{"version":3,"sources":["../src/array.ts","../src/assertion.ts","../src/create-generate-id.ts","../src/create-global-listeners.ts","../src/dom.ts","../src/enums.ts","../src/platform.ts","../src/events.ts","../src/external.ts","../src/focus-without-scrolling.ts","../src/tabbable.ts","../src/focus-manager.ts","../src/get-scroll-parent.ts","../src/is-virtual-event.ts","../src/noop.ts","../src/number.ts","../src/polygon.ts","../src/props.ts","../src/run-after-transition.ts","../src/scroll-into-view.ts","../src/styles.ts"],"names":["EventKey","tabbableElements","last"],"mappings":";AAWO,SAAS,eACf,OACA,MACA,QAAQ,IACP;AACD,MAAI,EAAE,SAAS,QAAQ;AACtB,WAAO,CAAC,GAAG,OAAO,IAAI;AAAA,EACvB;AACA,SAAO,CAAC,GAAG,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,MAAM,KAAK,CAAC;AAC9D;AAKO,SAAS,oBAAuB,OAAY,MAAS;AAC3D,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AAEvC,MAAI,UAAU,IAAI;AACjB,iBAAa,OAAO,OAAO,CAAC;AAAA,EAC7B;AAEA,SAAO;AACR;;;ACzBO,SAAS,SAAS,OAAiC;AACzD,SAAO,OAAO,UAAU;AACzB;AAGO,SAAS,QAAW,OAAmC;AAC7D,SAAO,MAAM,QAAQ,KAAK;AAC3B;AAGO,SAAS,SAAS,OAAiC;AACzD,SAAO,OAAO,UAAU,SAAS,KAAK,KAAK,MAAM;AAClD;AAGO,SAAS,WACf,OACa;AACb,SAAO,OAAO,UAAU;AACzB;;;ACvBO,SAAS,iBAAiB,QAA0B;AAC1D,SAAO,CAAC,WAAmB,GAAG,OAAO,CAAC,IAAI,MAAM;AACjD;;;ACCA,SAAS,iBAAiB;AAkCnB,SAAS,wBAAyC;AACxD,QAAM,kBAAkB,oBAAI,IAAI;AAEhC,QAAM,oBAAoB,CACzB,aACA,MACA,UACA,YACI;AAEJ,UAAM,KAAK,SAAS,OACjB,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AQ,GAAG;AAI1C,aAAO,SAAS,IAAI;AACpB;AAAA,IACD;AAEA,YAAQ,MAAM;AAAA,EACf;AACA,SAAO;AACR;AAOO,SAAS,mBACf,eACA,MACC;AACD,MAAI,SAAS,SAAS,aAAa,GAAG;AACrC,UAAM,OAAO,SAAS,oBAAoB,SAAS;AACnD,UAAM,oBACL,OAAO,iBAAiB,IAAI,EAAE,aAAa;AAE5C,QAAI,CAAC,mBAAmB;AACvB,YAAM,EAAE,MAAM,cAAc,KAAK,YAAY,IAC5C,cAAc,sBAAsB;AAIrC,qBAAe,iBAAiB,EAAE,OAAO,UAAU,CAAC;AACpD,YAAM,EAAE,MAAM,SAAS,KAAK,OAAO,IAClC,cAAc,sBAAsB;AAErC,UACC,KAAK,IAAI,eAAe,OAAO,IAAI,KACnC,KAAK,IAAI,cAAc,MAAM,IAAI,GAChC;AACD,cAAM,mBAAmB,iBAAiB;AAAA,UACzC,OAAO;AAAA,UACP,QAAQ;AAAA,QACT,CAAC;AACD,sBAAc,iBAAiB,EAAE,OAAO,UAAU,CAAC;AAAA,MACpD;AAAA,IACD,OAAO;AACN,UAAI,eAAe,gBAAgB,aAAa;AAEhD,aACC,iBACA,gBACA,kBAAkB,QAClB,iBAAiB,MAChB;AACD;AAAA,UACC;AAAA,UACA;AAAA,QACD;AAEA,wBAAgB;AAChB,uBAAe,gBAAgB,aAAa;AAAA,MAC7C;AAAA,IACD;AAAA,EACD;AACD;;;AC9HO,IAAM,uBAA0C;AAAA,EACtD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,eAAe;AAChB","sourcesContent":["/*\n * Portions of this file are based on code from ariakit.\n * MIT Licensed, Copyright (c) Diego Haz.\n *\n * Credits to the Ariakit team:\n * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit-utils/src/array.ts\n */\n\n/**\n * Immutably adds an item at the given index to an array.\n */\nexport function addItemToArray<T extends any[]>(\n\tarray: T,\n\titem: T[number],\n\tindex = -1,\n) {\n\tif (!(index in array)) {\n\t\treturn [...array, item] as T;\n\t}\n\treturn [...array.slice(0, index), item, ...array.slice(index)] as T;\n}\n\n/**\n * Immutably removes an item from an array.\n */\nexport function removeItemFromArray<T>(array: T[], item: T) {\n\tconst updatedArray = [...array];\n\tconst index = updatedArray.indexOf(item);\n\n\tif (index !== -1) {\n\t\tupdatedArray.splice(index, 1);\n\t}\n\n\treturn updatedArray;\n}\n","/*\n * Original code by Chakra UI\n * MIT Licensed, Copyright (c) 2019 Segun Adebayo.\n *\n * Credits to the Chakra UI team:\n * https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src/assertion.ts\n */\n\n// Number assertions\nexport function isNumber(value: unknown): value is number {\n\treturn typeof value === \"number\";\n}\n\n// Array assertions\nexport function isArray<T>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value);\n}\n\n// String assertions\nexport function isString(value: unknown): value is string {\n\treturn Object.prototype.toString.call(value) === \"[object String]\";\n}\n\n// Function assertions\nexport function isFunction<T extends Function = Function>(\n\tvalue: unknown,\n): value is T {\n\treturn typeof value === \"function\";\n}\n","import type { Accessor } from \"solid-js\";\n\n/**\n * Create a function that generate an id from a `baseId` and `suffix`.\n */\nexport function createGenerateId(baseId: Accessor<string>) {\n\treturn (suffix: string) => `${baseId()}-${suffix}`;\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/solidjs-community/solid-aria/blob/2c5f54feb5cfea514b1ee0a52d0416878f882351/packages/utils/src/createGlobalListeners.ts\n */\n\nimport { onCleanup } from \"solid-js\";\n\ninterface GlobalListeners {\n\taddGlobalListener<K extends keyof DocumentEventMap>(\n\t\tel: EventTarget,\n\t\ttype: K,\n\t\tlistener: (this: Document, ev: DocumentEventMap[K]) => any,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void;\n\n\taddGlobalListener(\n\t\tel: EventTarget,\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void;\n\n\tremoveGlobalListener<K extends keyof DocumentEventMap>(\n\t\tel: EventTarget,\n\t\ttype: K,\n\t\tlistener: (this: Document, ev: DocumentEventMap[K]) => any,\n\t\toptions?: boolean | EventListenerOptions,\n\t): void;\n\n\tremoveGlobalListener(\n\t\tel: EventTarget,\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject,\n\t\toptions?: boolean | EventListenerOptions,\n\t): void;\n\n\tremoveAllGlobalListeners(): void;\n}\n\nexport function createGlobalListeners(): GlobalListeners {\n\tconst globalListeners = new Map();\n\n\tconst addGlobalListener = (\n\t\teventTarget: any,\n\t\ttype: any,\n\t\tlistener: any,\n\t\toptions: any,\n\t) => {\n\t\t// Make sure we remove the listener after it is called with the `once` option.\n\t\tconst fn = options?.once\n\t\t\t? (...args: any) => {\n\t\t\t\t\tglobalListeners.delete(listener);\n\t\t\t\t\tlistener(...args);\n\t\t\t\t}\n\t\t\t: listener;\n\t\tglobalListeners.set(listener, { type, eventTarget, fn, options });\n\t\teventTarget.addEventListener(type, listener, options);\n\t};\n\n\tconst removeGlobalListener = (\n\t\teventTarget: any,\n\t\ttype: any,\n\t\tlistener: any,\n\t\toptions: any,\n\t) => {\n\t\tconst fn = globalListeners.get(listener)?.fn || listener;\n\t\teventTarget.removeEventListener(type, fn, options);\n\t\tglobalListeners.delete(listener);\n\t};\n\n\tconst removeAllGlobalListeners = () => {\n\t\tglobalListeners.forEach((value, key) => {\n\t\t\tremoveGlobalListener(value.eventTarget, value.type, key, value.options);\n\t\t});\n\t};\n\n\tonCleanup(() => {\n\t\tremoveAllGlobalListeners();\n\t});\n\n\treturn { addGlobalListener, removeGlobalListener, removeAllGlobalListeners };\n}\n","/*\n * Portions of this file are based on code from ariakit.\n * MIT Licensed, Copyright (c) Diego Haz.\n *\n * Credits to the Ariakit team:\n * https://github.com/ariakit/ariakit/blob/232bc79018ec20967fec1e097a9474aba3bb5be7/packages/ariakit-utils/src/dom.ts\n */\n\n/**\n * Similar to `Element.prototype.contains`, but a little faster when `element` is the same as `child`.\n */\nexport function contains(parent: Node | undefined, child: Node | null) {\n\tif (!parent) {\n\t\treturn false;\n\t}\n\n\treturn parent === child || parent.contains(child);\n}\n\n/**\n * Returns `element.ownerDocument.activeElement`.\n */\nexport function getActiveElement(\n\tnode?: Node | null,\n\tactiveDescendant = false,\n): HTMLElement | null {\n\tconst { activeElement } = getDocument(node);\n\n\tif (!activeElement?.nodeName) {\n\t\t// In IE11, activeElement might be an empty object if we're interacting\n\t\t// with elements inside an iframe.\n\t\treturn null;\n\t}\n\n\tif (isFrame(activeElement) && activeElement.contentDocument) {\n\t\treturn getActiveElement(\n\t\t\tactiveElement.contentDocument.body,\n\t\t\tactiveDescendant,\n\t\t);\n\t}\n\n\tif (activeDescendant) {\n\t\tconst id = activeElement.getAttribute(\"aria-activedescendant\");\n\n\t\tif (id) {\n\t\t\tconst element = getDocument(activeElement).getElementById(id);\n\n\t\t\tif (element) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn activeElement as HTMLElement | null;\n}\n\n/**\n * Returns `element.ownerDocument.defaultView || window`.\n */\nexport function getWindow(node?: Node | null): Window {\n\treturn getDocument(node).defaultView || window;\n}\n\n/**\n * Returns `element.ownerDocument || document`.\n */\nexport function getDocument(node?: Node | null): Document {\n\treturn node ? node.ownerDocument || (node as Document) : document;\n}\n\n/**\n * Checks whether `element` is a frame element.\n */\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n\treturn element.tagName === \"IFRAME\";\n}\n","export enum EventKey {\n\tEscape = \"Escape\",\n\tEnter = \"Enter\",\n\tTab = \"Tab\",\n\tSpace = \" \",\n\tArrowDown = \"ArrowDown\",\n\tArrowLeft = \"ArrowLeft\",\n\tArrowRight = \"ArrowRight\",\n\tArrowUp = \"ArrowUp\",\n\tEnd = \"End\",\n\tHome = \"Home\",\n\tPageDown = \"PageDown\",\n\tPageUp = \"PageUp\",\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/cf9ab24f3255be1530d0f584061a01aa1e8180e6/packages/@react-aria/utils/src/platform.ts\n */\n\nfunction testUserAgent(re: RegExp) {\n\tif (typeof window === \"undefined\" || window.navigator == null) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t// @ts-ignore\n\t\twindow.navigator.userAgentData?.brands.some(\n\t\t\t(brand: { brand: string; version: string }) => re.test(brand.brand),\n\t\t) || re.test(window.navigator.userAgent)\n\t);\n}\n\nfunction testPlatform(re: RegExp) {\n\treturn typeof window !== \"undefined\" && window.navigator != null\n\t\t? re.test(\n\t\t\t\t// @ts-ignore\n\t\t\t\twindow.navigator.userAgentData?.platform || window.navigator.platform,\n\t\t\t)\n\t\t: false;\n}\n\nexport function isMac() {\n\treturn testPlatform(/^Mac/i);\n}\n\nexport function isIPhone() {\n\treturn testPlatform(/^iPhone/i);\n}\n\nexport function isIPad() {\n\treturn (\n\t\ttestPlatform(/^iPad/i) ||\n\t\t// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n\t\t(isMac() && navigator.maxTouchPoints > 1)\n\t);\n}\n\nexport function isIOS() {\n\treturn isIPhone() || isIPad();\n}\n\nexport function isAppleDevice() {\n\treturn isMac() || isIOS();\n}\n\nexport function isWebKit() {\n\treturn testUserAgent(/AppleWebKit/i) && !isChrome();\n}\n\nexport function isChrome() {\n\treturn testUserAgent(/Chrome/i);\n}\n\nexport function isAndroid() {\n\treturn testUserAgent(/Android/i);\n}\n","import type { JSX } from \"solid-js\";\n\nimport { isFunction } from \"./assertion\";\nimport { isMac } from \"./platform\";\n\n/** Call a JSX.EventHandlerUnion with the event. */\nexport function callHandler<T, E extends Event>(\n\tevent: E & { currentTarget: T; target: Element },\n\thandler: JSX.EventHandlerUnion<T, E> | undefined,\n) {\n\tif (handler) {\n\t\tif (isFunction(handler)) {\n\t\t\thandler(event);\n\t\t} else {\n\t\t\thandler[0](handler[1], event);\n\t\t}\n\t}\n\n\treturn event?.defaultPrevented;\n}\n\n/** Create a new event handler which calls all given handlers in the order they were chained with the same event. */\nexport function composeEventHandlers<T>(\n\thandlers: Array<JSX.EventHandlerUnion<T, any> | undefined>,\n) {\n\treturn (event: any) => {\n\t\tfor (const handler of handlers) {\n\t\t\tcallHandler(event, handler);\n\t\t}\n\t};\n}\n\nexport function isCtrlKey(e: Pick<KeyboardEvent, \"ctrlKey\" | \"metaKey\">) {\n\tif (isMac()) {\n\t\treturn e.metaKey && !e.ctrlKey;\n\t}\n\n\treturn e.ctrlKey && !e.metaKey;\n}\n","// External libs re-exports\nexport { createEventListener } from \"@solid-primitives/event-listener\";\nexport { Key } from \"@solid-primitives/keyed\";\nexport { ReactiveMap } from \"@solid-primitives/map\";\nexport { createMediaQuery } from \"@solid-primitives/media\";\nexport { combineProps } from \"@solid-primitives/props\";\nexport { mergeRefs } from \"@solid-primitives/refs\";\nexport type { MaybeAccessor } from \"@solid-primitives/utils\";\nexport { access, accessWith, chain } from \"@solid-primitives/utils\";\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/focusWithoutScrolling.ts\n */\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n\telement: HTMLElement;\n\tscrollTop: number;\n\tscrollLeft: number;\n}\n\nexport function focusWithoutScrolling(element: HTMLElement | null | undefined) {\n\tif (!element) {\n\t\treturn;\n\t}\n\n\tif (supportsPreventScroll()) {\n\t\telement.focus({ preventScroll: true });\n\t} else {\n\t\tconst scrollableElements = getScrollableElements(element);\n\t\telement.focus();\n\t\trestoreScrollPosition(scrollableElements);\n\t}\n}\n\nlet supportsPreventScrollCached: boolean | null = null;\n\nfunction supportsPreventScroll() {\n\tif (supportsPreventScrollCached == null) {\n\t\tsupportsPreventScrollCached = false;\n\t\ttry {\n\t\t\tconst focusElem = document.createElement(\"div\");\n\t\t\tfocusElem.focus({\n\t\t\t\tget preventScroll() {\n\t\t\t\t\tsupportsPreventScrollCached = true;\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\t// Ignore\n\t\t}\n\t}\n\n\treturn supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: HTMLElement): ScrollableElement[] {\n\tlet parent = element.parentNode;\n\tconst scrollableElements: ScrollableElement[] = [];\n\tconst rootScrollingElement =\n\t\tdocument.scrollingElement || document.documentElement;\n\n\twhile (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n\t\tif (\n\t\t\tparent.offsetHeight < parent.scrollHeight ||\n\t\t\tparent.offsetWidth < parent.scrollWidth\n\t\t) {\n\t\t\tscrollableElements.push({\n\t\t\t\telement: parent,\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t});\n\t\t}\n\t\tparent = parent.parentNode;\n\t}\n\n\tif (rootScrollingElement instanceof HTMLElement) {\n\t\tscrollableElements.push({\n\t\t\telement: rootScrollingElement,\n\t\t\tscrollTop: rootScrollingElement.scrollTop,\n\t\t\tscrollLeft: rootScrollingElement.scrollLeft,\n\t\t});\n\t}\n\n\treturn scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n\tfor (const { element, scrollTop, scrollLeft } of scrollableElements) {\n\t\telement.scrollTop = scrollTop;\n\t\telement.scrollLeft = scrollLeft;\n\t}\n}\n","/*\n * Portions of this file are based on code from ariakit.\n * MIT Licensed, Copyright (c) Diego Haz.\n *\n * Credits to the Ariakit team:\n * https://github.com/ariakit/ariakit/blob/main/packages/ariakit-utils/src/focus.ts\n *\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/focus/src/isElementVisible.ts\n * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/focus/src/FocusScope.tsx\n */\n\nimport { contains, getActiveElement, isFrame } from \"./dom\";\n\nconst focusableElements = [\n\t\"input:not([type='hidden']):not([disabled])\",\n\t\"select:not([disabled])\",\n\t\"textarea:not([disabled])\",\n\t\"button:not([disabled])\",\n\t\"a[href]\",\n\t\"area[href]\",\n\t\"[tabindex]\",\n\t\"iframe\",\n\t\"object\",\n\t\"embed\",\n\t\"audio[controls]\",\n\t\"video[controls]\",\n\t\"[contenteditable]:not([contenteditable='false'])\",\n];\n\nconst tabbableElements = [\n\t...focusableElements,\n\t'[tabindex]:not([tabindex=\"-1\"]):not([disabled])',\n];\n\nexport const FOCUSABLE_ELEMENT_SELECTOR = `${focusableElements.join(\n\t\":not([hidden]),\",\n)},[tabindex]:not([disabled]):not([hidden])`;\n\nexport const TABBABLE_ELEMENT_SELECTOR = tabbableElements.join(\n\t':not([hidden]):not([tabindex=\"-1\"]),',\n);\n\n/**\n * Returns all the tabbable elements in `container`.\n */\nexport function getAllTabbableIn(\n\tcontainer: HTMLElement,\n\tincludeContainer?: boolean,\n) {\n\tconst elements = Array.from(\n\t\tcontainer.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTOR),\n\t);\n\n\tconst tabbableElements = elements.filter(isTabbable);\n\n\tif (includeContainer && isTabbable(container)) {\n\t\ttabbableElements.unshift(container);\n\t}\n\n\ttabbableElements.forEach((element, i) => {\n\t\tif (isFrame(element) && element.contentDocument) {\n\t\t\tconst frameBody = element.contentDocument.body;\n\t\t\tconst allFrameTabbable = getAllTabbableIn(frameBody, false);\n\t\t\ttabbableElements.splice(i, 1, ...allFrameTabbable);\n\t\t}\n\t});\n\n\treturn tabbableElements;\n}\n\n/**\n * Checks whether `element` is tabbable or not.\n * @example\n * isTabbable(document.querySelector(\"input\")); // true\n * isTabbable(document.querySelector(\"input[tabindex='-1']\")); // false\n * isTabbable(document.querySelector(\"input[hidden]\")); // false\n * isTabbable(document.querySelector(\"input:disabled\")); // false\n */\nexport function isTabbable(element: Element): element is HTMLElement {\n\treturn isFocusable(element) && !hasNegativeTabIndex(element);\n}\n\n/**\n * Checks whether `element` is focusable or not.\n * @example\n * isFocusable(document.querySelector(\"input\")); // true\n * isFocusable(document.querySelector(\"input[tabindex='-1']\")); // true\n * isFocusable(document.querySelector(\"input[hidden]\")); // false\n * isFocusable(document.querySelector(\"input:disabled\")); // false\n */\nexport function isFocusable(element: Element): element is HTMLElement {\n\treturn (\n\t\telement.matches(FOCUSABLE_ELEMENT_SELECTOR) && isElementVisible(element)\n\t);\n}\n\nfunction hasNegativeTabIndex(element: Element) {\n\tconst tabIndex = Number.parseInt(element.getAttribute(\"tabindex\") || \"0\", 10);\n\treturn tabIndex < 0;\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(\n\telement: Element,\n\tchildElement?: Element,\n): boolean {\n\treturn (\n\t\telement.nodeName !== \"#comment\" &&\n\t\tisStyleVisible(element) &&\n\t\tisAttributeVisible(element, childElement) &&\n\t\t(!element.parentElement || isElementVisible(element.parentElement, element))\n\t);\n}\n\nfunction isStyleVisible(element: Element) {\n\tif (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {\n\t\treturn false;\n\t}\n\n\tconst { display, visibility } = element.style;\n\n\tlet isVisible =\n\t\tdisplay !== \"none\" && visibility !== \"hidden\" && visibility !== \"collapse\";\n\n\tif (isVisible) {\n\t\tif (!element.ownerDocument.defaultView) {\n\t\t\treturn isVisible;\n\t\t}\n\n\t\tconst { getComputedStyle } = element.ownerDocument.defaultView;\n\t\tconst { display: computedDisplay, visibility: computedVisibility } =\n\t\t\tgetComputedStyle(element);\n\n\t\tisVisible =\n\t\t\tcomputedDisplay !== \"none\" &&\n\t\t\tcomputedVisibility !== \"hidden\" &&\n\t\t\tcomputedVisibility !== \"collapse\";\n\t}\n\n\treturn isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n\treturn (\n\t\t!element.hasAttribute(\"hidden\") &&\n\t\t(element.nodeName === \"DETAILS\" &&\n\t\tchildElement &&\n\t\tchildElement.nodeName !== \"SUMMARY\"\n\t\t\t? element.hasAttribute(\"open\")\n\t\t\t: true)\n\t);\n}\n\n/**\n * Checks if `element` has focus within.\n * Elements that are referenced by `aria-activedescendant` are also considered.\n * @example\n * hasFocusWithin(document.getElementById(\"id\"));\n */\nexport function hasFocusWithin(element: Node | Element) {\n\tconst activeElement = getActiveElement(element);\n\n\tif (!activeElement) {\n\t\treturn false;\n\t}\n\n\tif (!contains(element, activeElement)) {\n\t\tconst activeDescendant = activeElement.getAttribute(\n\t\t\t\"aria-activedescendant\",\n\t\t);\n\t\tif (!activeDescendant) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!(\"id\" in element)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (activeDescendant === element.id) {\n\t\t\treturn true;\n\t\t}\n\t\treturn !!element.querySelector(`#${CSS.escape(activeDescendant)}`);\n\t}\n\treturn true;\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/f6e686fe9d3b983d48650980c1ecfdde320bc62f/packages/@react-aria/focus/src/FocusScope.tsx\n */\n\nimport type { Accessor } from \"solid-js\";\n\nimport { focusWithoutScrolling } from \"./focus-without-scrolling\";\nimport {\n\tFOCUSABLE_ELEMENT_SELECTOR,\n\tTABBABLE_ELEMENT_SELECTOR,\n\tisElementVisible,\n} from \"./tabbable\";\n\nexport interface FocusManager {\n\t/** Moves focus to the next focusable or tabbable element in the focus scope. */\n\tfocusNext(opts?: FocusManagerOptions): HTMLElement | undefined;\n\n\t/** Moves focus to the previous focusable or tabbable element in the focus scope. */\n\tfocusPrevious(opts?: FocusManagerOptions): HTMLElement | undefined;\n\n\t/** Moves focus to the first focusable or tabbable element in the focus scope. */\n\tfocusFirst(opts?: FocusManagerOptions): HTMLElement | undefined;\n\n\t/** Moves focus to the last focusable or tabbable element in the focus scope. */\n\tfocusLast(opts?: FocusManagerOptions): HTMLElement | undefined;\n}\n\nexport interface FocusManagerOptions {\n\t/** The element to start searching from. The currently focused element by default. */\n\tfrom?: Element;\n\n\t/** Whether to only include tabbable elements, or all focusable elements. */\n\ttabbable?: boolean;\n\n\t/** Whether focus should wrap around when it reaches the end of the scope. */\n\twrap?: boolean;\n\n\t/** A callback that determines whether the given element is focused. */\n\taccept?: (node: Element) => boolean;\n}\n\n/**\n * Creates a FocusManager object that can be used to move focus within an element.\n */\nexport function createFocusManager(\n\tref: Accessor<HTMLElement | undefined>,\n\tdefaultOptions: Accessor<FocusManagerOptions> = () => ({}),\n): FocusManager {\n\tconst focusNext = (opts: FocusManagerOptions = {}) => {\n\t\tconst root = ref();\n\n\t\tif (!root) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\tfrom = defaultOptions().from || document.activeElement,\n\t\t\ttabbable = defaultOptions().tabbable,\n\t\t\twrap = defaultOptions().wrap,\n\t\t\taccept = defaultOptions().accept,\n\t\t} = opts;\n\n\t\tconst walker = getFocusableTreeWalker(root, { tabbable, accept });\n\n\t\tif (from && root.contains(from)) {\n\t\t\twalker.currentNode = from;\n\t\t}\n\n\t\tlet nextNode = walker.nextNode() as HTMLElement | undefined;\n\n\t\tif (!nextNode && wrap) {\n\t\t\twalker.currentNode = root;\n\t\t\tnextNode = walker.nextNode() as HTMLElement | undefined;\n\t\t}\n\n\t\tif (nextNode) {\n\t\t\tfocusElement(nextNode, true);\n\t\t}\n\n\t\treturn nextNode;\n\t};\n\n\tconst focusPrevious = (opts: FocusManagerOptions = {}) => {\n\t\tconst root = ref();\n\n\t\tif (!root) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\tfrom = defaultOptions().from || document.activeElement,\n\t\t\ttabbable = defaultOptions().tabbable,\n\t\t\twrap = defaultOptions().wrap,\n\t\t\taccept = defaultOptions().accept,\n\t\t} = opts;\n\n\t\tconst walker = getFocusableTreeWalker(root, { tabbable, accept });\n\n\t\tif (from && root.contains(from)) {\n\t\t\twalker.currentNode = from;\n\t\t} else {\n\t\t\tconst next = last(walker);\n\t\t\tif (next) {\n\t\t\t\tfocusElement(next, true);\n\t\t\t}\n\t\t\treturn next;\n\t\t}\n\n\t\tlet previousNode = walker.previousNode() as HTMLElement | undefined;\n\n\t\tif (!previousNode && wrap) {\n\t\t\twalker.currentNode = root;\n\t\t\tpreviousNode = last(walker);\n\t\t}\n\n\t\tif (previousNode) {\n\t\t\tfocusElement(previousNode, true);\n\t\t}\n\n\t\treturn previousNode;\n\t};\n\n\tconst focusFirst = (opts: FocusManagerOptions = {}) => {\n\t\tconst root = ref();\n\n\t\tif (!root) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttabbable = defaultOptions().tabbable,\n\t\t\taccept = defaultOptions().accept,\n\t\t} = opts;\n\n\t\tconst walker = getFocusableTreeWalker(root, { tabbable, accept });\n\t\tconst nextNode = walker.nextNode() as HTMLElement | undefined;\n\n\t\tif (nextNode) {\n\t\t\tfocusElement(nextNode, true);\n\t\t}\n\n\t\treturn nextNode;\n\t};\n\n\tconst focusLast = (opts: FocusManagerOptions = {}) => {\n\t\tconst root = ref();\n\n\t\tif (!root) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttabbable = defaultOptions().tabbable,\n\t\t\taccept = defaultOptions().accept,\n\t\t} = opts;\n\n\t\tconst walker = getFocusableTreeWalker(root, { tabbable, accept });\n\t\tconst next = last(walker);\n\n\t\tif (next) {\n\t\t\tfocusElement(next, true);\n\t\t}\n\n\t\treturn next;\n\t};\n\n\treturn { focusNext, focusPrevious, focusFirst, focusLast };\n}\n\nfunction focusElement(element: HTMLElement | null, scroll = false) {\n\tif (element != null && !scroll) {\n\t\ttry {\n\t\t\tfocusWithoutScrolling(element);\n\t\t} catch (err) {\n\t\t\t// ignore\n\t\t}\n\t} else if (element != null) {\n\t\ttry {\n\t\t\telement.focus();\n\t\t} catch (err) {\n\t\t\t// ignore\n\t\t}\n\t}\n}\n\nfunction last(walker: TreeWalker) {\n\tlet next: HTMLElement | undefined;\n\tlet last: HTMLElement | undefined;\n\n\tdo {\n\t\tlast = walker.lastChild() as HTMLElement;\n\t\tif (last) {\n\t\t\tnext = last;\n\t\t}\n\t} while (last);\n\n\treturn next;\n}\n\nfunction isElementInScope(element: Element | null, scope: HTMLElement[]) {\n\treturn scope.some((node) => node.contains(element));\n}\n\n/**\n * Create a [TreeWalker]{@link https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker}\n * that matches all focusable/tabbable elements.\n */\nexport function getFocusableTreeWalker(\n\troot: HTMLElement,\n\topts?: FocusManagerOptions,\n\tscope?: HTMLElement[],\n) {\n\tconst selector = opts?.tabbable\n\t\t? TABBABLE_ELEMENT_SELECTOR\n\t\t: FOCUSABLE_ELEMENT_SELECTOR;\n\tconst walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {\n\t\tacceptNode(node) {\n\t\t\t// Skip nodes inside the starting node.\n\t\t\tif (opts?.from?.contains(node)) {\n\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t(node as HTMLElement).matches(selector) &&\n\t\t\t\tisElementVisible(node as HTMLElement) &&\n\t\t\t\t(!scope || isElementInScope(node as HTMLElement, scope)) &&\n\t\t\t\t(!opts?.accept || opts.accept(node as Element))\n\t\t\t) {\n\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t}\n\n\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t},\n\t});\n\n\tif (opts?.from) {\n\t\twalker.currentNode = opts.from;\n\t}\n\n\treturn walker;\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/getScrollParent.ts\n */\n\nexport function getScrollParent(node: Element | null): Element {\n\tlet parentNode = node;\n\twhile (parentNode && !isScrollable(parentNode)) {\n\t\tparentNode = parentNode.parentElement;\n\t}\n\n\treturn parentNode || document.scrollingElement || document.documentElement;\n}\n\nfunction isScrollable(node: Element): boolean {\n\tconst style = window.getComputedStyle(node);\n\treturn /(auto|scroll)/.test(\n\t\tstyle.overflow + style.overflowX + style.overflowY,\n\t);\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/isVirtualEvent.ts\n */\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\nimport { isAndroid } from \"./platform\";\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n\t// JAWS/NVDA with Firefox.\n\tif ((event as any).mozInputSource === 0 && event.isTrusted) {\n\t\treturn true;\n\t}\n\n\t// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n\t// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n\t// to detect TalkBack virtual clicks.\n\tif (isAndroid() && (event as PointerEvent).pointerType) {\n\t\treturn event.type === \"click\" && event.buttons === 1;\n\t}\n\n\treturn event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent) {\n\t// If the pointer size is zero, then we assume it's from a screen reader.\n\t// Android TalkBack double tap will sometimes return a event with width and height of 1\n\t// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n\t// Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n\t// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n\t// Talkback double tap from Windows Firefox touch screen press\n\treturn (\n\t\t(event.width === 0 && event.height === 0) ||\n\t\t(event.width === 1 &&\n\t\t\tevent.height === 1 &&\n\t\t\tevent.pressure === 0 &&\n\t\t\tevent.detail === 0 &&\n\t\t\tevent.pointerType === \"mouse\")\n\t);\n}\n","/** A function that does nothing. */\nexport function noop() {\n\treturn;\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/ff3e690fffc6c54367b8057e28a0e5b9211f37b5/packages/@react-stately/utils/src/number.ts\n */\n\n/**\n * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest valid step.\n */\nexport function clamp(\n\tvalue: number,\n\tmin = Number.NEGATIVE_INFINITY,\n\tmax = Number.POSITIVE_INFINITY,\n): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n\nexport function snapValueToStep(\n\tvalue: number,\n\tmin: number,\n\tmax: number,\n\tstep: number,\n): number {\n\tconst remainder = (value - (Number.isNaN(min) ? 0 : min)) % step;\n\tlet snappedValue =\n\t\tMath.abs(remainder) * 2 >= step\n\t\t\t? value + Math.sign(remainder) * (step - Math.abs(remainder))\n\t\t\t: value - remainder;\n\n\tif (!Number.isNaN(min)) {\n\t\tif (snappedValue < min) {\n\t\t\tsnappedValue = min;\n\t\t} else if (!Number.isNaN(max) && snappedValue > max) {\n\t\t\tsnappedValue = min + Math.floor((max - min) / step) * step;\n\t\t}\n\t} else if (!Number.isNaN(max) && snappedValue > max) {\n\t\tsnappedValue = Math.floor(max / step) * step;\n\t}\n\n\t// correct floating point behavior by rounding to step precision\n\tconst string = step.toString();\n\tconst index = string.indexOf(\".\");\n\tconst precision = index >= 0 ? string.length - index : 0;\n\n\tif (precision > 0) {\n\t\tconst pow = 10 ** precision;\n\t\tsnappedValue = Math.round(snappedValue * pow) / pow;\n\t}\n\n\treturn snappedValue;\n}\n\nexport const getPrecision = (n: number) => {\n\tlet e = 1;\n\tlet precision = 0;\n\twhile (Math.round(n * e) / e !== n) {\n\t\te *= 10;\n\t\tprecision++;\n\t}\n\n\treturn precision;\n};\n","/*\n * Portions of this file are based on code from ariakit.\n * MIT Licensed, Copyright (c) Diego Haz.\n *\n * Credits to the Ariakit team:\n * https://github.com/ariakit/ariakit/blob/84e97943ad637a582c01c9b56d880cd95f595737/packages/ariakit/src/hovercard/__utils/polygon.ts\n * https://github.com/ariakit/ariakit/blob/f2a96973de523d67e41eec983263936c489ef3e2/packages/ariakit/src/hovercard/__utils/debug-polygon.ts\n */\n\nexport type Point = [number, number];\nexport type Polygon = Point[];\n\nexport function getEventPoint(event: MouseEvent): Point {\n\treturn [event.clientX, event.clientY];\n}\n\n// Based on https://github.com/metafloor/pointinpoly\nexport function isPointInPolygon(point: Point, polygon: Polygon) {\n\tconst [x, y] = point;\n\tlet inside = false;\n\tconst length = polygon.length;\n\tfor (let l = length, i = 0, j = l - 1; i < l; j = i++) {\n\t\tconst [xi, yi] = polygon[i] as Point;\n\t\tconst [xj, yj] = polygon[j] as Point;\n\t\tconst [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0];\n\t\tconst where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi);\n\t\tif (yj < yi) {\n\t\t\tif (y >= yj && y < yi) {\n\t\t\t\t// point on the line\n\t\t\t\tif (where === 0) return true;\n\t\t\t\tif (where > 0) {\n\t\t\t\t\tif (y === yj) {\n\t\t\t\t\t\t// ray intersects vertex\n\t\t\t\t\t\tif (y > vy) {\n\t\t\t\t\t\t\tinside = !inside;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinside = !inside;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (yi < yj) {\n\t\t\tif (y > yi && y <= yj) {\n\t\t\t\t// point on the line\n\t\t\t\tif (where === 0) return true;\n\t\t\t\tif (where < 0) {\n\t\t\t\t\tif (y === yj) {\n\t\t\t\t\t\t// ray intersects vertex\n\t\t\t\t\t\tif (y < vy) {\n\t\t\t\t\t\t\tinside = !inside;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinside = !inside;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (y === yi && ((x >= xj && x <= xi) || (x >= xi && x <= xj))) {\n\t\t\t// point on horizontal edge\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn inside;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Debug polygon\n * -----------------------------------------------------------------------------------------------*/\n\nfunction getPolygon() {\n\tconst id = \"debug-polygon\";\n\tconst existingPolygon = document.getElementById(id);\n\tif (existingPolygon) {\n\t\treturn existingPolygon;\n\t}\n\tconst svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\tsvg.style.top = \"0\";\n\tsvg.style.left = \"0\";\n\tsvg.style.width = \"100%\";\n\tsvg.style.height = \"100%\";\n\tsvg.style.fill = \"green\";\n\tsvg.style.opacity = \"0.2\";\n\tsvg.style.position = \"fixed\";\n\tsvg.style.pointerEvents = \"none\";\n\tsvg.style.zIndex = \"999999\";\n\tconst polygon = document.createElementNS(\n\t\t\"http://www.w3.org/2000/svg\",\n\t\t\"polygon\",\n\t);\n\tpolygon.setAttribute(\"id\", id);\n\tpolygon.setAttribute(\"points\", \"0,0 0,0\");\n\tsvg.appendChild(polygon);\n\tdocument.body.appendChild(svg);\n\treturn polygon;\n}\n\nexport function debugPolygon(polygon: Polygon) {\n\tconst polygonElement = getPolygon();\n\tconst points = polygon.map((point) => point.join(\",\")).join(\" \");\n\tpolygonElement.setAttribute(\"points\", points);\n\t// Return SVG element\n\treturn polygonElement.parentElement;\n}\n","import { type ComponentProps, type ValidComponent, mergeProps } from \"solid-js\";\n\n/**\n * Allows for extending a set of props (`Source`) by an overriding set of props (`Override`),\n * ensuring that any duplicates are overridden by the overriding set of props.\n */\nexport type OverrideProps<Source = {}, Override = {}> = Omit<\n\tSource,\n\tkeyof Override\n> &\n\tOverride;\n\n/**\n * Allows for extending a set of `ComponentProps` by an overriding set of props,\n * ensuring that any duplicates are overridden by the overriding set of props.\n */\nexport type OverrideComponentProps<T extends ValidComponent, P> = OverrideProps<\n\tComponentProps<T>,\n\tP\n>;\n\nexport function mergeDefaultProps<T extends {}, D extends Partial<T>>(\n\tdefaultProps: D,\n\tprops: T,\n): OverrideProps<T, D> {\n\treturn mergeProps(defaultProps, props) as OverrideProps<T, D>;\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/a9dea8a3672179e6c38aafd1429daf44c7ea2ff6/packages/@react-aria/utils/src/runAfterTransition.ts\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nconst transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nconst transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n\tif (typeof window === \"undefined\") {\n\t\treturn;\n\t}\n\n\tconst onTransitionStart = (e: TransitionEvent) => {\n\t\tif (!e.target) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the transitioning property to the list for this element.\n\t\tlet transitions = transitionsByElement.get(e.target);\n\t\tif (!transitions) {\n\t\t\ttransitions = new Set();\n\t\t\ttransitionsByElement.set(e.target, transitions);\n\n\t\t\t// The transitioncancel event must be registered on the element itself, rather than as a global\n\t\t\t// event. This enables us to handle when the node is deleted from the document while it is transitioning.\n\t\t\t// In that case, the cancel event would have nowhere to bubble to, so we need to handle it directly.\n\t\t\te.target.addEventListener(\n\t\t\t\t\"transitioncancel\",\n\t\t\t\tonTransitionEnd as EventListener,\n\t\t\t);\n\t\t}\n\n\t\ttransitions.add(e.propertyName);\n\t};\n\n\tconst onTransitionEnd = (e: TransitionEvent) => {\n\t\tif (!e.target) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove property from list of transitioning properties.\n\t\tconst properties = transitionsByElement.get(e.target);\n\t\tif (!properties) {\n\t\t\treturn;\n\t\t}\n\n\t\tproperties.delete(e.propertyName);\n\n\t\t// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n\t\tif (properties.size === 0) {\n\t\t\te.target.removeEventListener(\n\t\t\t\t\"transitioncancel\",\n\t\t\t\tonTransitionEnd as EventListener,\n\t\t\t);\n\t\t\ttransitionsByElement.delete(e.target);\n\t\t}\n\n\t\t// If no transitioning elements, call all the queued callbacks.\n\t\tif (transitionsByElement.size === 0) {\n\t\t\tfor (const cb of transitionCallbacks) {\n\t\t\t\tcb();\n\t\t\t}\n\n\t\t\ttransitionCallbacks.clear();\n\t\t}\n\t};\n\n\tdocument.body.addEventListener(\"transitionrun\", onTransitionStart);\n\tdocument.body.addEventListener(\"transitionend\", onTransitionEnd);\n}\n\nif (typeof document !== \"undefined\") {\n\tif (document.readyState !== \"loading\") {\n\t\tsetupGlobalEvents();\n\t} else {\n\t\tdocument.addEventListener(\"DOMContentLoaded\", setupGlobalEvents);\n\t}\n}\n\nexport function runAfterTransition(fn: () => void) {\n\t// Wait one frame to see if an animation starts, e.g. a transition on mount.\n\trequestAnimationFrame(() => {\n\t\t// If no transitions are running, call the function immediately.\n\t\t// Otherwise, add it to a list of callbacks to run at the end of the animation.\n\t\tif (transitionsByElement.size === 0) {\n\t\t\tfn();\n\t\t} else {\n\t\t\ttransitionCallbacks.add(fn);\n\t\t}\n\t});\n}\n","/*\n * Portions of this file are based on code from react-spectrum.\n * Apache License Version 2.0, Copyright 2020 Adobe.\n *\n * Credits to the React Spectrum team:\n * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/utils/src/scrollIntoView.ts\n */\n\nimport { getScrollParent } from \"./get-scroll-parent\";\n\ninterface ScrollIntoViewportOpts {\n\t/** The optional containing element of the target to be centered in the viewport. */\n\tcontainingElement?: Element;\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement) {\n\tconst offsetX = relativeOffset(scrollView, element, \"left\");\n\tconst offsetY = relativeOffset(scrollView, element, \"top\");\n\tconst width = element.offsetWidth;\n\tconst height = element.offsetHeight;\n\tlet x = scrollView.scrollLeft;\n\tlet y = scrollView.scrollTop;\n\tconst maxX = x + scrollView.offsetWidth;\n\tconst maxY = y + scrollView.offsetHeight;\n\n\tif (offsetX <= x) {\n\t\tx = offsetX;\n\t} else if (offsetX + width > maxX) {\n\t\tx += offsetX + width - maxX;\n\t}\n\tif (offsetY <= y) {\n\t\ty = offsetY;\n\t} else if (offsetY + height > maxY) {\n\t\ty += offsetY + height - maxY;\n\t}\n\n\tscrollView.scrollLeft = x;\n\tscrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(\n\tancestor: HTMLElement,\n\tchild: HTMLElement,\n\taxis: \"left\" | \"top\",\n) {\n\tconst prop = axis === \"left\" ? \"offsetLeft\" : \"offsetTop\";\n\tlet sum = 0;\n\twhile (child.offsetParent) {\n\t\tsum += child[prop];\n\t\tif (child.offsetParent === ancestor) {\n\t\t\t// Stop once we have found the ancestor we are interested in.\n\t\t\tbreak;\n\t\t}\n\t\tif (child.offsetParent.contains(ancestor)) {\n\t\t\t// If the ancestor is not `position:relative`, then we stop at\n\t\t\t// _its_ offset parent, and we subtract off _its_ offset, so that\n\t\t\t// we end up with the proper offset from child to ancestor.\n\t\t\tsum -= ancestor[prop];\n\t\t\tbreak;\n\t\t}\n\t\t// biome-ignore lint/style/noParameterAssign: used in loop\n\t\tchild = child.offsetParent as HTMLElement;\n\t}\n\treturn sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(\n\ttargetElement: Element,\n\topts?: ScrollIntoViewportOpts,\n) {\n\tif (document.contains(targetElement)) {\n\t\tconst root = document.scrollingElement || document.documentElement;\n\t\tconst isScrollPrevented =\n\t\t\twindow.getComputedStyle(root).overflow === \"hidden\";\n\t\t// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n\t\tif (!isScrollPrevented) {\n\t\t\tconst { left: originalLeft, top: originalTop } =\n\t\t\t\ttargetElement.getBoundingClientRect();\n\n\t\t\t// use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n\t\t\t// won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n\t\t\ttargetElement?.scrollIntoView?.({ block: \"nearest\" });\n\t\t\tconst { left: newLeft, top: newTop } =\n\t\t\t\ttargetElement.getBoundingClientRect();\n\t\t\t// Account for sub pixel differences from rounding\n\t\t\tif (\n\t\t\t\tMath.abs(originalLeft - newLeft) > 1 ||\n\t\t\t\tMath.abs(originalTop - newTop) > 1\n\t\t\t) {\n\t\t\t\topts?.containingElement?.scrollIntoView?.({\n\t\t\t\t\tblock: \"center\",\n\t\t\t\t\tinline: \"center\",\n\t\t\t\t});\n\t\t\t\ttargetElement.scrollIntoView?.({ block: \"nearest\" });\n\t\t\t}\n\t\t} else {\n\t\t\tlet scrollParent = getScrollParent(targetElement);\n\t\t\t// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n\t\t\twhile (\n\t\t\t\ttargetElement &&\n\t\t\t\tscrollParent &&\n\t\t\t\ttargetElement !== root &&\n\t\t\t\tscrollParent !== root\n\t\t\t) {\n\t\t\t\tscrollIntoView(\n\t\t\t\t\tscrollParent as HTMLElement,\n\t\t\t\t\ttargetElement as HTMLElement,\n\t\t\t\t);\n\t\t\t\t// biome-ignore lint/style/noParameterAssign: used in loop\n\t\t\t\ttargetElement = scrollParent;\n\t\t\t\tscrollParent = getScrollParent(targetElement);\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { JSX } from \"solid-js\";\n\nexport const visuallyHiddenStyles: JSX.CSSProperties = {\n\tborder: \"0\",\n\tclip: \"rect(0 0 0 0)\",\n\t\"clip-path\": \"inset(50%)\",\n\theight: \"1px\",\n\tmargin: \"0 -1px -1px 0\",\n\toverflow: \"hidden\",\n\tpadding: \"0\",\n\tposition: \"absolute\",\n\twidth: \"1px\",\n\t\"white-space\": \"nowrap\",\n};\n"]}