@featherk/composables 0.13.6 → 0.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"featherk-composables.umd.js","sources":["../src/grid/useGridA11y.ts","../src/grid/useGridActiveFilter.ts","../src/grid/useGridRowAction.ts","../src/address/useZipTextBox.ts","../src/form/useFieldsetTouchTracker.ts","../src/form/useFieldsetValidationKit.ts","../src/address/usStates.ts","../src/address/_useUSAddressFormData.ts","../src/address/_useUSAddressZip.ts","../src/address/_useUSAddressValidation.ts","../src/address/useUSAddress.ts","../src/geometry/computeCollisionOffset.ts","../src/id/useCompositeId.ts","../../../node_modules/@vueuse/shared/dist/index.js","../../../node_modules/@vueuse/core/dist/index.js","../src/observer/useIntersectionObserver.ts","../src/menu/usePopupMenu.ts","../src/registry/useExclusiveGroup.ts","../src/registry/useActiveIdRegistry.ts","../src/window/useWindow.ts","../src/date/useMaskedDateInput.ts","../src/range/useMaskedDateRangeInput.ts","../src/time/useMaskedTimeInput.ts","../src/trap/usePopupTrap.ts"],"sourcesContent":["/**\n * useGridA11y\n *\n * Composable that augments a Kendo-based grid with accessible keyboard navigation,\n * focus management, and custom behaviors for column header menus (filter/sort).\n */\n\nimport { ref, nextTick, onBeforeUnmount, type Ref } from \"vue\";\nimport type {\n SortDescriptor,\n GridColumnProps,\n GridSortChangeEvent,\n} from \"../types/kendo\";\n\nexport const useGridA11y = (\n gridRef: Ref<any>,\n options?: { focusableMenuSelectors?: string[] },\n) => {\n // Reference to the active filter button for focus management\n const activeFilterButton = ref<HTMLElement | null>(null);\n\n let a11yInitialized = false;\n\n // Mutation observer for dynamic elements\n let mutationsObserver: MutationObserver | null = null;\n\n // Observer to watch row changes within this grid instance so we can reassert tabindex\n let rowObserver: MutationObserver | null = null;\n\n const headerThTeardownCallbacks: Array<() => void> = [];\n\n const intraRowNavigationSelector =\n \".k-table-row[data-grid-row-index] [tabindex]\";\n\n const getGridRootElement = (): HTMLElement | null => {\n const host = gridRef?.value?.$el as HTMLElement | undefined;\n if (!host) return null;\n return host.closest(\".k-grid\") as HTMLElement | null;\n };\n\n const isWithinThisGridScope = (target: HTMLElement): boolean => {\n const gridRoot = getGridRootElement();\n if (!gridRoot) return false;\n\n // Preferred scope: Kendo's grid accessibility region.\n const ariaRoot = target.closest(\".k-grid-aria-root\") as HTMLElement | null;\n if (ariaRoot) {\n return gridRoot.contains(ariaRoot);\n }\n\n // Fallback for markup/theme variance across versions.\n const fallbackScope = target.closest(\n \".k-grid-header, .k-grid-content, .k-grid-content-locked\",\n ) as HTMLElement | null;\n return fallbackScope ? gridRoot.contains(fallbackScope) : false;\n };\n\n const isEnterActivation = (event: KeyboardEvent) => {\n return (\n event.key === \"Enter\" ||\n event.code === \"Enter\" ||\n event.code === \"NumpadEnter\"\n );\n };\n\n // Helper to get columns from gridRef\n const getColumns = () => {\n return (gridRef?.value as any)?.columns as Array<GridColumnProps>;\n };\n\n /**\n * Key activation handler for a header's column menu / filter button.\n *\n * Purpose:\n * - Enables keyboard users (Space / Enter) to open the Kendo column menu without\n * triggering unintended default behaviors (like sorting) that Kendo may bind\n * to key events on header elements.\n *\n * Behavior:\n * - Intercepts Space / Enter (including legacy \"Spacebar\") keys.\n * - Prevents default and stops propagation to suppress native scrolling or\n * upstream sort handlers.\n * - Records the event target in `activeFilterButton` so focus can be restored\n * after the menu closes (Escape handling in other logic).\n * - Programmatically clicks the target to open the column menu.\n *\n * Accessibility:\n * - Treats the underlying element as a button activation; complements ARIA\n * role=\"button\" applied elsewhere.\n *\n * Idempotency / Safety:\n * - Safe to attach to multiple buttons; only responds to specified keys.\n *\n * @param event KeyboardEvent originating on the column menu trigger.\n * @returns void\n */\n const handleFilterButtonKeyboardListener = (event: KeyboardEvent) => {\n const key = event.key || event.code;\n if ([\" \", \"Spacebar\", \"Space\"].includes(key) || isEnterActivation(event)) {\n // Prevents the unintended default sorting on keyboard event\n event.preventDefault();\n event.stopPropagation();\n\n // Store reference to the filter button when it is activated\n activeFilterButton.value = event.target as HTMLElement;\n\n // Trigger the click event on the filter button\n (event.target as HTMLElement).click();\n }\n };\n\n /**\n * Keyboard interaction handler for an open Kendo Grid column menu (filter / sort menu).\n *\n * Scope:\n * - Attached to each popup (\".k-animation-container\") when it appears.\n * - Handles navigation inside two possible UI states:\n * 1. Column menu list (\".k-columnmenu-item\") items.\n * 2. Filter form container (\".k-filter-menu-container\") with inputs/buttons.\n *\n * Keys:\n * - Escape:\n * * Closes semantic focus context by returning focus to `activeFilterButton`\n * (the header or trigger element that opened the menu) and exits.\n * - ArrowUp / ArrowDown (only when NOT in a filter form container):\n * * Cycles focus among menu items (wraps at ends).\n * - Tab within filter form container:\n * * Traps focus inside the filter form’s focusable elements; Shift+Tab reverses.\n * - Tab when not in a filter form container:\n * * Cycles focus among sibling trigger buttons adjacent to the originating header\n * (previousElementSibling / nextElementSibling of the active trigger).\n *\n * Focus Model:\n * - Relies on `activeFilterButton` (external ref) to restore focus after Escape or\n * to traverse sibling triggers on plain Tab outside a filter form.\n *\n * Guard Clauses:\n * - Returns immediately if no `activeFilterButton` is set (defensive).\n *\n * Assumptions:\n * - Menu markup follows Kendo’s structure with \".k-animation-container\" wrapper.\n * - Filter form presence is detectable via \".k-filter-menu-container\".\n * - Menu action items carry class \".k-columnmenu-item\".\n *\n * Side Effects:\n * - Calls focus() on controlled elements.\n * - Prevents default + stops propagation for handled keys to avoid native browser\n * tab order / scroll interference or Kendo’s default key handling.\n *\n * @param event KeyboardEvent dispatched on the popup container.\n * @returns void\n */\n const handleFilterMenuKeyboardListener = (event: KeyboardEvent) => {\n if (!activeFilterButton.value) return;\n if (event.code === \"Escape\") {\n event.stopPropagation();\n\n if (activeFilterButton.value) {\n activeFilterButton.value.focus();\n }\n return;\n }\n\n const menuItems = Array.from(\n document.querySelectorAll(\n \".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item\",\n ),\n ) as HTMLElement[];\n\n const filterContainer = document.querySelector(\n \".k-animation-container .k-popup .k-column-menu .k-filter-menu-container\",\n );\n\n if (filterContainer) {\n if (event.code === \"Tab\") {\n const defaultFocusable = [\n // \".k-filter-menu-container .k-dropdownlist[tabindex='0']\",\n // \".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])\",\n // \".k-filter-menu-container button:not([tabindex='-1']):not([disabled])\",\n // \".k-checkbox\",\n \".k-dropdownlist[tabindex='0']\",\n \"input.k-input-inner:not([tabindex='-1']):not([disabled])\",\n \"button:not([tabindex='-1']):not([disabled])\",\n \".k-checkbox\",\n ];\n const focusableSelectors =\n options?.focusableMenuSelectors ?? defaultFocusable;\n const focusableElements = Array.from(\n filterContainer.querySelectorAll(focusableSelectors.join(\",\")),\n ) as HTMLElement[];\n\n if (focusableElements.length === 0) return;\n\n const focusedIndex = focusableElements.findIndex(\n (el) => el === document.activeElement,\n );\n let targetIndex: number;\n if (focusedIndex === -1) {\n targetIndex = 0;\n } else if (event.shiftKey) {\n targetIndex =\n (focusedIndex - 1 + focusableElements.length) %\n focusableElements.length;\n } else {\n targetIndex = (focusedIndex + 1) % focusableElements.length;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n focusableElements[targetIndex]?.focus();\n }\n } else {\n if (event.code === \"ArrowUp\" || event.code === \"ArrowDown\") {\n event.preventDefault();\n event.stopPropagation();\n\n const focusedIndex = menuItems.findIndex(\n (item) => item === document.activeElement,\n );\n\n let targetIndex = focusedIndex;\n if (event.code === \"ArrowUp\") {\n targetIndex =\n focusedIndex > 0 ? focusedIndex - 1 : menuItems.length - 1;\n } else if (event.code === \"ArrowDown\") {\n targetIndex =\n focusedIndex < menuItems.length - 1 ? focusedIndex + 1 : 0;\n }\n\n menuItems[targetIndex]?.focus();\n return;\n }\n }\n\n if (event.code === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n\n const currentTh = activeFilterButton.value?.parentElement;\n const targetTh = event.shiftKey\n ? currentTh?.previousElementSibling\n : currentTh?.nextElementSibling;\n const targetButton = targetTh?.querySelector(\n \"button, [role='button'], .k-link\",\n ) as HTMLElement;\n\n targetButton?.focus();\n }\n };\n\n /**\n * Observes the document body for Kendo Grid column menu (filter/sort menu) lifecycle.\n *\n * Responsibilities:\n * - Creates a MutationObserver watching document.body (childList + subtree) for nodes\n * with class \"k-animation-container\" (the popup wrapper Kendo inserts/ removes).\n * - For each added animation container:\n * * If the active header is NOT sortable (data-feather-k-sortable=\"false\"), removes\n * any menu wrapper whose text content includes \"sort\" (case-insensitive) to hide\n * irrelevant sort options from the popup UI.\n * * Attaches a keydown listener (handleFilterMenuKeyboardListener) to enable:\n * - ArrowUp / ArrowDown navigation through menu items\n * - Tab trapping / cycling in filter form content\n * - Escape to return focus to the triggering header/filter button\n * * Uses a retry loop (nextTick + setTimeout) to auto-focus & auto-activate a lone\n * menu item (common when only \"Filter\" is present) improving keyboard efficiency.\n * - For each removed animation container (and any nested ones), detaches the keydown listener.\n *\n * Behavior Notes:\n * - Sort option pruning only occurs when the triggering column is not sortable. The sortable\n * state is inferred from data attribute: data-feather-k-sortable === \"true\".\n * - Active trigger element is read from activeFilterButton ref.\n * - Focus restoration after Escape is handled inside handleFilterMenuKeyboardListener.\n *\n * Idempotency:\n * - Calling multiple times replaces the prior MutationObserver reference (without an\n * explicit disconnect first). Current usage calls it once during initA11y(). If future\n * calls are needed, consider disconnecting mutationsObserver beforehand to avoid\n * duplicate observers.\n *\n * Cleanup:\n * - Observer and event listeners are disconnected/removed by cleanupFilterButtonAccessibility().\n *\n * Side Effects:\n * - Mutates DOM (removal of unwanted sort menu items).\n * - Registers global (document-level subtree) MutationObserver.\n * - Adds / removes keydown event listeners on popup containers.\n *\n * Preconditions:\n * - document.body is available (browser environment).\n * - activeFilterButton may reference the header/filter button that opened the menu.\n *\n * @returns void\n */\n const setupFilterMenuObserver = () => {\n mutationsObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n if (element.classList.contains(\"k-animation-container\")) {\n const column = activeFilterButton.value as HTMLElement;\n if (column) {\n const sortable = column.dataset.featherKSortable === \"true\";\n if (!sortable) {\n nextTick(() => {\n const wrappers = element.querySelectorAll(\n \".k-columnmenu-item-wrapper\",\n );\n wrappers.forEach((wrapper) => {\n const sortMenu = wrapper.textContent\n ?.toLowerCase()\n .includes(\"sort\");\n if (sortMenu) {\n wrapper.remove();\n }\n });\n });\n }\n }\n element.addEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n nextTick(() => {\n const tryFocusMenuItem = () => {\n const menuItems = Array.from(\n element.querySelectorAll(\n \".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item\",\n ),\n ) as HTMLElement[];\n\n if (menuItems.length === 1) {\n menuItems[0].focus();\n menuItems[0].click();\n (tryFocusMenuItem as any).attempts = 0; // reset attempts\n } else if (menuItems.length > 1) {\n (tryFocusMenuItem as any).attempts = 0; // reset attempts\n return;\n } else {\n if ((tryFocusMenuItem as any).attempts === undefined)\n (tryFocusMenuItem as any).attempts = 0;\n if ((tryFocusMenuItem as any).attempts++ < 3) {\n setTimeout(tryFocusMenuItem, 200);\n }\n }\n };\n tryFocusMenuItem();\n });\n }\n\n const animationContainers = element.querySelectorAll(\n \".k-animation-container\",\n );\n animationContainers.forEach((container) => {\n (container as HTMLElement).addEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n });\n }\n });\n\n mutation.removedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains(\"k-animation-container\")) {\n element.removeEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n }\n\n const animationContainers = element.querySelectorAll(\n \".k-animation-container\",\n );\n animationContainers.forEach((container) => {\n (container as HTMLElement).removeEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n });\n }\n });\n });\n });\n\n mutationsObserver.observe(document.body, {\n childList: true,\n subtree: true,\n });\n };\n\n /**\n * Detects if an element is a form control or inside a form-like component.\n *\n * Purpose:\n * - Allows grid keyboard navigation to skip form controls, letting them handle\n * their own keyboard events naturally (e.g., cursor movement in inputs, spinners).\n *\n * Behavior:\n * - Returns true if the element itself is an input, textarea, select, or button.\n * - Returns true if the element is inside a Kendo form component:\n * * .k-picker-wrap (DatePicker, TimePicker, etc.)\n * * .k-input-inner (MaskedTextBox, TextBox, etc.)\n * * .k-textbox (generic Kendo textbox wrapper)\n * * [role=\"combobox\"] (dropdown, autocomplete, etc.)\n * - Returns false otherwise.\n *\n * @param el HTMLElement to check\n * @returns true if el is a form control that should manage its own keyboard events\n */\n const isFormControl = (el: HTMLElement): boolean => {\n const tagName = el.tagName.toLowerCase();\n\n // Check if element itself is a native form control\n if ([\"input\", \"textarea\", \"select\", \"button\"].includes(tagName)) {\n return true;\n }\n\n // Check if element is inside a Kendo form component wrapper\n if (\n el.closest(\n '.k-picker-wrap, .k-input-inner, .k-textbox, [role=\"combobox\"]',\n )\n ) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Keyboard handler for the Grid root element (bind to @keydown on <Grid>).\n *\n * Responsibilities:\n * - ArrowUp / ArrowDown: Move focus (and tabindex=\"0\") between sibling data rows\n * (.k-table-row[data-grid-row-index]).\n * - ArrowLeft / ArrowRight: When focus is on (or within) a data row, cycle focus\n * among tabbable descendants inside that row (as defined by\n * `intraRowNavigationSelector`). If the row itself has focus and no descendant\n * is focused, ArrowRight focuses the first intra-row tabbable element.\n * - Escape: If focus is currently inside a data row descendant, collapse focus\n * back to the parent row element (ensuring it has tabindex=\"0\").\n * - Enter / Space: Reserved for future enhancements and prevented when part of\n * the core navigation key group to avoid unintended native behaviors.\n *\n * Special Cases:\n * - If the event target is a grid column menu button (identified by both\n * \"k-grid-header-menu\" and \"k-grid-column-menu\" classes), the handler stores\n * it in `activeFilterButton` and returns so menu logic can proceed elsewhere.\n * - If the event target is a form control (input, button, Kendo component, etc.),\n * the handler exits early to allow the form control to manage its own keyboard\n * events naturally.\n *\n * Side Effects:\n * - Mutates tabindex attributes on row elements to maintain exactly one row\n * with tabindex=\"0\" in the vertical navigation path.\n * - Calls focus() on target rows or intra-row elements as navigation occurs.\n *\n * Defensive Checks:\n * - Exits early if the event object, its type, or target is missing.\n * - Exits early if target is a form control (via isFormControl).\n *\n * Assumptions:\n * - `gridRef.value.$el` is the Grid root (or inside it) and queryable.\n * - Data rows use the selector \".k-table-row[data-grid-row-index]\".\n *\n * @param e KeyboardEvent from the Grid's @keydown binding.\n * @returns void\n */\n const handleGridKeyDown = (e: KeyboardEvent) => {\n if (!e.type) return;\n\n if (!e) {\n return;\n }\n const target = e.target as HTMLElement;\n if (!target) return;\n\n const row = target.closest(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement | null;\n\n // Scope keyboard handling to this grid instance's a11y/content region.\n // This prevents toolbar and external controls from being intercepted.\n if (!isWithinThisGridScope(target)) {\n return;\n }\n\n // EXIT EARLY: Don't apply grid navigation to form controls.\n // Exception: allow ArrowLeft/ArrowRight intra-row navigation for focusable\n // controls that live inside a data row.\n const isIntraRowHorizontalNavKey = [\"ArrowLeft\", \"ArrowRight\"].includes(\n e.code,\n );\n if (isFormControl(target) && !(row && isIntraRowHorizontalNavKey)) {\n return;\n }\n\n // If Escape pressed and the active element is inside a data row,\n // move focus to the parent .k-table-row and ensure its tabindex=0.\n if (e.code === \"Escape\") {\n const focusedRow = (\n document.activeElement as HTMLElement | null\n )?.closest(\".k-table-row[data-grid-row-index]\") as HTMLElement | null;\n if (focusedRow) {\n // Justified: We're handling Escape to collapse focus from descendant to row.\n // Prevent default to override native browser behavior (dialog close, etc.)\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this Escape.\n e.stopPropagation();\n try {\n const rows = Array.from(\n gridRef?.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n rows.forEach((r) => r.setAttribute(\"tabindex\", \"-1\"));\n } catch {\n // ignore if gridRef not available\n }\n focusedRow.setAttribute(\"tabindex\", \"0\");\n focusedRow.focus();\n return;\n }\n }\n\n // Handle navigation keys (only prevent/stop for keys we actually handle)\n if (\n [\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"Enter\",\n \"NumpadEnter\",\n \"Space\",\n ].includes(e.code)\n ) {\n // Check if target is a grid column menu button\n if (\n target.classList.contains(\"k-grid-header-menu\") &&\n target.classList.contains(\"k-grid-column-menu\")\n ) {\n activeFilterButton.value = target as HTMLElement;\n // Let menu logic proceed elsewhere; don't prevent or stop\n return;\n }\n\n // If event came from within a data row, handle row/intra-row navigation\n if (row) {\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n // Justified: We're handling ArrowUp/Down for vertical row navigation.\n // Prevent default to override native browser scrolling behavior.\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this.\n e.stopPropagation();\n\n // Find the next/previous element sibling that actually has a tabindex.\n const findSiblingRow = (\n start: Element,\n direction: \"next\" | \"previous\",\n ): HTMLElement | null => {\n let sib =\n direction === \"next\"\n ? start.nextElementSibling\n : start.previousElementSibling;\n while (sib) {\n const el = sib as HTMLElement;\n try {\n if (el.classList.contains(\"k-table-row\")) {\n return el;\n }\n } catch {\n // Defensive: some nodes might throw when accessed; skip them.\n }\n sib =\n direction === \"next\"\n ? sib.nextElementSibling\n : sib.previousElementSibling;\n }\n return null;\n };\n\n const targetRow =\n e.code === \"ArrowDown\"\n ? findSiblingRow(row, \"next\")\n : findSiblingRow(row, \"previous\");\n\n if (targetRow) {\n row.setAttribute(\"tabindex\", \"-1\");\n targetRow.setAttribute(\"tabindex\", \"0\");\n targetRow.focus();\n }\n return;\n }\n if ([\"ArrowLeft\", \"ArrowRight\"].includes(e.code)) {\n // Justified: We're handling ArrowLeft/Right for intra-row focus navigation.\n // Prevent default to override native text cursor movement only when we handle the event.\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this.\n e.stopPropagation();\n\n const tabbable = row.querySelectorAll(\n intraRowNavigationSelector,\n ) as NodeListOf<HTMLElement>;\n if (tabbable.length === 0) return;\n\n // Find currently focused element within the row\n let currentIndex = Array.from(tabbable).findIndex(\n (el) => el === document.activeElement,\n );\n\n if (currentIndex === -1 && document.activeElement === row) {\n // If no element is focused, focus the first tabbable element\n (tabbable[0] as HTMLElement).focus();\n return;\n }\n\n if (e.code === \"ArrowRight\") {\n currentIndex =\n currentIndex === tabbable.length - 1 ? 0 : currentIndex + 1;\n } else if (e.code === \"ArrowLeft\") {\n currentIndex =\n currentIndex === 0 ? tabbable.length - 1 : currentIndex - 1;\n }\n (tabbable[currentIndex] as HTMLElement).focus();\n\n return;\n }\n }\n\n // Enter, Space: Not currently handled for grid navigation.\n // Don't prevent by default to allow native behavior or other handlers to respond.\n }\n };\n\n /**\n * Applies a FeatherK-specific CSS hook class to the Kendo Grid root element.\n *\n * Behavior:\n * - On the next Vue microtask (nextTick), locates the closest ancestor with the\n * \".k-grid\" class starting from `gridRef.value.$el`.\n * - Adds the \"fk-grid\" class to that element (no-op if already present).\n *\n * Purpose:\n * - Provides a styling hook so external FeatherK stylesheets can target grids\n * that have been enhanced by this composable without relying on brittle\n * selectors or global overrides.\n *\n * Safety / Idempotency:\n * - Safe to call multiple times; subsequent calls simply re-add the same class.\n * - Silently does nothing if `gridRef.value` or its `$el` is not yet available.\n *\n * Side Effects:\n * - Mutates the DOM by adding a CSS class to the grid root element.\n *\n * No cleanup is currently required (class need not be removed on unmount).\n *\n * @returns void\n */\n const setupGridStyling = () => {\n nextTick(() => {\n const gridHost = gridRef.value?.$el as Element | undefined;\n if (!gridHost || typeof gridHost.closest !== \"function\") return;\n\n const gridElement = gridHost.closest(\".k-grid\") as HTMLElement | null;\n if (gridElement) gridElement.classList.add(\"fk-grid\");\n });\n };\n\n /**\n * Sets up row-level (tr) keyboard navigation for the Kendo Grid instance.\n *\n * Behavior:\n * 1. Ensures exactly one data row ('.k-table-row[data-grid-row-index]') has tabindex=\"0\"\n * (the current keyboard focus target) and all others have tabindex=\"-1\".\n * 2. Establishes an internal helper (ensureSingleTabindex) that:\n * - Re-calculates which row should retain tabindex=\"0\" after DOM changes.\n * - Preserves a focused row if its descendants currently contain focus.\n * - Falls back to the first row when no focused row exists.\n * 3. Applies initial tabindex values immediately (first row gets focusable state).\n * 4. Observes the grid <tbody> ('.k-table-tbody') with a MutationObserver so that when\n * Kendo re-renders rows (sorting, filtering, paging, data updates), tabindex\n * constraints are re-applied with minimal work.\n *\n * Rationale:\n * The default Kendo Grid may introduce multiple tabbable descendants, making\n * keyboard traversal verbose. Restricting tab stops to a single row improves\n * accessibility by:\n * - Reducing unnecessary Tab presses.\n * - Enabling arrow-key driven intra-row navigation (handled elsewhere).\n *\n * Assumptions / Dependencies:\n * - gridRef.value.$el points to (or is inside) a rendered Kendo Grid root.\n * - Data rows carry class 'k-table-row' and attribute 'data-grid-row-index'.\n * - Runs in a browser environment (document, MutationObserver available).\n *\n * Error Handling:\n * - Wrapped in try/catch; failures are logged and do not throw upstream.\n *\n * Idempotency:\n * - Safe to call more than once; repeated calls will attach at most one observer\n * per invocation lifecycle (previous observer persists). Caller is expected\n * to avoid redundant calls or add future cleanup if needed.\n *\n * Side Effects:\n * - Mutates DOM attributes (tabindex) of grid row elements.\n * - Creates a MutationObserver stored in the closure (rowObserver) for teardown\n * via cleanupFilterButtonAccessibility().\n *\n * @returns void\n */\n const setupTrNavigation = () => {\n if (rowObserver) {\n // Already set up\n return;\n }\n try {\n /**\n * Ensure exactly one grid row is keyboard-focusable (tabindex=\"0\") and make all others unfocusable (tabindex=\"-1\").\n *\n * This function:\n * - Queries the grid DOM for rows using the selector \".k-table-row[data-grid-row-index]\".\n * - If no rows are found, it returns immediately.\n * - If exactly one row already has tabindex=\"0\", it does nothing.\n * - Otherwise it clears tabindex to \"-1\" on all matched rows, then:\n * - If the currently focused element is inside one of the matched rows, that row is preserved as tabindex=\"0\".\n * - If there is no such focused row, the first matched row is set to tabindex=\"0\".\n *\n * Notes:\n * - The function mutates DOM attributes (tabindex) of the matched row elements.\n * - It expects to run in a browser environment where `document.activeElement` is available and where\n * `gridRef.value.$el` points to the grid root element containing rows matching the selector.\n * - Any runtime errors encountered while querying or updating the DOM are caught and logged via console.error;\n * the function will not throw.\n *\n * @remarks\n * Use this helper to maintain a single tabbable row for keyboard navigation / accessibility purposes within a custom grid component.\n *\n * @returns void\n *\n * @example\n * // Keep one tabbable row in the grid after rendering or when rows change\n * ensureSingleTabindex();\n */\n const ensureSingleTabindex = () => {\n try {\n const rows = Array.from(\n gridRef.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n\n if (!rows || rows.length === 0) return;\n\n // Count rows that currently have tabindex=\"0\"\n const zeroTabRows = rows.filter(\n (r) => r.getAttribute(\"tabindex\") === \"0\",\n );\n\n // If exactly one row already has tabindex=0, nothing to do\n if (zeroTabRows.length === 1) return;\n\n // Prefer to preserve the currently focused row if it's inside the rows\n const focusedRow = rows.find(\n (r) =>\n r === document.activeElement ||\n r.contains(document.activeElement),\n );\n\n // Clear all to -1\n rows.forEach((r) => r.setAttribute(\"tabindex\", \"-1\"));\n\n if (focusedRow) {\n focusedRow.setAttribute(\"tabindex\", \"0\");\n return;\n }\n\n // Fallback: set first row to tabindex=0\n rows[0].setAttribute(\"tabindex\", \"0\");\n } catch (err) {\n console.error(\"ensureSingleTabindex error:\", err);\n }\n };\n\n // Initial setup\n const rows = Array.from(\n gridRef.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n if (rows.length > 0) {\n rows.forEach((row, index) => {\n row.setAttribute(\"tabindex\", index === 0 ? \"0\" : \"-1\");\n });\n }\n\n // Observe tbody for row changes (Kendo will recreate rows on sort/filter/paging)\n const tbody = gridRef.value.$el.querySelector(\".k-table-tbody\");\n if (tbody) {\n rowObserver = new MutationObserver(() => {\n // Reassert single tabindex after DOM changes. Keep work minimal.\n ensureSingleTabindex();\n });\n rowObserver.observe(tbody, { childList: true, subtree: true });\n }\n } catch (error) {\n console.error(\"Error setting up row navigation:\", error);\n }\n };\n\n /**\n * Initializes accessibility behavior for grid filter buttons.\n *\n * - Queries the DOM for elements matching the selector\n * \".k-grid-header .k-grid-header-menu.k-grid-column-menu\".\n * - For each matched element, sets the ARIA role to \"button\" and attaches a\n * keydown event listener using handleFilterButtonKeyboardListener.\n * - Invokes setupFilterMenuObserver() to observe changes to filter menus.\n * - Invokes setupHeaderThTriggers() to initialize any header-related triggers.\n *\n * @returns void\n */\n const setupFilterButtonAccessibility = () => {\n nextTick(() => {\n const filterSelector =\n \".k-grid-header .k-grid-header-menu.k-grid-column-menu\";\n const filterButtons = document.querySelectorAll(filterSelector);\n if (filterButtons) {\n filterButtons.forEach((el) => {\n el.setAttribute(\"role\", \"button\");\n (el as HTMLElement).addEventListener(\n \"keydown\",\n handleFilterButtonKeyboardListener,\n );\n });\n }\n\n setupFilterMenuObserver();\n\n setupHeaderThTriggers();\n });\n };\n\n /**\n * Cleans up all accessibility (a11y) resources installed by useGridA11y.\n *\n * Includes:\n * - Removes keydown listeners from column menu / filter buttons.\n * - Disconnects the column menu MutationObserver.\n * - Disconnects the row MutationObserver.\n * - Executes and clears header <th> teardown callbacks.\n *\n * Idempotent: safe to call multiple times.\n */\n const cleanupGridA11y = () => {\n const filterSelector =\n \".k-grid-header .k-grid-header-menu.k-grid-column-menu\";\n const filterButtons = document.querySelectorAll(filterSelector);\n if (filterButtons) {\n filterButtons.forEach((el) => {\n (el as HTMLElement).removeEventListener(\n \"keydown\",\n handleFilterButtonKeyboardListener,\n );\n });\n }\n\n if (mutationsObserver) {\n mutationsObserver.disconnect();\n mutationsObserver = null;\n }\n\n if (rowObserver) {\n rowObserver.disconnect();\n rowObserver = null;\n }\n\n headerThTeardownCallbacks.forEach((teardown) => teardown());\n headerThTeardownCallbacks.length = 0;\n };\n\n /**\n * Initializes accessible interaction handlers for header <th> cells in a Kendo-style grid.\n *\n * Finds all header cells under \".k-grid-header .k-table-thead th\" and for each header cell:\n * - Locates the column menu button (\".k-grid-header-menu.k-grid-column-menu\") and sets its tabindex to -1.\n * - Reads column metadata from getColumns() (external dependency) to set data attributes:\n * - data-feather-k-field (column.field)\n * - data-feather-k-filterable (\"false\" if column.filterable === false, otherwise \"true\")\n * - data-feather-k-sortable (\"false\" if column.sortable === false, otherwise \"true\")\n * - Determines whether the header is filterable or sortable using the above data attributes.\n * - Sets appropriate cursor styles (pointer for interactive headers, default otherwise).\n * - Configures ARIA/sniffable roles:\n * - If filterable: tabindex=\"0\", role=\"button\", aria-haspopup=\"menu\"\n * - If not filterable: tabindex=\"0\", role=\"columnheader\", aria-haspopup is removed\n *\n * Adds event handlers for each header cell:\n * - click handler:\n * - If filterable: prevents default/propagation and opens the column menu (via the menu button click). Also records the header element on activeFilterButton (external ref) for focus return.\n * - If not filterable but sortable: synthesizes an \"Enter\" KeyboardEvent and dispatches it on the header to trigger sort behavior and records activeFilterButton.\n * - Clicks originating from a column resizer (closest \".k-column-resizer\") are ignored.\n * - keydown handler (registered in capture phase for the header cell):\n * - On Enter or Space when filterable or sortable:\n * - Sets activeFilterButton to the header and focuses it.\n * - If filterable: prevents default/propagation and opens the column menu.\n * - If sortable: clicks the first \".k-link\" inside the header to trigger sort.\n *\n * Additionally, attaches a capturing keydown handler to the enclosing THEAD element (\".k-grid-header .k-table-thead\"):\n * - Prevents default/immediate propagation for Enter/Space on headers that are neither filterable nor sortable.\n * - This protects non-interactive header cells from activating default keyboard behavior.\n *\n * All event listeners added by this setup are recorded as teardown callbacks into the\n * headerThTeardownCallbacks array (external), so they can be removed later to avoid leaks.\n *\n * Notes / assumptions:\n * - Relies on globals/closures: document, getColumns(), activeFilterButton (ref-like object), and headerThTeardownCallbacks (array).\n * - Intended to enhance accessibility and keyboard interaction for grid headers by mapping Kendo column behaviors\n * to appropriate ARIA roles, keyboard handling, and focus management.\n *\n * @remarks\n * - Does not return a value; side effects are applied directly to DOM and external state.\n * - Uses attribute-based decisions to maintain compatibility with dynamically-updated column metadata.\n *\n * @returns void\n */\n const setupHeaderThTriggers = () => {\n const headerCells = document.querySelectorAll(\n \".k-grid-header .k-table-thead th\",\n );\n\n headerCells.forEach((th, index) => {\n if ((th as HTMLElement).dataset.featherKHeaderBound === \"true\") {\n return;\n }\n\n const btn = th.querySelector(\n \".k-grid-header-menu.k-grid-column-menu\",\n ) as HTMLElement | null;\n if (!btn) return;\n\n const columns = getColumns();\n\n if (columns && columns[index]) {\n const field = columns[index].field ?? \"\";\n th.setAttribute(\"data-feather-k-field\", field);\n th.setAttribute(\n \"data-feather-k-filterable\",\n columns[index].filterable === false ? \"false\" : \"true\",\n );\n th.setAttribute(\n \"data-feather-k-sortable\",\n columns[index].sortable === false ? \"false\" : \"true\",\n );\n }\n\n const filterable =\n (th as HTMLElement).dataset.featherKFilterable !== \"false\";\n const sortable = (th as HTMLElement).dataset.featherKSortable !== \"false\";\n\n btn.setAttribute(\"tabindex\", \"-1\");\n\n if (filterable || sortable) {\n (th as HTMLElement).style.cursor = \"pointer\";\n } else {\n (th as HTMLElement).style.cursor = \"default\";\n }\n if (filterable) {\n th.setAttribute(\"tabindex\", \"0\");\n th.setAttribute(\"role\", \"button\");\n th.setAttribute(\"aria-haspopup\", \"menu\");\n } else {\n th.setAttribute(\"tabindex\", \"0\");\n th.setAttribute(\"role\", \"columnheader\");\n th.removeAttribute(\"aria-haspopup\");\n }\n const openMenu = (e: Event | KeyboardEvent) => {\n if ((e.target as HTMLElement)?.closest(\".k-column-resizer\")) return;\n\n activeFilterButton.value = th as HTMLElement; // focus return target\n btn.click();\n };\n\n const clickHandler = (e: Event) => {\n if (filterable) {\n activeFilterButton.value = th as HTMLElement;\n e.preventDefault();\n e.stopPropagation();\n openMenu(e);\n } else if (sortable) {\n activeFilterButton.value = th as HTMLElement;\n const columnLink = th.querySelector(\".k-link\");\n if (columnLink) {\n (columnLink as HTMLElement).click();\n }\n }\n };\n (th as HTMLElement).addEventListener(\"click\", clickHandler);\n headerThTeardownCallbacks.push(() => {\n (th as HTMLElement).removeEventListener(\"click\", clickHandler);\n });\n\n // Keyboard activation for sortable/filterable header cells.\n //\n // Enter, Numpad Enter, and Space are intentionally handled identically here:\n // - preventDefault + stopPropagation are applied for ALL three keys so\n // none of them leak to native browser or Kendo's own key handlers,\n // which could trigger a duplicate or conflicting sort/scroll action.\n // - For sortable-only headers the sort is triggered by clicking the\n // .k-link element directly (the same path the browser follows on a\n // real mouse click and what Space was already using). This keeps\n // the asc → desc → unsorted cycle consistent regardless of key used.\n //\n // IMPORTANT: Do not restore the old synthetic KeyboardEvent dispatch\n // (th.dispatchEvent(new KeyboardEvent('keydown', { key:'Enter', ... }))).\n // That approach caused Enter/Numpad Enter to re-enter this handler\n // recursively and be silently swallowed by the isSorting guard in\n // ClaimLog.vue, making every press after the first appear to do nothing.\n const keyHandler = (e: KeyboardEvent) => {\n if (\n (isEnterActivation(e) || e.code === \"Space\") &&\n (filterable || sortable)\n ) {\n e.preventDefault();\n e.stopPropagation();\n\n activeFilterButton.value = th as HTMLElement;\n activeFilterButton.value.focus();\n if (filterable) {\n openMenu(e);\n } else if (sortable) {\n const columnLink = th.querySelector(\".k-link\");\n if (columnLink) {\n (columnLink as HTMLElement).click();\n }\n }\n }\n };\n (th as HTMLElement).addEventListener(\"keydown\", keyHandler, true);\n headerThTeardownCallbacks.push(() => {\n (th as HTMLElement).removeEventListener(\"keydown\", keyHandler, true);\n });\n\n (th as HTMLElement).dataset.featherKHeaderBound = \"true\";\n });\n\n const thead = document.querySelector(\".k-grid-header .k-table-thead\");\n if (\n thead &&\n (thead as HTMLElement).dataset.featherKHeaderBound !== \"true\"\n ) {\n const theadKeyboardHandler = (e: KeyboardEvent) => {\n const th = (e.target as HTMLElement).closest(\"th\");\n if (!th) return;\n if (\n (isEnterActivation(e) || e.code === \"Space\") &&\n th.dataset.featherKFilterable === \"false\" &&\n th.dataset.featherKSortable === \"false\"\n ) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n };\n (thead as HTMLElement).addEventListener(\n \"keydown\",\n theadKeyboardHandler,\n true, // NOTE: capture phase\n );\n headerThTeardownCallbacks.push(() => {\n (thead as HTMLElement).removeEventListener(\n \"keydown\",\n theadKeyboardHandler,\n true,\n );\n });\n\n (thead as HTMLElement).dataset.featherKHeaderBound = \"true\";\n }\n };\n\n /**\n * Handles grid sort change events with special-casing for column menu interactions and non-sortable columns.\n *\n * This function inspects the DOM target that triggered the sort change and the grid column metadata to\n * determine whether the default sort handling should proceed or be suppressed. It:\n * - Ignores events coming from the column menu toggle (element with class \"k-link\").\n * - When a column menu item (element with class \"k-columnmenu-item\") is selected for a non-sortable field,\n * prevents modifying the sort descriptors for that field.\n * - Otherwise, if a custom handler is provided, schedules focusing of the active filter button (if present)\n * on the next tick and then invokes the custom handler with the original event.\n *\n * @param event - Optional GridSortChangeEvent. The implementation expects a nested structure where\n * the originating HTMLElement is available at `event.event.event.target`, the field at\n * `event.event.field`, and the current sort descriptors at `event.event.sort`.\n * @param customHandler - Optional callback to be executed when the standard handling path is allowed.\n * The callback will be invoked inside `nextTick` after attempting to focus the\n * active filter button.\n * @returns void\n *\n * @remarks\n * - This function relies on `getColumns()` to obtain column metadata and on an `activeFilterButton` ref\n * to optionally restore focus. It performs early returns when the event target or columns are unavailable,\n * or when the column menu toggle was the source of the event.\n */\n const handleSortChange = function (\n event?: GridSortChangeEvent,\n customHandler?: any,\n ) {\n const target = event?.event?.event.target as HTMLElement;\n const columns = getColumns();\n if (!target || !columns) return;\n\n const menuOpened = target.classList.contains(\"k-grid-header-menu\");\n const menuItemSelected = target.classList.contains(\"k-columnmenu-item\");\n\n const fieldIsSortable =\n columns.find((c) => c.field === event?.event?.field)?.sortable && true;\n\n if (menuOpened) return;\n\n if (menuItemSelected && !fieldIsSortable) {\n const sortDescriptor = event?.event?.sort as SortDescriptor[];\n sortDescriptor?.filter(\n (s: SortDescriptor) => s.field !== event?.event?.field,\n );\n return;\n }\n if (typeof customHandler === \"function\") {\n nextTick(() => {\n if (activeFilterButton.value) activeFilterButton.value.focus();\n customHandler(event);\n // Kendo recreates header <th> nodes after each sort, which discards any\n // previously attached keydown listeners. Re-running setupHeaderThTriggers\n // here (after the sort data has been applied) reattaches those listeners\n // to the new nodes so subsequent Enter/Space presses continue to work.\n nextTick(() => {\n setupHeaderThTriggers();\n });\n });\n }\n };\n\n /**\n * Initialize accessibility (a11y) features for the grid.\n *\n * This function is idempotent — it will perform initialization only once.\n * On the first call it sets the internal `a11yInitialized` flag and runs\n * the following setup routines:\n * - setupGridStyling()\n * - setupTrNavigation()\n * - setupFilterButtonAccessibility()\n *\n * Subsequent calls do nothing.\n *\n * Use this during component setup/mount to ensure grid accessibility helpers\n * are registered exactly once.\n *\n * @returns void\n */\n const initA11y = () => {\n if (a11yInitialized) return;\n try {\n setupGridStyling();\n setupTrNavigation();\n setupFilterButtonAccessibility();\n a11yInitialized = true;\n } catch (err) {\n console.error(\"initA11y failed:\", err);\n // Clean up any partial listeners/observers so a retry can succeed.\n cleanupGridA11y();\n }\n };\n\n onBeforeUnmount(() => {\n cleanupGridA11y();\n });\n return {\n activeFilterButton,\n handleGridKeyDown,\n handleSortChange,\n initA11y,\n };\n};\n","import { type Ref } from \"vue\";\nimport type {\n CompositeFilterDescriptor,\n FilterDescriptor,\n} from \"@progress/kendo-data-query\";\n\n/**\n * Type guard for composite filter groups.\n */\nconst isCompositeFilter = (\n filterItem: unknown,\n): filterItem is CompositeFilterDescriptor => {\n return (\n !!filterItem &&\n typeof filterItem === \"object\" &&\n \"filters\" in filterItem &&\n Array.isArray((filterItem as CompositeFilterDescriptor).filters)\n );\n};\n\n/**\n * Type guard for leaf filter nodes.\n */\nconst isFilterDescriptor = (\n filterItem: unknown,\n): filterItem is FilterDescriptor => {\n return (\n !!filterItem && typeof filterItem === \"object\" && \"field\" in filterItem\n );\n};\n\n/**\n * Recursively checks whether a filter tree contains a filter for a specific field.\n */\nconst hasFieldFilterRecursive = (\n filterItem: unknown,\n field: string,\n): boolean => {\n if (!filterItem || typeof filterItem !== \"object\") {\n return false;\n }\n\n if (!isCompositeFilter(filterItem)) {\n if (!isFilterDescriptor(filterItem)) {\n return false;\n }\n return filterItem.field === field;\n }\n\n return filterItem.filters.some((child) =>\n hasFieldFilterRecursive(child, field),\n );\n};\n\n/**\n * Returns a reactive function that resolves to `\"active\"` when the given\n * field has a filter applied in the current filter tree, or `\"\"` when it\n * does not.\n *\n * Bind the returned function directly to column `headerClassName` inside a\n * `computed` — Vue tracks the `filterRef` dependency automatically; no\n * manual update call is needed.\n *\n * @param filterRef - Reactive grid filter descriptor (the same ref bound to the Grid).\n * @returns `(field: string) => \"active\" | \"\"`\n *\n * @example\n * const activeClass = useGridActiveFilter(filterRef);\n *\n * const columns = computed(() => [\n * { field: \"ProductName\", headerClassName: activeClass(\"ProductName\") },\n * ]);\n */\nexport const useGridActiveFilter = (\n filterRef: Ref<CompositeFilterDescriptor | undefined>,\n): ((field: string) => string) => {\n return (field: string): string => {\n if (!filterRef.value?.filters) return \"\";\n return filterRef.value.filters.some((f) =>\n hasFieldFilterRecursive(f, field),\n )\n ? \"active\"\n : \"\";\n };\n};\n","/**\n * useGridRowAction\n *\n * Composable that provides safe, accessible row click and keyboard activation\n * handlers for Kendo UI for Vue Grid instances.\n *\n * Highlights:\n * - Guards against triggers when clicking interactive elements (buttons, links, inputs, checkboxes).\n * - Suppresses activation when the user is highlighting/selecting text inside a cell.\n * - Restricts mouse actions to primary (left) click.\n * - Provides keyboard activation (Enter / Space) for focused grid rows.\n * - Action-agnostic: executes consumer-supplied `onRowAction` callback with `dataItem` and context.\n */\n\nimport type { Ref } from \"vue\";\nimport type { GridRowClickEvent } from \"../types/kendo\";\n\nexport interface RowActionCoordinates {\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n screenX: number;\n screenY: number;\n}\n\nexport interface RowActionContext<T = any> {\n /**\n * Data item associated with the activated row.\n */\n dataItem: T;\n /**\n * Row index if provided by Kendo event or row DOM attribute.\n */\n rowIndex?: number;\n /**\n * Field name if click originated on a specific column cell.\n */\n field?: string;\n /**\n * Original native browser event.\n */\n event: Event;\n /**\n * Interaction trigger type ('click' | 'keyboard').\n */\n triggerType: \"click\" | \"keyboard\";\n /**\n * Modifier key states during activation.\n */\n ctrlKey: boolean;\n shiftKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n /**\n * Pointer coordinates of the activation. Derived from the native mouse event\n * for clicks, or from the focused row's bounding box for keyboard activation.\n * `undefined` when neither source is available.\n */\n coordinates?: RowActionCoordinates;\n}\n\nexport interface UseGridRowActionOptions<T = any> {\n /**\n * Action callback invoked when a row is clicked or activated via keyboard.\n */\n onRowAction: (dataItem: T, context: RowActionContext<T>) => void;\n /**\n * Optional ref to Kendo Grid component instance or array/ref of data items.\n * Used to resolve the row `dataItem` when row is activated via grid-level `@keydown`.\n */\n gridRef?: Ref<any>;\n dataItems?: Ref<T[]> | T[];\n /**\n * Additional CSS selectors inside row cells that should prevent the row action.\n */\n ignoreSelectors?: string[];\n /**\n * Custom predicate function to check if an event target should be ignored.\n * Return `true` to ignore row action, `false` to proceed.\n */\n shouldIgnoreTarget?: (target: HTMLElement, event: Event) => boolean;\n /**\n * Whether to enable Enter/Space keyboard activation on focused grid rows.\n * Default: true\n */\n enableKeyboardAction?: boolean;\n}\n\nexport interface UseGridRowActionReturn<T = any> {\n /**\n * Grid row click handler to bind to Kendo Grid's `@rowclick` event.\n */\n handleRowClick: (event: GridRowClickEvent<T>) => void;\n /**\n * Grid keyboard handler to bind to Kendo Grid's `@keydown` event.\n * Optionally accepts explicit `dataItem` if bound at the row/slot level.\n */\n handleRowKeyDown: (event: KeyboardEvent, explicitDataItem?: T) => void;\n /**\n * Helper function to test if a given DOM element is an ignored target.\n */\n isIgnoredTarget: (target: HTMLElement, event?: Event) => boolean;\n}\n\nconst DEFAULT_IGNORE_SELECTORS = [\n \"button\",\n \"a\",\n \"input\",\n \"select\",\n \"textarea\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"link\"]',\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n \".k-checkbox\",\n \".k-button\",\n \".k-dropdown\",\n \".k-picker\",\n \".k-hierarchy-cell\",\n \".k-grid-header-menu\",\n \".k-column-menu\",\n];\n\nexport const useGridRowAction = <T = any>(\n options: UseGridRowActionOptions<T>,\n): UseGridRowActionReturn<T> => {\n const {\n onRowAction,\n gridRef,\n dataItems,\n ignoreSelectors = [],\n shouldIgnoreTarget,\n enableKeyboardAction = true,\n } = options;\n\n const combinedIgnoreSelectors = [\n ...DEFAULT_IGNORE_SELECTORS,\n ...ignoreSelectors,\n ];\n\n /**\n * Tests if an event target element or any of its parent elements match ignored selectors\n * or custom predicate filters.\n */\n const isIgnoredTarget = (target: HTMLElement, event?: Event): boolean => {\n if (!target) return false;\n\n // Check if element or ancestor matches any ignored selector\n const selectorString = combinedIgnoreSelectors.join(\",\");\n if (target.closest && target.closest(selectorString)) {\n return true;\n }\n\n // Check custom predicate if provided\n if (shouldIgnoreTarget && event) {\n return shouldIgnoreTarget(target, event);\n }\n\n return false;\n };\n\n /**\n * Reads the row index from the nearest data row element.\n */\n const resolveRowIndex = (target?: HTMLElement | null): number | undefined => {\n const rowEl = target?.closest?.(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement | null;\n const attr = rowEl?.getAttribute(\"data-grid-row-index\");\n if (attr === null || attr === undefined) return undefined;\n const parsed = parseInt(attr, 10);\n return Number.isNaN(parsed) ? undefined : parsed;\n };\n\n /**\n * Extracts pointer coordinates from a native mouse/pointer event.\n */\n const getEventCoordinates = (\n nativeEvent: any,\n ): RowActionCoordinates | undefined => {\n if (!nativeEvent || typeof nativeEvent.clientX !== \"number\") {\n return undefined;\n }\n const scrollX = typeof window !== \"undefined\" ? window.scrollX || 0 : 0;\n const scrollY = typeof window !== \"undefined\" ? window.scrollY || 0 : 0;\n const screenX = typeof window !== \"undefined\" ? window.screenX || 0 : 0;\n const screenY = typeof window !== \"undefined\" ? window.screenY || 0 : 0;\n return {\n clientX: nativeEvent.clientX,\n clientY: nativeEvent.clientY,\n pageX:\n typeof nativeEvent.pageX === \"number\"\n ? nativeEvent.pageX\n : nativeEvent.clientX + scrollX,\n pageY:\n typeof nativeEvent.pageY === \"number\"\n ? nativeEvent.pageY\n : nativeEvent.clientY + scrollY,\n screenX:\n typeof nativeEvent.screenX === \"number\"\n ? nativeEvent.screenX\n : nativeEvent.clientX + screenX,\n screenY:\n typeof nativeEvent.screenY === \"number\"\n ? nativeEvent.screenY\n : nativeEvent.clientY + screenY,\n };\n };\n\n /**\n * Derives coordinates from an element's bounding box (keyboard activation).\n */\n const getElementCoordinates = (\n element: HTMLElement | null,\n ): RowActionCoordinates | undefined => {\n if (!element || typeof element.getBoundingClientRect !== \"function\") {\n return undefined;\n }\n const rect = element.getBoundingClientRect();\n if (!rect) return undefined;\n const clientX = rect.left;\n const clientY = rect.bottom;\n const scrollX = typeof window !== \"undefined\" ? window.scrollX || 0 : 0;\n const scrollY = typeof window !== \"undefined\" ? window.scrollY || 0 : 0;\n return {\n clientX,\n clientY,\n pageX: clientX + scrollX,\n pageY: clientY + scrollY,\n screenX: clientX,\n screenY: clientY,\n };\n };\n\n /**\n * Checks if user currently has active text selected inside the target row or container.\n */\n const hasTextSelection = (target?: HTMLElement | null): boolean => {\n if (typeof window === \"undefined\") return false;\n const selection = window.getSelection();\n if (!selection || selection.isCollapsed || !selection.toString().trim()) {\n return false;\n }\n if (target && selection.anchorNode && selection.focusNode) {\n const container =\n target.closest(\".k-table-row\") || target.closest(\".k-grid\") || target;\n const anchorParent =\n selection.anchorNode.nodeType === Node.ELEMENT_NODE\n ? (selection.anchorNode as HTMLElement)\n : selection.anchorNode.parentElement;\n const focusParent =\n selection.focusNode.nodeType === Node.ELEMENT_NODE\n ? (selection.focusNode as HTMLElement)\n : selection.focusNode.parentElement;\n const isAnchorInside = !!(\n anchorParent && container.contains(anchorParent)\n );\n const isFocusInside = !!(focusParent && container.contains(focusParent));\n return isAnchorInside || isFocusInside;\n }\n return true;\n };\n\n /**\n * Primary handler for Kendo Grid `@rowclick` event.\n */\n const handleRowClick = (event: GridRowClickEvent<T>): void => {\n const nativeEvent =\n (event as any)?.htmlEvent ||\n (event as any)?.event ||\n (event as any)?.nativeEvent ||\n (event instanceof Event ? event : undefined);\n\n // Only allow primary (left) mouse clicks\n if (\n nativeEvent &&\n nativeEvent.button !== undefined &&\n nativeEvent.button !== 0\n ) {\n return;\n }\n\n // Guard against ignored child element targets\n const target = (nativeEvent?.target ||\n (event as any)?.target) as HTMLElement | null;\n if (\n target &&\n isIgnoredTarget(target, nativeEvent || (event as unknown as Event))\n ) {\n return;\n }\n\n // Guard against active text highlighting / selection within the row/grid\n if (hasTextSelection(target)) {\n return;\n }\n\n const context: RowActionContext<T> = {\n dataItem: event.dataItem,\n rowIndex: event.rowIndex ?? resolveRowIndex(target),\n field: event.field,\n event: nativeEvent || (event as unknown as Event),\n triggerType: \"click\",\n ctrlKey: !!nativeEvent?.ctrlKey,\n shiftKey: !!nativeEvent?.shiftKey,\n metaKey: !!nativeEvent?.metaKey,\n altKey: !!nativeEvent?.altKey,\n coordinates:\n getEventCoordinates(nativeEvent) ?? getElementCoordinates(target),\n };\n\n onRowAction(event.dataItem, context);\n };\n\n /**\n * Primary handler for Grid `@keydown` event (Enter / Space on row).\n */\n const handleRowKeyDown = (\n event: KeyboardEvent,\n explicitDataItem?: T,\n ): void => {\n if (!enableKeyboardAction) return;\n\n const key = event.key || event.code;\n const isActivationKey =\n key === \"Enter\" ||\n key === \"NumpadEnter\" ||\n key === \" \" ||\n key === \"Space\" ||\n event.code === \"Enter\" ||\n event.code === \"NumpadEnter\" ||\n event.code === \"Space\";\n\n if (!isActivationKey) return;\n\n const target = event.target as HTMLElement | null;\n if (!target) return;\n\n // Check if event target is inside a data row\n const rowEl = target.closest(\n \".k-table-row[data-grid-row-index], .k-table-row\",\n ) as HTMLElement | null;\n if (!rowEl) return;\n\n // Guard against ignored child element targets\n if (isIgnoredTarget(target, event)) {\n return;\n }\n\n // Prevent default scrolling or unintended form submissions on Space / Enter\n event.preventDefault();\n event.stopPropagation();\n\n // Resolve row index from DOM attribute if available\n const rowIndexAttr = rowEl.getAttribute(\"data-grid-row-index\");\n const rowIndex =\n rowIndexAttr !== null ? parseInt(rowIndexAttr, 10) : undefined;\n\n // Resolve data item: explicitDataItem -> dataItems option -> gridRef option\n let resolvedDataItem: T | undefined = explicitDataItem;\n\n if (resolvedDataItem === undefined) {\n const itemsList =\n (Array.isArray(dataItems) ? dataItems : dataItems?.value) ||\n (gridRef?.value as any)?.props?.dataItems ||\n (gridRef?.value as any)?.dataItems;\n\n if (\n itemsList &&\n rowIndex !== undefined &&\n rowIndex >= 0 &&\n rowIndex < itemsList.length\n ) {\n resolvedDataItem = itemsList[rowIndex];\n }\n }\n\n if (resolvedDataItem === undefined) return;\n\n const context: RowActionContext<T> = {\n dataItem: resolvedDataItem,\n rowIndex,\n event,\n triggerType: \"keyboard\",\n ctrlKey: !!event.ctrlKey,\n shiftKey: !!event.shiftKey,\n metaKey: !!event.metaKey,\n altKey: !!event.altKey,\n coordinates: getElementCoordinates(rowEl),\n };\n\n onRowAction(resolvedDataItem, context);\n };\n\n return {\n handleRowClick,\n handleRowKeyDown,\n isIgnoredTarget,\n };\n};\n","import { computed, nextTick, ref } from \"vue\";\nimport type { ComputedRef, Ref } from \"vue\";\nimport type { TextBoxChangeEvent } from \"@progress/kendo-vue-inputs\";\n\nconst DEFAULT_ZIP_ERROR_MESSAGE =\n \"Enter a valid ZIP code with exactly 5 or 9 digits.\";\n\nconst formatZipDisplay = (input: string): string => {\n const digits = input.replace(/\\D/g, \"\").slice(0, 9);\n return digits.length > 5\n ? `${digits.slice(0, 5)}-${digits.slice(5)}`\n : digits;\n};\n\n// Translate a formatted caret into the number of ZIP digits before it.\nconst countDigitsBeforeIndex = (value: string, index: number): number => {\n return value.slice(0, Math.max(0, index)).replace(/\\D/g, \"\").length;\n};\n\n// Map a digit index back to the formatted ZIP display position.\nconst digitIndexToDisplayIndex = (digitIndex: number): number => {\n if (digitIndex <= 5) {\n return digitIndex;\n }\n\n return Math.min(digitIndex + 1, 10);\n};\n\nexport type ZipPayload = {\n zip: string;\n};\n\nexport type UseZipTextBoxOptions = {\n /** The `id` of the Kendo `TextBox` input element. Must match the `id` prop\n * passed to `<TextBox>`. Used by `submitAndValidate({ focus: true })` to focus\n * the field when validation fails. */\n id: string;\n initialValue?: string;\n errorMessage?: string;\n required?: boolean;\n};\n\nexport type UseZipTextBoxState = {\n zipDisplay: Ref<string>;\n submitted: Ref<boolean>;\n errorMessage: Ref<string>;\n};\n\nexport type UseZipTextBoxBindings = {\n /** Bind to `:wrapperClass` on `<TextBox>` so Kendo applies `fk-zip-textbox`\n * to its wrapper element on every render — no manual DOM manipulation needed. */\n readonly wrapperClass: string;\n};\n\nexport type UseZipTextBoxDerived = {\n readonly zipRaw: ComputedRef<string>;\n readonly isZipValid: ComputedRef<boolean>;\n readonly showZipError: ComputedRef<boolean>;\n readonly textBoxValid: ComputedRef<boolean>;\n readonly textBoxValidate: ComputedRef<boolean>;\n};\n\nexport type UseZipTextBoxActions = {\n handleZipInput: (...args: unknown[]) => void;\n submitAndValidate: (opts?: { focus?: boolean }) => boolean;\n buildPayload: () => ZipPayload;\n};\n\nexport type UseZipTextBoxApi = {} & UseZipTextBoxState &\n UseZipTextBoxBindings &\n UseZipTextBoxDerived &\n UseZipTextBoxActions;\n\nexport const useZipTextBox = (\n options: UseZipTextBoxOptions,\n): UseZipTextBoxApi => {\n const zipDisplay = ref(formatZipDisplay(options.initialValue ?? \"\"));\n const submitted = ref(false);\n const errorMessage = ref(\n options.errorMessage?.trim() || DEFAULT_ZIP_ERROR_MESSAGE,\n );\n\n const zipRaw = computed(() => zipDisplay.value.replace(/\\D/g, \"\"));\n const isZipValid = computed(() => {\n const length = zipRaw.value.length;\n return length === 5 || length === 9;\n });\n const showZipError = computed(() => submitted.value && !isZipValid.value);\n const textBoxValid = computed(() => !submitted.value || isZipValid.value);\n const textBoxValidate = computed(() => submitted.value);\n\n // Restore the caret after Vue re-renders the formatted ZIP value.\n const restoreCaret = (\n inputElement: HTMLInputElement,\n digitIndex: number,\n ): void => {\n const caretIndex = digitIndexToDisplayIndex(digitIndex);\n\n nextTick(() => {\n if (!inputElement.isConnected) {\n return;\n }\n\n inputElement.setSelectionRange(caretIndex, caretIndex);\n });\n };\n\n const handleZipInput = (...args: unknown[]) => {\n const event = args[0] as TextBoxChangeEvent | undefined;\n const nativeEvent = event?.event as InputEvent | undefined;\n const inputElement = nativeEvent?.target as HTMLInputElement | null;\n const nextValue = event?.value;\n const inputValue = Array.isArray(nextValue)\n ? nextValue.join(\"\")\n : String(nextValue ?? \"\");\n\n // Capture the caret before rewriting the controlled value.\n const digitIndex =\n inputElement?.selectionStart !== undefined &&\n inputElement.selectionStart !== null\n ? countDigitsBeforeIndex(\n inputElement.value,\n inputElement.selectionStart,\n )\n : inputValue.replace(/\\D/g, \"\").length;\n\n zipDisplay.value = formatZipDisplay(inputValue);\n\n // Put the caret back where the user was typing.\n if (inputElement) {\n restoreCaret(inputElement, digitIndex);\n }\n };\n\n const submitAndValidate = (opts?: { focus?: boolean }): boolean => {\n submitted.value = true;\n const valid = isZipValid.value;\n if (!valid && opts?.focus) {\n nextTick(() => {\n const inputEl = document.getElementById(\n options.id,\n ) as HTMLInputElement | null;\n inputEl?.focus();\n });\n }\n return valid;\n };\n\n const buildPayload = (): ZipPayload => {\n return { zip: zipRaw.value };\n };\n\n return {\n // writable state\n zipDisplay,\n submitted,\n errorMessage,\n // bindings\n wrapperClass: \"fk-zip-textbox\",\n // derived state\n zipRaw,\n isZipValid,\n showZipError,\n textBoxValid,\n textBoxValidate,\n // actions\n handleZipInput,\n submitAndValidate,\n buildPayload,\n };\n};\n","import { ref, watchEffect } from \"vue\";\nimport type { Ref } from \"vue\";\n\nexport interface UseFieldsetTouchTrackerOptions {\n /**\n * Function that returns whether the fieldset is valid.\n */\n isValid: () => boolean;\n}\n\nexport interface UseFieldsetTouchTrackerApi {\n touched: Ref<boolean>;\n onFocusout: (event: FocusEvent) => void;\n reset: () => void;\n}\n\nexport function useFieldsetTouchTracker(\n fieldsetRef: Ref<HTMLFieldSetElement | null>,\n options: UseFieldsetTouchTrackerOptions,\n): UseFieldsetTouchTrackerApi {\n const touched = ref(false);\n\n // Keep aria-invalid synchronized with the composed validator function.\n watchEffect(() => {\n fieldsetRef.value?.setAttribute(\"aria-invalid\", String(!options.isValid()));\n });\n\n function onFocusout(event: FocusEvent) {\n const fieldset =\n fieldsetRef.value ?? (event.currentTarget as HTMLElement | null);\n const next = event.relatedTarget as Node | null;\n\n if (!fieldset || !fieldset.contains(next)) {\n touched.value = true;\n }\n }\n\n function reset() {\n touched.value = false;\n }\n\n return { touched, onFocusout, reset };\n}\n","import {\n computed,\n ref,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\nimport { useFieldsetTouchTracker } from \"./useFieldsetTouchTracker\";\n\nexport interface UseFieldsetValidationKitOptions {\n /**\n * Consumer-owned submit state. The kit reads this value but never mutates it.\n */\n submitted: MaybeRefOrGetter<boolean>;\n /**\n * Returns the real validity of the fieldset when validation is active.\n */\n isValid: () => boolean;\n}\n\n/**\n * API returned by {@link useFieldsetValidationKit}.\n */\nexport interface UseFieldsetValidationKitApi {\n /**\n * Becomes true after the first focus transition that leaves the fieldset.\n */\n touched: Ref<boolean>;\n /**\n * Delayed validation gate. True when either submitted or touched is true.\n */\n fieldsetValidate: ComputedRef<boolean>;\n /**\n * Forwards fieldset focusout events to the internal touch tracker.\n */\n onFocusout: (event: FocusEvent) => void;\n /**\n * Clears touched state and suppresses one immediate post-reset focusout.\n *\n * This avoids re-activating delayed validation from reset-related focus\n * transitions (for example, clicking Reset while an input is focused).\n */\n reset: () => void;\n /**\n * Wraps a field-level validity source with delayed validation behavior.\n */\n createFieldValidity: (\n isValid: MaybeRefOrGetter<boolean>,\n ) => ComputedRef<boolean>;\n /**\n * Builds a named map of delayed field validity refs for ergonomic form setup.\n */\n createFieldValidationsMap: <\n T extends Record<string, MaybeRefOrGetter<boolean>>,\n >(\n isValidMap: T,\n ) => { [K in keyof T]: ComputedRef<boolean> };\n /**\n * Moves focus to the first invalid Kendo control found within the provided form.\n */\n focusFirstInvalidField: (\n formRef: MaybeRefOrGetter<HTMLFormElement | null>,\n ) => void;\n}\n\n/**\n * Orchestrates delayed fieldset validation using submit state and touch state.\n *\n * Intended as the primary form-level API for gated validity UX:\n * - validation displays after submit or first fieldset exit\n * - field-level validity can be composed through helper factories\n * - invalid focus and reset behavior are handled consistently\n *\n * @param fieldsetRef Reference to the fieldset whose focus transitions are tracked.\n * @param options Consumer-provided submit state and base validity function.\n * @returns Validation kit API for wiring fieldset-level and field-level behavior.\n */\nexport function useFieldsetValidationKit(\n fieldsetRef: Ref<HTMLFieldSetElement | null>,\n options: UseFieldsetValidationKitOptions,\n): UseFieldsetValidationKitApi {\n const touched = ref(false);\n // After reset, browser/UI focus can emit an immediate focusout that does not\n // represent a user intentionally leaving the fieldset. Ignore exactly one\n // focusout to prevent delayed validation from re-arming right away.\n const suppressNextTouch = ref(false);\n const fieldsetValidate = computed(\n () => toValue(options.submitted) || touched.value,\n );\n\n // Computes the effective validity of the fieldset, taking into account the\n // delayed validation gate.\n const fieldsetIsValid = computed(() => {\n return !fieldsetValidate.value || options.isValid();\n });\n\n // Initializes the internal touch tracker for the fieldset.\n const tracker = useFieldsetTouchTracker(fieldsetRef, {\n isValid: () => fieldsetIsValid.value,\n });\n\n // Creates a delayed validity ref for a single field based on the fieldset's\n // validation state.\n function createFieldValidity(isValid: MaybeRefOrGetter<boolean>) {\n return computed(() => !fieldsetValidate.value || toValue(isValid));\n }\n\n // Builds a named map of delayed field validity refs from the provided validity map.\n // (e.g. { firstName: () => firstNameValid, lastName: () => lastNameValid })\n // show example map?\n // Example usage:\n // const fieldValidations = createFieldValidationsMap({\n // firstName: () => firstNameValid,\n // lastName: () => lastNameValid,\n // });\n // The returned object will have the same keys as the input map, but each value will\n // be a computed ref that reflects the delayed validation state.\n function createFieldValidationsMap<\n T extends Record<string, MaybeRefOrGetter<boolean>>,\n >(isValidMap: T) {\n return Object.fromEntries(\n Object.entries(isValidMap).map(([key, isValid]) => [\n key,\n createFieldValidity(isValid),\n ]),\n ) as { [K in keyof T]: ComputedRef<boolean> };\n }\n\n // Focuses the first invalid field within the provided FORM.\n // TODO: Leaving this here for now as a convenience, but it does not belong\n // in the core validation kit. This should be its own composable or utility\n // function. I may move this to USAddress component-specific logic.\n function focusFirstInvalidField(\n formRef: MaybeRefOrGetter<HTMLFormElement | null>,\n ) {\n const form = toValue(formRef);\n if (!form) return;\n\n const firstInvalid = form.querySelector(\n '.k-invalid input, .k-invalid[tabindex=\"0\"]',\n ) as HTMLElement | null;\n\n firstInvalid?.focus();\n }\n\n // Forwards fieldset focusout events to the internal touch tracker.\n function onFocusout(event: FocusEvent) {\n if (suppressNextTouch.value) {\n // Consume the first post-reset focusout caused by reset/click focus\n // churn.\n suppressNextTouch.value = false;\n return;\n }\n\n tracker.onFocusout(event);\n\n if (tracker.touched.value) {\n touched.value = true;\n }\n }\n\n // Resets the touched state and suppresses one immediate post-reset focusout.\n function reset() {\n touched.value = false;\n suppressNextTouch.value = true;\n tracker.reset();\n }\n\n return {\n touched,\n fieldsetValidate,\n onFocusout,\n reset,\n createFieldValidity,\n createFieldValidationsMap,\n focusFirstInvalidField,\n };\n}\n","export type UsStateOption = {\n label: string;\n value: string;\n};\n\nexport const US_STATES_BY_ABBREVIATION: UsStateOption[] = [\n { label: \"Alabama\", value: \"AL\" },\n { label: \"Alaska\", value: \"AK\" },\n { label: \"Arizona\", value: \"AZ\" },\n { label: \"Arkansas\", value: \"AR\" },\n { label: \"California\", value: \"CA\" },\n { label: \"Colorado\", value: \"CO\" },\n { label: \"Connecticut\", value: \"CT\" },\n { label: \"Delaware\", value: \"DE\" },\n { label: \"Florida\", value: \"FL\" },\n { label: \"Georgia\", value: \"GA\" },\n { label: \"Hawaii\", value: \"HI\" },\n { label: \"Idaho\", value: \"ID\" },\n { label: \"Illinois\", value: \"IL\" },\n { label: \"Indiana\", value: \"IN\" },\n { label: \"Iowa\", value: \"IA\" },\n { label: \"Kansas\", value: \"KS\" },\n { label: \"Kentucky\", value: \"KY\" },\n { label: \"Louisiana\", value: \"LA\" },\n { label: \"Maine\", value: \"ME\" },\n { label: \"Maryland\", value: \"MD\" },\n { label: \"Massachusetts\", value: \"MA\" },\n { label: \"Michigan\", value: \"MI\" },\n { label: \"Minnesota\", value: \"MN\" },\n { label: \"Mississippi\", value: \"MS\" },\n { label: \"Missouri\", value: \"MO\" },\n { label: \"Montana\", value: \"MT\" },\n { label: \"Nebraska\", value: \"NE\" },\n { label: \"Nevada\", value: \"NV\" },\n { label: \"New Hampshire\", value: \"NH\" },\n { label: \"New Jersey\", value: \"NJ\" },\n { label: \"New Mexico\", value: \"NM\" },\n { label: \"New York\", value: \"NY\" },\n { label: \"North Carolina\", value: \"NC\" },\n { label: \"North Dakota\", value: \"ND\" },\n { label: \"Ohio\", value: \"OH\" },\n { label: \"Oklahoma\", value: \"OK\" },\n { label: \"Oregon\", value: \"OR\" },\n { label: \"Pennsylvania\", value: \"PA\" },\n { label: \"Rhode Island\", value: \"RI\" },\n { label: \"South Carolina\", value: \"SC\" },\n { label: \"South Dakota\", value: \"SD\" },\n { label: \"Tennessee\", value: \"TN\" },\n { label: \"Texas\", value: \"TX\" },\n { label: \"Utah\", value: \"UT\" },\n { label: \"Vermont\", value: \"VT\" },\n { label: \"Virginia\", value: \"VA\" },\n { label: \"Washington\", value: \"WA\" },\n { label: \"West Virginia\", value: \"WV\" },\n { label: \"Wisconsin\", value: \"WI\" },\n { label: \"Wyoming\", value: \"WY\" },\n];\n","import { reactive } from \"vue\";\n\nexport interface USAddressFormData {\n address1: string;\n address2: string;\n city: string;\n state: string | null;\n zip: string;\n}\n\n/**\n * Reads the value from an input event payload.\n * @param payload - The input event payload.\n * @returns The string value of the input.\n */\nfunction readInputValue(payload: unknown): string {\n if (payload && typeof payload === \"object\" && \"value\" in payload) {\n const value = (payload as { value: unknown }).value;\n return typeof value === \"string\" ? value : String(value ?? \"\");\n }\n return \"\";\n}\n\n/**\n * Manages the form data model for a US address.\n *\n * Note: this is internal UI data state, not just the US \"state\" (AL, CA, etc.) field.\n * @returns An object containing form data and field event handlers.\n */\nexport function useUSAddressFormData() {\n const formData = reactive<USAddressFormData>({\n address1: \"\",\n address2: \"\",\n city: \"\",\n state: null,\n zip: \"\",\n });\n\n const onAddress1Input = (...args: unknown[]) => {\n formData.address1 = readInputValue(args[0]);\n };\n\n const onAddress2Input = (...args: unknown[]) => {\n formData.address2 = readInputValue(args[0]);\n };\n\n const onCityInput = (...args: unknown[]) => {\n formData.city = readInputValue(args[0]);\n };\n\n const onStateChange = (event: { value: string | null }) => {\n formData.state = event.value;\n };\n\n const resetFormData = () => {\n formData.address1 = \"\";\n formData.address2 = \"\";\n formData.city = \"\";\n formData.state = null;\n formData.zip = \"\";\n };\n\n return {\n formData,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n resetFormData,\n };\n}\n","import { watch } from \"vue\";\nimport { useZipTextBox } from \"./useZipTextBox\";\nimport type { USAddressFormData } from \"./_useUSAddressFormData\";\n\n/**\n * Manages the ZIP code field for a US address.\n * @param formData - The form data object containing the ZIP code.\n * @returns An object containing ZIP code display, validity, wrapper class, input handler, and reset function.\n */\nexport function useUSAddressZip(\n formData: USAddressFormData,\n zipInputId = \"zip\",\n) {\n const zipField = useZipTextBox({ id: zipInputId });\n const {\n zipDisplay,\n zipRaw,\n isZipValid,\n wrapperClass: zipWrapperClass,\n handleZipInput: onZipInput,\n } = zipField;\n\n watch(zipRaw, (value) => {\n formData.zip = value;\n });\n\n const resetZip = () => {\n zipDisplay.value = \"\";\n formData.zip = \"\";\n };\n\n return {\n zipDisplay,\n isZipValid,\n zipWrapperClass,\n onZipInput,\n resetZip,\n };\n}\n","import { computed, toValue, type MaybeRefOrGetter } from \"vue\";\nimport type { USAddressFormData } from \"./_useUSAddressFormData\";\n\ninterface UseUSAddressValidationOptions {\n formData: USAddressFormData;\n isZipValid: MaybeRefOrGetter<boolean>;\n}\n\n/**\n * Manages the validation state for a US address.\n * @param options - The options object containing form data and ZIP code validity.\n * @returns An object containing validation state for each field and the overall address.\n */\nexport function useUSAddressValidation(options: UseUSAddressValidationOptions) {\n /**\n * Strict validity values represent the actual rule outcomes for each field,\n * independent of whether validation messages are currently shown in the UI.\n */\n const strictAddress1Valid = computed(\n () => options.formData.address1.trim() !== \"\",\n );\n const strictCityValid = computed(() => options.formData.city.trim() !== \"\");\n const strictStateValid = computed(() => !!options.formData.state);\n const strictZipValid = computed(() => toValue(options.isZipValid));\n\n const strictAddressValid = computed(\n () =>\n strictAddress1Valid.value &&\n strictCityValid.value &&\n strictStateValid.value &&\n strictZipValid.value,\n );\n\n return {\n strictAddress1Valid,\n strictCityValid,\n strictStateValid,\n strictZipValid,\n strictAddressValid,\n };\n}\n","import {\n computed,\n nextTick,\n ref,\n toValue,\n watch,\n watchEffect,\n type MaybeRefOrGetter,\n} from \"vue\";\nimport { useFieldsetValidationKit } from \"../form/useFieldsetValidationKit\";\nimport { US_STATES_BY_ABBREVIATION } from \"./usStates\";\nimport { useUSAddressFormData } from \"./_useUSAddressFormData\";\nimport { useUSAddressZip } from \"./_useUSAddressZip\";\nimport { useUSAddressValidation } from \"./_useUSAddressValidation\";\n\ninterface UseUSAddressOptions {\n fieldsetRef: MaybeRefOrGetter<HTMLFieldSetElement | null>;\n addressId: string;\n required?: MaybeRefOrGetter<boolean>;\n}\n\nexport interface USAddressSubmitPayload {\n address1: string;\n address2: string;\n city: string;\n state: string;\n zip: string;\n}\n\n/**\n * Focuses the first invalid input within a container.\n * @param container - The container element to search within.\n */\nfunction focusFirstInvalid(container: HTMLElement | null) {\n if (!container) return;\n const target = container.querySelector<HTMLElement>(\n '.k-invalid input, .k-invalid[tabindex=\"0\"]',\n );\n target?.focus();\n}\n\nfunction focusoutLeavesFieldset(\n fieldsetRef: HTMLFieldSetElement | null,\n event: FocusEvent,\n) {\n const fieldset = fieldsetRef ?? (event.currentTarget as HTMLElement | null);\n const next = event.relatedTarget as Node | null;\n\n return !fieldset || !fieldset.contains(next);\n}\n\n/**\n * Composable for managing a US address form.\n * @param options - The options object containing fieldset reference and address id.\n * @returns An object containing form state, validation state, and handlers.\n */\nexport function useUSAddress(options: UseUSAddressOptions) {\n const fieldsetRef = ref<HTMLFieldSetElement | null>(\n toValue(options.fieldsetRef),\n );\n\n watchEffect(() => {\n fieldsetRef.value = toValue(options.fieldsetRef);\n });\n\n const submitted = ref(false);\n const optionalFeedbackReviewed = ref(false);\n const isRequired = computed(() => toValue(options.required) ?? true);\n const {\n formData,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n resetFormData,\n } = useUSAddressFormData();\n\n const zipInputId = `${options.addressId}-zip`;\n\n const { zipDisplay, isZipValid, zipWrapperClass, onZipInput, resetZip } =\n useUSAddressZip(formData, zipInputId);\n\n const {\n strictAddress1Valid,\n strictCityValid,\n strictStateValid,\n strictZipValid,\n strictAddressValid,\n } = useUSAddressValidation({\n formData,\n isZipValid,\n });\n\n const validationKit = useFieldsetValidationKit(fieldsetRef, {\n submitted,\n isValid: () => strictAddressValid.value,\n });\n\n const { touched, fieldsetValidate, onFocusout, reset } = validationKit;\n\n const fieldValidations = validationKit.createFieldValidationsMap({\n address1: strictAddress1Valid,\n city: strictCityValid,\n state: strictStateValid,\n zip: strictZipValid,\n address: strictAddressValid,\n });\n\n const {\n address1: rawAddress1Valid,\n city: rawCityValid,\n state: rawStateValid,\n zip: rawZipValid,\n address: rawAddressValid,\n } = fieldValidations;\n\n const addressValidate = computed(() =>\n isRequired.value ? fieldsetValidate.value : false,\n );\n\n const address1Valid = computed(() =>\n isRequired.value ? rawAddress1Valid.value : true,\n );\n\n const cityValid = computed(() =>\n isRequired.value ? rawCityValid.value : true,\n );\n\n const stateValid = computed(() =>\n isRequired.value ? rawStateValid.value : true,\n );\n\n const zipValid = computed(() =>\n isRequired.value ? rawZipValid.value : true,\n );\n\n const addressValid = computed(() =>\n isRequired.value ? rawAddressValid.value : true,\n );\n\n const stateDefaultItem = { value: null, label: \"State\" };\n const stateOptions = US_STATES_BY_ABBREVIATION.map(({ label, value }) => ({\n label,\n value,\n }));\n\n const normalizedPayload = computed<USAddressSubmitPayload>(() => ({\n address1: formData.address1.trim(),\n address2: formData.address2.trim(),\n city: formData.city.trim(),\n state: (formData.state ?? \"\").trim().toUpperCase(),\n zip: formData.zip.replace(/\\D/g, \"\"),\n }));\n\n const isAddressEmpty = computed(() => {\n return (\n formData.address1.trim() === \"\" &&\n formData.address2.trim() === \"\" &&\n formData.city.trim() === \"\" &&\n (formData.state ?? \"\").trim() === \"\" &&\n formData.zip.replace(/\\D/g, \"\") === \"\"\n );\n });\n\n /**\n * Indicates whether any input has been provided in the optional address fields.\n * @returns True if any address field has input, false otherwise.\n */\n const optionalAddressHasAnyInput = computed(() => !isAddressEmpty.value);\n\n /**\n * Indicates whether any required fields are missing in the optional address section.\n * @returns True if any required field is missing, false otherwise.\n */\n const optionalMissingRequiredFields = computed(() => {\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n (!strictAddress1Valid.value ||\n !strictCityValid.value ||\n !strictStateValid.value)\n );\n });\n\n /**\n * Indicates whether the optional zip code field is invalid.\n * @returns True if the zip code is invalid, false otherwise.\n */\n const optionalZipInvalid = computed(() => {\n const zipDigits = formData.zip.replace(/\\D/g, \"\");\n\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n zipDigits.length !== 5 &&\n zipDigits.length !== 9\n );\n });\n\n /**\n * Indicates whether any part of the optional address is invalid.\n * @returns True if any part of the optional address is invalid, false otherwise.\n */\n const optionalPartialInvalid = computed(() => {\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n !strictAddressValid.value\n );\n });\n\n /**\n * Indicates whether optional address feedback should be active.\n * @returns True if feedback should be active, false otherwise.\n */\n const optionalFeedbackActive = computed(() => {\n return (\n !isRequired.value &&\n optionalPartialInvalid.value &&\n (optionalFeedbackReviewed.value || submitted.value)\n );\n });\n\n // Resets the optional feedback reviewed state when the normalized payload\n // changes and the address is not required.\n watch(normalizedPayload, () => {\n if (!isRequired.value) {\n optionalFeedbackReviewed.value = false;\n }\n });\n\n watch(isRequired, (required) => {\n if (!required) {\n submitted.value = false;\n optionalFeedbackReviewed.value = false;\n reset();\n }\n });\n\n /**\n * Validates address state for parent-owned submit flow.\n * Activates UI error visibility.\n * @returns An object containing the validity status and the normalized payload.\n */\n const validateForSubmit = async () => {\n if (!isRequired.value) {\n if (isAddressEmpty.value || strictAddressValid.value) {\n submitted.value = false;\n return {\n isValid: true as const,\n payload: normalizedPayload.value,\n };\n }\n\n submitted.value = true;\n return { isValid: false as const, payload: null };\n }\n\n submitted.value = true;\n\n if (!strictAddressValid.value) {\n await nextTick();\n focusFirstInvalid(fieldsetRef.value);\n return { isValid: false as const, payload: null };\n }\n\n return {\n isValid: true as const,\n payload: normalizedPayload.value,\n };\n };\n\n /**\n * Resets the US address form.\n * Deactivates UI error visibility.\n */\n const resetAddress = () => {\n submitted.value = false;\n optionalFeedbackReviewed.value = false;\n reset();\n resetFormData();\n resetZip();\n };\n\n const onFieldsetFocusout = (event: FocusEvent) => {\n const leftFieldset = focusoutLeavesFieldset(fieldsetRef.value, event);\n\n onFocusout(event);\n\n if (!isRequired.value && leftFieldset) {\n optionalFeedbackReviewed.value = true;\n }\n };\n\n return {\n formData,\n submitted,\n touched,\n addressValidate,\n address1Valid,\n cityValid,\n stateValid,\n zipValid,\n addressValid,\n optionalFeedbackActive,\n optionalPartialInvalid,\n optionalMissingRequiredFields,\n optionalZipInvalid,\n stateDefaultItem,\n stateOptions,\n zipDisplay,\n zipWrapperClass,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n onZipInput,\n onFieldsetFocusout,\n normalizedPayload,\n validateForSubmit,\n reset: resetAddress,\n };\n}\n","/** A corner/center alignment pair, independent of any specific composable. */\nexport type GeometryAlign = {\n horizontal: \"left\" | \"center\" | \"right\";\n vertical: \"top\" | \"center\" | \"bottom\";\n};\n\n/** A rectangular clipping region (viewport or a scrollable container's rect). */\nexport type GeometryBounds = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n};\n\nexport type GeometryCollisionType = \"fit\" | \"flip\";\n\nexport type GeometryCollision = {\n horizontal: GeometryCollisionType;\n vertical: GeometryCollisionType;\n};\n\nexport type ComputeCollisionOffsetInput = {\n /** The anchor rect (or a zero-size point rect for a click/keyboard activation). */\n anchor: DOMRect;\n /** The popup's own measured size, or `null` before it has been measured. */\n popup: DOMRect | null;\n /** Point on the anchor that the popup is positioned from. */\n anchorAlign: GeometryAlign;\n /** Point on the popup that is placed at the computed anchor point. */\n popupAlign: GeometryAlign;\n /** Clipping bounds checked for overflow; same coordinate space as `anchor`. */\n bounds: GeometryBounds;\n /** Per-axis collision behavior applied when the preferred corner overflows. */\n collision: GeometryCollision;\n};\n\nconst flipHorizontal = (\n horizontal: GeometryAlign[\"horizontal\"],\n): GeometryAlign[\"horizontal\"] =>\n horizontal === \"left\" ? \"right\" : horizontal === \"right\" ? \"left\" : \"center\";\n\nconst flipVertical = (\n vertical: GeometryAlign[\"vertical\"],\n): GeometryAlign[\"vertical\"] =>\n vertical === \"top\" ? \"bottom\" : vertical === \"bottom\" ? \"top\" : \"center\";\n\nconst computeCorner = (\n anchor: DOMRect,\n popup: DOMRect | null,\n anchorAlign: GeometryAlign,\n popupAlign: GeometryAlign,\n) => {\n const anchorX =\n anchor.left +\n (anchorAlign.horizontal === \"right\"\n ? anchor.width\n : anchorAlign.horizontal === \"center\"\n ? anchor.width / 2\n : 0);\n const anchorY =\n anchor.top +\n (anchorAlign.vertical === \"bottom\"\n ? anchor.height\n : anchorAlign.vertical === \"center\"\n ? anchor.height / 2\n : 0);\n\n const popupOffsetX = popup\n ? popupAlign.horizontal === \"right\"\n ? popup.width\n : popupAlign.horizontal === \"center\"\n ? popup.width / 2\n : 0\n : 0;\n const popupOffsetY = popup\n ? popupAlign.vertical === \"bottom\"\n ? popup.height\n : popupAlign.vertical === \"center\"\n ? popup.height / 2\n : 0\n : 0;\n\n return { left: anchorX - popupOffsetX, top: anchorY - popupOffsetY };\n};\n\nconst fitAxis = (\n position: number,\n size: number,\n start: number,\n end: number,\n) => {\n if (size >= end - start) return start;\n return Math.min(Math.max(position, start), end - size);\n};\n\n/**\n * Computes a popup's top-left corner from an anchor rect and alignment pair,\n * then applies Kendo-style `fit` or `flip` collision behavior independently\n * on each axis. Fit shifts the popup within bounds without changing sides;\n * flip moves it to the anchor's opposite side only when that reduces overflow.\n *\n * Returns the preferred position when `popup` is `null`, since collision\n * behavior cannot be calculated before the popup has been measured.\n */\nexport const computeCollisionOffset = ({\n anchor,\n popup,\n anchorAlign,\n popupAlign,\n bounds,\n collision,\n}: ComputeCollisionOffsetInput): { left: number; top: number } => {\n const preferred = computeCorner(anchor, popup, anchorAlign, popupAlign);\n if (!popup) return preferred;\n\n let { left, top } = preferred;\n\n if (collision.horizontal === \"fit\") {\n left = fitAxis(left, popup.width, bounds.left, bounds.right);\n } else {\n const overflowsRight = left + popup.width - bounds.right;\n const overflowsLeft = bounds.left - left;\n if (overflowsRight > 0 || overflowsLeft > 0) {\n const flipped = computeCorner(\n anchor,\n popup,\n {\n horizontal: flipHorizontal(anchorAlign.horizontal),\n vertical: anchorAlign.vertical,\n },\n {\n horizontal: flipHorizontal(popupAlign.horizontal),\n vertical: popupAlign.vertical,\n },\n );\n const currentOverflow =\n Math.max(overflowsRight, 0) + Math.max(overflowsLeft, 0);\n const flippedOverflow =\n Math.max(flipped.left + popup.width - bounds.right, 0) +\n Math.max(bounds.left - flipped.left, 0);\n if (flippedOverflow < currentOverflow) left = flipped.left;\n }\n }\n\n if (collision.vertical === \"fit\") {\n top = fitAxis(top, popup.height, bounds.top, bounds.bottom);\n } else {\n const overflowsBottom = top + popup.height - bounds.bottom;\n const overflowsTop = bounds.top - top;\n if (overflowsBottom > 0 || overflowsTop > 0) {\n const flipped = computeCorner(\n anchor,\n popup,\n {\n horizontal: anchorAlign.horizontal,\n vertical: flipVertical(anchorAlign.vertical),\n },\n {\n horizontal: popupAlign.horizontal,\n vertical: flipVertical(popupAlign.vertical),\n },\n );\n const currentOverflow =\n Math.max(overflowsBottom, 0) + Math.max(overflowsTop, 0);\n const flippedOverflow =\n Math.max(flipped.top + popup.height - bounds.bottom, 0) +\n Math.max(bounds.top - flipped.top, 0);\n if (flippedOverflow < currentOverflow) top = flipped.top;\n }\n }\n\n return { left, top };\n};\n","import { useId } from \"vue\";\n\n/** A stable segment used to compose a component-scoped DOM identifier. */\nexport type CompositeIdPart = string | number | null | undefined;\n\n/** Values returned by {@link useCompositeId}. */\nexport type UseCompositeIdReturn = {\n /** Unique Vue component-instance identifier, prefixed for FeatherK markup. */\n instanceId: string;\n /** Combines the component instance ID with stable logical identifier segments. */\n compose: (...parts: CompositeIdPart[]) => string;\n};\n\n/**\n * Creates component-scoped DOM identifiers from Vue's SSR-safe `useId()`.\n *\n * Use the resulting `instanceId` for a stable local base and `compose` for\n * related trigger, menu, popup, and ARIA relationship IDs. This does not\n * replace consumer-owned domain IDs used for shared state or registries.\n */\nexport const useCompositeId = (prefix = \"fkid\"): UseCompositeIdReturn => {\n const instanceId = `${prefix}-${useId()}`;\n\n const compose = (...parts: CompositeIdPart[]) =>\n [instanceId, ...parts]\n .filter((part) => part !== null && part !== undefined)\n .map(String)\n .join(\"-\");\n\n return { instanceId, compose };\n};\n","import { computed, customRef, effectScope, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isReactive, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRef as toRef$1, toRefs as toRefs$1, toValue, unref, watch, watchEffect } from \"vue\";\n//#region computedEager/index.ts\n/**\n*\n* @deprecated This function will be removed in future version.\n*\n* Note: If you are using Vue 3.4+, you can straight use computed instead.\n* Because in Vue 3.4+, if computed new value does not change,\n* computed, effect, watch, watchEffect, render dependencies will not be triggered.\n* refer: https://github.com/vuejs/core/pull/5912\n*\n* @param fn effect function\n* @param options WatchOptionsBase\n* @returns readonly shallowRef\n*/\nfunction computedEager(fn, options) {\n\tvar _options$flush;\n\tconst result = shallowRef();\n\twatchEffect(() => {\n\t\tresult.value = fn();\n\t}, {\n\t\t...options,\n\t\tflush: (_options$flush = options === null || options === void 0 ? void 0 : options.flush) !== null && _options$flush !== void 0 ? _options$flush : \"sync\"\n\t});\n\treturn readonly(result);\n}\n/** @deprecated use `computedEager` instead */\nconst eagerComputed = computedEager;\n//#endregion\n//#region computedWithControl/index.ts\n/**\n* Explicitly define the deps of computed.\n*\n* @param source\n* @param fn\n*/\nfunction computedWithControl(source, fn, options = {}) {\n\tlet v = void 0;\n\tlet track;\n\tlet trigger;\n\tlet dirty = true;\n\tconst update = () => {\n\t\tdirty = true;\n\t\ttrigger();\n\t};\n\twatch(source, update, {\n\t\tflush: \"sync\",\n\t\t...options\n\t});\n\tconst get = typeof fn === \"function\" ? fn : fn.get;\n\tconst set = typeof fn === \"function\" ? void 0 : fn.set;\n\tconst result = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tif (dirty) {\n\t\t\t\t\tv = get(v);\n\t\t\t\t\tdirty = false;\n\t\t\t\t}\n\t\t\t\ttrack();\n\t\t\t\treturn v;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset === null || set === void 0 || set(v);\n\t\t\t}\n\t\t};\n\t});\n\tresult.trigger = update;\n\treturn result;\n}\n/** @deprecated use `computedWithControl` instead */\nconst controlledComputed = computedWithControl;\n//#endregion\n//#region createDisposableDirective/index.ts\n/**\n* Utility for authoring disposable directives. Reactive effects created within `mounted` directive hook will be tracked and automatically disposed when directive is unmounted.\n*\n* @see https://vueuse.org/createDisposableDirective\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createDisposableDirective(origin = {}) {\n\tfunction isFunc(fn) {\n\t\treturn typeof fn === \"function\";\n\t}\n\tconst normalisedOrigin = isFunc(origin) ? {\n\t\tmounted: origin,\n\t\tupdated: origin\n\t} : origin;\n\tconst { mounted, unmounted } = normalisedOrigin;\n\tif (!isFunc(mounted)) return origin;\n\tconst scopeWeakMap = /* @__PURE__ */ new WeakMap();\n\treturn {\n\t\t...normalisedOrigin,\n\t\tmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get;\n\t\t\tconst scope = (_scopeWeakMap$get = scopeWeakMap.get(el)) !== null && _scopeWeakMap$get !== void 0 ? _scopeWeakMap$get : effectScope();\n\t\t\tscopeWeakMap.set(el, scope);\n\t\t\tscope.run(() => {\n\t\t\t\tmounted === null || mounted === void 0 || mounted(el, binding, vNode, prevNode);\n\t\t\t});\n\t\t},\n\t\tunmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get2;\n\t\t\t(_scopeWeakMap$get2 = scopeWeakMap.get(el)) === null || _scopeWeakMap$get2 === void 0 || _scopeWeakMap$get2.stop();\n\t\t\tscopeWeakMap.delete(el);\n\t\t\tif (isFunc(unmounted)) unmounted(el, binding, vNode, prevNode);\n\t\t}\n\t};\n}\n//#endregion\n//#region tryOnScopeDispose/index.ts\n/**\n* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing\n*\n* @param fn\n*/\nfunction tryOnScopeDispose(fn, failSilently) {\n\tif (getCurrentScope()) {\n\t\tonScopeDispose(fn, failSilently);\n\t\treturn true;\n\t}\n\treturn false;\n}\n//#endregion\n//#region createEventHook/index.ts\n/**\n* Utility for creating event hooks\n*\n* @see https://vueuse.org/createEventHook\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createEventHook() {\n\tconst fns = /* @__PURE__ */ new Set();\n\tconst off = (fn) => {\n\t\tfns.delete(fn);\n\t};\n\tconst clear = () => {\n\t\tfns.clear();\n\t};\n\tconst on = (fn) => {\n\t\tfns.add(fn);\n\t\tconst offFn = () => off(fn);\n\t\ttryOnScopeDispose(offFn);\n\t\treturn { off: offFn };\n\t};\n\tconst trigger = (...args) => {\n\t\treturn Promise.all(Array.from(fns).map((fn) => fn(...args)));\n\t};\n\treturn {\n\t\ton,\n\t\toff,\n\t\ttrigger,\n\t\tclear\n\t};\n}\n//#endregion\n//#region createGlobalState/index.ts\n/**\n* Keep states in the global scope to be reusable across Vue instances.\n*\n* @see https://vueuse.org/createGlobalState\n* @param stateFactory A factory function to create the state\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createGlobalState(stateFactory) {\n\tlet initialized = false;\n\tlet state;\n\tconst scope = effectScope(true);\n\treturn ((...args) => {\n\t\tif (!initialized) {\n\t\t\tstate = scope.run(() => stateFactory(...args));\n\t\t\tinitialized = true;\n\t\t}\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region provideLocal/map.ts\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n//#endregion\n//#region injectLocal/index.ts\n/**\n* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* injectLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*\n* @__NO_SIDE_EFFECTS__\n*/\nconst injectLocal = (...args) => {\n\tvar _getCurrentInstance;\n\tconst key = args[0];\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null && !hasInjectionContext()) throw new Error(\"injectLocal must be called in setup\");\n\tif (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];\n\treturn inject(...args);\n};\n//#endregion\n//#region provideLocal/index.ts\n/**\n* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* provideLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*/\nfunction provideLocal(key, value) {\n\tvar _getCurrentInstance;\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null) throw new Error(\"provideLocal must be called in setup\");\n\tif (!localProvidedStateMap.has(owner)) localProvidedStateMap.set(owner, Object.create(null));\n\tconst localProvidedState = localProvidedStateMap.get(owner);\n\tlocalProvidedState[key] = value;\n\treturn provide(key, value);\n}\n//#endregion\n//#region createInjectionState/index.ts\nfunction createInjectionState(composable, options) {\n\tconst key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n\tconst defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;\n\tconst useProvidingState = (...args) => {\n\t\tconst state = composable(...args);\n\t\tprovideLocal(key, state);\n\t\treturn state;\n\t};\n\tconst useInjectedState = () => injectLocal(key, defaultValue);\n\treturn [useProvidingState, useInjectedState];\n}\n//#endregion\n//#region createRef/index.ts\n/**\n* Returns a `deepRef` or `shallowRef` depending on the `deep` param.\n*\n* @example createRef(1) // ShallowRef<number>\n* @example createRef(1, false) // ShallowRef<number>\n* @example createRef(1, true) // Ref<number>\n* @example createRef(\"string\") // ShallowRef<string>\n* @example createRef<\"A\"|\"B\">(\"A\", true) // Ref<\"A\"|\"B\">\n*\n* @param value\n* @param deep\n* @returns the `deepRef` or `shallowRef`\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createRef(value, deep) {\n\tif (deep === true) return ref(value);\n\telse return shallowRef(value);\n}\n//#endregion\n//#region utils/is.ts\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n\tif (!condition) console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {};\nconst rand = (min, max) => {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.hasOwn(val, key);\nconst isIOS = /* #__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n\tvar _window, _window2, _window3;\n\treturn isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));\n}\n//#endregion\n//#region toRef/index.ts\nfunction toRef(...args) {\n\tif (args.length !== 1) return toRef$1(...args);\n\tconst r = args[0];\n\treturn typeof r === \"function\" ? readonly(customRef(() => ({\n\t\tget: r,\n\t\tset: noop\n\t}))) : ref(r);\n}\n//#endregion\n//#region utils/filters.ts\nfunction createFilterWrapper(filter, fn) {\n\tfunction wrapper(...args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tPromise.resolve(filter(() => fn.apply(this, args), {\n\t\t\t\tfn,\n\t\t\t\tthisArg: this,\n\t\t\t\targs\n\t\t\t})).then(resolve).catch(reject);\n\t\t});\n\t}\n\tif (\"cancel\" in filter) Object.assign(wrapper, {\n\t\tcancel: filter.cancel,\n\t\tflush: filter.flush,\n\t\tisPending: filter.isPending\n\t});\n\treturn wrapper;\n}\nconst bypassFilter = (invoke) => {\n\treturn invoke();\n};\n/**\n* Create an EventFilter that debounce the events\n*/\nfunction debounceFilter(ms, options = {}) {\n\tlet timer;\n\tlet maxTimer;\n\tlet lastRejector = noop;\n\tlet lastResolve = noop;\n\tconst _pending = shallowRef(false);\n\tconst _clearTimeout = (timer) => {\n\t\tclearTimeout(timer);\n\t\tlastRejector();\n\t\tlastRejector = noop;\n\t};\n\tlet lastInvoker;\n\tconst handler = (invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst maxDuration = toValue(options.maxWait);\n\t\tif (timer) _clearTimeout(timer);\n\t\tif (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\treturn Promise.resolve(invoke());\n\t\t}\n\t\t_pending.value = true;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlastRejector = options.rejectOnCancel ? reject : resolve;\n\t\t\tlastResolve = resolve;\n\t\t\tlastInvoker = invoke;\n\t\t\tif (maxDuration && !maxTimer) maxTimer = setTimeout(() => {\n\t\t\t\tif (timer) _clearTimeout(timer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}, maxDuration);\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tif (maxTimer) _clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(invoke());\n\t\t\t}, duration);\n\t\t});\n\t};\n\treturn Object.assign(handler, {\n\t\tcancel: () => {\n\t\t\tif (timer) {\n\t\t\t\t_clearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\tlastResolve = noop;\n\t\t},\n\t\tflush: () => {\n\t\t\tif (_pending.value) {\n\t\t\t\tif (timer) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = void 0;\n\t\t\t\t}\n\t\t\t\tif (maxTimer) {\n\t\t\t\t\tclearTimeout(maxTimer);\n\t\t\t\t\tmaxTimer = void 0;\n\t\t\t\t}\n\t\t\t\t_pending.value = false;\n\t\t\t\tconst resolve = lastResolve;\n\t\t\t\tlastRejector = noop;\n\t\t\t\tlastResolve = noop;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}\n\t\t},\n\t\tisPending: shallowReadonly(_pending)\n\t});\n}\nfunction throttleFilter(...args) {\n\tlet lastExec = 0;\n\tlet timer;\n\tlet isLeading = true;\n\tlet lastRejector = noop;\n\tlet lastValue;\n\tlet ms;\n\tlet trailing;\n\tlet leading;\n\tlet rejectOnCancel;\n\tif (!isRef(args[0]) && typeof args[0] === \"object\") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);\n\telse [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n\tconst clear = () => {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t\tlastRejector();\n\t\t\tlastRejector = noop;\n\t\t}\n\t};\n\tconst filter = (_invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst elapsed = Date.now() - lastExec;\n\t\tconst invoke = () => {\n\t\t\treturn lastValue = _invoke();\n\t\t};\n\t\tclear();\n\t\tif (duration <= 0) {\n\t\t\tlastExec = Date.now();\n\t\t\treturn invoke();\n\t\t}\n\t\tif (elapsed > duration) {\n\t\t\tlastExec = Date.now();\n\t\t\tif (leading || !isLeading) invoke();\n\t\t} else if (trailing) lastValue = new Promise((resolve, reject) => {\n\t\t\tlastRejector = rejectOnCancel ? reject : resolve;\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tlastExec = Date.now();\n\t\t\t\tisLeading = true;\n\t\t\t\tresolve(invoke());\n\t\t\t\tclear();\n\t\t\t}, Math.max(0, duration - elapsed));\n\t\t});\n\t\tif (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);\n\t\tisLeading = false;\n\t\treturn lastValue;\n\t};\n\treturn filter;\n}\n/**\n* EventFilter that gives extra controls to pause and resume the filter\n*\n* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n* @param options Options to configure the filter\n*/\nfunction pausableFilter(extendFilter = bypassFilter, options = {}) {\n\tconst { initialState = \"active\" } = options;\n\tconst isActive = toRef(initialState === \"active\");\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tfunction resume() {\n\t\tisActive.value = true;\n\t}\n\tconst eventFilter = (...args) => {\n\t\tif (isActive.value) extendFilter(...args);\n\t};\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume,\n\t\teventFilter\n\t};\n}\n//#endregion\n//#region utils/general.ts\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n\treturn new Promise((resolve, reject) => {\n\t\tif (throwOnTimeout) setTimeout(reject, ms, reason);\n\t\telse setTimeout(resolve, ms);\n\t});\n}\nfunction identity(arg) {\n\treturn arg;\n}\n/**\n* Create singleton promise function\n*\n* @example\n* ```\n* const promise = createSingletonPromise(async () => { ... })\n*\n* await promise()\n* await promise() // all of them will be bind to a single promise instance\n* await promise() // and be resolved together\n* ```\n*/\nfunction createSingletonPromise(fn) {\n\tlet _promise;\n\tfunction wrapper() {\n\t\tif (!_promise) _promise = fn();\n\t\treturn _promise;\n\t}\n\twrapper.reset = async () => {\n\t\tconst _prev = _promise;\n\t\t_promise = void 0;\n\t\tif (_prev) await _prev;\n\t};\n\treturn wrapper;\n}\nfunction invoke(fn) {\n\treturn fn();\n}\nfunction containsProp(obj, ...props) {\n\treturn props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n\tvar _target$match;\n\tif (typeof target === \"number\") return target + delta;\n\tconst value = ((_target$match = target.match(/^-?\\d+\\.?\\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || \"\";\n\tconst unit = target.slice(value.length);\n\tconst result = Number.parseFloat(value) + delta;\n\tif (Number.isNaN(result)) return target;\n\treturn result + unit;\n}\n/**\n* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\n*/\nfunction pxValue(px) {\n\treturn px.endsWith(\"rem\") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);\n}\n/**\n* Create a new subset object by giving keys\n*/\nfunction objectPick(obj, keys, omitUndefined = false) {\n\treturn keys.reduce((n, k) => {\n\t\tif (k in obj) {\n\t\t\tif (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];\n\t\t}\n\t\treturn n;\n\t}, {});\n}\n/**\n* Create a new subset object by omit giving keys\n*/\nfunction objectOmit(obj, keys, omitUndefined = false) {\n\treturn Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n\t\treturn (!omitUndefined || value !== void 0) && !keys.includes(key);\n\t}));\n}\nfunction objectEntries(obj) {\n\treturn Object.entries(obj);\n}\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n//#endregion\n//#region utils/port.ts\nfunction cacheStringFunction(fn) {\n\tconst cache = Object.create(null);\n\treturn ((str) => {\n\t\treturn cache[str] || (cache[str] = fn(str));\n\t});\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n\treturn str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n//#endregion\n//#region utils/vue.ts\nfunction getLifeCycleTarget(target) {\n\treturn target || getCurrentInstance();\n}\n//#endregion\n//#region createSharedComposable/index.ts\n/**\n* Make a composable function usable with multiple Vue instances.\n*\n* @see https://vueuse.org/createSharedComposable\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createSharedComposable(composable) {\n\tif (!isClient) return composable;\n\tlet subscribers = 0;\n\tlet state;\n\tlet scope;\n\tconst dispose = () => {\n\t\tsubscribers -= 1;\n\t\tif (scope && subscribers <= 0) {\n\t\t\tscope.stop();\n\t\t\tstate = void 0;\n\t\t\tscope = void 0;\n\t\t}\n\t};\n\treturn ((...args) => {\n\t\tsubscribers += 1;\n\t\tif (!scope) {\n\t\t\tscope = effectScope(true);\n\t\t\tstate = scope.run(() => composable(...args));\n\t\t}\n\t\ttryOnScopeDispose(dispose);\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region extendRef/index.ts\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n\tfor (const [key, value] of Object.entries(extend)) {\n\t\tif (key === \"value\") continue;\n\t\tif (isRef(value) && unwrap) Object.defineProperty(ref, key, {\n\t\t\tget() {\n\t\t\t\treturn value.value;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tvalue.value = v;\n\t\t\t},\n\t\t\tenumerable\n\t\t});\n\t\telse Object.defineProperty(ref, key, {\n\t\t\tvalue,\n\t\t\tenumerable\n\t\t});\n\t}\n\treturn ref;\n}\n//#endregion\n//#region get/index.ts\nfunction get(obj, key) {\n\tif (key == null) return unref(obj);\n\treturn unref(obj)[key];\n}\n//#endregion\n//#region isDefined/index.ts\nfunction isDefined(v) {\n\treturn unref(v) != null;\n}\n//#endregion\n//#region makeDestructurable/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction makeDestructurable(obj, arr) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tconst clone = { ...obj };\n\t\tObject.defineProperty(clone, Symbol.iterator, {\n\t\t\tenumerable: false,\n\t\t\tvalue() {\n\t\t\t\tlet index = 0;\n\t\t\t\treturn { next: () => ({\n\t\t\t\t\tvalue: arr[index++],\n\t\t\t\t\tdone: index > arr.length\n\t\t\t\t}) };\n\t\t\t}\n\t\t});\n\t\treturn clone;\n\t} else return Object.assign([...arr], obj);\n}\n//#endregion\n//#region reactify/index.ts\n/**\n* Converts plain function into a reactive function.\n* The converted function accepts refs as it's arguments\n* and returns a ComputedRef, with proper typing.\n*\n* @param fn - Source function\n* @param options - Options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactify(fn, options) {\n\tconst unrefFn = (options === null || options === void 0 ? void 0 : options.computedGetter) === false ? unref : toValue;\n\treturn function(...args) {\n\t\treturn computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n\t};\n}\n/** @deprecated use `reactify` instead */\nconst createReactiveFn = reactify;\n//#endregion\n//#region reactifyObject/index.ts\n/**\n* Apply `reactify` to an object\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n\tlet keys = [];\n\tlet options;\n\tif (Array.isArray(optionsOrKeys)) keys = optionsOrKeys;\n\telse {\n\t\toptions = optionsOrKeys;\n\t\tconst { includeOwnProperties = true } = optionsOrKeys;\n\t\tkeys.push(...Object.keys(obj));\n\t\tif (includeOwnProperties) keys.push(...Object.getOwnPropertyNames(obj));\n\t}\n\treturn Object.fromEntries(keys.map((key) => {\n\t\tconst value = obj[key];\n\t\treturn [key, typeof value === \"function\" ? reactify(value.bind(obj), options) : value];\n\t}));\n}\n//#endregion\n//#region toReactive/index.ts\n/**\n* Converts ref to reactive.\n*\n* @see https://vueuse.org/toReactive\n* @param objectRef A ref of object\n*/\nfunction toReactive(objectRef) {\n\tif (!isRef(objectRef)) return reactive(objectRef);\n\treturn reactive(new Proxy({}, {\n\t\tget(_, p, receiver) {\n\t\t\treturn unref(Reflect.get(objectRef.value, p, receiver));\n\t\t},\n\t\tset(_, p, value) {\n\t\t\tif (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;\n\t\t\telse objectRef.value[p] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, p) {\n\t\t\treturn Reflect.deleteProperty(objectRef.value, p);\n\t\t},\n\t\thas(_, p) {\n\t\t\treturn Reflect.has(objectRef.value, p);\n\t\t},\n\t\townKeys() {\n\t\t\treturn Object.keys(objectRef.value);\n\t\t},\n\t\tgetOwnPropertyDescriptor() {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t};\n\t\t}\n\t}));\n}\n//#endregion\n//#region reactiveComputed/index.ts\n/**\n* Computed reactive object.\n*/\nfunction reactiveComputed(fn) {\n\treturn toReactive(computed(fn));\n}\n//#endregion\n//#region reactiveOmit/index.ts\n/**\n* Reactively omit fields from a reactive object\n*\n* @see https://vueuse.org/reactiveOmit\n*/\nfunction reactiveOmit(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n//#endregion\n//#region reactivePick/index.ts\n/**\n* Reactively pick fields from a reactive object\n*\n* @see https://vueuse.org/reactivePick\n*/\nfunction reactivePick(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n//#endregion\n//#region refAutoReset/index.ts\n/**\n* Create a ref which will be reset to the default value after some time.\n*\n* @see https://vueuse.org/refAutoReset\n* @param defaultValue The value which will be set.\n* @param afterMs A zero-or-greater delay in milliseconds.\n*/\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n\treturn customRef((track, trigger) => {\n\t\tlet value = toValue(defaultValue);\n\t\tlet timer;\n\t\tconst resetAfter = () => setTimeout(() => {\n\t\t\tvalue = toValue(defaultValue);\n\t\t\ttrigger();\n\t\t}, toValue(afterMs));\n\t\ttryOnScopeDispose(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = resetAfter();\n\t\t\t}\n\t\t};\n\t});\n}\n/** @deprecated use `refAutoReset` instead */\nconst autoResetRef = refAutoReset;\n//#endregion\n//#region useDebounceFn/index.ts\n/**\n* Debounce execution of a function.\n*\n* @see https://vueuse.org/useDebounceFn\n* @param fn A function to be executed after delay milliseconds debounced.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param options Options\n*\n* @return A new, debounced, function with isPending, cancel, and flush properties.\n*/\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n\treturn createFilterWrapper(debounceFilter(ms, options), fn);\n}\n//#endregion\n//#region refDebounced/index.ts\n/**\n* Debounce updates of a ref.\n*\n* @return A new debounced ref.\n*/\nfunction refDebounced(value, ms = 200, options = {}) {\n\tconst debounced = ref(toValue(value));\n\tconst updater = useDebounceFn(() => {\n\t\tdebounced.value = value.value;\n\t}, ms, options);\n\twatch(value, () => updater());\n\treturn shallowReadonly(debounced);\n}\n/** @deprecated use `refDebounced` instead */\nconst debouncedRef = refDebounced;\n/** @deprecated use `refDebounced` instead */\nconst useDebounce = refDebounced;\n//#endregion\n//#region refDefault/index.ts\n/**\n* Apply default value to a ref.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refDefault(source, defaultValue) {\n\treturn computed({\n\t\tget() {\n\t\t\tvar _source$value;\n\t\t\treturn (_source$value = source.value) !== null && _source$value !== void 0 ? _source$value : defaultValue;\n\t\t},\n\t\tset(value) {\n\t\t\tsource.value = value;\n\t\t}\n\t});\n}\n//#endregion\n//#region refManualReset/index.ts\n/**\n* Create a ref with manual reset functionality.\n*\n* @see https://vueuse.org/refManualReset\n* @param defaultValue The value which will be set.\n*/\nfunction refManualReset(defaultValue) {\n\tlet value = toValue(defaultValue);\n\tlet trigger;\n\tconst reset = () => {\n\t\tvalue = toValue(defaultValue);\n\t\ttrigger();\n\t};\n\tconst refValue = customRef((track, _trigger) => {\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t}\n\t\t};\n\t});\n\trefValue.reset = reset;\n\treturn refValue;\n}\n//#endregion\n//#region useThrottleFn/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n* to `callback` when the throttled-function is executed.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* (default value: 200)\n*\n* @param [trailing] if true, call fn again after the time is up (default value: false)\n*\n* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)\n*\n* @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)\n*\n* @return A new, throttled, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n\treturn createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);\n}\n//#endregion\n//#region refThrottled/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param value Ref value to be watched with throttle effect\n* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param trailing if true, update the value again after the delay time is up\n* @param leading if true, update the value on the leading edge of the ms timeout\n*/\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n\tif (delay <= 0) return value;\n\tconst throttled = ref(toValue(value));\n\tconst updater = useThrottleFn(() => {\n\t\tthrottled.value = value.value;\n\t}, delay, trailing, leading);\n\twatch(value, () => updater());\n\treturn throttled;\n}\n/** @deprecated use `refThrottled` instead */\nconst throttledRef = refThrottled;\n/** @deprecated use `refThrottled` instead */\nconst useThrottle = refThrottled;\n//#endregion\n//#region refWithControl/index.ts\n/**\n* Fine-grained controls over ref and its reactivity.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refWithControl(initial, options = {}) {\n\tlet source = initial;\n\tlet track;\n\tlet trigger;\n\tconst ref = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\treturn get();\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset(v);\n\t\t\t}\n\t\t};\n\t});\n\tfunction get(tracking = true) {\n\t\tif (tracking) track();\n\t\treturn source;\n\t}\n\tfunction set(value, triggering = true) {\n\t\tvar _options$onBeforeChan, _options$onChanged;\n\t\tif (value === source) return;\n\t\tconst old = source;\n\t\tif (((_options$onBeforeChan = options.onBeforeChange) === null || _options$onBeforeChan === void 0 ? void 0 : _options$onBeforeChan.call(options, value, old)) === false) return;\n\t\tsource = value;\n\t\t(_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, value, old);\n\t\tif (triggering) trigger();\n\t}\n\t/**\n\t* Get the value without tracked in the reactivity system\n\t*/\n\tconst untrackedGet = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*/\n\tconst silentSet = (v) => set(v, false);\n\t/**\n\t* Get the value without tracked in the reactivity system.\n\t*\n\t* Alias for `untrackedGet()`\n\t*/\n\tconst peek = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*\n\t* Alias for `silentSet(v)`\n\t*/\n\tconst lay = (v) => set(v, false);\n\treturn extendRef(ref, {\n\t\tget,\n\t\tset,\n\t\tuntrackedGet,\n\t\tsilentSet,\n\t\tpeek,\n\t\tlay\n\t}, { enumerable: true });\n}\n/** @deprecated use `refWithControl` instead */\nconst controlledRef = refWithControl;\n//#endregion\n//#region set/index.ts\n/**\n* Shorthand for `ref.value = x`\n*/\nfunction set(...args) {\n\tif (args.length === 2) {\n\t\tconst [ref, value] = args;\n\t\tref.value = value;\n\t}\n\tif (args.length === 3) {\n\t\tconst [target, key, value] = args;\n\t\ttarget[key] = value;\n\t}\n}\n//#endregion\n//#region watchWithFilter/index.ts\nfunction watchWithFilter(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\treturn watch(source, createFilterWrapper(eventFilter, cb), watchOptions);\n}\n//#endregion\n//#region watchPausable/index.ts\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nfunction watchPausable(source, cb, options = {}) {\n\tconst { eventFilter: filter, initialState = \"active\", ...watchOptions } = options;\n\tconst { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });\n\treturn {\n\t\tstop: watchWithFilter(source, cb, {\n\t\t\t...watchOptions,\n\t\t\teventFilter\n\t\t}),\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nconst pausableWatch = watchPausable;\n//#endregion\n//#region syncRef/index.ts\n/**\n* Two-way refs synchronization.\n* From the set theory perspective to restrict the option's type\n* Check in the following order:\n* 1. L = R\n* 2. L ∩ R ≠ ∅\n* 3. L ⊆ R\n* 4. L ∩ R = ∅\n*/\nfunction syncRef(left, right, ...[options]) {\n\tconst { flush = \"sync\", deep = false, immediate = true, direction = \"both\", transform = {} } = options || {};\n\tconst watchers = [];\n\tconst transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n\tconst transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n\tif (direction === \"both\" || direction === \"ltr\") watchers.push(watchPausable(left, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tright.value = transformLTR(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tif (direction === \"both\" || direction === \"rtl\") watchers.push(watchPausable(right, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tleft.value = transformRTL(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tconst stop = () => {\n\t\twatchers.forEach((w) => w.stop());\n\t};\n\treturn stop;\n}\n//#endregion\n//#region syncRefs/index.ts\n/**\n* Keep target ref(s) in sync with the source ref\n*\n* @param source source ref\n* @param targets\n*/\nfunction syncRefs(source, targets, options = {}) {\n\tconst { flush = \"sync\", deep = false, immediate = true } = options;\n\tconst targetsArray = toArray(targets);\n\treturn watch(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t});\n}\n//#endregion\n//#region toRefs/index.ts\n/**\n* Extended `toRefs` that also accepts refs of an object.\n*\n* @see https://vueuse.org/toRefs\n* @param objectRef A ref or normal object or array.\n* @param options Options\n*/\nfunction toRefs(objectRef, options = {}) {\n\tif (!isRef(objectRef)) return toRefs$1(objectRef);\n\tconst result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n\tfor (const key in objectRef.value) result[key] = customRef(() => ({\n\t\tget() {\n\t\t\treturn objectRef.value[key];\n\t\t},\n\t\tset(v) {\n\t\t\tvar _toValue;\n\t\t\tif ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) if (Array.isArray(objectRef.value)) {\n\t\t\t\tconst copy = [...objectRef.value];\n\t\t\t\tcopy[key] = v;\n\t\t\t\tobjectRef.value = copy;\n\t\t\t} else {\n\t\t\t\tconst newObject = {\n\t\t\t\t\t...objectRef.value,\n\t\t\t\t\t[key]: v\n\t\t\t\t};\n\t\t\t\tObject.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n\t\t\t\tobjectRef.value = newObject;\n\t\t\t}\n\t\t\telse objectRef.value[key] = v;\n\t\t}\n\t}));\n\treturn result;\n}\n//#endregion\n//#region tryOnBeforeMount/index.ts\n/**\n* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnBeforeMount(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onBeforeMount(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnBeforeUnmount/index.ts\n/**\n* Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnBeforeUnmount(fn, target) {\n\tif (getLifeCycleTarget(target)) onBeforeUnmount(fn, target);\n}\n//#endregion\n//#region tryOnMounted/index.ts\n/**\n* Call onMounted() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnMounted(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onMounted(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnUnmounted/index.ts\n/**\n* Call onUnmounted() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnUnmounted(fn, target) {\n\tif (getLifeCycleTarget(target)) onUnmounted(fn, target);\n}\n//#endregion\n//#region until/index.ts\nfunction createUntil(r, isNot = false) {\n\tfunction toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch(r, (v) => {\n\t\t\t\tif (condition(v) !== isNot) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop === null || stop === void 0 ? void 0 : stop()));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBe(value, options) {\n\t\tif (!isRef(value)) return toMatch((v) => v === value, options);\n\t\tconst { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options !== null && options !== void 0 ? options : {};\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch([r, value], ([v1, v2]) => {\n\t\t\t\tif (isNot !== (v1 === v2)) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v1);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n\t\t\tstop === null || stop === void 0 || stop();\n\t\t\treturn toValue(r);\n\t\t}));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBeTruthy(options) {\n\t\treturn toMatch((v) => Boolean(v), options);\n\t}\n\tfunction toBeNull(options) {\n\t\treturn toBe(null, options);\n\t}\n\tfunction toBeUndefined(options) {\n\t\treturn toBe(void 0, options);\n\t}\n\tfunction toBeNaN(options) {\n\t\treturn toMatch(Number.isNaN, options);\n\t}\n\tfunction toContains(value, options) {\n\t\treturn toMatch((v) => {\n\t\t\tconst array = Array.from(v);\n\t\t\treturn array.includes(value) || array.includes(toValue(value));\n\t\t}, options);\n\t}\n\tfunction changed(options) {\n\t\treturn changedTimes(1, options);\n\t}\n\tfunction changedTimes(n = 1, options) {\n\t\tlet count = -1;\n\t\treturn toMatch(() => {\n\t\t\tcount += 1;\n\t\t\treturn count >= n;\n\t\t}, options);\n\t}\n\tif (Array.isArray(toValue(r))) return {\n\t\ttoMatch,\n\t\ttoContains,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n\telse return {\n\t\ttoMatch,\n\t\ttoBe,\n\t\ttoBeTruthy,\n\t\ttoBeNull,\n\t\ttoBeNaN,\n\t\ttoBeUndefined,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n}\nfunction until(r) {\n\treturn createUntil(r);\n}\n//#endregion\n//#region useArrayDifference/index.ts\nfunction defaultComparator(value, othVal) {\n\treturn value === othVal;\n}\n/**\n* Reactive get array difference of two array\n* @see https://vueuse.org/useArrayDifference\n* @returns - the difference of two array\n* @param args\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayDifference(...args) {\n\tvar _args$, _args$2;\n\tconst list = args[0];\n\tconst values = args[1];\n\tlet compareFn = (_args$ = args[2]) !== null && _args$ !== void 0 ? _args$ : defaultComparator;\n\tconst { symmetric = false } = (_args$2 = args[3]) !== null && _args$2 !== void 0 ? _args$2 : {};\n\tif (typeof compareFn === \"string\") {\n\t\tconst key = compareFn;\n\t\tcompareFn = (value, othVal) => value[key] === othVal[key];\n\t}\n\tconst diff1 = computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n\tif (symmetric) {\n\t\tconst diff2 = computed(() => toValue(values).filter((x) => toValue(list).findIndex((y) => compareFn(x, y)) === -1));\n\t\treturn computed(() => symmetric ? [...toValue(diff1), ...toValue(diff2)] : toValue(diff1));\n\t} else return diff1;\n}\n//#endregion\n//#region useArrayEvery/index.ts\n/**\n* Reactive `Array.every`\n*\n* @see https://vueuse.org/useArrayEvery\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayEvery(list, fn) {\n\treturn computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFilter/index.ts\n/**\n* Reactive `Array.filter`\n*\n* @see https://vueuse.org/useArrayFilter\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFilter(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n//#endregion\n//#region useArrayFind/index.ts\n/**\n* Reactive `Array.find`\n*\n* @see https://vueuse.org/useArrayFind\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFind(list, fn) {\n\treturn computed(() => toValue(toValue(list).find((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayFindIndex/index.ts\n/**\n* Reactive `Array.findIndex`\n*\n* @see https://vueuse.org/useArrayFindIndex\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the index of the first element in the array that passes the test. Otherwise, \"-1\".\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindIndex(list, fn) {\n\treturn computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFindLast/index.ts\nfunction findLast(arr, cb) {\n\tlet index = arr.length;\n\twhile (index-- > 0) if (cb(arr[index], index, arr)) return arr[index];\n}\n/**\n* Reactive `Array.findLast`\n*\n* @see https://vueuse.org/useArrayFindLast\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindLast(list, fn) {\n\treturn computed(() => toValue(!Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayIncludes/index.ts\nfunction isArrayIncludesOptions(obj) {\n\treturn isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\n/**\n* Reactive `Array.includes`\n*\n* @see https://vueuse.org/useArrayIncludes\n*\n* @returns true if the `value` is found in the array. Otherwise, false.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayIncludes(...args) {\n\tvar _comparator;\n\tconst list = args[0];\n\tconst value = args[1];\n\tlet comparator = args[2];\n\tlet formIndex = 0;\n\tif (isArrayIncludesOptions(comparator)) {\n\t\tvar _comparator$fromIndex;\n\t\tformIndex = (_comparator$fromIndex = comparator.fromIndex) !== null && _comparator$fromIndex !== void 0 ? _comparator$fromIndex : 0;\n\t\tcomparator = comparator.comparator;\n\t}\n\tif (typeof comparator === \"string\") {\n\t\tconst key = comparator;\n\t\tcomparator = (element, value) => element[key] === toValue(value);\n\t}\n\tcomparator = (_comparator = comparator) !== null && _comparator !== void 0 ? _comparator : ((element, value) => element === toValue(value));\n\treturn computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))));\n}\n//#endregion\n//#region useArrayJoin/index.ts\n/**\n* Reactive `Array.join`\n*\n* @see https://vueuse.org/useArrayJoin\n* @param list - the array was called upon.\n* @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (\",\").\n*\n* @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayJoin(list, separator) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n//#endregion\n//#region useArrayMap/index.ts\n/**\n* Reactive `Array.map`\n*\n* @see https://vueuse.org/useArrayMap\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a new array with each element being the result of the callback function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayMap(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n//#endregion\n//#region useArrayReduce/index.ts\n/**\n* Reactive `Array.reduce`\n*\n* @see https://vueuse.org/useArrayReduce\n* @param list - the array was called upon.\n* @param reducer - a \"reducer\" function.\n* @param args\n*\n* @returns the value that results from running the \"reducer\" callback function to completion over the entire array.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayReduce(list, reducer, ...args) {\n\tconst reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n\treturn computed(() => {\n\t\tconst resolved = toValue(list);\n\t\treturn args.length ? resolved.reduce(reduceCallback, typeof args[0] === \"function\" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);\n\t});\n}\n//#endregion\n//#region useArraySome/index.ts\n/**\n* Reactive `Array.some`\n*\n* @see https://vueuse.org/useArraySome\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArraySome(list, fn) {\n\treturn computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayUnique/index.ts\nfunction uniq(array) {\n\treturn Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n\treturn array.reduce((acc, v) => {\n\t\tif (!acc.some((x) => fn(v, x, array))) acc.push(v);\n\t\treturn acc;\n\t}, []);\n}\n/**\n* reactive unique array\n* @see https://vueuse.org/useArrayUnique\n* @param list - the array was called upon.\n* @param compareFn\n* @returns A computed ref that returns a unique array of items.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayUnique(list, compareFn) {\n\treturn computed(() => {\n\t\tconst resolvedList = toValue(list).map((element) => toValue(element));\n\t\treturn compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n\t});\n}\n//#endregion\n//#region useCounter/index.ts\n/**\n* Basic counter with utility functions.\n*\n* @see https://vueuse.org/useCounter\n* @param [initialValue]\n* @param options\n*/\nfunction useCounter(initialValue = 0, options = {}) {\n\tlet _initialValue = unref(initialValue);\n\tconst count = shallowRef(initialValue);\n\tconst { max = Number.POSITIVE_INFINITY, min = Number.NEGATIVE_INFINITY } = options;\n\tconst inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n\tconst dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n\tconst get = () => count.value;\n\tconst set = (val) => count.value = Math.max(min, Math.min(max, val));\n\tconst reset = (val = _initialValue) => {\n\t\t_initialValue = val;\n\t\treturn set(val);\n\t};\n\treturn {\n\t\tcount: shallowReadonly(count),\n\t\tinc,\n\t\tdec,\n\t\tget,\n\t\tset,\n\t\treset\n\t};\n}\n//#endregion\n//#region useDateFormat/index.ts\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[T\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/i;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)\\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n\tlet m = hours < 12 ? \"AM\" : \"PM\";\n\tif (hasPeriod) m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n\treturn isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n\tconst suffixes = [\n\t\t\"th\",\n\t\t\"st\",\n\t\t\"nd\",\n\t\t\"rd\"\n\t];\n\tconst v = num % 100;\n\treturn num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n\tvar _options$customMeridi;\n\tconst years = date.getFullYear();\n\tconst month = date.getMonth();\n\tconst days = date.getDate();\n\tconst hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst seconds = date.getSeconds();\n\tconst milliseconds = date.getMilliseconds();\n\tconst day = date.getDay();\n\tconst meridiem = (_options$customMeridi = options.customMeridiem) !== null && _options$customMeridi !== void 0 ? _options$customMeridi : defaultMeridiem;\n\tconst stripTimeZone = (dateString) => {\n\t\tvar _dateString$split$;\n\t\treturn (_dateString$split$ = dateString.split(\" \")[1]) !== null && _dateString$split$ !== void 0 ? _dateString$split$ : \"\";\n\t};\n\tconst matches = {\n\t\tYo: () => formatOrdinal(years),\n\t\tYY: () => String(years).slice(-2),\n\t\tYYYY: () => years,\n\t\tM: () => month + 1,\n\t\tMo: () => formatOrdinal(month + 1),\n\t\tMM: () => `${month + 1}`.padStart(2, \"0\"),\n\t\tMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"short\" }),\n\t\tMMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"long\" }),\n\t\tD: () => String(days),\n\t\tDo: () => formatOrdinal(days),\n\t\tDD: () => `${days}`.padStart(2, \"0\"),\n\t\tH: () => String(hours),\n\t\tHo: () => formatOrdinal(hours),\n\t\tHH: () => `${hours}`.padStart(2, \"0\"),\n\t\th: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n\t\tho: () => formatOrdinal(hours % 12 || 12),\n\t\thh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n\t\tm: () => String(minutes),\n\t\tmo: () => formatOrdinal(minutes),\n\t\tmm: () => `${minutes}`.padStart(2, \"0\"),\n\t\ts: () => String(seconds),\n\t\tso: () => formatOrdinal(seconds),\n\t\tss: () => `${seconds}`.padStart(2, \"0\"),\n\t\tSSS: () => `${milliseconds}`.padStart(3, \"0\"),\n\t\td: () => day,\n\t\tdd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"narrow\" }),\n\t\tddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"short\" }),\n\t\tdddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"long\" }),\n\t\tA: () => meridiem(hours, minutes),\n\t\tAA: () => meridiem(hours, minutes, false, true),\n\t\ta: () => meridiem(hours, minutes, true),\n\t\taa: () => meridiem(hours, minutes, true, true),\n\t\tz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"longOffset\" }))\n\t};\n\treturn formatStr.replace(REGEX_FORMAT, (match, $1) => {\n\t\tvar _ref, _matches$match;\n\t\treturn (_ref = $1 !== null && $1 !== void 0 ? $1 : (_matches$match = matches[match]) === null || _matches$match === void 0 ? void 0 : _matches$match.call(matches)) !== null && _ref !== void 0 ? _ref : match;\n\t});\n}\nfunction normalizeDate(date) {\n\tif (date === null) return /* @__PURE__ */ new Date(NaN);\n\tif (date === void 0) return /* @__PURE__ */ new Date();\n\tif (date instanceof Date) return new Date(date);\n\tif (typeof date === \"string\" && !/Z$/i.test(date)) {\n\t\tconst d = date.match(REGEX_PARSE);\n\t\tif (d) {\n\t\t\tconst m = d[2] - 1 || 0;\n\t\t\tconst ms = (d[7] || \"0\").substring(0, 3);\n\t\t\treturn new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n\t\t}\n\t}\n\treturn new Date(date);\n}\n/**\n* Get the formatted date according to the string of tokens passed in.\n*\n* @see https://vueuse.org/useDateFormat\n* @param date - The date to format, can either be a `Date` object, a timestamp, or a string\n* @param formatStr - The combination of tokens to format the date\n* @param options - UseDateFormatOptions\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n\treturn computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n//#endregion\n//#region useIntervalFn/index.ts\n/**\n* Wrapper for `setInterval` with controls\n*\n* @see https://vueuse.org/useIntervalFn\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tlet timer = null;\n\tconst isActive = shallowRef(false);\n\tfunction clean() {\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tclean();\n\t}\n\tfunction resume() {\n\t\tconst intervalValue = toValue(interval);\n\t\tif (intervalValue <= 0) return;\n\t\tisActive.value = true;\n\t\tif (immediateCallback) cb();\n\t\tclean();\n\t\tif (isActive.value) timer = setInterval(cb, intervalValue);\n\t}\n\tif (immediate && isClient) resume();\n\tif (isRef(interval) || typeof interval === \"function\") tryOnScopeDispose(watch(interval, () => {\n\t\tif (isActive.value && isClient) resume();\n\t}));\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useInterval/index.ts\nfunction useInterval(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, immediate = true, callback } = options;\n\tconst counter = shallowRef(0);\n\tconst update = () => counter.value += 1;\n\tconst reset = () => {\n\t\tcounter.value = 0;\n\t};\n\tconst controls = useIntervalFn(callback ? () => {\n\t\tupdate();\n\t\tcallback(counter.value);\n\t} : update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tcounter: shallowReadonly(counter),\n\t\treset,\n\t\t...controls\n\t};\n\telse return shallowReadonly(counter);\n}\n//#endregion\n//#region useLastChanged/index.ts\nfunction useLastChanged(source, options = {}) {\n\tvar _options$initialValue;\n\tconst ms = shallowRef((_options$initialValue = options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : null);\n\twatch(source, () => ms.value = timestamp(), options);\n\treturn shallowReadonly(ms);\n}\n//#endregion\n//#region useTimeoutFn/index.ts\n/**\n* Wrapper for `setTimeout` with controls.\n*\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useTimeoutFn(cb, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tfunction clear() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t}\n\tfunction stop() {\n\t\tisPending.value = false;\n\t\tclear();\n\t}\n\tfunction start(...args) {\n\t\tif (immediateCallback) cb();\n\t\tclear();\n\t\tisPending.value = true;\n\t\ttimer = setTimeout(() => {\n\t\t\tisPending.value = false;\n\t\t\ttimer = void 0;\n\t\t\tcb(...args);\n\t\t}, toValue(interval));\n\t}\n\tif (immediate) {\n\t\tisPending.value = true;\n\t\tif (isClient) start();\n\t}\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisPending: shallowReadonly(isPending),\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTimeout/index.ts\nfunction useTimeout(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, callback } = options;\n\tconst controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options);\n\tconst ready = computed(() => !controls.isPending.value);\n\tif (exposeControls) return {\n\t\tready,\n\t\t...controls\n\t};\n\telse return ready;\n}\n//#endregion\n//#region useToNumber/index.ts\n/**\n* Reactively convert a string ref to number.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToNumber(value, options = {}) {\n\tconst { method = \"parseFloat\", radix, nanToZero } = options;\n\treturn computed(() => {\n\t\tlet resolved = toValue(value);\n\t\tif (typeof method === \"function\") resolved = method(resolved);\n\t\telse if (typeof resolved === \"string\") resolved = Number[method](resolved, radix);\n\t\tif (nanToZero && Number.isNaN(resolved)) resolved = 0;\n\t\treturn resolved;\n\t});\n}\n//#endregion\n//#region useToString/index.ts\n/**\n* Reactively convert a ref to string.\n*\n* @see https://vueuse.org/useToString\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToString(value) {\n\treturn computed(() => `${toValue(value)}`);\n}\n//#endregion\n//#region useToggle/index.ts\n/**\n* A boolean ref with a toggler\n*\n* @see https://vueuse.org/useToggle\n* @param [initialValue]\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToggle(initialValue = false, options = {}) {\n\tconst { truthyValue = true, falsyValue = false } = options;\n\tconst valueIsRef = isRef(initialValue);\n\tconst _value = shallowRef(initialValue);\n\tfunction toggle(value) {\n\t\tif (arguments.length) {\n\t\t\t_value.value = value;\n\t\t\treturn _value.value;\n\t\t} else {\n\t\t\tconst truthy = toValue(truthyValue);\n\t\t\t_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n\t\t\treturn _value.value;\n\t\t}\n\t}\n\tif (valueIsRef) return toggle;\n\telse return [_value, toggle];\n}\n//#endregion\n//#region watchArray/index.ts\n/**\n* Watch for an array with additions and removals.\n*\n* @see https://vueuse.org/watchArray\n*/\nfunction watchArray(source, cb, options) {\n\tlet oldList = (options === null || options === void 0 ? void 0 : options.immediate) ? [] : [...typeof source === \"function\" ? source() : Array.isArray(source) ? source : toValue(source)];\n\treturn watch(source, (newList, _, onCleanup) => {\n\t\tconst oldListRemains = Array.from({ length: oldList.length });\n\t\tconst added = [];\n\t\tfor (const obj of newList) {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < oldList.length; i++) if (!oldListRemains[i] && obj === oldList[i]) {\n\t\t\t\toldListRemains[i] = true;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!found) added.push(obj);\n\t\t}\n\t\tconst removed = oldList.filter((_, i) => !oldListRemains[i]);\n\t\tcb(newList, oldList, added, removed, onCleanup);\n\t\toldList = [...newList];\n\t}, options);\n}\n//#endregion\n//#region watchAtMost/index.ts\nfunction watchAtMost(source, cb, options) {\n\tconst { count, ...watchOptions } = options;\n\tconst current = shallowRef(0);\n\tconst { stop, resume, pause } = watchWithFilter(source, (...args) => {\n\t\tcurrent.value += 1;\n\t\tif (current.value >= toValue(count)) nextTick(() => stop());\n\t\tcb(...args);\n\t}, watchOptions);\n\treturn {\n\t\tcount: current,\n\t\tstop,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region watchDebounced/index.ts\nfunction watchDebounced(source, cb, options = {}) {\n\tconst { debounce = 0, maxWait = void 0, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: debounceFilter(debounce, { maxWait })\n\t});\n}\n/** @deprecated use `watchDebounced` instead */\nconst debouncedWatch = watchDebounced;\n//#endregion\n//#region watchDeep/index.ts\n/**\n* Shorthand for watching value with {deep: true}\n*\n* @see https://vueuse.org/watchDeep\n*/\nfunction watchDeep(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tdeep: true\n\t});\n}\n//#endregion\n//#region watchIgnorable/index.ts\nfunction watchIgnorable(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\tconst filteredCb = createFilterWrapper(eventFilter, cb);\n\tlet ignoreUpdates;\n\tlet ignorePrevAsyncUpdates;\n\tlet stop;\n\tif (watchOptions.flush === \"sync\") {\n\t\tlet ignore = false;\n\t\tignorePrevAsyncUpdates = () => {};\n\t\tignoreUpdates = (updater) => {\n\t\t\tignore = true;\n\t\t\tupdater();\n\t\t\tignore = false;\n\t\t};\n\t\tstop = watch(source, (...args) => {\n\t\t\tif (!ignore) filteredCb(...args);\n\t\t}, watchOptions);\n\t} else {\n\t\tconst disposables = [];\n\t\tlet ignoreCounter = 0;\n\t\tlet syncCounter = 0;\n\t\tignorePrevAsyncUpdates = () => {\n\t\t\tignoreCounter = syncCounter;\n\t\t};\n\t\tdisposables.push(watch(source, () => {\n\t\t\tsyncCounter++;\n\t\t}, {\n\t\t\t...watchOptions,\n\t\t\tflush: \"sync\"\n\t\t}));\n\t\tignoreUpdates = (updater) => {\n\t\t\tconst syncCounterPrev = syncCounter;\n\t\t\tupdater();\n\t\t\tignoreCounter += syncCounter - syncCounterPrev;\n\t\t};\n\t\tdisposables.push(watch(source, (...args) => {\n\t\t\tconst ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;\n\t\t\tignoreCounter = 0;\n\t\t\tsyncCounter = 0;\n\t\t\tif (ignore) return;\n\t\t\tfilteredCb(...args);\n\t\t}, watchOptions));\n\t\tstop = () => {\n\t\t\tdisposables.forEach((fn) => fn());\n\t\t};\n\t}\n\treturn {\n\t\tstop,\n\t\tignoreUpdates,\n\t\tignorePrevAsyncUpdates\n\t};\n}\n/** @deprecated use `watchIgnorable` instead */\nconst ignorableWatch = watchIgnorable;\n//#endregion\n//#region watchImmediate/index.ts\n/**\n* Shorthand for watching value with {immediate: true}\n*\n* @see https://vueuse.org/watchImmediate\n*/\nfunction watchImmediate(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\timmediate: true\n\t});\n}\n//#endregion\n//#region watchOnce/index.ts\n/**\n* Shorthand for watching value with { once: true }\n*\n* @see https://vueuse.org/watchOnce\n*/\nfunction watchOnce(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tonce: true\n\t});\n}\n//#endregion\n//#region watchThrottled/index.ts\nfunction watchThrottled(source, cb, options = {}) {\n\tconst { throttle = 0, trailing = true, leading = true, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: throttleFilter(throttle, trailing, leading)\n\t});\n}\n/** @deprecated use `watchThrottled` instead */\nconst throttledWatch = watchThrottled;\n//#endregion\n//#region watchTriggerable/index.ts\nfunction watchTriggerable(source, cb, options = {}) {\n\tlet cleanupFn;\n\tfunction onEffect() {\n\t\tif (!cleanupFn) return;\n\t\tconst fn = cleanupFn;\n\t\tcleanupFn = void 0;\n\t\tfn();\n\t}\n\t/** Register the function `cleanupFn` */\n\tfunction onCleanup(callback) {\n\t\tcleanupFn = callback;\n\t}\n\tconst _cb = (value, oldValue) => {\n\t\tonEffect();\n\t\treturn cb(value, oldValue, onCleanup);\n\t};\n\tconst res = watchIgnorable(source, _cb, options);\n\tconst { ignoreUpdates } = res;\n\tconst trigger = () => {\n\t\tlet res;\n\t\tignoreUpdates(() => {\n\t\t\tres = _cb(getWatchSources(source), getOldValue(source));\n\t\t});\n\t\treturn res;\n\t};\n\treturn {\n\t\t...res,\n\t\ttrigger\n\t};\n}\nfunction getWatchSources(sources) {\n\tif (isReactive(sources)) return sources;\n\tif (Array.isArray(sources)) return sources.map((item) => toValue(item));\n\treturn toValue(sources);\n}\nfunction getOldValue(source) {\n\treturn Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n//#endregion\n//#region whenever/index.ts\nfunction whenever(source, cb, options) {\n\tconst stop = watch(source, (v, ov, onInvalidate) => {\n\t\tif (v) {\n\t\t\tif (options === null || options === void 0 ? void 0 : options.once) nextTick(() => stop());\n\t\t\tcb(v, ov, onInvalidate);\n\t\t}\n\t}, {\n\t\t...options,\n\t\tonce: false\n\t});\n\treturn stop;\n}\n//#endregion\nexport { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { bypassFilter, camelize, clamp, computedWithControl, containsProp, createEventHook, createFilterWrapper, createRef, createSingletonPromise, debounceFilter, hasOwn, identity, increaseWithUnit, injectLocal, isClient, isDef, isIOS, isObject, isWorker, makeDestructurable, noop, notNullish, objectEntries, objectOmit, objectPick, pausableFilter, promiseTimeout, provideLocal, pxValue, syncRef, throttleFilter, timestamp, toArray, toRef, toRefs, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useDebounceFn, useIntervalFn, useThrottleFn, useTimeoutFn, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchWithFilter, whenever } from \"@vueuse/shared\";\nimport { Fragment, TransitionGroup, computed, customRef, defineComponent, getCurrentInstance, h, hasInjectionContext, inject, isReadonly, isRef, markRaw, nextTick, onBeforeUpdate, onMounted, onUpdated, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toValue, unref, watch, watchEffect } from \"vue\";\nexport * from \"@vueuse/shared\";\n//#region computedAsync/index.ts\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n\tvar _globalThis$reportErr;\n\tlet options;\n\tif (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };\n\telse options = optionsOrRef || {};\n\tconst { lazy = false, flush = \"sync\", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;\n\tconst started = shallowRef(!lazy);\n\tconst current = shallow ? shallowRef(initialState) : ref(initialState);\n\tlet counter = 0;\n\twatchEffect(async (onInvalidate) => {\n\t\tif (!started.value) return;\n\t\tcounter++;\n\t\tconst counterAtBeginning = counter;\n\t\tlet hasFinished = false;\n\t\tif (evaluating) Promise.resolve().then(() => {\n\t\t\tevaluating.value = true;\n\t\t});\n\t\ttry {\n\t\t\tconst result = await evaluationCallback((cancelCallback) => {\n\t\t\t\tonInvalidate(() => {\n\t\t\t\t\tif (evaluating) evaluating.value = false;\n\t\t\t\t\tif (!hasFinished) cancelCallback();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (counterAtBeginning === counter) current.value = result;\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (evaluating && counterAtBeginning === counter) evaluating.value = false;\n\t\t\thasFinished = true;\n\t\t}\n\t}, { flush });\n\tif (lazy) return computed(() => {\n\t\tstarted.value = true;\n\t\treturn current.value;\n\t});\n\telse return current;\n}\n/** @deprecated use `computedAsync` instead */\nconst asyncComputed = computedAsync;\n//#endregion\n//#region computedInject/index.ts\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n\tlet source = inject(key);\n\tif (defaultSource) source = inject(key, defaultSource);\n\tif (treatDefaultAsFactory) source = inject(key, defaultSource, treatDefaultAsFactory);\n\tif (typeof options === \"function\") return computed((oldValue) => options(source, oldValue));\n\telse return computed({\n\t\tget: (oldValue) => options.get(source, oldValue),\n\t\tset: options.set\n\t});\n}\n//#endregion\n//#region createReusableTemplate/index.ts\n/**\n* This function creates `define` and `reuse` components in pair,\n* It also allow to pass a generic to bind with type.\n*\n* @see https://vueuse.org/createReusableTemplate\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createReusableTemplate(options = {}) {\n\tconst { inheritAttrs = true, name = \"ReusableTemplate\" } = options;\n\tconst render = shallowRef();\n\tconst define = defineComponent({\n\t\tname: `${name}.define`,\n\t\tsetup(_, { slots }) {\n\t\t\treturn () => {\n\t\t\t\trender.value = slots.default;\n\t\t\t};\n\t\t}\n\t});\n\tconst reuse = defineComponent({\n\t\tinheritAttrs,\n\t\tname: `${name}.reuse`,\n\t\tprops: options.props,\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => {\n\t\t\t\tvar _render$value;\n\t\t\t\tif (!render.value && true) throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n\t\t\t\tconst vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {\n\t\t\t\t\t...options.props == null ? keysToCamelKebabCase(attrs) : props,\n\t\t\t\t\t$slots: slots\n\t\t\t\t});\n\t\t\t\treturn inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n\t\t\t};\n\t\t}\n\t});\n\treturn makeDestructurable({\n\t\tdefine,\n\t\treuse\n\t}, [define, reuse]);\n}\nfunction keysToCamelKebabCase(obj) {\n\tconst newObj = {};\n\tfor (const key in obj) newObj[camelize(key)] = obj[key];\n\treturn newObj;\n}\n//#endregion\n//#region createTemplatePromise/index.ts\n/**\n* Creates a template promise component.\n*\n* @see https://vueuse.org/createTemplatePromise\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createTemplatePromise(options = {}) {\n\tlet index = 0;\n\tconst instances = ref([]);\n\tfunction create(...args) {\n\t\tconst props = shallowReactive({\n\t\t\tkey: index++,\n\t\t\targs,\n\t\t\tpromise: void 0,\n\t\t\tresolve: () => {},\n\t\t\treject: () => {},\n\t\t\tisResolving: false,\n\t\t\toptions\n\t\t});\n\t\tinstances.value.push(props);\n\t\tprops.promise = new Promise((_resolve, _reject) => {\n\t\t\tprops.resolve = (v) => {\n\t\t\t\tprops.isResolving = true;\n\t\t\t\treturn _resolve(v);\n\t\t\t};\n\t\t\tprops.reject = _reject;\n\t\t}).finally(() => {\n\t\t\tprops.promise = void 0;\n\t\t\tconst index = instances.value.indexOf(props);\n\t\t\tif (index !== -1) instances.value.splice(index, 1);\n\t\t});\n\t\treturn props.promise;\n\t}\n\tfunction start(...args) {\n\t\tif (options.singleton && instances.value.length > 0) return instances.value[0].promise;\n\t\treturn create(...args);\n\t}\n\tconst component = defineComponent((_, { slots }) => {\n\t\tconst renderList = () => instances.value.map((props) => {\n\t\t\tvar _slots$default;\n\t\t\treturn h(Fragment, { key: props.key }, (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, props));\n\t\t});\n\t\tif (options.transition) return () => h(TransitionGroup, options.transition, renderList);\n\t\treturn renderList;\n\t});\n\tcomponent.start = start;\n\treturn component;\n}\n//#endregion\n//#region createUnrefFn/index.ts\n/**\n* Make a plain function accepting ref and raw values as arguments.\n* Returns the same value the unconverted function returns, with proper typing.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createUnrefFn(fn) {\n\treturn function(...args) {\n\t\treturn fn.apply(this, args.map((i) => toValue(i)));\n\t};\n}\n//#endregion\n//#region _configurable.ts\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n//#endregion\n//#region unrefElement/index.ts\n/**\n* Get the dom element of a ref of element or Vue component instance\n*\n* @param elRef\n*/\nfunction unrefElement(elRef) {\n\tvar _$el;\n\tconst plain = toValue(elRef);\n\treturn (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;\n}\n//#endregion\n//#region useEventListener/index.ts\nfunction useEventListener(...args) {\n\tconst register = (el, event, listener, options) => {\n\t\tel.addEventListener(event, listener, options);\n\t\treturn () => el.removeEventListener(event, listener, options);\n\t};\n\tconst firstParamTargets = computed(() => {\n\t\tconst test = toArray(toValue(args[0])).filter((e) => e != null);\n\t\treturn test.every((e) => typeof e !== \"string\") ? test : void 0;\n\t});\n\treturn watchImmediate(() => {\n\t\tvar _firstParamTargets$va, _firstParamTargets$va2;\n\t\treturn [\n\t\t\t(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),\n\t\t\ttoArray(toValue(firstParamTargets.value ? args[1] : args[0])),\n\t\t\ttoArray(unref(firstParamTargets.value ? args[2] : args[1])),\n\t\t\ttoValue(firstParamTargets.value ? args[3] : args[2])\n\t\t];\n\t}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {\n\t\tif (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;\n\t\tconst optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;\n\t\tconst cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));\n\t\tonCleanup(() => {\n\t\t\tcleanups.forEach((fn) => fn());\n\t\t});\n\t}, { flush: \"post\" });\n}\n//#endregion\n//#region onClickOutside/index.ts\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n\tconst { window = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;\n\tif (!window) return controls ? {\n\t\tstop: noop,\n\t\tcancel: noop,\n\t\ttrigger: noop\n\t} : noop;\n\tif (isIOS && !_iOSWorkaround) {\n\t\t_iOSWorkaround = true;\n\t\tconst listenerOptions = { passive: true };\n\t\tArray.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop, listenerOptions));\n\t\twindow.document.documentElement.addEventListener(\"click\", noop, listenerOptions);\n\t}\n\tlet shouldListen = true;\n\tconst shouldIgnore = (event) => {\n\t\treturn toValue(ignore).some((target) => {\n\t\t\tif (typeof target === \"string\") return Array.from(window.document.querySelectorAll(target)).some((el) => el === event.target || event.composedPath().includes(el));\n\t\t\telse {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\treturn el && (event.target === el || event.composedPath().includes(el));\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* Determines if the given target has multiple root elements.\n\t* Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21\n\t*/\n\tfunction hasMultipleRoots(target) {\n\t\tconst vm = toValue(target);\n\t\treturn vm && vm.$.subTree.shapeFlag === 16;\n\t}\n\tfunction checkMultipleRoots(target, event) {\n\t\tconst vm = toValue(target);\n\t\tconst children = vm.$.subTree && vm.$.subTree.children;\n\t\tif (children == null || !Array.isArray(children)) return false;\n\t\treturn children.some((child) => child.el === event.target || event.composedPath().includes(child.el));\n\t}\n\tconst listener = (event) => {\n\t\tconst el = unrefElement(target);\n\t\tif (event.target == null) return;\n\t\tif (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;\n\t\tif (!el || el === event.target || event.composedPath().includes(el)) return;\n\t\tif (\"detail\" in event && event.detail === 0) shouldListen = !shouldIgnore(event);\n\t\tif (!shouldListen) {\n\t\t\tshouldListen = true;\n\t\t\treturn;\n\t\t}\n\t\thandler(event);\n\t};\n\tlet isProcessingClick = false;\n\tconst cleanup = [\n\t\tuseEventListener(window, \"click\", (event) => {\n\t\t\tif (!isProcessingClick) {\n\t\t\t\tisProcessingClick = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tisProcessingClick = false;\n\t\t\t\t}, 0);\n\t\t\t\tlistener(event);\n\t\t\t}\n\t\t}, {\n\t\t\tpassive: true,\n\t\t\tcapture\n\t\t}),\n\t\tuseEventListener(window, \"pointerdown\", (e) => {\n\t\t\tconst el = unrefElement(target);\n\t\t\tshouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n\t\t}, { passive: true }),\n\t\tdetectIframe && useEventListener(window, \"blur\", (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\tlet activeEl = window.document.activeElement;\n\t\t\t\twhile (activeEl === null || activeEl === void 0 ? void 0 : activeEl.shadowRoot) activeEl = activeEl.shadowRoot.activeElement;\n\t\t\t\tif ((activeEl === null || activeEl === void 0 ? void 0 : activeEl.tagName) === \"IFRAME\" && !(el === null || el === void 0 ? void 0 : el.contains(window.document.activeElement))) handler(event);\n\t\t\t}, 0);\n\t\t}, { passive: true })\n\t].filter(Boolean);\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\tif (controls) return {\n\t\tstop,\n\t\tcancel: () => {\n\t\t\tshouldListen = false;\n\t\t},\n\t\ttrigger: (event) => {\n\t\t\tshouldListen = true;\n\t\t\tlistener(event);\n\t\t\tshouldListen = false;\n\t\t}\n\t};\n\treturn stop;\n}\n//#endregion\n//#region useMounted/index.ts\n/**\n* Mounted state in ref.\n*\n* @see https://vueuse.org/useMounted\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMounted() {\n\tconst isMounted = shallowRef(false);\n\tconst instance = getCurrentInstance();\n\tif (instance) onMounted(() => {\n\t\tisMounted.value = true;\n\t}, instance);\n\treturn isMounted;\n}\n//#endregion\n//#region useSupported/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSupported(callback) {\n\tconst isMounted = useMounted();\n\treturn computed(() => {\n\t\tisMounted.value;\n\t\treturn Boolean(callback());\n\t});\n}\n//#endregion\n//#region useMutationObserver/index.ts\n/**\n* Watch for changes being made to the DOM tree.\n*\n* @see https://vueuse.org/useMutationObserver\n* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN\n* @param target\n* @param callback\n* @param options\n*/\nfunction useMutationObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...mutationOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"MutationObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst items = toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t\treturn new Set(items);\n\t}), (newTargets) => {\n\t\tcleanup();\n\t\tif (isSupported.value && newTargets.size) {\n\t\t\tobserver = new MutationObserver(callback);\n\t\t\tnewTargets.forEach((el) => observer.observe(el, mutationOptions));\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst takeRecords = () => {\n\t\treturn observer === null || observer === void 0 ? void 0 : observer.takeRecords();\n\t};\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop,\n\t\ttakeRecords\n\t};\n}\n//#endregion\n//#region onElementRemoval/index.ts\n/**\n* Fires when the element or any element containing it is removed.\n*\n* @param target\n* @param callback\n* @param options\n*/\nfunction onElementRemoval(target, callback, options = {}) {\n\tconst { window = defaultWindow, document = window === null || window === void 0 ? void 0 : window.document, flush = \"sync\" } = options;\n\tif (!window || !document) return noop;\n\tlet stopFn;\n\tconst cleanupAndUpdate = (fn) => {\n\t\tstopFn === null || stopFn === void 0 || stopFn();\n\t\tstopFn = fn;\n\t};\n\tconst stopWatch = watchEffect(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (el) {\n\t\t\tconst { stop } = useMutationObserver(document, (mutationsList) => {\n\t\t\t\tif (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);\n\t\t\t}, {\n\t\t\t\twindow,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t\tcleanupAndUpdate(stop);\n\t\t}\n\t}, { flush });\n\tconst stopHandle = () => {\n\t\tstopWatch();\n\t\tcleanupAndUpdate();\n\t};\n\ttryOnScopeDispose(stopHandle);\n\treturn stopHandle;\n}\n//#endregion\n//#region onKeyStroke/index.ts\nfunction createKeyPredicate(keyFilter) {\n\tif (typeof keyFilter === \"function\") return keyFilter;\n\telse if (typeof keyFilter === \"string\") return (event) => event.key === keyFilter;\n\telse if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);\n\treturn () => true;\n}\nfunction onKeyStroke(...args) {\n\tlet key;\n\tlet handler;\n\tlet options = {};\n\tif (args.length === 3) {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t\toptions = args[2];\n\t} else if (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tkey = true;\n\t\thandler = args[0];\n\t\toptions = args[1];\n\t} else {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t}\n\telse {\n\t\tkey = true;\n\t\thandler = args[0];\n\t}\n\tconst { target = defaultWindow, eventName = \"keydown\", passive = false, dedupe = false } = options;\n\tconst predicate = createKeyPredicate(key);\n\tconst listener = (e) => {\n\t\tif (e.repeat && toValue(dedupe)) return;\n\t\tif (predicate(e)) handler(e);\n\t};\n\treturn useEventListener(target, eventName, listener, passive);\n}\n/**\n* Listen to the keydown event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyDown(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keydown\"\n\t});\n}\n/**\n* Listen to the keypress event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyPressed(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keypress\"\n\t});\n}\n/**\n* Listen to the keyup event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyUp(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keyup\"\n\t});\n}\n//#endregion\n//#region onLongPress/index.ts\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n\tvar _options$modifiers10, _options$modifiers11;\n\tconst elementRef = computed(() => unrefElement(target));\n\tlet timeout;\n\tlet posStart;\n\tlet startTimestamp;\n\tlet hasLongPressed = false;\n\tfunction clear() {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = void 0;\n\t\t}\n\t\tposStart = void 0;\n\t\tstartTimestamp = void 0;\n\t\thasLongPressed = false;\n\t}\n\tfunction getDelay(ev) {\n\t\tconst delay = options === null || options === void 0 ? void 0 : options.delay;\n\t\tif (typeof delay === \"function\") return delay(ev);\n\t\treturn delay !== null && delay !== void 0 ? delay : DEFAULT_DELAY;\n\t}\n\tfunction onRelease(ev) {\n\t\tvar _options$modifiers, _options$modifiers2, _options$modifiers3;\n\t\tconst [_startTimestamp, _posStart, _hasLongPressed] = [\n\t\t\tstartTimestamp,\n\t\t\tposStart,\n\t\t\thasLongPressed\n\t\t];\n\t\tclear();\n\t\tif (!(options === null || options === void 0 ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp) return;\n\t\tif ((options === null || options === void 0 || (_options$modifiers = options.modifiers) === null || _options$modifiers === void 0 ? void 0 : _options$modifiers.self) && ev.target !== elementRef.value) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers2 = options.modifiers) === null || _options$modifiers2 === void 0 ? void 0 : _options$modifiers2.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers3 = options.modifiers) === null || _options$modifiers3 === void 0 ? void 0 : _options$modifiers3.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - _posStart.x;\n\t\tconst dy = ev.y - _posStart.y;\n\t\tconst distance = Math.sqrt(dx * dx + dy * dy);\n\t\toptions.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed, ev);\n\t}\n\tfunction onDown(ev) {\n\t\tvar _options$modifiers4, _options$modifiers5, _options$modifiers6;\n\t\tif ((options === null || options === void 0 || (_options$modifiers4 = options.modifiers) === null || _options$modifiers4 === void 0 ? void 0 : _options$modifiers4.self) && ev.target !== elementRef.value) return;\n\t\tclear();\n\t\tif (options === null || options === void 0 || (_options$modifiers5 = options.modifiers) === null || _options$modifiers5 === void 0 ? void 0 : _options$modifiers5.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers6 = options.modifiers) === null || _options$modifiers6 === void 0 ? void 0 : _options$modifiers6.stop) ev.stopPropagation();\n\t\tposStart = {\n\t\t\tx: ev.x,\n\t\t\ty: ev.y\n\t\t};\n\t\tstartTimestamp = ev.timeStamp;\n\t\ttimeout = setTimeout(() => {\n\t\t\thasLongPressed = true;\n\t\t\thandler(ev);\n\t\t}, getDelay(ev));\n\t}\n\tfunction onMove(ev) {\n\t\tvar _options$modifiers7, _options$modifiers8, _options$modifiers9, _options$distanceThre;\n\t\tif ((options === null || options === void 0 || (_options$modifiers7 = options.modifiers) === null || _options$modifiers7 === void 0 ? void 0 : _options$modifiers7.self) && ev.target !== elementRef.value) return;\n\t\tif (!posStart || (options === null || options === void 0 ? void 0 : options.distanceThreshold) === false) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers8 = options.modifiers) === null || _options$modifiers8 === void 0 ? void 0 : _options$modifiers8.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers9 = options.modifiers) === null || _options$modifiers9 === void 0 ? void 0 : _options$modifiers9.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - posStart.x;\n\t\tconst dy = ev.y - posStart.y;\n\t\tif (Math.sqrt(dx * dx + dy * dy) >= ((_options$distanceThre = options === null || options === void 0 ? void 0 : options.distanceThreshold) !== null && _options$distanceThre !== void 0 ? _options$distanceThre : DEFAULT_THRESHOLD)) clear();\n\t}\n\tconst listenerOptions = {\n\t\tcapture: options === null || options === void 0 || (_options$modifiers10 = options.modifiers) === null || _options$modifiers10 === void 0 ? void 0 : _options$modifiers10.capture,\n\t\tonce: options === null || options === void 0 || (_options$modifiers11 = options.modifiers) === null || _options$modifiers11 === void 0 ? void 0 : _options$modifiers11.once\n\t};\n\tconst cleanup = [\n\t\tuseEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n\t\tuseEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n\t\tuseEventListener(elementRef, [\"pointerup\", \"pointerleave\"], onRelease, listenerOptions)\n\t];\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\treturn stop;\n}\n//#endregion\n//#region onStartTyping/index.ts\nfunction isFocusedElementEditable() {\n\tconst { activeElement, body } = document;\n\tif (!activeElement) return false;\n\tif (activeElement === body) return false;\n\tswitch (activeElement.tagName) {\n\t\tcase \"INPUT\":\n\t\tcase \"TEXTAREA\": return true;\n\t}\n\treturn activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({ keyCode, metaKey, ctrlKey, altKey }) {\n\tif (metaKey || ctrlKey || altKey) return false;\n\tif (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) return true;\n\tif (keyCode >= 65 && keyCode <= 90) return true;\n\treturn false;\n}\n/**\n* Fires when users start typing on non-editable elements.\n*\n* @see https://vueuse.org/onStartTyping\n* @param callback\n* @param options\n*/\nfunction onStartTyping(callback, options = {}) {\n\tconst { document = defaultDocument, isTypedCharValid: isTypedCharValidFn = isTypedCharValid, isFocusedElementEditable: isFocusedElementEditableFn = isFocusedElementEditable } = options;\n\tconst keydown = (event) => {\n\t\tif (!isFocusedElementEditableFn() && isTypedCharValidFn(event)) callback(event);\n\t};\n\tif (document) useEventListener(document, \"keydown\", keydown, { passive: true });\n}\n//#endregion\n//#region templateRef/index.ts\n/**\n* @deprecated Use Vue's built-in `useTemplateRef` instead.\n*\n* Shorthand for binding ref to template element.\n*\n* @see https://vueuse.org/templateRef\n* @param key\n* @param initialValue\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction templateRef(key, initialValue = null) {\n\tconst instance = getCurrentInstance();\n\tlet _trigger = () => {};\n\tconst element = customRef((track, trigger) => {\n\t\t_trigger = trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tvar _instance$proxy$$refs, _instance$proxy;\n\t\t\t\ttrack();\n\t\t\t\treturn (_instance$proxy$$refs = instance === null || instance === void 0 || (_instance$proxy = instance.proxy) === null || _instance$proxy === void 0 ? void 0 : _instance$proxy.$refs[key]) !== null && _instance$proxy$$refs !== void 0 ? _instance$proxy$$refs : initialValue;\n\t\t\t},\n\t\t\tset() {}\n\t\t};\n\t});\n\ttryOnMounted(_trigger);\n\tonUpdated(_trigger);\n\treturn element;\n}\n//#endregion\n//#region useActiveElement/index.ts\n/**\n* Reactive `document.activeElement`\n*\n* @see https://vueuse.org/useActiveElement\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useActiveElement(options = {}) {\n\tvar _options$document;\n\tconst { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;\n\tconst document = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window === null || window === void 0 ? void 0 : window.document;\n\tconst getDeepActiveElement = () => {\n\t\tlet element = document === null || document === void 0 ? void 0 : document.activeElement;\n\t\tif (deep) {\n\t\t\tvar _element$shadowRoot;\n\t\t\twhile (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement;\n\t\t}\n\t\treturn element;\n\t};\n\tconst activeElement = shallowRef();\n\tconst trigger = () => {\n\t\tactiveElement.value = getDeepActiveElement();\n\t};\n\tif (window) {\n\t\tconst listenerOptions = {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t};\n\t\tuseEventListener(window, \"blur\", (event) => {\n\t\t\tif (event.relatedTarget !== null) return;\n\t\t\ttrigger();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"focus\", trigger, listenerOptions);\n\t}\n\tif (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document });\n\ttrigger();\n\treturn activeElement;\n}\n//#endregion\n//#region useRafFn/index.ts\n/**\n* Call function on every `requestAnimationFrame`. With controls of pausing and resuming.\n*\n* @see https://vueuse.org/useRafFn\n* @param fn\n* @param options\n*/\nfunction useRafFn(fn, options = {}) {\n\tconst { immediate = true, fpsLimit = null, window = defaultWindow, once = false } = options;\n\tconst isActive = shallowRef(false);\n\tconst intervalLimit = computed(() => {\n\t\tconst limit = toValue(fpsLimit);\n\t\treturn limit ? 1e3 / limit : null;\n\t});\n\tlet previousFrameTimestamp = 0;\n\tlet rafId = null;\n\tfunction loop(timestamp) {\n\t\tif (!isActive.value || !window) return;\n\t\tif (!previousFrameTimestamp) previousFrameTimestamp = timestamp;\n\t\tconst delta = timestamp - previousFrameTimestamp;\n\t\tif (intervalLimit.value && delta < intervalLimit.value) {\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t\treturn;\n\t\t}\n\t\tpreviousFrameTimestamp = timestamp;\n\t\tfn({\n\t\t\tdelta,\n\t\t\ttimestamp\n\t\t});\n\t\tif (once) {\n\t\t\tisActive.value = false;\n\t\t\trafId = null;\n\t\t\treturn;\n\t\t}\n\t\trafId = window.requestAnimationFrame(loop);\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value && window) {\n\t\t\tisActive.value = true;\n\t\t\tpreviousFrameTimestamp = 0;\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tif (rafId != null && window) {\n\t\t\twindow.cancelAnimationFrame(rafId);\n\t\t\trafId = null;\n\t\t}\n\t}\n\tif (immediate) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useAnimate/index.ts\n/**\n* Reactive Web Animations API\n*\n* @see https://vueuse.org/useAnimate\n* @param target\n* @param keyframes\n* @param options\n*/\nfunction useAnimate(target, keyframes, options) {\n\tlet config;\n\tlet animateOptions;\n\tif (isObject(options)) {\n\t\tconfig = options;\n\t\tanimateOptions = objectOmit(options, [\n\t\t\t\"window\",\n\t\t\t\"immediate\",\n\t\t\t\"commitStyles\",\n\t\t\t\"persist\",\n\t\t\t\"onReady\",\n\t\t\t\"onError\"\n\t\t]);\n\t} else {\n\t\tconfig = { duration: options };\n\t\tanimateOptions = options;\n\t}\n\tconst { window = defaultWindow, immediate = true, commitStyles, persist, playbackRate: _playbackRate = 1, onReady, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = config;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n\tconst animate = shallowRef(void 0);\n\tconst store = shallowReactive({\n\t\tstartTime: null,\n\t\tcurrentTime: null,\n\t\ttimeline: null,\n\t\tplaybackRate: _playbackRate,\n\t\tpending: false,\n\t\tplayState: immediate ? \"idle\" : \"paused\",\n\t\treplaceState: \"active\"\n\t});\n\tconst pending = computed(() => store.pending);\n\tconst playState = computed(() => store.playState);\n\tconst replaceState = computed(() => store.replaceState);\n\tconst startTime = computed({\n\t\tget() {\n\t\t\treturn store.startTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.startTime = value;\n\t\t\tif (animate.value) animate.value.startTime = value;\n\t\t}\n\t});\n\tconst currentTime = computed({\n\t\tget() {\n\t\t\treturn store.currentTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.currentTime = value;\n\t\t\tif (animate.value) {\n\t\t\t\tanimate.value.currentTime = value;\n\t\t\t\tsyncResume();\n\t\t\t}\n\t\t}\n\t});\n\tconst timeline = computed({\n\t\tget() {\n\t\t\treturn store.timeline;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.timeline = value;\n\t\t\tif (animate.value) animate.value.timeline = value;\n\t\t}\n\t});\n\tconst playbackRate = computed({\n\t\tget() {\n\t\t\treturn store.playbackRate;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.playbackRate = value;\n\t\t\tif (animate.value) animate.value.playbackRate = value;\n\t\t}\n\t});\n\tconst play = () => {\n\t\tif (animate.value) try {\n\t\t\tanimate.value.play();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t\telse update();\n\t};\n\tconst pause = () => {\n\t\ttry {\n\t\t\tvar _animate$value;\n\t\t\t(_animate$value = animate.value) === null || _animate$value === void 0 || _animate$value.pause();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst reverse = () => {\n\t\tif (!animate.value) update();\n\t\ttry {\n\t\t\tvar _animate$value2;\n\t\t\t(_animate$value2 = animate.value) === null || _animate$value2 === void 0 || _animate$value2.reverse();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst finish = () => {\n\t\ttry {\n\t\t\tvar _animate$value3;\n\t\t\t(_animate$value3 = animate.value) === null || _animate$value3 === void 0 || _animate$value3.finish();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\ttry {\n\t\t\tvar _animate$value4;\n\t\t\t(_animate$value4 = animate.value) === null || _animate$value4 === void 0 || _animate$value4.cancel();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\twatch(() => unrefElement(target), (el) => {\n\t\tif (el) update(true);\n\t\telse animate.value = void 0;\n\t});\n\twatch(() => keyframes, (value) => {\n\t\tif (animate.value) {\n\t\t\tupdate();\n\t\t\tconst targetEl = unrefElement(target);\n\t\t\tif (targetEl) animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);\n\t\t}\n\t}, { deep: true });\n\ttryOnMounted(() => update(true), false);\n\ttryOnScopeDispose(cancel);\n\tfunction update(init) {\n\t\tconst el = unrefElement(target);\n\t\tif (!isSupported.value || !el) return;\n\t\tif (!animate.value) animate.value = el.animate(toValue(keyframes), animateOptions);\n\t\tif (persist) animate.value.persist();\n\t\tif (_playbackRate !== 1) animate.value.playbackRate = _playbackRate;\n\t\tif (init && !immediate) animate.value.pause();\n\t\telse syncResume();\n\t\tonReady === null || onReady === void 0 || onReady(animate.value);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(animate, [\n\t\t\"cancel\",\n\t\t\"finish\",\n\t\t\"remove\"\n\t], syncPause, listenerOptions);\n\tuseEventListener(animate, \"finish\", () => {\n\t\tvar _animate$value5;\n\t\tif (commitStyles) (_animate$value5 = animate.value) === null || _animate$value5 === void 0 || _animate$value5.commitStyles();\n\t}, listenerOptions);\n\tconst { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n\t\tif (!animate.value) return;\n\t\tstore.pending = animate.value.pending;\n\t\tstore.playState = animate.value.playState;\n\t\tstore.replaceState = animate.value.replaceState;\n\t\tstore.startTime = animate.value.startTime;\n\t\tstore.currentTime = animate.value.currentTime;\n\t\tstore.timeline = animate.value.timeline;\n\t\tstore.playbackRate = animate.value.playbackRate;\n\t}, { immediate: false });\n\tfunction syncResume() {\n\t\tif (isSupported.value) resumeRef();\n\t}\n\tfunction syncPause() {\n\t\tif (isSupported.value && window) window.requestAnimationFrame(pauseRef);\n\t}\n\treturn {\n\t\tisSupported,\n\t\tanimate,\n\t\tplay,\n\t\tpause,\n\t\treverse,\n\t\tfinish,\n\t\tcancel,\n\t\tpending,\n\t\tplayState,\n\t\treplaceState,\n\t\tstartTime,\n\t\tcurrentTime,\n\t\ttimeline,\n\t\tplaybackRate\n\t};\n}\n//#endregion\n//#region useAsyncQueue/index.ts\n/**\n* Asynchronous queue task controller.\n*\n* @see https://vueuse.org/useAsyncQueue\n* @param tasks\n* @param options\n*/\nfunction useAsyncQueue(tasks, options) {\n\tconst { interrupt = true, onError = noop, onFinished = noop, signal } = options || {};\n\tconst promiseState = {\n\t\taborted: \"aborted\",\n\t\tfulfilled: \"fulfilled\",\n\t\tpending: \"pending\",\n\t\trejected: \"rejected\"\n\t};\n\tconst result = reactive(Array.from(Array.from({ length: tasks.length }), () => ({\n\t\tstate: promiseState.pending,\n\t\tdata: null\n\t})));\n\tconst activeIndex = shallowRef(-1);\n\tif (!tasks || tasks.length === 0) {\n\t\tonFinished();\n\t\treturn {\n\t\t\tactiveIndex,\n\t\t\tresult\n\t\t};\n\t}\n\tfunction updateResult(state, res) {\n\t\tactiveIndex.value++;\n\t\tresult[activeIndex.value].data = res;\n\t\tresult[activeIndex.value].state = state;\n\t}\n\ttasks.reduce((prev, curr) => {\n\t\treturn prev.then((prevRes) => {\n\t\t\tvar _result$activeIndex$v;\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, /* @__PURE__ */ new Error(\"aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (((_result$activeIndex$v = result[activeIndex.value]) === null || _result$activeIndex$v === void 0 ? void 0 : _result$activeIndex$v.state) === promiseState.rejected && interrupt) {\n\t\t\t\tonFinished();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst done = curr(prevRes).then((currentRes) => {\n\t\t\t\tupdateResult(promiseState.fulfilled, currentRes);\n\t\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\t\treturn currentRes;\n\t\t\t});\n\t\t\tif (!signal) return done;\n\t\t\treturn Promise.race([done, whenAborted(signal)]);\n\t\t}).catch((e) => {\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, e);\n\t\t\t\treturn e;\n\t\t\t}\n\t\t\tupdateResult(promiseState.rejected, e);\n\t\t\tonError();\n\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\treturn e;\n\t\t});\n\t}, Promise.resolve());\n\treturn {\n\t\tactiveIndex,\n\t\tresult\n\t};\n}\nfunction whenAborted(signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst error = /* @__PURE__ */ new Error(\"aborted\");\n\t\tif (signal.aborted) reject(error);\n\t\telse signal.addEventListener(\"abort\", () => reject(error), { once: true });\n\t});\n}\n//#endregion\n//#region useAsyncState/index.ts\n/**\n* Reactive async state. Will not block your setup function and will trigger changes once\n* the promise is ready.\n*\n* @see https://vueuse.org/useAsyncState\n* @param promise The promise / async function to be resolved\n* @param initialState The initial state, used until the first evaluation finishes\n* @param options\n*/\nfunction useAsyncState(promise, initialState, options) {\n\tvar _globalThis$reportErr;\n\tconst { immediate = true, delay = 0, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop, onSuccess = noop, resetOnExecute = true, shallow = true, throwError } = options !== null && options !== void 0 ? options : {};\n\tconst state = shallow ? shallowRef(initialState) : ref(initialState);\n\tconst isReady = shallowRef(false);\n\tconst isLoading = shallowRef(false);\n\tconst error = shallowRef(void 0);\n\tlet executionsCount = 0;\n\tasync function execute(delay = 0, ...args) {\n\t\tconst executionId = executionsCount += 1;\n\t\tif (resetOnExecute) state.value = toValue(initialState);\n\t\terror.value = void 0;\n\t\tisReady.value = false;\n\t\tisLoading.value = true;\n\t\tif (delay > 0) await promiseTimeout(delay);\n\t\tconst _promise = typeof promise === \"function\" ? promise(...args) : promise;\n\t\ttry {\n\t\t\tconst data = await _promise;\n\t\t\tif (executionId === executionsCount) {\n\t\t\t\tstate.value = data;\n\t\t\t\tisReady.value = true;\n\t\t\t}\n\t\t\tonSuccess(data);\n\t\t\treturn data;\n\t\t} catch (e) {\n\t\t\tif (executionId === executionsCount) error.value = e;\n\t\t\tonError(e);\n\t\t\tif (throwError) throw e;\n\t\t} finally {\n\t\t\tif (executionId === executionsCount) isLoading.value = false;\n\t\t}\n\t}\n\tif (immediate) execute(delay);\n\tconst shell = {\n\t\tstate,\n\t\tisReady,\n\t\tisLoading,\n\t\terror,\n\t\texecute,\n\t\texecuteImmediate: (...args) => execute(0, ...args)\n\t};\n\tfunction waitUntilIsLoaded() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilIsLoaded().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\n//#endregion\n//#region useBase64/serialization.ts\nconst defaults = {\n\tarray: (v) => JSON.stringify(v),\n\tobject: (v) => JSON.stringify(v),\n\tset: (v) => JSON.stringify(Array.from(v)),\n\tmap: (v) => JSON.stringify(Object.fromEntries(v)),\n\tnull: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n\tif (!target) return defaults.null;\n\tif (target instanceof Map) return defaults.map;\n\telse if (target instanceof Set) return defaults.set;\n\telse if (Array.isArray(target)) return defaults.array;\n\telse return defaults.object;\n}\n//#endregion\n//#region useBase64/index.ts\nfunction useBase64(target, options) {\n\tconst base64 = shallowRef(\"\");\n\tconst promise = shallowRef();\n\tfunction execute() {\n\t\tif (!isClient) return;\n\t\tpromise.value = new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst _target = toValue(target);\n\t\t\t\tif (_target == null) resolve(\"\");\n\t\t\t\telse if (typeof _target === \"string\") resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n\t\t\t\telse if (_target instanceof Blob) resolve(blobToBase64(_target));\n\t\t\t\telse if (_target instanceof ArrayBuffer) resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n\t\t\t\telse if (_target instanceof HTMLCanvasElement) resolve(_target.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\telse if (_target instanceof HTMLImageElement) {\n\t\t\t\t\tconst img = _target.cloneNode(false);\n\t\t\t\t\timg.crossOrigin = \"Anonymous\";\n\t\t\t\t\timgLoaded(img).then(() => {\n\t\t\t\t\t\tconst canvas = document.createElement(\"canvas\");\n\t\t\t\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tresolve(canvas.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\t\t}).catch(reject);\n\t\t\t\t} else if (typeof _target === \"object\") {\n\t\t\t\t\tconst serialized = ((options === null || options === void 0 ? void 0 : options.serializer) || getDefaultSerialization(_target))(_target);\n\t\t\t\t\treturn resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n\t\t\t\t} else reject(/* @__PURE__ */ new Error(\"target is unsupported types\"));\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t\tpromise.value.then((res) => {\n\t\t\tbase64.value = (options === null || options === void 0 ? void 0 : options.dataUrl) === false ? res.replace(/^data:.*?;base64,/, \"\") : res;\n\t\t});\n\t\treturn promise.value;\n\t}\n\tif (isRef(target) || typeof target === \"function\") watch(target, execute, { immediate: true });\n\telse execute();\n\treturn {\n\t\tbase64,\n\t\tpromise,\n\t\texecute\n\t};\n}\nfunction imgLoaded(img) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (!img.complete) {\n\t\t\timg.onload = () => {\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\timg.onerror = reject;\n\t\t} else resolve();\n\t});\n}\nfunction blobToBase64(blob) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst fr = new FileReader();\n\t\tfr.onload = (e) => {\n\t\t\tresolve(e.target.result);\n\t\t};\n\t\tfr.onerror = reject;\n\t\tfr.readAsDataURL(blob);\n\t});\n}\n//#endregion\n//#region useBattery/index.ts\n/**\n* Reactive Battery Status API.\n*\n* @see https://vueuse.org/useBattery\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBattery(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst events = [\n\t\t\"chargingchange\",\n\t\t\"chargingtimechange\",\n\t\t\"dischargingtimechange\",\n\t\t\"levelchange\"\n\t];\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n\tconst charging = shallowRef(false);\n\tconst chargingTime = shallowRef(0);\n\tconst dischargingTime = shallowRef(0);\n\tconst level = shallowRef(1);\n\tlet battery;\n\tfunction updateBatteryInfo() {\n\t\tcharging.value = this.charging;\n\t\tchargingTime.value = this.chargingTime || 0;\n\t\tdischargingTime.value = this.dischargingTime || 0;\n\t\tlevel.value = this.level;\n\t}\n\tif (isSupported.value) navigator.getBattery().then((_battery) => {\n\t\tbattery = _battery;\n\t\tupdateBatteryInfo.call(battery);\n\t\tuseEventListener(battery, events, updateBatteryInfo, { passive: true });\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcharging,\n\t\tchargingTime,\n\t\tdischargingTime,\n\t\tlevel\n\t};\n}\n//#endregion\n//#region useBluetooth/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useBluetooth(options) {\n\tlet { acceptAllDevices = false } = options || {};\n\tconst { filters = void 0, optionalServices = void 0, navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"bluetooth\" in navigator);\n\tconst device = shallowRef();\n\tconst error = shallowRef(null);\n\twatch(device, () => {\n\t\tconnectToBluetoothGATTServer();\n\t});\n\tasync function requestDevice() {\n\t\tif (!isSupported.value) return;\n\t\terror.value = null;\n\t\tif (filters && filters.length > 0) acceptAllDevices = false;\n\t\ttry {\n\t\t\tdevice.value = await (navigator === null || navigator === void 0 ? void 0 : navigator.bluetooth.requestDevice({\n\t\t\t\tacceptAllDevices,\n\t\t\t\tfilters,\n\t\t\t\toptionalServices\n\t\t\t}));\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\tconst server = shallowRef();\n\tconst isConnected = shallowRef(false);\n\tfunction reset() {\n\t\tisConnected.value = false;\n\t\tdevice.value = void 0;\n\t\tserver.value = void 0;\n\t}\n\tasync function connectToBluetoothGATTServer() {\n\t\terror.value = null;\n\t\tif (device.value && device.value.gatt) {\n\t\t\tuseEventListener(device, \"gattserverdisconnected\", reset, { passive: true });\n\t\t\ttry {\n\t\t\t\tserver.value = await device.value.gatt.connect();\n\t\t\t\tisConnected.value = server.value.connected;\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t}\n\t}\n\ttryOnMounted(() => {\n\t\tvar _device$value$gatt;\n\t\tif (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.connect();\n\t});\n\ttryOnScopeDispose(() => {\n\t\tvar _device$value$gatt2;\n\t\tif (device.value) (_device$value$gatt2 = device.value.gatt) === null || _device$value$gatt2 === void 0 || _device$value$gatt2.disconnect();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisConnected: shallowReadonly(isConnected),\n\t\tdevice,\n\t\trequestDevice,\n\t\tserver,\n\t\terror\n\t};\n}\n//#endregion\n//#region useSSRWidth/index.ts\nconst ssrWidthSymbol = Symbol(\"vueuse-ssr-width\");\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSSRWidth() {\n\tconst ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;\n\treturn typeof ssrWidth === \"number\" ? ssrWidth : void 0;\n}\nfunction provideSSRWidth(width, app) {\n\tif (app !== void 0) app.provide(ssrWidthSymbol, width);\n\telse provideLocal(ssrWidthSymbol, width);\n}\n//#endregion\n//#region useMediaQuery/index.ts\n/**\n* Reactive Media Query.\n*\n* @see https://vueuse.org/useMediaQuery\n* @param query\n* @param options\n*/\nfunction useMediaQuery(query, options = {}) {\n\tconst { window = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n\tconst ssrSupport = shallowRef(typeof ssrWidth === \"number\");\n\tconst mediaQuery = shallowRef();\n\tconst matches = shallowRef(false);\n\tconst handler = (event) => {\n\t\tmatches.value = event.matches;\n\t};\n\twatchEffect(() => {\n\t\tif (ssrSupport.value) {\n\t\t\tssrSupport.value = !isSupported.value;\n\t\t\tconst queryStrings = toValue(query).split(\",\");\n\t\t\tmatches.value = queryStrings.some((queryString) => {\n\t\t\t\tconst not = queryString.includes(\"not all\");\n\t\t\t\tconst minWidth = queryString.match(/\\(\\s*min-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tconst maxWidth = queryString.match(/\\(\\s*max-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tlet res = Boolean(minWidth || maxWidth);\n\t\t\t\tif (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);\n\t\t\t\tif (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);\n\t\t\t\treturn not ? !res : res;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!isSupported.value) return;\n\t\tmediaQuery.value = window.matchMedia(toValue(query));\n\t\tmatches.value = mediaQuery.value.matches;\n\t});\n\tuseEventListener(mediaQuery, \"change\", handler, { passive: true });\n\treturn computed(() => matches.value);\n}\n//#endregion\n//#region useBreakpoints/breakpoints.ts\n/**\n* Breakpoints from Tailwind V2\n*\n* @see https://tailwindcss.com/docs/breakpoints\n*/\nconst breakpointsTailwind = {\n\t\"sm\": 640,\n\t\"md\": 768,\n\t\"lg\": 1024,\n\t\"xl\": 1280,\n\t\"2xl\": 1536\n};\n/**\n* Breakpoints from Bootstrap V5\n*\n* @see https://getbootstrap.com/docs/5.0/layout/breakpoints\n*/\nconst breakpointsBootstrapV5 = {\n\txs: 0,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1400\n};\n/**\n* Breakpoints from Vuetify V2\n*\n* @see https://v2.vuetifyjs.com/en/features/breakpoints/\n*/\nconst breakpointsVuetifyV2 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1264,\n\txl: 1904\n};\n/**\n* Breakpoints from Vuetify V3\n*\n* @see https://vuetifyjs.com/en/styles/float/#overview\n*/\nconst breakpointsVuetifyV3 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1280,\n\txl: 1920,\n\txxl: 2560\n};\n/**\n* Alias to `breakpointsVuetifyV2`\n*\n* @deprecated explictly use `breakpointsVuetifyV2` or `breakpointsVuetifyV3` instead\n*/\nconst breakpointsVuetify = breakpointsVuetifyV2;\n/**\n* Breakpoints from Ant Design\n*\n* @see https://ant.design/components/layout/#breakpoint-width\n*/\nconst breakpointsAntDesign = {\n\txs: 480,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1600\n};\n/**\n* Breakpoints from Quasar V2\n*\n* @see https://quasar.dev/style/breakpoints\n*/\nconst breakpointsQuasar = {\n\txs: 0,\n\tsm: 600,\n\tmd: 1024,\n\tlg: 1440,\n\txl: 1920\n};\n/**\n* Sematic Breakpoints\n*/\nconst breakpointsSematic = {\n\tmobileS: 320,\n\tmobileM: 375,\n\tmobileL: 425,\n\ttablet: 768,\n\tlaptop: 1024,\n\tlaptopL: 1440,\n\tdesktop4K: 2560\n};\n/**\n* Breakpoints from Master CSS\n*\n* @see https://docs.master.co/css/breakpoints\n*/\nconst breakpointsMasterCss = {\n\t\"3xs\": 360,\n\t\"2xs\": 480,\n\t\"xs\": 600,\n\t\"sm\": 768,\n\t\"md\": 1024,\n\t\"lg\": 1280,\n\t\"xl\": 1440,\n\t\"2xl\": 1600,\n\t\"3xl\": 1920,\n\t\"4xl\": 2560\n};\n/**\n* Breakpoints from PrimeFlex\n*\n* @see https://primeflex.org/installation\n*/\nconst breakpointsPrimeFlex = {\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200\n};\n/**\n* Breakpoints from ElementUI/ElementPlus\n*\n* @see https://element.eleme.io/#/en-US/component/layout\n* @see https://element-plus.org/en-US/component/layout.html\n*/\nconst breakpointsElement = {\n\txs: 0,\n\tsm: 768,\n\tmd: 992,\n\tlg: 1200,\n\txl: 1920\n};\n//#endregion\n//#region useBreakpoints/index.ts\n/**\n* Reactively viewport breakpoints\n*\n* @see https://vueuse.org/useBreakpoints\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBreakpoints(breakpoints, options = {}) {\n\tfunction getValue(k, delta) {\n\t\tlet v = toValue(breakpoints[toValue(k)]);\n\t\tif (delta != null) v = increaseWithUnit(v, delta);\n\t\tif (typeof v === \"number\") v = `${v}px`;\n\t\treturn v;\n\t}\n\tconst { window = defaultWindow, strategy = \"min-width\", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst ssrSupport = typeof ssrWidth === \"number\";\n\tconst mounted = ssrSupport ? shallowRef(false) : { value: true };\n\tif (ssrSupport) tryOnMounted(() => mounted.value = !!window);\n\tfunction match(query, size) {\n\t\tif (!mounted.value && ssrSupport) return query === \"min\" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);\n\t\tif (!window) return false;\n\t\treturn window.matchMedia(`(${query}-width: ${size})`).matches;\n\t}\n\tconst greaterOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n\t};\n\tconst smallerOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n\t};\n\tconst shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n\t\tObject.defineProperty(shortcuts, k, {\n\t\t\tget: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\treturn shortcuts;\n\t}, {});\n\tfunction current() {\n\t\tconst points = Object.keys(breakpoints).map((k) => [\n\t\t\tk,\n\t\t\tshortcutMethods[k],\n\t\t\tpxValue(getValue(k))\n\t\t]).sort((a, b) => a[2] - b[2]);\n\t\treturn computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n\t}\n\treturn Object.assign(shortcutMethods, {\n\t\tgreaterOrEqual,\n\t\tsmallerOrEqual,\n\t\tgreater(k) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(k, .1)})`, options);\n\t\t},\n\t\tsmaller(k) {\n\t\t\treturn useMediaQuery(() => `(max-width: ${getValue(k, -.1)})`, options);\n\t\t},\n\t\tbetween(a, b) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -.1)})`, options);\n\t\t},\n\t\tisGreater(k) {\n\t\t\treturn match(\"min\", getValue(k, .1));\n\t\t},\n\t\tisGreaterOrEqual(k) {\n\t\t\treturn match(\"min\", getValue(k));\n\t\t},\n\t\tisSmaller(k) {\n\t\t\treturn match(\"max\", getValue(k, -.1));\n\t\t},\n\t\tisSmallerOrEqual(k) {\n\t\t\treturn match(\"max\", getValue(k));\n\t\t},\n\t\tisInBetween(a, b) {\n\t\t\treturn match(\"min\", getValue(a)) && match(\"max\", getValue(b, -.1));\n\t\t},\n\t\tcurrent,\n\t\tactive() {\n\t\t\tconst bps = current();\n\t\t\treturn computed(() => bps.value.length === 0 ? \"\" : bps.value.at(strategy === \"min-width\" ? -1 : 0));\n\t\t}\n\t});\n}\n//#endregion\n//#region useBroadcastChannel/index.ts\n/**\n* Reactive BroadcastChannel\n*\n* @see https://vueuse.org/useBroadcastChannel\n* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n* @param options\n*\n*/\nfunction useBroadcastChannel(options) {\n\tconst { name, window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"BroadcastChannel\" in window);\n\tconst isClosed = shallowRef(false);\n\tconst channel = shallowRef();\n\tconst data = shallowRef();\n\tconst error = shallowRef(null);\n\tconst post = (data) => {\n\t\tif (channel.value) channel.value.postMessage(data);\n\t};\n\tconst close = () => {\n\t\tif (channel.value) channel.value.close();\n\t\tisClosed.value = true;\n\t};\n\tif (isSupported.value) tryOnMounted(() => {\n\t\terror.value = null;\n\t\tchannel.value = new BroadcastChannel(name);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(channel, \"message\", (e) => {\n\t\t\tdata.value = e.data;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"messageerror\", (e) => {\n\t\t\terror.value = e;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"close\", () => {\n\t\t\tisClosed.value = true;\n\t\t}, listenerOptions);\n\t});\n\ttryOnScopeDispose(() => {\n\t\tclose();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tchannel,\n\t\tdata,\n\t\tpost,\n\t\tclose,\n\t\terror,\n\t\tisClosed\n\t};\n}\n//#endregion\n//#region useBrowserLocation/index.ts\nconst WRITABLE_PROPERTIES = [\n\t\"hash\",\n\t\"host\",\n\t\"hostname\",\n\t\"href\",\n\t\"pathname\",\n\t\"port\",\n\t\"protocol\",\n\t\"search\"\n];\n/**\n* Reactive browser location.\n*\n* @see https://vueuse.org/useBrowserLocation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBrowserLocation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst refs = Object.fromEntries(WRITABLE_PROPERTIES.map((key) => [key, ref()]));\n\tconst buildState = (trigger) => {\n\t\tvar _window$location;\n\t\tconst { state, length } = (window === null || window === void 0 ? void 0 : window.history) || {};\n\t\tconst { origin } = (window === null || window === void 0 ? void 0 : window.location) || {};\n\t\tfor (const key of WRITABLE_PROPERTIES) refs[key].value = window === null || window === void 0 || (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location[key];\n\t\treturn reactive({\n\t\t\ttrigger,\n\t\t\tstate,\n\t\t\tlength,\n\t\t\torigin,\n\t\t\t...refs\n\t\t});\n\t};\n\tconst state = ref(buildState(\"load\"));\n\tfor (const [key, ref] of objectEntries(refs)) watch(ref, (value) => {\n\t\tif (!(window === null || window === void 0 ? void 0 : window.location) || window.location[key] === value) return;\n\t\twindow.location[key] = value;\n\t});\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), listenerOptions);\n\t\tuseEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), listenerOptions);\n\t}\n\treturn state;\n}\n//#endregion\n//#region useCached/index.ts\nfunction useCached(refValue, comparator = (newSourceValue, cachedValue) => newSourceValue === cachedValue, options) {\n\tconst { deepRefs = true, ...watchOptions } = options || {};\n\tconst cachedValue = createRef(refValue.value, deepRefs);\n\twatch(() => refValue.value, (value) => {\n\t\tif (!comparator(value, cachedValue.value)) cachedValue.value = value;\n\t}, watchOptions);\n\treturn cachedValue;\n}\n//#endregion\n//#region usePermission/index.ts\n/**\n* Reactive Permissions API.\n*\n* @see https://vueuse.org/usePermission\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePermission(permissionDesc, options = {}) {\n\tconst { controls = false, navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"permissions\" in navigator);\n\tconst permissionStatus = shallowRef();\n\tconst desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n\tconst state = shallowRef();\n\tconst update = () => {\n\t\tvar _permissionStatus$val, _permissionStatus$val2;\n\t\tstate.value = (_permissionStatus$val = (_permissionStatus$val2 = permissionStatus.value) === null || _permissionStatus$val2 === void 0 ? void 0 : _permissionStatus$val2.state) !== null && _permissionStatus$val !== void 0 ? _permissionStatus$val : \"prompt\";\n\t};\n\tuseEventListener(permissionStatus, \"change\", update, { passive: true });\n\tconst query = createSingletonPromise(async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionStatus.value) try {\n\t\t\tpermissionStatus.value = await navigator.permissions.query(desc);\n\t\t} catch (_unused) {\n\t\t\tpermissionStatus.value = void 0;\n\t\t} finally {\n\t\t\tupdate();\n\t\t}\n\t\tif (controls) return toRaw(permissionStatus.value);\n\t});\n\tquery();\n\tif (controls) return {\n\t\tstate,\n\t\tisSupported,\n\t\tquery\n\t};\n\telse return state;\n}\n//#endregion\n//#region useClipboard/index.ts\nfunction useClipboard(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;\n\tconst isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst permissionRead = usePermission(\"clipboard-read\");\n\tconst permissionWrite = usePermission(\"clipboard-write\");\n\tconst isSupported = computed(() => isClipboardApiSupported.value || legacy);\n\tconst text = shallowRef(\"\");\n\tconst copied = shallowRef(false);\n\tconst copyPending = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tlet lastLegacyId = 0;\n\tasync function updateText() {\n\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));\n\t\tif (!useLegacy) try {\n\t\t\ttext.value = await navigator.clipboard.readText();\n\t\t} catch (_unused) {\n\t\t\tuseLegacy = true;\n\t\t}\n\t\tif (useLegacy) text.value = legacyRead();\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateText, { passive: true });\n\tasync function copy(value) {\n\t\tconst resolvedValue = value !== null && value !== void 0 ? value : toValue(source);\n\t\tif (isSupported.value && resolvedValue != null) {\n\t\t\tcopyPending.value = true;\n\t\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));\n\t\t\tif (!useLegacy) try {\n\t\t\t\tconst clipboardItem = createClipboardItem(resolvedValue);\n\t\t\t\tawait navigator.clipboard.write([clipboardItem]);\n\t\t\t} catch (_unused2) {\n\t\t\t\tuseLegacy = true;\n\t\t\t}\n\t\t\tif (useLegacy) if (typeof resolvedValue === \"string\") {\n\t\t\t\ttext.value = resolvedValue;\n\t\t\t\tlegacyCopy(resolvedValue);\n\t\t\t} else {\n\t\t\t\tconst currentId = ++lastLegacyId;\n\t\t\t\tconst resolvedText = await resolvedValue();\n\t\t\t\tif (resolvedText != null && currentId === lastLegacyId) {\n\t\t\t\t\ttext.value = resolvedText;\n\t\t\t\t\tlegacyCopy(resolvedText);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t\tcopyPending.value = false;\n\t\t}\n\t}\n\tfunction createClipboardItem(value) {\n\t\tif (typeof value === \"string\") {\n\t\t\ttext.value = value;\n\t\t\treturn new ClipboardItem({ \"text/plain\": value });\n\t\t} else return new ClipboardItem({ \"text/plain\": value().then((resolvedText = \"\") => {\n\t\t\ttext.value = resolvedText;\n\t\t\treturn new Blob([resolvedText], { type: \"text/plain\" });\n\t\t}) });\n\t}\n\tfunction legacyCopy(value) {\n\t\tconst ta = document.createElement(\"textarea\");\n\t\tta.value = value;\n\t\tta.style.position = \"absolute\";\n\t\tta.style.opacity = \"0\";\n\t\tta.setAttribute(\"readonly\", \"\");\n\t\tdocument.body.appendChild(ta);\n\t\tta.select();\n\t\tdocument.execCommand(\"copy\");\n\t\tta.remove();\n\t}\n\tfunction legacyRead() {\n\t\tvar _document$getSelectio, _document, _document$getSelectio2;\n\t\treturn (_document$getSelectio = (_document = document) === null || _document === void 0 || (_document$getSelectio2 = _document.getSelection) === null || _document$getSelectio2 === void 0 || (_document$getSelectio2 = _document$getSelectio2.call(_document)) === null || _document$getSelectio2 === void 0 ? void 0 : _document$getSelectio2.toString()) !== null && _document$getSelectio !== void 0 ? _document$getSelectio : \"\";\n\t}\n\tfunction isAllowed(status) {\n\t\treturn status === \"granted\" || status === \"prompt\";\n\t}\n\treturn {\n\t\tcopyPending: shallowReadonly(copyPending),\n\t\tisSupported,\n\t\ttext: shallowReadonly(text),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy\n\t};\n}\n//#endregion\n//#region useClipboardItems/index.ts\nfunction useClipboardItems(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst content = shallowRef([]);\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tfunction updateContent() {\n\t\tif (isSupported.value) navigator.clipboard.read().then((items) => {\n\t\t\tcontent.value = items;\n\t\t});\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateContent, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tawait navigator.clipboard.write(value);\n\t\t\tcontent.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\treturn {\n\t\tisSupported,\n\t\tcontent: shallowReadonly(content),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy,\n\t\tread: updateContent\n\t};\n}\n//#endregion\n//#region useCloned/index.ts\nfunction cloneFnJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n\tconst cloned = ref({});\n\tconst isModified = shallowRef(false);\n\tlet _lastSync = false;\n\tconst { manual, clone = cloneFnJSON, deep = true, immediate = true } = options;\n\twatch(cloned, () => {\n\t\tif (_lastSync) {\n\t\t\t_lastSync = false;\n\t\t\treturn;\n\t\t}\n\t\tisModified.value = true;\n\t}, {\n\t\tdeep: true,\n\t\tflush: \"sync\"\n\t});\n\tfunction sync() {\n\t\t_lastSync = true;\n\t\tisModified.value = false;\n\t\tcloned.value = clone(toValue(source));\n\t}\n\tif (!manual && (isRef(source) || typeof source === \"function\")) watch(source, sync, {\n\t\t...options,\n\t\tdeep,\n\t\timmediate\n\t});\n\telse sync();\n\treturn {\n\t\tcloned,\n\t\tisModified,\n\t\tsync\n\t};\n}\n//#endregion\n//#region ssr-handlers.ts\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* #__PURE__ */ getHandlers();\nfunction getHandlers() {\n\tif (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};\n\treturn _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n\treturn handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n\thandlers[key] = fn;\n}\n//#endregion\n//#region usePreferredDark/index.ts\n/**\n* Reactive dark theme preference.\n*\n* @see https://vueuse.org/usePreferredDark\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredDark(options) {\n\treturn useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n//#endregion\n//#region useStorage/guess.ts\nfunction guessSerializerType(rawInit) {\n\treturn rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n//#endregion\n//#region useStorage/index.ts\nconst StorageSerializers = {\n\tboolean: {\n\t\tread: (v) => v === \"true\",\n\t\twrite: (v) => String(v)\n\t},\n\tobject: {\n\t\tread: (v) => JSON.parse(v),\n\t\twrite: (v) => JSON.stringify(v)\n\t},\n\tnumber: {\n\t\tread: (v) => Number.parseFloat(v),\n\t\twrite: (v) => String(v)\n\t},\n\tany: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tstring: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tmap: {\n\t\tread: (v) => new Map(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v.entries()))\n\t},\n\tset: {\n\t\tread: (v) => new Set(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v))\n\t},\n\tdate: {\n\t\tread: (v) => new Date(v),\n\t\twrite: (v) => v.toISOString()\n\t}\n};\nconst customStorageEventName = \"vueuse-storage\";\n/**\n* Reactive LocalStorage/SessionStorage.\n*\n* @see https://vueuse.org/useStorage\n*/\nfunction useStorage(key, defaults, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, initOnMounted } = options;\n\tconst data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n\tconst keyComputed = computed(() => toValue(key));\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorage\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tif (!storage) return data;\n\tconst rawInit = toValue(defaults);\n\tconst type = guessSerializerType(rawInit);\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tconst { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\twatch(keyComputed, () => update(), { flush });\n\tlet firstMounted = false;\n\tconst onStorageEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdate(ev);\n\t};\n\tconst onStorageCustomEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdateFromCustomEvent(ev);\n\t};\n\t/**\n\t* The custom event is needed for same-document syncing when using custom\n\t* storage backends, but it doesn't work across different documents.\n\t*\n\t* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.\n\t*/\n\tif (window && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window, \"storage\", onStorageEvent, { passive: true });\n\telse useEventListener(window, customStorageEventName, onStorageCustomEvent);\n\tif (initOnMounted) tryOnMounted(() => {\n\t\tfirstMounted = true;\n\t\tupdate();\n\t});\n\telse update();\n\tfunction dispatchWriteEvent(oldValue, newValue) {\n\t\tif (window) {\n\t\t\tconst payload = {\n\t\t\t\tkey: keyComputed.value,\n\t\t\t\toldValue,\n\t\t\t\tnewValue,\n\t\t\t\tstorageArea: storage\n\t\t\t};\n\t\t\twindow.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, { detail: payload }));\n\t\t}\n\t}\n\tfunction write(v) {\n\t\ttry {\n\t\t\tconst oldValue = storage.getItem(keyComputed.value);\n\t\t\tif (v == null) {\n\t\t\t\tdispatchWriteEvent(oldValue, null);\n\t\t\t\tstorage.removeItem(keyComputed.value);\n\t\t\t} else {\n\t\t\t\tconst serialized = serializer.write(v);\n\t\t\t\tif (oldValue !== serialized) {\n\t\t\t\t\tstorage.setItem(keyComputed.value, serialized);\n\t\t\t\t\tdispatchWriteEvent(oldValue, serialized);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tfunction read(event) {\n\t\tconst rawValue = event ? event.newValue : storage.getItem(keyComputed.value);\n\t\tif (rawValue == null) {\n\t\t\tif (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));\n\t\t\treturn rawInit;\n\t\t} else if (!event && mergeDefaults) {\n\t\t\tconst value = serializer.read(rawValue);\n\t\t\tif (typeof mergeDefaults === \"function\") return mergeDefaults(value, rawInit);\n\t\t\telse if (type === \"object\" && !Array.isArray(value)) return {\n\t\t\t\t...rawInit,\n\t\t\t\t...value\n\t\t\t};\n\t\t\treturn value;\n\t\t} else if (typeof rawValue !== \"string\") return rawValue;\n\t\telse return serializer.read(rawValue);\n\t}\n\tfunction update(event) {\n\t\tif (event && event.storageArea !== storage) return;\n\t\tif (event && event.key == null) {\n\t\t\tdata.value = rawInit;\n\t\t\treturn;\n\t\t}\n\t\tif (event && event.key !== keyComputed.value) return;\n\t\tpauseWatch();\n\t\ttry {\n\t\t\tconst serializedData = serializer.write(data.value);\n\t\t\tif (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (event) nextTick(resumeWatch);\n\t\t\telse resumeWatch();\n\t\t}\n\t}\n\tfunction updateFromCustomEvent(event) {\n\t\tupdate(event.detail);\n\t}\n\treturn data;\n}\n//#endregion\n//#region useColorMode/index.ts\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n/**\n* Reactive color mode with auto data persistence.\n*\n* @see https://vueuse.org/useColorMode\n* @param options\n*/\nfunction useColorMode(options = {}) {\n\tconst { selector = \"html\", attribute = \"class\", initialValue = \"auto\", window = defaultWindow, storage, storageKey = \"vueuse-color-scheme\", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;\n\tconst modes = {\n\t\tauto: \"\",\n\t\tlight: \"light\",\n\t\tdark: \"dark\",\n\t\t...options.modes || {}\n\t};\n\tconst preferredDark = usePreferredDark({ window });\n\tconst system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n\tconst store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {\n\t\twindow,\n\t\tlistenToStorageChanges\n\t}));\n\tconst state = computed(() => store.value === \"auto\" ? system.value : store.value);\n\tconst updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector, attribute, value) => {\n\t\tconst el = typeof selector === \"string\" ? window === null || window === void 0 ? void 0 : window.document.querySelector(selector) : unrefElement(selector);\n\t\tif (!el) return;\n\t\tconst classesToAdd = /* @__PURE__ */ new Set();\n\t\tconst classesToRemove = /* @__PURE__ */ new Set();\n\t\tlet attributeToChange = null;\n\t\tif (attribute === \"class\") {\n\t\t\tconst current = value.split(/\\s/g);\n\t\t\tObject.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n\t\t\t\tif (current.includes(v)) classesToAdd.add(v);\n\t\t\t\telse classesToRemove.add(v);\n\t\t\t});\n\t\t} else attributeToChange = {\n\t\t\tkey: attribute,\n\t\t\tvalue\n\t\t};\n\t\tif (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;\n\t\tlet style;\n\t\tif (disableTransition) {\n\t\t\tstyle = window.document.createElement(\"style\");\n\t\t\tstyle.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n\t\t\twindow.document.head.appendChild(style);\n\t\t}\n\t\tfor (const c of classesToAdd) el.classList.add(c);\n\t\tfor (const c of classesToRemove) el.classList.remove(c);\n\t\tif (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);\n\t\tif (disableTransition) {\n\t\t\twindow.getComputedStyle(style).opacity;\n\t\t\tdocument.head.removeChild(style);\n\t\t}\n\t});\n\tfunction defaultOnChanged(mode) {\n\t\tvar _modes$mode;\n\t\tupdateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);\n\t}\n\tfunction onChanged(mode) {\n\t\tif (options.onChanged) options.onChanged(mode, defaultOnChanged);\n\t\telse defaultOnChanged(mode);\n\t}\n\twatch(state, onChanged, {\n\t\tflush: \"post\",\n\t\timmediate: true\n\t});\n\ttryOnMounted(() => onChanged(state.value));\n\tconst auto = computed({\n\t\tget() {\n\t\t\treturn emitAuto ? store.value : state.value;\n\t\t},\n\t\tset(v) {\n\t\t\tstore.value = v;\n\t\t}\n\t});\n\treturn Object.assign(auto, {\n\t\tstore,\n\t\tsystem,\n\t\tstate\n\t});\n}\n//#endregion\n//#region useConfirmDialog/index.ts\n/**\n* Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.\n*\n* @see https://vueuse.org/useConfirmDialog/\n* @param revealed `boolean` `ref` that handles a modal window\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useConfirmDialog(revealed = shallowRef(false)) {\n\tconst confirmHook = createEventHook();\n\tconst cancelHook = createEventHook();\n\tconst revealHook = createEventHook();\n\tlet _resolve = noop;\n\tconst reveal = (data) => {\n\t\trevealHook.trigger(data);\n\t\trevealed.value = true;\n\t\treturn new Promise((resolve) => {\n\t\t\t_resolve = resolve;\n\t\t});\n\t};\n\tconst confirm = (data) => {\n\t\trevealed.value = false;\n\t\tconfirmHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: false\n\t\t});\n\t};\n\tconst cancel = (data) => {\n\t\trevealed.value = false;\n\t\tcancelHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: true\n\t\t});\n\t};\n\treturn {\n\t\tisRevealed: computed(() => revealed.value),\n\t\treveal,\n\t\tconfirm,\n\t\tcancel,\n\t\tonReveal: revealHook.on,\n\t\tonConfirm: confirmHook.on,\n\t\tonCancel: cancelHook.on\n\t};\n}\n//#endregion\n//#region useCountdown/index.ts\nfunction getDefaultScheduler$8(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = 1e3, immediate = false } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive countdown timer in seconds.\n*\n* @param initialCountdown\n* @param options\n*\n* @see https://vueuse.org/useCountdown\n*/\nfunction useCountdown(initialCountdown, options = {}) {\n\tconst remaining = shallowRef(toValue(initialCountdown));\n\tconst { scheduler = getDefaultScheduler$8(options), onTick, onComplete } = options;\n\tconst controls = scheduler(() => {\n\t\tconst value = remaining.value - 1;\n\t\tremaining.value = value < 0 ? 0 : value;\n\t\tonTick === null || onTick === void 0 || onTick();\n\t\tif (remaining.value <= 0) {\n\t\t\tcontrols.pause();\n\t\t\tonComplete === null || onComplete === void 0 || onComplete();\n\t\t}\n\t});\n\tconst reset = (countdown) => {\n\t\tvar _toValue;\n\t\tremaining.value = (_toValue = toValue(countdown)) !== null && _toValue !== void 0 ? _toValue : toValue(initialCountdown);\n\t};\n\tconst stop = () => {\n\t\tcontrols.pause();\n\t\treset();\n\t};\n\tconst resume = () => {\n\t\tif (!controls.isActive.value) {\n\t\t\tif (remaining.value > 0) controls.resume();\n\t\t}\n\t};\n\tconst start = (countdown) => {\n\t\treset(countdown);\n\t\tcontrols.resume();\n\t};\n\treturn {\n\t\tremaining,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tpause: controls.pause,\n\t\tresume,\n\t\tisActive: controls.isActive\n\t};\n}\n//#endregion\n//#region useCssSupports/index.ts\nfunction useCssSupports(...args) {\n\tlet options = {};\n\tif (typeof toValue(args.at(-1)) === \"object\") options = args.pop();\n\tconst [prop, value] = args;\n\tconst { window = defaultWindow, ssrValue = false } = options;\n\tconst isMounted = useMounted();\n\treturn { isSupported: computed(() => {\n\t\tif (!isClient || !isMounted.value) return ssrValue;\n\t\treturn args.length === 2 ? window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop), toValue(value)) : window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop));\n\t}) };\n}\n//#endregion\n//#region useCssVar/index.ts\n/**\n* Manipulate CSS variables.\n*\n* @see https://vueuse.org/useCssVar\n* @param prop\n* @param target\n* @param options\n*/\nfunction useCssVar(prop, target, options = {}) {\n\tconst { window = defaultWindow, initialValue, observe = false } = options;\n\tconst variable = shallowRef(initialValue);\n\tconst elRef = computed(() => {\n\t\tvar _window$document;\n\t\treturn unrefElement(target) || (window === null || window === void 0 || (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);\n\t});\n\tfunction updateCssVar() {\n\t\tconst key = toValue(prop);\n\t\tconst el = toValue(elRef);\n\t\tif (el && window && key) {\n\t\t\tvar _window$getComputedSt;\n\t\t\tconst value = (_window$getComputedSt = window.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim();\n\t\t\tvariable.value = value || variable.value || initialValue;\n\t\t}\n\t}\n\tif (observe) useMutationObserver(elRef, updateCssVar, {\n\t\tattributeFilter: [\"style\", \"class\"],\n\t\twindow\n\t});\n\twatch([elRef, () => toValue(prop)], (_, old) => {\n\t\tif (old[0] && old[1]) old[0].style.removeProperty(old[1]);\n\t\tupdateCssVar();\n\t}, { immediate: true });\n\twatch([variable, elRef], ([val, el]) => {\n\t\tconst raw_prop = toValue(prop);\n\t\tif ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);\n\t\telse el.style.setProperty(raw_prop, val);\n\t}, { immediate: true });\n\treturn variable;\n}\n//#endregion\n//#region useCurrentElement/index.ts\nfunction useCurrentElement(rootComponent) {\n\tconst vm = getCurrentInstance();\n\tconst currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);\n\tonUpdated(currentElement.trigger);\n\tonMounted(currentElement.trigger);\n\treturn currentElement;\n}\n//#endregion\n//#region useCycleList/index.ts\n/**\n* Cycle through a list of items\n*\n* @see https://vueuse.org/useCycleList\n*/\nfunction useCycleList(list, options) {\n\tconst state = shallowRef(getInitialValue());\n\tconst listRef = toRef(list);\n\tconst index = computed({\n\t\tget() {\n\t\t\tvar _options$fallbackInde;\n\t\t\tconst targetList = listRef.value;\n\t\t\tlet index = (options === null || options === void 0 ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n\t\t\tif (index < 0) index = (_options$fallbackInde = options === null || options === void 0 ? void 0 : options.fallbackIndex) !== null && _options$fallbackInde !== void 0 ? _options$fallbackInde : 0;\n\t\t\treturn index;\n\t\t},\n\t\tset(v) {\n\t\t\tset(v);\n\t\t}\n\t});\n\tfunction set(i) {\n\t\tconst targetList = listRef.value;\n\t\tconst length = targetList.length;\n\t\tconst value = targetList[(i % length + length) % length];\n\t\tstate.value = value;\n\t\treturn value;\n\t}\n\tfunction shift(delta = 1) {\n\t\treturn set(index.value + delta);\n\t}\n\tfunction next(n = 1) {\n\t\treturn shift(n);\n\t}\n\tfunction prev(n = 1) {\n\t\treturn shift(-n);\n\t}\n\tfunction getInitialValue() {\n\t\tvar _toValue, _options$initialValue;\n\t\treturn (_toValue = toValue((_options$initialValue = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : toValue(list)[0])) !== null && _toValue !== void 0 ? _toValue : void 0;\n\t}\n\twatch(listRef, () => set(index.value));\n\treturn {\n\t\tstate,\n\t\tindex,\n\t\tnext,\n\t\tprev,\n\t\tgo: set\n\t};\n}\n//#endregion\n//#region useDark/index.ts\n/**\n* Reactive dark mode with auto data persistence.\n*\n* @see https://vueuse.org/useDark\n* @param options\n*/\nfunction useDark(options = {}) {\n\tconst { valueDark = \"dark\", valueLight = \"\" } = options;\n\tconst mode = useColorMode({\n\t\t...options,\n\t\tonChanged: (mode, defaultHandler) => {\n\t\t\tvar _options$onChanged;\n\t\t\tif (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode === \"dark\", defaultHandler, mode);\n\t\t\telse defaultHandler(mode);\n\t\t},\n\t\tmodes: {\n\t\t\tdark: valueDark,\n\t\t\tlight: valueLight\n\t\t}\n\t});\n\tconst system = computed(() => mode.system.value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn mode.value === \"dark\";\n\t\t},\n\t\tset(v) {\n\t\t\tconst modeVal = v ? \"dark\" : \"light\";\n\t\t\tif (system.value === modeVal) mode.value = \"auto\";\n\t\t\telse mode.value = modeVal;\n\t\t}\n\t});\n}\n//#endregion\n//#region useManualRefHistory/index.ts\nfunction fnBypass(v) {\n\treturn v;\n}\nfunction fnSetSource(source, value) {\n\treturn source.value = value;\n}\nfunction defaultDump(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useManualRefHistory\n* @param source\n* @param options\n*/\nfunction useManualRefHistory(source, options = {}) {\n\tconst { clone = false, dump = defaultDump(clone), parse = defaultParse(clone), setSource = fnSetSource } = options;\n\tfunction _createHistoryRecord() {\n\t\treturn markRaw({\n\t\t\tsnapshot: dump(source.value),\n\t\t\ttimestamp: timestamp()\n\t\t});\n\t}\n\tconst last = ref(_createHistoryRecord());\n\tconst undoStack = ref([]);\n\tconst redoStack = ref([]);\n\tconst _setSource = (record) => {\n\t\tsetSource(source, parse(record.snapshot));\n\t\tlast.value = record;\n\t};\n\tconst commit = () => {\n\t\tundoStack.value.unshift(last.value);\n\t\tlast.value = _createHistoryRecord();\n\t\tif (options.capacity && undoStack.value.length > options.capacity) undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n\t\tif (redoStack.value.length) redoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst clear = () => {\n\t\tundoStack.value.splice(0, undoStack.value.length);\n\t\tredoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst undo = () => {\n\t\tconst state = undoStack.value.shift();\n\t\tif (state) {\n\t\t\tredoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst redo = () => {\n\t\tconst state = redoStack.value.shift();\n\t\tif (state) {\n\t\t\tundoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst reset = () => {\n\t\t_setSource(last.value);\n\t};\n\treturn {\n\t\tsource,\n\t\tundoStack,\n\t\tredoStack,\n\t\tlast,\n\t\thistory: computed(() => [last.value, ...undoStack.value]),\n\t\tcanUndo: computed(() => undoStack.value.length > 0),\n\t\tcanRedo: computed(() => redoStack.value.length > 0),\n\t\tclear,\n\t\tcommit,\n\t\treset,\n\t\tundo,\n\t\tredo\n\t};\n}\n//#endregion\n//#region useRefHistory/index.ts\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useRefHistory\n* @param source\n* @param options\n*/\nfunction useRefHistory(source, options = {}) {\n\tconst { deep = false, flush = \"pre\", eventFilter, shouldCommit = () => true } = options;\n\tconst { eventFilter: composedFilter, pause, resume: resumeTracking, isActive: isTracking } = pausableFilter(eventFilter);\n\tlet lastRawValue = source.value;\n\tconst { ignoreUpdates, ignorePrevAsyncUpdates, stop } = watchIgnorable(source, commit, {\n\t\tdeep,\n\t\tflush,\n\t\teventFilter: composedFilter\n\t});\n\tfunction setSource(source, value) {\n\t\tignorePrevAsyncUpdates();\n\t\tignoreUpdates(() => {\n\t\t\tsource.value = value;\n\t\t\tlastRawValue = value;\n\t\t});\n\t}\n\tconst manualHistory = useManualRefHistory(source, {\n\t\t...options,\n\t\tclone: options.clone || deep,\n\t\tsetSource\n\t});\n\tconst { clear, commit: manualCommit } = manualHistory;\n\tfunction commit() {\n\t\tignorePrevAsyncUpdates();\n\t\tif (!shouldCommit(lastRawValue, source.value)) return;\n\t\tlastRawValue = source.value;\n\t\tmanualCommit();\n\t}\n\tfunction resume(commitNow) {\n\t\tresumeTracking();\n\t\tif (commitNow) commit();\n\t}\n\tfunction batch(fn) {\n\t\tlet canceled = false;\n\t\tconst cancel = () => canceled = true;\n\t\tignoreUpdates(() => {\n\t\t\tfn(cancel);\n\t\t});\n\t\tif (!canceled) commit();\n\t}\n\tfunction dispose() {\n\t\tstop();\n\t\tclear();\n\t}\n\treturn {\n\t\t...manualHistory,\n\t\tisTracking,\n\t\tpause,\n\t\tresume,\n\t\tcommit,\n\t\tbatch,\n\t\tdispose\n\t};\n}\n//#endregion\n//#region useDebouncedRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.\n*\n* @see https://vueuse.org/useDebouncedRefHistory\n* @param source\n* @param options\n*/\nfunction useDebouncedRefHistory(source, options = {}) {\n\tconst filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useDeviceMotion/index.ts\n/**\n* Reactive DeviceMotionEvent.\n*\n* @see https://vueuse.org/useDeviceMotion\n* @param options\n*/\nfunction useDeviceMotion(options = {}) {\n\tconst { window = defaultWindow, requestPermissions = false, eventFilter = bypassFilter } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof DeviceMotionEvent !== \"undefined\");\n\tconst requirePermissions = /* @__PURE__ */ useSupported(() => isSupported.value && \"requestPermission\" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === \"function\");\n\tconst permissionGranted = shallowRef(false);\n\tconst acceleration = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tconst rotationRate = ref({\n\t\talpha: null,\n\t\tbeta: null,\n\t\tgamma: null\n\t});\n\tconst interval = shallowRef(0);\n\tconst accelerationIncludingGravity = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tfunction init() {\n\t\tif (window) {\n\t\t\tconst onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n\t\t\t\tvar _event$acceleration, _event$acceleration2, _event$acceleration3, _event$accelerationIn, _event$accelerationIn2, _event$accelerationIn3, _event$rotationRate, _event$rotationRate2, _event$rotationRate3;\n\t\t\t\tacceleration.value = {\n\t\t\t\t\tx: ((_event$acceleration = event.acceleration) === null || _event$acceleration === void 0 ? void 0 : _event$acceleration.x) || null,\n\t\t\t\t\ty: ((_event$acceleration2 = event.acceleration) === null || _event$acceleration2 === void 0 ? void 0 : _event$acceleration2.y) || null,\n\t\t\t\t\tz: ((_event$acceleration3 = event.acceleration) === null || _event$acceleration3 === void 0 ? void 0 : _event$acceleration3.z) || null\n\t\t\t\t};\n\t\t\t\taccelerationIncludingGravity.value = {\n\t\t\t\t\tx: ((_event$accelerationIn = event.accelerationIncludingGravity) === null || _event$accelerationIn === void 0 ? void 0 : _event$accelerationIn.x) || null,\n\t\t\t\t\ty: ((_event$accelerationIn2 = event.accelerationIncludingGravity) === null || _event$accelerationIn2 === void 0 ? void 0 : _event$accelerationIn2.y) || null,\n\t\t\t\t\tz: ((_event$accelerationIn3 = event.accelerationIncludingGravity) === null || _event$accelerationIn3 === void 0 ? void 0 : _event$accelerationIn3.z) || null\n\t\t\t\t};\n\t\t\t\trotationRate.value = {\n\t\t\t\t\talpha: ((_event$rotationRate = event.rotationRate) === null || _event$rotationRate === void 0 ? void 0 : _event$rotationRate.alpha) || null,\n\t\t\t\t\tbeta: ((_event$rotationRate2 = event.rotationRate) === null || _event$rotationRate2 === void 0 ? void 0 : _event$rotationRate2.beta) || null,\n\t\t\t\t\tgamma: ((_event$rotationRate3 = event.rotationRate) === null || _event$rotationRate3 === void 0 ? void 0 : _event$rotationRate3.gamma) || null\n\t\t\t\t};\n\t\t\t\tinterval.value = event.interval;\n\t\t\t});\n\t\t\tuseEventListener(window, \"devicemotion\", onDeviceMotion, { passive: true });\n\t\t}\n\t}\n\tconst ensurePermissions = async () => {\n\t\tif (!requirePermissions.value) permissionGranted.value = true;\n\t\tif (permissionGranted.value) return;\n\t\tif (requirePermissions.value) {\n\t\t\tconst requestPermission = DeviceMotionEvent.requestPermission;\n\t\t\ttry {\n\t\t\t\tif (await requestPermission() === \"granted\") {\n\t\t\t\t\tpermissionGranted.value = true;\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\t};\n\tif (isSupported.value) if (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());\n\telse init();\n\treturn {\n\t\tacceleration,\n\t\taccelerationIncludingGravity,\n\t\trotationRate,\n\t\tinterval,\n\t\tisSupported,\n\t\trequirePermissions,\n\t\tensurePermissions,\n\t\tpermissionGranted\n\t};\n}\n//#endregion\n//#region useDeviceOrientation/index.ts\n/**\n* Reactive DeviceOrientationEvent.\n*\n* @see https://vueuse.org/useDeviceOrientation\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDeviceOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"DeviceOrientationEvent\" in window);\n\tconst isAbsolute = shallowRef(false);\n\tconst alpha = shallowRef(null);\n\tconst beta = shallowRef(null);\n\tconst gamma = shallowRef(null);\n\tif (window && isSupported.value) useEventListener(window, \"deviceorientation\", (event) => {\n\t\tisAbsolute.value = event.absolute;\n\t\talpha.value = event.alpha;\n\t\tbeta.value = event.beta;\n\t\tgamma.value = event.gamma;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tisAbsolute,\n\t\talpha,\n\t\tbeta,\n\t\tgamma\n\t};\n}\n//#endregion\n//#region useDevicePixelRatio/index.ts\n/**\n* Reactively track `window.devicePixelRatio`.\n*\n* @see https://vueuse.org/useDevicePixelRatio\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDevicePixelRatio(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst pixelRatio = shallowRef(1);\n\tconst query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);\n\tlet stop = noop;\n\tif (window) stop = watchImmediate(query, () => pixelRatio.value = window.devicePixelRatio);\n\treturn {\n\t\tpixelRatio: shallowReadonly(pixelRatio),\n\t\tstop\n\t};\n}\n//#endregion\n//#region useDevicesList/index.ts\n/**\n* Reactive `enumerateDevices` listing available input/output devices\n*\n* @see https://vueuse.org/useDevicesList\n* @param options\n*/\nfunction useDevicesList(options = {}) {\n\tconst { navigator = defaultNavigator, requestPermissions = false, constraints = {\n\t\taudio: true,\n\t\tvideo: true\n\t}, onUpdated } = options;\n\tconst devices = shallowRef([]);\n\tconst videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n\tconst audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n\tconst audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n\tconst permissionGranted = shallowRef(false);\n\tlet stream;\n\tasync function update() {\n\t\tif (!isSupported.value) return;\n\t\tdevices.value = await navigator.mediaDevices.enumerateDevices();\n\t\tonUpdated === null || onUpdated === void 0 || onUpdated(devices.value);\n\t\tif (stream) {\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\tstream = null;\n\t\t}\n\t}\n\tasync function ensurePermissions() {\n\t\tconst deviceName = constraints.video ? \"camera\" : \"microphone\";\n\t\tif (!isSupported.value) return false;\n\t\tif (permissionGranted.value) return true;\n\t\tconst { state, query } = usePermission(deviceName, { controls: true });\n\t\tawait query();\n\t\tif (state.value !== \"granted\") {\n\t\t\tlet granted = true;\n\t\t\ttry {\n\t\t\t\tconst allDevices = await navigator.mediaDevices.enumerateDevices();\n\t\t\t\tconst hasCamera = allDevices.some((device) => device.kind === \"videoinput\");\n\t\t\t\tconst hasMicrophone = allDevices.some((device) => device.kind === \"audioinput\" || device.kind === \"audiooutput\");\n\t\t\t\tconstraints.video = hasCamera ? constraints.video : false;\n\t\t\t\tconstraints.audio = hasMicrophone ? constraints.audio : false;\n\t\t\t\tstream = await navigator.mediaDevices.getUserMedia(constraints);\n\t\t\t} catch (_unused) {\n\t\t\t\tstream = null;\n\t\t\t\tgranted = false;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tpermissionGranted.value = granted;\n\t\t} else permissionGranted.value = true;\n\t\treturn permissionGranted.value;\n\t}\n\tif (isSupported.value) {\n\t\tif (requestPermissions) ensurePermissions();\n\t\tuseEventListener(navigator.mediaDevices, \"devicechange\", update, { passive: true });\n\t\tupdate();\n\t}\n\treturn {\n\t\tdevices,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tvideoInputs,\n\t\taudioInputs,\n\t\taudioOutputs,\n\t\tisSupported\n\t};\n}\n//#endregion\n//#region useDisplayMedia/index.ts\n/**\n* Reactive `mediaDevices.getDisplayMedia` streaming\n*\n* @see https://vueuse.org/useDisplayMedia\n* @param options\n*/\nfunction useDisplayMedia(options = {}) {\n\tvar _options$enabled;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst video = options.video;\n\tconst audio = options.audio;\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getDisplayMedia;\n\t});\n\tconst constraint = {\n\t\taudio,\n\t\tvideo\n\t};\n\tconst stream = shallowRef();\n\tasync function _start() {\n\t\tvar _stream$value;\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => useEventListener(t, \"ended\", stop, { passive: true }));\n\t\treturn stream.value;\n\t}\n\tasync function _stop() {\n\t\tvar _stream$value2;\n\t\t(_stream$value2 = stream.value) === null || _stream$value2 === void 0 || _stream$value2.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\tenabled\n\t};\n}\n//#endregion\n//#region useDocumentVisibility/index.ts\n/**\n* Reactively track `document.visibilityState`.\n*\n* @see https://vueuse.org/useDocumentVisibility\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDocumentVisibility(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tif (!document) return shallowRef(\"visible\");\n\tconst visibility = shallowRef(document.visibilityState);\n\tuseEventListener(document, \"visibilitychange\", () => {\n\t\tvisibility.value = document.visibilityState;\n\t}, { passive: true });\n\treturn visibility;\n}\n//#endregion\n//#region useDraggable/index.ts\nconst defaultScrollConfig = {\n\tspeed: 2,\n\tmargin: 30,\n\tdirection: \"both\"\n};\nfunction clampContainerScroll(container) {\n\tif (container.scrollLeft > container.scrollWidth - container.clientWidth) container.scrollLeft = Math.max(0, container.scrollWidth - container.clientWidth);\n\tif (container.scrollTop > container.scrollHeight - container.clientHeight) container.scrollTop = Math.max(0, container.scrollHeight - container.clientHeight);\n}\n/**\n* Make elements draggable.\n*\n* @see https://vueuse.org/useDraggable\n* @param target\n* @param options\n*/\nfunction useDraggable(target, options = {}) {\n\tvar _toValue, _toValue2, _toValue3, _scrollConfig$directi;\n\tconst { pointerTypes, preventDefault, stopPropagation, exact, onMove, onEnd, onStart, initialValue, axis = \"both\", draggingElement = defaultWindow, containerElement, handle: draggingHandle = target, buttons = [0], restrictInView, autoScroll = false } = options;\n\tconst position = ref((_toValue = toValue(initialValue)) !== null && _toValue !== void 0 ? _toValue : {\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst pressedDelta = ref();\n\tconst filterEvent = (e) => {\n\t\tif (pointerTypes) return pointerTypes.includes(e.pointerType);\n\t\treturn true;\n\t};\n\tconst handleEvent = (e) => {\n\t\tif (toValue(preventDefault)) e.preventDefault();\n\t\tif (toValue(stopPropagation)) e.stopPropagation();\n\t};\n\tconst scrollConfig = toValue(autoScroll);\n\tconst scrollSettings = typeof scrollConfig === \"object\" ? {\n\t\tspeed: (_toValue2 = toValue(scrollConfig.speed)) !== null && _toValue2 !== void 0 ? _toValue2 : defaultScrollConfig.speed,\n\t\tmargin: (_toValue3 = toValue(scrollConfig.margin)) !== null && _toValue3 !== void 0 ? _toValue3 : defaultScrollConfig.margin,\n\t\tdirection: (_scrollConfig$directi = scrollConfig.direction) !== null && _scrollConfig$directi !== void 0 ? _scrollConfig$directi : defaultScrollConfig.direction\n\t} : defaultScrollConfig;\n\tconst getScrollAxisValues = (value) => typeof value === \"number\" ? [value, value] : [value.x, value.y];\n\tconst handleAutoScroll = (container, targetRect, position) => {\n\t\tconst { clientWidth, clientHeight, scrollLeft, scrollTop, scrollWidth, scrollHeight } = container;\n\t\tconst [marginX, marginY] = getScrollAxisValues(scrollSettings.margin);\n\t\tconst [speedX, speedY] = getScrollAxisValues(scrollSettings.speed);\n\t\tlet deltaX = 0;\n\t\tlet deltaY = 0;\n\t\tif (scrollSettings.direction === \"x\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.x < marginX && scrollLeft > 0) deltaX = -speedX;\n\t\t\telse if (position.x + targetRect.width > clientWidth - marginX && scrollLeft < scrollWidth - clientWidth) deltaX = speedX;\n\t\t}\n\t\tif (scrollSettings.direction === \"y\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.y < marginY && scrollTop > 0) deltaY = -speedY;\n\t\t\telse if (position.y + targetRect.height > clientHeight - marginY && scrollTop < scrollHeight - clientHeight) deltaY = speedY;\n\t\t}\n\t\tif (deltaX || deltaY) container.scrollBy({\n\t\t\tleft: deltaX,\n\t\t\ttop: deltaY,\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t};\n\tlet autoScrollInterval = null;\n\tconst startAutoScroll = () => {\n\t\tconst container = toValue(containerElement);\n\t\tif (container && !autoScrollInterval) autoScrollInterval = setInterval(() => {\n\t\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\t\tconst { x, y } = position.value;\n\t\t\tconst relativePosition = {\n\t\t\t\tx: x - container.scrollLeft,\n\t\t\t\ty: y - container.scrollTop\n\t\t\t};\n\t\t\tif (relativePosition.x >= 0 && relativePosition.y >= 0) {\n\t\t\t\thandleAutoScroll(container, targetRect, relativePosition);\n\t\t\t\trelativePosition.x += container.scrollLeft;\n\t\t\t\trelativePosition.y += container.scrollTop;\n\t\t\t\tposition.value = relativePosition;\n\t\t\t}\n\t\t}, 1e3 / 60);\n\t};\n\tconst stopAutoScroll = () => {\n\t\tif (autoScrollInterval) {\n\t\t\tclearInterval(autoScrollInterval);\n\t\t\tautoScrollInterval = null;\n\t\t}\n\t};\n\tconst isPointerNearEdge = (pointer, container, margin, targetRect) => {\n\t\tconst [marginX, marginY] = typeof margin === \"number\" ? [margin, margin] : [margin.x, margin.y];\n\t\tconst { clientWidth, clientHeight } = container;\n\t\treturn pointer.x < marginX || pointer.x + targetRect.width > clientWidth - marginX || pointer.y < marginY || pointer.y + targetRect.height > clientHeight - marginY;\n\t};\n\tconst checkAutoScroll = () => {\n\t\tif (toValue(options.disabled) || !pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (!container) return;\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst { x, y } = position.value;\n\t\tconst relativePosition = {\n\t\t\tx: x - container.scrollLeft,\n\t\t\ty: y - container.scrollTop\n\t\t};\n\t\tif (isPointerNearEdge(relativePosition, container, scrollSettings.margin, targetRect)) startAutoScroll();\n\t\telse stopAutoScroll();\n\t};\n\tif (toValue(autoScroll)) watch(position, checkAutoScroll);\n\tconst start = (e) => {\n\t\tvar _container$getBoundin;\n\t\tif (!toValue(buttons).includes(e.button)) return;\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (toValue(exact) && e.target !== toValue(target)) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst containerRect = container === null || container === void 0 || (_container$getBoundin = container.getBoundingClientRect) === null || _container$getBoundin === void 0 ? void 0 : _container$getBoundin.call(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst pos = {\n\t\t\tx: e.clientX - (container ? targetRect.left - containerRect.left + (autoScroll ? 0 : container.scrollLeft) : targetRect.left),\n\t\t\ty: e.clientY - (container ? targetRect.top - containerRect.top + (autoScroll ? 0 : container.scrollTop) : targetRect.top)\n\t\t};\n\t\tif ((onStart === null || onStart === void 0 ? void 0 : onStart(pos, e)) === false) return;\n\t\tpressedDelta.value = pos;\n\t\thandleEvent(e);\n\t};\n\tconst move = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (container instanceof HTMLElement) clampContainerScroll(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tlet { x, y } = position.value;\n\t\tif (axis === \"x\" || axis === \"both\") {\n\t\t\tx = e.clientX - pressedDelta.value.x;\n\t\t\tif (container) x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n\t\t}\n\t\tif (axis === \"y\" || axis === \"both\") {\n\t\t\ty = e.clientY - pressedDelta.value.y;\n\t\t\tif (container) y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n\t\t}\n\t\tif (toValue(autoScroll) && container) {\n\t\t\tif (autoScrollInterval === null) handleAutoScroll(container, targetRect, {\n\t\t\t\tx,\n\t\t\t\ty\n\t\t\t});\n\t\t\tx += container.scrollLeft;\n\t\t\ty += container.scrollTop;\n\t\t}\n\t\tif (container && (restrictInView || autoScroll)) {\n\t\t\tif (axis !== \"y\") {\n\t\t\t\tconst relativeX = x - container.scrollLeft;\n\t\t\t\tif (relativeX < 0) x = container.scrollLeft;\n\t\t\t\telse if (relativeX > container.clientWidth - targetRect.width) x = container.clientWidth - targetRect.width + container.scrollLeft;\n\t\t\t}\n\t\t\tif (axis !== \"x\") {\n\t\t\t\tconst relativeY = y - container.scrollTop;\n\t\t\t\tif (relativeY < 0) y = container.scrollTop;\n\t\t\t\telse if (relativeY > container.clientHeight - targetRect.height) y = container.clientHeight - targetRect.height + container.scrollTop;\n\t\t\t}\n\t\t}\n\t\tposition.value = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tonMove === null || onMove === void 0 || onMove(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tconst end = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tpressedDelta.value = void 0;\n\t\tif (autoScroll) stopAutoScroll();\n\t\tonEnd === null || onEnd === void 0 || onEnd(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tif (isClient) {\n\t\tconst config = () => {\n\t\t\tvar _options$capture;\n\t\t\treturn {\n\t\t\t\tcapture: (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : true,\n\t\t\t\tpassive: !toValue(preventDefault)\n\t\t\t};\n\t\t};\n\t\tuseEventListener(draggingHandle, \"pointerdown\", start, config);\n\t\tuseEventListener(draggingElement, \"pointermove\", move, config);\n\t\tuseEventListener(draggingElement, [\"pointerup\", \"pointercancel\"], end, config);\n\t}\n\treturn {\n\t\t...toRefs(position),\n\t\tposition,\n\t\tisDragging: computed(() => !!pressedDelta.value),\n\t\tstyle: computed(() => `\n left: ${position.value.x}px;\n top: ${position.value.y}px;\n ${autoScroll ? \"text-wrap: nowrap;\" : \"\"}\n `)\n\t};\n}\n//#endregion\n//#region useDropZone/index.ts\nfunction useDropZone(target, options = {}) {\n\tconst isOverDropZone = shallowRef(false);\n\tconst files = shallowRef(null);\n\tlet counter = 0;\n\tlet isValid = true;\n\tif (isClient) {\n\t\tvar _options$multiple, _options$preventDefau;\n\t\tconst _options = typeof options === \"function\" ? { onDrop: options } : options;\n\t\tconst multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;\n\t\tconst preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;\n\t\tconst getFiles = (event) => {\n\t\t\tvar _event$dataTransfer$f, _event$dataTransfer;\n\t\t\tconst list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);\n\t\t\treturn list.length === 0 ? null : multiple ? list : [list[0]];\n\t\t};\n\t\tconst checkDataTypes = (types) => {\n\t\t\tconst dataTypes = unref(_options.dataTypes);\n\t\t\tif (typeof dataTypes === \"function\") return dataTypes(types);\n\t\t\tif (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;\n\t\t\tif (types.length === 0) return false;\n\t\t\treturn types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));\n\t\t};\n\t\tconst checkValidity = (items) => {\n\t\t\tif (_options.checkValidity) return _options.checkValidity(items);\n\t\t\tconst types = Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type);\n\t\t\tconst dataTypesValid = checkDataTypes(types);\n\t\t\tconst multipleFilesValid = multiple || items.length <= 1;\n\t\t\treturn dataTypesValid && multipleFilesValid;\n\t\t};\n\t\tconst isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !(\"chrome\" in window);\n\t\tconst handleDragEvent = (event, eventType) => {\n\t\t\tvar _event$dataTransfer2, _ref;\n\t\t\tconst dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;\n\t\t\tisValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;\n\t\t\tif (preventDefaultForUnhandled) event.preventDefault();\n\t\t\tif (!isSafari() && !isValid) {\n\t\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"none\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n\t\t\tconst currentFiles = getFiles(event);\n\t\t\tswitch (eventType) {\n\t\t\t\tcase \"enter\":\n\t\t\t\t\tvar _options$onEnter;\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tisOverDropZone.value = true;\n\t\t\t\t\t(_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"over\":\n\t\t\t\t\tvar _options$onOver;\n\t\t\t\t\t(_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"leave\":\n\t\t\t\t\tvar _options$onLeave;\n\t\t\t\t\tcounter -= 1;\n\t\t\t\t\tif (counter === 0) isOverDropZone.value = false;\n\t\t\t\t\t(_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"drop\":\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tisOverDropZone.value = false;\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tvar _options$onDrop;\n\t\t\t\t\t\tfiles.value = currentFiles;\n\t\t\t\t\t\t(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tuseEventListener(target, \"dragenter\", (event) => handleDragEvent(event, \"enter\"));\n\t\tuseEventListener(target, \"dragover\", (event) => handleDragEvent(event, \"over\"));\n\t\tuseEventListener(target, \"dragleave\", (event) => handleDragEvent(event, \"leave\"));\n\t\tuseEventListener(target, \"drop\", (event) => handleDragEvent(event, \"drop\"));\n\t}\n\treturn {\n\t\tfiles,\n\t\tisOverDropZone\n\t};\n}\n//#endregion\n//#region useResizeObserver/index.ts\n/**\n* Reports changes to the dimensions of an Element's content or the border-box\n*\n* @see https://vueuse.org/useResizeObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useResizeObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...observerOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"ResizeObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst _targets = toValue(target);\n\t\treturn Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n\t}), (els) => {\n\t\tcleanup();\n\t\tif (isSupported.value && window) {\n\t\t\tobserver = new ResizeObserver(callback);\n\t\t\tfor (const _el of els) if (_el) observer.observe(_el, observerOptions);\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementBounding/index.ts\n/**\n* Reactive bounding box of an HTML element.\n*\n* @see https://vueuse.org/useElementBounding\n* @param target\n*/\nfunction useElementBounding(target, options = {}) {\n\tconst { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = \"sync\" } = options;\n\tconst height = shallowRef(0);\n\tconst bottom = shallowRef(0);\n\tconst left = shallowRef(0);\n\tconst right = shallowRef(0);\n\tconst top = shallowRef(0);\n\tconst width = shallowRef(0);\n\tconst x = shallowRef(0);\n\tconst y = shallowRef(0);\n\tfunction recalculate() {\n\t\tconst el = unrefElement(target);\n\t\tif (!el) {\n\t\t\tif (reset) {\n\t\t\t\theight.value = 0;\n\t\t\t\tbottom.value = 0;\n\t\t\t\tleft.value = 0;\n\t\t\t\tright.value = 0;\n\t\t\t\ttop.value = 0;\n\t\t\t\twidth.value = 0;\n\t\t\t\tx.value = 0;\n\t\t\t\ty.value = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst rect = el.getBoundingClientRect();\n\t\theight.value = rect.height;\n\t\tbottom.value = rect.bottom;\n\t\tleft.value = rect.left;\n\t\tright.value = rect.right;\n\t\ttop.value = rect.top;\n\t\twidth.value = rect.width;\n\t\tx.value = rect.x;\n\t\ty.value = rect.y;\n\t}\n\tfunction update() {\n\t\tif (updateTiming === \"sync\") recalculate();\n\t\telse if (updateTiming === \"next-frame\") requestAnimationFrame(() => recalculate());\n\t}\n\tuseResizeObserver(target, update);\n\twatch(() => unrefElement(target), (ele) => !ele && update());\n\tuseMutationObserver(target, update, { attributeFilter: [\"style\", \"class\"] });\n\tif (windowScroll) useEventListener(\"scroll\", update, {\n\t\tcapture: true,\n\t\tpassive: true\n\t});\n\tif (windowResize) useEventListener(\"resize\", update, { passive: true });\n\ttryOnMounted(() => {\n\t\tif (immediate) update();\n\t});\n\treturn {\n\t\theight,\n\t\tbottom,\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\twidth,\n\t\tx,\n\t\ty,\n\t\tupdate\n\t};\n}\n//#endregion\n//#region useElementByPoint/index.ts\nfunction getDefaultScheduler$7(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive element by point.\n*\n* @see https://vueuse.org/useElementByPoint\n* @param options - UseElementByPointOptions\n*/\nfunction useElementByPoint(options) {\n\tconst { x, y, document = defaultDocument, multiple, scheduler = getDefaultScheduler$7(options) } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (toValue(multiple)) return document && \"elementsFromPoint\" in document;\n\t\treturn document && \"elementFromPoint\" in document;\n\t});\n\tconst element = shallowRef(null);\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\t...scheduler(() => {\n\t\t\tvar _document$elementsFro, _document$elementFrom;\n\t\t\telement.value = toValue(multiple) ? (_document$elementsFro = document === null || document === void 0 ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) !== null && _document$elementsFro !== void 0 ? _document$elementsFro : [] : (_document$elementFrom = document === null || document === void 0 ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) !== null && _document$elementFrom !== void 0 ? _document$elementFrom : null;\n\t\t})\n\t};\n}\n//#endregion\n//#region useElementHover/index.ts\nfunction useElementHover(el, options = {}) {\n\tconst { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window = defaultWindow } = options;\n\tconst isHovered = shallowRef(false);\n\tlet timer;\n\tconst toggle = (entering) => {\n\t\tconst delay = entering ? delayEnter : delayLeave;\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t\tif (delay) timer = setTimeout(() => isHovered.value = entering, delay);\n\t\telse isHovered.value = entering;\n\t};\n\tif (!window) return isHovered;\n\tuseEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n\tuseEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n\tif (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));\n\treturn isHovered;\n}\n//#endregion\n//#region useElementOverflow/index.ts\n/**\n* react a dom's overflow state\n* @see https://vueuse.org/useElementOverflow\n* @param target\n* @param option\n*/\nfunction useElementOverflow(target, option = {}) {\n\tconst { observeMutation = false, onUpdated, window = defaultWindow } = option;\n\tconst isXOverflowed = shallowRef(false);\n\tconst isYOverflowed = shallowRef(false);\n\tfunction update(htmlEl) {\n\t\tisXOverflowed.value = htmlEl.scrollWidth > htmlEl.offsetWidth;\n\t\tisYOverflowed.value = htmlEl.scrollHeight > htmlEl.offsetHeight;\n\t}\n\tconst onResizeUpdated = onUpdated;\n\tconst targetEl = computed(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (!el || el instanceof SVGElement) return void 0;\n\t\treturn el;\n\t});\n\tconst targets = () => {\n\t\tconst el = targetEl.value;\n\t\tif (!el || el instanceof SVGElement) return [];\n\t\treturn [el, ...Array.from(el.children).filter((i) => i instanceof HTMLElement)];\n\t};\n\tuseResizeObserver(targets, (entries, observer) => {\n\t\tconst el = targetEl.value;\n\t\tif (el) update(el);\n\t\tonResizeUpdated === null || onResizeUpdated === void 0 || onResizeUpdated(entries, observer);\n\t}, { window });\n\tif (observeMutation) {\n\t\tconst onMutationUpdated = onUpdated;\n\t\tuseMutationObserver(targets, (entries, observer) => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el) update(el);\n\t\t\tonMutationUpdated === null || onMutationUpdated === void 0 || onMutationUpdated(entries, observer);\n\t\t}, {\n\t\t\twindow,\n\t\t\t...typeof observeMutation === \"object\" ? observeMutation : {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t\tcharacterData: true\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tisXOverflowed: shallowReadonly(isXOverflowed),\n\t\tisYOverflowed: shallowReadonly(isYOverflowed),\n\t\tstop,\n\t\tupdate: () => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el && window) update(el);\n\t\t}\n\t};\n}\n//#endregion\n//#region useElementSize/index.ts\n/**\n* Reactive size of an HTML element.\n*\n* @see https://vueuse.org/useElementSize\n*/\nfunction useElementSize(target, initialSize = {\n\twidth: 0,\n\theight: 0\n}, options = {}) {\n\tconst { window = defaultWindow, box = \"content-box\" } = options;\n\tconst isSVG = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes(\"svg\");\n\t});\n\tconst width = shallowRef(initialSize.width);\n\tconst height = shallowRef(initialSize.height);\n\tconst { stop: stop1 } = useResizeObserver(target, ([entry]) => {\n\t\tconst boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n\t\tif (window && isSVG.value) {\n\t\t\tconst $elem = unrefElement(target);\n\t\t\tif ($elem) {\n\t\t\t\tconst rect = $elem.getBoundingClientRect();\n\t\t\t\twidth.value = rect.width;\n\t\t\t\theight.value = rect.height;\n\t\t\t}\n\t\t} else if (boxSize) {\n\t\t\tconst formatBoxSize = toArray(boxSize);\n\t\t\twidth.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n\t\t\theight.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n\t\t} else {\n\t\t\twidth.value = entry.contentRect.width;\n\t\t\theight.value = entry.contentRect.height;\n\t\t}\n\t}, options);\n\ttryOnMounted(() => {\n\t\tconst ele = unrefElement(target);\n\t\tif (ele && \"offsetWidth\" in ele) if (box === \"content-box\" && window) {\n\t\t\tconst cs = window.getComputedStyle(ele);\n\t\t\tconst padX = Number.parseFloat(cs.paddingLeft) + Number.parseFloat(cs.paddingRight);\n\t\t\tconst padY = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);\n\t\t\tconst bdX = Number.parseFloat(cs.borderLeftWidth) + Number.parseFloat(cs.borderRightWidth);\n\t\t\tconst bdY = Number.parseFloat(cs.borderTopWidth) + Number.parseFloat(cs.borderBottomWidth);\n\t\t\twidth.value = ele.offsetWidth - padX - bdX;\n\t\t\theight.value = ele.offsetHeight - padY - bdY;\n\t\t} else {\n\t\t\twidth.value = ele.offsetWidth;\n\t\t\theight.value = ele.offsetHeight;\n\t\t}\n\t\telse if (ele) {\n\t\t\twidth.value = initialSize.width;\n\t\t\theight.value = initialSize.height;\n\t\t}\n\t});\n\tconst stop2 = watch(() => unrefElement(target), (ele) => {\n\t\twidth.value = ele ? initialSize.width : 0;\n\t\theight.value = ele ? initialSize.height : 0;\n\t});\n\tfunction stop() {\n\t\tstop1();\n\t\tstop2();\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useIntersectionObserver/index.ts\n/**\n* Detects changes to a target element's visibility.\n*\n* @see https://vueuse.org/useIntersectionObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useIntersectionObserver(target, callback, options = {}) {\n\tconst { root, rootMargin, threshold = 0, window = defaultWindow, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"IntersectionObserver\" in window);\n\tconst targets = computed(() => {\n\t\treturn toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t});\n\tlet cleanup = noop;\n\tconst isActive = shallowRef(immediate);\n\tconst stopWatch = isSupported.value ? watch(() => [\n\t\ttargets.value,\n\t\tunrefElement(root),\n\t\ttoValue(rootMargin),\n\t\tisActive.value\n\t], ([targets, root, rootMargin]) => {\n\t\tcleanup();\n\t\tif (!isActive.value) return;\n\t\tif (!targets.length) return;\n\t\tconst observer = new IntersectionObserver(callback, {\n\t\t\troot: unrefElement(root),\n\t\t\trootMargin,\n\t\t\tthreshold\n\t\t});\n\t\ttargets.forEach((el) => el && observer.observe(el));\n\t\tcleanup = () => {\n\t\t\tobserver.disconnect();\n\t\t\tcleanup = noop;\n\t\t};\n\t}, {\n\t\timmediate,\n\t\tflush: \"post\"\n\t}) : noop;\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t\tisActive.value = false;\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tisActive,\n\t\tpause() {\n\t\t\tcleanup();\n\t\t\tisActive.value = false;\n\t\t},\n\t\tresume() {\n\t\t\tisActive.value = true;\n\t\t},\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementVisibility/index.ts\nfunction useElementVisibility(element, options = {}) {\n\tconst { window = defaultWindow, scrollTarget, threshold = 0, rootMargin, once = false, initialValue = false } = options;\n\tconst isVisible = shallowRef(initialValue);\n\tconst observerController = useIntersectionObserver(element, (intersectionObserverEntries) => {\n\t\tlet isIntersecting = isVisible.value;\n\t\tlet latestTime = 0;\n\t\tfor (const entry of intersectionObserverEntries) if (entry.time >= latestTime) {\n\t\t\tlatestTime = entry.time;\n\t\t\tisIntersecting = entry.isIntersecting;\n\t\t}\n\t\tisVisible.value = isIntersecting;\n\t\tif (once) watchOnce(isVisible, () => {\n\t\t\tobserverController.stop();\n\t\t});\n\t}, {\n\t\troot: scrollTarget,\n\t\twindow,\n\t\tthreshold,\n\t\trootMargin\n\t});\n\treturn options.controls ? {\n\t\t...observerController,\n\t\tisVisible\n\t} : isVisible;\n}\n//#endregion\n//#region useEventBus/internal.ts\nconst events = /* @__PURE__ */ new Map();\n//#endregion\n//#region useEventBus/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useEventBus(key) {\n\tfunction on(listener) {\n\t\tconst listeners = events.get(key) || /* @__PURE__ */ new Set();\n\t\tlisteners.add(listener);\n\t\tevents.set(key, listeners);\n\t\tconst _off = () => off(listener);\n\t\ttryOnScopeDispose(_off);\n\t\treturn _off;\n\t}\n\tfunction once(listener) {\n\t\tfunction _listener(...args) {\n\t\t\toff(_listener);\n\t\t\tlistener(...args);\n\t\t}\n\t\treturn on(_listener);\n\t}\n\tfunction off(listener) {\n\t\tconst listeners = events.get(key);\n\t\tif (!listeners) return;\n\t\tlisteners.delete(listener);\n\t\tif (!listeners.size) reset();\n\t}\n\tfunction reset() {\n\t\tevents.delete(key);\n\t}\n\tfunction emit(event, payload) {\n\t\tvar _events$get;\n\t\t(_events$get = events.get(key)) === null || _events$get === void 0 || _events$get.forEach((v) => v(event, payload));\n\t}\n\treturn {\n\t\ton,\n\t\tonce,\n\t\toff,\n\t\temit,\n\t\treset\n\t};\n}\n//#endregion\n//#region useEventSource/index.ts\nfunction resolveNestedOptions$1(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive wrapper for EventSource.\n*\n* @see https://vueuse.org/useEventSource\n* @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource\n* @param url\n* @param events\n* @param options\n*/\nfunction useEventSource(url, events = [], options = {}) {\n\tconst event = shallowRef(null);\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CONNECTING\");\n\tconst eventSource = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst urlRef = toRef(url);\n\tconst lastEventId = shallowRef(null);\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tconst { withCredentials = false, immediate = true, autoConnect = true, autoReconnect, serializer = { read: (v) => v } } = options;\n\tconst close = () => {\n\t\tif (isClient && eventSource.value) {\n\t\t\teventSource.value.close();\n\t\t\teventSource.value = null;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\texplicitlyClosed = true;\n\t\t}\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst es = new EventSource(urlRef.value, { withCredentials });\n\t\tstatus.value = \"CONNECTING\";\n\t\teventSource.value = es;\n\t\tes.onopen = () => {\n\t\t\tstatus.value = \"OPEN\";\n\t\t\terror.value = null;\n\t\t};\n\t\tes.onerror = (e) => {\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\terror.value = e;\n\t\t\tif (es.readyState === 2 && !explicitlyClosed && autoReconnect) {\n\t\t\t\tes.close();\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions$1(autoReconnect);\n\t\t\t\tretried += 1;\n\t\t\t\tif (typeof retries === \"number\" && (retries < 0 || retried < retries)) setTimeout(_init, delay);\n\t\t\t\telse if (typeof retries === \"function\" && retries()) setTimeout(_init, delay);\n\t\t\t\telse onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tes.onmessage = (e) => {\n\t\t\tvar _serializer$read;\n\t\t\tevent.value = null;\n\t\t\tdata.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;\n\t\t\tlastEventId.value = e.lastEventId;\n\t\t};\n\t\tfor (const event_name of events) useEventListener(es, event_name, (e) => {\n\t\t\tvar _serializer$read2, _e$lastEventId;\n\t\t\tevent.value = event_name;\n\t\t\tdata.value = (_serializer$read2 = serializer.read(e.data)) !== null && _serializer$read2 !== void 0 ? _serializer$read2 : null;\n\t\t\tlastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;\n\t\t}, { passive: true });\n\t};\n\tconst open = () => {\n\t\tif (!isClient) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\ttryOnScopeDispose(close);\n\treturn {\n\t\teventSource,\n\t\tevent,\n\t\tdata,\n\t\tstatus,\n\t\terror,\n\t\topen,\n\t\tclose,\n\t\tlastEventId\n\t};\n}\n//#endregion\n//#region useEyeDropper/index.ts\n/**\n* Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)\n*\n* @see https://vueuse.org/useEyeDropper\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useEyeDropper(options = {}) {\n\tconst { initialValue = \"\" } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n\tconst sRGBHex = shallowRef(initialValue);\n\tasync function open(openOptions) {\n\t\tif (!isSupported.value) return;\n\t\tconst result = await new window.EyeDropper().open(openOptions);\n\t\tsRGBHex.value = result.sRGBHex;\n\t\treturn result;\n\t}\n\treturn {\n\t\tisSupported,\n\t\tsRGBHex,\n\t\topen\n\t};\n}\n//#endregion\n//#region useFavicon/index.ts\nfunction useFavicon(newIcon = null, options = {}) {\n\tconst { baseUrl = \"\", rel = \"icon\", document = defaultDocument } = options;\n\tconst favicon = toRef(newIcon);\n\tconst applyIcon = (icon) => {\n\t\tconst elements = document === null || document === void 0 ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n\t\tif (!elements || elements.length === 0) {\n\t\t\tconst link = document === null || document === void 0 ? void 0 : document.createElement(\"link\");\n\t\t\tif (link) {\n\t\t\t\tlink.rel = rel;\n\t\t\t\tlink.href = `${baseUrl}${icon}`;\n\t\t\t\tlink.type = `image/${icon.split(\".\").pop()}`;\n\t\t\t\tdocument === null || document === void 0 || document.head.append(link);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telements === null || elements === void 0 || elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n\t};\n\twatch(favicon, (i, o) => {\n\t\tif (typeof i === \"string\" && i !== o) applyIcon(i);\n\t}, { immediate: true });\n\treturn favicon;\n}\n//#endregion\n//#region useFetch/index.ts\nconst payloadMapping = {\n\tjson: \"application/json\",\n\ttext: \"text/plain\"\n};\n/**\n* !!!IMPORTANT!!!\n*\n* If you update the UseFetchOptions interface, be sure to update this object\n* to include the new options\n*/\nfunction isFetchOptions(obj) {\n\treturn obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nconst reAbsolute = /^(?:[a-z][a-z\\d+\\-.]*:)?\\/\\//i;\nfunction isAbsoluteURL(url) {\n\treturn reAbsolute.test(url);\n}\nfunction headersToObject(headers) {\n\tif (typeof Headers !== \"undefined\" && headers instanceof Headers) return Object.fromEntries(headers.entries());\n\treturn headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n\tif (combination === \"overwrite\") return async (ctx) => {\n\t\tlet callback;\n\t\tfor (let i = callbacks.length - 1; i >= 0; i--) if (callbacks[i] != null) {\n\t\t\tcallback = callbacks[i];\n\t\t\tbreak;\n\t\t}\n\t\tif (callback) return {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n\telse return async (ctx) => {\n\t\tfor (const callback of callbacks) if (callback) ctx = {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n}\nfunction createFetch(config = {}) {\n\tconst _combination = config.combination || \"chain\";\n\tconst _options = config.options || {};\n\tconst _fetchOptions = config.fetchOptions || {};\n\tfunction useFactoryFetch(url, ...args) {\n\t\tconst computedUrl = computed(() => {\n\t\t\tconst baseUrl = toValue(config.baseUrl);\n\t\t\tconst targetUrl = toValue(url);\n\t\t\treturn baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n\t\t});\n\t\tlet options = _options;\n\t\tlet fetchOptions = _fetchOptions;\n\t\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t\t...options,\n\t\t\t...args[0],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n\t\t};\n\t\telse fetchOptions = {\n\t\t\t...fetchOptions,\n\t\t\t...args[0],\n\t\t\theaders: {\n\t\t\t\t...headersToObject(fetchOptions.headers) || {},\n\t\t\t\t...headersToObject(args[0].headers) || {}\n\t\t\t}\n\t\t};\n\t\tif (args.length > 1 && isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n\t\t};\n\t\treturn useFetch(computedUrl, fetchOptions, options);\n\t}\n\treturn useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n\tvar _defaultWindow$fetch, _globalThis;\n\tconst supportsAbort = typeof AbortController === \"function\";\n\tlet fetchOptions = {};\n\tlet options = {\n\t\timmediate: true,\n\t\trefetch: false,\n\t\ttimeout: 0,\n\t\tupdateDataOnError: false\n\t};\n\tconst config = {\n\t\tmethod: \"GET\",\n\t\ttype: \"text\",\n\t\tpayload: void 0\n\t};\n\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t...options,\n\t\t...args[0]\n\t};\n\telse fetchOptions = args[0];\n\tif (args.length > 1) {\n\t\tif (isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1]\n\t\t};\n\t}\n\tconst { fetch = (_defaultWindow$fetch = defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.fetch) !== null && _defaultWindow$fetch !== void 0 ? _defaultWindow$fetch : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.fetch, initialData, timeout } = options;\n\tconst responseEvent = createEventHook();\n\tconst errorEvent = createEventHook();\n\tconst finallyEvent = createEventHook();\n\tconst isFinished = shallowRef(false);\n\tconst isFetching = shallowRef(false);\n\tconst aborted = shallowRef(false);\n\tconst statusCode = shallowRef(null);\n\tconst response = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst data = shallowRef(initialData || null);\n\tconst canAbort = computed(() => supportsAbort && isFetching.value);\n\tlet controller;\n\tlet timer;\n\tconst abort = (reason) => {\n\t\tif (supportsAbort) {\n\t\t\tcontroller === null || controller === void 0 || controller.abort(reason);\n\t\t\tcontroller = new AbortController();\n\t\t\tcontroller.signal.onabort = () => aborted.value = true;\n\t\t\tfetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\tsignal: controller.signal\n\t\t\t};\n\t\t}\n\t};\n\tconst loading = (isLoading) => {\n\t\tisFetching.value = isLoading;\n\t\tisFinished.value = !isLoading;\n\t};\n\tif (timeout) timer = useTimeoutFn(abort, timeout, { immediate: false });\n\tlet executeCounter = 0;\n\tconst execute = async (throwOnFailed = false) => {\n\t\tvar _context$options;\n\t\tabort();\n\t\tloading(true);\n\t\terror.value = null;\n\t\tstatusCode.value = null;\n\t\taborted.value = false;\n\t\texecuteCounter += 1;\n\t\tconst currentExecuteCounter = executeCounter;\n\t\tconst defaultFetchOptions = {\n\t\t\tmethod: config.method,\n\t\t\theaders: {}\n\t\t};\n\t\tconst payload = toValue(config.payload);\n\t\tif (payload) {\n\t\t\tvar _payloadMapping$confi;\n\t\t\tconst headers = headersToObject(defaultFetchOptions.headers);\n\t\t\tconst proto = Object.getPrototypeOf(payload);\n\t\t\tif (!config.payloadType && payload && (proto === Object.prototype || Array.isArray(proto)) && !(payload instanceof FormData)) config.payloadType = \"json\";\n\t\t\tif (config.payloadType) headers[\"Content-Type\"] = (_payloadMapping$confi = payloadMapping[config.payloadType]) !== null && _payloadMapping$confi !== void 0 ? _payloadMapping$confi : config.payloadType;\n\t\t\tdefaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n\t\t}\n\t\tlet isCanceled = false;\n\t\tconst context = {\n\t\t\turl: toValue(url),\n\t\t\toptions: {\n\t\t\t\t...defaultFetchOptions,\n\t\t\t\t...fetchOptions\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tisCanceled = true;\n\t\t\t}\n\t\t};\n\t\tif (options.beforeFetch) Object.assign(context, await options.beforeFetch(context));\n\t\tif (isCanceled || !fetch) {\n\t\t\tloading(false);\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet responseData = null;\n\t\tif (timer) timer.start();\n\t\treturn fetch(context.url, {\n\t\t\t...defaultFetchOptions,\n\t\t\t...context.options,\n\t\t\theaders: {\n\t\t\t\t...headersToObject(defaultFetchOptions.headers),\n\t\t\t\t...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)\n\t\t\t}\n\t\t}).then(async (fetchResponse) => {\n\t\t\tresponse.value = fetchResponse;\n\t\t\tstatusCode.value = fetchResponse.status;\n\t\t\tresponseData = await fetchResponse.clone()[config.type]();\n\t\t\tif (!fetchResponse.ok) {\n\t\t\t\tdata.value = initialData || null;\n\t\t\t\tthrow new Error(fetchResponse.statusText);\n\t\t\t}\n\t\t\tif (options.afterFetch) ({data: responseData} = await options.afterFetch({\n\t\t\t\tdata: responseData,\n\t\t\t\tresponse: fetchResponse,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tdata.value = responseData;\n\t\t\tresponseEvent.trigger(fetchResponse);\n\t\t\treturn fetchResponse;\n\t\t}).catch(async (fetchError) => {\n\t\t\tlet errorData = fetchError.message || fetchError.name;\n\t\t\tif (options.onFetchError) ({error: errorData, data: responseData} = await options.onFetchError({\n\t\t\t\tdata: responseData,\n\t\t\t\terror: fetchError,\n\t\t\t\tresponse: response.value,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tif (currentExecuteCounter === executeCounter) {\n\t\t\t\terror.value = errorData;\n\t\t\t\tif (options.updateDataOnError) data.value = responseData;\n\t\t\t}\n\t\t\terrorEvent.trigger(fetchError);\n\t\t\tif (throwOnFailed) throw fetchError;\n\t\t\treturn null;\n\t\t}).finally(() => {\n\t\t\tif (currentExecuteCounter === executeCounter) loading(false);\n\t\t\tif (timer) timer.stop();\n\t\t\tfinallyEvent.trigger(null);\n\t\t});\n\t};\n\tconst refetch = toRef(options.refetch);\n\twatch([refetch, toRef(url)], ([refetch]) => refetch && execute(), { deep: true });\n\tconst shell = {\n\t\tisFinished: shallowReadonly(isFinished),\n\t\tisFetching: shallowReadonly(isFetching),\n\t\tstatusCode,\n\t\tresponse,\n\t\terror,\n\t\tdata,\n\t\tcanAbort,\n\t\taborted,\n\t\tabort,\n\t\texecute,\n\t\tonFetchResponse: responseEvent.on,\n\t\tonFetchError: errorEvent.on,\n\t\tonFetchFinally: finallyEvent.on,\n\t\tget: setMethod(\"GET\"),\n\t\tput: setMethod(\"PUT\"),\n\t\tpost: setMethod(\"POST\"),\n\t\tdelete: setMethod(\"DELETE\"),\n\t\tpatch: setMethod(\"PATCH\"),\n\t\thead: setMethod(\"HEAD\"),\n\t\toptions: setMethod(\"OPTIONS\"),\n\t\tjson: setType(\"json\"),\n\t\ttext: setType(\"text\"),\n\t\tblob: setType(\"blob\"),\n\t\tarrayBuffer: setType(\"arrayBuffer\"),\n\t\tformData: setType(\"formData\")\n\t};\n\tfunction setMethod(method) {\n\t\treturn (payload, payloadType) => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.method = method;\n\t\t\t\tconfig.payload = payload;\n\t\t\t\tconfig.payloadType = payloadType;\n\t\t\t\tif (isRef(config.payload)) watch([refetch, toRef(config.payload)], ([refetch]) => refetch && execute(), { deep: true });\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tfunction waitUntilFinished() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isFinished).toBe(true).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\tfunction setType(type) {\n\t\treturn () => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.type = type;\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (options.immediate) Promise.resolve().then(() => execute());\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\nfunction joinPaths(start, end) {\n\tif (!start.endsWith(\"/\") && !end.startsWith(\"/\")) return `${start}/${end}`;\n\tif (start.endsWith(\"/\") && end.startsWith(\"/\")) return `${start.slice(0, -1)}${end}`;\n\treturn `${start}${end}`;\n}\n//#endregion\n//#region useFileDialog/index.ts\nconst DEFAULT_OPTIONS = {\n\tmultiple: true,\n\taccept: \"*\",\n\treset: false,\n\tdirectory: false\n};\nfunction prepareInitialFiles(files) {\n\tif (!files) return null;\n\tif (files instanceof FileList) return files;\n\tconst dt = new DataTransfer();\n\tfor (const file of files) dt.items.add(file);\n\treturn dt.files;\n}\n/**\n* Open file dialog with ease.\n*\n* @see https://vueuse.org/useFileDialog\n* @param options\n*/\nfunction useFileDialog(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst files = ref(prepareInitialFiles(options.initialFiles));\n\tconst { on: onChange, trigger: changeTrigger } = createEventHook();\n\tconst { on: onCancel, trigger: cancelTrigger } = createEventHook();\n\tconst inputRef = computed(() => {\n\t\tvar _unrefElement;\n\t\tconst input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document ? document.createElement(\"input\") : void 0;\n\t\tif (input) {\n\t\t\tinput.type = \"file\";\n\t\t\tinput.onchange = (event) => {\n\t\t\t\tconst result = event.target;\n\t\t\t\tfiles.value = result.files;\n\t\t\t\tchangeTrigger(files.value);\n\t\t\t};\n\t\t\tinput.oncancel = () => {\n\t\t\t\tcancelTrigger();\n\t\t\t};\n\t\t}\n\t\treturn input;\n\t});\n\tconst reset = () => {\n\t\tfiles.value = null;\n\t\tif (inputRef.value && inputRef.value.value) {\n\t\t\tinputRef.value.value = \"\";\n\t\t\tchangeTrigger(null);\n\t\t}\n\t};\n\tconst applyOptions = (options) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tel.multiple = toValue(options.multiple);\n\t\tel.accept = toValue(options.accept);\n\t\tel.webkitdirectory = toValue(options.directory);\n\t\tif (hasOwn(options, \"capture\")) el.capture = toValue(options.capture);\n\t};\n\tconst open = (localOptions) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tconst mergedOptions = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t...localOptions\n\t\t};\n\t\tapplyOptions(mergedOptions);\n\t\tif (toValue(mergedOptions.reset)) reset();\n\t\tel.click();\n\t};\n\twatchEffect(() => {\n\t\tapplyOptions(options);\n\t});\n\treturn {\n\t\tfiles: readonly(files),\n\t\topen,\n\t\treset,\n\t\tonCancel,\n\t\tonChange\n\t};\n}\n//#endregion\n//#region useFileSystemAccess/index.ts\nfunction useFileSystemAccess(options = {}) {\n\tconst { window: _window = defaultWindow, dataType = \"Text\" } = options;\n\tconst window = _window;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n\tconst fileHandle = shallowRef();\n\tconst data = shallowRef();\n\tconst file = shallowRef();\n\tconst fileName = computed(() => {\n\t\tvar _file$value$name, _file$value;\n\t\treturn (_file$value$name = (_file$value = file.value) === null || _file$value === void 0 ? void 0 : _file$value.name) !== null && _file$value$name !== void 0 ? _file$value$name : \"\";\n\t});\n\tconst fileMIME = computed(() => {\n\t\tvar _file$value$type, _file$value2;\n\t\treturn (_file$value$type = (_file$value2 = file.value) === null || _file$value2 === void 0 ? void 0 : _file$value2.type) !== null && _file$value$type !== void 0 ? _file$value$type : \"\";\n\t});\n\tconst fileSize = computed(() => {\n\t\tvar _file$value$size, _file$value3;\n\t\treturn (_file$value$size = (_file$value3 = file.value) === null || _file$value3 === void 0 ? void 0 : _file$value3.size) !== null && _file$value$size !== void 0 ? _file$value$size : 0;\n\t});\n\tconst fileLastModified = computed(() => {\n\t\tvar _file$value$lastModif, _file$value4;\n\t\treturn (_file$value$lastModif = (_file$value4 = file.value) === null || _file$value4 === void 0 ? void 0 : _file$value4.lastModified) !== null && _file$value$lastModif !== void 0 ? _file$value$lastModif : 0;\n\t});\n\tasync function open(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tconst [handle] = await window.showOpenFilePicker({\n\t\t\t...toValue(options),\n\t\t\t..._options\n\t\t});\n\t\tfileHandle.value = handle;\n\t\tawait updateData();\n\t}\n\tasync function create(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tdata.value = void 0;\n\t\tawait updateData();\n\t}\n\tasync function save(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tif (!fileHandle.value) return saveAs(_options);\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function saveAs(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function updateFile() {\n\t\tvar _fileHandle$value;\n\t\tfile.value = await ((_fileHandle$value = fileHandle.value) === null || _fileHandle$value === void 0 ? void 0 : _fileHandle$value.getFile());\n\t}\n\tasync function updateData() {\n\t\tvar _file$value5, _file$value6;\n\t\tawait updateFile();\n\t\tconst type = toValue(dataType);\n\t\tif (type === \"Text\") data.value = await ((_file$value5 = file.value) === null || _file$value5 === void 0 ? void 0 : _file$value5.text());\n\t\telse if (type === \"ArrayBuffer\") data.value = await ((_file$value6 = file.value) === null || _file$value6 === void 0 ? void 0 : _file$value6.arrayBuffer());\n\t\telse if (type === \"Blob\") data.value = file.value;\n\t}\n\twatch(() => toValue(dataType), updateData);\n\treturn {\n\t\tisSupported,\n\t\tdata,\n\t\tfile,\n\t\tfileName,\n\t\tfileMIME,\n\t\tfileSize,\n\t\tfileLastModified,\n\t\topen,\n\t\tcreate,\n\t\tsave,\n\t\tsaveAs,\n\t\tupdateData\n\t};\n}\n//#endregion\n//#region useFocus/index.ts\n/**\n* Track or set the focus state of a DOM element.\n*\n* @see https://vueuse.org/useFocus\n* @param target The target element for the focus and blur events.\n* @param options\n*/\nfunction useFocus(target, options = {}) {\n\tconst { initialValue = false, focusVisible = false, preventScroll = false } = options;\n\tconst innerFocused = shallowRef(false);\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, \"focus\", (event) => {\n\t\tvar _matches, _ref;\n\t\tif (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, \":focus-visible\"))) innerFocused.value = true;\n\t}, listenerOptions);\n\tuseEventListener(targetElement, \"blur\", () => innerFocused.value = false, listenerOptions);\n\tconst focused = computed({\n\t\tget: () => innerFocused.value,\n\t\tset(value) {\n\t\t\tvar _targetElement$value, _targetElement$value2;\n\t\t\tif (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();\n\t\t\telse if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });\n\t\t}\n\t});\n\twatch(targetElement, () => {\n\t\tfocused.value = initialValue;\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\treturn { focused };\n}\n//#endregion\n//#region useFocusWithin/index.ts\nconst EVENT_FOCUS_IN = \"focusin\";\nconst EVENT_FOCUS_OUT = \"focusout\";\nconst PSEUDO_CLASS_FOCUS_WITHIN = \":focus-within\";\n/**\n* Track if focus is contained within the target element\n*\n* @see https://vueuse.org/useFocusWithin\n* @param target The target element to track\n* @param options Focus within options\n*/\nfunction useFocusWithin(target, options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst _focused = shallowRef(false);\n\tconst focused = computed(() => _focused.value);\n\tconst activeElement = useActiveElement(options);\n\tif (!window || !activeElement.value) return { focused };\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions);\n\tuseEventListener(targetElement, EVENT_FOCUS_OUT, () => {\n\t\tvar _targetElement$value$, _targetElement$value, _targetElement$value$2;\n\t\treturn _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false;\n\t}, listenerOptions);\n\treturn { focused };\n}\n//#endregion\n//#region useFps/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useFps(options) {\n\tvar _options$every;\n\tconst fps = shallowRef(0);\n\tif (typeof performance === \"undefined\") return fps;\n\tconst every = (_options$every = options === null || options === void 0 ? void 0 : options.every) !== null && _options$every !== void 0 ? _options$every : 10;\n\tlet last = performance.now();\n\tlet ticks = 0;\n\tuseRafFn(() => {\n\t\tticks += 1;\n\t\tif (ticks >= every) {\n\t\t\tconst now = performance.now();\n\t\t\tconst diff = now - last;\n\t\t\tfps.value = Math.round(1e3 / (diff / ticks));\n\t\t\tlast = now;\n\t\t\tticks = 0;\n\t\t}\n\t});\n\treturn fps;\n}\n//#endregion\n//#region useFullscreen/index.ts\nconst eventHandlers = [\n\t\"fullscreenchange\",\n\t\"webkitfullscreenchange\",\n\t\"webkitendfullscreen\",\n\t\"mozfullscreenchange\",\n\t\"MSFullscreenChange\"\n];\n/**\n* Reactive Fullscreen API.\n*\n* @see https://vueuse.org/useFullscreen\n* @param target\n* @param options\n*/\nfunction useFullscreen(target, options = {}) {\n\tconst { document = defaultDocument, autoExit = false } = options;\n\tconst targetRef = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : document === null || document === void 0 ? void 0 : document.documentElement;\n\t});\n\tconst isFullscreen = shallowRef(false);\n\tconst requestMethod = computed(() => {\n\t\treturn [\n\t\t\t\"requestFullscreen\",\n\t\t\t\"webkitRequestFullscreen\",\n\t\t\t\"webkitEnterFullscreen\",\n\t\t\t\"webkitEnterFullScreen\",\n\t\t\t\"webkitRequestFullScreen\",\n\t\t\t\"mozRequestFullScreen\",\n\t\t\t\"msRequestFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst exitMethod = computed(() => {\n\t\treturn [\n\t\t\t\"exitFullscreen\",\n\t\t\t\"webkitExitFullscreen\",\n\t\t\t\"webkitExitFullScreen\",\n\t\t\t\"webkitCancelFullScreen\",\n\t\t\t\"mozCancelFullScreen\",\n\t\t\t\"msExitFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenEnabled = computed(() => {\n\t\treturn [\n\t\t\t\"fullScreen\",\n\t\t\t\"webkitIsFullScreen\",\n\t\t\t\"webkitDisplayingFullscreen\",\n\t\t\t\"mozFullScreen\",\n\t\t\t\"msFullscreenElement\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenElementMethod = [\n\t\t\"fullscreenElement\",\n\t\t\"webkitFullscreenElement\",\n\t\t\"mozFullScreenElement\",\n\t\t\"msFullscreenElement\"\n\t].find((m) => document && m in document);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n\tconst isCurrentElementFullScreen = () => {\n\t\tif (fullscreenElementMethod) return (document === null || document === void 0 ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n\t\treturn false;\n\t};\n\tconst isElementFullScreen = () => {\n\t\tif (fullscreenEnabled.value) if (document && document[fullscreenEnabled.value] != null) return document[fullscreenEnabled.value];\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[fullscreenEnabled.value]) != null) return Boolean(target[fullscreenEnabled.value]);\n\t\t}\n\t\treturn false;\n\t};\n\tasync function exit() {\n\t\tif (!isSupported.value || !isFullscreen.value) return;\n\t\tif (exitMethod.value) if ((document === null || document === void 0 ? void 0 : document[exitMethod.value]) != null) await document[exitMethod.value]();\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[exitMethod.value]) != null) await target[exitMethod.value]();\n\t\t}\n\t\tisFullscreen.value = false;\n\t}\n\tasync function enter() {\n\t\tif (!isSupported.value || isFullscreen.value) return;\n\t\tif (isElementFullScreen()) await exit();\n\t\tconst target = targetRef.value;\n\t\tif (requestMethod.value && (target === null || target === void 0 ? void 0 : target[requestMethod.value]) != null) {\n\t\t\tawait target[requestMethod.value]();\n\t\t\tisFullscreen.value = true;\n\t\t}\n\t}\n\tasync function toggle() {\n\t\tawait (isFullscreen.value ? exit() : enter());\n\t}\n\tconst handlerCallback = () => {\n\t\tconst isElementFullScreenValue = isElementFullScreen();\n\t\tif (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;\n\t};\n\tconst listenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t};\n\tuseEventListener(document, eventHandlers, handlerCallback, listenerOptions);\n\tuseEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, listenerOptions);\n\ttryOnMounted(handlerCallback, false);\n\tif (autoExit) tryOnScopeDispose(exit);\n\treturn {\n\t\tisSupported,\n\t\tisFullscreen,\n\t\tenter,\n\t\texit,\n\t\ttoggle\n\t};\n}\n//#endregion\n//#region useGamepad/index.ts\n/**\n* Maps a standard standard gamepad to an Xbox 360 Controller.\n*/\nfunction mapGamepadToXbox360Controller(gamepad) {\n\treturn computed(() => {\n\t\tif (gamepad.value) return {\n\t\t\tbuttons: {\n\t\t\t\ta: gamepad.value.buttons[0],\n\t\t\t\tb: gamepad.value.buttons[1],\n\t\t\t\tx: gamepad.value.buttons[2],\n\t\t\t\ty: gamepad.value.buttons[3]\n\t\t\t},\n\t\t\tbumper: {\n\t\t\t\tleft: gamepad.value.buttons[4],\n\t\t\t\tright: gamepad.value.buttons[5]\n\t\t\t},\n\t\t\ttriggers: {\n\t\t\t\tleft: gamepad.value.buttons[6],\n\t\t\t\tright: gamepad.value.buttons[7]\n\t\t\t},\n\t\t\tstick: {\n\t\t\t\tleft: {\n\t\t\t\t\thorizontal: gamepad.value.axes[0],\n\t\t\t\t\tvertical: gamepad.value.axes[1],\n\t\t\t\t\tbutton: gamepad.value.buttons[10]\n\t\t\t\t},\n\t\t\t\tright: {\n\t\t\t\t\thorizontal: gamepad.value.axes[2],\n\t\t\t\t\tvertical: gamepad.value.axes[3],\n\t\t\t\t\tbutton: gamepad.value.buttons[11]\n\t\t\t\t}\n\t\t\t},\n\t\t\tdpad: {\n\t\t\t\tup: gamepad.value.buttons[12],\n\t\t\t\tdown: gamepad.value.buttons[13],\n\t\t\t\tleft: gamepad.value.buttons[14],\n\t\t\t\tright: gamepad.value.buttons[15]\n\t\t\t},\n\t\t\tback: gamepad.value.buttons[8],\n\t\t\tstart: gamepad.value.buttons[9]\n\t\t};\n\t\treturn null;\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useGamepad(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getGamepads\" in navigator);\n\tconst gamepads = ref([]);\n\tconst onConnectedHook = createEventHook();\n\tconst onDisconnectedHook = createEventHook();\n\tconst stateFromGamepad = (gamepad) => {\n\t\tconst hapticActuators = [];\n\t\tconst vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n\t\tif (vibrationActuator) hapticActuators.push(vibrationActuator);\n\t\tif (gamepad.hapticActuators) hapticActuators.push(...gamepad.hapticActuators);\n\t\treturn {\n\t\t\tid: gamepad.id,\n\t\t\tindex: gamepad.index,\n\t\t\tconnected: gamepad.connected,\n\t\t\tmapping: gamepad.mapping,\n\t\t\ttimestamp: gamepad.timestamp,\n\t\t\tvibrationActuator: gamepad.vibrationActuator,\n\t\t\thapticActuators,\n\t\t\taxes: gamepad.axes.map((axes) => axes),\n\t\t\tbuttons: gamepad.buttons.map((button) => ({\n\t\t\t\tpressed: button.pressed,\n\t\t\t\ttouched: button.touched,\n\t\t\t\tvalue: button.value\n\t\t\t}))\n\t\t};\n\t};\n\tconst updateGamepadState = () => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) {\n\t\t\tif (!gamepad) continue;\n\t\t\tconst index = gamepads.value.findIndex((x) => x.index === gamepad.index);\n\t\t\tif (index > -1) gamepads.value[index] = stateFromGamepad(gamepad);\n\t\t}\n\t};\n\tconst { isActive, pause, resume } = useRafFn(updateGamepadState);\n\tconst onGamepadConnected = (gamepad) => {\n\t\tif (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n\t\t\tgamepads.value.push(stateFromGamepad(gamepad));\n\t\t\tonConnectedHook.trigger(gamepad.index);\n\t\t}\n\t\tresume();\n\t};\n\tconst onGamepadDisconnected = (gamepad) => {\n\t\tgamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n\t\tonDisconnectedHook.trigger(gamepad.index);\n\t};\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad), listenerOptions);\n\tuseEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad), listenerOptions);\n\ttryOnMounted(() => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) onGamepadConnected(gamepad);\n\t});\n\tpause();\n\treturn {\n\t\tisSupported,\n\t\tonConnected: onConnectedHook.on,\n\t\tonDisconnected: onDisconnectedHook.on,\n\t\tgamepads,\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n//#endregion\n//#region useGeolocation/index.ts\n/**\n* Reactive Geolocation API.\n*\n* @see https://vueuse.org/useGeolocation\n* @param options\n*/\nfunction useGeolocation(options = {}) {\n\tconst { enableHighAccuracy = true, maximumAge = 3e4, timeout = 27e3, navigator = defaultNavigator, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"geolocation\" in navigator);\n\tconst locatedAt = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst coords = shallowRef({\n\t\taccuracy: 0,\n\t\tlatitude: Number.POSITIVE_INFINITY,\n\t\tlongitude: Number.POSITIVE_INFINITY,\n\t\taltitude: null,\n\t\taltitudeAccuracy: null,\n\t\theading: null,\n\t\tspeed: null\n\t});\n\tfunction updatePosition(position) {\n\t\tlocatedAt.value = position.timestamp;\n\t\tcoords.value = position.coords;\n\t\terror.value = null;\n\t}\n\tlet watcher;\n\tfunction resume() {\n\t\tif (isSupported.value) watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n\t\t\tenableHighAccuracy,\n\t\t\tmaximumAge,\n\t\t\ttimeout\n\t\t});\n\t}\n\tif (immediate) resume();\n\tfunction pause() {\n\t\tif (watcher && navigator) navigator.geolocation.clearWatch(watcher);\n\t}\n\ttryOnScopeDispose(() => {\n\t\tpause();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcoords,\n\t\tlocatedAt,\n\t\terror,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region useIdle/index.ts\nconst defaultEvents$1 = [\n\t\"mousemove\",\n\t\"mousedown\",\n\t\"resize\",\n\t\"keydown\",\n\t\"touchstart\",\n\t\"wheel\"\n];\nconst oneMinute = 6e4;\n/**\n* Tracks whether the user is being inactive.\n*\n* @see https://vueuse.org/useIdle\n* @param timeout default to 1 minute\n* @param options IdleOptions\n*/\nfunction useIdle(timeout = oneMinute, options = {}) {\n\tconst { initialState = false, listenForVisibilityChange = true, events = defaultEvents$1, window = defaultWindow, eventFilter = throttleFilter(50) } = options;\n\tconst idle = shallowRef(initialState);\n\tconst lastActive = shallowRef(timestamp());\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tconst reset = () => {\n\t\tidle.value = false;\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => idle.value = true, timeout);\n\t};\n\tconst onEvent = createFilterWrapper(eventFilter, () => {\n\t\tlastActive.value = timestamp();\n\t\treset();\n\t});\n\tif (window) {\n\t\tconst document = window.document;\n\t\tconst listenerOptions = { passive: true };\n\t\tfor (const event of events) useEventListener(window, event, () => {\n\t\t\tif (!isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tif (listenForVisibilityChange) useEventListener(document, \"visibilitychange\", () => {\n\t\t\tif (document.hidden || !isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tstart();\n\t}\n\tfunction start() {\n\t\tif (isPending.value) return;\n\t\tisPending.value = true;\n\t\tif (!initialState) reset();\n\t}\n\tfunction stop() {\n\t\tidle.value = initialState;\n\t\tclearTimeout(timer);\n\t\tisPending.value = false;\n\t}\n\treturn {\n\t\tidle,\n\t\tlastActive,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tisPending: shallowReadonly(isPending)\n\t};\n}\n//#endregion\n//#region useImage/index.ts\nasync function loadImage(options) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\tconst { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy, width, height, decoding, fetchPriority, ismap, usemap } = options;\n\t\timg.src = src;\n\t\tif (srcset != null) img.srcset = srcset;\n\t\tif (sizes != null) img.sizes = sizes;\n\t\tif (clazz != null) img.className = clazz;\n\t\tif (loading != null) img.loading = loading;\n\t\tif (crossorigin != null) img.crossOrigin = crossorigin;\n\t\tif (referrerPolicy != null) img.referrerPolicy = referrerPolicy;\n\t\tif (width != null) img.width = width;\n\t\tif (height != null) img.height = height;\n\t\tif (decoding != null) img.decoding = decoding;\n\t\tif (fetchPriority != null) img.fetchPriority = fetchPriority;\n\t\tif (ismap != null) img.isMap = ismap;\n\t\tif (usemap != null) img.useMap = usemap;\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t});\n}\n/**\n* Reactive load an image in the browser, you can wait the result to display it or show a fallback.\n*\n* @see https://vueuse.org/useImage\n* @param options Image attributes, as used in the <img> tag\n* @param asyncStateOptions\n*/\nfunction useImage(options, asyncStateOptions = {}) {\n\tconst state = useAsyncState(() => loadImage(toValue(options)), void 0, {\n\t\tresetOnExecute: true,\n\t\t...asyncStateOptions\n\t});\n\twatch(() => toValue(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n\treturn state;\n}\n//#endregion\n//#region _resolve-element.ts\n/**\n* Resolves an element from a given element, window, or document.\n*\n* @internal\n*/\nfunction resolveElement(el) {\n\tif (typeof Window !== \"undefined\" && el instanceof Window) return el.document.documentElement;\n\tif (typeof Document !== \"undefined\" && el instanceof Document) return el.documentElement;\n\treturn el;\n}\n//#endregion\n//#region useScroll/index.ts\n/**\n* We have to check if the scroll amount is close enough to some threshold in order to\n* more accurately calculate arrivedState. This is because scrollTop/scrollLeft are non-rounded\n* numbers, while scrollHeight/scrollWidth and clientHeight/clientWidth are rounded.\n* https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled\n*/\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\n/**\n* Reactive scroll.\n*\n* @see https://vueuse.org/useScroll\n* @param element\n* @param options\n*/\nfunction useScroll(element, options = {}) {\n\tconst { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: 0\n\t}, observe: _observe = { mutation: false }, eventListenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t}, behavior = \"auto\", window = defaultWindow, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = options;\n\tconst observe = typeof _observe === \"boolean\" ? { mutation: _observe } : _observe;\n\tconst internalX = shallowRef(0);\n\tconst internalY = shallowRef(0);\n\tconst x = computed({\n\t\tget() {\n\t\t\treturn internalX.value;\n\t\t},\n\t\tset(x) {\n\t\t\tscrollTo(x, void 0);\n\t\t}\n\t});\n\tconst y = computed({\n\t\tget() {\n\t\t\treturn internalY.value;\n\t\t},\n\t\tset(y) {\n\t\t\tscrollTo(void 0, y);\n\t\t}\n\t});\n\tfunction scrollTo(_x, _y) {\n\t\tvar _ref, _toValue, _toValue2, _document;\n\t\tif (!window) return;\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\t(_ref = _element instanceof Document ? window.document.body : _element) === null || _ref === void 0 || _ref.scrollTo({\n\t\t\ttop: (_toValue = toValue(_y)) !== null && _toValue !== void 0 ? _toValue : y.value,\n\t\t\tleft: (_toValue2 = toValue(_x)) !== null && _toValue2 !== void 0 ? _toValue2 : x.value,\n\t\t\tbehavior: toValue(behavior)\n\t\t});\n\t\tconst scrollContainer = (_element === null || _element === void 0 || (_document = _element.document) === null || _document === void 0 ? void 0 : _document.documentElement) || (_element === null || _element === void 0 ? void 0 : _element.documentElement) || _element;\n\t\tif (x != null) internalX.value = scrollContainer.scrollLeft;\n\t\tif (y != null) internalY.value = scrollContainer.scrollTop;\n\t}\n\tconst isScrolling = shallowRef(false);\n\tconst arrivedState = reactive({\n\t\tleft: true,\n\t\tright: false,\n\t\ttop: true,\n\t\tbottom: false\n\t});\n\tconst directions = reactive({\n\t\tleft: false,\n\t\tright: false,\n\t\ttop: false,\n\t\tbottom: false\n\t});\n\tconst onScrollEnd = (e) => {\n\t\tif (!isScrolling.value) return;\n\t\tisScrolling.value = false;\n\t\tdirections.left = false;\n\t\tdirections.right = false;\n\t\tdirections.top = false;\n\t\tdirections.bottom = false;\n\t\tonStop(e);\n\t};\n\tconst onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n\tconst setArrivedState = (target) => {\n\t\tvar _document2;\n\t\tif (!window) return;\n\t\tconst el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);\n\t\tconst { display, flexDirection, direction } = window.getComputedStyle(el);\n\t\tconst directionMultipler = direction === \"rtl\" ? -1 : 1;\n\t\tconst scrollLeft = el.scrollLeft;\n\t\tdirections.left = scrollLeft < internalX.value;\n\t\tdirections.right = scrollLeft > internalX.value;\n\t\tconst left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);\n\t\tconst right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\tif (display === \"flex\" && flexDirection === \"row-reverse\") {\n\t\t\tarrivedState.left = right;\n\t\t\tarrivedState.right = left;\n\t\t} else {\n\t\t\tarrivedState.left = left;\n\t\t\tarrivedState.right = right;\n\t\t}\n\t\tinternalX.value = scrollLeft;\n\t\tlet scrollTop = el.scrollTop;\n\t\tif (target === window.document && !scrollTop) scrollTop = window.document.body.scrollTop;\n\t\tdirections.top = scrollTop < internalY.value;\n\t\tdirections.bottom = scrollTop > internalY.value;\n\t\tconst top = Math.abs(scrollTop) <= (offset.top || 0);\n\t\tconst bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\t/**\n\t\t* reverse columns and rows behave exactly the other way around,\n\t\t* bottom is treated as top and top is treated as the negative version of bottom\n\t\t*/\n\t\tif (display === \"flex\" && flexDirection === \"column-reverse\") {\n\t\t\tarrivedState.top = bottom;\n\t\t\tarrivedState.bottom = top;\n\t\t} else {\n\t\t\tarrivedState.top = top;\n\t\t\tarrivedState.bottom = bottom;\n\t\t}\n\t\tinternalY.value = scrollTop;\n\t};\n\tconst onScrollHandler = (e) => {\n\t\tvar _documentElement;\n\t\tif (!window) return;\n\t\tconst eventTarget = (_documentElement = e.target.documentElement) !== null && _documentElement !== void 0 ? _documentElement : e.target;\n\t\tsetArrivedState(eventTarget);\n\t\tisScrolling.value = true;\n\t\tonScrollEndDebounced(e);\n\t\tonScroll(e);\n\t};\n\tuseEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n\ttryOnMounted(() => {\n\t\ttry {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (!_element) return;\n\t\t\tsetArrivedState(_element);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t});\n\tif ((observe === null || observe === void 0 ? void 0 : observe.mutation) && element != null && element !== window && element !== document) useMutationObserver(element, () => {\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\tsetArrivedState(_element);\n\t}, {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n\tuseEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n\treturn {\n\t\tx,\n\t\ty,\n\t\tisScrolling,\n\t\tarrivedState,\n\t\tdirections,\n\t\tmeasure() {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (window && _element) setArrivedState(_element);\n\t\t}\n\t};\n}\n//#endregion\n//#region useInfiniteScroll/index.ts\n/**\n* Reactive infinite scroll.\n*\n* @see https://vueuse.org/useInfiniteScroll\n*/\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n\tvar _options$distance;\n\tconst { direction = \"bottom\", interval = 100, canLoadMore = () => true } = options;\n\tconst state = reactive(useScroll(element, {\n\t\t...options,\n\t\toffset: {\n\t\t\t[direction]: (_options$distance = options.distance) !== null && _options$distance !== void 0 ? _options$distance : 0,\n\t\t\t...options.offset\n\t\t}\n\t}));\n\tconst promise = shallowRef();\n\tconst isLoading = computed(() => !!promise.value);\n\tconst observedElement = computed(() => {\n\t\treturn resolveElement(toValue(element));\n\t});\n\tconst isElementVisible = useElementVisibility(observedElement);\n\tconst canLoad = computed(() => {\n\t\tif (!observedElement.value) return false;\n\t\treturn canLoadMore(observedElement.value);\n\t});\n\tfunction checkAndLoad() {\n\t\tstate.measure();\n\t\tif (!observedElement.value || !isElementVisible.value || !canLoad.value || promise.value) return;\n\t\tconst { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n\t\tconst isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n\t\tif (state.arrivedState[direction] || isNarrower) promise.value = Promise.all([onLoadMore(state), new Promise((resolve) => setTimeout(resolve, interval))]).finally(() => {\n\t\t\tpromise.value = null;\n\t\t\tnextTick(() => checkAndLoad());\n\t\t});\n\t}\n\ttryOnUnmounted(watch(() => [\n\t\tstate.arrivedState[direction],\n\t\tisElementVisible.value,\n\t\tcanLoad.value\n\t], checkAndLoad, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t}));\n\treturn {\n\t\tisLoading,\n\t\treset() {\n\t\t\tnextTick(() => checkAndLoad());\n\t\t}\n\t};\n}\n//#endregion\n//#region useKeyModifier/index.ts\nconst defaultEvents = [\n\t\"mousedown\",\n\t\"mouseup\",\n\t\"keydown\",\n\t\"keyup\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction useKeyModifier(modifier, options = {}) {\n\tconst { events = defaultEvents, document = defaultDocument, initial = null } = options;\n\tconst state = shallowRef(initial);\n\tif (document) events.forEach((listenerEvent) => {\n\t\tuseEventListener(document, listenerEvent, (evt) => {\n\t\t\tif (typeof evt.getModifierState === \"function\") state.value = evt.getModifierState(modifier);\n\t\t}, { passive: true });\n\t});\n\treturn state;\n}\n//#endregion\n//#region useLocalStorage/index.ts\n/**\n* Reactive LocalStorage.\n*\n* @see https://vueuse.org/useLocalStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useLocalStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.localStorage, options);\n}\n//#endregion\n//#region useMagicKeys/aliasMap.ts\nconst DefaultMagicKeysAliasMap = {\n\tctrl: \"control\",\n\tcommand: \"meta\",\n\tcmd: \"meta\",\n\toption: \"alt\",\n\tup: \"arrowup\",\n\tdown: \"arrowdown\",\n\tleft: \"arrowleft\",\n\tright: \"arrowright\"\n};\n//#endregion\n//#region useMagicKeys/index.ts\n/**\n* Reactive keys pressed state, with magical keys combination support.\n*\n* @see https://vueuse.org/useMagicKeys\n*/\nfunction useMagicKeys(options = {}) {\n\tconst { reactive: useReactive = false, target = defaultWindow, aliasMap = DefaultMagicKeysAliasMap, passive = true, onEventFired = noop } = options;\n\tconst current = reactive(/* @__PURE__ */ new Set());\n\tconst obj = {\n\t\ttoJSON() {\n\t\t\treturn {};\n\t\t},\n\t\tcurrent\n\t};\n\tconst refs = useReactive ? reactive(obj) : obj;\n\tconst metaDeps = /* @__PURE__ */ new Set();\n\tconst depsMap = /* @__PURE__ */ new Map([\n\t\t[\"Meta\", metaDeps],\n\t\t[\"Shift\", /* @__PURE__ */ new Set()],\n\t\t[\"Alt\", /* @__PURE__ */ new Set()]\n\t]);\n\tconst usedKeys = /* @__PURE__ */ new Set();\n\tfunction setRefs(key, value) {\n\t\tif (key in refs) if (useReactive) refs[key] = value;\n\t\telse refs[key].value = value;\n\t}\n\tfunction reset() {\n\t\tcurrent.clear();\n\t\tfor (const key of usedKeys) setRefs(key, false);\n\t}\n\tfunction updateDeps(value, e, keys) {\n\t\tif (!value || typeof e.getModifierState !== \"function\") return;\n\t\tfor (const [modifier, depsSet] of depsMap) if (e.getModifierState(modifier)) {\n\t\t\tkeys.forEach((key) => depsSet.add(key));\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction clearDeps(value, key) {\n\t\tif (value) return;\n\t\tconst depsMapKey = `${key[0].toUpperCase()}${key.slice(1)}`;\n\t\tconst deps = depsMap.get(depsMapKey);\n\t\tif (![\"shift\", \"alt\"].includes(key) || !deps) return;\n\t\tconst depsArray = Array.from(deps);\n\t\tconst depsIndex = depsArray.indexOf(key);\n\t\tdepsArray.forEach((key, index) => {\n\t\t\tif (index >= depsIndex) {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t}\n\t\t});\n\t\tdeps.clear();\n\t}\n\tfunction updateRefs(e, value) {\n\t\tvar _e$key, _e$code;\n\t\tconst key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();\n\t\tconst values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);\n\t\tif (!key) return;\n\t\tif (key) if (value) current.add(key);\n\t\telse current.delete(key);\n\t\tfor (const key of values) {\n\t\t\tusedKeys.add(key);\n\t\t\tsetRefs(key, value);\n\t\t}\n\t\tupdateDeps(value, e, [...current, ...values]);\n\t\tclearDeps(value, key);\n\t\tif (key === \"meta\" && !value) {\n\t\t\tmetaDeps.forEach((key) => {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t});\n\t\t\tmetaDeps.clear();\n\t\t}\n\t}\n\tuseEventListener(target, \"keydown\", (e) => {\n\t\tupdateRefs(e, true);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(target, \"keyup\", (e) => {\n\t\tupdateRefs(e, false);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(\"blur\", reset, { passive });\n\tuseEventListener(\"focus\", reset, { passive });\n\tconst proxy = new Proxy(refs, { get(target, prop, rec) {\n\t\tif (typeof prop !== \"string\") return Reflect.get(target, prop, rec);\n\t\tprop = prop.toLowerCase();\n\t\tif (prop in aliasMap) prop = aliasMap[prop];\n\t\tif (!(prop in refs)) if (/[+_-]/.test(prop)) {\n\t\t\tconst keys = prop.split(/[+_-]/g).map((i) => i.trim());\n\t\t\trefs[prop] = computed(() => keys.map((key) => toValue(proxy[key])).every(Boolean));\n\t\t} else refs[prop] = shallowRef(false);\n\t\tconst r = Reflect.get(target, prop, rec);\n\t\treturn useReactive ? toValue(r) : r;\n\t} });\n\treturn proxy;\n}\n//#endregion\n//#region useMediaControls/index.ts\n/**\n* Automatically check if the ref exists and if it does run the cb fn\n*/\nfunction usingElRef(source, cb) {\n\tif (toValue(source)) cb(toValue(source));\n}\n/**\n* Converts a TimeRange object to an array\n*/\nfunction timeRangeToArray(timeRanges) {\n\tlet ranges = [];\n\tfor (let i = 0; i < timeRanges.length; ++i) ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n\treturn ranges;\n}\n/**\n* Converts a TextTrackList object to an array of `UseMediaTextTrack`\n*/\nfunction tracksToArray(tracks) {\n\treturn Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({\n\t\tid,\n\t\tlabel,\n\t\tkind,\n\t\tlanguage,\n\t\tmode,\n\t\tactiveCues,\n\t\tcues,\n\t\tinBandMetadataTrackDispatchType\n\t}));\n}\nconst defaultOptions = {\n\tsrc: \"\",\n\ttracks: []\n};\nfunction useMediaControls(target, options = {}) {\n\ttarget = toRef(target);\n\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { document = defaultDocument } = options;\n\tconst listenerOptions = { passive: true };\n\tconst currentTime = shallowRef(0);\n\tconst duration = shallowRef(0);\n\tconst seeking = shallowRef(false);\n\tconst volume = shallowRef(1);\n\tconst waiting = shallowRef(false);\n\tconst ended = shallowRef(false);\n\tconst playing = shallowRef(false);\n\tconst rate = shallowRef(1);\n\tconst stalled = shallowRef(false);\n\tconst buffered = shallowRef([]);\n\tconst tracks = shallowRef([]);\n\tconst selectedTrack = shallowRef(-1);\n\tconst isPictureInPicture = shallowRef(false);\n\tconst muted = shallowRef(false);\n\tconst supportsPictureInPicture = Boolean(document && \"pictureInPictureEnabled\" in document);\n\tconst sourceErrorEvent = createEventHook();\n\tconst playbackErrorEvent = createEventHook();\n\t/**\n\t* Disables the specified track. If no track is specified then\n\t* all tracks will be disabled\n\t*\n\t* @param track The id of the track to disable\n\t*/\n\tconst disableTrack = (track) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tif (track) {\n\t\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\t\tel.textTracks[id].mode = \"disabled\";\n\t\t\t} else for (let i = 0; i < el.textTracks.length; ++i) el.textTracks[i].mode = \"disabled\";\n\t\t\tselectedTrack.value = -1;\n\t\t});\n\t};\n\t/**\n\t* Enables the specified track and disables the\n\t* other tracks unless otherwise specified\n\t*\n\t* @param track The track of the id of the track to enable\n\t* @param disableTracks Disable all other tracks\n\t*/\n\tconst enableTrack = (track, disableTracks = true) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\tif (disableTracks) disableTrack();\n\t\t\tel.textTracks[id].mode = \"showing\";\n\t\t\tselectedTrack.value = id;\n\t\t});\n\t};\n\t/**\n\t* Toggle picture in picture mode for the player.\n\t*/\n\tconst togglePictureInPicture = () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tusingElRef(target, async (el) => {\n\t\t\t\tif (supportsPictureInPicture) if (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);\n\t\t\t\telse document.exitPictureInPicture().then(resolve).catch(reject);\n\t\t\t});\n\t\t});\n\t};\n\t/**\n\t* This will automatically inject sources to the media element. The sources will be\n\t* appended as children to the media element as `<source>` elements.\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tconst src = toValue(options.src);\n\t\tlet sources = [];\n\t\tif (!src) return;\n\t\tif (typeof src === \"string\") sources = [{ src }];\n\t\telse if (Array.isArray(src)) sources = src;\n\t\telse if (isObject(src)) sources = [src];\n\t\tel.querySelectorAll(\"source\").forEach((e) => {\n\t\t\te.remove();\n\t\t});\n\t\tsources.forEach(({ src, type, media }) => {\n\t\t\tconst source = document.createElement(\"source\");\n\t\t\tsource.setAttribute(\"src\", src);\n\t\t\tsource.setAttribute(\"type\", type || \"\");\n\t\t\tsource.setAttribute(\"media\", media || \"\");\n\t\t\tuseEventListener(source, \"error\", sourceErrorEvent.trigger, listenerOptions);\n\t\t\tel.appendChild(source);\n\t\t});\n\t\tel.load();\n\t});\n\t/**\n\t* Apply composable state to the element, also when element is changed\n\t*/\n\twatch([target, volume], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.volume = volume.value;\n\t});\n\twatch([target, muted], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.muted = muted.value;\n\t});\n\twatch([target, rate], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.playbackRate = rate.value;\n\t});\n\t/**\n\t* Load Tracks\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst textTracks = toValue(options.tracks);\n\t\tconst el = toValue(target);\n\t\tif (!textTracks || !textTracks.length || !el) return;\n\t\t/**\n\t\t* The MediaAPI provides an API for adding text tracks, but they don't currently\n\t\t* have an API for removing text tracks, so instead we will just create and remove\n\t\t* the tracks manually using the HTML api.\n\t\t*/\n\t\tel.querySelectorAll(\"track\").forEach((e) => e.remove());\n\t\ttextTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n\t\t\tconst track = document.createElement(\"track\");\n\t\t\ttrack.default = isDefault || false;\n\t\t\ttrack.kind = kind;\n\t\t\ttrack.label = label;\n\t\t\ttrack.src = src;\n\t\t\ttrack.srclang = srcLang;\n\t\t\tif (track.default) selectedTrack.value = i;\n\t\t\tel.appendChild(track);\n\t\t});\n\t});\n\t/**\n\t* This will allow us to update the current time from the timeupdate event\n\t* without setting the medias current position, but if the user changes the\n\t* current time via the ref, then the media will seek.\n\t*\n\t* If we did not use an ignorable watch, then the current time update from\n\t* the timeupdate event would cause the media to stutter.\n\t*/\n\tconst { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.currentTime = time;\n\t});\n\t/**\n\t* Using an ignorable watch so we can control the play state using a ref and not\n\t* a function\n\t*/\n\tconst { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tif (isPlaying) el.play().catch((e) => {\n\t\t\tplaybackErrorEvent.trigger(e);\n\t\t\tthrow e;\n\t\t});\n\t\telse el.pause();\n\t});\n\tuseEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime), listenerOptions);\n\tuseEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration, listenerOptions);\n\tuseEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered), listenerOptions);\n\tuseEventListener(target, \"seeking\", () => seeking.value = true, listenerOptions);\n\tuseEventListener(target, \"seeked\", () => seeking.value = false, listenerOptions);\n\tuseEventListener(target, [\"waiting\", \"loadstart\"], () => {\n\t\twaiting.value = true;\n\t\tignorePlayingUpdates(() => playing.value = false);\n\t}, listenerOptions);\n\tuseEventListener(target, \"loadeddata\", () => waiting.value = false, listenerOptions);\n\tuseEventListener(target, \"playing\", () => {\n\t\twaiting.value = false;\n\t\tended.value = false;\n\t\tignorePlayingUpdates(() => playing.value = true);\n\t}, listenerOptions);\n\tuseEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate, listenerOptions);\n\tuseEventListener(target, \"stalled\", () => stalled.value = true, listenerOptions);\n\tuseEventListener(target, \"ended\", () => ended.value = true, listenerOptions);\n\tuseEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false), listenerOptions);\n\tuseEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true), listenerOptions);\n\tuseEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true, listenerOptions);\n\tuseEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false, listenerOptions);\n\tuseEventListener(target, \"volumechange\", () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tvolume.value = el.volume;\n\t\tmuted.value = el.muted;\n\t}, listenerOptions);\n\t/**\n\t* The following listeners need to listen to a nested\n\t* object on the target, so we will have to use a nested\n\t* watch and manually remove the listeners\n\t*/\n\tconst listeners = [];\n\tconst stop = watch([target], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tstop();\n\t\tlisteners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t});\n\ttryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n\treturn {\n\t\tcurrentTime,\n\t\tduration,\n\t\twaiting,\n\t\tseeking,\n\t\tended,\n\t\tstalled,\n\t\tbuffered,\n\t\tplaying,\n\t\trate,\n\t\tvolume,\n\t\tmuted,\n\t\ttracks,\n\t\tselectedTrack,\n\t\tenableTrack,\n\t\tdisableTrack,\n\t\tsupportsPictureInPicture,\n\t\ttogglePictureInPicture,\n\t\tisPictureInPicture,\n\t\tonSourceError: sourceErrorEvent.on,\n\t\tonPlaybackError: playbackErrorEvent.on\n\t};\n}\n//#endregion\n//#region useMemoize/index.ts\n/**\n* Reactive function result cache based on arguments\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemoize(resolver, options) {\n\tconst initCache = () => {\n\t\tif (options === null || options === void 0 ? void 0 : options.cache) return shallowReactive(options.cache);\n\t\treturn shallowReactive(/* @__PURE__ */ new Map());\n\t};\n\tconst cache = initCache();\n\t/**\n\t* Generate key from args\n\t*/\n\tconst generateKey = (...args) => (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n\t/**\n\t* Load data and save in cache\n\t*/\n\tconst _loadData = (key, ...args) => {\n\t\tcache.set(key, resolver(...args));\n\t\treturn cache.get(key);\n\t};\n\tconst loadData = (...args) => _loadData(generateKey(...args), ...args);\n\t/**\n\t* Delete key from cache\n\t*/\n\tconst deleteData = (...args) => {\n\t\tcache.delete(generateKey(...args));\n\t};\n\t/**\n\t* Clear cached data\n\t*/\n\tconst clearData = () => {\n\t\tcache.clear();\n\t};\n\tconst memoized = (...args) => {\n\t\tconst key = generateKey(...args);\n\t\tif (cache.has(key)) return cache.get(key);\n\t\treturn _loadData(key, ...args);\n\t};\n\tmemoized.load = loadData;\n\tmemoized.delete = deleteData;\n\tmemoized.clear = clearData;\n\tmemoized.generateKey = generateKey;\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n//#endregion\n//#region useMemory/index.ts\nfunction getDefaultScheduler$6(options) {\n\tif (\"interval\" in options || \"immediate\" in options || \"immediateCallback\" in options) {\n\t\tconst { interval = 1e3, immediate, immediateCallback } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, {\n\t\t\timmediate,\n\t\t\timmediateCallback\n\t\t});\n\t}\n\treturn useIntervalFn;\n}\n/**\n* Reactive Memory Info.\n*\n* @see https://vueuse.org/useMemory\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemory(options = {}) {\n\tconst memory = shallowRef();\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n\tif (isSupported.value) {\n\t\tconst { scheduler = getDefaultScheduler$6 } = options;\n\t\tscheduler(() => {\n\t\t\tmemory.value = performance.memory;\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tmemory\n\t};\n}\n//#endregion\n//#region useMouse/index.ts\nconst UseMouseBuiltinExtractors = {\n\tpage: (event) => [event.pageX, event.pageY],\n\tclient: (event) => [event.clientX, event.clientY],\n\tscreen: (event) => [event.screenX, event.screenY],\n\tmovement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null\n};\n/**\n* Reactive mouse position.\n*\n* @see https://vueuse.org/useMouse\n* @param options\n*/\nfunction useMouse(options = {}) {\n\tconst { type = \"page\", touch = true, resetOnTouchEnds = false, initialValue = {\n\t\tx: 0,\n\t\ty: 0\n\t}, window = defaultWindow, target = window, scroll = true, eventFilter } = options;\n\tlet _prevMouseEvent = null;\n\tlet _prevScrollX = 0;\n\tlet _prevScrollY = 0;\n\tconst x = shallowRef(initialValue.x);\n\tconst y = shallowRef(initialValue.y);\n\tconst sourceType = shallowRef(null);\n\tconst extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n\tconst mouseHandler = (event) => {\n\t\tconst result = extractor(event);\n\t\t_prevMouseEvent = event;\n\t\tif (result) {\n\t\t\t[x.value, y.value] = result;\n\t\t\tsourceType.value = \"mouse\";\n\t\t}\n\t\tif (window) {\n\t\t\t_prevScrollX = window.scrollX;\n\t\t\t_prevScrollY = window.scrollY;\n\t\t}\n\t};\n\tconst touchHandler = (event) => {\n\t\tif (event.touches.length > 0) {\n\t\t\tconst result = extractor(event.touches[0]);\n\t\t\tif (result) {\n\t\t\t\t[x.value, y.value] = result;\n\t\t\t\tsourceType.value = \"touch\";\n\t\t\t}\n\t\t}\n\t};\n\tconst scrollHandler = () => {\n\t\tif (!_prevMouseEvent || !window) return;\n\t\tconst pos = extractor(_prevMouseEvent);\n\t\tif (_prevMouseEvent instanceof MouseEvent && pos) {\n\t\t\tx.value = pos[0] + window.scrollX - _prevScrollX;\n\t\t\ty.value = pos[1] + window.scrollY - _prevScrollY;\n\t\t}\n\t};\n\tconst reset = () => {\n\t\tx.value = initialValue.x;\n\t\ty.value = initialValue.y;\n\t};\n\tconst mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n\tconst touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n\tconst scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n\t\tif (touch && type !== \"movement\") {\n\t\t\tuseEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n\t\t\tif (resetOnTouchEnds) useEventListener(target, \"touchend\", reset, listenerOptions);\n\t\t}\n\t\tif (scroll && type === \"page\") useEventListener(window, \"scroll\", scrollHandlerWrapper, listenerOptions);\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useMouseInElement/index.ts\n/**\n* Reactive mouse position related to an element.\n*\n* @see https://vueuse.org/useMouseInElement\n* @param target\n* @param options\n*/\nfunction useMouseInElement(target, options = {}) {\n\tconst { windowResize = true, windowScroll = true, handleOutside = true, window = defaultWindow } = options;\n\tconst type = options.type || \"page\";\n\tconst { x, y, sourceType } = useMouse(options);\n\tconst targetRef = shallowRef(target !== null && target !== void 0 ? target : window === null || window === void 0 ? void 0 : window.document.body);\n\tconst elementX = shallowRef(0);\n\tconst elementY = shallowRef(0);\n\tconst elementPositionX = shallowRef(0);\n\tconst elementPositionY = shallowRef(0);\n\tconst elementHeight = shallowRef(0);\n\tconst elementWidth = shallowRef(0);\n\tconst isOutside = shallowRef(true);\n\tfunction update() {\n\t\tif (!window) return;\n\t\tconst el = unrefElement(targetRef);\n\t\tif (!el || !(el instanceof Element)) return;\n\t\tfor (const rect of el.getClientRects()) {\n\t\t\tconst { left, top, width, height } = rect;\n\t\t\telementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n\t\t\telementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n\t\t\telementHeight.value = height;\n\t\t\telementWidth.value = width;\n\t\t\tconst elX = x.value - elementPositionX.value;\n\t\t\tconst elY = y.value - elementPositionY.value;\n\t\t\tisOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n\t\t\tif (handleOutside || !isOutside.value) {\n\t\t\t\telementX.value = elX;\n\t\t\t\telementY.value = elY;\n\t\t\t}\n\t\t\tif (!isOutside.value) break;\n\t\t}\n\t}\n\tconst stopFnList = [];\n\tfunction stop() {\n\t\tstopFnList.forEach((fn) => fn());\n\t\tstopFnList.length = 0;\n\t}\n\ttryOnMounted(() => {\n\t\tupdate();\n\t});\n\tif (window) {\n\t\tconst { stop: stopResizeObserver } = useResizeObserver(targetRef, update);\n\t\tconst { stop: stopMutationObserver } = useMutationObserver(targetRef, update, { attributeFilter: [\"style\", \"class\"] });\n\t\tconst stopWatch = watch([\n\t\t\ttargetRef,\n\t\t\tx,\n\t\t\ty\n\t\t], update);\n\t\tstopFnList.push(stopResizeObserver, stopMutationObserver, stopWatch);\n\t\tuseEventListener(document, \"mouseleave\", () => isOutside.value = true, { passive: true });\n\t\tif (windowScroll) stopFnList.push(useEventListener(\"scroll\", update, {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t}));\n\t\tif (windowResize) stopFnList.push(useEventListener(\"resize\", update, { passive: true }));\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType,\n\t\telementX,\n\t\telementY,\n\t\telementPositionX,\n\t\telementPositionY,\n\t\telementHeight,\n\t\telementWidth,\n\t\tisOutside,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useMousePressed/index.ts\n/**\n* Reactive mouse pressing state.\n*\n* @see https://vueuse.org/useMousePressed\n* @param options\n*/\nfunction useMousePressed(options = {}) {\n\tconst { touch = true, drag = true, capture = false, initialValue = false, window = defaultWindow } = options;\n\tconst pressed = shallowRef(initialValue);\n\tconst sourceType = shallowRef(null);\n\tif (!window) return {\n\t\tpressed,\n\t\tsourceType\n\t};\n\tconst onPressed = (srcType) => (event) => {\n\t\tvar _options$onPressed;\n\t\tpressed.value = true;\n\t\tsourceType.value = srcType;\n\t\t(_options$onPressed = options.onPressed) === null || _options$onPressed === void 0 || _options$onPressed.call(options, event);\n\t};\n\tconst onReleased = (event) => {\n\t\tvar _options$onReleased;\n\t\tpressed.value = false;\n\t\tsourceType.value = null;\n\t\t(_options$onReleased = options.onReleased) === null || _options$onReleased === void 0 || _options$onReleased.call(options, event);\n\t};\n\tconst target = computed(() => unrefElement(options.target) || window);\n\tconst listenerOptions = {\n\t\tpassive: true,\n\t\tcapture\n\t};\n\tuseEventListener(target, \"mousedown\", onPressed(\"mouse\"), listenerOptions);\n\tuseEventListener(window, \"mouseleave\", onReleased, listenerOptions);\n\tuseEventListener(window, \"mouseup\", onReleased, listenerOptions);\n\tif (drag) {\n\t\tuseEventListener(target, \"dragstart\", onPressed(\"mouse\"), listenerOptions);\n\t\tuseEventListener(window, \"drop\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"dragend\", onReleased, listenerOptions);\n\t}\n\tif (touch) {\n\t\tuseEventListener(target, \"touchstart\", onPressed(\"touch\"), listenerOptions);\n\t\tuseEventListener(window, \"touchend\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"touchcancel\", onReleased, listenerOptions);\n\t}\n\treturn {\n\t\tpressed,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useNavigatorLanguage/index.ts\n/**\n*\n* Reactive useNavigatorLanguage\n*\n* Detects the currently selected user language and returns a reactive language\n* @see https://vueuse.org/useNavigatorLanguage\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNavigatorLanguage(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"language\" in navigator);\n\tconst language = shallowRef(navigator === null || navigator === void 0 ? void 0 : navigator.language);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tif (navigator) language.value = navigator.language;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tlanguage\n\t};\n}\n//#endregion\n//#region useNetwork/index.ts\n/**\n* Reactive Network status.\n*\n* @see https://vueuse.org/useNetwork\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNetwork(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"connection\" in navigator);\n\tconst isOnline = shallowRef(true);\n\tconst saveData = shallowRef(false);\n\tconst offlineAt = shallowRef(void 0);\n\tconst onlineAt = shallowRef(void 0);\n\tconst downlink = shallowRef(void 0);\n\tconst downlinkMax = shallowRef(void 0);\n\tconst rtt = shallowRef(void 0);\n\tconst effectiveType = shallowRef(void 0);\n\tconst type = shallowRef(\"unknown\");\n\tconst connection = isSupported.value && navigator.connection;\n\tfunction updateNetworkInformation() {\n\t\tif (!navigator) return;\n\t\tisOnline.value = navigator.onLine;\n\t\tofflineAt.value = isOnline.value ? void 0 : Date.now();\n\t\tonlineAt.value = isOnline.value ? Date.now() : void 0;\n\t\tif (connection) {\n\t\t\tdownlink.value = connection.downlink;\n\t\t\tdownlinkMax.value = connection.downlinkMax;\n\t\t\teffectiveType.value = connection.effectiveType;\n\t\t\trtt.value = connection.rtt;\n\t\t\tsaveData.value = connection.saveData;\n\t\t\ttype.value = connection.type;\n\t\t}\n\t}\n\tconst listenerOptions = { passive: true };\n\tif (window) {\n\t\tuseEventListener(window, \"offline\", () => {\n\t\t\tisOnline.value = false;\n\t\t\tofflineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"online\", () => {\n\t\t\tisOnline.value = true;\n\t\t\tonlineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t}\n\tif (connection) useEventListener(connection, \"change\", updateNetworkInformation, listenerOptions);\n\tupdateNetworkInformation();\n\treturn {\n\t\tisSupported,\n\t\tisOnline: shallowReadonly(isOnline),\n\t\tsaveData: shallowReadonly(saveData),\n\t\tofflineAt: shallowReadonly(offlineAt),\n\t\tonlineAt: shallowReadonly(onlineAt),\n\t\tdownlink: shallowReadonly(downlink),\n\t\tdownlinkMax: shallowReadonly(downlinkMax),\n\t\teffectiveType: shallowReadonly(effectiveType),\n\t\trtt: shallowReadonly(rtt),\n\t\ttype: shallowReadonly(type)\n\t};\n}\n//#endregion\n//#region useNow/index.ts\nfunction getDefaultScheduler$5(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (fn) => useRafFn(fn, { immediate }) : (fn) => useIntervalFn(fn, interval, options);\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive current Date instance.\n*\n* @see https://vueuse.org/useNow\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNow(options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$5(options) } = options;\n\tconst now = shallowRef(/* @__PURE__ */ new Date());\n\tconst update = () => now.value = /* @__PURE__ */ new Date();\n\tconst controls = scheduler(update);\n\tif (exposeControls) return {\n\t\tnow,\n\t\t...controls\n\t};\n\telse return now;\n}\n//#endregion\n//#region useObjectUrl/index.ts\n/**\n* Reactive URL representing an object.\n*\n* @see https://vueuse.org/useObjectUrl\n* @param object\n*/\nfunction useObjectUrl(object) {\n\tconst url = shallowRef();\n\tconst release = () => {\n\t\tif (url.value) URL.revokeObjectURL(url.value);\n\t\turl.value = void 0;\n\t};\n\twatch(() => toValue(object), (newObject) => {\n\t\trelease();\n\t\tif (newObject) url.value = URL.createObjectURL(newObject);\n\t}, { immediate: true });\n\ttryOnScopeDispose(release);\n\treturn shallowReadonly(url);\n}\n//#endregion\n//#region ../math/useClamp/index.ts\n/**\n* Reactively clamp a value between two other values.\n*\n* @see https://vueuse.org/useClamp\n* @param value number\n* @param min\n* @param max\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useClamp(value, min, max) {\n\tif (typeof value === \"function\" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n\tconst _value = ref(value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn _value.value = clamp(_value.value, toValue(min), toValue(max));\n\t\t},\n\t\tset(value) {\n\t\t\t_value.value = clamp(value, toValue(min), toValue(max));\n\t\t}\n\t});\n}\n//#endregion\n//#region useOffsetPagination/index.ts\nfunction useOffsetPagination(options) {\n\tconst { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;\n\tconst currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n\tconst pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));\n\tconst currentPage = useClamp(page, 1, pageCount);\n\tconst isFirstPage = computed(() => currentPage.value === 1);\n\tconst isLastPage = computed(() => currentPage.value === pageCount.value);\n\tif (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? \"ltr\" : \"both\" });\n\tif (isRef(pageSize)) syncRef(pageSize, currentPageSize, { direction: isReadonly(pageSize) ? \"ltr\" : \"both\" });\n\tfunction prev() {\n\t\tcurrentPage.value--;\n\t}\n\tfunction next() {\n\t\tcurrentPage.value++;\n\t}\n\tconst returnValue = {\n\t\tcurrentPage,\n\t\tcurrentPageSize,\n\t\tpageCount,\n\t\tisFirstPage,\n\t\tisLastPage,\n\t\tprev,\n\t\tnext\n\t};\n\twatch(currentPage, () => {\n\t\tonPageChange(reactive(returnValue));\n\t});\n\twatch(currentPageSize, () => {\n\t\tonPageSizeChange(reactive(returnValue));\n\t});\n\twatch(pageCount, () => {\n\t\tonPageCountChange(reactive(returnValue));\n\t});\n\treturn returnValue;\n}\n//#endregion\n//#region useOnline/index.ts\n/**\n* Reactive online state.\n*\n* @see https://vueuse.org/useOnline\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useOnline(options = {}) {\n\tconst { isOnline } = useNetwork(options);\n\treturn isOnline;\n}\n//#endregion\n//#region usePageLeave/index.ts\n/**\n* Reactive state to show whether mouse leaves the page.\n*\n* @see https://vueuse.org/usePageLeave\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePageLeave(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isLeft = shallowRef(false);\n\tconst handler = (event) => {\n\t\tif (!window) return;\n\t\tevent = event || window.event;\n\t\tconst from = event.relatedTarget || event.toElement;\n\t\tisLeft.value = !from;\n\t};\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"mouseout\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseleave\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseenter\", handler, listenerOptions);\n\t}\n\treturn isLeft;\n}\n//#endregion\n//#region useScreenOrientation/index.ts\n/**\n* Reactive screen orientation\n*\n* @see https://vueuse.org/useScreenOrientation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useScreenOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n\tconst screenOrientation = isSupported.value ? window.screen.orientation : {};\n\tconst orientation = shallowRef(screenOrientation.type);\n\tconst angle = shallowRef(screenOrientation.angle || 0);\n\tif (isSupported.value) useEventListener(window, \"orientationchange\", () => {\n\t\torientation.value = screenOrientation.type;\n\t\tangle.value = screenOrientation.angle;\n\t}, { passive: true });\n\tconst lockOrientation = (type) => {\n\t\tif (isSupported.value && typeof screenOrientation.lock === \"function\") return screenOrientation.lock(type);\n\t\treturn Promise.reject(/* @__PURE__ */ new Error(\"Not supported\"));\n\t};\n\tconst unlockOrientation = () => {\n\t\tif (isSupported.value && typeof screenOrientation.unlock === \"function\") screenOrientation.unlock();\n\t};\n\treturn {\n\t\tisSupported,\n\t\torientation,\n\t\tangle,\n\t\tlockOrientation,\n\t\tunlockOrientation\n\t};\n}\n//#endregion\n//#region useParallax/index.ts\n/**\n* Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`\n* if orientation is not supported.\n*\n* @param target\n* @param options\n*/\nfunction useParallax(target, options = {}) {\n\tconst { deviceOrientationTiltAdjust = (i) => i, deviceOrientationRollAdjust = (i) => i, mouseTiltAdjust = (i) => i, mouseRollAdjust = (i) => i, window = defaultWindow } = options;\n\tconst orientation = reactive(useDeviceOrientation({ window }));\n\tconst screenOrientation = reactive(useScreenOrientation({ window }));\n\tconst { elementX: x, elementY: y, elementWidth: width, elementHeight: height } = useMouseInElement(target, {\n\t\thandleOutside: false,\n\t\twindow\n\t});\n\tconst source = computed(() => {\n\t\tif (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0)) return \"deviceOrientation\";\n\t\treturn \"mouse\";\n\t});\n\treturn {\n\t\troll: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = -orientation.beta / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationRollAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = -(y.value - height.value / 2) / height.value;\n\t\t\t\treturn mouseRollAdjust(value);\n\t\t\t}\n\t\t}),\n\t\ttilt: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = orientation.gamma / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationTiltAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = (x.value - width.value / 2) / width.value;\n\t\t\t\treturn mouseTiltAdjust(value);\n\t\t\t}\n\t\t}),\n\t\tsource\n\t};\n}\n//#endregion\n//#region useParentElement/index.ts\nfunction useParentElement(element = useCurrentElement()) {\n\tconst parentElement = shallowRef();\n\tconst update = () => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) parentElement.value = el.parentElement;\n\t};\n\ttryOnMounted(update);\n\twatch(() => toValue(element), update);\n\treturn parentElement;\n}\n//#endregion\n//#region usePerformanceObserver/index.ts\n/**\n* Observe performance metrics.\n*\n* @see https://vueuse.org/usePerformanceObserver\n* @param options\n*/\nfunction usePerformanceObserver(options, callback) {\n\tconst { window = defaultWindow, immediate = true, ...performanceOptions } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"PerformanceObserver\" in window);\n\tlet observer;\n\tconst stop = () => {\n\t\tobserver === null || observer === void 0 || observer.disconnect();\n\t};\n\tconst start = () => {\n\t\tif (isSupported.value) {\n\t\t\tstop();\n\t\t\tobserver = new PerformanceObserver(callback);\n\t\t\tobserver.observe(performanceOptions);\n\t\t}\n\t};\n\ttryOnScopeDispose(stop);\n\tif (immediate) start();\n\treturn {\n\t\tisSupported,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePointer/index.ts\nconst defaultState = {\n\tx: 0,\n\ty: 0,\n\tpointerId: 0,\n\tpressure: 0,\n\ttiltX: 0,\n\ttiltY: 0,\n\twidth: 0,\n\theight: 0,\n\ttwist: 0,\n\tpointerType: null\n};\nconst keys = /* #__PURE__ */ Object.keys(defaultState);\n/**\n* Reactive pointer state.\n*\n* @see https://vueuse.org/usePointer\n* @param options\n*/\nfunction usePointer(options = {}) {\n\tconst { target = defaultWindow } = options;\n\tconst isInside = shallowRef(false);\n\tconst state = shallowRef(options.initialValue || {});\n\tObject.assign(state.value, defaultState, state.value);\n\tconst handler = (event) => {\n\t\tisInside.value = true;\n\t\tif (options.pointerTypes && !options.pointerTypes.includes(event.pointerType)) return;\n\t\tstate.value = objectPick(event, keys, false);\n\t};\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\n\t\t\t\"pointerdown\",\n\t\t\t\"pointermove\",\n\t\t\t\"pointerup\"\n\t\t], handler, listenerOptions);\n\t\tuseEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n\t}\n\treturn {\n\t\t...toRefs(state),\n\t\tisInside\n\t};\n}\n//#endregion\n//#region usePointerLock/index.ts\n/**\n* Reactive pointer lock.\n*\n* @see https://vueuse.org/usePointerLock\n* @param target\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePointerLock(target, options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => document && \"pointerLockElement\" in document);\n\tconst element = shallowRef();\n\tconst triggerElement = shallowRef();\n\tlet targetElement;\n\tif (isSupported.value) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(document, \"pointerlockchange\", () => {\n\t\t\tvar _pointerLockElement;\n\t\t\tconst currentElement = (_pointerLockElement = document.pointerLockElement) !== null && _pointerLockElement !== void 0 ? _pointerLockElement : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\telement.value = document.pointerLockElement;\n\t\t\t\tif (!element.value) targetElement = triggerElement.value = null;\n\t\t\t}\n\t\t}, listenerOptions);\n\t\tuseEventListener(document, \"pointerlockerror\", () => {\n\t\t\tvar _pointerLockElement2;\n\t\t\tconst currentElement = (_pointerLockElement2 = document.pointerLockElement) !== null && _pointerLockElement2 !== void 0 ? _pointerLockElement2 : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\tconst action = document.pointerLockElement ? \"release\" : \"acquire\";\n\t\t\t\tthrow new Error(`Failed to ${action} pointer lock.`);\n\t\t\t}\n\t\t}, listenerOptions);\n\t}\n\tasync function lock(e) {\n\t\tvar _unrefElement;\n\t\tif (!isSupported.value) throw new Error(\"Pointer Lock API is not supported by your browser.\");\n\t\ttriggerElement.value = e instanceof Event ? e.currentTarget : null;\n\t\ttargetElement = e instanceof Event ? (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : triggerElement.value : unrefElement(e);\n\t\tif (!targetElement) throw new Error(\"Target element undefined.\");\n\t\ttargetElement.requestPointerLock();\n\t\treturn await until(element).toBe(targetElement);\n\t}\n\tasync function unlock() {\n\t\tif (!element.value) return false;\n\t\tdocument.exitPointerLock();\n\t\tawait until(element).toBeNull();\n\t\treturn true;\n\t}\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\ttriggerElement,\n\t\tlock,\n\t\tunlock\n\t};\n}\n//#endregion\n//#region usePointerSwipe/index.ts\n/**\n* Reactive swipe detection based on PointerEvents.\n*\n* @see https://vueuse.org/usePointerSwipe\n* @param target\n* @param options\n*/\nfunction usePointerSwipe(target, options = {}) {\n\tconst targetRef = toRef(target);\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, disableTextSelect = false } = options;\n\tconst posStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosStart = (x, y) => {\n\t\tposStart.x = x;\n\t\tposStart.y = y;\n\t};\n\tconst posEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosEnd = (x, y) => {\n\t\tposEnd.x = x;\n\t\tposEnd.y = y;\n\t};\n\tconst distanceX = computed(() => posStart.x - posEnd.x);\n\tconst distanceY = computed(() => posStart.y - posEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst isPointerDown = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(distanceX.value) > abs(distanceY.value)) return distanceX.value > 0 ? \"left\" : \"right\";\n\t\telse return distanceY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst eventIsAllowed = (e) => {\n\t\tvar _ref, _options$pointerTypes, _options$pointerTypes2;\n\t\tconst isReleasingButton = e.buttons === 0;\n\t\tconst isPrimaryButton = e.buttons === 1;\n\t\treturn (_ref = (_options$pointerTypes = (_options$pointerTypes2 = options.pointerTypes) === null || _options$pointerTypes2 === void 0 ? void 0 : _options$pointerTypes2.includes(e.pointerType)) !== null && _options$pointerTypes !== void 0 ? _options$pointerTypes : isReleasingButton || isPrimaryButton) !== null && _ref !== void 0 ? _ref : true;\n\t};\n\tconst listenerOptions = { passive: true };\n\tconst stops = [\n\t\tuseEventListener(target, \"pointerdown\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tisPointerDown.value = true;\n\t\t\tconst eventTarget = e.target;\n\t\t\teventTarget === null || eventTarget === void 0 || eventTarget.setPointerCapture(e.pointerId);\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosStart(x, y);\n\t\t\tupdatePosEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointermove\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (!isPointerDown.value) return;\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosEnd(x, y);\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"pointerup\", \"pointercancel\"], (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\t\tisPointerDown.value = false;\n\t\t\tisSwiping.value = false;\n\t\t}, listenerOptions)\n\t];\n\ttryOnMounted(() => {\n\t\tvar _targetRef$value;\n\t\t(_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 || (_targetRef$value = _targetRef$value.style) === null || _targetRef$value === void 0 || _targetRef$value.setProperty(\"touch-action\", \"pan-y\");\n\t\tif (disableTextSelect) {\n\t\t\tvar _targetRef$value2, _targetRef$value3, _targetRef$value4;\n\t\t\t(_targetRef$value2 = targetRef.value) === null || _targetRef$value2 === void 0 || (_targetRef$value2 = _targetRef$value2.style) === null || _targetRef$value2 === void 0 || _targetRef$value2.setProperty(\"-webkit-user-select\", \"none\");\n\t\t\t(_targetRef$value3 = targetRef.value) === null || _targetRef$value3 === void 0 || (_targetRef$value3 = _targetRef$value3.style) === null || _targetRef$value3 === void 0 || _targetRef$value3.setProperty(\"-ms-user-select\", \"none\");\n\t\t\t(_targetRef$value4 = targetRef.value) === null || _targetRef$value4 === void 0 || (_targetRef$value4 = _targetRef$value4.style) === null || _targetRef$value4 === void 0 || _targetRef$value4.setProperty(\"user-select\", \"none\");\n\t\t}\n\t});\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping: shallowReadonly(isSwiping),\n\t\tdirection: shallowReadonly(direction),\n\t\tposStart: readonly(posStart),\n\t\tposEnd: readonly(posEnd),\n\t\tdistanceX,\n\t\tdistanceY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePreferredColorScheme/index.ts\n/**\n* Reactive prefers-color-scheme media query.\n*\n* @see https://vueuse.org/usePreferredColorScheme\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredColorScheme(options) {\n\tconst isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n\tconst isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n\treturn computed(() => {\n\t\tif (isDark.value) return \"dark\";\n\t\tif (isLight.value) return \"light\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredContrast/index.ts\n/**\n* Reactive prefers-contrast media query.\n*\n* @see https://vueuse.org/usePreferredContrast\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredContrast(options) {\n\tconst isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n\tconst isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n\tconst isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n\treturn computed(() => {\n\t\tif (isMore.value) return \"more\";\n\t\tif (isLess.value) return \"less\";\n\t\tif (isCustom.value) return \"custom\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredLanguages/index.ts\n/**\n* Reactive Navigator Languages.\n*\n* @see https://vueuse.org/usePreferredLanguages\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredLanguages(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef([\"en\"]);\n\tconst navigator = window.navigator;\n\tconst value = shallowRef(navigator.languages);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tvalue.value = navigator.languages;\n\t}, { passive: true });\n\treturn value;\n}\n//#endregion\n//#region usePreferredReducedMotion/index.ts\n/**\n* Reactive prefers-reduced-motion media query.\n*\n* @see https://vueuse.org/usePreferredReducedMotion\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedMotion(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredReducedTransparency/index.ts\n/**\n* Reactive prefers-reduced-transparency media query.\n*\n* @see https://vueuse.org/usePreferredReducedTransparency\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedTransparency(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-transparency: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePrevious/index.ts\nfunction usePrevious(value, initialValue) {\n\tconst previous = shallowRef(initialValue);\n\twatch(toRef(value), (_, oldValue) => {\n\t\tprevious.value = oldValue;\n\t}, { flush: \"sync\" });\n\treturn readonly(previous);\n}\n//#endregion\n//#region useScreenSafeArea/index.ts\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\n/**\n* Reactive `env(safe-area-inset-*)`\n*\n* @see https://vueuse.org/useScreenSafeArea\n*/\nfunction useScreenSafeArea() {\n\tconst top = shallowRef(\"\");\n\tconst right = shallowRef(\"\");\n\tconst bottom = shallowRef(\"\");\n\tconst left = shallowRef(\"\");\n\tif (isClient) {\n\t\tconst topCssVar = useCssVar(topVarName);\n\t\tconst rightCssVar = useCssVar(rightVarName);\n\t\tconst bottomCssVar = useCssVar(bottomVarName);\n\t\tconst leftCssVar = useCssVar(leftVarName);\n\t\ttopCssVar.value = \"env(safe-area-inset-top, 0px)\";\n\t\trightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n\t\tbottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n\t\tleftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n\t\ttryOnMounted(update);\n\t\tuseEventListener(\"resize\", useDebounceFn(update), { passive: true });\n\t}\n\tfunction update() {\n\t\ttop.value = getValue(topVarName);\n\t\tright.value = getValue(rightVarName);\n\t\tbottom.value = getValue(bottomVarName);\n\t\tleft.value = getValue(leftVarName);\n\t}\n\treturn {\n\t\ttop,\n\t\tright,\n\t\tbottom,\n\t\tleft,\n\t\tupdate\n\t};\n}\nfunction getValue(position) {\n\treturn getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n//#endregion\n//#region useScriptTag/index.ts\n/**\n* Async script tag loading.\n*\n* @see https://vueuse.org/useScriptTag\n* @param src\n* @param onLoaded\n* @param options\n*/\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n\tconst { immediate = true, manual = false, type = \"text/javascript\", async = true, crossOrigin, referrerPolicy, noModule, defer, document = defaultDocument, attrs = {}, nonce = void 0 } = options;\n\tconst scriptTag = shallowRef(null);\n\tlet _promise = null;\n\t/**\n\t* Load the script specified via `src`.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n\t\tconst resolveWithElement = (el) => {\n\t\t\tscriptTag.value = el;\n\t\t\tresolve(el);\n\t\t\treturn el;\n\t\t};\n\t\tif (!document) {\n\t\t\tresolve(false);\n\t\t\treturn;\n\t\t}\n\t\tlet shouldAppend = false;\n\t\tlet el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (!el) {\n\t\t\tel = document.createElement(\"script\");\n\t\t\tel.type = type;\n\t\t\tel.async = async;\n\t\t\tel.src = toValue(src);\n\t\t\tif (defer) el.defer = defer;\n\t\t\tif (crossOrigin) el.crossOrigin = crossOrigin;\n\t\t\tif (noModule) el.noModule = noModule;\n\t\t\tif (referrerPolicy) el.referrerPolicy = referrerPolicy;\n\t\t\tif (nonce) el.nonce = nonce;\n\t\t\tObject.entries(attrs).forEach(([name, value]) => el === null || el === void 0 ? void 0 : el.setAttribute(name, value));\n\t\t\tshouldAppend = true;\n\t\t} else if (el.hasAttribute(\"data-loaded\")) resolveWithElement(el);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(el, \"error\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"abort\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"load\", () => {\n\t\t\tel.setAttribute(\"data-loaded\", \"true\");\n\t\t\tonLoaded(el);\n\t\t\tresolveWithElement(el);\n\t\t}, listenerOptions);\n\t\tif (shouldAppend) el = document.head.appendChild(el);\n\t\tif (!waitForScriptLoad) resolveWithElement(el);\n\t});\n\t/**\n\t* Exposed singleton wrapper for `loadScript`, avoiding calling it twice.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst load = (waitForScriptLoad = true) => {\n\t\tif (!_promise) _promise = loadScript(waitForScriptLoad);\n\t\treturn _promise;\n\t};\n\t/**\n\t* Unload the script specified by `src`.\n\t*/\n\tconst unload = () => {\n\t\tif (!document) return;\n\t\t_promise = null;\n\t\tif (scriptTag.value) scriptTag.value = null;\n\t\tconst el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (el) document.head.removeChild(el);\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnUnmounted(unload);\n\treturn {\n\t\tscriptTag,\n\t\tload,\n\t\tunload\n\t};\n}\n//#endregion\n//#region useScrollLock/index.ts\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!parent || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault) e.preventDefault();\n\treturn false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\n/**\n* Lock scrolling of the element.\n*\n* @see https://vueuse.org/useScrollLock\n* @param element\n*/\nfunction useScrollLock(element, initialState = false) {\n\tconst isLocked = shallowRef(initialState);\n\tlet stopTouchMoveListener = null;\n\tlet initialOverflow = \"\";\n\twatch(toRef(element), (el) => {\n\t\tconst target = resolveElement(toValue(el));\n\t\tif (target) {\n\t\t\tconst ele = target;\n\t\t\tif (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);\n\t\t\tif (ele.style.overflow !== \"hidden\") initialOverflow = ele.style.overflow;\n\t\t\tif (ele.style.overflow === \"hidden\") return isLocked.value = true;\n\t\t\tif (isLocked.value) return ele.style.overflow = \"hidden\";\n\t\t}\n\t}, { immediate: true });\n\tconst lock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(el, \"touchmove\", (e) => {\n\t\t\tpreventDefault(e);\n\t\t}, { passive: false });\n\t\tel.style.overflow = \"hidden\";\n\t\tisLocked.value = true;\n\t};\n\tconst unlock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || !isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();\n\t\tel.style.overflow = initialOverflow;\n\t\telInitialOverflow.delete(el);\n\t\tisLocked.value = false;\n\t};\n\ttryOnScopeDispose(unlock);\n\treturn computed({\n\t\tget() {\n\t\t\treturn isLocked.value;\n\t\t},\n\t\tset(v) {\n\t\t\tif (v) lock();\n\t\t\telse unlock();\n\t\t}\n\t});\n}\n//#endregion\n//#region useSessionStorage/index.ts\n/**\n* Reactive SessionStorage.\n*\n* @see https://vueuse.org/useSessionStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useSessionStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.sessionStorage, options);\n}\n//#endregion\n//#region useShare/index.ts\n/**\n* Reactive Web Share API.\n*\n* @see https://vueuse.org/useShare\n* @param shareOptions\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useShare(shareOptions = {}, options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst _navigator = navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => _navigator && \"canShare\" in _navigator);\n\tconst share = async (overrideOptions = {}) => {\n\t\tif (isSupported.value) {\n\t\t\tconst data = {\n\t\t\t\t...toValue(shareOptions),\n\t\t\t\t...toValue(overrideOptions)\n\t\t\t};\n\t\t\tlet granted = false;\n\t\t\tif (_navigator.canShare) granted = _navigator.canShare(data);\n\t\t\tif (granted) return _navigator.share(data);\n\t\t}\n\t};\n\treturn {\n\t\tisSupported,\n\t\tshare\n\t};\n}\n//#endregion\n//#region useSorted/index.ts\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n\tconst [source] = args;\n\tlet compareFn = defaultCompare;\n\tlet options = {};\n\tif (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tvar _options$compareFn;\n\t\toptions = args[1];\n\t\tcompareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;\n\t} else {\n\t\tvar _args$;\n\t\tcompareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;\n\t}\n\telse if (args.length > 2) {\n\t\tvar _args$2, _args$3;\n\t\tcompareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;\n\t\toptions = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};\n\t}\n\tconst { dirty = false, sortFn = defaultSortFn } = options;\n\tif (!dirty) return computed(() => sortFn([...toValue(source)], compareFn));\n\twatchEffect(() => {\n\t\tconst result = sortFn(toValue(source), compareFn);\n\t\tif (isRef(source)) source.value = result;\n\t\telse source.splice(0, source.length, ...result);\n\t});\n\treturn source;\n}\n//#endregion\n//#region useSpeechRecognition/index.ts\n/**\n* Reactive SpeechRecognition.\n*\n* @see https://vueuse.org/useSpeechRecognition\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition\n* @param options\n*/\nfunction useSpeechRecognition(options = {}) {\n\tconst { interimResults = true, continuous = true, maxAlternatives = 1, window = defaultWindow } = options;\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst isListening = shallowRef(false);\n\tconst isFinal = shallowRef(false);\n\tconst result = shallowRef(\"\");\n\tconst confidence = shallowRef(0);\n\tconst error = shallowRef(void 0);\n\tlet recognition;\n\tconst start = () => {\n\t\tisListening.value = true;\n\t};\n\tconst stop = () => {\n\t\tisListening.value = false;\n\t};\n\tconst toggle = (value = !isListening.value) => {\n\t\tif (value) start();\n\t\telse stop();\n\t};\n\tconst SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => SpeechRecognition);\n\tif (isSupported.value) {\n\t\trecognition = new SpeechRecognition();\n\t\trecognition.continuous = continuous;\n\t\trecognition.interimResults = interimResults;\n\t\trecognition.lang = toValue(lang);\n\t\trecognition.maxAlternatives = maxAlternatives;\n\t\trecognition.onstart = () => {\n\t\t\tisListening.value = true;\n\t\t\tisFinal.value = false;\n\t\t};\n\t\twatch(lang, (lang) => {\n\t\t\tif (recognition && !isListening.value) recognition.lang = lang;\n\t\t});\n\t\trecognition.onresult = (event) => {\n\t\t\tconst currentResult = event.results[event.resultIndex];\n\t\t\tconst { transcript, confidence: alternativeConfidence } = currentResult[0];\n\t\t\tisFinal.value = currentResult.isFinal;\n\t\t\tresult.value = transcript;\n\t\t\tconfidence.value = alternativeConfidence;\n\t\t\terror.value = void 0;\n\t\t};\n\t\trecognition.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\trecognition.onend = () => {\n\t\t\tisListening.value = false;\n\t\t\trecognition.lang = toValue(lang);\n\t\t};\n\t\twatch(isListening, (newValue, oldValue) => {\n\t\t\tif (newValue === oldValue) return;\n\t\t\ttry {\n\t\t\t\tif (newValue) recognition.start();\n\t\t\t\telse recognition.stop();\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisListening,\n\t\tisFinal: shallowReadonly(isFinal),\n\t\trecognition,\n\t\tresult: shallowReadonly(result),\n\t\tconfidence: shallowReadonly(confidence),\n\t\terror,\n\t\ttoggle,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useSpeechSynthesis/index.ts\n/**\n* Reactive SpeechSynthesis.\n*\n* @see https://vueuse.org/useSpeechSynthesis\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis\n*/\nfunction useSpeechSynthesis(text, options = {}) {\n\tconst { pitch = 1, rate = 1, volume = 1, window = defaultWindow, onBoundary } = options;\n\tconst synth = window && window.speechSynthesis;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => synth);\n\tconst isPlaying = shallowRef(false);\n\tconst status = shallowRef(\"init\");\n\tconst spokenText = toRef(text || \"\");\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst error = shallowRef(void 0);\n\tconst toggle = (value = !isPlaying.value) => {\n\t\tisPlaying.value = value;\n\t};\n\tconst bindEventsForUtterance = (utterance) => {\n\t\tutterance.lang = toValue(lang);\n\t\tutterance.voice = toValue(options.voice) || null;\n\t\tutterance.pitch = toValue(pitch);\n\t\tutterance.rate = toValue(rate);\n\t\tutterance.volume = toValue(volume);\n\t\tutterance.onstart = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onpause = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"pause\";\n\t\t};\n\t\tutterance.onresume = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onend = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"end\";\n\t\t};\n\t\tutterance.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\tutterance.onboundary = (event) => {\n\t\t\tonBoundary === null || onBoundary === void 0 || onBoundary(event);\n\t\t};\n\t};\n\tconst utterance = computed(() => {\n\t\tisPlaying.value = false;\n\t\tstatus.value = \"init\";\n\t\tconst newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n\t\tbindEventsForUtterance(newUtterance);\n\t\treturn newUtterance;\n\t});\n\tconst speak = () => {\n\t\tsynth.cancel();\n\t\tif (utterance) synth.speak(utterance.value);\n\t};\n\tconst stop = () => {\n\t\tsynth.cancel();\n\t\tisPlaying.value = false;\n\t};\n\tif (isSupported.value) {\n\t\tbindEventsForUtterance(utterance.value);\n\t\twatch(lang, (lang) => {\n\t\t\tif (utterance.value && !isPlaying.value) utterance.value.lang = lang;\n\t\t});\n\t\tif (options.voice) watch(options.voice, () => {\n\t\t\tsynth.cancel();\n\t\t});\n\t\twatch(isPlaying, () => {\n\t\t\tif (isPlaying.value) synth.resume();\n\t\t\telse synth.pause();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tisPlaying.value = false;\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisPlaying,\n\t\tstatus,\n\t\tutterance,\n\t\terror,\n\t\tstop,\n\t\ttoggle,\n\t\tspeak\n\t};\n}\n//#endregion\n//#region useStepper/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useStepper(steps, initialStep) {\n\tconst stepsRef = ref(steps);\n\tconst stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n\tconst index = ref(stepNames.value.indexOf(initialStep !== null && initialStep !== void 0 ? initialStep : stepNames.value[0]));\n\tconst current = computed(() => at(index.value));\n\tconst isFirst = computed(() => index.value === 0);\n\tconst isLast = computed(() => index.value === stepNames.value.length - 1);\n\tconst next = computed(() => stepNames.value[index.value + 1]);\n\tconst previous = computed(() => stepNames.value[index.value - 1]);\n\tfunction at(index) {\n\t\tif (Array.isArray(stepsRef.value)) return stepsRef.value[index];\n\t\treturn stepsRef.value[stepNames.value[index]];\n\t}\n\tfunction get(step) {\n\t\tif (!stepNames.value.includes(step)) return;\n\t\treturn at(stepNames.value.indexOf(step));\n\t}\n\tfunction goTo(step) {\n\t\tif (stepNames.value.includes(step)) index.value = stepNames.value.indexOf(step);\n\t}\n\tfunction goToNext() {\n\t\tif (isLast.value) return;\n\t\tindex.value++;\n\t}\n\tfunction goToPrevious() {\n\t\tif (isFirst.value) return;\n\t\tindex.value--;\n\t}\n\tfunction goBackTo(step) {\n\t\tif (isAfter(step)) goTo(step);\n\t}\n\tfunction isNext(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value + 1;\n\t}\n\tfunction isPrevious(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value - 1;\n\t}\n\tfunction isCurrent(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value;\n\t}\n\tfunction isBefore(step) {\n\t\treturn index.value < stepNames.value.indexOf(step);\n\t}\n\tfunction isAfter(step) {\n\t\treturn index.value > stepNames.value.indexOf(step);\n\t}\n\treturn {\n\t\tsteps: stepsRef,\n\t\tstepNames,\n\t\tindex,\n\t\tcurrent,\n\t\tnext,\n\t\tprevious,\n\t\tisFirst,\n\t\tisLast,\n\t\tat,\n\t\tget,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoBackTo,\n\t\tisNext,\n\t\tisPrevious,\n\t\tisCurrent,\n\t\tisBefore,\n\t\tisAfter\n\t};\n}\n//#endregion\n//#region useStorageAsync/index.ts\n/**\n* Reactive Storage with async support.\n*\n* @see https://vueuse.org/useStorageAsync\n* @param key\n* @param initialValue\n* @param storage\n* @param options\n*/\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, onReady } = options;\n\tconst rawInit = toValue(initialValue);\n\tconst type = guessSerializerType(rawInit);\n\tconst data = (shallow ? shallowRef : ref)(toValue(initialValue));\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorageAsync\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tasync function read(event) {\n\t\tif (!storage || event && event.key !== key) return;\n\t\ttry {\n\t\t\tconst rawValue = event ? event.newValue : await storage.getItem(key);\n\t\t\tif (rawValue == null) {\n\t\t\t\tdata.value = rawInit;\n\t\t\t\tif (writeDefaults && rawInit !== null) await storage.setItem(key, await serializer.write(rawInit));\n\t\t\t} else if (mergeDefaults) {\n\t\t\t\tconst value = await serializer.read(rawValue);\n\t\t\t\tif (typeof mergeDefaults === \"function\") data.value = mergeDefaults(value, rawInit);\n\t\t\t\telse if (type === \"object\" && !Array.isArray(value)) data.value = {\n\t\t\t\t\t...rawInit,\n\t\t\t\t\t...value\n\t\t\t\t};\n\t\t\t\telse data.value = value;\n\t\t\t} else data.value = await serializer.read(rawValue);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tconst promise = new Promise((resolve) => {\n\t\tread().then(() => {\n\t\t\tonReady === null || onReady === void 0 || onReady(data.value);\n\t\t\tresolve(data);\n\t\t});\n\t});\n\tif (window && listenToStorageChanges) useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)), { passive: true });\n\tif (storage) watchWithFilter(data, async () => {\n\t\ttry {\n\t\t\tif (data.value == null) await storage.removeItem(key);\n\t\t\telse await storage.setItem(key, await serializer.write(data.value));\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\tObject.assign(data, {\n\t\tthen: promise.then.bind(promise),\n\t\tcatch: promise.catch.bind(promise)\n\t});\n\treturn data;\n}\n//#endregion\n//#region useStyleTag/index.ts\nlet _id = 0;\nconst _refCount = /* @__PURE__ */ new WeakMap();\n/**\n* Inject <style> element in head.\n*\n* Overload: Omitted id\n*\n* @see https://vueuse.org/useStyleTag\n* @param css\n* @param options\n*/\nfunction useStyleTag(css, options = {}) {\n\tconst isLoaded = shallowRef(false);\n\tconst { document = defaultDocument, immediate = true, manual = false, id = `vueuse_styletag_${++_id}` } = options;\n\tconst cssRef = shallowRef(css);\n\tlet stop = () => {};\n\tconst load = () => {\n\t\tvar _refCount$get;\n\t\tif (!document) return;\n\t\tconst el = document.getElementById(id) || document.createElement(\"style\");\n\t\tif (!el.isConnected) {\n\t\t\tel.id = id;\n\t\t\tif (options.nonce) el.nonce = options.nonce;\n\t\t\tif (options.media) el.media = options.media;\n\t\t\tdocument.head.appendChild(el);\n\t\t}\n\t\tif (isLoaded.value) return;\n\t\t_refCount.set(el, ((_refCount$get = _refCount.get(el)) !== null && _refCount$get !== void 0 ? _refCount$get : 0) + 1);\n\t\tstop = watch(cssRef, (value) => {\n\t\t\tel.textContent = value;\n\t\t}, { immediate: true });\n\t\tisLoaded.value = true;\n\t};\n\tconst unload = () => {\n\t\tif (!document || !isLoaded.value) return;\n\t\tstop();\n\t\tconst el = document.getElementById(id);\n\t\tif (el) {\n\t\t\tvar _refCount$get2;\n\t\t\tconst count = ((_refCount$get2 = _refCount.get(el)) !== null && _refCount$get2 !== void 0 ? _refCount$get2 : 1) - 1;\n\t\t\tif (count <= 0) {\n\t\t\t\t_refCount.delete(el);\n\t\t\t\tdocument.head.removeChild(el);\n\t\t\t} else _refCount.set(el, count);\n\t\t}\n\t\tisLoaded.value = false;\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnScopeDispose(unload);\n\treturn {\n\t\tid,\n\t\tcss: cssRef,\n\t\tunload,\n\t\tload,\n\t\tisLoaded: shallowReadonly(isLoaded)\n\t};\n}\n//#endregion\n//#region useSwipe/index.ts\n/**\n* Reactive swipe detection.\n*\n* @see https://vueuse.org/useSwipe\n* @param target\n* @param options\n*/\nfunction useSwipe(target, options = {}) {\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;\n\tconst coordsStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst coordsEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst diffX = computed(() => coordsStart.x - coordsEnd.x);\n\tconst diffY = computed(() => coordsStart.y - coordsEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? \"left\" : \"right\";\n\t\telse return diffY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n\tconst updateCoordsStart = (x, y) => {\n\t\tcoordsStart.x = x;\n\t\tcoordsStart.y = y;\n\t};\n\tconst updateCoordsEnd = (x, y) => {\n\t\tcoordsEnd.x = x;\n\t\tcoordsEnd.y = y;\n\t};\n\tconst listenerOptions = {\n\t\tpassive,\n\t\tcapture: !passive\n\t};\n\tconst onTouchEnd = (e) => {\n\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\tisSwiping.value = false;\n\t};\n\tconst stops = [\n\t\tuseEventListener(target, \"touchstart\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsStart(x, y);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"touchmove\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tif (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n\t];\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping,\n\t\tdirection,\n\t\tcoordsStart,\n\t\tcoordsEnd,\n\t\tlengthX: diffX,\n\t\tlengthY: diffY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTemplateRefsList/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTemplateRefsList() {\n\tconst refs = ref([]);\n\trefs.value.set = (el) => {\n\t\tif (el) refs.value.push(el);\n\t};\n\tonBeforeUpdate(() => {\n\t\trefs.value.length = 0;\n\t});\n\treturn refs;\n}\n//#endregion\n//#region useTextDirection/index.ts\n/**\n* Reactive dir of the element's text.\n*\n* @see https://vueuse.org/useTextDirection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextDirection(options = {}) {\n\tconst { document = defaultDocument, selector = \"html\", observe = false, initialValue = \"ltr\" } = options;\n\tfunction getValue() {\n\t\tvar _ref, _document$querySelect;\n\t\treturn (_ref = document === null || document === void 0 || (_document$querySelect = document.querySelector(selector)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute(\"dir\")) !== null && _ref !== void 0 ? _ref : initialValue;\n\t}\n\tconst dir = shallowRef(getValue());\n\ttryOnMounted(() => dir.value = getValue());\n\tif (observe && document) useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n\treturn computed({\n\t\tget() {\n\t\t\treturn dir.value;\n\t\t},\n\t\tset(v) {\n\t\t\tvar _document$querySelect2, _document$querySelect3;\n\t\t\tdir.value = v;\n\t\t\tif (!document) return;\n\t\t\tif (dir.value) (_document$querySelect2 = document.querySelector(selector)) === null || _document$querySelect2 === void 0 || _document$querySelect2.setAttribute(\"dir\", dir.value);\n\t\t\telse (_document$querySelect3 = document.querySelector(selector)) === null || _document$querySelect3 === void 0 || _document$querySelect3.removeAttribute(\"dir\");\n\t\t}\n\t});\n}\n//#endregion\n//#region useTextSelection/index.ts\nfunction getRangesFromSelection(selection) {\n\tvar _selection$rangeCount;\n\tconst rangeCount = (_selection$rangeCount = selection.rangeCount) !== null && _selection$rangeCount !== void 0 ? _selection$rangeCount : 0;\n\treturn Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\n/**\n* Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).\n*\n* @see https://vueuse.org/useTextSelection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextSelection(options = {}) {\n\tvar _window$getSelection;\n\tconst { window = defaultWindow } = options;\n\tconst selection = shallowRef((_window$getSelection = window === null || window === void 0 ? void 0 : window.getSelection()) !== null && _window$getSelection !== void 0 ? _window$getSelection : null);\n\tconst text = computed(() => {\n\t\tvar _selection$value$toSt, _selection$value;\n\t\treturn (_selection$value$toSt = (_selection$value = selection.value) === null || _selection$value === void 0 ? void 0 : _selection$value.toString()) !== null && _selection$value$toSt !== void 0 ? _selection$value$toSt : \"\";\n\t});\n\tconst ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n\tconst rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n\tfunction onSelectionChange() {\n\t\tselection.value = null;\n\t\tif (window) selection.value = window.getSelection();\n\t}\n\tif (window) useEventListener(window.document, \"selectionchange\", onSelectionChange, { passive: true });\n\treturn {\n\t\ttext,\n\t\trects,\n\t\tranges,\n\t\tselection\n\t};\n}\n//#endregion\n//#region useTextareaAutosize/index.ts\n/**\n* Call window.requestAnimationFrame(), if not available, just call the function\n*\n* @param window\n* @param fn\n*/\nfunction tryRequestAnimationFrame(window = defaultWindow, fn) {\n\tif (window && typeof window.requestAnimationFrame === \"function\") window.requestAnimationFrame(fn);\n\telse fn();\n}\nfunction useTextareaAutosize(options = {}) {\n\tvar _options$input, _options$styleProp;\n\tconst { window = defaultWindow } = options;\n\tconst textarea = toRef(options === null || options === void 0 ? void 0 : options.element);\n\tconst input = toRef((_options$input = options === null || options === void 0 ? void 0 : options.input) !== null && _options$input !== void 0 ? _options$input : \"\");\n\tconst styleProp = (_options$styleProp = options === null || options === void 0 ? void 0 : options.styleProp) !== null && _options$styleProp !== void 0 ? _options$styleProp : \"height\";\n\tconst textareaScrollHeight = shallowRef(1);\n\tconst textareaOldWidth = shallowRef(0);\n\tfunction triggerResize() {\n\t\tvar _textarea$value;\n\t\tif (!textarea.value) return;\n\t\tlet height = \"\";\n\t\tconst maxHeight = options === null || options === void 0 ? void 0 : options.maxHeight;\n\t\ttextarea.value.style[styleProp] = \"1px\";\n\t\ttextareaScrollHeight.value = (_textarea$value = textarea.value) === null || _textarea$value === void 0 ? void 0 : _textarea$value.scrollHeight;\n\t\tconst _styleTarget = toValue(options === null || options === void 0 ? void 0 : options.styleTarget);\n\t\tconst styleHeight = maxHeight != null ? `${Math.min(textareaScrollHeight.value, maxHeight)}px` : `${textareaScrollHeight.value}px`;\n\t\tif (_styleTarget) _styleTarget.style[styleProp] = styleHeight;\n\t\telse height = styleHeight;\n\t\ttextarea.value.style[styleProp] = height;\n\t}\n\twatch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n\twatch(textareaScrollHeight, () => {\n\t\tvar _options$onResize;\n\t\treturn options === null || options === void 0 || (_options$onResize = options.onResize) === null || _options$onResize === void 0 ? void 0 : _options$onResize.call(options);\n\t});\n\tuseResizeObserver(textarea, ([{ contentRect }]) => {\n\t\tif (textareaOldWidth.value === contentRect.width) return;\n\t\ttryRequestAnimationFrame(window, () => {\n\t\t\ttextareaOldWidth.value = contentRect.width;\n\t\t\ttriggerResize();\n\t\t});\n\t});\n\tif (options === null || options === void 0 ? void 0 : options.watch) watch(options.watch, triggerResize, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\treturn {\n\t\ttextarea,\n\t\tinput,\n\t\ttriggerResize\n\t};\n}\n//#endregion\n//#region useThrottledRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.\n*\n* @see https://vueuse.org/useThrottledRefHistory\n* @param source\n* @param options\n*/\nfunction useThrottledRefHistory(source, options = {}) {\n\tconst { throttle = 200, trailing = true } = options;\n\tconst filter = throttleFilter(throttle, trailing);\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useTimeAgo/index.ts\nconst DEFAULT_UNITS = [\n\t{\n\t\tmax: 6e4,\n\t\tvalue: 1e3,\n\t\tname: \"second\"\n\t},\n\t{\n\t\tmax: 276e4,\n\t\tvalue: 6e4,\n\t\tname: \"minute\"\n\t},\n\t{\n\t\tmax: 72e6,\n\t\tvalue: 36e5,\n\t\tname: \"hour\"\n\t},\n\t{\n\t\tmax: 5184e5,\n\t\tvalue: 864e5,\n\t\tname: \"day\"\n\t},\n\t{\n\t\tmax: 24192e5,\n\t\tvalue: 6048e5,\n\t\tname: \"week\"\n\t},\n\t{\n\t\tmax: 28512e6,\n\t\tvalue: 2592e6,\n\t\tname: \"month\"\n\t},\n\t{\n\t\tmax: Number.POSITIVE_INFINITY,\n\t\tvalue: 31536e6,\n\t\tname: \"year\"\n\t}\n];\nconst DEFAULT_MESSAGES = {\n\tjustNow: \"just now\",\n\tpast: (n) => /\\d/.test(n) ? `${n} ago` : n,\n\tfuture: (n) => /\\d/.test(n) ? `in ${n}` : n,\n\tmonth: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n\tyear: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n\tday: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n\tweek: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n\thour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n\tminute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n\tsecond: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n\tinvalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n\treturn date.toISOString().slice(0, 10);\n}\nfunction getDefaultScheduler$4(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\n/**\n* Reactive time ago formatter.\n*\n* @see https://vueuse.org/useTimeAgo\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTimeAgo(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$4(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n\tif (exposeControls) return {\n\t\ttimeAgo,\n\t\t...controls\n\t};\n\telse return timeAgo;\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n\tconst { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = \"round\" } = options;\n\tconst roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n\tconst diff = +now - +from;\n\tconst absDiff = Math.abs(diff);\n\tfunction getValue(diff, unit) {\n\t\treturn roundFn(Math.abs(diff) / unit.value);\n\t}\n\tfunction format(diff, unit) {\n\t\tconst val = getValue(diff, unit);\n\t\tconst past = diff > 0;\n\t\tconst str = applyFormat(unit.name, val, past);\n\t\treturn applyFormat(past ? \"past\" : \"future\", str, past);\n\t}\n\tfunction applyFormat(name, val, isPast) {\n\t\tconst formatter = messages[name];\n\t\tif (typeof formatter === \"function\") return formatter(val, isPast);\n\t\treturn formatter.replace(\"{0}\", val.toString());\n\t}\n\tif (absDiff < 6e4 && !showSecond) return messages.justNow;\n\tif (typeof max === \"number\" && absDiff > max) return fullDateFormatter(new Date(from));\n\tif (typeof max === \"string\") {\n\t\tvar _units$find;\n\t\tconst unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;\n\t\tif (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));\n\t}\n\tfor (const [idx, unit] of units.entries()) {\n\t\tif (getValue(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);\n\t\tif (absDiff < unit.max) return format(diff, unit);\n\t}\n\treturn messages.invalid;\n}\n//#endregion\n//#region useTimeAgoIntl/index.ts\nconst UNITS = [\n\t{\n\t\tname: \"year\",\n\t\tms: 31536e6\n\t},\n\t{\n\t\tname: \"month\",\n\t\tms: 2592e6\n\t},\n\t{\n\t\tname: \"week\",\n\t\tms: 6048e5\n\t},\n\t{\n\t\tname: \"day\",\n\t\tms: 864e5\n\t},\n\t{\n\t\tname: \"hour\",\n\t\tms: 36e5\n\t},\n\t{\n\t\tname: \"minute\",\n\t\tms: 6e4\n\t},\n\t{\n\t\tname: \"second\",\n\t\tms: 1e3\n\t}\n];\nfunction getDefaultScheduler$3(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\nfunction useTimeAgoIntl(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$3(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst result = computed(() => getTimeAgoIntlResult(new Date(toValue(time)), options, toValue(now)));\n\tconst parts = computed(() => result.value.parts);\n\tconst timeAgoIntl = computed(() => formatTimeAgoIntlParts(parts.value, {\n\t\t...options,\n\t\tlocale: result.value.resolvedLocale\n\t}));\n\treturn exposeControls ? {\n\t\ttimeAgoIntl,\n\t\tparts,\n\t\t...controls\n\t} : timeAgoIntl;\n}\n/**\n* Non-reactive version of useTimeAgoIntl\n*/\nfunction formatTimeAgoIntl(from, options = {}, now = Date.now()) {\n\tconst { parts, resolvedLocale } = getTimeAgoIntlResult(from, options, now);\n\treturn formatTimeAgoIntlParts(parts, {\n\t\t...options,\n\t\tlocale: resolvedLocale\n\t});\n}\n/**\n* Get parts from `Intl.RelativeTimeFormat.formatToParts`.\n*/\nfunction getTimeAgoIntlResult(from, options = {}, now = Date.now()) {\n\tvar _options$units;\n\tconst { locale, relativeTimeFormatOptions = { numeric: \"auto\" } } = options;\n\tconst rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);\n\tconst { locale: resolvedLocale } = rtf.resolvedOptions();\n\tconst diff = +from - +now;\n\tconst absDiff = Math.abs(diff);\n\tconst units = (_options$units = options.units) !== null && _options$units !== void 0 ? _options$units : UNITS;\n\tfor (const { name, ms } of units) if (absDiff >= ms) return {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(Math.round(diff / ms), name)\n\t};\n\treturn {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(0, units[units.length - 1].name)\n\t};\n}\n/**\n* Format parts into a string\n*/\nfunction formatTimeAgoIntlParts(parts, options = {}) {\n\tconst { insertSpace = true, joinParts, locale } = options;\n\tif (typeof joinParts === \"function\") return joinParts(parts, locale);\n\tif (!insertSpace) return parts.map((part) => part.value).join(\"\");\n\treturn parts.map((part) => part.value.trim()).join(\" \");\n}\n//#endregion\n//#region useTimeoutPoll/index.ts\nfunction useTimeoutPoll(fn, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst { start } = useTimeoutFn(loop, interval, { immediate });\n\tconst isActive = shallowRef(false);\n\tasync function loop() {\n\t\tif (!isActive.value) return;\n\t\tawait fn();\n\t\tstart();\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value) {\n\t\t\tisActive.value = true;\n\t\t\tif (immediateCallback) fn();\n\t\t\tstart();\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tif (immediate && isClient) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useTimestamp/index.ts\nfunction getDefaultScheduler$2(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\nfunction useTimestamp(options = {}) {\n\tconst { controls: exposeControls = false, offset = 0, scheduler = getDefaultScheduler$2(options), callback } = options;\n\tconst ts = shallowRef(timestamp() + offset);\n\tconst update = () => ts.value = timestamp() + offset;\n\tconst controls = scheduler(callback ? () => {\n\t\tupdate();\n\t\tcallback(ts.value);\n\t} : update);\n\tif (exposeControls) return {\n\t\ttimestamp: ts,\n\t\t...controls\n\t};\n\telse return ts;\n}\n//#endregion\n//#region useTitle/index.ts\nfunction useTitle(newTitle = null, options = {}) {\n\tvar _document$title, _ref;\n\tconst { document = defaultDocument, restoreOnUnmount = (t) => t } = options;\n\tconst originalTitle = (_document$title = document === null || document === void 0 ? void 0 : document.title) !== null && _document$title !== void 0 ? _document$title : \"\";\n\tconst title = toRef((_ref = newTitle !== null && newTitle !== void 0 ? newTitle : document === null || document === void 0 ? void 0 : document.title) !== null && _ref !== void 0 ? _ref : null);\n\tconst isReadonly = !!(newTitle && typeof newTitle === \"function\");\n\tfunction format(t) {\n\t\tif (!(\"titleTemplate\" in options)) return t;\n\t\tconst template = options.titleTemplate || \"%s\";\n\t\treturn typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n\t}\n\twatch(title, (newValue, oldValue) => {\n\t\tif (newValue !== oldValue && document) document.title = format(newValue !== null && newValue !== void 0 ? newValue : \"\");\n\t}, { immediate: true });\n\tif (options.observe && !options.titleTemplate && document && !isReadonly) {\n\t\tvar _document$head;\n\t\tuseMutationObserver((_document$head = document.head) === null || _document$head === void 0 ? void 0 : _document$head.querySelector(\"title\"), () => {\n\t\t\tif (document && document.title !== title.value) title.value = format(document.title);\n\t\t}, { childList: true });\n\t}\n\ttryOnScopeDispose(() => {\n\t\tif (restoreOnUnmount) {\n\t\t\tconst restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n\t\t\tif (restoredTitle != null && document) document.title = restoredTitle;\n\t\t}\n\t});\n\treturn title;\n}\n/**\n* Common transitions\n*\n* @see https://easings.net\n*/\nconst TransitionPresets = /* #__PURE__ */ Object.assign({}, { linear: identity }, {\n\teaseInSine: [\n\t\t.12,\n\t\t0,\n\t\t.39,\n\t\t0\n\t],\n\teaseOutSine: [\n\t\t.61,\n\t\t1,\n\t\t.88,\n\t\t1\n\t],\n\teaseInOutSine: [\n\t\t.37,\n\t\t0,\n\t\t.63,\n\t\t1\n\t],\n\teaseInQuad: [\n\t\t.11,\n\t\t0,\n\t\t.5,\n\t\t0\n\t],\n\teaseOutQuad: [\n\t\t.5,\n\t\t1,\n\t\t.89,\n\t\t1\n\t],\n\teaseInOutQuad: [\n\t\t.45,\n\t\t0,\n\t\t.55,\n\t\t1\n\t],\n\teaseInCubic: [\n\t\t.32,\n\t\t0,\n\t\t.67,\n\t\t0\n\t],\n\teaseOutCubic: [\n\t\t.33,\n\t\t1,\n\t\t.68,\n\t\t1\n\t],\n\teaseInOutCubic: [\n\t\t.65,\n\t\t0,\n\t\t.35,\n\t\t1\n\t],\n\teaseInQuart: [\n\t\t.5,\n\t\t0,\n\t\t.75,\n\t\t0\n\t],\n\teaseOutQuart: [\n\t\t.25,\n\t\t1,\n\t\t.5,\n\t\t1\n\t],\n\teaseInOutQuart: [\n\t\t.76,\n\t\t0,\n\t\t.24,\n\t\t1\n\t],\n\teaseInQuint: [\n\t\t.64,\n\t\t0,\n\t\t.78,\n\t\t0\n\t],\n\teaseOutQuint: [\n\t\t.22,\n\t\t1,\n\t\t.36,\n\t\t1\n\t],\n\teaseInOutQuint: [\n\t\t.83,\n\t\t0,\n\t\t.17,\n\t\t1\n\t],\n\teaseInExpo: [\n\t\t.7,\n\t\t0,\n\t\t.84,\n\t\t0\n\t],\n\teaseOutExpo: [\n\t\t.16,\n\t\t1,\n\t\t.3,\n\t\t1\n\t],\n\teaseInOutExpo: [\n\t\t.87,\n\t\t0,\n\t\t.13,\n\t\t1\n\t],\n\teaseInCirc: [\n\t\t.55,\n\t\t0,\n\t\t1,\n\t\t.45\n\t],\n\teaseOutCirc: [\n\t\t0,\n\t\t.55,\n\t\t.45,\n\t\t1\n\t],\n\teaseInOutCirc: [\n\t\t.85,\n\t\t0,\n\t\t.15,\n\t\t1\n\t],\n\teaseInBack: [\n\t\t.36,\n\t\t0,\n\t\t.66,\n\t\t-.56\n\t],\n\teaseOutBack: [\n\t\t.34,\n\t\t1.56,\n\t\t.64,\n\t\t1\n\t],\n\teaseInOutBack: [\n\t\t.68,\n\t\t-.6,\n\t\t.32,\n\t\t1.6\n\t]\n});\n/**\n* Create an easing function from cubic bezier points.\n*/\nfunction createEasingFunction([p0, p1, p2, p3]) {\n\tconst a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n\tconst b = (a1, a2) => 3 * a2 - 6 * a1;\n\tconst c = (a1) => 3 * a1;\n\tconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n\tconst getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n\tconst getTforX = (x) => {\n\t\tlet aGuessT = x;\n\t\tfor (let i = 0; i < 4; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, p0, p2);\n\t\t\tif (currentSlope === 0) return aGuessT;\n\t\t\tconst currentX = calcBezier(aGuessT, p0, p2) - x;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\t\treturn aGuessT;\n\t};\n\treturn (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n\treturn a + alpha * (b - a);\n}\nfunction defaultInterpolation(a, b, t) {\n\tconst aVal = toValue(a);\n\tconst bVal = toValue(b);\n\tif (typeof aVal === \"number\" && typeof bVal === \"number\") return lerp(aVal, bVal, t);\n\tif (Array.isArray(aVal) && Array.isArray(bVal)) return aVal.map((v, i) => lerp(v, toValue(bVal[i]), t));\n\tthrow new TypeError(\"Unknown transition type, specify an interpolation function.\");\n}\nfunction normalizeEasing(easing) {\n\tvar _toValue;\n\treturn typeof easing === \"function\" ? easing : (_toValue = toValue(easing)) !== null && _toValue !== void 0 ? _toValue : identity;\n}\n/**\n* Transition from one value to another.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction transition(source, from, to, options = {}) {\n\tvar _toValue2;\n\tconst { window = defaultWindow } = options;\n\tconst fromVal = toValue(from);\n\tconst toVal = toValue(to);\n\tconst duration = (_toValue2 = toValue(options.duration)) !== null && _toValue2 !== void 0 ? _toValue2 : 1e3;\n\tconst startedAt = Date.now();\n\tconst endAt = Date.now() + duration;\n\tconst interpolation = typeof options.interpolation === \"function\" ? options.interpolation : defaultInterpolation;\n\tconst trans = typeof options.easing !== \"undefined\" ? normalizeEasing(options.easing) : normalizeEasing(options.transition);\n\tconst ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n\treturn new Promise((resolve) => {\n\t\tsource.value = fromVal;\n\t\tconst tick = () => {\n\t\t\tvar _options$abort;\n\t\t\tif ((_options$abort = options.abort) === null || _options$abort === void 0 ? void 0 : _options$abort.call(options)) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst now = Date.now();\n\t\t\tconst alpha = ease((now - startedAt) / duration);\n\t\t\tsource.value = interpolation(fromVal, toVal, alpha);\n\t\t\tif (now < endAt) window === null || window === void 0 || window.requestAnimationFrame(tick);\n\t\t\telse {\n\t\t\t\tsource.value = toVal;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\t\ttick();\n\t});\n}\n/**\n* Transition from one value to another.\n* @deprecated The `executeTransition` function is deprecated, use `transition` instead.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction executeTransition(source, from, to, options = {}) {\n\treturn transition(source, from, to, options);\n}\n/**\n* Follow value with a transition.\n*\n* @see https://vueuse.org/useTransition\n* @param source\n* @param options\n*/\nfunction useTransition(source, options = {}) {\n\tlet currentId = 0;\n\tconst sourceVal = () => {\n\t\tconst v = toValue(source);\n\t\treturn typeof options.interpolation === \"undefined\" && Array.isArray(v) ? v.map(toValue) : v;\n\t};\n\tconst outputRef = shallowRef(sourceVal());\n\twatch(sourceVal, async (to) => {\n\t\tvar _options$onStarted, _options$onFinished;\n\t\tif (toValue(options.disabled)) return;\n\t\tconst id = ++currentId;\n\t\tif (options.delay) await promiseTimeout(toValue(options.delay));\n\t\tif (id !== currentId) return;\n\t\t(_options$onStarted = options.onStarted) === null || _options$onStarted === void 0 || _options$onStarted.call(options);\n\t\tawait transition(outputRef, outputRef.value, to, {\n\t\t\t...options,\n\t\t\tabort: () => {\n\t\t\t\tvar _options$abort2;\n\t\t\t\treturn id !== currentId || ((_options$abort2 = options.abort) === null || _options$abort2 === void 0 ? void 0 : _options$abort2.call(options));\n\t\t\t}\n\t\t});\n\t\t(_options$onFinished = options.onFinished) === null || _options$onFinished === void 0 || _options$onFinished.call(options);\n\t}, { deep: true });\n\twatch(() => toValue(options.disabled), (disabled) => {\n\t\tif (disabled) {\n\t\t\tcurrentId++;\n\t\t\toutputRef.value = sourceVal();\n\t\t}\n\t});\n\ttryOnScopeDispose(() => {\n\t\tcurrentId++;\n\t});\n\treturn computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n//#endregion\n//#region useUrlSearchParams/index.ts\n/**\n* Reactive URLSearchParams\n*\n* @see https://vueuse.org/useUrlSearchParams\n* @param mode\n* @param options\n*/\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n\tconst { initialValue = {}, removeNullishValues = true, removeFalsyValues = false, write: enableWrite = true, writeMode = \"replace\", window = defaultWindow, stringify = (params) => params.toString() } = options;\n\tif (!window) return reactive(initialValue);\n\tconst state = reactive({});\n\tfunction getRawParams() {\n\t\tif (mode === \"history\") return window.location.search || \"\";\n\t\telse if (mode === \"hash\") {\n\t\t\tconst hash = window.location.hash || \"\";\n\t\t\tconst index = hash.indexOf(\"?\");\n\t\t\treturn index > 0 ? hash.slice(index) : \"\";\n\t\t} else return (window.location.hash || \"\").replace(/^#/, \"\");\n\t}\n\tfunction constructQuery(params) {\n\t\tconst stringified = stringify(params);\n\t\tif (mode === \"history\") return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n\t\tif (mode === \"hash-params\") return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n\t\tconst hash = window.location.hash || \"#\";\n\t\tconst index = hash.indexOf(\"?\");\n\t\tif (index > 0) return `${window.location.search || \"\"}${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n\t\treturn `${window.location.search || \"\"}${hash}${stringified ? `?${stringified}` : \"\"}`;\n\t}\n\tfunction read() {\n\t\treturn new URLSearchParams(getRawParams());\n\t}\n\tfunction updateState(params) {\n\t\tconst unusedKeys = new Set(Object.keys(state));\n\t\tfor (const key of params.keys()) {\n\t\t\tconst paramsForKey = params.getAll(key);\n\t\t\tstate[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n\t\t\tunusedKeys.delete(key);\n\t\t}\n\t\tArray.from(unusedKeys).forEach((key) => delete state[key]);\n\t}\n\tconst { pause, resume } = watchPausable(state, () => {\n\t\tconst params = new URLSearchParams(\"\");\n\t\tObject.keys(state).forEach((key) => {\n\t\t\tconst mapEntry = state[key];\n\t\t\tif (Array.isArray(mapEntry)) mapEntry.forEach((value) => params.append(key, value));\n\t\t\telse if (removeNullishValues && mapEntry == null) params.delete(key);\n\t\t\telse if (removeFalsyValues && !mapEntry) params.delete(key);\n\t\t\telse params.set(key, mapEntry);\n\t\t});\n\t\twrite(params, false);\n\t}, { deep: true });\n\tfunction write(params, shouldUpdate, shouldWriteHistory = true) {\n\t\tpause();\n\t\tif (shouldUpdate) updateState(params);\n\t\tif (writeMode === \"replace\") window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\telse if (shouldWriteHistory) window.history.pushState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\tnextTick(() => resume());\n\t}\n\tfunction onChanged() {\n\t\tif (!enableWrite) return;\n\t\twrite(read(), true, false);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"popstate\", onChanged, listenerOptions);\n\tif (mode !== \"history\") useEventListener(window, \"hashchange\", onChanged, listenerOptions);\n\tconst initial = read();\n\tif (initial.keys().next().value) updateState(initial);\n\telse Object.assign(state, initialValue);\n\treturn state;\n}\n//#endregion\n//#region useUserMedia/index.ts\n/**\n* Reactive `mediaDevices.getUserMedia` streaming\n*\n* @see https://vueuse.org/useUserMedia\n* @param options\n*/\nfunction useUserMedia(options = {}) {\n\tvar _options$enabled, _options$autoSwitch;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst autoSwitch = shallowRef((_options$autoSwitch = options.autoSwitch) !== null && _options$autoSwitch !== void 0 ? _options$autoSwitch : true);\n\tconst constraints = ref(options.constraints);\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getUserMedia;\n\t});\n\tconst stream = shallowRef();\n\tfunction getDeviceOptions(type) {\n\t\tswitch (type) {\n\t\t\tcase \"video\":\n\t\t\t\tif (constraints.value) return constraints.value.video || false;\n\t\t\t\tbreak;\n\t\t\tcase \"audio\":\n\t\t\t\tif (constraints.value) return constraints.value.audio || false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tasync function _start() {\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getUserMedia({\n\t\t\tvideo: getDeviceOptions(\"video\"),\n\t\t\taudio: getDeviceOptions(\"audio\")\n\t\t});\n\t\treturn stream.value;\n\t}\n\tfunction _stop() {\n\t\tvar _stream$value;\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\tasync function restart() {\n\t\t_stop();\n\t\treturn await start();\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\twatch(constraints, () => {\n\t\tif (autoSwitch.value && stream.value) restart();\n\t}, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\trestart,\n\t\tconstraints,\n\t\tenabled,\n\t\tautoSwitch\n\t};\n}\n//#endregion\n//#region useVModel/index.ts\n/**\n* Shorthand for v-model binding, props + emit -> ref\n*\n* @see https://vueuse.org/useVModel\n* @param props\n* @param key (default 'modelValue')\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModel(props, key, emit, options = {}) {\n\tvar _vm$$emit, _vm$proxy;\n\tconst { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;\n\tconst vm = getCurrentInstance();\n\tconst _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));\n\tlet event = eventName;\n\tif (!key) key = \"modelValue\";\n\tevent = event || `update:${key.toString()}`;\n\tconst cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n\tconst getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n\tconst triggerEmit = (value) => {\n\t\tif (shouldEmit) {\n\t\t\tif (shouldEmit(value)) _emit(event, value);\n\t\t} else _emit(event, value);\n\t};\n\tif (passive) {\n\t\tconst proxy = ref(getValue());\n\t\tlet isUpdating = false;\n\t\twatch(() => props[key], (v) => {\n\t\t\tif (!isUpdating) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tproxy.value = cloneFn(v);\n\t\t\t\tnextTick(() => isUpdating = false);\n\t\t\t}\n\t\t});\n\t\twatch(proxy, (v) => {\n\t\t\tif (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);\n\t\t}, { deep });\n\t\treturn proxy;\n\t} else return computed({\n\t\tget() {\n\t\t\treturn getValue();\n\t\t},\n\t\tset(value) {\n\t\t\ttriggerEmit(value);\n\t\t}\n\t});\n}\n//#endregion\n//#region useVModels/index.ts\n/**\n* Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.\n*\n* @see https://vueuse.org/useVModels\n* @param props\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModels(props, emit, options = {}) {\n\tconst ret = {};\n\tfor (const key in props) ret[key] = useVModel(props, key, emit, options);\n\treturn ret;\n}\n//#endregion\n//#region useVibrate/index.ts\nfunction getDefaultScheduler$1(options = {}) {\n\tconst { interval = 0 } = options;\n\tif (interval === 0) return;\n\treturn (fn) => useIntervalFn(fn, interval, {\n\t\timmediate: false,\n\t\timmediateCallback: false\n\t});\n}\n/**\n* Reactive vibrate\n*\n* @see https://vueuse.org/useVibrate\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVibrate(options) {\n\tconst { pattern = [], scheduler = getDefaultScheduler$1(options), navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n\tconst patternRef = toRef(pattern);\n\tconst vibrate = (pattern = patternRef.value) => {\n\t\tif (isSupported.value) navigator.vibrate(pattern);\n\t};\n\tconst intervalControls = scheduler === null || scheduler === void 0 ? void 0 : scheduler(vibrate);\n\tconst stop = () => {\n\t\tif (isSupported.value) navigator.vibrate(0);\n\t\tintervalControls === null || intervalControls === void 0 || intervalControls.pause();\n\t};\n\treturn {\n\t\tisSupported,\n\t\tpattern,\n\t\tintervalControls,\n\t\tvibrate,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useVirtualList/index.ts\n/**\n* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.\n*/\nfunction useVirtualList(list, options) {\n\tconst { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n\treturn {\n\t\tlist: currentList,\n\t\tscrollTo,\n\t\tcontainerProps: {\n\t\t\tref: containerRef,\n\t\t\tonScroll: () => {\n\t\t\t\tcalculateRange();\n\t\t\t},\n\t\t\tstyle: containerStyle\n\t\t},\n\t\twrapperProps\n\t};\n}\nfunction useVirtualListResources(list) {\n\tconst containerRef = shallowRef(null);\n\tconst size = useElementSize(containerRef);\n\tconst currentList = ref([]);\n\tconst source = shallowRef(list);\n\treturn {\n\t\tstate: ref({\n\t\t\tstart: 0,\n\t\t\tend: 10\n\t\t}),\n\t\tsource,\n\t\tcurrentList,\n\t\tsize,\n\t\tcontainerRef\n\t};\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n\treturn (containerSize) => {\n\t\tif (typeof itemSize === \"number\") return Math.ceil(containerSize / itemSize);\n\t\tconst { start = 0 } = state.value;\n\t\tlet sum = 0;\n\t\tlet capacity = 0;\n\t\tfor (let i = start; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tcapacity = i;\n\t\t\tif (sum > containerSize) break;\n\t\t}\n\t\treturn capacity - start;\n\t};\n}\nfunction createGetOffset(source, itemSize) {\n\treturn (scrollDirection) => {\n\t\tif (typeof itemSize === \"number\") return Math.floor(scrollDirection / itemSize) + 1;\n\t\tlet sum = 0;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tif (sum >= scrollDirection) {\n\t\t\t\toffset = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn offset + 1;\n\t};\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n\treturn () => {\n\t\tconst element = containerRef.value;\n\t\tif (element) {\n\t\t\tconst offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n\t\t\tconst viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n\t\t\tconst from = offset - overscan;\n\t\t\tconst to = offset + viewCapacity + overscan;\n\t\t\tstate.value = {\n\t\t\t\tstart: from < 0 ? 0 : from,\n\t\t\t\tend: to > source.value.length ? source.value.length : to\n\t\t\t};\n\t\t\tcurrentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n\t\t\t\tdata: ele,\n\t\t\t\tindex: index + state.value.start\n\t\t\t}));\n\t\t}\n\t};\n}\nfunction createGetDistance(itemSize, source) {\n\treturn (index) => {\n\t\tif (typeof itemSize === \"number\") return index * itemSize;\n\t\treturn source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n\t};\n}\nfunction useWatchForSizes(size, listRef, totalSize, containerRef, calculateRange) {\n\twatch([\n\t\tsize.width,\n\t\tsize.height,\n\t\tlistRef,\n\t\ttotalSize,\n\t\tcontainerRef\n\t], () => {\n\t\tcalculateRange();\n\t});\n}\nfunction createComputedTotalSize(itemSize, source) {\n\treturn computed(() => {\n\t\tif (typeof itemSize === \"number\") return source.value.length * itemSize;\n\t\treturn source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n\t});\n}\nconst scrollToDictionaryForElementScrollKey = {\n\thorizontal: \"scrollLeft\",\n\tvertical: \"scrollTop\"\n};\nconst scrollToDictionaryForElementScrollToKey = {\n\thorizontal: \"left\",\n\tvertical: \"top\"\n};\nconst defaultScrollToOptions = {\n\tbehavior: \"auto\",\n\tblock: \"start\",\n\tinline: \"nearest\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef, itemSize) {\n\treturn (index, options = defaultScrollToOptions) => {\n\t\tif (!containerRef.value) return;\n\t\toptions = {\n\t\t\t...defaultScrollToOptions,\n\t\t\t...options\n\t\t};\n\t\tlet offset = 0;\n\t\tconst axisToCheck = options[type === \"horizontal\" ? \"inline\" : \"block\"];\n\t\tif (axisToCheck) {\n\t\t\tconst containerSize = type === \"horizontal\" ? containerRef.value.clientWidth : containerRef.value.clientHeight;\n\t\t\tconst fullItemSize = typeof itemSize === \"number\" ? itemSize : itemSize(index);\n\t\t\tif (axisToCheck === \"center\") offset = containerSize / 2 - fullItemSize / 2;\n\t\t\telse if (axisToCheck === \"end\") offset = containerSize - fullItemSize;\n\t\t\telse if (axisToCheck === \"nearest\") {\n\t\t\t\tconst containerScrollPosition = containerRef.value[scrollToDictionaryForElementScrollKey[type]];\n\t\t\t\tif (getDistance(index) > containerScrollPosition + containerSize / 2) offset = containerSize - fullItemSize;\n\t\t\t}\n\t\t}\n\t\tcontainerRef.value.scrollTo({\n\t\t\t[scrollToDictionaryForElementScrollToKey[type]]: getDistance(index) - offset,\n\t\t\tbehavior: options.behavior\n\t\t});\n\t\tcalculateRange();\n\t};\n}\nfunction useHorizontalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowX: \"auto\" };\n\tconst { itemWidth, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n\tconst calculateRange = createCalculateRange(\"horizontal\", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);\n\tconst getDistanceLeft = createGetDistance(itemWidth, source);\n\tconst offsetLeft = computed(() => getDistanceLeft(state.value.start));\n\tconst totalWidth = createComputedTotalSize(itemWidth, source);\n\tuseWatchForSizes(size, source, totalWidth, containerRef, calculateRange);\n\treturn {\n\t\tscrollTo: createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef, itemWidth),\n\t\tcalculateRange,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: `${totalWidth.value - offsetLeft.value}px`,\n\t\t\t\tmarginLeft: `${offsetLeft.value}px`,\n\t\t\t\tdisplay: \"flex\"\n\t\t\t} };\n\t\t}),\n\t\tcontainerStyle,\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\nfunction useVerticalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowY: \"auto\" };\n\tconst { itemHeight, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n\tconst calculateRange = createCalculateRange(\"vertical\", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);\n\tconst getDistanceTop = createGetDistance(itemHeight, source);\n\tconst offsetTop = computed(() => getDistanceTop(state.value.start));\n\tconst totalHeight = createComputedTotalSize(itemHeight, source);\n\tuseWatchForSizes(size, source, totalHeight, containerRef, calculateRange);\n\treturn {\n\t\tcalculateRange,\n\t\tscrollTo: createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef, itemHeight),\n\t\tcontainerStyle,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: `${totalHeight.value - offsetTop.value}px`,\n\t\t\t\tmarginTop: `${offsetTop.value}px`\n\t\t\t} };\n\t\t}),\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\n//#endregion\n//#region useWakeLock/index.ts\n/**\n* Reactive Screen Wake Lock API.\n*\n* @see https://vueuse.org/useWakeLock\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWakeLock(options = {}) {\n\tconst { navigator = defaultNavigator, document = defaultDocument } = options;\n\tconst requestedType = shallowRef(false);\n\tconst sentinel = shallowRef(null);\n\tconst documentVisibility = useDocumentVisibility({ document });\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"wakeLock\" in navigator);\n\tconst isActive = computed(() => !!sentinel.value && documentVisibility.value === \"visible\");\n\tif (isSupported.value) {\n\t\tuseEventListener(sentinel, \"release\", () => {\n\t\t\tvar _sentinel$value$type, _sentinel$value;\n\t\t\trequestedType.value = (_sentinel$value$type = (_sentinel$value = sentinel.value) === null || _sentinel$value === void 0 ? void 0 : _sentinel$value.type) !== null && _sentinel$value$type !== void 0 ? _sentinel$value$type : false;\n\t\t}, { passive: true });\n\t\twhenever(() => documentVisibility.value === \"visible\" && (document === null || document === void 0 ? void 0 : document.visibilityState) === \"visible\" && requestedType.value, (type) => {\n\t\t\trequestedType.value = false;\n\t\t\tforceRequest(type);\n\t\t});\n\t}\n\tasync function forceRequest(type) {\n\t\tvar _sentinel$value2;\n\t\tawait ((_sentinel$value2 = sentinel.value) === null || _sentinel$value2 === void 0 ? void 0 : _sentinel$value2.release());\n\t\tsentinel.value = isSupported.value ? await navigator.wakeLock.request(type) : null;\n\t}\n\tasync function request(type) {\n\t\tif (documentVisibility.value === \"visible\") await forceRequest(type);\n\t\telse requestedType.value = type;\n\t}\n\tasync function release() {\n\t\trequestedType.value = false;\n\t\tconst s = sentinel.value;\n\t\tsentinel.value = null;\n\t\tawait (s === null || s === void 0 ? void 0 : s.release());\n\t}\n\ttryOnScopeDispose(() => {\n\t\trelease();\n\t});\n\treturn {\n\t\tsentinel,\n\t\tisSupported,\n\t\tisActive,\n\t\trequest,\n\t\tforceRequest,\n\t\trelease\n\t};\n}\n//#endregion\n//#region useWebNotification/index.ts\n/**\n* Reactive useWebNotification\n*\n* @see https://vueuse.org/useWebNotification\n* @see https://developer.mozilla.org/en-US/docs/Web/API/notification\n*/\nfunction useWebNotification(options = {}) {\n\tconst { window = defaultWindow, requestPermissions: _requestForPermissions = true } = options;\n\tconst defaultWebNotificationOptions = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (!window || !(\"Notification\" in window)) return false;\n\t\tif (Notification.permission === \"granted\") return true;\n\t\ttry {\n\t\t\tconst notification = new Notification(\"\");\n\t\t\tnotification.onshow = () => {\n\t\t\t\tnotification.close();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.name === \"TypeError\") return false;\n\t\t}\n\t\treturn true;\n\t});\n\tconst permissionGranted = shallowRef(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n\tconst notification = shallowRef(null);\n\tconst ensurePermissions = async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionGranted.value && Notification.permission !== \"denied\") {\n\t\t\tif (await Notification.requestPermission() === \"granted\") permissionGranted.value = true;\n\t\t}\n\t\treturn permissionGranted.value;\n\t};\n\tconst { on: onClick, trigger: clickTrigger } = createEventHook();\n\tconst { on: onShow, trigger: showTrigger } = createEventHook();\n\tconst { on: onError, trigger: errorTrigger } = createEventHook();\n\tconst { on: onClose, trigger: closeTrigger } = createEventHook();\n\tconst show = async (overrides) => {\n\t\tif (!isSupported.value || !permissionGranted.value) return;\n\t\tconst options = Object.assign({}, defaultWebNotificationOptions, overrides);\n\t\tnotification.value = new Notification(options.title || \"\", options);\n\t\tnotification.value.onclick = clickTrigger;\n\t\tnotification.value.onshow = showTrigger;\n\t\tnotification.value.onerror = errorTrigger;\n\t\tnotification.value.onclose = closeTrigger;\n\t\treturn notification.value;\n\t};\n\tconst close = () => {\n\t\tif (notification.value) notification.value.close();\n\t\tnotification.value = null;\n\t};\n\tif (_requestForPermissions) tryOnMounted(ensurePermissions);\n\ttryOnScopeDispose(close);\n\tif (isSupported.value && window) {\n\t\tconst document = window.document;\n\t\tuseEventListener(document, \"visibilitychange\", (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (document.visibilityState === \"visible\") close();\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tnotification,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tshow,\n\t\tclose,\n\t\tonClick,\n\t\tonShow,\n\t\tonError,\n\t\tonClose\n\t};\n}\n//#endregion\n//#region useWebSocket/index.ts\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n\tif (options === true) return {};\n\treturn options;\n}\nfunction getDefaultScheduler(options) {\n\tif (\"interval\" in options) {\n\t\tconst { interval = 1e3 } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate: false });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive WebSocket client.\n*\n* @see https://vueuse.org/useWebSocket\n* @param url\n*/\nfunction useWebSocket(url, options = {}) {\n\tconst { onConnected, onDisconnected, onError, onMessage, immediate = true, autoConnect = true, autoClose = true, protocols = [] } = options;\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CLOSED\");\n\tconst wsRef = shallowRef();\n\tconst urlRef = toRef(url);\n\tlet heartbeatPause;\n\tlet heartbeatResume;\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tlet bufferedData = [];\n\tlet retryTimeout;\n\tlet pongTimeoutWait;\n\tconst _sendBuffer = () => {\n\t\tif (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n\t\t\tfor (const buffer of bufferedData) wsRef.value.send(buffer);\n\t\t\tbufferedData = [];\n\t\t}\n\t};\n\tconst resetRetry = () => {\n\t\tif (retryTimeout != null) {\n\t\t\tclearTimeout(retryTimeout);\n\t\t\tretryTimeout = void 0;\n\t\t}\n\t};\n\tconst resetHeartbeat = () => {\n\t\tclearTimeout(pongTimeoutWait);\n\t\tpongTimeoutWait = void 0;\n\t};\n\tconst close = (code = 1e3, reason) => {\n\t\tresetRetry();\n\t\tif (!isClient && !isWorker || !wsRef.value) return;\n\t\texplicitlyClosed = true;\n\t\tresetHeartbeat();\n\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\twsRef.value.close(code, reason);\n\t\twsRef.value = void 0;\n\t\tstatus.value = \"CLOSED\";\n\t};\n\tconst send = (data, useBuffer = true) => {\n\t\tif (!wsRef.value || status.value !== \"OPEN\") {\n\t\t\tif (useBuffer) bufferedData.push(data);\n\t\t\treturn false;\n\t\t}\n\t\t_sendBuffer();\n\t\twsRef.value.send(data);\n\t\treturn true;\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst ws = new WebSocket(urlRef.value, protocols);\n\t\twsRef.value = ws;\n\t\tstatus.value = \"CONNECTING\";\n\t\tws.onopen = () => {\n\t\t\tif (wsRef.value !== ws) return;\n\t\t\tstatus.value = \"OPEN\";\n\t\t\tretried = 0;\n\t\t\tonConnected === null || onConnected === void 0 || onConnected(ws);\n\t\t\theartbeatResume === null || heartbeatResume === void 0 || heartbeatResume();\n\t\t\t_sendBuffer();\n\t\t};\n\t\tws.onclose = (ev) => {\n\t\t\tif (wsRef.value === ws) status.value = \"CLOSED\";\n\t\t\tresetHeartbeat();\n\t\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\t\tonDisconnected === null || onDisconnected === void 0 || onDisconnected(ws, ev);\n\t\t\tif (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);\n\t\t\t\tif ((typeof retries === \"function\" ? retries : () => typeof retries === \"number\" && (retries < 0 || retried < retries))(retried)) {\n\t\t\t\t\tretried += 1;\n\t\t\t\t\tconst delayTime = typeof delay === \"function\" ? delay(retried) : delay;\n\t\t\t\t\tretryTimeout = setTimeout(_init, delayTime);\n\t\t\t\t} else onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tws.onerror = (e) => {\n\t\t\tonError === null || onError === void 0 || onError(ws, e);\n\t\t};\n\t\tws.onmessage = (e) => {\n\t\t\tif (options.heartbeat) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\tconst { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);\n\t\t\t\tif (e.data === toValue(responseMessage)) return;\n\t\t\t}\n\t\t\tdata.value = e.data;\n\t\t\tonMessage === null || onMessage === void 0 || onMessage(ws, e);\n\t\t};\n\t};\n\tif (options.heartbeat) {\n\t\tconst { message = DEFAULT_PING_MESSAGE, scheduler = getDefaultScheduler(resolveNestedOptions(options.heartbeat)), pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);\n\t\tconst { pause, resume } = scheduler(() => {\n\t\t\tsend(toValue(message), false);\n\t\t\tif (pongTimeoutWait != null) return;\n\t\t\tpongTimeoutWait = setTimeout(() => {\n\t\t\t\tclose();\n\t\t\t\texplicitlyClosed = false;\n\t\t\t}, pongTimeout);\n\t\t});\n\t\theartbeatPause = pause;\n\t\theartbeatResume = resume;\n\t}\n\tif (autoClose) {\n\t\tif (isClient) useEventListener(\"beforeunload\", () => close(), { passive: true });\n\t\ttryOnScopeDispose(close);\n\t}\n\tconst open = () => {\n\t\tif (!isClient && !isWorker) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\treturn {\n\t\tdata,\n\t\tstatus,\n\t\tclose,\n\t\tsend,\n\t\topen,\n\t\tws: wsRef\n\t};\n}\n//#endregion\n//#region useWebWorker/index.ts\nfunction useWebWorker(arg0, workerOptions, options) {\n\tconst { window = defaultWindow } = options !== null && options !== void 0 ? options : {};\n\tconst data = shallowRef(null);\n\tconst worker = shallowRef();\n\tconst post = (...args) => {\n\t\tif (!worker.value) return;\n\t\tworker.value.postMessage(...args);\n\t};\n\tconst terminate = function terminate() {\n\t\tif (!worker.value) return;\n\t\tworker.value.terminate();\n\t};\n\tif (window) {\n\t\tif (typeof arg0 === \"string\") worker.value = new Worker(arg0, workerOptions);\n\t\telse if (typeof arg0 === \"function\") worker.value = arg0();\n\t\telse worker.value = arg0;\n\t\tworker.value.onmessage = (e) => {\n\t\t\tdata.value = e.data;\n\t\t};\n\t\ttryOnScopeDispose(() => {\n\t\t\tif (worker.value) worker.value.terminate();\n\t\t});\n\t}\n\treturn {\n\t\tdata,\n\t\tpost,\n\t\tterminate,\n\t\tworker\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/depsParser.ts\n/**\n*\n* Concatenates the dependencies into a comma separated string.\n* this string will then be passed as an argument to the \"importScripts\" function\n*\n* @param deps array of string\n* @param localDeps array of function\n* @returns a string composed by the concatenation of the array\n* elements \"deps\" and \"importScripts\".\n*\n* @example\n* depsParser(['demo1', 'demo2']) // return importScripts('demo1', 'demo2')\n*/\nfunction depsParser(deps, localDeps) {\n\tif (deps.length === 0 && localDeps.length === 0) return \"\";\n\tconst depsString = deps.map((dep) => `'${dep}'`).toString();\n\tconst depsFunctionString = localDeps.filter((dep) => typeof dep === \"function\").map((fn) => {\n\t\tconst str = fn.toString();\n\t\tif (str.trim().startsWith(\"function\")) return str;\n\t\telse return `const ${fn.name} = ${str}`;\n\t}).join(\";\");\n\tconst importString = `importScripts(${depsString});`;\n\treturn `${depsString.trim() === \"\" ? \"\" : importString} ${depsFunctionString}`;\n}\n//#endregion\n//#region useWebWorkerFn/lib/jobRunner.ts\n/**\n* This function accepts as a parameter a function \"userFunc\"\n* And as a result returns an anonymous function.\n* This anonymous function, accepts as arguments,\n* the parameters to pass to the function \"useArgs\" and returns a Promise\n* This function can be used as a wrapper, only inside a Worker\n* because it depends by \"postMessage\".\n*\n* @param userFunc {Function} fn the function to run with web worker\n*\n* @returns returns a function that accepts the parameters\n* to be passed to the \"userFunc\" function\n*/\nfunction jobRunner(userFunc) {\n\treturn (e) => {\n\t\tconst userFuncArgs = e.data[0];\n\t\treturn Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n\t\t\tpostMessage([\"SUCCESS\", result]);\n\t\t}).catch((error) => {\n\t\t\tpostMessage([\"ERROR\", error]);\n\t\t});\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/createWorkerBlobUrl.ts\n/**\n* Converts the \"fn\" function into the syntax needed to be executed within a web worker\n*\n* @param fn the function to run with web worker\n* @param deps array of strings, imported into the worker through \"importScripts\"\n* @param localDeps array of function, local dependencies\n*\n* @returns a blob url, containing the code of \"fn\" as a string\n*\n* @example\n* createWorkerBlobUrl((a,b) => a+b, [])\n* // return \"onmessage=return Promise.resolve((a,b) => a + b)\n* .then(postMessage(['SUCCESS', result]))\n* .catch(postMessage(['ERROR', error])\"\n*/\nfunction createWorkerBlobUrl(fn, deps, localDeps) {\n\tconst blobCode = `${depsParser(deps, localDeps)}; onmessage=(${jobRunner})(${fn})`;\n\tconst blob = new Blob([blobCode], { type: \"text/javascript\" });\n\treturn URL.createObjectURL(blob);\n}\n//#endregion\n//#region useWebWorkerFn/index.ts\n/**\n* Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.\n*\n* @see https://vueuse.org/useWebWorkerFn\n* @param fn\n* @param options\n*/\nfunction useWebWorkerFn(fn, options = {}) {\n\tconst { dependencies = [], localDependencies = [], timeout, window = defaultWindow } = options;\n\tlet worker;\n\tconst workerStatus = shallowRef(\"PENDING\");\n\tconst promise = shallowRef({});\n\tconst timeoutId = shallowRef();\n\tconst workerTerminate = (status = \"PENDING\") => {\n\t\tif (worker && worker._url && window) {\n\t\t\tworker.terminate();\n\t\t\tURL.revokeObjectURL(worker._url);\n\t\t\tpromise.value = {};\n\t\t\tworker = void 0;\n\t\t\twindow.clearTimeout(timeoutId.value);\n\t\t\tworkerStatus.value = status;\n\t\t}\n\t};\n\tworkerTerminate();\n\ttryOnScopeDispose(workerTerminate);\n\tconst generateWorker = () => {\n\t\tconst blobUrl = createWorkerBlobUrl(fn, dependencies, localDependencies);\n\t\tconst newWorker = new Worker(blobUrl);\n\t\tnewWorker._url = blobUrl;\n\t\tnewWorker.onmessage = (e) => {\n\t\t\tconst { resolve = () => {}, reject = () => {} } = promise.value;\n\t\t\tconst [status, result] = e.data;\n\t\t\tswitch (status) {\n\t\t\t\tcase \"SUCCESS\":\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tworkerTerminate(status);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treject(result);\n\t\t\t\t\tworkerTerminate(\"ERROR\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tnewWorker.onerror = (e) => {\n\t\t\tconst { reject = () => {} } = promise.value;\n\t\t\te.preventDefault();\n\t\t\treject(e);\n\t\t\tworkerTerminate(\"ERROR\");\n\t\t};\n\t\tif (timeout) timeoutId.value = setTimeout(workerTerminate, timeout, \"TIMEOUT_EXPIRED\");\n\t\treturn newWorker;\n\t};\n\tconst callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n\t\tpromise.value = {\n\t\t\tresolve,\n\t\t\treject\n\t\t};\n\t\tworker === null || worker === void 0 || worker.postMessage([[...fnArgs]]);\n\t\tworkerStatus.value = \"RUNNING\";\n\t});\n\tconst workerFn = (...fnArgs) => {\n\t\tif (workerStatus.value === \"RUNNING\") {\n\t\t\tconsole.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n\t\t\treturn Promise.reject();\n\t\t}\n\t\tworker = generateWorker();\n\t\treturn callWorker(...fnArgs);\n\t};\n\treturn {\n\t\tworkerFn,\n\t\tworkerStatus,\n\t\tworkerTerminate\n\t};\n}\n//#endregion\n//#region useWindowFocus/index.ts\n/**\n* Reactively track window focus with `window.onfocus` and `window.onblur`.\n*\n* @see https://vueuse.org/useWindowFocus\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowFocus(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef(false);\n\tconst focused = shallowRef(window.document.hasFocus());\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"blur\", () => {\n\t\tfocused.value = false;\n\t}, listenerOptions);\n\tuseEventListener(window, \"focus\", () => {\n\t\tfocused.value = true;\n\t}, listenerOptions);\n\treturn focused;\n}\n//#endregion\n//#region useWindowScroll/index.ts\n/**\n* Reactive window scroll.\n*\n* @see https://vueuse.org/useWindowScroll\n* @param options\n*/\nfunction useWindowScroll(options = {}) {\n\tconst { window = defaultWindow, ...rest } = options;\n\treturn useScroll(window, rest);\n}\n//#endregion\n//#region useWindowSize/index.ts\n/**\n* Reactive window size.\n*\n* @see https://vueuse.org/useWindowSize\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowSize(options = {}) {\n\tconst { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = \"inner\" } = options;\n\tconst width = shallowRef(initialWidth);\n\tconst height = shallowRef(initialHeight);\n\tconst update = () => {\n\t\tif (window) if (type === \"outer\") {\n\t\t\twidth.value = window.outerWidth;\n\t\t\theight.value = window.outerHeight;\n\t\t} else if (type === \"visual\" && window.visualViewport) {\n\t\t\tconst { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;\n\t\t\twidth.value = Math.round(visualViewportWidth * scale);\n\t\t\theight.value = Math.round(visualViewportHeight * scale);\n\t\t} else if (includeScrollbar) {\n\t\t\twidth.value = window.innerWidth;\n\t\t\theight.value = window.innerHeight;\n\t\t} else {\n\t\t\twidth.value = window.document.documentElement.clientWidth;\n\t\t\theight.value = window.document.documentElement.clientHeight;\n\t\t}\n\t};\n\tupdate();\n\ttryOnMounted(update);\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"resize\", update, listenerOptions);\n\tif (window && type === \"visual\" && window.visualViewport) useEventListener(window.visualViewport, \"resize\", update, listenerOptions);\n\tif (listenOrientation) watch(useMediaQuery(\"(orientation: portrait)\"), () => update());\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\n//#endregion\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, getSSRHandler, isFocusedElementEditable, isTypedCharValid, mapGamepadToXbox360Controller, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, provideSSRWidth, setSSRHandler, templateRef, transition, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCssSupports, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementOverflow, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","import { onUnmounted, watch, type Ref } from \"vue\";\n\nexport type UseIntersectionObserverOptions = {\n /** Element to observe; the observer reinitializes whenever this ref changes. */\n target: Readonly<Ref<Element | null>>;\n /**\n * Resolves the scroll container that clips the target. Grid consumers must\n * provide the actual scrolling container, such as `.k-grid-content`. The\n * observer reinitializes whenever the resolved root element changes.\n */\n root: () => Element | null;\n /**\n * One or more intersection ratios from `0` through `1`. `0` observes entry\n * and complete departure; `1` observes full visibility. Defaults to `1`.\n */\n threshold?: number | number[];\n /** Called whenever the target's intersection state changes. */\n onChange: (entry: IntersectionObserverEntry) => void;\n};\n\nexport type UseIntersectionObserverReturn = {\n /** Stops observing the current target. Observation resumes if the target ref changes. */\n disconnect: () => void;\n};\n\n/**\n * Observes a reactive element against a lazily resolved clipping root.\n *\n * By default, the observer uses a threshold of `1`, so consumers are notified\n * when the target is no longer fully visible within its root. The observer\n * reinitializes whenever the target or resolved root changes. If\n * `IntersectionObserver` is unavailable (e.g. SSR), this is a no-op.\n */\nexport const useIntersectionObserver = (\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverReturn => {\n let observer: IntersectionObserver | null = null;\n\n const disconnect = () => {\n observer?.disconnect();\n observer = null;\n };\n\n const isSupported =\n typeof window !== \"undefined\" &&\n typeof window.IntersectionObserver === \"function\";\n\n if (isSupported) {\n watch(\n [options.target, () => options.root()],\n ([target, root]) => {\n disconnect();\n if (!target) return;\n\n observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) options.onChange(entry);\n },\n { root, threshold: options.threshold ?? 1 },\n );\n observer.observe(target);\n },\n { immediate: true },\n );\n }\n\n onUnmounted(disconnect);\n\n return { disconnect };\n};\n","import {\n computed,\n nextTick,\n onUnmounted,\n ref,\n shallowRef,\n toValue,\n watch,\n type ComponentPublicInstance,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\nimport { onClickOutside } from \"@vueuse/core\";\nimport { useIntersectionObserver } from \"../observer\";\nimport {\n computeCollisionOffset,\n type GeometryAlign,\n type GeometryBounds,\n type GeometryCollision,\n} from \"../geometry\";\n\n/** A template ref that may point to an element or a Vue/Kendo component. */\nexport type PopupMenuElementRef = Ref<\n HTMLElement | ComponentPublicInstance | null\n>;\n\nexport type PopupMenuTriggerMode = \"button\" | \"row\";\n\n/** Default `escapeFocusContainerSelector` for `triggerMode: \"button\"`. */\nconst DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR = \".k-table-row\";\n\nexport type PopupMenuOffset = {\n left: number;\n top: number;\n};\n\n/** Mirrors Kendo Popup's `anchorAlign`/`popupAlign` point shape. */\nexport type PopupMenuAlign = GeometryAlign;\n\n/** Per-axis viewport collision behavior for offset-positioned popups. */\nexport type PopupMenuCollision = GeometryCollision;\n\nexport type PopupMenuAnchorActivation = {\n triggerType: \"click\" | \"keyboard\";\n coordinates?: {\n clientX: number;\n clientY: number;\n };\n};\n\nexport type PopupMenuActivationPointOptions = {\n /** Added to pointer coordinates after they are made trigger-relative. */\n pointerOffset?: { x?: number; y?: number };\n /** Trigger-relative keyboard position. Defaults to 8px from the left and vertically centered. */\n keyboardPosition?: {\n x?: number;\n y?: number | \"top\" | \"center\" | \"bottom\";\n };\n};\n\ntype PopupMenuAnchorBaseOptions = {\n /** Scrollable/clipping container used for out-of-view dismissal. */\n clipRoot?: MaybeRefOrGetter<Element | null>;\n /** Closes the menu after its trigger leaves the clipping container. */\n hideWhenAnchorClipped?: boolean;\n /** Intersection ratio required to keep the anchor considered visible. */\n intersectionThreshold?: number | number[];\n /** Per-axis collision behavior. Defaults to `flip` on both axes. */\n collision?: PopupMenuCollision;\n /**\n * Point on the anchor rect that `offset` is computed from. Mirrors Kendo\n * Popup's `anchorAlign` semantics. Defaults to `{ vertical: \"bottom\",\n * horizontal: \"left\" }`, matching Kendo's own default. Passing `anchorAlign`/\n * `popupAlign` directly to `<Popup>` has no effect when positioning via\n * `offset` (no `anchor` DOM ref) - Kendo's own alignment engine only runs\n * against a real anchor element - so these options exist to reproduce that\n * alignment ourselves in the computed `offset`.\n */\n anchorAlign?: PopupMenuAlign;\n /**\n * Point on the popup itself that is placed at the computed anchor point.\n * Mirrors Kendo Popup's `popupAlign` semantics. Defaults to `{ vertical:\n * \"top\", horizontal: \"left\" }`. Requires measuring the rendered popup\n * border box; until it has a size (e.g. the first open frame), non-\"left\"/\n * \"top\" alignments briefly fall back to \"left\"/\"top\".\n */\n popupAlign?: PopupMenuAlign;\n};\n\n/** Offset-positioning options for a Popup with a dynamically changing trigger. */\nexport type PopupMenuAnchorOptions = PopupMenuAnchorBaseOptions &\n (\n | {\n /** Tracks a pointer or keyboard activation point relative to the trigger. */\n activationPoint: true | PopupMenuActivationPointOptions;\n getRect?: never;\n }\n | {\n activationPoint?: never;\n /** Resolves a custom anchor rect from the current trigger element. */\n getRect?: (trigger: HTMLElement) => DOMRect | null;\n }\n );\n\n/** Why the popup was closed, including the focus policy for mouse paths. */\nexport type PopupMenuCloseReason =\n /** Keyboard-driven menu selection (Enter/Space on a menu item); restores the configured focus target. */\n | \"keyboard\"\n /** Escape key; restores the configured focus target, then `escapeFocusTarget`, then the trigger. */\n | \"escape\"\n /** Pointer menu selection; restores focus to the trigger. */\n | \"mouse-selection\"\n /** Pointer interaction outside the menu; leaves browser focus unchanged. */\n | \"outside-click\"\n /** Interaction with the open trigger; leaves browser focus unchanged. */\n | \"trigger-click\"\n /** Trigger left its clipping area; closes without scrolling it back into view. */\n | \"anchor-hidden\"\n /** No close has been requested yet. */\n | null;\nexport type PopupMenuCloseTrigger = Exclude<PopupMenuCloseReason, null>;\n\n/** Minimal event shape emitted by Kendo Menu `@select`. */\nexport type KendoMenuSelectEvent<\n TItem = { text?: string; id?: string; cssClass?: string; data?: unknown },\n> = {\n item?: TItem;\n event?: {\n type?: string;\n } | null;\n};\n\n/** Options for configuring {@link usePopupMenu}. */\nexport type UsePopupMenuOptions = {\n /** Read-only reactive flag reflecting whether the popup menu is currently open. */\n isOpen: Readonly<Ref<boolean>>;\n /** Ref to the popup menu element or component. Used for outside-click detection. */\n menuRef: PopupMenuElementRef;\n /**\n * Optional measurement source for custom popup markup. The source is\n * promoted to its nearest Kendo `.k-popup` so alignment and collision use\n * the complete border box. Defaults to `menuRef`; outside-click detection\n * always uses `menuRef` directly.\n */\n popupContentRef?: PopupMenuElementRef;\n /** Ref to the trigger button element or component. Ignored by outside-click detection. */\n triggerRef: PopupMenuElementRef;\n /** Called to open the popup menu. Kendo passes its event args as a rest tuple. */\n requestShow: (...args: unknown[]) => void;\n /** Called to close the popup menu. Kendo passes its event args as a rest tuple. */\n requestHide: (...args: unknown[]) => void;\n /**\n * Optional target to focus after a keyboard-driven close.\n * Supports ordinary elements and Vue/Kendo components exposing `$el`.\n */\n focusTargetRef?: PopupMenuElementRef;\n /**\n * Resolves the focus target when it is virtualized or dynamically rendered.\n * Takes precedence over `focusTargetRef`.\n */\n resolveFocusTarget?: () => HTMLElement | null;\n /**\n * Resolves the closest matching ancestor of the trigger as the configured\n * keyboard-close focus target. Used after `resolveFocusTarget` and\n * `focusTargetRef`.\n */\n focusTargetContainerSelector?: string;\n /**\n * Resolves a fallback focus target for Escape closes when no `focusTargetRef`/\n * `resolveFocusTarget` is configured, e.g. the trigger's containing grid row so\n * keyboard users land back in row navigation instead of on the trigger button.\n * Only consulted for `triggerMode: \"button\"`; row triggers already restore to\n * themselves. Takes effect only for Escape, not keyboard menu selection.\n * Takes precedence over `escapeFocusContainerSelector`.\n */\n escapeFocusTarget?: () => HTMLElement | null;\n /**\n * CSS selector for the closest ancestor of the trigger (or, if the menu was\n * never opened, of `document.activeElement`) to focus on Escape. Sugar over\n * `escapeFocusTarget` for the common \"collapse back into the row\" case.\n * Defaults to `\".k-table-row\"` for `triggerMode: \"button\"`; harmless to leave\n * at its default for non-grid button triggers since a missing ancestor simply\n * falls through to focusing the trigger. Ignored when `escapeFocusTarget` is set.\n */\n escapeFocusContainerSelector?: string;\n /**\n * CSS selector used to find the first focusable menu item after open.\n * Defaults to `\".k-menu-item:not(.k-disabled)\"` for Kendo Menu.\n */\n menuItemSelector?: string;\n /**\n * Keeps `aria-expanded` in sync with `isOpen` on the resolved `triggerRef`.\n * Defaults to `true`. The consumer is always responsible for the static\n * `aria-haspopup=\"menu\"` and baseline `aria-expanded=\"false\"` attributes.\n */\n manageMenuTriggerAria?: boolean;\n /** Applies an accessible name to the rendered `role=\"menubar\"` when provided. */\n menuLabel?: MaybeRefOrGetter<string | null | undefined>;\n /**\n * Declares whether `triggerRef` is a button or a `tr.k-table-row`. Required so\n * misrouted refs (e.g. a button-mode ref that resolves to a row) are never\n * silently managed.\n */\n triggerMode: PopupMenuTriggerMode;\n /** Enables offset positioning and lifecycle tracking for a dynamic trigger. */\n anchor?: PopupMenuAnchorOptions | true;\n};\n\n/** Functions returned by {@link usePopupMenu} for the action menu. */\nexport type UsePopupMenuReturn = {\n /** Captures an activation relative to a trigger for activation-point anchoring. */\n setAnchorActivation: (\n trigger: HTMLElement | ComponentPublicInstance | null,\n activation: PopupMenuAnchorActivation,\n ) => boolean;\n /** Opens the menu, or closes it when it is already open. */\n handleTriggerClick: (...args: unknown[]) => void;\n /**\n * Handles keyboard input on the trigger. Enter and Space open or close\n * the menu. Escape closes an open menu or moves focus to the configured target.\n */\n handleTriggerKeydown: (...args: unknown[]) => void;\n /** Closes the menu when Escape is pressed while using the menu. */\n handleMenuEscape: (event: KeyboardEvent) => void;\n /**\n * Closes the menu after an item is chosen, then runs the optional action\n * provided by the consuming component.\n */\n handleMenuSelect: (\n event: KendoMenuSelectEvent,\n onAction?: (event: KendoMenuSelectEvent) => void,\n ) => void;\n /**\n * Restores focus after the popup closes. Keyboard actions prefer the\n * configured focus target; mouse menu selections return focus to the trigger.\n */\n handlePopupClose: () => void;\n /** Bind to Kendo Popup's `offset` prop when `anchor` is enabled. */\n offset: ComputedRef<PopupMenuOffset>;\n};\n\nconst resolveElement = (\n target: HTMLElement | ComponentPublicInstance | null | undefined,\n) => {\n if (target instanceof HTMLElement) return target;\n\n const componentElement = target?.$el;\n return componentElement instanceof HTMLElement ? componentElement : null;\n};\n\nconst isManagedTrigger = (\n element: HTMLElement,\n triggerMode: PopupMenuTriggerMode,\n) =>\n triggerMode === \"row\"\n ? element.matches(\"tr.k-table-row\")\n : !element.matches(\"tr.k-table-row\");\n\nconst warnMismatchedTrigger = (\n element: HTMLElement,\n triggerMode: PopupMenuTriggerMode,\n) => {\n console.warn(\n `usePopupMenu: triggerMode \"${triggerMode}\" does not match resolved element <${element.tagName.toLowerCase()}${\n element.className ? `.${element.className.split(\" \").join(\".\")}` : \"\"\n }>; ARIA management skipped.`,\n );\n};\n\nconst findScrollableAncestor = (element: HTMLElement) => {\n let parent = element.parentElement;\n let styledFallback: HTMLElement | null = null;\n\n while (parent) {\n const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);\n const scrollsX = /auto|scroll|overlay/.test(`${overflow} ${overflowX}`);\n const scrollsY = /auto|scroll|overlay/.test(`${overflow} ${overflowY}`);\n if (scrollsX || scrollsY) styledFallback ??= parent;\n\n if (\n (scrollsX && parent.scrollWidth > parent.clientWidth) ||\n (scrollsY && parent.scrollHeight > parent.clientHeight)\n ) {\n return parent;\n }\n parent = parent.parentElement;\n }\n\n return styledFallback;\n};\n\n/**\n * Composable for accessible Kendo Popup + Menu action-menu interactions.\n *\n * It manages toggling, menu-item focus, selection modality, and contextual\n * focus restoration. The consuming component keeps ownership of menu state\n * and business-specific actions.\n *\n * @param options - Parent-owned popup state, refs, and focus configuration.\n * @returns Template event handlers for the action trigger, Kendo Menu, and Popup.\n */\nexport const usePopupMenu = (\n options: UsePopupMenuOptions,\n): UsePopupMenuReturn => {\n const popupCloseReason = ref<PopupMenuCloseReason>(null);\n const menuItemSelector =\n options.menuItemSelector ?? \".k-menu-item:not(.k-disabled)\";\n const triggerMode = options.triggerMode;\n const anchorOptions: PopupMenuAnchorOptions | undefined =\n options.anchor === true ? {} : options.anchor;\n const activationPointOptions = anchorOptions?.activationPoint\n ? anchorOptions.activationPoint === true\n ? {}\n : anchorOptions.activationPoint\n : null;\n const anchorRect = shallowRef<DOMRect | null>(null);\n const anchorActivation = shallowRef<{\n trigger: HTMLElement;\n point: { x: number; y: number };\n hasMatchedTrigger: boolean;\n } | null>(null);\n const anchorAlign: PopupMenuAlign = anchorOptions?.anchorAlign ?? {\n horizontal: \"left\",\n vertical: \"bottom\",\n };\n const popupAlign: PopupMenuAlign = anchorOptions?.popupAlign ?? {\n horizontal: \"left\",\n vertical: \"top\",\n };\n const collision: PopupMenuCollision = anchorOptions?.collision ?? {\n horizontal: \"flip\",\n vertical: \"flip\",\n };\n // Always measured (via ResizeObserver below) whenever anchor tracking is on -\n // needed both for a non-\"left\"/\"top\" popupAlign and for flip/collision\n // detection, which must compare the popup's real size against `bounds`.\n const popupRect = shallowRef<DOMRect | null>(null);\n\n const resolveTriggerElement = () => resolveElement(options.triggerRef.value);\n const triggerEl = computed(() => resolveTriggerElement());\n const anchorObserverTarget = computed(() =>\n anchorOptions && anchorOptions.hideWhenAnchorClipped !== false\n ? triggerEl.value\n : null,\n );\n // Viewport by default; the configured clipRoot when provided, matching the\n // same container `hideWhenAnchorClipped`'s intersection check already uses.\n const getOffsetBounds = (): GeometryBounds => {\n const clip = anchorOptions?.clipRoot\n ? toValue(anchorOptions.clipRoot)\n : null;\n if (clip) {\n const rect = clip.getBoundingClientRect();\n return {\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n }\n return {\n left: 0,\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n };\n };\n const offset = computed<PopupMenuOffset>(() => {\n const rect = anchorRect.value;\n if (!options.isOpen.value || !rect) return { left: 0, top: 0 };\n\n const bounds = getOffsetBounds();\n const corner = computeCollisionOffset({\n anchor: rect,\n popup: popupRect.value,\n anchorAlign,\n popupAlign,\n bounds,\n collision,\n });\n\n return {\n left: corner.left + window.scrollX,\n top: corner.top + window.scrollY,\n };\n });\n\n const resolveConfiguredFocusTarget = () => {\n const explicitTarget =\n options.resolveFocusTarget?.() ??\n resolveElement(options.focusTargetRef?.value);\n if (explicitTarget) return explicitTarget;\n\n return options.focusTargetContainerSelector\n ? (resolveTriggerElement()?.closest<HTMLElement>(\n options.focusTargetContainerSelector,\n ) ?? null)\n : null;\n };\n\n const setAnchorActivation = (\n trigger: HTMLElement | ComponentPublicInstance | null,\n activation: PopupMenuAnchorActivation,\n ) => {\n if (!activationPointOptions) return false;\n\n const triggerElement = resolveElement(trigger);\n if (!triggerElement) {\n anchorActivation.value = null;\n return false;\n }\n\n const triggerRect = triggerElement.getBoundingClientRect();\n if (activation.triggerType === \"keyboard\") {\n const keyboardPosition = activationPointOptions.keyboardPosition;\n const verticalPosition = keyboardPosition?.y ?? \"center\";\n const y =\n typeof verticalPosition === \"number\"\n ? verticalPosition\n : verticalPosition === \"top\"\n ? 0\n : verticalPosition === \"bottom\"\n ? triggerRect.height\n : triggerRect.height / 2;\n anchorActivation.value = {\n trigger: triggerElement,\n point: { x: keyboardPosition?.x ?? 8, y },\n hasMatchedTrigger: false,\n };\n return true;\n }\n\n if (!activation.coordinates) {\n anchorActivation.value = null;\n return false;\n }\n\n anchorActivation.value = {\n trigger: triggerElement,\n point: {\n x:\n activation.coordinates.clientX -\n triggerRect.left +\n (activationPointOptions.pointerOffset?.x ?? 0),\n y:\n activation.coordinates.clientY -\n triggerRect.top +\n (activationPointOptions.pointerOffset?.y ?? 0),\n },\n hasMatchedTrigger: false,\n };\n return true;\n };\n\n /**\n * Escape-only fallback below the configured focus target: a custom resolver,\n * else the closest `escapeFocusContainerSelector` ancestor of the trigger, or\n * of `document.activeElement` when the menu was never opened (so the trigger\n * isn't yet known to a shared registry). Button mode only.\n */\n const resolveEscapeFallbackTarget = (): HTMLElement | null => {\n if (triggerMode !== \"button\") return null;\n if (options.escapeFocusTarget) return options.escapeFocusTarget();\n\n const selector =\n options.escapeFocusContainerSelector ??\n DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR;\n const anchor =\n resolveTriggerElement() ?? (document.activeElement as HTMLElement | null);\n return anchor?.closest<HTMLElement>(selector) ?? null;\n };\n\n const focusConfiguredTargetOrTrigger = () => {\n const target =\n resolveConfiguredFocusTarget() ?? resolveEscapeFallbackTarget();\n if (target) {\n target.focus();\n return true;\n }\n\n const trigger = resolveTriggerElement();\n trigger?.focus();\n return !!trigger;\n };\n\n const focusFirstEnabledMenuItem = () => {\n const menuElement = resolveElement(options.menuRef.value);\n const firstEnabledItem = menuElement?.querySelector(menuItemSelector);\n (firstEnabledItem as HTMLElement | null)?.focus({ preventScroll: true });\n };\n\n // Captured before requestHide(), since shared-instance triggerRefs (e.g. useActiveIdRegistry)\n // can resolve to null the instant the active id is cleared, before the Popup's async close fires.\n const pendingFocusTarget = shallowRef<HTMLElement | null>(null);\n const pendingTrigger = shallowRef<HTMLElement | null>(null);\n\n // Pressing Enter/Space on a focused <button> makes the browser synthesize a\n // click on keyup; since focus restoration below runs before that keyup fires,\n // the synthetic click would otherwise land on the trigger and reopen the menu.\n let suppressNextTriggerClick = false;\n\n /**\n * Restores focus for the reason recorded by `closePopup`, then clears the\n * pending state so a second call (e.g. a delayed Kendo Popup `@close`) is a no-op.\n */\n const restorePendingFocus = () => {\n const reason = popupCloseReason.value;\n if (reason === \"keyboard\" || reason === \"escape\") {\n const target = pendingFocusTarget.value ?? pendingTrigger.value;\n target?.focus();\n // Only \"keyboard\" (Enter/Space menu selection) risks the native click-on-keyup\n // reopen; Escape never synthesizes a click, so no suppression is needed there.\n if (reason === \"keyboard\" && target && target === pendingTrigger.value) {\n suppressNextTriggerClick = true;\n }\n } else if (popupCloseReason.value === \"mouse-selection\") {\n pendingTrigger.value?.focus();\n }\n\n popupCloseReason.value = null;\n pendingFocusTarget.value = null;\n pendingTrigger.value = null;\n };\n\n /** Closes the popup if open, preserving its input modality for restoration. */\n const closePopup = (reason: PopupMenuCloseTrigger) => {\n if (!options.isOpen.value) return;\n popupCloseReason.value = reason;\n pendingFocusTarget.value =\n resolveConfiguredFocusTarget() ??\n (reason === \"escape\" ? resolveEscapeFallbackTarget() : null);\n pendingTrigger.value = resolveTriggerElement();\n syncManagedTrigger(false);\n options.requestHide();\n // Restores focus itself rather than waiting on Kendo Popup's `@close`, which\n // fires from an exit-animation callback that isn't reliably observed for every close.\n nextTick(restorePendingFocus);\n };\n\n watch(\n [triggerEl, anchorActivation],\n ([trigger], _, onCleanup) => {\n if (!anchorOptions || !trigger) {\n anchorRect.value = null;\n return;\n }\n\n let animationFrame: number | null = null;\n const measure = () => {\n animationFrame = null;\n const activation = anchorActivation.value;\n if (activationPointOptions) {\n if (activation && activation.trigger === trigger) {\n activation.hasMatchedTrigger = true;\n } else if (activation?.hasMatchedTrigger) {\n activation.trigger = trigger;\n }\n const triggerRect = trigger.getBoundingClientRect();\n anchorRect.value =\n activation?.trigger === trigger\n ? new DOMRect(\n triggerRect.left + activation.point.x,\n triggerRect.top + activation.point.y,\n 0,\n 0,\n )\n : null;\n return;\n }\n anchorRect.value =\n anchorOptions.getRect?.(trigger) ?? trigger.getBoundingClientRect();\n };\n const scheduleMeasure = () => {\n if (animationFrame === null)\n animationFrame = window.requestAnimationFrame(measure);\n };\n const observer =\n typeof window.ResizeObserver === \"function\"\n ? new window.ResizeObserver(scheduleMeasure)\n : null;\n observer?.observe(trigger);\n window.addEventListener(\"scroll\", scheduleMeasure, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleMeasure, { passive: true });\n scheduleMeasure();\n\n onCleanup(() => {\n if (animationFrame !== null)\n window.cancelAnimationFrame(animationFrame);\n observer?.disconnect();\n window.removeEventListener(\"scroll\", scheduleMeasure, true);\n window.removeEventListener(\"resize\", scheduleMeasure);\n });\n },\n { immediate: true, flush: \"post\" },\n );\n\n // Needed whenever anchor tracking is on - both for a non-\"left\"/\"top\"\n // popupAlign and for flip/collision detection, which always needs the\n // popup's real size to compare against bounds. Runs post-flush since the\n // element only has a real size once open.\n const resolvePopupContentElement = () => {\n const content = resolveElement(\n options.popupContentRef?.value ?? options.menuRef.value,\n );\n return content?.closest<HTMLElement>(\".k-popup\") ?? content;\n };\n if (anchorOptions) {\n watch(\n options.isOpen,\n (open, _prev, onCleanup) => {\n if (!open) {\n popupRect.value = null;\n return;\n }\n\n let animationFrame: number | null = null;\n const measure = () => {\n animationFrame = null;\n const contentElement = resolvePopupContentElement();\n popupRect.value = contentElement?.getBoundingClientRect() ?? null;\n };\n const scheduleMeasure = () => {\n if (animationFrame === null)\n animationFrame = window.requestAnimationFrame(measure);\n };\n const contentElement = resolvePopupContentElement();\n const observer =\n contentElement && typeof window.ResizeObserver === \"function\"\n ? new window.ResizeObserver(scheduleMeasure)\n : null;\n observer?.observe(contentElement!);\n scheduleMeasure();\n\n onCleanup(() => {\n if (animationFrame !== null)\n window.cancelAnimationFrame(animationFrame);\n observer?.disconnect();\n });\n },\n { immediate: true, flush: \"post\" },\n );\n }\n\n useIntersectionObserver({\n target: anchorObserverTarget,\n root: () =>\n anchorOptions?.clipRoot\n ? toValue(anchorOptions.clipRoot)\n : triggerEl.value\n ? findScrollableAncestor(triggerEl.value)\n : null,\n threshold:\n anchorOptions?.intersectionThreshold ??\n (activationPointOptions ? 0 : 0.5),\n onChange: (entry) => {\n if (!entry.isIntersecting) closePopup(\"anchor-hidden\");\n },\n });\n\n onClickOutside(options.menuRef, () => closePopup(\"outside-click\"), {\n ignore: [triggerEl],\n });\n\n let previousTrigger: HTMLElement | null = null;\n let previousMenubar: HTMLElement | null = null;\n\n // Reverts the previous trigger to its closed baseline; aria-haspopup is the consumer's.\n const demoteManagedTrigger = () => {\n if (previousTrigger?.isConnected) {\n previousTrigger.setAttribute(\"aria-expanded\", \"false\");\n }\n previousTrigger = null;\n };\n\n const syncManagedTrigger = (open: boolean) => {\n if (options.manageMenuTriggerAria === false) return;\n\n const trigger = triggerEl.value;\n if (!trigger) {\n if (previousTrigger?.isConnected) {\n previousTrigger.setAttribute(\"aria-expanded\", open ? \"true\" : \"false\");\n }\n return;\n }\n\n if (!isManagedTrigger(trigger, triggerMode)) {\n warnMismatchedTrigger(trigger, triggerMode);\n demoteManagedTrigger();\n return;\n }\n\n if (previousTrigger && previousTrigger !== trigger) {\n demoteManagedTrigger();\n }\n\n trigger.setAttribute(\"aria-expanded\", open ? \"true\" : \"false\");\n previousTrigger = trigger;\n };\n\n const syncMenuLabel = () => {\n const menuElement = resolveElement(options.menuRef.value);\n const menubar = menuElement?.matches('[role=\"menubar\"]')\n ? menuElement\n : menuElement?.querySelector<HTMLElement>('[role=\"menubar\"]');\n const label = toValue(options.menuLabel)?.trim();\n\n if (previousMenubar && previousMenubar !== menubar) {\n previousMenubar.removeAttribute(\"aria-label\");\n }\n if (menubar) {\n if (label) menubar.setAttribute(\"aria-label\", label);\n else menubar.removeAttribute(\"aria-label\");\n }\n previousMenubar = menubar ?? null;\n };\n\n watch(\n [options.isOpen, options.triggerRef],\n ([open]) => {\n syncManagedTrigger(open);\n if (!open && activationPointOptions) {\n anchorActivation.value = null;\n anchorRect.value = null;\n }\n },\n { immediate: true, flush: \"post\" },\n );\n\n watch(\n [options.isOpen, options.menuRef, () => toValue(options.menuLabel)],\n syncMenuLabel,\n { immediate: true, flush: \"post\" },\n );\n\n // Resets managed ARIA attributes on unmount; aria-haspopup remains consumer-owned.\n onUnmounted(() => {\n anchorActivation.value = null;\n demoteManagedTrigger();\n previousMenubar?.removeAttribute(\"aria-label\");\n });\n\n // Focuses the first enabled item whenever the menu opens, however it was opened\n // (handleTriggerClick, or a consumer driving isOpen directly for row triggers).\n // flush: \"post\" already waits for the Popup/Menu DOM to render, so no extra nextTick is needed.\n watch(\n options.isOpen,\n (open) => {\n if (open) focusFirstEnabledMenuItem();\n },\n { flush: \"post\" },\n );\n\n /** Toggles the menu and focuses its first enabled item after opening. */\n const handleTriggerClick = (...args: unknown[]) => {\n const context = args[0];\n\n if (suppressNextTriggerClick) {\n suppressNextTriggerClick = false;\n return;\n }\n\n if (options.isOpen.value) {\n closePopup(\"trigger-click\");\n return;\n }\n\n options.requestShow(context);\n };\n\n /** Handles Enter, Space, and Escape on the trigger. */\n const handleTriggerKeydown = (...args: unknown[]) => {\n const event = args[0] as KeyboardEvent;\n const context = args[1];\n\n if (event.key === \"Enter\" || event.code === \"Space\") {\n event.preventDefault();\n handleTriggerClick(context);\n return;\n }\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n\n if (options.isOpen.value) {\n closePopup(\"escape\");\n return;\n }\n\n focusConfiguredTargetOrTrigger();\n }\n };\n\n /** Escape handler bound inside the menu. */\n const handleMenuEscape = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n closePopup(\"escape\");\n };\n\n /** Closes the menu then delegates its business action to the caller. */\n const handleMenuSelect = (\n event: KendoMenuSelectEvent,\n onAction?: (event: KendoMenuSelectEvent) => void,\n ) => {\n closePopup(\n event.event?.type?.startsWith(\"key\") ? \"keyboard\" : \"mouse-selection\",\n );\n onAction?.(event);\n };\n\n /**\n * Bind to the Kendo Popup `@close` event after the owner updates `isOpen`.\n * Keyboard menu selection and Escape both try the configured focus target\n * first, Escape then falls back to `escapeFocusTarget`, and both fall back\n * to the trigger. Mouse menu selection restores the trigger, while outside\n * clicks leave focus under browser control.\n */\n // Kept as a safety net for consumers that still wire Kendo Popup's `@close`;\n // restorePendingFocus() is idempotent once closePopup's own nextTick has already run.\n const handlePopupClose = () => {\n nextTick(restorePendingFocus);\n };\n\n return {\n /**\n * Sets the anchor activation state, controlling whether the popup menu\n * should respond to trigger interactions.\n */\n setAnchorActivation,\n /**\n * Handles Kendo Menu selection: records keyboard or mouse modality,\n * requests popup close, then runs the optional caller-owned action.\n */\n handleMenuSelect,\n /**\n * Toggles the action menu. When opening, focuses the first enabled Kendo\n * Menu item after Vue renders the popup.\n */\n handleTriggerClick,\n /**\n * Handles trigger keyboard input: Enter and Space toggle the menu; Escape\n * closes an open menu or focuses the configured target when already closed.\n */\n handleTriggerKeydown,\n /** Closes the open menu through the keyboard path when Escape is pressed inside it. */\n handleMenuEscape,\n /**\n * Restores focus after Kendo Popup closes: keyboard menu selection and\n * Escape prefer the configured focus target (Escape then falls back to\n * `escapeFocusTarget`), mouse selections return to the trigger, and\n * outside clicks do not move focus.\n */\n handlePopupClose,\n offset,\n };\n};\n","import { onUnmounted } from \"vue\";\n\n/** A participant that can be deactivated when another group member becomes active. */\nexport type ExclusiveGroupMember = {\n deactivate: () => void;\n};\n\n/** Coordinates mutually exclusive activation across registered members. */\nexport type UseExclusiveGroupReturn = {\n /** Adds a member and unregisters it automatically when the current owner unmounts. */\n register: (member: ExclusiveGroupMember) => void;\n /** Deactivates every registered member except the activating member. */\n deactivateOthers: (activeMember: ExclusiveGroupMember) => void;\n /** Deactivates every registered member. */\n deactivateAll: () => void;\n};\n\n/**\n * Coordinates mutually exclusive active-id registries within a Vue owner.\n *\n * Registered members are removed automatically when their owning component or composable\n * unmounts. Call `register` from setup so Vue can associate cleanup with that owner.\n */\nexport const useExclusiveGroup = (): UseExclusiveGroupReturn => {\n const members = new Set<ExclusiveGroupMember>();\n\n const register = (member: ExclusiveGroupMember) => {\n members.add(member);\n onUnmounted(() => members.delete(member));\n };\n\n const deactivateOthers = (activeMember: ExclusiveGroupMember) => {\n members.forEach((member) => {\n if (member !== activeMember) member.deactivate();\n });\n };\n\n const deactivateAll = () => {\n members.forEach((member) => member.deactivate());\n };\n\n return { register, deactivateOthers, deactivateAll };\n};\n","import {\n computed,\n readonly,\n ref,\n shallowReactive,\n type ComputedRef,\n type DeepReadonly,\n type Ref,\n} from \"vue\";\n\n/** An element ref value that may be a plain element or a Vue/Kendo ref-like object exposing `$el`. */\nexport type RegisterableElement =\n | HTMLElement\n | { $el?: HTMLElement | null }\n | null;\n\nconst resolveRegisteredElement = (\n value: RegisterableElement,\n): HTMLElement | null => {\n if (value instanceof HTMLElement) return value;\n const componentElement = value && \"$el\" in value ? value.$el : null;\n return componentElement instanceof HTMLElement ? componentElement : null;\n};\n\n/** Functions and state returned by {@link useActiveIdRegistry}. */\nexport type UseActiveIdRegistryReturn<Id> = {\n /** The currently active id, or `null` when nothing is active. Read-only; use `activate`/`deactivate` to change it. */\n activeId: DeepReadonly<Ref<Id | null>>;\n /** `true` while any id is active. */\n isActive: ComputedRef<boolean>;\n /** The registered element for the active id, or `null`. */\n activeElement: ComputedRef<HTMLElement | null>;\n /** Registers (or unregisters, when `el` is `null`) the element for `id`. */\n register: (id: Id, el: RegisterableElement) => void;\n /** Returns the currently registered element for `id`, if any. */\n resolve: (id: Id) => HTMLElement | null;\n /** Marks `id` as active. */\n activate: (id: Id) => void;\n /** Clears the active id. */\n deactivate: () => void;\n /** Returns whether `id` is the currently active id. */\n isIdActive: (id: Id) => boolean;\n};\n\n/**\n * Tracks which single id, out of a rendered list of items (grid rows, tabs,\n * action buttons, etc.), is currently \"active,\" alongside a registry\n * resolving each id to its mounted DOM element.\n *\n * This helper is useful for shared-instance patterns where one popup/menu instance\n * is reused across a list while a single item remains active at a time.\n *\n * @returns Active-id state, an element registry, and activation helpers.\n */\nexport const useActiveIdRegistry = <\n Id = string | number,\n>(): UseActiveIdRegistryReturn<Id> => {\n const registry = shallowReactive(new Map<Id, HTMLElement>());\n const activeId = ref<Id | null>(null) as Ref<Id | null>;\n\n const register = (id: Id, el: RegisterableElement) => {\n const element = resolveRegisteredElement(el);\n if (element) {\n registry.set(id, element);\n } else {\n registry.delete(id);\n }\n };\n\n const resolve = (id: Id) => registry.get(id) ?? null;\n\n const activate = (id: Id) => {\n activeId.value = id;\n };\n\n const deactivate = () => {\n activeId.value = null;\n };\n\n const isIdActive = (id: Id) => activeId.value === id;\n\n return {\n activeId: readonly(activeId),\n isActive: computed(() => activeId.value !== null),\n activeElement: computed(() =>\n activeId.value !== null ? resolve(activeId.value) : null,\n ),\n register,\n resolve,\n activate,\n deactivate,\n isIdActive,\n };\n};\n","import {\n computed,\n isRef,\n nextTick,\n onScopeDispose,\n ref,\n shallowRef,\n toValue,\n watch,\n type ComponentPublicInstance,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\n\n/** Kendo Window's stage values. Distinct from browser fullscreen APIs. */\nexport type WindowStage = \"DEFAULT\" | \"MINIMIZED\" | \"FULLSCREEN\";\n\nexport interface WindowMoveEventPayload {\n drag: boolean;\n end: boolean;\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nexport type WindowResizeEventPayload = WindowMoveEventPayload;\n\nexport interface WindowSettings {\n title: string;\n draggable: boolean;\n resizable: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n closable: boolean;\n fixed: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n minimizeButton: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n maximizeButton: boolean;\n initialWidth: number;\n initialHeight: number;\n width?: number;\n height?: number;\n left?: number;\n top?: number;\n}\n\nexport const WINDOW_SETTINGS_DEFAULTS: WindowSettings = {\n title: \"My Window\",\n draggable: true,\n resizable: true,\n closable: true,\n fixed: true,\n minimizeButton: true,\n maximizeButton: true,\n initialWidth: 500,\n initialHeight: 500,\n width: 500,\n height: 500,\n left: undefined,\n top: undefined,\n};\n\nexport interface UseWindowOptions {\n /**\n * Overrides for one or more settings; any field you omit falls back to\n * `WINDOW_SETTINGS_DEFAULTS`, merged internally - you never need to spread\n * the defaults yourself. Pass a `Ref` (e.g. one already wired to your own\n * persistence layer) to have `useWindow` read and mutate it directly\n * instead of creating its own internal ref; missing fields on that ref are\n * filled in from the defaults once, in place, at setup time.\n */\n settings?: Partial<WindowSettings> | Ref<Partial<WindowSettings>>;\n initialStage?: WindowStage;\n /** Enables the native titlebar double-click stage toggle. Defaults to true. */\n titlebarDoubleClick?: MaybeRefOrGetter<boolean>;\n onMove?: (payload: WindowMoveEventPayload) => void;\n onResize?: (payload: WindowResizeEventPayload) => void;\n onStageChange?: (stage: WindowStage) => void;\n onOpen?: () => void;\n onClose?: () => void;\n}\n\n/** The subset of Kendo `Window` props useWindow keeps functional - see docs \"Inert Props\". */\nexport interface WindowBindableProps {\n title: string;\n draggable: boolean;\n resizable: boolean;\n left?: number;\n top?: number;\n initialLeft: number;\n initialTop: number;\n initialWidth: number;\n initialHeight: number;\n width?: number;\n height?: number;\n stage: WindowStage;\n windowClass: string;\n}\n\nexport interface WindowEvents {\n move: (...args: unknown[]) => void;\n resize: (...args: unknown[]) => void;\n stagechange: (...args: unknown[]) => void;\n close: (...args: unknown[]) => void;\n}\n\nexport interface UseWindowOpenOptions {\n /**\n * Discards any existing left/top/width/height (including one restored from\n * an externally-persisted `settings` ref) and recomputes the initial inset\n * position and `initialWidth`/`initialHeight` size. Defaults to `false`, so\n * a previously dragged/resized/persisted position survives close + reopen.\n */\n resetPosition?: boolean;\n}\n\nexport interface UseWindowReturn {\n windowRef: Ref<ComponentPublicInstance | null>;\n settings: Ref<WindowSettings>;\n visible: Ref<boolean>;\n stage: Ref<WindowStage>;\n isDragging: Ref<boolean>;\n isResizing: Ref<boolean>;\n /** Spread via `v-bind` onto `<Window>`. */\n props: ComputedRef<WindowBindableProps>;\n /** Spread via `v-on` onto `<Window>`. */\n events: WindowEvents;\n open: (openOptions?: UseWindowOpenOptions) => Promise<void>;\n close: () => void;\n}\n\nconst isWindowStage = (value: unknown): value is WindowStage =>\n value === \"DEFAULT\" || value === \"MINIMIZED\" || value === \"FULLSCREEN\";\n\n/**\n * Converts a desired right-edge inset into Kendo Window's `initialLeft`\n * coordinate. Kendo exposes no `initialRight` prop, so positioning from the\n * right must be expressed as a left offset. Clamps to zero when the Window is\n * wider than the available viewport.\n */\nconst calculateInitialLeft = (\n viewportWidth: number,\n windowWidth: number,\n rightInset: number,\n) => Math.max(viewportWidth - windowWidth - rightInset, 0);\n\n/**\n * Wraps Kendo UI for Vue's `Window` component (not the browser `window`\n * object) with zero-config defaults, viewport-clamped dragging, and the\n * pointerdown-capture resize/text-selection workaround from\n * docs/design/composable-native-event-listener-tactic.md.\n */\nexport function useWindow(options: UseWindowOptions = {}): UseWindowReturn {\n // Merge WINDOW_SETTINGS_DEFAULTS into whatever the consumer provided.\n // A Ref is filled in place (preserving its identity, e.g. for persistence);\n // a plain partial object seeds a new internal ref.\n if (isRef(options.settings)) {\n options.settings.value = {\n ...WINDOW_SETTINGS_DEFAULTS,\n ...options.settings.value,\n };\n }\n\n const settings: Ref<WindowSettings> = isRef(options.settings)\n ? (options.settings as Ref<WindowSettings>)\n : ref<WindowSettings>({ ...WINDOW_SETTINGS_DEFAULTS, ...options.settings });\n\n const windowRef = shallowRef<ComponentPublicInstance | null>(null);\n const visible = ref(false);\n const stage = ref<WindowStage>(options.initialStage ?? \"DEFAULT\");\n const isDragging = ref(false);\n const isResizing = ref(false);\n const initialLeft = ref(0);\n const initialTop = ref(0);\n\n const open = async (openOptions?: UseWindowOpenOptions) => {\n // No stored left/top means this is the first-ever open - always compute\n // the initial layout then, regardless of resetPosition.\n const hasStoredPosition =\n settings.value.left !== undefined && settings.value.top !== undefined;\n\n if (openOptions?.resetPosition || !hasStoredPosition) {\n const rootFontSize = Number.parseFloat(\n window.getComputedStyle(document.documentElement).fontSize,\n );\n const padding = Number.isFinite(rootFontSize) ? rootFontSize : 16;\n // Non-fixed Windows position in document coordinates (matching\n // handleMove's viewportLeft/viewportTop), so the inset must account for\n // scroll offset or a scrolled page opens the Window off-screen.\n const viewportLeft = settings.value.fixed ? 0 : window.scrollX;\n const viewportTop = settings.value.fixed ? 0 : window.scrollY;\n\n settings.value.left = undefined;\n settings.value.top = undefined;\n settings.value.width = undefined;\n settings.value.height = undefined;\n initialLeft.value =\n viewportLeft +\n calculateInitialLeft(\n window.innerWidth,\n settings.value.initialWidth,\n padding,\n );\n initialTop.value = viewportTop + padding;\n visible.value = true;\n\n await nextTick();\n settings.value.width = settings.value.initialWidth;\n settings.value.height = settings.value.initialHeight;\n } else {\n // Persisted/dragged left, top, width, and height are left untouched -\n // Kendo applies them directly via the controlled left/top/width/height props.\n visible.value = true;\n }\n\n options.onOpen?.();\n };\n\n const closeWindow = () => {\n stage.value = \"DEFAULT\";\n visible.value = false;\n options.onClose?.();\n };\n\n const handleStageChange = (...args: unknown[]) => {\n // Kendo emits (nativeEvent, windowInstance, { state }) at runtime despite\n // its .d.ts typing onStagechange as a single-argument callback.\n const payload = args[2];\n\n if (\n typeof payload !== \"object\" ||\n payload === null ||\n !(\"state\" in payload) ||\n !isWindowStage(payload.state)\n ) {\n return;\n }\n\n const requestedStage = payload.state;\n\n if (requestedStage === stage.value) {\n return;\n }\n\n stage.value = requestedStage;\n options.onStageChange?.(requestedStage);\n };\n\n const handleMove = (...args: unknown[]) => {\n const event = args[0];\n\n if (\n typeof event === \"object\" &&\n event !== null &&\n \"drag\" in event &&\n \"left\" in event &&\n \"top\" in event &&\n \"width\" in event &&\n \"height\" in event &&\n typeof event.left === \"number\" &&\n typeof event.top === \"number\" &&\n typeof event.width === \"number\" &&\n typeof event.height === \"number\"\n ) {\n const payload = event as WindowMoveEventPayload;\n const windowRoot = windowRef.value?.$el;\n const titlebar =\n windowRoot instanceof Element\n ? windowRoot.querySelector<HTMLElement>(\".k-window-titlebar\")\n : null;\n const titlebarRect = titlebar?.getBoundingClientRect();\n const titlebarWidth = titlebarRect?.width ?? payload.width;\n const titlebarHeight = titlebarRect?.height ?? payload.height;\n const viewportLeft = settings.value.fixed ? 0 : window.scrollX;\n const viewportTop = settings.value.fixed ? 0 : window.scrollY;\n const viewportRight = viewportLeft + document.documentElement.clientWidth;\n const viewportBottom =\n viewportTop + document.documentElement.clientHeight;\n const maximumLeft = Math.max(viewportRight - titlebarWidth, viewportLeft);\n const maximumTop = Math.max(viewportBottom - titlebarHeight, viewportTop);\n\n settings.value.left = Math.min(\n Math.max(payload.left, viewportLeft),\n maximumLeft,\n );\n settings.value.top = Math.min(\n Math.max(payload.top, viewportTop),\n maximumTop,\n );\n isDragging.value = payload.drag && !payload.end;\n options.onMove?.(payload);\n }\n };\n\n const handleResize = (...args: unknown[]) => {\n const event = args[0];\n\n if (\n typeof event === \"object\" &&\n event !== null &&\n \"drag\" in event &&\n \"left\" in event &&\n \"top\" in event &&\n \"width\" in event &&\n \"height\" in event &&\n typeof event.left === \"number\" &&\n typeof event.top === \"number\" &&\n typeof event.width === \"number\" &&\n typeof event.height === \"number\"\n ) {\n const payload = event as WindowResizeEventPayload;\n settings.value.left = payload.left;\n settings.value.top = payload.top;\n settings.value.width = payload.width;\n settings.value.height = payload.height;\n isResizing.value = payload.drag && !payload.end;\n options.onResize?.(payload);\n }\n };\n\n // Kendo Window's resize-handle drag competes with native text-selection\n // dragging unless the handle's pointerdown default is prevented in the\n // capture phase, before Kendo's own listeners and the browser's default\n // selection-drag both react. See docs/design/composable-native-event-listener-tactic.md.\n const handlePointerDown = (event: PointerEvent) => {\n if (\n event.target instanceof Element &&\n event.target.closest(\".k-resize-handle\")\n ) {\n event.preventDefault();\n }\n };\n\n const handleTitlebarDoubleClick = (event: MouseEvent) => {\n if (toValue(options.titlebarDoubleClick) !== false) {\n return;\n }\n\n if (\n event.target instanceof Element &&\n event.target.closest(\".k-window-titlebar\")\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n let removePointerDownListener: (() => void) | undefined;\n let removeTitlebarDoubleClickListener: (() => void) | undefined;\n\n const removePointerDownWatcher = () => {\n removePointerDownListener?.();\n removePointerDownListener = undefined;\n };\n\n const removeTitlebarDoubleClickWatcher = () => {\n removeTitlebarDoubleClickListener?.();\n removeTitlebarDoubleClickListener = undefined;\n };\n\n watch(\n windowRef,\n (instance) => {\n removePointerDownWatcher();\n removeTitlebarDoubleClickWatcher();\n\n const root = instance?.$el;\n\n if (!(root instanceof HTMLElement)) {\n return;\n }\n\n root.addEventListener(\"pointerdown\", handlePointerDown, {\n capture: true,\n });\n removePointerDownListener = () =>\n root.removeEventListener(\"pointerdown\", handlePointerDown, {\n capture: true,\n });\n\n root.addEventListener(\"dblclick\", handleTitlebarDoubleClick, {\n capture: true,\n });\n removeTitlebarDoubleClickListener = () =>\n root.removeEventListener(\"dblclick\", handleTitlebarDoubleClick, {\n capture: true,\n });\n },\n { flush: \"post\" },\n );\n\n onScopeDispose(removePointerDownWatcher);\n onScopeDispose(removeTitlebarDoubleClickWatcher);\n\n const windowClass = computed(() => {\n const classes: string[] = [\"fk-window\"];\n\n if (settings.value.draggable && stage.value !== \"FULLSCREEN\") {\n classes.push(\"fk-window-can-drag\");\n }\n if (isDragging.value) {\n classes.push(\"fk-window-is-dragging\");\n }\n if (isResizing.value) {\n classes.push(\"fk-window-is-resizing\");\n }\n if (settings.value.fixed) {\n classes.push(\"fk-window-fixed\");\n }\n // Kendo's Window titlebar buttons render unconditionally; hidden via CSS\n // since minimizeButton/maximizeButton/closable only accept a\n // String|Function template in Kendo's own (buggy) prop types.\n if (!settings.value.minimizeButton) {\n classes.push(\"fk-window-hide-minimize\");\n }\n if (!settings.value.maximizeButton) {\n classes.push(\"fk-window-hide-maximize\");\n }\n if (!settings.value.closable) {\n classes.push(\"fk-window-hide-close\");\n }\n\n return classes.join(\" \");\n });\n\n const props = computed<WindowBindableProps>(() => ({\n title: settings.value.title,\n draggable: settings.value.draggable,\n resizable: settings.value.resizable,\n left: settings.value.left,\n top: settings.value.top,\n initialLeft: initialLeft.value,\n initialTop: initialTop.value,\n initialWidth: settings.value.initialWidth,\n initialHeight: settings.value.initialHeight,\n width: settings.value.width,\n height: settings.value.height,\n stage: stage.value,\n windowClass: windowClass.value,\n }));\n\n const events: WindowEvents = {\n move: handleMove,\n resize: handleResize,\n stagechange: handleStageChange,\n close: closeWindow,\n };\n\n return {\n windowRef,\n settings,\n visible,\n stage,\n isDragging,\n isResizing,\n props,\n events,\n open,\n close: closeWindow,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\n\nexport type ChangePayload = { value: Date | null; event: any };\n\nexport function useMaskedDateInput(args: {\n id: string;\n onChange: (p: ChangePayload) => void;\n onShowCalendar: (e: KeyboardEvent) => void;\n externalValue?: Ref<string | Date | null | undefined>;\n min?: Date | null | undefined;\n max?: Date | null | undefined;\n /** When true, empty/incomplete value is considered invalid after blur */\n required?: boolean;\n /** Optional default date for this field (e.g., today). */\n defaultValue?: Date | null;\n dateFormat?: string;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const placeholder = ref<string>(args.dateFormat ?? \"mm/dd/yyyy\");\n const isRequired = computed(() => !!args.required);\n const MIN_YEAR = 1000;\n const isTouched = ref(false);\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"];\n\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n\n const datePart = (pos: number) => {\n if (pos <= 2) return \"mm\";\n if (pos <= 5) return \"dd\";\n if (digitsOnly.value.length <= 10) return \"yyyy\";\n return \"mm\";\n };\n\n const month = computed(() => {\n const m = raw.value\n ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(m).toString().padStart(2, \"0\");\n });\n const day = computed(() => {\n const d = raw.value\n ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(d).toString().padStart(2, \"0\");\n });\n const year = computed(() => {\n const y = raw.value\n ? raw.value.substring(6, 10).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(y).toString().padStart(4, \"0\");\n });\n\n const emitParsedIfComplete = (event: any) => {\n if (digitsOnly.value.length === 0) {\n args.onChange({ value: null, event });\n return;\n }\n if (digitsOnly.value.length < 8) {\n args.onChange({ value: null, event });\n return;\n }\n if ((raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8) {\n const [mmStr, ddStr, yyyyStr] = raw.value.split(\"/\");\n const mm = parseInt(mmStr);\n const dd = parseInt(ddStr);\n const yyyy = parseInt(yyyyStr);\n // Prevent auto-correction: only emit if parts are a real calendar date\n if (isValidParts(yyyy, mm, dd)) {\n const d = createDate(yyyy, mm, dd);\n if (inRange(d)) {\n args.onChange({ value: d, event });\n } else {\n args.onChange({ value: null, event });\n }\n } else {\n args.onChange({ value: null, event });\n }\n }\n };\n const inRange = (d: Date) => {\n const min = args.min ?? undefined;\n const max = args.max ?? undefined;\n if (min && d < min) return false;\n if (max && d > max) return false;\n return true;\n };\n\n const parsedRawDate = computed<Date | null>(() => {\n if ((raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8) {\n const [mmStr, ddStr, yyyyStr] = (raw.value ?? \"\").split(\"/\");\n const mm = parseInt(mmStr);\n const dd = parseInt(ddStr);\n const yyyy = parseInt(yyyyStr);\n if (isValidParts(yyyy, mm, dd)) {\n return createDate(yyyy, mm, dd);\n }\n }\n return null;\n });\n\n const isComplete = computed(() => {\n return (raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8;\n });\n\n // Helpers to centralize validity checks and baseline selection\n const createDate = (yy: number, mm: number, dd: number) => {\n const date = new Date(0);\n date.setFullYear(yy, mm - 1, dd);\n date.setHours(0, 0, 0, 0);\n return date;\n };\n\n const daysInMonth = (yy: number, mm: number) => {\n return createDate(yy, mm + 1, 0).getDate();\n };\n\n const isValidParts = (yy: number, mm: number, dd: number) => {\n return (\n mm >= 1 &&\n mm <= 12 &&\n yy >= MIN_YEAR &&\n dd >= 1 &&\n dd <= daysInMonth(yy, mm)\n );\n };\n\n const handleChange = (event: any): void => {\n raw.value = event.value as string;\n const src = event.event?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n let m = parseInt(month.value);\n let d = parseInt(day.value);\n let y = parseInt(year.value);\n\n // If input is invalid or incomplete, set to today's date and ignore the step\n const hasEightDigits = digitsOnly.value.length >= 8;\n if (!hasEightDigits || !isValidParts(y, m, d)) {\n const today = args.defaultValue ?? new Date();\n m = today.getMonth() + 1;\n d = today.getDate();\n y = today.getFullYear();\n raw.value = `${String(m).padStart(2, \"0\")}/${String(d).padStart(\n 2,\n \"0\",\n )}/${String(y)}`;\n\n const setDate = createDate(y, m, d);\n args.onChange({ value: inRange(setDate) ? setDate : null, event });\n\n focusAndRestore({ useRAF: true });\n return;\n }\n\n const part = datePart(pos);\n\n if (part === \"mm\") {\n m = direction === \"ArrowUp\" ? (m < 12 ? m + 1 : 1) : m > 1 ? m - 1 : 12;\n } else if (part === \"dd\") {\n const days = new Date(y, m, 0).getDate();\n d =\n direction === \"ArrowUp\" ? (d < days ? d + 1 : 1) : d > 1 ? d - 1 : days;\n } else if (part === \"yyyy\") {\n y = direction === \"ArrowUp\" ? y + 1 : Math.max(1, y - 1);\n }\n\n raw.value = `${String(m).padStart(2, \"0\")}/${String(d).padStart(\n 2,\n \"0\",\n )}/${String(y)}`;\n\n const [mmStr, ddStr, yyyyStr] = raw.value.split(\"/\");\n const steppedDate = createDate(\n parseInt(yyyyStr),\n parseInt(mmStr),\n parseInt(ddStr),\n );\n if (\n steppedDate.toString() !== \"Invalid Date\" &&\n parseInt(yyyyStr) >= 1000\n ) {\n args.onChange({\n value: inRange(steppedDate) ? steppedDate : null,\n event,\n });\n } else {\n args.onChange({ value: null, event });\n }\n\n focusAndRestore({ useRAF: true });\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.code === \"Space\" || event.key === \" \") {\n // Justified: Space opens the calendar popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n // Alt+Down opens the menu; allow Alt combos to pass through\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the calendar popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n // Justified: ArrowUp/Down act as date-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Map mouse wheel to stepper behavior (up/down) based on caret segment\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n const src = event.target as HTMLInputElement;\n if (cursorKeys.includes(event.key)) {\n // Do not prevent default for caret navigation\n cursorPos.value = src?.selectionStart ?? 0;\n return;\n }\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const handleBlur = (event: FocusEvent): void => {\n isTouched.value = true;\n\n // If required, no default provided, and value is still undefined/blank,\n // coerce external value from undefined -> \"\" so downstream validation\n // treats this as an incomplete required field.\n if (\n isRequired.value &&\n !args.defaultValue &&\n args.externalValue &&\n args.externalValue.value === undefined &&\n digitsOnly.value.length === 0\n ) {\n (args.externalValue as Ref<any>).value = \"\";\n }\n\n // Also ensure caret position is captured on blur\n const src = event.target as HTMLInputElement | null;\n if (src) {\n cursorPos.value = src.selectionStart ?? 0;\n }\n };\n\n // Centralized focus + caret restore helper to avoid duplicated logic.\n const focusAndRestore = (opts?: {\n /** milliseconds to delay the focus (useful to wait for popups to close) */\n delay?: number;\n /** when true, use requestAnimationFrame to schedule the focus */\n useRAF?: boolean;\n /** explicit caret position override; otherwise uses `cursorPos` or end */\n pos?: number | undefined;\n }) => {\n const run = () => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (!inputEl) return;\n const p = opts?.pos ?? cursorPos.value ?? inputEl.value.length;\n try {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n } catch {\n // ignore if element not focusable or selection not supported\n }\n };\n\n nextTick(() => {\n if (opts?.delay && opts.delay > 0) {\n setTimeout(run, opts.delay);\n return;\n }\n if (opts?.useRAF) {\n requestAnimationFrame(run);\n return;\n }\n run();\n });\n };\n\n // Sync external value into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n if (newVal) {\n const date = new Date(newVal as any);\n if (date.toString() !== \"Invalid Date\") {\n const m = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const d = date.getDate().toString().padStart(2, \"0\");\n const y = date.getFullYear().toString();\n raw.value = `${m}/${d}/${y}`;\n\n // When external value is updated (e.g., user selects a date\n // from the calendar), refocus the input and restore caret.\n // Delay slightly to avoid Kendo calendar focus/DOM operations\n // overriding our focus call.\n focusAndRestore({ delay: 50 });\n return;\n }\n }\n // If external value is null/invalid, keep current raw as-is\n },\n { immediate: true },\n );\n }\n\n const debugLines = computed(() => {\n return [\n [\"Date\", `${month.value} / ${day.value} / ${year.value}`],\n [\"Digits only\", digitsOnly.value],\n [\n \"min\",\n args.min?.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }) ?? null,\n ],\n [\n \"max\",\n args.max?.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }) ?? null,\n ],\n ];\n });\n\n // Range validation based on provided min/max and current external value\n const isValid = computed(() => {\n // Optional field preserves existing forgiving behavior\n if (!isRequired.value) {\n if (!isComplete.value) return true;\n const candidate = parsedRawDate.value;\n if (!candidate) return false; // complete but invalid parts\n return inRange(candidate);\n }\n\n // Required field: do not flag invalid until after blur\n if (!isTouched.value) return true;\n\n const candidate = parsedRawDate.value;\n if (!isComplete.value) return false; // incomplete after blur\n if (!candidate) return false; // complete but invalid parts\n return inRange(candidate);\n });\n\n const reason = computed<string | undefined>(() => {\n // When not required, only report reasons for completed-but-bad values\n if (!isRequired.value) {\n if (!isComplete.value) return undefined;\n const candidate = parsedRawDate.value;\n if (!candidate) return \"invalid-date\";\n if (!inRange(candidate)) return \"out-of-bounds\";\n return \"valid\";\n }\n\n // Required: only validate after blur\n if (!isTouched.value) return undefined;\n\n if (digitsOnly.value.length === 0 || !isComplete.value) {\n return \"incomplete\";\n }\n\n const candidate = parsedRawDate.value;\n if (!candidate) return \"invalid-date\";\n if (!inRange(candidate)) return \"out-of-bounds\";\n return \"valid\";\n });\n\n const validationMessage = computed(() => {\n const r = reason.value;\n if (!r || r === \"valid\") return \"\";\n\n if (r === \"incomplete\") {\n return \"Required\";\n }\n\n if (r === \"invalid-date\") {\n return `Must be in ${placeholder.value} format.`;\n }\n\n const minStr = args.min\n ? args.min.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n })\n : null;\n const maxStr = args.max\n ? args.max.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n })\n : null;\n if (r === \"out-of-bounds\") {\n if (minStr && maxStr) return `Must be between ${minStr} and ${maxStr}.`;\n if (minStr) return `Must be on or after ${minStr}.`;\n if (maxStr) return `Must be on or before ${maxStr}.`;\n }\n\n return \"\";\n });\n\n const initStyling = () => {\n // Adds our `fk-datepicker` class to the parent of the Kendo datepicker\n // This is separated so callers can invoke styling on demand.\n nextTick(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n\n if (!inputEl) {\n console.warn(`ID (#${args.id}) not found for styling.`);\n return;\n }\n const datePicker = inputEl.closest(\".k-datepicker\");\n if (!datePicker) {\n console.warn(`.k-datepicker parent not found for #${args.id} styling.`);\n return;\n }\n\n // Add class to parent to avoid it being wiped away by Kendo's DOM manipulation\n const parent = datePicker.parentElement;\n if (parent) {\n // Idempotent: if we've already added our class, do nothing.\n if (parent.classList.contains(\"fk-datepicker\")) {\n return;\n }\n parent.classList.add(\"fk-datepicker\");\n } else {\n console.warn(\n `Parent of .k-datepicker not found for #${args.id} styling.`,\n );\n }\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n return {\n raw,\n cursorPos,\n debugEnabled,\n debugLines,\n placeholder,\n isValid,\n reason: readonly(reason),\n validationMessage,\n digitsOnly,\n month: readonly(month),\n day: readonly(day),\n year: readonly(year),\n datePart,\n handleChange,\n handleKeyDown,\n handleWheel,\n handleKeyUp,\n handleClick,\n handleBlur,\n // Expose so consumers can re-run styling when needed\n initStyling,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\nimport type { SelectionRange } from \"@progress/kendo-vue-dateinputs\";\n\nexport type RangeChangePayload = { value: SelectionRange | null; event: any };\n\ntype Part = \"mm\" | \"dd\" | \"yyyy\";\n\ntype Side = \"start\" | \"end\";\n\nexport function useMaskedDateRangeInput(args: {\n id: string; // id of the MaskedTextBox input element\n onChange: (p: RangeChangePayload) => void;\n onShowCalendar: (e: KeyboardEvent) => void;\n externalValue?: Ref<SelectionRange | null | undefined>;\n externalValid?: Ref<boolean | undefined>;\n manageValid?: boolean; // default true: mirror computed validity into externalValid\n maxSpanDays?: number; // optional maximum allowed span between start and end (in days)\n min?: Date;\n max?: Date;\n allowReverse?: boolean; // default false\n // Popup control hooks\n isOpen?: Ref<boolean>;\n onRequestClose?: () => void;\n closeDelay?: Ref<number> | number;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const calendarChanged = ref<boolean>(false);\n\n const ONE_DAY = 24 * 60 * 60 * 1000;\n const ONE_YEAR = 365 * ONE_DAY;\n const TODAY = new Date();\n const MIN_DATE = new Date(TODAY.getTime() - ONE_YEAR);\n const MAX_DATE = new Date(TODAY.getTime() + ONE_YEAR);\n\n args.min = args.min ?? MIN_DATE;\n args.max = args.max ?? MAX_DATE;\n\n // Define helpers early to avoid \"used before initialization\" issues\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n const daysInMonth = (yy: number, mm: number) => new Date(yy, mm, 0).getDate();\n const isValidParts = (yy: number, mm: number, dd: number) => {\n return (\n mm >= 1 && mm <= 12 && yy >= 1000 && dd >= 1 && dd <= daysInMonth(yy, mm)\n );\n };\n // Compare dates by date-only (UTC midnight) to avoid time-of-day issues\n const toUtcMidnightMs = (d: Date) =>\n Date.UTC(d.getFullYear(), d.getMonth(), d.getDate());\n const clampToMinMax = (d: Date | null): Date | null => {\n if (!d) return null;\n // default to 90days ago if min/max not provided\n const min = args.min ?? new Date(Date.now() - 90 * ONE_DAY);\n // default to today\n const max = args.max ?? new Date();\n const dMs = toUtcMidnightMs(d);\n if (dMs < toUtcMidnightMs(min) || dMs > toUtcMidnightMs(max)) return null;\n return d;\n };\n const rangeIsOrdered = (start: Date, end: Date) => {\n return (args.allowReverse ?? false) ? true : start <= end;\n };\n const maskComplete = computed(() => {\n return (raw.value?.length ?? 0) >= 23 && digitsOnly.value.length >= 16;\n });\n\n const parseFromRaw = (\n s: string,\n ): { start: Date | null; end: Date | null } => {\n // Expect MM/DD/YYYY - MM/DD/YYYY\n if ((s ?? \"\").length < 23 || digitsOnly.value.length < 16)\n return { start: null, end: null };\n const left = s.substring(0, 10);\n const right = s.substring(13, 23);\n const [mm1, dd1, yyyy1] = left\n .split(\"/\")\n .map((x) => parseInt(x || \"0\", 10));\n const [mm2, dd2, yyyy2] = right\n .split(\"/\")\n .map((x) => parseInt(x || \"0\", 10));\n const sDate = new Date(yyyy1, mm1 - 1, dd1);\n const eDate = new Date(yyyy2, mm2 - 1, dd2);\n const sOk =\n isValidParts(yyyy1, mm1, dd1) && sDate.toString() !== \"Invalid Date\";\n const eOk =\n isValidParts(yyyy2, mm2, dd2) && eDate.toString() !== \"Invalid Date\";\n return { start: sOk ? sDate : null, end: eOk ? eDate : null };\n };\n\n // validity state shared with consumer when provided\n // Initialize to true to avoid showing validation errors before first blur\n const valid = args.externalValid ?? ref<boolean | undefined>(true);\n // Derived validity and reason\n const parsed = computed(() => parseFromRaw(raw.value));\n const clamped = computed(() => {\n const s = clampToMinMax(parsed.value.start);\n const e = clampToMinMax(parsed.value.end);\n return { start: s, end: e };\n });\n\n // Span in days between clamped start/end; undefined when incomplete or out-of-bounds\n const spanDays = computed<number | undefined>(() => {\n if (!maskComplete.value) return undefined;\n const s = clamped.value.start;\n const e = clamped.value.end;\n if (!s || !e) return undefined;\n const diffMs = Math.abs(toUtcMidnightMs(e) - toUtcMidnightMs(s));\n return Math.round(diffMs / 86400000 + 1); // NOTE: FEATHER-1155\n });\n\n // Set on first blur/clear; nothing is flagged before the user leaves the field\n const isTouched = ref(false);\n\n const reasonComputed = computed<string | undefined>(() => {\n if (!isTouched.value) return undefined;\n\n const { start, end } = parsed.value;\n if (!maskComplete.value) return \"incomplete\";\n if (!start || !end) return \"invalid-date\";\n if (!clamped.value.start || !clamped.value.end) return \"out-of-bounds\";\n const s = clamped.value.start;\n const e = clamped.value.end;\n if (!rangeIsOrdered(s, e)) return \"reversed-range\";\n if (typeof args.maxSpanDays === \"number\" && spanDays.value !== undefined) {\n if (spanDays.value > args.maxSpanDays) return \"span-exceeds-limit\";\n }\n return \"valid\";\n });\n\n const validComputed = computed<boolean | undefined>(() => {\n const r = reasonComputed.value;\n return r === undefined || r === \"valid\";\n });\n\n // User-facing validation message derived from the same live reason as validComputed\n const validationMessage = computed<string>(() => {\n const { min, max } = args;\n const r = reasonComputed.value;\n\n if (!r) return \"\";\n\n switch (r) {\n case \"incomplete\":\n return \"Required\";\n case \"invalid-date\":\n return \"One or both dates invalid.\";\n case \"reversed-range\":\n return \"End Date must be on or after Start Date.\";\n case \"out-of-bounds\":\n if (min && max) {\n return `Dates must be between ${formatDate(min)} and ${formatDate(max)}.`;\n }\n return \"Dates must be within the allowed range.\";\n case \"span-exceeds-limit\":\n return typeof args.maxSpanDays === \"number\"\n ? `Date range exceeds ${args.maxSpanDays} days.`\n : \"Date range exceeds maximum allowed span.\";\n case \"valid\":\n default:\n return \"\";\n }\n });\n // // Mirror computed validity into external ref when enabled\n // watch(\n // validComputed,\n // (v) => {\n // if (args.manageValid ?? true) {\n // valid.value = v;\n // }\n // },\n // { immediate: true },\n // );\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"]; // tracked to keep caret\n\n const fmt = (n: number, w: number) => String(n).padStart(w, \"0\");\n const formatDate = (d: Date) =>\n `${fmt(d.getMonth() + 1, 2)}/${fmt(d.getDate(), 2)}/${fmt(\n d.getFullYear(),\n 4,\n )}`;\n\n // rangeIsOrdered declared earlier\n\n const datePartForPos = (pos: number): { side: Side; part: Part } => {\n // Mask: 00/00/0000 - 00/00/0000\n // Index map (digits start at 0..9 for start, 13..22 for end)\n if (pos <= 2) return { side: \"start\", part: \"mm\" };\n if (pos <= 5) return { side: \"start\", part: pos <= 3 ? \"dd\" : \"dd\" };\n if (pos <= 11) return { side: \"start\", part: \"yyyy\" };\n if (pos <= 15) return { side: \"end\", part: \"mm\" };\n if (pos <= 18) return { side: \"end\", part: \"dd\" };\n return { side: \"end\", part: \"yyyy\" };\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n\n // Current parsed values\n const { start, end } = parseFromRaw(raw.value);\n\n // If SelectionRange is null/undefined (both sides missing), default to today and ignore the step\n if (!start && !end) {\n const today = new Date();\n const tStr = formatDate(today);\n raw.value = `${tStr} - ${tStr}`;\n args.onChange({ value: { start: today, end: today }, event });\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n return;\n }\n\n // Build baseline from user's parsed input; clamp only when emitting\n const today = new Date();\n\n const which = datePartForPos(pos);\n\n // Baseline dates: prefer parsed values (even if out-of-bounds); otherwise today\n let s = start ? new Date(start) : new Date(today);\n let e = end ? new Date(end) : new Date(today);\n\n const mutate = (d: Date, part: Part) => {\n if (part === \"mm\") {\n const m = d.getMonth() + 1;\n const next =\n direction === \"ArrowUp\" ? (m < 12 ? m + 1 : 1) : m > 1 ? m - 1 : 12;\n d.setMonth(next - 1);\n // Fix day overflow after month change\n const days = daysInMonth(d.getFullYear(), next);\n if (d.getDate() > days) d.setDate(days);\n } else if (part === \"dd\") {\n const days = daysInMonth(d.getFullYear(), d.getMonth() + 1);\n const day = d.getDate();\n const next =\n direction === \"ArrowUp\"\n ? day < days\n ? day + 1\n : 1\n : day > 1\n ? day - 1\n : days;\n d.setDate(next);\n } else if (part === \"yyyy\") {\n const y = d.getFullYear();\n d.setFullYear(direction === \"ArrowUp\" ? y + 1 : Math.max(1, y - 1));\n // Fix Feb 29 overflow, etc.\n const days = daysInMonth(d.getFullYear(), d.getMonth() + 1);\n if (d.getDate() > days) d.setDate(days);\n }\n };\n\n if (which.side === \"start\") mutate(s, which.part);\n else mutate(e, which.part);\n\n // Compose new raw string: keep the untouched side as-is from current raw if parseable\n const sText = formatDate(s);\n const eText = formatDate(e);\n raw.value = `${sText} - ${eText}`;\n\n // Emit if valid and ordered and within min/max; else null\n const sClamped = clampToMinMax(s);\n const eClamped = clampToMinMax(e);\n if (sClamped && eClamped && rangeIsOrdered(sClamped, eClamped)) {\n args.onChange({ value: { start: sClamped, end: eClamped }, event });\n } else {\n args.onChange({ value: null, event });\n }\n\n // Restore caret\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n };\n\n const emitParsedIfComplete = (event: any) => {\n const { start, end } = parseFromRaw(raw.value);\n if (!start || !end) {\n args.onChange({ value: null, event });\n return;\n }\n const sClamped = clampToMinMax(start);\n const eClamped = clampToMinMax(end);\n if (!sClamped || !eClamped) {\n args.onChange({ value: null, event });\n return;\n }\n if (!rangeIsOrdered(sClamped, eClamped)) {\n args.onChange({ value: null, event });\n return;\n }\n args.onChange({ value: { start: sClamped, end: eClamped }, event });\n };\n\n const handleChange = (event: any): void => {\n const newValue = (event.value ?? \"\") as string;\n const originalEvent = event.event as Event | undefined;\n\n // No clear event handler from Kendo...\n // Kendo's clear button sets the value to empty and raises change;\n // treat that as an explicit clear action.\n if (!newValue && originalEvent && (originalEvent as any).type === \"click\") {\n handleClear(originalEvent);\n return;\n }\n\n raw.value = newValue;\n const src = originalEvent?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n // Do not coerce user's input; only emit parsed range when complete and valid\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n // Space already opens calendar\n if (event.code === \"Space\" || event.key === \" \") {\n // Do not let Space modify the input; only open the calendar\n // Justified: Space opens the calendar popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n // Alt + ArrowDown: open calendar popup without changing the value via stepper\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the calendar popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n // Justified: ArrowUp/Down act as range-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n if (cursorKeys.includes(event.key) || steppers.includes(event.key)) {\n const src = event.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const applyBlurValidation = () => {\n isTouched.value = true;\n\n if (args.manageValid ?? true) {\n valid.value = validComputed.value;\n }\n };\n\n const handleBlur = (_event: FocusEvent): void => {\n applyBlurValidation();\n };\n\n const handleClear = (event?: Event): void => {\n raw.value = \"\";\n cursorPos.value = 0;\n\n // Emit cleared range to consumer\n args.onChange({ value: null, event });\n\n // Run the same validation flow as on blur\n applyBlurValidation();\n\n // Return focus to the masked input so the user can retype\n nextTick(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(0, 0);\n }\n });\n };\n\n // Sync external range into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n const start = newVal?.start ?? null;\n const end = newVal?.end ?? null;\n if (start && end) {\n raw.value = `${formatDate(start)} - ${formatDate(end)}`;\n // If the change originated from calendar and popup is open, request close\n if (\n args.isOpen?.value &&\n calendarChanged.value &&\n args.onRequestClose\n ) {\n const delay =\n typeof args.closeDelay === \"number\"\n ? args.closeDelay\n : (args.closeDelay?.value ?? 0);\n setTimeout(() => {\n args.onRequestClose?.();\n calendarChanged.value = false;\n applyBlurValidation();\n }, delay);\n }\n return;\n }\n // If external is null/invalid, keep current raw as-is to preserve user's typing\n },\n { immediate: true },\n );\n }\n\n const month1 = computed(() =>\n raw.value ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const day1 = computed(() =>\n raw.value ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const year1 = computed(() =>\n raw.value ? raw.value.substring(6, 10).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const month2 = computed(() =>\n raw.value ? raw.value.substring(13, 15).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const day2 = computed(() =>\n raw.value ? raw.value.substring(16, 18).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const year2 = computed(() =>\n raw.value ? raw.value.substring(19, 23).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n\n const debugLines = computed((): Array<{ label: string; value: string }> => {\n const { start, end } = parseFromRaw(raw.value);\n return [\n {\n label: \"Raw\",\n value: raw.value,\n },\n {\n label: \"Min Date\",\n value: `${args.min ? args.min.toDateString() : \"-\"}`,\n },\n {\n label: \"Max Date\",\n value: `${args.max ? args.max.toDateString() : \"-\"}`,\n },\n {\n label: \"Start\",\n value: `${String(month1.value).padStart(2, \"0\")} / ${String(\n day1.value,\n ).padStart(2, \"0\")} / ${String(year1.value).padStart(4, \"0\")}`,\n },\n {\n label: \"End\",\n value: `${String(month2.value).padStart(2, \"0\")} / ${String(\n day2.value,\n ).padStart(2, \"0\")} / ${String(year2.value).padStart(4, \"0\")}`,\n },\n { label: \"Digits only\", value: digitsOnly.value },\n { label: \"Mask complete\", value: `${maskComplete.value}` },\n {\n label: \"Parsed\",\n value: `${start ? start.toDateString() : \"-\"} | ${\n end ? end.toDateString() : \"-\"\n }`,\n },\n {\n label: \"Valid (managed)\",\n value: `${valid.value ?? \"-\"}`,\n },\n { label: \"Span (days)\", value: `${spanDays.value ?? \"-\"}` },\n {\n label: \"Reason\",\n value: `${reasonComputed.value ?? \"-\"}`,\n },\n {\n label: \"Cursor in\",\n value: `${cursorPos.value ?? \"-\"} (${(() => {\n const p = cursorPos.value ?? 0;\n const w = datePartForPos(p);\n return `${w.side}.${w.part}`;\n })()})`,\n },\n ];\n });\n\n const initStyling = () => {\n // Idempotent application of the `fk-daterangepicker` class to the input's parent\n nextTick(() => {\n const rangeInput = document.getElementById(args.id) as HTMLElement | null;\n if (!rangeInput) {\n console.warn(`#${args.id} not found for styling.`);\n return;\n }\n const parentDiv = rangeInput.closest(\"div\");\n if (!parentDiv) {\n console.warn(`Parent div of #${args.id} not found for styling.`);\n return;\n }\n if (parentDiv.classList.contains(\"fk-daterangepicker\")) return;\n parentDiv.classList.add(\"fk-daterangepicker\");\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n // Accessibility fix: ensure only one month grid has tabIndex=0\n const calendarMonthTabIndexFix = () => {\n nextTick(() => {\n try {\n const containers = Array.from(\n document.querySelectorAll(\".k-animation-container\"),\n ) as HTMLElement[];\n if (!containers.length) return;\n\n // Prefer the most recently added visible container that has a calendar\n const candidate = [...containers]\n .reverse()\n .find((c) => c.querySelector(\".k-calendar\"));\n const calendarRoot = candidate?.querySelector(\n \".k-calendar\",\n ) as HTMLElement | null;\n if (!calendarRoot) return;\n\n const months = calendarRoot.querySelectorAll(\n \".k-calendar-table\",\n ) as NodeListOf<HTMLElement>;\n let foundTab0 = false;\n months.forEach((m) => {\n if (m.tabIndex === 0) {\n if (!foundTab0) {\n foundTab0 = true;\n } else {\n m.tabIndex = -1;\n }\n }\n });\n } catch (e) {\n // no-op; defensive\n console.warn(e);\n }\n });\n };\n\n // When popup opens, run the fix after render\n if (args.isOpen) {\n watch(\n args.isOpen,\n (open) => {\n if (open) {\n // Allow popup DOM to mount first\n setTimeout(() => calendarMonthTabIndexFix(), 0);\n }\n },\n { immediate: false },\n );\n }\n\n return {\n raw,\n cursorPos,\n debugEnabled: debugEnabled,\n debugLines: debugLines,\n digitsOnly: digitsOnly,\n valid,\n validComputed: readonly(validComputed),\n reason: readonly(reasonComputed),\n validationMessage: readonly(validationMessage),\n spanDays: readonly(spanDays),\n month1: readonly(month1),\n day1: readonly(day1),\n year1: readonly(year1),\n month2: readonly(month2),\n day2: readonly(day2),\n year2: readonly(year2),\n handleChange,\n handleKeyDown,\n handleWheel,\n handleKeyUp,\n handleClick,\n handleBlur,\n handleClear,\n onCalendarChange: () => {\n calendarChanged.value = true;\n },\n initStyling,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\n\nexport type ChangePayload = { value: Date | null; event: any };\n\ntype PopupAction = \"now\" | \"set\" | null;\ntype AnyArgsHandler = (...args: unknown[]) => void;\n\nexport function useMaskedTimeInput(args: {\n id: string;\n onChange: (p: ChangePayload) => void;\n onShowPicker: (e: KeyboardEvent) => void;\n externalValue?: Ref<string | Date | null | undefined>;\n // Minute stepping granularity for ArrowUp/ArrowDown when focused in minutes.\n // Supported values: 1, 5, 10, 15, 20, 30. If not provided, defaults to 1-minute steps.\n minuteStep?: 1 | 5 | 10 | 15 | 20 | 30;\n // Reactive alternative: pass a Ref to allow dynamic updates at runtime.\n minuteStepRef?: Ref<1 | 5 | 10 | 15 | 20 | 30 | undefined>;\n timeFormat?: string;\n min?: Date | null | undefined;\n max?: Date | null | undefined;\n /** When true, empty/incomplete value is considered invalid after blur */\n required?: boolean;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const placeholder = ref<string>(args.timeFormat ?? \"hh:mm AM\");\n const isRequired = computed(() => !!args.required);\n const isTouched = ref(false);\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"];\n\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n\n // Mask rules to be used by MaskedTextBox\n // Relax numeric constraints: allow any digits, then validate afterwards\n const rules = {\n H: /[0-9]/,\n h: /[0-9]/,\n M: /[0-9]/,\n m: /[0-9]/,\n A: /[AaPp]/,\n a: /[Mm]/,\n } as const;\n\n const partAt = (pos: number) => {\n if (pos <= 2) return \"hh\"; // hours\n if (pos <= 5) return \"mm\"; // minutes\n return \"ampm\"; // AM/PM\n };\n\n const hour = computed(() => {\n const h = raw.value\n ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n const v = parseInt(h);\n return Math.min(Math.max(v, 0), 23); // keep as 0-23 for parsing convenience\n });\n const minute = computed(() => {\n const m = raw.value\n ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n const v = parseInt(m);\n return Math.min(Math.max(v, 0), 59);\n });\n const period = computed(() => {\n const p = (raw.value?.substring(6, 8) || \"AM\").toUpperCase();\n return p.startsWith(\"P\") ? \"PM\" : \"AM\";\n });\n\n const hour24 = computed(() => {\n const h12 = parseInt(raw.value?.substring(0, 2).replace(/\\D/g, \"0\") || \"0\");\n const p = period.value;\n\n // Convert 12-hour to 24-hour format\n if (h12 === 12) {\n return p === \"AM\" ? 0 : 12;\n }\n return p === \"PM\" ? h12 + 12 : h12;\n });\n\n const time24 = computed(() => {\n if (!isComplete.value) return null;\n return `${String(hour24.value).padStart(2, \"0\")}:${String(minute.value).padStart(2, \"0\")}:00`;\n });\n\n const isComplete = computed(() =>\n /^(\\d{2}):(\\d{2})\\s([AP]M)$/i.test(raw.value ?? \"\"),\n );\n\n const toDisplay = (h24: number, m: number, ap: \"AM\" | \"PM\") => {\n // display uses 12-hour formatting in the field\n let h12 = h24 % 12;\n if (h12 === 0) h12 = 12;\n return `${String(h12).padStart(2, \"0\")}:${String(m).padStart(\n 2,\n \"0\",\n )} ${ap}`;\n };\n\n const toDateFromDisplay = (display: string) => {\n const match = display.match(/^(\\d{2}):(\\d{2})\\s([AP]M)$/i);\n if (!match) return null;\n const hh = parseInt(match[1]);\n const mm = parseInt(match[2]);\n const ap = match[3].toUpperCase();\n // Enforce 12-hour bounds and minute bounds; reject invalid formats like 99:99 AM\n if (hh < 1 || hh > 12 || mm < 0 || mm > 59) return null;\n let h24 = hh % 12;\n if (ap === \"PM\") h24 += 12;\n const d = new Date();\n d.setSeconds(0, 0);\n d.setHours(h24);\n d.setMinutes(mm);\n return d;\n };\n\n const emitParsedIfComplete = (event: any) => {\n if (digitsOnly.value.length === 0) {\n args.onChange({ value: null, event });\n return;\n }\n if (!isComplete.value) {\n args.onChange({ value: null, event });\n return;\n }\n const date = toDateFromDisplay(raw.value);\n if (date && inRangeTime(date)) {\n args.onChange({ value: date, event });\n } else {\n args.onChange({ value: null, event });\n }\n };\n const minutesSinceMidnight = (d: Date) => d.getHours() * 60 + d.getMinutes();\n const inRangeTime = (d: Date) => {\n const min = args.min ?? undefined;\n const max = args.max ?? undefined;\n const m = minutesSinceMidnight(d);\n if (min) {\n const minM = minutesSinceMidnight(min);\n if (m < minM) return false;\n }\n if (max) {\n const maxM = minutesSinceMidnight(max);\n if (m > maxM) return false;\n }\n return true;\n };\n\n const syncRawFromDate = (date: Date) => {\n const h24 = date.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, date.getMinutes(), ap);\n };\n\n const emitValue = (value: Date | null, event: any) => {\n args.onChange({ value, event });\n };\n\n const focusInputAfterPopupClose = () => {\n // Defer focus long enough for the popup close lifecycle to complete.\n nextTick(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n const end = (inputEl.value ?? \"\").length;\n inputEl.setSelectionRange(end, end);\n }\n });\n });\n });\n };\n\n const inferPopupAction = (event: any): PopupAction => {\n const target = event?.event?.target as HTMLElement | null | undefined;\n if (!target) return null;\n if (target.closest(\".k-time-now\")) return \"now\";\n if (target.closest(\".k-time-accept\")) return \"set\";\n return null;\n };\n\n const emitParsedDate = (date: Date | null, event: any) => {\n if (date && inRangeTime(date)) {\n emitValue(date, event);\n } else {\n emitValue(null, event);\n }\n };\n\n const handleChange: AnyArgsHandler = (...eventArgs) => {\n const event = eventArgs[0] as any;\n if (!event) return;\n\n const action = inferPopupAction(event);\n\n // TimePicker popup path: distinguish NOW vs SET and normalize value handling.\n if (action === \"now\") {\n const now = new Date();\n syncRawFromDate(now);\n emitParsedDate(now, event);\n focusInputAfterPopupClose();\n return;\n }\n\n if (event?.value instanceof Date) {\n const nextValue = new Date(event.value);\n syncRawFromDate(nextValue);\n emitParsedDate(nextValue, event);\n if (action === \"set\") {\n focusInputAfterPopupClose();\n }\n return;\n }\n\n if (event?.value === null) {\n raw.value = \"\";\n emitValue(null, event);\n return;\n }\n\n // Set raw first from event\n raw.value = event.value as string;\n const src = event.event?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n // If caret is in AM/PM segment and user typed A/a or P/p, auto-complete to AM/PM\n try {\n const pos = cursorPos.value ?? 0;\n if (partAt(pos) === \"ampm\" && (raw.value ?? \"\").length >= 8) {\n const first = raw.value.charAt(6);\n if (/[Aa]/.test(first)) {\n raw.value = `${raw.value.slice(0, 6)}AM${raw.value.slice(8)}`;\n // Move caret to end of AM/PM\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(8, 8);\n }\n });\n });\n } else if (/[Pp]/.test(first)) {\n raw.value = `${raw.value.slice(0, 6)}PM${raw.value.slice(8)}`;\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(8, 8);\n }\n });\n });\n }\n }\n } catch {}\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n const part = partAt(pos);\n\n const dispMatch = (raw.value ?? \"\").match(/^(\\d{2}):(\\d{2})\\s([AP]M)$/i);\n if (!dispMatch) {\n // If empty, initialize to current time on first step\n if ((raw.value ?? \"\").length === 0 || digitsOnly.value.length === 0) {\n const now = new Date();\n const h24 = now.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, now.getMinutes(), ap);\n const date = toDateFromDisplay(raw.value);\n emitParsedDate(date, event);\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n }\n // For non-empty but invalid formats, do not auto-correct\n return;\n }\n let hh = parseInt(dispMatch[1]);\n let mm = parseInt(dispMatch[2]);\n let ap = dispMatch[3].toUpperCase() as \"AM\" | \"PM\";\n\n if (part === \"hh\") {\n if (direction === \"ArrowUp\") hh = hh < 12 ? hh + 1 : 1;\n else hh = hh > 1 ? hh - 1 : 12;\n } else if (part === \"mm\") {\n const step = args.minuteStepRef?.value ?? args.minuteStep ?? 1;\n if (step === 1) {\n if (direction === \"ArrowUp\") mm = mm < 59 ? mm + 1 : 0;\n else mm = mm > 0 ? mm - 1 : 59;\n } else {\n if (direction === \"ArrowUp\") {\n const rem = mm % step;\n let next = rem === 0 ? mm + step : mm + (step - rem);\n if (next >= 60) next = 0; // wrap to top of hour\n mm = next;\n } else {\n const rem = mm % step;\n let prev = rem === 0 ? mm - step : mm - rem;\n if (prev < 0) prev = 60 - step; // wrap to last step in hour\n mm = prev;\n }\n }\n } else if (part === \"ampm\") {\n ap = ap === \"AM\" ? \"PM\" : \"AM\";\n }\n\n raw.value = `${String(hh).padStart(2, \"0\")}:${String(mm).padStart(\n 2,\n \"0\",\n )} ${ap}`;\n const date = toDateFromDisplay(raw.value);\n emitParsedDate(date, event);\n\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.code === \"Space\" || event.key === \" \") {\n // Open the picker without modifying the input\n // Justified: Space opens the time picker popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowPicker(event);\n return;\n }\n\n // Alt+Down opens the picker; allow other Alt+arrow combinations to pass through\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the time picker popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowPicker(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n // Justified: ArrowUp/Down act as time-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Map mouse wheel to stepper behavior (up/down) based on caret segment\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n const src = event.target as HTMLInputElement;\n if (cursorKeys.includes(event.key)) {\n // Do not prevent default for caret navigation\n cursorPos.value = src?.selectionStart ?? 0;\n return;\n }\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const handleBlur = (event: FocusEvent): void => {\n isTouched.value = true;\n\n // If required and value is still undefined/blank, coerce external\n // value from undefined -> \"\" so downstream validation can treat\n // this as an incomplete required field.\n if (\n isRequired.value &&\n args.externalValue &&\n args.externalValue.value === undefined &&\n digitsOnly.value.length === 0\n ) {\n (args.externalValue as Ref<any>).value = \"\";\n }\n\n const src = event.target as HTMLInputElement | null;\n if (src) {\n cursorPos.value = src.selectionStart ?? 0;\n }\n };\n\n // Sync external value into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n if (newVal) {\n const date = new Date(newVal as any);\n if (date.toString() !== \"Invalid Date\") {\n const h24 = date.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, date.getMinutes(), ap);\n return;\n }\n }\n // If external value is null/invalid, keep current raw as-is\n },\n { immediate: true },\n );\n }\n\n const debugLines = computed(() => {\n return [\n [\"Time\", raw.value || \"--:-- --\"],\n [\"Hour (12h)\", hour.value],\n [\"Hour (24h)\", hour24.value],\n [\"Minute\", minute.value],\n [\"Period\", period.value],\n [\"Time (24h)\", time24.value ?? \"--:--:--\"],\n [\"Digits only\", digitsOnly.value],\n [\n \"Parsed Date\",\n parsedRawTime.value?.toLocaleDateString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\n \"min\",\n args.min?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\n \"max\",\n args.max?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\"valid\", isValid.value],\n [\"reason\", reason.value],\n [\"validationMessage\", validationMessage.value],\n ];\n });\n\n // Validation based on completeness and parse-ability\n const parsedRawTime = computed<Date | null>(\n () => toDateFromDisplay(raw.value) ?? null,\n );\n const isValid = computed(() => {\n // Optional field preserves forgiving behavior\n if (!isRequired.value) {\n if (!isComplete.value) return true;\n const t = parsedRawTime.value;\n if (!t) return false;\n return inRangeTime(t);\n }\n\n // Required field: do not flag invalid until after blur\n if (!isTouched.value) return true;\n\n const t = parsedRawTime.value;\n if (!isComplete.value) return false;\n if (!t) return false;\n return inRangeTime(t);\n });\n\n const reason = computed<string | undefined>(() => {\n // Optional: only report reasons for completed-but-bad values\n if (!isRequired.value) {\n if (!isComplete.value) return undefined;\n const t = parsedRawTime.value;\n if (!t) return \"invalid-time\";\n if (!inRangeTime(t)) return \"out-of-bounds\";\n return \"valid\";\n }\n\n // Required: only validate after blur\n if (!isTouched.value) return undefined;\n\n if (digitsOnly.value.length === 0 || !isComplete.value) {\n return \"incomplete\";\n }\n\n const t = parsedRawTime.value;\n if (!t) return \"invalid-time\";\n if (!inRangeTime(t)) return \"out-of-bounds\";\n return \"valid\";\n });\n\n const validationMessage = computed(() => {\n const r = reason.value;\n if (!r || r === \"valid\") return \"\";\n\n if (r === \"incomplete\") {\n return \"Required\";\n }\n\n if (r === \"invalid-time\") {\n return `Must be in ${placeholder.value} format.`;\n }\n\n const opts: Intl.DateTimeFormatOptions = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n const minStr = args.min ? args.min.toLocaleTimeString(\"en-US\", opts) : null;\n const maxStr = args.max ? args.max.toLocaleTimeString(\"en-US\", opts) : null;\n if (r === \"out-of-bounds\") {\n if (minStr && maxStr) return `Must be between ${minStr} and ${maxStr}.`;\n if (minStr) return `Must be ${minStr} or later.`;\n if (maxStr) return `Must be ${maxStr} or earlier.`;\n }\n\n return \"\";\n });\n\n const initStyling = () => {\n // Idempotent application of the `fk-timepicker` class to the time picker's parent\n nextTick(() => {\n const inputEl = document.getElementById(args.id) as HTMLElement | null;\n if (!inputEl) {\n console.warn(`#${args.id} not found for styling.`);\n return;\n }\n const timePicker = inputEl.closest(\".k-timepicker\");\n if (!timePicker) {\n console.warn(\n `.k-timepicker parent of #${args.id} not found for styling.`,\n );\n return;\n }\n const parent = timePicker.parentElement;\n if (!parent) {\n console.warn(\n `Parent of .k-timepicker not found for #${args.id} styling.`,\n );\n return;\n }\n if (parent.classList.contains(\"fk-timepicker\")) return;\n parent.classList.add(\"fk-timepicker\");\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n return {\n raw,\n rules,\n debugEnabled,\n debugLines,\n placeholder,\n isValid,\n reason: readonly(reason),\n validationMessage,\n isComplete,\n inRangeTime,\n cursorPos,\n hour: readonly(hour),\n hour24: readonly(hour24),\n minute: readonly(minute),\n period: readonly(period),\n time24: readonly(time24),\n parsedRawTime: readonly(parsedRawTime),\n handleChange,\n handleKeyDown,\n handleKeyUp,\n handleClick,\n handleWheel,\n handleBlur,\n // Expose so consumers can reapply theming when Kendo updates DOM\n initStyling,\n };\n}\n","import { nextTick, readonly, ref, shallowRef, watch, type Ref } from \"vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { onClickOutside } from \"@vueuse/core\";\n\nexport type CloseReason = \"escape\" | \"outside\";\nexport type InitialFocus =\n | string\n | ((root: HTMLElement) => HTMLElement | null | undefined);\n\n/**\n * Focus-restoration options for pairing `usePopupTrap` with `usePopupMenu`.\n *\n * `usePopupMenu` owns menu-close focus restoration. These settings disable\n * both competing restoration paths in `usePopupTrap` and the underlying\n * `focus-trap` implementation. Spread this preset last so those integration\n * settings take precedence.\n */\nexport const POPUP_MENU_TRAP_OPTIONS = {\n returnFocusToTrigger: false,\n focusTrapOptions: {\n returnFocusOnDeactivate: false,\n },\n} as const;\n\nexport function usePopupTrap(opts: {\n isOpen: Ref<boolean>;\n onRequestClose?: (reason: CloseReason, ev?: Event) => void;\n popupSelector?: string | string[];\n triggerEl?: Ref<HTMLElement | null>;\n resolvePopupEl?: () => HTMLElement | null;\n initialFocus?: InitialFocus;\n focusTrapOptions?: Parameters<typeof useFocusTrap>[1];\n returnFocusToTrigger?: boolean;\n}) {\n const popupRef = shallowRef<HTMLElement | null>(null);\n\n const defaultSelectors = [\n \".k-animation-container .k-popup\",\n \".k-popup\",\n \".k-timepicker-popup\",\n \".k-menu-popup\",\n ];\n\n const selectors = Array.isArray(opts.popupSelector)\n ? opts.popupSelector\n : [opts.popupSelector ?? defaultSelectors].flat();\n\n const pickInitialFocus = (root: HTMLElement) => {\n if (!root) return null as unknown as HTMLElement;\n if (typeof opts.initialFocus === \"string\") {\n const found = root.querySelector(opts.initialFocus) as HTMLElement | null;\n return found ?? root;\n }\n if (typeof opts.initialFocus === \"function\") {\n return (opts.initialFocus(root) as HTMLElement | null) ?? root;\n }\n const candidate = root.querySelector(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ) as HTMLElement | null;\n return candidate ?? root;\n };\n\n const { activate, deactivate } = useFocusTrap(popupRef, {\n escapeDeactivates: false,\n clickOutsideDeactivates: false,\n // Without this, focus-trap's own default (false) preventDefault()s and\n // swallows every outside pointerdown/click while active - not just ones\n // that would close it - blocking interaction with anything else on the\n // page (e.g. another trigger in the same row) until the trap deactivates.\n allowOutsideClick: true,\n fallbackFocus: () => popupRef.value as HTMLElement,\n initialFocus: () => pickInitialFocus(popupRef.value as HTMLElement),\n ...(opts.focusTrapOptions ?? {}),\n });\n\n let escapeHandler: ((e: KeyboardEvent) => void) | null = null;\n let lastCloseReason = ref<CloseReason | null>(null);\n\n const findPopup = (): HTMLElement | null => {\n if (opts.resolvePopupEl) return opts.resolvePopupEl();\n\n const pickLastVisible = (root: ParentNode, sel: string) => {\n const list = Array.from(root.querySelectorAll(sel)) as HTMLElement[];\n if (!list.length) return null as HTMLElement | null;\n const visible = list.filter(\n (el) => el.offsetParent !== null || el.getClientRects().length > 0,\n );\n return visible[visible.length - 1] ?? list[list.length - 1] ?? null;\n };\n\n const scopeRoot =\n opts.triggerEl?.value?.closest?.(\".k-animation-container\") ??\n document.body;\n\n for (const sel of selectors) {\n const el = pickLastVisible(scopeRoot, sel);\n if (el) return el;\n }\n\n for (const sel of selectors) {\n const el = pickLastVisible(document, sel);\n if (el) return el;\n }\n\n return null;\n };\n\n onClickOutside(popupRef, (e) => {\n lastCloseReason.value = \"outside\";\n if (opts.isOpen.value) {\n opts.onRequestClose?.(\"outside\", e);\n }\n });\n\n watch(\n () => opts.isOpen.value,\n (open) => {\n if (open) {\n // Reset on open so the previous reason remains visible while closed\n lastCloseReason.value = null;\n nextTick(() => {\n const popup = findPopup();\n if (!popup) return;\n // Guarantees a valid fallback/initial focus target even when no\n // descendant is currently tabbable (e.g. Kendo Menu items only gain\n // a live tabindex via its own roving-tabindex JS on interaction) -\n // without this, focus-trap's activate() throws and silently no-ops,\n // leaving Tab to escape the popup entirely.\n if (popup.tabIndex < 0) popup.tabIndex = -1;\n popupRef.value = popup;\n setTimeout(() => {\n try {\n activate();\n } catch (error) {\n console.warn(\n \"usePopupTrap: focus trap failed to activate\",\n error,\n );\n }\n }, 0);\n\n if (!escapeHandler) {\n escapeHandler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n lastCloseReason.value = \"escape\";\n if (opts.isOpen.value) {\n opts.onRequestClose?.(\"escape\", e);\n }\n }\n };\n // Capture on document to catch Escape even when focus\n // stays on the trigger (e.g., TimeInput masked field).\n document.addEventListener(\"keydown\", escapeHandler, true);\n }\n });\n } else {\n deactivate();\n if (escapeHandler) {\n document.removeEventListener(\"keydown\", escapeHandler, true);\n escapeHandler = null;\n }\n popupRef.value = null;\n\n // On outside close, ensure trigger/input is not focused\n if (lastCloseReason.value === \"outside\") {\n nextTick(() => {\n const doBlur = () => {\n const root = opts.triggerEl?.value as HTMLElement | null;\n const input = root?.querySelector(\"input\") as HTMLElement | null;\n const active = document.activeElement as HTMLElement | null;\n // Only blur if focus is still on the trigger/input to avoid interfering\n if (\n active &&\n (active === input || (root && root.contains(active)))\n ) {\n (input ?? root)?.blur?.();\n }\n };\n requestAnimationFrame(() => setTimeout(doBlur, 0));\n });\n }\n\n if (\n opts.returnFocusToTrigger !== false &&\n lastCloseReason.value === \"escape\"\n ) {\n if (opts.triggerEl?.value) {\n // Schedule after Vue updates and after event/click propagation\n nextTick(() => {\n const doFocus = () => {\n const root = opts.triggerEl?.value as HTMLElement | null;\n if (!root) return;\n const input = root.querySelector(\"input\") as HTMLElement | null;\n const target = (input ?? root) as HTMLElement | null;\n target?.focus?.();\n };\n requestAnimationFrame(() => setTimeout(doFocus, 0));\n });\n }\n }\n }\n },\n );\n\n return {\n popupRef,\n activate,\n deactivate,\n lastCloseReason: readonly(lastCloseReason),\n setPopupEl: (el: HTMLElement | null) => (popupRef.value = el),\n };\n}\n"],"names":["useGridA11y","gridRef","options","activeFilterButton","ref","a11yInitialized","mutationsObserver","rowObserver","headerThTeardownCallbacks","intraRowNavigationSelector","getGridRootElement","host","isWithinThisGridScope","target","gridRoot","ariaRoot","fallbackScope","isEnterActivation","event","getColumns","handleFilterButtonKeyboardListener","key","handleFilterMenuKeyboardListener","menuItems","filterContainer","defaultFocusable","focusableSelectors","focusableElements","focusedIndex","el","targetIndex","item","currentTh","setupFilterMenuObserver","mutations","mutation","node","element","column","nextTick","wrapper","tryFocusMenuItem","container","isFormControl","tagName","handleGridKeyDown","e","row","isIntraRowHorizontalNavKey","focusedRow","r","findSiblingRow","start","direction","sib","targetRow","tabbable","currentIndex","setupGridStyling","gridHost","gridElement","setupTrNavigation","ensureSingleTabindex","rows","err","index","tbody","error","setupFilterButtonAccessibility","filterButtons","setupHeaderThTriggers","cleanupGridA11y","teardown","th","btn","columns","field","filterable","sortable","openMenu","clickHandler","columnLink","keyHandler","thead","theadKeyboardHandler","handleSortChange","customHandler","menuOpened","menuItemSelected","fieldIsSortable","c","s","initA11y","onBeforeUnmount","isCompositeFilter","filterItem","isFilterDescriptor","hasFieldFilterRecursive","child","useGridActiveFilter","filterRef","f","DEFAULT_IGNORE_SELECTORS","useGridRowAction","onRowAction","dataItems","ignoreSelectors","shouldIgnoreTarget","enableKeyboardAction","combinedIgnoreSelectors","isIgnoredTarget","selectorString","resolveRowIndex","attr","parsed","getEventCoordinates","nativeEvent","scrollX","scrollY","screenX","screenY","getElementCoordinates","rect","clientX","clientY","hasTextSelection","selection","anchorParent","focusParent","isAnchorInside","isFocusInside","context","explicitDataItem","rowEl","rowIndexAttr","rowIndex","resolvedDataItem","itemsList","DEFAULT_ZIP_ERROR_MESSAGE","formatZipDisplay","input","digits","countDigitsBeforeIndex","value","digitIndexToDisplayIndex","digitIndex","useZipTextBox","zipDisplay","submitted","errorMessage","zipRaw","computed","isZipValid","length","showZipError","textBoxValid","textBoxValidate","restoreCaret","inputElement","caretIndex","args","nextValue","inputValue","opts","valid","useFieldsetTouchTracker","fieldsetRef","touched","watchEffect","onFocusout","fieldset","next","reset","useFieldsetValidationKit","suppressNextTouch","fieldsetValidate","toValue","fieldsetIsValid","tracker","createFieldValidity","isValid","createFieldValidationsMap","isValidMap","focusFirstInvalidField","formRef","form","US_STATES_BY_ABBREVIATION","readInputValue","payload","useUSAddressFormData","formData","reactive","useUSAddressZip","zipInputId","zipField","zipWrapperClass","onZipInput","watch","useUSAddressValidation","strictAddress1Valid","strictCityValid","strictStateValid","strictZipValid","strictAddressValid","focusFirstInvalid","focusoutLeavesFieldset","useUSAddress","optionalFeedbackReviewed","isRequired","onAddress1Input","onAddress2Input","onCityInput","onStateChange","resetFormData","resetZip","validationKit","fieldValidations","rawAddress1Valid","rawCityValid","rawStateValid","rawZipValid","rawAddressValid","addressValidate","address1Valid","cityValid","stateValid","zipValid","addressValid","stateDefaultItem","stateOptions","label","normalizedPayload","isAddressEmpty","optionalAddressHasAnyInput","optionalMissingRequiredFields","optionalZipInvalid","zipDigits","optionalPartialInvalid","optionalFeedbackActive","required","leftFieldset","flipHorizontal","horizontal","flipVertical","vertical","computeCorner","anchor","popup","anchorAlign","popupAlign","anchorX","anchorY","popupOffsetX","popupOffsetY","fitAxis","position","size","end","computeCollisionOffset","bounds","collision","preferred","left","top","overflowsRight","overflowsLeft","flipped","currentOverflow","overflowsBottom","overflowsTop","useCompositeId","prefix","instanceId","useId","parts","part","isClient","toString","isObject","val","noop","toArray","watchImmediate","source","cb","defaultWindow","unrefElement","elRef","_$el","plain","useEventListener","register","listener","firstParamTargets","test","_firstParamTargets$va","_firstParamTargets$va2","unref","raw_targets","raw_events","raw_listeners","raw_options","_","onCleanup","optionsClone","cleanups","fn","onClickOutside","handler","window","ignore","capture","detectIframe","controls","shouldListen","shouldIgnore","hasMultipleRoots","vm","checkMultipleRoots","children","isProcessingClick","cleanup","activeEl","stop","useIntersectionObserver","observer","disconnect","root","entry","onUnmounted","DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR","resolveElement","componentElement","isManagedTrigger","triggerMode","warnMismatchedTrigger","findScrollableAncestor","parent","styledFallback","overflow","overflowX","overflowY","scrollsX","scrollsY","usePopupMenu","popupCloseReason","menuItemSelector","anchorOptions","activationPointOptions","anchorRect","shallowRef","anchorActivation","popupRect","resolveTriggerElement","triggerEl","anchorObserverTarget","getOffsetBounds","clip","offset","corner","resolveConfiguredFocusTarget","explicitTarget","setAnchorActivation","trigger","activation","triggerElement","triggerRect","keyboardPosition","verticalPosition","y","resolveEscapeFallbackTarget","selector","focusConfiguredTargetOrTrigger","focusFirstEnabledMenuItem","pendingFocusTarget","pendingTrigger","suppressNextTriggerClick","restorePendingFocus","reason","closePopup","syncManagedTrigger","animationFrame","measure","scheduleMeasure","resolvePopupContentElement","content","open","_prev","contentElement","previousTrigger","previousMenubar","demoteManagedTrigger","syncMenuLabel","menuElement","menubar","handleTriggerClick","onAction","useExclusiveGroup","members","member","activeMember","resolveRegisteredElement","useActiveIdRegistry","registry","shallowReactive","activeId","id","resolve","activate","deactivate","isIdActive","readonly","WINDOW_SETTINGS_DEFAULTS","isWindowStage","calculateInitialLeft","viewportWidth","windowWidth","rightInset","useWindow","isRef","settings","windowRef","visible","stage","isDragging","isResizing","initialLeft","initialTop","openOptions","hasStoredPosition","rootFontSize","padding","viewportLeft","viewportTop","closeWindow","handleStageChange","requestedStage","handleMove","windowRoot","titlebarRect","titlebarWidth","titlebarHeight","viewportRight","viewportBottom","maximumLeft","maximumTop","handleResize","handlePointerDown","handleTitlebarDoubleClick","removePointerDownListener","removeTitlebarDoubleClickListener","removePointerDownWatcher","removeTitlebarDoubleClickWatcher","instance","onScopeDispose","windowClass","classes","props","useMaskedDateInput","raw","cursorPos","debugEnabled","placeholder","MIN_YEAR","isTouched","steppers","cursorKeys","digitsOnly","datePart","pos","month","m","day","d","year","emitParsedIfComplete","mmStr","ddStr","yyyyStr","mm","dd","yyyy","isValidParts","createDate","inRange","min","max","parsedRawDate","isComplete","yy","date","daysInMonth","handleChange","src","handleClick","applyStep","sourceEl","today","setDate","focusAndRestore","days","steppedDate","handleKeyDown","handleWheel","handleKeyUp","handleBlur","run","inputEl","p","newVal","debugLines","candidate","validationMessage","minStr","maxStr","initStyling","datePicker","onMounted","useMaskedDateRangeInput","calendarChanged","ONE_DAY","ONE_YEAR","TODAY","MIN_DATE","MAX_DATE","toUtcMidnightMs","clampToMinMax","dMs","rangeIsOrdered","maskComplete","parseFromRaw","right","mm1","dd1","yyyy1","x","mm2","dd2","yyyy2","sDate","eDate","sOk","eOk","clamped","spanDays","diffMs","reasonComputed","validComputed","formatDate","fmt","n","w","datePartForPos","tStr","which","mutate","sText","eText","sClamped","eClamped","newValue","originalEvent","handleClear","applyBlurValidation","_event","delay","month1","day1","year1","month2","day2","year2","rangeInput","parentDiv","calendarMonthTabIndexFix","containers","calendarRoot","months","foundTab0","useMaskedTimeInput","rules","partAt","hour","h","v","minute","period","hour24","h12","time24","toDisplay","h24","ap","toDateFromDisplay","display","match","hh","inRangeTime","minutesSinceMidnight","minM","maxM","syncRawFromDate","emitValue","focusInputAfterPopupClose","inferPopupAction","emitParsedDate","eventArgs","action","now","first","dispMatch","step","rem","prev","parsedRawTime","t","timePicker","POPUP_MENU_TRAP_OPTIONS","usePopupTrap","popupRef","defaultSelectors","selectors","pickInitialFocus","useFocusTrap","escapeHandler","lastCloseReason","findPopup","pickLastVisible","sel","list","scopeRoot","doBlur","active","doFocus"],"mappings":"4WAcO,MAAMA,GAAc,CACzBC,EACAC,IACG,CAEH,MAAMC,EAAqBC,EAAAA,IAAwB,IAAI,EAEvD,IAAIC,EAAkB,GAGlBC,EAA6C,KAG7CC,EAAuC,KAE3C,MAAMC,EAA+C,CAAA,EAE/CC,EACJ,+CAEIC,EAAqB,IAA0B,CACnD,MAAMC,EAAOV,GAAS,OAAO,IAC7B,OAAKU,EACEA,EAAK,QAAQ,SAAS,EADX,IAEpB,EAEMC,EAAyBC,GAAiC,CAC9D,MAAMC,EAAWJ,EAAA,EACjB,GAAI,CAACI,EAAU,MAAO,GAGtB,MAAMC,EAAWF,EAAO,QAAQ,mBAAmB,EACnD,GAAIE,EACF,OAAOD,EAAS,SAASC,CAAQ,EAInC,MAAMC,EAAgBH,EAAO,QAC3B,yDAAA,EAEF,OAAOG,EAAgBF,EAAS,SAASE,CAAa,EAAI,EAC5D,EAEMC,EAAqBC,GAEvBA,EAAM,MAAQ,SACdA,EAAM,OAAS,SACfA,EAAM,OAAS,cAKbC,EAAa,IACTlB,GAAS,OAAe,QA6B5BmB,EAAsCF,GAAyB,CACnE,MAAMG,EAAMH,EAAM,KAAOA,EAAM,MAC3B,CAAC,IAAK,WAAY,OAAO,EAAE,SAASG,CAAG,GAAKJ,EAAkBC,CAAK,KAErEA,EAAM,eAAA,EACNA,EAAM,gBAAA,EAGNf,EAAmB,MAAQe,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AA,SAAS,IAAM,CACb,MAAMglB,EAAS,IAAM,CACnB,MAAMhT,EAAOpK,EAAK,WAAW,MACvBvB,EAAQ2L,GAAM,cAAc,OAAO,EACnCiT,EAAS,SAAS,cAGtBA,IACCA,IAAW5e,GAAU2L,GAAQA,EAAK,SAASiT,CAAM,KAEjD5e,GAAS2L,IAAO,OAAA,CAErB,EACA,sBAAsB,IAAM,WAAWgT,EAAQ,CAAC,CAAC,CACnD,CAAC,EAIDpd,EAAK,uBAAyB,IAC9B8c,EAAgB,QAAU,UAEtB9c,EAAK,WAAW,OAElB5H,EAAAA,SAAS,IAAM,CACb,MAAMklB,EAAU,IAAM,CACpB,MAAMlT,EAAOpK,EAAK,WAAW,MAC7B,GAAI,CAACoK,EAAM,QACGA,EAAK,cAAc,OAAO,GACfA,IACjB,QAAA,CACV,EACA,sBAAsB,IAAM,WAAWkT,EAAS,CAAC,CAAC,CACpD,CAAC,EAIT,CAAA,EAGK,CACL,SAAAd,EACA,SAAAnN,EACA,WAAAC,EACA,gBAAiBE,EAAAA,SAASsN,CAAe,EACzC,WAAaplB,GAA4B8kB,EAAS,MAAQ9kB,CAAA,CAE9D","x_google_ignoreList":[13,14]}
1
+ {"version":3,"file":"featherk-composables.umd.js","sources":["../src/grid/useGridA11y.ts","../src/grid/useGridActiveFilter.ts","../src/grid/useGridRowAction.ts","../src/address/useZipTextBox.ts","../src/form/useFieldsetTouchTracker.ts","../src/form/useFieldsetValidationKit.ts","../src/address/usStates.ts","../src/address/_useUSAddressFormData.ts","../src/address/_useUSAddressZip.ts","../src/address/_useUSAddressValidation.ts","../src/address/useUSAddress.ts","../src/geometry/computeCollisionOffset.ts","../src/id/useCompositeId.ts","../../../node_modules/@vueuse/shared/dist/index.js","../../../node_modules/@vueuse/core/dist/index.js","../src/observer/useIntersectionObserver.ts","../src/menu/usePopupMenu.ts","../src/registry/useExclusiveGroup.ts","../src/registry/useActiveIdRegistry.ts","../src/window/useWindow.ts","../src/date/useMaskedDateInput.ts","../src/range/useMaskedDateRangeInput.ts","../src/time/useMaskedTimeInput.ts","../src/trap/usePopupTrap.ts"],"sourcesContent":["/**\n * useGridA11y\n *\n * Composable that augments a Kendo-based grid with accessible keyboard navigation,\n * focus management, and custom behaviors for column header menus (filter/sort).\n */\n\nimport { ref, nextTick, onBeforeUnmount, type Ref } from \"vue\";\nimport type {\n SortDescriptor,\n GridColumnProps,\n GridSortChangeEvent,\n} from \"../types/kendo\";\n\nexport const useGridA11y = (\n gridRef: Ref<any>,\n options?: { focusableMenuSelectors?: string[] },\n) => {\n // Reference to the active filter button for focus management\n const activeFilterButton = ref<HTMLElement | null>(null);\n\n let a11yInitialized = false;\n\n // Mutation observer for dynamic elements\n let mutationsObserver: MutationObserver | null = null;\n\n // Observer to watch row changes within this grid instance so we can reassert tabindex\n let rowObserver: MutationObserver | null = null;\n\n const headerThTeardownCallbacks: Array<() => void> = [];\n\n const intraRowNavigationSelector =\n \".k-table-row[data-grid-row-index] [tabindex]\";\n\n const getGridRootElement = (): HTMLElement | null => {\n const host = gridRef?.value?.$el as HTMLElement | undefined;\n if (!host) return null;\n return host.closest(\".k-grid\") as HTMLElement | null;\n };\n\n const isWithinThisGridScope = (target: HTMLElement): boolean => {\n const gridRoot = getGridRootElement();\n if (!gridRoot) return false;\n\n // Preferred scope: Kendo's grid accessibility region.\n const ariaRoot = target.closest(\".k-grid-aria-root\") as HTMLElement | null;\n if (ariaRoot) {\n return gridRoot.contains(ariaRoot);\n }\n\n // Fallback for markup/theme variance across versions.\n const fallbackScope = target.closest(\n \".k-grid-header, .k-grid-content, .k-grid-content-locked\",\n ) as HTMLElement | null;\n return fallbackScope ? gridRoot.contains(fallbackScope) : false;\n };\n\n const isEnterActivation = (event: KeyboardEvent) => {\n return (\n event.key === \"Enter\" ||\n event.code === \"Enter\" ||\n event.code === \"NumpadEnter\"\n );\n };\n\n // Helper to get columns from gridRef\n const getColumns = () => {\n return (gridRef?.value as any)?.columns as Array<GridColumnProps>;\n };\n\n /**\n * Key activation handler for a header's column menu / filter button.\n *\n * Purpose:\n * - Enables keyboard users (Space / Enter) to open the Kendo column menu without\n * triggering unintended default behaviors (like sorting) that Kendo may bind\n * to key events on header elements.\n *\n * Behavior:\n * - Intercepts Space / Enter (including legacy \"Spacebar\") keys.\n * - Prevents default and stops propagation to suppress native scrolling or\n * upstream sort handlers.\n * - Records the event target in `activeFilterButton` so focus can be restored\n * after the menu closes (Escape handling in other logic).\n * - Programmatically clicks the target to open the column menu.\n *\n * Accessibility:\n * - Treats the underlying element as a button activation; complements ARIA\n * role=\"button\" applied elsewhere.\n *\n * Idempotency / Safety:\n * - Safe to attach to multiple buttons; only responds to specified keys.\n *\n * @param event KeyboardEvent originating on the column menu trigger.\n * @returns void\n */\n const handleFilterButtonKeyboardListener = (event: KeyboardEvent) => {\n const key = event.key || event.code;\n if ([\" \", \"Spacebar\", \"Space\"].includes(key) || isEnterActivation(event)) {\n // Prevents the unintended default sorting on keyboard event\n event.preventDefault();\n event.stopPropagation();\n\n // Store reference to the filter button when it is activated\n activeFilterButton.value = event.target as HTMLElement;\n\n // Trigger the click event on the filter button\n (event.target as HTMLElement).click();\n }\n };\n\n /**\n * Keyboard interaction handler for an open Kendo Grid column menu (filter / sort menu).\n *\n * Scope:\n * - Attached to each popup (\".k-animation-container\") when it appears.\n * - Handles navigation inside two possible UI states:\n * 1. Column menu list (\".k-columnmenu-item\") items.\n * 2. Filter form container (\".k-filter-menu-container\") with inputs/buttons.\n *\n * Keys:\n * - Escape:\n * * Closes semantic focus context by returning focus to `activeFilterButton`\n * (the header or trigger element that opened the menu) and exits.\n * - ArrowUp / ArrowDown (only when NOT in a filter form container):\n * * Cycles focus among menu items (wraps at ends).\n * - Tab within filter form container:\n * * Traps focus inside the filter form’s focusable elements; Shift+Tab reverses.\n * - Tab when not in a filter form container:\n * * Cycles focus among sibling trigger buttons adjacent to the originating header\n * (previousElementSibling / nextElementSibling of the active trigger).\n *\n * Focus Model:\n * - Relies on `activeFilterButton` (external ref) to restore focus after Escape or\n * to traverse sibling triggers on plain Tab outside a filter form.\n *\n * Guard Clauses:\n * - Returns immediately if no `activeFilterButton` is set (defensive).\n *\n * Assumptions:\n * - Menu markup follows Kendo’s structure with \".k-animation-container\" wrapper.\n * - Filter form presence is detectable via \".k-filter-menu-container\".\n * - Menu action items carry class \".k-columnmenu-item\".\n *\n * Side Effects:\n * - Calls focus() on controlled elements.\n * - Prevents default + stops propagation for handled keys to avoid native browser\n * tab order / scroll interference or Kendo’s default key handling.\n *\n * @param event KeyboardEvent dispatched on the popup container.\n * @returns void\n */\n const handleFilterMenuKeyboardListener = (event: KeyboardEvent) => {\n if (!activeFilterButton.value) return;\n if (event.code === \"Escape\") {\n event.stopPropagation();\n\n if (activeFilterButton.value) {\n activeFilterButton.value.focus();\n }\n return;\n }\n\n const menuItems = Array.from(\n document.querySelectorAll(\n \".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item\",\n ),\n ) as HTMLElement[];\n\n const filterContainer = document.querySelector(\n \".k-animation-container .k-popup .k-column-menu .k-filter-menu-container\",\n );\n\n if (filterContainer) {\n if (event.code === \"Tab\") {\n const defaultFocusable = [\n // \".k-filter-menu-container .k-dropdownlist[tabindex='0']\",\n // \".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])\",\n // \".k-filter-menu-container button:not([tabindex='-1']):not([disabled])\",\n // \".k-checkbox\",\n \".k-dropdownlist[tabindex='0']\",\n \"input.k-input-inner:not([tabindex='-1']):not([disabled])\",\n \"button:not([tabindex='-1']):not([disabled])\",\n \".k-checkbox\",\n ];\n const focusableSelectors =\n options?.focusableMenuSelectors ?? defaultFocusable;\n const focusableElements = Array.from(\n filterContainer.querySelectorAll(focusableSelectors.join(\",\")),\n ) as HTMLElement[];\n\n if (focusableElements.length === 0) return;\n\n const focusedIndex = focusableElements.findIndex(\n (el) => el === document.activeElement,\n );\n let targetIndex: number;\n if (focusedIndex === -1) {\n targetIndex = 0;\n } else if (event.shiftKey) {\n targetIndex =\n (focusedIndex - 1 + focusableElements.length) %\n focusableElements.length;\n } else {\n targetIndex = (focusedIndex + 1) % focusableElements.length;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n focusableElements[targetIndex]?.focus();\n }\n } else {\n if (event.code === \"ArrowUp\" || event.code === \"ArrowDown\") {\n event.preventDefault();\n event.stopPropagation();\n\n const focusedIndex = menuItems.findIndex(\n (item) => item === document.activeElement,\n );\n\n let targetIndex = focusedIndex;\n if (event.code === \"ArrowUp\") {\n targetIndex =\n focusedIndex > 0 ? focusedIndex - 1 : menuItems.length - 1;\n } else if (event.code === \"ArrowDown\") {\n targetIndex =\n focusedIndex < menuItems.length - 1 ? focusedIndex + 1 : 0;\n }\n\n menuItems[targetIndex]?.focus();\n return;\n }\n }\n\n if (event.code === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n\n const currentTh = activeFilterButton.value?.parentElement;\n const targetTh = event.shiftKey\n ? currentTh?.previousElementSibling\n : currentTh?.nextElementSibling;\n const targetButton = targetTh?.querySelector(\n \"button, [role='button'], .k-link\",\n ) as HTMLElement;\n\n targetButton?.focus();\n }\n };\n\n /**\n * Observes the document body for Kendo Grid column menu (filter/sort menu) lifecycle.\n *\n * Responsibilities:\n * - Creates a MutationObserver watching document.body (childList + subtree) for nodes\n * with class \"k-animation-container\" (the popup wrapper Kendo inserts/ removes).\n * - For each added animation container:\n * * If the active header is NOT sortable (data-feather-k-sortable=\"false\"), removes\n * any menu wrapper whose text content includes \"sort\" (case-insensitive) to hide\n * irrelevant sort options from the popup UI.\n * * Attaches a keydown listener (handleFilterMenuKeyboardListener) to enable:\n * - ArrowUp / ArrowDown navigation through menu items\n * - Tab trapping / cycling in filter form content\n * - Escape to return focus to the triggering header/filter button\n * * Uses a retry loop (nextTick + setTimeout) to auto-focus & auto-activate a lone\n * menu item (common when only \"Filter\" is present) improving keyboard efficiency.\n * - For each removed animation container (and any nested ones), detaches the keydown listener.\n *\n * Behavior Notes:\n * - Sort option pruning only occurs when the triggering column is not sortable. The sortable\n * state is inferred from data attribute: data-feather-k-sortable === \"true\".\n * - Active trigger element is read from activeFilterButton ref.\n * - Focus restoration after Escape is handled inside handleFilterMenuKeyboardListener.\n *\n * Idempotency:\n * - Calling multiple times replaces the prior MutationObserver reference (without an\n * explicit disconnect first). Current usage calls it once during initA11y(). If future\n * calls are needed, consider disconnecting mutationsObserver beforehand to avoid\n * duplicate observers.\n *\n * Cleanup:\n * - Observer and event listeners are disconnected/removed by cleanupFilterButtonAccessibility().\n *\n * Side Effects:\n * - Mutates DOM (removal of unwanted sort menu items).\n * - Registers global (document-level subtree) MutationObserver.\n * - Adds / removes keydown event listeners on popup containers.\n *\n * Preconditions:\n * - document.body is available (browser environment).\n * - activeFilterButton may reference the header/filter button that opened the menu.\n *\n * @returns void\n */\n const setupFilterMenuObserver = () => {\n mutationsObserver = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n if (element.classList.contains(\"k-animation-container\")) {\n const column = activeFilterButton.value as HTMLElement;\n if (column) {\n const sortable = column.dataset.featherKSortable === \"true\";\n if (!sortable) {\n nextTick(() => {\n const wrappers = element.querySelectorAll(\n \".k-columnmenu-item-wrapper\",\n );\n wrappers.forEach((wrapper) => {\n const sortMenu = wrapper.textContent\n ?.toLowerCase()\n .includes(\"sort\");\n if (sortMenu) {\n wrapper.remove();\n }\n });\n });\n }\n }\n element.addEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n nextTick(() => {\n const tryFocusMenuItem = () => {\n const menuItems = Array.from(\n element.querySelectorAll(\n \".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item\",\n ),\n ) as HTMLElement[];\n\n if (menuItems.length === 1) {\n menuItems[0].focus();\n menuItems[0].click();\n (tryFocusMenuItem as any).attempts = 0; // reset attempts\n } else if (menuItems.length > 1) {\n (tryFocusMenuItem as any).attempts = 0; // reset attempts\n return;\n } else {\n if ((tryFocusMenuItem as any).attempts === undefined)\n (tryFocusMenuItem as any).attempts = 0;\n if ((tryFocusMenuItem as any).attempts++ < 3) {\n setTimeout(tryFocusMenuItem, 200);\n }\n }\n };\n tryFocusMenuItem();\n });\n }\n\n const animationContainers = element.querySelectorAll(\n \".k-animation-container\",\n );\n animationContainers.forEach((container) => {\n (container as HTMLElement).addEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n });\n }\n });\n\n mutation.removedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains(\"k-animation-container\")) {\n element.removeEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n }\n\n const animationContainers = element.querySelectorAll(\n \".k-animation-container\",\n );\n animationContainers.forEach((container) => {\n (container as HTMLElement).removeEventListener(\n \"keydown\",\n handleFilterMenuKeyboardListener,\n );\n });\n }\n });\n });\n });\n\n mutationsObserver.observe(document.body, {\n childList: true,\n subtree: true,\n });\n };\n\n /**\n * Detects if an element is a form control or inside a form-like component.\n *\n * Purpose:\n * - Allows grid keyboard navigation to skip form controls, letting them handle\n * their own keyboard events naturally (e.g., cursor movement in inputs, spinners).\n *\n * Behavior:\n * - Returns true if the element itself is an input, textarea, select, or button.\n * - Returns true if the element is inside a Kendo form component:\n * * .k-picker-wrap (DatePicker, TimePicker, etc.)\n * * .k-input-inner (MaskedTextBox, TextBox, etc.)\n * * .k-textbox (generic Kendo textbox wrapper)\n * * [role=\"combobox\"] (dropdown, autocomplete, etc.)\n * - Returns false otherwise.\n *\n * @param el HTMLElement to check\n * @returns true if el is a form control that should manage its own keyboard events\n */\n const isFormControl = (el: HTMLElement): boolean => {\n const tagName = el.tagName.toLowerCase();\n\n // Check if element itself is a native form control\n if ([\"input\", \"textarea\", \"select\", \"button\"].includes(tagName)) {\n return true;\n }\n\n // Check if element is inside a Kendo form component wrapper\n if (\n el.closest(\n '.k-picker-wrap, .k-input-inner, .k-textbox, [role=\"combobox\"]',\n )\n ) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Keyboard handler for the Grid root element (bind to @keydown on <Grid>).\n *\n * Responsibilities:\n * - ArrowUp / ArrowDown: Move focus (and tabindex=\"0\") between sibling data rows\n * (.k-table-row[data-grid-row-index]).\n * - ArrowLeft / ArrowRight: When focus is on (or within) a data row, cycle focus\n * among tabbable descendants inside that row (as defined by\n * `intraRowNavigationSelector`). If the row itself has focus and no descendant\n * is focused, ArrowRight focuses the first intra-row tabbable element.\n * - Escape: If focus is currently inside a data row descendant, collapse focus\n * back to the parent row element (ensuring it has tabindex=\"0\").\n * - Enter / Space: Reserved for future enhancements and prevented when part of\n * the core navigation key group to avoid unintended native behaviors.\n *\n * Special Cases:\n * - If the event target is a grid column menu button (identified by both\n * \"k-grid-header-menu\" and \"k-grid-column-menu\" classes), the handler stores\n * it in `activeFilterButton` and returns so menu logic can proceed elsewhere.\n * - If the event target is a form control (input, button, Kendo component, etc.),\n * the handler exits early to allow the form control to manage its own keyboard\n * events naturally.\n *\n * Side Effects:\n * - Mutates tabindex attributes on row elements to maintain exactly one row\n * with tabindex=\"0\" in the vertical navigation path.\n * - Calls focus() on target rows or intra-row elements as navigation occurs.\n *\n * Defensive Checks:\n * - Exits early if the event object, its type, or target is missing.\n * - Exits early if target is a form control (via isFormControl).\n *\n * Assumptions:\n * - `gridRef.value.$el` is the Grid root (or inside it) and queryable.\n * - Data rows use the selector \".k-table-row[data-grid-row-index]\".\n *\n * @param e KeyboardEvent from the Grid's @keydown binding.\n * @returns void\n */\n const handleGridKeyDown = (e: KeyboardEvent) => {\n if (!e.type) return;\n\n if (!e) {\n return;\n }\n const target = e.target as HTMLElement;\n if (!target) return;\n\n const row = target.closest(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement | null;\n\n // Scope keyboard handling to this grid instance's a11y/content region.\n // This prevents toolbar and external controls from being intercepted.\n if (!isWithinThisGridScope(target)) {\n return;\n }\n\n // EXIT EARLY: Don't apply grid navigation to form controls.\n // Exception: allow ArrowLeft/ArrowRight intra-row navigation for focusable\n // controls that live inside a data row.\n const isIntraRowHorizontalNavKey = [\"ArrowLeft\", \"ArrowRight\"].includes(\n e.code,\n );\n if (isFormControl(target) && !(row && isIntraRowHorizontalNavKey)) {\n return;\n }\n\n // If Escape pressed and the active element is inside a data row,\n // move focus to the parent .k-table-row and ensure its tabindex=0.\n if (e.code === \"Escape\") {\n const focusedRow = (\n document.activeElement as HTMLElement | null\n )?.closest(\".k-table-row[data-grid-row-index]\") as HTMLElement | null;\n if (focusedRow) {\n // Justified: We're handling Escape to collapse focus from descendant to row.\n // Prevent default to override native browser behavior (dialog close, etc.)\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this Escape.\n e.stopPropagation();\n try {\n const rows = Array.from(\n gridRef?.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n rows.forEach((r) => r.setAttribute(\"tabindex\", \"-1\"));\n } catch {\n // ignore if gridRef not available\n }\n focusedRow.setAttribute(\"tabindex\", \"0\");\n focusedRow.focus();\n return;\n }\n }\n\n // Handle navigation keys (only prevent/stop for keys we actually handle)\n if (\n [\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"Enter\",\n \"NumpadEnter\",\n \"Space\",\n ].includes(e.code)\n ) {\n // Check if target is a grid column menu button\n if (\n target.classList.contains(\"k-grid-header-menu\") &&\n target.classList.contains(\"k-grid-column-menu\")\n ) {\n activeFilterButton.value = target as HTMLElement;\n // Let menu logic proceed elsewhere; don't prevent or stop\n return;\n }\n\n // If event came from within a data row, handle row/intra-row navigation\n if (row) {\n if ([\"ArrowDown\", \"ArrowUp\"].includes(e.code)) {\n // Justified: We're handling ArrowUp/Down for vertical row navigation.\n // Prevent default to override native browser scrolling behavior.\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this.\n e.stopPropagation();\n\n // Find the next/previous element sibling that actually has a tabindex.\n const findSiblingRow = (\n start: Element,\n direction: \"next\" | \"previous\",\n ): HTMLElement | null => {\n let sib =\n direction === \"next\"\n ? start.nextElementSibling\n : start.previousElementSibling;\n while (sib) {\n const el = sib as HTMLElement;\n try {\n if (el.classList.contains(\"k-table-row\")) {\n return el;\n }\n } catch {\n // Defensive: some nodes might throw when accessed; skip them.\n }\n sib =\n direction === \"next\"\n ? sib.nextElementSibling\n : sib.previousElementSibling;\n }\n return null;\n };\n\n const targetRow =\n e.code === \"ArrowDown\"\n ? findSiblingRow(row, \"next\")\n : findSiblingRow(row, \"previous\");\n\n if (targetRow) {\n row.setAttribute(\"tabindex\", \"-1\");\n targetRow.setAttribute(\"tabindex\", \"0\");\n targetRow.focus();\n }\n return;\n }\n if ([\"ArrowLeft\", \"ArrowRight\"].includes(e.code)) {\n // Justified: We're handling ArrowLeft/Right for intra-row focus navigation.\n // Prevent default to override native text cursor movement only when we handle the event.\n e.preventDefault();\n // Justified: Stop propagation to prevent parent containers from seeing this.\n e.stopPropagation();\n\n const tabbable = row.querySelectorAll(\n intraRowNavigationSelector,\n ) as NodeListOf<HTMLElement>;\n if (tabbable.length === 0) return;\n\n // Find currently focused element within the row\n let currentIndex = Array.from(tabbable).findIndex(\n (el) => el === document.activeElement,\n );\n\n if (currentIndex === -1 && document.activeElement === row) {\n // If no element is focused, focus the first tabbable element\n (tabbable[0] as HTMLElement).focus();\n return;\n }\n\n if (e.code === \"ArrowRight\") {\n currentIndex =\n currentIndex === tabbable.length - 1 ? 0 : currentIndex + 1;\n } else if (e.code === \"ArrowLeft\") {\n currentIndex =\n currentIndex === 0 ? tabbable.length - 1 : currentIndex - 1;\n }\n (tabbable[currentIndex] as HTMLElement).focus();\n\n return;\n }\n }\n\n // Enter, Space: Not currently handled for grid navigation.\n // Don't prevent by default to allow native behavior or other handlers to respond.\n }\n };\n\n /**\n * Applies a FeatherK-specific CSS hook class to the Kendo Grid root element.\n *\n * Behavior:\n * - On the next Vue microtask (nextTick), locates the closest ancestor with the\n * \".k-grid\" class starting from `gridRef.value.$el`.\n * - Adds the \"fk-grid\" class to that element (no-op if already present).\n *\n * Purpose:\n * - Provides a styling hook so external FeatherK stylesheets can target grids\n * that have been enhanced by this composable without relying on brittle\n * selectors or global overrides.\n *\n * Safety / Idempotency:\n * - Safe to call multiple times; subsequent calls simply re-add the same class.\n * - Silently does nothing if `gridRef.value` or its `$el` is not yet available.\n *\n * Side Effects:\n * - Mutates the DOM by adding a CSS class to the grid root element.\n *\n * No cleanup is currently required (class need not be removed on unmount).\n *\n * @returns void\n */\n const setupGridStyling = () => {\n nextTick(() => {\n const gridHost = gridRef.value?.$el as Element | undefined;\n if (!gridHost || typeof gridHost.closest !== \"function\") return;\n\n const gridElement = gridHost.closest(\".k-grid\") as HTMLElement | null;\n if (gridElement) gridElement.classList.add(\"fk-grid\");\n });\n };\n\n /**\n * Sets up row-level (tr) keyboard navigation for the Kendo Grid instance.\n *\n * Behavior:\n * 1. Ensures exactly one data row ('.k-table-row[data-grid-row-index]') has tabindex=\"0\"\n * (the current keyboard focus target) and all others have tabindex=\"-1\".\n * 2. Establishes an internal helper (ensureSingleTabindex) that:\n * - Re-calculates which row should retain tabindex=\"0\" after DOM changes.\n * - Preserves a focused row if its descendants currently contain focus.\n * - Falls back to the first row when no focused row exists.\n * 3. Applies initial tabindex values immediately (first row gets focusable state).\n * 4. Observes the grid <tbody> ('.k-table-tbody') with a MutationObserver so that when\n * Kendo re-renders rows (sorting, filtering, paging, data updates), tabindex\n * constraints are re-applied with minimal work.\n *\n * Rationale:\n * The default Kendo Grid may introduce multiple tabbable descendants, making\n * keyboard traversal verbose. Restricting tab stops to a single row improves\n * accessibility by:\n * - Reducing unnecessary Tab presses.\n * - Enabling arrow-key driven intra-row navigation (handled elsewhere).\n *\n * Assumptions / Dependencies:\n * - gridRef.value.$el points to (or is inside) a rendered Kendo Grid root.\n * - Data rows carry class 'k-table-row' and attribute 'data-grid-row-index'.\n * - Runs in a browser environment (document, MutationObserver available).\n *\n * Error Handling:\n * - Wrapped in try/catch; failures are logged and do not throw upstream.\n *\n * Idempotency:\n * - Safe to call more than once; repeated calls will attach at most one observer\n * per invocation lifecycle (previous observer persists). Caller is expected\n * to avoid redundant calls or add future cleanup if needed.\n *\n * Side Effects:\n * - Mutates DOM attributes (tabindex) of grid row elements.\n * - Creates a MutationObserver stored in the closure (rowObserver) for teardown\n * via cleanupFilterButtonAccessibility().\n *\n * @returns void\n */\n const setupTrNavigation = () => {\n if (rowObserver) {\n // Already set up\n return;\n }\n try {\n /**\n * Ensure exactly one grid row is keyboard-focusable (tabindex=\"0\") and make all others unfocusable (tabindex=\"-1\").\n *\n * This function:\n * - Queries the grid DOM for rows using the selector \".k-table-row[data-grid-row-index]\".\n * - If no rows are found, it returns immediately.\n * - If exactly one row already has tabindex=\"0\", it does nothing.\n * - Otherwise it clears tabindex to \"-1\" on all matched rows, then:\n * - If the currently focused element is inside one of the matched rows, that row is preserved as tabindex=\"0\".\n * - If there is no such focused row, the first matched row is set to tabindex=\"0\".\n *\n * Notes:\n * - The function mutates DOM attributes (tabindex) of the matched row elements.\n * - It expects to run in a browser environment where `document.activeElement` is available and where\n * `gridRef.value.$el` points to the grid root element containing rows matching the selector.\n * - Any runtime errors encountered while querying or updating the DOM are caught and logged via console.error;\n * the function will not throw.\n *\n * @remarks\n * Use this helper to maintain a single tabbable row for keyboard navigation / accessibility purposes within a custom grid component.\n *\n * @returns void\n *\n * @example\n * // Keep one tabbable row in the grid after rendering or when rows change\n * ensureSingleTabindex();\n */\n const ensureSingleTabindex = () => {\n try {\n const rows = Array.from(\n gridRef.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n\n if (!rows || rows.length === 0) return;\n\n // Count rows that currently have tabindex=\"0\"\n const zeroTabRows = rows.filter(\n (r) => r.getAttribute(\"tabindex\") === \"0\",\n );\n\n // If exactly one row already has tabindex=0, nothing to do\n if (zeroTabRows.length === 1) return;\n\n // Prefer to preserve the currently focused row if it's inside the rows\n const focusedRow = rows.find(\n (r) =>\n r === document.activeElement ||\n r.contains(document.activeElement),\n );\n\n // Clear all to -1\n rows.forEach((r) => r.setAttribute(\"tabindex\", \"-1\"));\n\n if (focusedRow) {\n focusedRow.setAttribute(\"tabindex\", \"0\");\n return;\n }\n\n // Fallback: set first row to tabindex=0\n rows[0].setAttribute(\"tabindex\", \"0\");\n } catch (err) {\n console.error(\"ensureSingleTabindex error:\", err);\n }\n };\n\n // Initial setup\n const rows = Array.from(\n gridRef.value.$el.querySelectorAll(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement[],\n );\n if (rows.length > 0) {\n rows.forEach((row, index) => {\n row.setAttribute(\"tabindex\", index === 0 ? \"0\" : \"-1\");\n });\n }\n\n // Observe tbody for row changes (Kendo will recreate rows on sort/filter/paging)\n const tbody = gridRef.value.$el.querySelector(\".k-table-tbody\");\n if (tbody) {\n rowObserver = new MutationObserver(() => {\n // Reassert single tabindex after DOM changes. Keep work minimal.\n ensureSingleTabindex();\n });\n rowObserver.observe(tbody, { childList: true, subtree: true });\n }\n } catch (error) {\n console.error(\"Error setting up row navigation:\", error);\n }\n };\n\n /**\n * Initializes accessibility behavior for grid filter buttons.\n *\n * - Queries the DOM for elements matching the selector\n * \".k-grid-header .k-grid-header-menu.k-grid-column-menu\".\n * - For each matched element, sets the ARIA role to \"button\" and attaches a\n * keydown event listener using handleFilterButtonKeyboardListener.\n * - Invokes setupFilterMenuObserver() to observe changes to filter menus.\n * - Invokes setupHeaderThTriggers() to initialize any header-related triggers.\n *\n * @returns void\n */\n const setupFilterButtonAccessibility = () => {\n nextTick(() => {\n const filterSelector =\n \".k-grid-header .k-grid-header-menu.k-grid-column-menu\";\n const filterButtons = document.querySelectorAll(filterSelector);\n if (filterButtons) {\n filterButtons.forEach((el) => {\n el.setAttribute(\"role\", \"button\");\n (el as HTMLElement).addEventListener(\n \"keydown\",\n handleFilterButtonKeyboardListener,\n );\n });\n }\n\n setupFilterMenuObserver();\n\n setupHeaderThTriggers();\n });\n };\n\n /**\n * Cleans up all accessibility (a11y) resources installed by useGridA11y.\n *\n * Includes:\n * - Removes keydown listeners from column menu / filter buttons.\n * - Disconnects the column menu MutationObserver.\n * - Disconnects the row MutationObserver.\n * - Executes and clears header <th> teardown callbacks.\n *\n * Idempotent: safe to call multiple times.\n */\n const cleanupGridA11y = () => {\n const filterSelector =\n \".k-grid-header .k-grid-header-menu.k-grid-column-menu\";\n const filterButtons = document.querySelectorAll(filterSelector);\n if (filterButtons) {\n filterButtons.forEach((el) => {\n (el as HTMLElement).removeEventListener(\n \"keydown\",\n handleFilterButtonKeyboardListener,\n );\n });\n }\n\n if (mutationsObserver) {\n mutationsObserver.disconnect();\n mutationsObserver = null;\n }\n\n if (rowObserver) {\n rowObserver.disconnect();\n rowObserver = null;\n }\n\n headerThTeardownCallbacks.forEach((teardown) => teardown());\n headerThTeardownCallbacks.length = 0;\n };\n\n /**\n * Initializes accessible interaction handlers for header <th> cells in a Kendo-style grid.\n *\n * Finds all header cells under \".k-grid-header .k-table-thead th\" and for each header cell:\n * - Locates the column menu button (\".k-grid-header-menu.k-grid-column-menu\") and sets its tabindex to -1.\n * - Reads column metadata from getColumns() (external dependency) to set data attributes:\n * - data-feather-k-field (column.field)\n * - data-feather-k-filterable (\"false\" if column.filterable === false, otherwise \"true\")\n * - data-feather-k-sortable (\"false\" if column.sortable === false, otherwise \"true\")\n * - Determines whether the header is filterable or sortable using the above data attributes.\n * - Sets appropriate cursor styles (pointer for interactive headers, default otherwise).\n * - Configures ARIA/sniffable roles:\n * - If filterable: tabindex=\"0\", role=\"button\", aria-haspopup=\"menu\"\n * - If not filterable: tabindex=\"0\", role=\"columnheader\", aria-haspopup is removed\n *\n * Adds event handlers for each header cell:\n * - click handler:\n * - If filterable: prevents default/propagation and opens the column menu (via the menu button click). Also records the header element on activeFilterButton (external ref) for focus return.\n * - If not filterable but sortable: synthesizes an \"Enter\" KeyboardEvent and dispatches it on the header to trigger sort behavior and records activeFilterButton.\n * - Clicks originating from a column resizer (closest \".k-column-resizer\") are ignored.\n * - keydown handler (registered in capture phase for the header cell):\n * - On Enter or Space when filterable or sortable:\n * - Sets activeFilterButton to the header and focuses it.\n * - If filterable: prevents default/propagation and opens the column menu.\n * - If sortable: clicks the first \".k-link\" inside the header to trigger sort.\n *\n * Additionally, attaches a capturing keydown handler to the enclosing THEAD element (\".k-grid-header .k-table-thead\"):\n * - Prevents default/immediate propagation for Enter/Space on headers that are neither filterable nor sortable.\n * - This protects non-interactive header cells from activating default keyboard behavior.\n *\n * All event listeners added by this setup are recorded as teardown callbacks into the\n * headerThTeardownCallbacks array (external), so they can be removed later to avoid leaks.\n *\n * Notes / assumptions:\n * - Relies on globals/closures: document, getColumns(), activeFilterButton (ref-like object), and headerThTeardownCallbacks (array).\n * - Intended to enhance accessibility and keyboard interaction for grid headers by mapping Kendo column behaviors\n * to appropriate ARIA roles, keyboard handling, and focus management.\n *\n * @remarks\n * - Does not return a value; side effects are applied directly to DOM and external state.\n * - Uses attribute-based decisions to maintain compatibility with dynamically-updated column metadata.\n *\n * @returns void\n */\n const setupHeaderThTriggers = () => {\n const headerCells = document.querySelectorAll(\n \".k-grid-header .k-table-thead th\",\n );\n\n headerCells.forEach((th, index) => {\n if ((th as HTMLElement).dataset.featherKHeaderBound === \"true\") {\n return;\n }\n\n const btn = th.querySelector(\n \".k-grid-header-menu.k-grid-column-menu\",\n ) as HTMLElement | null;\n if (!btn) return;\n\n const columns = getColumns();\n\n if (columns && columns[index]) {\n const field = columns[index].field ?? \"\";\n th.setAttribute(\"data-feather-k-field\", field);\n th.setAttribute(\n \"data-feather-k-filterable\",\n columns[index].filterable === false ? \"false\" : \"true\",\n );\n th.setAttribute(\n \"data-feather-k-sortable\",\n columns[index].sortable === false ? \"false\" : \"true\",\n );\n }\n\n const filterable =\n (th as HTMLElement).dataset.featherKFilterable !== \"false\";\n const sortable = (th as HTMLElement).dataset.featherKSortable !== \"false\";\n\n btn.setAttribute(\"tabindex\", \"-1\");\n\n if (filterable || sortable) {\n (th as HTMLElement).style.cursor = \"pointer\";\n } else {\n (th as HTMLElement).style.cursor = \"default\";\n }\n if (filterable) {\n th.setAttribute(\"tabindex\", \"0\");\n th.setAttribute(\"role\", \"button\");\n th.setAttribute(\"aria-haspopup\", \"menu\");\n } else {\n th.setAttribute(\"tabindex\", \"0\");\n th.setAttribute(\"role\", \"columnheader\");\n th.removeAttribute(\"aria-haspopup\");\n }\n const openMenu = (e: Event | KeyboardEvent) => {\n if ((e.target as HTMLElement)?.closest(\".k-column-resizer\")) return;\n\n activeFilterButton.value = th as HTMLElement; // focus return target\n btn.click();\n };\n\n const clickHandler = (e: Event) => {\n if (filterable) {\n activeFilterButton.value = th as HTMLElement;\n e.preventDefault();\n e.stopPropagation();\n openMenu(e);\n } else if (sortable) {\n activeFilterButton.value = th as HTMLElement;\n const columnLink = th.querySelector(\".k-link\");\n if (columnLink) {\n (columnLink as HTMLElement).click();\n }\n }\n };\n (th as HTMLElement).addEventListener(\"click\", clickHandler);\n headerThTeardownCallbacks.push(() => {\n (th as HTMLElement).removeEventListener(\"click\", clickHandler);\n });\n\n // Keyboard activation for sortable/filterable header cells.\n //\n // Enter, Numpad Enter, and Space are intentionally handled identically here:\n // - preventDefault + stopPropagation are applied for ALL three keys so\n // none of them leak to native browser or Kendo's own key handlers,\n // which could trigger a duplicate or conflicting sort/scroll action.\n // - For sortable-only headers the sort is triggered by clicking the\n // .k-link element directly (the same path the browser follows on a\n // real mouse click and what Space was already using). This keeps\n // the asc → desc → unsorted cycle consistent regardless of key used.\n //\n // IMPORTANT: Do not restore the old synthetic KeyboardEvent dispatch\n // (th.dispatchEvent(new KeyboardEvent('keydown', { key:'Enter', ... }))).\n // That approach caused Enter/Numpad Enter to re-enter this handler\n // recursively and be silently swallowed by the isSorting guard in\n // ClaimLog.vue, making every press after the first appear to do nothing.\n const keyHandler = (e: KeyboardEvent) => {\n if (\n (isEnterActivation(e) || e.code === \"Space\") &&\n (filterable || sortable)\n ) {\n e.preventDefault();\n e.stopPropagation();\n\n activeFilterButton.value = th as HTMLElement;\n activeFilterButton.value.focus();\n if (filterable) {\n openMenu(e);\n } else if (sortable) {\n const columnLink = th.querySelector(\".k-link\");\n if (columnLink) {\n (columnLink as HTMLElement).click();\n }\n }\n }\n };\n (th as HTMLElement).addEventListener(\"keydown\", keyHandler, true);\n headerThTeardownCallbacks.push(() => {\n (th as HTMLElement).removeEventListener(\"keydown\", keyHandler, true);\n });\n\n (th as HTMLElement).dataset.featherKHeaderBound = \"true\";\n });\n\n const thead = document.querySelector(\".k-grid-header .k-table-thead\");\n if (\n thead &&\n (thead as HTMLElement).dataset.featherKHeaderBound !== \"true\"\n ) {\n const theadKeyboardHandler = (e: KeyboardEvent) => {\n const th = (e.target as HTMLElement).closest(\"th\");\n if (!th) return;\n if (\n (isEnterActivation(e) || e.code === \"Space\") &&\n th.dataset.featherKFilterable === \"false\" &&\n th.dataset.featherKSortable === \"false\"\n ) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n };\n (thead as HTMLElement).addEventListener(\n \"keydown\",\n theadKeyboardHandler,\n true, // NOTE: capture phase\n );\n headerThTeardownCallbacks.push(() => {\n (thead as HTMLElement).removeEventListener(\n \"keydown\",\n theadKeyboardHandler,\n true,\n );\n });\n\n (thead as HTMLElement).dataset.featherKHeaderBound = \"true\";\n }\n };\n\n /**\n * Handles grid sort change events with special-casing for column menu interactions and non-sortable columns.\n *\n * This function inspects the DOM target that triggered the sort change and the grid column metadata to\n * determine whether the default sort handling should proceed or be suppressed. It:\n * - Ignores events coming from the column menu toggle (element with class \"k-link\").\n * - When a column menu item (element with class \"k-columnmenu-item\") is selected for a non-sortable field,\n * prevents modifying the sort descriptors for that field.\n * - Otherwise, if a custom handler is provided, schedules focusing of the active filter button (if present)\n * on the next tick and then invokes the custom handler with the original event.\n *\n * @param event - Optional GridSortChangeEvent. The implementation expects a nested structure where\n * the originating HTMLElement is available at `event.event.event.target`, the field at\n * `event.event.field`, and the current sort descriptors at `event.event.sort`.\n * @param customHandler - Optional callback to be executed when the standard handling path is allowed.\n * The callback will be invoked inside `nextTick` after attempting to focus the\n * active filter button.\n * @returns void\n *\n * @remarks\n * - This function relies on `getColumns()` to obtain column metadata and on an `activeFilterButton` ref\n * to optionally restore focus. It performs early returns when the event target or columns are unavailable,\n * or when the column menu toggle was the source of the event.\n */\n const handleSortChange = function (\n event?: GridSortChangeEvent,\n customHandler?: any,\n ) {\n const target = event?.event?.event.target as HTMLElement;\n const columns = getColumns();\n if (!target || !columns) return;\n\n const menuOpened = target.classList.contains(\"k-grid-header-menu\");\n const menuItemSelected = target.classList.contains(\"k-columnmenu-item\");\n\n const fieldIsSortable =\n columns.find((c) => c.field === event?.event?.field)?.sortable && true;\n\n if (menuOpened) return;\n\n if (menuItemSelected && !fieldIsSortable) {\n const sortDescriptor = event?.event?.sort as SortDescriptor[];\n sortDescriptor?.filter(\n (s: SortDescriptor) => s.field !== event?.event?.field,\n );\n return;\n }\n if (typeof customHandler === \"function\") {\n nextTick(() => {\n if (activeFilterButton.value) activeFilterButton.value.focus();\n customHandler(event);\n // Kendo recreates header <th> nodes after each sort, which discards any\n // previously attached keydown listeners. Re-running setupHeaderThTriggers\n // here (after the sort data has been applied) reattaches those listeners\n // to the new nodes so subsequent Enter/Space presses continue to work.\n nextTick(() => {\n setupHeaderThTriggers();\n });\n });\n }\n };\n\n /**\n * Initialize accessibility (a11y) features for the grid.\n *\n * This function is idempotent — it will perform initialization only once.\n * On the first call it sets the internal `a11yInitialized` flag and runs\n * the following setup routines:\n * - setupGridStyling()\n * - setupTrNavigation()\n * - setupFilterButtonAccessibility()\n *\n * Subsequent calls do nothing.\n *\n * Use this during component setup/mount to ensure grid accessibility helpers\n * are registered exactly once.\n *\n * @returns void\n */\n const initA11y = () => {\n if (a11yInitialized) return;\n try {\n setupGridStyling();\n setupTrNavigation();\n setupFilterButtonAccessibility();\n a11yInitialized = true;\n } catch (err) {\n console.error(\"initA11y failed:\", err);\n // Clean up any partial listeners/observers so a retry can succeed.\n cleanupGridA11y();\n }\n };\n\n onBeforeUnmount(() => {\n cleanupGridA11y();\n });\n return {\n activeFilterButton,\n handleGridKeyDown,\n handleSortChange,\n initA11y,\n };\n};\n","import { type Ref } from \"vue\";\nimport type {\n CompositeFilterDescriptor,\n FilterDescriptor,\n} from \"@progress/kendo-data-query\";\n\n/**\n * Type guard for composite filter groups.\n */\nconst isCompositeFilter = (\n filterItem: unknown,\n): filterItem is CompositeFilterDescriptor => {\n return (\n !!filterItem &&\n typeof filterItem === \"object\" &&\n \"filters\" in filterItem &&\n Array.isArray((filterItem as CompositeFilterDescriptor).filters)\n );\n};\n\n/**\n * Type guard for leaf filter nodes.\n */\nconst isFilterDescriptor = (\n filterItem: unknown,\n): filterItem is FilterDescriptor => {\n return (\n !!filterItem && typeof filterItem === \"object\" && \"field\" in filterItem\n );\n};\n\n/**\n * Recursively checks whether a filter tree contains a filter for a specific field.\n */\nconst hasFieldFilterRecursive = (\n filterItem: unknown,\n field: string,\n): boolean => {\n if (!filterItem || typeof filterItem !== \"object\") {\n return false;\n }\n\n if (!isCompositeFilter(filterItem)) {\n if (!isFilterDescriptor(filterItem)) {\n return false;\n }\n return filterItem.field === field;\n }\n\n return filterItem.filters.some((child) =>\n hasFieldFilterRecursive(child, field),\n );\n};\n\n/**\n * Returns a reactive function that resolves to `\"active\"` when the given\n * field has a filter applied in the current filter tree, or `\"\"` when it\n * does not.\n *\n * Bind the returned function directly to column `headerClassName` inside a\n * `computed` — Vue tracks the `filterRef` dependency automatically; no\n * manual update call is needed.\n *\n * @param filterRef - Reactive grid filter descriptor (the same ref bound to the Grid).\n * @returns `(field: string) => \"active\" | \"\"`\n *\n * @example\n * const activeClass = useGridActiveFilter(filterRef);\n *\n * const columns = computed(() => [\n * { field: \"ProductName\", headerClassName: activeClass(\"ProductName\") },\n * ]);\n */\nexport const useGridActiveFilter = (\n filterRef: Ref<CompositeFilterDescriptor | undefined>,\n): ((field: string) => string) => {\n return (field: string): string => {\n if (!filterRef.value?.filters) return \"\";\n return filterRef.value.filters.some((f) =>\n hasFieldFilterRecursive(f, field),\n )\n ? \"active\"\n : \"\";\n };\n};\n","/**\n * useGridRowAction\n *\n * Composable that provides safe, accessible row click and keyboard activation\n * handlers for Kendo UI for Vue Grid instances.\n *\n * Highlights:\n * - Guards against triggers when clicking interactive elements (buttons, links, inputs, checkboxes).\n * - Suppresses activation when the user is highlighting/selecting text inside a cell.\n * - Restricts mouse actions to primary (left) click.\n * - Provides keyboard activation (Enter / Space) for focused grid rows.\n * - Action-agnostic: executes consumer-supplied `onRowAction` callback with `dataItem` and context.\n */\n\nimport type { Ref } from \"vue\";\nimport type { GridRowClickEvent } from \"../types/kendo\";\n\nexport interface RowActionCoordinates {\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n screenX: number;\n screenY: number;\n}\n\nexport interface RowActionContext<T = any> {\n /**\n * Data item associated with the activated row.\n */\n dataItem: T;\n /**\n * Row index if provided by Kendo event or row DOM attribute.\n */\n rowIndex?: number;\n /**\n * Field name if click originated on a specific column cell.\n */\n field?: string;\n /**\n * Original native browser event.\n */\n event: Event;\n /**\n * Interaction trigger type ('click' | 'keyboard').\n */\n triggerType: \"click\" | \"keyboard\";\n /**\n * Modifier key states during activation.\n */\n ctrlKey: boolean;\n shiftKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n /**\n * Pointer coordinates of the activation. Derived from the native mouse event\n * for clicks, or from the focused row's bounding box for keyboard activation.\n * `undefined` when neither source is available.\n */\n coordinates?: RowActionCoordinates;\n}\n\nexport interface UseGridRowActionOptions<T = any> {\n /**\n * Action callback invoked when a row is clicked or activated via keyboard.\n */\n onRowAction: (dataItem: T, context: RowActionContext<T>) => void;\n /**\n * Optional ref to Kendo Grid component instance or array/ref of data items.\n * Used to resolve the row `dataItem` when row is activated via grid-level `@keydown`.\n */\n gridRef?: Ref<any>;\n dataItems?: Ref<T[]> | T[];\n /**\n * Additional CSS selectors inside row cells that should prevent the row action.\n */\n ignoreSelectors?: string[];\n /**\n * Custom predicate function to check if an event target should be ignored.\n * Return `true` to ignore row action, `false` to proceed.\n */\n shouldIgnoreTarget?: (target: HTMLElement, event: Event) => boolean;\n /**\n * Whether to enable Enter/Space keyboard activation on focused grid rows.\n * Default: true\n */\n enableKeyboardAction?: boolean;\n}\n\nexport interface UseGridRowActionReturn<T = any> {\n /**\n * Grid row click handler to bind to Kendo Grid's `@rowclick` event.\n */\n handleRowClick: (event: GridRowClickEvent<T>) => void;\n /**\n * Grid keyboard handler to bind to Kendo Grid's `@keydown` event.\n * Optionally accepts explicit `dataItem` if bound at the row/slot level.\n */\n handleRowKeyDown: (event: KeyboardEvent, explicitDataItem?: T) => void;\n /**\n * Helper function to test if a given DOM element is an ignored target.\n */\n isIgnoredTarget: (target: HTMLElement, event?: Event) => boolean;\n}\n\nconst DEFAULT_IGNORE_SELECTORS = [\n \"button\",\n \"a\",\n \"input\",\n \"select\",\n \"textarea\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"link\"]',\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n \".k-checkbox\",\n \".k-button\",\n \".k-dropdown\",\n \".k-picker\",\n \".k-hierarchy-cell\",\n \".k-grid-header-menu\",\n \".k-column-menu\",\n];\n\nexport const useGridRowAction = <T = any>(\n options: UseGridRowActionOptions<T>,\n): UseGridRowActionReturn<T> => {\n const {\n onRowAction,\n gridRef,\n dataItems,\n ignoreSelectors = [],\n shouldIgnoreTarget,\n enableKeyboardAction = true,\n } = options;\n\n const combinedIgnoreSelectors = [\n ...DEFAULT_IGNORE_SELECTORS,\n ...ignoreSelectors,\n ];\n\n /**\n * Tests if an event target element or any of its parent elements match ignored selectors\n * or custom predicate filters.\n */\n const isIgnoredTarget = (target: HTMLElement, event?: Event): boolean => {\n if (!target) return false;\n\n // Check if element or ancestor matches any ignored selector\n const selectorString = combinedIgnoreSelectors.join(\",\");\n if (target.closest && target.closest(selectorString)) {\n return true;\n }\n\n // Check custom predicate if provided\n if (shouldIgnoreTarget && event) {\n return shouldIgnoreTarget(target, event);\n }\n\n return false;\n };\n\n /**\n * Reads the row index from the nearest data row element.\n */\n const resolveRowIndex = (target?: HTMLElement | null): number | undefined => {\n const rowEl = target?.closest?.(\n \".k-table-row[data-grid-row-index]\",\n ) as HTMLElement | null;\n const attr = rowEl?.getAttribute(\"data-grid-row-index\");\n if (attr === null || attr === undefined) return undefined;\n const parsed = parseInt(attr, 10);\n return Number.isNaN(parsed) ? undefined : parsed;\n };\n\n /**\n * Extracts pointer coordinates from a native mouse/pointer event.\n */\n const getEventCoordinates = (\n nativeEvent: any,\n ): RowActionCoordinates | undefined => {\n if (!nativeEvent || typeof nativeEvent.clientX !== \"number\") {\n return undefined;\n }\n const scrollX = typeof window !== \"undefined\" ? window.scrollX || 0 : 0;\n const scrollY = typeof window !== \"undefined\" ? window.scrollY || 0 : 0;\n const screenX = typeof window !== \"undefined\" ? window.screenX || 0 : 0;\n const screenY = typeof window !== \"undefined\" ? window.screenY || 0 : 0;\n return {\n clientX: nativeEvent.clientX,\n clientY: nativeEvent.clientY,\n pageX:\n typeof nativeEvent.pageX === \"number\"\n ? nativeEvent.pageX\n : nativeEvent.clientX + scrollX,\n pageY:\n typeof nativeEvent.pageY === \"number\"\n ? nativeEvent.pageY\n : nativeEvent.clientY + scrollY,\n screenX:\n typeof nativeEvent.screenX === \"number\"\n ? nativeEvent.screenX\n : nativeEvent.clientX + screenX,\n screenY:\n typeof nativeEvent.screenY === \"number\"\n ? nativeEvent.screenY\n : nativeEvent.clientY + screenY,\n };\n };\n\n /**\n * Derives coordinates from an element's bounding box (keyboard activation).\n */\n const getElementCoordinates = (\n element: HTMLElement | null,\n ): RowActionCoordinates | undefined => {\n if (!element || typeof element.getBoundingClientRect !== \"function\") {\n return undefined;\n }\n const rect = element.getBoundingClientRect();\n if (!rect) return undefined;\n const clientX = rect.left;\n const clientY = rect.bottom;\n const scrollX = typeof window !== \"undefined\" ? window.scrollX || 0 : 0;\n const scrollY = typeof window !== \"undefined\" ? window.scrollY || 0 : 0;\n return {\n clientX,\n clientY,\n pageX: clientX + scrollX,\n pageY: clientY + scrollY,\n screenX: clientX,\n screenY: clientY,\n };\n };\n\n /**\n * Checks if user currently has active text selected inside the target row or container.\n */\n const hasTextSelection = (target?: HTMLElement | null): boolean => {\n if (typeof window === \"undefined\") return false;\n const selection = window.getSelection();\n if (!selection || selection.isCollapsed || !selection.toString().trim()) {\n return false;\n }\n if (target && selection.anchorNode && selection.focusNode) {\n const container =\n target.closest(\".k-table-row\") || target.closest(\".k-grid\") || target;\n const anchorParent =\n selection.anchorNode.nodeType === Node.ELEMENT_NODE\n ? (selection.anchorNode as HTMLElement)\n : selection.anchorNode.parentElement;\n const focusParent =\n selection.focusNode.nodeType === Node.ELEMENT_NODE\n ? (selection.focusNode as HTMLElement)\n : selection.focusNode.parentElement;\n const isAnchorInside = !!(\n anchorParent && container.contains(anchorParent)\n );\n const isFocusInside = !!(focusParent && container.contains(focusParent));\n return isAnchorInside || isFocusInside;\n }\n return true;\n };\n\n /**\n * Primary handler for Kendo Grid `@rowclick` event.\n */\n const handleRowClick = (event: GridRowClickEvent<T>): void => {\n const nativeEvent =\n (event as any)?.htmlEvent ||\n (event as any)?.event ||\n (event as any)?.nativeEvent ||\n (event instanceof Event ? event : undefined);\n\n // Only allow primary (left) mouse clicks\n if (\n nativeEvent &&\n nativeEvent.button !== undefined &&\n nativeEvent.button !== 0\n ) {\n return;\n }\n\n // Guard against ignored child element targets\n const target = (nativeEvent?.target ||\n (event as any)?.target) as HTMLElement | null;\n if (\n target &&\n isIgnoredTarget(target, nativeEvent || (event as unknown as Event))\n ) {\n return;\n }\n\n // Guard against active text highlighting / selection within the row/grid\n if (hasTextSelection(target)) {\n return;\n }\n\n const context: RowActionContext<T> = {\n dataItem: event.dataItem,\n rowIndex: event.rowIndex ?? resolveRowIndex(target),\n field: event.field,\n event: nativeEvent || (event as unknown as Event),\n triggerType: \"click\",\n ctrlKey: !!nativeEvent?.ctrlKey,\n shiftKey: !!nativeEvent?.shiftKey,\n metaKey: !!nativeEvent?.metaKey,\n altKey: !!nativeEvent?.altKey,\n coordinates:\n getEventCoordinates(nativeEvent) ?? getElementCoordinates(target),\n };\n\n onRowAction(event.dataItem, context);\n };\n\n /**\n * Primary handler for Grid `@keydown` event (Enter / Space on row).\n */\n const handleRowKeyDown = (\n event: KeyboardEvent,\n explicitDataItem?: T,\n ): void => {\n if (!enableKeyboardAction) return;\n\n const key = event.key || event.code;\n const isActivationKey =\n key === \"Enter\" ||\n key === \"NumpadEnter\" ||\n key === \" \" ||\n key === \"Space\" ||\n event.code === \"Enter\" ||\n event.code === \"NumpadEnter\" ||\n event.code === \"Space\";\n\n if (!isActivationKey) return;\n\n const target = event.target as HTMLElement | null;\n if (!target) return;\n\n // Check if event target is inside a data row\n const rowEl = target.closest(\n \".k-table-row[data-grid-row-index], .k-table-row\",\n ) as HTMLElement | null;\n if (!rowEl) return;\n\n // Guard against ignored child element targets\n if (isIgnoredTarget(target, event)) {\n return;\n }\n\n // Prevent default scrolling or unintended form submissions on Space / Enter\n event.preventDefault();\n event.stopPropagation();\n\n // Resolve row index from DOM attribute if available\n const rowIndexAttr = rowEl.getAttribute(\"data-grid-row-index\");\n const rowIndex =\n rowIndexAttr !== null ? parseInt(rowIndexAttr, 10) : undefined;\n\n // Resolve data item: explicitDataItem -> dataItems option -> gridRef option\n let resolvedDataItem: T | undefined = explicitDataItem;\n\n if (resolvedDataItem === undefined) {\n const itemsList =\n (Array.isArray(dataItems) ? dataItems : dataItems?.value) ||\n (gridRef?.value as any)?.props?.dataItems ||\n (gridRef?.value as any)?.dataItems;\n\n if (\n itemsList &&\n rowIndex !== undefined &&\n rowIndex >= 0 &&\n rowIndex < itemsList.length\n ) {\n resolvedDataItem = itemsList[rowIndex];\n }\n }\n\n if (resolvedDataItem === undefined) return;\n\n const context: RowActionContext<T> = {\n dataItem: resolvedDataItem,\n rowIndex,\n event,\n triggerType: \"keyboard\",\n ctrlKey: !!event.ctrlKey,\n shiftKey: !!event.shiftKey,\n metaKey: !!event.metaKey,\n altKey: !!event.altKey,\n coordinates: getElementCoordinates(rowEl),\n };\n\n onRowAction(resolvedDataItem, context);\n };\n\n return {\n handleRowClick,\n handleRowKeyDown,\n isIgnoredTarget,\n };\n};\n","import { computed, nextTick, ref } from \"vue\";\nimport type { ComputedRef, Ref } from \"vue\";\nimport type { TextBoxChangeEvent } from \"@progress/kendo-vue-inputs\";\n\nconst DEFAULT_ZIP_ERROR_MESSAGE =\n \"Enter a valid ZIP code with exactly 5 or 9 digits.\";\n\nconst formatZipDisplay = (input: string): string => {\n const digits = input.replace(/\\D/g, \"\").slice(0, 9);\n return digits.length > 5\n ? `${digits.slice(0, 5)}-${digits.slice(5)}`\n : digits;\n};\n\n// Translate a formatted caret into the number of ZIP digits before it.\nconst countDigitsBeforeIndex = (value: string, index: number): number => {\n return value.slice(0, Math.max(0, index)).replace(/\\D/g, \"\").length;\n};\n\n// Map a digit index back to the formatted ZIP display position.\nconst digitIndexToDisplayIndex = (digitIndex: number): number => {\n if (digitIndex <= 5) {\n return digitIndex;\n }\n\n return Math.min(digitIndex + 1, 10);\n};\n\nexport type ZipPayload = {\n zip: string;\n};\n\nexport type UseZipTextBoxOptions = {\n /** The `id` of the Kendo `TextBox` input element. Must match the `id` prop\n * passed to `<TextBox>`. Used by `submitAndValidate({ focus: true })` to focus\n * the field when validation fails. */\n id: string;\n initialValue?: string;\n errorMessage?: string;\n required?: boolean;\n};\n\nexport type UseZipTextBoxState = {\n zipDisplay: Ref<string>;\n submitted: Ref<boolean>;\n errorMessage: Ref<string>;\n};\n\nexport type UseZipTextBoxBindings = {\n /** Bind to `:wrapperClass` on `<TextBox>` so Kendo applies `fk-zip-textbox`\n * to its wrapper element on every render — no manual DOM manipulation needed. */\n readonly wrapperClass: string;\n};\n\nexport type UseZipTextBoxDerived = {\n readonly zipRaw: ComputedRef<string>;\n readonly isZipValid: ComputedRef<boolean>;\n readonly showZipError: ComputedRef<boolean>;\n readonly textBoxValid: ComputedRef<boolean>;\n readonly textBoxValidate: ComputedRef<boolean>;\n};\n\nexport type UseZipTextBoxActions = {\n handleZipInput: (...args: unknown[]) => void;\n submitAndValidate: (opts?: { focus?: boolean }) => boolean;\n buildPayload: () => ZipPayload;\n};\n\nexport type UseZipTextBoxApi = {} & UseZipTextBoxState &\n UseZipTextBoxBindings &\n UseZipTextBoxDerived &\n UseZipTextBoxActions;\n\nexport const useZipTextBox = (\n options: UseZipTextBoxOptions,\n): UseZipTextBoxApi => {\n const zipDisplay = ref(formatZipDisplay(options.initialValue ?? \"\"));\n const submitted = ref(false);\n const errorMessage = ref(\n options.errorMessage?.trim() || DEFAULT_ZIP_ERROR_MESSAGE,\n );\n\n const zipRaw = computed(() => zipDisplay.value.replace(/\\D/g, \"\"));\n const isZipValid = computed(() => {\n const length = zipRaw.value.length;\n return length === 5 || length === 9;\n });\n const showZipError = computed(() => submitted.value && !isZipValid.value);\n const textBoxValid = computed(() => !submitted.value || isZipValid.value);\n const textBoxValidate = computed(() => submitted.value);\n\n // Restore the caret after Vue re-renders the formatted ZIP value.\n const restoreCaret = (\n inputElement: HTMLInputElement,\n digitIndex: number,\n ): void => {\n const caretIndex = digitIndexToDisplayIndex(digitIndex);\n\n nextTick(() => {\n if (!inputElement.isConnected) {\n return;\n }\n\n inputElement.setSelectionRange(caretIndex, caretIndex);\n });\n };\n\n const handleZipInput = (...args: unknown[]) => {\n const event = args[0] as TextBoxChangeEvent | undefined;\n const nativeEvent = event?.event as InputEvent | undefined;\n const inputElement = nativeEvent?.target as HTMLInputElement | null;\n const nextValue = event?.value;\n const inputValue = Array.isArray(nextValue)\n ? nextValue.join(\"\")\n : String(nextValue ?? \"\");\n\n // Capture the caret before rewriting the controlled value.\n const digitIndex =\n inputElement?.selectionStart !== undefined &&\n inputElement.selectionStart !== null\n ? countDigitsBeforeIndex(\n inputElement.value,\n inputElement.selectionStart,\n )\n : inputValue.replace(/\\D/g, \"\").length;\n\n zipDisplay.value = formatZipDisplay(inputValue);\n\n // Put the caret back where the user was typing.\n if (inputElement) {\n restoreCaret(inputElement, digitIndex);\n }\n };\n\n const submitAndValidate = (opts?: { focus?: boolean }): boolean => {\n submitted.value = true;\n const valid = isZipValid.value;\n if (!valid && opts?.focus) {\n nextTick(() => {\n const inputEl = document.getElementById(\n options.id,\n ) as HTMLInputElement | null;\n inputEl?.focus();\n });\n }\n return valid;\n };\n\n const buildPayload = (): ZipPayload => {\n return { zip: zipRaw.value };\n };\n\n return {\n // writable state\n zipDisplay,\n submitted,\n errorMessage,\n // bindings\n wrapperClass: \"fk-zip-textbox\",\n // derived state\n zipRaw,\n isZipValid,\n showZipError,\n textBoxValid,\n textBoxValidate,\n // actions\n handleZipInput,\n submitAndValidate,\n buildPayload,\n };\n};\n","import { ref, watchEffect } from \"vue\";\nimport type { Ref } from \"vue\";\n\nexport interface UseFieldsetTouchTrackerOptions {\n /**\n * Function that returns whether the fieldset is valid.\n */\n isValid: () => boolean;\n}\n\nexport interface UseFieldsetTouchTrackerApi {\n touched: Ref<boolean>;\n onFocusout: (event: FocusEvent) => void;\n reset: () => void;\n}\n\nexport function useFieldsetTouchTracker(\n fieldsetRef: Ref<HTMLFieldSetElement | null>,\n options: UseFieldsetTouchTrackerOptions,\n): UseFieldsetTouchTrackerApi {\n const touched = ref(false);\n\n // Keep aria-invalid synchronized with the composed validator function.\n watchEffect(() => {\n fieldsetRef.value?.setAttribute(\"aria-invalid\", String(!options.isValid()));\n });\n\n function onFocusout(event: FocusEvent) {\n const fieldset =\n fieldsetRef.value ?? (event.currentTarget as HTMLElement | null);\n const next = event.relatedTarget as Node | null;\n\n if (!fieldset || !fieldset.contains(next)) {\n touched.value = true;\n }\n }\n\n function reset() {\n touched.value = false;\n }\n\n return { touched, onFocusout, reset };\n}\n","import {\n computed,\n ref,\n toValue,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\nimport { useFieldsetTouchTracker } from \"./useFieldsetTouchTracker\";\n\nexport interface UseFieldsetValidationKitOptions {\n /**\n * Consumer-owned submit state. The kit reads this value but never mutates it.\n */\n submitted: MaybeRefOrGetter<boolean>;\n /**\n * Returns the real validity of the fieldset when validation is active.\n */\n isValid: () => boolean;\n}\n\n/**\n * API returned by {@link useFieldsetValidationKit}.\n */\nexport interface UseFieldsetValidationKitApi {\n /**\n * Becomes true after the first focus transition that leaves the fieldset.\n */\n touched: Ref<boolean>;\n /**\n * Delayed validation gate. True when either submitted or touched is true.\n */\n fieldsetValidate: ComputedRef<boolean>;\n /**\n * Forwards fieldset focusout events to the internal touch tracker.\n */\n onFocusout: (event: FocusEvent) => void;\n /**\n * Clears touched state and suppresses one immediate post-reset focusout.\n *\n * This avoids re-activating delayed validation from reset-related focus\n * transitions (for example, clicking Reset while an input is focused).\n */\n reset: () => void;\n /**\n * Wraps a field-level validity source with delayed validation behavior.\n */\n createFieldValidity: (\n isValid: MaybeRefOrGetter<boolean>,\n ) => ComputedRef<boolean>;\n /**\n * Builds a named map of delayed field validity refs for ergonomic form setup.\n */\n createFieldValidationsMap: <\n T extends Record<string, MaybeRefOrGetter<boolean>>,\n >(\n isValidMap: T,\n ) => { [K in keyof T]: ComputedRef<boolean> };\n /**\n * Moves focus to the first invalid Kendo control found within the provided form.\n */\n focusFirstInvalidField: (\n formRef: MaybeRefOrGetter<HTMLFormElement | null>,\n ) => void;\n}\n\n/**\n * Orchestrates delayed fieldset validation using submit state and touch state.\n *\n * Intended as the primary form-level API for gated validity UX:\n * - validation displays after submit or first fieldset exit\n * - field-level validity can be composed through helper factories\n * - invalid focus and reset behavior are handled consistently\n *\n * @param fieldsetRef Reference to the fieldset whose focus transitions are tracked.\n * @param options Consumer-provided submit state and base validity function.\n * @returns Validation kit API for wiring fieldset-level and field-level behavior.\n */\nexport function useFieldsetValidationKit(\n fieldsetRef: Ref<HTMLFieldSetElement | null>,\n options: UseFieldsetValidationKitOptions,\n): UseFieldsetValidationKitApi {\n const touched = ref(false);\n // After reset, browser/UI focus can emit an immediate focusout that does not\n // represent a user intentionally leaving the fieldset. Ignore exactly one\n // focusout to prevent delayed validation from re-arming right away.\n const suppressNextTouch = ref(false);\n const fieldsetValidate = computed(\n () => toValue(options.submitted) || touched.value,\n );\n\n // Computes the effective validity of the fieldset, taking into account the\n // delayed validation gate.\n const fieldsetIsValid = computed(() => {\n return !fieldsetValidate.value || options.isValid();\n });\n\n // Initializes the internal touch tracker for the fieldset.\n const tracker = useFieldsetTouchTracker(fieldsetRef, {\n isValid: () => fieldsetIsValid.value,\n });\n\n // Creates a delayed validity ref for a single field based on the fieldset's\n // validation state.\n function createFieldValidity(isValid: MaybeRefOrGetter<boolean>) {\n return computed(() => !fieldsetValidate.value || toValue(isValid));\n }\n\n // Builds a named map of delayed field validity refs from the provided validity map.\n // (e.g. { firstName: () => firstNameValid, lastName: () => lastNameValid })\n // show example map?\n // Example usage:\n // const fieldValidations = createFieldValidationsMap({\n // firstName: () => firstNameValid,\n // lastName: () => lastNameValid,\n // });\n // The returned object will have the same keys as the input map, but each value will\n // be a computed ref that reflects the delayed validation state.\n function createFieldValidationsMap<\n T extends Record<string, MaybeRefOrGetter<boolean>>,\n >(isValidMap: T) {\n return Object.fromEntries(\n Object.entries(isValidMap).map(([key, isValid]) => [\n key,\n createFieldValidity(isValid),\n ]),\n ) as { [K in keyof T]: ComputedRef<boolean> };\n }\n\n // Focuses the first invalid field within the provided FORM.\n // TODO: Leaving this here for now as a convenience, but it does not belong\n // in the core validation kit. This should be its own composable or utility\n // function. I may move this to USAddress component-specific logic.\n function focusFirstInvalidField(\n formRef: MaybeRefOrGetter<HTMLFormElement | null>,\n ) {\n const form = toValue(formRef);\n if (!form) return;\n\n const firstInvalid = form.querySelector(\n '.k-invalid input, .k-invalid[tabindex=\"0\"]',\n ) as HTMLElement | null;\n\n firstInvalid?.focus();\n }\n\n // Forwards fieldset focusout events to the internal touch tracker.\n function onFocusout(event: FocusEvent) {\n if (suppressNextTouch.value) {\n // Consume the first post-reset focusout caused by reset/click focus\n // churn.\n suppressNextTouch.value = false;\n return;\n }\n\n tracker.onFocusout(event);\n\n if (tracker.touched.value) {\n touched.value = true;\n }\n }\n\n // Resets the touched state and suppresses one immediate post-reset focusout.\n function reset() {\n touched.value = false;\n suppressNextTouch.value = true;\n tracker.reset();\n }\n\n return {\n touched,\n fieldsetValidate,\n onFocusout,\n reset,\n createFieldValidity,\n createFieldValidationsMap,\n focusFirstInvalidField,\n };\n}\n","export type UsStateOption = {\n label: string;\n value: string;\n};\n\nexport const US_STATES_BY_ABBREVIATION: UsStateOption[] = [\n { label: \"Alabama\", value: \"AL\" },\n { label: \"Alaska\", value: \"AK\" },\n { label: \"Arizona\", value: \"AZ\" },\n { label: \"Arkansas\", value: \"AR\" },\n { label: \"California\", value: \"CA\" },\n { label: \"Colorado\", value: \"CO\" },\n { label: \"Connecticut\", value: \"CT\" },\n { label: \"Delaware\", value: \"DE\" },\n { label: \"Florida\", value: \"FL\" },\n { label: \"Georgia\", value: \"GA\" },\n { label: \"Hawaii\", value: \"HI\" },\n { label: \"Idaho\", value: \"ID\" },\n { label: \"Illinois\", value: \"IL\" },\n { label: \"Indiana\", value: \"IN\" },\n { label: \"Iowa\", value: \"IA\" },\n { label: \"Kansas\", value: \"KS\" },\n { label: \"Kentucky\", value: \"KY\" },\n { label: \"Louisiana\", value: \"LA\" },\n { label: \"Maine\", value: \"ME\" },\n { label: \"Maryland\", value: \"MD\" },\n { label: \"Massachusetts\", value: \"MA\" },\n { label: \"Michigan\", value: \"MI\" },\n { label: \"Minnesota\", value: \"MN\" },\n { label: \"Mississippi\", value: \"MS\" },\n { label: \"Missouri\", value: \"MO\" },\n { label: \"Montana\", value: \"MT\" },\n { label: \"Nebraska\", value: \"NE\" },\n { label: \"Nevada\", value: \"NV\" },\n { label: \"New Hampshire\", value: \"NH\" },\n { label: \"New Jersey\", value: \"NJ\" },\n { label: \"New Mexico\", value: \"NM\" },\n { label: \"New York\", value: \"NY\" },\n { label: \"North Carolina\", value: \"NC\" },\n { label: \"North Dakota\", value: \"ND\" },\n { label: \"Ohio\", value: \"OH\" },\n { label: \"Oklahoma\", value: \"OK\" },\n { label: \"Oregon\", value: \"OR\" },\n { label: \"Pennsylvania\", value: \"PA\" },\n { label: \"Rhode Island\", value: \"RI\" },\n { label: \"South Carolina\", value: \"SC\" },\n { label: \"South Dakota\", value: \"SD\" },\n { label: \"Tennessee\", value: \"TN\" },\n { label: \"Texas\", value: \"TX\" },\n { label: \"Utah\", value: \"UT\" },\n { label: \"Vermont\", value: \"VT\" },\n { label: \"Virginia\", value: \"VA\" },\n { label: \"Washington\", value: \"WA\" },\n { label: \"West Virginia\", value: \"WV\" },\n { label: \"Wisconsin\", value: \"WI\" },\n { label: \"Wyoming\", value: \"WY\" },\n];\n","import { reactive } from \"vue\";\n\nexport interface USAddressFormData {\n address1: string;\n address2: string;\n city: string;\n state: string | null;\n zip: string;\n}\n\n/**\n * Reads the value from an input event payload.\n * @param payload - The input event payload.\n * @returns The string value of the input.\n */\nfunction readInputValue(payload: unknown): string {\n if (payload && typeof payload === \"object\" && \"value\" in payload) {\n const value = (payload as { value: unknown }).value;\n return typeof value === \"string\" ? value : String(value ?? \"\");\n }\n return \"\";\n}\n\n/**\n * Manages the form data model for a US address.\n *\n * Note: this is internal UI data state, not just the US \"state\" (AL, CA, etc.) field.\n * @returns An object containing form data and field event handlers.\n */\nexport function useUSAddressFormData() {\n const formData = reactive<USAddressFormData>({\n address1: \"\",\n address2: \"\",\n city: \"\",\n state: null,\n zip: \"\",\n });\n\n const onAddress1Input = (...args: unknown[]) => {\n formData.address1 = readInputValue(args[0]);\n };\n\n const onAddress2Input = (...args: unknown[]) => {\n formData.address2 = readInputValue(args[0]);\n };\n\n const onCityInput = (...args: unknown[]) => {\n formData.city = readInputValue(args[0]);\n };\n\n const onStateChange = (event: { value: string | null }) => {\n formData.state = event.value;\n };\n\n const resetFormData = () => {\n formData.address1 = \"\";\n formData.address2 = \"\";\n formData.city = \"\";\n formData.state = null;\n formData.zip = \"\";\n };\n\n return {\n formData,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n resetFormData,\n };\n}\n","import { watch } from \"vue\";\nimport { useZipTextBox } from \"./useZipTextBox\";\nimport type { USAddressFormData } from \"./_useUSAddressFormData\";\n\n/**\n * Manages the ZIP code field for a US address.\n * @param formData - The form data object containing the ZIP code.\n * @returns An object containing ZIP code display, validity, wrapper class, input handler, and reset function.\n */\nexport function useUSAddressZip(\n formData: USAddressFormData,\n zipInputId = \"zip\",\n) {\n const zipField = useZipTextBox({ id: zipInputId });\n const {\n zipDisplay,\n zipRaw,\n isZipValid,\n wrapperClass: zipWrapperClass,\n handleZipInput: onZipInput,\n } = zipField;\n\n watch(zipRaw, (value) => {\n formData.zip = value;\n });\n\n const resetZip = () => {\n zipDisplay.value = \"\";\n formData.zip = \"\";\n };\n\n return {\n zipDisplay,\n isZipValid,\n zipWrapperClass,\n onZipInput,\n resetZip,\n };\n}\n","import { computed, toValue, type MaybeRefOrGetter } from \"vue\";\nimport type { USAddressFormData } from \"./_useUSAddressFormData\";\n\ninterface UseUSAddressValidationOptions {\n formData: USAddressFormData;\n isZipValid: MaybeRefOrGetter<boolean>;\n}\n\n/**\n * Manages the validation state for a US address.\n * @param options - The options object containing form data and ZIP code validity.\n * @returns An object containing validation state for each field and the overall address.\n */\nexport function useUSAddressValidation(options: UseUSAddressValidationOptions) {\n /**\n * Strict validity values represent the actual rule outcomes for each field,\n * independent of whether validation messages are currently shown in the UI.\n */\n const strictAddress1Valid = computed(\n () => options.formData.address1.trim() !== \"\",\n );\n const strictCityValid = computed(() => options.formData.city.trim() !== \"\");\n const strictStateValid = computed(() => !!options.formData.state);\n const strictZipValid = computed(() => toValue(options.isZipValid));\n\n const strictAddressValid = computed(\n () =>\n strictAddress1Valid.value &&\n strictCityValid.value &&\n strictStateValid.value &&\n strictZipValid.value,\n );\n\n return {\n strictAddress1Valid,\n strictCityValid,\n strictStateValid,\n strictZipValid,\n strictAddressValid,\n };\n}\n","import {\n computed,\n nextTick,\n ref,\n toValue,\n watch,\n watchEffect,\n type MaybeRefOrGetter,\n} from \"vue\";\nimport { useFieldsetValidationKit } from \"../form/useFieldsetValidationKit\";\nimport { US_STATES_BY_ABBREVIATION } from \"./usStates\";\nimport { useUSAddressFormData } from \"./_useUSAddressFormData\";\nimport { useUSAddressZip } from \"./_useUSAddressZip\";\nimport { useUSAddressValidation } from \"./_useUSAddressValidation\";\n\ninterface UseUSAddressOptions {\n fieldsetRef: MaybeRefOrGetter<HTMLFieldSetElement | null>;\n addressId: string;\n required?: MaybeRefOrGetter<boolean>;\n}\n\nexport interface USAddressSubmitPayload {\n address1: string;\n address2: string;\n city: string;\n state: string;\n zip: string;\n}\n\n/**\n * Focuses the first invalid input within a container.\n * @param container - The container element to search within.\n */\nfunction focusFirstInvalid(container: HTMLElement | null) {\n if (!container) return;\n const target = container.querySelector<HTMLElement>(\n '.k-invalid input, .k-invalid[tabindex=\"0\"]',\n );\n target?.focus();\n}\n\nfunction focusoutLeavesFieldset(\n fieldsetRef: HTMLFieldSetElement | null,\n event: FocusEvent,\n) {\n const fieldset = fieldsetRef ?? (event.currentTarget as HTMLElement | null);\n const next = event.relatedTarget as Node | null;\n\n return !fieldset || !fieldset.contains(next);\n}\n\n/**\n * Composable for managing a US address form.\n * @param options - The options object containing fieldset reference and address id.\n * @returns An object containing form state, validation state, and handlers.\n */\nexport function useUSAddress(options: UseUSAddressOptions) {\n const fieldsetRef = ref<HTMLFieldSetElement | null>(\n toValue(options.fieldsetRef),\n );\n\n watchEffect(() => {\n fieldsetRef.value = toValue(options.fieldsetRef);\n });\n\n const submitted = ref(false);\n const optionalFeedbackReviewed = ref(false);\n const isRequired = computed(() => toValue(options.required) ?? true);\n const {\n formData,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n resetFormData,\n } = useUSAddressFormData();\n\n const zipInputId = `${options.addressId}-zip`;\n\n const { zipDisplay, isZipValid, zipWrapperClass, onZipInput, resetZip } =\n useUSAddressZip(formData, zipInputId);\n\n const {\n strictAddress1Valid,\n strictCityValid,\n strictStateValid,\n strictZipValid,\n strictAddressValid,\n } = useUSAddressValidation({\n formData,\n isZipValid,\n });\n\n const validationKit = useFieldsetValidationKit(fieldsetRef, {\n submitted,\n isValid: () => strictAddressValid.value,\n });\n\n const { touched, fieldsetValidate, onFocusout, reset } = validationKit;\n\n const fieldValidations = validationKit.createFieldValidationsMap({\n address1: strictAddress1Valid,\n city: strictCityValid,\n state: strictStateValid,\n zip: strictZipValid,\n address: strictAddressValid,\n });\n\n const {\n address1: rawAddress1Valid,\n city: rawCityValid,\n state: rawStateValid,\n zip: rawZipValid,\n address: rawAddressValid,\n } = fieldValidations;\n\n const addressValidate = computed(() =>\n isRequired.value ? fieldsetValidate.value : false,\n );\n\n const address1Valid = computed(() =>\n isRequired.value ? rawAddress1Valid.value : true,\n );\n\n const cityValid = computed(() =>\n isRequired.value ? rawCityValid.value : true,\n );\n\n const stateValid = computed(() =>\n isRequired.value ? rawStateValid.value : true,\n );\n\n const zipValid = computed(() =>\n isRequired.value ? rawZipValid.value : true,\n );\n\n const addressValid = computed(() =>\n isRequired.value ? rawAddressValid.value : true,\n );\n\n const stateDefaultItem = { value: null, label: \"State\" };\n const stateOptions = US_STATES_BY_ABBREVIATION.map(({ label, value }) => ({\n label,\n value,\n }));\n\n const normalizedPayload = computed<USAddressSubmitPayload>(() => ({\n address1: formData.address1.trim(),\n address2: formData.address2.trim(),\n city: formData.city.trim(),\n state: (formData.state ?? \"\").trim().toUpperCase(),\n zip: formData.zip.replace(/\\D/g, \"\"),\n }));\n\n const isAddressEmpty = computed(() => {\n return (\n formData.address1.trim() === \"\" &&\n formData.address2.trim() === \"\" &&\n formData.city.trim() === \"\" &&\n (formData.state ?? \"\").trim() === \"\" &&\n formData.zip.replace(/\\D/g, \"\") === \"\"\n );\n });\n\n /**\n * Indicates whether any input has been provided in the optional address fields.\n * @returns True if any address field has input, false otherwise.\n */\n const optionalAddressHasAnyInput = computed(() => !isAddressEmpty.value);\n\n /**\n * Indicates whether any required fields are missing in the optional address section.\n * @returns True if any required field is missing, false otherwise.\n */\n const optionalMissingRequiredFields = computed(() => {\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n (!strictAddress1Valid.value ||\n !strictCityValid.value ||\n !strictStateValid.value)\n );\n });\n\n /**\n * Indicates whether the optional zip code field is invalid.\n * @returns True if the zip code is invalid, false otherwise.\n */\n const optionalZipInvalid = computed(() => {\n const zipDigits = formData.zip.replace(/\\D/g, \"\");\n\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n zipDigits.length !== 5 &&\n zipDigits.length !== 9\n );\n });\n\n /**\n * Indicates whether any part of the optional address is invalid.\n * @returns True if any part of the optional address is invalid, false otherwise.\n */\n const optionalPartialInvalid = computed(() => {\n return (\n !isRequired.value &&\n optionalAddressHasAnyInput.value &&\n !strictAddressValid.value\n );\n });\n\n /**\n * Indicates whether optional address feedback should be active.\n * @returns True if feedback should be active, false otherwise.\n */\n const optionalFeedbackActive = computed(() => {\n return (\n !isRequired.value &&\n optionalPartialInvalid.value &&\n (optionalFeedbackReviewed.value || submitted.value)\n );\n });\n\n // Resets the optional feedback reviewed state when the normalized payload\n // changes and the address is not required.\n watch(normalizedPayload, () => {\n if (!isRequired.value) {\n optionalFeedbackReviewed.value = false;\n }\n });\n\n watch(isRequired, (required) => {\n if (!required) {\n submitted.value = false;\n optionalFeedbackReviewed.value = false;\n reset();\n }\n });\n\n /**\n * Validates address state for parent-owned submit flow.\n * Activates UI error visibility.\n * @returns An object containing the validity status and the normalized payload.\n */\n const validateForSubmit = async () => {\n if (!isRequired.value) {\n if (isAddressEmpty.value || strictAddressValid.value) {\n submitted.value = false;\n return {\n isValid: true as const,\n payload: normalizedPayload.value,\n };\n }\n\n submitted.value = true;\n return { isValid: false as const, payload: null };\n }\n\n submitted.value = true;\n\n if (!strictAddressValid.value) {\n await nextTick();\n focusFirstInvalid(fieldsetRef.value);\n return { isValid: false as const, payload: null };\n }\n\n return {\n isValid: true as const,\n payload: normalizedPayload.value,\n };\n };\n\n /**\n * Resets the US address form.\n * Deactivates UI error visibility.\n */\n const resetAddress = () => {\n submitted.value = false;\n optionalFeedbackReviewed.value = false;\n reset();\n resetFormData();\n resetZip();\n };\n\n const onFieldsetFocusout = (event: FocusEvent) => {\n const leftFieldset = focusoutLeavesFieldset(fieldsetRef.value, event);\n\n onFocusout(event);\n\n if (!isRequired.value && leftFieldset) {\n optionalFeedbackReviewed.value = true;\n }\n };\n\n return {\n formData,\n submitted,\n touched,\n addressValidate,\n address1Valid,\n cityValid,\n stateValid,\n zipValid,\n addressValid,\n optionalFeedbackActive,\n optionalPartialInvalid,\n optionalMissingRequiredFields,\n optionalZipInvalid,\n stateDefaultItem,\n stateOptions,\n zipDisplay,\n zipWrapperClass,\n onAddress1Input,\n onAddress2Input,\n onCityInput,\n onStateChange,\n onZipInput,\n onFieldsetFocusout,\n normalizedPayload,\n validateForSubmit,\n reset: resetAddress,\n };\n}\n","/** A corner/center alignment pair, independent of any specific composable. */\nexport type GeometryAlign = {\n horizontal: \"left\" | \"center\" | \"right\";\n vertical: \"top\" | \"center\" | \"bottom\";\n};\n\n/** A rectangular clipping region (viewport or a scrollable container's rect). */\nexport type GeometryBounds = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n};\n\nexport type GeometryCollisionType = \"fit\" | \"flip\";\n\nexport type GeometryCollision = {\n horizontal: GeometryCollisionType;\n vertical: GeometryCollisionType;\n};\n\nexport type ComputeCollisionOffsetInput = {\n /** The anchor rect (or a zero-size point rect for a click/keyboard activation). */\n anchor: DOMRect;\n /** The popup's own measured size, or `null` before it has been measured. */\n popup: DOMRect | null;\n /** Point on the anchor that the popup is positioned from. */\n anchorAlign: GeometryAlign;\n /** Point on the popup that is placed at the computed anchor point. */\n popupAlign: GeometryAlign;\n /** Clipping bounds checked for overflow; same coordinate space as `anchor`. */\n bounds: GeometryBounds;\n /** Per-axis collision behavior applied when the preferred corner overflows. */\n collision: GeometryCollision;\n};\n\nconst flipHorizontal = (\n horizontal: GeometryAlign[\"horizontal\"],\n): GeometryAlign[\"horizontal\"] =>\n horizontal === \"left\" ? \"right\" : horizontal === \"right\" ? \"left\" : \"center\";\n\nconst flipVertical = (\n vertical: GeometryAlign[\"vertical\"],\n): GeometryAlign[\"vertical\"] =>\n vertical === \"top\" ? \"bottom\" : vertical === \"bottom\" ? \"top\" : \"center\";\n\nconst computeCorner = (\n anchor: DOMRect,\n popup: DOMRect | null,\n anchorAlign: GeometryAlign,\n popupAlign: GeometryAlign,\n) => {\n const anchorX =\n anchor.left +\n (anchorAlign.horizontal === \"right\"\n ? anchor.width\n : anchorAlign.horizontal === \"center\"\n ? anchor.width / 2\n : 0);\n const anchorY =\n anchor.top +\n (anchorAlign.vertical === \"bottom\"\n ? anchor.height\n : anchorAlign.vertical === \"center\"\n ? anchor.height / 2\n : 0);\n\n const popupOffsetX = popup\n ? popupAlign.horizontal === \"right\"\n ? popup.width\n : popupAlign.horizontal === \"center\"\n ? popup.width / 2\n : 0\n : 0;\n const popupOffsetY = popup\n ? popupAlign.vertical === \"bottom\"\n ? popup.height\n : popupAlign.vertical === \"center\"\n ? popup.height / 2\n : 0\n : 0;\n\n return { left: anchorX - popupOffsetX, top: anchorY - popupOffsetY };\n};\n\nconst fitAxis = (\n position: number,\n size: number,\n start: number,\n end: number,\n) => {\n if (size >= end - start) return start;\n return Math.min(Math.max(position, start), end - size);\n};\n\n/**\n * Computes a popup's top-left corner from an anchor rect and alignment pair,\n * then applies Kendo-style `fit` or `flip` collision behavior independently\n * on each axis. Fit shifts the popup within bounds without changing sides;\n * flip moves it to the anchor's opposite side only when that reduces overflow.\n *\n * Returns the preferred position when `popup` is `null`, since collision\n * behavior cannot be calculated before the popup has been measured.\n */\nexport const computeCollisionOffset = ({\n anchor,\n popup,\n anchorAlign,\n popupAlign,\n bounds,\n collision,\n}: ComputeCollisionOffsetInput): { left: number; top: number } => {\n const preferred = computeCorner(anchor, popup, anchorAlign, popupAlign);\n if (!popup) return preferred;\n\n let { left, top } = preferred;\n\n if (collision.horizontal === \"fit\") {\n left = fitAxis(left, popup.width, bounds.left, bounds.right);\n } else {\n const overflowsRight = left + popup.width - bounds.right;\n const overflowsLeft = bounds.left - left;\n if (overflowsRight > 0 || overflowsLeft > 0) {\n const flipped = computeCorner(\n anchor,\n popup,\n {\n horizontal: flipHorizontal(anchorAlign.horizontal),\n vertical: anchorAlign.vertical,\n },\n {\n horizontal: flipHorizontal(popupAlign.horizontal),\n vertical: popupAlign.vertical,\n },\n );\n const currentOverflow =\n Math.max(overflowsRight, 0) + Math.max(overflowsLeft, 0);\n const flippedOverflow =\n Math.max(flipped.left + popup.width - bounds.right, 0) +\n Math.max(bounds.left - flipped.left, 0);\n if (flippedOverflow < currentOverflow) left = flipped.left;\n }\n }\n\n if (collision.vertical === \"fit\") {\n top = fitAxis(top, popup.height, bounds.top, bounds.bottom);\n } else {\n const overflowsBottom = top + popup.height - bounds.bottom;\n const overflowsTop = bounds.top - top;\n if (overflowsBottom > 0 || overflowsTop > 0) {\n const flipped = computeCorner(\n anchor,\n popup,\n {\n horizontal: anchorAlign.horizontal,\n vertical: flipVertical(anchorAlign.vertical),\n },\n {\n horizontal: popupAlign.horizontal,\n vertical: flipVertical(popupAlign.vertical),\n },\n );\n const currentOverflow =\n Math.max(overflowsBottom, 0) + Math.max(overflowsTop, 0);\n const flippedOverflow =\n Math.max(flipped.top + popup.height - bounds.bottom, 0) +\n Math.max(bounds.top - flipped.top, 0);\n if (flippedOverflow < currentOverflow) top = flipped.top;\n }\n }\n\n return { left, top };\n};\n","import { useId } from \"vue\";\n\n/** A stable segment used to compose a component-scoped DOM identifier. */\nexport type CompositeIdPart = string | number | null | undefined;\n\n/** Values returned by {@link useCompositeId}. */\nexport type UseCompositeIdReturn = {\n /** Unique Vue component-instance identifier, prefixed for FeatherK markup. */\n instanceId: string;\n /** Combines the component instance ID with stable logical identifier segments. */\n compose: (...parts: CompositeIdPart[]) => string;\n};\n\n/**\n * Creates component-scoped DOM identifiers from Vue's SSR-safe `useId()`.\n *\n * Use the resulting `instanceId` for a stable local base and `compose` for\n * related trigger, menu, popup, and ARIA relationship IDs. This does not\n * replace consumer-owned domain IDs used for shared state or registries.\n */\nexport const useCompositeId = (prefix = \"fkid\"): UseCompositeIdReturn => {\n const instanceId = `${prefix}-${useId()}`;\n\n const compose = (...parts: CompositeIdPart[]) =>\n [instanceId, ...parts]\n .filter((part) => part !== null && part !== undefined)\n .map(String)\n .join(\"-\");\n\n return { instanceId, compose };\n};\n","import { computed, customRef, effectScope, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isReactive, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRef as toRef$1, toRefs as toRefs$1, toValue, unref, watch, watchEffect } from \"vue\";\n//#region computedEager/index.ts\n/**\n*\n* @deprecated This function will be removed in future version.\n*\n* Note: If you are using Vue 3.4+, you can straight use computed instead.\n* Because in Vue 3.4+, if computed new value does not change,\n* computed, effect, watch, watchEffect, render dependencies will not be triggered.\n* refer: https://github.com/vuejs/core/pull/5912\n*\n* @param fn effect function\n* @param options WatchOptionsBase\n* @returns readonly shallowRef\n*/\nfunction computedEager(fn, options) {\n\tvar _options$flush;\n\tconst result = shallowRef();\n\twatchEffect(() => {\n\t\tresult.value = fn();\n\t}, {\n\t\t...options,\n\t\tflush: (_options$flush = options === null || options === void 0 ? void 0 : options.flush) !== null && _options$flush !== void 0 ? _options$flush : \"sync\"\n\t});\n\treturn readonly(result);\n}\n/** @deprecated use `computedEager` instead */\nconst eagerComputed = computedEager;\n//#endregion\n//#region computedWithControl/index.ts\n/**\n* Explicitly define the deps of computed.\n*\n* @param source\n* @param fn\n*/\nfunction computedWithControl(source, fn, options = {}) {\n\tlet v = void 0;\n\tlet track;\n\tlet trigger;\n\tlet dirty = true;\n\tconst update = () => {\n\t\tdirty = true;\n\t\ttrigger();\n\t};\n\twatch(source, update, {\n\t\tflush: \"sync\",\n\t\t...options\n\t});\n\tconst get = typeof fn === \"function\" ? fn : fn.get;\n\tconst set = typeof fn === \"function\" ? void 0 : fn.set;\n\tconst result = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tif (dirty) {\n\t\t\t\t\tv = get(v);\n\t\t\t\t\tdirty = false;\n\t\t\t\t}\n\t\t\t\ttrack();\n\t\t\t\treturn v;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset === null || set === void 0 || set(v);\n\t\t\t}\n\t\t};\n\t});\n\tresult.trigger = update;\n\treturn result;\n}\n/** @deprecated use `computedWithControl` instead */\nconst controlledComputed = computedWithControl;\n//#endregion\n//#region createDisposableDirective/index.ts\n/**\n* Utility for authoring disposable directives. Reactive effects created within `mounted` directive hook will be tracked and automatically disposed when directive is unmounted.\n*\n* @see https://vueuse.org/createDisposableDirective\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createDisposableDirective(origin = {}) {\n\tfunction isFunc(fn) {\n\t\treturn typeof fn === \"function\";\n\t}\n\tconst normalisedOrigin = isFunc(origin) ? {\n\t\tmounted: origin,\n\t\tupdated: origin\n\t} : origin;\n\tconst { mounted, unmounted } = normalisedOrigin;\n\tif (!isFunc(mounted)) return origin;\n\tconst scopeWeakMap = /* @__PURE__ */ new WeakMap();\n\treturn {\n\t\t...normalisedOrigin,\n\t\tmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get;\n\t\t\tconst scope = (_scopeWeakMap$get = scopeWeakMap.get(el)) !== null && _scopeWeakMap$get !== void 0 ? _scopeWeakMap$get : effectScope();\n\t\t\tscopeWeakMap.set(el, scope);\n\t\t\tscope.run(() => {\n\t\t\t\tmounted === null || mounted === void 0 || mounted(el, binding, vNode, prevNode);\n\t\t\t});\n\t\t},\n\t\tunmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get2;\n\t\t\t(_scopeWeakMap$get2 = scopeWeakMap.get(el)) === null || _scopeWeakMap$get2 === void 0 || _scopeWeakMap$get2.stop();\n\t\t\tscopeWeakMap.delete(el);\n\t\t\tif (isFunc(unmounted)) unmounted(el, binding, vNode, prevNode);\n\t\t}\n\t};\n}\n//#endregion\n//#region tryOnScopeDispose/index.ts\n/**\n* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing\n*\n* @param fn\n*/\nfunction tryOnScopeDispose(fn, failSilently) {\n\tif (getCurrentScope()) {\n\t\tonScopeDispose(fn, failSilently);\n\t\treturn true;\n\t}\n\treturn false;\n}\n//#endregion\n//#region createEventHook/index.ts\n/**\n* Utility for creating event hooks\n*\n* @see https://vueuse.org/createEventHook\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createEventHook() {\n\tconst fns = /* @__PURE__ */ new Set();\n\tconst off = (fn) => {\n\t\tfns.delete(fn);\n\t};\n\tconst clear = () => {\n\t\tfns.clear();\n\t};\n\tconst on = (fn) => {\n\t\tfns.add(fn);\n\t\tconst offFn = () => off(fn);\n\t\ttryOnScopeDispose(offFn);\n\t\treturn { off: offFn };\n\t};\n\tconst trigger = (...args) => {\n\t\treturn Promise.all(Array.from(fns).map((fn) => fn(...args)));\n\t};\n\treturn {\n\t\ton,\n\t\toff,\n\t\ttrigger,\n\t\tclear\n\t};\n}\n//#endregion\n//#region createGlobalState/index.ts\n/**\n* Keep states in the global scope to be reusable across Vue instances.\n*\n* @see https://vueuse.org/createGlobalState\n* @param stateFactory A factory function to create the state\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createGlobalState(stateFactory) {\n\tlet initialized = false;\n\tlet state;\n\tconst scope = effectScope(true);\n\treturn ((...args) => {\n\t\tif (!initialized) {\n\t\t\tstate = scope.run(() => stateFactory(...args));\n\t\t\tinitialized = true;\n\t\t}\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region provideLocal/map.ts\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n//#endregion\n//#region injectLocal/index.ts\n/**\n* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* injectLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*\n* @__NO_SIDE_EFFECTS__\n*/\nconst injectLocal = (...args) => {\n\tvar _getCurrentInstance;\n\tconst key = args[0];\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null && !hasInjectionContext()) throw new Error(\"injectLocal must be called in setup\");\n\tif (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];\n\treturn inject(...args);\n};\n//#endregion\n//#region provideLocal/index.ts\n/**\n* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* provideLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*/\nfunction provideLocal(key, value) {\n\tvar _getCurrentInstance;\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null) throw new Error(\"provideLocal must be called in setup\");\n\tif (!localProvidedStateMap.has(owner)) localProvidedStateMap.set(owner, Object.create(null));\n\tconst localProvidedState = localProvidedStateMap.get(owner);\n\tlocalProvidedState[key] = value;\n\treturn provide(key, value);\n}\n//#endregion\n//#region createInjectionState/index.ts\nfunction createInjectionState(composable, options) {\n\tconst key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n\tconst defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;\n\tconst useProvidingState = (...args) => {\n\t\tconst state = composable(...args);\n\t\tprovideLocal(key, state);\n\t\treturn state;\n\t};\n\tconst useInjectedState = () => injectLocal(key, defaultValue);\n\treturn [useProvidingState, useInjectedState];\n}\n//#endregion\n//#region createRef/index.ts\n/**\n* Returns a `deepRef` or `shallowRef` depending on the `deep` param.\n*\n* @example createRef(1) // ShallowRef<number>\n* @example createRef(1, false) // ShallowRef<number>\n* @example createRef(1, true) // Ref<number>\n* @example createRef(\"string\") // ShallowRef<string>\n* @example createRef<\"A\"|\"B\">(\"A\", true) // Ref<\"A\"|\"B\">\n*\n* @param value\n* @param deep\n* @returns the `deepRef` or `shallowRef`\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createRef(value, deep) {\n\tif (deep === true) return ref(value);\n\telse return shallowRef(value);\n}\n//#endregion\n//#region utils/is.ts\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n\tif (!condition) console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {};\nconst rand = (min, max) => {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.hasOwn(val, key);\nconst isIOS = /* #__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n\tvar _window, _window2, _window3;\n\treturn isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));\n}\n//#endregion\n//#region toRef/index.ts\nfunction toRef(...args) {\n\tif (args.length !== 1) return toRef$1(...args);\n\tconst r = args[0];\n\treturn typeof r === \"function\" ? readonly(customRef(() => ({\n\t\tget: r,\n\t\tset: noop\n\t}))) : ref(r);\n}\n//#endregion\n//#region utils/filters.ts\nfunction createFilterWrapper(filter, fn) {\n\tfunction wrapper(...args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tPromise.resolve(filter(() => fn.apply(this, args), {\n\t\t\t\tfn,\n\t\t\t\tthisArg: this,\n\t\t\t\targs\n\t\t\t})).then(resolve).catch(reject);\n\t\t});\n\t}\n\tif (\"cancel\" in filter) Object.assign(wrapper, {\n\t\tcancel: filter.cancel,\n\t\tflush: filter.flush,\n\t\tisPending: filter.isPending\n\t});\n\treturn wrapper;\n}\nconst bypassFilter = (invoke) => {\n\treturn invoke();\n};\n/**\n* Create an EventFilter that debounce the events\n*/\nfunction debounceFilter(ms, options = {}) {\n\tlet timer;\n\tlet maxTimer;\n\tlet lastRejector = noop;\n\tlet lastResolve = noop;\n\tconst _pending = shallowRef(false);\n\tconst _clearTimeout = (timer) => {\n\t\tclearTimeout(timer);\n\t\tlastRejector();\n\t\tlastRejector = noop;\n\t};\n\tlet lastInvoker;\n\tconst handler = (invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst maxDuration = toValue(options.maxWait);\n\t\tif (timer) _clearTimeout(timer);\n\t\tif (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\treturn Promise.resolve(invoke());\n\t\t}\n\t\t_pending.value = true;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlastRejector = options.rejectOnCancel ? reject : resolve;\n\t\t\tlastResolve = resolve;\n\t\t\tlastInvoker = invoke;\n\t\t\tif (maxDuration && !maxTimer) maxTimer = setTimeout(() => {\n\t\t\t\tif (timer) _clearTimeout(timer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}, maxDuration);\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tif (maxTimer) _clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(invoke());\n\t\t\t}, duration);\n\t\t});\n\t};\n\treturn Object.assign(handler, {\n\t\tcancel: () => {\n\t\t\tif (timer) {\n\t\t\t\t_clearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\tlastResolve = noop;\n\t\t},\n\t\tflush: () => {\n\t\t\tif (_pending.value) {\n\t\t\t\tif (timer) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = void 0;\n\t\t\t\t}\n\t\t\t\tif (maxTimer) {\n\t\t\t\t\tclearTimeout(maxTimer);\n\t\t\t\t\tmaxTimer = void 0;\n\t\t\t\t}\n\t\t\t\t_pending.value = false;\n\t\t\t\tconst resolve = lastResolve;\n\t\t\t\tlastRejector = noop;\n\t\t\t\tlastResolve = noop;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}\n\t\t},\n\t\tisPending: shallowReadonly(_pending)\n\t});\n}\nfunction throttleFilter(...args) {\n\tlet lastExec = 0;\n\tlet timer;\n\tlet isLeading = true;\n\tlet lastRejector = noop;\n\tlet lastValue;\n\tlet ms;\n\tlet trailing;\n\tlet leading;\n\tlet rejectOnCancel;\n\tif (!isRef(args[0]) && typeof args[0] === \"object\") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);\n\telse [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n\tconst clear = () => {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t\tlastRejector();\n\t\t\tlastRejector = noop;\n\t\t}\n\t};\n\tconst filter = (_invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst elapsed = Date.now() - lastExec;\n\t\tconst invoke = () => {\n\t\t\treturn lastValue = _invoke();\n\t\t};\n\t\tclear();\n\t\tif (duration <= 0) {\n\t\t\tlastExec = Date.now();\n\t\t\treturn invoke();\n\t\t}\n\t\tif (elapsed > duration) {\n\t\t\tlastExec = Date.now();\n\t\t\tif (leading || !isLeading) invoke();\n\t\t} else if (trailing) lastValue = new Promise((resolve, reject) => {\n\t\t\tlastRejector = rejectOnCancel ? reject : resolve;\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tlastExec = Date.now();\n\t\t\t\tisLeading = true;\n\t\t\t\tresolve(invoke());\n\t\t\t\tclear();\n\t\t\t}, Math.max(0, duration - elapsed));\n\t\t});\n\t\tif (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);\n\t\tisLeading = false;\n\t\treturn lastValue;\n\t};\n\treturn filter;\n}\n/**\n* EventFilter that gives extra controls to pause and resume the filter\n*\n* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n* @param options Options to configure the filter\n*/\nfunction pausableFilter(extendFilter = bypassFilter, options = {}) {\n\tconst { initialState = \"active\" } = options;\n\tconst isActive = toRef(initialState === \"active\");\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tfunction resume() {\n\t\tisActive.value = true;\n\t}\n\tconst eventFilter = (...args) => {\n\t\tif (isActive.value) extendFilter(...args);\n\t};\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume,\n\t\teventFilter\n\t};\n}\n//#endregion\n//#region utils/general.ts\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n\treturn new Promise((resolve, reject) => {\n\t\tif (throwOnTimeout) setTimeout(reject, ms, reason);\n\t\telse setTimeout(resolve, ms);\n\t});\n}\nfunction identity(arg) {\n\treturn arg;\n}\n/**\n* Create singleton promise function\n*\n* @example\n* ```\n* const promise = createSingletonPromise(async () => { ... })\n*\n* await promise()\n* await promise() // all of them will be bind to a single promise instance\n* await promise() // and be resolved together\n* ```\n*/\nfunction createSingletonPromise(fn) {\n\tlet _promise;\n\tfunction wrapper() {\n\t\tif (!_promise) _promise = fn();\n\t\treturn _promise;\n\t}\n\twrapper.reset = async () => {\n\t\tconst _prev = _promise;\n\t\t_promise = void 0;\n\t\tif (_prev) await _prev;\n\t};\n\treturn wrapper;\n}\nfunction invoke(fn) {\n\treturn fn();\n}\nfunction containsProp(obj, ...props) {\n\treturn props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n\tvar _target$match;\n\tif (typeof target === \"number\") return target + delta;\n\tconst value = ((_target$match = target.match(/^-?\\d+\\.?\\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || \"\";\n\tconst unit = target.slice(value.length);\n\tconst result = Number.parseFloat(value) + delta;\n\tif (Number.isNaN(result)) return target;\n\treturn result + unit;\n}\n/**\n* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\n*/\nfunction pxValue(px) {\n\treturn px.endsWith(\"rem\") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);\n}\n/**\n* Create a new subset object by giving keys\n*/\nfunction objectPick(obj, keys, omitUndefined = false) {\n\treturn keys.reduce((n, k) => {\n\t\tif (k in obj) {\n\t\t\tif (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];\n\t\t}\n\t\treturn n;\n\t}, {});\n}\n/**\n* Create a new subset object by omit giving keys\n*/\nfunction objectOmit(obj, keys, omitUndefined = false) {\n\treturn Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n\t\treturn (!omitUndefined || value !== void 0) && !keys.includes(key);\n\t}));\n}\nfunction objectEntries(obj) {\n\treturn Object.entries(obj);\n}\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n//#endregion\n//#region utils/port.ts\nfunction cacheStringFunction(fn) {\n\tconst cache = Object.create(null);\n\treturn ((str) => {\n\t\treturn cache[str] || (cache[str] = fn(str));\n\t});\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n\treturn str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n//#endregion\n//#region utils/vue.ts\nfunction getLifeCycleTarget(target) {\n\treturn target || getCurrentInstance();\n}\n//#endregion\n//#region createSharedComposable/index.ts\n/**\n* Make a composable function usable with multiple Vue instances.\n*\n* @see https://vueuse.org/createSharedComposable\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createSharedComposable(composable) {\n\tif (!isClient) return composable;\n\tlet subscribers = 0;\n\tlet state;\n\tlet scope;\n\tconst dispose = () => {\n\t\tsubscribers -= 1;\n\t\tif (scope && subscribers <= 0) {\n\t\t\tscope.stop();\n\t\t\tstate = void 0;\n\t\t\tscope = void 0;\n\t\t}\n\t};\n\treturn ((...args) => {\n\t\tsubscribers += 1;\n\t\tif (!scope) {\n\t\t\tscope = effectScope(true);\n\t\t\tstate = scope.run(() => composable(...args));\n\t\t}\n\t\ttryOnScopeDispose(dispose);\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region extendRef/index.ts\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n\tfor (const [key, value] of Object.entries(extend)) {\n\t\tif (key === \"value\") continue;\n\t\tif (isRef(value) && unwrap) Object.defineProperty(ref, key, {\n\t\t\tget() {\n\t\t\t\treturn value.value;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tvalue.value = v;\n\t\t\t},\n\t\t\tenumerable\n\t\t});\n\t\telse Object.defineProperty(ref, key, {\n\t\t\tvalue,\n\t\t\tenumerable\n\t\t});\n\t}\n\treturn ref;\n}\n//#endregion\n//#region get/index.ts\nfunction get(obj, key) {\n\tif (key == null) return unref(obj);\n\treturn unref(obj)[key];\n}\n//#endregion\n//#region isDefined/index.ts\nfunction isDefined(v) {\n\treturn unref(v) != null;\n}\n//#endregion\n//#region makeDestructurable/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction makeDestructurable(obj, arr) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tconst clone = { ...obj };\n\t\tObject.defineProperty(clone, Symbol.iterator, {\n\t\t\tenumerable: false,\n\t\t\tvalue() {\n\t\t\t\tlet index = 0;\n\t\t\t\treturn { next: () => ({\n\t\t\t\t\tvalue: arr[index++],\n\t\t\t\t\tdone: index > arr.length\n\t\t\t\t}) };\n\t\t\t}\n\t\t});\n\t\treturn clone;\n\t} else return Object.assign([...arr], obj);\n}\n//#endregion\n//#region reactify/index.ts\n/**\n* Converts plain function into a reactive function.\n* The converted function accepts refs as it's arguments\n* and returns a ComputedRef, with proper typing.\n*\n* @param fn - Source function\n* @param options - Options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactify(fn, options) {\n\tconst unrefFn = (options === null || options === void 0 ? void 0 : options.computedGetter) === false ? unref : toValue;\n\treturn function(...args) {\n\t\treturn computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n\t};\n}\n/** @deprecated use `reactify` instead */\nconst createReactiveFn = reactify;\n//#endregion\n//#region reactifyObject/index.ts\n/**\n* Apply `reactify` to an object\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n\tlet keys = [];\n\tlet options;\n\tif (Array.isArray(optionsOrKeys)) keys = optionsOrKeys;\n\telse {\n\t\toptions = optionsOrKeys;\n\t\tconst { includeOwnProperties = true } = optionsOrKeys;\n\t\tkeys.push(...Object.keys(obj));\n\t\tif (includeOwnProperties) keys.push(...Object.getOwnPropertyNames(obj));\n\t}\n\treturn Object.fromEntries(keys.map((key) => {\n\t\tconst value = obj[key];\n\t\treturn [key, typeof value === \"function\" ? reactify(value.bind(obj), options) : value];\n\t}));\n}\n//#endregion\n//#region toReactive/index.ts\n/**\n* Converts ref to reactive.\n*\n* @see https://vueuse.org/toReactive\n* @param objectRef A ref of object\n*/\nfunction toReactive(objectRef) {\n\tif (!isRef(objectRef)) return reactive(objectRef);\n\treturn reactive(new Proxy({}, {\n\t\tget(_, p, receiver) {\n\t\t\treturn unref(Reflect.get(objectRef.value, p, receiver));\n\t\t},\n\t\tset(_, p, value) {\n\t\t\tif (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;\n\t\t\telse objectRef.value[p] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, p) {\n\t\t\treturn Reflect.deleteProperty(objectRef.value, p);\n\t\t},\n\t\thas(_, p) {\n\t\t\treturn Reflect.has(objectRef.value, p);\n\t\t},\n\t\townKeys() {\n\t\t\treturn Object.keys(objectRef.value);\n\t\t},\n\t\tgetOwnPropertyDescriptor() {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t};\n\t\t}\n\t}));\n}\n//#endregion\n//#region reactiveComputed/index.ts\n/**\n* Computed reactive object.\n*/\nfunction reactiveComputed(fn) {\n\treturn toReactive(computed(fn));\n}\n//#endregion\n//#region reactiveOmit/index.ts\n/**\n* Reactively omit fields from a reactive object\n*\n* @see https://vueuse.org/reactiveOmit\n*/\nfunction reactiveOmit(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n//#endregion\n//#region reactivePick/index.ts\n/**\n* Reactively pick fields from a reactive object\n*\n* @see https://vueuse.org/reactivePick\n*/\nfunction reactivePick(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n//#endregion\n//#region refAutoReset/index.ts\n/**\n* Create a ref which will be reset to the default value after some time.\n*\n* @see https://vueuse.org/refAutoReset\n* @param defaultValue The value which will be set.\n* @param afterMs A zero-or-greater delay in milliseconds.\n*/\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n\treturn customRef((track, trigger) => {\n\t\tlet value = toValue(defaultValue);\n\t\tlet timer;\n\t\tconst resetAfter = () => setTimeout(() => {\n\t\t\tvalue = toValue(defaultValue);\n\t\t\ttrigger();\n\t\t}, toValue(afterMs));\n\t\ttryOnScopeDispose(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = resetAfter();\n\t\t\t}\n\t\t};\n\t});\n}\n/** @deprecated use `refAutoReset` instead */\nconst autoResetRef = refAutoReset;\n//#endregion\n//#region useDebounceFn/index.ts\n/**\n* Debounce execution of a function.\n*\n* @see https://vueuse.org/useDebounceFn\n* @param fn A function to be executed after delay milliseconds debounced.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param options Options\n*\n* @return A new, debounced, function with isPending, cancel, and flush properties.\n*/\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n\treturn createFilterWrapper(debounceFilter(ms, options), fn);\n}\n//#endregion\n//#region refDebounced/index.ts\n/**\n* Debounce updates of a ref.\n*\n* @return A new debounced ref.\n*/\nfunction refDebounced(value, ms = 200, options = {}) {\n\tconst debounced = ref(toValue(value));\n\tconst updater = useDebounceFn(() => {\n\t\tdebounced.value = value.value;\n\t}, ms, options);\n\twatch(value, () => updater());\n\treturn shallowReadonly(debounced);\n}\n/** @deprecated use `refDebounced` instead */\nconst debouncedRef = refDebounced;\n/** @deprecated use `refDebounced` instead */\nconst useDebounce = refDebounced;\n//#endregion\n//#region refDefault/index.ts\n/**\n* Apply default value to a ref.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refDefault(source, defaultValue) {\n\treturn computed({\n\t\tget() {\n\t\t\tvar _source$value;\n\t\t\treturn (_source$value = source.value) !== null && _source$value !== void 0 ? _source$value : defaultValue;\n\t\t},\n\t\tset(value) {\n\t\t\tsource.value = value;\n\t\t}\n\t});\n}\n//#endregion\n//#region refManualReset/index.ts\n/**\n* Create a ref with manual reset functionality.\n*\n* @see https://vueuse.org/refManualReset\n* @param defaultValue The value which will be set.\n*/\nfunction refManualReset(defaultValue) {\n\tlet value = toValue(defaultValue);\n\tlet trigger;\n\tconst reset = () => {\n\t\tvalue = toValue(defaultValue);\n\t\ttrigger();\n\t};\n\tconst refValue = customRef((track, _trigger) => {\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t}\n\t\t};\n\t});\n\trefValue.reset = reset;\n\treturn refValue;\n}\n//#endregion\n//#region useThrottleFn/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n* to `callback` when the throttled-function is executed.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* (default value: 200)\n*\n* @param [trailing] if true, call fn again after the time is up (default value: false)\n*\n* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)\n*\n* @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)\n*\n* @return A new, throttled, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n\treturn createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);\n}\n//#endregion\n//#region refThrottled/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param value Ref value to be watched with throttle effect\n* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param trailing if true, update the value again after the delay time is up\n* @param leading if true, update the value on the leading edge of the ms timeout\n*/\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n\tif (delay <= 0) return value;\n\tconst throttled = ref(toValue(value));\n\tconst updater = useThrottleFn(() => {\n\t\tthrottled.value = value.value;\n\t}, delay, trailing, leading);\n\twatch(value, () => updater());\n\treturn throttled;\n}\n/** @deprecated use `refThrottled` instead */\nconst throttledRef = refThrottled;\n/** @deprecated use `refThrottled` instead */\nconst useThrottle = refThrottled;\n//#endregion\n//#region refWithControl/index.ts\n/**\n* Fine-grained controls over ref and its reactivity.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refWithControl(initial, options = {}) {\n\tlet source = initial;\n\tlet track;\n\tlet trigger;\n\tconst ref = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\treturn get();\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset(v);\n\t\t\t}\n\t\t};\n\t});\n\tfunction get(tracking = true) {\n\t\tif (tracking) track();\n\t\treturn source;\n\t}\n\tfunction set(value, triggering = true) {\n\t\tvar _options$onBeforeChan, _options$onChanged;\n\t\tif (value === source) return;\n\t\tconst old = source;\n\t\tif (((_options$onBeforeChan = options.onBeforeChange) === null || _options$onBeforeChan === void 0 ? void 0 : _options$onBeforeChan.call(options, value, old)) === false) return;\n\t\tsource = value;\n\t\t(_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, value, old);\n\t\tif (triggering) trigger();\n\t}\n\t/**\n\t* Get the value without tracked in the reactivity system\n\t*/\n\tconst untrackedGet = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*/\n\tconst silentSet = (v) => set(v, false);\n\t/**\n\t* Get the value without tracked in the reactivity system.\n\t*\n\t* Alias for `untrackedGet()`\n\t*/\n\tconst peek = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*\n\t* Alias for `silentSet(v)`\n\t*/\n\tconst lay = (v) => set(v, false);\n\treturn extendRef(ref, {\n\t\tget,\n\t\tset,\n\t\tuntrackedGet,\n\t\tsilentSet,\n\t\tpeek,\n\t\tlay\n\t}, { enumerable: true });\n}\n/** @deprecated use `refWithControl` instead */\nconst controlledRef = refWithControl;\n//#endregion\n//#region set/index.ts\n/**\n* Shorthand for `ref.value = x`\n*/\nfunction set(...args) {\n\tif (args.length === 2) {\n\t\tconst [ref, value] = args;\n\t\tref.value = value;\n\t}\n\tif (args.length === 3) {\n\t\tconst [target, key, value] = args;\n\t\ttarget[key] = value;\n\t}\n}\n//#endregion\n//#region watchWithFilter/index.ts\nfunction watchWithFilter(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\treturn watch(source, createFilterWrapper(eventFilter, cb), watchOptions);\n}\n//#endregion\n//#region watchPausable/index.ts\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nfunction watchPausable(source, cb, options = {}) {\n\tconst { eventFilter: filter, initialState = \"active\", ...watchOptions } = options;\n\tconst { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });\n\treturn {\n\t\tstop: watchWithFilter(source, cb, {\n\t\t\t...watchOptions,\n\t\t\teventFilter\n\t\t}),\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nconst pausableWatch = watchPausable;\n//#endregion\n//#region syncRef/index.ts\n/**\n* Two-way refs synchronization.\n* From the set theory perspective to restrict the option's type\n* Check in the following order:\n* 1. L = R\n* 2. L ∩ R ≠ ∅\n* 3. L ⊆ R\n* 4. L ∩ R = ∅\n*/\nfunction syncRef(left, right, ...[options]) {\n\tconst { flush = \"sync\", deep = false, immediate = true, direction = \"both\", transform = {} } = options || {};\n\tconst watchers = [];\n\tconst transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n\tconst transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n\tif (direction === \"both\" || direction === \"ltr\") watchers.push(watchPausable(left, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tright.value = transformLTR(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tif (direction === \"both\" || direction === \"rtl\") watchers.push(watchPausable(right, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tleft.value = transformRTL(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tconst stop = () => {\n\t\twatchers.forEach((w) => w.stop());\n\t};\n\treturn stop;\n}\n//#endregion\n//#region syncRefs/index.ts\n/**\n* Keep target ref(s) in sync with the source ref\n*\n* @param source source ref\n* @param targets\n*/\nfunction syncRefs(source, targets, options = {}) {\n\tconst { flush = \"sync\", deep = false, immediate = true } = options;\n\tconst targetsArray = toArray(targets);\n\treturn watch(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t});\n}\n//#endregion\n//#region toRefs/index.ts\n/**\n* Extended `toRefs` that also accepts refs of an object.\n*\n* @see https://vueuse.org/toRefs\n* @param objectRef A ref or normal object or array.\n* @param options Options\n*/\nfunction toRefs(objectRef, options = {}) {\n\tif (!isRef(objectRef)) return toRefs$1(objectRef);\n\tconst result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n\tfor (const key in objectRef.value) result[key] = customRef(() => ({\n\t\tget() {\n\t\t\treturn objectRef.value[key];\n\t\t},\n\t\tset(v) {\n\t\t\tvar _toValue;\n\t\t\tif ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) if (Array.isArray(objectRef.value)) {\n\t\t\t\tconst copy = [...objectRef.value];\n\t\t\t\tcopy[key] = v;\n\t\t\t\tobjectRef.value = copy;\n\t\t\t} else {\n\t\t\t\tconst newObject = {\n\t\t\t\t\t...objectRef.value,\n\t\t\t\t\t[key]: v\n\t\t\t\t};\n\t\t\t\tObject.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n\t\t\t\tobjectRef.value = newObject;\n\t\t\t}\n\t\t\telse objectRef.value[key] = v;\n\t\t}\n\t}));\n\treturn result;\n}\n//#endregion\n//#region tryOnBeforeMount/index.ts\n/**\n* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnBeforeMount(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onBeforeMount(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnBeforeUnmount/index.ts\n/**\n* Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnBeforeUnmount(fn, target) {\n\tif (getLifeCycleTarget(target)) onBeforeUnmount(fn, target);\n}\n//#endregion\n//#region tryOnMounted/index.ts\n/**\n* Call onMounted() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnMounted(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onMounted(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnUnmounted/index.ts\n/**\n* Call onUnmounted() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnUnmounted(fn, target) {\n\tif (getLifeCycleTarget(target)) onUnmounted(fn, target);\n}\n//#endregion\n//#region until/index.ts\nfunction createUntil(r, isNot = false) {\n\tfunction toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch(r, (v) => {\n\t\t\t\tif (condition(v) !== isNot) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop === null || stop === void 0 ? void 0 : stop()));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBe(value, options) {\n\t\tif (!isRef(value)) return toMatch((v) => v === value, options);\n\t\tconst { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options !== null && options !== void 0 ? options : {};\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch([r, value], ([v1, v2]) => {\n\t\t\t\tif (isNot !== (v1 === v2)) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v1);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n\t\t\tstop === null || stop === void 0 || stop();\n\t\t\treturn toValue(r);\n\t\t}));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBeTruthy(options) {\n\t\treturn toMatch((v) => Boolean(v), options);\n\t}\n\tfunction toBeNull(options) {\n\t\treturn toBe(null, options);\n\t}\n\tfunction toBeUndefined(options) {\n\t\treturn toBe(void 0, options);\n\t}\n\tfunction toBeNaN(options) {\n\t\treturn toMatch(Number.isNaN, options);\n\t}\n\tfunction toContains(value, options) {\n\t\treturn toMatch((v) => {\n\t\t\tconst array = Array.from(v);\n\t\t\treturn array.includes(value) || array.includes(toValue(value));\n\t\t}, options);\n\t}\n\tfunction changed(options) {\n\t\treturn changedTimes(1, options);\n\t}\n\tfunction changedTimes(n = 1, options) {\n\t\tlet count = -1;\n\t\treturn toMatch(() => {\n\t\t\tcount += 1;\n\t\t\treturn count >= n;\n\t\t}, options);\n\t}\n\tif (Array.isArray(toValue(r))) return {\n\t\ttoMatch,\n\t\ttoContains,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n\telse return {\n\t\ttoMatch,\n\t\ttoBe,\n\t\ttoBeTruthy,\n\t\ttoBeNull,\n\t\ttoBeNaN,\n\t\ttoBeUndefined,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n}\nfunction until(r) {\n\treturn createUntil(r);\n}\n//#endregion\n//#region useArrayDifference/index.ts\nfunction defaultComparator(value, othVal) {\n\treturn value === othVal;\n}\n/**\n* Reactive get array difference of two array\n* @see https://vueuse.org/useArrayDifference\n* @returns - the difference of two array\n* @param args\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayDifference(...args) {\n\tvar _args$, _args$2;\n\tconst list = args[0];\n\tconst values = args[1];\n\tlet compareFn = (_args$ = args[2]) !== null && _args$ !== void 0 ? _args$ : defaultComparator;\n\tconst { symmetric = false } = (_args$2 = args[3]) !== null && _args$2 !== void 0 ? _args$2 : {};\n\tif (typeof compareFn === \"string\") {\n\t\tconst key = compareFn;\n\t\tcompareFn = (value, othVal) => value[key] === othVal[key];\n\t}\n\tconst diff1 = computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n\tif (symmetric) {\n\t\tconst diff2 = computed(() => toValue(values).filter((x) => toValue(list).findIndex((y) => compareFn(x, y)) === -1));\n\t\treturn computed(() => symmetric ? [...toValue(diff1), ...toValue(diff2)] : toValue(diff1));\n\t} else return diff1;\n}\n//#endregion\n//#region useArrayEvery/index.ts\n/**\n* Reactive `Array.every`\n*\n* @see https://vueuse.org/useArrayEvery\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayEvery(list, fn) {\n\treturn computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFilter/index.ts\n/**\n* Reactive `Array.filter`\n*\n* @see https://vueuse.org/useArrayFilter\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFilter(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n//#endregion\n//#region useArrayFind/index.ts\n/**\n* Reactive `Array.find`\n*\n* @see https://vueuse.org/useArrayFind\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFind(list, fn) {\n\treturn computed(() => toValue(toValue(list).find((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayFindIndex/index.ts\n/**\n* Reactive `Array.findIndex`\n*\n* @see https://vueuse.org/useArrayFindIndex\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the index of the first element in the array that passes the test. Otherwise, \"-1\".\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindIndex(list, fn) {\n\treturn computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFindLast/index.ts\nfunction findLast(arr, cb) {\n\tlet index = arr.length;\n\twhile (index-- > 0) if (cb(arr[index], index, arr)) return arr[index];\n}\n/**\n* Reactive `Array.findLast`\n*\n* @see https://vueuse.org/useArrayFindLast\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindLast(list, fn) {\n\treturn computed(() => toValue(!Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayIncludes/index.ts\nfunction isArrayIncludesOptions(obj) {\n\treturn isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\n/**\n* Reactive `Array.includes`\n*\n* @see https://vueuse.org/useArrayIncludes\n*\n* @returns true if the `value` is found in the array. Otherwise, false.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayIncludes(...args) {\n\tvar _comparator;\n\tconst list = args[0];\n\tconst value = args[1];\n\tlet comparator = args[2];\n\tlet formIndex = 0;\n\tif (isArrayIncludesOptions(comparator)) {\n\t\tvar _comparator$fromIndex;\n\t\tformIndex = (_comparator$fromIndex = comparator.fromIndex) !== null && _comparator$fromIndex !== void 0 ? _comparator$fromIndex : 0;\n\t\tcomparator = comparator.comparator;\n\t}\n\tif (typeof comparator === \"string\") {\n\t\tconst key = comparator;\n\t\tcomparator = (element, value) => element[key] === toValue(value);\n\t}\n\tcomparator = (_comparator = comparator) !== null && _comparator !== void 0 ? _comparator : ((element, value) => element === toValue(value));\n\treturn computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))));\n}\n//#endregion\n//#region useArrayJoin/index.ts\n/**\n* Reactive `Array.join`\n*\n* @see https://vueuse.org/useArrayJoin\n* @param list - the array was called upon.\n* @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (\",\").\n*\n* @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayJoin(list, separator) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n//#endregion\n//#region useArrayMap/index.ts\n/**\n* Reactive `Array.map`\n*\n* @see https://vueuse.org/useArrayMap\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a new array with each element being the result of the callback function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayMap(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n//#endregion\n//#region useArrayReduce/index.ts\n/**\n* Reactive `Array.reduce`\n*\n* @see https://vueuse.org/useArrayReduce\n* @param list - the array was called upon.\n* @param reducer - a \"reducer\" function.\n* @param args\n*\n* @returns the value that results from running the \"reducer\" callback function to completion over the entire array.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayReduce(list, reducer, ...args) {\n\tconst reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n\treturn computed(() => {\n\t\tconst resolved = toValue(list);\n\t\treturn args.length ? resolved.reduce(reduceCallback, typeof args[0] === \"function\" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);\n\t});\n}\n//#endregion\n//#region useArraySome/index.ts\n/**\n* Reactive `Array.some`\n*\n* @see https://vueuse.org/useArraySome\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArraySome(list, fn) {\n\treturn computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayUnique/index.ts\nfunction uniq(array) {\n\treturn Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n\treturn array.reduce((acc, v) => {\n\t\tif (!acc.some((x) => fn(v, x, array))) acc.push(v);\n\t\treturn acc;\n\t}, []);\n}\n/**\n* reactive unique array\n* @see https://vueuse.org/useArrayUnique\n* @param list - the array was called upon.\n* @param compareFn\n* @returns A computed ref that returns a unique array of items.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayUnique(list, compareFn) {\n\treturn computed(() => {\n\t\tconst resolvedList = toValue(list).map((element) => toValue(element));\n\t\treturn compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n\t});\n}\n//#endregion\n//#region useCounter/index.ts\n/**\n* Basic counter with utility functions.\n*\n* @see https://vueuse.org/useCounter\n* @param [initialValue]\n* @param options\n*/\nfunction useCounter(initialValue = 0, options = {}) {\n\tlet _initialValue = unref(initialValue);\n\tconst count = shallowRef(initialValue);\n\tconst { max = Number.POSITIVE_INFINITY, min = Number.NEGATIVE_INFINITY } = options;\n\tconst inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n\tconst dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n\tconst get = () => count.value;\n\tconst set = (val) => count.value = Math.max(min, Math.min(max, val));\n\tconst reset = (val = _initialValue) => {\n\t\t_initialValue = val;\n\t\treturn set(val);\n\t};\n\treturn {\n\t\tcount: shallowReadonly(count),\n\t\tinc,\n\t\tdec,\n\t\tget,\n\t\tset,\n\t\treset\n\t};\n}\n//#endregion\n//#region useDateFormat/index.ts\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[T\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/i;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)\\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n\tlet m = hours < 12 ? \"AM\" : \"PM\";\n\tif (hasPeriod) m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n\treturn isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n\tconst suffixes = [\n\t\t\"th\",\n\t\t\"st\",\n\t\t\"nd\",\n\t\t\"rd\"\n\t];\n\tconst v = num % 100;\n\treturn num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n\tvar _options$customMeridi;\n\tconst years = date.getFullYear();\n\tconst month = date.getMonth();\n\tconst days = date.getDate();\n\tconst hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst seconds = date.getSeconds();\n\tconst milliseconds = date.getMilliseconds();\n\tconst day = date.getDay();\n\tconst meridiem = (_options$customMeridi = options.customMeridiem) !== null && _options$customMeridi !== void 0 ? _options$customMeridi : defaultMeridiem;\n\tconst stripTimeZone = (dateString) => {\n\t\tvar _dateString$split$;\n\t\treturn (_dateString$split$ = dateString.split(\" \")[1]) !== null && _dateString$split$ !== void 0 ? _dateString$split$ : \"\";\n\t};\n\tconst matches = {\n\t\tYo: () => formatOrdinal(years),\n\t\tYY: () => String(years).slice(-2),\n\t\tYYYY: () => years,\n\t\tM: () => month + 1,\n\t\tMo: () => formatOrdinal(month + 1),\n\t\tMM: () => `${month + 1}`.padStart(2, \"0\"),\n\t\tMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"short\" }),\n\t\tMMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"long\" }),\n\t\tD: () => String(days),\n\t\tDo: () => formatOrdinal(days),\n\t\tDD: () => `${days}`.padStart(2, \"0\"),\n\t\tH: () => String(hours),\n\t\tHo: () => formatOrdinal(hours),\n\t\tHH: () => `${hours}`.padStart(2, \"0\"),\n\t\th: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n\t\tho: () => formatOrdinal(hours % 12 || 12),\n\t\thh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n\t\tm: () => String(minutes),\n\t\tmo: () => formatOrdinal(minutes),\n\t\tmm: () => `${minutes}`.padStart(2, \"0\"),\n\t\ts: () => String(seconds),\n\t\tso: () => formatOrdinal(seconds),\n\t\tss: () => `${seconds}`.padStart(2, \"0\"),\n\t\tSSS: () => `${milliseconds}`.padStart(3, \"0\"),\n\t\td: () => day,\n\t\tdd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"narrow\" }),\n\t\tddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"short\" }),\n\t\tdddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"long\" }),\n\t\tA: () => meridiem(hours, minutes),\n\t\tAA: () => meridiem(hours, minutes, false, true),\n\t\ta: () => meridiem(hours, minutes, true),\n\t\taa: () => meridiem(hours, minutes, true, true),\n\t\tz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"longOffset\" }))\n\t};\n\treturn formatStr.replace(REGEX_FORMAT, (match, $1) => {\n\t\tvar _ref, _matches$match;\n\t\treturn (_ref = $1 !== null && $1 !== void 0 ? $1 : (_matches$match = matches[match]) === null || _matches$match === void 0 ? void 0 : _matches$match.call(matches)) !== null && _ref !== void 0 ? _ref : match;\n\t});\n}\nfunction normalizeDate(date) {\n\tif (date === null) return /* @__PURE__ */ new Date(NaN);\n\tif (date === void 0) return /* @__PURE__ */ new Date();\n\tif (date instanceof Date) return new Date(date);\n\tif (typeof date === \"string\" && !/Z$/i.test(date)) {\n\t\tconst d = date.match(REGEX_PARSE);\n\t\tif (d) {\n\t\t\tconst m = d[2] - 1 || 0;\n\t\t\tconst ms = (d[7] || \"0\").substring(0, 3);\n\t\t\treturn new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n\t\t}\n\t}\n\treturn new Date(date);\n}\n/**\n* Get the formatted date according to the string of tokens passed in.\n*\n* @see https://vueuse.org/useDateFormat\n* @param date - The date to format, can either be a `Date` object, a timestamp, or a string\n* @param formatStr - The combination of tokens to format the date\n* @param options - UseDateFormatOptions\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n\treturn computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n//#endregion\n//#region useIntervalFn/index.ts\n/**\n* Wrapper for `setInterval` with controls\n*\n* @see https://vueuse.org/useIntervalFn\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tlet timer = null;\n\tconst isActive = shallowRef(false);\n\tfunction clean() {\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tclean();\n\t}\n\tfunction resume() {\n\t\tconst intervalValue = toValue(interval);\n\t\tif (intervalValue <= 0) return;\n\t\tisActive.value = true;\n\t\tif (immediateCallback) cb();\n\t\tclean();\n\t\tif (isActive.value) timer = setInterval(cb, intervalValue);\n\t}\n\tif (immediate && isClient) resume();\n\tif (isRef(interval) || typeof interval === \"function\") tryOnScopeDispose(watch(interval, () => {\n\t\tif (isActive.value && isClient) resume();\n\t}));\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useInterval/index.ts\nfunction useInterval(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, immediate = true, callback } = options;\n\tconst counter = shallowRef(0);\n\tconst update = () => counter.value += 1;\n\tconst reset = () => {\n\t\tcounter.value = 0;\n\t};\n\tconst controls = useIntervalFn(callback ? () => {\n\t\tupdate();\n\t\tcallback(counter.value);\n\t} : update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tcounter: shallowReadonly(counter),\n\t\treset,\n\t\t...controls\n\t};\n\telse return shallowReadonly(counter);\n}\n//#endregion\n//#region useLastChanged/index.ts\nfunction useLastChanged(source, options = {}) {\n\tvar _options$initialValue;\n\tconst ms = shallowRef((_options$initialValue = options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : null);\n\twatch(source, () => ms.value = timestamp(), options);\n\treturn shallowReadonly(ms);\n}\n//#endregion\n//#region useTimeoutFn/index.ts\n/**\n* Wrapper for `setTimeout` with controls.\n*\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useTimeoutFn(cb, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tfunction clear() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t}\n\tfunction stop() {\n\t\tisPending.value = false;\n\t\tclear();\n\t}\n\tfunction start(...args) {\n\t\tif (immediateCallback) cb();\n\t\tclear();\n\t\tisPending.value = true;\n\t\ttimer = setTimeout(() => {\n\t\t\tisPending.value = false;\n\t\t\ttimer = void 0;\n\t\t\tcb(...args);\n\t\t}, toValue(interval));\n\t}\n\tif (immediate) {\n\t\tisPending.value = true;\n\t\tif (isClient) start();\n\t}\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisPending: shallowReadonly(isPending),\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTimeout/index.ts\nfunction useTimeout(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, callback } = options;\n\tconst controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options);\n\tconst ready = computed(() => !controls.isPending.value);\n\tif (exposeControls) return {\n\t\tready,\n\t\t...controls\n\t};\n\telse return ready;\n}\n//#endregion\n//#region useToNumber/index.ts\n/**\n* Reactively convert a string ref to number.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToNumber(value, options = {}) {\n\tconst { method = \"parseFloat\", radix, nanToZero } = options;\n\treturn computed(() => {\n\t\tlet resolved = toValue(value);\n\t\tif (typeof method === \"function\") resolved = method(resolved);\n\t\telse if (typeof resolved === \"string\") resolved = Number[method](resolved, radix);\n\t\tif (nanToZero && Number.isNaN(resolved)) resolved = 0;\n\t\treturn resolved;\n\t});\n}\n//#endregion\n//#region useToString/index.ts\n/**\n* Reactively convert a ref to string.\n*\n* @see https://vueuse.org/useToString\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToString(value) {\n\treturn computed(() => `${toValue(value)}`);\n}\n//#endregion\n//#region useToggle/index.ts\n/**\n* A boolean ref with a toggler\n*\n* @see https://vueuse.org/useToggle\n* @param [initialValue]\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToggle(initialValue = false, options = {}) {\n\tconst { truthyValue = true, falsyValue = false } = options;\n\tconst valueIsRef = isRef(initialValue);\n\tconst _value = shallowRef(initialValue);\n\tfunction toggle(value) {\n\t\tif (arguments.length) {\n\t\t\t_value.value = value;\n\t\t\treturn _value.value;\n\t\t} else {\n\t\t\tconst truthy = toValue(truthyValue);\n\t\t\t_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n\t\t\treturn _value.value;\n\t\t}\n\t}\n\tif (valueIsRef) return toggle;\n\telse return [_value, toggle];\n}\n//#endregion\n//#region watchArray/index.ts\n/**\n* Watch for an array with additions and removals.\n*\n* @see https://vueuse.org/watchArray\n*/\nfunction watchArray(source, cb, options) {\n\tlet oldList = (options === null || options === void 0 ? void 0 : options.immediate) ? [] : [...typeof source === \"function\" ? source() : Array.isArray(source) ? source : toValue(source)];\n\treturn watch(source, (newList, _, onCleanup) => {\n\t\tconst oldListRemains = Array.from({ length: oldList.length });\n\t\tconst added = [];\n\t\tfor (const obj of newList) {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < oldList.length; i++) if (!oldListRemains[i] && obj === oldList[i]) {\n\t\t\t\toldListRemains[i] = true;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!found) added.push(obj);\n\t\t}\n\t\tconst removed = oldList.filter((_, i) => !oldListRemains[i]);\n\t\tcb(newList, oldList, added, removed, onCleanup);\n\t\toldList = [...newList];\n\t}, options);\n}\n//#endregion\n//#region watchAtMost/index.ts\nfunction watchAtMost(source, cb, options) {\n\tconst { count, ...watchOptions } = options;\n\tconst current = shallowRef(0);\n\tconst { stop, resume, pause } = watchWithFilter(source, (...args) => {\n\t\tcurrent.value += 1;\n\t\tif (current.value >= toValue(count)) nextTick(() => stop());\n\t\tcb(...args);\n\t}, watchOptions);\n\treturn {\n\t\tcount: current,\n\t\tstop,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region watchDebounced/index.ts\nfunction watchDebounced(source, cb, options = {}) {\n\tconst { debounce = 0, maxWait = void 0, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: debounceFilter(debounce, { maxWait })\n\t});\n}\n/** @deprecated use `watchDebounced` instead */\nconst debouncedWatch = watchDebounced;\n//#endregion\n//#region watchDeep/index.ts\n/**\n* Shorthand for watching value with {deep: true}\n*\n* @see https://vueuse.org/watchDeep\n*/\nfunction watchDeep(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tdeep: true\n\t});\n}\n//#endregion\n//#region watchIgnorable/index.ts\nfunction watchIgnorable(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\tconst filteredCb = createFilterWrapper(eventFilter, cb);\n\tlet ignoreUpdates;\n\tlet ignorePrevAsyncUpdates;\n\tlet stop;\n\tif (watchOptions.flush === \"sync\") {\n\t\tlet ignore = false;\n\t\tignorePrevAsyncUpdates = () => {};\n\t\tignoreUpdates = (updater) => {\n\t\t\tignore = true;\n\t\t\tupdater();\n\t\t\tignore = false;\n\t\t};\n\t\tstop = watch(source, (...args) => {\n\t\t\tif (!ignore) filteredCb(...args);\n\t\t}, watchOptions);\n\t} else {\n\t\tconst disposables = [];\n\t\tlet ignoreCounter = 0;\n\t\tlet syncCounter = 0;\n\t\tignorePrevAsyncUpdates = () => {\n\t\t\tignoreCounter = syncCounter;\n\t\t};\n\t\tdisposables.push(watch(source, () => {\n\t\t\tsyncCounter++;\n\t\t}, {\n\t\t\t...watchOptions,\n\t\t\tflush: \"sync\"\n\t\t}));\n\t\tignoreUpdates = (updater) => {\n\t\t\tconst syncCounterPrev = syncCounter;\n\t\t\tupdater();\n\t\t\tignoreCounter += syncCounter - syncCounterPrev;\n\t\t};\n\t\tdisposables.push(watch(source, (...args) => {\n\t\t\tconst ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;\n\t\t\tignoreCounter = 0;\n\t\t\tsyncCounter = 0;\n\t\t\tif (ignore) return;\n\t\t\tfilteredCb(...args);\n\t\t}, watchOptions));\n\t\tstop = () => {\n\t\t\tdisposables.forEach((fn) => fn());\n\t\t};\n\t}\n\treturn {\n\t\tstop,\n\t\tignoreUpdates,\n\t\tignorePrevAsyncUpdates\n\t};\n}\n/** @deprecated use `watchIgnorable` instead */\nconst ignorableWatch = watchIgnorable;\n//#endregion\n//#region watchImmediate/index.ts\n/**\n* Shorthand for watching value with {immediate: true}\n*\n* @see https://vueuse.org/watchImmediate\n*/\nfunction watchImmediate(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\timmediate: true\n\t});\n}\n//#endregion\n//#region watchOnce/index.ts\n/**\n* Shorthand for watching value with { once: true }\n*\n* @see https://vueuse.org/watchOnce\n*/\nfunction watchOnce(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tonce: true\n\t});\n}\n//#endregion\n//#region watchThrottled/index.ts\nfunction watchThrottled(source, cb, options = {}) {\n\tconst { throttle = 0, trailing = true, leading = true, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: throttleFilter(throttle, trailing, leading)\n\t});\n}\n/** @deprecated use `watchThrottled` instead */\nconst throttledWatch = watchThrottled;\n//#endregion\n//#region watchTriggerable/index.ts\nfunction watchTriggerable(source, cb, options = {}) {\n\tlet cleanupFn;\n\tfunction onEffect() {\n\t\tif (!cleanupFn) return;\n\t\tconst fn = cleanupFn;\n\t\tcleanupFn = void 0;\n\t\tfn();\n\t}\n\t/** Register the function `cleanupFn` */\n\tfunction onCleanup(callback) {\n\t\tcleanupFn = callback;\n\t}\n\tconst _cb = (value, oldValue) => {\n\t\tonEffect();\n\t\treturn cb(value, oldValue, onCleanup);\n\t};\n\tconst res = watchIgnorable(source, _cb, options);\n\tconst { ignoreUpdates } = res;\n\tconst trigger = () => {\n\t\tlet res;\n\t\tignoreUpdates(() => {\n\t\t\tres = _cb(getWatchSources(source), getOldValue(source));\n\t\t});\n\t\treturn res;\n\t};\n\treturn {\n\t\t...res,\n\t\ttrigger\n\t};\n}\nfunction getWatchSources(sources) {\n\tif (isReactive(sources)) return sources;\n\tif (Array.isArray(sources)) return sources.map((item) => toValue(item));\n\treturn toValue(sources);\n}\nfunction getOldValue(source) {\n\treturn Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n//#endregion\n//#region whenever/index.ts\nfunction whenever(source, cb, options) {\n\tconst stop = watch(source, (v, ov, onInvalidate) => {\n\t\tif (v) {\n\t\t\tif (options === null || options === void 0 ? void 0 : options.once) nextTick(() => stop());\n\t\t\tcb(v, ov, onInvalidate);\n\t\t}\n\t}, {\n\t\t...options,\n\t\tonce: false\n\t});\n\treturn stop;\n}\n//#endregion\nexport { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { bypassFilter, camelize, clamp, computedWithControl, containsProp, createEventHook, createFilterWrapper, createRef, createSingletonPromise, debounceFilter, hasOwn, identity, increaseWithUnit, injectLocal, isClient, isDef, isIOS, isObject, isWorker, makeDestructurable, noop, notNullish, objectEntries, objectOmit, objectPick, pausableFilter, promiseTimeout, provideLocal, pxValue, syncRef, throttleFilter, timestamp, toArray, toRef, toRefs, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useDebounceFn, useIntervalFn, useThrottleFn, useTimeoutFn, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchWithFilter, whenever } from \"@vueuse/shared\";\nimport { Fragment, TransitionGroup, computed, customRef, defineComponent, getCurrentInstance, h, hasInjectionContext, inject, isReadonly, isRef, markRaw, nextTick, onBeforeUpdate, onMounted, onUpdated, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toValue, unref, watch, watchEffect } from \"vue\";\nexport * from \"@vueuse/shared\";\n//#region computedAsync/index.ts\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n\tvar _globalThis$reportErr;\n\tlet options;\n\tif (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };\n\telse options = optionsOrRef || {};\n\tconst { lazy = false, flush = \"sync\", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;\n\tconst started = shallowRef(!lazy);\n\tconst current = shallow ? shallowRef(initialState) : ref(initialState);\n\tlet counter = 0;\n\twatchEffect(async (onInvalidate) => {\n\t\tif (!started.value) return;\n\t\tcounter++;\n\t\tconst counterAtBeginning = counter;\n\t\tlet hasFinished = false;\n\t\tif (evaluating) Promise.resolve().then(() => {\n\t\t\tevaluating.value = true;\n\t\t});\n\t\ttry {\n\t\t\tconst result = await evaluationCallback((cancelCallback) => {\n\t\t\t\tonInvalidate(() => {\n\t\t\t\t\tif (evaluating) evaluating.value = false;\n\t\t\t\t\tif (!hasFinished) cancelCallback();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (counterAtBeginning === counter) current.value = result;\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (evaluating && counterAtBeginning === counter) evaluating.value = false;\n\t\t\thasFinished = true;\n\t\t}\n\t}, { flush });\n\tif (lazy) return computed(() => {\n\t\tstarted.value = true;\n\t\treturn current.value;\n\t});\n\telse return current;\n}\n/** @deprecated use `computedAsync` instead */\nconst asyncComputed = computedAsync;\n//#endregion\n//#region computedInject/index.ts\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n\tlet source = inject(key);\n\tif (defaultSource) source = inject(key, defaultSource);\n\tif (treatDefaultAsFactory) source = inject(key, defaultSource, treatDefaultAsFactory);\n\tif (typeof options === \"function\") return computed((oldValue) => options(source, oldValue));\n\telse return computed({\n\t\tget: (oldValue) => options.get(source, oldValue),\n\t\tset: options.set\n\t});\n}\n//#endregion\n//#region createReusableTemplate/index.ts\n/**\n* This function creates `define` and `reuse` components in pair,\n* It also allow to pass a generic to bind with type.\n*\n* @see https://vueuse.org/createReusableTemplate\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createReusableTemplate(options = {}) {\n\tconst { inheritAttrs = true, name = \"ReusableTemplate\" } = options;\n\tconst render = shallowRef();\n\tconst define = defineComponent({\n\t\tname: `${name}.define`,\n\t\tsetup(_, { slots }) {\n\t\t\treturn () => {\n\t\t\t\trender.value = slots.default;\n\t\t\t};\n\t\t}\n\t});\n\tconst reuse = defineComponent({\n\t\tinheritAttrs,\n\t\tname: `${name}.reuse`,\n\t\tprops: options.props,\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => {\n\t\t\t\tvar _render$value;\n\t\t\t\tif (!render.value && true) throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n\t\t\t\tconst vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {\n\t\t\t\t\t...options.props == null ? keysToCamelKebabCase(attrs) : props,\n\t\t\t\t\t$slots: slots\n\t\t\t\t});\n\t\t\t\treturn inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n\t\t\t};\n\t\t}\n\t});\n\treturn makeDestructurable({\n\t\tdefine,\n\t\treuse\n\t}, [define, reuse]);\n}\nfunction keysToCamelKebabCase(obj) {\n\tconst newObj = {};\n\tfor (const key in obj) newObj[camelize(key)] = obj[key];\n\treturn newObj;\n}\n//#endregion\n//#region createTemplatePromise/index.ts\n/**\n* Creates a template promise component.\n*\n* @see https://vueuse.org/createTemplatePromise\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createTemplatePromise(options = {}) {\n\tlet index = 0;\n\tconst instances = ref([]);\n\tfunction create(...args) {\n\t\tconst props = shallowReactive({\n\t\t\tkey: index++,\n\t\t\targs,\n\t\t\tpromise: void 0,\n\t\t\tresolve: () => {},\n\t\t\treject: () => {},\n\t\t\tisResolving: false,\n\t\t\toptions\n\t\t});\n\t\tinstances.value.push(props);\n\t\tprops.promise = new Promise((_resolve, _reject) => {\n\t\t\tprops.resolve = (v) => {\n\t\t\t\tprops.isResolving = true;\n\t\t\t\treturn _resolve(v);\n\t\t\t};\n\t\t\tprops.reject = _reject;\n\t\t}).finally(() => {\n\t\t\tprops.promise = void 0;\n\t\t\tconst index = instances.value.indexOf(props);\n\t\t\tif (index !== -1) instances.value.splice(index, 1);\n\t\t});\n\t\treturn props.promise;\n\t}\n\tfunction start(...args) {\n\t\tif (options.singleton && instances.value.length > 0) return instances.value[0].promise;\n\t\treturn create(...args);\n\t}\n\tconst component = defineComponent((_, { slots }) => {\n\t\tconst renderList = () => instances.value.map((props) => {\n\t\t\tvar _slots$default;\n\t\t\treturn h(Fragment, { key: props.key }, (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, props));\n\t\t});\n\t\tif (options.transition) return () => h(TransitionGroup, options.transition, renderList);\n\t\treturn renderList;\n\t});\n\tcomponent.start = start;\n\treturn component;\n}\n//#endregion\n//#region createUnrefFn/index.ts\n/**\n* Make a plain function accepting ref and raw values as arguments.\n* Returns the same value the unconverted function returns, with proper typing.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createUnrefFn(fn) {\n\treturn function(...args) {\n\t\treturn fn.apply(this, args.map((i) => toValue(i)));\n\t};\n}\n//#endregion\n//#region _configurable.ts\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n//#endregion\n//#region unrefElement/index.ts\n/**\n* Get the dom element of a ref of element or Vue component instance\n*\n* @param elRef\n*/\nfunction unrefElement(elRef) {\n\tvar _$el;\n\tconst plain = toValue(elRef);\n\treturn (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;\n}\n//#endregion\n//#region useEventListener/index.ts\nfunction useEventListener(...args) {\n\tconst register = (el, event, listener, options) => {\n\t\tel.addEventListener(event, listener, options);\n\t\treturn () => el.removeEventListener(event, listener, options);\n\t};\n\tconst firstParamTargets = computed(() => {\n\t\tconst test = toArray(toValue(args[0])).filter((e) => e != null);\n\t\treturn test.every((e) => typeof e !== \"string\") ? test : void 0;\n\t});\n\treturn watchImmediate(() => {\n\t\tvar _firstParamTargets$va, _firstParamTargets$va2;\n\t\treturn [\n\t\t\t(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),\n\t\t\ttoArray(toValue(firstParamTargets.value ? args[1] : args[0])),\n\t\t\ttoArray(unref(firstParamTargets.value ? args[2] : args[1])),\n\t\t\ttoValue(firstParamTargets.value ? args[3] : args[2])\n\t\t];\n\t}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {\n\t\tif (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;\n\t\tconst optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;\n\t\tconst cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));\n\t\tonCleanup(() => {\n\t\t\tcleanups.forEach((fn) => fn());\n\t\t});\n\t}, { flush: \"post\" });\n}\n//#endregion\n//#region onClickOutside/index.ts\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n\tconst { window = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;\n\tif (!window) return controls ? {\n\t\tstop: noop,\n\t\tcancel: noop,\n\t\ttrigger: noop\n\t} : noop;\n\tif (isIOS && !_iOSWorkaround) {\n\t\t_iOSWorkaround = true;\n\t\tconst listenerOptions = { passive: true };\n\t\tArray.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop, listenerOptions));\n\t\twindow.document.documentElement.addEventListener(\"click\", noop, listenerOptions);\n\t}\n\tlet shouldListen = true;\n\tconst shouldIgnore = (event) => {\n\t\treturn toValue(ignore).some((target) => {\n\t\t\tif (typeof target === \"string\") return Array.from(window.document.querySelectorAll(target)).some((el) => el === event.target || event.composedPath().includes(el));\n\t\t\telse {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\treturn el && (event.target === el || event.composedPath().includes(el));\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* Determines if the given target has multiple root elements.\n\t* Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21\n\t*/\n\tfunction hasMultipleRoots(target) {\n\t\tconst vm = toValue(target);\n\t\treturn vm && vm.$.subTree.shapeFlag === 16;\n\t}\n\tfunction checkMultipleRoots(target, event) {\n\t\tconst vm = toValue(target);\n\t\tconst children = vm.$.subTree && vm.$.subTree.children;\n\t\tif (children == null || !Array.isArray(children)) return false;\n\t\treturn children.some((child) => child.el === event.target || event.composedPath().includes(child.el));\n\t}\n\tconst listener = (event) => {\n\t\tconst el = unrefElement(target);\n\t\tif (event.target == null) return;\n\t\tif (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;\n\t\tif (!el || el === event.target || event.composedPath().includes(el)) return;\n\t\tif (\"detail\" in event && event.detail === 0) shouldListen = !shouldIgnore(event);\n\t\tif (!shouldListen) {\n\t\t\tshouldListen = true;\n\t\t\treturn;\n\t\t}\n\t\thandler(event);\n\t};\n\tlet isProcessingClick = false;\n\tconst cleanup = [\n\t\tuseEventListener(window, \"click\", (event) => {\n\t\t\tif (!isProcessingClick) {\n\t\t\t\tisProcessingClick = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tisProcessingClick = false;\n\t\t\t\t}, 0);\n\t\t\t\tlistener(event);\n\t\t\t}\n\t\t}, {\n\t\t\tpassive: true,\n\t\t\tcapture\n\t\t}),\n\t\tuseEventListener(window, \"pointerdown\", (e) => {\n\t\t\tconst el = unrefElement(target);\n\t\t\tshouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n\t\t}, { passive: true }),\n\t\tdetectIframe && useEventListener(window, \"blur\", (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\tlet activeEl = window.document.activeElement;\n\t\t\t\twhile (activeEl === null || activeEl === void 0 ? void 0 : activeEl.shadowRoot) activeEl = activeEl.shadowRoot.activeElement;\n\t\t\t\tif ((activeEl === null || activeEl === void 0 ? void 0 : activeEl.tagName) === \"IFRAME\" && !(el === null || el === void 0 ? void 0 : el.contains(window.document.activeElement))) handler(event);\n\t\t\t}, 0);\n\t\t}, { passive: true })\n\t].filter(Boolean);\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\tif (controls) return {\n\t\tstop,\n\t\tcancel: () => {\n\t\t\tshouldListen = false;\n\t\t},\n\t\ttrigger: (event) => {\n\t\t\tshouldListen = true;\n\t\t\tlistener(event);\n\t\t\tshouldListen = false;\n\t\t}\n\t};\n\treturn stop;\n}\n//#endregion\n//#region useMounted/index.ts\n/**\n* Mounted state in ref.\n*\n* @see https://vueuse.org/useMounted\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMounted() {\n\tconst isMounted = shallowRef(false);\n\tconst instance = getCurrentInstance();\n\tif (instance) onMounted(() => {\n\t\tisMounted.value = true;\n\t}, instance);\n\treturn isMounted;\n}\n//#endregion\n//#region useSupported/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSupported(callback) {\n\tconst isMounted = useMounted();\n\treturn computed(() => {\n\t\tisMounted.value;\n\t\treturn Boolean(callback());\n\t});\n}\n//#endregion\n//#region useMutationObserver/index.ts\n/**\n* Watch for changes being made to the DOM tree.\n*\n* @see https://vueuse.org/useMutationObserver\n* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN\n* @param target\n* @param callback\n* @param options\n*/\nfunction useMutationObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...mutationOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"MutationObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst items = toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t\treturn new Set(items);\n\t}), (newTargets) => {\n\t\tcleanup();\n\t\tif (isSupported.value && newTargets.size) {\n\t\t\tobserver = new MutationObserver(callback);\n\t\t\tnewTargets.forEach((el) => observer.observe(el, mutationOptions));\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst takeRecords = () => {\n\t\treturn observer === null || observer === void 0 ? void 0 : observer.takeRecords();\n\t};\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop,\n\t\ttakeRecords\n\t};\n}\n//#endregion\n//#region onElementRemoval/index.ts\n/**\n* Fires when the element or any element containing it is removed.\n*\n* @param target\n* @param callback\n* @param options\n*/\nfunction onElementRemoval(target, callback, options = {}) {\n\tconst { window = defaultWindow, document = window === null || window === void 0 ? void 0 : window.document, flush = \"sync\" } = options;\n\tif (!window || !document) return noop;\n\tlet stopFn;\n\tconst cleanupAndUpdate = (fn) => {\n\t\tstopFn === null || stopFn === void 0 || stopFn();\n\t\tstopFn = fn;\n\t};\n\tconst stopWatch = watchEffect(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (el) {\n\t\t\tconst { stop } = useMutationObserver(document, (mutationsList) => {\n\t\t\t\tif (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);\n\t\t\t}, {\n\t\t\t\twindow,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t\tcleanupAndUpdate(stop);\n\t\t}\n\t}, { flush });\n\tconst stopHandle = () => {\n\t\tstopWatch();\n\t\tcleanupAndUpdate();\n\t};\n\ttryOnScopeDispose(stopHandle);\n\treturn stopHandle;\n}\n//#endregion\n//#region onKeyStroke/index.ts\nfunction createKeyPredicate(keyFilter) {\n\tif (typeof keyFilter === \"function\") return keyFilter;\n\telse if (typeof keyFilter === \"string\") return (event) => event.key === keyFilter;\n\telse if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);\n\treturn () => true;\n}\nfunction onKeyStroke(...args) {\n\tlet key;\n\tlet handler;\n\tlet options = {};\n\tif (args.length === 3) {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t\toptions = args[2];\n\t} else if (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tkey = true;\n\t\thandler = args[0];\n\t\toptions = args[1];\n\t} else {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t}\n\telse {\n\t\tkey = true;\n\t\thandler = args[0];\n\t}\n\tconst { target = defaultWindow, eventName = \"keydown\", passive = false, dedupe = false } = options;\n\tconst predicate = createKeyPredicate(key);\n\tconst listener = (e) => {\n\t\tif (e.repeat && toValue(dedupe)) return;\n\t\tif (predicate(e)) handler(e);\n\t};\n\treturn useEventListener(target, eventName, listener, passive);\n}\n/**\n* Listen to the keydown event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyDown(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keydown\"\n\t});\n}\n/**\n* Listen to the keypress event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyPressed(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keypress\"\n\t});\n}\n/**\n* Listen to the keyup event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyUp(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keyup\"\n\t});\n}\n//#endregion\n//#region onLongPress/index.ts\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n\tvar _options$modifiers10, _options$modifiers11;\n\tconst elementRef = computed(() => unrefElement(target));\n\tlet timeout;\n\tlet posStart;\n\tlet startTimestamp;\n\tlet hasLongPressed = false;\n\tfunction clear() {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = void 0;\n\t\t}\n\t\tposStart = void 0;\n\t\tstartTimestamp = void 0;\n\t\thasLongPressed = false;\n\t}\n\tfunction getDelay(ev) {\n\t\tconst delay = options === null || options === void 0 ? void 0 : options.delay;\n\t\tif (typeof delay === \"function\") return delay(ev);\n\t\treturn delay !== null && delay !== void 0 ? delay : DEFAULT_DELAY;\n\t}\n\tfunction onRelease(ev) {\n\t\tvar _options$modifiers, _options$modifiers2, _options$modifiers3;\n\t\tconst [_startTimestamp, _posStart, _hasLongPressed] = [\n\t\t\tstartTimestamp,\n\t\t\tposStart,\n\t\t\thasLongPressed\n\t\t];\n\t\tclear();\n\t\tif (!(options === null || options === void 0 ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp) return;\n\t\tif ((options === null || options === void 0 || (_options$modifiers = options.modifiers) === null || _options$modifiers === void 0 ? void 0 : _options$modifiers.self) && ev.target !== elementRef.value) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers2 = options.modifiers) === null || _options$modifiers2 === void 0 ? void 0 : _options$modifiers2.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers3 = options.modifiers) === null || _options$modifiers3 === void 0 ? void 0 : _options$modifiers3.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - _posStart.x;\n\t\tconst dy = ev.y - _posStart.y;\n\t\tconst distance = Math.sqrt(dx * dx + dy * dy);\n\t\toptions.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed, ev);\n\t}\n\tfunction onDown(ev) {\n\t\tvar _options$modifiers4, _options$modifiers5, _options$modifiers6;\n\t\tif ((options === null || options === void 0 || (_options$modifiers4 = options.modifiers) === null || _options$modifiers4 === void 0 ? void 0 : _options$modifiers4.self) && ev.target !== elementRef.value) return;\n\t\tclear();\n\t\tif (options === null || options === void 0 || (_options$modifiers5 = options.modifiers) === null || _options$modifiers5 === void 0 ? void 0 : _options$modifiers5.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers6 = options.modifiers) === null || _options$modifiers6 === void 0 ? void 0 : _options$modifiers6.stop) ev.stopPropagation();\n\t\tposStart = {\n\t\t\tx: ev.x,\n\t\t\ty: ev.y\n\t\t};\n\t\tstartTimestamp = ev.timeStamp;\n\t\ttimeout = setTimeout(() => {\n\t\t\thasLongPressed = true;\n\t\t\thandler(ev);\n\t\t}, getDelay(ev));\n\t}\n\tfunction onMove(ev) {\n\t\tvar _options$modifiers7, _options$modifiers8, _options$modifiers9, _options$distanceThre;\n\t\tif ((options === null || options === void 0 || (_options$modifiers7 = options.modifiers) === null || _options$modifiers7 === void 0 ? void 0 : _options$modifiers7.self) && ev.target !== elementRef.value) return;\n\t\tif (!posStart || (options === null || options === void 0 ? void 0 : options.distanceThreshold) === false) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers8 = options.modifiers) === null || _options$modifiers8 === void 0 ? void 0 : _options$modifiers8.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers9 = options.modifiers) === null || _options$modifiers9 === void 0 ? void 0 : _options$modifiers9.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - posStart.x;\n\t\tconst dy = ev.y - posStart.y;\n\t\tif (Math.sqrt(dx * dx + dy * dy) >= ((_options$distanceThre = options === null || options === void 0 ? void 0 : options.distanceThreshold) !== null && _options$distanceThre !== void 0 ? _options$distanceThre : DEFAULT_THRESHOLD)) clear();\n\t}\n\tconst listenerOptions = {\n\t\tcapture: options === null || options === void 0 || (_options$modifiers10 = options.modifiers) === null || _options$modifiers10 === void 0 ? void 0 : _options$modifiers10.capture,\n\t\tonce: options === null || options === void 0 || (_options$modifiers11 = options.modifiers) === null || _options$modifiers11 === void 0 ? void 0 : _options$modifiers11.once\n\t};\n\tconst cleanup = [\n\t\tuseEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n\t\tuseEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n\t\tuseEventListener(elementRef, [\"pointerup\", \"pointerleave\"], onRelease, listenerOptions)\n\t];\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\treturn stop;\n}\n//#endregion\n//#region onStartTyping/index.ts\nfunction isFocusedElementEditable() {\n\tconst { activeElement, body } = document;\n\tif (!activeElement) return false;\n\tif (activeElement === body) return false;\n\tswitch (activeElement.tagName) {\n\t\tcase \"INPUT\":\n\t\tcase \"TEXTAREA\": return true;\n\t}\n\treturn activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({ keyCode, metaKey, ctrlKey, altKey }) {\n\tif (metaKey || ctrlKey || altKey) return false;\n\tif (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) return true;\n\tif (keyCode >= 65 && keyCode <= 90) return true;\n\treturn false;\n}\n/**\n* Fires when users start typing on non-editable elements.\n*\n* @see https://vueuse.org/onStartTyping\n* @param callback\n* @param options\n*/\nfunction onStartTyping(callback, options = {}) {\n\tconst { document = defaultDocument, isTypedCharValid: isTypedCharValidFn = isTypedCharValid, isFocusedElementEditable: isFocusedElementEditableFn = isFocusedElementEditable } = options;\n\tconst keydown = (event) => {\n\t\tif (!isFocusedElementEditableFn() && isTypedCharValidFn(event)) callback(event);\n\t};\n\tif (document) useEventListener(document, \"keydown\", keydown, { passive: true });\n}\n//#endregion\n//#region templateRef/index.ts\n/**\n* @deprecated Use Vue's built-in `useTemplateRef` instead.\n*\n* Shorthand for binding ref to template element.\n*\n* @see https://vueuse.org/templateRef\n* @param key\n* @param initialValue\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction templateRef(key, initialValue = null) {\n\tconst instance = getCurrentInstance();\n\tlet _trigger = () => {};\n\tconst element = customRef((track, trigger) => {\n\t\t_trigger = trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tvar _instance$proxy$$refs, _instance$proxy;\n\t\t\t\ttrack();\n\t\t\t\treturn (_instance$proxy$$refs = instance === null || instance === void 0 || (_instance$proxy = instance.proxy) === null || _instance$proxy === void 0 ? void 0 : _instance$proxy.$refs[key]) !== null && _instance$proxy$$refs !== void 0 ? _instance$proxy$$refs : initialValue;\n\t\t\t},\n\t\t\tset() {}\n\t\t};\n\t});\n\ttryOnMounted(_trigger);\n\tonUpdated(_trigger);\n\treturn element;\n}\n//#endregion\n//#region useActiveElement/index.ts\n/**\n* Reactive `document.activeElement`\n*\n* @see https://vueuse.org/useActiveElement\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useActiveElement(options = {}) {\n\tvar _options$document;\n\tconst { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;\n\tconst document = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window === null || window === void 0 ? void 0 : window.document;\n\tconst getDeepActiveElement = () => {\n\t\tlet element = document === null || document === void 0 ? void 0 : document.activeElement;\n\t\tif (deep) {\n\t\t\tvar _element$shadowRoot;\n\t\t\twhile (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement;\n\t\t}\n\t\treturn element;\n\t};\n\tconst activeElement = shallowRef();\n\tconst trigger = () => {\n\t\tactiveElement.value = getDeepActiveElement();\n\t};\n\tif (window) {\n\t\tconst listenerOptions = {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t};\n\t\tuseEventListener(window, \"blur\", (event) => {\n\t\t\tif (event.relatedTarget !== null) return;\n\t\t\ttrigger();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"focus\", trigger, listenerOptions);\n\t}\n\tif (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document });\n\ttrigger();\n\treturn activeElement;\n}\n//#endregion\n//#region useRafFn/index.ts\n/**\n* Call function on every `requestAnimationFrame`. With controls of pausing and resuming.\n*\n* @see https://vueuse.org/useRafFn\n* @param fn\n* @param options\n*/\nfunction useRafFn(fn, options = {}) {\n\tconst { immediate = true, fpsLimit = null, window = defaultWindow, once = false } = options;\n\tconst isActive = shallowRef(false);\n\tconst intervalLimit = computed(() => {\n\t\tconst limit = toValue(fpsLimit);\n\t\treturn limit ? 1e3 / limit : null;\n\t});\n\tlet previousFrameTimestamp = 0;\n\tlet rafId = null;\n\tfunction loop(timestamp) {\n\t\tif (!isActive.value || !window) return;\n\t\tif (!previousFrameTimestamp) previousFrameTimestamp = timestamp;\n\t\tconst delta = timestamp - previousFrameTimestamp;\n\t\tif (intervalLimit.value && delta < intervalLimit.value) {\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t\treturn;\n\t\t}\n\t\tpreviousFrameTimestamp = timestamp;\n\t\tfn({\n\t\t\tdelta,\n\t\t\ttimestamp\n\t\t});\n\t\tif (once) {\n\t\t\tisActive.value = false;\n\t\t\trafId = null;\n\t\t\treturn;\n\t\t}\n\t\trafId = window.requestAnimationFrame(loop);\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value && window) {\n\t\t\tisActive.value = true;\n\t\t\tpreviousFrameTimestamp = 0;\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tif (rafId != null && window) {\n\t\t\twindow.cancelAnimationFrame(rafId);\n\t\t\trafId = null;\n\t\t}\n\t}\n\tif (immediate) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useAnimate/index.ts\n/**\n* Reactive Web Animations API\n*\n* @see https://vueuse.org/useAnimate\n* @param target\n* @param keyframes\n* @param options\n*/\nfunction useAnimate(target, keyframes, options) {\n\tlet config;\n\tlet animateOptions;\n\tif (isObject(options)) {\n\t\tconfig = options;\n\t\tanimateOptions = objectOmit(options, [\n\t\t\t\"window\",\n\t\t\t\"immediate\",\n\t\t\t\"commitStyles\",\n\t\t\t\"persist\",\n\t\t\t\"onReady\",\n\t\t\t\"onError\"\n\t\t]);\n\t} else {\n\t\tconfig = { duration: options };\n\t\tanimateOptions = options;\n\t}\n\tconst { window = defaultWindow, immediate = true, commitStyles, persist, playbackRate: _playbackRate = 1, onReady, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = config;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n\tconst animate = shallowRef(void 0);\n\tconst store = shallowReactive({\n\t\tstartTime: null,\n\t\tcurrentTime: null,\n\t\ttimeline: null,\n\t\tplaybackRate: _playbackRate,\n\t\tpending: false,\n\t\tplayState: immediate ? \"idle\" : \"paused\",\n\t\treplaceState: \"active\"\n\t});\n\tconst pending = computed(() => store.pending);\n\tconst playState = computed(() => store.playState);\n\tconst replaceState = computed(() => store.replaceState);\n\tconst startTime = computed({\n\t\tget() {\n\t\t\treturn store.startTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.startTime = value;\n\t\t\tif (animate.value) animate.value.startTime = value;\n\t\t}\n\t});\n\tconst currentTime = computed({\n\t\tget() {\n\t\t\treturn store.currentTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.currentTime = value;\n\t\t\tif (animate.value) {\n\t\t\t\tanimate.value.currentTime = value;\n\t\t\t\tsyncResume();\n\t\t\t}\n\t\t}\n\t});\n\tconst timeline = computed({\n\t\tget() {\n\t\t\treturn store.timeline;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.timeline = value;\n\t\t\tif (animate.value) animate.value.timeline = value;\n\t\t}\n\t});\n\tconst playbackRate = computed({\n\t\tget() {\n\t\t\treturn store.playbackRate;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.playbackRate = value;\n\t\t\tif (animate.value) animate.value.playbackRate = value;\n\t\t}\n\t});\n\tconst play = () => {\n\t\tif (animate.value) try {\n\t\t\tanimate.value.play();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t\telse update();\n\t};\n\tconst pause = () => {\n\t\ttry {\n\t\t\tvar _animate$value;\n\t\t\t(_animate$value = animate.value) === null || _animate$value === void 0 || _animate$value.pause();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst reverse = () => {\n\t\tif (!animate.value) update();\n\t\ttry {\n\t\t\tvar _animate$value2;\n\t\t\t(_animate$value2 = animate.value) === null || _animate$value2 === void 0 || _animate$value2.reverse();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst finish = () => {\n\t\ttry {\n\t\t\tvar _animate$value3;\n\t\t\t(_animate$value3 = animate.value) === null || _animate$value3 === void 0 || _animate$value3.finish();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\ttry {\n\t\t\tvar _animate$value4;\n\t\t\t(_animate$value4 = animate.value) === null || _animate$value4 === void 0 || _animate$value4.cancel();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\twatch(() => unrefElement(target), (el) => {\n\t\tif (el) update(true);\n\t\telse animate.value = void 0;\n\t});\n\twatch(() => keyframes, (value) => {\n\t\tif (animate.value) {\n\t\t\tupdate();\n\t\t\tconst targetEl = unrefElement(target);\n\t\t\tif (targetEl) animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);\n\t\t}\n\t}, { deep: true });\n\ttryOnMounted(() => update(true), false);\n\ttryOnScopeDispose(cancel);\n\tfunction update(init) {\n\t\tconst el = unrefElement(target);\n\t\tif (!isSupported.value || !el) return;\n\t\tif (!animate.value) animate.value = el.animate(toValue(keyframes), animateOptions);\n\t\tif (persist) animate.value.persist();\n\t\tif (_playbackRate !== 1) animate.value.playbackRate = _playbackRate;\n\t\tif (init && !immediate) animate.value.pause();\n\t\telse syncResume();\n\t\tonReady === null || onReady === void 0 || onReady(animate.value);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(animate, [\n\t\t\"cancel\",\n\t\t\"finish\",\n\t\t\"remove\"\n\t], syncPause, listenerOptions);\n\tuseEventListener(animate, \"finish\", () => {\n\t\tvar _animate$value5;\n\t\tif (commitStyles) (_animate$value5 = animate.value) === null || _animate$value5 === void 0 || _animate$value5.commitStyles();\n\t}, listenerOptions);\n\tconst { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n\t\tif (!animate.value) return;\n\t\tstore.pending = animate.value.pending;\n\t\tstore.playState = animate.value.playState;\n\t\tstore.replaceState = animate.value.replaceState;\n\t\tstore.startTime = animate.value.startTime;\n\t\tstore.currentTime = animate.value.currentTime;\n\t\tstore.timeline = animate.value.timeline;\n\t\tstore.playbackRate = animate.value.playbackRate;\n\t}, { immediate: false });\n\tfunction syncResume() {\n\t\tif (isSupported.value) resumeRef();\n\t}\n\tfunction syncPause() {\n\t\tif (isSupported.value && window) window.requestAnimationFrame(pauseRef);\n\t}\n\treturn {\n\t\tisSupported,\n\t\tanimate,\n\t\tplay,\n\t\tpause,\n\t\treverse,\n\t\tfinish,\n\t\tcancel,\n\t\tpending,\n\t\tplayState,\n\t\treplaceState,\n\t\tstartTime,\n\t\tcurrentTime,\n\t\ttimeline,\n\t\tplaybackRate\n\t};\n}\n//#endregion\n//#region useAsyncQueue/index.ts\n/**\n* Asynchronous queue task controller.\n*\n* @see https://vueuse.org/useAsyncQueue\n* @param tasks\n* @param options\n*/\nfunction useAsyncQueue(tasks, options) {\n\tconst { interrupt = true, onError = noop, onFinished = noop, signal } = options || {};\n\tconst promiseState = {\n\t\taborted: \"aborted\",\n\t\tfulfilled: \"fulfilled\",\n\t\tpending: \"pending\",\n\t\trejected: \"rejected\"\n\t};\n\tconst result = reactive(Array.from(Array.from({ length: tasks.length }), () => ({\n\t\tstate: promiseState.pending,\n\t\tdata: null\n\t})));\n\tconst activeIndex = shallowRef(-1);\n\tif (!tasks || tasks.length === 0) {\n\t\tonFinished();\n\t\treturn {\n\t\t\tactiveIndex,\n\t\t\tresult\n\t\t};\n\t}\n\tfunction updateResult(state, res) {\n\t\tactiveIndex.value++;\n\t\tresult[activeIndex.value].data = res;\n\t\tresult[activeIndex.value].state = state;\n\t}\n\ttasks.reduce((prev, curr) => {\n\t\treturn prev.then((prevRes) => {\n\t\t\tvar _result$activeIndex$v;\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, /* @__PURE__ */ new Error(\"aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (((_result$activeIndex$v = result[activeIndex.value]) === null || _result$activeIndex$v === void 0 ? void 0 : _result$activeIndex$v.state) === promiseState.rejected && interrupt) {\n\t\t\t\tonFinished();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst done = curr(prevRes).then((currentRes) => {\n\t\t\t\tupdateResult(promiseState.fulfilled, currentRes);\n\t\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\t\treturn currentRes;\n\t\t\t});\n\t\t\tif (!signal) return done;\n\t\t\treturn Promise.race([done, whenAborted(signal)]);\n\t\t}).catch((e) => {\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, e);\n\t\t\t\treturn e;\n\t\t\t}\n\t\t\tupdateResult(promiseState.rejected, e);\n\t\t\tonError();\n\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\treturn e;\n\t\t});\n\t}, Promise.resolve());\n\treturn {\n\t\tactiveIndex,\n\t\tresult\n\t};\n}\nfunction whenAborted(signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst error = /* @__PURE__ */ new Error(\"aborted\");\n\t\tif (signal.aborted) reject(error);\n\t\telse signal.addEventListener(\"abort\", () => reject(error), { once: true });\n\t});\n}\n//#endregion\n//#region useAsyncState/index.ts\n/**\n* Reactive async state. Will not block your setup function and will trigger changes once\n* the promise is ready.\n*\n* @see https://vueuse.org/useAsyncState\n* @param promise The promise / async function to be resolved\n* @param initialState The initial state, used until the first evaluation finishes\n* @param options\n*/\nfunction useAsyncState(promise, initialState, options) {\n\tvar _globalThis$reportErr;\n\tconst { immediate = true, delay = 0, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop, onSuccess = noop, resetOnExecute = true, shallow = true, throwError } = options !== null && options !== void 0 ? options : {};\n\tconst state = shallow ? shallowRef(initialState) : ref(initialState);\n\tconst isReady = shallowRef(false);\n\tconst isLoading = shallowRef(false);\n\tconst error = shallowRef(void 0);\n\tlet executionsCount = 0;\n\tasync function execute(delay = 0, ...args) {\n\t\tconst executionId = executionsCount += 1;\n\t\tif (resetOnExecute) state.value = toValue(initialState);\n\t\terror.value = void 0;\n\t\tisReady.value = false;\n\t\tisLoading.value = true;\n\t\tif (delay > 0) await promiseTimeout(delay);\n\t\tconst _promise = typeof promise === \"function\" ? promise(...args) : promise;\n\t\ttry {\n\t\t\tconst data = await _promise;\n\t\t\tif (executionId === executionsCount) {\n\t\t\t\tstate.value = data;\n\t\t\t\tisReady.value = true;\n\t\t\t}\n\t\t\tonSuccess(data);\n\t\t\treturn data;\n\t\t} catch (e) {\n\t\t\tif (executionId === executionsCount) error.value = e;\n\t\t\tonError(e);\n\t\t\tif (throwError) throw e;\n\t\t} finally {\n\t\t\tif (executionId === executionsCount) isLoading.value = false;\n\t\t}\n\t}\n\tif (immediate) execute(delay);\n\tconst shell = {\n\t\tstate,\n\t\tisReady,\n\t\tisLoading,\n\t\terror,\n\t\texecute,\n\t\texecuteImmediate: (...args) => execute(0, ...args)\n\t};\n\tfunction waitUntilIsLoaded() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilIsLoaded().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\n//#endregion\n//#region useBase64/serialization.ts\nconst defaults = {\n\tarray: (v) => JSON.stringify(v),\n\tobject: (v) => JSON.stringify(v),\n\tset: (v) => JSON.stringify(Array.from(v)),\n\tmap: (v) => JSON.stringify(Object.fromEntries(v)),\n\tnull: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n\tif (!target) return defaults.null;\n\tif (target instanceof Map) return defaults.map;\n\telse if (target instanceof Set) return defaults.set;\n\telse if (Array.isArray(target)) return defaults.array;\n\telse return defaults.object;\n}\n//#endregion\n//#region useBase64/index.ts\nfunction useBase64(target, options) {\n\tconst base64 = shallowRef(\"\");\n\tconst promise = shallowRef();\n\tfunction execute() {\n\t\tif (!isClient) return;\n\t\tpromise.value = new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst _target = toValue(target);\n\t\t\t\tif (_target == null) resolve(\"\");\n\t\t\t\telse if (typeof _target === \"string\") resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n\t\t\t\telse if (_target instanceof Blob) resolve(blobToBase64(_target));\n\t\t\t\telse if (_target instanceof ArrayBuffer) resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n\t\t\t\telse if (_target instanceof HTMLCanvasElement) resolve(_target.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\telse if (_target instanceof HTMLImageElement) {\n\t\t\t\t\tconst img = _target.cloneNode(false);\n\t\t\t\t\timg.crossOrigin = \"Anonymous\";\n\t\t\t\t\timgLoaded(img).then(() => {\n\t\t\t\t\t\tconst canvas = document.createElement(\"canvas\");\n\t\t\t\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tresolve(canvas.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\t\t}).catch(reject);\n\t\t\t\t} else if (typeof _target === \"object\") {\n\t\t\t\t\tconst serialized = ((options === null || options === void 0 ? void 0 : options.serializer) || getDefaultSerialization(_target))(_target);\n\t\t\t\t\treturn resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n\t\t\t\t} else reject(/* @__PURE__ */ new Error(\"target is unsupported types\"));\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t\tpromise.value.then((res) => {\n\t\t\tbase64.value = (options === null || options === void 0 ? void 0 : options.dataUrl) === false ? res.replace(/^data:.*?;base64,/, \"\") : res;\n\t\t});\n\t\treturn promise.value;\n\t}\n\tif (isRef(target) || typeof target === \"function\") watch(target, execute, { immediate: true });\n\telse execute();\n\treturn {\n\t\tbase64,\n\t\tpromise,\n\t\texecute\n\t};\n}\nfunction imgLoaded(img) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (!img.complete) {\n\t\t\timg.onload = () => {\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\timg.onerror = reject;\n\t\t} else resolve();\n\t});\n}\nfunction blobToBase64(blob) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst fr = new FileReader();\n\t\tfr.onload = (e) => {\n\t\t\tresolve(e.target.result);\n\t\t};\n\t\tfr.onerror = reject;\n\t\tfr.readAsDataURL(blob);\n\t});\n}\n//#endregion\n//#region useBattery/index.ts\n/**\n* Reactive Battery Status API.\n*\n* @see https://vueuse.org/useBattery\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBattery(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst events = [\n\t\t\"chargingchange\",\n\t\t\"chargingtimechange\",\n\t\t\"dischargingtimechange\",\n\t\t\"levelchange\"\n\t];\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n\tconst charging = shallowRef(false);\n\tconst chargingTime = shallowRef(0);\n\tconst dischargingTime = shallowRef(0);\n\tconst level = shallowRef(1);\n\tlet battery;\n\tfunction updateBatteryInfo() {\n\t\tcharging.value = this.charging;\n\t\tchargingTime.value = this.chargingTime || 0;\n\t\tdischargingTime.value = this.dischargingTime || 0;\n\t\tlevel.value = this.level;\n\t}\n\tif (isSupported.value) navigator.getBattery().then((_battery) => {\n\t\tbattery = _battery;\n\t\tupdateBatteryInfo.call(battery);\n\t\tuseEventListener(battery, events, updateBatteryInfo, { passive: true });\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcharging,\n\t\tchargingTime,\n\t\tdischargingTime,\n\t\tlevel\n\t};\n}\n//#endregion\n//#region useBluetooth/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useBluetooth(options) {\n\tlet { acceptAllDevices = false } = options || {};\n\tconst { filters = void 0, optionalServices = void 0, navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"bluetooth\" in navigator);\n\tconst device = shallowRef();\n\tconst error = shallowRef(null);\n\twatch(device, () => {\n\t\tconnectToBluetoothGATTServer();\n\t});\n\tasync function requestDevice() {\n\t\tif (!isSupported.value) return;\n\t\terror.value = null;\n\t\tif (filters && filters.length > 0) acceptAllDevices = false;\n\t\ttry {\n\t\t\tdevice.value = await (navigator === null || navigator === void 0 ? void 0 : navigator.bluetooth.requestDevice({\n\t\t\t\tacceptAllDevices,\n\t\t\t\tfilters,\n\t\t\t\toptionalServices\n\t\t\t}));\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\tconst server = shallowRef();\n\tconst isConnected = shallowRef(false);\n\tfunction reset() {\n\t\tisConnected.value = false;\n\t\tdevice.value = void 0;\n\t\tserver.value = void 0;\n\t}\n\tasync function connectToBluetoothGATTServer() {\n\t\terror.value = null;\n\t\tif (device.value && device.value.gatt) {\n\t\t\tuseEventListener(device, \"gattserverdisconnected\", reset, { passive: true });\n\t\t\ttry {\n\t\t\t\tserver.value = await device.value.gatt.connect();\n\t\t\t\tisConnected.value = server.value.connected;\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t}\n\t}\n\ttryOnMounted(() => {\n\t\tvar _device$value$gatt;\n\t\tif (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.connect();\n\t});\n\ttryOnScopeDispose(() => {\n\t\tvar _device$value$gatt2;\n\t\tif (device.value) (_device$value$gatt2 = device.value.gatt) === null || _device$value$gatt2 === void 0 || _device$value$gatt2.disconnect();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisConnected: shallowReadonly(isConnected),\n\t\tdevice,\n\t\trequestDevice,\n\t\tserver,\n\t\terror\n\t};\n}\n//#endregion\n//#region useSSRWidth/index.ts\nconst ssrWidthSymbol = Symbol(\"vueuse-ssr-width\");\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSSRWidth() {\n\tconst ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;\n\treturn typeof ssrWidth === \"number\" ? ssrWidth : void 0;\n}\nfunction provideSSRWidth(width, app) {\n\tif (app !== void 0) app.provide(ssrWidthSymbol, width);\n\telse provideLocal(ssrWidthSymbol, width);\n}\n//#endregion\n//#region useMediaQuery/index.ts\n/**\n* Reactive Media Query.\n*\n* @see https://vueuse.org/useMediaQuery\n* @param query\n* @param options\n*/\nfunction useMediaQuery(query, options = {}) {\n\tconst { window = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n\tconst ssrSupport = shallowRef(typeof ssrWidth === \"number\");\n\tconst mediaQuery = shallowRef();\n\tconst matches = shallowRef(false);\n\tconst handler = (event) => {\n\t\tmatches.value = event.matches;\n\t};\n\twatchEffect(() => {\n\t\tif (ssrSupport.value) {\n\t\t\tssrSupport.value = !isSupported.value;\n\t\t\tconst queryStrings = toValue(query).split(\",\");\n\t\t\tmatches.value = queryStrings.some((queryString) => {\n\t\t\t\tconst not = queryString.includes(\"not all\");\n\t\t\t\tconst minWidth = queryString.match(/\\(\\s*min-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tconst maxWidth = queryString.match(/\\(\\s*max-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tlet res = Boolean(minWidth || maxWidth);\n\t\t\t\tif (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);\n\t\t\t\tif (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);\n\t\t\t\treturn not ? !res : res;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!isSupported.value) return;\n\t\tmediaQuery.value = window.matchMedia(toValue(query));\n\t\tmatches.value = mediaQuery.value.matches;\n\t});\n\tuseEventListener(mediaQuery, \"change\", handler, { passive: true });\n\treturn computed(() => matches.value);\n}\n//#endregion\n//#region useBreakpoints/breakpoints.ts\n/**\n* Breakpoints from Tailwind V2\n*\n* @see https://tailwindcss.com/docs/breakpoints\n*/\nconst breakpointsTailwind = {\n\t\"sm\": 640,\n\t\"md\": 768,\n\t\"lg\": 1024,\n\t\"xl\": 1280,\n\t\"2xl\": 1536\n};\n/**\n* Breakpoints from Bootstrap V5\n*\n* @see https://getbootstrap.com/docs/5.0/layout/breakpoints\n*/\nconst breakpointsBootstrapV5 = {\n\txs: 0,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1400\n};\n/**\n* Breakpoints from Vuetify V2\n*\n* @see https://v2.vuetifyjs.com/en/features/breakpoints/\n*/\nconst breakpointsVuetifyV2 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1264,\n\txl: 1904\n};\n/**\n* Breakpoints from Vuetify V3\n*\n* @see https://vuetifyjs.com/en/styles/float/#overview\n*/\nconst breakpointsVuetifyV3 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1280,\n\txl: 1920,\n\txxl: 2560\n};\n/**\n* Alias to `breakpointsVuetifyV2`\n*\n* @deprecated explictly use `breakpointsVuetifyV2` or `breakpointsVuetifyV3` instead\n*/\nconst breakpointsVuetify = breakpointsVuetifyV2;\n/**\n* Breakpoints from Ant Design\n*\n* @see https://ant.design/components/layout/#breakpoint-width\n*/\nconst breakpointsAntDesign = {\n\txs: 480,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1600\n};\n/**\n* Breakpoints from Quasar V2\n*\n* @see https://quasar.dev/style/breakpoints\n*/\nconst breakpointsQuasar = {\n\txs: 0,\n\tsm: 600,\n\tmd: 1024,\n\tlg: 1440,\n\txl: 1920\n};\n/**\n* Sematic Breakpoints\n*/\nconst breakpointsSematic = {\n\tmobileS: 320,\n\tmobileM: 375,\n\tmobileL: 425,\n\ttablet: 768,\n\tlaptop: 1024,\n\tlaptopL: 1440,\n\tdesktop4K: 2560\n};\n/**\n* Breakpoints from Master CSS\n*\n* @see https://docs.master.co/css/breakpoints\n*/\nconst breakpointsMasterCss = {\n\t\"3xs\": 360,\n\t\"2xs\": 480,\n\t\"xs\": 600,\n\t\"sm\": 768,\n\t\"md\": 1024,\n\t\"lg\": 1280,\n\t\"xl\": 1440,\n\t\"2xl\": 1600,\n\t\"3xl\": 1920,\n\t\"4xl\": 2560\n};\n/**\n* Breakpoints from PrimeFlex\n*\n* @see https://primeflex.org/installation\n*/\nconst breakpointsPrimeFlex = {\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200\n};\n/**\n* Breakpoints from ElementUI/ElementPlus\n*\n* @see https://element.eleme.io/#/en-US/component/layout\n* @see https://element-plus.org/en-US/component/layout.html\n*/\nconst breakpointsElement = {\n\txs: 0,\n\tsm: 768,\n\tmd: 992,\n\tlg: 1200,\n\txl: 1920\n};\n//#endregion\n//#region useBreakpoints/index.ts\n/**\n* Reactively viewport breakpoints\n*\n* @see https://vueuse.org/useBreakpoints\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBreakpoints(breakpoints, options = {}) {\n\tfunction getValue(k, delta) {\n\t\tlet v = toValue(breakpoints[toValue(k)]);\n\t\tif (delta != null) v = increaseWithUnit(v, delta);\n\t\tif (typeof v === \"number\") v = `${v}px`;\n\t\treturn v;\n\t}\n\tconst { window = defaultWindow, strategy = \"min-width\", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst ssrSupport = typeof ssrWidth === \"number\";\n\tconst mounted = ssrSupport ? shallowRef(false) : { value: true };\n\tif (ssrSupport) tryOnMounted(() => mounted.value = !!window);\n\tfunction match(query, size) {\n\t\tif (!mounted.value && ssrSupport) return query === \"min\" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);\n\t\tif (!window) return false;\n\t\treturn window.matchMedia(`(${query}-width: ${size})`).matches;\n\t}\n\tconst greaterOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n\t};\n\tconst smallerOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n\t};\n\tconst shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n\t\tObject.defineProperty(shortcuts, k, {\n\t\t\tget: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\treturn shortcuts;\n\t}, {});\n\tfunction current() {\n\t\tconst points = Object.keys(breakpoints).map((k) => [\n\t\t\tk,\n\t\t\tshortcutMethods[k],\n\t\t\tpxValue(getValue(k))\n\t\t]).sort((a, b) => a[2] - b[2]);\n\t\treturn computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n\t}\n\treturn Object.assign(shortcutMethods, {\n\t\tgreaterOrEqual,\n\t\tsmallerOrEqual,\n\t\tgreater(k) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(k, .1)})`, options);\n\t\t},\n\t\tsmaller(k) {\n\t\t\treturn useMediaQuery(() => `(max-width: ${getValue(k, -.1)})`, options);\n\t\t},\n\t\tbetween(a, b) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -.1)})`, options);\n\t\t},\n\t\tisGreater(k) {\n\t\t\treturn match(\"min\", getValue(k, .1));\n\t\t},\n\t\tisGreaterOrEqual(k) {\n\t\t\treturn match(\"min\", getValue(k));\n\t\t},\n\t\tisSmaller(k) {\n\t\t\treturn match(\"max\", getValue(k, -.1));\n\t\t},\n\t\tisSmallerOrEqual(k) {\n\t\t\treturn match(\"max\", getValue(k));\n\t\t},\n\t\tisInBetween(a, b) {\n\t\t\treturn match(\"min\", getValue(a)) && match(\"max\", getValue(b, -.1));\n\t\t},\n\t\tcurrent,\n\t\tactive() {\n\t\t\tconst bps = current();\n\t\t\treturn computed(() => bps.value.length === 0 ? \"\" : bps.value.at(strategy === \"min-width\" ? -1 : 0));\n\t\t}\n\t});\n}\n//#endregion\n//#region useBroadcastChannel/index.ts\n/**\n* Reactive BroadcastChannel\n*\n* @see https://vueuse.org/useBroadcastChannel\n* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n* @param options\n*\n*/\nfunction useBroadcastChannel(options) {\n\tconst { name, window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"BroadcastChannel\" in window);\n\tconst isClosed = shallowRef(false);\n\tconst channel = shallowRef();\n\tconst data = shallowRef();\n\tconst error = shallowRef(null);\n\tconst post = (data) => {\n\t\tif (channel.value) channel.value.postMessage(data);\n\t};\n\tconst close = () => {\n\t\tif (channel.value) channel.value.close();\n\t\tisClosed.value = true;\n\t};\n\tif (isSupported.value) tryOnMounted(() => {\n\t\terror.value = null;\n\t\tchannel.value = new BroadcastChannel(name);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(channel, \"message\", (e) => {\n\t\t\tdata.value = e.data;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"messageerror\", (e) => {\n\t\t\terror.value = e;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"close\", () => {\n\t\t\tisClosed.value = true;\n\t\t}, listenerOptions);\n\t});\n\ttryOnScopeDispose(() => {\n\t\tclose();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tchannel,\n\t\tdata,\n\t\tpost,\n\t\tclose,\n\t\terror,\n\t\tisClosed\n\t};\n}\n//#endregion\n//#region useBrowserLocation/index.ts\nconst WRITABLE_PROPERTIES = [\n\t\"hash\",\n\t\"host\",\n\t\"hostname\",\n\t\"href\",\n\t\"pathname\",\n\t\"port\",\n\t\"protocol\",\n\t\"search\"\n];\n/**\n* Reactive browser location.\n*\n* @see https://vueuse.org/useBrowserLocation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBrowserLocation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst refs = Object.fromEntries(WRITABLE_PROPERTIES.map((key) => [key, ref()]));\n\tconst buildState = (trigger) => {\n\t\tvar _window$location;\n\t\tconst { state, length } = (window === null || window === void 0 ? void 0 : window.history) || {};\n\t\tconst { origin } = (window === null || window === void 0 ? void 0 : window.location) || {};\n\t\tfor (const key of WRITABLE_PROPERTIES) refs[key].value = window === null || window === void 0 || (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location[key];\n\t\treturn reactive({\n\t\t\ttrigger,\n\t\t\tstate,\n\t\t\tlength,\n\t\t\torigin,\n\t\t\t...refs\n\t\t});\n\t};\n\tconst state = ref(buildState(\"load\"));\n\tfor (const [key, ref] of objectEntries(refs)) watch(ref, (value) => {\n\t\tif (!(window === null || window === void 0 ? void 0 : window.location) || window.location[key] === value) return;\n\t\twindow.location[key] = value;\n\t});\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), listenerOptions);\n\t\tuseEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), listenerOptions);\n\t}\n\treturn state;\n}\n//#endregion\n//#region useCached/index.ts\nfunction useCached(refValue, comparator = (newSourceValue, cachedValue) => newSourceValue === cachedValue, options) {\n\tconst { deepRefs = true, ...watchOptions } = options || {};\n\tconst cachedValue = createRef(refValue.value, deepRefs);\n\twatch(() => refValue.value, (value) => {\n\t\tif (!comparator(value, cachedValue.value)) cachedValue.value = value;\n\t}, watchOptions);\n\treturn cachedValue;\n}\n//#endregion\n//#region usePermission/index.ts\n/**\n* Reactive Permissions API.\n*\n* @see https://vueuse.org/usePermission\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePermission(permissionDesc, options = {}) {\n\tconst { controls = false, navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"permissions\" in navigator);\n\tconst permissionStatus = shallowRef();\n\tconst desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n\tconst state = shallowRef();\n\tconst update = () => {\n\t\tvar _permissionStatus$val, _permissionStatus$val2;\n\t\tstate.value = (_permissionStatus$val = (_permissionStatus$val2 = permissionStatus.value) === null || _permissionStatus$val2 === void 0 ? void 0 : _permissionStatus$val2.state) !== null && _permissionStatus$val !== void 0 ? _permissionStatus$val : \"prompt\";\n\t};\n\tuseEventListener(permissionStatus, \"change\", update, { passive: true });\n\tconst query = createSingletonPromise(async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionStatus.value) try {\n\t\t\tpermissionStatus.value = await navigator.permissions.query(desc);\n\t\t} catch (_unused) {\n\t\t\tpermissionStatus.value = void 0;\n\t\t} finally {\n\t\t\tupdate();\n\t\t}\n\t\tif (controls) return toRaw(permissionStatus.value);\n\t});\n\tquery();\n\tif (controls) return {\n\t\tstate,\n\t\tisSupported,\n\t\tquery\n\t};\n\telse return state;\n}\n//#endregion\n//#region useClipboard/index.ts\nfunction useClipboard(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;\n\tconst isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst permissionRead = usePermission(\"clipboard-read\");\n\tconst permissionWrite = usePermission(\"clipboard-write\");\n\tconst isSupported = computed(() => isClipboardApiSupported.value || legacy);\n\tconst text = shallowRef(\"\");\n\tconst copied = shallowRef(false);\n\tconst copyPending = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tlet lastLegacyId = 0;\n\tasync function updateText() {\n\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));\n\t\tif (!useLegacy) try {\n\t\t\ttext.value = await navigator.clipboard.readText();\n\t\t} catch (_unused) {\n\t\t\tuseLegacy = true;\n\t\t}\n\t\tif (useLegacy) text.value = legacyRead();\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateText, { passive: true });\n\tasync function copy(value) {\n\t\tconst resolvedValue = value !== null && value !== void 0 ? value : toValue(source);\n\t\tif (isSupported.value && resolvedValue != null) {\n\t\t\tcopyPending.value = true;\n\t\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));\n\t\t\tif (!useLegacy) try {\n\t\t\t\tconst clipboardItem = createClipboardItem(resolvedValue);\n\t\t\t\tawait navigator.clipboard.write([clipboardItem]);\n\t\t\t} catch (_unused2) {\n\t\t\t\tuseLegacy = true;\n\t\t\t}\n\t\t\tif (useLegacy) if (typeof resolvedValue === \"string\") {\n\t\t\t\ttext.value = resolvedValue;\n\t\t\t\tlegacyCopy(resolvedValue);\n\t\t\t} else {\n\t\t\t\tconst currentId = ++lastLegacyId;\n\t\t\t\tconst resolvedText = await resolvedValue();\n\t\t\t\tif (resolvedText != null && currentId === lastLegacyId) {\n\t\t\t\t\ttext.value = resolvedText;\n\t\t\t\t\tlegacyCopy(resolvedText);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t\tcopyPending.value = false;\n\t\t}\n\t}\n\tfunction createClipboardItem(value) {\n\t\tif (typeof value === \"string\") {\n\t\t\ttext.value = value;\n\t\t\treturn new ClipboardItem({ \"text/plain\": value });\n\t\t} else return new ClipboardItem({ \"text/plain\": value().then((resolvedText = \"\") => {\n\t\t\ttext.value = resolvedText;\n\t\t\treturn new Blob([resolvedText], { type: \"text/plain\" });\n\t\t}) });\n\t}\n\tfunction legacyCopy(value) {\n\t\tconst ta = document.createElement(\"textarea\");\n\t\tta.value = value;\n\t\tta.style.position = \"absolute\";\n\t\tta.style.opacity = \"0\";\n\t\tta.setAttribute(\"readonly\", \"\");\n\t\tdocument.body.appendChild(ta);\n\t\tta.select();\n\t\tdocument.execCommand(\"copy\");\n\t\tta.remove();\n\t}\n\tfunction legacyRead() {\n\t\tvar _document$getSelectio, _document, _document$getSelectio2;\n\t\treturn (_document$getSelectio = (_document = document) === null || _document === void 0 || (_document$getSelectio2 = _document.getSelection) === null || _document$getSelectio2 === void 0 || (_document$getSelectio2 = _document$getSelectio2.call(_document)) === null || _document$getSelectio2 === void 0 ? void 0 : _document$getSelectio2.toString()) !== null && _document$getSelectio !== void 0 ? _document$getSelectio : \"\";\n\t}\n\tfunction isAllowed(status) {\n\t\treturn status === \"granted\" || status === \"prompt\";\n\t}\n\treturn {\n\t\tcopyPending: shallowReadonly(copyPending),\n\t\tisSupported,\n\t\ttext: shallowReadonly(text),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy\n\t};\n}\n//#endregion\n//#region useClipboardItems/index.ts\nfunction useClipboardItems(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst content = shallowRef([]);\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tfunction updateContent() {\n\t\tif (isSupported.value) navigator.clipboard.read().then((items) => {\n\t\t\tcontent.value = items;\n\t\t});\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateContent, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tawait navigator.clipboard.write(value);\n\t\t\tcontent.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\treturn {\n\t\tisSupported,\n\t\tcontent: shallowReadonly(content),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy,\n\t\tread: updateContent\n\t};\n}\n//#endregion\n//#region useCloned/index.ts\nfunction cloneFnJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n\tconst cloned = ref({});\n\tconst isModified = shallowRef(false);\n\tlet _lastSync = false;\n\tconst { manual, clone = cloneFnJSON, deep = true, immediate = true } = options;\n\twatch(cloned, () => {\n\t\tif (_lastSync) {\n\t\t\t_lastSync = false;\n\t\t\treturn;\n\t\t}\n\t\tisModified.value = true;\n\t}, {\n\t\tdeep: true,\n\t\tflush: \"sync\"\n\t});\n\tfunction sync() {\n\t\t_lastSync = true;\n\t\tisModified.value = false;\n\t\tcloned.value = clone(toValue(source));\n\t}\n\tif (!manual && (isRef(source) || typeof source === \"function\")) watch(source, sync, {\n\t\t...options,\n\t\tdeep,\n\t\timmediate\n\t});\n\telse sync();\n\treturn {\n\t\tcloned,\n\t\tisModified,\n\t\tsync\n\t};\n}\n//#endregion\n//#region ssr-handlers.ts\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* #__PURE__ */ getHandlers();\nfunction getHandlers() {\n\tif (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};\n\treturn _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n\treturn handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n\thandlers[key] = fn;\n}\n//#endregion\n//#region usePreferredDark/index.ts\n/**\n* Reactive dark theme preference.\n*\n* @see https://vueuse.org/usePreferredDark\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredDark(options) {\n\treturn useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n//#endregion\n//#region useStorage/guess.ts\nfunction guessSerializerType(rawInit) {\n\treturn rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n//#endregion\n//#region useStorage/index.ts\nconst StorageSerializers = {\n\tboolean: {\n\t\tread: (v) => v === \"true\",\n\t\twrite: (v) => String(v)\n\t},\n\tobject: {\n\t\tread: (v) => JSON.parse(v),\n\t\twrite: (v) => JSON.stringify(v)\n\t},\n\tnumber: {\n\t\tread: (v) => Number.parseFloat(v),\n\t\twrite: (v) => String(v)\n\t},\n\tany: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tstring: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tmap: {\n\t\tread: (v) => new Map(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v.entries()))\n\t},\n\tset: {\n\t\tread: (v) => new Set(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v))\n\t},\n\tdate: {\n\t\tread: (v) => new Date(v),\n\t\twrite: (v) => v.toISOString()\n\t}\n};\nconst customStorageEventName = \"vueuse-storage\";\n/**\n* Reactive LocalStorage/SessionStorage.\n*\n* @see https://vueuse.org/useStorage\n*/\nfunction useStorage(key, defaults, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, initOnMounted } = options;\n\tconst data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n\tconst keyComputed = computed(() => toValue(key));\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorage\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tif (!storage) return data;\n\tconst rawInit = toValue(defaults);\n\tconst type = guessSerializerType(rawInit);\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tconst { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\twatch(keyComputed, () => update(), { flush });\n\tlet firstMounted = false;\n\tconst onStorageEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdate(ev);\n\t};\n\tconst onStorageCustomEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdateFromCustomEvent(ev);\n\t};\n\t/**\n\t* The custom event is needed for same-document syncing when using custom\n\t* storage backends, but it doesn't work across different documents.\n\t*\n\t* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.\n\t*/\n\tif (window && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window, \"storage\", onStorageEvent, { passive: true });\n\telse useEventListener(window, customStorageEventName, onStorageCustomEvent);\n\tif (initOnMounted) tryOnMounted(() => {\n\t\tfirstMounted = true;\n\t\tupdate();\n\t});\n\telse update();\n\tfunction dispatchWriteEvent(oldValue, newValue) {\n\t\tif (window) {\n\t\t\tconst payload = {\n\t\t\t\tkey: keyComputed.value,\n\t\t\t\toldValue,\n\t\t\t\tnewValue,\n\t\t\t\tstorageArea: storage\n\t\t\t};\n\t\t\twindow.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, { detail: payload }));\n\t\t}\n\t}\n\tfunction write(v) {\n\t\ttry {\n\t\t\tconst oldValue = storage.getItem(keyComputed.value);\n\t\t\tif (v == null) {\n\t\t\t\tdispatchWriteEvent(oldValue, null);\n\t\t\t\tstorage.removeItem(keyComputed.value);\n\t\t\t} else {\n\t\t\t\tconst serialized = serializer.write(v);\n\t\t\t\tif (oldValue !== serialized) {\n\t\t\t\t\tstorage.setItem(keyComputed.value, serialized);\n\t\t\t\t\tdispatchWriteEvent(oldValue, serialized);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tfunction read(event) {\n\t\tconst rawValue = event ? event.newValue : storage.getItem(keyComputed.value);\n\t\tif (rawValue == null) {\n\t\t\tif (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));\n\t\t\treturn rawInit;\n\t\t} else if (!event && mergeDefaults) {\n\t\t\tconst value = serializer.read(rawValue);\n\t\t\tif (typeof mergeDefaults === \"function\") return mergeDefaults(value, rawInit);\n\t\t\telse if (type === \"object\" && !Array.isArray(value)) return {\n\t\t\t\t...rawInit,\n\t\t\t\t...value\n\t\t\t};\n\t\t\treturn value;\n\t\t} else if (typeof rawValue !== \"string\") return rawValue;\n\t\telse return serializer.read(rawValue);\n\t}\n\tfunction update(event) {\n\t\tif (event && event.storageArea !== storage) return;\n\t\tif (event && event.key == null) {\n\t\t\tdata.value = rawInit;\n\t\t\treturn;\n\t\t}\n\t\tif (event && event.key !== keyComputed.value) return;\n\t\tpauseWatch();\n\t\ttry {\n\t\t\tconst serializedData = serializer.write(data.value);\n\t\t\tif (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (event) nextTick(resumeWatch);\n\t\t\telse resumeWatch();\n\t\t}\n\t}\n\tfunction updateFromCustomEvent(event) {\n\t\tupdate(event.detail);\n\t}\n\treturn data;\n}\n//#endregion\n//#region useColorMode/index.ts\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n/**\n* Reactive color mode with auto data persistence.\n*\n* @see https://vueuse.org/useColorMode\n* @param options\n*/\nfunction useColorMode(options = {}) {\n\tconst { selector = \"html\", attribute = \"class\", initialValue = \"auto\", window = defaultWindow, storage, storageKey = \"vueuse-color-scheme\", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;\n\tconst modes = {\n\t\tauto: \"\",\n\t\tlight: \"light\",\n\t\tdark: \"dark\",\n\t\t...options.modes || {}\n\t};\n\tconst preferredDark = usePreferredDark({ window });\n\tconst system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n\tconst store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {\n\t\twindow,\n\t\tlistenToStorageChanges\n\t}));\n\tconst state = computed(() => store.value === \"auto\" ? system.value : store.value);\n\tconst updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector, attribute, value) => {\n\t\tconst el = typeof selector === \"string\" ? window === null || window === void 0 ? void 0 : window.document.querySelector(selector) : unrefElement(selector);\n\t\tif (!el) return;\n\t\tconst classesToAdd = /* @__PURE__ */ new Set();\n\t\tconst classesToRemove = /* @__PURE__ */ new Set();\n\t\tlet attributeToChange = null;\n\t\tif (attribute === \"class\") {\n\t\t\tconst current = value.split(/\\s/g);\n\t\t\tObject.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n\t\t\t\tif (current.includes(v)) classesToAdd.add(v);\n\t\t\t\telse classesToRemove.add(v);\n\t\t\t});\n\t\t} else attributeToChange = {\n\t\t\tkey: attribute,\n\t\t\tvalue\n\t\t};\n\t\tif (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;\n\t\tlet style;\n\t\tif (disableTransition) {\n\t\t\tstyle = window.document.createElement(\"style\");\n\t\t\tstyle.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n\t\t\twindow.document.head.appendChild(style);\n\t\t}\n\t\tfor (const c of classesToAdd) el.classList.add(c);\n\t\tfor (const c of classesToRemove) el.classList.remove(c);\n\t\tif (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);\n\t\tif (disableTransition) {\n\t\t\twindow.getComputedStyle(style).opacity;\n\t\t\tdocument.head.removeChild(style);\n\t\t}\n\t});\n\tfunction defaultOnChanged(mode) {\n\t\tvar _modes$mode;\n\t\tupdateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);\n\t}\n\tfunction onChanged(mode) {\n\t\tif (options.onChanged) options.onChanged(mode, defaultOnChanged);\n\t\telse defaultOnChanged(mode);\n\t}\n\twatch(state, onChanged, {\n\t\tflush: \"post\",\n\t\timmediate: true\n\t});\n\ttryOnMounted(() => onChanged(state.value));\n\tconst auto = computed({\n\t\tget() {\n\t\t\treturn emitAuto ? store.value : state.value;\n\t\t},\n\t\tset(v) {\n\t\t\tstore.value = v;\n\t\t}\n\t});\n\treturn Object.assign(auto, {\n\t\tstore,\n\t\tsystem,\n\t\tstate\n\t});\n}\n//#endregion\n//#region useConfirmDialog/index.ts\n/**\n* Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.\n*\n* @see https://vueuse.org/useConfirmDialog/\n* @param revealed `boolean` `ref` that handles a modal window\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useConfirmDialog(revealed = shallowRef(false)) {\n\tconst confirmHook = createEventHook();\n\tconst cancelHook = createEventHook();\n\tconst revealHook = createEventHook();\n\tlet _resolve = noop;\n\tconst reveal = (data) => {\n\t\trevealHook.trigger(data);\n\t\trevealed.value = true;\n\t\treturn new Promise((resolve) => {\n\t\t\t_resolve = resolve;\n\t\t});\n\t};\n\tconst confirm = (data) => {\n\t\trevealed.value = false;\n\t\tconfirmHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: false\n\t\t});\n\t};\n\tconst cancel = (data) => {\n\t\trevealed.value = false;\n\t\tcancelHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: true\n\t\t});\n\t};\n\treturn {\n\t\tisRevealed: computed(() => revealed.value),\n\t\treveal,\n\t\tconfirm,\n\t\tcancel,\n\t\tonReveal: revealHook.on,\n\t\tonConfirm: confirmHook.on,\n\t\tonCancel: cancelHook.on\n\t};\n}\n//#endregion\n//#region useCountdown/index.ts\nfunction getDefaultScheduler$8(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = 1e3, immediate = false } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive countdown timer in seconds.\n*\n* @param initialCountdown\n* @param options\n*\n* @see https://vueuse.org/useCountdown\n*/\nfunction useCountdown(initialCountdown, options = {}) {\n\tconst remaining = shallowRef(toValue(initialCountdown));\n\tconst { scheduler = getDefaultScheduler$8(options), onTick, onComplete } = options;\n\tconst controls = scheduler(() => {\n\t\tconst value = remaining.value - 1;\n\t\tremaining.value = value < 0 ? 0 : value;\n\t\tonTick === null || onTick === void 0 || onTick();\n\t\tif (remaining.value <= 0) {\n\t\t\tcontrols.pause();\n\t\t\tonComplete === null || onComplete === void 0 || onComplete();\n\t\t}\n\t});\n\tconst reset = (countdown) => {\n\t\tvar _toValue;\n\t\tremaining.value = (_toValue = toValue(countdown)) !== null && _toValue !== void 0 ? _toValue : toValue(initialCountdown);\n\t};\n\tconst stop = () => {\n\t\tcontrols.pause();\n\t\treset();\n\t};\n\tconst resume = () => {\n\t\tif (!controls.isActive.value) {\n\t\t\tif (remaining.value > 0) controls.resume();\n\t\t}\n\t};\n\tconst start = (countdown) => {\n\t\treset(countdown);\n\t\tcontrols.resume();\n\t};\n\treturn {\n\t\tremaining,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tpause: controls.pause,\n\t\tresume,\n\t\tisActive: controls.isActive\n\t};\n}\n//#endregion\n//#region useCssSupports/index.ts\nfunction useCssSupports(...args) {\n\tlet options = {};\n\tif (typeof toValue(args.at(-1)) === \"object\") options = args.pop();\n\tconst [prop, value] = args;\n\tconst { window = defaultWindow, ssrValue = false } = options;\n\tconst isMounted = useMounted();\n\treturn { isSupported: computed(() => {\n\t\tif (!isClient || !isMounted.value) return ssrValue;\n\t\treturn args.length === 2 ? window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop), toValue(value)) : window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop));\n\t}) };\n}\n//#endregion\n//#region useCssVar/index.ts\n/**\n* Manipulate CSS variables.\n*\n* @see https://vueuse.org/useCssVar\n* @param prop\n* @param target\n* @param options\n*/\nfunction useCssVar(prop, target, options = {}) {\n\tconst { window = defaultWindow, initialValue, observe = false } = options;\n\tconst variable = shallowRef(initialValue);\n\tconst elRef = computed(() => {\n\t\tvar _window$document;\n\t\treturn unrefElement(target) || (window === null || window === void 0 || (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);\n\t});\n\tfunction updateCssVar() {\n\t\tconst key = toValue(prop);\n\t\tconst el = toValue(elRef);\n\t\tif (el && window && key) {\n\t\t\tvar _window$getComputedSt;\n\t\t\tconst value = (_window$getComputedSt = window.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim();\n\t\t\tvariable.value = value || variable.value || initialValue;\n\t\t}\n\t}\n\tif (observe) useMutationObserver(elRef, updateCssVar, {\n\t\tattributeFilter: [\"style\", \"class\"],\n\t\twindow\n\t});\n\twatch([elRef, () => toValue(prop)], (_, old) => {\n\t\tif (old[0] && old[1]) old[0].style.removeProperty(old[1]);\n\t\tupdateCssVar();\n\t}, { immediate: true });\n\twatch([variable, elRef], ([val, el]) => {\n\t\tconst raw_prop = toValue(prop);\n\t\tif ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);\n\t\telse el.style.setProperty(raw_prop, val);\n\t}, { immediate: true });\n\treturn variable;\n}\n//#endregion\n//#region useCurrentElement/index.ts\nfunction useCurrentElement(rootComponent) {\n\tconst vm = getCurrentInstance();\n\tconst currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);\n\tonUpdated(currentElement.trigger);\n\tonMounted(currentElement.trigger);\n\treturn currentElement;\n}\n//#endregion\n//#region useCycleList/index.ts\n/**\n* Cycle through a list of items\n*\n* @see https://vueuse.org/useCycleList\n*/\nfunction useCycleList(list, options) {\n\tconst state = shallowRef(getInitialValue());\n\tconst listRef = toRef(list);\n\tconst index = computed({\n\t\tget() {\n\t\t\tvar _options$fallbackInde;\n\t\t\tconst targetList = listRef.value;\n\t\t\tlet index = (options === null || options === void 0 ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n\t\t\tif (index < 0) index = (_options$fallbackInde = options === null || options === void 0 ? void 0 : options.fallbackIndex) !== null && _options$fallbackInde !== void 0 ? _options$fallbackInde : 0;\n\t\t\treturn index;\n\t\t},\n\t\tset(v) {\n\t\t\tset(v);\n\t\t}\n\t});\n\tfunction set(i) {\n\t\tconst targetList = listRef.value;\n\t\tconst length = targetList.length;\n\t\tconst value = targetList[(i % length + length) % length];\n\t\tstate.value = value;\n\t\treturn value;\n\t}\n\tfunction shift(delta = 1) {\n\t\treturn set(index.value + delta);\n\t}\n\tfunction next(n = 1) {\n\t\treturn shift(n);\n\t}\n\tfunction prev(n = 1) {\n\t\treturn shift(-n);\n\t}\n\tfunction getInitialValue() {\n\t\tvar _toValue, _options$initialValue;\n\t\treturn (_toValue = toValue((_options$initialValue = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : toValue(list)[0])) !== null && _toValue !== void 0 ? _toValue : void 0;\n\t}\n\twatch(listRef, () => set(index.value));\n\treturn {\n\t\tstate,\n\t\tindex,\n\t\tnext,\n\t\tprev,\n\t\tgo: set\n\t};\n}\n//#endregion\n//#region useDark/index.ts\n/**\n* Reactive dark mode with auto data persistence.\n*\n* @see https://vueuse.org/useDark\n* @param options\n*/\nfunction useDark(options = {}) {\n\tconst { valueDark = \"dark\", valueLight = \"\" } = options;\n\tconst mode = useColorMode({\n\t\t...options,\n\t\tonChanged: (mode, defaultHandler) => {\n\t\t\tvar _options$onChanged;\n\t\t\tif (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode === \"dark\", defaultHandler, mode);\n\t\t\telse defaultHandler(mode);\n\t\t},\n\t\tmodes: {\n\t\t\tdark: valueDark,\n\t\t\tlight: valueLight\n\t\t}\n\t});\n\tconst system = computed(() => mode.system.value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn mode.value === \"dark\";\n\t\t},\n\t\tset(v) {\n\t\t\tconst modeVal = v ? \"dark\" : \"light\";\n\t\t\tif (system.value === modeVal) mode.value = \"auto\";\n\t\t\telse mode.value = modeVal;\n\t\t}\n\t});\n}\n//#endregion\n//#region useManualRefHistory/index.ts\nfunction fnBypass(v) {\n\treturn v;\n}\nfunction fnSetSource(source, value) {\n\treturn source.value = value;\n}\nfunction defaultDump(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useManualRefHistory\n* @param source\n* @param options\n*/\nfunction useManualRefHistory(source, options = {}) {\n\tconst { clone = false, dump = defaultDump(clone), parse = defaultParse(clone), setSource = fnSetSource } = options;\n\tfunction _createHistoryRecord() {\n\t\treturn markRaw({\n\t\t\tsnapshot: dump(source.value),\n\t\t\ttimestamp: timestamp()\n\t\t});\n\t}\n\tconst last = ref(_createHistoryRecord());\n\tconst undoStack = ref([]);\n\tconst redoStack = ref([]);\n\tconst _setSource = (record) => {\n\t\tsetSource(source, parse(record.snapshot));\n\t\tlast.value = record;\n\t};\n\tconst commit = () => {\n\t\tundoStack.value.unshift(last.value);\n\t\tlast.value = _createHistoryRecord();\n\t\tif (options.capacity && undoStack.value.length > options.capacity) undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n\t\tif (redoStack.value.length) redoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst clear = () => {\n\t\tundoStack.value.splice(0, undoStack.value.length);\n\t\tredoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst undo = () => {\n\t\tconst state = undoStack.value.shift();\n\t\tif (state) {\n\t\t\tredoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst redo = () => {\n\t\tconst state = redoStack.value.shift();\n\t\tif (state) {\n\t\t\tundoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst reset = () => {\n\t\t_setSource(last.value);\n\t};\n\treturn {\n\t\tsource,\n\t\tundoStack,\n\t\tredoStack,\n\t\tlast,\n\t\thistory: computed(() => [last.value, ...undoStack.value]),\n\t\tcanUndo: computed(() => undoStack.value.length > 0),\n\t\tcanRedo: computed(() => redoStack.value.length > 0),\n\t\tclear,\n\t\tcommit,\n\t\treset,\n\t\tundo,\n\t\tredo\n\t};\n}\n//#endregion\n//#region useRefHistory/index.ts\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useRefHistory\n* @param source\n* @param options\n*/\nfunction useRefHistory(source, options = {}) {\n\tconst { deep = false, flush = \"pre\", eventFilter, shouldCommit = () => true } = options;\n\tconst { eventFilter: composedFilter, pause, resume: resumeTracking, isActive: isTracking } = pausableFilter(eventFilter);\n\tlet lastRawValue = source.value;\n\tconst { ignoreUpdates, ignorePrevAsyncUpdates, stop } = watchIgnorable(source, commit, {\n\t\tdeep,\n\t\tflush,\n\t\teventFilter: composedFilter\n\t});\n\tfunction setSource(source, value) {\n\t\tignorePrevAsyncUpdates();\n\t\tignoreUpdates(() => {\n\t\t\tsource.value = value;\n\t\t\tlastRawValue = value;\n\t\t});\n\t}\n\tconst manualHistory = useManualRefHistory(source, {\n\t\t...options,\n\t\tclone: options.clone || deep,\n\t\tsetSource\n\t});\n\tconst { clear, commit: manualCommit } = manualHistory;\n\tfunction commit() {\n\t\tignorePrevAsyncUpdates();\n\t\tif (!shouldCommit(lastRawValue, source.value)) return;\n\t\tlastRawValue = source.value;\n\t\tmanualCommit();\n\t}\n\tfunction resume(commitNow) {\n\t\tresumeTracking();\n\t\tif (commitNow) commit();\n\t}\n\tfunction batch(fn) {\n\t\tlet canceled = false;\n\t\tconst cancel = () => canceled = true;\n\t\tignoreUpdates(() => {\n\t\t\tfn(cancel);\n\t\t});\n\t\tif (!canceled) commit();\n\t}\n\tfunction dispose() {\n\t\tstop();\n\t\tclear();\n\t}\n\treturn {\n\t\t...manualHistory,\n\t\tisTracking,\n\t\tpause,\n\t\tresume,\n\t\tcommit,\n\t\tbatch,\n\t\tdispose\n\t};\n}\n//#endregion\n//#region useDebouncedRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.\n*\n* @see https://vueuse.org/useDebouncedRefHistory\n* @param source\n* @param options\n*/\nfunction useDebouncedRefHistory(source, options = {}) {\n\tconst filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useDeviceMotion/index.ts\n/**\n* Reactive DeviceMotionEvent.\n*\n* @see https://vueuse.org/useDeviceMotion\n* @param options\n*/\nfunction useDeviceMotion(options = {}) {\n\tconst { window = defaultWindow, requestPermissions = false, eventFilter = bypassFilter } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof DeviceMotionEvent !== \"undefined\");\n\tconst requirePermissions = /* @__PURE__ */ useSupported(() => isSupported.value && \"requestPermission\" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === \"function\");\n\tconst permissionGranted = shallowRef(false);\n\tconst acceleration = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tconst rotationRate = ref({\n\t\talpha: null,\n\t\tbeta: null,\n\t\tgamma: null\n\t});\n\tconst interval = shallowRef(0);\n\tconst accelerationIncludingGravity = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tfunction init() {\n\t\tif (window) {\n\t\t\tconst onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n\t\t\t\tvar _event$acceleration, _event$acceleration2, _event$acceleration3, _event$accelerationIn, _event$accelerationIn2, _event$accelerationIn3, _event$rotationRate, _event$rotationRate2, _event$rotationRate3;\n\t\t\t\tacceleration.value = {\n\t\t\t\t\tx: ((_event$acceleration = event.acceleration) === null || _event$acceleration === void 0 ? void 0 : _event$acceleration.x) || null,\n\t\t\t\t\ty: ((_event$acceleration2 = event.acceleration) === null || _event$acceleration2 === void 0 ? void 0 : _event$acceleration2.y) || null,\n\t\t\t\t\tz: ((_event$acceleration3 = event.acceleration) === null || _event$acceleration3 === void 0 ? void 0 : _event$acceleration3.z) || null\n\t\t\t\t};\n\t\t\t\taccelerationIncludingGravity.value = {\n\t\t\t\t\tx: ((_event$accelerationIn = event.accelerationIncludingGravity) === null || _event$accelerationIn === void 0 ? void 0 : _event$accelerationIn.x) || null,\n\t\t\t\t\ty: ((_event$accelerationIn2 = event.accelerationIncludingGravity) === null || _event$accelerationIn2 === void 0 ? void 0 : _event$accelerationIn2.y) || null,\n\t\t\t\t\tz: ((_event$accelerationIn3 = event.accelerationIncludingGravity) === null || _event$accelerationIn3 === void 0 ? void 0 : _event$accelerationIn3.z) || null\n\t\t\t\t};\n\t\t\t\trotationRate.value = {\n\t\t\t\t\talpha: ((_event$rotationRate = event.rotationRate) === null || _event$rotationRate === void 0 ? void 0 : _event$rotationRate.alpha) || null,\n\t\t\t\t\tbeta: ((_event$rotationRate2 = event.rotationRate) === null || _event$rotationRate2 === void 0 ? void 0 : _event$rotationRate2.beta) || null,\n\t\t\t\t\tgamma: ((_event$rotationRate3 = event.rotationRate) === null || _event$rotationRate3 === void 0 ? void 0 : _event$rotationRate3.gamma) || null\n\t\t\t\t};\n\t\t\t\tinterval.value = event.interval;\n\t\t\t});\n\t\t\tuseEventListener(window, \"devicemotion\", onDeviceMotion, { passive: true });\n\t\t}\n\t}\n\tconst ensurePermissions = async () => {\n\t\tif (!requirePermissions.value) permissionGranted.value = true;\n\t\tif (permissionGranted.value) return;\n\t\tif (requirePermissions.value) {\n\t\t\tconst requestPermission = DeviceMotionEvent.requestPermission;\n\t\t\ttry {\n\t\t\t\tif (await requestPermission() === \"granted\") {\n\t\t\t\t\tpermissionGranted.value = true;\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\t};\n\tif (isSupported.value) if (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());\n\telse init();\n\treturn {\n\t\tacceleration,\n\t\taccelerationIncludingGravity,\n\t\trotationRate,\n\t\tinterval,\n\t\tisSupported,\n\t\trequirePermissions,\n\t\tensurePermissions,\n\t\tpermissionGranted\n\t};\n}\n//#endregion\n//#region useDeviceOrientation/index.ts\n/**\n* Reactive DeviceOrientationEvent.\n*\n* @see https://vueuse.org/useDeviceOrientation\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDeviceOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"DeviceOrientationEvent\" in window);\n\tconst isAbsolute = shallowRef(false);\n\tconst alpha = shallowRef(null);\n\tconst beta = shallowRef(null);\n\tconst gamma = shallowRef(null);\n\tif (window && isSupported.value) useEventListener(window, \"deviceorientation\", (event) => {\n\t\tisAbsolute.value = event.absolute;\n\t\talpha.value = event.alpha;\n\t\tbeta.value = event.beta;\n\t\tgamma.value = event.gamma;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tisAbsolute,\n\t\talpha,\n\t\tbeta,\n\t\tgamma\n\t};\n}\n//#endregion\n//#region useDevicePixelRatio/index.ts\n/**\n* Reactively track `window.devicePixelRatio`.\n*\n* @see https://vueuse.org/useDevicePixelRatio\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDevicePixelRatio(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst pixelRatio = shallowRef(1);\n\tconst query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);\n\tlet stop = noop;\n\tif (window) stop = watchImmediate(query, () => pixelRatio.value = window.devicePixelRatio);\n\treturn {\n\t\tpixelRatio: shallowReadonly(pixelRatio),\n\t\tstop\n\t};\n}\n//#endregion\n//#region useDevicesList/index.ts\n/**\n* Reactive `enumerateDevices` listing available input/output devices\n*\n* @see https://vueuse.org/useDevicesList\n* @param options\n*/\nfunction useDevicesList(options = {}) {\n\tconst { navigator = defaultNavigator, requestPermissions = false, constraints = {\n\t\taudio: true,\n\t\tvideo: true\n\t}, onUpdated } = options;\n\tconst devices = shallowRef([]);\n\tconst videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n\tconst audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n\tconst audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n\tconst permissionGranted = shallowRef(false);\n\tlet stream;\n\tasync function update() {\n\t\tif (!isSupported.value) return;\n\t\tdevices.value = await navigator.mediaDevices.enumerateDevices();\n\t\tonUpdated === null || onUpdated === void 0 || onUpdated(devices.value);\n\t\tif (stream) {\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\tstream = null;\n\t\t}\n\t}\n\tasync function ensurePermissions() {\n\t\tconst deviceName = constraints.video ? \"camera\" : \"microphone\";\n\t\tif (!isSupported.value) return false;\n\t\tif (permissionGranted.value) return true;\n\t\tconst { state, query } = usePermission(deviceName, { controls: true });\n\t\tawait query();\n\t\tif (state.value !== \"granted\") {\n\t\t\tlet granted = true;\n\t\t\ttry {\n\t\t\t\tconst allDevices = await navigator.mediaDevices.enumerateDevices();\n\t\t\t\tconst hasCamera = allDevices.some((device) => device.kind === \"videoinput\");\n\t\t\t\tconst hasMicrophone = allDevices.some((device) => device.kind === \"audioinput\" || device.kind === \"audiooutput\");\n\t\t\t\tconstraints.video = hasCamera ? constraints.video : false;\n\t\t\t\tconstraints.audio = hasMicrophone ? constraints.audio : false;\n\t\t\t\tstream = await navigator.mediaDevices.getUserMedia(constraints);\n\t\t\t} catch (_unused) {\n\t\t\t\tstream = null;\n\t\t\t\tgranted = false;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tpermissionGranted.value = granted;\n\t\t} else permissionGranted.value = true;\n\t\treturn permissionGranted.value;\n\t}\n\tif (isSupported.value) {\n\t\tif (requestPermissions) ensurePermissions();\n\t\tuseEventListener(navigator.mediaDevices, \"devicechange\", update, { passive: true });\n\t\tupdate();\n\t}\n\treturn {\n\t\tdevices,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tvideoInputs,\n\t\taudioInputs,\n\t\taudioOutputs,\n\t\tisSupported\n\t};\n}\n//#endregion\n//#region useDisplayMedia/index.ts\n/**\n* Reactive `mediaDevices.getDisplayMedia` streaming\n*\n* @see https://vueuse.org/useDisplayMedia\n* @param options\n*/\nfunction useDisplayMedia(options = {}) {\n\tvar _options$enabled;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst video = options.video;\n\tconst audio = options.audio;\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getDisplayMedia;\n\t});\n\tconst constraint = {\n\t\taudio,\n\t\tvideo\n\t};\n\tconst stream = shallowRef();\n\tasync function _start() {\n\t\tvar _stream$value;\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => useEventListener(t, \"ended\", stop, { passive: true }));\n\t\treturn stream.value;\n\t}\n\tasync function _stop() {\n\t\tvar _stream$value2;\n\t\t(_stream$value2 = stream.value) === null || _stream$value2 === void 0 || _stream$value2.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\tenabled\n\t};\n}\n//#endregion\n//#region useDocumentVisibility/index.ts\n/**\n* Reactively track `document.visibilityState`.\n*\n* @see https://vueuse.org/useDocumentVisibility\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDocumentVisibility(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tif (!document) return shallowRef(\"visible\");\n\tconst visibility = shallowRef(document.visibilityState);\n\tuseEventListener(document, \"visibilitychange\", () => {\n\t\tvisibility.value = document.visibilityState;\n\t}, { passive: true });\n\treturn visibility;\n}\n//#endregion\n//#region useDraggable/index.ts\nconst defaultScrollConfig = {\n\tspeed: 2,\n\tmargin: 30,\n\tdirection: \"both\"\n};\nfunction clampContainerScroll(container) {\n\tif (container.scrollLeft > container.scrollWidth - container.clientWidth) container.scrollLeft = Math.max(0, container.scrollWidth - container.clientWidth);\n\tif (container.scrollTop > container.scrollHeight - container.clientHeight) container.scrollTop = Math.max(0, container.scrollHeight - container.clientHeight);\n}\n/**\n* Make elements draggable.\n*\n* @see https://vueuse.org/useDraggable\n* @param target\n* @param options\n*/\nfunction useDraggable(target, options = {}) {\n\tvar _toValue, _toValue2, _toValue3, _scrollConfig$directi;\n\tconst { pointerTypes, preventDefault, stopPropagation, exact, onMove, onEnd, onStart, initialValue, axis = \"both\", draggingElement = defaultWindow, containerElement, handle: draggingHandle = target, buttons = [0], restrictInView, autoScroll = false } = options;\n\tconst position = ref((_toValue = toValue(initialValue)) !== null && _toValue !== void 0 ? _toValue : {\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst pressedDelta = ref();\n\tconst filterEvent = (e) => {\n\t\tif (pointerTypes) return pointerTypes.includes(e.pointerType);\n\t\treturn true;\n\t};\n\tconst handleEvent = (e) => {\n\t\tif (toValue(preventDefault)) e.preventDefault();\n\t\tif (toValue(stopPropagation)) e.stopPropagation();\n\t};\n\tconst scrollConfig = toValue(autoScroll);\n\tconst scrollSettings = typeof scrollConfig === \"object\" ? {\n\t\tspeed: (_toValue2 = toValue(scrollConfig.speed)) !== null && _toValue2 !== void 0 ? _toValue2 : defaultScrollConfig.speed,\n\t\tmargin: (_toValue3 = toValue(scrollConfig.margin)) !== null && _toValue3 !== void 0 ? _toValue3 : defaultScrollConfig.margin,\n\t\tdirection: (_scrollConfig$directi = scrollConfig.direction) !== null && _scrollConfig$directi !== void 0 ? _scrollConfig$directi : defaultScrollConfig.direction\n\t} : defaultScrollConfig;\n\tconst getScrollAxisValues = (value) => typeof value === \"number\" ? [value, value] : [value.x, value.y];\n\tconst handleAutoScroll = (container, targetRect, position) => {\n\t\tconst { clientWidth, clientHeight, scrollLeft, scrollTop, scrollWidth, scrollHeight } = container;\n\t\tconst [marginX, marginY] = getScrollAxisValues(scrollSettings.margin);\n\t\tconst [speedX, speedY] = getScrollAxisValues(scrollSettings.speed);\n\t\tlet deltaX = 0;\n\t\tlet deltaY = 0;\n\t\tif (scrollSettings.direction === \"x\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.x < marginX && scrollLeft > 0) deltaX = -speedX;\n\t\t\telse if (position.x + targetRect.width > clientWidth - marginX && scrollLeft < scrollWidth - clientWidth) deltaX = speedX;\n\t\t}\n\t\tif (scrollSettings.direction === \"y\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.y < marginY && scrollTop > 0) deltaY = -speedY;\n\t\t\telse if (position.y + targetRect.height > clientHeight - marginY && scrollTop < scrollHeight - clientHeight) deltaY = speedY;\n\t\t}\n\t\tif (deltaX || deltaY) container.scrollBy({\n\t\t\tleft: deltaX,\n\t\t\ttop: deltaY,\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t};\n\tlet autoScrollInterval = null;\n\tconst startAutoScroll = () => {\n\t\tconst container = toValue(containerElement);\n\t\tif (container && !autoScrollInterval) autoScrollInterval = setInterval(() => {\n\t\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\t\tconst { x, y } = position.value;\n\t\t\tconst relativePosition = {\n\t\t\t\tx: x - container.scrollLeft,\n\t\t\t\ty: y - container.scrollTop\n\t\t\t};\n\t\t\tif (relativePosition.x >= 0 && relativePosition.y >= 0) {\n\t\t\t\thandleAutoScroll(container, targetRect, relativePosition);\n\t\t\t\trelativePosition.x += container.scrollLeft;\n\t\t\t\trelativePosition.y += container.scrollTop;\n\t\t\t\tposition.value = relativePosition;\n\t\t\t}\n\t\t}, 1e3 / 60);\n\t};\n\tconst stopAutoScroll = () => {\n\t\tif (autoScrollInterval) {\n\t\t\tclearInterval(autoScrollInterval);\n\t\t\tautoScrollInterval = null;\n\t\t}\n\t};\n\tconst isPointerNearEdge = (pointer, container, margin, targetRect) => {\n\t\tconst [marginX, marginY] = typeof margin === \"number\" ? [margin, margin] : [margin.x, margin.y];\n\t\tconst { clientWidth, clientHeight } = container;\n\t\treturn pointer.x < marginX || pointer.x + targetRect.width > clientWidth - marginX || pointer.y < marginY || pointer.y + targetRect.height > clientHeight - marginY;\n\t};\n\tconst checkAutoScroll = () => {\n\t\tif (toValue(options.disabled) || !pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (!container) return;\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst { x, y } = position.value;\n\t\tconst relativePosition = {\n\t\t\tx: x - container.scrollLeft,\n\t\t\ty: y - container.scrollTop\n\t\t};\n\t\tif (isPointerNearEdge(relativePosition, container, scrollSettings.margin, targetRect)) startAutoScroll();\n\t\telse stopAutoScroll();\n\t};\n\tif (toValue(autoScroll)) watch(position, checkAutoScroll);\n\tconst start = (e) => {\n\t\tvar _container$getBoundin;\n\t\tif (!toValue(buttons).includes(e.button)) return;\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (toValue(exact) && e.target !== toValue(target)) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst containerRect = container === null || container === void 0 || (_container$getBoundin = container.getBoundingClientRect) === null || _container$getBoundin === void 0 ? void 0 : _container$getBoundin.call(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst pos = {\n\t\t\tx: e.clientX - (container ? targetRect.left - containerRect.left + (autoScroll ? 0 : container.scrollLeft) : targetRect.left),\n\t\t\ty: e.clientY - (container ? targetRect.top - containerRect.top + (autoScroll ? 0 : container.scrollTop) : targetRect.top)\n\t\t};\n\t\tif ((onStart === null || onStart === void 0 ? void 0 : onStart(pos, e)) === false) return;\n\t\tpressedDelta.value = pos;\n\t\thandleEvent(e);\n\t};\n\tconst move = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (container instanceof HTMLElement) clampContainerScroll(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tlet { x, y } = position.value;\n\t\tif (axis === \"x\" || axis === \"both\") {\n\t\t\tx = e.clientX - pressedDelta.value.x;\n\t\t\tif (container) x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n\t\t}\n\t\tif (axis === \"y\" || axis === \"both\") {\n\t\t\ty = e.clientY - pressedDelta.value.y;\n\t\t\tif (container) y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n\t\t}\n\t\tif (toValue(autoScroll) && container) {\n\t\t\tif (autoScrollInterval === null) handleAutoScroll(container, targetRect, {\n\t\t\t\tx,\n\t\t\t\ty\n\t\t\t});\n\t\t\tx += container.scrollLeft;\n\t\t\ty += container.scrollTop;\n\t\t}\n\t\tif (container && (restrictInView || autoScroll)) {\n\t\t\tif (axis !== \"y\") {\n\t\t\t\tconst relativeX = x - container.scrollLeft;\n\t\t\t\tif (relativeX < 0) x = container.scrollLeft;\n\t\t\t\telse if (relativeX > container.clientWidth - targetRect.width) x = container.clientWidth - targetRect.width + container.scrollLeft;\n\t\t\t}\n\t\t\tif (axis !== \"x\") {\n\t\t\t\tconst relativeY = y - container.scrollTop;\n\t\t\t\tif (relativeY < 0) y = container.scrollTop;\n\t\t\t\telse if (relativeY > container.clientHeight - targetRect.height) y = container.clientHeight - targetRect.height + container.scrollTop;\n\t\t\t}\n\t\t}\n\t\tposition.value = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tonMove === null || onMove === void 0 || onMove(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tconst end = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tpressedDelta.value = void 0;\n\t\tif (autoScroll) stopAutoScroll();\n\t\tonEnd === null || onEnd === void 0 || onEnd(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tif (isClient) {\n\t\tconst config = () => {\n\t\t\tvar _options$capture;\n\t\t\treturn {\n\t\t\t\tcapture: (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : true,\n\t\t\t\tpassive: !toValue(preventDefault)\n\t\t\t};\n\t\t};\n\t\tuseEventListener(draggingHandle, \"pointerdown\", start, config);\n\t\tuseEventListener(draggingElement, \"pointermove\", move, config);\n\t\tuseEventListener(draggingElement, [\"pointerup\", \"pointercancel\"], end, config);\n\t}\n\treturn {\n\t\t...toRefs(position),\n\t\tposition,\n\t\tisDragging: computed(() => !!pressedDelta.value),\n\t\tstyle: computed(() => `\n left: ${position.value.x}px;\n top: ${position.value.y}px;\n ${autoScroll ? \"text-wrap: nowrap;\" : \"\"}\n `)\n\t};\n}\n//#endregion\n//#region useDropZone/index.ts\nfunction useDropZone(target, options = {}) {\n\tconst isOverDropZone = shallowRef(false);\n\tconst files = shallowRef(null);\n\tlet counter = 0;\n\tlet isValid = true;\n\tif (isClient) {\n\t\tvar _options$multiple, _options$preventDefau;\n\t\tconst _options = typeof options === \"function\" ? { onDrop: options } : options;\n\t\tconst multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;\n\t\tconst preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;\n\t\tconst getFiles = (event) => {\n\t\t\tvar _event$dataTransfer$f, _event$dataTransfer;\n\t\t\tconst list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);\n\t\t\treturn list.length === 0 ? null : multiple ? list : [list[0]];\n\t\t};\n\t\tconst checkDataTypes = (types) => {\n\t\t\tconst dataTypes = unref(_options.dataTypes);\n\t\t\tif (typeof dataTypes === \"function\") return dataTypes(types);\n\t\t\tif (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;\n\t\t\tif (types.length === 0) return false;\n\t\t\treturn types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));\n\t\t};\n\t\tconst checkValidity = (items) => {\n\t\t\tif (_options.checkValidity) return _options.checkValidity(items);\n\t\t\tconst types = Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type);\n\t\t\tconst dataTypesValid = checkDataTypes(types);\n\t\t\tconst multipleFilesValid = multiple || items.length <= 1;\n\t\t\treturn dataTypesValid && multipleFilesValid;\n\t\t};\n\t\tconst isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !(\"chrome\" in window);\n\t\tconst handleDragEvent = (event, eventType) => {\n\t\t\tvar _event$dataTransfer2, _ref;\n\t\t\tconst dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;\n\t\t\tisValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;\n\t\t\tif (preventDefaultForUnhandled) event.preventDefault();\n\t\t\tif (!isSafari() && !isValid) {\n\t\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"none\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n\t\t\tconst currentFiles = getFiles(event);\n\t\t\tswitch (eventType) {\n\t\t\t\tcase \"enter\":\n\t\t\t\t\tvar _options$onEnter;\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tisOverDropZone.value = true;\n\t\t\t\t\t(_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"over\":\n\t\t\t\t\tvar _options$onOver;\n\t\t\t\t\t(_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"leave\":\n\t\t\t\t\tvar _options$onLeave;\n\t\t\t\t\tcounter -= 1;\n\t\t\t\t\tif (counter === 0) isOverDropZone.value = false;\n\t\t\t\t\t(_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"drop\":\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tisOverDropZone.value = false;\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tvar _options$onDrop;\n\t\t\t\t\t\tfiles.value = currentFiles;\n\t\t\t\t\t\t(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tuseEventListener(target, \"dragenter\", (event) => handleDragEvent(event, \"enter\"));\n\t\tuseEventListener(target, \"dragover\", (event) => handleDragEvent(event, \"over\"));\n\t\tuseEventListener(target, \"dragleave\", (event) => handleDragEvent(event, \"leave\"));\n\t\tuseEventListener(target, \"drop\", (event) => handleDragEvent(event, \"drop\"));\n\t}\n\treturn {\n\t\tfiles,\n\t\tisOverDropZone\n\t};\n}\n//#endregion\n//#region useResizeObserver/index.ts\n/**\n* Reports changes to the dimensions of an Element's content or the border-box\n*\n* @see https://vueuse.org/useResizeObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useResizeObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...observerOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"ResizeObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst _targets = toValue(target);\n\t\treturn Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n\t}), (els) => {\n\t\tcleanup();\n\t\tif (isSupported.value && window) {\n\t\t\tobserver = new ResizeObserver(callback);\n\t\t\tfor (const _el of els) if (_el) observer.observe(_el, observerOptions);\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementBounding/index.ts\n/**\n* Reactive bounding box of an HTML element.\n*\n* @see https://vueuse.org/useElementBounding\n* @param target\n*/\nfunction useElementBounding(target, options = {}) {\n\tconst { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = \"sync\" } = options;\n\tconst height = shallowRef(0);\n\tconst bottom = shallowRef(0);\n\tconst left = shallowRef(0);\n\tconst right = shallowRef(0);\n\tconst top = shallowRef(0);\n\tconst width = shallowRef(0);\n\tconst x = shallowRef(0);\n\tconst y = shallowRef(0);\n\tfunction recalculate() {\n\t\tconst el = unrefElement(target);\n\t\tif (!el) {\n\t\t\tif (reset) {\n\t\t\t\theight.value = 0;\n\t\t\t\tbottom.value = 0;\n\t\t\t\tleft.value = 0;\n\t\t\t\tright.value = 0;\n\t\t\t\ttop.value = 0;\n\t\t\t\twidth.value = 0;\n\t\t\t\tx.value = 0;\n\t\t\t\ty.value = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst rect = el.getBoundingClientRect();\n\t\theight.value = rect.height;\n\t\tbottom.value = rect.bottom;\n\t\tleft.value = rect.left;\n\t\tright.value = rect.right;\n\t\ttop.value = rect.top;\n\t\twidth.value = rect.width;\n\t\tx.value = rect.x;\n\t\ty.value = rect.y;\n\t}\n\tfunction update() {\n\t\tif (updateTiming === \"sync\") recalculate();\n\t\telse if (updateTiming === \"next-frame\") requestAnimationFrame(() => recalculate());\n\t}\n\tuseResizeObserver(target, update);\n\twatch(() => unrefElement(target), (ele) => !ele && update());\n\tuseMutationObserver(target, update, { attributeFilter: [\"style\", \"class\"] });\n\tif (windowScroll) useEventListener(\"scroll\", update, {\n\t\tcapture: true,\n\t\tpassive: true\n\t});\n\tif (windowResize) useEventListener(\"resize\", update, { passive: true });\n\ttryOnMounted(() => {\n\t\tif (immediate) update();\n\t});\n\treturn {\n\t\theight,\n\t\tbottom,\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\twidth,\n\t\tx,\n\t\ty,\n\t\tupdate\n\t};\n}\n//#endregion\n//#region useElementByPoint/index.ts\nfunction getDefaultScheduler$7(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive element by point.\n*\n* @see https://vueuse.org/useElementByPoint\n* @param options - UseElementByPointOptions\n*/\nfunction useElementByPoint(options) {\n\tconst { x, y, document = defaultDocument, multiple, scheduler = getDefaultScheduler$7(options) } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (toValue(multiple)) return document && \"elementsFromPoint\" in document;\n\t\treturn document && \"elementFromPoint\" in document;\n\t});\n\tconst element = shallowRef(null);\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\t...scheduler(() => {\n\t\t\tvar _document$elementsFro, _document$elementFrom;\n\t\t\telement.value = toValue(multiple) ? (_document$elementsFro = document === null || document === void 0 ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) !== null && _document$elementsFro !== void 0 ? _document$elementsFro : [] : (_document$elementFrom = document === null || document === void 0 ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) !== null && _document$elementFrom !== void 0 ? _document$elementFrom : null;\n\t\t})\n\t};\n}\n//#endregion\n//#region useElementHover/index.ts\nfunction useElementHover(el, options = {}) {\n\tconst { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window = defaultWindow } = options;\n\tconst isHovered = shallowRef(false);\n\tlet timer;\n\tconst toggle = (entering) => {\n\t\tconst delay = entering ? delayEnter : delayLeave;\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t\tif (delay) timer = setTimeout(() => isHovered.value = entering, delay);\n\t\telse isHovered.value = entering;\n\t};\n\tif (!window) return isHovered;\n\tuseEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n\tuseEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n\tif (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));\n\treturn isHovered;\n}\n//#endregion\n//#region useElementOverflow/index.ts\n/**\n* react a dom's overflow state\n* @see https://vueuse.org/useElementOverflow\n* @param target\n* @param option\n*/\nfunction useElementOverflow(target, option = {}) {\n\tconst { observeMutation = false, onUpdated, window = defaultWindow } = option;\n\tconst isXOverflowed = shallowRef(false);\n\tconst isYOverflowed = shallowRef(false);\n\tfunction update(htmlEl) {\n\t\tisXOverflowed.value = htmlEl.scrollWidth > htmlEl.offsetWidth;\n\t\tisYOverflowed.value = htmlEl.scrollHeight > htmlEl.offsetHeight;\n\t}\n\tconst onResizeUpdated = onUpdated;\n\tconst targetEl = computed(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (!el || el instanceof SVGElement) return void 0;\n\t\treturn el;\n\t});\n\tconst targets = () => {\n\t\tconst el = targetEl.value;\n\t\tif (!el || el instanceof SVGElement) return [];\n\t\treturn [el, ...Array.from(el.children).filter((i) => i instanceof HTMLElement)];\n\t};\n\tuseResizeObserver(targets, (entries, observer) => {\n\t\tconst el = targetEl.value;\n\t\tif (el) update(el);\n\t\tonResizeUpdated === null || onResizeUpdated === void 0 || onResizeUpdated(entries, observer);\n\t}, { window });\n\tif (observeMutation) {\n\t\tconst onMutationUpdated = onUpdated;\n\t\tuseMutationObserver(targets, (entries, observer) => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el) update(el);\n\t\t\tonMutationUpdated === null || onMutationUpdated === void 0 || onMutationUpdated(entries, observer);\n\t\t}, {\n\t\t\twindow,\n\t\t\t...typeof observeMutation === \"object\" ? observeMutation : {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t\tcharacterData: true\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tisXOverflowed: shallowReadonly(isXOverflowed),\n\t\tisYOverflowed: shallowReadonly(isYOverflowed),\n\t\tstop,\n\t\tupdate: () => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el && window) update(el);\n\t\t}\n\t};\n}\n//#endregion\n//#region useElementSize/index.ts\n/**\n* Reactive size of an HTML element.\n*\n* @see https://vueuse.org/useElementSize\n*/\nfunction useElementSize(target, initialSize = {\n\twidth: 0,\n\theight: 0\n}, options = {}) {\n\tconst { window = defaultWindow, box = \"content-box\" } = options;\n\tconst isSVG = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes(\"svg\");\n\t});\n\tconst width = shallowRef(initialSize.width);\n\tconst height = shallowRef(initialSize.height);\n\tconst { stop: stop1 } = useResizeObserver(target, ([entry]) => {\n\t\tconst boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n\t\tif (window && isSVG.value) {\n\t\t\tconst $elem = unrefElement(target);\n\t\t\tif ($elem) {\n\t\t\t\tconst rect = $elem.getBoundingClientRect();\n\t\t\t\twidth.value = rect.width;\n\t\t\t\theight.value = rect.height;\n\t\t\t}\n\t\t} else if (boxSize) {\n\t\t\tconst formatBoxSize = toArray(boxSize);\n\t\t\twidth.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n\t\t\theight.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n\t\t} else {\n\t\t\twidth.value = entry.contentRect.width;\n\t\t\theight.value = entry.contentRect.height;\n\t\t}\n\t}, options);\n\ttryOnMounted(() => {\n\t\tconst ele = unrefElement(target);\n\t\tif (ele && \"offsetWidth\" in ele) if (box === \"content-box\" && window) {\n\t\t\tconst cs = window.getComputedStyle(ele);\n\t\t\tconst padX = Number.parseFloat(cs.paddingLeft) + Number.parseFloat(cs.paddingRight);\n\t\t\tconst padY = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);\n\t\t\tconst bdX = Number.parseFloat(cs.borderLeftWidth) + Number.parseFloat(cs.borderRightWidth);\n\t\t\tconst bdY = Number.parseFloat(cs.borderTopWidth) + Number.parseFloat(cs.borderBottomWidth);\n\t\t\twidth.value = ele.offsetWidth - padX - bdX;\n\t\t\theight.value = ele.offsetHeight - padY - bdY;\n\t\t} else {\n\t\t\twidth.value = ele.offsetWidth;\n\t\t\theight.value = ele.offsetHeight;\n\t\t}\n\t\telse if (ele) {\n\t\t\twidth.value = initialSize.width;\n\t\t\theight.value = initialSize.height;\n\t\t}\n\t});\n\tconst stop2 = watch(() => unrefElement(target), (ele) => {\n\t\twidth.value = ele ? initialSize.width : 0;\n\t\theight.value = ele ? initialSize.height : 0;\n\t});\n\tfunction stop() {\n\t\tstop1();\n\t\tstop2();\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useIntersectionObserver/index.ts\n/**\n* Detects changes to a target element's visibility.\n*\n* @see https://vueuse.org/useIntersectionObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useIntersectionObserver(target, callback, options = {}) {\n\tconst { root, rootMargin, threshold = 0, window = defaultWindow, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"IntersectionObserver\" in window);\n\tconst targets = computed(() => {\n\t\treturn toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t});\n\tlet cleanup = noop;\n\tconst isActive = shallowRef(immediate);\n\tconst stopWatch = isSupported.value ? watch(() => [\n\t\ttargets.value,\n\t\tunrefElement(root),\n\t\ttoValue(rootMargin),\n\t\tisActive.value\n\t], ([targets, root, rootMargin]) => {\n\t\tcleanup();\n\t\tif (!isActive.value) return;\n\t\tif (!targets.length) return;\n\t\tconst observer = new IntersectionObserver(callback, {\n\t\t\troot: unrefElement(root),\n\t\t\trootMargin,\n\t\t\tthreshold\n\t\t});\n\t\ttargets.forEach((el) => el && observer.observe(el));\n\t\tcleanup = () => {\n\t\t\tobserver.disconnect();\n\t\t\tcleanup = noop;\n\t\t};\n\t}, {\n\t\timmediate,\n\t\tflush: \"post\"\n\t}) : noop;\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t\tisActive.value = false;\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tisActive,\n\t\tpause() {\n\t\t\tcleanup();\n\t\t\tisActive.value = false;\n\t\t},\n\t\tresume() {\n\t\t\tisActive.value = true;\n\t\t},\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementVisibility/index.ts\nfunction useElementVisibility(element, options = {}) {\n\tconst { window = defaultWindow, scrollTarget, threshold = 0, rootMargin, once = false, initialValue = false } = options;\n\tconst isVisible = shallowRef(initialValue);\n\tconst observerController = useIntersectionObserver(element, (intersectionObserverEntries) => {\n\t\tlet isIntersecting = isVisible.value;\n\t\tlet latestTime = 0;\n\t\tfor (const entry of intersectionObserverEntries) if (entry.time >= latestTime) {\n\t\t\tlatestTime = entry.time;\n\t\t\tisIntersecting = entry.isIntersecting;\n\t\t}\n\t\tisVisible.value = isIntersecting;\n\t\tif (once) watchOnce(isVisible, () => {\n\t\t\tobserverController.stop();\n\t\t});\n\t}, {\n\t\troot: scrollTarget,\n\t\twindow,\n\t\tthreshold,\n\t\trootMargin\n\t});\n\treturn options.controls ? {\n\t\t...observerController,\n\t\tisVisible\n\t} : isVisible;\n}\n//#endregion\n//#region useEventBus/internal.ts\nconst events = /* @__PURE__ */ new Map();\n//#endregion\n//#region useEventBus/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useEventBus(key) {\n\tfunction on(listener) {\n\t\tconst listeners = events.get(key) || /* @__PURE__ */ new Set();\n\t\tlisteners.add(listener);\n\t\tevents.set(key, listeners);\n\t\tconst _off = () => off(listener);\n\t\ttryOnScopeDispose(_off);\n\t\treturn _off;\n\t}\n\tfunction once(listener) {\n\t\tfunction _listener(...args) {\n\t\t\toff(_listener);\n\t\t\tlistener(...args);\n\t\t}\n\t\treturn on(_listener);\n\t}\n\tfunction off(listener) {\n\t\tconst listeners = events.get(key);\n\t\tif (!listeners) return;\n\t\tlisteners.delete(listener);\n\t\tif (!listeners.size) reset();\n\t}\n\tfunction reset() {\n\t\tevents.delete(key);\n\t}\n\tfunction emit(event, payload) {\n\t\tvar _events$get;\n\t\t(_events$get = events.get(key)) === null || _events$get === void 0 || _events$get.forEach((v) => v(event, payload));\n\t}\n\treturn {\n\t\ton,\n\t\tonce,\n\t\toff,\n\t\temit,\n\t\treset\n\t};\n}\n//#endregion\n//#region useEventSource/index.ts\nfunction resolveNestedOptions$1(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive wrapper for EventSource.\n*\n* @see https://vueuse.org/useEventSource\n* @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource\n* @param url\n* @param events\n* @param options\n*/\nfunction useEventSource(url, events = [], options = {}) {\n\tconst event = shallowRef(null);\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CONNECTING\");\n\tconst eventSource = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst urlRef = toRef(url);\n\tconst lastEventId = shallowRef(null);\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tconst { withCredentials = false, immediate = true, autoConnect = true, autoReconnect, serializer = { read: (v) => v } } = options;\n\tconst close = () => {\n\t\tif (isClient && eventSource.value) {\n\t\t\teventSource.value.close();\n\t\t\teventSource.value = null;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\texplicitlyClosed = true;\n\t\t}\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst es = new EventSource(urlRef.value, { withCredentials });\n\t\tstatus.value = \"CONNECTING\";\n\t\teventSource.value = es;\n\t\tes.onopen = () => {\n\t\t\tstatus.value = \"OPEN\";\n\t\t\terror.value = null;\n\t\t};\n\t\tes.onerror = (e) => {\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\terror.value = e;\n\t\t\tif (es.readyState === 2 && !explicitlyClosed && autoReconnect) {\n\t\t\t\tes.close();\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions$1(autoReconnect);\n\t\t\t\tretried += 1;\n\t\t\t\tif (typeof retries === \"number\" && (retries < 0 || retried < retries)) setTimeout(_init, delay);\n\t\t\t\telse if (typeof retries === \"function\" && retries()) setTimeout(_init, delay);\n\t\t\t\telse onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tes.onmessage = (e) => {\n\t\t\tvar _serializer$read;\n\t\t\tevent.value = null;\n\t\t\tdata.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;\n\t\t\tlastEventId.value = e.lastEventId;\n\t\t};\n\t\tfor (const event_name of events) useEventListener(es, event_name, (e) => {\n\t\t\tvar _serializer$read2, _e$lastEventId;\n\t\t\tevent.value = event_name;\n\t\t\tdata.value = (_serializer$read2 = serializer.read(e.data)) !== null && _serializer$read2 !== void 0 ? _serializer$read2 : null;\n\t\t\tlastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;\n\t\t}, { passive: true });\n\t};\n\tconst open = () => {\n\t\tif (!isClient) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\ttryOnScopeDispose(close);\n\treturn {\n\t\teventSource,\n\t\tevent,\n\t\tdata,\n\t\tstatus,\n\t\terror,\n\t\topen,\n\t\tclose,\n\t\tlastEventId\n\t};\n}\n//#endregion\n//#region useEyeDropper/index.ts\n/**\n* Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)\n*\n* @see https://vueuse.org/useEyeDropper\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useEyeDropper(options = {}) {\n\tconst { initialValue = \"\" } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n\tconst sRGBHex = shallowRef(initialValue);\n\tasync function open(openOptions) {\n\t\tif (!isSupported.value) return;\n\t\tconst result = await new window.EyeDropper().open(openOptions);\n\t\tsRGBHex.value = result.sRGBHex;\n\t\treturn result;\n\t}\n\treturn {\n\t\tisSupported,\n\t\tsRGBHex,\n\t\topen\n\t};\n}\n//#endregion\n//#region useFavicon/index.ts\nfunction useFavicon(newIcon = null, options = {}) {\n\tconst { baseUrl = \"\", rel = \"icon\", document = defaultDocument } = options;\n\tconst favicon = toRef(newIcon);\n\tconst applyIcon = (icon) => {\n\t\tconst elements = document === null || document === void 0 ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n\t\tif (!elements || elements.length === 0) {\n\t\t\tconst link = document === null || document === void 0 ? void 0 : document.createElement(\"link\");\n\t\t\tif (link) {\n\t\t\t\tlink.rel = rel;\n\t\t\t\tlink.href = `${baseUrl}${icon}`;\n\t\t\t\tlink.type = `image/${icon.split(\".\").pop()}`;\n\t\t\t\tdocument === null || document === void 0 || document.head.append(link);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telements === null || elements === void 0 || elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n\t};\n\twatch(favicon, (i, o) => {\n\t\tif (typeof i === \"string\" && i !== o) applyIcon(i);\n\t}, { immediate: true });\n\treturn favicon;\n}\n//#endregion\n//#region useFetch/index.ts\nconst payloadMapping = {\n\tjson: \"application/json\",\n\ttext: \"text/plain\"\n};\n/**\n* !!!IMPORTANT!!!\n*\n* If you update the UseFetchOptions interface, be sure to update this object\n* to include the new options\n*/\nfunction isFetchOptions(obj) {\n\treturn obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nconst reAbsolute = /^(?:[a-z][a-z\\d+\\-.]*:)?\\/\\//i;\nfunction isAbsoluteURL(url) {\n\treturn reAbsolute.test(url);\n}\nfunction headersToObject(headers) {\n\tif (typeof Headers !== \"undefined\" && headers instanceof Headers) return Object.fromEntries(headers.entries());\n\treturn headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n\tif (combination === \"overwrite\") return async (ctx) => {\n\t\tlet callback;\n\t\tfor (let i = callbacks.length - 1; i >= 0; i--) if (callbacks[i] != null) {\n\t\t\tcallback = callbacks[i];\n\t\t\tbreak;\n\t\t}\n\t\tif (callback) return {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n\telse return async (ctx) => {\n\t\tfor (const callback of callbacks) if (callback) ctx = {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n}\nfunction createFetch(config = {}) {\n\tconst _combination = config.combination || \"chain\";\n\tconst _options = config.options || {};\n\tconst _fetchOptions = config.fetchOptions || {};\n\tfunction useFactoryFetch(url, ...args) {\n\t\tconst computedUrl = computed(() => {\n\t\t\tconst baseUrl = toValue(config.baseUrl);\n\t\t\tconst targetUrl = toValue(url);\n\t\t\treturn baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n\t\t});\n\t\tlet options = _options;\n\t\tlet fetchOptions = _fetchOptions;\n\t\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t\t...options,\n\t\t\t...args[0],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n\t\t};\n\t\telse fetchOptions = {\n\t\t\t...fetchOptions,\n\t\t\t...args[0],\n\t\t\theaders: {\n\t\t\t\t...headersToObject(fetchOptions.headers) || {},\n\t\t\t\t...headersToObject(args[0].headers) || {}\n\t\t\t}\n\t\t};\n\t\tif (args.length > 1 && isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n\t\t};\n\t\treturn useFetch(computedUrl, fetchOptions, options);\n\t}\n\treturn useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n\tvar _defaultWindow$fetch, _globalThis;\n\tconst supportsAbort = typeof AbortController === \"function\";\n\tlet fetchOptions = {};\n\tlet options = {\n\t\timmediate: true,\n\t\trefetch: false,\n\t\ttimeout: 0,\n\t\tupdateDataOnError: false\n\t};\n\tconst config = {\n\t\tmethod: \"GET\",\n\t\ttype: \"text\",\n\t\tpayload: void 0\n\t};\n\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t...options,\n\t\t...args[0]\n\t};\n\telse fetchOptions = args[0];\n\tif (args.length > 1) {\n\t\tif (isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1]\n\t\t};\n\t}\n\tconst { fetch = (_defaultWindow$fetch = defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.fetch) !== null && _defaultWindow$fetch !== void 0 ? _defaultWindow$fetch : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.fetch, initialData, timeout } = options;\n\tconst responseEvent = createEventHook();\n\tconst errorEvent = createEventHook();\n\tconst finallyEvent = createEventHook();\n\tconst isFinished = shallowRef(false);\n\tconst isFetching = shallowRef(false);\n\tconst aborted = shallowRef(false);\n\tconst statusCode = shallowRef(null);\n\tconst response = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst data = shallowRef(initialData || null);\n\tconst canAbort = computed(() => supportsAbort && isFetching.value);\n\tlet controller;\n\tlet timer;\n\tconst abort = (reason) => {\n\t\tif (supportsAbort) {\n\t\t\tcontroller === null || controller === void 0 || controller.abort(reason);\n\t\t\tcontroller = new AbortController();\n\t\t\tcontroller.signal.onabort = () => aborted.value = true;\n\t\t\tfetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\tsignal: controller.signal\n\t\t\t};\n\t\t}\n\t};\n\tconst loading = (isLoading) => {\n\t\tisFetching.value = isLoading;\n\t\tisFinished.value = !isLoading;\n\t};\n\tif (timeout) timer = useTimeoutFn(abort, timeout, { immediate: false });\n\tlet executeCounter = 0;\n\tconst execute = async (throwOnFailed = false) => {\n\t\tvar _context$options;\n\t\tabort();\n\t\tloading(true);\n\t\terror.value = null;\n\t\tstatusCode.value = null;\n\t\taborted.value = false;\n\t\texecuteCounter += 1;\n\t\tconst currentExecuteCounter = executeCounter;\n\t\tconst defaultFetchOptions = {\n\t\t\tmethod: config.method,\n\t\t\theaders: {}\n\t\t};\n\t\tconst payload = toValue(config.payload);\n\t\tif (payload) {\n\t\t\tvar _payloadMapping$confi;\n\t\t\tconst headers = headersToObject(defaultFetchOptions.headers);\n\t\t\tconst proto = Object.getPrototypeOf(payload);\n\t\t\tif (!config.payloadType && payload && (proto === Object.prototype || Array.isArray(proto)) && !(payload instanceof FormData)) config.payloadType = \"json\";\n\t\t\tif (config.payloadType) headers[\"Content-Type\"] = (_payloadMapping$confi = payloadMapping[config.payloadType]) !== null && _payloadMapping$confi !== void 0 ? _payloadMapping$confi : config.payloadType;\n\t\t\tdefaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n\t\t}\n\t\tlet isCanceled = false;\n\t\tconst context = {\n\t\t\turl: toValue(url),\n\t\t\toptions: {\n\t\t\t\t...defaultFetchOptions,\n\t\t\t\t...fetchOptions\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tisCanceled = true;\n\t\t\t}\n\t\t};\n\t\tif (options.beforeFetch) Object.assign(context, await options.beforeFetch(context));\n\t\tif (isCanceled || !fetch) {\n\t\t\tloading(false);\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet responseData = null;\n\t\tif (timer) timer.start();\n\t\treturn fetch(context.url, {\n\t\t\t...defaultFetchOptions,\n\t\t\t...context.options,\n\t\t\theaders: {\n\t\t\t\t...headersToObject(defaultFetchOptions.headers),\n\t\t\t\t...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)\n\t\t\t}\n\t\t}).then(async (fetchResponse) => {\n\t\t\tresponse.value = fetchResponse;\n\t\t\tstatusCode.value = fetchResponse.status;\n\t\t\tresponseData = await fetchResponse.clone()[config.type]();\n\t\t\tif (!fetchResponse.ok) {\n\t\t\t\tdata.value = initialData || null;\n\t\t\t\tthrow new Error(fetchResponse.statusText);\n\t\t\t}\n\t\t\tif (options.afterFetch) ({data: responseData} = await options.afterFetch({\n\t\t\t\tdata: responseData,\n\t\t\t\tresponse: fetchResponse,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tdata.value = responseData;\n\t\t\tresponseEvent.trigger(fetchResponse);\n\t\t\treturn fetchResponse;\n\t\t}).catch(async (fetchError) => {\n\t\t\tlet errorData = fetchError.message || fetchError.name;\n\t\t\tif (options.onFetchError) ({error: errorData, data: responseData} = await options.onFetchError({\n\t\t\t\tdata: responseData,\n\t\t\t\terror: fetchError,\n\t\t\t\tresponse: response.value,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tif (currentExecuteCounter === executeCounter) {\n\t\t\t\terror.value = errorData;\n\t\t\t\tif (options.updateDataOnError) data.value = responseData;\n\t\t\t}\n\t\t\terrorEvent.trigger(fetchError);\n\t\t\tif (throwOnFailed) throw fetchError;\n\t\t\treturn null;\n\t\t}).finally(() => {\n\t\t\tif (currentExecuteCounter === executeCounter) loading(false);\n\t\t\tif (timer) timer.stop();\n\t\t\tfinallyEvent.trigger(null);\n\t\t});\n\t};\n\tconst refetch = toRef(options.refetch);\n\twatch([refetch, toRef(url)], ([refetch]) => refetch && execute(), { deep: true });\n\tconst shell = {\n\t\tisFinished: shallowReadonly(isFinished),\n\t\tisFetching: shallowReadonly(isFetching),\n\t\tstatusCode,\n\t\tresponse,\n\t\terror,\n\t\tdata,\n\t\tcanAbort,\n\t\taborted,\n\t\tabort,\n\t\texecute,\n\t\tonFetchResponse: responseEvent.on,\n\t\tonFetchError: errorEvent.on,\n\t\tonFetchFinally: finallyEvent.on,\n\t\tget: setMethod(\"GET\"),\n\t\tput: setMethod(\"PUT\"),\n\t\tpost: setMethod(\"POST\"),\n\t\tdelete: setMethod(\"DELETE\"),\n\t\tpatch: setMethod(\"PATCH\"),\n\t\thead: setMethod(\"HEAD\"),\n\t\toptions: setMethod(\"OPTIONS\"),\n\t\tjson: setType(\"json\"),\n\t\ttext: setType(\"text\"),\n\t\tblob: setType(\"blob\"),\n\t\tarrayBuffer: setType(\"arrayBuffer\"),\n\t\tformData: setType(\"formData\")\n\t};\n\tfunction setMethod(method) {\n\t\treturn (payload, payloadType) => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.method = method;\n\t\t\t\tconfig.payload = payload;\n\t\t\t\tconfig.payloadType = payloadType;\n\t\t\t\tif (isRef(config.payload)) watch([refetch, toRef(config.payload)], ([refetch]) => refetch && execute(), { deep: true });\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tfunction waitUntilFinished() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isFinished).toBe(true).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\tfunction setType(type) {\n\t\treturn () => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.type = type;\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (options.immediate) Promise.resolve().then(() => execute());\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\nfunction joinPaths(start, end) {\n\tif (!start.endsWith(\"/\") && !end.startsWith(\"/\")) return `${start}/${end}`;\n\tif (start.endsWith(\"/\") && end.startsWith(\"/\")) return `${start.slice(0, -1)}${end}`;\n\treturn `${start}${end}`;\n}\n//#endregion\n//#region useFileDialog/index.ts\nconst DEFAULT_OPTIONS = {\n\tmultiple: true,\n\taccept: \"*\",\n\treset: false,\n\tdirectory: false\n};\nfunction prepareInitialFiles(files) {\n\tif (!files) return null;\n\tif (files instanceof FileList) return files;\n\tconst dt = new DataTransfer();\n\tfor (const file of files) dt.items.add(file);\n\treturn dt.files;\n}\n/**\n* Open file dialog with ease.\n*\n* @see https://vueuse.org/useFileDialog\n* @param options\n*/\nfunction useFileDialog(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst files = ref(prepareInitialFiles(options.initialFiles));\n\tconst { on: onChange, trigger: changeTrigger } = createEventHook();\n\tconst { on: onCancel, trigger: cancelTrigger } = createEventHook();\n\tconst inputRef = computed(() => {\n\t\tvar _unrefElement;\n\t\tconst input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document ? document.createElement(\"input\") : void 0;\n\t\tif (input) {\n\t\t\tinput.type = \"file\";\n\t\t\tinput.onchange = (event) => {\n\t\t\t\tconst result = event.target;\n\t\t\t\tfiles.value = result.files;\n\t\t\t\tchangeTrigger(files.value);\n\t\t\t};\n\t\t\tinput.oncancel = () => {\n\t\t\t\tcancelTrigger();\n\t\t\t};\n\t\t}\n\t\treturn input;\n\t});\n\tconst reset = () => {\n\t\tfiles.value = null;\n\t\tif (inputRef.value && inputRef.value.value) {\n\t\t\tinputRef.value.value = \"\";\n\t\t\tchangeTrigger(null);\n\t\t}\n\t};\n\tconst applyOptions = (options) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tel.multiple = toValue(options.multiple);\n\t\tel.accept = toValue(options.accept);\n\t\tel.webkitdirectory = toValue(options.directory);\n\t\tif (hasOwn(options, \"capture\")) el.capture = toValue(options.capture);\n\t};\n\tconst open = (localOptions) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tconst mergedOptions = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t...localOptions\n\t\t};\n\t\tapplyOptions(mergedOptions);\n\t\tif (toValue(mergedOptions.reset)) reset();\n\t\tel.click();\n\t};\n\twatchEffect(() => {\n\t\tapplyOptions(options);\n\t});\n\treturn {\n\t\tfiles: readonly(files),\n\t\topen,\n\t\treset,\n\t\tonCancel,\n\t\tonChange\n\t};\n}\n//#endregion\n//#region useFileSystemAccess/index.ts\nfunction useFileSystemAccess(options = {}) {\n\tconst { window: _window = defaultWindow, dataType = \"Text\" } = options;\n\tconst window = _window;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n\tconst fileHandle = shallowRef();\n\tconst data = shallowRef();\n\tconst file = shallowRef();\n\tconst fileName = computed(() => {\n\t\tvar _file$value$name, _file$value;\n\t\treturn (_file$value$name = (_file$value = file.value) === null || _file$value === void 0 ? void 0 : _file$value.name) !== null && _file$value$name !== void 0 ? _file$value$name : \"\";\n\t});\n\tconst fileMIME = computed(() => {\n\t\tvar _file$value$type, _file$value2;\n\t\treturn (_file$value$type = (_file$value2 = file.value) === null || _file$value2 === void 0 ? void 0 : _file$value2.type) !== null && _file$value$type !== void 0 ? _file$value$type : \"\";\n\t});\n\tconst fileSize = computed(() => {\n\t\tvar _file$value$size, _file$value3;\n\t\treturn (_file$value$size = (_file$value3 = file.value) === null || _file$value3 === void 0 ? void 0 : _file$value3.size) !== null && _file$value$size !== void 0 ? _file$value$size : 0;\n\t});\n\tconst fileLastModified = computed(() => {\n\t\tvar _file$value$lastModif, _file$value4;\n\t\treturn (_file$value$lastModif = (_file$value4 = file.value) === null || _file$value4 === void 0 ? void 0 : _file$value4.lastModified) !== null && _file$value$lastModif !== void 0 ? _file$value$lastModif : 0;\n\t});\n\tasync function open(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tconst [handle] = await window.showOpenFilePicker({\n\t\t\t...toValue(options),\n\t\t\t..._options\n\t\t});\n\t\tfileHandle.value = handle;\n\t\tawait updateData();\n\t}\n\tasync function create(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tdata.value = void 0;\n\t\tawait updateData();\n\t}\n\tasync function save(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tif (!fileHandle.value) return saveAs(_options);\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function saveAs(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function updateFile() {\n\t\tvar _fileHandle$value;\n\t\tfile.value = await ((_fileHandle$value = fileHandle.value) === null || _fileHandle$value === void 0 ? void 0 : _fileHandle$value.getFile());\n\t}\n\tasync function updateData() {\n\t\tvar _file$value5, _file$value6;\n\t\tawait updateFile();\n\t\tconst type = toValue(dataType);\n\t\tif (type === \"Text\") data.value = await ((_file$value5 = file.value) === null || _file$value5 === void 0 ? void 0 : _file$value5.text());\n\t\telse if (type === \"ArrayBuffer\") data.value = await ((_file$value6 = file.value) === null || _file$value6 === void 0 ? void 0 : _file$value6.arrayBuffer());\n\t\telse if (type === \"Blob\") data.value = file.value;\n\t}\n\twatch(() => toValue(dataType), updateData);\n\treturn {\n\t\tisSupported,\n\t\tdata,\n\t\tfile,\n\t\tfileName,\n\t\tfileMIME,\n\t\tfileSize,\n\t\tfileLastModified,\n\t\topen,\n\t\tcreate,\n\t\tsave,\n\t\tsaveAs,\n\t\tupdateData\n\t};\n}\n//#endregion\n//#region useFocus/index.ts\n/**\n* Track or set the focus state of a DOM element.\n*\n* @see https://vueuse.org/useFocus\n* @param target The target element for the focus and blur events.\n* @param options\n*/\nfunction useFocus(target, options = {}) {\n\tconst { initialValue = false, focusVisible = false, preventScroll = false } = options;\n\tconst innerFocused = shallowRef(false);\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, \"focus\", (event) => {\n\t\tvar _matches, _ref;\n\t\tif (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, \":focus-visible\"))) innerFocused.value = true;\n\t}, listenerOptions);\n\tuseEventListener(targetElement, \"blur\", () => innerFocused.value = false, listenerOptions);\n\tconst focused = computed({\n\t\tget: () => innerFocused.value,\n\t\tset(value) {\n\t\t\tvar _targetElement$value, _targetElement$value2;\n\t\t\tif (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();\n\t\t\telse if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });\n\t\t}\n\t});\n\twatch(targetElement, () => {\n\t\tfocused.value = initialValue;\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\treturn { focused };\n}\n//#endregion\n//#region useFocusWithin/index.ts\nconst EVENT_FOCUS_IN = \"focusin\";\nconst EVENT_FOCUS_OUT = \"focusout\";\nconst PSEUDO_CLASS_FOCUS_WITHIN = \":focus-within\";\n/**\n* Track if focus is contained within the target element\n*\n* @see https://vueuse.org/useFocusWithin\n* @param target The target element to track\n* @param options Focus within options\n*/\nfunction useFocusWithin(target, options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst _focused = shallowRef(false);\n\tconst focused = computed(() => _focused.value);\n\tconst activeElement = useActiveElement(options);\n\tif (!window || !activeElement.value) return { focused };\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions);\n\tuseEventListener(targetElement, EVENT_FOCUS_OUT, () => {\n\t\tvar _targetElement$value$, _targetElement$value, _targetElement$value$2;\n\t\treturn _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false;\n\t}, listenerOptions);\n\treturn { focused };\n}\n//#endregion\n//#region useFps/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useFps(options) {\n\tvar _options$every;\n\tconst fps = shallowRef(0);\n\tif (typeof performance === \"undefined\") return fps;\n\tconst every = (_options$every = options === null || options === void 0 ? void 0 : options.every) !== null && _options$every !== void 0 ? _options$every : 10;\n\tlet last = performance.now();\n\tlet ticks = 0;\n\tuseRafFn(() => {\n\t\tticks += 1;\n\t\tif (ticks >= every) {\n\t\t\tconst now = performance.now();\n\t\t\tconst diff = now - last;\n\t\t\tfps.value = Math.round(1e3 / (diff / ticks));\n\t\t\tlast = now;\n\t\t\tticks = 0;\n\t\t}\n\t});\n\treturn fps;\n}\n//#endregion\n//#region useFullscreen/index.ts\nconst eventHandlers = [\n\t\"fullscreenchange\",\n\t\"webkitfullscreenchange\",\n\t\"webkitendfullscreen\",\n\t\"mozfullscreenchange\",\n\t\"MSFullscreenChange\"\n];\n/**\n* Reactive Fullscreen API.\n*\n* @see https://vueuse.org/useFullscreen\n* @param target\n* @param options\n*/\nfunction useFullscreen(target, options = {}) {\n\tconst { document = defaultDocument, autoExit = false } = options;\n\tconst targetRef = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : document === null || document === void 0 ? void 0 : document.documentElement;\n\t});\n\tconst isFullscreen = shallowRef(false);\n\tconst requestMethod = computed(() => {\n\t\treturn [\n\t\t\t\"requestFullscreen\",\n\t\t\t\"webkitRequestFullscreen\",\n\t\t\t\"webkitEnterFullscreen\",\n\t\t\t\"webkitEnterFullScreen\",\n\t\t\t\"webkitRequestFullScreen\",\n\t\t\t\"mozRequestFullScreen\",\n\t\t\t\"msRequestFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst exitMethod = computed(() => {\n\t\treturn [\n\t\t\t\"exitFullscreen\",\n\t\t\t\"webkitExitFullscreen\",\n\t\t\t\"webkitExitFullScreen\",\n\t\t\t\"webkitCancelFullScreen\",\n\t\t\t\"mozCancelFullScreen\",\n\t\t\t\"msExitFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenEnabled = computed(() => {\n\t\treturn [\n\t\t\t\"fullScreen\",\n\t\t\t\"webkitIsFullScreen\",\n\t\t\t\"webkitDisplayingFullscreen\",\n\t\t\t\"mozFullScreen\",\n\t\t\t\"msFullscreenElement\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenElementMethod = [\n\t\t\"fullscreenElement\",\n\t\t\"webkitFullscreenElement\",\n\t\t\"mozFullScreenElement\",\n\t\t\"msFullscreenElement\"\n\t].find((m) => document && m in document);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n\tconst isCurrentElementFullScreen = () => {\n\t\tif (fullscreenElementMethod) return (document === null || document === void 0 ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n\t\treturn false;\n\t};\n\tconst isElementFullScreen = () => {\n\t\tif (fullscreenEnabled.value) if (document && document[fullscreenEnabled.value] != null) return document[fullscreenEnabled.value];\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[fullscreenEnabled.value]) != null) return Boolean(target[fullscreenEnabled.value]);\n\t\t}\n\t\treturn false;\n\t};\n\tasync function exit() {\n\t\tif (!isSupported.value || !isFullscreen.value) return;\n\t\tif (exitMethod.value) if ((document === null || document === void 0 ? void 0 : document[exitMethod.value]) != null) await document[exitMethod.value]();\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[exitMethod.value]) != null) await target[exitMethod.value]();\n\t\t}\n\t\tisFullscreen.value = false;\n\t}\n\tasync function enter() {\n\t\tif (!isSupported.value || isFullscreen.value) return;\n\t\tif (isElementFullScreen()) await exit();\n\t\tconst target = targetRef.value;\n\t\tif (requestMethod.value && (target === null || target === void 0 ? void 0 : target[requestMethod.value]) != null) {\n\t\t\tawait target[requestMethod.value]();\n\t\t\tisFullscreen.value = true;\n\t\t}\n\t}\n\tasync function toggle() {\n\t\tawait (isFullscreen.value ? exit() : enter());\n\t}\n\tconst handlerCallback = () => {\n\t\tconst isElementFullScreenValue = isElementFullScreen();\n\t\tif (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;\n\t};\n\tconst listenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t};\n\tuseEventListener(document, eventHandlers, handlerCallback, listenerOptions);\n\tuseEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, listenerOptions);\n\ttryOnMounted(handlerCallback, false);\n\tif (autoExit) tryOnScopeDispose(exit);\n\treturn {\n\t\tisSupported,\n\t\tisFullscreen,\n\t\tenter,\n\t\texit,\n\t\ttoggle\n\t};\n}\n//#endregion\n//#region useGamepad/index.ts\n/**\n* Maps a standard standard gamepad to an Xbox 360 Controller.\n*/\nfunction mapGamepadToXbox360Controller(gamepad) {\n\treturn computed(() => {\n\t\tif (gamepad.value) return {\n\t\t\tbuttons: {\n\t\t\t\ta: gamepad.value.buttons[0],\n\t\t\t\tb: gamepad.value.buttons[1],\n\t\t\t\tx: gamepad.value.buttons[2],\n\t\t\t\ty: gamepad.value.buttons[3]\n\t\t\t},\n\t\t\tbumper: {\n\t\t\t\tleft: gamepad.value.buttons[4],\n\t\t\t\tright: gamepad.value.buttons[5]\n\t\t\t},\n\t\t\ttriggers: {\n\t\t\t\tleft: gamepad.value.buttons[6],\n\t\t\t\tright: gamepad.value.buttons[7]\n\t\t\t},\n\t\t\tstick: {\n\t\t\t\tleft: {\n\t\t\t\t\thorizontal: gamepad.value.axes[0],\n\t\t\t\t\tvertical: gamepad.value.axes[1],\n\t\t\t\t\tbutton: gamepad.value.buttons[10]\n\t\t\t\t},\n\t\t\t\tright: {\n\t\t\t\t\thorizontal: gamepad.value.axes[2],\n\t\t\t\t\tvertical: gamepad.value.axes[3],\n\t\t\t\t\tbutton: gamepad.value.buttons[11]\n\t\t\t\t}\n\t\t\t},\n\t\t\tdpad: {\n\t\t\t\tup: gamepad.value.buttons[12],\n\t\t\t\tdown: gamepad.value.buttons[13],\n\t\t\t\tleft: gamepad.value.buttons[14],\n\t\t\t\tright: gamepad.value.buttons[15]\n\t\t\t},\n\t\t\tback: gamepad.value.buttons[8],\n\t\t\tstart: gamepad.value.buttons[9]\n\t\t};\n\t\treturn null;\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useGamepad(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getGamepads\" in navigator);\n\tconst gamepads = ref([]);\n\tconst onConnectedHook = createEventHook();\n\tconst onDisconnectedHook = createEventHook();\n\tconst stateFromGamepad = (gamepad) => {\n\t\tconst hapticActuators = [];\n\t\tconst vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n\t\tif (vibrationActuator) hapticActuators.push(vibrationActuator);\n\t\tif (gamepad.hapticActuators) hapticActuators.push(...gamepad.hapticActuators);\n\t\treturn {\n\t\t\tid: gamepad.id,\n\t\t\tindex: gamepad.index,\n\t\t\tconnected: gamepad.connected,\n\t\t\tmapping: gamepad.mapping,\n\t\t\ttimestamp: gamepad.timestamp,\n\t\t\tvibrationActuator: gamepad.vibrationActuator,\n\t\t\thapticActuators,\n\t\t\taxes: gamepad.axes.map((axes) => axes),\n\t\t\tbuttons: gamepad.buttons.map((button) => ({\n\t\t\t\tpressed: button.pressed,\n\t\t\t\ttouched: button.touched,\n\t\t\t\tvalue: button.value\n\t\t\t}))\n\t\t};\n\t};\n\tconst updateGamepadState = () => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) {\n\t\t\tif (!gamepad) continue;\n\t\t\tconst index = gamepads.value.findIndex((x) => x.index === gamepad.index);\n\t\t\tif (index > -1) gamepads.value[index] = stateFromGamepad(gamepad);\n\t\t}\n\t};\n\tconst { isActive, pause, resume } = useRafFn(updateGamepadState);\n\tconst onGamepadConnected = (gamepad) => {\n\t\tif (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n\t\t\tgamepads.value.push(stateFromGamepad(gamepad));\n\t\t\tonConnectedHook.trigger(gamepad.index);\n\t\t}\n\t\tresume();\n\t};\n\tconst onGamepadDisconnected = (gamepad) => {\n\t\tgamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n\t\tonDisconnectedHook.trigger(gamepad.index);\n\t};\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad), listenerOptions);\n\tuseEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad), listenerOptions);\n\ttryOnMounted(() => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) onGamepadConnected(gamepad);\n\t});\n\tpause();\n\treturn {\n\t\tisSupported,\n\t\tonConnected: onConnectedHook.on,\n\t\tonDisconnected: onDisconnectedHook.on,\n\t\tgamepads,\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n//#endregion\n//#region useGeolocation/index.ts\n/**\n* Reactive Geolocation API.\n*\n* @see https://vueuse.org/useGeolocation\n* @param options\n*/\nfunction useGeolocation(options = {}) {\n\tconst { enableHighAccuracy = true, maximumAge = 3e4, timeout = 27e3, navigator = defaultNavigator, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"geolocation\" in navigator);\n\tconst locatedAt = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst coords = shallowRef({\n\t\taccuracy: 0,\n\t\tlatitude: Number.POSITIVE_INFINITY,\n\t\tlongitude: Number.POSITIVE_INFINITY,\n\t\taltitude: null,\n\t\taltitudeAccuracy: null,\n\t\theading: null,\n\t\tspeed: null\n\t});\n\tfunction updatePosition(position) {\n\t\tlocatedAt.value = position.timestamp;\n\t\tcoords.value = position.coords;\n\t\terror.value = null;\n\t}\n\tlet watcher;\n\tfunction resume() {\n\t\tif (isSupported.value) watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n\t\t\tenableHighAccuracy,\n\t\t\tmaximumAge,\n\t\t\ttimeout\n\t\t});\n\t}\n\tif (immediate) resume();\n\tfunction pause() {\n\t\tif (watcher && navigator) navigator.geolocation.clearWatch(watcher);\n\t}\n\ttryOnScopeDispose(() => {\n\t\tpause();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcoords,\n\t\tlocatedAt,\n\t\terror,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region useIdle/index.ts\nconst defaultEvents$1 = [\n\t\"mousemove\",\n\t\"mousedown\",\n\t\"resize\",\n\t\"keydown\",\n\t\"touchstart\",\n\t\"wheel\"\n];\nconst oneMinute = 6e4;\n/**\n* Tracks whether the user is being inactive.\n*\n* @see https://vueuse.org/useIdle\n* @param timeout default to 1 minute\n* @param options IdleOptions\n*/\nfunction useIdle(timeout = oneMinute, options = {}) {\n\tconst { initialState = false, listenForVisibilityChange = true, events = defaultEvents$1, window = defaultWindow, eventFilter = throttleFilter(50) } = options;\n\tconst idle = shallowRef(initialState);\n\tconst lastActive = shallowRef(timestamp());\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tconst reset = () => {\n\t\tidle.value = false;\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => idle.value = true, timeout);\n\t};\n\tconst onEvent = createFilterWrapper(eventFilter, () => {\n\t\tlastActive.value = timestamp();\n\t\treset();\n\t});\n\tif (window) {\n\t\tconst document = window.document;\n\t\tconst listenerOptions = { passive: true };\n\t\tfor (const event of events) useEventListener(window, event, () => {\n\t\t\tif (!isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tif (listenForVisibilityChange) useEventListener(document, \"visibilitychange\", () => {\n\t\t\tif (document.hidden || !isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tstart();\n\t}\n\tfunction start() {\n\t\tif (isPending.value) return;\n\t\tisPending.value = true;\n\t\tif (!initialState) reset();\n\t}\n\tfunction stop() {\n\t\tidle.value = initialState;\n\t\tclearTimeout(timer);\n\t\tisPending.value = false;\n\t}\n\treturn {\n\t\tidle,\n\t\tlastActive,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tisPending: shallowReadonly(isPending)\n\t};\n}\n//#endregion\n//#region useImage/index.ts\nasync function loadImage(options) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\tconst { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy, width, height, decoding, fetchPriority, ismap, usemap } = options;\n\t\timg.src = src;\n\t\tif (srcset != null) img.srcset = srcset;\n\t\tif (sizes != null) img.sizes = sizes;\n\t\tif (clazz != null) img.className = clazz;\n\t\tif (loading != null) img.loading = loading;\n\t\tif (crossorigin != null) img.crossOrigin = crossorigin;\n\t\tif (referrerPolicy != null) img.referrerPolicy = referrerPolicy;\n\t\tif (width != null) img.width = width;\n\t\tif (height != null) img.height = height;\n\t\tif (decoding != null) img.decoding = decoding;\n\t\tif (fetchPriority != null) img.fetchPriority = fetchPriority;\n\t\tif (ismap != null) img.isMap = ismap;\n\t\tif (usemap != null) img.useMap = usemap;\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t});\n}\n/**\n* Reactive load an image in the browser, you can wait the result to display it or show a fallback.\n*\n* @see https://vueuse.org/useImage\n* @param options Image attributes, as used in the <img> tag\n* @param asyncStateOptions\n*/\nfunction useImage(options, asyncStateOptions = {}) {\n\tconst state = useAsyncState(() => loadImage(toValue(options)), void 0, {\n\t\tresetOnExecute: true,\n\t\t...asyncStateOptions\n\t});\n\twatch(() => toValue(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n\treturn state;\n}\n//#endregion\n//#region _resolve-element.ts\n/**\n* Resolves an element from a given element, window, or document.\n*\n* @internal\n*/\nfunction resolveElement(el) {\n\tif (typeof Window !== \"undefined\" && el instanceof Window) return el.document.documentElement;\n\tif (typeof Document !== \"undefined\" && el instanceof Document) return el.documentElement;\n\treturn el;\n}\n//#endregion\n//#region useScroll/index.ts\n/**\n* We have to check if the scroll amount is close enough to some threshold in order to\n* more accurately calculate arrivedState. This is because scrollTop/scrollLeft are non-rounded\n* numbers, while scrollHeight/scrollWidth and clientHeight/clientWidth are rounded.\n* https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled\n*/\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\n/**\n* Reactive scroll.\n*\n* @see https://vueuse.org/useScroll\n* @param element\n* @param options\n*/\nfunction useScroll(element, options = {}) {\n\tconst { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: 0\n\t}, observe: _observe = { mutation: false }, eventListenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t}, behavior = \"auto\", window = defaultWindow, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = options;\n\tconst observe = typeof _observe === \"boolean\" ? { mutation: _observe } : _observe;\n\tconst internalX = shallowRef(0);\n\tconst internalY = shallowRef(0);\n\tconst x = computed({\n\t\tget() {\n\t\t\treturn internalX.value;\n\t\t},\n\t\tset(x) {\n\t\t\tscrollTo(x, void 0);\n\t\t}\n\t});\n\tconst y = computed({\n\t\tget() {\n\t\t\treturn internalY.value;\n\t\t},\n\t\tset(y) {\n\t\t\tscrollTo(void 0, y);\n\t\t}\n\t});\n\tfunction scrollTo(_x, _y) {\n\t\tvar _ref, _toValue, _toValue2, _document;\n\t\tif (!window) return;\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\t(_ref = _element instanceof Document ? window.document.body : _element) === null || _ref === void 0 || _ref.scrollTo({\n\t\t\ttop: (_toValue = toValue(_y)) !== null && _toValue !== void 0 ? _toValue : y.value,\n\t\t\tleft: (_toValue2 = toValue(_x)) !== null && _toValue2 !== void 0 ? _toValue2 : x.value,\n\t\t\tbehavior: toValue(behavior)\n\t\t});\n\t\tconst scrollContainer = (_element === null || _element === void 0 || (_document = _element.document) === null || _document === void 0 ? void 0 : _document.documentElement) || (_element === null || _element === void 0 ? void 0 : _element.documentElement) || _element;\n\t\tif (x != null) internalX.value = scrollContainer.scrollLeft;\n\t\tif (y != null) internalY.value = scrollContainer.scrollTop;\n\t}\n\tconst isScrolling = shallowRef(false);\n\tconst arrivedState = reactive({\n\t\tleft: true,\n\t\tright: false,\n\t\ttop: true,\n\t\tbottom: false\n\t});\n\tconst directions = reactive({\n\t\tleft: false,\n\t\tright: false,\n\t\ttop: false,\n\t\tbottom: false\n\t});\n\tconst onScrollEnd = (e) => {\n\t\tif (!isScrolling.value) return;\n\t\tisScrolling.value = false;\n\t\tdirections.left = false;\n\t\tdirections.right = false;\n\t\tdirections.top = false;\n\t\tdirections.bottom = false;\n\t\tonStop(e);\n\t};\n\tconst onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n\tconst setArrivedState = (target) => {\n\t\tvar _document2;\n\t\tif (!window) return;\n\t\tconst el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);\n\t\tconst { display, flexDirection, direction } = window.getComputedStyle(el);\n\t\tconst directionMultipler = direction === \"rtl\" ? -1 : 1;\n\t\tconst scrollLeft = el.scrollLeft;\n\t\tdirections.left = scrollLeft < internalX.value;\n\t\tdirections.right = scrollLeft > internalX.value;\n\t\tconst left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);\n\t\tconst right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\tif (display === \"flex\" && flexDirection === \"row-reverse\") {\n\t\t\tarrivedState.left = right;\n\t\t\tarrivedState.right = left;\n\t\t} else {\n\t\t\tarrivedState.left = left;\n\t\t\tarrivedState.right = right;\n\t\t}\n\t\tinternalX.value = scrollLeft;\n\t\tlet scrollTop = el.scrollTop;\n\t\tif (target === window.document && !scrollTop) scrollTop = window.document.body.scrollTop;\n\t\tdirections.top = scrollTop < internalY.value;\n\t\tdirections.bottom = scrollTop > internalY.value;\n\t\tconst top = Math.abs(scrollTop) <= (offset.top || 0);\n\t\tconst bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\t/**\n\t\t* reverse columns and rows behave exactly the other way around,\n\t\t* bottom is treated as top and top is treated as the negative version of bottom\n\t\t*/\n\t\tif (display === \"flex\" && flexDirection === \"column-reverse\") {\n\t\t\tarrivedState.top = bottom;\n\t\t\tarrivedState.bottom = top;\n\t\t} else {\n\t\t\tarrivedState.top = top;\n\t\t\tarrivedState.bottom = bottom;\n\t\t}\n\t\tinternalY.value = scrollTop;\n\t};\n\tconst onScrollHandler = (e) => {\n\t\tvar _documentElement;\n\t\tif (!window) return;\n\t\tconst eventTarget = (_documentElement = e.target.documentElement) !== null && _documentElement !== void 0 ? _documentElement : e.target;\n\t\tsetArrivedState(eventTarget);\n\t\tisScrolling.value = true;\n\t\tonScrollEndDebounced(e);\n\t\tonScroll(e);\n\t};\n\tuseEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n\ttryOnMounted(() => {\n\t\ttry {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (!_element) return;\n\t\t\tsetArrivedState(_element);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t});\n\tif ((observe === null || observe === void 0 ? void 0 : observe.mutation) && element != null && element !== window && element !== document) useMutationObserver(element, () => {\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\tsetArrivedState(_element);\n\t}, {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n\tuseEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n\treturn {\n\t\tx,\n\t\ty,\n\t\tisScrolling,\n\t\tarrivedState,\n\t\tdirections,\n\t\tmeasure() {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (window && _element) setArrivedState(_element);\n\t\t}\n\t};\n}\n//#endregion\n//#region useInfiniteScroll/index.ts\n/**\n* Reactive infinite scroll.\n*\n* @see https://vueuse.org/useInfiniteScroll\n*/\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n\tvar _options$distance;\n\tconst { direction = \"bottom\", interval = 100, canLoadMore = () => true } = options;\n\tconst state = reactive(useScroll(element, {\n\t\t...options,\n\t\toffset: {\n\t\t\t[direction]: (_options$distance = options.distance) !== null && _options$distance !== void 0 ? _options$distance : 0,\n\t\t\t...options.offset\n\t\t}\n\t}));\n\tconst promise = shallowRef();\n\tconst isLoading = computed(() => !!promise.value);\n\tconst observedElement = computed(() => {\n\t\treturn resolveElement(toValue(element));\n\t});\n\tconst isElementVisible = useElementVisibility(observedElement);\n\tconst canLoad = computed(() => {\n\t\tif (!observedElement.value) return false;\n\t\treturn canLoadMore(observedElement.value);\n\t});\n\tfunction checkAndLoad() {\n\t\tstate.measure();\n\t\tif (!observedElement.value || !isElementVisible.value || !canLoad.value || promise.value) return;\n\t\tconst { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n\t\tconst isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n\t\tif (state.arrivedState[direction] || isNarrower) promise.value = Promise.all([onLoadMore(state), new Promise((resolve) => setTimeout(resolve, interval))]).finally(() => {\n\t\t\tpromise.value = null;\n\t\t\tnextTick(() => checkAndLoad());\n\t\t});\n\t}\n\ttryOnUnmounted(watch(() => [\n\t\tstate.arrivedState[direction],\n\t\tisElementVisible.value,\n\t\tcanLoad.value\n\t], checkAndLoad, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t}));\n\treturn {\n\t\tisLoading,\n\t\treset() {\n\t\t\tnextTick(() => checkAndLoad());\n\t\t}\n\t};\n}\n//#endregion\n//#region useKeyModifier/index.ts\nconst defaultEvents = [\n\t\"mousedown\",\n\t\"mouseup\",\n\t\"keydown\",\n\t\"keyup\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction useKeyModifier(modifier, options = {}) {\n\tconst { events = defaultEvents, document = defaultDocument, initial = null } = options;\n\tconst state = shallowRef(initial);\n\tif (document) events.forEach((listenerEvent) => {\n\t\tuseEventListener(document, listenerEvent, (evt) => {\n\t\t\tif (typeof evt.getModifierState === \"function\") state.value = evt.getModifierState(modifier);\n\t\t}, { passive: true });\n\t});\n\treturn state;\n}\n//#endregion\n//#region useLocalStorage/index.ts\n/**\n* Reactive LocalStorage.\n*\n* @see https://vueuse.org/useLocalStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useLocalStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.localStorage, options);\n}\n//#endregion\n//#region useMagicKeys/aliasMap.ts\nconst DefaultMagicKeysAliasMap = {\n\tctrl: \"control\",\n\tcommand: \"meta\",\n\tcmd: \"meta\",\n\toption: \"alt\",\n\tup: \"arrowup\",\n\tdown: \"arrowdown\",\n\tleft: \"arrowleft\",\n\tright: \"arrowright\"\n};\n//#endregion\n//#region useMagicKeys/index.ts\n/**\n* Reactive keys pressed state, with magical keys combination support.\n*\n* @see https://vueuse.org/useMagicKeys\n*/\nfunction useMagicKeys(options = {}) {\n\tconst { reactive: useReactive = false, target = defaultWindow, aliasMap = DefaultMagicKeysAliasMap, passive = true, onEventFired = noop } = options;\n\tconst current = reactive(/* @__PURE__ */ new Set());\n\tconst obj = {\n\t\ttoJSON() {\n\t\t\treturn {};\n\t\t},\n\t\tcurrent\n\t};\n\tconst refs = useReactive ? reactive(obj) : obj;\n\tconst metaDeps = /* @__PURE__ */ new Set();\n\tconst depsMap = /* @__PURE__ */ new Map([\n\t\t[\"Meta\", metaDeps],\n\t\t[\"Shift\", /* @__PURE__ */ new Set()],\n\t\t[\"Alt\", /* @__PURE__ */ new Set()]\n\t]);\n\tconst usedKeys = /* @__PURE__ */ new Set();\n\tfunction setRefs(key, value) {\n\t\tif (key in refs) if (useReactive) refs[key] = value;\n\t\telse refs[key].value = value;\n\t}\n\tfunction reset() {\n\t\tcurrent.clear();\n\t\tfor (const key of usedKeys) setRefs(key, false);\n\t}\n\tfunction updateDeps(value, e, keys) {\n\t\tif (!value || typeof e.getModifierState !== \"function\") return;\n\t\tfor (const [modifier, depsSet] of depsMap) if (e.getModifierState(modifier)) {\n\t\t\tkeys.forEach((key) => depsSet.add(key));\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction clearDeps(value, key) {\n\t\tif (value) return;\n\t\tconst depsMapKey = `${key[0].toUpperCase()}${key.slice(1)}`;\n\t\tconst deps = depsMap.get(depsMapKey);\n\t\tif (![\"shift\", \"alt\"].includes(key) || !deps) return;\n\t\tconst depsArray = Array.from(deps);\n\t\tconst depsIndex = depsArray.indexOf(key);\n\t\tdepsArray.forEach((key, index) => {\n\t\t\tif (index >= depsIndex) {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t}\n\t\t});\n\t\tdeps.clear();\n\t}\n\tfunction updateRefs(e, value) {\n\t\tvar _e$key, _e$code;\n\t\tconst key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();\n\t\tconst values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);\n\t\tif (!key) return;\n\t\tif (key) if (value) current.add(key);\n\t\telse current.delete(key);\n\t\tfor (const key of values) {\n\t\t\tusedKeys.add(key);\n\t\t\tsetRefs(key, value);\n\t\t}\n\t\tupdateDeps(value, e, [...current, ...values]);\n\t\tclearDeps(value, key);\n\t\tif (key === \"meta\" && !value) {\n\t\t\tmetaDeps.forEach((key) => {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t});\n\t\t\tmetaDeps.clear();\n\t\t}\n\t}\n\tuseEventListener(target, \"keydown\", (e) => {\n\t\tupdateRefs(e, true);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(target, \"keyup\", (e) => {\n\t\tupdateRefs(e, false);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(\"blur\", reset, { passive });\n\tuseEventListener(\"focus\", reset, { passive });\n\tconst proxy = new Proxy(refs, { get(target, prop, rec) {\n\t\tif (typeof prop !== \"string\") return Reflect.get(target, prop, rec);\n\t\tprop = prop.toLowerCase();\n\t\tif (prop in aliasMap) prop = aliasMap[prop];\n\t\tif (!(prop in refs)) if (/[+_-]/.test(prop)) {\n\t\t\tconst keys = prop.split(/[+_-]/g).map((i) => i.trim());\n\t\t\trefs[prop] = computed(() => keys.map((key) => toValue(proxy[key])).every(Boolean));\n\t\t} else refs[prop] = shallowRef(false);\n\t\tconst r = Reflect.get(target, prop, rec);\n\t\treturn useReactive ? toValue(r) : r;\n\t} });\n\treturn proxy;\n}\n//#endregion\n//#region useMediaControls/index.ts\n/**\n* Automatically check if the ref exists and if it does run the cb fn\n*/\nfunction usingElRef(source, cb) {\n\tif (toValue(source)) cb(toValue(source));\n}\n/**\n* Converts a TimeRange object to an array\n*/\nfunction timeRangeToArray(timeRanges) {\n\tlet ranges = [];\n\tfor (let i = 0; i < timeRanges.length; ++i) ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n\treturn ranges;\n}\n/**\n* Converts a TextTrackList object to an array of `UseMediaTextTrack`\n*/\nfunction tracksToArray(tracks) {\n\treturn Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({\n\t\tid,\n\t\tlabel,\n\t\tkind,\n\t\tlanguage,\n\t\tmode,\n\t\tactiveCues,\n\t\tcues,\n\t\tinBandMetadataTrackDispatchType\n\t}));\n}\nconst defaultOptions = {\n\tsrc: \"\",\n\ttracks: []\n};\nfunction useMediaControls(target, options = {}) {\n\ttarget = toRef(target);\n\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { document = defaultDocument } = options;\n\tconst listenerOptions = { passive: true };\n\tconst currentTime = shallowRef(0);\n\tconst duration = shallowRef(0);\n\tconst seeking = shallowRef(false);\n\tconst volume = shallowRef(1);\n\tconst waiting = shallowRef(false);\n\tconst ended = shallowRef(false);\n\tconst playing = shallowRef(false);\n\tconst rate = shallowRef(1);\n\tconst stalled = shallowRef(false);\n\tconst buffered = shallowRef([]);\n\tconst tracks = shallowRef([]);\n\tconst selectedTrack = shallowRef(-1);\n\tconst isPictureInPicture = shallowRef(false);\n\tconst muted = shallowRef(false);\n\tconst supportsPictureInPicture = Boolean(document && \"pictureInPictureEnabled\" in document);\n\tconst sourceErrorEvent = createEventHook();\n\tconst playbackErrorEvent = createEventHook();\n\t/**\n\t* Disables the specified track. If no track is specified then\n\t* all tracks will be disabled\n\t*\n\t* @param track The id of the track to disable\n\t*/\n\tconst disableTrack = (track) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tif (track) {\n\t\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\t\tel.textTracks[id].mode = \"disabled\";\n\t\t\t} else for (let i = 0; i < el.textTracks.length; ++i) el.textTracks[i].mode = \"disabled\";\n\t\t\tselectedTrack.value = -1;\n\t\t});\n\t};\n\t/**\n\t* Enables the specified track and disables the\n\t* other tracks unless otherwise specified\n\t*\n\t* @param track The track of the id of the track to enable\n\t* @param disableTracks Disable all other tracks\n\t*/\n\tconst enableTrack = (track, disableTracks = true) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\tif (disableTracks) disableTrack();\n\t\t\tel.textTracks[id].mode = \"showing\";\n\t\t\tselectedTrack.value = id;\n\t\t});\n\t};\n\t/**\n\t* Toggle picture in picture mode for the player.\n\t*/\n\tconst togglePictureInPicture = () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tusingElRef(target, async (el) => {\n\t\t\t\tif (supportsPictureInPicture) if (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);\n\t\t\t\telse document.exitPictureInPicture().then(resolve).catch(reject);\n\t\t\t});\n\t\t});\n\t};\n\t/**\n\t* This will automatically inject sources to the media element. The sources will be\n\t* appended as children to the media element as `<source>` elements.\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tconst src = toValue(options.src);\n\t\tlet sources = [];\n\t\tif (!src) return;\n\t\tif (typeof src === \"string\") sources = [{ src }];\n\t\telse if (Array.isArray(src)) sources = src;\n\t\telse if (isObject(src)) sources = [src];\n\t\tel.querySelectorAll(\"source\").forEach((e) => {\n\t\t\te.remove();\n\t\t});\n\t\tsources.forEach(({ src, type, media }) => {\n\t\t\tconst source = document.createElement(\"source\");\n\t\t\tsource.setAttribute(\"src\", src);\n\t\t\tsource.setAttribute(\"type\", type || \"\");\n\t\t\tsource.setAttribute(\"media\", media || \"\");\n\t\t\tuseEventListener(source, \"error\", sourceErrorEvent.trigger, listenerOptions);\n\t\t\tel.appendChild(source);\n\t\t});\n\t\tel.load();\n\t});\n\t/**\n\t* Apply composable state to the element, also when element is changed\n\t*/\n\twatch([target, volume], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.volume = volume.value;\n\t});\n\twatch([target, muted], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.muted = muted.value;\n\t});\n\twatch([target, rate], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.playbackRate = rate.value;\n\t});\n\t/**\n\t* Load Tracks\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst textTracks = toValue(options.tracks);\n\t\tconst el = toValue(target);\n\t\tif (!textTracks || !textTracks.length || !el) return;\n\t\t/**\n\t\t* The MediaAPI provides an API for adding text tracks, but they don't currently\n\t\t* have an API for removing text tracks, so instead we will just create and remove\n\t\t* the tracks manually using the HTML api.\n\t\t*/\n\t\tel.querySelectorAll(\"track\").forEach((e) => e.remove());\n\t\ttextTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n\t\t\tconst track = document.createElement(\"track\");\n\t\t\ttrack.default = isDefault || false;\n\t\t\ttrack.kind = kind;\n\t\t\ttrack.label = label;\n\t\t\ttrack.src = src;\n\t\t\ttrack.srclang = srcLang;\n\t\t\tif (track.default) selectedTrack.value = i;\n\t\t\tel.appendChild(track);\n\t\t});\n\t});\n\t/**\n\t* This will allow us to update the current time from the timeupdate event\n\t* without setting the medias current position, but if the user changes the\n\t* current time via the ref, then the media will seek.\n\t*\n\t* If we did not use an ignorable watch, then the current time update from\n\t* the timeupdate event would cause the media to stutter.\n\t*/\n\tconst { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.currentTime = time;\n\t});\n\t/**\n\t* Using an ignorable watch so we can control the play state using a ref and not\n\t* a function\n\t*/\n\tconst { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tif (isPlaying) el.play().catch((e) => {\n\t\t\tplaybackErrorEvent.trigger(e);\n\t\t\tthrow e;\n\t\t});\n\t\telse el.pause();\n\t});\n\tuseEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime), listenerOptions);\n\tuseEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration, listenerOptions);\n\tuseEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered), listenerOptions);\n\tuseEventListener(target, \"seeking\", () => seeking.value = true, listenerOptions);\n\tuseEventListener(target, \"seeked\", () => seeking.value = false, listenerOptions);\n\tuseEventListener(target, [\"waiting\", \"loadstart\"], () => {\n\t\twaiting.value = true;\n\t\tignorePlayingUpdates(() => playing.value = false);\n\t}, listenerOptions);\n\tuseEventListener(target, \"loadeddata\", () => waiting.value = false, listenerOptions);\n\tuseEventListener(target, \"playing\", () => {\n\t\twaiting.value = false;\n\t\tended.value = false;\n\t\tignorePlayingUpdates(() => playing.value = true);\n\t}, listenerOptions);\n\tuseEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate, listenerOptions);\n\tuseEventListener(target, \"stalled\", () => stalled.value = true, listenerOptions);\n\tuseEventListener(target, \"ended\", () => ended.value = true, listenerOptions);\n\tuseEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false), listenerOptions);\n\tuseEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true), listenerOptions);\n\tuseEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true, listenerOptions);\n\tuseEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false, listenerOptions);\n\tuseEventListener(target, \"volumechange\", () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tvolume.value = el.volume;\n\t\tmuted.value = el.muted;\n\t}, listenerOptions);\n\t/**\n\t* The following listeners need to listen to a nested\n\t* object on the target, so we will have to use a nested\n\t* watch and manually remove the listeners\n\t*/\n\tconst listeners = [];\n\tconst stop = watch([target], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tstop();\n\t\tlisteners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t});\n\ttryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n\treturn {\n\t\tcurrentTime,\n\t\tduration,\n\t\twaiting,\n\t\tseeking,\n\t\tended,\n\t\tstalled,\n\t\tbuffered,\n\t\tplaying,\n\t\trate,\n\t\tvolume,\n\t\tmuted,\n\t\ttracks,\n\t\tselectedTrack,\n\t\tenableTrack,\n\t\tdisableTrack,\n\t\tsupportsPictureInPicture,\n\t\ttogglePictureInPicture,\n\t\tisPictureInPicture,\n\t\tonSourceError: sourceErrorEvent.on,\n\t\tonPlaybackError: playbackErrorEvent.on\n\t};\n}\n//#endregion\n//#region useMemoize/index.ts\n/**\n* Reactive function result cache based on arguments\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemoize(resolver, options) {\n\tconst initCache = () => {\n\t\tif (options === null || options === void 0 ? void 0 : options.cache) return shallowReactive(options.cache);\n\t\treturn shallowReactive(/* @__PURE__ */ new Map());\n\t};\n\tconst cache = initCache();\n\t/**\n\t* Generate key from args\n\t*/\n\tconst generateKey = (...args) => (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n\t/**\n\t* Load data and save in cache\n\t*/\n\tconst _loadData = (key, ...args) => {\n\t\tcache.set(key, resolver(...args));\n\t\treturn cache.get(key);\n\t};\n\tconst loadData = (...args) => _loadData(generateKey(...args), ...args);\n\t/**\n\t* Delete key from cache\n\t*/\n\tconst deleteData = (...args) => {\n\t\tcache.delete(generateKey(...args));\n\t};\n\t/**\n\t* Clear cached data\n\t*/\n\tconst clearData = () => {\n\t\tcache.clear();\n\t};\n\tconst memoized = (...args) => {\n\t\tconst key = generateKey(...args);\n\t\tif (cache.has(key)) return cache.get(key);\n\t\treturn _loadData(key, ...args);\n\t};\n\tmemoized.load = loadData;\n\tmemoized.delete = deleteData;\n\tmemoized.clear = clearData;\n\tmemoized.generateKey = generateKey;\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n//#endregion\n//#region useMemory/index.ts\nfunction getDefaultScheduler$6(options) {\n\tif (\"interval\" in options || \"immediate\" in options || \"immediateCallback\" in options) {\n\t\tconst { interval = 1e3, immediate, immediateCallback } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, {\n\t\t\timmediate,\n\t\t\timmediateCallback\n\t\t});\n\t}\n\treturn useIntervalFn;\n}\n/**\n* Reactive Memory Info.\n*\n* @see https://vueuse.org/useMemory\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemory(options = {}) {\n\tconst memory = shallowRef();\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n\tif (isSupported.value) {\n\t\tconst { scheduler = getDefaultScheduler$6 } = options;\n\t\tscheduler(() => {\n\t\t\tmemory.value = performance.memory;\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tmemory\n\t};\n}\n//#endregion\n//#region useMouse/index.ts\nconst UseMouseBuiltinExtractors = {\n\tpage: (event) => [event.pageX, event.pageY],\n\tclient: (event) => [event.clientX, event.clientY],\n\tscreen: (event) => [event.screenX, event.screenY],\n\tmovement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null\n};\n/**\n* Reactive mouse position.\n*\n* @see https://vueuse.org/useMouse\n* @param options\n*/\nfunction useMouse(options = {}) {\n\tconst { type = \"page\", touch = true, resetOnTouchEnds = false, initialValue = {\n\t\tx: 0,\n\t\ty: 0\n\t}, window = defaultWindow, target = window, scroll = true, eventFilter } = options;\n\tlet _prevMouseEvent = null;\n\tlet _prevScrollX = 0;\n\tlet _prevScrollY = 0;\n\tconst x = shallowRef(initialValue.x);\n\tconst y = shallowRef(initialValue.y);\n\tconst sourceType = shallowRef(null);\n\tconst extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n\tconst mouseHandler = (event) => {\n\t\tconst result = extractor(event);\n\t\t_prevMouseEvent = event;\n\t\tif (result) {\n\t\t\t[x.value, y.value] = result;\n\t\t\tsourceType.value = \"mouse\";\n\t\t}\n\t\tif (window) {\n\t\t\t_prevScrollX = window.scrollX;\n\t\t\t_prevScrollY = window.scrollY;\n\t\t}\n\t};\n\tconst touchHandler = (event) => {\n\t\tif (event.touches.length > 0) {\n\t\t\tconst result = extractor(event.touches[0]);\n\t\t\tif (result) {\n\t\t\t\t[x.value, y.value] = result;\n\t\t\t\tsourceType.value = \"touch\";\n\t\t\t}\n\t\t}\n\t};\n\tconst scrollHandler = () => {\n\t\tif (!_prevMouseEvent || !window) return;\n\t\tconst pos = extractor(_prevMouseEvent);\n\t\tif (_prevMouseEvent instanceof MouseEvent && pos) {\n\t\t\tx.value = pos[0] + window.scrollX - _prevScrollX;\n\t\t\ty.value = pos[1] + window.scrollY - _prevScrollY;\n\t\t}\n\t};\n\tconst reset = () => {\n\t\tx.value = initialValue.x;\n\t\ty.value = initialValue.y;\n\t};\n\tconst mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n\tconst touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n\tconst scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n\t\tif (touch && type !== \"movement\") {\n\t\t\tuseEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n\t\t\tif (resetOnTouchEnds) useEventListener(target, \"touchend\", reset, listenerOptions);\n\t\t}\n\t\tif (scroll && type === \"page\") useEventListener(window, \"scroll\", scrollHandlerWrapper, listenerOptions);\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useMouseInElement/index.ts\n/**\n* Reactive mouse position related to an element.\n*\n* @see https://vueuse.org/useMouseInElement\n* @param target\n* @param options\n*/\nfunction useMouseInElement(target, options = {}) {\n\tconst { windowResize = true, windowScroll = true, handleOutside = true, window = defaultWindow } = options;\n\tconst type = options.type || \"page\";\n\tconst { x, y, sourceType } = useMouse(options);\n\tconst targetRef = shallowRef(target !== null && target !== void 0 ? target : window === null || window === void 0 ? void 0 : window.document.body);\n\tconst elementX = shallowRef(0);\n\tconst elementY = shallowRef(0);\n\tconst elementPositionX = shallowRef(0);\n\tconst elementPositionY = shallowRef(0);\n\tconst elementHeight = shallowRef(0);\n\tconst elementWidth = shallowRef(0);\n\tconst isOutside = shallowRef(true);\n\tfunction update() {\n\t\tif (!window) return;\n\t\tconst el = unrefElement(targetRef);\n\t\tif (!el || !(el instanceof Element)) return;\n\t\tfor (const rect of el.getClientRects()) {\n\t\t\tconst { left, top, width, height } = rect;\n\t\t\telementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n\t\t\telementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n\t\t\telementHeight.value = height;\n\t\t\telementWidth.value = width;\n\t\t\tconst elX = x.value - elementPositionX.value;\n\t\t\tconst elY = y.value - elementPositionY.value;\n\t\t\tisOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n\t\t\tif (handleOutside || !isOutside.value) {\n\t\t\t\telementX.value = elX;\n\t\t\t\telementY.value = elY;\n\t\t\t}\n\t\t\tif (!isOutside.value) break;\n\t\t}\n\t}\n\tconst stopFnList = [];\n\tfunction stop() {\n\t\tstopFnList.forEach((fn) => fn());\n\t\tstopFnList.length = 0;\n\t}\n\ttryOnMounted(() => {\n\t\tupdate();\n\t});\n\tif (window) {\n\t\tconst { stop: stopResizeObserver } = useResizeObserver(targetRef, update);\n\t\tconst { stop: stopMutationObserver } = useMutationObserver(targetRef, update, { attributeFilter: [\"style\", \"class\"] });\n\t\tconst stopWatch = watch([\n\t\t\ttargetRef,\n\t\t\tx,\n\t\t\ty\n\t\t], update);\n\t\tstopFnList.push(stopResizeObserver, stopMutationObserver, stopWatch);\n\t\tuseEventListener(document, \"mouseleave\", () => isOutside.value = true, { passive: true });\n\t\tif (windowScroll) stopFnList.push(useEventListener(\"scroll\", update, {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t}));\n\t\tif (windowResize) stopFnList.push(useEventListener(\"resize\", update, { passive: true }));\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType,\n\t\telementX,\n\t\telementY,\n\t\telementPositionX,\n\t\telementPositionY,\n\t\telementHeight,\n\t\telementWidth,\n\t\tisOutside,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useMousePressed/index.ts\n/**\n* Reactive mouse pressing state.\n*\n* @see https://vueuse.org/useMousePressed\n* @param options\n*/\nfunction useMousePressed(options = {}) {\n\tconst { touch = true, drag = true, capture = false, initialValue = false, window = defaultWindow } = options;\n\tconst pressed = shallowRef(initialValue);\n\tconst sourceType = shallowRef(null);\n\tif (!window) return {\n\t\tpressed,\n\t\tsourceType\n\t};\n\tconst onPressed = (srcType) => (event) => {\n\t\tvar _options$onPressed;\n\t\tpressed.value = true;\n\t\tsourceType.value = srcType;\n\t\t(_options$onPressed = options.onPressed) === null || _options$onPressed === void 0 || _options$onPressed.call(options, event);\n\t};\n\tconst onReleased = (event) => {\n\t\tvar _options$onReleased;\n\t\tpressed.value = false;\n\t\tsourceType.value = null;\n\t\t(_options$onReleased = options.onReleased) === null || _options$onReleased === void 0 || _options$onReleased.call(options, event);\n\t};\n\tconst target = computed(() => unrefElement(options.target) || window);\n\tconst listenerOptions = {\n\t\tpassive: true,\n\t\tcapture\n\t};\n\tuseEventListener(target, \"mousedown\", onPressed(\"mouse\"), listenerOptions);\n\tuseEventListener(window, \"mouseleave\", onReleased, listenerOptions);\n\tuseEventListener(window, \"mouseup\", onReleased, listenerOptions);\n\tif (drag) {\n\t\tuseEventListener(target, \"dragstart\", onPressed(\"mouse\"), listenerOptions);\n\t\tuseEventListener(window, \"drop\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"dragend\", onReleased, listenerOptions);\n\t}\n\tif (touch) {\n\t\tuseEventListener(target, \"touchstart\", onPressed(\"touch\"), listenerOptions);\n\t\tuseEventListener(window, \"touchend\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"touchcancel\", onReleased, listenerOptions);\n\t}\n\treturn {\n\t\tpressed,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useNavigatorLanguage/index.ts\n/**\n*\n* Reactive useNavigatorLanguage\n*\n* Detects the currently selected user language and returns a reactive language\n* @see https://vueuse.org/useNavigatorLanguage\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNavigatorLanguage(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"language\" in navigator);\n\tconst language = shallowRef(navigator === null || navigator === void 0 ? void 0 : navigator.language);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tif (navigator) language.value = navigator.language;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tlanguage\n\t};\n}\n//#endregion\n//#region useNetwork/index.ts\n/**\n* Reactive Network status.\n*\n* @see https://vueuse.org/useNetwork\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNetwork(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"connection\" in navigator);\n\tconst isOnline = shallowRef(true);\n\tconst saveData = shallowRef(false);\n\tconst offlineAt = shallowRef(void 0);\n\tconst onlineAt = shallowRef(void 0);\n\tconst downlink = shallowRef(void 0);\n\tconst downlinkMax = shallowRef(void 0);\n\tconst rtt = shallowRef(void 0);\n\tconst effectiveType = shallowRef(void 0);\n\tconst type = shallowRef(\"unknown\");\n\tconst connection = isSupported.value && navigator.connection;\n\tfunction updateNetworkInformation() {\n\t\tif (!navigator) return;\n\t\tisOnline.value = navigator.onLine;\n\t\tofflineAt.value = isOnline.value ? void 0 : Date.now();\n\t\tonlineAt.value = isOnline.value ? Date.now() : void 0;\n\t\tif (connection) {\n\t\t\tdownlink.value = connection.downlink;\n\t\t\tdownlinkMax.value = connection.downlinkMax;\n\t\t\teffectiveType.value = connection.effectiveType;\n\t\t\trtt.value = connection.rtt;\n\t\t\tsaveData.value = connection.saveData;\n\t\t\ttype.value = connection.type;\n\t\t}\n\t}\n\tconst listenerOptions = { passive: true };\n\tif (window) {\n\t\tuseEventListener(window, \"offline\", () => {\n\t\t\tisOnline.value = false;\n\t\t\tofflineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"online\", () => {\n\t\t\tisOnline.value = true;\n\t\t\tonlineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t}\n\tif (connection) useEventListener(connection, \"change\", updateNetworkInformation, listenerOptions);\n\tupdateNetworkInformation();\n\treturn {\n\t\tisSupported,\n\t\tisOnline: shallowReadonly(isOnline),\n\t\tsaveData: shallowReadonly(saveData),\n\t\tofflineAt: shallowReadonly(offlineAt),\n\t\tonlineAt: shallowReadonly(onlineAt),\n\t\tdownlink: shallowReadonly(downlink),\n\t\tdownlinkMax: shallowReadonly(downlinkMax),\n\t\teffectiveType: shallowReadonly(effectiveType),\n\t\trtt: shallowReadonly(rtt),\n\t\ttype: shallowReadonly(type)\n\t};\n}\n//#endregion\n//#region useNow/index.ts\nfunction getDefaultScheduler$5(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (fn) => useRafFn(fn, { immediate }) : (fn) => useIntervalFn(fn, interval, options);\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive current Date instance.\n*\n* @see https://vueuse.org/useNow\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNow(options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$5(options) } = options;\n\tconst now = shallowRef(/* @__PURE__ */ new Date());\n\tconst update = () => now.value = /* @__PURE__ */ new Date();\n\tconst controls = scheduler(update);\n\tif (exposeControls) return {\n\t\tnow,\n\t\t...controls\n\t};\n\telse return now;\n}\n//#endregion\n//#region useObjectUrl/index.ts\n/**\n* Reactive URL representing an object.\n*\n* @see https://vueuse.org/useObjectUrl\n* @param object\n*/\nfunction useObjectUrl(object) {\n\tconst url = shallowRef();\n\tconst release = () => {\n\t\tif (url.value) URL.revokeObjectURL(url.value);\n\t\turl.value = void 0;\n\t};\n\twatch(() => toValue(object), (newObject) => {\n\t\trelease();\n\t\tif (newObject) url.value = URL.createObjectURL(newObject);\n\t}, { immediate: true });\n\ttryOnScopeDispose(release);\n\treturn shallowReadonly(url);\n}\n//#endregion\n//#region ../math/useClamp/index.ts\n/**\n* Reactively clamp a value between two other values.\n*\n* @see https://vueuse.org/useClamp\n* @param value number\n* @param min\n* @param max\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useClamp(value, min, max) {\n\tif (typeof value === \"function\" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n\tconst _value = ref(value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn _value.value = clamp(_value.value, toValue(min), toValue(max));\n\t\t},\n\t\tset(value) {\n\t\t\t_value.value = clamp(value, toValue(min), toValue(max));\n\t\t}\n\t});\n}\n//#endregion\n//#region useOffsetPagination/index.ts\nfunction useOffsetPagination(options) {\n\tconst { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;\n\tconst currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n\tconst pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));\n\tconst currentPage = useClamp(page, 1, pageCount);\n\tconst isFirstPage = computed(() => currentPage.value === 1);\n\tconst isLastPage = computed(() => currentPage.value === pageCount.value);\n\tif (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? \"ltr\" : \"both\" });\n\tif (isRef(pageSize)) syncRef(pageSize, currentPageSize, { direction: isReadonly(pageSize) ? \"ltr\" : \"both\" });\n\tfunction prev() {\n\t\tcurrentPage.value--;\n\t}\n\tfunction next() {\n\t\tcurrentPage.value++;\n\t}\n\tconst returnValue = {\n\t\tcurrentPage,\n\t\tcurrentPageSize,\n\t\tpageCount,\n\t\tisFirstPage,\n\t\tisLastPage,\n\t\tprev,\n\t\tnext\n\t};\n\twatch(currentPage, () => {\n\t\tonPageChange(reactive(returnValue));\n\t});\n\twatch(currentPageSize, () => {\n\t\tonPageSizeChange(reactive(returnValue));\n\t});\n\twatch(pageCount, () => {\n\t\tonPageCountChange(reactive(returnValue));\n\t});\n\treturn returnValue;\n}\n//#endregion\n//#region useOnline/index.ts\n/**\n* Reactive online state.\n*\n* @see https://vueuse.org/useOnline\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useOnline(options = {}) {\n\tconst { isOnline } = useNetwork(options);\n\treturn isOnline;\n}\n//#endregion\n//#region usePageLeave/index.ts\n/**\n* Reactive state to show whether mouse leaves the page.\n*\n* @see https://vueuse.org/usePageLeave\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePageLeave(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isLeft = shallowRef(false);\n\tconst handler = (event) => {\n\t\tif (!window) return;\n\t\tevent = event || window.event;\n\t\tconst from = event.relatedTarget || event.toElement;\n\t\tisLeft.value = !from;\n\t};\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"mouseout\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseleave\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseenter\", handler, listenerOptions);\n\t}\n\treturn isLeft;\n}\n//#endregion\n//#region useScreenOrientation/index.ts\n/**\n* Reactive screen orientation\n*\n* @see https://vueuse.org/useScreenOrientation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useScreenOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n\tconst screenOrientation = isSupported.value ? window.screen.orientation : {};\n\tconst orientation = shallowRef(screenOrientation.type);\n\tconst angle = shallowRef(screenOrientation.angle || 0);\n\tif (isSupported.value) useEventListener(window, \"orientationchange\", () => {\n\t\torientation.value = screenOrientation.type;\n\t\tangle.value = screenOrientation.angle;\n\t}, { passive: true });\n\tconst lockOrientation = (type) => {\n\t\tif (isSupported.value && typeof screenOrientation.lock === \"function\") return screenOrientation.lock(type);\n\t\treturn Promise.reject(/* @__PURE__ */ new Error(\"Not supported\"));\n\t};\n\tconst unlockOrientation = () => {\n\t\tif (isSupported.value && typeof screenOrientation.unlock === \"function\") screenOrientation.unlock();\n\t};\n\treturn {\n\t\tisSupported,\n\t\torientation,\n\t\tangle,\n\t\tlockOrientation,\n\t\tunlockOrientation\n\t};\n}\n//#endregion\n//#region useParallax/index.ts\n/**\n* Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`\n* if orientation is not supported.\n*\n* @param target\n* @param options\n*/\nfunction useParallax(target, options = {}) {\n\tconst { deviceOrientationTiltAdjust = (i) => i, deviceOrientationRollAdjust = (i) => i, mouseTiltAdjust = (i) => i, mouseRollAdjust = (i) => i, window = defaultWindow } = options;\n\tconst orientation = reactive(useDeviceOrientation({ window }));\n\tconst screenOrientation = reactive(useScreenOrientation({ window }));\n\tconst { elementX: x, elementY: y, elementWidth: width, elementHeight: height } = useMouseInElement(target, {\n\t\thandleOutside: false,\n\t\twindow\n\t});\n\tconst source = computed(() => {\n\t\tif (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0)) return \"deviceOrientation\";\n\t\treturn \"mouse\";\n\t});\n\treturn {\n\t\troll: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = -orientation.beta / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationRollAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = -(y.value - height.value / 2) / height.value;\n\t\t\t\treturn mouseRollAdjust(value);\n\t\t\t}\n\t\t}),\n\t\ttilt: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = orientation.gamma / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationTiltAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = (x.value - width.value / 2) / width.value;\n\t\t\t\treturn mouseTiltAdjust(value);\n\t\t\t}\n\t\t}),\n\t\tsource\n\t};\n}\n//#endregion\n//#region useParentElement/index.ts\nfunction useParentElement(element = useCurrentElement()) {\n\tconst parentElement = shallowRef();\n\tconst update = () => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) parentElement.value = el.parentElement;\n\t};\n\ttryOnMounted(update);\n\twatch(() => toValue(element), update);\n\treturn parentElement;\n}\n//#endregion\n//#region usePerformanceObserver/index.ts\n/**\n* Observe performance metrics.\n*\n* @see https://vueuse.org/usePerformanceObserver\n* @param options\n*/\nfunction usePerformanceObserver(options, callback) {\n\tconst { window = defaultWindow, immediate = true, ...performanceOptions } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"PerformanceObserver\" in window);\n\tlet observer;\n\tconst stop = () => {\n\t\tobserver === null || observer === void 0 || observer.disconnect();\n\t};\n\tconst start = () => {\n\t\tif (isSupported.value) {\n\t\t\tstop();\n\t\t\tobserver = new PerformanceObserver(callback);\n\t\t\tobserver.observe(performanceOptions);\n\t\t}\n\t};\n\ttryOnScopeDispose(stop);\n\tif (immediate) start();\n\treturn {\n\t\tisSupported,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePointer/index.ts\nconst defaultState = {\n\tx: 0,\n\ty: 0,\n\tpointerId: 0,\n\tpressure: 0,\n\ttiltX: 0,\n\ttiltY: 0,\n\twidth: 0,\n\theight: 0,\n\ttwist: 0,\n\tpointerType: null\n};\nconst keys = /* #__PURE__ */ Object.keys(defaultState);\n/**\n* Reactive pointer state.\n*\n* @see https://vueuse.org/usePointer\n* @param options\n*/\nfunction usePointer(options = {}) {\n\tconst { target = defaultWindow } = options;\n\tconst isInside = shallowRef(false);\n\tconst state = shallowRef(options.initialValue || {});\n\tObject.assign(state.value, defaultState, state.value);\n\tconst handler = (event) => {\n\t\tisInside.value = true;\n\t\tif (options.pointerTypes && !options.pointerTypes.includes(event.pointerType)) return;\n\t\tstate.value = objectPick(event, keys, false);\n\t};\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\n\t\t\t\"pointerdown\",\n\t\t\t\"pointermove\",\n\t\t\t\"pointerup\"\n\t\t], handler, listenerOptions);\n\t\tuseEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n\t}\n\treturn {\n\t\t...toRefs(state),\n\t\tisInside\n\t};\n}\n//#endregion\n//#region usePointerLock/index.ts\n/**\n* Reactive pointer lock.\n*\n* @see https://vueuse.org/usePointerLock\n* @param target\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePointerLock(target, options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => document && \"pointerLockElement\" in document);\n\tconst element = shallowRef();\n\tconst triggerElement = shallowRef();\n\tlet targetElement;\n\tif (isSupported.value) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(document, \"pointerlockchange\", () => {\n\t\t\tvar _pointerLockElement;\n\t\t\tconst currentElement = (_pointerLockElement = document.pointerLockElement) !== null && _pointerLockElement !== void 0 ? _pointerLockElement : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\telement.value = document.pointerLockElement;\n\t\t\t\tif (!element.value) targetElement = triggerElement.value = null;\n\t\t\t}\n\t\t}, listenerOptions);\n\t\tuseEventListener(document, \"pointerlockerror\", () => {\n\t\t\tvar _pointerLockElement2;\n\t\t\tconst currentElement = (_pointerLockElement2 = document.pointerLockElement) !== null && _pointerLockElement2 !== void 0 ? _pointerLockElement2 : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\tconst action = document.pointerLockElement ? \"release\" : \"acquire\";\n\t\t\t\tthrow new Error(`Failed to ${action} pointer lock.`);\n\t\t\t}\n\t\t}, listenerOptions);\n\t}\n\tasync function lock(e) {\n\t\tvar _unrefElement;\n\t\tif (!isSupported.value) throw new Error(\"Pointer Lock API is not supported by your browser.\");\n\t\ttriggerElement.value = e instanceof Event ? e.currentTarget : null;\n\t\ttargetElement = e instanceof Event ? (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : triggerElement.value : unrefElement(e);\n\t\tif (!targetElement) throw new Error(\"Target element undefined.\");\n\t\ttargetElement.requestPointerLock();\n\t\treturn await until(element).toBe(targetElement);\n\t}\n\tasync function unlock() {\n\t\tif (!element.value) return false;\n\t\tdocument.exitPointerLock();\n\t\tawait until(element).toBeNull();\n\t\treturn true;\n\t}\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\ttriggerElement,\n\t\tlock,\n\t\tunlock\n\t};\n}\n//#endregion\n//#region usePointerSwipe/index.ts\n/**\n* Reactive swipe detection based on PointerEvents.\n*\n* @see https://vueuse.org/usePointerSwipe\n* @param target\n* @param options\n*/\nfunction usePointerSwipe(target, options = {}) {\n\tconst targetRef = toRef(target);\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, disableTextSelect = false } = options;\n\tconst posStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosStart = (x, y) => {\n\t\tposStart.x = x;\n\t\tposStart.y = y;\n\t};\n\tconst posEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosEnd = (x, y) => {\n\t\tposEnd.x = x;\n\t\tposEnd.y = y;\n\t};\n\tconst distanceX = computed(() => posStart.x - posEnd.x);\n\tconst distanceY = computed(() => posStart.y - posEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst isPointerDown = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(distanceX.value) > abs(distanceY.value)) return distanceX.value > 0 ? \"left\" : \"right\";\n\t\telse return distanceY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst eventIsAllowed = (e) => {\n\t\tvar _ref, _options$pointerTypes, _options$pointerTypes2;\n\t\tconst isReleasingButton = e.buttons === 0;\n\t\tconst isPrimaryButton = e.buttons === 1;\n\t\treturn (_ref = (_options$pointerTypes = (_options$pointerTypes2 = options.pointerTypes) === null || _options$pointerTypes2 === void 0 ? void 0 : _options$pointerTypes2.includes(e.pointerType)) !== null && _options$pointerTypes !== void 0 ? _options$pointerTypes : isReleasingButton || isPrimaryButton) !== null && _ref !== void 0 ? _ref : true;\n\t};\n\tconst listenerOptions = { passive: true };\n\tconst stops = [\n\t\tuseEventListener(target, \"pointerdown\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tisPointerDown.value = true;\n\t\t\tconst eventTarget = e.target;\n\t\t\teventTarget === null || eventTarget === void 0 || eventTarget.setPointerCapture(e.pointerId);\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosStart(x, y);\n\t\t\tupdatePosEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointermove\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (!isPointerDown.value) return;\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosEnd(x, y);\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"pointerup\", \"pointercancel\"], (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\t\tisPointerDown.value = false;\n\t\t\tisSwiping.value = false;\n\t\t}, listenerOptions)\n\t];\n\ttryOnMounted(() => {\n\t\tvar _targetRef$value;\n\t\t(_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 || (_targetRef$value = _targetRef$value.style) === null || _targetRef$value === void 0 || _targetRef$value.setProperty(\"touch-action\", \"pan-y\");\n\t\tif (disableTextSelect) {\n\t\t\tvar _targetRef$value2, _targetRef$value3, _targetRef$value4;\n\t\t\t(_targetRef$value2 = targetRef.value) === null || _targetRef$value2 === void 0 || (_targetRef$value2 = _targetRef$value2.style) === null || _targetRef$value2 === void 0 || _targetRef$value2.setProperty(\"-webkit-user-select\", \"none\");\n\t\t\t(_targetRef$value3 = targetRef.value) === null || _targetRef$value3 === void 0 || (_targetRef$value3 = _targetRef$value3.style) === null || _targetRef$value3 === void 0 || _targetRef$value3.setProperty(\"-ms-user-select\", \"none\");\n\t\t\t(_targetRef$value4 = targetRef.value) === null || _targetRef$value4 === void 0 || (_targetRef$value4 = _targetRef$value4.style) === null || _targetRef$value4 === void 0 || _targetRef$value4.setProperty(\"user-select\", \"none\");\n\t\t}\n\t});\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping: shallowReadonly(isSwiping),\n\t\tdirection: shallowReadonly(direction),\n\t\tposStart: readonly(posStart),\n\t\tposEnd: readonly(posEnd),\n\t\tdistanceX,\n\t\tdistanceY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePreferredColorScheme/index.ts\n/**\n* Reactive prefers-color-scheme media query.\n*\n* @see https://vueuse.org/usePreferredColorScheme\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredColorScheme(options) {\n\tconst isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n\tconst isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n\treturn computed(() => {\n\t\tif (isDark.value) return \"dark\";\n\t\tif (isLight.value) return \"light\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredContrast/index.ts\n/**\n* Reactive prefers-contrast media query.\n*\n* @see https://vueuse.org/usePreferredContrast\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredContrast(options) {\n\tconst isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n\tconst isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n\tconst isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n\treturn computed(() => {\n\t\tif (isMore.value) return \"more\";\n\t\tif (isLess.value) return \"less\";\n\t\tif (isCustom.value) return \"custom\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredLanguages/index.ts\n/**\n* Reactive Navigator Languages.\n*\n* @see https://vueuse.org/usePreferredLanguages\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredLanguages(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef([\"en\"]);\n\tconst navigator = window.navigator;\n\tconst value = shallowRef(navigator.languages);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tvalue.value = navigator.languages;\n\t}, { passive: true });\n\treturn value;\n}\n//#endregion\n//#region usePreferredReducedMotion/index.ts\n/**\n* Reactive prefers-reduced-motion media query.\n*\n* @see https://vueuse.org/usePreferredReducedMotion\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedMotion(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredReducedTransparency/index.ts\n/**\n* Reactive prefers-reduced-transparency media query.\n*\n* @see https://vueuse.org/usePreferredReducedTransparency\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedTransparency(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-transparency: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePrevious/index.ts\nfunction usePrevious(value, initialValue) {\n\tconst previous = shallowRef(initialValue);\n\twatch(toRef(value), (_, oldValue) => {\n\t\tprevious.value = oldValue;\n\t}, { flush: \"sync\" });\n\treturn readonly(previous);\n}\n//#endregion\n//#region useScreenSafeArea/index.ts\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\n/**\n* Reactive `env(safe-area-inset-*)`\n*\n* @see https://vueuse.org/useScreenSafeArea\n*/\nfunction useScreenSafeArea() {\n\tconst top = shallowRef(\"\");\n\tconst right = shallowRef(\"\");\n\tconst bottom = shallowRef(\"\");\n\tconst left = shallowRef(\"\");\n\tif (isClient) {\n\t\tconst topCssVar = useCssVar(topVarName);\n\t\tconst rightCssVar = useCssVar(rightVarName);\n\t\tconst bottomCssVar = useCssVar(bottomVarName);\n\t\tconst leftCssVar = useCssVar(leftVarName);\n\t\ttopCssVar.value = \"env(safe-area-inset-top, 0px)\";\n\t\trightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n\t\tbottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n\t\tleftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n\t\ttryOnMounted(update);\n\t\tuseEventListener(\"resize\", useDebounceFn(update), { passive: true });\n\t}\n\tfunction update() {\n\t\ttop.value = getValue(topVarName);\n\t\tright.value = getValue(rightVarName);\n\t\tbottom.value = getValue(bottomVarName);\n\t\tleft.value = getValue(leftVarName);\n\t}\n\treturn {\n\t\ttop,\n\t\tright,\n\t\tbottom,\n\t\tleft,\n\t\tupdate\n\t};\n}\nfunction getValue(position) {\n\treturn getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n//#endregion\n//#region useScriptTag/index.ts\n/**\n* Async script tag loading.\n*\n* @see https://vueuse.org/useScriptTag\n* @param src\n* @param onLoaded\n* @param options\n*/\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n\tconst { immediate = true, manual = false, type = \"text/javascript\", async = true, crossOrigin, referrerPolicy, noModule, defer, document = defaultDocument, attrs = {}, nonce = void 0 } = options;\n\tconst scriptTag = shallowRef(null);\n\tlet _promise = null;\n\t/**\n\t* Load the script specified via `src`.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n\t\tconst resolveWithElement = (el) => {\n\t\t\tscriptTag.value = el;\n\t\t\tresolve(el);\n\t\t\treturn el;\n\t\t};\n\t\tif (!document) {\n\t\t\tresolve(false);\n\t\t\treturn;\n\t\t}\n\t\tlet shouldAppend = false;\n\t\tlet el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (!el) {\n\t\t\tel = document.createElement(\"script\");\n\t\t\tel.type = type;\n\t\t\tel.async = async;\n\t\t\tel.src = toValue(src);\n\t\t\tif (defer) el.defer = defer;\n\t\t\tif (crossOrigin) el.crossOrigin = crossOrigin;\n\t\t\tif (noModule) el.noModule = noModule;\n\t\t\tif (referrerPolicy) el.referrerPolicy = referrerPolicy;\n\t\t\tif (nonce) el.nonce = nonce;\n\t\t\tObject.entries(attrs).forEach(([name, value]) => el === null || el === void 0 ? void 0 : el.setAttribute(name, value));\n\t\t\tshouldAppend = true;\n\t\t} else if (el.hasAttribute(\"data-loaded\")) resolveWithElement(el);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(el, \"error\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"abort\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"load\", () => {\n\t\t\tel.setAttribute(\"data-loaded\", \"true\");\n\t\t\tonLoaded(el);\n\t\t\tresolveWithElement(el);\n\t\t}, listenerOptions);\n\t\tif (shouldAppend) el = document.head.appendChild(el);\n\t\tif (!waitForScriptLoad) resolveWithElement(el);\n\t});\n\t/**\n\t* Exposed singleton wrapper for `loadScript`, avoiding calling it twice.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst load = (waitForScriptLoad = true) => {\n\t\tif (!_promise) _promise = loadScript(waitForScriptLoad);\n\t\treturn _promise;\n\t};\n\t/**\n\t* Unload the script specified by `src`.\n\t*/\n\tconst unload = () => {\n\t\tif (!document) return;\n\t\t_promise = null;\n\t\tif (scriptTag.value) scriptTag.value = null;\n\t\tconst el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (el) document.head.removeChild(el);\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnUnmounted(unload);\n\treturn {\n\t\tscriptTag,\n\t\tload,\n\t\tunload\n\t};\n}\n//#endregion\n//#region useScrollLock/index.ts\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!parent || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault) e.preventDefault();\n\treturn false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\n/**\n* Lock scrolling of the element.\n*\n* @see https://vueuse.org/useScrollLock\n* @param element\n*/\nfunction useScrollLock(element, initialState = false) {\n\tconst isLocked = shallowRef(initialState);\n\tlet stopTouchMoveListener = null;\n\tlet initialOverflow = \"\";\n\twatch(toRef(element), (el) => {\n\t\tconst target = resolveElement(toValue(el));\n\t\tif (target) {\n\t\t\tconst ele = target;\n\t\t\tif (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);\n\t\t\tif (ele.style.overflow !== \"hidden\") initialOverflow = ele.style.overflow;\n\t\t\tif (ele.style.overflow === \"hidden\") return isLocked.value = true;\n\t\t\tif (isLocked.value) return ele.style.overflow = \"hidden\";\n\t\t}\n\t}, { immediate: true });\n\tconst lock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(el, \"touchmove\", (e) => {\n\t\t\tpreventDefault(e);\n\t\t}, { passive: false });\n\t\tel.style.overflow = \"hidden\";\n\t\tisLocked.value = true;\n\t};\n\tconst unlock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || !isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();\n\t\tel.style.overflow = initialOverflow;\n\t\telInitialOverflow.delete(el);\n\t\tisLocked.value = false;\n\t};\n\ttryOnScopeDispose(unlock);\n\treturn computed({\n\t\tget() {\n\t\t\treturn isLocked.value;\n\t\t},\n\t\tset(v) {\n\t\t\tif (v) lock();\n\t\t\telse unlock();\n\t\t}\n\t});\n}\n//#endregion\n//#region useSessionStorage/index.ts\n/**\n* Reactive SessionStorage.\n*\n* @see https://vueuse.org/useSessionStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useSessionStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.sessionStorage, options);\n}\n//#endregion\n//#region useShare/index.ts\n/**\n* Reactive Web Share API.\n*\n* @see https://vueuse.org/useShare\n* @param shareOptions\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useShare(shareOptions = {}, options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst _navigator = navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => _navigator && \"canShare\" in _navigator);\n\tconst share = async (overrideOptions = {}) => {\n\t\tif (isSupported.value) {\n\t\t\tconst data = {\n\t\t\t\t...toValue(shareOptions),\n\t\t\t\t...toValue(overrideOptions)\n\t\t\t};\n\t\t\tlet granted = false;\n\t\t\tif (_navigator.canShare) granted = _navigator.canShare(data);\n\t\t\tif (granted) return _navigator.share(data);\n\t\t}\n\t};\n\treturn {\n\t\tisSupported,\n\t\tshare\n\t};\n}\n//#endregion\n//#region useSorted/index.ts\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n\tconst [source] = args;\n\tlet compareFn = defaultCompare;\n\tlet options = {};\n\tif (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tvar _options$compareFn;\n\t\toptions = args[1];\n\t\tcompareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;\n\t} else {\n\t\tvar _args$;\n\t\tcompareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;\n\t}\n\telse if (args.length > 2) {\n\t\tvar _args$2, _args$3;\n\t\tcompareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;\n\t\toptions = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};\n\t}\n\tconst { dirty = false, sortFn = defaultSortFn } = options;\n\tif (!dirty) return computed(() => sortFn([...toValue(source)], compareFn));\n\twatchEffect(() => {\n\t\tconst result = sortFn(toValue(source), compareFn);\n\t\tif (isRef(source)) source.value = result;\n\t\telse source.splice(0, source.length, ...result);\n\t});\n\treturn source;\n}\n//#endregion\n//#region useSpeechRecognition/index.ts\n/**\n* Reactive SpeechRecognition.\n*\n* @see https://vueuse.org/useSpeechRecognition\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition\n* @param options\n*/\nfunction useSpeechRecognition(options = {}) {\n\tconst { interimResults = true, continuous = true, maxAlternatives = 1, window = defaultWindow } = options;\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst isListening = shallowRef(false);\n\tconst isFinal = shallowRef(false);\n\tconst result = shallowRef(\"\");\n\tconst confidence = shallowRef(0);\n\tconst error = shallowRef(void 0);\n\tlet recognition;\n\tconst start = () => {\n\t\tisListening.value = true;\n\t};\n\tconst stop = () => {\n\t\tisListening.value = false;\n\t};\n\tconst toggle = (value = !isListening.value) => {\n\t\tif (value) start();\n\t\telse stop();\n\t};\n\tconst SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => SpeechRecognition);\n\tif (isSupported.value) {\n\t\trecognition = new SpeechRecognition();\n\t\trecognition.continuous = continuous;\n\t\trecognition.interimResults = interimResults;\n\t\trecognition.lang = toValue(lang);\n\t\trecognition.maxAlternatives = maxAlternatives;\n\t\trecognition.onstart = () => {\n\t\t\tisListening.value = true;\n\t\t\tisFinal.value = false;\n\t\t};\n\t\twatch(lang, (lang) => {\n\t\t\tif (recognition && !isListening.value) recognition.lang = lang;\n\t\t});\n\t\trecognition.onresult = (event) => {\n\t\t\tconst currentResult = event.results[event.resultIndex];\n\t\t\tconst { transcript, confidence: alternativeConfidence } = currentResult[0];\n\t\t\tisFinal.value = currentResult.isFinal;\n\t\t\tresult.value = transcript;\n\t\t\tconfidence.value = alternativeConfidence;\n\t\t\terror.value = void 0;\n\t\t};\n\t\trecognition.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\trecognition.onend = () => {\n\t\t\tisListening.value = false;\n\t\t\trecognition.lang = toValue(lang);\n\t\t};\n\t\twatch(isListening, (newValue, oldValue) => {\n\t\t\tif (newValue === oldValue) return;\n\t\t\ttry {\n\t\t\t\tif (newValue) recognition.start();\n\t\t\t\telse recognition.stop();\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisListening,\n\t\tisFinal: shallowReadonly(isFinal),\n\t\trecognition,\n\t\tresult: shallowReadonly(result),\n\t\tconfidence: shallowReadonly(confidence),\n\t\terror,\n\t\ttoggle,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useSpeechSynthesis/index.ts\n/**\n* Reactive SpeechSynthesis.\n*\n* @see https://vueuse.org/useSpeechSynthesis\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis\n*/\nfunction useSpeechSynthesis(text, options = {}) {\n\tconst { pitch = 1, rate = 1, volume = 1, window = defaultWindow, onBoundary } = options;\n\tconst synth = window && window.speechSynthesis;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => synth);\n\tconst isPlaying = shallowRef(false);\n\tconst status = shallowRef(\"init\");\n\tconst spokenText = toRef(text || \"\");\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst error = shallowRef(void 0);\n\tconst toggle = (value = !isPlaying.value) => {\n\t\tisPlaying.value = value;\n\t};\n\tconst bindEventsForUtterance = (utterance) => {\n\t\tutterance.lang = toValue(lang);\n\t\tutterance.voice = toValue(options.voice) || null;\n\t\tutterance.pitch = toValue(pitch);\n\t\tutterance.rate = toValue(rate);\n\t\tutterance.volume = toValue(volume);\n\t\tutterance.onstart = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onpause = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"pause\";\n\t\t};\n\t\tutterance.onresume = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onend = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"end\";\n\t\t};\n\t\tutterance.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\tutterance.onboundary = (event) => {\n\t\t\tonBoundary === null || onBoundary === void 0 || onBoundary(event);\n\t\t};\n\t};\n\tconst utterance = computed(() => {\n\t\tisPlaying.value = false;\n\t\tstatus.value = \"init\";\n\t\tconst newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n\t\tbindEventsForUtterance(newUtterance);\n\t\treturn newUtterance;\n\t});\n\tconst speak = () => {\n\t\tsynth.cancel();\n\t\tif (utterance) synth.speak(utterance.value);\n\t};\n\tconst stop = () => {\n\t\tsynth.cancel();\n\t\tisPlaying.value = false;\n\t};\n\tif (isSupported.value) {\n\t\tbindEventsForUtterance(utterance.value);\n\t\twatch(lang, (lang) => {\n\t\t\tif (utterance.value && !isPlaying.value) utterance.value.lang = lang;\n\t\t});\n\t\tif (options.voice) watch(options.voice, () => {\n\t\t\tsynth.cancel();\n\t\t});\n\t\twatch(isPlaying, () => {\n\t\t\tif (isPlaying.value) synth.resume();\n\t\t\telse synth.pause();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tisPlaying.value = false;\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisPlaying,\n\t\tstatus,\n\t\tutterance,\n\t\terror,\n\t\tstop,\n\t\ttoggle,\n\t\tspeak\n\t};\n}\n//#endregion\n//#region useStepper/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useStepper(steps, initialStep) {\n\tconst stepsRef = ref(steps);\n\tconst stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n\tconst index = ref(stepNames.value.indexOf(initialStep !== null && initialStep !== void 0 ? initialStep : stepNames.value[0]));\n\tconst current = computed(() => at(index.value));\n\tconst isFirst = computed(() => index.value === 0);\n\tconst isLast = computed(() => index.value === stepNames.value.length - 1);\n\tconst next = computed(() => stepNames.value[index.value + 1]);\n\tconst previous = computed(() => stepNames.value[index.value - 1]);\n\tfunction at(index) {\n\t\tif (Array.isArray(stepsRef.value)) return stepsRef.value[index];\n\t\treturn stepsRef.value[stepNames.value[index]];\n\t}\n\tfunction get(step) {\n\t\tif (!stepNames.value.includes(step)) return;\n\t\treturn at(stepNames.value.indexOf(step));\n\t}\n\tfunction goTo(step) {\n\t\tif (stepNames.value.includes(step)) index.value = stepNames.value.indexOf(step);\n\t}\n\tfunction goToNext() {\n\t\tif (isLast.value) return;\n\t\tindex.value++;\n\t}\n\tfunction goToPrevious() {\n\t\tif (isFirst.value) return;\n\t\tindex.value--;\n\t}\n\tfunction goBackTo(step) {\n\t\tif (isAfter(step)) goTo(step);\n\t}\n\tfunction isNext(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value + 1;\n\t}\n\tfunction isPrevious(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value - 1;\n\t}\n\tfunction isCurrent(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value;\n\t}\n\tfunction isBefore(step) {\n\t\treturn index.value < stepNames.value.indexOf(step);\n\t}\n\tfunction isAfter(step) {\n\t\treturn index.value > stepNames.value.indexOf(step);\n\t}\n\treturn {\n\t\tsteps: stepsRef,\n\t\tstepNames,\n\t\tindex,\n\t\tcurrent,\n\t\tnext,\n\t\tprevious,\n\t\tisFirst,\n\t\tisLast,\n\t\tat,\n\t\tget,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoBackTo,\n\t\tisNext,\n\t\tisPrevious,\n\t\tisCurrent,\n\t\tisBefore,\n\t\tisAfter\n\t};\n}\n//#endregion\n//#region useStorageAsync/index.ts\n/**\n* Reactive Storage with async support.\n*\n* @see https://vueuse.org/useStorageAsync\n* @param key\n* @param initialValue\n* @param storage\n* @param options\n*/\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, onReady } = options;\n\tconst rawInit = toValue(initialValue);\n\tconst type = guessSerializerType(rawInit);\n\tconst data = (shallow ? shallowRef : ref)(toValue(initialValue));\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorageAsync\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tasync function read(event) {\n\t\tif (!storage || event && event.key !== key) return;\n\t\ttry {\n\t\t\tconst rawValue = event ? event.newValue : await storage.getItem(key);\n\t\t\tif (rawValue == null) {\n\t\t\t\tdata.value = rawInit;\n\t\t\t\tif (writeDefaults && rawInit !== null) await storage.setItem(key, await serializer.write(rawInit));\n\t\t\t} else if (mergeDefaults) {\n\t\t\t\tconst value = await serializer.read(rawValue);\n\t\t\t\tif (typeof mergeDefaults === \"function\") data.value = mergeDefaults(value, rawInit);\n\t\t\t\telse if (type === \"object\" && !Array.isArray(value)) data.value = {\n\t\t\t\t\t...rawInit,\n\t\t\t\t\t...value\n\t\t\t\t};\n\t\t\t\telse data.value = value;\n\t\t\t} else data.value = await serializer.read(rawValue);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tconst promise = new Promise((resolve) => {\n\t\tread().then(() => {\n\t\t\tonReady === null || onReady === void 0 || onReady(data.value);\n\t\t\tresolve(data);\n\t\t});\n\t});\n\tif (window && listenToStorageChanges) useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)), { passive: true });\n\tif (storage) watchWithFilter(data, async () => {\n\t\ttry {\n\t\t\tif (data.value == null) await storage.removeItem(key);\n\t\t\telse await storage.setItem(key, await serializer.write(data.value));\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\tObject.assign(data, {\n\t\tthen: promise.then.bind(promise),\n\t\tcatch: promise.catch.bind(promise)\n\t});\n\treturn data;\n}\n//#endregion\n//#region useStyleTag/index.ts\nlet _id = 0;\nconst _refCount = /* @__PURE__ */ new WeakMap();\n/**\n* Inject <style> element in head.\n*\n* Overload: Omitted id\n*\n* @see https://vueuse.org/useStyleTag\n* @param css\n* @param options\n*/\nfunction useStyleTag(css, options = {}) {\n\tconst isLoaded = shallowRef(false);\n\tconst { document = defaultDocument, immediate = true, manual = false, id = `vueuse_styletag_${++_id}` } = options;\n\tconst cssRef = shallowRef(css);\n\tlet stop = () => {};\n\tconst load = () => {\n\t\tvar _refCount$get;\n\t\tif (!document) return;\n\t\tconst el = document.getElementById(id) || document.createElement(\"style\");\n\t\tif (!el.isConnected) {\n\t\t\tel.id = id;\n\t\t\tif (options.nonce) el.nonce = options.nonce;\n\t\t\tif (options.media) el.media = options.media;\n\t\t\tdocument.head.appendChild(el);\n\t\t}\n\t\tif (isLoaded.value) return;\n\t\t_refCount.set(el, ((_refCount$get = _refCount.get(el)) !== null && _refCount$get !== void 0 ? _refCount$get : 0) + 1);\n\t\tstop = watch(cssRef, (value) => {\n\t\t\tel.textContent = value;\n\t\t}, { immediate: true });\n\t\tisLoaded.value = true;\n\t};\n\tconst unload = () => {\n\t\tif (!document || !isLoaded.value) return;\n\t\tstop();\n\t\tconst el = document.getElementById(id);\n\t\tif (el) {\n\t\t\tvar _refCount$get2;\n\t\t\tconst count = ((_refCount$get2 = _refCount.get(el)) !== null && _refCount$get2 !== void 0 ? _refCount$get2 : 1) - 1;\n\t\t\tif (count <= 0) {\n\t\t\t\t_refCount.delete(el);\n\t\t\t\tdocument.head.removeChild(el);\n\t\t\t} else _refCount.set(el, count);\n\t\t}\n\t\tisLoaded.value = false;\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnScopeDispose(unload);\n\treturn {\n\t\tid,\n\t\tcss: cssRef,\n\t\tunload,\n\t\tload,\n\t\tisLoaded: shallowReadonly(isLoaded)\n\t};\n}\n//#endregion\n//#region useSwipe/index.ts\n/**\n* Reactive swipe detection.\n*\n* @see https://vueuse.org/useSwipe\n* @param target\n* @param options\n*/\nfunction useSwipe(target, options = {}) {\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;\n\tconst coordsStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst coordsEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst diffX = computed(() => coordsStart.x - coordsEnd.x);\n\tconst diffY = computed(() => coordsStart.y - coordsEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? \"left\" : \"right\";\n\t\telse return diffY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n\tconst updateCoordsStart = (x, y) => {\n\t\tcoordsStart.x = x;\n\t\tcoordsStart.y = y;\n\t};\n\tconst updateCoordsEnd = (x, y) => {\n\t\tcoordsEnd.x = x;\n\t\tcoordsEnd.y = y;\n\t};\n\tconst listenerOptions = {\n\t\tpassive,\n\t\tcapture: !passive\n\t};\n\tconst onTouchEnd = (e) => {\n\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\tisSwiping.value = false;\n\t};\n\tconst stops = [\n\t\tuseEventListener(target, \"touchstart\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsStart(x, y);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"touchmove\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tif (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n\t];\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping,\n\t\tdirection,\n\t\tcoordsStart,\n\t\tcoordsEnd,\n\t\tlengthX: diffX,\n\t\tlengthY: diffY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTemplateRefsList/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTemplateRefsList() {\n\tconst refs = ref([]);\n\trefs.value.set = (el) => {\n\t\tif (el) refs.value.push(el);\n\t};\n\tonBeforeUpdate(() => {\n\t\trefs.value.length = 0;\n\t});\n\treturn refs;\n}\n//#endregion\n//#region useTextDirection/index.ts\n/**\n* Reactive dir of the element's text.\n*\n* @see https://vueuse.org/useTextDirection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextDirection(options = {}) {\n\tconst { document = defaultDocument, selector = \"html\", observe = false, initialValue = \"ltr\" } = options;\n\tfunction getValue() {\n\t\tvar _ref, _document$querySelect;\n\t\treturn (_ref = document === null || document === void 0 || (_document$querySelect = document.querySelector(selector)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute(\"dir\")) !== null && _ref !== void 0 ? _ref : initialValue;\n\t}\n\tconst dir = shallowRef(getValue());\n\ttryOnMounted(() => dir.value = getValue());\n\tif (observe && document) useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n\treturn computed({\n\t\tget() {\n\t\t\treturn dir.value;\n\t\t},\n\t\tset(v) {\n\t\t\tvar _document$querySelect2, _document$querySelect3;\n\t\t\tdir.value = v;\n\t\t\tif (!document) return;\n\t\t\tif (dir.value) (_document$querySelect2 = document.querySelector(selector)) === null || _document$querySelect2 === void 0 || _document$querySelect2.setAttribute(\"dir\", dir.value);\n\t\t\telse (_document$querySelect3 = document.querySelector(selector)) === null || _document$querySelect3 === void 0 || _document$querySelect3.removeAttribute(\"dir\");\n\t\t}\n\t});\n}\n//#endregion\n//#region useTextSelection/index.ts\nfunction getRangesFromSelection(selection) {\n\tvar _selection$rangeCount;\n\tconst rangeCount = (_selection$rangeCount = selection.rangeCount) !== null && _selection$rangeCount !== void 0 ? _selection$rangeCount : 0;\n\treturn Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\n/**\n* Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).\n*\n* @see https://vueuse.org/useTextSelection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextSelection(options = {}) {\n\tvar _window$getSelection;\n\tconst { window = defaultWindow } = options;\n\tconst selection = shallowRef((_window$getSelection = window === null || window === void 0 ? void 0 : window.getSelection()) !== null && _window$getSelection !== void 0 ? _window$getSelection : null);\n\tconst text = computed(() => {\n\t\tvar _selection$value$toSt, _selection$value;\n\t\treturn (_selection$value$toSt = (_selection$value = selection.value) === null || _selection$value === void 0 ? void 0 : _selection$value.toString()) !== null && _selection$value$toSt !== void 0 ? _selection$value$toSt : \"\";\n\t});\n\tconst ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n\tconst rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n\tfunction onSelectionChange() {\n\t\tselection.value = null;\n\t\tif (window) selection.value = window.getSelection();\n\t}\n\tif (window) useEventListener(window.document, \"selectionchange\", onSelectionChange, { passive: true });\n\treturn {\n\t\ttext,\n\t\trects,\n\t\tranges,\n\t\tselection\n\t};\n}\n//#endregion\n//#region useTextareaAutosize/index.ts\n/**\n* Call window.requestAnimationFrame(), if not available, just call the function\n*\n* @param window\n* @param fn\n*/\nfunction tryRequestAnimationFrame(window = defaultWindow, fn) {\n\tif (window && typeof window.requestAnimationFrame === \"function\") window.requestAnimationFrame(fn);\n\telse fn();\n}\nfunction useTextareaAutosize(options = {}) {\n\tvar _options$input, _options$styleProp;\n\tconst { window = defaultWindow } = options;\n\tconst textarea = toRef(options === null || options === void 0 ? void 0 : options.element);\n\tconst input = toRef((_options$input = options === null || options === void 0 ? void 0 : options.input) !== null && _options$input !== void 0 ? _options$input : \"\");\n\tconst styleProp = (_options$styleProp = options === null || options === void 0 ? void 0 : options.styleProp) !== null && _options$styleProp !== void 0 ? _options$styleProp : \"height\";\n\tconst textareaScrollHeight = shallowRef(1);\n\tconst textareaOldWidth = shallowRef(0);\n\tfunction triggerResize() {\n\t\tvar _textarea$value;\n\t\tif (!textarea.value) return;\n\t\tlet height = \"\";\n\t\tconst maxHeight = options === null || options === void 0 ? void 0 : options.maxHeight;\n\t\ttextarea.value.style[styleProp] = \"1px\";\n\t\ttextareaScrollHeight.value = (_textarea$value = textarea.value) === null || _textarea$value === void 0 ? void 0 : _textarea$value.scrollHeight;\n\t\tconst _styleTarget = toValue(options === null || options === void 0 ? void 0 : options.styleTarget);\n\t\tconst styleHeight = maxHeight != null ? `${Math.min(textareaScrollHeight.value, maxHeight)}px` : `${textareaScrollHeight.value}px`;\n\t\tif (_styleTarget) _styleTarget.style[styleProp] = styleHeight;\n\t\telse height = styleHeight;\n\t\ttextarea.value.style[styleProp] = height;\n\t}\n\twatch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n\twatch(textareaScrollHeight, () => {\n\t\tvar _options$onResize;\n\t\treturn options === null || options === void 0 || (_options$onResize = options.onResize) === null || _options$onResize === void 0 ? void 0 : _options$onResize.call(options);\n\t});\n\tuseResizeObserver(textarea, ([{ contentRect }]) => {\n\t\tif (textareaOldWidth.value === contentRect.width) return;\n\t\ttryRequestAnimationFrame(window, () => {\n\t\t\ttextareaOldWidth.value = contentRect.width;\n\t\t\ttriggerResize();\n\t\t});\n\t});\n\tif (options === null || options === void 0 ? void 0 : options.watch) watch(options.watch, triggerResize, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\treturn {\n\t\ttextarea,\n\t\tinput,\n\t\ttriggerResize\n\t};\n}\n//#endregion\n//#region useThrottledRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.\n*\n* @see https://vueuse.org/useThrottledRefHistory\n* @param source\n* @param options\n*/\nfunction useThrottledRefHistory(source, options = {}) {\n\tconst { throttle = 200, trailing = true } = options;\n\tconst filter = throttleFilter(throttle, trailing);\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useTimeAgo/index.ts\nconst DEFAULT_UNITS = [\n\t{\n\t\tmax: 6e4,\n\t\tvalue: 1e3,\n\t\tname: \"second\"\n\t},\n\t{\n\t\tmax: 276e4,\n\t\tvalue: 6e4,\n\t\tname: \"minute\"\n\t},\n\t{\n\t\tmax: 72e6,\n\t\tvalue: 36e5,\n\t\tname: \"hour\"\n\t},\n\t{\n\t\tmax: 5184e5,\n\t\tvalue: 864e5,\n\t\tname: \"day\"\n\t},\n\t{\n\t\tmax: 24192e5,\n\t\tvalue: 6048e5,\n\t\tname: \"week\"\n\t},\n\t{\n\t\tmax: 28512e6,\n\t\tvalue: 2592e6,\n\t\tname: \"month\"\n\t},\n\t{\n\t\tmax: Number.POSITIVE_INFINITY,\n\t\tvalue: 31536e6,\n\t\tname: \"year\"\n\t}\n];\nconst DEFAULT_MESSAGES = {\n\tjustNow: \"just now\",\n\tpast: (n) => /\\d/.test(n) ? `${n} ago` : n,\n\tfuture: (n) => /\\d/.test(n) ? `in ${n}` : n,\n\tmonth: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n\tyear: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n\tday: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n\tweek: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n\thour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n\tminute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n\tsecond: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n\tinvalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n\treturn date.toISOString().slice(0, 10);\n}\nfunction getDefaultScheduler$4(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\n/**\n* Reactive time ago formatter.\n*\n* @see https://vueuse.org/useTimeAgo\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTimeAgo(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$4(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n\tif (exposeControls) return {\n\t\ttimeAgo,\n\t\t...controls\n\t};\n\telse return timeAgo;\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n\tconst { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = \"round\" } = options;\n\tconst roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n\tconst diff = +now - +from;\n\tconst absDiff = Math.abs(diff);\n\tfunction getValue(diff, unit) {\n\t\treturn roundFn(Math.abs(diff) / unit.value);\n\t}\n\tfunction format(diff, unit) {\n\t\tconst val = getValue(diff, unit);\n\t\tconst past = diff > 0;\n\t\tconst str = applyFormat(unit.name, val, past);\n\t\treturn applyFormat(past ? \"past\" : \"future\", str, past);\n\t}\n\tfunction applyFormat(name, val, isPast) {\n\t\tconst formatter = messages[name];\n\t\tif (typeof formatter === \"function\") return formatter(val, isPast);\n\t\treturn formatter.replace(\"{0}\", val.toString());\n\t}\n\tif (absDiff < 6e4 && !showSecond) return messages.justNow;\n\tif (typeof max === \"number\" && absDiff > max) return fullDateFormatter(new Date(from));\n\tif (typeof max === \"string\") {\n\t\tvar _units$find;\n\t\tconst unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;\n\t\tif (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));\n\t}\n\tfor (const [idx, unit] of units.entries()) {\n\t\tif (getValue(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);\n\t\tif (absDiff < unit.max) return format(diff, unit);\n\t}\n\treturn messages.invalid;\n}\n//#endregion\n//#region useTimeAgoIntl/index.ts\nconst UNITS = [\n\t{\n\t\tname: \"year\",\n\t\tms: 31536e6\n\t},\n\t{\n\t\tname: \"month\",\n\t\tms: 2592e6\n\t},\n\t{\n\t\tname: \"week\",\n\t\tms: 6048e5\n\t},\n\t{\n\t\tname: \"day\",\n\t\tms: 864e5\n\t},\n\t{\n\t\tname: \"hour\",\n\t\tms: 36e5\n\t},\n\t{\n\t\tname: \"minute\",\n\t\tms: 6e4\n\t},\n\t{\n\t\tname: \"second\",\n\t\tms: 1e3\n\t}\n];\nfunction getDefaultScheduler$3(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\nfunction useTimeAgoIntl(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$3(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst result = computed(() => getTimeAgoIntlResult(new Date(toValue(time)), options, toValue(now)));\n\tconst parts = computed(() => result.value.parts);\n\tconst timeAgoIntl = computed(() => formatTimeAgoIntlParts(parts.value, {\n\t\t...options,\n\t\tlocale: result.value.resolvedLocale\n\t}));\n\treturn exposeControls ? {\n\t\ttimeAgoIntl,\n\t\tparts,\n\t\t...controls\n\t} : timeAgoIntl;\n}\n/**\n* Non-reactive version of useTimeAgoIntl\n*/\nfunction formatTimeAgoIntl(from, options = {}, now = Date.now()) {\n\tconst { parts, resolvedLocale } = getTimeAgoIntlResult(from, options, now);\n\treturn formatTimeAgoIntlParts(parts, {\n\t\t...options,\n\t\tlocale: resolvedLocale\n\t});\n}\n/**\n* Get parts from `Intl.RelativeTimeFormat.formatToParts`.\n*/\nfunction getTimeAgoIntlResult(from, options = {}, now = Date.now()) {\n\tvar _options$units;\n\tconst { locale, relativeTimeFormatOptions = { numeric: \"auto\" } } = options;\n\tconst rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);\n\tconst { locale: resolvedLocale } = rtf.resolvedOptions();\n\tconst diff = +from - +now;\n\tconst absDiff = Math.abs(diff);\n\tconst units = (_options$units = options.units) !== null && _options$units !== void 0 ? _options$units : UNITS;\n\tfor (const { name, ms } of units) if (absDiff >= ms) return {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(Math.round(diff / ms), name)\n\t};\n\treturn {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(0, units[units.length - 1].name)\n\t};\n}\n/**\n* Format parts into a string\n*/\nfunction formatTimeAgoIntlParts(parts, options = {}) {\n\tconst { insertSpace = true, joinParts, locale } = options;\n\tif (typeof joinParts === \"function\") return joinParts(parts, locale);\n\tif (!insertSpace) return parts.map((part) => part.value).join(\"\");\n\treturn parts.map((part) => part.value.trim()).join(\" \");\n}\n//#endregion\n//#region useTimeoutPoll/index.ts\nfunction useTimeoutPoll(fn, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst { start } = useTimeoutFn(loop, interval, { immediate });\n\tconst isActive = shallowRef(false);\n\tasync function loop() {\n\t\tif (!isActive.value) return;\n\t\tawait fn();\n\t\tstart();\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value) {\n\t\t\tisActive.value = true;\n\t\t\tif (immediateCallback) fn();\n\t\t\tstart();\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tif (immediate && isClient) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useTimestamp/index.ts\nfunction getDefaultScheduler$2(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\nfunction useTimestamp(options = {}) {\n\tconst { controls: exposeControls = false, offset = 0, scheduler = getDefaultScheduler$2(options), callback } = options;\n\tconst ts = shallowRef(timestamp() + offset);\n\tconst update = () => ts.value = timestamp() + offset;\n\tconst controls = scheduler(callback ? () => {\n\t\tupdate();\n\t\tcallback(ts.value);\n\t} : update);\n\tif (exposeControls) return {\n\t\ttimestamp: ts,\n\t\t...controls\n\t};\n\telse return ts;\n}\n//#endregion\n//#region useTitle/index.ts\nfunction useTitle(newTitle = null, options = {}) {\n\tvar _document$title, _ref;\n\tconst { document = defaultDocument, restoreOnUnmount = (t) => t } = options;\n\tconst originalTitle = (_document$title = document === null || document === void 0 ? void 0 : document.title) !== null && _document$title !== void 0 ? _document$title : \"\";\n\tconst title = toRef((_ref = newTitle !== null && newTitle !== void 0 ? newTitle : document === null || document === void 0 ? void 0 : document.title) !== null && _ref !== void 0 ? _ref : null);\n\tconst isReadonly = !!(newTitle && typeof newTitle === \"function\");\n\tfunction format(t) {\n\t\tif (!(\"titleTemplate\" in options)) return t;\n\t\tconst template = options.titleTemplate || \"%s\";\n\t\treturn typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n\t}\n\twatch(title, (newValue, oldValue) => {\n\t\tif (newValue !== oldValue && document) document.title = format(newValue !== null && newValue !== void 0 ? newValue : \"\");\n\t}, { immediate: true });\n\tif (options.observe && !options.titleTemplate && document && !isReadonly) {\n\t\tvar _document$head;\n\t\tuseMutationObserver((_document$head = document.head) === null || _document$head === void 0 ? void 0 : _document$head.querySelector(\"title\"), () => {\n\t\t\tif (document && document.title !== title.value) title.value = format(document.title);\n\t\t}, { childList: true });\n\t}\n\ttryOnScopeDispose(() => {\n\t\tif (restoreOnUnmount) {\n\t\t\tconst restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n\t\t\tif (restoredTitle != null && document) document.title = restoredTitle;\n\t\t}\n\t});\n\treturn title;\n}\n/**\n* Common transitions\n*\n* @see https://easings.net\n*/\nconst TransitionPresets = /* #__PURE__ */ Object.assign({}, { linear: identity }, {\n\teaseInSine: [\n\t\t.12,\n\t\t0,\n\t\t.39,\n\t\t0\n\t],\n\teaseOutSine: [\n\t\t.61,\n\t\t1,\n\t\t.88,\n\t\t1\n\t],\n\teaseInOutSine: [\n\t\t.37,\n\t\t0,\n\t\t.63,\n\t\t1\n\t],\n\teaseInQuad: [\n\t\t.11,\n\t\t0,\n\t\t.5,\n\t\t0\n\t],\n\teaseOutQuad: [\n\t\t.5,\n\t\t1,\n\t\t.89,\n\t\t1\n\t],\n\teaseInOutQuad: [\n\t\t.45,\n\t\t0,\n\t\t.55,\n\t\t1\n\t],\n\teaseInCubic: [\n\t\t.32,\n\t\t0,\n\t\t.67,\n\t\t0\n\t],\n\teaseOutCubic: [\n\t\t.33,\n\t\t1,\n\t\t.68,\n\t\t1\n\t],\n\teaseInOutCubic: [\n\t\t.65,\n\t\t0,\n\t\t.35,\n\t\t1\n\t],\n\teaseInQuart: [\n\t\t.5,\n\t\t0,\n\t\t.75,\n\t\t0\n\t],\n\teaseOutQuart: [\n\t\t.25,\n\t\t1,\n\t\t.5,\n\t\t1\n\t],\n\teaseInOutQuart: [\n\t\t.76,\n\t\t0,\n\t\t.24,\n\t\t1\n\t],\n\teaseInQuint: [\n\t\t.64,\n\t\t0,\n\t\t.78,\n\t\t0\n\t],\n\teaseOutQuint: [\n\t\t.22,\n\t\t1,\n\t\t.36,\n\t\t1\n\t],\n\teaseInOutQuint: [\n\t\t.83,\n\t\t0,\n\t\t.17,\n\t\t1\n\t],\n\teaseInExpo: [\n\t\t.7,\n\t\t0,\n\t\t.84,\n\t\t0\n\t],\n\teaseOutExpo: [\n\t\t.16,\n\t\t1,\n\t\t.3,\n\t\t1\n\t],\n\teaseInOutExpo: [\n\t\t.87,\n\t\t0,\n\t\t.13,\n\t\t1\n\t],\n\teaseInCirc: [\n\t\t.55,\n\t\t0,\n\t\t1,\n\t\t.45\n\t],\n\teaseOutCirc: [\n\t\t0,\n\t\t.55,\n\t\t.45,\n\t\t1\n\t],\n\teaseInOutCirc: [\n\t\t.85,\n\t\t0,\n\t\t.15,\n\t\t1\n\t],\n\teaseInBack: [\n\t\t.36,\n\t\t0,\n\t\t.66,\n\t\t-.56\n\t],\n\teaseOutBack: [\n\t\t.34,\n\t\t1.56,\n\t\t.64,\n\t\t1\n\t],\n\teaseInOutBack: [\n\t\t.68,\n\t\t-.6,\n\t\t.32,\n\t\t1.6\n\t]\n});\n/**\n* Create an easing function from cubic bezier points.\n*/\nfunction createEasingFunction([p0, p1, p2, p3]) {\n\tconst a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n\tconst b = (a1, a2) => 3 * a2 - 6 * a1;\n\tconst c = (a1) => 3 * a1;\n\tconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n\tconst getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n\tconst getTforX = (x) => {\n\t\tlet aGuessT = x;\n\t\tfor (let i = 0; i < 4; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, p0, p2);\n\t\t\tif (currentSlope === 0) return aGuessT;\n\t\t\tconst currentX = calcBezier(aGuessT, p0, p2) - x;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\t\treturn aGuessT;\n\t};\n\treturn (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n\treturn a + alpha * (b - a);\n}\nfunction defaultInterpolation(a, b, t) {\n\tconst aVal = toValue(a);\n\tconst bVal = toValue(b);\n\tif (typeof aVal === \"number\" && typeof bVal === \"number\") return lerp(aVal, bVal, t);\n\tif (Array.isArray(aVal) && Array.isArray(bVal)) return aVal.map((v, i) => lerp(v, toValue(bVal[i]), t));\n\tthrow new TypeError(\"Unknown transition type, specify an interpolation function.\");\n}\nfunction normalizeEasing(easing) {\n\tvar _toValue;\n\treturn typeof easing === \"function\" ? easing : (_toValue = toValue(easing)) !== null && _toValue !== void 0 ? _toValue : identity;\n}\n/**\n* Transition from one value to another.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction transition(source, from, to, options = {}) {\n\tvar _toValue2;\n\tconst { window = defaultWindow } = options;\n\tconst fromVal = toValue(from);\n\tconst toVal = toValue(to);\n\tconst duration = (_toValue2 = toValue(options.duration)) !== null && _toValue2 !== void 0 ? _toValue2 : 1e3;\n\tconst startedAt = Date.now();\n\tconst endAt = Date.now() + duration;\n\tconst interpolation = typeof options.interpolation === \"function\" ? options.interpolation : defaultInterpolation;\n\tconst trans = typeof options.easing !== \"undefined\" ? normalizeEasing(options.easing) : normalizeEasing(options.transition);\n\tconst ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n\treturn new Promise((resolve) => {\n\t\tsource.value = fromVal;\n\t\tconst tick = () => {\n\t\t\tvar _options$abort;\n\t\t\tif ((_options$abort = options.abort) === null || _options$abort === void 0 ? void 0 : _options$abort.call(options)) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst now = Date.now();\n\t\t\tconst alpha = ease((now - startedAt) / duration);\n\t\t\tsource.value = interpolation(fromVal, toVal, alpha);\n\t\t\tif (now < endAt) window === null || window === void 0 || window.requestAnimationFrame(tick);\n\t\t\telse {\n\t\t\t\tsource.value = toVal;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\t\ttick();\n\t});\n}\n/**\n* Transition from one value to another.\n* @deprecated The `executeTransition` function is deprecated, use `transition` instead.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction executeTransition(source, from, to, options = {}) {\n\treturn transition(source, from, to, options);\n}\n/**\n* Follow value with a transition.\n*\n* @see https://vueuse.org/useTransition\n* @param source\n* @param options\n*/\nfunction useTransition(source, options = {}) {\n\tlet currentId = 0;\n\tconst sourceVal = () => {\n\t\tconst v = toValue(source);\n\t\treturn typeof options.interpolation === \"undefined\" && Array.isArray(v) ? v.map(toValue) : v;\n\t};\n\tconst outputRef = shallowRef(sourceVal());\n\twatch(sourceVal, async (to) => {\n\t\tvar _options$onStarted, _options$onFinished;\n\t\tif (toValue(options.disabled)) return;\n\t\tconst id = ++currentId;\n\t\tif (options.delay) await promiseTimeout(toValue(options.delay));\n\t\tif (id !== currentId) return;\n\t\t(_options$onStarted = options.onStarted) === null || _options$onStarted === void 0 || _options$onStarted.call(options);\n\t\tawait transition(outputRef, outputRef.value, to, {\n\t\t\t...options,\n\t\t\tabort: () => {\n\t\t\t\tvar _options$abort2;\n\t\t\t\treturn id !== currentId || ((_options$abort2 = options.abort) === null || _options$abort2 === void 0 ? void 0 : _options$abort2.call(options));\n\t\t\t}\n\t\t});\n\t\t(_options$onFinished = options.onFinished) === null || _options$onFinished === void 0 || _options$onFinished.call(options);\n\t}, { deep: true });\n\twatch(() => toValue(options.disabled), (disabled) => {\n\t\tif (disabled) {\n\t\t\tcurrentId++;\n\t\t\toutputRef.value = sourceVal();\n\t\t}\n\t});\n\ttryOnScopeDispose(() => {\n\t\tcurrentId++;\n\t});\n\treturn computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n//#endregion\n//#region useUrlSearchParams/index.ts\n/**\n* Reactive URLSearchParams\n*\n* @see https://vueuse.org/useUrlSearchParams\n* @param mode\n* @param options\n*/\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n\tconst { initialValue = {}, removeNullishValues = true, removeFalsyValues = false, write: enableWrite = true, writeMode = \"replace\", window = defaultWindow, stringify = (params) => params.toString() } = options;\n\tif (!window) return reactive(initialValue);\n\tconst state = reactive({});\n\tfunction getRawParams() {\n\t\tif (mode === \"history\") return window.location.search || \"\";\n\t\telse if (mode === \"hash\") {\n\t\t\tconst hash = window.location.hash || \"\";\n\t\t\tconst index = hash.indexOf(\"?\");\n\t\t\treturn index > 0 ? hash.slice(index) : \"\";\n\t\t} else return (window.location.hash || \"\").replace(/^#/, \"\");\n\t}\n\tfunction constructQuery(params) {\n\t\tconst stringified = stringify(params);\n\t\tif (mode === \"history\") return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n\t\tif (mode === \"hash-params\") return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n\t\tconst hash = window.location.hash || \"#\";\n\t\tconst index = hash.indexOf(\"?\");\n\t\tif (index > 0) return `${window.location.search || \"\"}${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n\t\treturn `${window.location.search || \"\"}${hash}${stringified ? `?${stringified}` : \"\"}`;\n\t}\n\tfunction read() {\n\t\treturn new URLSearchParams(getRawParams());\n\t}\n\tfunction updateState(params) {\n\t\tconst unusedKeys = new Set(Object.keys(state));\n\t\tfor (const key of params.keys()) {\n\t\t\tconst paramsForKey = params.getAll(key);\n\t\t\tstate[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n\t\t\tunusedKeys.delete(key);\n\t\t}\n\t\tArray.from(unusedKeys).forEach((key) => delete state[key]);\n\t}\n\tconst { pause, resume } = watchPausable(state, () => {\n\t\tconst params = new URLSearchParams(\"\");\n\t\tObject.keys(state).forEach((key) => {\n\t\t\tconst mapEntry = state[key];\n\t\t\tif (Array.isArray(mapEntry)) mapEntry.forEach((value) => params.append(key, value));\n\t\t\telse if (removeNullishValues && mapEntry == null) params.delete(key);\n\t\t\telse if (removeFalsyValues && !mapEntry) params.delete(key);\n\t\t\telse params.set(key, mapEntry);\n\t\t});\n\t\twrite(params, false);\n\t}, { deep: true });\n\tfunction write(params, shouldUpdate, shouldWriteHistory = true) {\n\t\tpause();\n\t\tif (shouldUpdate) updateState(params);\n\t\tif (writeMode === \"replace\") window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\telse if (shouldWriteHistory) window.history.pushState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\tnextTick(() => resume());\n\t}\n\tfunction onChanged() {\n\t\tif (!enableWrite) return;\n\t\twrite(read(), true, false);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"popstate\", onChanged, listenerOptions);\n\tif (mode !== \"history\") useEventListener(window, \"hashchange\", onChanged, listenerOptions);\n\tconst initial = read();\n\tif (initial.keys().next().value) updateState(initial);\n\telse Object.assign(state, initialValue);\n\treturn state;\n}\n//#endregion\n//#region useUserMedia/index.ts\n/**\n* Reactive `mediaDevices.getUserMedia` streaming\n*\n* @see https://vueuse.org/useUserMedia\n* @param options\n*/\nfunction useUserMedia(options = {}) {\n\tvar _options$enabled, _options$autoSwitch;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst autoSwitch = shallowRef((_options$autoSwitch = options.autoSwitch) !== null && _options$autoSwitch !== void 0 ? _options$autoSwitch : true);\n\tconst constraints = ref(options.constraints);\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getUserMedia;\n\t});\n\tconst stream = shallowRef();\n\tfunction getDeviceOptions(type) {\n\t\tswitch (type) {\n\t\t\tcase \"video\":\n\t\t\t\tif (constraints.value) return constraints.value.video || false;\n\t\t\t\tbreak;\n\t\t\tcase \"audio\":\n\t\t\t\tif (constraints.value) return constraints.value.audio || false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tasync function _start() {\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getUserMedia({\n\t\t\tvideo: getDeviceOptions(\"video\"),\n\t\t\taudio: getDeviceOptions(\"audio\")\n\t\t});\n\t\treturn stream.value;\n\t}\n\tfunction _stop() {\n\t\tvar _stream$value;\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\tasync function restart() {\n\t\t_stop();\n\t\treturn await start();\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\twatch(constraints, () => {\n\t\tif (autoSwitch.value && stream.value) restart();\n\t}, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\trestart,\n\t\tconstraints,\n\t\tenabled,\n\t\tautoSwitch\n\t};\n}\n//#endregion\n//#region useVModel/index.ts\n/**\n* Shorthand for v-model binding, props + emit -> ref\n*\n* @see https://vueuse.org/useVModel\n* @param props\n* @param key (default 'modelValue')\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModel(props, key, emit, options = {}) {\n\tvar _vm$$emit, _vm$proxy;\n\tconst { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;\n\tconst vm = getCurrentInstance();\n\tconst _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));\n\tlet event = eventName;\n\tif (!key) key = \"modelValue\";\n\tevent = event || `update:${key.toString()}`;\n\tconst cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n\tconst getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n\tconst triggerEmit = (value) => {\n\t\tif (shouldEmit) {\n\t\t\tif (shouldEmit(value)) _emit(event, value);\n\t\t} else _emit(event, value);\n\t};\n\tif (passive) {\n\t\tconst proxy = ref(getValue());\n\t\tlet isUpdating = false;\n\t\twatch(() => props[key], (v) => {\n\t\t\tif (!isUpdating) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tproxy.value = cloneFn(v);\n\t\t\t\tnextTick(() => isUpdating = false);\n\t\t\t}\n\t\t});\n\t\twatch(proxy, (v) => {\n\t\t\tif (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);\n\t\t}, { deep });\n\t\treturn proxy;\n\t} else return computed({\n\t\tget() {\n\t\t\treturn getValue();\n\t\t},\n\t\tset(value) {\n\t\t\ttriggerEmit(value);\n\t\t}\n\t});\n}\n//#endregion\n//#region useVModels/index.ts\n/**\n* Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.\n*\n* @see https://vueuse.org/useVModels\n* @param props\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModels(props, emit, options = {}) {\n\tconst ret = {};\n\tfor (const key in props) ret[key] = useVModel(props, key, emit, options);\n\treturn ret;\n}\n//#endregion\n//#region useVibrate/index.ts\nfunction getDefaultScheduler$1(options = {}) {\n\tconst { interval = 0 } = options;\n\tif (interval === 0) return;\n\treturn (fn) => useIntervalFn(fn, interval, {\n\t\timmediate: false,\n\t\timmediateCallback: false\n\t});\n}\n/**\n* Reactive vibrate\n*\n* @see https://vueuse.org/useVibrate\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVibrate(options) {\n\tconst { pattern = [], scheduler = getDefaultScheduler$1(options), navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n\tconst patternRef = toRef(pattern);\n\tconst vibrate = (pattern = patternRef.value) => {\n\t\tif (isSupported.value) navigator.vibrate(pattern);\n\t};\n\tconst intervalControls = scheduler === null || scheduler === void 0 ? void 0 : scheduler(vibrate);\n\tconst stop = () => {\n\t\tif (isSupported.value) navigator.vibrate(0);\n\t\tintervalControls === null || intervalControls === void 0 || intervalControls.pause();\n\t};\n\treturn {\n\t\tisSupported,\n\t\tpattern,\n\t\tintervalControls,\n\t\tvibrate,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useVirtualList/index.ts\n/**\n* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.\n*/\nfunction useVirtualList(list, options) {\n\tconst { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n\treturn {\n\t\tlist: currentList,\n\t\tscrollTo,\n\t\tcontainerProps: {\n\t\t\tref: containerRef,\n\t\t\tonScroll: () => {\n\t\t\t\tcalculateRange();\n\t\t\t},\n\t\t\tstyle: containerStyle\n\t\t},\n\t\twrapperProps\n\t};\n}\nfunction useVirtualListResources(list) {\n\tconst containerRef = shallowRef(null);\n\tconst size = useElementSize(containerRef);\n\tconst currentList = ref([]);\n\tconst source = shallowRef(list);\n\treturn {\n\t\tstate: ref({\n\t\t\tstart: 0,\n\t\t\tend: 10\n\t\t}),\n\t\tsource,\n\t\tcurrentList,\n\t\tsize,\n\t\tcontainerRef\n\t};\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n\treturn (containerSize) => {\n\t\tif (typeof itemSize === \"number\") return Math.ceil(containerSize / itemSize);\n\t\tconst { start = 0 } = state.value;\n\t\tlet sum = 0;\n\t\tlet capacity = 0;\n\t\tfor (let i = start; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tcapacity = i;\n\t\t\tif (sum > containerSize) break;\n\t\t}\n\t\treturn capacity - start;\n\t};\n}\nfunction createGetOffset(source, itemSize) {\n\treturn (scrollDirection) => {\n\t\tif (typeof itemSize === \"number\") return Math.floor(scrollDirection / itemSize) + 1;\n\t\tlet sum = 0;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tif (sum >= scrollDirection) {\n\t\t\t\toffset = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn offset + 1;\n\t};\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n\treturn () => {\n\t\tconst element = containerRef.value;\n\t\tif (element) {\n\t\t\tconst offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n\t\t\tconst viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n\t\t\tconst from = offset - overscan;\n\t\t\tconst to = offset + viewCapacity + overscan;\n\t\t\tstate.value = {\n\t\t\t\tstart: from < 0 ? 0 : from,\n\t\t\t\tend: to > source.value.length ? source.value.length : to\n\t\t\t};\n\t\t\tcurrentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n\t\t\t\tdata: ele,\n\t\t\t\tindex: index + state.value.start\n\t\t\t}));\n\t\t}\n\t};\n}\nfunction createGetDistance(itemSize, source) {\n\treturn (index) => {\n\t\tif (typeof itemSize === \"number\") return index * itemSize;\n\t\treturn source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n\t};\n}\nfunction useWatchForSizes(size, listRef, totalSize, containerRef, calculateRange) {\n\twatch([\n\t\tsize.width,\n\t\tsize.height,\n\t\tlistRef,\n\t\ttotalSize,\n\t\tcontainerRef\n\t], () => {\n\t\tcalculateRange();\n\t});\n}\nfunction createComputedTotalSize(itemSize, source) {\n\treturn computed(() => {\n\t\tif (typeof itemSize === \"number\") return source.value.length * itemSize;\n\t\treturn source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n\t});\n}\nconst scrollToDictionaryForElementScrollKey = {\n\thorizontal: \"scrollLeft\",\n\tvertical: \"scrollTop\"\n};\nconst scrollToDictionaryForElementScrollToKey = {\n\thorizontal: \"left\",\n\tvertical: \"top\"\n};\nconst defaultScrollToOptions = {\n\tbehavior: \"auto\",\n\tblock: \"start\",\n\tinline: \"nearest\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef, itemSize) {\n\treturn (index, options = defaultScrollToOptions) => {\n\t\tif (!containerRef.value) return;\n\t\toptions = {\n\t\t\t...defaultScrollToOptions,\n\t\t\t...options\n\t\t};\n\t\tlet offset = 0;\n\t\tconst axisToCheck = options[type === \"horizontal\" ? \"inline\" : \"block\"];\n\t\tif (axisToCheck) {\n\t\t\tconst containerSize = type === \"horizontal\" ? containerRef.value.clientWidth : containerRef.value.clientHeight;\n\t\t\tconst fullItemSize = typeof itemSize === \"number\" ? itemSize : itemSize(index);\n\t\t\tif (axisToCheck === \"center\") offset = containerSize / 2 - fullItemSize / 2;\n\t\t\telse if (axisToCheck === \"end\") offset = containerSize - fullItemSize;\n\t\t\telse if (axisToCheck === \"nearest\") {\n\t\t\t\tconst containerScrollPosition = containerRef.value[scrollToDictionaryForElementScrollKey[type]];\n\t\t\t\tif (getDistance(index) > containerScrollPosition + containerSize / 2) offset = containerSize - fullItemSize;\n\t\t\t}\n\t\t}\n\t\tcontainerRef.value.scrollTo({\n\t\t\t[scrollToDictionaryForElementScrollToKey[type]]: getDistance(index) - offset,\n\t\t\tbehavior: options.behavior\n\t\t});\n\t\tcalculateRange();\n\t};\n}\nfunction useHorizontalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowX: \"auto\" };\n\tconst { itemWidth, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n\tconst calculateRange = createCalculateRange(\"horizontal\", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);\n\tconst getDistanceLeft = createGetDistance(itemWidth, source);\n\tconst offsetLeft = computed(() => getDistanceLeft(state.value.start));\n\tconst totalWidth = createComputedTotalSize(itemWidth, source);\n\tuseWatchForSizes(size, source, totalWidth, containerRef, calculateRange);\n\treturn {\n\t\tscrollTo: createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef, itemWidth),\n\t\tcalculateRange,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: `${totalWidth.value - offsetLeft.value}px`,\n\t\t\t\tmarginLeft: `${offsetLeft.value}px`,\n\t\t\t\tdisplay: \"flex\"\n\t\t\t} };\n\t\t}),\n\t\tcontainerStyle,\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\nfunction useVerticalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowY: \"auto\" };\n\tconst { itemHeight, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n\tconst calculateRange = createCalculateRange(\"vertical\", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);\n\tconst getDistanceTop = createGetDistance(itemHeight, source);\n\tconst offsetTop = computed(() => getDistanceTop(state.value.start));\n\tconst totalHeight = createComputedTotalSize(itemHeight, source);\n\tuseWatchForSizes(size, source, totalHeight, containerRef, calculateRange);\n\treturn {\n\t\tcalculateRange,\n\t\tscrollTo: createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef, itemHeight),\n\t\tcontainerStyle,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: `${totalHeight.value - offsetTop.value}px`,\n\t\t\t\tmarginTop: `${offsetTop.value}px`\n\t\t\t} };\n\t\t}),\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\n//#endregion\n//#region useWakeLock/index.ts\n/**\n* Reactive Screen Wake Lock API.\n*\n* @see https://vueuse.org/useWakeLock\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWakeLock(options = {}) {\n\tconst { navigator = defaultNavigator, document = defaultDocument } = options;\n\tconst requestedType = shallowRef(false);\n\tconst sentinel = shallowRef(null);\n\tconst documentVisibility = useDocumentVisibility({ document });\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"wakeLock\" in navigator);\n\tconst isActive = computed(() => !!sentinel.value && documentVisibility.value === \"visible\");\n\tif (isSupported.value) {\n\t\tuseEventListener(sentinel, \"release\", () => {\n\t\t\tvar _sentinel$value$type, _sentinel$value;\n\t\t\trequestedType.value = (_sentinel$value$type = (_sentinel$value = sentinel.value) === null || _sentinel$value === void 0 ? void 0 : _sentinel$value.type) !== null && _sentinel$value$type !== void 0 ? _sentinel$value$type : false;\n\t\t}, { passive: true });\n\t\twhenever(() => documentVisibility.value === \"visible\" && (document === null || document === void 0 ? void 0 : document.visibilityState) === \"visible\" && requestedType.value, (type) => {\n\t\t\trequestedType.value = false;\n\t\t\tforceRequest(type);\n\t\t});\n\t}\n\tasync function forceRequest(type) {\n\t\tvar _sentinel$value2;\n\t\tawait ((_sentinel$value2 = sentinel.value) === null || _sentinel$value2 === void 0 ? void 0 : _sentinel$value2.release());\n\t\tsentinel.value = isSupported.value ? await navigator.wakeLock.request(type) : null;\n\t}\n\tasync function request(type) {\n\t\tif (documentVisibility.value === \"visible\") await forceRequest(type);\n\t\telse requestedType.value = type;\n\t}\n\tasync function release() {\n\t\trequestedType.value = false;\n\t\tconst s = sentinel.value;\n\t\tsentinel.value = null;\n\t\tawait (s === null || s === void 0 ? void 0 : s.release());\n\t}\n\ttryOnScopeDispose(() => {\n\t\trelease();\n\t});\n\treturn {\n\t\tsentinel,\n\t\tisSupported,\n\t\tisActive,\n\t\trequest,\n\t\tforceRequest,\n\t\trelease\n\t};\n}\n//#endregion\n//#region useWebNotification/index.ts\n/**\n* Reactive useWebNotification\n*\n* @see https://vueuse.org/useWebNotification\n* @see https://developer.mozilla.org/en-US/docs/Web/API/notification\n*/\nfunction useWebNotification(options = {}) {\n\tconst { window = defaultWindow, requestPermissions: _requestForPermissions = true } = options;\n\tconst defaultWebNotificationOptions = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (!window || !(\"Notification\" in window)) return false;\n\t\tif (Notification.permission === \"granted\") return true;\n\t\ttry {\n\t\t\tconst notification = new Notification(\"\");\n\t\t\tnotification.onshow = () => {\n\t\t\t\tnotification.close();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.name === \"TypeError\") return false;\n\t\t}\n\t\treturn true;\n\t});\n\tconst permissionGranted = shallowRef(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n\tconst notification = shallowRef(null);\n\tconst ensurePermissions = async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionGranted.value && Notification.permission !== \"denied\") {\n\t\t\tif (await Notification.requestPermission() === \"granted\") permissionGranted.value = true;\n\t\t}\n\t\treturn permissionGranted.value;\n\t};\n\tconst { on: onClick, trigger: clickTrigger } = createEventHook();\n\tconst { on: onShow, trigger: showTrigger } = createEventHook();\n\tconst { on: onError, trigger: errorTrigger } = createEventHook();\n\tconst { on: onClose, trigger: closeTrigger } = createEventHook();\n\tconst show = async (overrides) => {\n\t\tif (!isSupported.value || !permissionGranted.value) return;\n\t\tconst options = Object.assign({}, defaultWebNotificationOptions, overrides);\n\t\tnotification.value = new Notification(options.title || \"\", options);\n\t\tnotification.value.onclick = clickTrigger;\n\t\tnotification.value.onshow = showTrigger;\n\t\tnotification.value.onerror = errorTrigger;\n\t\tnotification.value.onclose = closeTrigger;\n\t\treturn notification.value;\n\t};\n\tconst close = () => {\n\t\tif (notification.value) notification.value.close();\n\t\tnotification.value = null;\n\t};\n\tif (_requestForPermissions) tryOnMounted(ensurePermissions);\n\ttryOnScopeDispose(close);\n\tif (isSupported.value && window) {\n\t\tconst document = window.document;\n\t\tuseEventListener(document, \"visibilitychange\", (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (document.visibilityState === \"visible\") close();\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tnotification,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tshow,\n\t\tclose,\n\t\tonClick,\n\t\tonShow,\n\t\tonError,\n\t\tonClose\n\t};\n}\n//#endregion\n//#region useWebSocket/index.ts\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n\tif (options === true) return {};\n\treturn options;\n}\nfunction getDefaultScheduler(options) {\n\tif (\"interval\" in options) {\n\t\tconst { interval = 1e3 } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate: false });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive WebSocket client.\n*\n* @see https://vueuse.org/useWebSocket\n* @param url\n*/\nfunction useWebSocket(url, options = {}) {\n\tconst { onConnected, onDisconnected, onError, onMessage, immediate = true, autoConnect = true, autoClose = true, protocols = [] } = options;\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CLOSED\");\n\tconst wsRef = shallowRef();\n\tconst urlRef = toRef(url);\n\tlet heartbeatPause;\n\tlet heartbeatResume;\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tlet bufferedData = [];\n\tlet retryTimeout;\n\tlet pongTimeoutWait;\n\tconst _sendBuffer = () => {\n\t\tif (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n\t\t\tfor (const buffer of bufferedData) wsRef.value.send(buffer);\n\t\t\tbufferedData = [];\n\t\t}\n\t};\n\tconst resetRetry = () => {\n\t\tif (retryTimeout != null) {\n\t\t\tclearTimeout(retryTimeout);\n\t\t\tretryTimeout = void 0;\n\t\t}\n\t};\n\tconst resetHeartbeat = () => {\n\t\tclearTimeout(pongTimeoutWait);\n\t\tpongTimeoutWait = void 0;\n\t};\n\tconst close = (code = 1e3, reason) => {\n\t\tresetRetry();\n\t\tif (!isClient && !isWorker || !wsRef.value) return;\n\t\texplicitlyClosed = true;\n\t\tresetHeartbeat();\n\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\twsRef.value.close(code, reason);\n\t\twsRef.value = void 0;\n\t\tstatus.value = \"CLOSED\";\n\t};\n\tconst send = (data, useBuffer = true) => {\n\t\tif (!wsRef.value || status.value !== \"OPEN\") {\n\t\t\tif (useBuffer) bufferedData.push(data);\n\t\t\treturn false;\n\t\t}\n\t\t_sendBuffer();\n\t\twsRef.value.send(data);\n\t\treturn true;\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst ws = new WebSocket(urlRef.value, protocols);\n\t\twsRef.value = ws;\n\t\tstatus.value = \"CONNECTING\";\n\t\tws.onopen = () => {\n\t\t\tif (wsRef.value !== ws) return;\n\t\t\tstatus.value = \"OPEN\";\n\t\t\tretried = 0;\n\t\t\tonConnected === null || onConnected === void 0 || onConnected(ws);\n\t\t\theartbeatResume === null || heartbeatResume === void 0 || heartbeatResume();\n\t\t\t_sendBuffer();\n\t\t};\n\t\tws.onclose = (ev) => {\n\t\t\tif (wsRef.value === ws) status.value = \"CLOSED\";\n\t\t\tresetHeartbeat();\n\t\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\t\tonDisconnected === null || onDisconnected === void 0 || onDisconnected(ws, ev);\n\t\t\tif (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);\n\t\t\t\tif ((typeof retries === \"function\" ? retries : () => typeof retries === \"number\" && (retries < 0 || retried < retries))(retried)) {\n\t\t\t\t\tretried += 1;\n\t\t\t\t\tconst delayTime = typeof delay === \"function\" ? delay(retried) : delay;\n\t\t\t\t\tretryTimeout = setTimeout(_init, delayTime);\n\t\t\t\t} else onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tws.onerror = (e) => {\n\t\t\tonError === null || onError === void 0 || onError(ws, e);\n\t\t};\n\t\tws.onmessage = (e) => {\n\t\t\tif (options.heartbeat) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\tconst { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);\n\t\t\t\tif (e.data === toValue(responseMessage)) return;\n\t\t\t}\n\t\t\tdata.value = e.data;\n\t\t\tonMessage === null || onMessage === void 0 || onMessage(ws, e);\n\t\t};\n\t};\n\tif (options.heartbeat) {\n\t\tconst { message = DEFAULT_PING_MESSAGE, scheduler = getDefaultScheduler(resolveNestedOptions(options.heartbeat)), pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);\n\t\tconst { pause, resume } = scheduler(() => {\n\t\t\tsend(toValue(message), false);\n\t\t\tif (pongTimeoutWait != null) return;\n\t\t\tpongTimeoutWait = setTimeout(() => {\n\t\t\t\tclose();\n\t\t\t\texplicitlyClosed = false;\n\t\t\t}, pongTimeout);\n\t\t});\n\t\theartbeatPause = pause;\n\t\theartbeatResume = resume;\n\t}\n\tif (autoClose) {\n\t\tif (isClient) useEventListener(\"beforeunload\", () => close(), { passive: true });\n\t\ttryOnScopeDispose(close);\n\t}\n\tconst open = () => {\n\t\tif (!isClient && !isWorker) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\treturn {\n\t\tdata,\n\t\tstatus,\n\t\tclose,\n\t\tsend,\n\t\topen,\n\t\tws: wsRef\n\t};\n}\n//#endregion\n//#region useWebWorker/index.ts\nfunction useWebWorker(arg0, workerOptions, options) {\n\tconst { window = defaultWindow } = options !== null && options !== void 0 ? options : {};\n\tconst data = shallowRef(null);\n\tconst worker = shallowRef();\n\tconst post = (...args) => {\n\t\tif (!worker.value) return;\n\t\tworker.value.postMessage(...args);\n\t};\n\tconst terminate = function terminate() {\n\t\tif (!worker.value) return;\n\t\tworker.value.terminate();\n\t};\n\tif (window) {\n\t\tif (typeof arg0 === \"string\") worker.value = new Worker(arg0, workerOptions);\n\t\telse if (typeof arg0 === \"function\") worker.value = arg0();\n\t\telse worker.value = arg0;\n\t\tworker.value.onmessage = (e) => {\n\t\t\tdata.value = e.data;\n\t\t};\n\t\ttryOnScopeDispose(() => {\n\t\t\tif (worker.value) worker.value.terminate();\n\t\t});\n\t}\n\treturn {\n\t\tdata,\n\t\tpost,\n\t\tterminate,\n\t\tworker\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/depsParser.ts\n/**\n*\n* Concatenates the dependencies into a comma separated string.\n* this string will then be passed as an argument to the \"importScripts\" function\n*\n* @param deps array of string\n* @param localDeps array of function\n* @returns a string composed by the concatenation of the array\n* elements \"deps\" and \"importScripts\".\n*\n* @example\n* depsParser(['demo1', 'demo2']) // return importScripts('demo1', 'demo2')\n*/\nfunction depsParser(deps, localDeps) {\n\tif (deps.length === 0 && localDeps.length === 0) return \"\";\n\tconst depsString = deps.map((dep) => `'${dep}'`).toString();\n\tconst depsFunctionString = localDeps.filter((dep) => typeof dep === \"function\").map((fn) => {\n\t\tconst str = fn.toString();\n\t\tif (str.trim().startsWith(\"function\")) return str;\n\t\telse return `const ${fn.name} = ${str}`;\n\t}).join(\";\");\n\tconst importString = `importScripts(${depsString});`;\n\treturn `${depsString.trim() === \"\" ? \"\" : importString} ${depsFunctionString}`;\n}\n//#endregion\n//#region useWebWorkerFn/lib/jobRunner.ts\n/**\n* This function accepts as a parameter a function \"userFunc\"\n* And as a result returns an anonymous function.\n* This anonymous function, accepts as arguments,\n* the parameters to pass to the function \"useArgs\" and returns a Promise\n* This function can be used as a wrapper, only inside a Worker\n* because it depends by \"postMessage\".\n*\n* @param userFunc {Function} fn the function to run with web worker\n*\n* @returns returns a function that accepts the parameters\n* to be passed to the \"userFunc\" function\n*/\nfunction jobRunner(userFunc) {\n\treturn (e) => {\n\t\tconst userFuncArgs = e.data[0];\n\t\treturn Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n\t\t\tpostMessage([\"SUCCESS\", result]);\n\t\t}).catch((error) => {\n\t\t\tpostMessage([\"ERROR\", error]);\n\t\t});\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/createWorkerBlobUrl.ts\n/**\n* Converts the \"fn\" function into the syntax needed to be executed within a web worker\n*\n* @param fn the function to run with web worker\n* @param deps array of strings, imported into the worker through \"importScripts\"\n* @param localDeps array of function, local dependencies\n*\n* @returns a blob url, containing the code of \"fn\" as a string\n*\n* @example\n* createWorkerBlobUrl((a,b) => a+b, [])\n* // return \"onmessage=return Promise.resolve((a,b) => a + b)\n* .then(postMessage(['SUCCESS', result]))\n* .catch(postMessage(['ERROR', error])\"\n*/\nfunction createWorkerBlobUrl(fn, deps, localDeps) {\n\tconst blobCode = `${depsParser(deps, localDeps)}; onmessage=(${jobRunner})(${fn})`;\n\tconst blob = new Blob([blobCode], { type: \"text/javascript\" });\n\treturn URL.createObjectURL(blob);\n}\n//#endregion\n//#region useWebWorkerFn/index.ts\n/**\n* Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.\n*\n* @see https://vueuse.org/useWebWorkerFn\n* @param fn\n* @param options\n*/\nfunction useWebWorkerFn(fn, options = {}) {\n\tconst { dependencies = [], localDependencies = [], timeout, window = defaultWindow } = options;\n\tlet worker;\n\tconst workerStatus = shallowRef(\"PENDING\");\n\tconst promise = shallowRef({});\n\tconst timeoutId = shallowRef();\n\tconst workerTerminate = (status = \"PENDING\") => {\n\t\tif (worker && worker._url && window) {\n\t\t\tworker.terminate();\n\t\t\tURL.revokeObjectURL(worker._url);\n\t\t\tpromise.value = {};\n\t\t\tworker = void 0;\n\t\t\twindow.clearTimeout(timeoutId.value);\n\t\t\tworkerStatus.value = status;\n\t\t}\n\t};\n\tworkerTerminate();\n\ttryOnScopeDispose(workerTerminate);\n\tconst generateWorker = () => {\n\t\tconst blobUrl = createWorkerBlobUrl(fn, dependencies, localDependencies);\n\t\tconst newWorker = new Worker(blobUrl);\n\t\tnewWorker._url = blobUrl;\n\t\tnewWorker.onmessage = (e) => {\n\t\t\tconst { resolve = () => {}, reject = () => {} } = promise.value;\n\t\t\tconst [status, result] = e.data;\n\t\t\tswitch (status) {\n\t\t\t\tcase \"SUCCESS\":\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tworkerTerminate(status);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treject(result);\n\t\t\t\t\tworkerTerminate(\"ERROR\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tnewWorker.onerror = (e) => {\n\t\t\tconst { reject = () => {} } = promise.value;\n\t\t\te.preventDefault();\n\t\t\treject(e);\n\t\t\tworkerTerminate(\"ERROR\");\n\t\t};\n\t\tif (timeout) timeoutId.value = setTimeout(workerTerminate, timeout, \"TIMEOUT_EXPIRED\");\n\t\treturn newWorker;\n\t};\n\tconst callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n\t\tpromise.value = {\n\t\t\tresolve,\n\t\t\treject\n\t\t};\n\t\tworker === null || worker === void 0 || worker.postMessage([[...fnArgs]]);\n\t\tworkerStatus.value = \"RUNNING\";\n\t});\n\tconst workerFn = (...fnArgs) => {\n\t\tif (workerStatus.value === \"RUNNING\") {\n\t\t\tconsole.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n\t\t\treturn Promise.reject();\n\t\t}\n\t\tworker = generateWorker();\n\t\treturn callWorker(...fnArgs);\n\t};\n\treturn {\n\t\tworkerFn,\n\t\tworkerStatus,\n\t\tworkerTerminate\n\t};\n}\n//#endregion\n//#region useWindowFocus/index.ts\n/**\n* Reactively track window focus with `window.onfocus` and `window.onblur`.\n*\n* @see https://vueuse.org/useWindowFocus\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowFocus(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef(false);\n\tconst focused = shallowRef(window.document.hasFocus());\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"blur\", () => {\n\t\tfocused.value = false;\n\t}, listenerOptions);\n\tuseEventListener(window, \"focus\", () => {\n\t\tfocused.value = true;\n\t}, listenerOptions);\n\treturn focused;\n}\n//#endregion\n//#region useWindowScroll/index.ts\n/**\n* Reactive window scroll.\n*\n* @see https://vueuse.org/useWindowScroll\n* @param options\n*/\nfunction useWindowScroll(options = {}) {\n\tconst { window = defaultWindow, ...rest } = options;\n\treturn useScroll(window, rest);\n}\n//#endregion\n//#region useWindowSize/index.ts\n/**\n* Reactive window size.\n*\n* @see https://vueuse.org/useWindowSize\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowSize(options = {}) {\n\tconst { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = \"inner\" } = options;\n\tconst width = shallowRef(initialWidth);\n\tconst height = shallowRef(initialHeight);\n\tconst update = () => {\n\t\tif (window) if (type === \"outer\") {\n\t\t\twidth.value = window.outerWidth;\n\t\t\theight.value = window.outerHeight;\n\t\t} else if (type === \"visual\" && window.visualViewport) {\n\t\t\tconst { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;\n\t\t\twidth.value = Math.round(visualViewportWidth * scale);\n\t\t\theight.value = Math.round(visualViewportHeight * scale);\n\t\t} else if (includeScrollbar) {\n\t\t\twidth.value = window.innerWidth;\n\t\t\theight.value = window.innerHeight;\n\t\t} else {\n\t\t\twidth.value = window.document.documentElement.clientWidth;\n\t\t\theight.value = window.document.documentElement.clientHeight;\n\t\t}\n\t};\n\tupdate();\n\ttryOnMounted(update);\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"resize\", update, listenerOptions);\n\tif (window && type === \"visual\" && window.visualViewport) useEventListener(window.visualViewport, \"resize\", update, listenerOptions);\n\tif (listenOrientation) watch(useMediaQuery(\"(orientation: portrait)\"), () => update());\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\n//#endregion\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, getSSRHandler, isFocusedElementEditable, isTypedCharValid, mapGamepadToXbox360Controller, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, provideSSRWidth, setSSRHandler, templateRef, transition, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCssSupports, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementOverflow, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","import { onUnmounted, watch, type Ref } from \"vue\";\n\nexport type UseIntersectionObserverOptions = {\n /** Element to observe; the observer reinitializes whenever this ref changes. */\n target: Readonly<Ref<Element | null>>;\n /**\n * Resolves the scroll container that clips the target. Grid consumers must\n * provide the actual scrolling container, such as `.k-grid-content`. The\n * observer reinitializes whenever the resolved root element changes.\n */\n root: () => Element | null;\n /**\n * One or more intersection ratios from `0` through `1`. `0` observes entry\n * and complete departure; `1` observes full visibility. Defaults to `1`.\n */\n threshold?: number | number[];\n /** Called whenever the target's intersection state changes. */\n onChange: (entry: IntersectionObserverEntry) => void;\n};\n\nexport type UseIntersectionObserverReturn = {\n /** Stops observing the current target. Observation resumes if the target ref changes. */\n disconnect: () => void;\n};\n\n/**\n * Observes a reactive element against a lazily resolved clipping root.\n *\n * By default, the observer uses a threshold of `1`, so consumers are notified\n * when the target is no longer fully visible within its root. The observer\n * reinitializes whenever the target or resolved root changes. If\n * `IntersectionObserver` is unavailable (e.g. SSR), this is a no-op.\n */\nexport const useIntersectionObserver = (\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverReturn => {\n let observer: IntersectionObserver | null = null;\n\n const disconnect = () => {\n observer?.disconnect();\n observer = null;\n };\n\n const isSupported =\n typeof window !== \"undefined\" &&\n typeof window.IntersectionObserver === \"function\";\n\n if (isSupported) {\n watch(\n [options.target, () => options.root()],\n ([target, root]) => {\n disconnect();\n if (!target) return;\n\n observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) options.onChange(entry);\n },\n { root, threshold: options.threshold ?? 1 },\n );\n observer.observe(target);\n },\n { immediate: true },\n );\n }\n\n onUnmounted(disconnect);\n\n return { disconnect };\n};\n","import {\n computed,\n nextTick,\n onUnmounted,\n ref,\n shallowRef,\n toValue,\n watch,\n type ComponentPublicInstance,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\nimport { onClickOutside } from \"@vueuse/core\";\nimport { useIntersectionObserver } from \"../observer\";\nimport {\n computeCollisionOffset,\n type GeometryAlign,\n type GeometryBounds,\n type GeometryCollision,\n} from \"../geometry\";\n\n/** A template ref that may point to an element or a Vue/Kendo component. */\nexport type PopupMenuElementRef = Ref<\n HTMLElement | ComponentPublicInstance | null\n>;\n\nexport type PopupMenuTriggerMode = \"button\" | \"row\";\n\n/** Default `escapeFocusContainerSelector` for `triggerMode: \"button\"`. */\nconst DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR = \".k-table-row\";\n\nexport type PopupMenuOffset = {\n left: number;\n top: number;\n};\n\n/** Mirrors Kendo Popup's `anchorAlign`/`popupAlign` point shape. */\nexport type PopupMenuAlign = GeometryAlign;\n\n/** Per-axis viewport collision behavior for offset-positioned popups. */\nexport type PopupMenuCollision = GeometryCollision;\n\nexport type PopupMenuAnchorActivation = {\n triggerType: \"click\" | \"keyboard\";\n coordinates?: {\n clientX: number;\n clientY: number;\n };\n};\n\nexport type PopupMenuActivationPointOptions = {\n /** Added to pointer coordinates after they are made trigger-relative. */\n pointerOffset?: { x?: number; y?: number };\n /** Trigger-relative keyboard position. Defaults to 8px from the left and vertically centered. */\n keyboardPosition?: {\n x?: number;\n y?: number | \"top\" | \"center\" | \"bottom\";\n };\n};\n\ntype PopupMenuAnchorBaseOptions = {\n /** Scrollable/clipping container used for out-of-view dismissal. */\n clipRoot?: MaybeRefOrGetter<Element | null>;\n /** Closes the menu after its trigger leaves the clipping container. */\n hideWhenAnchorClipped?: boolean;\n /** Intersection ratio required to keep the anchor considered visible. */\n intersectionThreshold?: number | number[];\n /** Per-axis collision behavior. Defaults to `flip` on both axes. */\n collision?: PopupMenuCollision;\n /**\n * Point on the anchor rect that `offset` is computed from. Mirrors Kendo\n * Popup's `anchorAlign` semantics. Defaults to `{ vertical: \"bottom\",\n * horizontal: \"left\" }`, matching Kendo's own default. Passing `anchorAlign`/\n * `popupAlign` directly to `<Popup>` has no effect when positioning via\n * `offset` (no `anchor` DOM ref) - Kendo's own alignment engine only runs\n * against a real anchor element - so these options exist to reproduce that\n * alignment ourselves in the computed `offset`.\n */\n anchorAlign?: PopupMenuAlign;\n /**\n * Point on the popup itself that is placed at the computed anchor point.\n * Mirrors Kendo Popup's `popupAlign` semantics. Defaults to `{ vertical:\n * \"top\", horizontal: \"left\" }`. Requires measuring the rendered popup\n * border box; until it has a size (e.g. the first open frame), non-\"left\"/\n * \"top\" alignments briefly fall back to \"left\"/\"top\".\n */\n popupAlign?: PopupMenuAlign;\n};\n\n/** Offset-positioning options for a Popup with a dynamically changing trigger. */\nexport type PopupMenuAnchorOptions = PopupMenuAnchorBaseOptions &\n (\n | {\n /** Tracks a pointer or keyboard activation point relative to the trigger. */\n activationPoint: true | PopupMenuActivationPointOptions;\n getRect?: never;\n }\n | {\n activationPoint?: never;\n /** Resolves a custom anchor rect from the current trigger element. */\n getRect?: (trigger: HTMLElement) => DOMRect | null;\n }\n );\n\n/** Why the popup was closed, including the focus policy for mouse paths. */\nexport type PopupMenuCloseReason =\n /** Keyboard-driven menu selection (Enter/Space on a menu item); restores the configured focus target. */\n | \"keyboard\"\n /** Escape key; restores the configured focus target, then `escapeFocusTarget`, then the trigger. */\n | \"escape\"\n /** Pointer menu selection; restores focus to the trigger. */\n | \"mouse-selection\"\n /** Pointer interaction outside the menu; leaves browser focus unchanged. */\n | \"outside-click\"\n /** Interaction with the open trigger; leaves browser focus unchanged. */\n | \"trigger-click\"\n /** Trigger left its clipping area; closes without scrolling it back into view. */\n | \"anchor-hidden\"\n /** No close has been requested yet. */\n | null;\nexport type PopupMenuCloseTrigger = Exclude<PopupMenuCloseReason, null>;\n\n/** Minimal event shape emitted by Kendo Menu `@select`. */\nexport type KendoMenuSelectEvent<\n TItem = { text?: string; id?: string; cssClass?: string; data?: unknown },\n> = {\n item?: TItem;\n event?: {\n type?: string;\n } | null;\n};\n\n/** Options for configuring {@link usePopupMenu}. */\nexport type UsePopupMenuOptions = {\n /** Read-only reactive flag reflecting whether the popup menu is currently open. */\n isOpen: Readonly<Ref<boolean>>;\n /** Ref to the popup menu element or component. Used for outside-click detection. */\n menuRef: PopupMenuElementRef;\n /**\n * Optional measurement source for custom popup markup. The source is\n * promoted to its nearest Kendo `.k-popup` so alignment and collision use\n * the complete border box. Defaults to `menuRef`; outside-click detection\n * always uses `menuRef` directly.\n */\n popupContentRef?: PopupMenuElementRef;\n /** Ref to the trigger button element or component. Ignored by outside-click detection. */\n triggerRef: PopupMenuElementRef;\n /** Called to open the popup menu. Kendo passes its event args as a rest tuple. */\n requestShow: (...args: unknown[]) => void;\n /** Called to close the popup menu. Kendo passes its event args as a rest tuple. */\n requestHide: (...args: unknown[]) => void;\n /**\n * Optional target to focus after a keyboard-driven close.\n * Supports ordinary elements and Vue/Kendo components exposing `$el`.\n */\n focusTargetRef?: PopupMenuElementRef;\n /**\n * Resolves the focus target when it is virtualized or dynamically rendered.\n * Takes precedence over `focusTargetRef`.\n */\n resolveFocusTarget?: () => HTMLElement | null;\n /**\n * Resolves the closest matching ancestor of the trigger as the configured\n * keyboard-close focus target. Used after `resolveFocusTarget` and\n * `focusTargetRef`.\n */\n focusTargetContainerSelector?: string;\n /**\n * Resolves a fallback focus target for Escape closes when no `focusTargetRef`/\n * `resolveFocusTarget` is configured, e.g. the trigger's containing grid row so\n * keyboard users land back in row navigation instead of on the trigger button.\n * Only consulted for `triggerMode: \"button\"`; row triggers already restore to\n * themselves. Takes effect only for Escape, not keyboard menu selection.\n * Takes precedence over `escapeFocusContainerSelector`.\n */\n escapeFocusTarget?: () => HTMLElement | null;\n /**\n * CSS selector for the closest ancestor of the trigger (or, if the menu was\n * never opened, of `document.activeElement`) to focus on Escape. Sugar over\n * `escapeFocusTarget` for the common \"collapse back into the row\" case.\n * Defaults to `\".k-table-row\"` for `triggerMode: \"button\"`; harmless to leave\n * at its default for non-grid button triggers since a missing ancestor simply\n * falls through to focusing the trigger. Ignored when `escapeFocusTarget` is set.\n */\n escapeFocusContainerSelector?: string;\n /**\n * CSS selector used to find the first focusable menu item after open.\n * Defaults to `\".k-menu-item:not(.k-disabled)\"` for Kendo Menu.\n */\n menuItemSelector?: string;\n /**\n * Keeps `aria-expanded` in sync with `isOpen` on the resolved `triggerRef`.\n * Defaults to `true`. The consumer is always responsible for the static\n * `aria-haspopup=\"menu\"` and baseline `aria-expanded=\"false\"` attributes.\n */\n manageMenuTriggerAria?: boolean;\n /** Applies an accessible name to the rendered `role=\"menubar\"` when provided. */\n menuLabel?: MaybeRefOrGetter<string | null | undefined>;\n /**\n * Declares whether `triggerRef` is a button or a `tr.k-table-row`. Required so\n * misrouted refs (e.g. a button-mode ref that resolves to a row) are never\n * silently managed.\n */\n triggerMode: PopupMenuTriggerMode;\n /** Enables offset positioning and lifecycle tracking for a dynamic trigger. */\n anchor?: PopupMenuAnchorOptions | true;\n};\n\n/** Functions returned by {@link usePopupMenu} for the action menu. */\nexport type UsePopupMenuReturn = {\n /** Captures an activation relative to a trigger for activation-point anchoring. */\n setAnchorActivation: (\n trigger: HTMLElement | ComponentPublicInstance | null,\n activation: PopupMenuAnchorActivation,\n ) => boolean;\n /** Opens the menu, or closes it when it is already open. */\n handleTriggerClick: (...args: unknown[]) => void;\n /**\n * Handles keyboard input on the trigger. Enter and Space open or close\n * the menu. Escape closes an open menu or moves focus to the configured target.\n */\n handleTriggerKeydown: (...args: unknown[]) => void;\n /** Closes the menu when Escape is pressed while using the menu. */\n handleMenuEscape: (event: KeyboardEvent) => void;\n /**\n * Closes the menu after an item is chosen, then runs the optional action\n * provided by the consuming component.\n */\n handleMenuSelect: (\n event: KendoMenuSelectEvent,\n onAction?: (event: KendoMenuSelectEvent) => void,\n ) => void;\n /**\n * Restores focus after the popup closes. Keyboard actions prefer the\n * configured focus target; mouse menu selections return focus to the trigger.\n */\n handlePopupClose: () => void;\n /** Bind to Kendo Popup's `offset` prop when `anchor` is enabled. */\n offset: ComputedRef<PopupMenuOffset>;\n};\n\nconst resolveElement = (\n target: HTMLElement | ComponentPublicInstance | null | undefined,\n) => {\n if (target instanceof HTMLElement) return target;\n\n const componentElement = target?.$el;\n return componentElement instanceof HTMLElement ? componentElement : null;\n};\n\nconst isManagedTrigger = (\n element: HTMLElement,\n triggerMode: PopupMenuTriggerMode,\n) =>\n triggerMode === \"row\"\n ? element.matches(\"tr.k-table-row\")\n : !element.matches(\"tr.k-table-row\");\n\nconst warnMismatchedTrigger = (\n element: HTMLElement,\n triggerMode: PopupMenuTriggerMode,\n) => {\n console.warn(\n `usePopupMenu: triggerMode \"${triggerMode}\" does not match resolved element <${element.tagName.toLowerCase()}${\n element.className ? `.${element.className.split(\" \").join(\".\")}` : \"\"\n }>; ARIA management skipped.`,\n );\n};\n\nconst findScrollableAncestor = (element: HTMLElement) => {\n let parent = element.parentElement;\n let styledFallback: HTMLElement | null = null;\n\n while (parent) {\n const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);\n const scrollsX = /auto|scroll|overlay/.test(`${overflow} ${overflowX}`);\n const scrollsY = /auto|scroll|overlay/.test(`${overflow} ${overflowY}`);\n if (scrollsX || scrollsY) styledFallback ??= parent;\n\n if (\n (scrollsX && parent.scrollWidth > parent.clientWidth) ||\n (scrollsY && parent.scrollHeight > parent.clientHeight)\n ) {\n return parent;\n }\n parent = parent.parentElement;\n }\n\n return styledFallback;\n};\n\n/**\n * Composable for accessible Kendo Popup + Menu action-menu interactions.\n *\n * It manages toggling, menu-item focus, selection modality, and contextual\n * focus restoration. The consuming component keeps ownership of menu state\n * and business-specific actions.\n *\n * @param options - Parent-owned popup state, refs, and focus configuration.\n * @returns Template event handlers for the action trigger, Kendo Menu, and Popup.\n */\nexport const usePopupMenu = (\n options: UsePopupMenuOptions,\n): UsePopupMenuReturn => {\n const popupCloseReason = ref<PopupMenuCloseReason>(null);\n const menuItemSelector =\n options.menuItemSelector ?? \".k-menu-item:not(.k-disabled)\";\n const triggerMode = options.triggerMode;\n const anchorOptions: PopupMenuAnchorOptions | undefined =\n options.anchor === true ? {} : options.anchor;\n const activationPointOptions = anchorOptions?.activationPoint\n ? anchorOptions.activationPoint === true\n ? {}\n : anchorOptions.activationPoint\n : null;\n const anchorRect = shallowRef<DOMRect | null>(null);\n const anchorActivation = shallowRef<{\n trigger: HTMLElement;\n point: { x: number; y: number };\n hasMatchedTrigger: boolean;\n } | null>(null);\n const anchorAlign: PopupMenuAlign = anchorOptions?.anchorAlign ?? {\n horizontal: \"left\",\n vertical: \"bottom\",\n };\n const popupAlign: PopupMenuAlign = anchorOptions?.popupAlign ?? {\n horizontal: \"left\",\n vertical: \"top\",\n };\n const collision: PopupMenuCollision = anchorOptions?.collision ?? {\n horizontal: \"flip\",\n vertical: \"flip\",\n };\n // Always measured (via ResizeObserver below) whenever anchor tracking is on -\n // needed both for a non-\"left\"/\"top\" popupAlign and for flip/collision\n // detection, which must compare the popup's real size against `bounds`.\n const popupRect = shallowRef<DOMRect | null>(null);\n\n const resolveTriggerElement = () => resolveElement(options.triggerRef.value);\n const triggerEl = computed(() => resolveTriggerElement());\n const anchorObserverTarget = computed(() =>\n anchorOptions && anchorOptions.hideWhenAnchorClipped !== false\n ? triggerEl.value\n : null,\n );\n // Viewport by default; the configured clipRoot when provided, matching the\n // same container `hideWhenAnchorClipped`'s intersection check already uses.\n const getOffsetBounds = (): GeometryBounds => {\n const clip = anchorOptions?.clipRoot\n ? toValue(anchorOptions.clipRoot)\n : null;\n if (clip) {\n const rect = clip.getBoundingClientRect();\n return {\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n }\n return {\n left: 0,\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n };\n };\n const offset = computed<PopupMenuOffset>(() => {\n const rect = anchorRect.value;\n if (!options.isOpen.value || !rect) return { left: 0, top: 0 };\n\n const bounds = getOffsetBounds();\n const corner = computeCollisionOffset({\n anchor: rect,\n popup: popupRect.value,\n anchorAlign,\n popupAlign,\n bounds,\n collision,\n });\n\n return {\n left: corner.left + window.scrollX,\n top: corner.top + window.scrollY,\n };\n });\n\n const resolveConfiguredFocusTarget = () => {\n const explicitTarget =\n options.resolveFocusTarget?.() ??\n resolveElement(options.focusTargetRef?.value);\n if (explicitTarget) return explicitTarget;\n\n return options.focusTargetContainerSelector\n ? (resolveTriggerElement()?.closest<HTMLElement>(\n options.focusTargetContainerSelector,\n ) ?? null)\n : null;\n };\n\n const setAnchorActivation = (\n trigger: HTMLElement | ComponentPublicInstance | null,\n activation: PopupMenuAnchorActivation,\n ) => {\n if (!activationPointOptions) return false;\n\n const triggerElement = resolveElement(trigger);\n if (!triggerElement) {\n anchorActivation.value = null;\n return false;\n }\n\n const triggerRect = triggerElement.getBoundingClientRect();\n if (activation.triggerType === \"keyboard\") {\n const keyboardPosition = activationPointOptions.keyboardPosition;\n const verticalPosition = keyboardPosition?.y ?? \"center\";\n const y =\n typeof verticalPosition === \"number\"\n ? verticalPosition\n : verticalPosition === \"top\"\n ? 0\n : verticalPosition === \"bottom\"\n ? triggerRect.height\n : triggerRect.height / 2;\n anchorActivation.value = {\n trigger: triggerElement,\n point: { x: keyboardPosition?.x ?? 8, y },\n hasMatchedTrigger: false,\n };\n return true;\n }\n\n if (!activation.coordinates) {\n anchorActivation.value = null;\n return false;\n }\n\n anchorActivation.value = {\n trigger: triggerElement,\n point: {\n x:\n activation.coordinates.clientX -\n triggerRect.left +\n (activationPointOptions.pointerOffset?.x ?? 0),\n y:\n activation.coordinates.clientY -\n triggerRect.top +\n (activationPointOptions.pointerOffset?.y ?? 0),\n },\n hasMatchedTrigger: false,\n };\n return true;\n };\n\n /**\n * Escape-only fallback below the configured focus target: a custom resolver,\n * else the closest `escapeFocusContainerSelector` ancestor of the trigger, or\n * of `document.activeElement` when the menu was never opened (so the trigger\n * isn't yet known to a shared registry). Button mode only.\n */\n const resolveEscapeFallbackTarget = (): HTMLElement | null => {\n if (triggerMode !== \"button\") return null;\n if (options.escapeFocusTarget) return options.escapeFocusTarget();\n\n const selector =\n options.escapeFocusContainerSelector ??\n DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR;\n const anchor =\n resolveTriggerElement() ?? (document.activeElement as HTMLElement | null);\n return anchor?.closest<HTMLElement>(selector) ?? null;\n };\n\n const focusConfiguredTargetOrTrigger = () => {\n const target =\n resolveConfiguredFocusTarget() ?? resolveEscapeFallbackTarget();\n if (target) {\n target.focus();\n return true;\n }\n\n const trigger = resolveTriggerElement();\n trigger?.focus();\n return !!trigger;\n };\n\n const focusFirstEnabledMenuItem = () => {\n const menuElement = resolveElement(options.menuRef.value);\n const firstEnabledItem = menuElement?.querySelector(menuItemSelector);\n (firstEnabledItem as HTMLElement | null)?.focus({ preventScroll: true });\n };\n\n // Captured before requestHide(), since shared-instance triggerRefs (e.g. useActiveIdRegistry)\n // can resolve to null the instant the active id is cleared, before the Popup's async close fires.\n const pendingFocusTarget = shallowRef<HTMLElement | null>(null);\n const pendingTrigger = shallowRef<HTMLElement | null>(null);\n\n // Pressing Enter/Space on a focused <button> makes the browser synthesize a\n // click on keyup; since focus restoration below runs before that keyup fires,\n // the synthetic click would otherwise land on the trigger and reopen the menu.\n let suppressNextTriggerClick = false;\n\n /**\n * Restores focus for the reason recorded by `closePopup`, then clears the\n * pending state so a second call (e.g. a delayed Kendo Popup `@close`) is a no-op.\n */\n const restorePendingFocus = () => {\n const reason = popupCloseReason.value;\n if (reason === \"keyboard\" || reason === \"escape\") {\n const target = pendingFocusTarget.value ?? pendingTrigger.value;\n target?.focus();\n // Only \"keyboard\" (Enter/Space menu selection) risks the native click-on-keyup\n // reopen; Escape never synthesizes a click, so no suppression is needed there.\n if (reason === \"keyboard\" && target && target === pendingTrigger.value) {\n suppressNextTriggerClick = true;\n }\n } else if (popupCloseReason.value === \"mouse-selection\") {\n pendingTrigger.value?.focus();\n }\n\n popupCloseReason.value = null;\n pendingFocusTarget.value = null;\n pendingTrigger.value = null;\n };\n\n /** Closes the popup if open, preserving its input modality for restoration. */\n const closePopup = (reason: PopupMenuCloseTrigger) => {\n if (!options.isOpen.value) return;\n popupCloseReason.value = reason;\n pendingFocusTarget.value =\n resolveConfiguredFocusTarget() ??\n (reason === \"escape\" ? resolveEscapeFallbackTarget() : null);\n pendingTrigger.value = resolveTriggerElement();\n syncManagedTrigger(false);\n options.requestHide();\n // Restores focus itself rather than waiting on Kendo Popup's `@close`, which\n // fires from an exit-animation callback that isn't reliably observed for every close.\n nextTick(restorePendingFocus);\n };\n\n watch(\n [triggerEl, anchorActivation],\n ([trigger], _, onCleanup) => {\n if (!anchorOptions || !trigger) {\n anchorRect.value = null;\n return;\n }\n\n let animationFrame: number | null = null;\n const measure = () => {\n animationFrame = null;\n const activation = anchorActivation.value;\n if (activationPointOptions) {\n if (activation && activation.trigger === trigger) {\n activation.hasMatchedTrigger = true;\n } else if (activation?.hasMatchedTrigger) {\n activation.trigger = trigger;\n }\n const triggerRect = trigger.getBoundingClientRect();\n anchorRect.value =\n activation?.trigger === trigger\n ? new DOMRect(\n triggerRect.left + activation.point.x,\n triggerRect.top + activation.point.y,\n 0,\n 0,\n )\n : null;\n return;\n }\n anchorRect.value =\n anchorOptions.getRect?.(trigger) ?? trigger.getBoundingClientRect();\n };\n const scheduleMeasure = () => {\n if (animationFrame === null)\n animationFrame = window.requestAnimationFrame(measure);\n };\n const observer =\n typeof window.ResizeObserver === \"function\"\n ? new window.ResizeObserver(scheduleMeasure)\n : null;\n observer?.observe(trigger);\n window.addEventListener(\"scroll\", scheduleMeasure, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleMeasure, { passive: true });\n scheduleMeasure();\n\n onCleanup(() => {\n if (animationFrame !== null)\n window.cancelAnimationFrame(animationFrame);\n observer?.disconnect();\n window.removeEventListener(\"scroll\", scheduleMeasure, true);\n window.removeEventListener(\"resize\", scheduleMeasure);\n });\n },\n { immediate: true, flush: \"post\" },\n );\n\n // Needed whenever anchor tracking is on - both for a non-\"left\"/\"top\"\n // popupAlign and for flip/collision detection, which always needs the\n // popup's real size to compare against bounds. Runs post-flush since the\n // element only has a real size once open.\n const resolvePopupContentElement = () => {\n const content = resolveElement(\n options.popupContentRef?.value ?? options.menuRef.value,\n );\n return content?.closest<HTMLElement>(\".k-popup\") ?? content;\n };\n if (anchorOptions) {\n watch(\n options.isOpen,\n (open, _prev, onCleanup) => {\n if (!open) {\n popupRect.value = null;\n return;\n }\n\n let animationFrame: number | null = null;\n const measure = () => {\n animationFrame = null;\n const contentElement = resolvePopupContentElement();\n popupRect.value = contentElement?.getBoundingClientRect() ?? null;\n };\n const scheduleMeasure = () => {\n if (animationFrame === null)\n animationFrame = window.requestAnimationFrame(measure);\n };\n const contentElement = resolvePopupContentElement();\n const observer =\n contentElement && typeof window.ResizeObserver === \"function\"\n ? new window.ResizeObserver(scheduleMeasure)\n : null;\n observer?.observe(contentElement!);\n scheduleMeasure();\n\n onCleanup(() => {\n if (animationFrame !== null)\n window.cancelAnimationFrame(animationFrame);\n observer?.disconnect();\n });\n },\n { immediate: true, flush: \"post\" },\n );\n }\n\n useIntersectionObserver({\n target: anchorObserverTarget,\n root: () =>\n anchorOptions?.clipRoot\n ? toValue(anchorOptions.clipRoot)\n : triggerEl.value\n ? findScrollableAncestor(triggerEl.value)\n : null,\n threshold:\n anchorOptions?.intersectionThreshold ??\n (activationPointOptions ? 0 : 0.5),\n onChange: (entry) => {\n if (!entry.isIntersecting) closePopup(\"anchor-hidden\");\n },\n });\n\n onClickOutside(options.menuRef, () => closePopup(\"outside-click\"), {\n ignore: [triggerEl],\n });\n\n let previousTrigger: HTMLElement | null = null;\n let previousMenubar: HTMLElement | null = null;\n\n // Reverts the previous trigger to its closed baseline; aria-haspopup is the consumer's.\n const demoteManagedTrigger = () => {\n if (previousTrigger?.isConnected) {\n previousTrigger.setAttribute(\"aria-expanded\", \"false\");\n }\n previousTrigger = null;\n };\n\n const syncManagedTrigger = (open: boolean) => {\n if (options.manageMenuTriggerAria === false) return;\n\n const trigger = triggerEl.value;\n if (!trigger) {\n if (previousTrigger?.isConnected) {\n previousTrigger.setAttribute(\"aria-expanded\", open ? \"true\" : \"false\");\n }\n return;\n }\n\n if (!isManagedTrigger(trigger, triggerMode)) {\n warnMismatchedTrigger(trigger, triggerMode);\n demoteManagedTrigger();\n return;\n }\n\n if (previousTrigger && previousTrigger !== trigger) {\n demoteManagedTrigger();\n }\n\n trigger.setAttribute(\"aria-expanded\", open ? \"true\" : \"false\");\n previousTrigger = trigger;\n };\n\n const syncMenuLabel = () => {\n const menuElement = resolveElement(options.menuRef.value);\n const menubar = menuElement?.matches('[role=\"menubar\"]')\n ? menuElement\n : menuElement?.querySelector<HTMLElement>('[role=\"menubar\"]');\n const label = toValue(options.menuLabel)?.trim();\n\n if (previousMenubar && previousMenubar !== menubar) {\n previousMenubar.removeAttribute(\"aria-label\");\n }\n if (menubar) {\n if (label) menubar.setAttribute(\"aria-label\", label);\n else menubar.removeAttribute(\"aria-label\");\n }\n previousMenubar = menubar ?? null;\n };\n\n watch(\n [options.isOpen, options.triggerRef],\n ([open]) => {\n syncManagedTrigger(open);\n if (!open && activationPointOptions) {\n anchorActivation.value = null;\n anchorRect.value = null;\n }\n },\n { immediate: true, flush: \"post\" },\n );\n\n watch(\n [options.isOpen, options.menuRef, () => toValue(options.menuLabel)],\n syncMenuLabel,\n { immediate: true, flush: \"post\" },\n );\n\n // Resets managed ARIA attributes on unmount; aria-haspopup remains consumer-owned.\n onUnmounted(() => {\n anchorActivation.value = null;\n demoteManagedTrigger();\n previousMenubar?.removeAttribute(\"aria-label\");\n });\n\n // Focuses the first enabled item whenever the menu opens, however it was opened\n // (handleTriggerClick, or a consumer driving isOpen directly for row triggers).\n // flush: \"post\" already waits for the Popup/Menu DOM to render, so no extra nextTick is needed.\n watch(\n options.isOpen,\n (open) => {\n if (open) focusFirstEnabledMenuItem();\n },\n { flush: \"post\" },\n );\n\n /** Toggles the menu and focuses its first enabled item after opening. */\n const handleTriggerClick = (...args: unknown[]) => {\n const context = args[0];\n\n if (suppressNextTriggerClick) {\n suppressNextTriggerClick = false;\n return;\n }\n\n if (options.isOpen.value) {\n closePopup(\"trigger-click\");\n return;\n }\n\n options.requestShow(context);\n };\n\n /** Handles Enter, Space, and Escape on the trigger. */\n const handleTriggerKeydown = (...args: unknown[]) => {\n const event = args[0] as KeyboardEvent;\n const context = args[1];\n\n if (event.key === \"Enter\" || event.code === \"Space\") {\n event.preventDefault();\n handleTriggerClick(context);\n return;\n }\n\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n\n if (options.isOpen.value) {\n closePopup(\"escape\");\n return;\n }\n\n focusConfiguredTargetOrTrigger();\n }\n };\n\n /** Escape handler bound inside the menu. */\n const handleMenuEscape = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n closePopup(\"escape\");\n };\n\n /** Closes the menu then delegates its business action to the caller. */\n const handleMenuSelect = (\n event: KendoMenuSelectEvent,\n onAction?: (event: KendoMenuSelectEvent) => void,\n ) => {\n closePopup(\n event.event?.type?.startsWith(\"key\") ? \"keyboard\" : \"mouse-selection\",\n );\n onAction?.(event);\n };\n\n /**\n * Bind to the Kendo Popup `@close` event after the owner updates `isOpen`.\n * Keyboard menu selection and Escape both try the configured focus target\n * first, Escape then falls back to `escapeFocusTarget`, and both fall back\n * to the trigger. Mouse menu selection restores the trigger, while outside\n * clicks leave focus under browser control.\n */\n // Kept as a safety net for consumers that still wire Kendo Popup's `@close`;\n // restorePendingFocus() is idempotent once closePopup's own nextTick has already run.\n const handlePopupClose = () => {\n nextTick(restorePendingFocus);\n };\n\n return {\n /**\n * Sets the anchor activation state, controlling whether the popup menu\n * should respond to trigger interactions.\n */\n setAnchorActivation,\n /**\n * Handles Kendo Menu selection: records keyboard or mouse modality,\n * requests popup close, then runs the optional caller-owned action.\n */\n handleMenuSelect,\n /**\n * Toggles the action menu. When opening, focuses the first enabled Kendo\n * Menu item after Vue renders the popup.\n */\n handleTriggerClick,\n /**\n * Handles trigger keyboard input: Enter and Space toggle the menu; Escape\n * closes an open menu or focuses the configured target when already closed.\n */\n handleTriggerKeydown,\n /** Closes the open menu through the keyboard path when Escape is pressed inside it. */\n handleMenuEscape,\n /**\n * Restores focus after Kendo Popup closes: keyboard menu selection and\n * Escape prefer the configured focus target (Escape then falls back to\n * `escapeFocusTarget`), mouse selections return to the trigger, and\n * outside clicks do not move focus.\n */\n handlePopupClose,\n offset,\n };\n};\n","import { onUnmounted } from \"vue\";\n\n/** A participant that can be deactivated when another group member becomes active. */\nexport type ExclusiveGroupMember = {\n deactivate: () => void;\n};\n\n/** Coordinates mutually exclusive activation across registered members. */\nexport type UseExclusiveGroupReturn = {\n /** Adds a member and unregisters it automatically when the current owner unmounts. */\n register: (member: ExclusiveGroupMember) => void;\n /** Deactivates every registered member except the activating member. */\n deactivateOthers: (activeMember: ExclusiveGroupMember) => void;\n /** Deactivates every registered member. */\n deactivateAll: () => void;\n};\n\n/**\n * Coordinates mutually exclusive active-id registries within a Vue owner.\n *\n * Registered members are removed automatically when their owning component or composable\n * unmounts. Call `register` from setup so Vue can associate cleanup with that owner.\n */\nexport const useExclusiveGroup = (): UseExclusiveGroupReturn => {\n const members = new Set<ExclusiveGroupMember>();\n\n const register = (member: ExclusiveGroupMember) => {\n members.add(member);\n onUnmounted(() => members.delete(member));\n };\n\n const deactivateOthers = (activeMember: ExclusiveGroupMember) => {\n members.forEach((member) => {\n if (member !== activeMember) member.deactivate();\n });\n };\n\n const deactivateAll = () => {\n members.forEach((member) => member.deactivate());\n };\n\n return { register, deactivateOthers, deactivateAll };\n};\n","import {\n computed,\n readonly,\n ref,\n shallowReactive,\n type ComputedRef,\n type DeepReadonly,\n type Ref,\n} from \"vue\";\n\n/** An element ref value that may be a plain element or a Vue/Kendo ref-like object exposing `$el`. */\nexport type RegisterableElement =\n | HTMLElement\n | { $el?: HTMLElement | null }\n | null;\n\nconst resolveRegisteredElement = (\n value: RegisterableElement,\n): HTMLElement | null => {\n if (value instanceof HTMLElement) return value;\n const componentElement = value && \"$el\" in value ? value.$el : null;\n return componentElement instanceof HTMLElement ? componentElement : null;\n};\n\n/** Functions and state returned by {@link useActiveIdRegistry}. */\nexport type UseActiveIdRegistryReturn<Id> = {\n /** The currently active id, or `null` when nothing is active. Read-only; use `activate`/`deactivate` to change it. */\n activeId: DeepReadonly<Ref<Id | null>>;\n /** `true` while any id is active. */\n isActive: ComputedRef<boolean>;\n /** The registered element for the active id, or `null`. */\n activeElement: ComputedRef<HTMLElement | null>;\n /** Registers (or unregisters, when `el` is `null`) the element for `id`. */\n register: (id: Id, el: RegisterableElement) => void;\n /** Returns the currently registered element for `id`, if any. */\n resolve: (id: Id) => HTMLElement | null;\n /** Marks `id` as active. */\n activate: (id: Id) => void;\n /** Clears the active id. */\n deactivate: () => void;\n /** Returns whether `id` is the currently active id. */\n isIdActive: (id: Id) => boolean;\n};\n\n/**\n * Tracks which single id, out of a rendered list of items (grid rows, tabs,\n * action buttons, etc.), is currently \"active,\" alongside a registry\n * resolving each id to its mounted DOM element.\n *\n * This helper is useful for shared-instance patterns where one popup/menu instance\n * is reused across a list while a single item remains active at a time.\n *\n * @returns Active-id state, an element registry, and activation helpers.\n */\nexport const useActiveIdRegistry = <\n Id = string | number,\n>(): UseActiveIdRegistryReturn<Id> => {\n const registry = shallowReactive(new Map<Id, HTMLElement>());\n const activeId = ref<Id | null>(null) as Ref<Id | null>;\n\n const register = (id: Id, el: RegisterableElement) => {\n const element = resolveRegisteredElement(el);\n if (element) {\n registry.set(id, element);\n } else {\n registry.delete(id);\n }\n };\n\n const resolve = (id: Id) => registry.get(id) ?? null;\n\n const activate = (id: Id) => {\n activeId.value = id;\n };\n\n const deactivate = () => {\n activeId.value = null;\n };\n\n const isIdActive = (id: Id) => activeId.value === id;\n\n return {\n activeId: readonly(activeId),\n isActive: computed(() => activeId.value !== null),\n activeElement: computed(() =>\n activeId.value !== null ? resolve(activeId.value) : null,\n ),\n register,\n resolve,\n activate,\n deactivate,\n isIdActive,\n };\n};\n","import {\n computed,\n isRef,\n nextTick,\n onScopeDispose,\n ref,\n shallowRef,\n toValue,\n watch,\n type ComponentPublicInstance,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from \"vue\";\n\n/** Kendo Window's stage values. Distinct from browser fullscreen APIs. */\nexport type WindowStage = \"DEFAULT\" | \"MINIMIZED\" | \"FULLSCREEN\";\n\nexport interface WindowMoveEventPayload {\n drag: boolean;\n end: boolean;\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nexport type WindowResizeEventPayload = WindowMoveEventPayload;\n\nexport interface WindowSettings {\n title: string;\n draggable: boolean;\n resizable: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n closable: boolean;\n fixed: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n minimizeButton: boolean;\n /** Hidden via `windowClass`, not a real Kendo prop - see docs \"Inert Props\". */\n maximizeButton: boolean;\n initialLeft?: number;\n initialTop?: number;\n initialWidth: number;\n initialHeight: number;\n width?: number;\n height?: number;\n left?: number;\n top?: number;\n}\n\nexport const WINDOW_SETTINGS_DEFAULTS: WindowSettings = {\n title: \"My Window\",\n draggable: true,\n resizable: true,\n closable: true,\n fixed: true,\n minimizeButton: true,\n maximizeButton: true,\n initialLeft: undefined,\n initialTop: undefined,\n initialWidth: 500,\n initialHeight: 500,\n width: 500,\n height: 500,\n left: undefined,\n top: undefined,\n};\n\nexport interface UseWindowOptions {\n /**\n * Overrides for one or more settings; any field you omit falls back to\n * `WINDOW_SETTINGS_DEFAULTS`, merged internally - you never need to spread\n * the defaults yourself. Pass a `Ref` (e.g. one already wired to your own\n * persistence layer) to have `useWindow` read and mutate it directly\n * instead of creating its own internal ref; missing fields on that ref are\n * filled in from the defaults once, in place, at setup time.\n */\n settings?: Partial<WindowSettings> | Ref<Partial<WindowSettings>>;\n initialStage?: WindowStage;\n /** Enables the native titlebar double-click stage toggle. Defaults to true. */\n titlebarDoubleClick?: MaybeRefOrGetter<boolean>;\n onMove?: (payload: WindowMoveEventPayload) => void;\n onResize?: (payload: WindowResizeEventPayload) => void;\n onStageChange?: (stage: WindowStage) => void;\n onOpen?: () => void;\n onClose?: () => void;\n}\n\n/** The subset of Kendo `Window` props useWindow keeps functional - see docs \"Inert Props\". */\nexport interface WindowBindableProps {\n title: string;\n draggable: boolean;\n resizable: boolean;\n left?: number;\n top?: number;\n initialLeft: number;\n initialTop: number;\n initialWidth: number;\n initialHeight: number;\n width?: number;\n height?: number;\n stage: WindowStage;\n windowClass: string;\n}\n\nexport interface WindowEvents {\n move: (...args: unknown[]) => void;\n resize: (...args: unknown[]) => void;\n stagechange: (...args: unknown[]) => void;\n close: (...args: unknown[]) => void;\n}\n\nexport interface UseWindowOpenOptions {\n /**\n * Discards any existing left/top/width/height (including one restored from\n * an externally-persisted `settings` ref) and recomputes the initial inset\n * position and `initialWidth`/`initialHeight` size. Defaults to `false`, so\n * a previously dragged/resized/persisted position survives close + reopen.\n */\n resetPosition?: boolean;\n}\n\nexport interface UseWindowReturn {\n windowRef: Ref<ComponentPublicInstance | null>;\n settings: Ref<WindowSettings>;\n visible: Ref<boolean>;\n stage: Ref<WindowStage>;\n isDragging: Ref<boolean>;\n isResizing: Ref<boolean>;\n /** Spread via `v-bind` onto `<Window>`. */\n props: ComputedRef<WindowBindableProps>;\n /** Spread via `v-on` onto `<Window>`. */\n events: WindowEvents;\n open: (openOptions?: UseWindowOpenOptions) => Promise<void>;\n close: () => void;\n}\n\nconst isWindowStage = (value: unknown): value is WindowStage =>\n value === \"DEFAULT\" || value === \"MINIMIZED\" || value === \"FULLSCREEN\";\n\n/**\n * Converts a desired right-edge inset into Kendo Window's `initialLeft`\n * coordinate. Kendo exposes no `initialRight` prop, so positioning from the\n * right must be expressed as a left offset. Clamps to zero when the Window is\n * wider than the available viewport.\n */\nconst calculateInitialLeft = (\n viewportWidth: number,\n windowWidth: number,\n rightInset: number,\n) => Math.max(viewportWidth - windowWidth - rightInset, 0);\n\n/**\n * Wraps Kendo UI for Vue's `Window` component (not the browser `window`\n * object) with zero-config defaults, viewport-clamped dragging, and the\n * pointerdown-capture resize/text-selection workaround from\n * docs/design/composable-native-event-listener-tactic.md.\n */\nexport function useWindow(options: UseWindowOptions = {}): UseWindowReturn {\n // Merge WINDOW_SETTINGS_DEFAULTS into whatever the consumer provided.\n // A Ref is filled in place (preserving its identity, e.g. for persistence);\n // a plain partial object seeds a new internal ref.\n if (isRef(options.settings)) {\n options.settings.value = {\n ...WINDOW_SETTINGS_DEFAULTS,\n ...options.settings.value,\n };\n }\n\n const settings: Ref<WindowSettings> = isRef(options.settings)\n ? (options.settings as Ref<WindowSettings>)\n : ref<WindowSettings>({ ...WINDOW_SETTINGS_DEFAULTS, ...options.settings });\n\n const windowRef = shallowRef<ComponentPublicInstance | null>(null);\n const visible = ref(false);\n const stage = ref<WindowStage>(options.initialStage ?? \"DEFAULT\");\n const isDragging = ref(false);\n const isResizing = ref(false);\n const initialLeft = ref(0);\n const initialTop = ref(0);\n\n const open = async (openOptions?: UseWindowOpenOptions) => {\n // No stored left/top means this is the first-ever open - always compute\n // the initial layout then, regardless of resetPosition.\n const hasStoredPosition =\n settings.value.left !== undefined && settings.value.top !== undefined;\n\n if (openOptions?.resetPosition || !hasStoredPosition) {\n const rootFontSize = Number.parseFloat(\n window.getComputedStyle(document.documentElement).fontSize,\n );\n const padding = Number.isFinite(rootFontSize) ? rootFontSize : 16;\n // Non-fixed Windows position in document coordinates (matching\n // handleMove's viewportLeft/viewportTop), so the inset must account for\n // scroll offset or a scrolled page opens the Window off-screen.\n const viewportLeft = settings.value.fixed ? 0 : window.scrollX;\n const viewportTop = settings.value.fixed ? 0 : window.scrollY;\n\n settings.value.left = undefined;\n settings.value.top = undefined;\n settings.value.width = undefined;\n settings.value.height = undefined;\n initialLeft.value =\n settings.value.initialLeft ??\n viewportLeft +\n calculateInitialLeft(\n window.innerWidth,\n settings.value.initialWidth,\n padding,\n );\n initialTop.value = settings.value.initialTop ?? viewportTop + padding;\n visible.value = true;\n\n await nextTick();\n settings.value.width = settings.value.initialWidth;\n settings.value.height = settings.value.initialHeight;\n } else {\n // Persisted/dragged left, top, width, and height are left untouched -\n // Kendo applies them directly via the controlled left/top/width/height props.\n visible.value = true;\n }\n\n options.onOpen?.();\n };\n\n const closeWindow = () => {\n stage.value = \"DEFAULT\";\n visible.value = false;\n options.onClose?.();\n };\n\n const handleStageChange = (...args: unknown[]) => {\n // Kendo emits (nativeEvent, windowInstance, { state }) at runtime despite\n // its .d.ts typing onStagechange as a single-argument callback.\n const payload = args[2];\n\n if (\n typeof payload !== \"object\" ||\n payload === null ||\n !(\"state\" in payload) ||\n !isWindowStage(payload.state)\n ) {\n return;\n }\n\n const requestedStage = payload.state;\n\n if (requestedStage === stage.value) {\n return;\n }\n\n stage.value = requestedStage;\n options.onStageChange?.(requestedStage);\n };\n\n const handleMove = (...args: unknown[]) => {\n const event = args[0];\n\n if (\n typeof event === \"object\" &&\n event !== null &&\n \"drag\" in event &&\n \"left\" in event &&\n \"top\" in event &&\n \"width\" in event &&\n \"height\" in event &&\n typeof event.left === \"number\" &&\n typeof event.top === \"number\" &&\n typeof event.width === \"number\" &&\n typeof event.height === \"number\"\n ) {\n const payload = event as WindowMoveEventPayload;\n const windowRoot = windowRef.value?.$el;\n const titlebar =\n windowRoot instanceof Element\n ? windowRoot.querySelector<HTMLElement>(\".k-window-titlebar\")\n : null;\n const titlebarRect = titlebar?.getBoundingClientRect();\n const titlebarWidth = titlebarRect?.width ?? payload.width;\n const titlebarHeight = titlebarRect?.height ?? payload.height;\n const viewportLeft = settings.value.fixed ? 0 : window.scrollX;\n const viewportTop = settings.value.fixed ? 0 : window.scrollY;\n const viewportRight = viewportLeft + document.documentElement.clientWidth;\n const viewportBottom =\n viewportTop + document.documentElement.clientHeight;\n const maximumLeft = Math.max(viewportRight - titlebarWidth, viewportLeft);\n const maximumTop = Math.max(viewportBottom - titlebarHeight, viewportTop);\n\n settings.value.left = Math.min(\n Math.max(payload.left, viewportLeft),\n maximumLeft,\n );\n settings.value.top = Math.min(\n Math.max(payload.top, viewportTop),\n maximumTop,\n );\n isDragging.value = payload.drag && !payload.end;\n options.onMove?.(payload);\n }\n };\n\n const handleResize = (...args: unknown[]) => {\n const event = args[0];\n\n if (\n typeof event === \"object\" &&\n event !== null &&\n \"drag\" in event &&\n \"left\" in event &&\n \"top\" in event &&\n \"width\" in event &&\n \"height\" in event &&\n typeof event.left === \"number\" &&\n typeof event.top === \"number\" &&\n typeof event.width === \"number\" &&\n typeof event.height === \"number\"\n ) {\n const payload = event as WindowResizeEventPayload;\n settings.value.left = payload.left;\n settings.value.top = payload.top;\n settings.value.width = payload.width;\n settings.value.height = payload.height;\n isResizing.value = payload.drag && !payload.end;\n options.onResize?.(payload);\n }\n };\n\n // Kendo Window's resize-handle drag competes with native text-selection\n // dragging unless the handle's pointerdown default is prevented in the\n // capture phase, before Kendo's own listeners and the browser's default\n // selection-drag both react. See docs/design/composable-native-event-listener-tactic.md.\n const handlePointerDown = (event: PointerEvent) => {\n if (\n event.target instanceof Element &&\n event.target.closest(\".k-resize-handle\")\n ) {\n event.preventDefault();\n }\n };\n\n const handleTitlebarDoubleClick = (event: MouseEvent) => {\n if (toValue(options.titlebarDoubleClick) !== false) {\n return;\n }\n\n if (\n event.target instanceof Element &&\n event.target.closest(\".k-window-titlebar\")\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n let removePointerDownListener: (() => void) | undefined;\n let removeTitlebarDoubleClickListener: (() => void) | undefined;\n\n const removePointerDownWatcher = () => {\n removePointerDownListener?.();\n removePointerDownListener = undefined;\n };\n\n const removeTitlebarDoubleClickWatcher = () => {\n removeTitlebarDoubleClickListener?.();\n removeTitlebarDoubleClickListener = undefined;\n };\n\n watch(\n windowRef,\n (instance) => {\n removePointerDownWatcher();\n removeTitlebarDoubleClickWatcher();\n\n const root = instance?.$el;\n\n if (!(root instanceof HTMLElement)) {\n return;\n }\n\n root.addEventListener(\"pointerdown\", handlePointerDown, {\n capture: true,\n });\n removePointerDownListener = () =>\n root.removeEventListener(\"pointerdown\", handlePointerDown, {\n capture: true,\n });\n\n root.addEventListener(\"dblclick\", handleTitlebarDoubleClick, {\n capture: true,\n });\n removeTitlebarDoubleClickListener = () =>\n root.removeEventListener(\"dblclick\", handleTitlebarDoubleClick, {\n capture: true,\n });\n },\n { flush: \"post\" },\n );\n\n onScopeDispose(removePointerDownWatcher);\n onScopeDispose(removeTitlebarDoubleClickWatcher);\n\n const windowClass = computed(() => {\n const classes: string[] = [\"fk-window\"];\n\n if (settings.value.draggable && stage.value !== \"FULLSCREEN\") {\n classes.push(\"fk-window-can-drag\");\n }\n if (isDragging.value) {\n classes.push(\"fk-window-is-dragging\");\n }\n if (isResizing.value) {\n classes.push(\"fk-window-is-resizing\");\n }\n if (settings.value.fixed) {\n classes.push(\"fk-window-fixed\");\n }\n // Kendo's Window titlebar buttons render unconditionally; hidden via CSS\n // since minimizeButton/maximizeButton/closable only accept a\n // String|Function template in Kendo's own (buggy) prop types.\n if (!settings.value.minimizeButton) {\n classes.push(\"fk-window-hide-minimize\");\n }\n if (!settings.value.maximizeButton) {\n classes.push(\"fk-window-hide-maximize\");\n }\n if (!settings.value.closable) {\n classes.push(\"fk-window-hide-close\");\n }\n\n return classes.join(\" \");\n });\n\n const props = computed<WindowBindableProps>(() => ({\n title: settings.value.title,\n draggable: settings.value.draggable,\n resizable: settings.value.resizable,\n left: settings.value.left,\n top: settings.value.top,\n initialLeft: initialLeft.value,\n initialTop: initialTop.value,\n initialWidth: settings.value.initialWidth,\n initialHeight: settings.value.initialHeight,\n width: settings.value.width,\n height: settings.value.height,\n stage: stage.value,\n windowClass: windowClass.value,\n }));\n\n const events: WindowEvents = {\n move: handleMove,\n resize: handleResize,\n stagechange: handleStageChange,\n close: closeWindow,\n };\n\n return {\n windowRef,\n settings,\n visible,\n stage,\n isDragging,\n isResizing,\n props,\n events,\n open,\n close: closeWindow,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\n\nexport type ChangePayload = { value: Date | null; event: any };\n\nexport function useMaskedDateInput(args: {\n id: string;\n onChange: (p: ChangePayload) => void;\n onShowCalendar: (e: KeyboardEvent) => void;\n externalValue?: Ref<string | Date | null | undefined>;\n min?: Date | null | undefined;\n max?: Date | null | undefined;\n /** When true, empty/incomplete value is considered invalid after blur */\n required?: boolean;\n /** Optional default date for this field (e.g., today). */\n defaultValue?: Date | null;\n dateFormat?: string;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const placeholder = ref<string>(args.dateFormat ?? \"mm/dd/yyyy\");\n const isRequired = computed(() => !!args.required);\n const MIN_YEAR = 1000;\n const isTouched = ref(false);\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"];\n\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n\n const datePart = (pos: number) => {\n if (pos <= 2) return \"mm\";\n if (pos <= 5) return \"dd\";\n if (digitsOnly.value.length <= 10) return \"yyyy\";\n return \"mm\";\n };\n\n const month = computed(() => {\n const m = raw.value\n ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(m).toString().padStart(2, \"0\");\n });\n const day = computed(() => {\n const d = raw.value\n ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(d).toString().padStart(2, \"0\");\n });\n const year = computed(() => {\n const y = raw.value\n ? raw.value.substring(6, 10).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n return parseInt(y).toString().padStart(4, \"0\");\n });\n\n const emitParsedIfComplete = (event: any) => {\n if (digitsOnly.value.length === 0) {\n args.onChange({ value: null, event });\n return;\n }\n if (digitsOnly.value.length < 8) {\n args.onChange({ value: null, event });\n return;\n }\n if ((raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8) {\n const [mmStr, ddStr, yyyyStr] = raw.value.split(\"/\");\n const mm = parseInt(mmStr);\n const dd = parseInt(ddStr);\n const yyyy = parseInt(yyyyStr);\n // Prevent auto-correction: only emit if parts are a real calendar date\n if (isValidParts(yyyy, mm, dd)) {\n const d = createDate(yyyy, mm, dd);\n if (inRange(d)) {\n args.onChange({ value: d, event });\n } else {\n args.onChange({ value: null, event });\n }\n } else {\n args.onChange({ value: null, event });\n }\n }\n };\n const inRange = (d: Date) => {\n const min = args.min ?? undefined;\n const max = args.max ?? undefined;\n if (min && d < min) return false;\n if (max && d > max) return false;\n return true;\n };\n\n const parsedRawDate = computed<Date | null>(() => {\n if ((raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8) {\n const [mmStr, ddStr, yyyyStr] = (raw.value ?? \"\").split(\"/\");\n const mm = parseInt(mmStr);\n const dd = parseInt(ddStr);\n const yyyy = parseInt(yyyyStr);\n if (isValidParts(yyyy, mm, dd)) {\n return createDate(yyyy, mm, dd);\n }\n }\n return null;\n });\n\n const isComplete = computed(() => {\n return (raw.value ?? \"\").length === 10 && digitsOnly.value.length === 8;\n });\n\n // Helpers to centralize validity checks and baseline selection\n const createDate = (yy: number, mm: number, dd: number) => {\n const date = new Date(0);\n date.setFullYear(yy, mm - 1, dd);\n date.setHours(0, 0, 0, 0);\n return date;\n };\n\n const daysInMonth = (yy: number, mm: number) => {\n return createDate(yy, mm + 1, 0).getDate();\n };\n\n const isValidParts = (yy: number, mm: number, dd: number) => {\n return (\n mm >= 1 &&\n mm <= 12 &&\n yy >= MIN_YEAR &&\n dd >= 1 &&\n dd <= daysInMonth(yy, mm)\n );\n };\n\n const handleChange = (event: any): void => {\n raw.value = event.value as string;\n const src = event.event?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n let m = parseInt(month.value);\n let d = parseInt(day.value);\n let y = parseInt(year.value);\n\n // If input is invalid or incomplete, set to today's date and ignore the step\n const hasEightDigits = digitsOnly.value.length >= 8;\n if (!hasEightDigits || !isValidParts(y, m, d)) {\n const today = args.defaultValue ?? new Date();\n m = today.getMonth() + 1;\n d = today.getDate();\n y = today.getFullYear();\n raw.value = `${String(m).padStart(2, \"0\")}/${String(d).padStart(\n 2,\n \"0\",\n )}/${String(y)}`;\n\n const setDate = createDate(y, m, d);\n args.onChange({ value: inRange(setDate) ? setDate : null, event });\n\n focusAndRestore({ useRAF: true });\n return;\n }\n\n const part = datePart(pos);\n\n if (part === \"mm\") {\n m = direction === \"ArrowUp\" ? (m < 12 ? m + 1 : 1) : m > 1 ? m - 1 : 12;\n } else if (part === \"dd\") {\n const days = new Date(y, m, 0).getDate();\n d =\n direction === \"ArrowUp\" ? (d < days ? d + 1 : 1) : d > 1 ? d - 1 : days;\n } else if (part === \"yyyy\") {\n y = direction === \"ArrowUp\" ? y + 1 : Math.max(1, y - 1);\n }\n\n raw.value = `${String(m).padStart(2, \"0\")}/${String(d).padStart(\n 2,\n \"0\",\n )}/${String(y)}`;\n\n const [mmStr, ddStr, yyyyStr] = raw.value.split(\"/\");\n const steppedDate = createDate(\n parseInt(yyyyStr),\n parseInt(mmStr),\n parseInt(ddStr),\n );\n if (\n steppedDate.toString() !== \"Invalid Date\" &&\n parseInt(yyyyStr) >= 1000\n ) {\n args.onChange({\n value: inRange(steppedDate) ? steppedDate : null,\n event,\n });\n } else {\n args.onChange({ value: null, event });\n }\n\n focusAndRestore({ useRAF: true });\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.code === \"Space\" || event.key === \" \") {\n // Justified: Space opens the calendar popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n // Alt+Down opens the menu; allow Alt combos to pass through\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the calendar popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n // Justified: ArrowUp/Down act as date-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Map mouse wheel to stepper behavior (up/down) based on caret segment\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n const src = event.target as HTMLInputElement;\n if (cursorKeys.includes(event.key)) {\n // Do not prevent default for caret navigation\n cursorPos.value = src?.selectionStart ?? 0;\n return;\n }\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const handleBlur = (event: FocusEvent): void => {\n isTouched.value = true;\n\n // If required, no default provided, and value is still undefined/blank,\n // coerce external value from undefined -> \"\" so downstream validation\n // treats this as an incomplete required field.\n if (\n isRequired.value &&\n !args.defaultValue &&\n args.externalValue &&\n args.externalValue.value === undefined &&\n digitsOnly.value.length === 0\n ) {\n (args.externalValue as Ref<any>).value = \"\";\n }\n\n // Also ensure caret position is captured on blur\n const src = event.target as HTMLInputElement | null;\n if (src) {\n cursorPos.value = src.selectionStart ?? 0;\n }\n };\n\n // Centralized focus + caret restore helper to avoid duplicated logic.\n const focusAndRestore = (opts?: {\n /** milliseconds to delay the focus (useful to wait for popups to close) */\n delay?: number;\n /** when true, use requestAnimationFrame to schedule the focus */\n useRAF?: boolean;\n /** explicit caret position override; otherwise uses `cursorPos` or end */\n pos?: number | undefined;\n }) => {\n const run = () => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (!inputEl) return;\n const p = opts?.pos ?? cursorPos.value ?? inputEl.value.length;\n try {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n } catch {\n // ignore if element not focusable or selection not supported\n }\n };\n\n nextTick(() => {\n if (opts?.delay && opts.delay > 0) {\n setTimeout(run, opts.delay);\n return;\n }\n if (opts?.useRAF) {\n requestAnimationFrame(run);\n return;\n }\n run();\n });\n };\n\n // Sync external value into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n if (newVal) {\n const date = new Date(newVal as any);\n if (date.toString() !== \"Invalid Date\") {\n const m = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const d = date.getDate().toString().padStart(2, \"0\");\n const y = date.getFullYear().toString();\n raw.value = `${m}/${d}/${y}`;\n\n // When external value is updated (e.g., user selects a date\n // from the calendar), refocus the input and restore caret.\n // Delay slightly to avoid Kendo calendar focus/DOM operations\n // overriding our focus call.\n focusAndRestore({ delay: 50 });\n return;\n }\n }\n // If external value is null/invalid, keep current raw as-is\n },\n { immediate: true },\n );\n }\n\n const debugLines = computed(() => {\n return [\n [\"Date\", `${month.value} / ${day.value} / ${year.value}`],\n [\"Digits only\", digitsOnly.value],\n [\n \"min\",\n args.min?.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }) ?? null,\n ],\n [\n \"max\",\n args.max?.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }) ?? null,\n ],\n ];\n });\n\n // Range validation based on provided min/max and current external value\n const isValid = computed(() => {\n // Optional field preserves existing forgiving behavior\n if (!isRequired.value) {\n if (!isComplete.value) return true;\n const candidate = parsedRawDate.value;\n if (!candidate) return false; // complete but invalid parts\n return inRange(candidate);\n }\n\n // Required field: do not flag invalid until after blur\n if (!isTouched.value) return true;\n\n const candidate = parsedRawDate.value;\n if (!isComplete.value) return false; // incomplete after blur\n if (!candidate) return false; // complete but invalid parts\n return inRange(candidate);\n });\n\n const reason = computed<string | undefined>(() => {\n // When not required, only report reasons for completed-but-bad values\n if (!isRequired.value) {\n if (!isComplete.value) return undefined;\n const candidate = parsedRawDate.value;\n if (!candidate) return \"invalid-date\";\n if (!inRange(candidate)) return \"out-of-bounds\";\n return \"valid\";\n }\n\n // Required: only validate after blur\n if (!isTouched.value) return undefined;\n\n if (digitsOnly.value.length === 0 || !isComplete.value) {\n return \"incomplete\";\n }\n\n const candidate = parsedRawDate.value;\n if (!candidate) return \"invalid-date\";\n if (!inRange(candidate)) return \"out-of-bounds\";\n return \"valid\";\n });\n\n const validationMessage = computed(() => {\n const r = reason.value;\n if (!r || r === \"valid\") return \"\";\n\n if (r === \"incomplete\") {\n return \"Required\";\n }\n\n if (r === \"invalid-date\") {\n return `Must be in ${placeholder.value} format.`;\n }\n\n const minStr = args.min\n ? args.min.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n })\n : null;\n const maxStr = args.max\n ? args.max.toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n })\n : null;\n if (r === \"out-of-bounds\") {\n if (minStr && maxStr) return `Must be between ${minStr} and ${maxStr}.`;\n if (minStr) return `Must be on or after ${minStr}.`;\n if (maxStr) return `Must be on or before ${maxStr}.`;\n }\n\n return \"\";\n });\n\n const initStyling = () => {\n // Adds our `fk-datepicker` class to the parent of the Kendo datepicker\n // This is separated so callers can invoke styling on demand.\n nextTick(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n\n if (!inputEl) {\n console.warn(`ID (#${args.id}) not found for styling.`);\n return;\n }\n const datePicker = inputEl.closest(\".k-datepicker\");\n if (!datePicker) {\n console.warn(`.k-datepicker parent not found for #${args.id} styling.`);\n return;\n }\n\n // Add class to parent to avoid it being wiped away by Kendo's DOM manipulation\n const parent = datePicker.parentElement;\n if (parent) {\n // Idempotent: if we've already added our class, do nothing.\n if (parent.classList.contains(\"fk-datepicker\")) {\n return;\n }\n parent.classList.add(\"fk-datepicker\");\n } else {\n console.warn(\n `Parent of .k-datepicker not found for #${args.id} styling.`,\n );\n }\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n return {\n raw,\n cursorPos,\n debugEnabled,\n debugLines,\n placeholder,\n isValid,\n reason: readonly(reason),\n validationMessage,\n digitsOnly,\n month: readonly(month),\n day: readonly(day),\n year: readonly(year),\n datePart,\n handleChange,\n handleKeyDown,\n handleWheel,\n handleKeyUp,\n handleClick,\n handleBlur,\n // Expose so consumers can re-run styling when needed\n initStyling,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\nimport type { SelectionRange } from \"@progress/kendo-vue-dateinputs\";\n\nexport type RangeChangePayload = { value: SelectionRange | null; event: any };\n\ntype Part = \"mm\" | \"dd\" | \"yyyy\";\n\ntype Side = \"start\" | \"end\";\n\nexport function useMaskedDateRangeInput(args: {\n id: string; // id of the MaskedTextBox input element\n onChange: (p: RangeChangePayload) => void;\n onShowCalendar: (e: KeyboardEvent) => void;\n externalValue?: Ref<SelectionRange | null | undefined>;\n externalValid?: Ref<boolean | undefined>;\n manageValid?: boolean; // default true: mirror computed validity into externalValid\n maxSpanDays?: number; // optional maximum allowed span between start and end (in days)\n min?: Date;\n max?: Date;\n allowReverse?: boolean; // default false\n // Popup control hooks\n isOpen?: Ref<boolean>;\n onRequestClose?: () => void;\n closeDelay?: Ref<number> | number;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const calendarChanged = ref<boolean>(false);\n\n const ONE_DAY = 24 * 60 * 60 * 1000;\n const ONE_YEAR = 365 * ONE_DAY;\n const TODAY = new Date();\n const MIN_DATE = new Date(TODAY.getTime() - ONE_YEAR);\n const MAX_DATE = new Date(TODAY.getTime() + ONE_YEAR);\n\n args.min = args.min ?? MIN_DATE;\n args.max = args.max ?? MAX_DATE;\n\n // Define helpers early to avoid \"used before initialization\" issues\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n const daysInMonth = (yy: number, mm: number) => new Date(yy, mm, 0).getDate();\n const isValidParts = (yy: number, mm: number, dd: number) => {\n return (\n mm >= 1 && mm <= 12 && yy >= 1000 && dd >= 1 && dd <= daysInMonth(yy, mm)\n );\n };\n // Compare dates by date-only (UTC midnight) to avoid time-of-day issues\n const toUtcMidnightMs = (d: Date) =>\n Date.UTC(d.getFullYear(), d.getMonth(), d.getDate());\n const clampToMinMax = (d: Date | null): Date | null => {\n if (!d) return null;\n // default to 90days ago if min/max not provided\n const min = args.min ?? new Date(Date.now() - 90 * ONE_DAY);\n // default to today\n const max = args.max ?? new Date();\n const dMs = toUtcMidnightMs(d);\n if (dMs < toUtcMidnightMs(min) || dMs > toUtcMidnightMs(max)) return null;\n return d;\n };\n const rangeIsOrdered = (start: Date, end: Date) => {\n return (args.allowReverse ?? false) ? true : start <= end;\n };\n const maskComplete = computed(() => {\n return (raw.value?.length ?? 0) >= 23 && digitsOnly.value.length >= 16;\n });\n\n const parseFromRaw = (\n s: string,\n ): { start: Date | null; end: Date | null } => {\n // Expect MM/DD/YYYY - MM/DD/YYYY\n if ((s ?? \"\").length < 23 || digitsOnly.value.length < 16)\n return { start: null, end: null };\n const left = s.substring(0, 10);\n const right = s.substring(13, 23);\n const [mm1, dd1, yyyy1] = left\n .split(\"/\")\n .map((x) => parseInt(x || \"0\", 10));\n const [mm2, dd2, yyyy2] = right\n .split(\"/\")\n .map((x) => parseInt(x || \"0\", 10));\n const sDate = new Date(yyyy1, mm1 - 1, dd1);\n const eDate = new Date(yyyy2, mm2 - 1, dd2);\n const sOk =\n isValidParts(yyyy1, mm1, dd1) && sDate.toString() !== \"Invalid Date\";\n const eOk =\n isValidParts(yyyy2, mm2, dd2) && eDate.toString() !== \"Invalid Date\";\n return { start: sOk ? sDate : null, end: eOk ? eDate : null };\n };\n\n // validity state shared with consumer when provided\n // Initialize to true to avoid showing validation errors before first blur\n const valid = args.externalValid ?? ref<boolean | undefined>(true);\n // Derived validity and reason\n const parsed = computed(() => parseFromRaw(raw.value));\n const clamped = computed(() => {\n const s = clampToMinMax(parsed.value.start);\n const e = clampToMinMax(parsed.value.end);\n return { start: s, end: e };\n });\n\n // Span in days between clamped start/end; undefined when incomplete or out-of-bounds\n const spanDays = computed<number | undefined>(() => {\n if (!maskComplete.value) return undefined;\n const s = clamped.value.start;\n const e = clamped.value.end;\n if (!s || !e) return undefined;\n const diffMs = Math.abs(toUtcMidnightMs(e) - toUtcMidnightMs(s));\n return Math.round(diffMs / 86400000 + 1); // NOTE: FEATHER-1155\n });\n\n // Set on first blur/clear; nothing is flagged before the user leaves the field\n const isTouched = ref(false);\n\n const reasonComputed = computed<string | undefined>(() => {\n if (!isTouched.value) return undefined;\n\n const { start, end } = parsed.value;\n if (!maskComplete.value) return \"incomplete\";\n if (!start || !end) return \"invalid-date\";\n if (!clamped.value.start || !clamped.value.end) return \"out-of-bounds\";\n const s = clamped.value.start;\n const e = clamped.value.end;\n if (!rangeIsOrdered(s, e)) return \"reversed-range\";\n if (typeof args.maxSpanDays === \"number\" && spanDays.value !== undefined) {\n if (spanDays.value > args.maxSpanDays) return \"span-exceeds-limit\";\n }\n return \"valid\";\n });\n\n const validComputed = computed<boolean | undefined>(() => {\n const r = reasonComputed.value;\n return r === undefined || r === \"valid\";\n });\n\n // User-facing validation message derived from the same live reason as validComputed\n const validationMessage = computed<string>(() => {\n const { min, max } = args;\n const r = reasonComputed.value;\n\n if (!r) return \"\";\n\n switch (r) {\n case \"incomplete\":\n return \"Required\";\n case \"invalid-date\":\n return \"One or both dates invalid.\";\n case \"reversed-range\":\n return \"End Date must be on or after Start Date.\";\n case \"out-of-bounds\":\n if (min && max) {\n return `Dates must be between ${formatDate(min)} and ${formatDate(max)}.`;\n }\n return \"Dates must be within the allowed range.\";\n case \"span-exceeds-limit\":\n return typeof args.maxSpanDays === \"number\"\n ? `Date range exceeds ${args.maxSpanDays} days.`\n : \"Date range exceeds maximum allowed span.\";\n case \"valid\":\n default:\n return \"\";\n }\n });\n // // Mirror computed validity into external ref when enabled\n // watch(\n // validComputed,\n // (v) => {\n // if (args.manageValid ?? true) {\n // valid.value = v;\n // }\n // },\n // { immediate: true },\n // );\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"]; // tracked to keep caret\n\n const fmt = (n: number, w: number) => String(n).padStart(w, \"0\");\n const formatDate = (d: Date) =>\n `${fmt(d.getMonth() + 1, 2)}/${fmt(d.getDate(), 2)}/${fmt(\n d.getFullYear(),\n 4,\n )}`;\n\n // rangeIsOrdered declared earlier\n\n const datePartForPos = (pos: number): { side: Side; part: Part } => {\n // Mask: 00/00/0000 - 00/00/0000\n // Index map (digits start at 0..9 for start, 13..22 for end)\n if (pos <= 2) return { side: \"start\", part: \"mm\" };\n if (pos <= 5) return { side: \"start\", part: pos <= 3 ? \"dd\" : \"dd\" };\n if (pos <= 11) return { side: \"start\", part: \"yyyy\" };\n if (pos <= 15) return { side: \"end\", part: \"mm\" };\n if (pos <= 18) return { side: \"end\", part: \"dd\" };\n return { side: \"end\", part: \"yyyy\" };\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n\n // Current parsed values\n const { start, end } = parseFromRaw(raw.value);\n\n // If SelectionRange is null/undefined (both sides missing), default to today and ignore the step\n if (!start && !end) {\n const today = new Date();\n const tStr = formatDate(today);\n raw.value = `${tStr} - ${tStr}`;\n args.onChange({ value: { start: today, end: today }, event });\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n return;\n }\n\n // Build baseline from user's parsed input; clamp only when emitting\n const today = new Date();\n\n const which = datePartForPos(pos);\n\n // Baseline dates: prefer parsed values (even if out-of-bounds); otherwise today\n let s = start ? new Date(start) : new Date(today);\n let e = end ? new Date(end) : new Date(today);\n\n const mutate = (d: Date, part: Part) => {\n if (part === \"mm\") {\n const m = d.getMonth() + 1;\n const next =\n direction === \"ArrowUp\" ? (m < 12 ? m + 1 : 1) : m > 1 ? m - 1 : 12;\n d.setMonth(next - 1);\n // Fix day overflow after month change\n const days = daysInMonth(d.getFullYear(), next);\n if (d.getDate() > days) d.setDate(days);\n } else if (part === \"dd\") {\n const days = daysInMonth(d.getFullYear(), d.getMonth() + 1);\n const day = d.getDate();\n const next =\n direction === \"ArrowUp\"\n ? day < days\n ? day + 1\n : 1\n : day > 1\n ? day - 1\n : days;\n d.setDate(next);\n } else if (part === \"yyyy\") {\n const y = d.getFullYear();\n d.setFullYear(direction === \"ArrowUp\" ? y + 1 : Math.max(1, y - 1));\n // Fix Feb 29 overflow, etc.\n const days = daysInMonth(d.getFullYear(), d.getMonth() + 1);\n if (d.getDate() > days) d.setDate(days);\n }\n };\n\n if (which.side === \"start\") mutate(s, which.part);\n else mutate(e, which.part);\n\n // Compose new raw string: keep the untouched side as-is from current raw if parseable\n const sText = formatDate(s);\n const eText = formatDate(e);\n raw.value = `${sText} - ${eText}`;\n\n // Emit if valid and ordered and within min/max; else null\n const sClamped = clampToMinMax(s);\n const eClamped = clampToMinMax(e);\n if (sClamped && eClamped && rangeIsOrdered(sClamped, eClamped)) {\n args.onChange({ value: { start: sClamped, end: eClamped }, event });\n } else {\n args.onChange({ value: null, event });\n }\n\n // Restore caret\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n };\n\n const emitParsedIfComplete = (event: any) => {\n const { start, end } = parseFromRaw(raw.value);\n if (!start || !end) {\n args.onChange({ value: null, event });\n return;\n }\n const sClamped = clampToMinMax(start);\n const eClamped = clampToMinMax(end);\n if (!sClamped || !eClamped) {\n args.onChange({ value: null, event });\n return;\n }\n if (!rangeIsOrdered(sClamped, eClamped)) {\n args.onChange({ value: null, event });\n return;\n }\n args.onChange({ value: { start: sClamped, end: eClamped }, event });\n };\n\n const handleChange = (event: any): void => {\n const newValue = (event.value ?? \"\") as string;\n const originalEvent = event.event as Event | undefined;\n\n // No clear event handler from Kendo...\n // Kendo's clear button sets the value to empty and raises change;\n // treat that as an explicit clear action.\n if (!newValue && originalEvent && (originalEvent as any).type === \"click\") {\n handleClear(originalEvent);\n return;\n }\n\n raw.value = newValue;\n const src = originalEvent?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n // Do not coerce user's input; only emit parsed range when complete and valid\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n // Space already opens calendar\n if (event.code === \"Space\" || event.key === \" \") {\n // Do not let Space modify the input; only open the calendar\n // Justified: Space opens the calendar popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n // Alt + ArrowDown: open calendar popup without changing the value via stepper\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the calendar popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowCalendar(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n // Justified: ArrowUp/Down act as range-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n if (cursorKeys.includes(event.key) || steppers.includes(event.key)) {\n const src = event.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const applyBlurValidation = () => {\n isTouched.value = true;\n\n if (args.manageValid ?? true) {\n valid.value = validComputed.value;\n }\n };\n\n const handleBlur = (_event: FocusEvent): void => {\n applyBlurValidation();\n };\n\n const handleClear = (event?: Event): void => {\n raw.value = \"\";\n cursorPos.value = 0;\n\n // Emit cleared range to consumer\n args.onChange({ value: null, event });\n\n // Run the same validation flow as on blur\n applyBlurValidation();\n\n // Return focus to the masked input so the user can retype\n nextTick(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(0, 0);\n }\n });\n };\n\n // Sync external range into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n const start = newVal?.start ?? null;\n const end = newVal?.end ?? null;\n if (start && end) {\n raw.value = `${formatDate(start)} - ${formatDate(end)}`;\n // If the change originated from calendar and popup is open, request close\n if (\n args.isOpen?.value &&\n calendarChanged.value &&\n args.onRequestClose\n ) {\n const delay =\n typeof args.closeDelay === \"number\"\n ? args.closeDelay\n : (args.closeDelay?.value ?? 0);\n setTimeout(() => {\n args.onRequestClose?.();\n calendarChanged.value = false;\n applyBlurValidation();\n }, delay);\n }\n return;\n }\n // If external is null/invalid, keep current raw as-is to preserve user's typing\n },\n { immediate: true },\n );\n }\n\n const month1 = computed(() =>\n raw.value ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const day1 = computed(() =>\n raw.value ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const year1 = computed(() =>\n raw.value ? raw.value.substring(6, 10).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const month2 = computed(() =>\n raw.value ? raw.value.substring(13, 15).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const day2 = computed(() =>\n raw.value ? raw.value.substring(16, 18).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n const year2 = computed(() =>\n raw.value ? raw.value.substring(19, 23).replace(/\\D/g, \"0\") || \"0\" : \"0\",\n );\n\n const debugLines = computed((): Array<{ label: string; value: string }> => {\n const { start, end } = parseFromRaw(raw.value);\n return [\n {\n label: \"Raw\",\n value: raw.value,\n },\n {\n label: \"Min Date\",\n value: `${args.min ? args.min.toDateString() : \"-\"}`,\n },\n {\n label: \"Max Date\",\n value: `${args.max ? args.max.toDateString() : \"-\"}`,\n },\n {\n label: \"Start\",\n value: `${String(month1.value).padStart(2, \"0\")} / ${String(\n day1.value,\n ).padStart(2, \"0\")} / ${String(year1.value).padStart(4, \"0\")}`,\n },\n {\n label: \"End\",\n value: `${String(month2.value).padStart(2, \"0\")} / ${String(\n day2.value,\n ).padStart(2, \"0\")} / ${String(year2.value).padStart(4, \"0\")}`,\n },\n { label: \"Digits only\", value: digitsOnly.value },\n { label: \"Mask complete\", value: `${maskComplete.value}` },\n {\n label: \"Parsed\",\n value: `${start ? start.toDateString() : \"-\"} | ${\n end ? end.toDateString() : \"-\"\n }`,\n },\n {\n label: \"Valid (managed)\",\n value: `${valid.value ?? \"-\"}`,\n },\n { label: \"Span (days)\", value: `${spanDays.value ?? \"-\"}` },\n {\n label: \"Reason\",\n value: `${reasonComputed.value ?? \"-\"}`,\n },\n {\n label: \"Cursor in\",\n value: `${cursorPos.value ?? \"-\"} (${(() => {\n const p = cursorPos.value ?? 0;\n const w = datePartForPos(p);\n return `${w.side}.${w.part}`;\n })()})`,\n },\n ];\n });\n\n const initStyling = () => {\n // Idempotent application of the `fk-daterangepicker` class to the input's parent\n nextTick(() => {\n const rangeInput = document.getElementById(args.id) as HTMLElement | null;\n if (!rangeInput) {\n console.warn(`#${args.id} not found for styling.`);\n return;\n }\n const parentDiv = rangeInput.closest(\"div\");\n if (!parentDiv) {\n console.warn(`Parent div of #${args.id} not found for styling.`);\n return;\n }\n if (parentDiv.classList.contains(\"fk-daterangepicker\")) return;\n parentDiv.classList.add(\"fk-daterangepicker\");\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n // Accessibility fix: ensure only one month grid has tabIndex=0\n const calendarMonthTabIndexFix = () => {\n nextTick(() => {\n try {\n const containers = Array.from(\n document.querySelectorAll(\".k-animation-container\"),\n ) as HTMLElement[];\n if (!containers.length) return;\n\n // Prefer the most recently added visible container that has a calendar\n const candidate = [...containers]\n .reverse()\n .find((c) => c.querySelector(\".k-calendar\"));\n const calendarRoot = candidate?.querySelector(\n \".k-calendar\",\n ) as HTMLElement | null;\n if (!calendarRoot) return;\n\n const months = calendarRoot.querySelectorAll(\n \".k-calendar-table\",\n ) as NodeListOf<HTMLElement>;\n let foundTab0 = false;\n months.forEach((m) => {\n if (m.tabIndex === 0) {\n if (!foundTab0) {\n foundTab0 = true;\n } else {\n m.tabIndex = -1;\n }\n }\n });\n } catch (e) {\n // no-op; defensive\n console.warn(e);\n }\n });\n };\n\n // When popup opens, run the fix after render\n if (args.isOpen) {\n watch(\n args.isOpen,\n (open) => {\n if (open) {\n // Allow popup DOM to mount first\n setTimeout(() => calendarMonthTabIndexFix(), 0);\n }\n },\n { immediate: false },\n );\n }\n\n return {\n raw,\n cursorPos,\n debugEnabled: debugEnabled,\n debugLines: debugLines,\n digitsOnly: digitsOnly,\n valid,\n validComputed: readonly(validComputed),\n reason: readonly(reasonComputed),\n validationMessage: readonly(validationMessage),\n spanDays: readonly(spanDays),\n month1: readonly(month1),\n day1: readonly(day1),\n year1: readonly(year1),\n month2: readonly(month2),\n day2: readonly(day2),\n year2: readonly(year2),\n handleChange,\n handleKeyDown,\n handleWheel,\n handleKeyUp,\n handleClick,\n handleBlur,\n handleClear,\n onCalendarChange: () => {\n calendarChanged.value = true;\n },\n initStyling,\n };\n}\n","import {\n computed,\n nextTick,\n onMounted,\n readonly,\n ref,\n watch,\n type Ref,\n} from \"vue\";\n\nexport type ChangePayload = { value: Date | null; event: any };\n\ntype PopupAction = \"now\" | \"set\" | null;\ntype AnyArgsHandler = (...args: unknown[]) => void;\n\nexport function useMaskedTimeInput(args: {\n id: string;\n onChange: (p: ChangePayload) => void;\n onShowPicker: (e: KeyboardEvent) => void;\n externalValue?: Ref<string | Date | null | undefined>;\n // Minute stepping granularity for ArrowUp/ArrowDown when focused in minutes.\n // Supported values: 1, 5, 10, 15, 20, 30. If not provided, defaults to 1-minute steps.\n minuteStep?: 1 | 5 | 10 | 15 | 20 | 30;\n // Reactive alternative: pass a Ref to allow dynamic updates at runtime.\n minuteStepRef?: Ref<1 | 5 | 10 | 15 | 20 | 30 | undefined>;\n timeFormat?: string;\n min?: Date | null | undefined;\n max?: Date | null | undefined;\n /** When true, empty/incomplete value is considered invalid after blur */\n required?: boolean;\n debug?: boolean;\n}) {\n const raw = ref(\"\");\n const cursorPos = ref<number | undefined>(undefined);\n const debugEnabled = ref<boolean>(!!args.debug);\n const placeholder = ref<string>(args.timeFormat ?? \"hh:mm AM\");\n const isRequired = computed(() => !!args.required);\n const isTouched = ref(false);\n\n const steppers: string[] = [\"ArrowUp\", \"ArrowDown\"];\n const cursorKeys: string[] = [\"ArrowLeft\", \"ArrowRight\"];\n\n const digitsOnly = computed(() => (raw.value ?? \"\").replace(/\\D/g, \"\"));\n\n // Mask rules to be used by MaskedTextBox\n // Relax numeric constraints: allow any digits, then validate afterwards\n const rules = {\n H: /[0-9]/,\n h: /[0-9]/,\n M: /[0-9]/,\n m: /[0-9]/,\n A: /[AaPp]/,\n a: /[Mm]/,\n } as const;\n\n const partAt = (pos: number) => {\n if (pos <= 2) return \"hh\"; // hours\n if (pos <= 5) return \"mm\"; // minutes\n return \"ampm\"; // AM/PM\n };\n\n const hour = computed(() => {\n const h = raw.value\n ? raw.value.substring(0, 2).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n const v = parseInt(h);\n return Math.min(Math.max(v, 0), 23); // keep as 0-23 for parsing convenience\n });\n const minute = computed(() => {\n const m = raw.value\n ? raw.value.substring(3, 5).replace(/\\D/g, \"0\") || \"0\"\n : \"0\";\n const v = parseInt(m);\n return Math.min(Math.max(v, 0), 59);\n });\n const period = computed(() => {\n const p = (raw.value?.substring(6, 8) || \"AM\").toUpperCase();\n return p.startsWith(\"P\") ? \"PM\" : \"AM\";\n });\n\n const hour24 = computed(() => {\n const h12 = parseInt(raw.value?.substring(0, 2).replace(/\\D/g, \"0\") || \"0\");\n const p = period.value;\n\n // Convert 12-hour to 24-hour format\n if (h12 === 12) {\n return p === \"AM\" ? 0 : 12;\n }\n return p === \"PM\" ? h12 + 12 : h12;\n });\n\n const time24 = computed(() => {\n if (!isComplete.value) return null;\n return `${String(hour24.value).padStart(2, \"0\")}:${String(minute.value).padStart(2, \"0\")}:00`;\n });\n\n const isComplete = computed(() =>\n /^(\\d{2}):(\\d{2})\\s([AP]M)$/i.test(raw.value ?? \"\"),\n );\n\n const toDisplay = (h24: number, m: number, ap: \"AM\" | \"PM\") => {\n // display uses 12-hour formatting in the field\n let h12 = h24 % 12;\n if (h12 === 0) h12 = 12;\n return `${String(h12).padStart(2, \"0\")}:${String(m).padStart(\n 2,\n \"0\",\n )} ${ap}`;\n };\n\n const toDateFromDisplay = (display: string) => {\n const match = display.match(/^(\\d{2}):(\\d{2})\\s([AP]M)$/i);\n if (!match) return null;\n const hh = parseInt(match[1]);\n const mm = parseInt(match[2]);\n const ap = match[3].toUpperCase();\n // Enforce 12-hour bounds and minute bounds; reject invalid formats like 99:99 AM\n if (hh < 1 || hh > 12 || mm < 0 || mm > 59) return null;\n let h24 = hh % 12;\n if (ap === \"PM\") h24 += 12;\n const d = new Date();\n d.setSeconds(0, 0);\n d.setHours(h24);\n d.setMinutes(mm);\n return d;\n };\n\n const emitParsedIfComplete = (event: any) => {\n if (digitsOnly.value.length === 0) {\n args.onChange({ value: null, event });\n return;\n }\n if (!isComplete.value) {\n args.onChange({ value: null, event });\n return;\n }\n const date = toDateFromDisplay(raw.value);\n if (date && inRangeTime(date)) {\n args.onChange({ value: date, event });\n } else {\n args.onChange({ value: null, event });\n }\n };\n const minutesSinceMidnight = (d: Date) => d.getHours() * 60 + d.getMinutes();\n const inRangeTime = (d: Date) => {\n const min = args.min ?? undefined;\n const max = args.max ?? undefined;\n const m = minutesSinceMidnight(d);\n if (min) {\n const minM = minutesSinceMidnight(min);\n if (m < minM) return false;\n }\n if (max) {\n const maxM = minutesSinceMidnight(max);\n if (m > maxM) return false;\n }\n return true;\n };\n\n const syncRawFromDate = (date: Date) => {\n const h24 = date.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, date.getMinutes(), ap);\n };\n\n const emitValue = (value: Date | null, event: any) => {\n args.onChange({ value, event });\n };\n\n const focusInputAfterPopupClose = () => {\n // Defer focus long enough for the popup close lifecycle to complete.\n nextTick(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n const end = (inputEl.value ?? \"\").length;\n inputEl.setSelectionRange(end, end);\n }\n });\n });\n });\n };\n\n const inferPopupAction = (event: any): PopupAction => {\n const target = event?.event?.target as HTMLElement | null | undefined;\n if (!target) return null;\n if (target.closest(\".k-time-now\")) return \"now\";\n if (target.closest(\".k-time-accept\")) return \"set\";\n return null;\n };\n\n const emitParsedDate = (date: Date | null, event: any) => {\n if (date && inRangeTime(date)) {\n emitValue(date, event);\n } else {\n emitValue(null, event);\n }\n };\n\n const handleChange: AnyArgsHandler = (...eventArgs) => {\n const event = eventArgs[0] as any;\n if (!event) return;\n\n const action = inferPopupAction(event);\n\n // TimePicker popup path: distinguish NOW vs SET and normalize value handling.\n if (action === \"now\") {\n const now = new Date();\n syncRawFromDate(now);\n emitParsedDate(now, event);\n focusInputAfterPopupClose();\n return;\n }\n\n if (event?.value instanceof Date) {\n const nextValue = new Date(event.value);\n syncRawFromDate(nextValue);\n emitParsedDate(nextValue, event);\n if (action === \"set\") {\n focusInputAfterPopupClose();\n }\n return;\n }\n\n if (event?.value === null) {\n raw.value = \"\";\n emitValue(null, event);\n return;\n }\n\n // Set raw first from event\n raw.value = event.value as string;\n const src = event.event?.target as HTMLInputElement;\n cursorPos.value = src?.selectionStart ?? 0;\n // If caret is in AM/PM segment and user typed A/a or P/p, auto-complete to AM/PM\n try {\n const pos = cursorPos.value ?? 0;\n if (partAt(pos) === \"ampm\" && (raw.value ?? \"\").length >= 8) {\n const first = raw.value.charAt(6);\n if (/[Aa]/.test(first)) {\n raw.value = `${raw.value.slice(0, 6)}AM${raw.value.slice(8)}`;\n // Move caret to end of AM/PM\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(8, 8);\n }\n });\n });\n } else if (/[Pp]/.test(first)) {\n raw.value = `${raw.value.slice(0, 6)}PM${raw.value.slice(8)}`;\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(8, 8);\n }\n });\n });\n }\n }\n } catch {}\n emitParsedIfComplete(event);\n };\n\n const handleClick = (event: MouseEvent): void => {\n cursorPos.value = (event.target as HTMLInputElement).selectionStart ?? 0;\n };\n\n const applyStep = (\n direction: \"ArrowUp\" | \"ArrowDown\",\n sourceEl: HTMLInputElement | null | undefined,\n event: Event,\n ): void => {\n const pos = sourceEl?.selectionStart ?? cursorPos.value ?? 0;\n cursorPos.value = pos;\n const part = partAt(pos);\n\n const dispMatch = (raw.value ?? \"\").match(/^(\\d{2}):(\\d{2})\\s([AP]M)$/i);\n if (!dispMatch) {\n // If empty, initialize to current time on first step\n if ((raw.value ?? \"\").length === 0 || digitsOnly.value.length === 0) {\n const now = new Date();\n const h24 = now.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, now.getMinutes(), ap);\n const date = toDateFromDisplay(raw.value);\n emitParsedDate(date, event);\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n }\n // For non-empty but invalid formats, do not auto-correct\n return;\n }\n let hh = parseInt(dispMatch[1]);\n let mm = parseInt(dispMatch[2]);\n let ap = dispMatch[3].toUpperCase() as \"AM\" | \"PM\";\n\n if (part === \"hh\") {\n if (direction === \"ArrowUp\") hh = hh < 12 ? hh + 1 : 1;\n else hh = hh > 1 ? hh - 1 : 12;\n } else if (part === \"mm\") {\n const step = args.minuteStepRef?.value ?? args.minuteStep ?? 1;\n if (step === 1) {\n if (direction === \"ArrowUp\") mm = mm < 59 ? mm + 1 : 0;\n else mm = mm > 0 ? mm - 1 : 59;\n } else {\n if (direction === \"ArrowUp\") {\n const rem = mm % step;\n let next = rem === 0 ? mm + step : mm + (step - rem);\n if (next >= 60) next = 0; // wrap to top of hour\n mm = next;\n } else {\n const rem = mm % step;\n let prev = rem === 0 ? mm - step : mm - rem;\n if (prev < 0) prev = 60 - step; // wrap to last step in hour\n mm = prev;\n }\n }\n } else if (part === \"ampm\") {\n ap = ap === \"AM\" ? \"PM\" : \"AM\";\n }\n\n raw.value = `${String(hh).padStart(2, \"0\")}:${String(mm).padStart(\n 2,\n \"0\",\n )} ${ap}`;\n const date = toDateFromDisplay(raw.value);\n emitParsedDate(date, event);\n\n nextTick(() => {\n requestAnimationFrame(() => {\n const inputEl = document.getElementById(\n args.id,\n ) as HTMLInputElement | null;\n const p = cursorPos.value ?? 0;\n if (inputEl) {\n inputEl.focus();\n inputEl.setSelectionRange(p, p);\n }\n });\n });\n };\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.code === \"Space\" || event.key === \" \") {\n // Open the picker without modifying the input\n // Justified: Space opens the time picker popup instead of inserting a space.\n event.preventDefault();\n // Justified: Parent containers such as grid keyboard handlers should not consume this.\n event.stopPropagation();\n args.onShowPicker(event);\n return;\n }\n\n // Alt+Down opens the picker; allow other Alt+arrow combinations to pass through\n if (event.key === \"ArrowDown\" && event.altKey) {\n // Justified: Alt+Down is reserved for opening the time picker popup.\n event.preventDefault();\n // Justified: Prevent parent keyboard navigation from treating this as row movement.\n event.stopPropagation();\n args.onShowPicker(event);\n return;\n }\n\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n // Justified: ArrowUp/Down act as time-part steppers instead of native caret/page behavior.\n event.preventDefault();\n // Justified: Prevent parent containers such as the grid from also handling these arrows.\n event.stopPropagation();\n const src = event.target as HTMLInputElement;\n applyStep(event.key as \"ArrowUp\" | \"ArrowDown\", src, event);\n return;\n }\n };\n\n const handleWheel = (event: WheelEvent): void => {\n // Map mouse wheel to stepper behavior (up/down) based on caret segment\n // Prevent page scroll when interacting with the input\n event.preventDefault();\n const direction = event.deltaY < 0 ? \"ArrowUp\" : \"ArrowDown\";\n applyStep(direction, event.target as HTMLInputElement, event);\n };\n\n const handleKeyUp = (event: KeyboardEvent): void => {\n const src = event.target as HTMLInputElement;\n if (cursorKeys.includes(event.key)) {\n // Do not prevent default for caret navigation\n cursorPos.value = src?.selectionStart ?? 0;\n return;\n }\n if (steppers.includes(event.key)) {\n if (event.altKey) return;\n cursorPos.value = src?.selectionStart ?? 0;\n }\n };\n\n const handleBlur = (event: FocusEvent): void => {\n isTouched.value = true;\n\n // If required and value is still undefined/blank, coerce external\n // value from undefined -> \"\" so downstream validation can treat\n // this as an incomplete required field.\n if (\n isRequired.value &&\n args.externalValue &&\n args.externalValue.value === undefined &&\n digitsOnly.value.length === 0\n ) {\n (args.externalValue as Ref<any>).value = \"\";\n }\n\n const src = event.target as HTMLInputElement | null;\n if (src) {\n cursorPos.value = src.selectionStart ?? 0;\n }\n };\n\n // Sync external value into raw when provided\n if (args.externalValue) {\n watch(\n args.externalValue,\n (newVal) => {\n if (newVal) {\n const date = new Date(newVal as any);\n if (date.toString() !== \"Invalid Date\") {\n const h24 = date.getHours();\n const ap = h24 >= 12 ? \"PM\" : \"AM\";\n raw.value = toDisplay(h24, date.getMinutes(), ap);\n return;\n }\n }\n // If external value is null/invalid, keep current raw as-is\n },\n { immediate: true },\n );\n }\n\n const debugLines = computed(() => {\n return [\n [\"Time\", raw.value || \"--:-- --\"],\n [\"Hour (12h)\", hour.value],\n [\"Hour (24h)\", hour24.value],\n [\"Minute\", minute.value],\n [\"Period\", period.value],\n [\"Time (24h)\", time24.value ?? \"--:--:--\"],\n [\"Digits only\", digitsOnly.value],\n [\n \"Parsed Date\",\n parsedRawTime.value?.toLocaleDateString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\n \"min\",\n args.min?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\n \"max\",\n args.max?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n }) ?? null,\n ],\n [\"valid\", isValid.value],\n [\"reason\", reason.value],\n [\"validationMessage\", validationMessage.value],\n ];\n });\n\n // Validation based on completeness and parse-ability\n const parsedRawTime = computed<Date | null>(\n () => toDateFromDisplay(raw.value) ?? null,\n );\n const isValid = computed(() => {\n // Optional field preserves forgiving behavior\n if (!isRequired.value) {\n if (!isComplete.value) return true;\n const t = parsedRawTime.value;\n if (!t) return false;\n return inRangeTime(t);\n }\n\n // Required field: do not flag invalid until after blur\n if (!isTouched.value) return true;\n\n const t = parsedRawTime.value;\n if (!isComplete.value) return false;\n if (!t) return false;\n return inRangeTime(t);\n });\n\n const reason = computed<string | undefined>(() => {\n // Optional: only report reasons for completed-but-bad values\n if (!isRequired.value) {\n if (!isComplete.value) return undefined;\n const t = parsedRawTime.value;\n if (!t) return \"invalid-time\";\n if (!inRangeTime(t)) return \"out-of-bounds\";\n return \"valid\";\n }\n\n // Required: only validate after blur\n if (!isTouched.value) return undefined;\n\n if (digitsOnly.value.length === 0 || !isComplete.value) {\n return \"incomplete\";\n }\n\n const t = parsedRawTime.value;\n if (!t) return \"invalid-time\";\n if (!inRangeTime(t)) return \"out-of-bounds\";\n return \"valid\";\n });\n\n const validationMessage = computed(() => {\n const r = reason.value;\n if (!r || r === \"valid\") return \"\";\n\n if (r === \"incomplete\") {\n return \"Required\";\n }\n\n if (r === \"invalid-time\") {\n return `Must be in ${placeholder.value} format.`;\n }\n\n const opts: Intl.DateTimeFormatOptions = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n const minStr = args.min ? args.min.toLocaleTimeString(\"en-US\", opts) : null;\n const maxStr = args.max ? args.max.toLocaleTimeString(\"en-US\", opts) : null;\n if (r === \"out-of-bounds\") {\n if (minStr && maxStr) return `Must be between ${minStr} and ${maxStr}.`;\n if (minStr) return `Must be ${minStr} or later.`;\n if (maxStr) return `Must be ${maxStr} or earlier.`;\n }\n\n return \"\";\n });\n\n const initStyling = () => {\n // Idempotent application of the `fk-timepicker` class to the time picker's parent\n nextTick(() => {\n const inputEl = document.getElementById(args.id) as HTMLElement | null;\n if (!inputEl) {\n console.warn(`#${args.id} not found for styling.`);\n return;\n }\n const timePicker = inputEl.closest(\".k-timepicker\");\n if (!timePicker) {\n console.warn(\n `.k-timepicker parent of #${args.id} not found for styling.`,\n );\n return;\n }\n const parent = timePicker.parentElement;\n if (!parent) {\n console.warn(\n `Parent of .k-timepicker not found for #${args.id} styling.`,\n );\n return;\n }\n if (parent.classList.contains(\"fk-timepicker\")) return;\n parent.classList.add(\"fk-timepicker\");\n });\n };\n\n onMounted(() => {\n initStyling();\n });\n\n return {\n raw,\n rules,\n debugEnabled,\n debugLines,\n placeholder,\n isValid,\n reason: readonly(reason),\n validationMessage,\n isComplete,\n inRangeTime,\n cursorPos,\n hour: readonly(hour),\n hour24: readonly(hour24),\n minute: readonly(minute),\n period: readonly(period),\n time24: readonly(time24),\n parsedRawTime: readonly(parsedRawTime),\n handleChange,\n handleKeyDown,\n handleKeyUp,\n handleClick,\n handleWheel,\n handleBlur,\n // Expose so consumers can reapply theming when Kendo updates DOM\n initStyling,\n };\n}\n","import { nextTick, readonly, ref, shallowRef, watch, type Ref } from \"vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { onClickOutside } from \"@vueuse/core\";\n\nexport type CloseReason = \"escape\" | \"outside\";\nexport type InitialFocus =\n | string\n | ((root: HTMLElement) => HTMLElement | null | undefined);\n\n/**\n * Focus-restoration options for pairing `usePopupTrap` with `usePopupMenu`.\n *\n * `usePopupMenu` owns menu-close focus restoration. These settings disable\n * both competing restoration paths in `usePopupTrap` and the underlying\n * `focus-trap` implementation. Spread this preset last so those integration\n * settings take precedence.\n */\nexport const POPUP_MENU_TRAP_OPTIONS = {\n returnFocusToTrigger: false,\n focusTrapOptions: {\n returnFocusOnDeactivate: false,\n },\n} as const;\n\nexport function usePopupTrap(opts: {\n isOpen: Ref<boolean>;\n onRequestClose?: (reason: CloseReason, ev?: Event) => void;\n popupSelector?: string | string[];\n triggerEl?: Ref<HTMLElement | null>;\n resolvePopupEl?: () => HTMLElement | null;\n initialFocus?: InitialFocus;\n focusTrapOptions?: Parameters<typeof useFocusTrap>[1];\n returnFocusToTrigger?: boolean;\n}) {\n const popupRef = shallowRef<HTMLElement | null>(null);\n\n const defaultSelectors = [\n \".k-animation-container .k-popup\",\n \".k-popup\",\n \".k-timepicker-popup\",\n \".k-menu-popup\",\n ];\n\n const selectors = Array.isArray(opts.popupSelector)\n ? opts.popupSelector\n : [opts.popupSelector ?? defaultSelectors].flat();\n\n const pickInitialFocus = (root: HTMLElement) => {\n if (!root) return null as unknown as HTMLElement;\n if (typeof opts.initialFocus === \"string\") {\n const found = root.querySelector(opts.initialFocus) as HTMLElement | null;\n return found ?? root;\n }\n if (typeof opts.initialFocus === \"function\") {\n return (opts.initialFocus(root) as HTMLElement | null) ?? root;\n }\n const candidate = root.querySelector(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ) as HTMLElement | null;\n return candidate ?? root;\n };\n\n const { activate, deactivate } = useFocusTrap(popupRef, {\n escapeDeactivates: false,\n clickOutsideDeactivates: false,\n // Without this, focus-trap's own default (false) preventDefault()s and\n // swallows every outside pointerdown/click while active - not just ones\n // that would close it - blocking interaction with anything else on the\n // page (e.g. another trigger in the same row) until the trap deactivates.\n allowOutsideClick: true,\n fallbackFocus: () => popupRef.value as HTMLElement,\n initialFocus: () => pickInitialFocus(popupRef.value as HTMLElement),\n ...(opts.focusTrapOptions ?? {}),\n });\n\n let escapeHandler: ((e: KeyboardEvent) => void) | null = null;\n let lastCloseReason = ref<CloseReason | null>(null);\n\n const findPopup = (): HTMLElement | null => {\n if (opts.resolvePopupEl) return opts.resolvePopupEl();\n\n const pickLastVisible = (root: ParentNode, sel: string) => {\n const list = Array.from(root.querySelectorAll(sel)) as HTMLElement[];\n if (!list.length) return null as HTMLElement | null;\n const visible = list.filter(\n (el) => el.offsetParent !== null || el.getClientRects().length > 0,\n );\n return visible[visible.length - 1] ?? list[list.length - 1] ?? null;\n };\n\n const scopeRoot =\n opts.triggerEl?.value?.closest?.(\".k-animation-container\") ??\n document.body;\n\n for (const sel of selectors) {\n const el = pickLastVisible(scopeRoot, sel);\n if (el) return el;\n }\n\n for (const sel of selectors) {\n const el = pickLastVisible(document, sel);\n if (el) return el;\n }\n\n return null;\n };\n\n onClickOutside(popupRef, (e) => {\n lastCloseReason.value = \"outside\";\n if (opts.isOpen.value) {\n opts.onRequestClose?.(\"outside\", e);\n }\n });\n\n watch(\n () => opts.isOpen.value,\n (open) => {\n if (open) {\n // Reset on open so the previous reason remains visible while closed\n lastCloseReason.value = null;\n nextTick(() => {\n const popup = findPopup();\n if (!popup) return;\n // Guarantees a valid fallback/initial focus target even when no\n // descendant is currently tabbable (e.g. Kendo Menu items only gain\n // a live tabindex via its own roving-tabindex JS on interaction) -\n // without this, focus-trap's activate() throws and silently no-ops,\n // leaving Tab to escape the popup entirely.\n if (popup.tabIndex < 0) popup.tabIndex = -1;\n popupRef.value = popup;\n setTimeout(() => {\n try {\n activate();\n } catch (error) {\n console.warn(\n \"usePopupTrap: focus trap failed to activate\",\n error,\n );\n }\n }, 0);\n\n if (!escapeHandler) {\n escapeHandler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n lastCloseReason.value = \"escape\";\n if (opts.isOpen.value) {\n opts.onRequestClose?.(\"escape\", e);\n }\n }\n };\n // Capture on document to catch Escape even when focus\n // stays on the trigger (e.g., TimeInput masked field).\n document.addEventListener(\"keydown\", escapeHandler, true);\n }\n });\n } else {\n deactivate();\n if (escapeHandler) {\n document.removeEventListener(\"keydown\", escapeHandler, true);\n escapeHandler = null;\n }\n popupRef.value = null;\n\n // On outside close, ensure trigger/input is not focused\n if (lastCloseReason.value === \"outside\") {\n nextTick(() => {\n const doBlur = () => {\n const root = opts.triggerEl?.value as HTMLElement | null;\n const input = root?.querySelector(\"input\") as HTMLElement | null;\n const active = document.activeElement as HTMLElement | null;\n // Only blur if focus is still on the trigger/input to avoid interfering\n if (\n active &&\n (active === input || (root && root.contains(active)))\n ) {\n (input ?? root)?.blur?.();\n }\n };\n requestAnimationFrame(() => setTimeout(doBlur, 0));\n });\n }\n\n if (\n opts.returnFocusToTrigger !== false &&\n lastCloseReason.value === \"escape\"\n ) {\n if (opts.triggerEl?.value) {\n // Schedule after Vue updates and after event/click propagation\n nextTick(() => {\n const doFocus = () => {\n const root = opts.triggerEl?.value as HTMLElement | null;\n if (!root) return;\n const input = root.querySelector(\"input\") as HTMLElement | null;\n const target = (input ?? root) as HTMLElement | null;\n target?.focus?.();\n };\n requestAnimationFrame(() => setTimeout(doFocus, 0));\n });\n }\n }\n }\n },\n );\n\n return {\n popupRef,\n activate,\n deactivate,\n lastCloseReason: readonly(lastCloseReason),\n setPopupEl: (el: HTMLElement | null) => (popupRef.value = el),\n };\n}\n"],"names":["useGridA11y","gridRef","options","activeFilterButton","ref","a11yInitialized","mutationsObserver","rowObserver","headerThTeardownCallbacks","intraRowNavigationSelector","getGridRootElement","host","isWithinThisGridScope","target","gridRoot","ariaRoot","fallbackScope","isEnterActivation","event","getColumns","handleFilterButtonKeyboardListener","key","handleFilterMenuKeyboardListener","menuItems","filterContainer","defaultFocusable","focusableSelectors","focusableElements","focusedIndex","el","targetIndex","item","currentTh","setupFilterMenuObserver","mutations","mutation","node","element","column","nextTick","wrapper","tryFocusMenuItem","container","isFormControl","tagName","handleGridKeyDown","e","row","isIntraRowHorizontalNavKey","focusedRow","r","findSiblingRow","start","direction","sib","targetRow","tabbable","currentIndex","setupGridStyling","gridHost","gridElement","setupTrNavigation","ensureSingleTabindex","rows","err","index","tbody","error","setupFilterButtonAccessibility","filterButtons","setupHeaderThTriggers","cleanupGridA11y","teardown","th","btn","columns","field","filterable","sortable","openMenu","clickHandler","columnLink","keyHandler","thead","theadKeyboardHandler","handleSortChange","customHandler","menuOpened","menuItemSelected","fieldIsSortable","c","s","initA11y","onBeforeUnmount","isCompositeFilter","filterItem","isFilterDescriptor","hasFieldFilterRecursive","child","useGridActiveFilter","filterRef","f","DEFAULT_IGNORE_SELECTORS","useGridRowAction","onRowAction","dataItems","ignoreSelectors","shouldIgnoreTarget","enableKeyboardAction","combinedIgnoreSelectors","isIgnoredTarget","selectorString","resolveRowIndex","attr","parsed","getEventCoordinates","nativeEvent","scrollX","scrollY","screenX","screenY","getElementCoordinates","rect","clientX","clientY","hasTextSelection","selection","anchorParent","focusParent","isAnchorInside","isFocusInside","context","explicitDataItem","rowEl","rowIndexAttr","rowIndex","resolvedDataItem","itemsList","DEFAULT_ZIP_ERROR_MESSAGE","formatZipDisplay","input","digits","countDigitsBeforeIndex","value","digitIndexToDisplayIndex","digitIndex","useZipTextBox","zipDisplay","submitted","errorMessage","zipRaw","computed","isZipValid","length","showZipError","textBoxValid","textBoxValidate","restoreCaret","inputElement","caretIndex","args","nextValue","inputValue","opts","valid","useFieldsetTouchTracker","fieldsetRef","touched","watchEffect","onFocusout","fieldset","next","reset","useFieldsetValidationKit","suppressNextTouch","fieldsetValidate","toValue","fieldsetIsValid","tracker","createFieldValidity","isValid","createFieldValidationsMap","isValidMap","focusFirstInvalidField","formRef","form","US_STATES_BY_ABBREVIATION","readInputValue","payload","useUSAddressFormData","formData","reactive","useUSAddressZip","zipInputId","zipField","zipWrapperClass","onZipInput","watch","useUSAddressValidation","strictAddress1Valid","strictCityValid","strictStateValid","strictZipValid","strictAddressValid","focusFirstInvalid","focusoutLeavesFieldset","useUSAddress","optionalFeedbackReviewed","isRequired","onAddress1Input","onAddress2Input","onCityInput","onStateChange","resetFormData","resetZip","validationKit","fieldValidations","rawAddress1Valid","rawCityValid","rawStateValid","rawZipValid","rawAddressValid","addressValidate","address1Valid","cityValid","stateValid","zipValid","addressValid","stateDefaultItem","stateOptions","label","normalizedPayload","isAddressEmpty","optionalAddressHasAnyInput","optionalMissingRequiredFields","optionalZipInvalid","zipDigits","optionalPartialInvalid","optionalFeedbackActive","required","leftFieldset","flipHorizontal","horizontal","flipVertical","vertical","computeCorner","anchor","popup","anchorAlign","popupAlign","anchorX","anchorY","popupOffsetX","popupOffsetY","fitAxis","position","size","end","computeCollisionOffset","bounds","collision","preferred","left","top","overflowsRight","overflowsLeft","flipped","currentOverflow","overflowsBottom","overflowsTop","useCompositeId","prefix","instanceId","useId","parts","part","isClient","toString","isObject","val","noop","toArray","watchImmediate","source","cb","defaultWindow","unrefElement","elRef","_$el","plain","useEventListener","register","listener","firstParamTargets","test","_firstParamTargets$va","_firstParamTargets$va2","unref","raw_targets","raw_events","raw_listeners","raw_options","_","onCleanup","optionsClone","cleanups","fn","onClickOutside","handler","window","ignore","capture","detectIframe","controls","shouldListen","shouldIgnore","hasMultipleRoots","vm","checkMultipleRoots","children","isProcessingClick","cleanup","activeEl","stop","useIntersectionObserver","observer","disconnect","root","entry","onUnmounted","DEFAULT_ESCAPE_FOCUS_CONTAINER_SELECTOR","resolveElement","componentElement","isManagedTrigger","triggerMode","warnMismatchedTrigger","findScrollableAncestor","parent","styledFallback","overflow","overflowX","overflowY","scrollsX","scrollsY","usePopupMenu","popupCloseReason","menuItemSelector","anchorOptions","activationPointOptions","anchorRect","shallowRef","anchorActivation","popupRect","resolveTriggerElement","triggerEl","anchorObserverTarget","getOffsetBounds","clip","offset","corner","resolveConfiguredFocusTarget","explicitTarget","setAnchorActivation","trigger","activation","triggerElement","triggerRect","keyboardPosition","verticalPosition","y","resolveEscapeFallbackTarget","selector","focusConfiguredTargetOrTrigger","focusFirstEnabledMenuItem","pendingFocusTarget","pendingTrigger","suppressNextTriggerClick","restorePendingFocus","reason","closePopup","syncManagedTrigger","animationFrame","measure","scheduleMeasure","resolvePopupContentElement","content","open","_prev","contentElement","previousTrigger","previousMenubar","demoteManagedTrigger","syncMenuLabel","menuElement","menubar","handleTriggerClick","onAction","useExclusiveGroup","members","member","activeMember","resolveRegisteredElement","useActiveIdRegistry","registry","shallowReactive","activeId","id","resolve","activate","deactivate","isIdActive","readonly","WINDOW_SETTINGS_DEFAULTS","isWindowStage","calculateInitialLeft","viewportWidth","windowWidth","rightInset","useWindow","isRef","settings","windowRef","visible","stage","isDragging","isResizing","initialLeft","initialTop","openOptions","hasStoredPosition","rootFontSize","padding","viewportLeft","viewportTop","closeWindow","handleStageChange","requestedStage","handleMove","windowRoot","titlebarRect","titlebarWidth","titlebarHeight","viewportRight","viewportBottom","maximumLeft","maximumTop","handleResize","handlePointerDown","handleTitlebarDoubleClick","removePointerDownListener","removeTitlebarDoubleClickListener","removePointerDownWatcher","removeTitlebarDoubleClickWatcher","instance","onScopeDispose","windowClass","classes","props","useMaskedDateInput","raw","cursorPos","debugEnabled","placeholder","MIN_YEAR","isTouched","steppers","cursorKeys","digitsOnly","datePart","pos","month","m","day","d","year","emitParsedIfComplete","mmStr","ddStr","yyyyStr","mm","dd","yyyy","isValidParts","createDate","inRange","min","max","parsedRawDate","isComplete","yy","date","daysInMonth","handleChange","src","handleClick","applyStep","sourceEl","today","setDate","focusAndRestore","days","steppedDate","handleKeyDown","handleWheel","handleKeyUp","handleBlur","run","inputEl","p","newVal","debugLines","candidate","validationMessage","minStr","maxStr","initStyling","datePicker","onMounted","useMaskedDateRangeInput","calendarChanged","ONE_DAY","ONE_YEAR","TODAY","MIN_DATE","MAX_DATE","toUtcMidnightMs","clampToMinMax","dMs","rangeIsOrdered","maskComplete","parseFromRaw","right","mm1","dd1","yyyy1","x","mm2","dd2","yyyy2","sDate","eDate","sOk","eOk","clamped","spanDays","diffMs","reasonComputed","validComputed","formatDate","fmt","n","w","datePartForPos","tStr","which","mutate","sText","eText","sClamped","eClamped","newValue","originalEvent","handleClear","applyBlurValidation","_event","delay","month1","day1","year1","month2","day2","year2","rangeInput","parentDiv","calendarMonthTabIndexFix","containers","calendarRoot","months","foundTab0","useMaskedTimeInput","rules","partAt","hour","h","v","minute","period","hour24","h12","time24","toDisplay","h24","ap","toDateFromDisplay","display","match","hh","inRangeTime","minutesSinceMidnight","minM","maxM","syncRawFromDate","emitValue","focusInputAfterPopupClose","inferPopupAction","emitParsedDate","eventArgs","action","now","first","dispMatch","step","rem","prev","parsedRawTime","t","timePicker","POPUP_MENU_TRAP_OPTIONS","usePopupTrap","popupRef","defaultSelectors","selectors","pickInitialFocus","useFocusTrap","escapeHandler","lastCloseReason","findPopup","pickLastVisible","sel","list","scopeRoot","doBlur","active","doFocus"],"mappings":"4WAcO,MAAMA,GAAc,CACzBC,EACAC,IACG,CAEH,MAAMC,EAAqBC,EAAAA,IAAwB,IAAI,EAEvD,IAAIC,EAAkB,GAGlBC,EAA6C,KAG7CC,EAAuC,KAE3C,MAAMC,EAA+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