primer_view_components 0.35.1 → 0.35.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/javascripts/components/primer/alpha/select_panel_element.d.ts +3 -1
- data/app/assets/javascripts/components/primer/primer.d.ts +0 -1
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +1 -1
- data/app/components/primer/alpha/select_panel.html.erb +1 -1
- data/app/components/primer/alpha/select_panel_element.d.ts +3 -1
- data/app/components/primer/alpha/select_panel_element.js +10 -12
- data/app/components/primer/alpha/select_panel_element.ts +9 -10
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +4 -0
- data/app/components/primer/primer.d.ts +0 -1
- data/app/components/primer/primer.js +0 -1
- data/app/components/primer/primer.ts +0 -1
- data/lib/primer/view_components/version.rb +1 -1
- metadata +2 -6
- data/app/assets/javascripts/components/primer/aria_live.d.ts +0 -8
- data/app/components/primer/aria_live.d.ts +0 -8
- data/app/components/primer/aria_live.js +0 -38
- data/app/components/primer/aria_live.ts +0 -41
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"primer_view_components.js","sources":["../../../node_modules/@github/include-fragment-element/dist/include-fragment-element.js","../../../node_modules/@github/include-fragment-element/dist/include-fragment-element-define.js","../../../node_modules/@github/remote-input-element/dist/index.js","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/@github/catalyst/lib/bind.js","../../../node_modules/@github/catalyst/lib/dasherize.js","../../../node_modules/@github/catalyst/lib/attr.js","../../../node_modules/@github/catalyst/lib/core.js","../../../node_modules/@github/catalyst/lib/register.js","../../../node_modules/@github/catalyst/lib/auto-shadow-root.js","../../../node_modules/@github/catalyst/lib/target.js","../../../node_modules/@github/catalyst/lib/findtarget.js","../../../node_modules/@github/catalyst/lib/controller.js","../../../node_modules/@github/catalyst/lib/lazy-define.js","../../components/primer/alpha/action_list.ts","../../../node_modules/@primer/behaviors/dist/esm/anchored-position.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.mjs","../../../node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-trap.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/user-agent.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/unique-id.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-zone.mjs","../../components/primer/alpha/action_bar_element.ts","../../../node_modules/@github/details-menu-element/dist/index.js","../../components/primer/anchored_position.ts","../../components/primer/dialog_helper.ts","../../../node_modules/@oddbird/popover-polyfill/dist/popover.js","../../components/primer/focus_group.ts","../../components/primer/scrollable_region.ts","../../components/primer/aria_live.ts","../../components/primer/alpha/modal_dialog.ts","../../components/primer/beta/nav_list.ts","../../components/primer/beta/nav_list_group_element.ts","../../components/primer/alpha/segmented_control.ts","../../components/primer/alpha/toggle_switch.ts","../../components/primer/alpha/tool_tip.ts","../../components/primer/alpha/x_banner.ts","../../../node_modules/@github/combobox-nav/dist/index.js","../../../node_modules/@github/auto-complete-element/dist/autocomplete.js","../../../node_modules/@github/auto-complete-element/dist/debounce.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element-define.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element-define.js","../../components/primer/beta/clipboard_copy.ts","../../../node_modules/@github/relative-time-element/dist/duration-format-ponyfill.js","../../../node_modules/@github/relative-time-element/dist/duration.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element-define.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element-define.js","../../lib/primer/forms/primer_multi_input.ts","../../../node_modules/@github/mini-throttle/dist/index.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element-define.js","../../lib/primer/forms/primer_text_field.ts","../../lib/primer/forms/toggle_switch_input.ts","../../components/primer/alpha/action_menu/action_menu_element.ts","../../components/primer/alpha/select_panel_element.ts"],"sourcesContent":["var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _IncludeFragmentElement_instances, _IncludeFragmentElement_busy, _IncludeFragmentElement_observer, _IncludeFragmentElement_handleData, _IncludeFragmentElement_getData, _IncludeFragmentElement_getStringOrErrorData, _IncludeFragmentElement_task, _IncludeFragmentElement_fetchDataWithEvents;\nconst privateData = new WeakMap();\nfunction isWildcard(accept) {\n return accept && !!accept.split(',').find(x => x.match(/^\\s*\\*\\/\\*/));\n}\nlet cspTrustedTypesPolicyPromise = null;\nexport class IncludeFragmentElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _IncludeFragmentElement_instances.add(this);\n _IncludeFragmentElement_busy.set(this, false);\n _IncludeFragmentElement_observer.set(this, new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const { target } = entry;\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(target);\n if (!(target instanceof IncludeFragmentElement))\n return;\n if (target.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n }, {\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01,\n }));\n }\n static define(tag = 'include-fragment', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n static get observedAttributes() {\n return ['src', 'loading'];\n }\n get src() {\n const src = this.getAttribute('src');\n if (src) {\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n else {\n return '';\n }\n }\n set src(val) {\n this.setAttribute('src', val);\n }\n get loading() {\n if (this.getAttribute('loading') === 'lazy')\n return 'lazy';\n return 'eager';\n }\n set loading(value) {\n this.setAttribute('loading', value);\n }\n get accept() {\n return this.getAttribute('accept') || '';\n }\n set accept(val) {\n this.setAttribute('accept', val);\n }\n get data() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n attributeChangedCallback(attribute, oldVal) {\n if (attribute === 'src') {\n if (this.isConnected && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n else if (attribute === 'loading') {\n if (this.isConnected && oldVal !== 'eager' && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n connectedCallback() {\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = `:host {display: block;}`;\n this.shadowRoot.append(style, document.createElement('slot'));\n }\n if (this.src && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n if (this.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").observe(this);\n }\n }\n request() {\n const src = this.src;\n if (!src) {\n throw new Error('missing src');\n }\n return new Request(src, {\n method: 'GET',\n credentials: 'same-origin',\n headers: {\n Accept: this.accept || 'text/html',\n },\n });\n }\n load() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n fetch(request) {\n return fetch(request);\n }\n refetch() {\n privateData.delete(this);\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n}\n_IncludeFragmentElement_busy = new WeakMap(), _IncludeFragmentElement_observer = new WeakMap(), _IncludeFragmentElement_instances = new WeakSet(), _IncludeFragmentElement_handleData = async function _IncludeFragmentElement_handleData() {\n if (__classPrivateFieldGet(this, _IncludeFragmentElement_busy, \"f\"))\n return;\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, true, \"f\");\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(this);\n try {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n const dataTreatedAsString = data;\n const template = document.createElement('template');\n template.innerHTML = dataTreatedAsString;\n const fragment = document.importNode(template.content, true);\n const canceled = !this.dispatchEvent(new CustomEvent('include-fragment-replace', {\n cancelable: true,\n detail: { fragment },\n }));\n if (canceled) {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n return;\n }\n this.replaceWith(fragment);\n this.dispatchEvent(new CustomEvent('include-fragment-replaced'));\n }\n catch (_a) {\n this.classList.add('is-error');\n }\n finally {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n }\n}, _IncludeFragmentElement_getData = async function _IncludeFragmentElement_getData() {\n const src = this.src;\n const cachedData = privateData.get(this);\n if (cachedData && cachedData.src === src) {\n return cachedData.data;\n }\n else {\n let data;\n if (src) {\n data = __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_fetchDataWithEvents).call(this);\n }\n else {\n data = Promise.reject(new Error('missing src'));\n }\n privateData.set(this, { src, data });\n return data;\n }\n}, _IncludeFragmentElement_getStringOrErrorData = async function _IncludeFragmentElement_getStringOrErrorData() {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n return data.toString();\n}, _IncludeFragmentElement_task = async function _IncludeFragmentElement_task(eventsToDispatch) {\n await new Promise(resolve => setTimeout(resolve, 0));\n for (const eventType of eventsToDispatch) {\n this.dispatchEvent(new Event(eventType));\n }\n}, _IncludeFragmentElement_fetchDataWithEvents = async function _IncludeFragmentElement_fetchDataWithEvents() {\n try {\n await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['loadstart']);\n const response = await this.fetch(this.request());\n if (response.status !== 200) {\n throw new Error(`Failed to load resource: the server responded with a status of ${response.status}`);\n }\n const ct = response.headers.get('Content-Type');\n if (!isWildcard(this.accept) && (!ct || !ct.includes(this.accept ? this.accept : 'text/html'))) {\n throw new Error(`Failed to load resource: expected ${this.accept || 'text/html'} but was ${ct}`);\n }\n const responseText = await response.text();\n let data = responseText;\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n data = cspTrustedTypesPolicy.createHTML(responseText, response);\n }\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['load', 'loadend']);\n return data;\n }\n catch (error) {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['error', 'loadend']);\n throw error;\n }\n};\n","import { IncludeFragmentElement } from './include-fragment-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.IncludeFragmentElement = IncludeFragmentElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default IncludeFragmentElement;\nexport * from './include-fragment-element.js';\n","const states = new WeakMap();\nclass RemoteInputElement extends HTMLElement {\n constructor() {\n super();\n const fetch = fetchResults.bind(null, this, true);\n const state = { currentQuery: null, oninput: debounce((e) => fetch(e)), fetch, controller: null };\n states.set(this, state);\n }\n static get observedAttributes() {\n return ['src'];\n }\n attributeChangedCallback(name, oldValue) {\n if (oldValue && name === 'src') {\n fetchResults(this, false);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('spellcheck', 'false');\n const state = states.get(this);\n if (!state)\n return;\n input.addEventListener('focus', state.fetch);\n input.addEventListener('change', state.fetch);\n input.addEventListener('input', state.oninput);\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n input.removeEventListener('focus', state.fetch);\n input.removeEventListener('change', state.fetch);\n input.removeEventListener('input', state.oninput);\n }\n get input() {\n const input = this.querySelector('input, textarea');\n return input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement ? input : null;\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return { signal: null, abort() { } };\n}\nasync function fetchResults(remoteInput, checkCurrentQuery, event) {\n const input = remoteInput.input;\n if (!input)\n return;\n const state = states.get(remoteInput);\n if (!state)\n return;\n const query = input.value;\n if (checkCurrentQuery && state.currentQuery === query)\n return;\n state.currentQuery = query;\n const src = remoteInput.src;\n if (!src)\n return;\n const resultsContainer = document.getElementById(remoteInput.getAttribute('aria-owns') || '');\n if (!resultsContainer)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search);\n params.append(remoteInput.getAttribute('param') || 'q', query);\n url.search = params.toString();\n if (state.controller) {\n state.controller.abort();\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('loadstart'));\n remoteInput.setAttribute('loading', '');\n }\n state.controller = makeAbortController();\n let response;\n let html = '';\n try {\n response = await fetchWithNetworkEvents(remoteInput, url.toString(), {\n signal: state.controller.signal,\n credentials: 'same-origin',\n headers: { accept: 'text/fragment+html' }\n });\n html = await response.text();\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n catch (error) {\n if (error instanceof Error && error.name !== 'AbortError') {\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n return;\n }\n if (response && response.ok) {\n resultsContainer.innerHTML = html;\n remoteInput.dispatchEvent(new CustomEvent('remote-input-success', { bubbles: true, detail: { \"eventType\": event ? event.type : undefined } }));\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('remote-input-error', { bubbles: true }));\n }\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new CustomEvent('load'));\n el.dispatchEvent(new CustomEvent('loadend'));\n return response;\n }\n catch (error) {\n if (error instanceof Error && (error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') {\n el.dispatchEvent(new CustomEvent('error'));\n el.dispatchEvent(new CustomEvent('loadend'));\n }\n throw error;\n }\n}\nfunction debounce(callback) {\n let timeout;\n return function (args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n clearTimeout(timeout);\n callback(args);\n }, 300);\n };\n}\nexport default RemoteInputElement;\nif (!window.customElements.get('remote-input')) {\n window.RemoteInputElement = RemoteInputElement;\n window.customElements.define('remote-input', RemoteInputElement);\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","const controllers = new WeakSet();\n/*\n * Bind `[data-action]` elements from the DOM to their actions.\n *\n */\nexport function bind(controller) {\n controllers.add(controller);\n if (controller.shadowRoot)\n bindShadow(controller.shadowRoot);\n bindElements(controller);\n listenForBind(controller.ownerDocument);\n}\nexport function bindShadow(root) {\n bindElements(root);\n listenForBind(root);\n}\nconst observers = new WeakMap();\n/**\n * Set up observer that will make sure any actions that are dynamically\n * injected into `el` will be bound to it's controller.\n *\n * This returns a Subscription object which you can call `unsubscribe()` on to\n * stop further live updates.\n */\nexport function listenForBind(el = document) {\n if (observers.has(el))\n return observers.get(el);\n let closed = false;\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.target instanceof Element) {\n bindActions(mutation.target);\n }\n else if (mutation.type === 'childList' && mutation.addedNodes.length) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element) {\n bindElements(node);\n }\n }\n }\n }\n });\n observer.observe(el, { childList: true, subtree: true, attributeFilter: ['data-action'] });\n const subscription = {\n get closed() {\n return closed;\n },\n unsubscribe() {\n closed = true;\n observers.delete(el);\n observer.disconnect();\n }\n };\n observers.set(el, subscription);\n return subscription;\n}\nfunction bindElements(root) {\n for (const el of root.querySelectorAll('[data-action]')) {\n bindActions(el);\n }\n // Also bind the controller to itself\n if (root instanceof Element && root.hasAttribute('data-action')) {\n bindActions(root);\n }\n}\n// Bind a single function to all events to avoid anonymous closure performance penalty.\nfunction handleEvent(event) {\n const el = event.currentTarget;\n for (const binding of bindings(el)) {\n if (event.type === binding.type) {\n const controller = el.closest(binding.tag);\n if (controllers.has(controller) && typeof controller[binding.method] === 'function') {\n controller[binding.method](event);\n }\n const root = el.getRootNode();\n if (root instanceof ShadowRoot && controllers.has(root.host) && root.host.matches(binding.tag)) {\n const shadowController = root.host;\n if (typeof shadowController[binding.method] === 'function') {\n shadowController[binding.method](event);\n }\n }\n }\n }\n}\nfunction* bindings(el) {\n for (const action of (el.getAttribute('data-action') || '').trim().split(/\\s+/)) {\n const eventSep = action.lastIndexOf(':');\n const methodSep = Math.max(0, action.lastIndexOf('#')) || action.length;\n yield {\n type: action.slice(0, eventSep),\n tag: action.slice(eventSep + 1, methodSep),\n method: action.slice(methodSep + 1) || 'handleEvent'\n } || 'handleEvent';\n }\n}\nfunction bindActions(el) {\n for (const binding of bindings(el)) {\n el.addEventListener(binding.type, handleEvent);\n }\n}\n//# sourceMappingURL=bind.js.map","export const dasherize = (str) => String(typeof str === 'symbol' ? str.description : str)\n .replace(/([A-Z]($|[a-z]))/g, '-$1')\n .replace(/--/g, '-')\n .replace(/^-|-$/, '')\n .toLowerCase();\nexport const mustDasherize = (str, type = 'property') => {\n const dashed = dasherize(str);\n if (!dashed.includes('-')) {\n throw new DOMException(`${type}: ${String(str)} is not a valid ${type} name`, 'SyntaxError');\n }\n return dashed;\n};\n//# sourceMappingURL=dasherize.js.map","import { mustDasherize } from './dasherize.js';\nimport { meta } from './core.js';\nconst attrKey = 'attr';\n/**\n * Attr is a decorator which tags a property as one to be initialized via\n * `initializeAttrs`.\n *\n * The signature is typed such that the property must be one of a String,\n * Number or Boolean. This matches the behavior of `initializeAttrs`.\n */\nexport function attr(proto, key) {\n meta(proto, attrKey).add(key);\n}\n/**\n * initializeAttrs is called with a set of class property names (if omitted, it\n * will look for any properties tagged with the `@attr` decorator). With this\n * list it defines property descriptors for each property that map to `data-*`\n * attributes on the HTMLElement instance.\n *\n * It works around Native Class Property semantics - which are equivalent to\n * calling `Object.defineProperty` on the instance upon creation, but before\n * `constructor()` is called.\n *\n * If a class property is assigned to the class body, it will infer the type\n * (using `typeof`) and define an appropriate getter/setter combo that aligns\n * to that type. This means class properties assigned to Numbers can only ever\n * be Numbers, assigned to Booleans can only ever be Booleans, and assigned to\n * Strings can only ever be Strings.\n *\n * This is automatically called as part of `@controller`. If a class uses the\n * `@controller` decorator it should not call this manually.\n */\nconst initialized = new WeakSet();\nexport function initializeAttrs(instance, names) {\n if (initialized.has(instance))\n return;\n initialized.add(instance);\n const proto = Object.getPrototypeOf(instance);\n const prefix = proto?.constructor?.attrPrefix ?? 'data-';\n if (!names)\n names = meta(proto, attrKey);\n for (const key of names) {\n const value = instance[key];\n const name = mustDasherize(`${prefix}${key}`);\n let descriptor = {\n configurable: true,\n get() {\n return this.getAttribute(name) || '';\n },\n set(newValue) {\n this.setAttribute(name, newValue || '');\n }\n };\n if (typeof value === 'number') {\n descriptor = {\n configurable: true,\n get() {\n return Number(this.getAttribute(name) || 0);\n },\n set(newValue) {\n this.setAttribute(name, newValue);\n }\n };\n }\n else if (typeof value === 'boolean') {\n descriptor = {\n configurable: true,\n get() {\n return this.hasAttribute(name);\n },\n set(newValue) {\n this.toggleAttribute(name, newValue);\n }\n };\n }\n Object.defineProperty(instance, key, descriptor);\n if (key in instance && !instance.hasAttribute(name)) {\n descriptor.set.call(instance, value);\n }\n }\n}\nexport function defineObservedAttributes(classObject) {\n let observed = classObject.observedAttributes || [];\n const prefix = classObject.attrPrefix ?? 'data-';\n const attrToAttributeName = (name) => mustDasherize(`${prefix}${name}`);\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return [...meta(classObject.prototype, attrKey)].map(attrToAttributeName).concat(observed);\n },\n set(attributes) {\n observed = attributes;\n }\n });\n}\n//# sourceMappingURL=attr.js.map","import { register } from './register.js';\nimport { bind, bindShadow } from './bind.js';\nimport { autoShadowRoot } from './auto-shadow-root.js';\nimport { defineObservedAttributes, initializeAttrs } from './attr.js';\nconst symbol = Symbol.for('catalyst');\nexport class CatalystDelegate {\n constructor(classObject) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const delegate = this;\n const connectedCallback = classObject.prototype.connectedCallback;\n classObject.prototype.connectedCallback = function () {\n delegate.connectedCallback(this, connectedCallback);\n };\n const disconnectedCallback = classObject.prototype.disconnectedCallback;\n classObject.prototype.disconnectedCallback = function () {\n delegate.disconnectedCallback(this, disconnectedCallback);\n };\n const attributeChangedCallback = classObject.prototype.attributeChangedCallback;\n classObject.prototype.attributeChangedCallback = function (name, oldValue, newValue) {\n delegate.attributeChangedCallback(this, name, oldValue, newValue, attributeChangedCallback);\n };\n let observedAttributes = classObject.observedAttributes || [];\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return delegate.observedAttributes(this, observedAttributes);\n },\n set(attributes) {\n observedAttributes = attributes;\n }\n });\n defineObservedAttributes(classObject);\n register(classObject);\n }\n observedAttributes(instance, observedAttributes) {\n return observedAttributes;\n }\n connectedCallback(instance, connectedCallback) {\n instance.toggleAttribute('data-catalyst', true);\n customElements.upgrade(instance);\n autoShadowRoot(instance);\n initializeAttrs(instance);\n bind(instance);\n connectedCallback?.call(instance);\n if (instance.shadowRoot)\n bindShadow(instance.shadowRoot);\n }\n disconnectedCallback(element, disconnectedCallback) {\n disconnectedCallback?.call(element);\n }\n attributeChangedCallback(instance, name, oldValue, newValue, attributeChangedCallback) {\n initializeAttrs(instance);\n if (name !== 'data-catalyst' && attributeChangedCallback) {\n attributeChangedCallback.call(instance, name, oldValue, newValue);\n }\n }\n}\nexport function meta(proto, name) {\n if (!Object.prototype.hasOwnProperty.call(proto, symbol)) {\n const parent = proto[symbol];\n const map = (proto[symbol] = new Map());\n if (parent) {\n for (const [key, value] of parent) {\n map.set(key, new Set(value));\n }\n }\n }\n const map = proto[symbol];\n if (!map.has(name))\n map.set(name, new Set());\n return map.get(name);\n}\n//# sourceMappingURL=core.js.map","import { dasherize } from './dasherize.js';\n/**\n * Register the controller as a custom element.\n *\n * The classname is converted to a approriate tag name.\n *\n * Example: HelloController => hello-controller\n */\nexport function register(classObject) {\n const name = dasherize(classObject.name).replace(/-element$/, '');\n try {\n window.customElements.define(name, classObject);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window[classObject.name] = customElements.get(name);\n }\n catch (e) {\n // The only reason for window.customElements.define to throw a `NotSupportedError`\n // is if the element has already been defined.\n if (!(e instanceof DOMException && e.name === 'NotSupportedError'))\n throw e;\n }\n return classObject;\n}\n//# sourceMappingURL=register.js.map","export function autoShadowRoot(element) {\n for (const template of element.querySelectorAll('template[data-shadowroot]')) {\n if (template.parentElement === element) {\n element\n .attachShadow({\n mode: template.getAttribute('data-shadowroot') === 'closed' ? 'closed' : 'open'\n })\n .append(template.content.cloneNode(true));\n }\n }\n}\n//# sourceMappingURL=auto-shadow-root.js.map","import { findTarget, findTargets } from './findtarget.js';\nimport { meta } from './core.js';\n/**\n * Target is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTarget(this, key)` where `key` is the name of the\n * property field. In other words, `@target foo` becomes a getter for\n * `findTarget(this, 'foo')`.\n */\nexport function target(proto, key) {\n meta(proto, 'target').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTarget(this, key);\n }\n });\n}\n/**\n * Targets is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTargets(this, key)` where `key` is the name of the\n * property field. In other words, `@targets foo` becomes a getter for\n * `findTargets(this, 'foo')`.\n */\nexport function targets(proto, key) {\n meta(proto, 'targets').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTargets(this, key);\n }\n });\n}\n//# sourceMappingURL=target.js.map","/**\n * findTarget will run `querySelectorAll` against the given controller, plus\n * its shadowRoot, returning any the first child that:\n *\n * - Matches the selector of `[data-target~=\"tag.name\"]` where tag is the\n * tagName of the given HTMLElement, and `name` is the given `name` argument.\n *\n * - Closest ascendant of the element, that matches the tagname of the\n * controller, is the specific instance of the controller itself - in other\n * words it is not nested in other controllers of the same type.\n *\n */\nexport function findTarget(controller, name) {\n const tag = controller.tagName.toLowerCase();\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n return el;\n }\n }\n for (const el of controller.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n return el;\n }\n}\nexport function findTargets(controller, name) {\n const tag = controller.tagName.toLowerCase();\n const targets = [];\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n targets.push(el);\n }\n }\n for (const el of controller.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n targets.push(el);\n }\n return targets;\n}\n//# sourceMappingURL=findtarget.js.map","import { CatalystDelegate } from './core.js';\n/**\n * Controller is a decorator to be used over a class that extends HTMLElement.\n * It will automatically `register()` the component in the customElement\n * registry, as well as ensuring `bind(this)` is called on `connectedCallback`,\n * wrapping the classes `connectedCallback` method if needed.\n */\nexport function controller(classObject) {\n new CatalystDelegate(classObject);\n}\n//# sourceMappingURL=controller.js.map","const dynamicElements = new Map();\nconst ready = new Promise(resolve => {\n if (document.readyState !== 'loading') {\n resolve();\n }\n else {\n document.addEventListener('readystatechange', () => resolve(), { once: true });\n }\n});\nconst firstInteraction = new Promise(resolve => {\n const controller = new AbortController();\n controller.signal.addEventListener('abort', () => resolve());\n const listenerOptions = { once: true, passive: true, signal: controller.signal };\n const handler = () => controller.abort();\n document.addEventListener('mousedown', handler, listenerOptions);\n // eslint-disable-next-line github/require-passive-events\n document.addEventListener('touchstart', handler, listenerOptions);\n document.addEventListener('keydown', handler, listenerOptions);\n document.addEventListener('pointerdown', handler, listenerOptions);\n});\nconst visible = (tagName) => new Promise(resolve => {\n const observer = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n resolve();\n observer.disconnect();\n return;\n }\n }\n }, {\n // Currently the threshold is set to 256px from the bottom of the viewport\n // with a threshold of 0.1. This means the element will not load until about\n // 2 keyboard-down-arrow presses away from being visible in the viewport,\n // giving us some time to fetch it before the contents are made visible\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01\n });\n for (const el of document.querySelectorAll(tagName)) {\n observer.observe(el);\n }\n});\nconst strategies = {\n ready: () => ready,\n firstInteraction: () => firstInteraction,\n visible\n};\nconst timers = new WeakMap();\nfunction scan(node) {\n cancelAnimationFrame(timers.get(node) || 0);\n timers.set(node, requestAnimationFrame(() => {\n for (const tagName of dynamicElements.keys()) {\n const child = node.matches(tagName) ? node : node.querySelector(tagName);\n if (customElements.get(tagName) || child) {\n const strategyName = (child?.getAttribute('data-load-on') || 'ready');\n const strategy = strategyName in strategies ? strategies[strategyName] : strategies.ready;\n // eslint-disable-next-line github/no-then\n for (const cb of dynamicElements.get(tagName) || [])\n strategy(tagName).then(cb);\n dynamicElements.delete(tagName);\n timers.delete(node);\n }\n }\n }));\n}\nlet elementLoader;\nexport function lazyDefine(tagName, callback) {\n if (!dynamicElements.has(tagName))\n dynamicElements.set(tagName, new Set());\n dynamicElements.get(tagName).add(callback);\n scan(document.body);\n if (!elementLoader) {\n elementLoader = new MutationObserver(mutations => {\n if (!dynamicElements.size)\n return;\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element)\n scan(node);\n }\n }\n });\n elementLoader.observe(document, { subtree: true, childList: true });\n }\n}\n//# sourceMappingURL=lazy-define.js.map","import {controller} from '@github/catalyst'\n\n// eslint-disable-next-line custom-elements/no-exports-with-element\nexport class ActionListTruncationObserver {\n resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n\n if (action instanceof HTMLElement) {\n this.update(action)\n }\n }\n })\n\n constructor(el: HTMLElement) {\n this.resizeObserver.observe(el)\n }\n\n unobserve(el: HTMLElement) {\n this.resizeObserver.unobserve(el)\n }\n\n update(el: HTMLElement) {\n const items = el.querySelectorAll('li')\n\n for (const item of items) {\n const label = item.querySelector('.ActionListItem-label') as HTMLElement\n if (!label) continue\n const tooltip = item.querySelector('.ActionListItem-truncationTooltip') as HTMLElement\n if (!tooltip) continue\n\n const isTruncated = label.scrollWidth > label.clientWidth\n\n if (isTruncated) {\n tooltip.style.display = ''\n } else {\n tooltip.style.display = 'none'\n }\n }\n }\n}\n\n@controller\n// eslint-disable-next-line custom-elements/expose-class-on-global\nexport class ActionListElement extends HTMLElement {\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n this.#truncationObserver = new ActionListTruncationObserver(this)\n }\n\n disconnectedCallback() {\n this.#truncationObserver.unobserve(this)\n }\n}\n\ndeclare global {\n interface Window {\n ActionListElement: typeof ActionListElement\n }\n}\n","const alternateOrders = {\n 'outside-top': ['outside-bottom', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-bottom': ['outside-top', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-left': ['outside-right', 'outside-bottom', 'outside-top', 'outside-bottom'],\n 'outside-right': ['outside-left', 'outside-bottom', 'outside-top', 'outside-bottom'],\n};\nconst alternateAlignments = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start'],\n};\nfunction getAnchoredPosition(floatingElement, anchorElement, settings = {}) {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [parentElementStyle.borderTopWidth, parentElementStyle.borderLeftWidth].map(v => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft,\n };\n return pureCalculateAnchoredPosition(clippingRect, relativeRect, floatingElement.getBoundingClientRect(), anchorElement instanceof Element ? anchorElement.getBoundingClientRect() : anchorElement, getDefaultSettings(settings));\n}\nfunction getPositionedParent(element) {\n if (isOnTopLayer(element))\n return document.body;\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\nfunction isOnTopLayer(element) {\n var _a;\n if (element.tagName === 'DIALOG') {\n return true;\n }\n try {\n if (element.matches(':popover-open') && /native code/.test((_a = document.body.showPopover) === null || _a === void 0 ? void 0 : _a.toString())) {\n return true;\n }\n }\n catch (_b) {\n return false;\n }\n return false;\n}\nfunction getClippingRect(element) {\n let parentNode = element;\n while (parentNode !== null) {\n if (!(parentNode instanceof Element)) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode = parentNode === document.body || !(parentNode instanceof HTMLElement) ? document.body : parentNode;\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth,\n ].map(v => parseInt(v, 10) || 0);\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n height: Math.max(elemRect.height - borderTop - borderBottom, clippingNode === document.body ? window.innerHeight : -Infinity),\n };\n}\nconst positionDefaults = {\n side: 'outside-bottom',\n align: 'start',\n anchorOffset: 4,\n alignmentOffset: 4,\n allowOutOfBounds: false,\n};\nfunction getDefaultSettings(settings = {}) {\n var _a, _b, _c, _d, _e;\n const side = (_a = settings.side) !== null && _a !== void 0 ? _a : positionDefaults.side;\n const align = (_b = settings.align) !== null && _b !== void 0 ? _b : positionDefaults.align;\n return {\n side,\n align,\n anchorOffset: (_c = settings.anchorOffset) !== null && _c !== void 0 ? _c : (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset: (_d = settings.alignmentOffset) !== null && _d !== void 0 ? _d : (align !== 'center' && side.startsWith('inside') ? positionDefaults.alignmentOffset : 0),\n allowOutOfBounds: (_e = settings.allowOutOfBounds) !== null && _e !== void 0 ? _e : positionDefaults.allowOutOfBounds,\n };\n}\nfunction pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingRect, anchorRect, { side, align, allowOutOfBounds, anchorOffset, alignmentOffset }) {\n const relativeViewportRect = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height,\n };\n let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n while (positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(prevSide, pos, relativeViewportRect, floatingRect)) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n const alternateAlignment = alternateAlignments[align];\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n while (alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(prevAlign, pos, relativeViewportRect, floatingRect)) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n pos = calculatePosition(floatingRect, anchorRect, anchorSide, nextAlign, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (pos.left + floatingRect.width > viewportRect.width + relativeViewportRect.left) {\n pos.left = viewportRect.width + relativeViewportRect.left - floatingRect.width;\n }\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {\n pos.top = Math.max(viewportRect.height + relativeViewportRect.top - floatingRect.height, 0);\n }\n }\n }\n return Object.assign(Object.assign({}, pos), { anchorSide, anchorAlign });\n}\nfunction calculatePosition(elementDimensions, anchorPosition, side, align, anchorOffset, alignmentOffset) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top = anchorPosition.top - anchorOffset - elementDimensions.height;\n }\n else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n }\n else if (side === 'outside-left') {\n left = anchorPosition.left - anchorOffset - elementDimensions.width;\n }\n else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n }\n else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n }\n else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n }\n else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n }\n else if (side === 'inside-center') {\n left = (anchorRight + anchorPosition.left) / 2 - elementDimensions.width / 2 + anchorOffset;\n }\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n return { top, left };\n}\nfunction shouldRecalculatePosition(side, currentPos, containerDimensions, elementDimensions) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height > containerDimensions.height + containerDimensions.top);\n }\n else {\n return (currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width > containerDimensions.width + containerDimensions.left);\n }\n}\nfunction shouldRecalculateAlignment(align, currentPos, containerDimensions, elementDimensions) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n }\n else if (align === 'start' || align === 'center') {\n return (currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width ||\n currentPos.left < containerDimensions.left);\n }\n}\n\nexport { getAnchoredPosition };\n","function* iterateFocusableElements(container, options = {}) {\n var _a, _b;\n const strict = (_a = options.strict) !== null && _a !== void 0 ? _a : false;\n const acceptFn = ((_b = options.onlyTabbable) !== null && _b !== void 0 ? _b : false) ? isTabbable : isFocusable;\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: node => node instanceof HTMLElement && acceptFn(node, strict) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n });\n let nextNode = null;\n if (!options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n if (options.reverse) {\n let lastChild = walker.lastChild();\n while (lastChild) {\n nextNode = lastChild;\n lastChild = walker.lastChild();\n }\n }\n else {\n nextNode = walker.firstChild();\n }\n while (nextNode instanceof HTMLElement) {\n yield nextNode;\n nextNode = options.reverse ? walker.previousNode() : walker.nextNode();\n }\n if (options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n return undefined;\n}\nfunction getFocusableChild(container, lastChild = false) {\n return iterateFocusableElements(container, { reverse: lastChild, strict: true, onlyTabbable: true }).next().value;\n}\nfunction isFocusable(elem, strict = false) {\n const disabledAttrInert = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA', 'OPTGROUP', 'OPTION', 'FIELDSET'].includes(elem.tagName) &&\n elem.disabled;\n const hiddenInert = elem.hidden;\n const hiddenInputInert = elem instanceof HTMLInputElement && elem.type === 'hidden';\n const sentinelInert = elem.classList.contains('sentinel');\n if (disabledAttrInert || hiddenInert || hiddenInputInert || sentinelInert) {\n return false;\n }\n if (strict) {\n const style = getComputedStyle(elem);\n const sizeInert = elem.offsetWidth === 0 || elem.offsetHeight === 0;\n const visibilityInert = ['hidden', 'collapse'].includes(style.visibility);\n const displayInert = style.display === 'none' || !elem.offsetParent;\n const clientRectsInert = elem.getClientRects().length === 0;\n if (sizeInert || visibilityInert || clientRectsInert || displayInert) {\n return false;\n }\n }\n if (elem.getAttribute('tabindex') != null) {\n return true;\n }\n if (elem.getAttribute('contenteditable') === 'true' || elem.getAttribute('contenteditable') === 'plaintext-only') {\n return true;\n }\n if (elem instanceof HTMLAnchorElement && elem.getAttribute('href') == null) {\n return false;\n }\n return elem.tabIndex !== -1;\n}\nfunction isTabbable(elem, strict = false) {\n return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';\n}\n\nexport { getFocusableChild, isFocusable, isTabbable, iterateFocusableElements };\n","let signalSupported = false;\nfunction noop() { }\ntry {\n const options = Object.create({}, {\n signal: {\n get() {\n signalSupported = true;\n },\n },\n });\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop, options);\n}\ncatch (e) {\n}\nfunction featureSupported() {\n return signalSupported;\n}\nfunction monkeyPatch() {\n if (typeof window === 'undefined') {\n return;\n }\n const originalAddEventListener = EventTarget.prototype.addEventListener;\n EventTarget.prototype.addEventListener = function (name, originalCallback, optionsOrCapture) {\n if (typeof optionsOrCapture === 'object' &&\n 'signal' in optionsOrCapture &&\n optionsOrCapture.signal instanceof AbortSignal) {\n originalAddEventListener.call(optionsOrCapture.signal, 'abort', () => {\n this.removeEventListener(name, originalCallback, optionsOrCapture);\n });\n }\n return originalAddEventListener.call(this, name, originalCallback, optionsOrCapture);\n };\n}\nfunction polyfill() {\n if (!featureSupported()) {\n monkeyPatch();\n signalSupported = true;\n }\n}\n\nexport { polyfill };\n","import { getFocusableChild, isTabbable } from './utils/iterate-focusable-elements.mjs';\nimport { polyfill } from './polyfills/event-listener-signal.mjs';\n\npolyfill();\nconst suspendedTrapStack = [];\nlet activeTrap = undefined;\nfunction tryReactivate() {\n const trapToReactivate = suspendedTrapStack.pop();\n if (trapToReactivate) {\n focusTrap(trapToReactivate.container, trapToReactivate.initialFocus, trapToReactivate.originalSignal);\n }\n}\nfunction followSignal(signal) {\n const controller = new AbortController();\n signal.addEventListener('abort', () => {\n controller.abort();\n });\n return controller;\n}\nfunction observeFocusTrap(container, sentinels) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList' && mutation.addedNodes.length) {\n const sentinelChildren = Array.from(mutation.addedNodes).filter(e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN');\n if (sentinelChildren.length) {\n return;\n }\n const firstChild = container.firstElementChild;\n const lastChild = container.lastElementChild;\n const [sentinelStart, sentinelEnd] = sentinels;\n if (!(firstChild === null || firstChild === void 0 ? void 0 : firstChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('afterbegin', sentinelStart);\n }\n if (!(lastChild === null || lastChild === void 0 ? void 0 : lastChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('beforeend', sentinelEnd);\n }\n }\n }\n });\n observer.observe(container, { childList: true });\n return observer;\n}\nfunction focusTrap(container, initialFocus, abortSignal) {\n const controller = new AbortController();\n const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;\n container.setAttribute('data-focus-trap', 'active');\n const sentinelStart = document.createElement('span');\n sentinelStart.setAttribute('class', 'sentinel');\n sentinelStart.setAttribute('tabindex', '0');\n sentinelStart.setAttribute('aria-hidden', 'true');\n sentinelStart.onfocus = () => {\n const lastFocusableChild = getFocusableChild(container, true);\n lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();\n };\n const sentinelEnd = document.createElement('span');\n sentinelEnd.setAttribute('class', 'sentinel');\n sentinelEnd.setAttribute('tabindex', '0');\n sentinelEnd.setAttribute('aria-hidden', 'true');\n sentinelEnd.onfocus = () => {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n };\n container.prepend(sentinelStart);\n container.append(sentinelEnd);\n const observer = observeFocusTrap(container, [sentinelStart, sentinelEnd]);\n let lastFocusedChild = undefined;\n function ensureTrapZoneHasFocus(focusedElement) {\n if (focusedElement instanceof HTMLElement && document.contains(container)) {\n if (container.contains(focusedElement)) {\n lastFocusedChild = focusedElement;\n return;\n }\n else {\n if (lastFocusedChild && isTabbable(lastFocusedChild) && container.contains(lastFocusedChild)) {\n lastFocusedChild.focus();\n return;\n }\n else if (initialFocus && container.contains(initialFocus)) {\n initialFocus.focus();\n return;\n }\n else {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n return;\n }\n }\n }\n }\n const wrappingController = followSignal(signal);\n if (activeTrap) {\n const suspendedTrap = activeTrap;\n activeTrap.container.setAttribute('data-focus-trap', 'suspended');\n activeTrap.controller.abort();\n suspendedTrapStack.push(suspendedTrap);\n }\n wrappingController.signal.addEventListener('abort', () => {\n activeTrap = undefined;\n });\n signal.addEventListener('abort', () => {\n container.removeAttribute('data-focus-trap');\n const sentinels = container.getElementsByClassName('sentinel');\n while (sentinels.length > 0)\n sentinels[0].remove();\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n observer.disconnect();\n tryReactivate();\n });\n document.addEventListener('focus', event => {\n ensureTrapZoneHasFocus(event.target);\n }, { signal: wrappingController.signal, capture: true });\n ensureTrapZoneHasFocus(document.activeElement);\n activeTrap = {\n container,\n controller: wrappingController,\n initialFocus,\n originalSignal: signal,\n };\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n if (!abortSignal) {\n return controller;\n }\n}\n\nexport { focusTrap };\n","let isMac = undefined;\nfunction isMacOS() {\n if (isMac === undefined) {\n isMac = /^mac/i.test(window.navigator.platform);\n }\n return isMac;\n}\n\nexport { isMacOS };\n","let idSeed = 10000;\nfunction uniqueId() {\n return `__primer_id_${idSeed++}`;\n}\n\nexport { uniqueId };\n","import { polyfill } from './polyfills/event-listener-signal.mjs';\nimport { isMacOS } from './utils/user-agent.mjs';\nimport { iterateFocusableElements } from './utils/iterate-focusable-elements.mjs';\nimport { uniqueId } from './utils/unique-id.mjs';\n\npolyfill();\nvar FocusKeys;\n(function (FocusKeys) {\n FocusKeys[FocusKeys[\"ArrowHorizontal\"] = 1] = \"ArrowHorizontal\";\n FocusKeys[FocusKeys[\"ArrowVertical\"] = 2] = \"ArrowVertical\";\n FocusKeys[FocusKeys[\"JK\"] = 4] = \"JK\";\n FocusKeys[FocusKeys[\"HL\"] = 8] = \"HL\";\n FocusKeys[FocusKeys[\"HomeAndEnd\"] = 16] = \"HomeAndEnd\";\n FocusKeys[FocusKeys[\"PageUpDown\"] = 256] = \"PageUpDown\";\n FocusKeys[FocusKeys[\"WS\"] = 32] = \"WS\";\n FocusKeys[FocusKeys[\"AD\"] = 64] = \"AD\";\n FocusKeys[FocusKeys[\"Tab\"] = 128] = \"Tab\";\n FocusKeys[FocusKeys[\"Backspace\"] = 512] = \"Backspace\";\n FocusKeys[FocusKeys[\"ArrowAll\"] = 3] = \"ArrowAll\";\n FocusKeys[FocusKeys[\"HJKL\"] = 12] = \"HJKL\";\n FocusKeys[FocusKeys[\"WASD\"] = 96] = \"WASD\";\n FocusKeys[FocusKeys[\"All\"] = 511] = \"All\";\n})(FocusKeys || (FocusKeys = {}));\nconst KEY_TO_BIT = {\n ArrowLeft: FocusKeys.ArrowHorizontal,\n ArrowDown: FocusKeys.ArrowVertical,\n ArrowUp: FocusKeys.ArrowVertical,\n ArrowRight: FocusKeys.ArrowHorizontal,\n h: FocusKeys.HL,\n j: FocusKeys.JK,\n k: FocusKeys.JK,\n l: FocusKeys.HL,\n a: FocusKeys.AD,\n s: FocusKeys.WS,\n w: FocusKeys.WS,\n d: FocusKeys.AD,\n Tab: FocusKeys.Tab,\n Home: FocusKeys.HomeAndEnd,\n End: FocusKeys.HomeAndEnd,\n PageUp: FocusKeys.PageUpDown,\n PageDown: FocusKeys.PageUpDown,\n Backspace: FocusKeys.Backspace,\n};\nconst KEY_TO_DIRECTION = {\n ArrowLeft: 'previous',\n ArrowDown: 'next',\n ArrowUp: 'previous',\n ArrowRight: 'next',\n h: 'previous',\n j: 'next',\n k: 'previous',\n l: 'next',\n a: 'previous',\n s: 'next',\n w: 'previous',\n d: 'next',\n Tab: 'next',\n Home: 'start',\n End: 'end',\n PageUp: 'start',\n PageDown: 'end',\n Backspace: 'previous',\n};\nfunction getDirection(keyboardEvent) {\n const direction = KEY_TO_DIRECTION[keyboardEvent.key];\n if (keyboardEvent.key === 'Tab' && keyboardEvent.shiftKey) {\n return 'previous';\n }\n const isMac = isMacOS();\n if ((isMac && keyboardEvent.metaKey) || (!isMac && keyboardEvent.ctrlKey)) {\n if (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowUp') {\n return 'start';\n }\n else if (keyboardEvent.key === 'ArrowRight' || keyboardEvent.key === 'ArrowDown') {\n return 'end';\n }\n }\n return direction;\n}\nfunction shouldIgnoreFocusHandling(keyboardEvent, activeElement) {\n const key = keyboardEvent.key;\n const keyLength = [...key].length;\n const isTextInput = (activeElement instanceof HTMLInputElement && activeElement.type === 'text') ||\n activeElement instanceof HTMLTextAreaElement;\n if (isTextInput && (keyLength === 1 || key === 'Home' || key === 'End')) {\n return true;\n }\n if (activeElement instanceof HTMLSelectElement) {\n if (keyLength === 1) {\n return true;\n }\n if (key === 'ArrowDown' && isMacOS() && !keyboardEvent.metaKey) {\n return true;\n }\n if (key === 'ArrowDown' && !isMacOS() && keyboardEvent.altKey) {\n return true;\n }\n }\n if (activeElement instanceof HTMLTextAreaElement && (key === 'PageUp' || key === 'PageDown')) {\n return true;\n }\n if (isTextInput) {\n const textInput = activeElement;\n const cursorAtStart = textInput.selectionStart === 0 && textInput.selectionEnd === 0;\n const cursorAtEnd = textInput.selectionStart === textInput.value.length && textInput.selectionEnd === textInput.value.length;\n if (key === 'ArrowLeft' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowRight' && !cursorAtEnd) {\n return true;\n }\n if (textInput instanceof HTMLTextAreaElement) {\n if (key === 'ArrowUp' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowDown' && !cursorAtEnd) {\n return true;\n }\n }\n }\n return false;\n}\nconst isActiveDescendantAttribute = 'data-is-active-descendant';\nconst activeDescendantActivatedDirectly = 'activated-directly';\nconst activeDescendantActivatedIndirectly = 'activated-indirectly';\nconst hasActiveDescendantAttribute = 'data-has-active-descendant';\nfunction focusZone(container, settings) {\n var _a, _b, _c, _d, _e;\n const focusableElements = [];\n const savedTabIndex = new WeakMap();\n const bindKeys = (_a = settings === null || settings === void 0 ? void 0 : settings.bindKeys) !== null && _a !== void 0 ? _a : ((settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) ? FocusKeys.ArrowAll : FocusKeys.ArrowVertical) | FocusKeys.HomeAndEnd;\n const focusOutBehavior = (_b = settings === null || settings === void 0 ? void 0 : settings.focusOutBehavior) !== null && _b !== void 0 ? _b : 'stop';\n const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';\n const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;\n const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;\n let currentFocusedElement;\n const preventScroll = (_d = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _d !== void 0 ? _d : false;\n function getFirstFocusableElement() {\n return focusableElements[0];\n }\n function isActiveDescendantInputFocused() {\n return document.activeElement === activeDescendantControl;\n }\n function updateFocusedElement(to, directlyActivated = false) {\n const from = currentFocusedElement;\n currentFocusedElement = to;\n if (activeDescendantControl) {\n if (to && isActiveDescendantInputFocused()) {\n setActiveDescendant(from, to, directlyActivated);\n }\n else {\n clearActiveDescendant();\n }\n return;\n }\n if (from && from !== to && savedTabIndex.has(from)) {\n from.setAttribute('tabindex', '-1');\n }\n to === null || to === void 0 ? void 0 : to.setAttribute('tabindex', '0');\n }\n function setActiveDescendant(from, to, directlyActivated = false) {\n if (!to.id) {\n to.setAttribute('id', uniqueId());\n }\n if (from && from !== to) {\n from.removeAttribute(isActiveDescendantAttribute);\n }\n if (!activeDescendantControl ||\n (!directlyActivated && activeDescendantControl.getAttribute('aria-activedescendant') === to.id)) {\n return;\n }\n activeDescendantControl.setAttribute('aria-activedescendant', to.id);\n container.setAttribute(hasActiveDescendantAttribute, to.id);\n to.setAttribute(isActiveDescendantAttribute, directlyActivated ? activeDescendantActivatedDirectly : activeDescendantActivatedIndirectly);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(to, from, directlyActivated);\n }\n function clearActiveDescendant(previouslyActiveElement = currentFocusedElement) {\n if (focusInStrategy === 'first') {\n currentFocusedElement = undefined;\n }\n activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');\n container.removeAttribute(hasActiveDescendantAttribute);\n previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(undefined, previouslyActiveElement, false);\n }\n function beginFocusManagement(...elements) {\n const filteredElements = elements.filter(e => { var _a, _b; return (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.focusableElementFilter) === null || _a === void 0 ? void 0 : _a.call(settings, e)) !== null && _b !== void 0 ? _b : true; });\n if (filteredElements.length === 0) {\n return;\n }\n focusableElements.splice(findInsertionIndex(filteredElements), 0, ...filteredElements);\n for (const element of filteredElements) {\n if (!savedTabIndex.has(element)) {\n savedTabIndex.set(element, element.getAttribute('tabindex'));\n }\n element.setAttribute('tabindex', '-1');\n }\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n }\n function findInsertionIndex(elementsToInsert) {\n const firstElementToInsert = elementsToInsert[0];\n if (focusableElements.length === 0)\n return 0;\n let iMin = 0;\n let iMax = focusableElements.length - 1;\n while (iMin <= iMax) {\n const i = Math.floor((iMin + iMax) / 2);\n const element = focusableElements[i];\n if (followsInDocument(firstElementToInsert, element)) {\n iMax = i - 1;\n }\n else {\n iMin = i + 1;\n }\n }\n return iMin;\n }\n function followsInDocument(first, second) {\n return (second.compareDocumentPosition(first) & Node.DOCUMENT_POSITION_PRECEDING) > 0;\n }\n function endFocusManagement(...elements) {\n for (const element of elements) {\n const focusableElementIndex = focusableElements.indexOf(element);\n if (focusableElementIndex >= 0) {\n focusableElements.splice(focusableElementIndex, 1);\n }\n const savedIndex = savedTabIndex.get(element);\n if (savedIndex !== undefined) {\n if (savedIndex === null) {\n element.removeAttribute('tabindex');\n }\n else {\n element.setAttribute('tabindex', savedIndex);\n }\n savedTabIndex.delete(element);\n }\n if (element === currentFocusedElement) {\n const nextElementToFocus = getFirstFocusableElement();\n updateFocusedElement(nextElementToFocus);\n }\n }\n }\n const iterateFocusableElementsOptions = {\n reverse: settings === null || settings === void 0 ? void 0 : settings.reverse,\n strict: settings === null || settings === void 0 ? void 0 : settings.strict,\n onlyTabbable: settings === null || settings === void 0 ? void 0 : settings.onlyTabbable,\n };\n beginFocusManagement(...iterateFocusableElements(container, iterateFocusableElementsOptions));\n const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();\n updateFocusedElement(initialElement);\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const removedNode of mutation.removedNodes) {\n if (removedNode instanceof HTMLElement) {\n endFocusManagement(...iterateFocusableElements(removedNode));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue === null) {\n if (mutation.target instanceof HTMLElement) {\n endFocusManagement(mutation.target);\n }\n }\n }\n for (const mutation of mutations) {\n for (const addedNode of mutation.addedNodes) {\n if (addedNode instanceof HTMLElement) {\n beginFocusManagement(...iterateFocusableElements(addedNode, iterateFocusableElementsOptions));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue !== null) {\n if (mutation.target instanceof HTMLElement) {\n beginFocusManagement(mutation.target);\n }\n }\n }\n });\n observer.observe(container, {\n subtree: true,\n childList: true,\n attributeFilter: ['hidden', 'disabled'],\n attributeOldValue: true,\n });\n const controller = new AbortController();\n const signal = (_e = settings === null || settings === void 0 ? void 0 : settings.abortSignal) !== null && _e !== void 0 ? _e : controller.signal;\n signal.addEventListener('abort', () => {\n endFocusManagement(...focusableElements);\n });\n let elementIndexFocusedByClick = undefined;\n container.addEventListener('mousedown', event => {\n if (event.target instanceof HTMLElement && event.target !== document.activeElement) {\n elementIndexFocusedByClick = focusableElements.indexOf(event.target);\n }\n }, { signal });\n if (activeDescendantControl) {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement && focusableElements.includes(event.target)) {\n activeDescendantControl.focus({ preventScroll });\n updateFocusedElement(event.target);\n }\n });\n container.addEventListener('mousemove', ({ target }) => {\n if (!(target instanceof Node)) {\n return;\n }\n const focusableElement = focusableElements.find(element => element.contains(target));\n if (focusableElement) {\n updateFocusedElement(focusableElement);\n }\n }, { signal, capture: true });\n activeDescendantControl.addEventListener('focusin', () => {\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n else {\n setActiveDescendant(undefined, currentFocusedElement);\n }\n });\n activeDescendantControl.addEventListener('focusout', () => {\n clearActiveDescendant();\n });\n }\n else {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement) {\n if (elementIndexFocusedByClick !== undefined) {\n if (elementIndexFocusedByClick >= 0) {\n if (focusableElements[elementIndexFocusedByClick] !== currentFocusedElement) {\n updateFocusedElement(focusableElements[elementIndexFocusedByClick]);\n }\n }\n elementIndexFocusedByClick = undefined;\n }\n else {\n if (focusInStrategy === 'previous') {\n updateFocusedElement(event.target);\n }\n else if (focusInStrategy === 'closest' || focusInStrategy === 'first') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const targetElementIndex = lastKeyboardFocusDirection === 'previous' ? focusableElements.length - 1 : 0;\n const targetElement = focusableElements[targetElementIndex];\n targetElement === null || targetElement === void 0 ? void 0 : targetElement.focus({ preventScroll });\n return;\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n else if (typeof focusInStrategy === 'function') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const elementToFocus = focusInStrategy(event.relatedTarget);\n const requestedFocusElementIndex = elementToFocus ? focusableElements.indexOf(elementToFocus) : -1;\n if (requestedFocusElementIndex >= 0 && elementToFocus instanceof HTMLElement) {\n elementToFocus.focus({ preventScroll });\n return;\n }\n else {\n console.warn('Element requested is not a known focusable element.');\n }\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n }\n }\n lastKeyboardFocusDirection = undefined;\n }, { signal });\n }\n const keyboardEventRecipient = activeDescendantControl !== null && activeDescendantControl !== void 0 ? activeDescendantControl : container;\n let lastKeyboardFocusDirection = undefined;\n if (focusInStrategy === 'closest') {\n document.addEventListener('keydown', event => {\n if (event.key === 'Tab') {\n lastKeyboardFocusDirection = getDirection(event);\n }\n }, { signal, capture: true });\n }\n function getCurrentFocusedIndex() {\n if (!currentFocusedElement) {\n return 0;\n }\n const focusedIndex = focusableElements.indexOf(currentFocusedElement);\n const fallbackIndex = currentFocusedElement === container ? -1 : 0;\n return focusedIndex !== -1 ? focusedIndex : fallbackIndex;\n }\n keyboardEventRecipient.addEventListener('keydown', event => {\n var _a;\n if (event.key in KEY_TO_DIRECTION) {\n const keyBit = KEY_TO_BIT[event.key];\n if (!event.defaultPrevented &&\n (keyBit & bindKeys) > 0 &&\n !shouldIgnoreFocusHandling(event, document.activeElement)) {\n const direction = getDirection(event);\n let nextElementToFocus = undefined;\n if (settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) {\n nextElementToFocus = settings.getNextFocusable(direction, (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined, event);\n }\n if (!nextElementToFocus) {\n const lastFocusedIndex = getCurrentFocusedIndex();\n let nextFocusedIndex = lastFocusedIndex;\n if (direction === 'previous') {\n nextFocusedIndex -= 1;\n }\n else if (direction === 'start') {\n nextFocusedIndex = 0;\n }\n else if (direction === 'next') {\n nextFocusedIndex += 1;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n if (nextFocusedIndex < 0) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = focusableElements.length - 1;\n }\n else {\n nextFocusedIndex = 0;\n }\n }\n if (nextFocusedIndex >= focusableElements.length) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = 0;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n }\n if (lastFocusedIndex !== nextFocusedIndex) {\n nextElementToFocus = focusableElements[nextFocusedIndex];\n }\n }\n if (activeDescendantControl) {\n updateFocusedElement(nextElementToFocus || currentFocusedElement, true);\n }\n else if (nextElementToFocus) {\n lastKeyboardFocusDirection = direction;\n nextElementToFocus.focus({ preventScroll });\n }\n if (event.key !== 'Tab' || nextElementToFocus) {\n event.preventDefault();\n }\n }\n }\n }, { signal });\n return controller;\n}\n\nexport { FocusKeys, activeDescendantActivatedDirectly, activeDescendantActivatedIndirectly, focusZone, hasActiveDescendantAttribute, isActiveDescendantAttribute };\n","import {controller, targets, target} from '@github/catalyst'\nimport {focusZone, FocusKeys} from '@primer/behaviors'\nimport {ActionMenuElement} from './action_menu/action_menu_element'\n\nconst instersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (entry.isIntersecting && action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\nconst resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\n// These are definitely used, but eslint is dumb apparently\n\nenum ItemType {\n Item,\n Divider,\n}\n\n@controller\nclass ActionBarElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target itemContainer: HTMLElement\n @target moreMenu: ActionMenuElement\n\n #focusZoneAbortController: AbortController | null = null\n\n connectedCallback() {\n // Calculate the width of all the items before hiding anything\n for (const item of this.items) {\n const width = item.getBoundingClientRect().width\n const marginLeft = parseInt(window.getComputedStyle(item)?.marginLeft, 10)\n const marginRight = parseInt(window.getComputedStyle(item)?.marginRight, 10)\n item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`)\n }\n\n resizeObserver.observe(this)\n instersectionObserver.observe(this)\n\n requestAnimationFrame(() => {\n // This overflow visible is needed for browsers that don't support PopoverElement\n // to ensure the menu and tooltips are visible when the action bar is in a collapsed state\n // once popover is fully supported we can remove this.style.overflow = 'visible'\n this.style.overflow = 'visible'\n this.update()\n })\n }\n\n disconnectedCallback() {\n resizeObserver.unobserve(this)\n instersectionObserver.unobserve(this)\n }\n\n menuItemClick(event: Event) {\n const currentTarget = event.currentTarget as HTMLButtonElement\n\n const id = currentTarget?.getAttribute('data-for')\n\n if (id) {\n document.getElementById(id)?.click()\n }\n }\n\n update() {\n const firstItem = this.#firstItem\n if (!firstItem) return\n\n const firstItemTop = firstItem.getBoundingClientRect().top\n let previousItemType: ItemType | null = null\n\n this.#eachItem((item: HTMLElement, index: number, type: ItemType): boolean => {\n const itemTop = item.getBoundingClientRect().top\n\n if (type === ItemType.Item) {\n if (itemTop > firstItemTop) {\n this.#hideItem(index)\n\n if (this.moreMenu.hidden) {\n this.moreMenu.hidden = false\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#hideItem(index - 1)\n }\n } else {\n this.#showItem(index)\n\n if (index === this.items.length - 1) {\n this.moreMenu.hidden = true\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#showItem(index - 1)\n }\n }\n }\n\n previousItemType = type\n\n return true\n })\n\n if (this.#focusZoneAbortController) {\n this.#focusZoneAbortController.abort()\n }\n\n this.#focusZoneAbortController = focusZone(this, {\n bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,\n focusOutBehavior: 'wrap',\n focusableElementFilter: element => {\n const idx = this.items.indexOf(element.parentElement!)\n const elementIsVisibleItem = idx > -1 && this.items[idx].style.visibility === 'visible'\n const elementIsVisibleActionMenuInvoker = element === this.moreMenu.invokerElement && !this.moreMenu.hidden\n return elementIsVisibleItem || elementIsVisibleActionMenuInvoker\n },\n })\n }\n\n get #firstItem(): HTMLElement | null {\n let foundItem = null\n\n this.#eachItem((item: HTMLElement, _index: number, type: ItemType): boolean => {\n if (type === ItemType.Item) {\n foundItem = item\n return false\n }\n\n return true\n })\n\n return foundItem\n }\n\n #showItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'visible')\n menuItem.hidden = true\n }\n\n #hideItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'hidden')\n menuItem.hidden = false\n }\n\n get #menuItems(): NodeListOf<HTMLElement> {\n return this.moreMenu.querySelectorAll('[role=\"menu\"] > li')\n }\n\n #eachItem(callback: (item: HTMLElement, index: number, type: ItemType) => boolean): void {\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i]\n const type = item.classList.contains('ActionBar-divider') ? ItemType.Divider : ItemType.Item\n if (!callback(item, i, type)) {\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ActionBarElement: typeof ActionBarElement\n }\n}\n\nwindow.ActionBarElement = ActionBarElement\n","class DetailsMenuElement extends HTMLElement {\n get preload() {\n return this.hasAttribute('preload');\n }\n set preload(value) {\n if (value) {\n this.setAttribute('preload', '');\n }\n else {\n this.removeAttribute('preload');\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n connectedCallback() {\n if (!this.hasAttribute('role'))\n this.setAttribute('role', 'menu');\n const details = this.parentElement;\n if (!details)\n return;\n const summary = details.querySelector('summary');\n if (summary) {\n summary.setAttribute('aria-haspopup', 'menu');\n if (!summary.hasAttribute('role'))\n summary.setAttribute('role', 'button');\n }\n const subscriptions = [\n fromEvent(details, 'compositionstart', e => trackComposition(this, e)),\n fromEvent(details, 'compositionend', e => trackComposition(this, e)),\n fromEvent(details, 'click', e => shouldCommit(details, e)),\n fromEvent(details, 'change', e => shouldCommit(details, e)),\n fromEvent(details, 'keydown', e => keydown(details, this, e)),\n fromEvent(details, 'toggle', () => loadFragment(details, this), { once: true }),\n fromEvent(details, 'toggle', () => closeCurrentMenu(details)),\n this.preload\n ? fromEvent(details, 'mouseover', () => loadFragment(details, this), { once: true })\n : NullSubscription,\n ...focusOnOpen(details)\n ];\n states.set(this, { subscriptions, loaded: false, isComposing: false });\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n for (const sub of state.subscriptions) {\n sub.unsubscribe();\n }\n }\n}\nconst states = new WeakMap();\nconst NullSubscription = {\n unsubscribe() {\n }\n};\nfunction fromEvent(target, eventName, onNext, options = false) {\n target.addEventListener(eventName, onNext, options);\n return {\n unsubscribe: () => {\n target.removeEventListener(eventName, onNext, options);\n }\n };\n}\nfunction loadFragment(details, menu) {\n const src = menu.getAttribute('src');\n if (!src)\n return;\n const state = states.get(menu);\n if (!state)\n return;\n if (state.loaded)\n return;\n state.loaded = true;\n const loader = menu.querySelector('include-fragment');\n if (loader && !loader.hasAttribute('src')) {\n loader.addEventListener('loadend', () => autofocus(details));\n loader.setAttribute('src', src);\n }\n}\nfunction focusOnOpen(details) {\n let isMouse = false;\n const onmousedown = () => (isMouse = true);\n const onkeydown = () => (isMouse = false);\n const ontoggle = () => {\n if (!details.hasAttribute('open'))\n return;\n if (autofocus(details))\n return;\n if (!isMouse)\n focusFirstItem(details);\n };\n return [\n fromEvent(details, 'mousedown', onmousedown),\n fromEvent(details, 'keydown', onkeydown),\n fromEvent(details, 'toggle', ontoggle)\n ];\n}\nfunction closeCurrentMenu(details) {\n if (!details.hasAttribute('open'))\n return;\n for (const menu of document.querySelectorAll('details[open] > details-menu')) {\n const opened = menu.closest('details');\n if (opened && opened !== details && !opened.contains(details)) {\n opened.removeAttribute('open');\n }\n }\n}\nfunction autofocus(details) {\n if (!details.hasAttribute('open'))\n return false;\n const input = details.querySelector('details-menu [autofocus]');\n if (input) {\n input.focus();\n return true;\n }\n else {\n return false;\n }\n}\nfunction focusFirstItem(details) {\n const selected = document.activeElement;\n if (selected && isMenuItem(selected) && details.contains(selected))\n return;\n const target = sibling(details, true);\n if (target)\n target.focus();\n}\nfunction sibling(details, next) {\n const options = Array.from(details.querySelectorAll('[role^=\"menuitem\"]:not([hidden]):not([disabled])'));\n const selected = document.activeElement;\n const index = selected instanceof HTMLElement ? options.indexOf(selected) : -1;\n const found = next ? options[index + 1] : options[index - 1];\n const def = next ? options[0] : options[options.length - 1];\n return found || def;\n}\nconst ctrlBindings = navigator.userAgent.match(/Macintosh/);\nfunction shouldCommit(details, event) {\n const target = event.target;\n if (!(target instanceof Element))\n return;\n if (target.closest('details') !== details)\n return;\n if (event.type === 'click') {\n const menuitem = target.closest('[role=\"menuitem\"], [role=\"menuitemradio\"]');\n if (!menuitem)\n return;\n const input = menuitem.querySelector('input');\n if (menuitem.tagName === 'LABEL' && target === input)\n return;\n const onlyCommitOnChangeEvent = menuitem.tagName === 'LABEL' && input && !input.checked;\n if (!onlyCommitOnChangeEvent) {\n commit(menuitem, details);\n }\n }\n else if (event.type === 'change') {\n const menuitem = target.closest('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]');\n if (menuitem)\n commit(menuitem, details);\n }\n}\nfunction updateChecked(selected, details) {\n for (const el of details.querySelectorAll('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]')) {\n const input = el.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n let checkState = (el === selected).toString();\n if (input instanceof HTMLInputElement) {\n checkState = input.indeterminate ? 'mixed' : input.checked.toString();\n }\n el.setAttribute('aria-checked', checkState);\n }\n}\nfunction commit(selected, details) {\n if (selected.hasAttribute('disabled') || selected.getAttribute('aria-disabled') === 'true')\n return;\n const menu = selected.closest('details-menu');\n if (!menu)\n return;\n const dispatched = menu.dispatchEvent(new CustomEvent('details-menu-select', {\n cancelable: true,\n detail: { relatedTarget: selected }\n }));\n if (!dispatched)\n return;\n updateLabel(selected, details);\n updateChecked(selected, details);\n if (selected.getAttribute('role') !== 'menuitemcheckbox')\n close(details);\n menu.dispatchEvent(new CustomEvent('details-menu-selected', {\n detail: { relatedTarget: selected }\n }));\n}\nfunction keydown(details, menu, event) {\n if (!(event instanceof KeyboardEvent))\n return;\n if (details.querySelector('details[open]'))\n return;\n const state = states.get(menu);\n if (!state || state.isComposing)\n return;\n const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';\n switch (event.key) {\n case 'Escape':\n if (details.hasAttribute('open')) {\n close(details);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n case 'ArrowDown':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'ArrowUp':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'n':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case 'p':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case ' ':\n case 'Enter':\n {\n const selected = document.activeElement;\n if (selected instanceof HTMLElement && isMenuItem(selected) && selected.closest('details') === details) {\n event.preventDefault();\n event.stopPropagation();\n selected.click();\n }\n }\n break;\n }\n}\nfunction isMenuItem(el) {\n const role = el.getAttribute('role');\n return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';\n}\nfunction close(details) {\n const wasOpen = details.hasAttribute('open');\n if (!wasOpen)\n return;\n details.removeAttribute('open');\n const summary = details.querySelector('summary');\n if (summary)\n summary.focus();\n}\nfunction updateLabel(item, details) {\n const button = details.querySelector('[data-menu-button]');\n if (!button)\n return;\n const text = labelText(item);\n if (text) {\n button.textContent = text;\n }\n else {\n const html = labelHTML(item);\n if (html)\n button.innerHTML = html;\n }\n}\nfunction labelText(el) {\n if (!el)\n return null;\n const textEl = el.hasAttribute('data-menu-button-text') ? el : el.querySelector('[data-menu-button-text]');\n if (!textEl)\n return null;\n return textEl.getAttribute('data-menu-button-text') || textEl.textContent;\n}\nfunction labelHTML(el) {\n if (!el)\n return null;\n const contentsEl = el.hasAttribute('data-menu-button-contents') ? el : el.querySelector('[data-menu-button-contents]');\n return contentsEl ? contentsEl.innerHTML : null;\n}\nfunction trackComposition(menu, event) {\n const state = states.get(menu);\n if (!state)\n return;\n state.isComposing = event.type === 'compositionstart';\n}\nexport default DetailsMenuElement;\nif (!window.customElements.get('details-menu')) {\n window.DetailsMenuElement = DetailsMenuElement;\n window.customElements.define('details-menu', DetailsMenuElement);\n}\n","import type {AnchorAlignment, AnchorSide, PositionSettings} from '@primer/behaviors'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst updateWhenVisible = (() => {\n const anchors = new Set<AnchoredPositionElement>()\n let intersectionObserver: IntersectionObserver | null = null\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.update()\n }\n }\n return (el: AnchoredPositionElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n intersectionObserver ||= new IntersectionObserver(entries => {\n for (const entry of entries) {\n const target = entry.target as AnchoredPositionElement\n if (entry.isIntersecting) {\n target.update()\n anchors.add(target)\n } else {\n anchors.delete(target)\n }\n }\n })\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.update()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n intersectionObserver.observe(el)\n }\n})()\n\nexport default class AnchoredPositionElement extends HTMLElement implements PositionSettings {\n get align(): AnchorAlignment {\n const value = this.getAttribute('align')\n if (value === 'center' || value === 'end') return value\n return 'start'\n }\n\n set align(value: AnchorAlignment) {\n this.setAttribute('align', `${value}`)\n }\n\n get side(): AnchorSide {\n const value = this.getAttribute('side')\n if (\n value === 'inside-top' ||\n value === 'inside-bottom' ||\n value === 'inside-left' ||\n value === 'inside-right' ||\n value === 'inside-center' ||\n value === 'outside-top' ||\n value === 'outside-left' ||\n value === 'outside-right'\n ) {\n return value\n }\n return 'outside-bottom'\n }\n\n set side(value: AnchorSide) {\n this.setAttribute('side', `${value}`)\n }\n\n get anchorOffset(): number {\n const alias = this.getAttribute('anchor-offset')\n if (alias === 'spacious' || alias === '8') return 8\n return 4\n }\n\n set anchorOffset(value: number | 'normal' | 'spacious') {\n this.setAttribute('anchor-offset', `${value}`)\n }\n\n get anchor() {\n return this.getAttribute('anchor') || ''\n }\n\n set anchor(value: string) {\n this.setAttribute('anchor', `${value}`)\n }\n\n #anchorElement: HTMLElement | null = null\n get anchorElement(): HTMLElement | null {\n if (this.#anchorElement) return this.#anchorElement\n const idRef = this.anchor\n if (!idRef) return null\n return this.ownerDocument.getElementById(idRef)\n }\n\n set anchorElement(value: HTMLElement | null) {\n this.#anchorElement = value\n if (!this.#anchorElement) {\n this.removeAttribute('anchor')\n }\n }\n\n get alignmentOffset(): number {\n return Number(this.getAttribute('alignment-offset'))\n }\n\n set alignmentOffset(value: number) {\n this.setAttribute('alignment-offset', `${value}`)\n }\n\n get allowOutOfBounds() {\n return this.hasAttribute('allow-out-of-bounds')\n }\n\n set allowOutOfBounds(value: boolean) {\n this.toggleAttribute('allow-out-of-bounds', value)\n }\n\n connectedCallback() {\n this.update()\n this.addEventListener('beforetoggle', () => this.update())\n updateWhenVisible(this)\n }\n\n static observedAttributes = ['align', 'side', 'anchor', 'alignment-offset', 'allow-out-of-bounds']\n attributeChangedCallback() {\n this.update()\n }\n\n #animationFrame: ReturnType<typeof requestAnimationFrame>\n update() {\n if (!this.isConnected) return\n cancelAnimationFrame(this.#animationFrame)\n\n this.#animationFrame = requestAnimationFrame(() => {\n const anchor = this.anchorElement\n this.classList.toggle('not-anchored', !anchor)\n if (anchor) {\n const {left, top} = getAnchoredPosition(this, anchor, this)\n this.style.top = `${top}px`\n this.style.left = `${left}px`\n this.style.bottom = 'auto'\n this.style.right = 'auto'\n } else {\n this.style.top = '0'\n this.style.left = '0'\n this.style.bottom = '0'\n this.style.right = '0'\n }\n })\n }\n}\n\nif (!customElements.get('anchored-position')) {\n window.AnchoredPositionElement = AnchoredPositionElement\n customElements.define('anchored-position', AnchoredPositionElement)\n}\n\ndeclare global {\n interface Window {\n AnchoredPositionElement: typeof AnchoredPositionElement\n }\n}\n","function dialogInvokerButtonHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement) {\n dialog.showModal()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n\n // In some older browsers, such as Chrome 122, when a top layer element (such as a dialog)\n // opens from within a popover, the \"hide all popovers\" internal algorithm runs, hiding\n // any popover that is currently open, regardless of whether or not another top layer element,\n // such as a <dialog> is nested inside.\n // See https://github.com/whatwg/html/issues/9998.\n // This is fixed by https://github.com/whatwg/html/pull/10116, but while we still support browsers\n // that present this bug, we must undo the work they did to hide ancestral popovers of the dialog:\n let node: HTMLElement | null | undefined = button\n let fixed = false\n while (node) {\n node = node.parentElement?.closest('[popover]:not(:popover-open)')\n if (node && node.popover === 'auto') {\n node.classList.add('dialog-inside-popover-fix')\n node.popover = 'manual'\n node.showPopover()\n fixed = true\n }\n }\n if (fixed) {\n // We need to re-open the dialog as modal, and also ensure no close event listeners\n // are trying to act on the close\n /* eslint-disable-next-line no-restricted-syntax */\n dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n dialog.close()\n dialog.showModal()\n dialog.addEventListener(\n 'close',\n () => {\n for (const el of dialog.ownerDocument.querySelectorAll<HTMLElement>('.dialog-inside-popover-fix')) {\n if (el.contains(dialog)) {\n el.classList.remove('dialog-inside-popover-fix')\n el.popover = 'auto'\n el.showPopover()\n }\n }\n },\n {once: true},\n )\n }\n }\n }\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement && dialog.open) {\n dialog.close()\n }\n }\n}\n\nexport class DialogHelperElement extends HTMLElement {\n get dialog() {\n return this.querySelector('dialog')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n document.addEventListener('click', dialogInvokerButtonHandler, true)\n document.addEventListener('click', this, {signal})\n this.ownerDocument.body.style.setProperty(\n '--dialog-scrollgutter',\n `${window.innerWidth - this.ownerDocument.body.clientWidth}px`,\n )\n new MutationObserver(records => {\n for (const record of records) {\n if (record.target === this.dialog) {\n this.#handleDialogOpenAttribute()\n }\n }\n }).observe(this, {subtree: true, attributeFilter: ['open']})\n this.#handleDialogOpenAttribute()\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n #handleDialogOpenAttribute() {\n if (!this.dialog) return\n // We don't want to show the Dialog component as non-modal\n if (this.dialog.matches('[open]:not(:modal)')) {\n // eslint-disable-next-line no-restricted-syntax\n this.dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n this.dialog.close()\n this.dialog.showModal()\n }\n }\n\n handleEvent(event: MouseEvent) {\n const target = event.target as HTMLElement\n const dialog = this.dialog\n // The click target _must_ be the dialog element itself, and not elements underneath or inside.\n if (target !== dialog || !dialog?.open) return\n\n const rect = dialog.getBoundingClientRect()\n const clickWasInsideDialog =\n rect.top <= event.clientY &&\n event.clientY <= rect.top + rect.height &&\n rect.left <= event.clientX &&\n event.clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n dialog.close()\n }\n }\n}\n\ndeclare global {\n interface Window {\n DialogHelperElement: typeof DialogHelperElement\n }\n interface HTMLElementTagNameMap {\n 'dialog-helper': DialogHelperElement\n }\n}\n\nif (!window.customElements.get('dialog-helper')) {\n window.DialogHelperElement = DialogHelperElement\n window.customElements.define('dialog-helper', DialogHelperElement)\n}\n","// src/events.ts\nvar ToggleEvent = class extends Event {\n oldState;\n newState;\n constructor(type, { oldState = \"\", newState = \"\", ...init } = {}) {\n super(type, init);\n this.oldState = String(oldState || \"\");\n this.newState = String(newState || \"\");\n }\n};\nvar popoverToggleTaskQueue = /* @__PURE__ */ new WeakMap();\nfunction queuePopoverToggleEventTask(element, oldState, newState) {\n popoverToggleTaskQueue.set(\n element,\n setTimeout(() => {\n if (!popoverToggleTaskQueue.has(element)) return;\n element.dispatchEvent(\n new ToggleEvent(\"toggle\", {\n cancelable: false,\n oldState,\n newState\n })\n );\n }, 0)\n );\n}\n\n// src/popover-helpers.ts\nvar ShadowRoot = globalThis.ShadowRoot || function() {\n};\nvar HTMLDialogElement = globalThis.HTMLDialogElement || function() {\n};\nvar topLayerElements = /* @__PURE__ */ new WeakMap();\nvar autoPopoverList = /* @__PURE__ */ new WeakMap();\nvar visibilityState = /* @__PURE__ */ new WeakMap();\nfunction getPopoverVisibilityState(popover) {\n return visibilityState.get(popover) || \"hidden\";\n}\nvar popoverInvoker = /* @__PURE__ */ new WeakMap();\nfunction popoverTargetAttributeActivationBehavior(element) {\n const popover = element.popoverTargetElement;\n if (!(popover instanceof HTMLElement)) {\n return;\n }\n const visibility = getPopoverVisibilityState(popover);\n if (element.popoverTargetAction === \"show\" && visibility === \"showing\") {\n return;\n }\n if (element.popoverTargetAction === \"hide\" && visibility === \"hidden\") return;\n if (visibility === \"showing\") {\n hidePopover(popover, true, true);\n } else if (checkPopoverValidity(popover, false)) {\n popoverInvoker.set(popover, element);\n showPopover(popover);\n }\n}\nfunction checkPopoverValidity(element, expectedToBeShowing) {\n if (element.popover !== \"auto\" && element.popover !== \"manual\") {\n return false;\n }\n if (!element.isConnected) return false;\n if (expectedToBeShowing && getPopoverVisibilityState(element) !== \"showing\") {\n return false;\n }\n if (!expectedToBeShowing && getPopoverVisibilityState(element) !== \"hidden\") {\n return false;\n }\n if (element instanceof HTMLDialogElement && element.hasAttribute(\"open\")) {\n return false;\n }\n if (document.fullscreenElement === element) return false;\n return true;\n}\nfunction getStackPosition(popover) {\n if (!popover) return 0;\n return Array.from(autoPopoverList.get(popover.ownerDocument) || []).indexOf(\n popover\n ) + 1;\n}\nfunction topMostClickedPopover(target) {\n const clickedPopover = nearestInclusiveOpenPopover(target);\n const invokerPopover = nearestInclusiveTargetPopoverForInvoker(target);\n if (getStackPosition(clickedPopover) > getStackPosition(invokerPopover)) {\n return clickedPopover;\n }\n return invokerPopover;\n}\nfunction topMostAutoPopover(document2) {\n const documentPopovers = autoPopoverList.get(document2);\n for (const popover of documentPopovers || []) {\n if (!popover.isConnected) {\n documentPopovers.delete(popover);\n } else {\n return popover;\n }\n }\n return null;\n}\nfunction getRootNode(node) {\n if (typeof node.getRootNode === \"function\") {\n return node.getRootNode();\n }\n if (node.parentNode) return getRootNode(node.parentNode);\n return node;\n}\nfunction nearestInclusiveOpenPopover(node) {\n while (node) {\n if (node instanceof HTMLElement && node.popover === \"auto\" && visibilityState.get(node) === \"showing\") {\n return node;\n }\n node = node instanceof Element && node.assignedSlot || node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction nearestInclusiveTargetPopoverForInvoker(node) {\n while (node) {\n const nodePopover = node.popoverTargetElement;\n if (nodePopover instanceof HTMLElement) return nodePopover;\n node = node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction topMostPopoverAncestor(newPopover) {\n const popoverPositions = /* @__PURE__ */ new Map();\n let i = 0;\n for (const popover of autoPopoverList.get(newPopover.ownerDocument) || []) {\n popoverPositions.set(popover, i);\n i += 1;\n }\n popoverPositions.set(newPopover, i);\n i += 1;\n let topMostPopoverAncestor2 = null;\n function checkAncestor(candidate) {\n const candidateAncestor = nearestInclusiveOpenPopover(candidate);\n if (candidateAncestor === null) return null;\n const candidatePosition = popoverPositions.get(candidateAncestor);\n if (topMostPopoverAncestor2 === null || popoverPositions.get(topMostPopoverAncestor2) < candidatePosition) {\n topMostPopoverAncestor2 = candidateAncestor;\n }\n }\n checkAncestor(newPopover.parentElement || getRootNode(newPopover));\n return topMostPopoverAncestor2;\n}\nfunction isFocusable(focusTarget) {\n if (focusTarget.hidden || focusTarget instanceof ShadowRoot) return false;\n if (focusTarget instanceof HTMLButtonElement || focusTarget instanceof HTMLInputElement || focusTarget instanceof HTMLSelectElement || focusTarget instanceof HTMLTextAreaElement || focusTarget instanceof HTMLOptGroupElement || focusTarget instanceof HTMLOptionElement || focusTarget instanceof HTMLFieldSetElement) {\n if (focusTarget.disabled) return false;\n }\n if (focusTarget instanceof HTMLInputElement && focusTarget.type === \"hidden\") {\n return false;\n }\n if (focusTarget instanceof HTMLAnchorElement && focusTarget.href === \"\") {\n return false;\n }\n return typeof focusTarget.tabIndex === \"number\" && focusTarget.tabIndex !== -1;\n}\nfunction focusDelegate(focusTarget) {\n if (focusTarget.shadowRoot && focusTarget.shadowRoot.delegatesFocus !== true) {\n return null;\n }\n let whereToLook = focusTarget;\n if (whereToLook.shadowRoot) {\n whereToLook = whereToLook.shadowRoot;\n }\n let autoFocusDelegate = whereToLook.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n } else {\n const slots = whereToLook.querySelectorAll(\"slot\");\n for (const slot of slots) {\n const assignedElements = slot.assignedElements({ flatten: true });\n for (const el of assignedElements) {\n if (el.hasAttribute(\"autofocus\")) {\n return el;\n } else {\n autoFocusDelegate = el.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n }\n }\n }\n }\n }\n const walker = focusTarget.ownerDocument.createTreeWalker(\n whereToLook,\n NodeFilter.SHOW_ELEMENT\n );\n let descendant = walker.currentNode;\n while (descendant) {\n if (isFocusable(descendant)) {\n return descendant;\n }\n descendant = walker.nextNode();\n }\n}\nfunction popoverFocusingSteps(subject) {\n focusDelegate(subject)?.focus();\n}\nvar previouslyFocusedElements = /* @__PURE__ */ new WeakMap();\nfunction showPopover(element) {\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (!element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n cancelable: true,\n oldState: \"closed\",\n newState: \"open\"\n })\n )) {\n return;\n }\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n let shouldRestoreFocus = false;\n if (element.popover === \"auto\") {\n const originalType = element.getAttribute(\"popover\");\n const ancestor = topMostPopoverAncestor(element) || document2;\n hideAllPopoversUntil(ancestor, false, true);\n if (originalType !== element.getAttribute(\"popover\") || !checkPopoverValidity(element, false)) {\n return;\n }\n }\n if (!topMostAutoPopover(document2)) {\n shouldRestoreFocus = true;\n }\n previouslyFocusedElements.delete(element);\n const originallyFocusedElement = document2.activeElement;\n element.classList.add(\":popover-open\");\n visibilityState.set(element, \"showing\");\n if (!topLayerElements.has(document2)) {\n topLayerElements.set(document2, /* @__PURE__ */ new Set());\n }\n topLayerElements.get(document2).add(element);\n popoverFocusingSteps(element);\n if (element.popover === \"auto\") {\n if (!autoPopoverList.has(document2)) {\n autoPopoverList.set(document2, /* @__PURE__ */ new Set());\n }\n autoPopoverList.get(document2).add(element);\n setInvokerAriaExpanded(popoverInvoker.get(element), true);\n }\n if (shouldRestoreFocus && originallyFocusedElement && element.popover === \"auto\") {\n previouslyFocusedElements.set(element, originallyFocusedElement);\n }\n queuePopoverToggleEventTask(element, \"closed\", \"open\");\n}\nfunction hidePopover(element, focusPreviousElement = false, fireEvents = false) {\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (element.popover === \"auto\") {\n hideAllPopoversUntil(element, focusPreviousElement, fireEvents);\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n setInvokerAriaExpanded(popoverInvoker.get(element), false);\n popoverInvoker.delete(element);\n if (fireEvents) {\n element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n oldState: \"open\",\n newState: \"closed\"\n })\n );\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n topLayerElements.get(document2)?.delete(element);\n autoPopoverList.get(document2)?.delete(element);\n element.classList.remove(\":popover-open\");\n visibilityState.set(element, \"hidden\");\n if (fireEvents) {\n queuePopoverToggleEventTask(element, \"open\", \"closed\");\n }\n const previouslyFocusedElement = previouslyFocusedElements.get(element);\n if (previouslyFocusedElement) {\n previouslyFocusedElements.delete(element);\n if (focusPreviousElement) {\n previouslyFocusedElement.focus();\n }\n }\n}\nfunction closeAllOpenPopovers(document2, focusPreviousElement = false, fireEvents = false) {\n let popover = topMostAutoPopover(document2);\n while (popover) {\n hidePopover(popover, focusPreviousElement, fireEvents);\n popover = topMostAutoPopover(document2);\n }\n}\nfunction hideAllPopoversUntil(endpoint, focusPreviousElement, fireEvents) {\n const document2 = endpoint.ownerDocument || endpoint;\n if (endpoint instanceof Document) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n let lastToHide = null;\n let foundEndpoint = false;\n for (const popover of autoPopoverList.get(document2) || []) {\n if (popover === endpoint) {\n foundEndpoint = true;\n } else if (foundEndpoint) {\n lastToHide = popover;\n break;\n }\n }\n if (!foundEndpoint) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n while (lastToHide && getPopoverVisibilityState(lastToHide) === \"showing\" && autoPopoverList.get(document2)?.size) {\n hidePopover(lastToHide, focusPreviousElement, fireEvents);\n }\n}\nvar popoverPointerDownTargets = /* @__PURE__ */ new WeakMap();\nfunction lightDismissOpenPopovers(event) {\n if (!event.isTrusted) return;\n const target = event.composedPath()[0];\n if (!target) return;\n const document2 = target.ownerDocument;\n const topMostPopover = topMostAutoPopover(document2);\n if (!topMostPopover) return;\n const ancestor = topMostClickedPopover(target);\n if (ancestor && event.type === \"pointerdown\") {\n popoverPointerDownTargets.set(document2, ancestor);\n } else if (event.type === \"pointerup\") {\n const sameTarget = popoverPointerDownTargets.get(document2) === ancestor;\n popoverPointerDownTargets.delete(document2);\n if (sameTarget) {\n hideAllPopoversUntil(ancestor || document2, false, true);\n }\n }\n}\nvar initialAriaExpandedValue = /* @__PURE__ */ new WeakMap();\nfunction setInvokerAriaExpanded(el, force = false) {\n if (!el) return;\n if (!initialAriaExpandedValue.has(el)) {\n initialAriaExpandedValue.set(el, el.getAttribute(\"aria-expanded\"));\n }\n const popover = el.popoverTargetElement;\n if (popover instanceof HTMLElement && popover.popover === \"auto\") {\n el.setAttribute(\"aria-expanded\", String(force));\n } else {\n const initialValue = initialAriaExpandedValue.get(el);\n if (!initialValue) {\n el.removeAttribute(\"aria-expanded\");\n } else {\n el.setAttribute(\"aria-expanded\", initialValue);\n }\n }\n}\n\n// src/popover.ts\nvar ShadowRoot2 = globalThis.ShadowRoot || function() {\n};\nfunction isSupported() {\n return typeof HTMLElement !== \"undefined\" && typeof HTMLElement.prototype === \"object\" && \"popover\" in HTMLElement.prototype;\n}\nfunction patchSelectorFn(object, name, mapper) {\n const original = object[name];\n Object.defineProperty(object, name, {\n value(selector) {\n return original.call(this, mapper(selector));\n }\n });\n}\nvar nonEscapedPopoverSelector = /(^|[^\\\\]):popover-open\\b/g;\nfunction hasLayerSupport() {\n return typeof globalThis.CSSLayerBlockRule === \"function\";\n}\nfunction getStyles() {\n const useLayer = hasLayerSupport();\n return `\n${useLayer ? \"@layer popover-polyfill {\" : \"\"}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${useLayer ? \"}\" : \"\"}\n`;\n}\nvar popoverStyleSheet = null;\nfunction injectStyles(root) {\n const styles = getStyles();\n if (popoverStyleSheet === null) {\n try {\n popoverStyleSheet = new CSSStyleSheet();\n popoverStyleSheet.replaceSync(styles);\n } catch {\n popoverStyleSheet = false;\n }\n }\n if (popoverStyleSheet === false) {\n const sheet = document.createElement(\"style\");\n sheet.textContent = styles;\n if (root instanceof Document) {\n root.head.prepend(sheet);\n } else {\n root.prepend(sheet);\n }\n } else {\n root.adoptedStyleSheets = [popoverStyleSheet, ...root.adoptedStyleSheets];\n }\n}\nfunction apply() {\n if (typeof window === \"undefined\") return;\n window.ToggleEvent = window.ToggleEvent || ToggleEvent;\n function rewriteSelector(selector) {\n if (selector?.includes(\":popover-open\")) {\n selector = selector.replace(\n nonEscapedPopoverSelector,\n \"$1.\\\\:popover-open\"\n );\n }\n return selector;\n }\n patchSelectorFn(Document.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Document.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"matches\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"closest\", rewriteSelector);\n patchSelectorFn(\n DocumentFragment.prototype,\n \"querySelectorAll\",\n rewriteSelector\n );\n Object.defineProperties(HTMLElement.prototype, {\n popover: {\n enumerable: true,\n configurable: true,\n get() {\n if (!this.hasAttribute(\"popover\")) return null;\n const value = (this.getAttribute(\"popover\") || \"\").toLowerCase();\n if (value === \"\" || value == \"auto\") return \"auto\";\n return \"manual\";\n },\n set(value) {\n this.setAttribute(\"popover\", value);\n }\n },\n showPopover: {\n enumerable: true,\n configurable: true,\n value() {\n showPopover(this);\n }\n },\n hidePopover: {\n enumerable: true,\n configurable: true,\n value() {\n hidePopover(this, true, true);\n }\n },\n togglePopover: {\n enumerable: true,\n configurable: true,\n value(force) {\n if (visibilityState.get(this) === \"showing\" && force === void 0 || force === false) {\n hidePopover(this, true, true);\n } else if (force === void 0 || force === true) {\n showPopover(this);\n }\n }\n }\n });\n const originalAttachShadow = Element.prototype.attachShadow;\n if (originalAttachShadow) {\n Object.defineProperties(Element.prototype, {\n attachShadow: {\n enumerable: true,\n configurable: true,\n writable: true,\n value(options) {\n const shadowRoot = originalAttachShadow.call(this, options);\n injectStyles(shadowRoot);\n return shadowRoot;\n }\n }\n });\n }\n const originalAttachInternals = HTMLElement.prototype.attachInternals;\n if (originalAttachInternals) {\n Object.defineProperties(HTMLElement.prototype, {\n attachInternals: {\n enumerable: true,\n configurable: true,\n writable: true,\n value() {\n const internals = originalAttachInternals.call(this);\n if (internals.shadowRoot) {\n injectStyles(internals.shadowRoot);\n }\n return internals;\n }\n }\n });\n }\n const popoverTargetAssociatedElements = /* @__PURE__ */ new WeakMap();\n function applyPopoverInvokerElementMixin(ElementClass) {\n Object.defineProperties(ElementClass.prototype, {\n popoverTargetElement: {\n enumerable: true,\n configurable: true,\n set(targetElement) {\n if (targetElement === null) {\n this.removeAttribute(\"popovertarget\");\n popoverTargetAssociatedElements.delete(this);\n } else if (!(targetElement instanceof Element)) {\n throw new TypeError(\n `popoverTargetElement must be an element or null`\n );\n } else {\n this.setAttribute(\"popovertarget\", \"\");\n popoverTargetAssociatedElements.set(this, targetElement);\n }\n },\n get() {\n if (this.localName !== \"button\" && this.localName !== \"input\") {\n return null;\n }\n if (this.localName === \"input\" && this.type !== \"reset\" && this.type !== \"image\" && this.type !== \"button\") {\n return null;\n }\n if (this.disabled) {\n return null;\n }\n if (this.form && this.type === \"submit\") {\n return null;\n }\n const targetElement = popoverTargetAssociatedElements.get(this);\n if (targetElement && targetElement.isConnected) {\n return targetElement;\n } else if (targetElement && !targetElement.isConnected) {\n popoverTargetAssociatedElements.delete(this);\n return null;\n }\n const root = getRootNode(this);\n const idref = this.getAttribute(\"popovertarget\");\n if ((root instanceof Document || root instanceof ShadowRoot2) && idref) {\n return root.getElementById(idref) || null;\n }\n return null;\n }\n },\n popoverTargetAction: {\n enumerable: true,\n configurable: true,\n get() {\n const value = (this.getAttribute(\"popovertargetaction\") || \"\").toLowerCase();\n if (value === \"show\" || value === \"hide\") return value;\n return \"toggle\";\n },\n set(value) {\n this.setAttribute(\"popovertargetaction\", value);\n }\n }\n });\n }\n applyPopoverInvokerElementMixin(HTMLButtonElement);\n applyPopoverInvokerElementMixin(HTMLInputElement);\n const handleInvokerActivation = (event) => {\n const composedPath = event.composedPath();\n const target = composedPath[0];\n if (!(target instanceof Element) || target?.shadowRoot) {\n return;\n }\n const root = getRootNode(target);\n if (!(root instanceof ShadowRoot2 || root instanceof Document)) {\n return;\n }\n const invoker = composedPath.find(\n (el) => el.matches?.(\"[popovertargetaction],[popovertarget]\")\n );\n if (invoker) {\n popoverTargetAttributeActivationBehavior(invoker);\n event.preventDefault();\n return;\n }\n };\n const onKeydown = (event) => {\n const key = event.key;\n const target = event.target;\n if (!event.defaultPrevented && target && (key === \"Escape\" || key === \"Esc\")) {\n hideAllPopoversUntil(target.ownerDocument, true, true);\n }\n };\n const addEventListeners = (root) => {\n root.addEventListener(\"click\", handleInvokerActivation);\n root.addEventListener(\"keydown\", onKeydown);\n root.addEventListener(\"pointerdown\", lightDismissOpenPopovers);\n root.addEventListener(\"pointerup\", lightDismissOpenPopovers);\n };\n addEventListeners(document);\n injectStyles(document);\n}\n\n// src/index.ts\nif (!isSupported()) apply();\n//# sourceMappingURL=popover.js.map\n","import '@oddbird/popover-polyfill'\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]', '[role=\"option\"]']\nconst menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ')\n\nconst getMnemonicFor = (item: Element) => item.textContent?.trim()[0].toLowerCase()\n\nconst printable = /^\\S$/\n\nexport default class FocusGroupElement extends HTMLElement {\n #retainSignal: AbortController | null = null\n\n get nowrap(): boolean {\n return this.hasAttribute('nowrap')\n }\n\n set nowrap(value: boolean) {\n this.toggleAttribute('nowrap', value)\n }\n\n get direction(): 'horizontal' | 'vertical' | 'both' {\n if (this.getAttribute('direction') === 'horizontal') return 'horizontal'\n return 'vertical'\n }\n\n set direction(value: 'horizontal' | 'vertical' | 'both') {\n this.setAttribute('direction', `${value}`)\n }\n\n get retain() {\n return this.hasAttribute('retain')\n }\n\n set retain(value: boolean) {\n this.toggleAttribute('retain', value)\n }\n\n get mnemonics() {\n return this.hasAttribute('mnemonics')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusin', this, {signal})\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n get #items() {\n return this.querySelectorAll(menuItemSelector)\n }\n\n handleEvent(event: Event) {\n const {direction, nowrap} = this\n if (event.type === 'focusin') {\n if (this.retain && event.target instanceof Element && event.target.matches(menuItemSelector)) {\n this.#retainSignal?.abort()\n const {signal} = (this.#retainSignal = new AbortController())\n for (const item of this.#items) {\n item.setAttribute('tabindex', item === event.target ? '0' : '-1')\n const popover = event.target.closest<HTMLElement>('[popover]')\n if (item === event.target && popover?.popover === 'auto' && popover.closest('focus-group') === this) {\n popover.addEventListener(\n 'toggle',\n (toggleEvent: Event) => {\n if (!(toggleEvent.target instanceof Element)) return\n if ((toggleEvent as ToggleEvent).newState === 'closed') {\n this.#retainSignal?.abort()\n item.setAttribute('tabindex', '-1')\n if (popover.id) {\n const invoker = this.querySelector(`[popovertarget=\"${popover.id}\"]`)\n if (invoker) {\n invoker.setAttribute('tabindex', '0')\n } else {\n this.#items[0]?.setAttribute('tabindex', '0')\n }\n }\n }\n },\n {signal},\n )\n }\n }\n }\n } else if (event instanceof KeyboardEvent) {\n const items = Array.from(this.#items)\n let index = items.indexOf(event.target as Element)\n const key = event.key\n if (key === 'Up' || key === 'ArrowUp') {\n if (direction === 'vertical' || direction === 'both') {\n index -= index < 0 ? 0 : 1\n event.preventDefault()\n }\n } else if (key === 'Down' || key === 'ArrowDown') {\n if (direction === 'vertical' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Left' || event.key === 'ArrowLeft') {\n if (direction === 'horizontal' || direction === 'both') {\n index -= 1\n event.preventDefault()\n }\n } else if (event.key === 'Right' || event.key === 'ArrowRight') {\n if (direction === 'horizontal' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n index = 0\n event.preventDefault()\n } else if (event.key === 'End' || event.key === 'PageDown') {\n index = items.length - 1\n event.preventDefault()\n } else if (this.mnemonics && printable.test(key)) {\n const mnemonic = key.toLowerCase()\n const offset = index > 0 && getMnemonicFor(event.target as Element) === mnemonic ? index : 0\n index = items.findIndex((item, i) => i > offset && getMnemonicFor(item) === mnemonic)\n if (index < 0 && !nowrap) {\n index = items.findIndex(item => getMnemonicFor(item) === mnemonic)\n }\n } else {\n return\n }\n if (nowrap && index < 0) index = 0\n if (!nowrap && index >= items.length) index = 0\n const focusEl = items.at(Math.min(index, items.length - 1)) as HTMLElement\n {\n let el: HTMLElement | null = focusEl\n do {\n el = el.closest(`[popover]:not(:popover-open)`)\n if (el?.popover === 'auto' && !['ArrowRight', 'ArrowLeft'].includes(event.key)) {\n el.showPopover()\n }\n el = el?.parentElement || null\n } while (el)\n }\n focusEl?.focus()\n }\n }\n}\n\nif (!customElements.get('focus-group')) {\n window.FocusGroupElement = FocusGroupElement\n customElements.define('focus-group', FocusGroupElement)\n}\n\ndeclare global {\n interface Window {\n FocusGroupElement: typeof FocusGroupElement\n }\n}\n","import {controller, attr} from '@github/catalyst'\n\n@controller\nexport class ScrollableRegionElement extends HTMLElement {\n @attr hasOverflow = false\n @attr labelledBy = ''\n\n observer: ResizeObserver\n\n connectedCallback() {\n this.style.overflow = 'auto'\n\n this.observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n this.hasOverflow =\n entry.target.scrollHeight > entry.target.clientHeight || entry.target.scrollWidth > entry.target.clientWidth\n }\n })\n\n this.observer.observe(this)\n }\n\n disconnectedCallback() {\n this.observer.disconnect()\n }\n\n attributeChangedCallback(name: string) {\n if (name === 'data-has-overflow') {\n if (this.hasOverflow) {\n this.setAttribute('aria-labelledby', this.labelledBy)\n this.setAttribute('role', 'region')\n this.setAttribute('tabindex', '0')\n } else {\n this.removeAttribute('aria-labelledby')\n this.removeAttribute('role')\n this.removeAttribute('tabindex')\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ScrollableRegionElement: typeof ScrollableRegionElement\n }\n}\n\nwindow.ScrollableRegionElement = ScrollableRegionElement\n","const safeDocument = typeof document === 'undefined' ? undefined : document\n\n// Announce an element's text to the screen reader.\nexport function announceFromElement(el: HTMLElement, options?: {assertive?: boolean; element?: HTMLElement}) {\n announce(getTextContent(el), options)\n}\n\n// Announce message update to screen reader.\n// Note: Use caution when using this function while a dialog is active.\n// If the message is updated while the dialog is open, the screen reader may not announce the live region.\nexport function announce(message: string, options?: {assertive?: boolean; element?: HTMLElement}) {\n const {assertive, element} = options ?? {}\n\n setContainerContent(message, assertive, element)\n}\n\n// Set aria-live container to message.\nfunction setContainerContent(message: string, assertive?: boolean, element?: HTMLElement) {\n const getQuerySelector = () => {\n return assertive ? '#js-global-screen-reader-notice-assertive' : '#js-global-screen-reader-notice'\n }\n const container = element ?? safeDocument?.querySelector(getQuerySelector())\n if (!container) return\n if (container.textContent === message) {\n /* This is a hack due to the way the aria live API works.\n A screen reader will not read a live region again\n if the text is the same. Adding a space character tells\n the browser that the live region has updated,\n which will cause it to read again, but with no audible difference. */\n container.textContent = `${message}\\u00A0`\n } else {\n container.textContent = message\n }\n}\n\n// Gets the trimmed text content of an element.\nfunction getTextContent(el: HTMLElement): string {\n // innerText does not contain hidden text\n /* eslint-disable-next-line github/no-innerText */\n return (el.getAttribute('aria-label') || el.innerText || '').trim()\n}\n","import {focusTrap} from '@primer/behaviors'\nimport {getFocusableChild} from '@primer/behaviors/utils'\n\nfunction focusIfNeeded(elem: HTMLElement | undefined | null) {\n if (document.activeElement !== elem) {\n elem?.focus()\n }\n}\n\nconst overlayStack: ModalDialogElement[] = []\n\nfunction clickHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n dialog.openButton = button\n dialog.show()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n return\n }\n }\n\n if (!overlayStack.length) return\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n const dialogIndex = overlayStack.findIndex(ele => ele.id === dialogId)\n overlayStack.splice(dialogIndex, 1)\n dialog.close(button.hasAttribute('data-submit-dialog-id'))\n }\n }\n}\n\nfunction keydownHandler(event: Event) {\n if (\n !(event instanceof KeyboardEvent) ||\n event.type !== 'keydown' ||\n event.key !== 'Enter' ||\n event.ctrlKey ||\n event.altKey ||\n event.metaKey ||\n event.shiftKey\n )\n return\n\n clickHandler(event)\n}\n\nfunction mousedownHandler(event: Event) {\n const target = event.target as HTMLElement\n if (target?.closest('button')) return\n\n // Find the top level dialog that is open.\n const topLevelDialog = overlayStack[overlayStack.length - 1]\n if (!topLevelDialog) return\n\n // Check if the mousedown happened outside the boundary of the top level dialog\n const mouseDownOutsideDialog = !target.closest(`#${topLevelDialog.getAttribute('id')}`)\n\n // Only close dialog if it's a click outside the dialog and the dialog has a button?\n if (mouseDownOutsideDialog) {\n target.ownerDocument.addEventListener(\n 'mouseup',\n (upEvent: Event) => {\n if (upEvent.target === target) {\n overlayStack.pop()\n topLevelDialog.close()\n }\n },\n {once: true},\n )\n }\n}\n\nexport class ModalDialogElement extends HTMLElement {\n //TODO: Do we remove the abortController from focusTrap?\n #focusAbortController = new AbortController()\n openButton: HTMLButtonElement | null\n\n get open() {\n return this.hasAttribute('open')\n }\n set open(value: boolean) {\n if (value) {\n if (this.open) return\n this.setAttribute('open', '')\n this.setAttribute('aria-disabled', 'false')\n document.body.style.paddingRight = `${window.innerWidth - document.body.clientWidth}px`\n document.body.style.overflow = 'hidden'\n this.#overlayBackdrop?.classList.remove('Overlay--hidden')\n if (this.#focusAbortController.signal.aborted) {\n this.#focusAbortController = new AbortController()\n }\n focusTrap(this, this.querySelector('[autofocus]') as HTMLElement, this.#focusAbortController.signal)\n overlayStack.push(this)\n } else {\n if (!this.open) return\n this.removeAttribute('open')\n this.setAttribute('aria-disabled', 'true')\n this.#overlayBackdrop?.classList.add('Overlay--hidden')\n document.body.style.paddingRight = '0'\n document.body.style.overflow = 'initial'\n this.#focusAbortController.abort()\n // if #openButton is a child of a menu, we need to focus a suitable child of the menu\n // element since it is expected for the menu to close on click\n const menu = this.openButton?.closest('details') || this.openButton?.closest('action-menu')\n if (menu) {\n focusIfNeeded(getFocusableChild(menu))\n } else {\n focusIfNeeded(this.openButton)\n }\n this.openButton = null\n }\n }\n\n get #overlayBackdrop(): HTMLElement | null {\n if (this.parentElement?.hasAttribute('data-modal-dialog-overlay')) {\n return this.parentElement\n }\n\n return null\n }\n\n get showButtons(): NodeList {\n // Dialogs may also be opened from any arbitrary button with a matching show-dialog-id data attribute\n return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)\n }\n\n connectedCallback(): void {\n if (!this.hasAttribute('role')) this.setAttribute('role', 'dialog')\n\n document.addEventListener('click', clickHandler)\n document.addEventListener('keydown', keydownHandler)\n document.addEventListener('mousedown', mousedownHandler)\n\n this.addEventListener('keydown', e => this.#keydown(e))\n }\n\n show() {\n this.open = true\n }\n\n close(closedNotCancelled = false) {\n if (this.open === false) return\n const eventType = closedNotCancelled ? 'close' : 'cancel'\n const dialogEvent = new Event(eventType)\n this.dispatchEvent(dialogEvent)\n this.open = false\n }\n\n #keydown(event: Event) {\n if (!(event instanceof KeyboardEvent)) return\n if (event.isComposing) return\n if (!this.open) return\n\n switch (event.key) {\n case 'Escape':\n this.close()\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n break\n case 'Enter': {\n const target = event.target as HTMLElement\n\n if (target.getAttribute('data-close-dialog-id') === this.id) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n }\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ModalDialogElement: typeof ModalDialogElement\n }\n interface HTMLElementTagNameMap {\n 'modal-dialog': ModalDialogElement\n }\n}\n\nif (!window.customElements.get('modal-dialog')) {\n window.ModalDialogElement = ModalDialogElement\n window.customElements.define('modal-dialog', ModalDialogElement)\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target topLevelList: HTMLElement\n\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n // groups are wrapped in <action-list>, which handles resizing on its own\n if (this.topLevelList) {\n this.#truncationObserver = new ActionListTruncationObserver(this.topLevelList)\n }\n }\n\n disconnectedCallback() {\n if (this.topLevelList) {\n this.#truncationObserver.unobserve(this.topLevelList)\n }\n }\n\n selectItemById(itemId: string | null): boolean {\n if (!itemId) return false\n\n const selectedItem = this.#findSelectedNavItemById(itemId)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByHref(href: string | null): boolean {\n if (!href) return false\n\n const selectedItem = this.#findSelectedNavItemByHref(href)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByCurrentLocation(): boolean {\n const selectedItem = this.#findSelectedNavItemByCurrentLocation()\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n // expand collapsible item onClick\n expandItem(item: HTMLElement) {\n item.nextElementSibling?.removeAttribute('data-hidden')\n item.setAttribute('aria-expanded', 'true')\n }\n\n collapseItem(item: HTMLElement) {\n item.nextElementSibling?.setAttribute('data-hidden', '')\n item.setAttribute('aria-expanded', 'false')\n item.focus()\n }\n\n itemIsExpanded(item: HTMLElement | null) {\n if (item?.tagName === 'A') {\n return true\n }\n return item?.getAttribute('aria-expanded') === 'true'\n }\n\n // expand/collapse item\n handleItemWithSubItemClick(e: Event) {\n const el = e.target\n if (!(el instanceof HTMLElement)) return\n\n const button = el.closest<HTMLButtonElement>('button')\n if (!button) return\n if (this.itemIsExpanded(button)) {\n this.collapseItem(button)\n } else {\n this.expandItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n // collapse item\n handleItemWithSubItemKeydown(e: KeyboardEvent) {\n const el = e.currentTarget\n if (!(el instanceof HTMLElement)) return\n\n let button = el.closest<HTMLButtonElement>('button')\n if (!button) {\n const button_id = el.getAttribute('aria-labelledby')\n if (button_id) {\n button = document.getElementById(button_id) as HTMLButtonElement\n } else {\n return\n }\n }\n\n if (this.itemIsExpanded(button) && e.key === 'Escape') {\n this.collapseItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n #findSelectedNavItemById(itemId: string): HTMLElement | null {\n // First we compare the selected link to data-item-id for each nav item\n for (const navItem of this.items) {\n if (navItem.classList.contains('ActionListItem--hasSubItem')) {\n continue\n }\n\n const keys = navItem.getAttribute('data-item-id')?.split(' ') || []\n\n if (keys.includes(itemId)) {\n return navItem\n }\n }\n\n return null\n }\n\n #findSelectedNavItemByHref(href: string): HTMLElement | null {\n // If we didn't find a match, we compare the selected link to the href of each nav item\n const selectedNavItem = this.querySelector<HTMLAnchorElement>(`.ActionListContent[href=\"${href}\"]`)\n if (selectedNavItem) {\n return selectedNavItem.closest('.ActionListItem')\n }\n\n return null\n }\n\n #findSelectedNavItemByCurrentLocation(): HTMLElement | null {\n return this.#findSelectedNavItemByHref(window.location.pathname)\n }\n\n #select(navItem: HTMLElement) {\n const currentlySelectedItem = this.querySelector('.ActionListItem--navActive') as HTMLElement\n if (currentlySelectedItem) this.#deselect(currentlySelectedItem)\n\n navItem.classList.add('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].setAttribute('aria-current', 'page')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.expandItem(parentMenu)\n parentMenu.classList.add('ActionListContent--hasActiveSubItem')\n }\n }\n\n #deselect(navItem: HTMLElement) {\n navItem.classList.remove('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].removeAttribute('aria-current')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.collapseItem(parentMenu)\n parentMenu.classList.remove('ActionListContent--hasActiveSubItem')\n }\n }\n\n #findParentMenu(navItem: HTMLElement): HTMLElement | null {\n if (!navItem.classList.contains('ActionListItem--subItem')) return null\n\n const parent = navItem.closest('li.ActionListItem--hasSubItem')?.querySelector('button.ActionListContent')\n\n if (parent) {\n return parent as HTMLElement\n } else {\n return null\n }\n }\n}\n\ndeclare global {\n interface Window {\n NavListElement: typeof NavListElement\n }\n}\n","import {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListGroupElement extends HTMLElement {\n @target showMoreItem: HTMLElement\n @targets focusMarkers: HTMLElement[]\n\n connectedCallback(): void {\n this.setShowMoreItemState()\n }\n\n get showMoreDisabled(): boolean {\n return this.showMoreItem.hasAttribute('aria-disabled')\n }\n\n set showMoreDisabled(value: boolean) {\n if (value) {\n this.showMoreItem.setAttribute('aria-disabled', 'true')\n } else {\n this.showMoreItem.removeAttribute('aria-disabled')\n }\n this.showMoreItem.classList.toggle('disabled', value)\n }\n\n set currentPage(value: number) {\n this.showMoreItem.setAttribute('data-current-page', value.toString())\n }\n\n get currentPage(): number {\n return parseInt(this.showMoreItem.getAttribute('data-current-page') as string) || 1\n }\n\n get totalPages(): number {\n return parseInt(this.showMoreItem.getAttribute('data-total-pages') as string) || 1\n }\n\n get paginationSrc(): string {\n return this.showMoreItem.getAttribute('src') || ''\n }\n\n private async showMore(e: Event) {\n e.preventDefault()\n if (this.showMoreDisabled) return\n this.showMoreDisabled = true\n let html\n try {\n const paginationURL = new URL(this.paginationSrc, window.location.origin)\n this.currentPage++\n paginationURL.searchParams.append('page', this.currentPage.toString())\n const response = await fetch(paginationURL)\n if (!response.ok) return\n html = await response.text()\n if (this.currentPage === this.totalPages) {\n this.showMoreItem.hidden = true\n }\n } catch (err) {\n // Ignore network errors\n this.showMoreDisabled = false\n this.currentPage--\n return\n }\n const fragment = this.#parseHTML(document, html)\n fragment?.querySelector('li > a')?.setAttribute('data-targets', 'nav-list-group.focusMarkers')\n const listId = (e.target as HTMLElement).closest('button')!.getAttribute('data-list-id')!\n const list = document.getElementById(listId)!\n list.append(fragment)\n this.focusMarkers.pop()?.focus()\n this.showMoreDisabled = false\n }\n\n private setShowMoreItemState() {\n if (!this.showMoreItem) {\n return\n }\n\n if (this.currentPage < this.totalPages) {\n this.showMoreItem.hidden = false\n } else {\n this.showMoreItem.hidden = true\n }\n }\n\n #parseHTML(document: Document, html: string): DocumentFragment {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = html\n return document.importNode(template.content, true)\n }\n\n #truncateObserver = new ActionListTruncationObserver(this)\n}\n\ndeclare global {\n interface Window {\n NavListGroupElement: typeof NavListGroupElement\n }\n}\n\nwindow.NavListGroupElement = NavListGroupElement\n","import {controller, targets} from '@github/catalyst'\n\n@controller\nclass SegmentedControlElement extends HTMLElement {\n @targets items: HTMLElement[]\n\n connectedCallback() {\n this.#updateButtonLabels()\n }\n\n select(event: Event) {\n const button = event.currentTarget as HTMLButtonElement\n for (const item of this.items) {\n item.classList.remove('SegmentedControl-item--selected')\n item.querySelector('[aria-current]')?.setAttribute('aria-current', 'false')\n }\n\n button.closest('li.SegmentedControl-item')?.classList.add('SegmentedControl-item--selected')\n button.setAttribute('aria-current', 'true')\n }\n\n // Updates the button labels to have a data-content attribute with the text\n // This is for selection styling to avoid the text jumping. It only needs to be\n // setup when the component is first loaded.\n #updateButtonLabels() {\n for (const label of this.querySelectorAll('.Button-label')) {\n label.setAttribute('data-content', label.textContent || '')\n }\n }\n}\n\ndeclare global {\n interface Window {\n SegmentedControlElement: typeof SegmentedControlElement\n }\n}\n\nif (!window.customElements.get('segmented-control')) {\n window.SegmentedControlElement = SegmentedControlElement\n window.customElements.define('segmented-control', SegmentedControlElement)\n}\n","import {controller, target, attr} from '@github/catalyst'\n\n@controller\nclass ToggleSwitchElement extends HTMLElement {\n @target switch: HTMLElement\n @target loadingSpinner: HTMLElement\n @target errorIcon: HTMLElement\n @attr turbo = false\n\n private toggling = false\n\n get src(): string | null {\n const src = this.getAttribute('src')\n if (!src) return null\n\n const link = this.ownerDocument.createElement('a')\n link.href = src\n return link.href\n }\n\n get csrf(): string | null {\n const csrfElement = this.querySelector('[data-csrf]')\n return this.getAttribute('data-csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || null\n }\n\n get csrfField(): string {\n // the authenticity token is passed into the element and is not generated in js land\n\n return this.getAttribute('csrf-field') || 'authenticity_token'\n }\n\n isRemote(): boolean {\n return this.src != null\n }\n\n async toggle() {\n if (this.toggling) return\n\n this.toggling = true\n\n if (this.isDisabled()) {\n return\n }\n\n if (!this.isRemote()) {\n this.performToggle()\n this.toggling = false\n return\n }\n\n // toggle immediately to tell screen readers the switch was clicked\n this.performToggle()\n this.setLoadingState()\n\n try {\n await this.submitForm()\n } catch (error) {\n if (error instanceof Error) {\n // because we toggle immediately when the switch is clicked, toggle back to the\n // old state on failure\n this.setErrorState(error.message || 'An error occurred, please try again.')\n this.performToggle()\n }\n\n return\n } finally {\n this.toggling = false\n }\n\n this.setSuccessState()\n }\n\n turnOn(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'true')\n this.classList.add('ToggleSwitch--checked')\n }\n\n turnOff(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'false')\n this.classList.remove('ToggleSwitch--checked')\n }\n\n isOn(): boolean {\n return this.switch.getAttribute('aria-pressed') === 'true'\n }\n\n isOff(): boolean {\n return !this.isOn()\n }\n\n isDisabled(): boolean {\n return this.switch.getAttribute('disabled') != null\n }\n\n disable(): void {\n this.switch.setAttribute('disabled', 'disabled')\n }\n\n enable(): void {\n this.switch.removeAttribute('disabled')\n }\n\n private performToggle(): void {\n if (this.isOn()) {\n this.turnOff()\n } else {\n this.turnOn()\n }\n }\n\n private setLoadingState(): void {\n this.errorIcon.setAttribute('hidden', 'hidden')\n this.loadingSpinner.removeAttribute('hidden')\n\n const event = new CustomEvent('toggleSwitchLoading', {bubbles: true})\n this.dispatchEvent(event)\n }\n\n private setSuccessState(): void {\n const event = new CustomEvent('toggleSwitchSuccess', {bubbles: true})\n this.dispatchEvent(event)\n\n this.setFinishedState(false)\n }\n\n private setErrorState(message: string): void {\n const event = new CustomEvent('toggleSwitchError', {bubbles: true, detail: message})\n this.dispatchEvent(event)\n\n this.setFinishedState(true)\n }\n\n private setFinishedState(error: boolean): void {\n if (error) {\n this.errorIcon.removeAttribute('hidden')\n }\n\n this.loadingSpinner.setAttribute('hidden', 'hidden')\n }\n\n private async submitForm() {\n const body = new FormData()\n\n if (this.csrf) {\n body.append(this.csrfField, this.csrf)\n }\n\n body.append('value', this.isOn() ? '1' : '0')\n\n if (!this.src) throw new Error('invalid src')\n\n let response\n\n const requestHeaders: {[key: string]: string} = {\n 'Requested-With': 'XMLHttpRequest',\n }\n\n if (this.turbo) {\n requestHeaders['Accept'] = 'text/vnd.turbo-stream.html'\n }\n\n try {\n response = await fetch(this.src, {\n credentials: 'same-origin',\n method: 'POST',\n headers: requestHeaders,\n body,\n })\n } catch (error) {\n throw new Error('A network error occurred, please try again.')\n }\n\n if (!response.ok) {\n throw new Error(await response.text())\n }\n\n const contentType = response.headers.get('Content-Type')\n if (window.Turbo && this.turbo && contentType?.startsWith('text/vnd.turbo-stream.html')) {\n window.Turbo.renderStreamMessage(await response.text())\n }\n }\n}\n\ndeclare global {\n interface Window {\n ToggleSwitchElement: typeof ToggleSwitchElement\n Turbo: {\n renderStreamMessage: (message: string) => void\n }\n }\n}\n\nif (!window.customElements.get('toggle-switch')) {\n window.ToggleSwitchElement = ToggleSwitchElement\n window.customElements.define('toggle-switch', ToggleSwitchElement)\n}\n","import type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport '@oddbird/popover-polyfill'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst isPopoverOpen = (() => {\n let selector: string\n function setSelector(el: Element) {\n try {\n selector = ':popover-open'\n return el.matches(selector)\n } catch {\n try {\n selector = ':open'\n return el.matches(':open')\n } catch {\n selector = '.\\\\:popover-open'\n return el.matches('.\\\\:popover-open')\n }\n }\n }\n return (el: Element) => (selector ? el.matches(selector) : setSelector(el))\n})()\n\nconst TOOLTIP_SR_ONLY_CLASS = 'sr-only'\n\ntype Direction = 'n' | 's' | 'e' | 'w' | 'ne' | 'se' | 'nw' | 'sw'\n\nconst DIRECTION_CLASSES = [\n 'tooltip-n',\n 'tooltip-s',\n 'tooltip-e',\n 'tooltip-w',\n 'tooltip-ne',\n 'tooltip-se',\n 'tooltip-nw',\n 'tooltip-sw',\n]\n\nfunction closeOpenTooltips(except?: Element) {\n for (const tooltip of openTooltips) {\n if (tooltip === except) continue\n if (isPopoverOpen(tooltip)) {\n tooltip.hidePopover()\n } else {\n openTooltips.delete(tooltip)\n }\n }\n}\n\nfunction focusOutListener() {\n closeOpenTooltips()\n}\n\nfunction focusInListener(event: Event) {\n setTimeout(() => {\n for (const tooltip of openTooltips) {\n if (isPopoverOpen(tooltip) && tooltip.showReason === 'focus' && tooltip.control !== event.target) {\n tooltip.hidePopover()\n }\n }\n }, 0)\n}\n\nconst tooltips = new Set<ToolTipElement>()\nconst openTooltips = new Set<ToolTipElement>()\nclass ToolTipElement extends HTMLElement {\n styles() {\n return `\n :host {\n --tooltip-top: var(--tool-tip-position-top, 0);\n --tooltip-left: var(--tool-tip-position-left, 0);\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(.tooltip-w) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));\n }\n\n :host(.tooltip-e) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--overlay-offset, 0.25rem);\n content: \"\";\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n :host(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\\\:popover-open) {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n `\n }\n\n #abortController: AbortController | undefined\n #align: AnchorAlignment = 'center'\n #side: AnchorSide = 'outside-bottom'\n #allowUpdatePosition = false\n #showReason: 'focus' | 'mouse' = 'mouse'\n get showReason() {\n return this.#showReason\n }\n\n get htmlFor(): string {\n return this.getAttribute('for') || ''\n }\n\n set htmlFor(value: string) {\n this.setAttribute('for', value)\n }\n\n get type(): 'description' | 'label' {\n const type = this.getAttribute('data-type')\n return type === 'label' ? 'label' : 'description'\n }\n\n set type(value: 'description' | 'label') {\n this.setAttribute('data-type', value)\n }\n\n get direction(): Direction {\n return (this.getAttribute('data-direction') || 's') as Direction\n }\n\n set direction(value: Direction) {\n this.setAttribute('data-direction', value)\n }\n\n get control(): HTMLElement | null {\n return this.ownerDocument.getElementById(this.htmlFor)\n }\n\n /* @deprecated */\n set hiddenFromView(value: true | false) {\n if (value && isPopoverOpen(this)) {\n this.hidePopover()\n } else if (!value && !isPopoverOpen(this)) {\n this.showPopover()\n }\n }\n\n /* @deprecated */\n get hiddenFromView() {\n return !isPopoverOpen(this)\n }\n\n connectedCallback() {\n tooltips.add(this)\n this.#updateControlReference()\n this.#updateDirection()\n if (!this.shadowRoot) {\n const shadow = this.attachShadow({mode: 'open'})\n const style = shadow.appendChild(document.createElement('style'))\n style.textContent = this.styles()\n shadow.appendChild(document.createElement('slot'))\n }\n this.#update(false)\n this.#allowUpdatePosition = true\n\n if (!this.control) return\n\n this.setAttribute('role', 'tooltip')\n\n this.#abortController?.abort()\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('mouseleave', this, {signal})\n this.addEventListener('toggle', this, {signal})\n this.control.addEventListener('mouseenter', this, {signal})\n this.control.addEventListener('mouseleave', this, {signal})\n this.control.addEventListener('focus', this, {signal})\n this.control.addEventListener('mousedown', this, {signal})\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore popoverTargetElement is not in the type definition\n this.control.popoverTargetElement?.addEventListener('beforetoggle', this, {\n signal,\n })\n this.ownerDocument.addEventListener('focusout', focusOutListener)\n this.ownerDocument.addEventListener('focusin', focusInListener)\n this.ownerDocument.addEventListener('keydown', this, {signal, capture: true})\n }\n\n disconnectedCallback() {\n tooltips.delete(this)\n openTooltips.delete(this)\n this.#abortController?.abort()\n }\n\n async handleEvent(event: Event) {\n if (!this.control) return\n const showing = isPopoverOpen(this)\n\n // Ensures that tooltip stays open when hovering between tooltip and element\n // WCAG Success Criterion 1.4.13 Hoverable\n const shouldShow =\n event.type === 'mouseenter' ||\n // Only show tooltip on focus if running in headless browser (for tests) or if focus ring\n // is visible (i.e. if user is using keyboard navigation)\n (event.type === 'focus' && (navigator.webdriver || this.control.matches(':focus-visible')))\n const isMouseLeaveFromButton =\n event.type === 'mouseleave' &&\n (event as MouseEvent).relatedTarget !== this.control &&\n (event as MouseEvent).relatedTarget !== this\n const isEscapeKeydown = event.type === 'keydown' && (event as KeyboardEvent).key === 'Escape'\n const isMouseDownOnButton = event.type === 'mousedown' && event.currentTarget === this.control\n const isOpeningOtherPopover = event.type === 'beforetoggle' && event.currentTarget !== this\n const shouldHide = isMouseLeaveFromButton || isEscapeKeydown || isMouseDownOnButton || isOpeningOtherPopover\n\n if (showing && isEscapeKeydown) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n event.preventDefault()\n }\n\n await Promise.resolve()\n if (!showing && shouldShow && !isPopoverOpen(this)) {\n this.#showReason = event.type === 'mouseenter' ? 'mouse' : 'focus'\n this.showPopover()\n } else if (showing && shouldHide && isPopoverOpen(this)) {\n this.hidePopover()\n }\n\n if (event.type === 'toggle') {\n this.#update((event as ToggleEvent).newState === 'open')\n }\n }\n\n static observedAttributes = ['data-type', 'data-direction', 'id']\n\n #update(isOpen: boolean) {\n if (isOpen) {\n openTooltips.add(this)\n this.classList.remove(TOOLTIP_SR_ONLY_CLASS)\n closeOpenTooltips(this)\n this.#updatePosition()\n } else {\n openTooltips.delete(this)\n this.classList.remove(...DIRECTION_CLASSES)\n this.classList.add(TOOLTIP_SR_ONLY_CLASS)\n }\n }\n\n attributeChangedCallback(name: string) {\n if (!this.isConnected) return\n\n if (name === 'id' || name === 'data-type') {\n this.#updateControlReference()\n } else if (name === 'data-direction') {\n this.#updateDirection()\n }\n }\n\n #updateControlReference() {\n if (!this.id || !this.control) return\n if (this.type === 'label') {\n let labelledBy = this.control.getAttribute('aria-labelledby')\n if (labelledBy) {\n if (!labelledBy.split(' ').includes(this.id)) {\n labelledBy = `${labelledBy} ${this.id}`\n } else {\n labelledBy = `${labelledBy}`\n }\n } else {\n labelledBy = this.id\n }\n this.control.setAttribute('aria-labelledby', labelledBy)\n\n // Prevent duplicate accessible name announcements.\n this.setAttribute('aria-hidden', 'true')\n } else {\n let describedBy = this.control.getAttribute('aria-describedby')\n if (describedBy) {\n if (!describedBy.split(' ').includes(this.id)) {\n describedBy = `${describedBy} ${this.id}`\n } else {\n describedBy = `${describedBy}`\n }\n } else {\n describedBy = this.id\n }\n this.control.setAttribute('aria-describedby', describedBy)\n }\n }\n\n #updateDirection() {\n this.classList.remove(...DIRECTION_CLASSES)\n const direction = this.direction\n if (direction === 'n') {\n this.#align = 'center'\n this.#side = 'outside-top'\n } else if (direction === 'ne') {\n this.#align = 'end'\n this.#side = 'outside-top'\n } else if (direction === 'e') {\n this.#align = 'center'\n this.#side = 'outside-right'\n } else if (direction === 'se') {\n this.#align = 'end'\n this.#side = 'outside-bottom'\n } else if (direction === 's') {\n this.#align = 'center'\n this.#side = 'outside-bottom'\n } else if (direction === 'sw') {\n this.#align = 'start'\n this.#side = 'outside-bottom'\n } else if (direction === 'w') {\n this.#align = 'center'\n this.#side = 'outside-left'\n } else if (direction === 'nw') {\n this.#align = 'start'\n this.#side = 'outside-top'\n }\n }\n\n #updatePosition() {\n if (!this.control) return\n if (!this.#allowUpdatePosition || !isPopoverOpen(this)) return\n\n const position = getAnchoredPosition(this, this.control, {\n side: this.#side,\n align: this.#align,\n anchorOffset: 0,\n })\n const anchorSide = position.anchorSide\n const align = position.anchorAlign\n\n this.style.setProperty('--tool-tip-position-top', `${position.top}px`)\n this.style.setProperty('--tool-tip-position-left', `${position.left}px`)\n\n let direction: Direction = 's'\n\n if (anchorSide === 'outside-left') {\n direction = 'w'\n } else if (anchorSide === 'outside-right') {\n direction = 'e'\n } else if (anchorSide === 'outside-top') {\n if (align === 'center') {\n direction = 'n'\n } else if (align === 'start') {\n direction = 'ne'\n } else {\n direction = 'nw'\n }\n } else {\n if (align === 'center') {\n direction = 's'\n } else if (align === 'start') {\n direction = 'se'\n } else {\n direction = 'sw'\n }\n }\n\n this.classList.add(`tooltip-${direction}`)\n }\n}\n\nif (!window.customElements.get('tool-tip')) {\n window.ToolTipElement = ToolTipElement\n window.customElements.define('tool-tip', ToolTipElement)\n}\n\ndeclare global {\n interface Window {\n ToolTipElement: typeof ToolTipElement\n }\n}\n","import {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'banner:dismiss': CustomEvent<void>\n }\n}\n\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n if (this.#dismissScheme === 'remove') {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\n\n this.dispatchEvent(new CustomEvent('banner:dismiss'))\n }\n\n show() {\n this.style.setProperty('display', 'initial')\n }\n\n hide() {\n this.style.setProperty('display', 'none')\n }\n\n get #dismissScheme(): string {\n return this.getAttribute('data-dismiss-scheme')!\n }\n}\n\ndeclare global {\n interface Window {\n XBannerElement: typeof XBannerElement\n }\n}\n\nif (!window.customElements.get('x-banner')) {\n window.XBannerElement = XBannerElement\n window.customElements.define('x-banner', XBannerElement)\n}\n","export default class Combobox {\n constructor(input, list, { tabInsertsSuggestions, defaultFirstOption } = {}) {\n this.input = input;\n this.list = list;\n this.tabInsertsSuggestions = tabInsertsSuggestions !== null && tabInsertsSuggestions !== void 0 ? tabInsertsSuggestions : true;\n this.defaultFirstOption = defaultFirstOption !== null && defaultFirstOption !== void 0 ? defaultFirstOption : false;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random().toString().slice(2, 6)}`;\n }\n this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n this.indicateDefaultOption();\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n indicateDefaultOption() {\n var _a;\n if (this.defaultFirstOption) {\n (_a = Array.from(this.list.querySelectorAll('[role=\"option\"]:not([aria-disabled=\"true\"])'))\n .filter(visible)[0]) === null || _a === void 0 ? void 0 : _a.setAttribute('data-combobox-option-default', 'true');\n }\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n el.removeAttribute('data-combobox-option-default');\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.removeAttribute('aria-selected');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.removeAttribute('aria-selected');\n }\n this.indicateDefaultOption();\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!combobox.ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n if (combobox.tabInsertsSuggestions && commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target, { event });\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"], [data-combobox-option-default=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target, detail) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true, detail }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\nimport debounce from './debounce.js';\nconst SCREEN_READER_DELAY = window.testScreenReaderDelay || 100;\nexport default class Autocomplete {\n constructor(container, input, results, autoselectEnabled = false) {\n var _a;\n this.container = container;\n this.input = input;\n this.results = results;\n this.combobox = new Combobox(input, results, {\n defaultFirstOption: autoselectEnabled,\n });\n this.feedback = container.getRootNode().getElementById(`${this.results.id}-feedback`);\n this.autoselectEnabled = autoselectEnabled;\n this.clearButton = container.getRootNode().getElementById(`${this.input.id || this.input.name}-clear`);\n this.clientOptions = results.querySelectorAll('[role=option]');\n if (this.feedback) {\n this.feedback.setAttribute('aria-live', 'polite');\n this.feedback.setAttribute('aria-atomic', 'true');\n }\n if (this.clearButton && !this.clearButton.getAttribute('aria-label')) {\n const labelElem = document.querySelector(`label[for=\"${this.input.name}\"]`);\n this.clearButton.setAttribute('aria-label', `clear:`);\n this.clearButton.setAttribute('aria-labelledby', `${this.clearButton.id} ${(labelElem === null || labelElem === void 0 ? void 0 : labelElem.id) || ''}`);\n }\n if (!this.input.getAttribute('aria-expanded')) {\n this.input.setAttribute('aria-expanded', 'false');\n }\n if (this.results.popover) {\n if (this.results.matches(':popover-open')) {\n this.results.hidePopover();\n }\n }\n else {\n this.results.hidden = true;\n }\n if (!this.results.getAttribute('aria-label')) {\n this.results.setAttribute('aria-label', 'results');\n }\n this.input.setAttribute('autocomplete', 'off');\n this.input.setAttribute('spellcheck', 'false');\n this.interactingWithList = false;\n this.onInputChange = debounce(this.onInputChange.bind(this), 300);\n this.onResultsMouseDown = this.onResultsMouseDown.bind(this);\n this.onInputBlur = this.onInputBlur.bind(this);\n this.onInputFocus = this.onInputFocus.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onCommit = this.onCommit.bind(this);\n this.handleClear = this.handleClear.bind(this);\n this.input.addEventListener('keydown', this.onKeydown);\n this.input.addEventListener('focus', this.onInputFocus);\n this.input.addEventListener('blur', this.onInputBlur);\n this.input.addEventListener('input', this.onInputChange);\n this.results.addEventListener('mousedown', this.onResultsMouseDown);\n this.results.addEventListener('combobox-commit', this.onCommit);\n (_a = this.clearButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleClear);\n }\n destroy() {\n this.input.removeEventListener('keydown', this.onKeydown);\n this.input.removeEventListener('focus', this.onInputFocus);\n this.input.removeEventListener('blur', this.onInputBlur);\n this.input.removeEventListener('input', this.onInputChange);\n this.results.removeEventListener('mousedown', this.onResultsMouseDown);\n this.results.removeEventListener('combobox-commit', this.onCommit);\n }\n handleClear(event) {\n event.preventDefault();\n if (this.input.getAttribute('aria-expanded') === 'true') {\n this.input.setAttribute('aria-expanded', 'false');\n this.updateFeedbackForScreenReaders('Results hidden.');\n }\n this.input.value = '';\n this.container.value = '';\n this.input.focus();\n this.input.dispatchEvent(new Event('change'));\n this.close();\n }\n onKeydown(event) {\n if (event.key === 'Escape' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowUp' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowDown' && !this.container.open) {\n if (!this.input.value.trim())\n return;\n this.open();\n event.stopPropagation();\n event.preventDefault();\n }\n }\n onInputFocus() {\n if (this.interactingWithList)\n return;\n this.fetchResults();\n }\n onInputBlur() {\n if (this.interactingWithList)\n return;\n this.close();\n }\n onCommit({ target }) {\n const selected = target;\n if (!(selected instanceof HTMLElement))\n return;\n this.close();\n if (selected instanceof HTMLAnchorElement)\n return;\n const value = selected.getAttribute('data-autocomplete-value') || selected.textContent;\n this.updateFeedbackForScreenReaders(`${selected.textContent || ''} selected.`);\n this.container.value = value;\n if (!value) {\n this.updateFeedbackForScreenReaders(`Results hidden.`);\n }\n }\n onResultsMouseDown() {\n this.interactingWithList = true;\n }\n onInputChange() {\n if (this.feedback && this.feedback.textContent) {\n this.feedback.textContent = '';\n }\n this.container.removeAttribute('value');\n this.fetchResults();\n }\n identifyOptions() {\n let id = 0;\n for (const el of this.results.querySelectorAll('[role=\"option\"]:not([id])')) {\n el.id = `${this.results.id}-option-${id++}`;\n }\n }\n updateFeedbackForScreenReaders(inputString) {\n setTimeout(() => {\n if (this.feedback) {\n this.feedback.textContent = inputString;\n }\n }, SCREEN_READER_DELAY);\n }\n fetchResults() {\n const query = this.input.value.trim();\n if (!query && !this.container.fetchOnEmpty) {\n this.close();\n return;\n }\n const src = this.container.src;\n if (!src)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search.slice(1));\n params.append('q', query);\n url.search = params.toString();\n this.container.dispatchEvent(new CustomEvent('loadstart'));\n this.container\n .fetchResult(url)\n .then(html => {\n this.results.innerHTML = html;\n this.identifyOptions();\n this.combobox.indicateDefaultOption();\n const allNewOptions = this.results.querySelectorAll('[role=\"option\"]');\n const hasResults = !!allNewOptions.length;\n const numOptions = allNewOptions.length;\n const [firstOption] = allNewOptions;\n const firstOptionValue = firstOption === null || firstOption === void 0 ? void 0 : firstOption.textContent;\n if (this.autoselectEnabled && firstOptionValue) {\n this.updateFeedbackForScreenReaders(`${numOptions} results. ${firstOptionValue} is the top result: Press Enter to activate.`);\n }\n else {\n this.updateFeedbackForScreenReaders(`${numOptions || 'No'} results.`);\n }\n hasResults ? this.open() : this.close();\n this.container.dispatchEvent(new CustomEvent('load'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n })\n .catch(() => {\n this.container.dispatchEvent(new CustomEvent('error'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n });\n }\n open() {\n const isHidden = this.results.popover ? !this.results.matches(':popover-open') : this.results.hidden;\n if (isHidden) {\n this.combobox.start();\n if (this.results.popover) {\n this.results.showPopover();\n }\n else {\n this.results.hidden = false;\n }\n }\n this.container.open = true;\n this.interactingWithList = true;\n }\n close() {\n const isVisible = this.results.popover ? this.results.matches(':popover-open') : !this.results.hidden;\n if (isVisible) {\n this.combobox.stop();\n if (this.results.popover) {\n this.results.hidePopover();\n }\n else {\n this.results.hidden = true;\n }\n }\n this.container.open = false;\n this.interactingWithList = false;\n }\n}\n","export default function debounce(callback, wait = 0) {\n let timeout;\n return function (...Rest) {\n clearTimeout(timeout);\n timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n callback(...Rest);\n }, wait);\n };\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar _AutoCompleteElement_instances, _AutoCompleteElement_forElement, _AutoCompleteElement_inputElement, _AutoCompleteElement_reattachState, _AutoCompleteElement_requestController;\nimport Autocomplete from './autocomplete.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nexport class AutoCompleteEvent extends Event {\n constructor(type, _a) {\n var { relatedTarget } = _a, init = __rest(_a, [\"relatedTarget\"]);\n super(type, init);\n this.relatedTarget = relatedTarget;\n }\n}\nconst state = new WeakMap();\nlet cspTrustedTypesPolicyPromise = null;\nexport class AutoCompleteElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCompleteElement_instances.add(this);\n _AutoCompleteElement_forElement.set(this, null);\n _AutoCompleteElement_inputElement.set(this, null);\n _AutoCompleteElement_requestController.set(this, void 0);\n }\n static define(tag = 'auto-complete', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n get forElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\");\n }\n const id = this.getAttribute('for');\n const root = this.getRootNode();\n if (id && (root instanceof Document || root instanceof ShadowRoot)) {\n return root.getElementById(id);\n }\n return null;\n }\n set forElement(element) {\n __classPrivateFieldSet(this, _AutoCompleteElement_forElement, element, \"f\");\n this.setAttribute('for', '');\n }\n get inputElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\");\n }\n return this.querySelector('input');\n }\n set inputElement(input) {\n __classPrivateFieldSet(this, _AutoCompleteElement_inputElement, input, \"f\");\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n connectedCallback() {\n if (!this.isConnected)\n return;\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n new MutationObserver(() => {\n if (!state.get(this)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n }).observe(this, { subtree: true, childList: true });\n }\n disconnectedCallback() {\n const autocomplete = state.get(this);\n if (autocomplete) {\n autocomplete.destroy();\n state.delete(this);\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(value) {\n this.setAttribute('value', value);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n }\n else {\n this.removeAttribute('open');\n }\n }\n get fetchOnEmpty() {\n return this.hasAttribute('fetch-on-empty');\n }\n set fetchOnEmpty(fetchOnEmpty) {\n this.toggleAttribute('fetch-on-empty', fetchOnEmpty);\n }\n async fetchResult(url) {\n var _a;\n (_a = __classPrivateFieldGet(this, _AutoCompleteElement_requestController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n const { signal } = (__classPrivateFieldSet(this, _AutoCompleteElement_requestController, new AbortController(), \"f\"));\n const res = await fetch(url.toString(), {\n signal,\n headers: {\n Accept: 'text/fragment+html',\n },\n });\n if (!res.ok) {\n throw new Error(await res.text());\n }\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n return cspTrustedTypesPolicy.createHTML(await res.text(), res);\n }\n return await res.text();\n }\n static get observedAttributes() {\n return ['open', 'value', 'for'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n var _a, _b;\n if (oldValue === newValue)\n return;\n const autocomplete = state.get(this);\n if (!autocomplete)\n return;\n if (this.forElement !== ((_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.results) || this.inputElement !== ((_b = state.get(this)) === null || _b === void 0 ? void 0 : _b.input)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n switch (name) {\n case 'open':\n newValue === null ? autocomplete.close() : autocomplete.open();\n break;\n case 'value':\n if (newValue !== null) {\n autocomplete.input.value = newValue;\n }\n this.dispatchEvent(new AutoCompleteEvent('auto-complete-change', {\n bubbles: true,\n relatedTarget: autocomplete.input,\n }));\n break;\n }\n }\n}\n_AutoCompleteElement_forElement = new WeakMap(), _AutoCompleteElement_inputElement = new WeakMap(), _AutoCompleteElement_requestController = new WeakMap(), _AutoCompleteElement_instances = new WeakSet(), _AutoCompleteElement_reattachState = function _AutoCompleteElement_reattachState() {\n var _a;\n (_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.destroy();\n const { forElement, inputElement } = this;\n if (!forElement || !inputElement)\n return;\n const autoselectEnabled = this.getAttribute('data-autoselect') === 'true';\n state.set(this, new Autocomplete(this, inputElement, forElement, autoselectEnabled));\n forElement.setAttribute('role', 'listbox');\n};\nexport default AutoCompleteElement;\n","import { AutoCompleteElement } from './auto-complete-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutocompleteElement = root.AutoCompleteElement = AutoCompleteElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCompleteElement;\nexport * from './auto-complete-element.js';\n","function createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\nexport function copyNode(node) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(node.textContent || '');\n }\n const selection = getSelection();\n if (selection == null) {\n return Promise.reject(new Error());\n }\n selection.removeAllRanges();\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n document.execCommand('copy');\n selection.removeAllRanges();\n return Promise.resolve();\n}\nexport function copyText(text) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(text);\n }\n const body = document.body;\n if (!body) {\n return Promise.reject(new Error());\n }\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n","import { copyNode, copyText } from './clipboard.js';\nasync function copy(button) {\n const id = button.getAttribute('for');\n const text = button.getAttribute('value');\n function trigger() {\n button.dispatchEvent(new CustomEvent('clipboard-copy', { bubbles: true }));\n }\n if (button.getAttribute('aria-disabled') === 'true') {\n return;\n }\n if (text) {\n await copyText(text);\n trigger();\n }\n else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot)))\n return;\n const node = root.getElementById(id);\n if (node) {\n await copyTarget(node);\n trigger();\n }\n }\n}\nfunction copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement) {\n return copyText(content.value);\n }\n else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n }\n else {\n return copyNode(content);\n }\n}\nfunction clicked(event) {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n copy(button);\n }\n}\nfunction keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n event.preventDefault();\n copy(button);\n }\n }\n}\nfunction focused(event) {\n ;\n event.currentTarget.addEventListener('keydown', keydown);\n}\nfunction blurred(event) {\n ;\n event.currentTarget.removeEventListener('keydown', keydown);\n}\nexport class ClipboardCopyElement extends HTMLElement {\n static define(tag = 'clipboard-copy', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n constructor() {\n super();\n this.addEventListener('click', clicked);\n this.addEventListener('focus', focused);\n this.addEventListener('blur', blurred);\n }\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(text) {\n this.setAttribute('value', text);\n }\n}\n","import { ClipboardCopyElement } from './clipboard-copy-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.ClipboardCopyElement = ClipboardCopyElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default ClipboardCopyElement;\nexport * from './clipboard-copy-element.js';\n","import '@github/clipboard-copy-element'\n\nconst CLIPBOARD_COPY_TIMER_DURATION = 2000\n\nfunction showSVG(svg: SVGElement) {\n svg.style.display = 'inline-block'\n}\n\nfunction hideSVG(svg: SVGElement) {\n svg.style.display = 'none'\n}\n\n// Toggle a copy button.\nfunction showCopy(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n showSVG(copyIcon)\n hideSVG(checkIcon)\n}\n\n// Toggle a copy button.\nfunction showCheck(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n hideSVG(copyIcon)\n showSVG(checkIcon)\n}\n\nconst clipboardCopyElementTimers = new WeakMap<HTMLElement, number>()\n\ndocument.addEventListener('clipboard-copy', ({target}) => {\n if (!(target instanceof HTMLElement)) return\n if (!target.hasAttribute('data-view-component')) return\n\n const currentTimeout = clipboardCopyElementTimers.get(target)\n const clipboardCopyLiveRegion = target.parentNode?.querySelector<HTMLElement>('[data-clipboard-copy-feedback]')\n const copiedAnnouncement = 'Copied!'\n\n if (currentTimeout) {\n clearTimeout(currentTimeout)\n clipboardCopyElementTimers.delete(target)\n } else {\n showCheck(target)\n if (clipboardCopyLiveRegion) {\n if (clipboardCopyLiveRegion.textContent === copiedAnnouncement) {\n /* This is a hack due to the way the aria live API works.\n A screen reader will not read a live region again\n if the text is the same. Adding a space character tells\n the browser that the live region has updated,\n which will cause it to read again, but with no audible difference. */\n clipboardCopyLiveRegion.textContent = `${copiedAnnouncement}\\u00A0`\n } else {\n clipboardCopyLiveRegion.textContent = copiedAnnouncement\n }\n }\n }\n\n clipboardCopyElementTimers.set(\n target,\n setTimeout(() => {\n showCopy(target)\n clipboardCopyElementTimers.delete(target)\n }, CLIPBOARD_COPY_TIMER_DURATION),\n )\n})\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _DurationFormat_options;\nclass ListFormatPonyFill {\n formatToParts(members) {\n const parts = [];\n for (const value of members) {\n parts.push({ type: 'element', value });\n parts.push({ type: 'literal', value: ', ' });\n }\n return parts.slice(0, -1);\n }\n}\nconst ListFormat = (typeof Intl !== 'undefined' && Intl.ListFormat) || ListFormatPonyFill;\nconst partsTable = [\n ['years', 'year'],\n ['months', 'month'],\n ['weeks', 'week'],\n ['days', 'day'],\n ['hours', 'hour'],\n ['minutes', 'minute'],\n ['seconds', 'second'],\n ['milliseconds', 'millisecond'],\n];\nconst twoDigitFormatOptions = { minimumIntegerDigits: 2 };\nexport default class DurationFormat {\n constructor(locale, options = {}) {\n _DurationFormat_options.set(this, void 0);\n let style = String(options.style || 'short');\n if (style !== 'long' && style !== 'short' && style !== 'narrow' && style !== 'digital')\n style = 'short';\n let prevStyle = style === 'digital' ? 'numeric' : style;\n const hours = options.hours || prevStyle;\n prevStyle = hours === '2-digit' ? 'numeric' : hours;\n const minutes = options.minutes || prevStyle;\n prevStyle = minutes === '2-digit' ? 'numeric' : minutes;\n const seconds = options.seconds || prevStyle;\n prevStyle = seconds === '2-digit' ? 'numeric' : seconds;\n const milliseconds = options.milliseconds || prevStyle;\n __classPrivateFieldSet(this, _DurationFormat_options, {\n locale,\n style,\n years: options.years || style === 'digital' ? 'short' : style,\n yearsDisplay: options.yearsDisplay === 'always' ? 'always' : 'auto',\n months: options.months || style === 'digital' ? 'short' : style,\n monthsDisplay: options.monthsDisplay === 'always' ? 'always' : 'auto',\n weeks: options.weeks || style === 'digital' ? 'short' : style,\n weeksDisplay: options.weeksDisplay === 'always' ? 'always' : 'auto',\n days: options.days || style === 'digital' ? 'short' : style,\n daysDisplay: options.daysDisplay === 'always' ? 'always' : 'auto',\n hours,\n hoursDisplay: options.hoursDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n minutes,\n minutesDisplay: options.minutesDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n seconds,\n secondsDisplay: options.secondsDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n milliseconds,\n millisecondsDisplay: options.millisecondsDisplay === 'always' ? 'always' : 'auto',\n }, \"f\");\n }\n resolvedOptions() {\n return __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n }\n formatToParts(duration) {\n const list = [];\n const options = __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n const style = options.style;\n const locale = options.locale;\n for (const [unit, nfUnit] of partsTable) {\n const value = duration[unit];\n if (options[`${unit}Display`] === 'auto' && !value)\n continue;\n const unitStyle = options[unit];\n const nfOpts = unitStyle === '2-digit'\n ? twoDigitFormatOptions\n : unitStyle === 'numeric'\n ? {}\n : { style: 'unit', unit: nfUnit, unitDisplay: unitStyle };\n list.push(new Intl.NumberFormat(locale, nfOpts).format(value));\n }\n return new ListFormat(locale, {\n type: 'unit',\n style: style === 'digital' ? 'short' : style,\n }).formatToParts(list);\n }\n format(duration) {\n return this.formatToParts(duration)\n .map(p => p.value)\n .join('');\n }\n}\n_DurationFormat_options = new WeakMap();\n","import DurationFormat from './duration-format-ponyfill.js';\nconst durationRe = /^[-+]?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?$/;\nexport const unitNames = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport const isDuration = (str) => durationRe.test(str);\nexport class Duration {\n constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0) {\n this.years = years;\n this.months = months;\n this.weeks = weeks;\n this.days = days;\n this.hours = hours;\n this.minutes = minutes;\n this.seconds = seconds;\n this.milliseconds = milliseconds;\n this.years || (this.years = 0);\n this.sign || (this.sign = Math.sign(this.years));\n this.months || (this.months = 0);\n this.sign || (this.sign = Math.sign(this.months));\n this.weeks || (this.weeks = 0);\n this.sign || (this.sign = Math.sign(this.weeks));\n this.days || (this.days = 0);\n this.sign || (this.sign = Math.sign(this.days));\n this.hours || (this.hours = 0);\n this.sign || (this.sign = Math.sign(this.hours));\n this.minutes || (this.minutes = 0);\n this.sign || (this.sign = Math.sign(this.minutes));\n this.seconds || (this.seconds = 0);\n this.sign || (this.sign = Math.sign(this.seconds));\n this.milliseconds || (this.milliseconds = 0);\n this.sign || (this.sign = Math.sign(this.milliseconds));\n this.blank = this.sign === 0;\n }\n abs() {\n return new Duration(Math.abs(this.years), Math.abs(this.months), Math.abs(this.weeks), Math.abs(this.days), Math.abs(this.hours), Math.abs(this.minutes), Math.abs(this.seconds), Math.abs(this.milliseconds));\n }\n static from(durationLike) {\n var _a;\n if (typeof durationLike === 'string') {\n const str = String(durationLike).trim();\n const factor = str.startsWith('-') ? -1 : 1;\n const parsed = (_a = str\n .match(durationRe)) === null || _a === void 0 ? void 0 : _a.slice(1).map(x => (Number(x) || 0) * factor);\n if (!parsed)\n return new Duration();\n return new Duration(...parsed);\n }\n else if (typeof durationLike === 'object') {\n const { years, months, weeks, days, hours, minutes, seconds, milliseconds } = durationLike;\n return new Duration(years, months, weeks, days, hours, minutes, seconds, milliseconds);\n }\n throw new RangeError('invalid duration');\n }\n static compare(one, two) {\n const now = Date.now();\n const oneApplied = Math.abs(applyDuration(now, Duration.from(one)).getTime() - now);\n const twoApplied = Math.abs(applyDuration(now, Duration.from(two)).getTime() - now);\n return oneApplied > twoApplied ? -1 : oneApplied < twoApplied ? 1 : 0;\n }\n toLocaleString(locale, opts) {\n return new DurationFormat(locale, opts).format(this);\n }\n}\nexport function applyDuration(date, duration) {\n const r = new Date(date);\n r.setFullYear(r.getFullYear() + duration.years);\n r.setMonth(r.getMonth() + duration.months);\n r.setDate(r.getDate() + duration.weeks * 7 + duration.days);\n r.setHours(r.getHours() + duration.hours);\n r.setMinutes(r.getMinutes() + duration.minutes);\n r.setSeconds(r.getSeconds() + duration.seconds);\n return r;\n}\nexport function elapsedTime(date, precision = 'second', now = Date.now()) {\n const delta = date.getTime() - now;\n if (delta === 0)\n return new Duration();\n const sign = Math.sign(delta);\n const ms = Math.abs(delta);\n const sec = Math.floor(ms / 1000);\n const min = Math.floor(sec / 60);\n const hr = Math.floor(min / 60);\n const day = Math.floor(hr / 24);\n const month = Math.floor(day / 30);\n const year = Math.floor(month / 12);\n const i = unitNames.indexOf(precision) || unitNames.length;\n return new Duration(i >= 0 ? year * sign : 0, i >= 1 ? (month - year * 12) * sign : 0, 0, i >= 3 ? (day - month * 30) * sign : 0, i >= 4 ? (hr - day * 24) * sign : 0, i >= 5 ? (min - hr * 60) * sign : 0, i >= 6 ? (sec - min * 60) * sign : 0, i >= 7 ? (ms - sec * 1000) * sign : 0);\n}\nexport function roundToSingleUnit(duration, { relativeTo = Date.now() } = {}) {\n relativeTo = new Date(relativeTo);\n if (duration.blank)\n return duration;\n const sign = duration.sign;\n let years = Math.abs(duration.years);\n let months = Math.abs(duration.months);\n let weeks = Math.abs(duration.weeks);\n let days = Math.abs(duration.days);\n let hours = Math.abs(duration.hours);\n let minutes = Math.abs(duration.minutes);\n let seconds = Math.abs(duration.seconds);\n let milliseconds = Math.abs(duration.milliseconds);\n if (milliseconds >= 900)\n seconds += Math.round(milliseconds / 1000);\n if (seconds || minutes || hours || days || weeks || months || years) {\n milliseconds = 0;\n }\n if (seconds >= 55)\n minutes += Math.round(seconds / 60);\n if (minutes || hours || days || weeks || months || years)\n seconds = 0;\n if (minutes >= 55)\n hours += Math.round(minutes / 60);\n if (hours || days || weeks || months || years)\n minutes = 0;\n if (days && hours >= 12)\n days += Math.round(hours / 24);\n if (!days && hours >= 21)\n days += Math.round(hours / 24);\n if (days || weeks || months || years)\n hours = 0;\n const currentYear = relativeTo.getFullYear();\n const currentMonth = relativeTo.getMonth();\n const currentDate = relativeTo.getDate();\n if (days >= 27 || years + months + days) {\n const newMonthDate = new Date(relativeTo);\n newMonthDate.setDate(1);\n newMonthDate.setMonth(currentMonth + months * sign + 1);\n newMonthDate.setDate(0);\n const monthDateCorrection = Math.max(0, currentDate - newMonthDate.getDate());\n const newDate = new Date(relativeTo);\n newDate.setFullYear(currentYear + years * sign);\n newDate.setDate(currentDate - monthDateCorrection);\n newDate.setMonth(currentMonth + months * sign);\n newDate.setDate(currentDate - monthDateCorrection + days * sign);\n const yearDiff = newDate.getFullYear() - relativeTo.getFullYear();\n const monthDiff = newDate.getMonth() - relativeTo.getMonth();\n const daysDiff = Math.abs(Math.round((Number(newDate) - Number(relativeTo)) / 86400000)) + monthDateCorrection;\n const monthsDiff = Math.abs(yearDiff * 12 + monthDiff);\n if (daysDiff < 27) {\n if (days >= 6) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n else {\n days = daysDiff;\n }\n months = years = 0;\n }\n else if (monthsDiff < 11) {\n months = monthsDiff;\n years = 0;\n }\n else {\n months = 0;\n years = yearDiff * sign;\n }\n if (months || years)\n days = 0;\n }\n if (years)\n months = 0;\n if (weeks >= 4)\n months += Math.round(weeks / 4);\n if (months || years)\n weeks = 0;\n if (days && weeks && !months && !years) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n return new Duration(years * sign, months * sign, weeks * sign, days * sign, hours * sign, minutes * sign, seconds * sign, milliseconds * sign);\n}\nexport function getRelativeTimeUnit(duration, opts) {\n const rounded = roundToSingleUnit(duration, opts);\n if (rounded.blank)\n return [0, 'second'];\n for (const unit of unitNames) {\n if (unit === 'millisecond')\n continue;\n const val = rounded[`${unit}s`];\n if (val)\n return [val, unit];\n }\n return [0, 'second'];\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _RelativeTimeElement_instances, _RelativeTimeElement_customTitle, _RelativeTimeElement_updating, _RelativeTimeElement_lang_get, _RelativeTimeElement_renderRoot, _RelativeTimeElement_getFormattedTitle, _RelativeTimeElement_resolveFormat, _RelativeTimeElement_getDurationFormat, _RelativeTimeElement_getRelativeFormat, _RelativeTimeElement_getDateTimeFormat, _RelativeTimeElement_onRelativeTimeUpdated;\nimport { Duration, elapsedTime, getRelativeTimeUnit, isDuration, roundToSingleUnit, unitNames } from './duration.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nconst emptyDuration = new Duration();\nconst microEmptyDuration = new Duration(0, 0, 0, 0, 0, 1);\nexport class RelativeTimeUpdatedEvent extends Event {\n constructor(oldText, newText, oldTitle, newTitle) {\n super('relative-time-updated', { bubbles: true, composed: true });\n this.oldText = oldText;\n this.newText = newText;\n this.oldTitle = oldTitle;\n this.newTitle = newTitle;\n }\n}\nfunction getUnitFactor(el) {\n if (!el.date)\n return Infinity;\n if (el.format === 'duration' || el.format === 'elapsed') {\n const precision = el.precision;\n if (precision === 'second') {\n return 1000;\n }\n else if (precision === 'minute') {\n return 60 * 1000;\n }\n }\n const ms = Math.abs(Date.now() - el.date.getTime());\n if (ms < 60 * 1000)\n return 1000;\n if (ms < 60 * 60 * 1000)\n return 60 * 1000;\n return 60 * 60 * 1000;\n}\nconst dateObserver = new (class {\n constructor() {\n this.elements = new Set();\n this.time = Infinity;\n this.timer = -1;\n }\n observe(element) {\n if (this.elements.has(element))\n return;\n this.elements.add(element);\n const date = element.date;\n if (date && date.getTime()) {\n const ms = getUnitFactor(element);\n const time = Date.now() + ms;\n if (time < this.time) {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => this.update(), ms);\n this.time = time;\n }\n }\n }\n unobserve(element) {\n if (!this.elements.has(element))\n return;\n this.elements.delete(element);\n }\n update() {\n clearTimeout(this.timer);\n if (!this.elements.size)\n return;\n let nearestDistance = Infinity;\n for (const timeEl of this.elements) {\n nearestDistance = Math.min(nearestDistance, getUnitFactor(timeEl));\n timeEl.update();\n }\n this.time = Math.min(60 * 60 * 1000, nearestDistance);\n this.timer = setTimeout(() => this.update(), this.time);\n this.time += Date.now();\n }\n})();\nexport class RelativeTimeElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _RelativeTimeElement_instances.add(this);\n _RelativeTimeElement_customTitle.set(this, false);\n _RelativeTimeElement_updating.set(this, false);\n _RelativeTimeElement_renderRoot.set(this, this.shadowRoot ? this.shadowRoot : this.attachShadow ? this.attachShadow({ mode: 'open' }) : this);\n _RelativeTimeElement_onRelativeTimeUpdated.set(this, null);\n }\n static define(tag = 'relative-time', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static get observedAttributes() {\n return [\n 'second',\n 'minute',\n 'hour',\n 'weekday',\n 'day',\n 'month',\n 'year',\n 'time-zone-name',\n 'prefix',\n 'threshold',\n 'tense',\n 'precision',\n 'format',\n 'format-style',\n 'no-title',\n 'datetime',\n 'lang',\n 'title',\n ];\n }\n get onRelativeTimeUpdated() {\n return __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\");\n }\n set onRelativeTimeUpdated(listener) {\n if (__classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\")) {\n this.removeEventListener('relative-time-updated', __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\"));\n }\n __classPrivateFieldSet(this, _RelativeTimeElement_onRelativeTimeUpdated, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('relative-time-updated', listener);\n }\n }\n get second() {\n const second = this.getAttribute('second');\n if (second === 'numeric' || second === '2-digit')\n return second;\n }\n set second(value) {\n this.setAttribute('second', value || '');\n }\n get minute() {\n const minute = this.getAttribute('minute');\n if (minute === 'numeric' || minute === '2-digit')\n return minute;\n }\n set minute(value) {\n this.setAttribute('minute', value || '');\n }\n get hour() {\n const hour = this.getAttribute('hour');\n if (hour === 'numeric' || hour === '2-digit')\n return hour;\n }\n set hour(value) {\n this.setAttribute('hour', value || '');\n }\n get weekday() {\n const weekday = this.getAttribute('weekday');\n if (weekday === 'long' || weekday === 'short' || weekday === 'narrow') {\n return weekday;\n }\n if (this.format === 'datetime' && weekday !== '')\n return this.formatStyle;\n }\n set weekday(value) {\n this.setAttribute('weekday', value || '');\n }\n get day() {\n var _a;\n const day = (_a = this.getAttribute('day')) !== null && _a !== void 0 ? _a : 'numeric';\n if (day === 'numeric' || day === '2-digit')\n return day;\n }\n set day(value) {\n this.setAttribute('day', value || '');\n }\n get month() {\n const format = this.format;\n let month = this.getAttribute('month');\n if (month === '')\n return;\n month !== null && month !== void 0 ? month : (month = format === 'datetime' ? this.formatStyle : 'short');\n if (month === 'numeric' || month === '2-digit' || month === 'short' || month === 'long' || month === 'narrow') {\n return month;\n }\n }\n set month(value) {\n this.setAttribute('month', value || '');\n }\n get year() {\n var _a;\n const year = this.getAttribute('year');\n if (year === 'numeric' || year === '2-digit')\n return year;\n if (!this.hasAttribute('year') && new Date().getUTCFullYear() !== ((_a = this.date) === null || _a === void 0 ? void 0 : _a.getUTCFullYear())) {\n return 'numeric';\n }\n }\n set year(value) {\n this.setAttribute('year', value || '');\n }\n get timeZoneName() {\n const name = this.getAttribute('time-zone-name');\n if (name === 'long' ||\n name === 'short' ||\n name === 'shortOffset' ||\n name === 'longOffset' ||\n name === 'shortGeneric' ||\n name === 'longGeneric') {\n return name;\n }\n }\n set timeZoneName(value) {\n this.setAttribute('time-zone-name', value || '');\n }\n get prefix() {\n var _a;\n return (_a = this.getAttribute('prefix')) !== null && _a !== void 0 ? _a : (this.format === 'datetime' ? '' : 'on');\n }\n set prefix(value) {\n this.setAttribute('prefix', value);\n }\n get threshold() {\n const threshold = this.getAttribute('threshold');\n return threshold && isDuration(threshold) ? threshold : 'P30D';\n }\n set threshold(value) {\n this.setAttribute('threshold', value);\n }\n get tense() {\n const tense = this.getAttribute('tense');\n if (tense === 'past')\n return 'past';\n if (tense === 'future')\n return 'future';\n return 'auto';\n }\n set tense(value) {\n this.setAttribute('tense', value);\n }\n get precision() {\n const precision = this.getAttribute('precision');\n if (unitNames.includes(precision))\n return precision;\n if (this.format === 'micro')\n return 'minute';\n return 'second';\n }\n set precision(value) {\n this.setAttribute('precision', value);\n }\n get format() {\n const format = this.getAttribute('format');\n if (format === 'datetime')\n return 'datetime';\n if (format === 'relative')\n return 'relative';\n if (format === 'duration')\n return 'duration';\n if (format === 'micro')\n return 'micro';\n if (format === 'elapsed')\n return 'elapsed';\n return 'auto';\n }\n set format(value) {\n this.setAttribute('format', value);\n }\n get formatStyle() {\n const formatStyle = this.getAttribute('format-style');\n if (formatStyle === 'long')\n return 'long';\n if (formatStyle === 'short')\n return 'short';\n if (formatStyle === 'narrow')\n return 'narrow';\n const format = this.format;\n if (format === 'elapsed' || format === 'micro')\n return 'narrow';\n if (format === 'datetime')\n return 'short';\n return 'long';\n }\n set formatStyle(value) {\n this.setAttribute('format-style', value);\n }\n get noTitle() {\n return this.hasAttribute('no-title');\n }\n set noTitle(value) {\n this.toggleAttribute('no-title', value);\n }\n get datetime() {\n return this.getAttribute('datetime') || '';\n }\n set datetime(value) {\n this.setAttribute('datetime', value);\n }\n get date() {\n const parsed = Date.parse(this.datetime);\n return Number.isNaN(parsed) ? null : new Date(parsed);\n }\n set date(value) {\n this.datetime = (value === null || value === void 0 ? void 0 : value.toISOString()) || '';\n }\n connectedCallback() {\n this.update();\n }\n disconnectedCallback() {\n dateObserver.unobserve(this);\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue === newValue)\n return;\n if (attrName === 'title') {\n __classPrivateFieldSet(this, _RelativeTimeElement_customTitle, newValue !== null && (this.date && __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, this.date)) !== newValue, \"f\");\n }\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_updating, \"f\") && !(attrName === 'title' && __classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\"))) {\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, (async () => {\n await Promise.resolve();\n this.update();\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\n })(), \"f\");\n }\n }\n update() {\n const oldText = __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent || this.textContent || '';\n const oldTitle = this.getAttribute('title') || '';\n let newTitle = oldTitle;\n const date = this.date;\n if (typeof Intl === 'undefined' || !Intl.DateTimeFormat || !date) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = oldText;\n return;\n }\n const now = Date.now();\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\")) {\n newTitle = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, date) || '';\n if (newTitle && !this.noTitle)\n this.setAttribute('title', newTitle);\n }\n const duration = elapsedTime(date, this.precision, now);\n const format = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_resolveFormat).call(this, duration);\n let newText = oldText;\n if (format === 'duration') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDurationFormat).call(this, duration);\n }\n else if (format === 'relative') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getRelativeFormat).call(this, duration);\n }\n else {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDateTimeFormat).call(this, date);\n }\n if (newText) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = newText;\n }\n else if (this.shadowRoot === __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\") && this.textContent) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = this.textContent;\n }\n if (newText !== oldText || newTitle !== oldTitle) {\n this.dispatchEvent(new RelativeTimeUpdatedEvent(oldText, newText, oldTitle, newTitle));\n }\n if (format === 'relative' || format === 'duration') {\n dateObserver.observe(this);\n }\n else {\n dateObserver.unobserve(this);\n }\n }\n}\n_RelativeTimeElement_customTitle = new WeakMap(), _RelativeTimeElement_updating = new WeakMap(), _RelativeTimeElement_renderRoot = new WeakMap(), _RelativeTimeElement_onRelativeTimeUpdated = new WeakMap(), _RelativeTimeElement_instances = new WeakSet(), _RelativeTimeElement_lang_get = function _RelativeTimeElement_lang_get() {\n var _a;\n return (((_a = this.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.getAttribute('lang')) ||\n this.ownerDocument.documentElement.getAttribute('lang') ||\n 'default');\n}, _RelativeTimeElement_getFormattedTitle = function _RelativeTimeElement_getFormattedTitle(date) {\n return new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n }).format(date);\n}, _RelativeTimeElement_resolveFormat = function _RelativeTimeElement_resolveFormat(duration) {\n const format = this.format;\n if (format === 'datetime')\n return 'datetime';\n if (format === 'duration')\n return 'duration';\n if (format === 'elapsed')\n return 'duration';\n if (format === 'micro')\n return 'duration';\n if ((format === 'auto' || format === 'relative') && typeof Intl !== 'undefined' && Intl.RelativeTimeFormat) {\n const tense = this.tense;\n if (tense === 'past' || tense === 'future')\n return 'relative';\n if (Duration.compare(duration, this.threshold) === 1)\n return 'relative';\n }\n return 'datetime';\n}, _RelativeTimeElement_getDurationFormat = function _RelativeTimeElement_getDurationFormat(duration) {\n const locale = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get);\n const format = this.format;\n const style = this.formatStyle;\n const tense = this.tense;\n let empty = emptyDuration;\n if (format === 'micro') {\n duration = roundToSingleUnit(duration);\n empty = microEmptyDuration;\n if ((this.tense === 'past' && duration.sign !== -1) || (this.tense === 'future' && duration.sign !== 1)) {\n duration = microEmptyDuration;\n }\n }\n else if ((tense === 'past' && duration.sign !== -1) || (tense === 'future' && duration.sign !== 1)) {\n duration = empty;\n }\n const display = `${this.precision}sDisplay`;\n if (duration.blank) {\n return empty.toLocaleString(locale, { style, [display]: 'always' });\n }\n return duration.abs().toLocaleString(locale, { style });\n}, _RelativeTimeElement_getRelativeFormat = function _RelativeTimeElement_getRelativeFormat(duration) {\n const relativeFormat = new Intl.RelativeTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n numeric: 'auto',\n style: this.formatStyle,\n });\n const tense = this.tense;\n if (tense === 'future' && duration.sign !== 1)\n duration = emptyDuration;\n if (tense === 'past' && duration.sign !== -1)\n duration = emptyDuration;\n const [int, unit] = getRelativeTimeUnit(duration);\n if (unit === 'second' && int < 10) {\n return relativeFormat.format(0, this.precision === 'millisecond' ? 'second' : this.precision);\n }\n return relativeFormat.format(int, unit);\n}, _RelativeTimeElement_getDateTimeFormat = function _RelativeTimeElement_getDateTimeFormat(date) {\n const formatter = new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n second: this.second,\n minute: this.minute,\n hour: this.hour,\n weekday: this.weekday,\n day: this.day,\n month: this.month,\n year: this.year,\n timeZoneName: this.timeZoneName,\n });\n return `${this.prefix} ${formatter.format(date)}`.trim();\n};\nexport default RelativeTimeElement;\n","import { RelativeTimeElement } from './relative-time-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.RelativeTimeElement = RelativeTimeElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default RelativeTimeElement;\nexport * from './relative-time-element.js';\n","function getTabs(el) {\n return Array.from(el.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]')).filter(tab => tab instanceof HTMLElement && tab.closest(el.tagName) === el);\n}\nfunction getNavigationKeyCodes(vertical) {\n if (vertical) {\n return [\n ['ArrowDown', 'ArrowRight'],\n ['ArrowUp', 'ArrowLeft'],\n ];\n }\n else {\n return [['ArrowRight'], ['ArrowLeft']];\n }\n}\nexport class TabContainerElement extends HTMLElement {\n static define(tag = 'tab-container', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n connectedCallback() {\n this.addEventListener('keydown', (event) => {\n var _a;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.closest(this.tagName) !== this)\n return;\n if (target.getAttribute('role') !== 'tab' && !target.closest('[role=\"tablist\"]'))\n return;\n const tabs = getTabs(this);\n const currentIndex = tabs.indexOf(tabs.find(tab => tab.matches('[aria-selected=\"true\"]')));\n const [incrementKeys, decrementKeys] = getNavigationKeyCodes(((_a = target.closest('[role=\"tablist\"]')) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-orientation')) === 'vertical');\n if (incrementKeys.some(code => event.code === code)) {\n let index = currentIndex + 1;\n if (index >= tabs.length)\n index = 0;\n this.selectTab(index);\n }\n else if (decrementKeys.some(code => event.code === code)) {\n let index = currentIndex - 1;\n if (index < 0)\n index = tabs.length - 1;\n this.selectTab(index);\n }\n else if (event.code === 'Home') {\n this.selectTab(0);\n event.preventDefault();\n }\n else if (event.code === 'End') {\n this.selectTab(tabs.length - 1);\n event.preventDefault();\n }\n });\n this.addEventListener('click', (event) => {\n const tabs = getTabs(this);\n if (!(event.target instanceof Element))\n return;\n if (event.target.closest(this.tagName) !== this)\n return;\n const tab = event.target.closest('[role=\"tab\"]');\n if (!(tab instanceof HTMLElement) || !tab.closest('[role=\"tablist\"]')) {\n return;\n }\n const index = tabs.indexOf(tab);\n this.selectTab(index);\n });\n for (const tab of getTabs(this)) {\n if (!tab.hasAttribute('aria-selected')) {\n tab.setAttribute('aria-selected', 'false');\n }\n if (!tab.hasAttribute('tabindex')) {\n if (tab.getAttribute('aria-selected') === 'true') {\n tab.setAttribute('tabindex', '0');\n }\n else {\n tab.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n selectTab(index) {\n const tabs = getTabs(this);\n const panels = Array.from(this.querySelectorAll('[role=\"tabpanel\"]')).filter(panel => panel.closest(this.tagName) === this);\n if (index > tabs.length - 1) {\n throw new RangeError(`Index \"${index}\" out of bounds`);\n }\n const selectedTab = tabs[index];\n const selectedPanel = panels[index];\n const cancelled = !this.dispatchEvent(new CustomEvent('tab-container-change', {\n bubbles: true,\n cancelable: true,\n detail: { relatedTarget: selectedPanel },\n }));\n if (cancelled)\n return;\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n for (const panel of panels) {\n panel.hidden = true;\n if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {\n panel.setAttribute('tabindex', '0');\n }\n }\n selectedTab.setAttribute('aria-selected', 'true');\n selectedTab.setAttribute('tabindex', '0');\n selectedTab.focus();\n selectedPanel.hidden = false;\n this.dispatchEvent(new CustomEvent('tab-container-changed', {\n bubbles: true,\n detail: { relatedTarget: selectedPanel },\n }));\n }\n}\n","import { TabContainerElement } from './tab-container-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.TabContainerElement = TabContainerElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default TabContainerElement;\nexport * from './tab-container-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, targets} from '@github/catalyst'\n\n@controller\nexport class PrimerMultiInputElement extends HTMLElement {\n @targets fields: HTMLInputElement[]\n\n activateField(name: string) {\n const fieldWithName = this.findField(name)\n if (!fieldWithName) return\n\n for (const field of this.fields) {\n if (field === fieldWithName) continue\n\n field.setAttribute('disabled', 'disabled')\n field.setAttribute('hidden', 'hidden')\n\n field.parentElement?.setAttribute('hidden', 'hidden')\n }\n\n fieldWithName.removeAttribute('disabled')\n fieldWithName.removeAttribute('hidden')\n fieldWithName.parentElement?.removeAttribute('hidden')\n }\n\n private findField(name: string): HTMLElement | null {\n for (const field of this.fields) {\n if (field.getAttribute('data-name') === name) {\n return field\n }\n }\n\n return null\n }\n}\n\ndeclare global {\n interface Window {\n PrimerMultiInputElement: typeof PrimerMultiInputElement\n }\n}\n\nif (!window.customElements.get('primer-multi-input')) {\n Object.assign(window, {PrimerMultiInputElement})\n window.customElements.define('primer-multi-input', PrimerMultiInputElement)\n}\n","export function throttle(callback, wait = 0, { start = true, middle = true, once = false } = {}) {\n let last = 0;\n let timer;\n let cancelled = false;\n function fn(...args) {\n if (cancelled)\n return;\n const delta = Date.now() - last;\n last = Date.now();\n if (start) {\n start = false;\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }\n else if ((middle && delta < wait) || !middle) {\n clearTimeout(timer);\n timer = setTimeout(() => {\n last = Date.now();\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }, !middle ? wait : wait - delta);\n }\n }\n fn.cancel = () => {\n clearTimeout(timer);\n cancelled = true;\n };\n return fn;\n}\nexport function debounce(callback, wait = 0, { start = false, middle = false, once = false } = {}) {\n return throttle(callback, wait, { start, middle, once });\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AutoCheckElement_onloadend;\nimport { debounce } from '@github/mini-throttle';\nvar AllowedHttpMethods;\n(function (AllowedHttpMethods) {\n AllowedHttpMethods[\"GET\"] = \"GET\";\n AllowedHttpMethods[\"POST\"] = \"POST\";\n})(AllowedHttpMethods || (AllowedHttpMethods = {}));\nconst states = new WeakMap();\nclass AutoCheckEvent extends Event {\n constructor(phase) {\n super(`auto-check-${phase}`, { bubbles: true });\n this.phase = phase;\n }\n get detail() {\n return this;\n }\n}\nclass AutoCheckValidationEvent extends AutoCheckEvent {\n constructor(phase, message = '') {\n super(phase);\n this.phase = phase;\n this.message = message;\n this.setValidity = (message) => {\n this.message = message;\n };\n }\n}\nexport class AutoCheckCompleteEvent extends AutoCheckEvent {\n constructor() {\n super('complete');\n }\n}\nexport class AutoCheckSuccessEvent extends AutoCheckEvent {\n constructor(response) {\n super('success');\n this.response = response;\n }\n}\nexport class AutoCheckStartEvent extends AutoCheckValidationEvent {\n constructor() {\n super('start', 'Verifying…');\n }\n}\nexport class AutoCheckErrorEvent extends AutoCheckValidationEvent {\n constructor(response) {\n super('error', 'Validation failed');\n this.response = response;\n }\n}\nexport class AutoCheckSendEvent extends AutoCheckEvent {\n constructor(body) {\n super('send');\n this.body = body;\n }\n}\nexport class AutoCheckElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCheckElement_onloadend.set(this, null);\n }\n static define(tag = 'auto-check', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n get onloadend() {\n return __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\");\n }\n set onloadend(listener) {\n if (__classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\")) {\n this.removeEventListener('loadend', __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\"));\n }\n __classPrivateFieldSet(this, _AutoCheckElement_onloadend, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('loadend', listener);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const checker = debounce(check.bind(null, this), 300);\n const state = { check: checker, controller: null };\n states.set(this, state);\n input.addEventListener('input', setLoadingState);\n input.addEventListener('input', checker);\n input.autocomplete = 'off';\n input.spellcheck = false;\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n input.removeEventListener('input', setLoadingState);\n input.removeEventListener('input', state.check);\n input.setCustomValidity('');\n }\n attributeChangedCallback(name) {\n if (name === 'required') {\n const input = this.input;\n if (!input)\n return;\n input.required = this.required;\n }\n }\n static get observedAttributes() {\n return ['required'];\n }\n get input() {\n return this.querySelector('input');\n }\n get src() {\n const src = this.getAttribute('src');\n if (!src)\n return '';\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n get csrf() {\n const csrfElement = this.querySelector('[data-csrf]');\n return this.getAttribute('csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || '';\n }\n set csrf(value) {\n this.setAttribute('csrf', value);\n }\n get required() {\n return this.hasAttribute('required');\n }\n set required(required) {\n if (required) {\n this.setAttribute('required', '');\n }\n else {\n this.removeAttribute('required');\n }\n }\n get csrfField() {\n return this.getAttribute('csrf-field') || 'authenticity_token';\n }\n set csrfField(value) {\n this.setAttribute('csrf-field', value);\n }\n get httpMethod() {\n return AllowedHttpMethods[this.getAttribute('http-method')] || 'POST';\n }\n}\n_AutoCheckElement_onloadend = new WeakMap();\nfunction setLoadingState(event) {\n const input = event.currentTarget;\n if (!(input instanceof HTMLInputElement))\n return;\n const autoCheckElement = input.closest('auto-check');\n if (!(autoCheckElement instanceof AutoCheckElement))\n return;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const httpMethod = autoCheckElement.httpMethod;\n const state = states.get(autoCheckElement);\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n return;\n }\n const startEvent = new AutoCheckStartEvent();\n input.dispatchEvent(startEvent);\n if (autoCheckElement.required) {\n input.setCustomValidity(startEvent.message);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return {\n signal: null,\n abort() {\n },\n };\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n if (options.method === 'GET') {\n delete options.body;\n }\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new Event('load'));\n el.dispatchEvent(new Event('loadend'));\n return response;\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n el.dispatchEvent(new Event('error'));\n el.dispatchEvent(new Event('loadend'));\n }\n throw error;\n }\n}\nasync function check(autoCheckElement) {\n const input = autoCheckElement.input;\n if (!input) {\n return;\n }\n const csrfField = autoCheckElement.csrfField;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const state = states.get(autoCheckElement);\n const httpMethod = autoCheckElement.httpMethod;\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n if (!input.value.trim()) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n const body = new FormData();\n const url = new URL(src, window.location.origin);\n if (httpMethod === 'POST') {\n body.append(csrfField, csrf);\n body.append('value', input.value);\n }\n else {\n url.search = new URLSearchParams({ value: input.value }).toString();\n }\n input.dispatchEvent(new AutoCheckSendEvent(body));\n if (state.controller) {\n state.controller.abort();\n }\n else {\n autoCheckElement.dispatchEvent(new Event('loadstart'));\n }\n state.controller = makeAbortController();\n try {\n const response = await fetchWithNetworkEvents(autoCheckElement, url.toString(), {\n credentials: 'same-origin',\n signal: state.controller.signal,\n method: httpMethod,\n body,\n });\n if (response.ok) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n input.dispatchEvent(new AutoCheckSuccessEvent(response.clone()));\n }\n else {\n const event = new AutoCheckErrorEvent(response.clone());\n input.dispatchEvent(event);\n if (autoCheckElement.required) {\n input.setCustomValidity(event.message);\n }\n }\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n }\n}\nexport default AutoCheckElement;\n","import { AutoCheckElement } from './auto-check-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutoCheckElement = AutoCheckElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCheckElement;\nexport * from './auto-check-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport '@github/auto-check-element'\nimport type {AutoCheckErrorEvent, AutoCheckSuccessEvent} from '@github/auto-check-element'\nimport {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'auto-check-success': AutoCheckSuccessEvent\n 'auto-check-error': AutoCheckErrorEvent\n }\n}\n\n@controller\nexport class PrimerTextFieldElement extends HTMLElement {\n @target inputElement: HTMLInputElement\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n @target validationSuccessIcon: HTMLElement\n @target validationErrorIcon: HTMLElement\n @target leadingVisual: HTMLElement\n @target leadingSpinner: HTMLElement\n\n #abortController: AbortController | null\n\n connectedCallback(): void {\n this.#abortController?.abort()\n const {signal} = (this.#abortController = new AbortController())\n\n this.addEventListener(\n 'auto-check-success',\n async (event: AutoCheckSuccessEvent) => {\n const message = await event.detail.response.text()\n if (message && message.length > 0) {\n this.setSuccess(message)\n } else {\n this.clearError()\n }\n },\n {signal},\n )\n\n this.addEventListener(\n 'auto-check-error',\n async (event: AutoCheckErrorEvent) => {\n const errorMessage = await event.detail.response.text()\n this.setError(errorMessage)\n },\n {signal},\n )\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n clearContents() {\n this.inputElement.value = ''\n this.inputElement.focus()\n this.inputElement.dispatchEvent(new Event('input', { bubbles: true, cancelable: false }))\n }\n\n clearError(): void {\n this.inputElement.removeAttribute('invalid')\n this.validationElement.hidden = true\n this.validationMessageElement.replaceChildren()\n }\n\n setValidationMessage(message: string): void {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = message\n const fragment = document.importNode(template.content, true)\n this.validationMessageElement.replaceChildren(fragment)\n }\n\n toggleValidationStyling(isError: boolean): void {\n if (isError) {\n this.validationElement.classList.remove('FormControl-inlineValidation--success')\n } else {\n this.validationElement.classList.add('FormControl-inlineValidation--success')\n }\n this.validationSuccessIcon.hidden = isError\n this.validationErrorIcon.hidden = !isError\n this.inputElement.setAttribute('invalid', isError ? 'true' : 'false')\n }\n\n setSuccess(message: string): void {\n this.toggleValidationStyling(false)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n setError(message: string): void {\n this.toggleValidationStyling(true)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n showLeadingSpinner(): void {\n this.leadingSpinner?.removeAttribute('hidden')\n this.leadingVisual?.setAttribute('hidden', '')\n }\n\n hideLeadingSpinner(): void {\n this.leadingSpinner?.setAttribute('hidden', '')\n this.leadingVisual?.removeAttribute('hidden')\n }\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport {controller, target} from '@github/catalyst'\n\n@controller\nexport class ToggleSwitchInputElement extends HTMLElement {\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n\n connectedCallback() {\n this.addEventListener('toggleSwitchError', (event: Event) => {\n this.validationMessageElement.textContent = (event as CustomEvent).detail\n this.validationElement.removeAttribute('hidden')\n })\n\n this.addEventListener('toggleSwitchSuccess', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n\n this.addEventListener('toggleSwitchLoading', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n }\n}\n","import {controller, target} from '@github/catalyst'\nimport '@oddbird/popover-polyfill'\nimport type {IncludeFragmentElement} from '@github/include-fragment-element'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n element: Element\n}\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]']\nconst menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`)\n\n@controller\nexport class ActionMenuElement extends HTMLElement {\n @target\n includeFragment: IncludeFragmentElement\n\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #invokerBeingClicked = false\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get popoverElement(): HTMLElement | null {\n return (this.invokerElement?.popoverTargetElement as HTMLElement) || null\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('[role=menu]')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n const selectedItems = this.querySelectorAll('[aria-checked=true]')\n const results: SelectedItem[] = []\n\n for (const selectedItem of selectedItems) {\n const labelEl = selectedItem.querySelector('.ActionListItem-label')\n\n results.push({\n label: labelEl?.textContent,\n value: selectedItem?.getAttribute('data-value'),\n element: selectedItem,\n })\n }\n\n return results\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusout', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.popoverElement?.addEventListener('toggle', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n\n if (this.includeFragment) {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {\n signal,\n })\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(menuItemSelectors.join(','))\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n handleEvent(event: Event) {\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (event.type === 'toggle' && (event as ToggleEvent).newState === 'open') {\n this.#firstItem?.focus()\n }\n\n if (targetIsInvoker && event.type === 'mousedown') {\n this.#invokerBeingClicked = true\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n this.#invokerBeingClicked = false\n return\n }\n\n if (event.type === 'focusout') {\n if (this.#invokerBeingClicked) return\n\n // Give the browser time to focus the next element\n requestAnimationFrame(() => {\n if (!this.contains(document.activeElement) || document.activeElement === this.invokerElement) {\n this.#handleFocusOut()\n }\n })\n\n return\n }\n\n const item = (event.target as Element).closest(menuItemSelectors.join(','))\n const targetIsItem = item !== null\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n ;(item as HTMLElement).click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'include-fragment-replaced') {\n this.#handleIncludeFragmentReplaced()\n }\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n\n if (this.#isOpen()) {\n this.#hide()\n } else {\n this.#show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n if (this.contains(dialog)) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = 'none'\n }\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n if (this.contains(dialog)) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = ''\n if (this.#isOpen()) {\n this.#hide()\n }\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n const focusInDialog = dialog.contains(activeElement)\n if (lostFocus || focusInClosedMenu || focusInDialog) {\n setTimeout(() => {\n // if the activeElement has changed after a task, then it's likely\n // that other JS has tried to shift focus. We should respect that\n // focus shift as long as it's not back at the document.\n const newActiveElement = this.ownerDocument.activeElement\n if (newActiveElement === activeElement || newActiveElement === this.ownerDocument.body) {\n this.invokerElement?.focus()\n }\n }, 0)\n }\n }\n // a modal <dialog> element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: Element) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // <a> tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.#isOpen()) {\n this.#hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const ariaChecked = item.getAttribute('aria-checked')\n const checked = ariaChecked !== 'true'\n\n if (this.selectVariant === 'single') {\n // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.\n if (checked) {\n item.setAttribute('aria-checked', 'true')\n }\n\n for (const checkedItem of this.querySelectorAll('[aria-checked]')) {\n if (checkedItem !== item) {\n checkedItem.setAttribute('aria-checked', 'false')\n }\n }\n\n this.#setDynamicLabel()\n } else {\n // multi-select mode allows unchecking a checked item\n item.setAttribute('aria-checked', `${checked}`)\n }\n\n this.#updateInput()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n detail: {item: item.parentElement, checked: this.isItemChecked(item.parentElement)},\n }),\n )\n }\n\n #handleIncludeFragmentReplaced() {\n if (this.#firstItem) this.#firstItem.focus()\n this.#softDisableItems()\n }\n\n // Close when focus leaves menu\n #handleFocusOut() {\n this.#hide()\n }\n\n #show() {\n this.popoverElement?.showPopover()\n }\n\n #hide() {\n this.popoverElement?.hidePopover()\n }\n\n #isOpen() {\n return this.popoverElement?.matches(':popover-open')\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel = this.querySelector('[aria-checked=true] .ActionListItem-label')\n if (itemLabel && this.dynamicLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = this.dynamicLabelPrefix\n contentSpan.textContent = itemLabel.textContent || ''\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement | null\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): HTMLElement | null {\n return this.querySelector(menuItemSelectors.join(','))\n }\n\n get items(): HTMLElement[] {\n return Array.from(this.querySelectorAll(menuItemSelectors.join(',')))\n }\n\n getItemById(itemId: string): HTMLElement | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: Element | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: Element | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: Element | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: Element | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n hideItem(item: Element | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n showItem(item: Element | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: Element | null) {\n if (item) {\n return item.querySelector('.ActionListContent')!.getAttribute('aria-checked') === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (!ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n\n uncheckItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n}\n\nif (!window.customElements.get('action-menu')) {\n window.ActionMenuElement = ActionMenuElement\n window.customElements.define('action-menu', ActionMenuElement)\n}\n\ndeclare global {\n interface Window {\n ActionMenuElement: typeof ActionMenuElement\n }\n}\n","import {getAnchoredPosition} from '@primer/behaviors'\nimport {controller, target} from '@github/catalyst'\nimport {announceFromElement, announce} from '../aria_live'\nimport {IncludeFragmentElement} from '@github/include-fragment-element'\nimport type {PrimerTextFieldElement} from 'app/lib/primer/forms/primer_text_field'\nimport type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport '@oddbird/popover-polyfill'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n inputName: string | null | undefined\n}\n\nconst validSelectors = ['[role=\"option\"]']\nconst menuItemSelectors = validSelectors.join(',')\nconst visibleMenuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(',')\n\nexport type SelectPanelItem = HTMLLIElement\n\nenum FetchStrategy {\n REMOTE,\n EVENTUALLY_LOCAL,\n LOCAL,\n}\n\nenum ErrorStateType {\n BODY,\n BANNER,\n}\n\nexport type FilterFn = (item: SelectPanelItem, query: string) => boolean\n\nconst updateWhenVisible = (() => {\n const anchors = new Set<SelectPanelElement>()\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n }\n return (el: SelectPanelElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n el.addEventListener('dialog:close', () => {\n el.invokerElement?.setAttribute('aria-expanded', 'false')\n anchors.delete(el)\n })\n el.addEventListener('dialog:open', () => {\n anchors.add(el)\n })\n }\n})()\n\n@controller\nexport class SelectPanelElement extends HTMLElement {\n @target includeFragment: IncludeFragmentElement\n @target dialog: HTMLDialogElement\n @target filterInputTextField: HTMLInputElement\n @target remoteInput: HTMLElement\n @target list: HTMLElement\n @target ariaLiveContainer: HTMLElement\n @target noResults: HTMLElement\n @target fragmentErrorElement: HTMLElement\n @target bannerErrorElement: HTMLElement\n @target bodySpinner: HTMLElement\n\n filterFn?: FilterFn\n\n #dialogIntersectionObserver: IntersectionObserver\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #selectedItems: Map<string, SelectedItem> = new Map()\n #loadingDelayTimeoutId: number | null = null\n #loadingAnnouncementTimeoutId: number | null = null\n #hasLoadedData = false\n\n get open(): boolean {\n return this.dialog.open\n }\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n get ariaSelectionType(): string {\n return this.selectVariant === 'multiple' ? 'aria-checked' : 'aria-selected'\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n get dynamicAriaLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-aria-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('dialog')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get closeButton(): HTMLButtonElement | null {\n return this.querySelector('button[data-close-dialog-id]')\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n return Array.from(this.#selectedItems.values())\n }\n\n get align(): AnchorAlignment {\n return (this.getAttribute('anchor-align') || 'start') as AnchorAlignment\n }\n\n get side(): AnchorSide {\n return (this.getAttribute('anchor-side') || 'outside-bottom') as AnchorSide\n }\n\n updateAnchorPosition() {\n // If the selectPanel is removed from the screen on resize close the dialog\n if (this && this.offsetParent === null) {\n this.hide()\n }\n\n if (this.invokerElement) {\n const {top, left} = getAnchoredPosition(this.dialog, this.invokerElement, {\n align: this.align,\n side: this.side,\n anchorOffset: 4,\n })\n this.dialog.style.top = `${top}px`\n this.dialog.style.left = `${left}px`\n this.dialog.style.bottom = 'auto'\n this.dialog.style.right = 'auto'\n }\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.addEventListener('input', this, {signal})\n this.addEventListener('remote-input-success', this, {signal})\n this.addEventListener('remote-input-error', this, {signal})\n this.addEventListener('loadstart', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n updateWhenVisible(this)\n\n this.#waitForCondition(\n () => Boolean(this.remoteInput),\n () => {\n this.remoteInput.addEventListener('loadstart', this, {signal})\n this.remoteInput.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#waitForCondition(\n () => Boolean(this.includeFragment),\n () => {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {signal})\n this.includeFragment.addEventListener('error', this, {signal})\n this.includeFragment.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#dialogIntersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const elem = entry.target\n if (entry.isIntersecting && elem === this.dialog) {\n // Focus on the filter input when the dialog opens to work around a Safari limitation\n // that prevents the autofocus attribute from working as it does in other browsers\n if (this.filterInputTextField) {\n if (document.activeElement !== this.filterInputTextField) {\n this.filterInputTextField.focus()\n }\n }\n\n // signal that any focus hijinks are finished (thanks Safari)\n this.dialog.setAttribute('data-ready', 'true')\n\n this.updateAnchorPosition()\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#updateItemVisibility()\n }\n }\n }\n })\n\n this.#waitForCondition(\n () => Boolean(this.dialog),\n () => {\n this.#dialogIntersectionObserver.observe(this.dialog)\n this.dialog.addEventListener('close', this, {signal})\n\n if (this.getAttribute('data-open-on-load') === 'true') {\n this.show()\n }\n },\n )\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#waitForCondition(\n () => this.items.length > 0,\n () => {\n this.#updateItemVisibility()\n this.#updateInput()\n },\n )\n }\n }\n\n // Waits for condition to return true. If it returns false initially, this function creates a\n // MutationObserver that calls body() whenever the contents of the component change.\n #waitForCondition(condition: () => boolean, body: () => void) {\n if (condition()) {\n body()\n } else {\n const mutationObserver = new MutationObserver(() => {\n if (condition()) {\n body()\n mutationObserver.disconnect()\n }\n })\n\n mutationObserver.observe(this, {childList: true, subtree: true})\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // If there is an active item in single-select mode, set its tabindex to 0. Otherwise, set the\n // first visible item's tabindex to 0. All other items should have a tabindex of -1.\n #updateTabIndices() {\n let setZeroTabIndex = false\n\n if (this.selectVariant === 'single') {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n if (!this.isItemHidden(item) && this.isItemChecked(item) && !setZeroTabIndex) {\n itemContent.setAttribute('tabindex', '0')\n setZeroTabIndex = true\n } else {\n itemContent.setAttribute('tabindex', '-1')\n }\n\n // <li> elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n } else {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n itemContent.setAttribute('tabindex', '-1')\n\n // <li> elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n }\n\n if (!setZeroTabIndex && this.#firstItem) {\n this.#getItemContent(this.#firstItem)?.setAttribute('tabindex', '0')\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(visibleMenuItemSelectors)\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n #checkSelectedItems() {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n if (this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'true')\n }\n }\n }\n\n this.#updateInput()\n }\n\n #addSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n this.#selectedItems.set(value, {\n value,\n label: itemContent.querySelector('.ActionListItem-label')?.textContent?.trim(),\n inputName: itemContent.getAttribute('data-input-name'),\n })\n }\n }\n\n #removeSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n if (value) {\n this.#selectedItems.delete(value)\n }\n }\n\n #setTextFieldLoadingSpinnerTimer() {\n if (!this.#filterInputTextFieldElement) return\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n\n this.#loadingAnnouncementTimeoutId = setTimeout(() => {\n announce('Loading', {element: this.ariaLiveContainer})\n }, 2000) as unknown as number\n\n this.#loadingDelayTimeoutId = setTimeout(() => {\n this.#filterInputTextFieldElement?.showLeadingSpinner()\n }, 1000) as unknown as number\n }\n\n handleEvent(event: Event) {\n if (event.target === this.filterInputTextField) {\n this.#handleSearchFieldEvent(event)\n return\n }\n\n if (event.target === this.remoteInput) {\n this.#handleRemoteInputEvent(event)\n return\n }\n\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const targetIsCloseButton = this.closeButton?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (targetIsInvoker && event.type === 'mousedown') {\n return\n }\n\n if (event.type === 'mousedown' && event.target instanceof HTMLInputElement) {\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n return\n }\n\n if (targetIsCloseButton && eventIsActivation) {\n // hide() will automatically be called by dialog event triggered from `data-close-dialog-id`\n return\n }\n\n if (event.target === this.dialog && event.type === 'close') {\n // Remove data-ready so it can be set the next time the panel is opened\n this.dialog.removeAttribute('data-ready')\n this.invokerElement?.setAttribute('aria-expanded', 'false')\n // When we close the dialog, clear the filter input\n\n if (this.filterInputTextField) {\n const fireSearchEvent = this.filterInputTextField.value.length > 0\n this.filterInputTextField.value = ''\n if (fireSearchEvent) {\n this.filterInputTextField.dispatchEvent(new Event('input'))\n }\n }\n\n this.dispatchEvent(\n new CustomEvent('panelClosed', {\n detail: {panel: this},\n bubbles: true,\n }),\n )\n\n return\n }\n\n const item = (event.target as Element).closest(visibleMenuItemSelectors)?.parentElement as\n | SelectPanelItem\n | null\n | undefined\n\n const targetIsItem = item !== null && item !== undefined\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker) && this.contains(dialog)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n this.#getItemContent(item)?.click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'click') {\n const rect = this.dialog.getBoundingClientRect()\n\n const clickWasInsideDialog =\n rect.top <= (event as MouseEvent).clientY &&\n (event as MouseEvent).clientY <= rect.top + rect.height &&\n rect.left <= (event as MouseEvent).clientX &&\n (event as MouseEvent).clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n this.hide()\n }\n }\n\n // The include fragment will have been removed from the DOM by the time\n // the include-fragment-replaced event has been dispatched, so we have to\n // check for the type of the event target manually, since this.includeFragment\n // will be null.\n if (event.target instanceof IncludeFragmentElement) {\n this.#handleIncludeFragmentEvent(event)\n }\n }\n\n #handleIncludeFragmentEvent(event: Event) {\n switch (event.type) {\n case 'include-fragment-replaced': {\n this.#updateItemVisibility()\n break\n }\n\n case 'loadstart': {\n this.#toggleIncludeFragmentElements(false)\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n\n case 'error': {\n this.#toggleIncludeFragmentElements(true)\n\n const errorElement = this.fragmentErrorElement\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\n return\n }\n\n break\n }\n }\n }\n\n #toggleIncludeFragmentElements(showError: boolean) {\n for (const el of this.includeFragment.querySelectorAll('[data-show-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = !showError\n }\n for (const el of this.includeFragment.querySelectorAll('[data-hide-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = showError\n }\n }\n\n #handleRemoteInputEvent(event: Event) {\n switch (event.type) {\n case 'remote-input-success': {\n this.#clearErrorState()\n this.#updateItemVisibility()\n this.#checkSelectedItems()\n break\n }\n\n case 'remote-input-error': {\n this.bodySpinner?.setAttribute('hidden', '')\n\n if (this.includeFragment || this.visibleItems.length === 0) {\n this.#setErrorState(ErrorStateType.BODY)\n } else {\n this.#setErrorState(ErrorStateType.BANNER)\n }\n\n break\n }\n\n case 'loadstart': {\n if (!this.#performFilteringLocally()) {\n this.#clearErrorState()\n this.bodySpinner?.removeAttribute('hidden')\n\n if (this.bodySpinner) break\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n }\n }\n\n #defaultFilterFn(item: HTMLElement, query: string) {\n const text = (item.getAttribute('data-filter-string') || item.textContent || '').toLowerCase()\n return text.indexOf(query.toLowerCase()) > -1\n }\n\n #handleSearchFieldEvent(event: Event) {\n if (event.type === 'keydown') {\n const key = (event as KeyboardEvent).key\n\n if (key === 'Enter') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.click()\n }\n } else if (key === 'ArrowDown') {\n const item = (this.focusableItem || this.#getItemContent(this.visibleItems[0])) as HTMLLIElement\n\n if (item) {\n item.focus()\n event.preventDefault()\n }\n } else if (key === 'Home') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n } else if (key === 'End') {\n if (this.visibleItems.length > 0) {\n const item = this.visibleItems[this.visibleItems.length - 1] as HTMLLIElement\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n }\n }\n\n if (event.type !== 'input') return\n\n // remote-input-element does not trigger another loadstart event if a request is\n // already in-flight, so we use the input event on the text field to reset the\n // loading spinner timer instead\n if (!this.bodySpinner && !this.#performFilteringLocally()) {\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL) {\n if (this.includeFragment) {\n this.includeFragment.refetch()\n return\n }\n\n this.#updateItemVisibility()\n }\n }\n\n #updateItemVisibility() {\n if (!this.list) return\n\n let atLeastOneResult = false\n\n if (this.#performFilteringLocally()) {\n const query = this.filterInputTextField?.value ?? ''\n const filter = this.filterFn || this.#defaultFilterFn\n\n for (const item of this.items) {\n if (filter(item, query)) {\n this.#showItem(item)\n atLeastOneResult = true\n } else {\n this.#hideItem(item)\n }\n }\n } else {\n atLeastOneResult = this.items.length > 0\n }\n\n this.#updateTabIndices()\n this.#maybeAnnounce()\n\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n if (this.#hasLoadedData) {\n if (value && !this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'false')\n }\n } else if (value && !this.#selectedItems.has(value) && this.isItemChecked(item)) {\n this.#addSelectedItem(item)\n }\n }\n\n this.#hasLoadedData = true\n\n if (!this.noResults) return\n\n if (this.#inErrorState()) {\n this.noResults.setAttribute('hidden', '')\n return\n }\n\n if (atLeastOneResult) {\n this.noResults.setAttribute('hidden', '')\n // TODO can we change this to search for `@panelId-list`\n this.list?.querySelector('.ActionListWrap')?.removeAttribute('hidden')\n } else {\n this.list?.querySelector('.ActionListWrap')?.setAttribute('hidden', '')\n this.noResults.removeAttribute('hidden')\n }\n }\n\n #inErrorState(): boolean {\n if (this.fragmentErrorElement && !this.fragmentErrorElement.hasAttribute('hidden')) {\n return true\n }\n\n if (!this.bannerErrorElement) return false\n\n return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY && this.fragmentErrorElement) {\n this.fragmentErrorElement.removeAttribute('hidden')\n this.bannerErrorElement.setAttribute('hidden', '')\n } else {\n errorElement = this.bannerErrorElement\n this.bannerErrorElement?.removeAttribute('hidden')\n this.fragmentErrorElement?.setAttribute('hidden', '')\n }\n\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n announceFromElement(errorElement, {element: this.ariaLiveContainer, assertive: true})\n return\n }\n }\n\n #clearErrorState() {\n this.fragmentErrorElement?.setAttribute('hidden', '')\n this.bannerErrorElement.setAttribute('hidden', '')\n }\n\n #maybeAnnounce() {\n if (this.open && this.list) {\n const items = this.items\n\n if (items.length > 0) {\n const instructions = 'tab for results'\n announce(`${items.length} result${items.length === 1 ? '' : 's'} ${instructions}`, {\n element: this.ariaLiveContainer,\n })\n } else {\n const noResultsEl = this.noResults\n if (noResultsEl) {\n announceFromElement(noResultsEl, {element: this.ariaLiveContainer})\n }\n }\n }\n }\n\n get #fetchStrategy(): FetchStrategy {\n if (!this.list) return FetchStrategy.REMOTE\n\n switch (this.list.getAttribute('data-fetch-strategy')) {\n case 'local':\n return FetchStrategy.LOCAL\n case 'eventually_local':\n return FetchStrategy.EVENTUALLY_LOCAL\n default:\n return FetchStrategy.REMOTE\n }\n }\n\n get #filterInputTextFieldElement(): PrimerTextFieldElement | null {\n return this.filterInputTextField?.closest('primer-text-field') as PrimerTextFieldElement | null\n }\n\n #performFilteringLocally(): boolean {\n return this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n if (this.open) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = 'none'\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = ''\n if (this.open) {\n this.hide()\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n if (lostFocus || focusInClosedMenu) {\n setTimeout(() => this.invokerElement?.focus(), 0)\n }\n }\n // a modal <dialog> element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: SelectPanelItem) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // <a> tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.open) {\n this.hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const currentlyChecked = this.isItemChecked(item)\n const checked = !currentlyChecked\n\n const activationSuccess = this.dispatchEvent(\n new CustomEvent('beforeItemActivated', {\n bubbles: true,\n cancelable: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n\n if (!activationSuccess) return\n\n const itemContent = this.#getItemContent(item)\n\n if (this.selectVariant === 'single') {\n // Don't check anything if we have an href\n if (itemContent?.getAttribute('href')) return\n\n // disallow unchecking checked item in single-select mode\n if (!currentlyChecked) {\n for (const el of this.items) {\n this.#getItemContent(el)?.setAttribute(this.ariaSelectionType, 'false')\n }\n\n this.#selectedItems.clear()\n\n if (checked) {\n this.#addSelectedItem(item)\n itemContent?.setAttribute(this.ariaSelectionType, 'true')\n }\n\n this.#setDynamicLabel()\n }\n } else {\n // multi-select mode allows unchecking a checked item\n itemContent?.setAttribute(this.ariaSelectionType, `${checked}`)\n\n if (checked) {\n this.#addSelectedItem(item)\n } else {\n this.#removeSelectedItem(item)\n }\n }\n\n this.#updateInput()\n this.#updateTabIndices()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n bubbles: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n }\n\n show() {\n this.updateAnchorPosition()\n this.dialog.showModal()\n this.invokerElement?.setAttribute('aria-expanded', 'true')\n const event = new CustomEvent('dialog:open', {\n detail: {dialog: this.dialog},\n })\n this.dispatchEvent(event)\n }\n\n hide() {\n this.dialog.close()\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel =\n this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent || this.#originalLabel\n if (itemLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = `${this.dynamicLabelPrefix} `\n contentSpan.textContent = itemLabel\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n\n if (this.dynamicAriaLabelPrefix) {\n this.invokerElement?.setAttribute('aria-label', `${this.dynamicAriaLabelPrefix} ${itemLabel.trim()}`)\n }\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n if (selectedItem.inputName) input.name = selectedItem.inputName\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = selectedItem.inputName || this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): SelectPanelItem | null {\n return (this.querySelector(visibleMenuItemSelectors)?.parentElement || null) as SelectPanelItem | null\n }\n\n get visibleItems(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(visibleMenuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get items(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(menuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get focusableItem(): HTMLElement | undefined {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n if (itemContent.getAttribute('tabindex') === '0') {\n return itemContent\n }\n }\n }\n\n getItemById(itemId: string): SelectPanelItem | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n this.#getItemContent(item)!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n this.#getItemContent(item)!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n #hideItem(item: SelectPanelItem | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n #showItem(item: SelectPanelItem | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: SelectPanelItem | null) {\n if (item) {\n return this.#getItemContent(item)!.getAttribute(this.ariaSelectionType) === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (!this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n uncheckItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n #getItemContent(item: SelectPanelItem): HTMLElement | null {\n return item.querySelector('.ActionListContent')\n }\n}\n\nif (!window.customElements.get('select-panel')) {\n window.SelectPanelElement = SelectPanelElement\n window.customElements.define('select-panel', SelectPanelElement)\n}\n\ndeclare global {\n interface Window {\n SelectPanelElement: typeof SelectPanelElement\n }\n}\n"],"names":["_IncludeFragmentElement_instances","_IncludeFragmentElement_busy","_IncludeFragmentElement_observer","_IncludeFragmentElement_handleData","_IncludeFragmentElement_getData","_IncludeFragmentElement_getStringOrErrorData","_IncludeFragmentElement_task","_IncludeFragmentElement_fetchDataWithEvents","__classPrivateFieldGet","receiver","state","kind","f","TypeError","has","call","value","get","__classPrivateFieldSet","set","privateData","WeakMap","cspTrustedTypesPolicyPromise","IncludeFragmentElement","HTMLElement","constructor","super","arguments","add","this","IntersectionObserver","entries","entry","isIntersecting","target","unobserve","loading","rootMargin","threshold","static","tag","registry","customElements","define","policy","Promise","resolve","observedAttributes","src","getAttribute","link","ownerDocument","createElement","href","val","setAttribute","accept","data","attributeChangedCallback","attribute","oldVal","isConnected","connectedCallback","shadowRoot","attachShadow","mode","style","document","textContent","append","observe","request","Error","Request","method","credentials","headers","Accept","load","fetch","refetch","delete","WeakSet","async","dataTreatedAsString","template","innerHTML","fragment","importNode","content","dispatchEvent","CustomEvent","cancelable","detail","replaceWith","_a","classList","cachedData","reject","toString","eventsToDispatch","setTimeout","eventType","Event","response","status","ct","split","find","x","match","includes","responseText","text","createHTML","error","root","globalThis","window","e","DOMException","name","ReferenceError","states","RemoteInputElement","fetchResults","bind","currentQuery","oninput","debounce","controller","oldValue","input","addEventListener","disconnectedCallback","removeEventListener","querySelector","HTMLInputElement","HTMLTextAreaElement","url","remoteInput","checkCurrentQuery","event","query","resultsContainer","getElementById","URL","location","params","URLSearchParams","search","abort","AbortController","signal","html","el","options","fetchWithNetworkEvents","removeAttribute","ok","bubbles","type","undefined","callback","timeout","args","clearTimeout","__decorate","decorators","key","desc","d","c","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","controllers","bindShadow","bindElements","listenForBind","observers","closed","observer","MutationObserver","mutations","mutation","Element","bindActions","addedNodes","node","childList","subtree","attributeFilter","subscription","unsubscribe","disconnect","querySelectorAll","hasAttribute","handleEvent","currentTarget","binding","bindings","closest","getRootNode","ShadowRoot","host","matches","shadowController","action","trim","eventSep","lastIndexOf","methodSep","Math","max","slice","dasherize","str","String","description","replace","toLowerCase","mustDasherize","dashed","attrKey","attr","proto","meta","initialized","initializeAttrs","instance","names","getPrototypeOf","prefix","attrPrefix","descriptor","configurable","newValue","Number","toggleAttribute","symbol","Symbol","for","CatalystDelegate","classObject","delegate","prototype","attributes","observed","attrToAttributeName","map","concat","defineObservedAttributes","register","upgrade","element","parentElement","cloneNode","autoShadowRoot","hasOwnProperty","parent","Map","Set","tagName","findTarget","targets","push","findTargets","readyState","once","listenerOptions","passive","handler","ActionListTruncationObserver","resizeObserver","ResizeObserver","update","items","item","label","tooltip","isTruncated","scrollWidth","clientWidth","display","ActionListElement","_ActionListElement_truncationObserver","alternateOrders","alternateAlignments","start","end","center","getAnchoredPosition","floatingElement","anchorElement","settings","test","body","showPopover","_b","isOnTopLayer","parentNode","getComputedStyle","position","getPositionedParent","clippingRect","overflow","clippingNode","elemRect","getBoundingClientRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","v","parseInt","top","left","width","height","innerHeight","Infinity","getClippingRect","parentElementStyle","parentElementRect","viewportRect","relativePosition","floatingRect","anchorRect","side","align","allowOutOfBounds","anchorOffset","alignmentOffset","relativeViewportRect","pos","calculatePosition","anchorSide","anchorAlign","alternateOrder","positionAttempt","prevSide","shouldRecalculatePosition","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","assign","pureCalculateAnchoredPosition","_c","_d","_e","positionDefaults","startsWith","getDefaultSettings","elementDimensions","anchorPosition","anchorRight","anchorBottom","currentPos","containerDimensions","iterateFocusableElements","container","strict","acceptFn","onlyTabbable","isTabbable","isFocusable","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","FILTER_ACCEPT","FILTER_SKIP","nextNode","reverse","lastChild","firstChild","previousNode","getFocusableChild","next","elem","disabledAttrInert","disabled","hiddenInert","hidden","hiddenInputInert","sentinelInert","contains","sizeInert","offsetWidth","offsetHeight","visibilityInert","visibility","displayInert","offsetParent","clientRectsInert","getClientRects","HTMLAnchorElement","tabIndex","signalSupported","noop","create","polyfill","originalAddEventListener","EventTarget","originalCallback","optionsOrCapture","AbortSignal","monkeyPatch","suspendedTrapStack","activeTrap","isMac","focusTrap","initialFocus","abortSignal","sentinelStart","onfocus","lastFocusableChild","focus","sentinelEnd","firstFocusableChild","prepend","sentinels","Array","from","filter","firstElementChild","lastElementChild","insertAdjacentElement","observeFocusTrap","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","wrappingController","followSignal","suspendedTrap","getElementsByClassName","remove","suspendedTrapIndex","findIndex","t","splice","trapToReactivate","pop","originalSignal","tryReactivate","capture","activeElement","isMacOS","navigator","platform","idSeed","FocusKeys","KEY_TO_BIT","ArrowLeft","ArrowHorizontal","ArrowDown","ArrowVertical","ArrowUp","ArrowRight","h","HL","j","JK","k","l","a","AD","s","WS","w","Tab","Home","HomeAndEnd","End","PageUp","PageUpDown","PageDown","Backspace","KEY_TO_DIRECTION","getDirection","keyboardEvent","direction","shiftKey","metaKey","ctrlKey","isActiveDescendantAttribute","hasActiveDescendantAttribute","focusZone","focusableElements","savedTabIndex","bindKeys","getNextFocusable","ArrowAll","focusOutBehavior","focusInStrategy","activeDescendantControl","activeDescendantCallback","onActiveDescendantChanged","currentFocusedElement","preventScroll","getFirstFocusableElement","updateFocusedElement","to","directlyActivated","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","focusableElementFilter","elementsToInsert","firstElementToInsert","iMin","iMax","floor","followsInDocument","findInsertionIndex","first","second","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","endFocusManagement","focusableElementIndex","indexOf","savedIndex","iterateFocusableElementsOptions","removedNode","removedNodes","addedNode","attributeOldValue","elementIndexFocusedByClick","focusableElement","relatedTarget","targetElementIndex","lastKeyboardFocusDirection","targetElement","elementToFocus","console","warn","keyboardEventRecipient","keyBit","defaultPrevented","keyLength","isTextInput","HTMLSelectElement","altKey","textInput","cursorAtStart","selectionStart","selectionEnd","cursorAtEnd","shouldIgnoreFocusHandling","nextElementToFocus","lastFocusedIndex","focusedIndex","getCurrentFocusedIndex","nextFocusedIndex","preventDefault","instersectionObserver","ActionBarElement","ItemType","_ActionBarElement_focusZoneAbortController","marginLeft","marginRight","requestAnimationFrame","menuItemClick","click","firstItem","firstItemTop","previousItemType","_ActionBarElement_instances","_ActionBarElement_eachItem","index","itemTop","Item","_ActionBarElement_hideItem","moreMenu","Divider","_ActionBarElement_showItem","idx","elementIsVisibleItem","elementIsVisibleActionMenuInvoker","invokerElement","foundItem","_index","menuItem","setProperty","DetailsMenuElement","preload","details","summary","subscriptions","fromEvent","trackComposition","shouldCommit","menu","KeyboardEvent","isComposing","isSummaryFocused","close","stopPropagation","sibling","ctrlBindings","selected","isMenuItem","keydown","loadFragment","opened","closeCurrentMenu","NullSubscription","focusOnOpen","loaded","sub","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","found","def","userAgent","menuitem","checked","commit","button","textEl","labelText","contentsEl","labelHTML","updateLabel","checkState","indeterminate","updateChecked","role","updateWhenVisible","anchors","intersectionObserver","updateVisibleAnchors","anchor","documentElement","AnchoredPositionElement","_AnchoredPositionElement_anchorElement","_AnchoredPositionElement_animationFrame","alias","idRef","cancelAnimationFrame","toggle","bottom","right","dialogInvokerButtonHandler","dialogId","dialog","HTMLDialogElement","showModal","fixed","popover","stopImmediatePropagation","open","DialogHelperElement","_DialogHelperElement_abortController","innerWidth","records","record","_DialogHelperElement_instances","_DialogHelperElement_handleDialogOpenAttribute","rect","clientY","clientX","ToggleEvent","oldState","newState","init","popoverToggleTaskQueue","queuePopoverToggleEventTask","topLayerElements","autoPopoverList","visibilityState","getPopoverVisibilityState","popoverInvoker","checkPopoverValidity","expectedToBeShowing","fullscreenElement","getStackPosition","topMostClickedPopover","clickedPopover","nearestInclusiveOpenPopover","invokerPopover","nodePopover","popoverTargetElement","Document","nearestInclusiveTargetPopoverForInvoker","topMostAutoPopover","document2","documentPopovers","assignedSlot","focusTarget","HTMLButtonElement","HTMLOptGroupElement","HTMLOptionElement","HTMLFieldSetElement","popoverFocusingSteps","subject","delegatesFocus","whereToLook","autoFocusDelegate","slots","slot","assignedElements","flatten","descendant","currentNode","focusDelegate","previouslyFocusedElements","shouldRestoreFocus","originalType","hideAllPopoversUntil","newPopover","popoverPositions","topMostPopoverAncestor2","candidate","candidateAncestor","candidatePosition","checkAncestor","topMostPopoverAncestor","originallyFocusedElement","setInvokerAriaExpanded","hidePopover","focusPreviousElement","fireEvents","previouslyFocusedElement","closeAllOpenPopovers","endpoint","lastToHide","foundEndpoint","size","popoverPointerDownTargets","lightDismissOpenPopovers","isTrusted","composedPath","ancestor","sameTarget","initialAriaExpandedValue","force","initialValue","ShadowRoot2","patchSelectorFn","object","mapper","original","selector","nonEscapedPopoverSelector","getStyles","useLayer","CSSLayerBlockRule","popoverStyleSheet","injectStyles","styles","CSSStyleSheet","replaceSync","sheet","head","adoptedStyleSheets","rewriteSelector","DocumentFragment","defineProperties","enumerable","togglePopover","originalAttachShadow","writable","originalAttachInternals","attachInternals","internals","popoverTargetAssociatedElements","applyPopoverInvokerElementMixin","ElementClass","localName","form","idref","popoverTargetAction","handleInvokerActivation","invoker","popoverTargetAttributeActivationBehavior","onKeydown","addEventListeners","apply","menuItemSelector","join","getMnemonicFor","printable","FocusGroupElement","_FocusGroupElement_retainSignal","_FocusGroupElement_abortController","nowrap","retain","mnemonics","_FocusGroupElement_instances","_FocusGroupElement_items_get","toggleEvent","mnemonic","offset","focusEl","at","min","ScrollableRegionElement","hasOverflow","labelledBy","scrollHeight","clientHeight","safeDocument","announceFromElement","announce","innerText","getTextContent","message","assertive","getQuerySelector","setContainerContent","focusIfNeeded","overlayStack","clickHandler","ModalDialogElement","openButton","show","dialogIndex","ele","keydownHandler","mousedownHandler","topLevelDialog","upEvent","_ModalDialogElement_focusAbortController","paddingRight","aborted","showButtons","closedNotCancelled","dialogEvent","NavListElement","_NavListElement_truncationObserver","topLevelList","selectItemById","itemId","selectedItem","_NavListElement_instances","_NavListElement_findSelectedNavItemById","_NavListElement_select","selectItemByHref","_NavListElement_findSelectedNavItemByHref","selectItemByCurrentLocation","expandItem","nextElementSibling","collapseItem","itemIsExpanded","handleItemWithSubItemClick","handleItemWithSubItemKeydown","button_id","navItem","selectedNavItem","pathname","currentlySelectedItem","_NavListElement_deselect","children","parentMenu","_NavListElement_findParentMenu","NavListGroupElement","_NavListGroupElement_truncateObserver","setShowMoreItemState","showMoreDisabled","showMoreItem","currentPage","totalPages","paginationSrc","paginationURL","origin","searchParams","err","_NavListGroupElement_instances","_NavListGroupElement_parseHTML","listId","focusMarkers","SegmentedControlElement","_SegmentedControlElement_instances","_SegmentedControlElement_updateButtonLabels","select","ToggleSwitchElement","turbo","toggling","csrf","csrfElement","csrfField","isRemote","isDisabled","performToggle","setLoadingState","submitForm","setErrorState","setSuccessState","turnOn","switch","turnOff","isOn","isOff","disable","enable","errorIcon","loadingSpinner","setFinishedState","FormData","requestHeaders","contentType","Turbo","renderStreamMessage","isPopoverOpen","setSelector","TOOLTIP_SR_ONLY_CLASS","DIRECTION_CLASSES","closeOpenTooltips","except","openTooltips","focusOutListener","focusInListener","showReason","control","tooltips","ToolTipElement","_ToolTipElement_abortController","_ToolTipElement_align","_ToolTipElement_side","_ToolTipElement_allowUpdatePosition","_ToolTipElement_showReason","htmlFor","hiddenFromView","_ToolTipElement_instances","_ToolTipElement_updateControlReference","_ToolTipElement_updateDirection","shadow","appendChild","_ToolTipElement_update","showing","shouldShow","webdriver","isMouseLeaveFromButton","isEscapeKeydown","isMouseDownOnButton","isOpeningOtherPopover","shouldHide","isOpen","_ToolTipElement_updatePosition","describedBy","XBannerElement","dismiss","_XBannerElement_instances","_XBannerElement_dismissScheme_get","removeChild","hide","Combobox","list","tabInsertsSuggestions","defaultFirstOption","random","keyboardEventHandler","combobox","clearSelection","navigate","keyboardBindings","compositionEventHandler","inputHandler","destroy","stop","commitWithElement","indicateDefaultOption","visible","indexDiff","els","focusIndex","indexOfItem","newIndex","scrollTo","fireCommitEvent","scrollTop","containerBottom","offsetTop","inViewport","SCREEN_READER_DELAY","testScreenReaderDelay","Autocomplete","results","autoselectEnabled","feedback","clearButton","clientOptions","labelElem","interactingWithList","onInputChange","wait","Rest","onResultsMouseDown","onInputBlur","onInputFocus","onCommit","handleClear","updateFeedbackForScreenReaders","identifyOptions","inputString","fetchOnEmpty","fetchResult","then","allNewOptions","hasResults","numOptions","firstOption","firstOptionValue","catch","_AutoCompleteElement_instances","_AutoCompleteElement_forElement","_AutoCompleteElement_inputElement","_AutoCompleteElement_reattachState","_AutoCompleteElement_requestController","__rest","p","getOwnPropertySymbols","propertyIsEnumerable","AutoCompleteEvent","AutoCompleteElement","forElement","inputElement","autocomplete","res","AutocompleteElement","copyNode","clipboard","writeText","selection","getSelection","removeAllRanges","range","createRange","selectNodeContents","addRange","execCommand","copyText","createNode","copy","trigger","clicked","focused","blurred","ClipboardCopyElement","showSVG","svg","hideSVG","clipboardCopyElementTimers","currentTimeout","clipboardCopyLiveRegion","copiedAnnouncement","copyIcon","checkIcon","showCheck","showCopy","_DurationFormat_options","ListFormat","Intl","formatToParts","members","parts","partsTable","twoDigitFormatOptions","minimumIntegerDigits","DurationFormat","locale","prevStyle","hours","minutes","seconds","milliseconds","years","yearsDisplay","months","monthsDisplay","weeks","weeksDisplay","days","daysDisplay","hoursDisplay","minutesDisplay","secondsDisplay","millisecondsDisplay","resolvedOptions","duration","unit","nfUnit","unitStyle","nfOpts","unitDisplay","NumberFormat","format","durationRe","unitNames","Duration","sign","blank","abs","durationLike","factor","parsed","RangeError","one","two","now","Date","oneApplied","applyDuration","getTime","twoApplied","toLocaleString","opts","date","setFullYear","getFullYear","setMonth","getMonth","setDate","getDate","setHours","getHours","setMinutes","getMinutes","setSeconds","getSeconds","roundToSingleUnit","relativeTo","round","currentYear","currentMonth","currentDate","newMonthDate","monthDateCorrection","newDate","yearDiff","monthDiff","daysDiff","monthsDiff","_RelativeTimeElement_instances","_RelativeTimeElement_customTitle","_RelativeTimeElement_updating","_RelativeTimeElement_lang_get","_RelativeTimeElement_renderRoot","_RelativeTimeElement_getFormattedTitle","_RelativeTimeElement_resolveFormat","_RelativeTimeElement_getDurationFormat","_RelativeTimeElement_getRelativeFormat","_RelativeTimeElement_getDateTimeFormat","_RelativeTimeElement_onRelativeTimeUpdated","emptyDuration","microEmptyDuration","RelativeTimeUpdatedEvent","oldText","newText","oldTitle","newTitle","composed","getUnitFactor","precision","ms","dateObserver","time","timer","nearestDistance","timeEl","RelativeTimeElement","onRelativeTimeUpdated","listener","minute","hour","weekday","formatStyle","day","month","year","getUTCFullYear","timeZoneName","tense","noTitle","datetime","parse","isNaN","toISOString","attrName","DateTimeFormat","delta","sec","hr","elapsedTime","RelativeTimeFormat","compare","empty","relativeFormat","numeric","int","rounded","getRelativeTimeUnit","formatter","getTabs","tab","TabContainerElement","tabs","currentIndex","incrementKeys","decrementKeys","some","code","selectTab","panels","panel","selectedTab","selectedPanel","PrimerMultiInputElement","activateField","fieldWithName","findField","field","fields","middle","last","cancelled","fn","cancel","throttle","_AutoCheckElement_onloadend","AllowedHttpMethods","AutoCheckEvent","phase","AutoCheckValidationEvent","setValidity","AutoCheckCompleteEvent","AutoCheckSuccessEvent","AutoCheckStartEvent","AutoCheckErrorEvent","AutoCheckSendEvent","AutoCheckElement","onloadend","checker","check","spellcheck","setCustomValidity","required","httpMethod","autoCheckElement","startEvent","clone","PrimerTextFieldElement","_PrimerTextFieldElement_abortController","setSuccess","clearError","errorMessage","setError","clearContents","validationElement","validationMessageElement","replaceChildren","setValidationMessage","toggleValidationStyling","isError","validationSuccessIcon","validationErrorIcon","showLeadingSpinner","leadingSpinner","leadingVisual","hideLeadingSpinner","ToggleSwitchInputElement","validSelectors","menuItemSelectors","ActionMenuElement","_ActionMenuElement_abortController","_ActionMenuElement_originalLabel","_ActionMenuElement_inputName","_ActionMenuElement_invokerBeingClicked","selectVariant","variant","dynamicLabelPrefix","dynamicLabel","popoverElement","invokerLabel","selectedItems","labelEl","_ActionMenuElement_instances","_ActionMenuElement_setDynamicLabel","_ActionMenuElement_updateInput","_ActionMenuElement_softDisableItems","includeFragment","targetIsInvoker","eventIsActivation","_ActionMenuElement_isActivation","_ActionMenuElement_firstItem_get","_ActionMenuElement_handleInvokerActivated","_ActionMenuElement_handleFocusOut","_ActionMenuElement_potentiallyDisallowActivation","dialogInvoker","_ActionMenuElement_isAnchorActivationViaSpace","_ActionMenuElement_handleItemActivated","_ActionMenuElement_handleIncludeFragmentReplaced","getItemById","isItemDisabled","disableItem","enableItem","isItemHidden","hideItem","showItem","isItemChecked","checkItem","itemContent","uncheckItem","MouseEvent","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","focusInDialog","newActiveElement","checkedItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput","visibleMenuItemSelectors","FetchStrategy","ErrorStateType","updateAnchorPosition","SelectPanelElement","_SelectPanelElement_dialogIntersectionObserver","_SelectPanelElement_abortController","_SelectPanelElement_originalLabel","_SelectPanelElement_inputName","_SelectPanelElement_selectedItems","_SelectPanelElement_loadingDelayTimeoutId","_SelectPanelElement_loadingAnnouncementTimeoutId","_SelectPanelElement_hasLoadedData","ariaSelectionType","dynamicAriaLabelPrefix","closeButton","values","_SelectPanelElement_instances","_SelectPanelElement_setDynamicLabel","_SelectPanelElement_updateInput","_SelectPanelElement_softDisableItems","_SelectPanelElement_waitForCondition","Boolean","filterInputTextField","_SelectPanelElement_fetchStrategy_get","LOCAL","_SelectPanelElement_updateItemVisibility","_SelectPanelElement_handleSearchFieldEvent","_SelectPanelElement_handleRemoteInputEvent","targetIsCloseButton","_SelectPanelElement_isActivation","_SelectPanelElement_handleInvokerActivated","fireSearchEvent","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","_SelectPanelElement_filterInputTextFieldElement_get","ariaLiveContainer","_SelectPanelElement_toggleIncludeFragmentElements","errorElement","fragmentErrorElement","showError","_SelectPanelElement_clearErrorState","_SelectPanelElement_checkSelectedItems","bodySpinner","BODY","BANNER","_SelectPanelElement_performFilteringLocally","_SelectPanelElement_setTextFieldLoadingSpinnerTimer","_SelectPanelElement_defaultFilterFn","EVENTUALLY_LOCAL","atLeastOneResult","filterFn","_SelectPanelElement_showItem","_SelectPanelElement_hideItem","_SelectPanelElement_updateTabIndices","_SelectPanelElement_maybeAnnounce","_SelectPanelElement_addSelectedItem","noResults","_SelectPanelElement_inErrorState","bannerErrorElement","instructions","noResultsEl","REMOTE","_SelectPanelElement_handleDialogItemActivated","currentlyChecked","clear","_SelectPanelElement_removeSelectedItem"],"mappings":"yBAAA,IAWIA,EAAmCC,EAA8BC,EAAkCC,EAAoCC,EAAiCC,EAA8CC,EAA8BC,EAXpPC,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,GACnG,GAAa,MAATD,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,4EACvG,MAAgB,MAATF,EAAeC,EAAa,MAATD,EAAeC,EAAEG,KAAKN,GAAYG,EAAIA,EAAEI,MAAQN,EAAMO,IAAIR,EACxF,EACIS,EAAkE,SAAUT,EAAUC,EAAOM,EAAOL,EAAMC,GAC1G,GAAa,MAATD,EAAc,MAAM,IAAIE,UAAU,kCACtC,GAAa,MAATF,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,2EACvG,MAAiB,MAATF,EAAeC,EAAEG,KAAKN,EAAUO,GAASJ,EAAIA,EAAEI,MAAQA,EAAQN,EAAMS,IAAIV,EAAUO,GAASA,CACxG,EAEA,MAAMI,EAAc,IAAIC,QAIxB,IAAIC,EAA+B,KAC5B,MAAMC,+BAA+BC,YACxCC,cACIC,SAASC,WACT3B,EAAk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.js","sources":["../../../node_modules/@github/include-fragment-element/dist/include-fragment-element.js","../../../node_modules/@github/include-fragment-element/dist/include-fragment-element-define.js","../../../node_modules/@github/remote-input-element/dist/index.js","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/@github/catalyst/lib/bind.js","../../../node_modules/@github/catalyst/lib/dasherize.js","../../../node_modules/@github/catalyst/lib/attr.js","../../../node_modules/@github/catalyst/lib/core.js","../../../node_modules/@github/catalyst/lib/register.js","../../../node_modules/@github/catalyst/lib/auto-shadow-root.js","../../../node_modules/@github/catalyst/lib/target.js","../../../node_modules/@github/catalyst/lib/findtarget.js","../../../node_modules/@github/catalyst/lib/controller.js","../../../node_modules/@github/catalyst/lib/lazy-define.js","../../components/primer/alpha/action_list.ts","../../../node_modules/@primer/behaviors/dist/esm/anchored-position.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.mjs","../../../node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-trap.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/user-agent.mjs","../../../node_modules/@primer/behaviors/dist/esm/utils/unique-id.mjs","../../../node_modules/@primer/behaviors/dist/esm/focus-zone.mjs","../../components/primer/alpha/action_bar_element.ts","../../../node_modules/@github/details-menu-element/dist/index.js","../../components/primer/anchored_position.ts","../../components/primer/dialog_helper.ts","../../../node_modules/@oddbird/popover-polyfill/dist/popover.js","../../components/primer/focus_group.ts","../../components/primer/scrollable_region.ts","../../components/primer/alpha/modal_dialog.ts","../../components/primer/beta/nav_list.ts","../../components/primer/beta/nav_list_group_element.ts","../../components/primer/alpha/segmented_control.ts","../../components/primer/alpha/toggle_switch.ts","../../components/primer/alpha/tool_tip.ts","../../components/primer/alpha/x_banner.ts","../../../node_modules/@github/combobox-nav/dist/index.js","../../../node_modules/@github/auto-complete-element/dist/autocomplete.js","../../../node_modules/@github/auto-complete-element/dist/debounce.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element.js","../../../node_modules/@github/auto-complete-element/dist/auto-complete-element-define.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element.js","../../../node_modules/@github/clipboard-copy-element/dist/clipboard-copy-element-define.js","../../components/primer/beta/clipboard_copy.ts","../../../node_modules/@github/relative-time-element/dist/duration-format-ponyfill.js","../../../node_modules/@github/relative-time-element/dist/duration.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element.js","../../../node_modules/@github/relative-time-element/dist/relative-time-element-define.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element.js","../../../node_modules/@github/tab-container-element/dist/tab-container-element-define.js","../../lib/primer/forms/primer_multi_input.ts","../../../node_modules/@github/mini-throttle/dist/index.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element.js","../../../node_modules/@github/auto-check-element/dist/auto-check-element-define.js","../../lib/primer/forms/primer_text_field.ts","../../lib/primer/forms/toggle_switch_input.ts","../../components/primer/alpha/action_menu/action_menu_element.ts","../../../node_modules/@primer/live-region-element/dist/esm/index.js","../../components/primer/alpha/select_panel_element.ts"],"sourcesContent":["var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _IncludeFragmentElement_instances, _IncludeFragmentElement_busy, _IncludeFragmentElement_observer, _IncludeFragmentElement_handleData, _IncludeFragmentElement_getData, _IncludeFragmentElement_getStringOrErrorData, _IncludeFragmentElement_task, _IncludeFragmentElement_fetchDataWithEvents;\nconst privateData = new WeakMap();\nfunction isWildcard(accept) {\n return accept && !!accept.split(',').find(x => x.match(/^\\s*\\*\\/\\*/));\n}\nlet cspTrustedTypesPolicyPromise = null;\nexport class IncludeFragmentElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _IncludeFragmentElement_instances.add(this);\n _IncludeFragmentElement_busy.set(this, false);\n _IncludeFragmentElement_observer.set(this, new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const { target } = entry;\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(target);\n if (!(target instanceof IncludeFragmentElement))\n return;\n if (target.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n }, {\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01,\n }));\n }\n static define(tag = 'include-fragment', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n static get observedAttributes() {\n return ['src', 'loading'];\n }\n get src() {\n const src = this.getAttribute('src');\n if (src) {\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n else {\n return '';\n }\n }\n set src(val) {\n this.setAttribute('src', val);\n }\n get loading() {\n if (this.getAttribute('loading') === 'lazy')\n return 'lazy';\n return 'eager';\n }\n set loading(value) {\n this.setAttribute('loading', value);\n }\n get accept() {\n return this.getAttribute('accept') || '';\n }\n set accept(val) {\n this.setAttribute('accept', val);\n }\n get data() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n attributeChangedCallback(attribute, oldVal) {\n if (attribute === 'src') {\n if (this.isConnected && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n else if (attribute === 'loading') {\n if (this.isConnected && oldVal !== 'eager' && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n }\n }\n connectedCallback() {\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = `:host {display: block;}`;\n this.shadowRoot.append(style, document.createElement('slot'));\n }\n if (this.src && this.loading === 'eager') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n if (this.loading === 'lazy') {\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").observe(this);\n }\n }\n request() {\n const src = this.src;\n if (!src) {\n throw new Error('missing src');\n }\n return new Request(src, {\n method: 'GET',\n credentials: 'same-origin',\n headers: {\n Accept: this.accept || 'text/html',\n },\n });\n }\n load() {\n return __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getStringOrErrorData).call(this);\n }\n fetch(request) {\n return fetch(request);\n }\n refetch() {\n privateData.delete(this);\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_handleData).call(this);\n }\n}\n_IncludeFragmentElement_busy = new WeakMap(), _IncludeFragmentElement_observer = new WeakMap(), _IncludeFragmentElement_instances = new WeakSet(), _IncludeFragmentElement_handleData = async function _IncludeFragmentElement_handleData() {\n if (__classPrivateFieldGet(this, _IncludeFragmentElement_busy, \"f\"))\n return;\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, true, \"f\");\n __classPrivateFieldGet(this, _IncludeFragmentElement_observer, \"f\").unobserve(this);\n try {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n const dataTreatedAsString = data;\n const template = document.createElement('template');\n template.innerHTML = dataTreatedAsString;\n const fragment = document.importNode(template.content, true);\n const canceled = !this.dispatchEvent(new CustomEvent('include-fragment-replace', {\n cancelable: true,\n detail: { fragment },\n }));\n if (canceled) {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n return;\n }\n this.replaceWith(fragment);\n this.dispatchEvent(new CustomEvent('include-fragment-replaced'));\n }\n catch (_a) {\n this.classList.add('is-error');\n }\n finally {\n __classPrivateFieldSet(this, _IncludeFragmentElement_busy, false, \"f\");\n }\n}, _IncludeFragmentElement_getData = async function _IncludeFragmentElement_getData() {\n const src = this.src;\n const cachedData = privateData.get(this);\n if (cachedData && cachedData.src === src) {\n return cachedData.data;\n }\n else {\n let data;\n if (src) {\n data = __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_fetchDataWithEvents).call(this);\n }\n else {\n data = Promise.reject(new Error('missing src'));\n }\n privateData.set(this, { src, data });\n return data;\n }\n}, _IncludeFragmentElement_getStringOrErrorData = async function _IncludeFragmentElement_getStringOrErrorData() {\n const data = await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_getData).call(this);\n if (data instanceof Error) {\n throw data;\n }\n return data.toString();\n}, _IncludeFragmentElement_task = async function _IncludeFragmentElement_task(eventsToDispatch) {\n await new Promise(resolve => setTimeout(resolve, 0));\n for (const eventType of eventsToDispatch) {\n this.dispatchEvent(new Event(eventType));\n }\n}, _IncludeFragmentElement_fetchDataWithEvents = async function _IncludeFragmentElement_fetchDataWithEvents() {\n try {\n await __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['loadstart']);\n const response = await this.fetch(this.request());\n if (response.status !== 200) {\n throw new Error(`Failed to load resource: the server responded with a status of ${response.status}`);\n }\n const ct = response.headers.get('Content-Type');\n if (!isWildcard(this.accept) && (!ct || !ct.includes(this.accept ? this.accept : 'text/html'))) {\n throw new Error(`Failed to load resource: expected ${this.accept || 'text/html'} but was ${ct}`);\n }\n const responseText = await response.text();\n let data = responseText;\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n data = cspTrustedTypesPolicy.createHTML(responseText, response);\n }\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['load', 'loadend']);\n return data;\n }\n catch (error) {\n __classPrivateFieldGet(this, _IncludeFragmentElement_instances, \"m\", _IncludeFragmentElement_task).call(this, ['error', 'loadend']);\n throw error;\n }\n};\n","import { IncludeFragmentElement } from './include-fragment-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.IncludeFragmentElement = IncludeFragmentElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default IncludeFragmentElement;\nexport * from './include-fragment-element.js';\n","const states = new WeakMap();\nclass RemoteInputElement extends HTMLElement {\n constructor() {\n super();\n const fetch = fetchResults.bind(null, this, true);\n const state = { currentQuery: null, oninput: debounce((e) => fetch(e)), fetch, controller: null };\n states.set(this, state);\n }\n static get observedAttributes() {\n return ['src'];\n }\n attributeChangedCallback(name, oldValue) {\n if (oldValue && name === 'src') {\n fetchResults(this, false);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('spellcheck', 'false');\n const state = states.get(this);\n if (!state)\n return;\n input.addEventListener('focus', state.fetch);\n input.addEventListener('change', state.fetch);\n input.addEventListener('input', state.oninput);\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n input.removeEventListener('focus', state.fetch);\n input.removeEventListener('change', state.fetch);\n input.removeEventListener('input', state.oninput);\n }\n get input() {\n const input = this.querySelector('input, textarea');\n return input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement ? input : null;\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return { signal: null, abort() { } };\n}\nasync function fetchResults(remoteInput, checkCurrentQuery, event) {\n const input = remoteInput.input;\n if (!input)\n return;\n const state = states.get(remoteInput);\n if (!state)\n return;\n const query = input.value;\n if (checkCurrentQuery && state.currentQuery === query)\n return;\n state.currentQuery = query;\n const src = remoteInput.src;\n if (!src)\n return;\n const resultsContainer = document.getElementById(remoteInput.getAttribute('aria-owns') || '');\n if (!resultsContainer)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search);\n params.append(remoteInput.getAttribute('param') || 'q', query);\n url.search = params.toString();\n if (state.controller) {\n state.controller.abort();\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('loadstart'));\n remoteInput.setAttribute('loading', '');\n }\n state.controller = makeAbortController();\n let response;\n let html = '';\n try {\n response = await fetchWithNetworkEvents(remoteInput, url.toString(), {\n signal: state.controller.signal,\n credentials: 'same-origin',\n headers: { accept: 'text/fragment+html' }\n });\n html = await response.text();\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n catch (error) {\n if (error instanceof Error && error.name !== 'AbortError') {\n remoteInput.removeAttribute('loading');\n state.controller = null;\n }\n return;\n }\n if (response && response.ok) {\n resultsContainer.innerHTML = html;\n remoteInput.dispatchEvent(new CustomEvent('remote-input-success', { bubbles: true, detail: { \"eventType\": event ? event.type : undefined } }));\n }\n else {\n remoteInput.dispatchEvent(new CustomEvent('remote-input-error', { bubbles: true }));\n }\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new CustomEvent('load'));\n el.dispatchEvent(new CustomEvent('loadend'));\n return response;\n }\n catch (error) {\n if (error instanceof Error && (error === null || error === void 0 ? void 0 : error.name) !== 'AbortError') {\n el.dispatchEvent(new CustomEvent('error'));\n el.dispatchEvent(new CustomEvent('loadend'));\n }\n throw error;\n }\n}\nfunction debounce(callback) {\n let timeout;\n return function (args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n clearTimeout(timeout);\n callback(args);\n }, 300);\n };\n}\nexport default RemoteInputElement;\nif (!window.customElements.get('remote-input')) {\n window.RemoteInputElement = RemoteInputElement;\n window.customElements.define('remote-input', RemoteInputElement);\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","const controllers = new WeakSet();\n/*\n * Bind `[data-action]` elements from the DOM to their actions.\n *\n */\nexport function bind(controller) {\n controllers.add(controller);\n if (controller.shadowRoot)\n bindShadow(controller.shadowRoot);\n bindElements(controller);\n listenForBind(controller.ownerDocument);\n}\nexport function bindShadow(root) {\n bindElements(root);\n listenForBind(root);\n}\nconst observers = new WeakMap();\n/**\n * Set up observer that will make sure any actions that are dynamically\n * injected into `el` will be bound to it's controller.\n *\n * This returns a Subscription object which you can call `unsubscribe()` on to\n * stop further live updates.\n */\nexport function listenForBind(el = document) {\n if (observers.has(el))\n return observers.get(el);\n let closed = false;\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.target instanceof Element) {\n bindActions(mutation.target);\n }\n else if (mutation.type === 'childList' && mutation.addedNodes.length) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element) {\n bindElements(node);\n }\n }\n }\n }\n });\n observer.observe(el, { childList: true, subtree: true, attributeFilter: ['data-action'] });\n const subscription = {\n get closed() {\n return closed;\n },\n unsubscribe() {\n closed = true;\n observers.delete(el);\n observer.disconnect();\n }\n };\n observers.set(el, subscription);\n return subscription;\n}\nfunction bindElements(root) {\n for (const el of root.querySelectorAll('[data-action]')) {\n bindActions(el);\n }\n // Also bind the controller to itself\n if (root instanceof Element && root.hasAttribute('data-action')) {\n bindActions(root);\n }\n}\n// Bind a single function to all events to avoid anonymous closure performance penalty.\nfunction handleEvent(event) {\n const el = event.currentTarget;\n for (const binding of bindings(el)) {\n if (event.type === binding.type) {\n const controller = el.closest(binding.tag);\n if (controllers.has(controller) && typeof controller[binding.method] === 'function') {\n controller[binding.method](event);\n }\n const root = el.getRootNode();\n if (root instanceof ShadowRoot && controllers.has(root.host) && root.host.matches(binding.tag)) {\n const shadowController = root.host;\n if (typeof shadowController[binding.method] === 'function') {\n shadowController[binding.method](event);\n }\n }\n }\n }\n}\nfunction* bindings(el) {\n for (const action of (el.getAttribute('data-action') || '').trim().split(/\\s+/)) {\n const eventSep = action.lastIndexOf(':');\n const methodSep = Math.max(0, action.lastIndexOf('#')) || action.length;\n yield {\n type: action.slice(0, eventSep),\n tag: action.slice(eventSep + 1, methodSep),\n method: action.slice(methodSep + 1) || 'handleEvent'\n } || 'handleEvent';\n }\n}\nfunction bindActions(el) {\n for (const binding of bindings(el)) {\n el.addEventListener(binding.type, handleEvent);\n }\n}\n//# sourceMappingURL=bind.js.map","export const dasherize = (str) => String(typeof str === 'symbol' ? str.description : str)\n .replace(/([A-Z]($|[a-z]))/g, '-$1')\n .replace(/--/g, '-')\n .replace(/^-|-$/, '')\n .toLowerCase();\nexport const mustDasherize = (str, type = 'property') => {\n const dashed = dasherize(str);\n if (!dashed.includes('-')) {\n throw new DOMException(`${type}: ${String(str)} is not a valid ${type} name`, 'SyntaxError');\n }\n return dashed;\n};\n//# sourceMappingURL=dasherize.js.map","import { mustDasherize } from './dasherize.js';\nimport { meta } from './core.js';\nconst attrKey = 'attr';\n/**\n * Attr is a decorator which tags a property as one to be initialized via\n * `initializeAttrs`.\n *\n * The signature is typed such that the property must be one of a String,\n * Number or Boolean. This matches the behavior of `initializeAttrs`.\n */\nexport function attr(proto, key) {\n meta(proto, attrKey).add(key);\n}\n/**\n * initializeAttrs is called with a set of class property names (if omitted, it\n * will look for any properties tagged with the `@attr` decorator). With this\n * list it defines property descriptors for each property that map to `data-*`\n * attributes on the HTMLElement instance.\n *\n * It works around Native Class Property semantics - which are equivalent to\n * calling `Object.defineProperty` on the instance upon creation, but before\n * `constructor()` is called.\n *\n * If a class property is assigned to the class body, it will infer the type\n * (using `typeof`) and define an appropriate getter/setter combo that aligns\n * to that type. This means class properties assigned to Numbers can only ever\n * be Numbers, assigned to Booleans can only ever be Booleans, and assigned to\n * Strings can only ever be Strings.\n *\n * This is automatically called as part of `@controller`. If a class uses the\n * `@controller` decorator it should not call this manually.\n */\nconst initialized = new WeakSet();\nexport function initializeAttrs(instance, names) {\n if (initialized.has(instance))\n return;\n initialized.add(instance);\n const proto = Object.getPrototypeOf(instance);\n const prefix = proto?.constructor?.attrPrefix ?? 'data-';\n if (!names)\n names = meta(proto, attrKey);\n for (const key of names) {\n const value = instance[key];\n const name = mustDasherize(`${prefix}${key}`);\n let descriptor = {\n configurable: true,\n get() {\n return this.getAttribute(name) || '';\n },\n set(newValue) {\n this.setAttribute(name, newValue || '');\n }\n };\n if (typeof value === 'number') {\n descriptor = {\n configurable: true,\n get() {\n return Number(this.getAttribute(name) || 0);\n },\n set(newValue) {\n this.setAttribute(name, newValue);\n }\n };\n }\n else if (typeof value === 'boolean') {\n descriptor = {\n configurable: true,\n get() {\n return this.hasAttribute(name);\n },\n set(newValue) {\n this.toggleAttribute(name, newValue);\n }\n };\n }\n Object.defineProperty(instance, key, descriptor);\n if (key in instance && !instance.hasAttribute(name)) {\n descriptor.set.call(instance, value);\n }\n }\n}\nexport function defineObservedAttributes(classObject) {\n let observed = classObject.observedAttributes || [];\n const prefix = classObject.attrPrefix ?? 'data-';\n const attrToAttributeName = (name) => mustDasherize(`${prefix}${name}`);\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return [...meta(classObject.prototype, attrKey)].map(attrToAttributeName).concat(observed);\n },\n set(attributes) {\n observed = attributes;\n }\n });\n}\n//# sourceMappingURL=attr.js.map","import { register } from './register.js';\nimport { bind, bindShadow } from './bind.js';\nimport { autoShadowRoot } from './auto-shadow-root.js';\nimport { defineObservedAttributes, initializeAttrs } from './attr.js';\nconst symbol = Symbol.for('catalyst');\nexport class CatalystDelegate {\n constructor(classObject) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const delegate = this;\n const connectedCallback = classObject.prototype.connectedCallback;\n classObject.prototype.connectedCallback = function () {\n delegate.connectedCallback(this, connectedCallback);\n };\n const disconnectedCallback = classObject.prototype.disconnectedCallback;\n classObject.prototype.disconnectedCallback = function () {\n delegate.disconnectedCallback(this, disconnectedCallback);\n };\n const attributeChangedCallback = classObject.prototype.attributeChangedCallback;\n classObject.prototype.attributeChangedCallback = function (name, oldValue, newValue) {\n delegate.attributeChangedCallback(this, name, oldValue, newValue, attributeChangedCallback);\n };\n let observedAttributes = classObject.observedAttributes || [];\n Object.defineProperty(classObject, 'observedAttributes', {\n configurable: true,\n get() {\n return delegate.observedAttributes(this, observedAttributes);\n },\n set(attributes) {\n observedAttributes = attributes;\n }\n });\n defineObservedAttributes(classObject);\n register(classObject);\n }\n observedAttributes(instance, observedAttributes) {\n return observedAttributes;\n }\n connectedCallback(instance, connectedCallback) {\n instance.toggleAttribute('data-catalyst', true);\n customElements.upgrade(instance);\n autoShadowRoot(instance);\n initializeAttrs(instance);\n bind(instance);\n connectedCallback?.call(instance);\n if (instance.shadowRoot)\n bindShadow(instance.shadowRoot);\n }\n disconnectedCallback(element, disconnectedCallback) {\n disconnectedCallback?.call(element);\n }\n attributeChangedCallback(instance, name, oldValue, newValue, attributeChangedCallback) {\n initializeAttrs(instance);\n if (name !== 'data-catalyst' && attributeChangedCallback) {\n attributeChangedCallback.call(instance, name, oldValue, newValue);\n }\n }\n}\nexport function meta(proto, name) {\n if (!Object.prototype.hasOwnProperty.call(proto, symbol)) {\n const parent = proto[symbol];\n const map = (proto[symbol] = new Map());\n if (parent) {\n for (const [key, value] of parent) {\n map.set(key, new Set(value));\n }\n }\n }\n const map = proto[symbol];\n if (!map.has(name))\n map.set(name, new Set());\n return map.get(name);\n}\n//# sourceMappingURL=core.js.map","import { dasherize } from './dasherize.js';\n/**\n * Register the controller as a custom element.\n *\n * The classname is converted to a approriate tag name.\n *\n * Example: HelloController => hello-controller\n */\nexport function register(classObject) {\n const name = dasherize(classObject.name).replace(/-element$/, '');\n try {\n window.customElements.define(name, classObject);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n window[classObject.name] = customElements.get(name);\n }\n catch (e) {\n // The only reason for window.customElements.define to throw a `NotSupportedError`\n // is if the element has already been defined.\n if (!(e instanceof DOMException && e.name === 'NotSupportedError'))\n throw e;\n }\n return classObject;\n}\n//# sourceMappingURL=register.js.map","export function autoShadowRoot(element) {\n for (const template of element.querySelectorAll('template[data-shadowroot]')) {\n if (template.parentElement === element) {\n element\n .attachShadow({\n mode: template.getAttribute('data-shadowroot') === 'closed' ? 'closed' : 'open'\n })\n .append(template.content.cloneNode(true));\n }\n }\n}\n//# sourceMappingURL=auto-shadow-root.js.map","import { findTarget, findTargets } from './findtarget.js';\nimport { meta } from './core.js';\n/**\n * Target is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTarget(this, key)` where `key` is the name of the\n * property field. In other words, `@target foo` becomes a getter for\n * `findTarget(this, 'foo')`.\n */\nexport function target(proto, key) {\n meta(proto, 'target').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTarget(this, key);\n }\n });\n}\n/**\n * Targets is a decorator which - when assigned to a property field on the\n * class - will override that class field, turning it into a Getter which\n * returns a call to `findTargets(this, key)` where `key` is the name of the\n * property field. In other words, `@targets foo` becomes a getter for\n * `findTargets(this, 'foo')`.\n */\nexport function targets(proto, key) {\n meta(proto, 'targets').add(key);\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n return findTargets(this, key);\n }\n });\n}\n//# sourceMappingURL=target.js.map","/**\n * findTarget will run `querySelectorAll` against the given controller, plus\n * its shadowRoot, returning any the first child that:\n *\n * - Matches the selector of `[data-target~=\"tag.name\"]` where tag is the\n * tagName of the given HTMLElement, and `name` is the given `name` argument.\n *\n * - Closest ascendant of the element, that matches the tagname of the\n * controller, is the specific instance of the controller itself - in other\n * words it is not nested in other controllers of the same type.\n *\n */\nexport function findTarget(controller, name) {\n const tag = controller.tagName.toLowerCase();\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n return el;\n }\n }\n for (const el of controller.querySelectorAll(`[data-target~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n return el;\n }\n}\nexport function findTargets(controller, name) {\n const tag = controller.tagName.toLowerCase();\n const targets = [];\n if (controller.shadowRoot) {\n for (const el of controller.shadowRoot.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (!el.closest(tag))\n targets.push(el);\n }\n }\n for (const el of controller.querySelectorAll(`[data-targets~=\"${tag}.${name}\"]`)) {\n if (el.closest(tag) === controller)\n targets.push(el);\n }\n return targets;\n}\n//# sourceMappingURL=findtarget.js.map","import { CatalystDelegate } from './core.js';\n/**\n * Controller is a decorator to be used over a class that extends HTMLElement.\n * It will automatically `register()` the component in the customElement\n * registry, as well as ensuring `bind(this)` is called on `connectedCallback`,\n * wrapping the classes `connectedCallback` method if needed.\n */\nexport function controller(classObject) {\n new CatalystDelegate(classObject);\n}\n//# sourceMappingURL=controller.js.map","const dynamicElements = new Map();\nconst ready = new Promise(resolve => {\n if (document.readyState !== 'loading') {\n resolve();\n }\n else {\n document.addEventListener('readystatechange', () => resolve(), { once: true });\n }\n});\nconst firstInteraction = new Promise(resolve => {\n const controller = new AbortController();\n controller.signal.addEventListener('abort', () => resolve());\n const listenerOptions = { once: true, passive: true, signal: controller.signal };\n const handler = () => controller.abort();\n document.addEventListener('mousedown', handler, listenerOptions);\n // eslint-disable-next-line github/require-passive-events\n document.addEventListener('touchstart', handler, listenerOptions);\n document.addEventListener('keydown', handler, listenerOptions);\n document.addEventListener('pointerdown', handler, listenerOptions);\n});\nconst visible = (tagName) => new Promise(resolve => {\n const observer = new IntersectionObserver(entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n resolve();\n observer.disconnect();\n return;\n }\n }\n }, {\n // Currently the threshold is set to 256px from the bottom of the viewport\n // with a threshold of 0.1. This means the element will not load until about\n // 2 keyboard-down-arrow presses away from being visible in the viewport,\n // giving us some time to fetch it before the contents are made visible\n rootMargin: '0px 0px 256px 0px',\n threshold: 0.01\n });\n for (const el of document.querySelectorAll(tagName)) {\n observer.observe(el);\n }\n});\nconst strategies = {\n ready: () => ready,\n firstInteraction: () => firstInteraction,\n visible\n};\nconst timers = new WeakMap();\nfunction scan(node) {\n cancelAnimationFrame(timers.get(node) || 0);\n timers.set(node, requestAnimationFrame(() => {\n for (const tagName of dynamicElements.keys()) {\n const child = node.matches(tagName) ? node : node.querySelector(tagName);\n if (customElements.get(tagName) || child) {\n const strategyName = (child?.getAttribute('data-load-on') || 'ready');\n const strategy = strategyName in strategies ? strategies[strategyName] : strategies.ready;\n // eslint-disable-next-line github/no-then\n for (const cb of dynamicElements.get(tagName) || [])\n strategy(tagName).then(cb);\n dynamicElements.delete(tagName);\n timers.delete(node);\n }\n }\n }));\n}\nlet elementLoader;\nexport function lazyDefine(tagName, callback) {\n if (!dynamicElements.has(tagName))\n dynamicElements.set(tagName, new Set());\n dynamicElements.get(tagName).add(callback);\n scan(document.body);\n if (!elementLoader) {\n elementLoader = new MutationObserver(mutations => {\n if (!dynamicElements.size)\n return;\n for (const mutation of mutations) {\n for (const node of mutation.addedNodes) {\n if (node instanceof Element)\n scan(node);\n }\n }\n });\n elementLoader.observe(document, { subtree: true, childList: true });\n }\n}\n//# sourceMappingURL=lazy-define.js.map","import {controller} from '@github/catalyst'\n\n// eslint-disable-next-line custom-elements/no-exports-with-element\nexport class ActionListTruncationObserver {\n resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n\n if (action instanceof HTMLElement) {\n this.update(action)\n }\n }\n })\n\n constructor(el: HTMLElement) {\n this.resizeObserver.observe(el)\n }\n\n unobserve(el: HTMLElement) {\n this.resizeObserver.unobserve(el)\n }\n\n update(el: HTMLElement) {\n const items = el.querySelectorAll('li')\n\n for (const item of items) {\n const label = item.querySelector('.ActionListItem-label') as HTMLElement\n if (!label) continue\n const tooltip = item.querySelector('.ActionListItem-truncationTooltip') as HTMLElement\n if (!tooltip) continue\n\n const isTruncated = label.scrollWidth > label.clientWidth\n\n if (isTruncated) {\n tooltip.style.display = ''\n } else {\n tooltip.style.display = 'none'\n }\n }\n }\n}\n\n@controller\n// eslint-disable-next-line custom-elements/expose-class-on-global\nexport class ActionListElement extends HTMLElement {\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n this.#truncationObserver = new ActionListTruncationObserver(this)\n }\n\n disconnectedCallback() {\n this.#truncationObserver.unobserve(this)\n }\n}\n\ndeclare global {\n interface Window {\n ActionListElement: typeof ActionListElement\n }\n}\n","const alternateOrders = {\n 'outside-top': ['outside-bottom', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-bottom': ['outside-top', 'outside-right', 'outside-left', 'outside-bottom'],\n 'outside-left': ['outside-right', 'outside-bottom', 'outside-top', 'outside-bottom'],\n 'outside-right': ['outside-left', 'outside-bottom', 'outside-top', 'outside-bottom'],\n};\nconst alternateAlignments = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start'],\n};\nfunction getAnchoredPosition(floatingElement, anchorElement, settings = {}) {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [parentElementStyle.borderTopWidth, parentElementStyle.borderLeftWidth].map(v => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft,\n };\n return pureCalculateAnchoredPosition(clippingRect, relativeRect, floatingElement.getBoundingClientRect(), anchorElement instanceof Element ? anchorElement.getBoundingClientRect() : anchorElement, getDefaultSettings(settings));\n}\nfunction getPositionedParent(element) {\n if (isOnTopLayer(element))\n return document.body;\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\nfunction isOnTopLayer(element) {\n var _a;\n if (element.tagName === 'DIALOG') {\n return true;\n }\n try {\n if (element.matches(':popover-open') && /native code/.test((_a = document.body.showPopover) === null || _a === void 0 ? void 0 : _a.toString())) {\n return true;\n }\n }\n catch (_b) {\n return false;\n }\n return false;\n}\nfunction getClippingRect(element) {\n let parentNode = element;\n while (parentNode !== null) {\n if (!(parentNode instanceof Element)) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode = parentNode === document.body || !(parentNode instanceof HTMLElement) ? document.body : parentNode;\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth,\n ].map(v => parseInt(v, 10) || 0);\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n height: Math.max(elemRect.height - borderTop - borderBottom, clippingNode === document.body ? window.innerHeight : -Infinity),\n };\n}\nconst positionDefaults = {\n side: 'outside-bottom',\n align: 'start',\n anchorOffset: 4,\n alignmentOffset: 4,\n allowOutOfBounds: false,\n};\nfunction getDefaultSettings(settings = {}) {\n var _a, _b, _c, _d, _e;\n const side = (_a = settings.side) !== null && _a !== void 0 ? _a : positionDefaults.side;\n const align = (_b = settings.align) !== null && _b !== void 0 ? _b : positionDefaults.align;\n return {\n side,\n align,\n anchorOffset: (_c = settings.anchorOffset) !== null && _c !== void 0 ? _c : (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset: (_d = settings.alignmentOffset) !== null && _d !== void 0 ? _d : (align !== 'center' && side.startsWith('inside') ? positionDefaults.alignmentOffset : 0),\n allowOutOfBounds: (_e = settings.allowOutOfBounds) !== null && _e !== void 0 ? _e : positionDefaults.allowOutOfBounds,\n };\n}\nfunction pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingRect, anchorRect, { side, align, allowOutOfBounds, anchorOffset, alignmentOffset }) {\n const relativeViewportRect = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height,\n };\n let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n while (positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(prevSide, pos, relativeViewportRect, floatingRect)) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n const alternateAlignment = alternateAlignments[align];\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n while (alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(prevAlign, pos, relativeViewportRect, floatingRect)) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n pos = calculatePosition(floatingRect, anchorRect, anchorSide, nextAlign, anchorOffset, alignmentOffset);\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (pos.left + floatingRect.width > viewportRect.width + relativeViewportRect.left) {\n pos.left = viewportRect.width + relativeViewportRect.left - floatingRect.width;\n }\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {\n pos.top = Math.max(viewportRect.height + relativeViewportRect.top - floatingRect.height, 0);\n }\n }\n }\n return Object.assign(Object.assign({}, pos), { anchorSide, anchorAlign });\n}\nfunction calculatePosition(elementDimensions, anchorPosition, side, align, anchorOffset, alignmentOffset) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top = anchorPosition.top - anchorOffset - elementDimensions.height;\n }\n else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n }\n else if (side === 'outside-left') {\n left = anchorPosition.left - anchorOffset - elementDimensions.width;\n }\n else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n }\n else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n }\n else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n }\n else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n }\n else if (side === 'inside-center') {\n left = (anchorRight + anchorPosition.left) / 2 - elementDimensions.width / 2 + anchorOffset;\n }\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n }\n else if (align === 'center') {\n left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;\n }\n else {\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n }\n else if (align === 'center') {\n top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;\n }\n else {\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n return { top, left };\n}\nfunction shouldRecalculatePosition(side, currentPos, containerDimensions, elementDimensions) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height > containerDimensions.height + containerDimensions.top);\n }\n else {\n return (currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width > containerDimensions.width + containerDimensions.left);\n }\n}\nfunction shouldRecalculateAlignment(align, currentPos, containerDimensions, elementDimensions) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n }\n else if (align === 'start' || align === 'center') {\n return (currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width ||\n currentPos.left < containerDimensions.left);\n }\n}\n\nexport { getAnchoredPosition };\n","function* iterateFocusableElements(container, options = {}) {\n var _a, _b;\n const strict = (_a = options.strict) !== null && _a !== void 0 ? _a : false;\n const acceptFn = ((_b = options.onlyTabbable) !== null && _b !== void 0 ? _b : false) ? isTabbable : isFocusable;\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: node => node instanceof HTMLElement && acceptFn(node, strict) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n });\n let nextNode = null;\n if (!options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n if (options.reverse) {\n let lastChild = walker.lastChild();\n while (lastChild) {\n nextNode = lastChild;\n lastChild = walker.lastChild();\n }\n }\n else {\n nextNode = walker.firstChild();\n }\n while (nextNode instanceof HTMLElement) {\n yield nextNode;\n nextNode = options.reverse ? walker.previousNode() : walker.nextNode();\n }\n if (options.reverse && acceptFn(container, strict)) {\n yield container;\n }\n return undefined;\n}\nfunction getFocusableChild(container, lastChild = false) {\n return iterateFocusableElements(container, { reverse: lastChild, strict: true, onlyTabbable: true }).next().value;\n}\nfunction isFocusable(elem, strict = false) {\n const disabledAttrInert = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA', 'OPTGROUP', 'OPTION', 'FIELDSET'].includes(elem.tagName) &&\n elem.disabled;\n const hiddenInert = elem.hidden;\n const hiddenInputInert = elem instanceof HTMLInputElement && elem.type === 'hidden';\n const sentinelInert = elem.classList.contains('sentinel');\n if (disabledAttrInert || hiddenInert || hiddenInputInert || sentinelInert) {\n return false;\n }\n if (strict) {\n const style = getComputedStyle(elem);\n const sizeInert = elem.offsetWidth === 0 || elem.offsetHeight === 0;\n const visibilityInert = ['hidden', 'collapse'].includes(style.visibility);\n const displayInert = style.display === 'none' || !elem.offsetParent;\n const clientRectsInert = elem.getClientRects().length === 0;\n if (sizeInert || visibilityInert || clientRectsInert || displayInert) {\n return false;\n }\n }\n if (elem.getAttribute('tabindex') != null) {\n return true;\n }\n if (elem.getAttribute('contenteditable') === 'true' || elem.getAttribute('contenteditable') === 'plaintext-only') {\n return true;\n }\n if (elem instanceof HTMLAnchorElement && elem.getAttribute('href') == null) {\n return false;\n }\n return elem.tabIndex !== -1;\n}\nfunction isTabbable(elem, strict = false) {\n return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';\n}\n\nexport { getFocusableChild, isFocusable, isTabbable, iterateFocusableElements };\n","let signalSupported = false;\nfunction noop() { }\ntry {\n const options = Object.create({}, {\n signal: {\n get() {\n signalSupported = true;\n },\n },\n });\n window.addEventListener('test', noop, options);\n window.removeEventListener('test', noop, options);\n}\ncatch (e) {\n}\nfunction featureSupported() {\n return signalSupported;\n}\nfunction monkeyPatch() {\n if (typeof window === 'undefined') {\n return;\n }\n const originalAddEventListener = EventTarget.prototype.addEventListener;\n EventTarget.prototype.addEventListener = function (name, originalCallback, optionsOrCapture) {\n if (typeof optionsOrCapture === 'object' &&\n 'signal' in optionsOrCapture &&\n optionsOrCapture.signal instanceof AbortSignal) {\n originalAddEventListener.call(optionsOrCapture.signal, 'abort', () => {\n this.removeEventListener(name, originalCallback, optionsOrCapture);\n });\n }\n return originalAddEventListener.call(this, name, originalCallback, optionsOrCapture);\n };\n}\nfunction polyfill() {\n if (!featureSupported()) {\n monkeyPatch();\n signalSupported = true;\n }\n}\n\nexport { polyfill };\n","import { getFocusableChild, isTabbable } from './utils/iterate-focusable-elements.mjs';\nimport { polyfill } from './polyfills/event-listener-signal.mjs';\n\npolyfill();\nconst suspendedTrapStack = [];\nlet activeTrap = undefined;\nfunction tryReactivate() {\n const trapToReactivate = suspendedTrapStack.pop();\n if (trapToReactivate) {\n focusTrap(trapToReactivate.container, trapToReactivate.initialFocus, trapToReactivate.originalSignal);\n }\n}\nfunction followSignal(signal) {\n const controller = new AbortController();\n signal.addEventListener('abort', () => {\n controller.abort();\n });\n return controller;\n}\nfunction observeFocusTrap(container, sentinels) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList' && mutation.addedNodes.length) {\n const sentinelChildren = Array.from(mutation.addedNodes).filter(e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN');\n if (sentinelChildren.length) {\n return;\n }\n const firstChild = container.firstElementChild;\n const lastChild = container.lastElementChild;\n const [sentinelStart, sentinelEnd] = sentinels;\n if (!(firstChild === null || firstChild === void 0 ? void 0 : firstChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('afterbegin', sentinelStart);\n }\n if (!(lastChild === null || lastChild === void 0 ? void 0 : lastChild.classList.contains('sentinel'))) {\n container.insertAdjacentElement('beforeend', sentinelEnd);\n }\n }\n }\n });\n observer.observe(container, { childList: true });\n return observer;\n}\nfunction focusTrap(container, initialFocus, abortSignal) {\n const controller = new AbortController();\n const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;\n container.setAttribute('data-focus-trap', 'active');\n const sentinelStart = document.createElement('span');\n sentinelStart.setAttribute('class', 'sentinel');\n sentinelStart.setAttribute('tabindex', '0');\n sentinelStart.setAttribute('aria-hidden', 'true');\n sentinelStart.onfocus = () => {\n const lastFocusableChild = getFocusableChild(container, true);\n lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();\n };\n const sentinelEnd = document.createElement('span');\n sentinelEnd.setAttribute('class', 'sentinel');\n sentinelEnd.setAttribute('tabindex', '0');\n sentinelEnd.setAttribute('aria-hidden', 'true');\n sentinelEnd.onfocus = () => {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n };\n container.prepend(sentinelStart);\n container.append(sentinelEnd);\n const observer = observeFocusTrap(container, [sentinelStart, sentinelEnd]);\n let lastFocusedChild = undefined;\n function ensureTrapZoneHasFocus(focusedElement) {\n if (focusedElement instanceof HTMLElement && document.contains(container)) {\n if (container.contains(focusedElement)) {\n lastFocusedChild = focusedElement;\n return;\n }\n else {\n if (lastFocusedChild && isTabbable(lastFocusedChild) && container.contains(lastFocusedChild)) {\n lastFocusedChild.focus();\n return;\n }\n else if (initialFocus && container.contains(initialFocus)) {\n initialFocus.focus();\n return;\n }\n else {\n const firstFocusableChild = getFocusableChild(container);\n firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();\n return;\n }\n }\n }\n }\n const wrappingController = followSignal(signal);\n if (activeTrap) {\n const suspendedTrap = activeTrap;\n activeTrap.container.setAttribute('data-focus-trap', 'suspended');\n activeTrap.controller.abort();\n suspendedTrapStack.push(suspendedTrap);\n }\n wrappingController.signal.addEventListener('abort', () => {\n activeTrap = undefined;\n });\n signal.addEventListener('abort', () => {\n container.removeAttribute('data-focus-trap');\n const sentinels = container.getElementsByClassName('sentinel');\n while (sentinels.length > 0)\n sentinels[0].remove();\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n observer.disconnect();\n tryReactivate();\n });\n document.addEventListener('focus', event => {\n ensureTrapZoneHasFocus(event.target);\n }, { signal: wrappingController.signal, capture: true });\n ensureTrapZoneHasFocus(document.activeElement);\n activeTrap = {\n container,\n controller: wrappingController,\n initialFocus,\n originalSignal: signal,\n };\n const suspendedTrapIndex = suspendedTrapStack.findIndex(t => t.container === container);\n if (suspendedTrapIndex >= 0) {\n suspendedTrapStack.splice(suspendedTrapIndex, 1);\n }\n if (!abortSignal) {\n return controller;\n }\n}\n\nexport { focusTrap };\n","let isMac = undefined;\nfunction isMacOS() {\n if (isMac === undefined) {\n isMac = /^mac/i.test(window.navigator.platform);\n }\n return isMac;\n}\n\nexport { isMacOS };\n","let idSeed = 10000;\nfunction uniqueId() {\n return `__primer_id_${idSeed++}`;\n}\n\nexport { uniqueId };\n","import { polyfill } from './polyfills/event-listener-signal.mjs';\nimport { isMacOS } from './utils/user-agent.mjs';\nimport { iterateFocusableElements } from './utils/iterate-focusable-elements.mjs';\nimport { uniqueId } from './utils/unique-id.mjs';\n\npolyfill();\nvar FocusKeys;\n(function (FocusKeys) {\n FocusKeys[FocusKeys[\"ArrowHorizontal\"] = 1] = \"ArrowHorizontal\";\n FocusKeys[FocusKeys[\"ArrowVertical\"] = 2] = \"ArrowVertical\";\n FocusKeys[FocusKeys[\"JK\"] = 4] = \"JK\";\n FocusKeys[FocusKeys[\"HL\"] = 8] = \"HL\";\n FocusKeys[FocusKeys[\"HomeAndEnd\"] = 16] = \"HomeAndEnd\";\n FocusKeys[FocusKeys[\"PageUpDown\"] = 256] = \"PageUpDown\";\n FocusKeys[FocusKeys[\"WS\"] = 32] = \"WS\";\n FocusKeys[FocusKeys[\"AD\"] = 64] = \"AD\";\n FocusKeys[FocusKeys[\"Tab\"] = 128] = \"Tab\";\n FocusKeys[FocusKeys[\"Backspace\"] = 512] = \"Backspace\";\n FocusKeys[FocusKeys[\"ArrowAll\"] = 3] = \"ArrowAll\";\n FocusKeys[FocusKeys[\"HJKL\"] = 12] = \"HJKL\";\n FocusKeys[FocusKeys[\"WASD\"] = 96] = \"WASD\";\n FocusKeys[FocusKeys[\"All\"] = 511] = \"All\";\n})(FocusKeys || (FocusKeys = {}));\nconst KEY_TO_BIT = {\n ArrowLeft: FocusKeys.ArrowHorizontal,\n ArrowDown: FocusKeys.ArrowVertical,\n ArrowUp: FocusKeys.ArrowVertical,\n ArrowRight: FocusKeys.ArrowHorizontal,\n h: FocusKeys.HL,\n j: FocusKeys.JK,\n k: FocusKeys.JK,\n l: FocusKeys.HL,\n a: FocusKeys.AD,\n s: FocusKeys.WS,\n w: FocusKeys.WS,\n d: FocusKeys.AD,\n Tab: FocusKeys.Tab,\n Home: FocusKeys.HomeAndEnd,\n End: FocusKeys.HomeAndEnd,\n PageUp: FocusKeys.PageUpDown,\n PageDown: FocusKeys.PageUpDown,\n Backspace: FocusKeys.Backspace,\n};\nconst KEY_TO_DIRECTION = {\n ArrowLeft: 'previous',\n ArrowDown: 'next',\n ArrowUp: 'previous',\n ArrowRight: 'next',\n h: 'previous',\n j: 'next',\n k: 'previous',\n l: 'next',\n a: 'previous',\n s: 'next',\n w: 'previous',\n d: 'next',\n Tab: 'next',\n Home: 'start',\n End: 'end',\n PageUp: 'start',\n PageDown: 'end',\n Backspace: 'previous',\n};\nfunction getDirection(keyboardEvent) {\n const direction = KEY_TO_DIRECTION[keyboardEvent.key];\n if (keyboardEvent.key === 'Tab' && keyboardEvent.shiftKey) {\n return 'previous';\n }\n const isMac = isMacOS();\n if ((isMac && keyboardEvent.metaKey) || (!isMac && keyboardEvent.ctrlKey)) {\n if (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowUp') {\n return 'start';\n }\n else if (keyboardEvent.key === 'ArrowRight' || keyboardEvent.key === 'ArrowDown') {\n return 'end';\n }\n }\n return direction;\n}\nfunction shouldIgnoreFocusHandling(keyboardEvent, activeElement) {\n const key = keyboardEvent.key;\n const keyLength = [...key].length;\n const isTextInput = (activeElement instanceof HTMLInputElement && activeElement.type === 'text') ||\n activeElement instanceof HTMLTextAreaElement;\n if (isTextInput && (keyLength === 1 || key === 'Home' || key === 'End')) {\n return true;\n }\n if (activeElement instanceof HTMLSelectElement) {\n if (keyLength === 1) {\n return true;\n }\n if (key === 'ArrowDown' && isMacOS() && !keyboardEvent.metaKey) {\n return true;\n }\n if (key === 'ArrowDown' && !isMacOS() && keyboardEvent.altKey) {\n return true;\n }\n }\n if (activeElement instanceof HTMLTextAreaElement && (key === 'PageUp' || key === 'PageDown')) {\n return true;\n }\n if (isTextInput) {\n const textInput = activeElement;\n const cursorAtStart = textInput.selectionStart === 0 && textInput.selectionEnd === 0;\n const cursorAtEnd = textInput.selectionStart === textInput.value.length && textInput.selectionEnd === textInput.value.length;\n if (key === 'ArrowLeft' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowRight' && !cursorAtEnd) {\n return true;\n }\n if (textInput instanceof HTMLTextAreaElement) {\n if (key === 'ArrowUp' && !cursorAtStart) {\n return true;\n }\n if (key === 'ArrowDown' && !cursorAtEnd) {\n return true;\n }\n }\n }\n return false;\n}\nconst isActiveDescendantAttribute = 'data-is-active-descendant';\nconst activeDescendantActivatedDirectly = 'activated-directly';\nconst activeDescendantActivatedIndirectly = 'activated-indirectly';\nconst hasActiveDescendantAttribute = 'data-has-active-descendant';\nfunction focusZone(container, settings) {\n var _a, _b, _c, _d, _e;\n const focusableElements = [];\n const savedTabIndex = new WeakMap();\n const bindKeys = (_a = settings === null || settings === void 0 ? void 0 : settings.bindKeys) !== null && _a !== void 0 ? _a : ((settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) ? FocusKeys.ArrowAll : FocusKeys.ArrowVertical) | FocusKeys.HomeAndEnd;\n const focusOutBehavior = (_b = settings === null || settings === void 0 ? void 0 : settings.focusOutBehavior) !== null && _b !== void 0 ? _b : 'stop';\n const focusInStrategy = (_c = settings === null || settings === void 0 ? void 0 : settings.focusInStrategy) !== null && _c !== void 0 ? _c : 'previous';\n const activeDescendantControl = settings === null || settings === void 0 ? void 0 : settings.activeDescendantControl;\n const activeDescendantCallback = settings === null || settings === void 0 ? void 0 : settings.onActiveDescendantChanged;\n let currentFocusedElement;\n const preventScroll = (_d = settings === null || settings === void 0 ? void 0 : settings.preventScroll) !== null && _d !== void 0 ? _d : false;\n function getFirstFocusableElement() {\n return focusableElements[0];\n }\n function isActiveDescendantInputFocused() {\n return document.activeElement === activeDescendantControl;\n }\n function updateFocusedElement(to, directlyActivated = false) {\n const from = currentFocusedElement;\n currentFocusedElement = to;\n if (activeDescendantControl) {\n if (to && isActiveDescendantInputFocused()) {\n setActiveDescendant(from, to, directlyActivated);\n }\n else {\n clearActiveDescendant();\n }\n return;\n }\n if (from && from !== to && savedTabIndex.has(from)) {\n from.setAttribute('tabindex', '-1');\n }\n to === null || to === void 0 ? void 0 : to.setAttribute('tabindex', '0');\n }\n function setActiveDescendant(from, to, directlyActivated = false) {\n if (!to.id) {\n to.setAttribute('id', uniqueId());\n }\n if (from && from !== to) {\n from.removeAttribute(isActiveDescendantAttribute);\n }\n if (!activeDescendantControl ||\n (!directlyActivated && activeDescendantControl.getAttribute('aria-activedescendant') === to.id)) {\n return;\n }\n activeDescendantControl.setAttribute('aria-activedescendant', to.id);\n container.setAttribute(hasActiveDescendantAttribute, to.id);\n to.setAttribute(isActiveDescendantAttribute, directlyActivated ? activeDescendantActivatedDirectly : activeDescendantActivatedIndirectly);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(to, from, directlyActivated);\n }\n function clearActiveDescendant(previouslyActiveElement = currentFocusedElement) {\n if (focusInStrategy === 'first') {\n currentFocusedElement = undefined;\n }\n activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');\n container.removeAttribute(hasActiveDescendantAttribute);\n previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);\n activeDescendantCallback === null || activeDescendantCallback === void 0 ? void 0 : activeDescendantCallback(undefined, previouslyActiveElement, false);\n }\n function beginFocusManagement(...elements) {\n const filteredElements = elements.filter(e => { var _a, _b; return (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.focusableElementFilter) === null || _a === void 0 ? void 0 : _a.call(settings, e)) !== null && _b !== void 0 ? _b : true; });\n if (filteredElements.length === 0) {\n return;\n }\n focusableElements.splice(findInsertionIndex(filteredElements), 0, ...filteredElements);\n for (const element of filteredElements) {\n if (!savedTabIndex.has(element)) {\n savedTabIndex.set(element, element.getAttribute('tabindex'));\n }\n element.setAttribute('tabindex', '-1');\n }\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n }\n function findInsertionIndex(elementsToInsert) {\n const firstElementToInsert = elementsToInsert[0];\n if (focusableElements.length === 0)\n return 0;\n let iMin = 0;\n let iMax = focusableElements.length - 1;\n while (iMin <= iMax) {\n const i = Math.floor((iMin + iMax) / 2);\n const element = focusableElements[i];\n if (followsInDocument(firstElementToInsert, element)) {\n iMax = i - 1;\n }\n else {\n iMin = i + 1;\n }\n }\n return iMin;\n }\n function followsInDocument(first, second) {\n return (second.compareDocumentPosition(first) & Node.DOCUMENT_POSITION_PRECEDING) > 0;\n }\n function endFocusManagement(...elements) {\n for (const element of elements) {\n const focusableElementIndex = focusableElements.indexOf(element);\n if (focusableElementIndex >= 0) {\n focusableElements.splice(focusableElementIndex, 1);\n }\n const savedIndex = savedTabIndex.get(element);\n if (savedIndex !== undefined) {\n if (savedIndex === null) {\n element.removeAttribute('tabindex');\n }\n else {\n element.setAttribute('tabindex', savedIndex);\n }\n savedTabIndex.delete(element);\n }\n if (element === currentFocusedElement) {\n const nextElementToFocus = getFirstFocusableElement();\n updateFocusedElement(nextElementToFocus);\n }\n }\n }\n const iterateFocusableElementsOptions = {\n reverse: settings === null || settings === void 0 ? void 0 : settings.reverse,\n strict: settings === null || settings === void 0 ? void 0 : settings.strict,\n onlyTabbable: settings === null || settings === void 0 ? void 0 : settings.onlyTabbable,\n };\n beginFocusManagement(...iterateFocusableElements(container, iterateFocusableElementsOptions));\n const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();\n updateFocusedElement(initialElement);\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const removedNode of mutation.removedNodes) {\n if (removedNode instanceof HTMLElement) {\n endFocusManagement(...iterateFocusableElements(removedNode));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue === null) {\n if (mutation.target instanceof HTMLElement) {\n endFocusManagement(mutation.target);\n }\n }\n }\n for (const mutation of mutations) {\n for (const addedNode of mutation.addedNodes) {\n if (addedNode instanceof HTMLElement) {\n beginFocusManagement(...iterateFocusableElements(addedNode, iterateFocusableElementsOptions));\n }\n }\n if (mutation.type === 'attributes' && mutation.oldValue !== null) {\n if (mutation.target instanceof HTMLElement) {\n beginFocusManagement(mutation.target);\n }\n }\n }\n });\n observer.observe(container, {\n subtree: true,\n childList: true,\n attributeFilter: ['hidden', 'disabled'],\n attributeOldValue: true,\n });\n const controller = new AbortController();\n const signal = (_e = settings === null || settings === void 0 ? void 0 : settings.abortSignal) !== null && _e !== void 0 ? _e : controller.signal;\n signal.addEventListener('abort', () => {\n endFocusManagement(...focusableElements);\n });\n let elementIndexFocusedByClick = undefined;\n container.addEventListener('mousedown', event => {\n if (event.target instanceof HTMLElement && event.target !== document.activeElement) {\n elementIndexFocusedByClick = focusableElements.indexOf(event.target);\n }\n }, { signal });\n if (activeDescendantControl) {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement && focusableElements.includes(event.target)) {\n activeDescendantControl.focus({ preventScroll });\n updateFocusedElement(event.target);\n }\n });\n container.addEventListener('mousemove', ({ target }) => {\n if (!(target instanceof Node)) {\n return;\n }\n const focusableElement = focusableElements.find(element => element.contains(target));\n if (focusableElement) {\n updateFocusedElement(focusableElement);\n }\n }, { signal, capture: true });\n activeDescendantControl.addEventListener('focusin', () => {\n if (!currentFocusedElement) {\n updateFocusedElement(getFirstFocusableElement());\n }\n else {\n setActiveDescendant(undefined, currentFocusedElement);\n }\n });\n activeDescendantControl.addEventListener('focusout', () => {\n clearActiveDescendant();\n });\n }\n else {\n container.addEventListener('focusin', event => {\n if (event.target instanceof HTMLElement) {\n if (elementIndexFocusedByClick !== undefined) {\n if (elementIndexFocusedByClick >= 0) {\n if (focusableElements[elementIndexFocusedByClick] !== currentFocusedElement) {\n updateFocusedElement(focusableElements[elementIndexFocusedByClick]);\n }\n }\n elementIndexFocusedByClick = undefined;\n }\n else {\n if (focusInStrategy === 'previous') {\n updateFocusedElement(event.target);\n }\n else if (focusInStrategy === 'closest' || focusInStrategy === 'first') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const targetElementIndex = lastKeyboardFocusDirection === 'previous' ? focusableElements.length - 1 : 0;\n const targetElement = focusableElements[targetElementIndex];\n targetElement === null || targetElement === void 0 ? void 0 : targetElement.focus({ preventScroll });\n return;\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n else if (typeof focusInStrategy === 'function') {\n if (event.relatedTarget instanceof Element && !container.contains(event.relatedTarget)) {\n const elementToFocus = focusInStrategy(event.relatedTarget);\n const requestedFocusElementIndex = elementToFocus ? focusableElements.indexOf(elementToFocus) : -1;\n if (requestedFocusElementIndex >= 0 && elementToFocus instanceof HTMLElement) {\n elementToFocus.focus({ preventScroll });\n return;\n }\n else {\n console.warn('Element requested is not a known focusable element.');\n }\n }\n else {\n updateFocusedElement(event.target);\n }\n }\n }\n }\n lastKeyboardFocusDirection = undefined;\n }, { signal });\n }\n const keyboardEventRecipient = activeDescendantControl !== null && activeDescendantControl !== void 0 ? activeDescendantControl : container;\n let lastKeyboardFocusDirection = undefined;\n if (focusInStrategy === 'closest') {\n document.addEventListener('keydown', event => {\n if (event.key === 'Tab') {\n lastKeyboardFocusDirection = getDirection(event);\n }\n }, { signal, capture: true });\n }\n function getCurrentFocusedIndex() {\n if (!currentFocusedElement) {\n return 0;\n }\n const focusedIndex = focusableElements.indexOf(currentFocusedElement);\n const fallbackIndex = currentFocusedElement === container ? -1 : 0;\n return focusedIndex !== -1 ? focusedIndex : fallbackIndex;\n }\n keyboardEventRecipient.addEventListener('keydown', event => {\n var _a;\n if (event.key in KEY_TO_DIRECTION) {\n const keyBit = KEY_TO_BIT[event.key];\n if (!event.defaultPrevented &&\n (keyBit & bindKeys) > 0 &&\n !shouldIgnoreFocusHandling(event, document.activeElement)) {\n const direction = getDirection(event);\n let nextElementToFocus = undefined;\n if (settings === null || settings === void 0 ? void 0 : settings.getNextFocusable) {\n nextElementToFocus = settings.getNextFocusable(direction, (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined, event);\n }\n if (!nextElementToFocus) {\n const lastFocusedIndex = getCurrentFocusedIndex();\n let nextFocusedIndex = lastFocusedIndex;\n if (direction === 'previous') {\n nextFocusedIndex -= 1;\n }\n else if (direction === 'start') {\n nextFocusedIndex = 0;\n }\n else if (direction === 'next') {\n nextFocusedIndex += 1;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n if (nextFocusedIndex < 0) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = focusableElements.length - 1;\n }\n else {\n nextFocusedIndex = 0;\n }\n }\n if (nextFocusedIndex >= focusableElements.length) {\n if (focusOutBehavior === 'wrap' && event.key !== 'Tab') {\n nextFocusedIndex = 0;\n }\n else {\n nextFocusedIndex = focusableElements.length - 1;\n }\n }\n if (lastFocusedIndex !== nextFocusedIndex) {\n nextElementToFocus = focusableElements[nextFocusedIndex];\n }\n }\n if (activeDescendantControl) {\n updateFocusedElement(nextElementToFocus || currentFocusedElement, true);\n }\n else if (nextElementToFocus) {\n lastKeyboardFocusDirection = direction;\n nextElementToFocus.focus({ preventScroll });\n }\n if (event.key !== 'Tab' || nextElementToFocus) {\n event.preventDefault();\n }\n }\n }\n }, { signal });\n return controller;\n}\n\nexport { FocusKeys, activeDescendantActivatedDirectly, activeDescendantActivatedIndirectly, focusZone, hasActiveDescendantAttribute, isActiveDescendantAttribute };\n","import {controller, targets, target} from '@github/catalyst'\nimport {focusZone, FocusKeys} from '@primer/behaviors'\nimport {ActionMenuElement} from './action_menu/action_menu_element'\n\nconst instersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (entry.isIntersecting && action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\nconst resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const action = entry.target\n if (action instanceof ActionBarElement) {\n action.update()\n }\n }\n})\n\n// These are definitely used, but eslint is dumb apparently\n\nenum ItemType {\n Item,\n Divider,\n}\n\n@controller\nclass ActionBarElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target itemContainer: HTMLElement\n @target moreMenu: ActionMenuElement\n\n #focusZoneAbortController: AbortController | null = null\n\n connectedCallback() {\n // Calculate the width of all the items before hiding anything\n for (const item of this.items) {\n const width = item.getBoundingClientRect().width\n const marginLeft = parseInt(window.getComputedStyle(item)?.marginLeft, 10)\n const marginRight = parseInt(window.getComputedStyle(item)?.marginRight, 10)\n item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`)\n }\n\n resizeObserver.observe(this)\n instersectionObserver.observe(this)\n\n requestAnimationFrame(() => {\n // This overflow visible is needed for browsers that don't support PopoverElement\n // to ensure the menu and tooltips are visible when the action bar is in a collapsed state\n // once popover is fully supported we can remove this.style.overflow = 'visible'\n this.style.overflow = 'visible'\n this.update()\n })\n }\n\n disconnectedCallback() {\n resizeObserver.unobserve(this)\n instersectionObserver.unobserve(this)\n }\n\n menuItemClick(event: Event) {\n const currentTarget = event.currentTarget as HTMLButtonElement\n\n const id = currentTarget?.getAttribute('data-for')\n\n if (id) {\n document.getElementById(id)?.click()\n }\n }\n\n update() {\n const firstItem = this.#firstItem\n if (!firstItem) return\n\n const firstItemTop = firstItem.getBoundingClientRect().top\n let previousItemType: ItemType | null = null\n\n this.#eachItem((item: HTMLElement, index: number, type: ItemType): boolean => {\n const itemTop = item.getBoundingClientRect().top\n\n if (type === ItemType.Item) {\n if (itemTop > firstItemTop) {\n this.#hideItem(index)\n\n if (this.moreMenu.hidden) {\n this.moreMenu.hidden = false\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#hideItem(index - 1)\n }\n } else {\n this.#showItem(index)\n\n if (index === this.items.length - 1) {\n this.moreMenu.hidden = true\n }\n\n if (previousItemType === ItemType.Divider) {\n this.#showItem(index - 1)\n }\n }\n }\n\n previousItemType = type\n\n return true\n })\n\n if (this.#focusZoneAbortController) {\n this.#focusZoneAbortController.abort()\n }\n\n this.#focusZoneAbortController = focusZone(this, {\n bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,\n focusOutBehavior: 'wrap',\n focusableElementFilter: element => {\n const idx = this.items.indexOf(element.parentElement!)\n const elementIsVisibleItem = idx > -1 && this.items[idx].style.visibility === 'visible'\n const elementIsVisibleActionMenuInvoker = element === this.moreMenu.invokerElement && !this.moreMenu.hidden\n return elementIsVisibleItem || elementIsVisibleActionMenuInvoker\n },\n })\n }\n\n get #firstItem(): HTMLElement | null {\n let foundItem = null\n\n this.#eachItem((item: HTMLElement, _index: number, type: ItemType): boolean => {\n if (type === ItemType.Item) {\n foundItem = item\n return false\n }\n\n return true\n })\n\n return foundItem\n }\n\n #showItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'visible')\n menuItem.hidden = true\n }\n\n #hideItem(index: number) {\n const item = this.items[index]\n const menuItem = this.#menuItems[index]\n if (!item || !menuItem) return\n item.style.setProperty('visibility', 'hidden')\n menuItem.hidden = false\n }\n\n get #menuItems(): NodeListOf<HTMLElement> {\n return this.moreMenu.querySelectorAll('[role=\"menu\"] > li')\n }\n\n #eachItem(callback: (item: HTMLElement, index: number, type: ItemType) => boolean): void {\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i]\n const type = item.classList.contains('ActionBar-divider') ? ItemType.Divider : ItemType.Item\n if (!callback(item, i, type)) {\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ActionBarElement: typeof ActionBarElement\n }\n}\n\nwindow.ActionBarElement = ActionBarElement\n","class DetailsMenuElement extends HTMLElement {\n get preload() {\n return this.hasAttribute('preload');\n }\n set preload(value) {\n if (value) {\n this.setAttribute('preload', '');\n }\n else {\n this.removeAttribute('preload');\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n connectedCallback() {\n if (!this.hasAttribute('role'))\n this.setAttribute('role', 'menu');\n const details = this.parentElement;\n if (!details)\n return;\n const summary = details.querySelector('summary');\n if (summary) {\n summary.setAttribute('aria-haspopup', 'menu');\n if (!summary.hasAttribute('role'))\n summary.setAttribute('role', 'button');\n }\n const subscriptions = [\n fromEvent(details, 'compositionstart', e => trackComposition(this, e)),\n fromEvent(details, 'compositionend', e => trackComposition(this, e)),\n fromEvent(details, 'click', e => shouldCommit(details, e)),\n fromEvent(details, 'change', e => shouldCommit(details, e)),\n fromEvent(details, 'keydown', e => keydown(details, this, e)),\n fromEvent(details, 'toggle', () => loadFragment(details, this), { once: true }),\n fromEvent(details, 'toggle', () => closeCurrentMenu(details)),\n this.preload\n ? fromEvent(details, 'mouseover', () => loadFragment(details, this), { once: true })\n : NullSubscription,\n ...focusOnOpen(details)\n ];\n states.set(this, { subscriptions, loaded: false, isComposing: false });\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n for (const sub of state.subscriptions) {\n sub.unsubscribe();\n }\n }\n}\nconst states = new WeakMap();\nconst NullSubscription = {\n unsubscribe() {\n }\n};\nfunction fromEvent(target, eventName, onNext, options = false) {\n target.addEventListener(eventName, onNext, options);\n return {\n unsubscribe: () => {\n target.removeEventListener(eventName, onNext, options);\n }\n };\n}\nfunction loadFragment(details, menu) {\n const src = menu.getAttribute('src');\n if (!src)\n return;\n const state = states.get(menu);\n if (!state)\n return;\n if (state.loaded)\n return;\n state.loaded = true;\n const loader = menu.querySelector('include-fragment');\n if (loader && !loader.hasAttribute('src')) {\n loader.addEventListener('loadend', () => autofocus(details));\n loader.setAttribute('src', src);\n }\n}\nfunction focusOnOpen(details) {\n let isMouse = false;\n const onmousedown = () => (isMouse = true);\n const onkeydown = () => (isMouse = false);\n const ontoggle = () => {\n if (!details.hasAttribute('open'))\n return;\n if (autofocus(details))\n return;\n if (!isMouse)\n focusFirstItem(details);\n };\n return [\n fromEvent(details, 'mousedown', onmousedown),\n fromEvent(details, 'keydown', onkeydown),\n fromEvent(details, 'toggle', ontoggle)\n ];\n}\nfunction closeCurrentMenu(details) {\n if (!details.hasAttribute('open'))\n return;\n for (const menu of document.querySelectorAll('details[open] > details-menu')) {\n const opened = menu.closest('details');\n if (opened && opened !== details && !opened.contains(details)) {\n opened.removeAttribute('open');\n }\n }\n}\nfunction autofocus(details) {\n if (!details.hasAttribute('open'))\n return false;\n const input = details.querySelector('details-menu [autofocus]');\n if (input) {\n input.focus();\n return true;\n }\n else {\n return false;\n }\n}\nfunction focusFirstItem(details) {\n const selected = document.activeElement;\n if (selected && isMenuItem(selected) && details.contains(selected))\n return;\n const target = sibling(details, true);\n if (target)\n target.focus();\n}\nfunction sibling(details, next) {\n const options = Array.from(details.querySelectorAll('[role^=\"menuitem\"]:not([hidden]):not([disabled])'));\n const selected = document.activeElement;\n const index = selected instanceof HTMLElement ? options.indexOf(selected) : -1;\n const found = next ? options[index + 1] : options[index - 1];\n const def = next ? options[0] : options[options.length - 1];\n return found || def;\n}\nconst ctrlBindings = navigator.userAgent.match(/Macintosh/);\nfunction shouldCommit(details, event) {\n const target = event.target;\n if (!(target instanceof Element))\n return;\n if (target.closest('details') !== details)\n return;\n if (event.type === 'click') {\n const menuitem = target.closest('[role=\"menuitem\"], [role=\"menuitemradio\"]');\n if (!menuitem)\n return;\n const input = menuitem.querySelector('input');\n if (menuitem.tagName === 'LABEL' && target === input)\n return;\n const onlyCommitOnChangeEvent = menuitem.tagName === 'LABEL' && input && !input.checked;\n if (!onlyCommitOnChangeEvent) {\n commit(menuitem, details);\n }\n }\n else if (event.type === 'change') {\n const menuitem = target.closest('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]');\n if (menuitem)\n commit(menuitem, details);\n }\n}\nfunction updateChecked(selected, details) {\n for (const el of details.querySelectorAll('[role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]')) {\n const input = el.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n let checkState = (el === selected).toString();\n if (input instanceof HTMLInputElement) {\n checkState = input.indeterminate ? 'mixed' : input.checked.toString();\n }\n el.setAttribute('aria-checked', checkState);\n }\n}\nfunction commit(selected, details) {\n if (selected.hasAttribute('disabled') || selected.getAttribute('aria-disabled') === 'true')\n return;\n const menu = selected.closest('details-menu');\n if (!menu)\n return;\n const dispatched = menu.dispatchEvent(new CustomEvent('details-menu-select', {\n cancelable: true,\n detail: { relatedTarget: selected }\n }));\n if (!dispatched)\n return;\n updateLabel(selected, details);\n updateChecked(selected, details);\n if (selected.getAttribute('role') !== 'menuitemcheckbox')\n close(details);\n menu.dispatchEvent(new CustomEvent('details-menu-selected', {\n detail: { relatedTarget: selected }\n }));\n}\nfunction keydown(details, menu, event) {\n if (!(event instanceof KeyboardEvent))\n return;\n if (details.querySelector('details[open]'))\n return;\n const state = states.get(menu);\n if (!state || state.isComposing)\n return;\n const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';\n switch (event.key) {\n case 'Escape':\n if (details.hasAttribute('open')) {\n close(details);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n case 'ArrowDown':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'ArrowUp':\n {\n if (isSummaryFocused && !details.hasAttribute('open')) {\n details.setAttribute('open', '');\n }\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n break;\n case 'n':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, true);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case 'p':\n {\n if (ctrlBindings && event.ctrlKey) {\n const target = sibling(details, false);\n if (target)\n target.focus();\n event.preventDefault();\n }\n }\n break;\n case ' ':\n case 'Enter':\n {\n const selected = document.activeElement;\n if (selected instanceof HTMLElement && isMenuItem(selected) && selected.closest('details') === details) {\n event.preventDefault();\n event.stopPropagation();\n selected.click();\n }\n }\n break;\n }\n}\nfunction isMenuItem(el) {\n const role = el.getAttribute('role');\n return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';\n}\nfunction close(details) {\n const wasOpen = details.hasAttribute('open');\n if (!wasOpen)\n return;\n details.removeAttribute('open');\n const summary = details.querySelector('summary');\n if (summary)\n summary.focus();\n}\nfunction updateLabel(item, details) {\n const button = details.querySelector('[data-menu-button]');\n if (!button)\n return;\n const text = labelText(item);\n if (text) {\n button.textContent = text;\n }\n else {\n const html = labelHTML(item);\n if (html)\n button.innerHTML = html;\n }\n}\nfunction labelText(el) {\n if (!el)\n return null;\n const textEl = el.hasAttribute('data-menu-button-text') ? el : el.querySelector('[data-menu-button-text]');\n if (!textEl)\n return null;\n return textEl.getAttribute('data-menu-button-text') || textEl.textContent;\n}\nfunction labelHTML(el) {\n if (!el)\n return null;\n const contentsEl = el.hasAttribute('data-menu-button-contents') ? el : el.querySelector('[data-menu-button-contents]');\n return contentsEl ? contentsEl.innerHTML : null;\n}\nfunction trackComposition(menu, event) {\n const state = states.get(menu);\n if (!state)\n return;\n state.isComposing = event.type === 'compositionstart';\n}\nexport default DetailsMenuElement;\nif (!window.customElements.get('details-menu')) {\n window.DetailsMenuElement = DetailsMenuElement;\n window.customElements.define('details-menu', DetailsMenuElement);\n}\n","import type {AnchorAlignment, AnchorSide, PositionSettings} from '@primer/behaviors'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst updateWhenVisible = (() => {\n const anchors = new Set<AnchoredPositionElement>()\n let intersectionObserver: IntersectionObserver | null = null\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.update()\n }\n }\n return (el: AnchoredPositionElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n intersectionObserver ||= new IntersectionObserver(entries => {\n for (const entry of entries) {\n const target = entry.target as AnchoredPositionElement\n if (entry.isIntersecting) {\n target.update()\n anchors.add(target)\n } else {\n anchors.delete(target)\n }\n }\n })\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.update()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n intersectionObserver.observe(el)\n }\n})()\n\nexport default class AnchoredPositionElement extends HTMLElement implements PositionSettings {\n get align(): AnchorAlignment {\n const value = this.getAttribute('align')\n if (value === 'center' || value === 'end') return value\n return 'start'\n }\n\n set align(value: AnchorAlignment) {\n this.setAttribute('align', `${value}`)\n }\n\n get side(): AnchorSide {\n const value = this.getAttribute('side')\n if (\n value === 'inside-top' ||\n value === 'inside-bottom' ||\n value === 'inside-left' ||\n value === 'inside-right' ||\n value === 'inside-center' ||\n value === 'outside-top' ||\n value === 'outside-left' ||\n value === 'outside-right'\n ) {\n return value\n }\n return 'outside-bottom'\n }\n\n set side(value: AnchorSide) {\n this.setAttribute('side', `${value}`)\n }\n\n get anchorOffset(): number {\n const alias = this.getAttribute('anchor-offset')\n if (alias === 'spacious' || alias === '8') return 8\n return 4\n }\n\n set anchorOffset(value: number | 'normal' | 'spacious') {\n this.setAttribute('anchor-offset', `${value}`)\n }\n\n get anchor() {\n return this.getAttribute('anchor') || ''\n }\n\n set anchor(value: string) {\n this.setAttribute('anchor', `${value}`)\n }\n\n #anchorElement: HTMLElement | null = null\n get anchorElement(): HTMLElement | null {\n if (this.#anchorElement) return this.#anchorElement\n const idRef = this.anchor\n if (!idRef) return null\n return this.ownerDocument.getElementById(idRef)\n }\n\n set anchorElement(value: HTMLElement | null) {\n this.#anchorElement = value\n if (!this.#anchorElement) {\n this.removeAttribute('anchor')\n }\n }\n\n get alignmentOffset(): number {\n return Number(this.getAttribute('alignment-offset'))\n }\n\n set alignmentOffset(value: number) {\n this.setAttribute('alignment-offset', `${value}`)\n }\n\n get allowOutOfBounds() {\n return this.hasAttribute('allow-out-of-bounds')\n }\n\n set allowOutOfBounds(value: boolean) {\n this.toggleAttribute('allow-out-of-bounds', value)\n }\n\n connectedCallback() {\n this.update()\n this.addEventListener('beforetoggle', () => this.update())\n updateWhenVisible(this)\n }\n\n static observedAttributes = ['align', 'side', 'anchor', 'alignment-offset', 'allow-out-of-bounds']\n attributeChangedCallback() {\n this.update()\n }\n\n #animationFrame: ReturnType<typeof requestAnimationFrame>\n update() {\n if (!this.isConnected) return\n cancelAnimationFrame(this.#animationFrame)\n\n this.#animationFrame = requestAnimationFrame(() => {\n const anchor = this.anchorElement\n this.classList.toggle('not-anchored', !anchor)\n if (anchor) {\n const {left, top} = getAnchoredPosition(this, anchor, this)\n this.style.top = `${top}px`\n this.style.left = `${left}px`\n this.style.bottom = 'auto'\n this.style.right = 'auto'\n } else {\n this.style.top = '0'\n this.style.left = '0'\n this.style.bottom = '0'\n this.style.right = '0'\n }\n })\n }\n}\n\nif (!customElements.get('anchored-position')) {\n window.AnchoredPositionElement = AnchoredPositionElement\n customElements.define('anchored-position', AnchoredPositionElement)\n}\n\ndeclare global {\n interface Window {\n AnchoredPositionElement: typeof AnchoredPositionElement\n }\n}\n","function dialogInvokerButtonHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement) {\n dialog.showModal()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n\n // In some older browsers, such as Chrome 122, when a top layer element (such as a dialog)\n // opens from within a popover, the \"hide all popovers\" internal algorithm runs, hiding\n // any popover that is currently open, regardless of whether or not another top layer element,\n // such as a <dialog> is nested inside.\n // See https://github.com/whatwg/html/issues/9998.\n // This is fixed by https://github.com/whatwg/html/pull/10116, but while we still support browsers\n // that present this bug, we must undo the work they did to hide ancestral popovers of the dialog:\n let node: HTMLElement | null | undefined = button\n let fixed = false\n while (node) {\n node = node.parentElement?.closest('[popover]:not(:popover-open)')\n if (node && node.popover === 'auto') {\n node.classList.add('dialog-inside-popover-fix')\n node.popover = 'manual'\n node.showPopover()\n fixed = true\n }\n }\n if (fixed) {\n // We need to re-open the dialog as modal, and also ensure no close event listeners\n // are trying to act on the close\n /* eslint-disable-next-line no-restricted-syntax */\n dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n dialog.close()\n dialog.showModal()\n dialog.addEventListener(\n 'close',\n () => {\n for (const el of dialog.ownerDocument.querySelectorAll<HTMLElement>('.dialog-inside-popover-fix')) {\n if (el.contains(dialog)) {\n el.classList.remove('dialog-inside-popover-fix')\n el.popover = 'auto'\n el.showPopover()\n }\n }\n },\n {once: true},\n )\n }\n }\n }\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof HTMLDialogElement && dialog.open) {\n dialog.close()\n }\n }\n}\n\nexport class DialogHelperElement extends HTMLElement {\n get dialog() {\n return this.querySelector('dialog')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n document.addEventListener('click', dialogInvokerButtonHandler, true)\n document.addEventListener('click', this, {signal})\n this.ownerDocument.body.style.setProperty(\n '--dialog-scrollgutter',\n `${window.innerWidth - this.ownerDocument.body.clientWidth}px`,\n )\n new MutationObserver(records => {\n for (const record of records) {\n if (record.target === this.dialog) {\n this.#handleDialogOpenAttribute()\n }\n }\n }).observe(this, {subtree: true, attributeFilter: ['open']})\n this.#handleDialogOpenAttribute()\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n #handleDialogOpenAttribute() {\n if (!this.dialog) return\n // We don't want to show the Dialog component as non-modal\n if (this.dialog.matches('[open]:not(:modal)')) {\n // eslint-disable-next-line no-restricted-syntax\n this.dialog.addEventListener('close', e => e.stopImmediatePropagation(), {once: true})\n this.dialog.close()\n this.dialog.showModal()\n }\n }\n\n handleEvent(event: MouseEvent) {\n const target = event.target as HTMLElement\n const dialog = this.dialog\n // The click target _must_ be the dialog element itself, and not elements underneath or inside.\n if (target !== dialog || !dialog?.open) return\n\n const rect = dialog.getBoundingClientRect()\n const clickWasInsideDialog =\n rect.top <= event.clientY &&\n event.clientY <= rect.top + rect.height &&\n rect.left <= event.clientX &&\n event.clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n dialog.close()\n }\n }\n}\n\ndeclare global {\n interface Window {\n DialogHelperElement: typeof DialogHelperElement\n }\n interface HTMLElementTagNameMap {\n 'dialog-helper': DialogHelperElement\n }\n}\n\nif (!window.customElements.get('dialog-helper')) {\n window.DialogHelperElement = DialogHelperElement\n window.customElements.define('dialog-helper', DialogHelperElement)\n}\n","// src/events.ts\nvar ToggleEvent = class extends Event {\n oldState;\n newState;\n constructor(type, { oldState = \"\", newState = \"\", ...init } = {}) {\n super(type, init);\n this.oldState = String(oldState || \"\");\n this.newState = String(newState || \"\");\n }\n};\nvar popoverToggleTaskQueue = /* @__PURE__ */ new WeakMap();\nfunction queuePopoverToggleEventTask(element, oldState, newState) {\n popoverToggleTaskQueue.set(\n element,\n setTimeout(() => {\n if (!popoverToggleTaskQueue.has(element)) return;\n element.dispatchEvent(\n new ToggleEvent(\"toggle\", {\n cancelable: false,\n oldState,\n newState\n })\n );\n }, 0)\n );\n}\n\n// src/popover-helpers.ts\nvar ShadowRoot = globalThis.ShadowRoot || function() {\n};\nvar HTMLDialogElement = globalThis.HTMLDialogElement || function() {\n};\nvar topLayerElements = /* @__PURE__ */ new WeakMap();\nvar autoPopoverList = /* @__PURE__ */ new WeakMap();\nvar visibilityState = /* @__PURE__ */ new WeakMap();\nfunction getPopoverVisibilityState(popover) {\n return visibilityState.get(popover) || \"hidden\";\n}\nvar popoverInvoker = /* @__PURE__ */ new WeakMap();\nfunction popoverTargetAttributeActivationBehavior(element) {\n const popover = element.popoverTargetElement;\n if (!(popover instanceof HTMLElement)) {\n return;\n }\n const visibility = getPopoverVisibilityState(popover);\n if (element.popoverTargetAction === \"show\" && visibility === \"showing\") {\n return;\n }\n if (element.popoverTargetAction === \"hide\" && visibility === \"hidden\") return;\n if (visibility === \"showing\") {\n hidePopover(popover, true, true);\n } else if (checkPopoverValidity(popover, false)) {\n popoverInvoker.set(popover, element);\n showPopover(popover);\n }\n}\nfunction checkPopoverValidity(element, expectedToBeShowing) {\n if (element.popover !== \"auto\" && element.popover !== \"manual\") {\n return false;\n }\n if (!element.isConnected) return false;\n if (expectedToBeShowing && getPopoverVisibilityState(element) !== \"showing\") {\n return false;\n }\n if (!expectedToBeShowing && getPopoverVisibilityState(element) !== \"hidden\") {\n return false;\n }\n if (element instanceof HTMLDialogElement && element.hasAttribute(\"open\")) {\n return false;\n }\n if (document.fullscreenElement === element) return false;\n return true;\n}\nfunction getStackPosition(popover) {\n if (!popover) return 0;\n return Array.from(autoPopoverList.get(popover.ownerDocument) || []).indexOf(\n popover\n ) + 1;\n}\nfunction topMostClickedPopover(target) {\n const clickedPopover = nearestInclusiveOpenPopover(target);\n const invokerPopover = nearestInclusiveTargetPopoverForInvoker(target);\n if (getStackPosition(clickedPopover) > getStackPosition(invokerPopover)) {\n return clickedPopover;\n }\n return invokerPopover;\n}\nfunction topMostAutoPopover(document2) {\n const documentPopovers = autoPopoverList.get(document2);\n for (const popover of documentPopovers || []) {\n if (!popover.isConnected) {\n documentPopovers.delete(popover);\n } else {\n return popover;\n }\n }\n return null;\n}\nfunction getRootNode(node) {\n if (typeof node.getRootNode === \"function\") {\n return node.getRootNode();\n }\n if (node.parentNode) return getRootNode(node.parentNode);\n return node;\n}\nfunction nearestInclusiveOpenPopover(node) {\n while (node) {\n if (node instanceof HTMLElement && node.popover === \"auto\" && visibilityState.get(node) === \"showing\") {\n return node;\n }\n node = node instanceof Element && node.assignedSlot || node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction nearestInclusiveTargetPopoverForInvoker(node) {\n while (node) {\n const nodePopover = node.popoverTargetElement;\n if (nodePopover instanceof HTMLElement) return nodePopover;\n node = node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot) node = node.host;\n if (node instanceof Document) return;\n }\n}\nfunction topMostPopoverAncestor(newPopover) {\n const popoverPositions = /* @__PURE__ */ new Map();\n let i = 0;\n for (const popover of autoPopoverList.get(newPopover.ownerDocument) || []) {\n popoverPositions.set(popover, i);\n i += 1;\n }\n popoverPositions.set(newPopover, i);\n i += 1;\n let topMostPopoverAncestor2 = null;\n function checkAncestor(candidate) {\n const candidateAncestor = nearestInclusiveOpenPopover(candidate);\n if (candidateAncestor === null) return null;\n const candidatePosition = popoverPositions.get(candidateAncestor);\n if (topMostPopoverAncestor2 === null || popoverPositions.get(topMostPopoverAncestor2) < candidatePosition) {\n topMostPopoverAncestor2 = candidateAncestor;\n }\n }\n checkAncestor(newPopover.parentElement || getRootNode(newPopover));\n return topMostPopoverAncestor2;\n}\nfunction isFocusable(focusTarget) {\n if (focusTarget.hidden || focusTarget instanceof ShadowRoot) return false;\n if (focusTarget instanceof HTMLButtonElement || focusTarget instanceof HTMLInputElement || focusTarget instanceof HTMLSelectElement || focusTarget instanceof HTMLTextAreaElement || focusTarget instanceof HTMLOptGroupElement || focusTarget instanceof HTMLOptionElement || focusTarget instanceof HTMLFieldSetElement) {\n if (focusTarget.disabled) return false;\n }\n if (focusTarget instanceof HTMLInputElement && focusTarget.type === \"hidden\") {\n return false;\n }\n if (focusTarget instanceof HTMLAnchorElement && focusTarget.href === \"\") {\n return false;\n }\n return typeof focusTarget.tabIndex === \"number\" && focusTarget.tabIndex !== -1;\n}\nfunction focusDelegate(focusTarget) {\n if (focusTarget.shadowRoot && focusTarget.shadowRoot.delegatesFocus !== true) {\n return null;\n }\n let whereToLook = focusTarget;\n if (whereToLook.shadowRoot) {\n whereToLook = whereToLook.shadowRoot;\n }\n let autoFocusDelegate = whereToLook.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n } else {\n const slots = whereToLook.querySelectorAll(\"slot\");\n for (const slot of slots) {\n const assignedElements = slot.assignedElements({ flatten: true });\n for (const el of assignedElements) {\n if (el.hasAttribute(\"autofocus\")) {\n return el;\n } else {\n autoFocusDelegate = el.querySelector(\"[autofocus]\");\n if (autoFocusDelegate) {\n return autoFocusDelegate;\n }\n }\n }\n }\n }\n const walker = focusTarget.ownerDocument.createTreeWalker(\n whereToLook,\n NodeFilter.SHOW_ELEMENT\n );\n let descendant = walker.currentNode;\n while (descendant) {\n if (isFocusable(descendant)) {\n return descendant;\n }\n descendant = walker.nextNode();\n }\n}\nfunction popoverFocusingSteps(subject) {\n focusDelegate(subject)?.focus();\n}\nvar previouslyFocusedElements = /* @__PURE__ */ new WeakMap();\nfunction showPopover(element) {\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (!element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n cancelable: true,\n oldState: \"closed\",\n newState: \"open\"\n })\n )) {\n return;\n }\n if (!checkPopoverValidity(element, false)) {\n return;\n }\n let shouldRestoreFocus = false;\n if (element.popover === \"auto\") {\n const originalType = element.getAttribute(\"popover\");\n const ancestor = topMostPopoverAncestor(element) || document2;\n hideAllPopoversUntil(ancestor, false, true);\n if (originalType !== element.getAttribute(\"popover\") || !checkPopoverValidity(element, false)) {\n return;\n }\n }\n if (!topMostAutoPopover(document2)) {\n shouldRestoreFocus = true;\n }\n previouslyFocusedElements.delete(element);\n const originallyFocusedElement = document2.activeElement;\n element.classList.add(\":popover-open\");\n visibilityState.set(element, \"showing\");\n if (!topLayerElements.has(document2)) {\n topLayerElements.set(document2, /* @__PURE__ */ new Set());\n }\n topLayerElements.get(document2).add(element);\n popoverFocusingSteps(element);\n if (element.popover === \"auto\") {\n if (!autoPopoverList.has(document2)) {\n autoPopoverList.set(document2, /* @__PURE__ */ new Set());\n }\n autoPopoverList.get(document2).add(element);\n setInvokerAriaExpanded(popoverInvoker.get(element), true);\n }\n if (shouldRestoreFocus && originallyFocusedElement && element.popover === \"auto\") {\n previouslyFocusedElements.set(element, originallyFocusedElement);\n }\n queuePopoverToggleEventTask(element, \"closed\", \"open\");\n}\nfunction hidePopover(element, focusPreviousElement = false, fireEvents = false) {\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n const document2 = element.ownerDocument;\n if (element.popover === \"auto\") {\n hideAllPopoversUntil(element, focusPreviousElement, fireEvents);\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n setInvokerAriaExpanded(popoverInvoker.get(element), false);\n popoverInvoker.delete(element);\n if (fireEvents) {\n element.dispatchEvent(\n new ToggleEvent(\"beforetoggle\", {\n oldState: \"open\",\n newState: \"closed\"\n })\n );\n if (!checkPopoverValidity(element, true)) {\n return;\n }\n }\n topLayerElements.get(document2)?.delete(element);\n autoPopoverList.get(document2)?.delete(element);\n element.classList.remove(\":popover-open\");\n visibilityState.set(element, \"hidden\");\n if (fireEvents) {\n queuePopoverToggleEventTask(element, \"open\", \"closed\");\n }\n const previouslyFocusedElement = previouslyFocusedElements.get(element);\n if (previouslyFocusedElement) {\n previouslyFocusedElements.delete(element);\n if (focusPreviousElement) {\n previouslyFocusedElement.focus();\n }\n }\n}\nfunction closeAllOpenPopovers(document2, focusPreviousElement = false, fireEvents = false) {\n let popover = topMostAutoPopover(document2);\n while (popover) {\n hidePopover(popover, focusPreviousElement, fireEvents);\n popover = topMostAutoPopover(document2);\n }\n}\nfunction hideAllPopoversUntil(endpoint, focusPreviousElement, fireEvents) {\n const document2 = endpoint.ownerDocument || endpoint;\n if (endpoint instanceof Document) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n let lastToHide = null;\n let foundEndpoint = false;\n for (const popover of autoPopoverList.get(document2) || []) {\n if (popover === endpoint) {\n foundEndpoint = true;\n } else if (foundEndpoint) {\n lastToHide = popover;\n break;\n }\n }\n if (!foundEndpoint) {\n return closeAllOpenPopovers(document2, focusPreviousElement, fireEvents);\n }\n while (lastToHide && getPopoverVisibilityState(lastToHide) === \"showing\" && autoPopoverList.get(document2)?.size) {\n hidePopover(lastToHide, focusPreviousElement, fireEvents);\n }\n}\nvar popoverPointerDownTargets = /* @__PURE__ */ new WeakMap();\nfunction lightDismissOpenPopovers(event) {\n if (!event.isTrusted) return;\n const target = event.composedPath()[0];\n if (!target) return;\n const document2 = target.ownerDocument;\n const topMostPopover = topMostAutoPopover(document2);\n if (!topMostPopover) return;\n const ancestor = topMostClickedPopover(target);\n if (ancestor && event.type === \"pointerdown\") {\n popoverPointerDownTargets.set(document2, ancestor);\n } else if (event.type === \"pointerup\") {\n const sameTarget = popoverPointerDownTargets.get(document2) === ancestor;\n popoverPointerDownTargets.delete(document2);\n if (sameTarget) {\n hideAllPopoversUntil(ancestor || document2, false, true);\n }\n }\n}\nvar initialAriaExpandedValue = /* @__PURE__ */ new WeakMap();\nfunction setInvokerAriaExpanded(el, force = false) {\n if (!el) return;\n if (!initialAriaExpandedValue.has(el)) {\n initialAriaExpandedValue.set(el, el.getAttribute(\"aria-expanded\"));\n }\n const popover = el.popoverTargetElement;\n if (popover instanceof HTMLElement && popover.popover === \"auto\") {\n el.setAttribute(\"aria-expanded\", String(force));\n } else {\n const initialValue = initialAriaExpandedValue.get(el);\n if (!initialValue) {\n el.removeAttribute(\"aria-expanded\");\n } else {\n el.setAttribute(\"aria-expanded\", initialValue);\n }\n }\n}\n\n// src/popover.ts\nvar ShadowRoot2 = globalThis.ShadowRoot || function() {\n};\nfunction isSupported() {\n return typeof HTMLElement !== \"undefined\" && typeof HTMLElement.prototype === \"object\" && \"popover\" in HTMLElement.prototype;\n}\nfunction patchSelectorFn(object, name, mapper) {\n const original = object[name];\n Object.defineProperty(object, name, {\n value(selector) {\n return original.call(this, mapper(selector));\n }\n });\n}\nvar nonEscapedPopoverSelector = /(^|[^\\\\]):popover-open\\b/g;\nfunction hasLayerSupport() {\n return typeof globalThis.CSSLayerBlockRule === \"function\";\n}\nfunction getStyles() {\n const useLayer = hasLayerSupport();\n return `\n${useLayer ? \"@layer popover-polyfill {\" : \"\"}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${useLayer ? \"}\" : \"\"}\n`;\n}\nvar popoverStyleSheet = null;\nfunction injectStyles(root) {\n const styles = getStyles();\n if (popoverStyleSheet === null) {\n try {\n popoverStyleSheet = new CSSStyleSheet();\n popoverStyleSheet.replaceSync(styles);\n } catch {\n popoverStyleSheet = false;\n }\n }\n if (popoverStyleSheet === false) {\n const sheet = document.createElement(\"style\");\n sheet.textContent = styles;\n if (root instanceof Document) {\n root.head.prepend(sheet);\n } else {\n root.prepend(sheet);\n }\n } else {\n root.adoptedStyleSheets = [popoverStyleSheet, ...root.adoptedStyleSheets];\n }\n}\nfunction apply() {\n if (typeof window === \"undefined\") return;\n window.ToggleEvent = window.ToggleEvent || ToggleEvent;\n function rewriteSelector(selector) {\n if (selector?.includes(\":popover-open\")) {\n selector = selector.replace(\n nonEscapedPopoverSelector,\n \"$1.\\\\:popover-open\"\n );\n }\n return selector;\n }\n patchSelectorFn(Document.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Document.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelector\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"querySelectorAll\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"matches\", rewriteSelector);\n patchSelectorFn(Element.prototype, \"closest\", rewriteSelector);\n patchSelectorFn(\n DocumentFragment.prototype,\n \"querySelectorAll\",\n rewriteSelector\n );\n Object.defineProperties(HTMLElement.prototype, {\n popover: {\n enumerable: true,\n configurable: true,\n get() {\n if (!this.hasAttribute(\"popover\")) return null;\n const value = (this.getAttribute(\"popover\") || \"\").toLowerCase();\n if (value === \"\" || value == \"auto\") return \"auto\";\n return \"manual\";\n },\n set(value) {\n this.setAttribute(\"popover\", value);\n }\n },\n showPopover: {\n enumerable: true,\n configurable: true,\n value() {\n showPopover(this);\n }\n },\n hidePopover: {\n enumerable: true,\n configurable: true,\n value() {\n hidePopover(this, true, true);\n }\n },\n togglePopover: {\n enumerable: true,\n configurable: true,\n value(force) {\n if (visibilityState.get(this) === \"showing\" && force === void 0 || force === false) {\n hidePopover(this, true, true);\n } else if (force === void 0 || force === true) {\n showPopover(this);\n }\n }\n }\n });\n const originalAttachShadow = Element.prototype.attachShadow;\n if (originalAttachShadow) {\n Object.defineProperties(Element.prototype, {\n attachShadow: {\n enumerable: true,\n configurable: true,\n writable: true,\n value(options) {\n const shadowRoot = originalAttachShadow.call(this, options);\n injectStyles(shadowRoot);\n return shadowRoot;\n }\n }\n });\n }\n const originalAttachInternals = HTMLElement.prototype.attachInternals;\n if (originalAttachInternals) {\n Object.defineProperties(HTMLElement.prototype, {\n attachInternals: {\n enumerable: true,\n configurable: true,\n writable: true,\n value() {\n const internals = originalAttachInternals.call(this);\n if (internals.shadowRoot) {\n injectStyles(internals.shadowRoot);\n }\n return internals;\n }\n }\n });\n }\n const popoverTargetAssociatedElements = /* @__PURE__ */ new WeakMap();\n function applyPopoverInvokerElementMixin(ElementClass) {\n Object.defineProperties(ElementClass.prototype, {\n popoverTargetElement: {\n enumerable: true,\n configurable: true,\n set(targetElement) {\n if (targetElement === null) {\n this.removeAttribute(\"popovertarget\");\n popoverTargetAssociatedElements.delete(this);\n } else if (!(targetElement instanceof Element)) {\n throw new TypeError(\n `popoverTargetElement must be an element or null`\n );\n } else {\n this.setAttribute(\"popovertarget\", \"\");\n popoverTargetAssociatedElements.set(this, targetElement);\n }\n },\n get() {\n if (this.localName !== \"button\" && this.localName !== \"input\") {\n return null;\n }\n if (this.localName === \"input\" && this.type !== \"reset\" && this.type !== \"image\" && this.type !== \"button\") {\n return null;\n }\n if (this.disabled) {\n return null;\n }\n if (this.form && this.type === \"submit\") {\n return null;\n }\n const targetElement = popoverTargetAssociatedElements.get(this);\n if (targetElement && targetElement.isConnected) {\n return targetElement;\n } else if (targetElement && !targetElement.isConnected) {\n popoverTargetAssociatedElements.delete(this);\n return null;\n }\n const root = getRootNode(this);\n const idref = this.getAttribute(\"popovertarget\");\n if ((root instanceof Document || root instanceof ShadowRoot2) && idref) {\n return root.getElementById(idref) || null;\n }\n return null;\n }\n },\n popoverTargetAction: {\n enumerable: true,\n configurable: true,\n get() {\n const value = (this.getAttribute(\"popovertargetaction\") || \"\").toLowerCase();\n if (value === \"show\" || value === \"hide\") return value;\n return \"toggle\";\n },\n set(value) {\n this.setAttribute(\"popovertargetaction\", value);\n }\n }\n });\n }\n applyPopoverInvokerElementMixin(HTMLButtonElement);\n applyPopoverInvokerElementMixin(HTMLInputElement);\n const handleInvokerActivation = (event) => {\n const composedPath = event.composedPath();\n const target = composedPath[0];\n if (!(target instanceof Element) || target?.shadowRoot) {\n return;\n }\n const root = getRootNode(target);\n if (!(root instanceof ShadowRoot2 || root instanceof Document)) {\n return;\n }\n const invoker = composedPath.find(\n (el) => el.matches?.(\"[popovertargetaction],[popovertarget]\")\n );\n if (invoker) {\n popoverTargetAttributeActivationBehavior(invoker);\n event.preventDefault();\n return;\n }\n };\n const onKeydown = (event) => {\n const key = event.key;\n const target = event.target;\n if (!event.defaultPrevented && target && (key === \"Escape\" || key === \"Esc\")) {\n hideAllPopoversUntil(target.ownerDocument, true, true);\n }\n };\n const addEventListeners = (root) => {\n root.addEventListener(\"click\", handleInvokerActivation);\n root.addEventListener(\"keydown\", onKeydown);\n root.addEventListener(\"pointerdown\", lightDismissOpenPopovers);\n root.addEventListener(\"pointerup\", lightDismissOpenPopovers);\n };\n addEventListeners(document);\n injectStyles(document);\n}\n\n// src/index.ts\nif (!isSupported()) apply();\n//# sourceMappingURL=popover.js.map\n","import '@oddbird/popover-polyfill'\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]', '[role=\"option\"]']\nconst menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ')\n\nconst getMnemonicFor = (item: Element) => item.textContent?.trim()[0].toLowerCase()\n\nconst printable = /^\\S$/\n\nexport default class FocusGroupElement extends HTMLElement {\n #retainSignal: AbortController | null = null\n\n get nowrap(): boolean {\n return this.hasAttribute('nowrap')\n }\n\n set nowrap(value: boolean) {\n this.toggleAttribute('nowrap', value)\n }\n\n get direction(): 'horizontal' | 'vertical' | 'both' {\n if (this.getAttribute('direction') === 'horizontal') return 'horizontal'\n return 'vertical'\n }\n\n set direction(value: 'horizontal' | 'vertical' | 'both') {\n this.setAttribute('direction', `${value}`)\n }\n\n get retain() {\n return this.hasAttribute('retain')\n }\n\n set retain(value: boolean) {\n this.toggleAttribute('retain', value)\n }\n\n get mnemonics() {\n return this.hasAttribute('mnemonics')\n }\n\n #abortController: AbortController | null = null\n connectedCallback() {\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusin', this, {signal})\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n get #items() {\n return this.querySelectorAll(menuItemSelector)\n }\n\n handleEvent(event: Event) {\n const {direction, nowrap} = this\n if (event.type === 'focusin') {\n if (this.retain && event.target instanceof Element && event.target.matches(menuItemSelector)) {\n this.#retainSignal?.abort()\n const {signal} = (this.#retainSignal = new AbortController())\n for (const item of this.#items) {\n item.setAttribute('tabindex', item === event.target ? '0' : '-1')\n const popover = event.target.closest<HTMLElement>('[popover]')\n if (item === event.target && popover?.popover === 'auto' && popover.closest('focus-group') === this) {\n popover.addEventListener(\n 'toggle',\n (toggleEvent: Event) => {\n if (!(toggleEvent.target instanceof Element)) return\n if ((toggleEvent as ToggleEvent).newState === 'closed') {\n this.#retainSignal?.abort()\n item.setAttribute('tabindex', '-1')\n if (popover.id) {\n const invoker = this.querySelector(`[popovertarget=\"${popover.id}\"]`)\n if (invoker) {\n invoker.setAttribute('tabindex', '0')\n } else {\n this.#items[0]?.setAttribute('tabindex', '0')\n }\n }\n }\n },\n {signal},\n )\n }\n }\n }\n } else if (event instanceof KeyboardEvent) {\n const items = Array.from(this.#items)\n let index = items.indexOf(event.target as Element)\n const key = event.key\n if (key === 'Up' || key === 'ArrowUp') {\n if (direction === 'vertical' || direction === 'both') {\n index -= index < 0 ? 0 : 1\n event.preventDefault()\n }\n } else if (key === 'Down' || key === 'ArrowDown') {\n if (direction === 'vertical' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Left' || event.key === 'ArrowLeft') {\n if (direction === 'horizontal' || direction === 'both') {\n index -= 1\n event.preventDefault()\n }\n } else if (event.key === 'Right' || event.key === 'ArrowRight') {\n if (direction === 'horizontal' || direction === 'both') {\n index += 1\n event.preventDefault()\n }\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n index = 0\n event.preventDefault()\n } else if (event.key === 'End' || event.key === 'PageDown') {\n index = items.length - 1\n event.preventDefault()\n } else if (this.mnemonics && printable.test(key)) {\n const mnemonic = key.toLowerCase()\n const offset = index > 0 && getMnemonicFor(event.target as Element) === mnemonic ? index : 0\n index = items.findIndex((item, i) => i > offset && getMnemonicFor(item) === mnemonic)\n if (index < 0 && !nowrap) {\n index = items.findIndex(item => getMnemonicFor(item) === mnemonic)\n }\n } else {\n return\n }\n if (nowrap && index < 0) index = 0\n if (!nowrap && index >= items.length) index = 0\n const focusEl = items.at(Math.min(index, items.length - 1)) as HTMLElement\n {\n let el: HTMLElement | null = focusEl\n do {\n el = el.closest(`[popover]:not(:popover-open)`)\n if (el?.popover === 'auto' && !['ArrowRight', 'ArrowLeft'].includes(event.key)) {\n el.showPopover()\n }\n el = el?.parentElement || null\n } while (el)\n }\n focusEl?.focus()\n }\n }\n}\n\nif (!customElements.get('focus-group')) {\n window.FocusGroupElement = FocusGroupElement\n customElements.define('focus-group', FocusGroupElement)\n}\n\ndeclare global {\n interface Window {\n FocusGroupElement: typeof FocusGroupElement\n }\n}\n","import {controller, attr} from '@github/catalyst'\n\n@controller\nexport class ScrollableRegionElement extends HTMLElement {\n @attr hasOverflow = false\n @attr labelledBy = ''\n\n observer: ResizeObserver\n\n connectedCallback() {\n this.style.overflow = 'auto'\n\n this.observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n this.hasOverflow =\n entry.target.scrollHeight > entry.target.clientHeight || entry.target.scrollWidth > entry.target.clientWidth\n }\n })\n\n this.observer.observe(this)\n }\n\n disconnectedCallback() {\n this.observer.disconnect()\n }\n\n attributeChangedCallback(name: string) {\n if (name === 'data-has-overflow') {\n if (this.hasOverflow) {\n this.setAttribute('aria-labelledby', this.labelledBy)\n this.setAttribute('role', 'region')\n this.setAttribute('tabindex', '0')\n } else {\n this.removeAttribute('aria-labelledby')\n this.removeAttribute('role')\n this.removeAttribute('tabindex')\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ScrollableRegionElement: typeof ScrollableRegionElement\n }\n}\n\nwindow.ScrollableRegionElement = ScrollableRegionElement\n","import {focusTrap} from '@primer/behaviors'\nimport {getFocusableChild} from '@primer/behaviors/utils'\n\nfunction focusIfNeeded(elem: HTMLElement | undefined | null) {\n if (document.activeElement !== elem) {\n elem?.focus()\n }\n}\n\nconst overlayStack: ModalDialogElement[] = []\n\nfunction clickHandler(event: Event) {\n const target = event.target as HTMLElement\n const button = target?.closest('button')\n\n if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return\n\n // If the user is clicking a valid dialog trigger\n let dialogId = button?.getAttribute('data-show-dialog-id')\n if (dialogId) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n dialog.openButton = button\n dialog.show()\n // A buttons default behaviour in some browsers it to send a pointer event\n // If the behaviour is allowed through the dialog will be shown but then\n // quickly hidden- as if it were never shown. This prevents that.\n event.preventDefault()\n return\n }\n }\n\n if (!overlayStack.length) return\n\n dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id')\n if (dialogId) {\n const dialog = document.getElementById(dialogId)\n if (dialog instanceof ModalDialogElement) {\n const dialogIndex = overlayStack.findIndex(ele => ele.id === dialogId)\n overlayStack.splice(dialogIndex, 1)\n dialog.close(button.hasAttribute('data-submit-dialog-id'))\n }\n }\n}\n\nfunction keydownHandler(event: Event) {\n if (\n !(event instanceof KeyboardEvent) ||\n event.type !== 'keydown' ||\n event.key !== 'Enter' ||\n event.ctrlKey ||\n event.altKey ||\n event.metaKey ||\n event.shiftKey\n )\n return\n\n clickHandler(event)\n}\n\nfunction mousedownHandler(event: Event) {\n const target = event.target as HTMLElement\n if (target?.closest('button')) return\n\n // Find the top level dialog that is open.\n const topLevelDialog = overlayStack[overlayStack.length - 1]\n if (!topLevelDialog) return\n\n // Check if the mousedown happened outside the boundary of the top level dialog\n const mouseDownOutsideDialog = !target.closest(`#${topLevelDialog.getAttribute('id')}`)\n\n // Only close dialog if it's a click outside the dialog and the dialog has a button?\n if (mouseDownOutsideDialog) {\n target.ownerDocument.addEventListener(\n 'mouseup',\n (upEvent: Event) => {\n if (upEvent.target === target) {\n overlayStack.pop()\n topLevelDialog.close()\n }\n },\n {once: true},\n )\n }\n}\n\nexport class ModalDialogElement extends HTMLElement {\n //TODO: Do we remove the abortController from focusTrap?\n #focusAbortController = new AbortController()\n openButton: HTMLButtonElement | null\n\n get open() {\n return this.hasAttribute('open')\n }\n set open(value: boolean) {\n if (value) {\n if (this.open) return\n this.setAttribute('open', '')\n this.setAttribute('aria-disabled', 'false')\n document.body.style.paddingRight = `${window.innerWidth - document.body.clientWidth}px`\n document.body.style.overflow = 'hidden'\n this.#overlayBackdrop?.classList.remove('Overlay--hidden')\n if (this.#focusAbortController.signal.aborted) {\n this.#focusAbortController = new AbortController()\n }\n focusTrap(this, this.querySelector('[autofocus]') as HTMLElement, this.#focusAbortController.signal)\n overlayStack.push(this)\n } else {\n if (!this.open) return\n this.removeAttribute('open')\n this.setAttribute('aria-disabled', 'true')\n this.#overlayBackdrop?.classList.add('Overlay--hidden')\n document.body.style.paddingRight = '0'\n document.body.style.overflow = 'initial'\n this.#focusAbortController.abort()\n // if #openButton is a child of a menu, we need to focus a suitable child of the menu\n // element since it is expected for the menu to close on click\n const menu = this.openButton?.closest('details') || this.openButton?.closest('action-menu')\n if (menu) {\n focusIfNeeded(getFocusableChild(menu))\n } else {\n focusIfNeeded(this.openButton)\n }\n this.openButton = null\n }\n }\n\n get #overlayBackdrop(): HTMLElement | null {\n if (this.parentElement?.hasAttribute('data-modal-dialog-overlay')) {\n return this.parentElement\n }\n\n return null\n }\n\n get showButtons(): NodeList {\n // Dialogs may also be opened from any arbitrary button with a matching show-dialog-id data attribute\n return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)\n }\n\n connectedCallback(): void {\n if (!this.hasAttribute('role')) this.setAttribute('role', 'dialog')\n\n document.addEventListener('click', clickHandler)\n document.addEventListener('keydown', keydownHandler)\n document.addEventListener('mousedown', mousedownHandler)\n\n this.addEventListener('keydown', e => this.#keydown(e))\n }\n\n show() {\n this.open = true\n }\n\n close(closedNotCancelled = false) {\n if (this.open === false) return\n const eventType = closedNotCancelled ? 'close' : 'cancel'\n const dialogEvent = new Event(eventType)\n this.dispatchEvent(dialogEvent)\n this.open = false\n }\n\n #keydown(event: Event) {\n if (!(event instanceof KeyboardEvent)) return\n if (event.isComposing) return\n if (!this.open) return\n\n switch (event.key) {\n case 'Escape':\n this.close()\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n break\n case 'Enter': {\n const target = event.target as HTMLElement\n\n if (target.getAttribute('data-close-dialog-id') === this.id) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n }\n break\n }\n }\n }\n}\n\ndeclare global {\n interface Window {\n ModalDialogElement: typeof ModalDialogElement\n }\n interface HTMLElementTagNameMap {\n 'modal-dialog': ModalDialogElement\n }\n}\n\nif (!window.customElements.get('modal-dialog')) {\n window.ModalDialogElement = ModalDialogElement\n window.customElements.define('modal-dialog', ModalDialogElement)\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListElement extends HTMLElement {\n @targets items: HTMLElement[]\n @target topLevelList: HTMLElement\n\n #truncationObserver: ActionListTruncationObserver\n\n connectedCallback() {\n // groups are wrapped in <action-list>, which handles resizing on its own\n if (this.topLevelList) {\n this.#truncationObserver = new ActionListTruncationObserver(this.topLevelList)\n }\n }\n\n disconnectedCallback() {\n if (this.topLevelList) {\n this.#truncationObserver.unobserve(this.topLevelList)\n }\n }\n\n selectItemById(itemId: string | null): boolean {\n if (!itemId) return false\n\n const selectedItem = this.#findSelectedNavItemById(itemId)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByHref(href: string | null): boolean {\n if (!href) return false\n\n const selectedItem = this.#findSelectedNavItemByHref(href)\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n selectItemByCurrentLocation(): boolean {\n const selectedItem = this.#findSelectedNavItemByCurrentLocation()\n\n if (selectedItem) {\n this.#select(selectedItem)\n return true\n }\n\n return false\n }\n\n // expand collapsible item onClick\n expandItem(item: HTMLElement) {\n item.nextElementSibling?.removeAttribute('data-hidden')\n item.setAttribute('aria-expanded', 'true')\n }\n\n collapseItem(item: HTMLElement) {\n item.nextElementSibling?.setAttribute('data-hidden', '')\n item.setAttribute('aria-expanded', 'false')\n item.focus()\n }\n\n itemIsExpanded(item: HTMLElement | null) {\n if (item?.tagName === 'A') {\n return true\n }\n return item?.getAttribute('aria-expanded') === 'true'\n }\n\n // expand/collapse item\n handleItemWithSubItemClick(e: Event) {\n const el = e.target\n if (!(el instanceof HTMLElement)) return\n\n const button = el.closest<HTMLButtonElement>('button')\n if (!button) return\n if (this.itemIsExpanded(button)) {\n this.collapseItem(button)\n } else {\n this.expandItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n // collapse item\n handleItemWithSubItemKeydown(e: KeyboardEvent) {\n const el = e.currentTarget\n if (!(el instanceof HTMLElement)) return\n\n let button = el.closest<HTMLButtonElement>('button')\n if (!button) {\n const button_id = el.getAttribute('aria-labelledby')\n if (button_id) {\n button = document.getElementById(button_id) as HTMLButtonElement\n } else {\n return\n }\n }\n\n if (this.itemIsExpanded(button) && e.key === 'Escape') {\n this.collapseItem(button)\n }\n\n /* eslint-disable-next-line no-restricted-syntax */\n e.stopPropagation()\n }\n\n #findSelectedNavItemById(itemId: string): HTMLElement | null {\n // First we compare the selected link to data-item-id for each nav item\n for (const navItem of this.items) {\n if (navItem.classList.contains('ActionListItem--hasSubItem')) {\n continue\n }\n\n const keys = navItem.getAttribute('data-item-id')?.split(' ') || []\n\n if (keys.includes(itemId)) {\n return navItem\n }\n }\n\n return null\n }\n\n #findSelectedNavItemByHref(href: string): HTMLElement | null {\n // If we didn't find a match, we compare the selected link to the href of each nav item\n const selectedNavItem = this.querySelector<HTMLAnchorElement>(`.ActionListContent[href=\"${href}\"]`)\n if (selectedNavItem) {\n return selectedNavItem.closest('.ActionListItem')\n }\n\n return null\n }\n\n #findSelectedNavItemByCurrentLocation(): HTMLElement | null {\n return this.#findSelectedNavItemByHref(window.location.pathname)\n }\n\n #select(navItem: HTMLElement) {\n const currentlySelectedItem = this.querySelector('.ActionListItem--navActive') as HTMLElement\n if (currentlySelectedItem) this.#deselect(currentlySelectedItem)\n\n navItem.classList.add('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].setAttribute('aria-current', 'page')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.expandItem(parentMenu)\n parentMenu.classList.add('ActionListContent--hasActiveSubItem')\n }\n }\n\n #deselect(navItem: HTMLElement) {\n navItem.classList.remove('ActionListItem--navActive')\n\n if (navItem.children.length > 0) {\n navItem.children[0].removeAttribute('aria-current')\n }\n\n const parentMenu = this.#findParentMenu(navItem)\n\n if (parentMenu) {\n this.collapseItem(parentMenu)\n parentMenu.classList.remove('ActionListContent--hasActiveSubItem')\n }\n }\n\n #findParentMenu(navItem: HTMLElement): HTMLElement | null {\n if (!navItem.classList.contains('ActionListItem--subItem')) return null\n\n const parent = navItem.closest('li.ActionListItem--hasSubItem')?.querySelector('button.ActionListContent')\n\n if (parent) {\n return parent as HTMLElement\n } else {\n return null\n }\n }\n}\n\ndeclare global {\n interface Window {\n NavListElement: typeof NavListElement\n }\n}\n","import {controller, target, targets} from '@github/catalyst'\nimport {ActionListTruncationObserver} from '../alpha/action_list'\n\n@controller\nexport class NavListGroupElement extends HTMLElement {\n @target showMoreItem: HTMLElement\n @targets focusMarkers: HTMLElement[]\n\n connectedCallback(): void {\n this.setShowMoreItemState()\n }\n\n get showMoreDisabled(): boolean {\n return this.showMoreItem.hasAttribute('aria-disabled')\n }\n\n set showMoreDisabled(value: boolean) {\n if (value) {\n this.showMoreItem.setAttribute('aria-disabled', 'true')\n } else {\n this.showMoreItem.removeAttribute('aria-disabled')\n }\n this.showMoreItem.classList.toggle('disabled', value)\n }\n\n set currentPage(value: number) {\n this.showMoreItem.setAttribute('data-current-page', value.toString())\n }\n\n get currentPage(): number {\n return parseInt(this.showMoreItem.getAttribute('data-current-page') as string) || 1\n }\n\n get totalPages(): number {\n return parseInt(this.showMoreItem.getAttribute('data-total-pages') as string) || 1\n }\n\n get paginationSrc(): string {\n return this.showMoreItem.getAttribute('src') || ''\n }\n\n private async showMore(e: Event) {\n e.preventDefault()\n if (this.showMoreDisabled) return\n this.showMoreDisabled = true\n let html\n try {\n const paginationURL = new URL(this.paginationSrc, window.location.origin)\n this.currentPage++\n paginationURL.searchParams.append('page', this.currentPage.toString())\n const response = await fetch(paginationURL)\n if (!response.ok) return\n html = await response.text()\n if (this.currentPage === this.totalPages) {\n this.showMoreItem.hidden = true\n }\n } catch (err) {\n // Ignore network errors\n this.showMoreDisabled = false\n this.currentPage--\n return\n }\n const fragment = this.#parseHTML(document, html)\n fragment?.querySelector('li > a')?.setAttribute('data-targets', 'nav-list-group.focusMarkers')\n const listId = (e.target as HTMLElement).closest('button')!.getAttribute('data-list-id')!\n const list = document.getElementById(listId)!\n list.append(fragment)\n this.focusMarkers.pop()?.focus()\n this.showMoreDisabled = false\n }\n\n private setShowMoreItemState() {\n if (!this.showMoreItem) {\n return\n }\n\n if (this.currentPage < this.totalPages) {\n this.showMoreItem.hidden = false\n } else {\n this.showMoreItem.hidden = true\n }\n }\n\n #parseHTML(document: Document, html: string): DocumentFragment {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = html\n return document.importNode(template.content, true)\n }\n\n #truncateObserver = new ActionListTruncationObserver(this)\n}\n\ndeclare global {\n interface Window {\n NavListGroupElement: typeof NavListGroupElement\n }\n}\n\nwindow.NavListGroupElement = NavListGroupElement\n","import {controller, targets} from '@github/catalyst'\n\n@controller\nclass SegmentedControlElement extends HTMLElement {\n @targets items: HTMLElement[]\n\n connectedCallback() {\n this.#updateButtonLabels()\n }\n\n select(event: Event) {\n const button = event.currentTarget as HTMLButtonElement\n for (const item of this.items) {\n item.classList.remove('SegmentedControl-item--selected')\n item.querySelector('[aria-current]')?.setAttribute('aria-current', 'false')\n }\n\n button.closest('li.SegmentedControl-item')?.classList.add('SegmentedControl-item--selected')\n button.setAttribute('aria-current', 'true')\n }\n\n // Updates the button labels to have a data-content attribute with the text\n // This is for selection styling to avoid the text jumping. It only needs to be\n // setup when the component is first loaded.\n #updateButtonLabels() {\n for (const label of this.querySelectorAll('.Button-label')) {\n label.setAttribute('data-content', label.textContent || '')\n }\n }\n}\n\ndeclare global {\n interface Window {\n SegmentedControlElement: typeof SegmentedControlElement\n }\n}\n\nif (!window.customElements.get('segmented-control')) {\n window.SegmentedControlElement = SegmentedControlElement\n window.customElements.define('segmented-control', SegmentedControlElement)\n}\n","import {controller, target, attr} from '@github/catalyst'\n\n@controller\nclass ToggleSwitchElement extends HTMLElement {\n @target switch: HTMLElement\n @target loadingSpinner: HTMLElement\n @target errorIcon: HTMLElement\n @attr turbo = false\n\n private toggling = false\n\n get src(): string | null {\n const src = this.getAttribute('src')\n if (!src) return null\n\n const link = this.ownerDocument.createElement('a')\n link.href = src\n return link.href\n }\n\n get csrf(): string | null {\n const csrfElement = this.querySelector('[data-csrf]')\n return this.getAttribute('data-csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || null\n }\n\n get csrfField(): string {\n // the authenticity token is passed into the element and is not generated in js land\n\n return this.getAttribute('csrf-field') || 'authenticity_token'\n }\n\n isRemote(): boolean {\n return this.src != null\n }\n\n async toggle() {\n if (this.toggling) return\n\n this.toggling = true\n\n if (this.isDisabled()) {\n return\n }\n\n if (!this.isRemote()) {\n this.performToggle()\n this.toggling = false\n return\n }\n\n // toggle immediately to tell screen readers the switch was clicked\n this.performToggle()\n this.setLoadingState()\n\n try {\n await this.submitForm()\n } catch (error) {\n if (error instanceof Error) {\n // because we toggle immediately when the switch is clicked, toggle back to the\n // old state on failure\n this.setErrorState(error.message || 'An error occurred, please try again.')\n this.performToggle()\n }\n\n return\n } finally {\n this.toggling = false\n }\n\n this.setSuccessState()\n }\n\n turnOn(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'true')\n this.classList.add('ToggleSwitch--checked')\n }\n\n turnOff(): void {\n if (this.isDisabled()) {\n return\n }\n\n this.switch.setAttribute('aria-pressed', 'false')\n this.classList.remove('ToggleSwitch--checked')\n }\n\n isOn(): boolean {\n return this.switch.getAttribute('aria-pressed') === 'true'\n }\n\n isOff(): boolean {\n return !this.isOn()\n }\n\n isDisabled(): boolean {\n return this.switch.getAttribute('disabled') != null\n }\n\n disable(): void {\n this.switch.setAttribute('disabled', 'disabled')\n }\n\n enable(): void {\n this.switch.removeAttribute('disabled')\n }\n\n private performToggle(): void {\n if (this.isOn()) {\n this.turnOff()\n } else {\n this.turnOn()\n }\n }\n\n private setLoadingState(): void {\n this.errorIcon.setAttribute('hidden', 'hidden')\n this.loadingSpinner.removeAttribute('hidden')\n\n const event = new CustomEvent('toggleSwitchLoading', {bubbles: true})\n this.dispatchEvent(event)\n }\n\n private setSuccessState(): void {\n const event = new CustomEvent('toggleSwitchSuccess', {bubbles: true})\n this.dispatchEvent(event)\n\n this.setFinishedState(false)\n }\n\n private setErrorState(message: string): void {\n const event = new CustomEvent('toggleSwitchError', {bubbles: true, detail: message})\n this.dispatchEvent(event)\n\n this.setFinishedState(true)\n }\n\n private setFinishedState(error: boolean): void {\n if (error) {\n this.errorIcon.removeAttribute('hidden')\n }\n\n this.loadingSpinner.setAttribute('hidden', 'hidden')\n }\n\n private async submitForm() {\n const body = new FormData()\n\n if (this.csrf) {\n body.append(this.csrfField, this.csrf)\n }\n\n body.append('value', this.isOn() ? '1' : '0')\n\n if (!this.src) throw new Error('invalid src')\n\n let response\n\n const requestHeaders: {[key: string]: string} = {\n 'Requested-With': 'XMLHttpRequest',\n }\n\n if (this.turbo) {\n requestHeaders['Accept'] = 'text/vnd.turbo-stream.html'\n }\n\n try {\n response = await fetch(this.src, {\n credentials: 'same-origin',\n method: 'POST',\n headers: requestHeaders,\n body,\n })\n } catch (error) {\n throw new Error('A network error occurred, please try again.')\n }\n\n if (!response.ok) {\n throw new Error(await response.text())\n }\n\n const contentType = response.headers.get('Content-Type')\n if (window.Turbo && this.turbo && contentType?.startsWith('text/vnd.turbo-stream.html')) {\n window.Turbo.renderStreamMessage(await response.text())\n }\n }\n}\n\ndeclare global {\n interface Window {\n ToggleSwitchElement: typeof ToggleSwitchElement\n Turbo: {\n renderStreamMessage: (message: string) => void\n }\n }\n}\n\nif (!window.customElements.get('toggle-switch')) {\n window.ToggleSwitchElement = ToggleSwitchElement\n window.customElements.define('toggle-switch', ToggleSwitchElement)\n}\n","import type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport '@oddbird/popover-polyfill'\nimport {getAnchoredPosition} from '@primer/behaviors'\n\nconst isPopoverOpen = (() => {\n let selector: string\n function setSelector(el: Element) {\n try {\n selector = ':popover-open'\n return el.matches(selector)\n } catch {\n try {\n selector = ':open'\n return el.matches(':open')\n } catch {\n selector = '.\\\\:popover-open'\n return el.matches('.\\\\:popover-open')\n }\n }\n }\n return (el: Element) => (selector ? el.matches(selector) : setSelector(el))\n})()\n\nconst TOOLTIP_SR_ONLY_CLASS = 'sr-only'\n\ntype Direction = 'n' | 's' | 'e' | 'w' | 'ne' | 'se' | 'nw' | 'sw'\n\nconst DIRECTION_CLASSES = [\n 'tooltip-n',\n 'tooltip-s',\n 'tooltip-e',\n 'tooltip-w',\n 'tooltip-ne',\n 'tooltip-se',\n 'tooltip-nw',\n 'tooltip-sw',\n]\n\nfunction closeOpenTooltips(except?: Element) {\n for (const tooltip of openTooltips) {\n if (tooltip === except) continue\n if (isPopoverOpen(tooltip)) {\n tooltip.hidePopover()\n } else {\n openTooltips.delete(tooltip)\n }\n }\n}\n\nfunction focusOutListener() {\n closeOpenTooltips()\n}\n\nfunction focusInListener(event: Event) {\n setTimeout(() => {\n for (const tooltip of openTooltips) {\n if (isPopoverOpen(tooltip) && tooltip.showReason === 'focus' && tooltip.control !== event.target) {\n tooltip.hidePopover()\n }\n }\n }, 0)\n}\n\nconst tooltips = new Set<ToolTipElement>()\nconst openTooltips = new Set<ToolTipElement>()\nclass ToolTipElement extends HTMLElement {\n styles() {\n return `\n :host {\n --tooltip-top: var(--tool-tip-position-top, 0);\n --tooltip-left: var(--tool-tip-position-left, 0);\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: var(--overlay-width-small);\n word-wrap: break-word;\n white-space: normal;\n width: max-content !important;\n inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;\n overflow: visible !important;\n text-wrap: balance;\n }\n\n :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {\n --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));\n --tooltip-left: var(--tool-tip-position-left);\n }\n\n :host(.tooltip-w) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));\n }\n\n :host(.tooltip-e) {\n --tooltip-top: var(--tool-tip-position-top);\n --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--overlay-offset, 0.25rem);\n content: \"\";\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%;\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n :host(:popover-open),\n :host(:popover-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n :host(.\\\\:popover-open) {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n }\n\n @media (forced-colors: active) {\n :host {\n outline: solid 1px transparent;\n }\n\n :host:before {\n display: none;\n }\n }\n `\n }\n\n #abortController: AbortController | undefined\n #align: AnchorAlignment = 'center'\n #side: AnchorSide = 'outside-bottom'\n #allowUpdatePosition = false\n #showReason: 'focus' | 'mouse' = 'mouse'\n get showReason() {\n return this.#showReason\n }\n\n get htmlFor(): string {\n return this.getAttribute('for') || ''\n }\n\n set htmlFor(value: string) {\n this.setAttribute('for', value)\n }\n\n get type(): 'description' | 'label' {\n const type = this.getAttribute('data-type')\n return type === 'label' ? 'label' : 'description'\n }\n\n set type(value: 'description' | 'label') {\n this.setAttribute('data-type', value)\n }\n\n get direction(): Direction {\n return (this.getAttribute('data-direction') || 's') as Direction\n }\n\n set direction(value: Direction) {\n this.setAttribute('data-direction', value)\n }\n\n get control(): HTMLElement | null {\n return this.ownerDocument.getElementById(this.htmlFor)\n }\n\n /* @deprecated */\n set hiddenFromView(value: true | false) {\n if (value && isPopoverOpen(this)) {\n this.hidePopover()\n } else if (!value && !isPopoverOpen(this)) {\n this.showPopover()\n }\n }\n\n /* @deprecated */\n get hiddenFromView() {\n return !isPopoverOpen(this)\n }\n\n connectedCallback() {\n tooltips.add(this)\n this.#updateControlReference()\n this.#updateDirection()\n if (!this.shadowRoot) {\n const shadow = this.attachShadow({mode: 'open'})\n const style = shadow.appendChild(document.createElement('style'))\n style.textContent = this.styles()\n shadow.appendChild(document.createElement('slot'))\n }\n this.#update(false)\n this.#allowUpdatePosition = true\n\n if (!this.control) return\n\n this.setAttribute('role', 'tooltip')\n\n this.#abortController?.abort()\n this.#abortController = new AbortController()\n const {signal} = this.#abortController\n\n this.addEventListener('mouseleave', this, {signal})\n this.addEventListener('toggle', this, {signal})\n this.control.addEventListener('mouseenter', this, {signal})\n this.control.addEventListener('mouseleave', this, {signal})\n this.control.addEventListener('focus', this, {signal})\n this.control.addEventListener('mousedown', this, {signal})\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore popoverTargetElement is not in the type definition\n this.control.popoverTargetElement?.addEventListener('beforetoggle', this, {\n signal,\n })\n this.ownerDocument.addEventListener('focusout', focusOutListener)\n this.ownerDocument.addEventListener('focusin', focusInListener)\n this.ownerDocument.addEventListener('keydown', this, {signal, capture: true})\n }\n\n disconnectedCallback() {\n tooltips.delete(this)\n openTooltips.delete(this)\n this.#abortController?.abort()\n }\n\n async handleEvent(event: Event) {\n if (!this.control) return\n const showing = isPopoverOpen(this)\n\n // Ensures that tooltip stays open when hovering between tooltip and element\n // WCAG Success Criterion 1.4.13 Hoverable\n const shouldShow =\n event.type === 'mouseenter' ||\n // Only show tooltip on focus if running in headless browser (for tests) or if focus ring\n // is visible (i.e. if user is using keyboard navigation)\n (event.type === 'focus' && (navigator.webdriver || this.control.matches(':focus-visible')))\n const isMouseLeaveFromButton =\n event.type === 'mouseleave' &&\n (event as MouseEvent).relatedTarget !== this.control &&\n (event as MouseEvent).relatedTarget !== this\n const isEscapeKeydown = event.type === 'keydown' && (event as KeyboardEvent).key === 'Escape'\n const isMouseDownOnButton = event.type === 'mousedown' && event.currentTarget === this.control\n const isOpeningOtherPopover = event.type === 'beforetoggle' && event.currentTarget !== this\n const shouldHide = isMouseLeaveFromButton || isEscapeKeydown || isMouseDownOnButton || isOpeningOtherPopover\n\n if (showing && isEscapeKeydown) {\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n event.preventDefault()\n }\n\n await Promise.resolve()\n if (!showing && shouldShow && !isPopoverOpen(this)) {\n this.#showReason = event.type === 'mouseenter' ? 'mouse' : 'focus'\n this.showPopover()\n } else if (showing && shouldHide && isPopoverOpen(this)) {\n this.hidePopover()\n }\n\n if (event.type === 'toggle') {\n this.#update((event as ToggleEvent).newState === 'open')\n }\n }\n\n static observedAttributes = ['data-type', 'data-direction', 'id']\n\n #update(isOpen: boolean) {\n if (isOpen) {\n openTooltips.add(this)\n this.classList.remove(TOOLTIP_SR_ONLY_CLASS)\n closeOpenTooltips(this)\n this.#updatePosition()\n } else {\n openTooltips.delete(this)\n this.classList.remove(...DIRECTION_CLASSES)\n this.classList.add(TOOLTIP_SR_ONLY_CLASS)\n }\n }\n\n attributeChangedCallback(name: string) {\n if (!this.isConnected) return\n\n if (name === 'id' || name === 'data-type') {\n this.#updateControlReference()\n } else if (name === 'data-direction') {\n this.#updateDirection()\n }\n }\n\n #updateControlReference() {\n if (!this.id || !this.control) return\n if (this.type === 'label') {\n let labelledBy = this.control.getAttribute('aria-labelledby')\n if (labelledBy) {\n if (!labelledBy.split(' ').includes(this.id)) {\n labelledBy = `${labelledBy} ${this.id}`\n } else {\n labelledBy = `${labelledBy}`\n }\n } else {\n labelledBy = this.id\n }\n this.control.setAttribute('aria-labelledby', labelledBy)\n\n // Prevent duplicate accessible name announcements.\n this.setAttribute('aria-hidden', 'true')\n } else {\n let describedBy = this.control.getAttribute('aria-describedby')\n if (describedBy) {\n if (!describedBy.split(' ').includes(this.id)) {\n describedBy = `${describedBy} ${this.id}`\n } else {\n describedBy = `${describedBy}`\n }\n } else {\n describedBy = this.id\n }\n this.control.setAttribute('aria-describedby', describedBy)\n }\n }\n\n #updateDirection() {\n this.classList.remove(...DIRECTION_CLASSES)\n const direction = this.direction\n if (direction === 'n') {\n this.#align = 'center'\n this.#side = 'outside-top'\n } else if (direction === 'ne') {\n this.#align = 'end'\n this.#side = 'outside-top'\n } else if (direction === 'e') {\n this.#align = 'center'\n this.#side = 'outside-right'\n } else if (direction === 'se') {\n this.#align = 'end'\n this.#side = 'outside-bottom'\n } else if (direction === 's') {\n this.#align = 'center'\n this.#side = 'outside-bottom'\n } else if (direction === 'sw') {\n this.#align = 'start'\n this.#side = 'outside-bottom'\n } else if (direction === 'w') {\n this.#align = 'center'\n this.#side = 'outside-left'\n } else if (direction === 'nw') {\n this.#align = 'start'\n this.#side = 'outside-top'\n }\n }\n\n #updatePosition() {\n if (!this.control) return\n if (!this.#allowUpdatePosition || !isPopoverOpen(this)) return\n\n const position = getAnchoredPosition(this, this.control, {\n side: this.#side,\n align: this.#align,\n anchorOffset: 0,\n })\n const anchorSide = position.anchorSide\n const align = position.anchorAlign\n\n this.style.setProperty('--tool-tip-position-top', `${position.top}px`)\n this.style.setProperty('--tool-tip-position-left', `${position.left}px`)\n\n let direction: Direction = 's'\n\n if (anchorSide === 'outside-left') {\n direction = 'w'\n } else if (anchorSide === 'outside-right') {\n direction = 'e'\n } else if (anchorSide === 'outside-top') {\n if (align === 'center') {\n direction = 'n'\n } else if (align === 'start') {\n direction = 'ne'\n } else {\n direction = 'nw'\n }\n } else {\n if (align === 'center') {\n direction = 's'\n } else if (align === 'start') {\n direction = 'se'\n } else {\n direction = 'sw'\n }\n }\n\n this.classList.add(`tooltip-${direction}`)\n }\n}\n\nif (!window.customElements.get('tool-tip')) {\n window.ToolTipElement = ToolTipElement\n window.customElements.define('tool-tip', ToolTipElement)\n}\n\ndeclare global {\n interface Window {\n ToolTipElement: typeof ToolTipElement\n }\n}\n","import {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'banner:dismiss': CustomEvent<void>\n }\n}\n\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n if (this.#dismissScheme === 'remove') {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\n\n this.dispatchEvent(new CustomEvent('banner:dismiss'))\n }\n\n show() {\n this.style.setProperty('display', 'initial')\n }\n\n hide() {\n this.style.setProperty('display', 'none')\n }\n\n get #dismissScheme(): string {\n return this.getAttribute('data-dismiss-scheme')!\n }\n}\n\ndeclare global {\n interface Window {\n XBannerElement: typeof XBannerElement\n }\n}\n\nif (!window.customElements.get('x-banner')) {\n window.XBannerElement = XBannerElement\n window.customElements.define('x-banner', XBannerElement)\n}\n","export default class Combobox {\n constructor(input, list, { tabInsertsSuggestions, defaultFirstOption } = {}) {\n this.input = input;\n this.list = list;\n this.tabInsertsSuggestions = tabInsertsSuggestions !== null && tabInsertsSuggestions !== void 0 ? tabInsertsSuggestions : true;\n this.defaultFirstOption = defaultFirstOption !== null && defaultFirstOption !== void 0 ? defaultFirstOption : false;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random().toString().slice(2, 6)}`;\n }\n this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n this.indicateDefaultOption();\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n indicateDefaultOption() {\n var _a;\n if (this.defaultFirstOption) {\n (_a = Array.from(this.list.querySelectorAll('[role=\"option\"]:not([aria-disabled=\"true\"])'))\n .filter(visible)[0]) === null || _a === void 0 ? void 0 : _a.setAttribute('data-combobox-option-default', 'true');\n }\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n el.removeAttribute('data-combobox-option-default');\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.removeAttribute('aria-selected');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.removeAttribute('aria-selected');\n }\n this.indicateDefaultOption();\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!combobox.ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n if (combobox.tabInsertsSuggestions && commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target, { event });\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"], [data-combobox-option-default=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target, detail) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true, detail }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\nimport debounce from './debounce.js';\nconst SCREEN_READER_DELAY = window.testScreenReaderDelay || 100;\nexport default class Autocomplete {\n constructor(container, input, results, autoselectEnabled = false) {\n var _a;\n this.container = container;\n this.input = input;\n this.results = results;\n this.combobox = new Combobox(input, results, {\n defaultFirstOption: autoselectEnabled,\n });\n this.feedback = container.getRootNode().getElementById(`${this.results.id}-feedback`);\n this.autoselectEnabled = autoselectEnabled;\n this.clearButton = container.getRootNode().getElementById(`${this.input.id || this.input.name}-clear`);\n this.clientOptions = results.querySelectorAll('[role=option]');\n if (this.feedback) {\n this.feedback.setAttribute('aria-live', 'polite');\n this.feedback.setAttribute('aria-atomic', 'true');\n }\n if (this.clearButton && !this.clearButton.getAttribute('aria-label')) {\n const labelElem = document.querySelector(`label[for=\"${this.input.name}\"]`);\n this.clearButton.setAttribute('aria-label', `clear:`);\n this.clearButton.setAttribute('aria-labelledby', `${this.clearButton.id} ${(labelElem === null || labelElem === void 0 ? void 0 : labelElem.id) || ''}`);\n }\n if (!this.input.getAttribute('aria-expanded')) {\n this.input.setAttribute('aria-expanded', 'false');\n }\n if (this.results.popover) {\n if (this.results.matches(':popover-open')) {\n this.results.hidePopover();\n }\n }\n else {\n this.results.hidden = true;\n }\n if (!this.results.getAttribute('aria-label')) {\n this.results.setAttribute('aria-label', 'results');\n }\n this.input.setAttribute('autocomplete', 'off');\n this.input.setAttribute('spellcheck', 'false');\n this.interactingWithList = false;\n this.onInputChange = debounce(this.onInputChange.bind(this), 300);\n this.onResultsMouseDown = this.onResultsMouseDown.bind(this);\n this.onInputBlur = this.onInputBlur.bind(this);\n this.onInputFocus = this.onInputFocus.bind(this);\n this.onKeydown = this.onKeydown.bind(this);\n this.onCommit = this.onCommit.bind(this);\n this.handleClear = this.handleClear.bind(this);\n this.input.addEventListener('keydown', this.onKeydown);\n this.input.addEventListener('focus', this.onInputFocus);\n this.input.addEventListener('blur', this.onInputBlur);\n this.input.addEventListener('input', this.onInputChange);\n this.results.addEventListener('mousedown', this.onResultsMouseDown);\n this.results.addEventListener('combobox-commit', this.onCommit);\n (_a = this.clearButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleClear);\n }\n destroy() {\n this.input.removeEventListener('keydown', this.onKeydown);\n this.input.removeEventListener('focus', this.onInputFocus);\n this.input.removeEventListener('blur', this.onInputBlur);\n this.input.removeEventListener('input', this.onInputChange);\n this.results.removeEventListener('mousedown', this.onResultsMouseDown);\n this.results.removeEventListener('combobox-commit', this.onCommit);\n }\n handleClear(event) {\n event.preventDefault();\n if (this.input.getAttribute('aria-expanded') === 'true') {\n this.input.setAttribute('aria-expanded', 'false');\n this.updateFeedbackForScreenReaders('Results hidden.');\n }\n this.input.value = '';\n this.container.value = '';\n this.input.focus();\n this.input.dispatchEvent(new Event('change'));\n this.close();\n }\n onKeydown(event) {\n if (event.key === 'Escape' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowUp' && this.container.open) {\n this.close();\n event.stopPropagation();\n event.preventDefault();\n }\n else if (event.altKey && event.key === 'ArrowDown' && !this.container.open) {\n if (!this.input.value.trim())\n return;\n this.open();\n event.stopPropagation();\n event.preventDefault();\n }\n }\n onInputFocus() {\n if (this.interactingWithList)\n return;\n this.fetchResults();\n }\n onInputBlur() {\n if (this.interactingWithList)\n return;\n this.close();\n }\n onCommit({ target }) {\n const selected = target;\n if (!(selected instanceof HTMLElement))\n return;\n this.close();\n if (selected instanceof HTMLAnchorElement)\n return;\n const value = selected.getAttribute('data-autocomplete-value') || selected.textContent;\n this.updateFeedbackForScreenReaders(`${selected.textContent || ''} selected.`);\n this.container.value = value;\n if (!value) {\n this.updateFeedbackForScreenReaders(`Results hidden.`);\n }\n }\n onResultsMouseDown() {\n this.interactingWithList = true;\n }\n onInputChange() {\n if (this.feedback && this.feedback.textContent) {\n this.feedback.textContent = '';\n }\n this.container.removeAttribute('value');\n this.fetchResults();\n }\n identifyOptions() {\n let id = 0;\n for (const el of this.results.querySelectorAll('[role=\"option\"]:not([id])')) {\n el.id = `${this.results.id}-option-${id++}`;\n }\n }\n updateFeedbackForScreenReaders(inputString) {\n setTimeout(() => {\n if (this.feedback) {\n this.feedback.textContent = inputString;\n }\n }, SCREEN_READER_DELAY);\n }\n fetchResults() {\n const query = this.input.value.trim();\n if (!query && !this.container.fetchOnEmpty) {\n this.close();\n return;\n }\n const src = this.container.src;\n if (!src)\n return;\n const url = new URL(src, window.location.href);\n const params = new URLSearchParams(url.search.slice(1));\n params.append('q', query);\n url.search = params.toString();\n this.container.dispatchEvent(new CustomEvent('loadstart'));\n this.container\n .fetchResult(url)\n .then(html => {\n this.results.innerHTML = html;\n this.identifyOptions();\n this.combobox.indicateDefaultOption();\n const allNewOptions = this.results.querySelectorAll('[role=\"option\"]');\n const hasResults = !!allNewOptions.length;\n const numOptions = allNewOptions.length;\n const [firstOption] = allNewOptions;\n const firstOptionValue = firstOption === null || firstOption === void 0 ? void 0 : firstOption.textContent;\n if (this.autoselectEnabled && firstOptionValue) {\n this.updateFeedbackForScreenReaders(`${numOptions} results. ${firstOptionValue} is the top result: Press Enter to activate.`);\n }\n else {\n this.updateFeedbackForScreenReaders(`${numOptions || 'No'} results.`);\n }\n hasResults ? this.open() : this.close();\n this.container.dispatchEvent(new CustomEvent('load'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n })\n .catch(() => {\n this.container.dispatchEvent(new CustomEvent('error'));\n this.container.dispatchEvent(new CustomEvent('loadend'));\n });\n }\n open() {\n const isHidden = this.results.popover ? !this.results.matches(':popover-open') : this.results.hidden;\n if (isHidden) {\n this.combobox.start();\n if (this.results.popover) {\n this.results.showPopover();\n }\n else {\n this.results.hidden = false;\n }\n }\n this.container.open = true;\n this.interactingWithList = true;\n }\n close() {\n const isVisible = this.results.popover ? this.results.matches(':popover-open') : !this.results.hidden;\n if (isVisible) {\n this.combobox.stop();\n if (this.results.popover) {\n this.results.hidePopover();\n }\n else {\n this.results.hidden = true;\n }\n }\n this.container.open = false;\n this.interactingWithList = false;\n }\n}\n","export default function debounce(callback, wait = 0) {\n let timeout;\n return function (...Rest) {\n clearTimeout(timeout);\n timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n callback(...Rest);\n }, wait);\n };\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar _AutoCompleteElement_instances, _AutoCompleteElement_forElement, _AutoCompleteElement_inputElement, _AutoCompleteElement_reattachState, _AutoCompleteElement_requestController;\nimport Autocomplete from './autocomplete.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nexport class AutoCompleteEvent extends Event {\n constructor(type, _a) {\n var { relatedTarget } = _a, init = __rest(_a, [\"relatedTarget\"]);\n super(type, init);\n this.relatedTarget = relatedTarget;\n }\n}\nconst state = new WeakMap();\nlet cspTrustedTypesPolicyPromise = null;\nexport class AutoCompleteElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCompleteElement_instances.add(this);\n _AutoCompleteElement_forElement.set(this, null);\n _AutoCompleteElement_inputElement.set(this, null);\n _AutoCompleteElement_requestController.set(this, void 0);\n }\n static define(tag = 'auto-complete', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static setCSPTrustedTypesPolicy(policy) {\n cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy);\n }\n get forElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_forElement, \"f\");\n }\n const id = this.getAttribute('for');\n const root = this.getRootNode();\n if (id && (root instanceof Document || root instanceof ShadowRoot)) {\n return root.getElementById(id);\n }\n return null;\n }\n set forElement(element) {\n __classPrivateFieldSet(this, _AutoCompleteElement_forElement, element, \"f\");\n this.setAttribute('for', '');\n }\n get inputElement() {\n var _a;\n if ((_a = __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\")) === null || _a === void 0 ? void 0 : _a.isConnected) {\n return __classPrivateFieldGet(this, _AutoCompleteElement_inputElement, \"f\");\n }\n return this.querySelector('input');\n }\n set inputElement(input) {\n __classPrivateFieldSet(this, _AutoCompleteElement_inputElement, input, \"f\");\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n connectedCallback() {\n if (!this.isConnected)\n return;\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n new MutationObserver(() => {\n if (!state.get(this)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n }).observe(this, { subtree: true, childList: true });\n }\n disconnectedCallback() {\n const autocomplete = state.get(this);\n if (autocomplete) {\n autocomplete.destroy();\n state.delete(this);\n }\n }\n get src() {\n return this.getAttribute('src') || '';\n }\n set src(url) {\n this.setAttribute('src', url);\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(value) {\n this.setAttribute('value', value);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n }\n else {\n this.removeAttribute('open');\n }\n }\n get fetchOnEmpty() {\n return this.hasAttribute('fetch-on-empty');\n }\n set fetchOnEmpty(fetchOnEmpty) {\n this.toggleAttribute('fetch-on-empty', fetchOnEmpty);\n }\n async fetchResult(url) {\n var _a;\n (_a = __classPrivateFieldGet(this, _AutoCompleteElement_requestController, \"f\")) === null || _a === void 0 ? void 0 : _a.abort();\n const { signal } = (__classPrivateFieldSet(this, _AutoCompleteElement_requestController, new AbortController(), \"f\"));\n const res = await fetch(url.toString(), {\n signal,\n headers: {\n Accept: 'text/fragment+html',\n },\n });\n if (!res.ok) {\n throw new Error(await res.text());\n }\n if (cspTrustedTypesPolicyPromise) {\n const cspTrustedTypesPolicy = await cspTrustedTypesPolicyPromise;\n return cspTrustedTypesPolicy.createHTML(await res.text(), res);\n }\n return await res.text();\n }\n static get observedAttributes() {\n return ['open', 'value', 'for'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n var _a, _b;\n if (oldValue === newValue)\n return;\n const autocomplete = state.get(this);\n if (!autocomplete)\n return;\n if (this.forElement !== ((_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.results) || this.inputElement !== ((_b = state.get(this)) === null || _b === void 0 ? void 0 : _b.input)) {\n __classPrivateFieldGet(this, _AutoCompleteElement_instances, \"m\", _AutoCompleteElement_reattachState).call(this);\n }\n switch (name) {\n case 'open':\n newValue === null ? autocomplete.close() : autocomplete.open();\n break;\n case 'value':\n if (newValue !== null) {\n autocomplete.input.value = newValue;\n }\n this.dispatchEvent(new AutoCompleteEvent('auto-complete-change', {\n bubbles: true,\n relatedTarget: autocomplete.input,\n }));\n break;\n }\n }\n}\n_AutoCompleteElement_forElement = new WeakMap(), _AutoCompleteElement_inputElement = new WeakMap(), _AutoCompleteElement_requestController = new WeakMap(), _AutoCompleteElement_instances = new WeakSet(), _AutoCompleteElement_reattachState = function _AutoCompleteElement_reattachState() {\n var _a;\n (_a = state.get(this)) === null || _a === void 0 ? void 0 : _a.destroy();\n const { forElement, inputElement } = this;\n if (!forElement || !inputElement)\n return;\n const autoselectEnabled = this.getAttribute('data-autoselect') === 'true';\n state.set(this, new Autocomplete(this, inputElement, forElement, autoselectEnabled));\n forElement.setAttribute('role', 'listbox');\n};\nexport default AutoCompleteElement;\n","import { AutoCompleteElement } from './auto-complete-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutocompleteElement = root.AutoCompleteElement = AutoCompleteElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCompleteElement;\nexport * from './auto-complete-element.js';\n","function createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\nexport function copyNode(node) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(node.textContent || '');\n }\n const selection = getSelection();\n if (selection == null) {\n return Promise.reject(new Error());\n }\n selection.removeAllRanges();\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n document.execCommand('copy');\n selection.removeAllRanges();\n return Promise.resolve();\n}\nexport function copyText(text) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(text);\n }\n const body = document.body;\n if (!body) {\n return Promise.reject(new Error());\n }\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n","import { copyNode, copyText } from './clipboard.js';\nasync function copy(button) {\n const id = button.getAttribute('for');\n const text = button.getAttribute('value');\n function trigger() {\n button.dispatchEvent(new CustomEvent('clipboard-copy', { bubbles: true }));\n }\n if (button.getAttribute('aria-disabled') === 'true') {\n return;\n }\n if (text) {\n await copyText(text);\n trigger();\n }\n else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot)))\n return;\n const node = root.getElementById(id);\n if (node) {\n await copyTarget(node);\n trigger();\n }\n }\n}\nfunction copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement) {\n return copyText(content.value);\n }\n else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n }\n else {\n return copyNode(content);\n }\n}\nfunction clicked(event) {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n copy(button);\n }\n}\nfunction keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n const button = event.currentTarget;\n if (button instanceof HTMLElement) {\n event.preventDefault();\n copy(button);\n }\n }\n}\nfunction focused(event) {\n ;\n event.currentTarget.addEventListener('keydown', keydown);\n}\nfunction blurred(event) {\n ;\n event.currentTarget.removeEventListener('keydown', keydown);\n}\nexport class ClipboardCopyElement extends HTMLElement {\n static define(tag = 'clipboard-copy', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n constructor() {\n super();\n this.addEventListener('click', clicked);\n this.addEventListener('focus', focused);\n this.addEventListener('blur', blurred);\n }\n connectedCallback() {\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n }\n get value() {\n return this.getAttribute('value') || '';\n }\n set value(text) {\n this.setAttribute('value', text);\n }\n}\n","import { ClipboardCopyElement } from './clipboard-copy-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.ClipboardCopyElement = ClipboardCopyElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default ClipboardCopyElement;\nexport * from './clipboard-copy-element.js';\n","import '@github/clipboard-copy-element'\n\nconst CLIPBOARD_COPY_TIMER_DURATION = 2000\n\nfunction showSVG(svg: SVGElement) {\n svg.style.display = 'inline-block'\n}\n\nfunction hideSVG(svg: SVGElement) {\n svg.style.display = 'none'\n}\n\n// Toggle a copy button.\nfunction showCopy(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n showSVG(copyIcon)\n hideSVG(checkIcon)\n}\n\n// Toggle a copy button.\nfunction showCheck(button: HTMLElement) {\n const [copyIcon, checkIcon] = button.querySelectorAll<SVGElement>('.octicon')\n\n if (!copyIcon || !checkIcon) return\n\n hideSVG(copyIcon)\n showSVG(checkIcon)\n}\n\nconst clipboardCopyElementTimers = new WeakMap<HTMLElement, number>()\n\ndocument.addEventListener('clipboard-copy', ({target}) => {\n if (!(target instanceof HTMLElement)) return\n if (!target.hasAttribute('data-view-component')) return\n\n const currentTimeout = clipboardCopyElementTimers.get(target)\n const clipboardCopyLiveRegion = target.parentNode?.querySelector<HTMLElement>('[data-clipboard-copy-feedback]')\n const copiedAnnouncement = 'Copied!'\n\n if (currentTimeout) {\n clearTimeout(currentTimeout)\n clipboardCopyElementTimers.delete(target)\n } else {\n showCheck(target)\n if (clipboardCopyLiveRegion) {\n if (clipboardCopyLiveRegion.textContent === copiedAnnouncement) {\n /* This is a hack due to the way the aria live API works.\n A screen reader will not read a live region again\n if the text is the same. Adding a space character tells\n the browser that the live region has updated,\n which will cause it to read again, but with no audible difference. */\n clipboardCopyLiveRegion.textContent = `${copiedAnnouncement}\\u00A0`\n } else {\n clipboardCopyLiveRegion.textContent = copiedAnnouncement\n }\n }\n }\n\n clipboardCopyElementTimers.set(\n target,\n setTimeout(() => {\n showCopy(target)\n clipboardCopyElementTimers.delete(target)\n }, CLIPBOARD_COPY_TIMER_DURATION),\n )\n})\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _DurationFormat_options;\nclass ListFormatPonyFill {\n formatToParts(members) {\n const parts = [];\n for (const value of members) {\n parts.push({ type: 'element', value });\n parts.push({ type: 'literal', value: ', ' });\n }\n return parts.slice(0, -1);\n }\n}\nconst ListFormat = (typeof Intl !== 'undefined' && Intl.ListFormat) || ListFormatPonyFill;\nconst partsTable = [\n ['years', 'year'],\n ['months', 'month'],\n ['weeks', 'week'],\n ['days', 'day'],\n ['hours', 'hour'],\n ['minutes', 'minute'],\n ['seconds', 'second'],\n ['milliseconds', 'millisecond'],\n];\nconst twoDigitFormatOptions = { minimumIntegerDigits: 2 };\nexport default class DurationFormat {\n constructor(locale, options = {}) {\n _DurationFormat_options.set(this, void 0);\n let style = String(options.style || 'short');\n if (style !== 'long' && style !== 'short' && style !== 'narrow' && style !== 'digital')\n style = 'short';\n let prevStyle = style === 'digital' ? 'numeric' : style;\n const hours = options.hours || prevStyle;\n prevStyle = hours === '2-digit' ? 'numeric' : hours;\n const minutes = options.minutes || prevStyle;\n prevStyle = minutes === '2-digit' ? 'numeric' : minutes;\n const seconds = options.seconds || prevStyle;\n prevStyle = seconds === '2-digit' ? 'numeric' : seconds;\n const milliseconds = options.milliseconds || prevStyle;\n __classPrivateFieldSet(this, _DurationFormat_options, {\n locale,\n style,\n years: options.years || style === 'digital' ? 'short' : style,\n yearsDisplay: options.yearsDisplay === 'always' ? 'always' : 'auto',\n months: options.months || style === 'digital' ? 'short' : style,\n monthsDisplay: options.monthsDisplay === 'always' ? 'always' : 'auto',\n weeks: options.weeks || style === 'digital' ? 'short' : style,\n weeksDisplay: options.weeksDisplay === 'always' ? 'always' : 'auto',\n days: options.days || style === 'digital' ? 'short' : style,\n daysDisplay: options.daysDisplay === 'always' ? 'always' : 'auto',\n hours,\n hoursDisplay: options.hoursDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n minutes,\n minutesDisplay: options.minutesDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n seconds,\n secondsDisplay: options.secondsDisplay === 'always' ? 'always' : style === 'digital' ? 'always' : 'auto',\n milliseconds,\n millisecondsDisplay: options.millisecondsDisplay === 'always' ? 'always' : 'auto',\n }, \"f\");\n }\n resolvedOptions() {\n return __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n }\n formatToParts(duration) {\n const list = [];\n const options = __classPrivateFieldGet(this, _DurationFormat_options, \"f\");\n const style = options.style;\n const locale = options.locale;\n for (const [unit, nfUnit] of partsTable) {\n const value = duration[unit];\n if (options[`${unit}Display`] === 'auto' && !value)\n continue;\n const unitStyle = options[unit];\n const nfOpts = unitStyle === '2-digit'\n ? twoDigitFormatOptions\n : unitStyle === 'numeric'\n ? {}\n : { style: 'unit', unit: nfUnit, unitDisplay: unitStyle };\n list.push(new Intl.NumberFormat(locale, nfOpts).format(value));\n }\n return new ListFormat(locale, {\n type: 'unit',\n style: style === 'digital' ? 'short' : style,\n }).formatToParts(list);\n }\n format(duration) {\n return this.formatToParts(duration)\n .map(p => p.value)\n .join('');\n }\n}\n_DurationFormat_options = new WeakMap();\n","import DurationFormat from './duration-format-ponyfill.js';\nconst durationRe = /^[-+]?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?$/;\nexport const unitNames = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport const isDuration = (str) => durationRe.test(str);\nexport class Duration {\n constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0) {\n this.years = years;\n this.months = months;\n this.weeks = weeks;\n this.days = days;\n this.hours = hours;\n this.minutes = minutes;\n this.seconds = seconds;\n this.milliseconds = milliseconds;\n this.years || (this.years = 0);\n this.sign || (this.sign = Math.sign(this.years));\n this.months || (this.months = 0);\n this.sign || (this.sign = Math.sign(this.months));\n this.weeks || (this.weeks = 0);\n this.sign || (this.sign = Math.sign(this.weeks));\n this.days || (this.days = 0);\n this.sign || (this.sign = Math.sign(this.days));\n this.hours || (this.hours = 0);\n this.sign || (this.sign = Math.sign(this.hours));\n this.minutes || (this.minutes = 0);\n this.sign || (this.sign = Math.sign(this.minutes));\n this.seconds || (this.seconds = 0);\n this.sign || (this.sign = Math.sign(this.seconds));\n this.milliseconds || (this.milliseconds = 0);\n this.sign || (this.sign = Math.sign(this.milliseconds));\n this.blank = this.sign === 0;\n }\n abs() {\n return new Duration(Math.abs(this.years), Math.abs(this.months), Math.abs(this.weeks), Math.abs(this.days), Math.abs(this.hours), Math.abs(this.minutes), Math.abs(this.seconds), Math.abs(this.milliseconds));\n }\n static from(durationLike) {\n var _a;\n if (typeof durationLike === 'string') {\n const str = String(durationLike).trim();\n const factor = str.startsWith('-') ? -1 : 1;\n const parsed = (_a = str\n .match(durationRe)) === null || _a === void 0 ? void 0 : _a.slice(1).map(x => (Number(x) || 0) * factor);\n if (!parsed)\n return new Duration();\n return new Duration(...parsed);\n }\n else if (typeof durationLike === 'object') {\n const { years, months, weeks, days, hours, minutes, seconds, milliseconds } = durationLike;\n return new Duration(years, months, weeks, days, hours, minutes, seconds, milliseconds);\n }\n throw new RangeError('invalid duration');\n }\n static compare(one, two) {\n const now = Date.now();\n const oneApplied = Math.abs(applyDuration(now, Duration.from(one)).getTime() - now);\n const twoApplied = Math.abs(applyDuration(now, Duration.from(two)).getTime() - now);\n return oneApplied > twoApplied ? -1 : oneApplied < twoApplied ? 1 : 0;\n }\n toLocaleString(locale, opts) {\n return new DurationFormat(locale, opts).format(this);\n }\n}\nexport function applyDuration(date, duration) {\n const r = new Date(date);\n r.setFullYear(r.getFullYear() + duration.years);\n r.setMonth(r.getMonth() + duration.months);\n r.setDate(r.getDate() + duration.weeks * 7 + duration.days);\n r.setHours(r.getHours() + duration.hours);\n r.setMinutes(r.getMinutes() + duration.minutes);\n r.setSeconds(r.getSeconds() + duration.seconds);\n return r;\n}\nexport function elapsedTime(date, precision = 'second', now = Date.now()) {\n const delta = date.getTime() - now;\n if (delta === 0)\n return new Duration();\n const sign = Math.sign(delta);\n const ms = Math.abs(delta);\n const sec = Math.floor(ms / 1000);\n const min = Math.floor(sec / 60);\n const hr = Math.floor(min / 60);\n const day = Math.floor(hr / 24);\n const month = Math.floor(day / 30);\n const year = Math.floor(month / 12);\n const i = unitNames.indexOf(precision) || unitNames.length;\n return new Duration(i >= 0 ? year * sign : 0, i >= 1 ? (month - year * 12) * sign : 0, 0, i >= 3 ? (day - month * 30) * sign : 0, i >= 4 ? (hr - day * 24) * sign : 0, i >= 5 ? (min - hr * 60) * sign : 0, i >= 6 ? (sec - min * 60) * sign : 0, i >= 7 ? (ms - sec * 1000) * sign : 0);\n}\nexport function roundToSingleUnit(duration, { relativeTo = Date.now() } = {}) {\n relativeTo = new Date(relativeTo);\n if (duration.blank)\n return duration;\n const sign = duration.sign;\n let years = Math.abs(duration.years);\n let months = Math.abs(duration.months);\n let weeks = Math.abs(duration.weeks);\n let days = Math.abs(duration.days);\n let hours = Math.abs(duration.hours);\n let minutes = Math.abs(duration.minutes);\n let seconds = Math.abs(duration.seconds);\n let milliseconds = Math.abs(duration.milliseconds);\n if (milliseconds >= 900)\n seconds += Math.round(milliseconds / 1000);\n if (seconds || minutes || hours || days || weeks || months || years) {\n milliseconds = 0;\n }\n if (seconds >= 55)\n minutes += Math.round(seconds / 60);\n if (minutes || hours || days || weeks || months || years)\n seconds = 0;\n if (minutes >= 55)\n hours += Math.round(minutes / 60);\n if (hours || days || weeks || months || years)\n minutes = 0;\n if (days && hours >= 12)\n days += Math.round(hours / 24);\n if (!days && hours >= 21)\n days += Math.round(hours / 24);\n if (days || weeks || months || years)\n hours = 0;\n const currentYear = relativeTo.getFullYear();\n const currentMonth = relativeTo.getMonth();\n const currentDate = relativeTo.getDate();\n if (days >= 27 || years + months + days) {\n const newMonthDate = new Date(relativeTo);\n newMonthDate.setDate(1);\n newMonthDate.setMonth(currentMonth + months * sign + 1);\n newMonthDate.setDate(0);\n const monthDateCorrection = Math.max(0, currentDate - newMonthDate.getDate());\n const newDate = new Date(relativeTo);\n newDate.setFullYear(currentYear + years * sign);\n newDate.setDate(currentDate - monthDateCorrection);\n newDate.setMonth(currentMonth + months * sign);\n newDate.setDate(currentDate - monthDateCorrection + days * sign);\n const yearDiff = newDate.getFullYear() - relativeTo.getFullYear();\n const monthDiff = newDate.getMonth() - relativeTo.getMonth();\n const daysDiff = Math.abs(Math.round((Number(newDate) - Number(relativeTo)) / 86400000)) + monthDateCorrection;\n const monthsDiff = Math.abs(yearDiff * 12 + monthDiff);\n if (daysDiff < 27) {\n if (days >= 6) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n else {\n days = daysDiff;\n }\n months = years = 0;\n }\n else if (monthsDiff < 11) {\n months = monthsDiff;\n years = 0;\n }\n else {\n months = 0;\n years = yearDiff * sign;\n }\n if (months || years)\n days = 0;\n }\n if (years)\n months = 0;\n if (weeks >= 4)\n months += Math.round(weeks / 4);\n if (months || years)\n weeks = 0;\n if (days && weeks && !months && !years) {\n weeks += Math.round(days / 7);\n days = 0;\n }\n return new Duration(years * sign, months * sign, weeks * sign, days * sign, hours * sign, minutes * sign, seconds * sign, milliseconds * sign);\n}\nexport function getRelativeTimeUnit(duration, opts) {\n const rounded = roundToSingleUnit(duration, opts);\n if (rounded.blank)\n return [0, 'second'];\n for (const unit of unitNames) {\n if (unit === 'millisecond')\n continue;\n const val = rounded[`${unit}s`];\n if (val)\n return [val, unit];\n }\n return [0, 'second'];\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _RelativeTimeElement_instances, _RelativeTimeElement_customTitle, _RelativeTimeElement_updating, _RelativeTimeElement_lang_get, _RelativeTimeElement_renderRoot, _RelativeTimeElement_getFormattedTitle, _RelativeTimeElement_resolveFormat, _RelativeTimeElement_getDurationFormat, _RelativeTimeElement_getRelativeFormat, _RelativeTimeElement_getDateTimeFormat, _RelativeTimeElement_onRelativeTimeUpdated;\nimport { Duration, elapsedTime, getRelativeTimeUnit, isDuration, roundToSingleUnit, unitNames } from './duration.js';\nconst HTMLElement = globalThis.HTMLElement || null;\nconst emptyDuration = new Duration();\nconst microEmptyDuration = new Duration(0, 0, 0, 0, 0, 1);\nexport class RelativeTimeUpdatedEvent extends Event {\n constructor(oldText, newText, oldTitle, newTitle) {\n super('relative-time-updated', { bubbles: true, composed: true });\n this.oldText = oldText;\n this.newText = newText;\n this.oldTitle = oldTitle;\n this.newTitle = newTitle;\n }\n}\nfunction getUnitFactor(el) {\n if (!el.date)\n return Infinity;\n if (el.format === 'duration' || el.format === 'elapsed') {\n const precision = el.precision;\n if (precision === 'second') {\n return 1000;\n }\n else if (precision === 'minute') {\n return 60 * 1000;\n }\n }\n const ms = Math.abs(Date.now() - el.date.getTime());\n if (ms < 60 * 1000)\n return 1000;\n if (ms < 60 * 60 * 1000)\n return 60 * 1000;\n return 60 * 60 * 1000;\n}\nconst dateObserver = new (class {\n constructor() {\n this.elements = new Set();\n this.time = Infinity;\n this.timer = -1;\n }\n observe(element) {\n if (this.elements.has(element))\n return;\n this.elements.add(element);\n const date = element.date;\n if (date && date.getTime()) {\n const ms = getUnitFactor(element);\n const time = Date.now() + ms;\n if (time < this.time) {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => this.update(), ms);\n this.time = time;\n }\n }\n }\n unobserve(element) {\n if (!this.elements.has(element))\n return;\n this.elements.delete(element);\n }\n update() {\n clearTimeout(this.timer);\n if (!this.elements.size)\n return;\n let nearestDistance = Infinity;\n for (const timeEl of this.elements) {\n nearestDistance = Math.min(nearestDistance, getUnitFactor(timeEl));\n timeEl.update();\n }\n this.time = Math.min(60 * 60 * 1000, nearestDistance);\n this.timer = setTimeout(() => this.update(), this.time);\n this.time += Date.now();\n }\n})();\nexport class RelativeTimeElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _RelativeTimeElement_instances.add(this);\n _RelativeTimeElement_customTitle.set(this, false);\n _RelativeTimeElement_updating.set(this, false);\n _RelativeTimeElement_renderRoot.set(this, this.shadowRoot ? this.shadowRoot : this.attachShadow ? this.attachShadow({ mode: 'open' }) : this);\n _RelativeTimeElement_onRelativeTimeUpdated.set(this, null);\n }\n static define(tag = 'relative-time', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n static get observedAttributes() {\n return [\n 'second',\n 'minute',\n 'hour',\n 'weekday',\n 'day',\n 'month',\n 'year',\n 'time-zone-name',\n 'prefix',\n 'threshold',\n 'tense',\n 'precision',\n 'format',\n 'format-style',\n 'no-title',\n 'datetime',\n 'lang',\n 'title',\n ];\n }\n get onRelativeTimeUpdated() {\n return __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\");\n }\n set onRelativeTimeUpdated(listener) {\n if (__classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\")) {\n this.removeEventListener('relative-time-updated', __classPrivateFieldGet(this, _RelativeTimeElement_onRelativeTimeUpdated, \"f\"));\n }\n __classPrivateFieldSet(this, _RelativeTimeElement_onRelativeTimeUpdated, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('relative-time-updated', listener);\n }\n }\n get second() {\n const second = this.getAttribute('second');\n if (second === 'numeric' || second === '2-digit')\n return second;\n }\n set second(value) {\n this.setAttribute('second', value || '');\n }\n get minute() {\n const minute = this.getAttribute('minute');\n if (minute === 'numeric' || minute === '2-digit')\n return minute;\n }\n set minute(value) {\n this.setAttribute('minute', value || '');\n }\n get hour() {\n const hour = this.getAttribute('hour');\n if (hour === 'numeric' || hour === '2-digit')\n return hour;\n }\n set hour(value) {\n this.setAttribute('hour', value || '');\n }\n get weekday() {\n const weekday = this.getAttribute('weekday');\n if (weekday === 'long' || weekday === 'short' || weekday === 'narrow') {\n return weekday;\n }\n if (this.format === 'datetime' && weekday !== '')\n return this.formatStyle;\n }\n set weekday(value) {\n this.setAttribute('weekday', value || '');\n }\n get day() {\n var _a;\n const day = (_a = this.getAttribute('day')) !== null && _a !== void 0 ? _a : 'numeric';\n if (day === 'numeric' || day === '2-digit')\n return day;\n }\n set day(value) {\n this.setAttribute('day', value || '');\n }\n get month() {\n const format = this.format;\n let month = this.getAttribute('month');\n if (month === '')\n return;\n month !== null && month !== void 0 ? month : (month = format === 'datetime' ? this.formatStyle : 'short');\n if (month === 'numeric' || month === '2-digit' || month === 'short' || month === 'long' || month === 'narrow') {\n return month;\n }\n }\n set month(value) {\n this.setAttribute('month', value || '');\n }\n get year() {\n var _a;\n const year = this.getAttribute('year');\n if (year === 'numeric' || year === '2-digit')\n return year;\n if (!this.hasAttribute('year') && new Date().getUTCFullYear() !== ((_a = this.date) === null || _a === void 0 ? void 0 : _a.getUTCFullYear())) {\n return 'numeric';\n }\n }\n set year(value) {\n this.setAttribute('year', value || '');\n }\n get timeZoneName() {\n const name = this.getAttribute('time-zone-name');\n if (name === 'long' ||\n name === 'short' ||\n name === 'shortOffset' ||\n name === 'longOffset' ||\n name === 'shortGeneric' ||\n name === 'longGeneric') {\n return name;\n }\n }\n set timeZoneName(value) {\n this.setAttribute('time-zone-name', value || '');\n }\n get prefix() {\n var _a;\n return (_a = this.getAttribute('prefix')) !== null && _a !== void 0 ? _a : (this.format === 'datetime' ? '' : 'on');\n }\n set prefix(value) {\n this.setAttribute('prefix', value);\n }\n get threshold() {\n const threshold = this.getAttribute('threshold');\n return threshold && isDuration(threshold) ? threshold : 'P30D';\n }\n set threshold(value) {\n this.setAttribute('threshold', value);\n }\n get tense() {\n const tense = this.getAttribute('tense');\n if (tense === 'past')\n return 'past';\n if (tense === 'future')\n return 'future';\n return 'auto';\n }\n set tense(value) {\n this.setAttribute('tense', value);\n }\n get precision() {\n const precision = this.getAttribute('precision');\n if (unitNames.includes(precision))\n return precision;\n if (this.format === 'micro')\n return 'minute';\n return 'second';\n }\n set precision(value) {\n this.setAttribute('precision', value);\n }\n get format() {\n const format = this.getAttribute('format');\n if (format === 'datetime')\n return 'datetime';\n if (format === 'relative')\n return 'relative';\n if (format === 'duration')\n return 'duration';\n if (format === 'micro')\n return 'micro';\n if (format === 'elapsed')\n return 'elapsed';\n return 'auto';\n }\n set format(value) {\n this.setAttribute('format', value);\n }\n get formatStyle() {\n const formatStyle = this.getAttribute('format-style');\n if (formatStyle === 'long')\n return 'long';\n if (formatStyle === 'short')\n return 'short';\n if (formatStyle === 'narrow')\n return 'narrow';\n const format = this.format;\n if (format === 'elapsed' || format === 'micro')\n return 'narrow';\n if (format === 'datetime')\n return 'short';\n return 'long';\n }\n set formatStyle(value) {\n this.setAttribute('format-style', value);\n }\n get noTitle() {\n return this.hasAttribute('no-title');\n }\n set noTitle(value) {\n this.toggleAttribute('no-title', value);\n }\n get datetime() {\n return this.getAttribute('datetime') || '';\n }\n set datetime(value) {\n this.setAttribute('datetime', value);\n }\n get date() {\n const parsed = Date.parse(this.datetime);\n return Number.isNaN(parsed) ? null : new Date(parsed);\n }\n set date(value) {\n this.datetime = (value === null || value === void 0 ? void 0 : value.toISOString()) || '';\n }\n connectedCallback() {\n this.update();\n }\n disconnectedCallback() {\n dateObserver.unobserve(this);\n }\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue === newValue)\n return;\n if (attrName === 'title') {\n __classPrivateFieldSet(this, _RelativeTimeElement_customTitle, newValue !== null && (this.date && __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, this.date)) !== newValue, \"f\");\n }\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_updating, \"f\") && !(attrName === 'title' && __classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\"))) {\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, (async () => {\n await Promise.resolve();\n this.update();\n __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\n })(), \"f\");\n }\n }\n update() {\n const oldText = __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent || this.textContent || '';\n const oldTitle = this.getAttribute('title') || '';\n let newTitle = oldTitle;\n const date = this.date;\n if (typeof Intl === 'undefined' || !Intl.DateTimeFormat || !date) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = oldText;\n return;\n }\n const now = Date.now();\n if (!__classPrivateFieldGet(this, _RelativeTimeElement_customTitle, \"f\")) {\n newTitle = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getFormattedTitle).call(this, date) || '';\n if (newTitle && !this.noTitle)\n this.setAttribute('title', newTitle);\n }\n const duration = elapsedTime(date, this.precision, now);\n const format = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_resolveFormat).call(this, duration);\n let newText = oldText;\n if (format === 'duration') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDurationFormat).call(this, duration);\n }\n else if (format === 'relative') {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getRelativeFormat).call(this, duration);\n }\n else {\n newText = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"m\", _RelativeTimeElement_getDateTimeFormat).call(this, date);\n }\n if (newText) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = newText;\n }\n else if (this.shadowRoot === __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\") && this.textContent) {\n __classPrivateFieldGet(this, _RelativeTimeElement_renderRoot, \"f\").textContent = this.textContent;\n }\n if (newText !== oldText || newTitle !== oldTitle) {\n this.dispatchEvent(new RelativeTimeUpdatedEvent(oldText, newText, oldTitle, newTitle));\n }\n if (format === 'relative' || format === 'duration') {\n dateObserver.observe(this);\n }\n else {\n dateObserver.unobserve(this);\n }\n }\n}\n_RelativeTimeElement_customTitle = new WeakMap(), _RelativeTimeElement_updating = new WeakMap(), _RelativeTimeElement_renderRoot = new WeakMap(), _RelativeTimeElement_onRelativeTimeUpdated = new WeakMap(), _RelativeTimeElement_instances = new WeakSet(), _RelativeTimeElement_lang_get = function _RelativeTimeElement_lang_get() {\n var _a;\n return (((_a = this.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.getAttribute('lang')) ||\n this.ownerDocument.documentElement.getAttribute('lang') ||\n 'default');\n}, _RelativeTimeElement_getFormattedTitle = function _RelativeTimeElement_getFormattedTitle(date) {\n return new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n }).format(date);\n}, _RelativeTimeElement_resolveFormat = function _RelativeTimeElement_resolveFormat(duration) {\n const format = this.format;\n if (format === 'datetime')\n return 'datetime';\n if (format === 'duration')\n return 'duration';\n if (format === 'elapsed')\n return 'duration';\n if (format === 'micro')\n return 'duration';\n if ((format === 'auto' || format === 'relative') && typeof Intl !== 'undefined' && Intl.RelativeTimeFormat) {\n const tense = this.tense;\n if (tense === 'past' || tense === 'future')\n return 'relative';\n if (Duration.compare(duration, this.threshold) === 1)\n return 'relative';\n }\n return 'datetime';\n}, _RelativeTimeElement_getDurationFormat = function _RelativeTimeElement_getDurationFormat(duration) {\n const locale = __classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get);\n const format = this.format;\n const style = this.formatStyle;\n const tense = this.tense;\n let empty = emptyDuration;\n if (format === 'micro') {\n duration = roundToSingleUnit(duration);\n empty = microEmptyDuration;\n if ((this.tense === 'past' && duration.sign !== -1) || (this.tense === 'future' && duration.sign !== 1)) {\n duration = microEmptyDuration;\n }\n }\n else if ((tense === 'past' && duration.sign !== -1) || (tense === 'future' && duration.sign !== 1)) {\n duration = empty;\n }\n const display = `${this.precision}sDisplay`;\n if (duration.blank) {\n return empty.toLocaleString(locale, { style, [display]: 'always' });\n }\n return duration.abs().toLocaleString(locale, { style });\n}, _RelativeTimeElement_getRelativeFormat = function _RelativeTimeElement_getRelativeFormat(duration) {\n const relativeFormat = new Intl.RelativeTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n numeric: 'auto',\n style: this.formatStyle,\n });\n const tense = this.tense;\n if (tense === 'future' && duration.sign !== 1)\n duration = emptyDuration;\n if (tense === 'past' && duration.sign !== -1)\n duration = emptyDuration;\n const [int, unit] = getRelativeTimeUnit(duration);\n if (unit === 'second' && int < 10) {\n return relativeFormat.format(0, this.precision === 'millisecond' ? 'second' : this.precision);\n }\n return relativeFormat.format(int, unit);\n}, _RelativeTimeElement_getDateTimeFormat = function _RelativeTimeElement_getDateTimeFormat(date) {\n const formatter = new Intl.DateTimeFormat(__classPrivateFieldGet(this, _RelativeTimeElement_instances, \"a\", _RelativeTimeElement_lang_get), {\n second: this.second,\n minute: this.minute,\n hour: this.hour,\n weekday: this.weekday,\n day: this.day,\n month: this.month,\n year: this.year,\n timeZoneName: this.timeZoneName,\n });\n return `${this.prefix} ${formatter.format(date)}`.trim();\n};\nexport default RelativeTimeElement;\n","import { RelativeTimeElement } from './relative-time-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.RelativeTimeElement = RelativeTimeElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default RelativeTimeElement;\nexport * from './relative-time-element.js';\n","function getTabs(el) {\n return Array.from(el.querySelectorAll('[role=\"tablist\"] [role=\"tab\"]')).filter(tab => tab instanceof HTMLElement && tab.closest(el.tagName) === el);\n}\nfunction getNavigationKeyCodes(vertical) {\n if (vertical) {\n return [\n ['ArrowDown', 'ArrowRight'],\n ['ArrowUp', 'ArrowLeft'],\n ];\n }\n else {\n return [['ArrowRight'], ['ArrowLeft']];\n }\n}\nexport class TabContainerElement extends HTMLElement {\n static define(tag = 'tab-container', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n connectedCallback() {\n this.addEventListener('keydown', (event) => {\n var _a;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.closest(this.tagName) !== this)\n return;\n if (target.getAttribute('role') !== 'tab' && !target.closest('[role=\"tablist\"]'))\n return;\n const tabs = getTabs(this);\n const currentIndex = tabs.indexOf(tabs.find(tab => tab.matches('[aria-selected=\"true\"]')));\n const [incrementKeys, decrementKeys] = getNavigationKeyCodes(((_a = target.closest('[role=\"tablist\"]')) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-orientation')) === 'vertical');\n if (incrementKeys.some(code => event.code === code)) {\n let index = currentIndex + 1;\n if (index >= tabs.length)\n index = 0;\n this.selectTab(index);\n }\n else if (decrementKeys.some(code => event.code === code)) {\n let index = currentIndex - 1;\n if (index < 0)\n index = tabs.length - 1;\n this.selectTab(index);\n }\n else if (event.code === 'Home') {\n this.selectTab(0);\n event.preventDefault();\n }\n else if (event.code === 'End') {\n this.selectTab(tabs.length - 1);\n event.preventDefault();\n }\n });\n this.addEventListener('click', (event) => {\n const tabs = getTabs(this);\n if (!(event.target instanceof Element))\n return;\n if (event.target.closest(this.tagName) !== this)\n return;\n const tab = event.target.closest('[role=\"tab\"]');\n if (!(tab instanceof HTMLElement) || !tab.closest('[role=\"tablist\"]')) {\n return;\n }\n const index = tabs.indexOf(tab);\n this.selectTab(index);\n });\n for (const tab of getTabs(this)) {\n if (!tab.hasAttribute('aria-selected')) {\n tab.setAttribute('aria-selected', 'false');\n }\n if (!tab.hasAttribute('tabindex')) {\n if (tab.getAttribute('aria-selected') === 'true') {\n tab.setAttribute('tabindex', '0');\n }\n else {\n tab.setAttribute('tabindex', '-1');\n }\n }\n }\n }\n selectTab(index) {\n const tabs = getTabs(this);\n const panels = Array.from(this.querySelectorAll('[role=\"tabpanel\"]')).filter(panel => panel.closest(this.tagName) === this);\n if (index > tabs.length - 1) {\n throw new RangeError(`Index \"${index}\" out of bounds`);\n }\n const selectedTab = tabs[index];\n const selectedPanel = panels[index];\n const cancelled = !this.dispatchEvent(new CustomEvent('tab-container-change', {\n bubbles: true,\n cancelable: true,\n detail: { relatedTarget: selectedPanel },\n }));\n if (cancelled)\n return;\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n for (const panel of panels) {\n panel.hidden = true;\n if (!panel.hasAttribute('tabindex') && !panel.hasAttribute('data-tab-container-no-tabstop')) {\n panel.setAttribute('tabindex', '0');\n }\n }\n selectedTab.setAttribute('aria-selected', 'true');\n selectedTab.setAttribute('tabindex', '0');\n selectedTab.focus();\n selectedPanel.hidden = false;\n this.dispatchEvent(new CustomEvent('tab-container-changed', {\n bubbles: true,\n detail: { relatedTarget: selectedPanel },\n }));\n }\n}\n","import { TabContainerElement } from './tab-container-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.TabContainerElement = TabContainerElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default TabContainerElement;\nexport * from './tab-container-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\nimport {controller, targets} from '@github/catalyst'\n\n@controller\nexport class PrimerMultiInputElement extends HTMLElement {\n @targets fields: HTMLInputElement[]\n\n activateField(name: string) {\n const fieldWithName = this.findField(name)\n if (!fieldWithName) return\n\n for (const field of this.fields) {\n if (field === fieldWithName) continue\n\n field.setAttribute('disabled', 'disabled')\n field.setAttribute('hidden', 'hidden')\n\n field.parentElement?.setAttribute('hidden', 'hidden')\n }\n\n fieldWithName.removeAttribute('disabled')\n fieldWithName.removeAttribute('hidden')\n fieldWithName.parentElement?.removeAttribute('hidden')\n }\n\n private findField(name: string): HTMLElement | null {\n for (const field of this.fields) {\n if (field.getAttribute('data-name') === name) {\n return field\n }\n }\n\n return null\n }\n}\n\ndeclare global {\n interface Window {\n PrimerMultiInputElement: typeof PrimerMultiInputElement\n }\n}\n\nif (!window.customElements.get('primer-multi-input')) {\n Object.assign(window, {PrimerMultiInputElement})\n window.customElements.define('primer-multi-input', PrimerMultiInputElement)\n}\n","export function throttle(callback, wait = 0, { start = true, middle = true, once = false } = {}) {\n let last = 0;\n let timer;\n let cancelled = false;\n function fn(...args) {\n if (cancelled)\n return;\n const delta = Date.now() - last;\n last = Date.now();\n if (start) {\n start = false;\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }\n else if ((middle && delta < wait) || !middle) {\n clearTimeout(timer);\n timer = setTimeout(() => {\n last = Date.now();\n callback.apply(this, args);\n if (once)\n fn.cancel();\n }, !middle ? wait : wait - delta);\n }\n }\n fn.cancel = () => {\n clearTimeout(timer);\n cancelled = true;\n };\n return fn;\n}\nexport function debounce(callback, wait = 0, { start = false, middle = false, once = false } = {}) {\n return throttle(callback, wait, { start, middle, once });\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AutoCheckElement_onloadend;\nimport { debounce } from '@github/mini-throttle';\nvar AllowedHttpMethods;\n(function (AllowedHttpMethods) {\n AllowedHttpMethods[\"GET\"] = \"GET\";\n AllowedHttpMethods[\"POST\"] = \"POST\";\n})(AllowedHttpMethods || (AllowedHttpMethods = {}));\nconst states = new WeakMap();\nclass AutoCheckEvent extends Event {\n constructor(phase) {\n super(`auto-check-${phase}`, { bubbles: true });\n this.phase = phase;\n }\n get detail() {\n return this;\n }\n}\nclass AutoCheckValidationEvent extends AutoCheckEvent {\n constructor(phase, message = '') {\n super(phase);\n this.phase = phase;\n this.message = message;\n this.setValidity = (message) => {\n this.message = message;\n };\n }\n}\nexport class AutoCheckCompleteEvent extends AutoCheckEvent {\n constructor() {\n super('complete');\n }\n}\nexport class AutoCheckSuccessEvent extends AutoCheckEvent {\n constructor(response) {\n super('success');\n this.response = response;\n }\n}\nexport class AutoCheckStartEvent extends AutoCheckValidationEvent {\n constructor() {\n super('start', 'Verifying…');\n }\n}\nexport class AutoCheckErrorEvent extends AutoCheckValidationEvent {\n constructor(response) {\n super('error', 'Validation failed');\n this.response = response;\n }\n}\nexport class AutoCheckSendEvent extends AutoCheckEvent {\n constructor(body) {\n super('send');\n this.body = body;\n }\n}\nexport class AutoCheckElement extends HTMLElement {\n constructor() {\n super(...arguments);\n _AutoCheckElement_onloadend.set(this, null);\n }\n static define(tag = 'auto-check', registry = customElements) {\n registry.define(tag, this);\n return this;\n }\n get onloadend() {\n return __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\");\n }\n set onloadend(listener) {\n if (__classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\")) {\n this.removeEventListener('loadend', __classPrivateFieldGet(this, _AutoCheckElement_onloadend, \"f\"));\n }\n __classPrivateFieldSet(this, _AutoCheckElement_onloadend, typeof listener === 'object' || typeof listener === 'function' ? listener : null, \"f\");\n if (typeof listener === 'function') {\n this.addEventListener('loadend', listener);\n }\n }\n connectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const checker = debounce(check.bind(null, this), 300);\n const state = { check: checker, controller: null };\n states.set(this, state);\n input.addEventListener('input', setLoadingState);\n input.addEventListener('input', checker);\n input.autocomplete = 'off';\n input.spellcheck = false;\n }\n disconnectedCallback() {\n const input = this.input;\n if (!input)\n return;\n const state = states.get(this);\n if (!state)\n return;\n states.delete(this);\n input.removeEventListener('input', setLoadingState);\n input.removeEventListener('input', state.check);\n input.setCustomValidity('');\n }\n attributeChangedCallback(name) {\n if (name === 'required') {\n const input = this.input;\n if (!input)\n return;\n input.required = this.required;\n }\n }\n static get observedAttributes() {\n return ['required'];\n }\n get input() {\n return this.querySelector('input');\n }\n get src() {\n const src = this.getAttribute('src');\n if (!src)\n return '';\n const link = this.ownerDocument.createElement('a');\n link.href = src;\n return link.href;\n }\n set src(value) {\n this.setAttribute('src', value);\n }\n get csrf() {\n const csrfElement = this.querySelector('[data-csrf]');\n return this.getAttribute('csrf') || (csrfElement instanceof HTMLInputElement && csrfElement.value) || '';\n }\n set csrf(value) {\n this.setAttribute('csrf', value);\n }\n get required() {\n return this.hasAttribute('required');\n }\n set required(required) {\n if (required) {\n this.setAttribute('required', '');\n }\n else {\n this.removeAttribute('required');\n }\n }\n get csrfField() {\n return this.getAttribute('csrf-field') || 'authenticity_token';\n }\n set csrfField(value) {\n this.setAttribute('csrf-field', value);\n }\n get httpMethod() {\n return AllowedHttpMethods[this.getAttribute('http-method')] || 'POST';\n }\n}\n_AutoCheckElement_onloadend = new WeakMap();\nfunction setLoadingState(event) {\n const input = event.currentTarget;\n if (!(input instanceof HTMLInputElement))\n return;\n const autoCheckElement = input.closest('auto-check');\n if (!(autoCheckElement instanceof AutoCheckElement))\n return;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const httpMethod = autoCheckElement.httpMethod;\n const state = states.get(autoCheckElement);\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n return;\n }\n const startEvent = new AutoCheckStartEvent();\n input.dispatchEvent(startEvent);\n if (autoCheckElement.required) {\n input.setCustomValidity(startEvent.message);\n }\n}\nfunction makeAbortController() {\n if ('AbortController' in window) {\n return new AbortController();\n }\n return {\n signal: null,\n abort() {\n },\n };\n}\nasync function fetchWithNetworkEvents(el, url, options) {\n if (options.method === 'GET') {\n delete options.body;\n }\n try {\n const response = await fetch(url, options);\n el.dispatchEvent(new Event('load'));\n el.dispatchEvent(new Event('loadend'));\n return response;\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n el.dispatchEvent(new Event('error'));\n el.dispatchEvent(new Event('loadend'));\n }\n throw error;\n }\n}\nasync function check(autoCheckElement) {\n const input = autoCheckElement.input;\n if (!input) {\n return;\n }\n const csrfField = autoCheckElement.csrfField;\n const src = autoCheckElement.src;\n const csrf = autoCheckElement.csrf;\n const state = states.get(autoCheckElement);\n const httpMethod = autoCheckElement.httpMethod;\n if (!src || (httpMethod === 'POST' && !csrf) || !state) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n if (!input.value.trim()) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n return;\n }\n const body = new FormData();\n const url = new URL(src, window.location.origin);\n if (httpMethod === 'POST') {\n body.append(csrfField, csrf);\n body.append('value', input.value);\n }\n else {\n url.search = new URLSearchParams({ value: input.value }).toString();\n }\n input.dispatchEvent(new AutoCheckSendEvent(body));\n if (state.controller) {\n state.controller.abort();\n }\n else {\n autoCheckElement.dispatchEvent(new Event('loadstart'));\n }\n state.controller = makeAbortController();\n try {\n const response = await fetchWithNetworkEvents(autoCheckElement, url.toString(), {\n credentials: 'same-origin',\n signal: state.controller.signal,\n method: httpMethod,\n body,\n });\n if (response.ok) {\n if (autoCheckElement.required) {\n input.setCustomValidity('');\n }\n input.dispatchEvent(new AutoCheckSuccessEvent(response.clone()));\n }\n else {\n const event = new AutoCheckErrorEvent(response.clone());\n input.dispatchEvent(event);\n if (autoCheckElement.required) {\n input.setCustomValidity(event.message);\n }\n }\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n catch (error) {\n if (error.name !== 'AbortError') {\n state.controller = null;\n input.dispatchEvent(new AutoCheckCompleteEvent());\n }\n }\n}\nexport default AutoCheckElement;\n","import { AutoCheckElement } from './auto-check-element.js';\nconst root = (typeof globalThis !== 'undefined' ? globalThis : window);\ntry {\n root.AutoCheckElement = AutoCheckElement.define();\n}\ncatch (e) {\n if (!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&\n !(e instanceof ReferenceError)) {\n throw e;\n }\n}\nexport default AutoCheckElement;\nexport * from './auto-check-element.js';\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport '@github/auto-check-element'\nimport type {AutoCheckErrorEvent, AutoCheckSuccessEvent} from '@github/auto-check-element'\nimport {controller, target} from '@github/catalyst'\n\ndeclare global {\n interface HTMLElementEventMap {\n 'auto-check-success': AutoCheckSuccessEvent\n 'auto-check-error': AutoCheckErrorEvent\n }\n}\n\n@controller\nexport class PrimerTextFieldElement extends HTMLElement {\n @target inputElement: HTMLInputElement\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n @target validationSuccessIcon: HTMLElement\n @target validationErrorIcon: HTMLElement\n @target leadingVisual: HTMLElement\n @target leadingSpinner: HTMLElement\n\n #abortController: AbortController | null\n\n connectedCallback(): void {\n this.#abortController?.abort()\n const {signal} = (this.#abortController = new AbortController())\n\n this.addEventListener(\n 'auto-check-success',\n async (event: AutoCheckSuccessEvent) => {\n const message = await event.detail.response.text()\n if (message && message.length > 0) {\n this.setSuccess(message)\n } else {\n this.clearError()\n }\n },\n {signal},\n )\n\n this.addEventListener(\n 'auto-check-error',\n async (event: AutoCheckErrorEvent) => {\n const errorMessage = await event.detail.response.text()\n this.setError(errorMessage)\n },\n {signal},\n )\n }\n\n disconnectedCallback() {\n this.#abortController?.abort()\n }\n\n clearContents() {\n this.inputElement.value = ''\n this.inputElement.focus()\n this.inputElement.dispatchEvent(new Event('input', { bubbles: true, cancelable: false }))\n }\n\n clearError(): void {\n this.inputElement.removeAttribute('invalid')\n this.validationElement.hidden = true\n this.validationMessageElement.replaceChildren()\n }\n\n setValidationMessage(message: string): void {\n const template = document.createElement('template')\n // eslint-disable-next-line github/no-inner-html\n template.innerHTML = message\n const fragment = document.importNode(template.content, true)\n this.validationMessageElement.replaceChildren(fragment)\n }\n\n toggleValidationStyling(isError: boolean): void {\n if (isError) {\n this.validationElement.classList.remove('FormControl-inlineValidation--success')\n } else {\n this.validationElement.classList.add('FormControl-inlineValidation--success')\n }\n this.validationSuccessIcon.hidden = isError\n this.validationErrorIcon.hidden = !isError\n this.inputElement.setAttribute('invalid', isError ? 'true' : 'false')\n }\n\n setSuccess(message: string): void {\n this.toggleValidationStyling(false)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n setError(message: string): void {\n this.toggleValidationStyling(true)\n this.setValidationMessage(message)\n this.validationElement.hidden = false\n }\n\n showLeadingSpinner(): void {\n this.leadingSpinner?.removeAttribute('hidden')\n this.leadingVisual?.setAttribute('hidden', '')\n }\n\n hideLeadingSpinner(): void {\n this.leadingSpinner?.setAttribute('hidden', '')\n this.leadingVisual?.removeAttribute('hidden')\n }\n}\n","/* eslint-disable custom-elements/expose-class-on-global */\n\nimport {controller, target} from '@github/catalyst'\n\n@controller\nexport class ToggleSwitchInputElement extends HTMLElement {\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n\n connectedCallback() {\n this.addEventListener('toggleSwitchError', (event: Event) => {\n this.validationMessageElement.textContent = (event as CustomEvent).detail\n this.validationElement.removeAttribute('hidden')\n })\n\n this.addEventListener('toggleSwitchSuccess', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n\n this.addEventListener('toggleSwitchLoading', () => {\n this.validationMessageElement.textContent = ''\n this.validationElement.setAttribute('hidden', 'hidden')\n })\n }\n}\n","import {controller, target} from '@github/catalyst'\nimport '@oddbird/popover-polyfill'\nimport type {IncludeFragmentElement} from '@github/include-fragment-element'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n element: Element\n}\n\nconst validSelectors = ['[role=\"menuitem\"]', '[role=\"menuitemcheckbox\"]', '[role=\"menuitemradio\"]']\nconst menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`)\n\n@controller\nexport class ActionMenuElement extends HTMLElement {\n @target\n includeFragment: IncludeFragmentElement\n\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #invokerBeingClicked = false\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get popoverElement(): HTMLElement | null {\n return (this.invokerElement?.popoverTargetElement as HTMLElement) || null\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('[role=menu]')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n const selectedItems = this.querySelectorAll('[aria-checked=true]')\n const results: SelectedItem[] = []\n\n for (const selectedItem of selectedItems) {\n const labelEl = selectedItem.querySelector('.ActionListItem-label')\n\n results.push({\n label: labelEl?.textContent,\n value: selectedItem?.getAttribute('data-value'),\n element: selectedItem,\n })\n }\n\n return results\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mouseover', this, {signal})\n this.addEventListener('focusout', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.popoverElement?.addEventListener('toggle', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n\n if (this.includeFragment) {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {\n signal,\n })\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(menuItemSelectors.join(','))\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n handleEvent(event: Event) {\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (event.type === 'toggle' && (event as ToggleEvent).newState === 'open') {\n this.#firstItem?.focus()\n }\n\n if (targetIsInvoker && event.type === 'mousedown') {\n this.#invokerBeingClicked = true\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n this.#invokerBeingClicked = false\n return\n }\n\n if (event.type === 'focusout') {\n if (this.#invokerBeingClicked) return\n\n // Give the browser time to focus the next element\n requestAnimationFrame(() => {\n if (!this.contains(document.activeElement) || document.activeElement === this.invokerElement) {\n this.#handleFocusOut()\n }\n })\n\n return\n }\n\n const item = (event.target as Element).closest(menuItemSelectors.join(','))\n const targetIsItem = item !== null\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n ;(item as HTMLElement).click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'include-fragment-replaced') {\n this.#handleIncludeFragmentReplaced()\n }\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n\n if (this.#isOpen()) {\n this.#hide()\n } else {\n this.#show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n if (this.contains(dialog)) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = 'none'\n }\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n if (this.contains(dialog)) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = ''\n if (this.#isOpen()) {\n this.#hide()\n }\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n const focusInDialog = dialog.contains(activeElement)\n if (lostFocus || focusInClosedMenu || focusInDialog) {\n setTimeout(() => {\n // if the activeElement has changed after a task, then it's likely\n // that other JS has tried to shift focus. We should respect that\n // focus shift as long as it's not back at the document.\n const newActiveElement = this.ownerDocument.activeElement\n if (newActiveElement === activeElement || newActiveElement === this.ownerDocument.body) {\n this.invokerElement?.focus()\n }\n }, 0)\n }\n }\n // a modal <dialog> element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: Element) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // <a> tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.#isOpen()) {\n this.#hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const ariaChecked = item.getAttribute('aria-checked')\n const checked = ariaChecked !== 'true'\n\n if (this.selectVariant === 'single') {\n // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.\n if (checked) {\n item.setAttribute('aria-checked', 'true')\n }\n\n for (const checkedItem of this.querySelectorAll('[aria-checked]')) {\n if (checkedItem !== item) {\n checkedItem.setAttribute('aria-checked', 'false')\n }\n }\n\n this.#setDynamicLabel()\n } else {\n // multi-select mode allows unchecking a checked item\n item.setAttribute('aria-checked', `${checked}`)\n }\n\n this.#updateInput()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n detail: {item: item.parentElement, checked: this.isItemChecked(item.parentElement)},\n }),\n )\n }\n\n #handleIncludeFragmentReplaced() {\n if (this.#firstItem) this.#firstItem.focus()\n this.#softDisableItems()\n }\n\n // Close when focus leaves menu\n #handleFocusOut() {\n this.#hide()\n }\n\n #show() {\n this.popoverElement?.showPopover()\n }\n\n #hide() {\n this.popoverElement?.hidePopover()\n }\n\n #isOpen() {\n return this.popoverElement?.matches(':popover-open')\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel = this.querySelector('[aria-checked=true] .ActionListItem-label')\n if (itemLabel && this.dynamicLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = this.dynamicLabelPrefix\n contentSpan.textContent = itemLabel.textContent || ''\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement | null\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): HTMLElement | null {\n return this.querySelector(menuItemSelectors.join(','))\n }\n\n get items(): HTMLElement[] {\n return Array.from(this.querySelectorAll(menuItemSelectors.join(',')))\n }\n\n getItemById(itemId: string): HTMLElement | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: Element | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: Element | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: Element | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n item.querySelector('.ActionListContent')!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: Element | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n hideItem(item: Element | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n showItem(item: Element | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: Element | null) {\n if (item) {\n return item.querySelector('.ActionListContent')!.getAttribute('aria-checked') === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (!ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n\n uncheckItem(item: Element | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n const itemContent = item.querySelector('.ActionListContent')!\n const ariaChecked = itemContent.getAttribute('aria-checked') === 'true'\n\n if (ariaChecked) {\n this.#handleItemActivated(itemContent)\n }\n }\n }\n}\n\nif (!window.customElements.get('action-menu')) {\n window.ActionMenuElement = ActionMenuElement\n window.customElements.define('action-menu', ActionMenuElement)\n}\n\ndeclare global {\n interface Window {\n ActionMenuElement: typeof ActionMenuElement\n }\n}\n","const Ordering = {\n Less: \"less\",\n Equal: \"equal\",\n Greater: \"greater\"\n};\n\nvar __typeError$2 = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2(\"Cannot \" + msg);\nvar __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod$1 = (obj, member, method) => (__accessCheck$2(obj, member, \"access private method\"), method);\nvar _compareFn, _heap, _MinHeap_instances, heapifyDown_fn, heapifyUp_fn;\nclass MinHeap {\n constructor({ compareFn }) {\n __privateAdd$2(this, _MinHeap_instances);\n __privateAdd$2(this, _compareFn);\n __privateAdd$2(this, _heap);\n __privateSet$2(this, _compareFn, compareFn);\n __privateSet$2(this, _heap, []);\n }\n insert(value) {\n __privateGet$2(this, _heap).push(value);\n __privateMethod$1(this, _MinHeap_instances, heapifyUp_fn).call(this);\n }\n pop() {\n const item = __privateGet$2(this, _heap)[0];\n if (__privateGet$2(this, _heap)[__privateGet$2(this, _heap).length - 1]) {\n __privateGet$2(this, _heap)[0] = __privateGet$2(this, _heap)[__privateGet$2(this, _heap).length - 1];\n __privateGet$2(this, _heap).pop();\n }\n __privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);\n return item;\n }\n peek() {\n return __privateGet$2(this, _heap)[0];\n }\n delete(value) {\n const index = __privateGet$2(this, _heap).indexOf(value);\n if (index === -1) {\n return;\n }\n swap(__privateGet$2(this, _heap), index, __privateGet$2(this, _heap).length - 1);\n __privateGet$2(this, _heap).pop();\n __privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);\n }\n clear() {\n __privateSet$2(this, _heap, []);\n }\n get size() {\n return __privateGet$2(this, _heap).length;\n }\n}\n_compareFn = new WeakMap();\n_heap = new WeakMap();\n_MinHeap_instances = new WeakSet();\nheapifyDown_fn = function() {\n let index = 0;\n while (hasLeftChild(index, __privateGet$2(this, _heap).length)) {\n let smallerChildIndex = getLeftChildIndex(index);\n if (hasRightChild(index, __privateGet$2(this, _heap).length) && __privateGet$2(this, _compareFn).call(this, rightChild(__privateGet$2(this, _heap), index), leftChild(__privateGet$2(this, _heap), index)) === Ordering.Less) {\n smallerChildIndex = getRightChildIndex(index);\n }\n if (__privateGet$2(this, _compareFn).call(this, __privateGet$2(this, _heap)[index], __privateGet$2(this, _heap)[smallerChildIndex]) === Ordering.Less) {\n break;\n } else {\n swap(__privateGet$2(this, _heap), index, smallerChildIndex);\n }\n index = smallerChildIndex;\n }\n};\nheapifyUp_fn = function() {\n let index = __privateGet$2(this, _heap).length - 1;\n while (hasParent(index) && __privateGet$2(this, _compareFn).call(this, __privateGet$2(this, _heap)[index], parent(__privateGet$2(this, _heap), index)) === Ordering.Less) {\n swap(__privateGet$2(this, _heap), index, getParentIndex(index));\n index = getParentIndex(index);\n }\n};\nfunction getLeftChildIndex(index) {\n return 2 * index + 1;\n}\nfunction getRightChildIndex(index) {\n return 2 * index + 2;\n}\nfunction getParentIndex(index) {\n return Math.floor((index - 1) / 2);\n}\nfunction hasLeftChild(index, size) {\n return getLeftChildIndex(index) < size;\n}\nfunction hasRightChild(index, size) {\n return getRightChildIndex(index) < size;\n}\nfunction hasParent(index) {\n return index > 0;\n}\nfunction leftChild(heap, index) {\n return heap[getLeftChildIndex(index)];\n}\nfunction rightChild(heap, index) {\n return heap[getRightChildIndex(index)];\n}\nfunction parent(heap, index) {\n return heap[getParentIndex(index)];\n}\nfunction swap(heap, a, b) {\n const tmp = heap[a];\n heap[a] = heap[b];\n heap[b] = tmp;\n}\n\nvar __defProp = Object.defineProperty;\nvar __typeError$1 = (msg) => {\n throw TypeError(msg);\n};\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1(\"Cannot \" + msg);\nvar __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar _a, _promise, _resolve, _reject;\n_a = Symbol.toStringTag;\nclass Deferred {\n constructor() {\n __publicField(this, _a, \"Deferred\");\n __privateAdd$1(this, _promise);\n __privateAdd$1(this, _resolve);\n __privateAdd$1(this, _reject);\n __privateSet$1(this, _promise, new Promise((resolve, reject) => {\n __privateSet$1(this, _resolve, resolve);\n __privateSet$1(this, _reject, reject);\n }));\n }\n then(onfulfilled, onrejected) {\n return Promise.prototype.then.apply(__privateGet$1(this, _promise), [onfulfilled, onrejected]);\n }\n catch(onrejected) {\n return Promise.prototype.catch.apply(__privateGet$1(this, _promise), [onrejected]);\n }\n finally(onfinally) {\n return Promise.prototype.finally.apply(__privateGet$1(this, _promise), [onfinally]);\n }\n resolve(value) {\n __privateGet$1(this, _resolve).call(this, value);\n }\n reject(reason) {\n __privateGet$1(this, _reject).call(this, reason);\n }\n getPromise() {\n return __privateGet$1(this, _promise);\n }\n}\n_promise = new WeakMap();\n_resolve = new WeakMap();\n_reject = new WeakMap();\n\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod = (obj, member, method) => (__accessCheck(obj, member, \"access private method\"), method);\nvar _pending, _queue, _timeoutId, _LiveRegionElement_instances, performWork_fn, updateContainerWithMessage_fn;\nconst DEFAULT_THROTTLE_DELAY_MS = 150;\nclass LiveRegionElement extends HTMLElement {\n constructor() {\n super();\n __privateAdd(this, _LiveRegionElement_instances);\n /**\n * A flag to indicate if a message has been announced and we are currently\n * waiting for the delay to pass before announcing the next message.\n */\n __privateAdd(this, _pending);\n /**\n * A priority queue to store messages to be announced by the live region.\n */\n __privateAdd(this, _queue);\n /**\n * The id for a timeout being used by the live region to either wait until the\n * next message or wait until the delay has passed before announcing the next\n * message\n */\n __privateAdd(this, _timeoutId);\n if (!this.shadowRoot) {\n const template2 = getTemplate();\n const shadowRoot = this.attachShadow({ mode: \"open\" });\n shadowRoot.appendChild(template2.content.cloneNode(true));\n }\n __privateSet(this, _pending, false);\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _queue, new MinHeap({\n compareFn: compareMessages\n }));\n }\n /**\n * The delay in milliseconds to wait between announcements. This helps to\n * prevent announcements getting dropped if multiple are made at the same time.\n */\n get delay() {\n const value = this.getAttribute(\"delay\");\n if (value) {\n return parseInt(value, 10);\n }\n return DEFAULT_THROTTLE_DELAY_MS;\n }\n set delay(value) {\n this.setAttribute(\"delay\", `${value}`);\n }\n /**\n * Announce a message using a live region with a corresponding politeness\n * level.\n */\n announce(message, options = {}) {\n const { delayMs, politeness = \"polite\" } = options;\n const now = Date.now();\n const deferred = new Deferred();\n const item = {\n deferred,\n politeness,\n contents: message,\n scheduled: delayMs !== void 0 ? now + delayMs : now\n };\n __privateGet(this, _queue).insert(item);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n return {\n ...deferred.getPromise(),\n cancel: () => {\n __privateGet(this, _queue).delete(item);\n deferred.resolve();\n }\n };\n }\n /**\n * Announce a message using the text content of an element with a\n * corresponding politeness level\n */\n announceFromElement(element, options) {\n const textContent = getTextContent(element);\n if (textContent !== \"\") {\n return this.announce(textContent, options);\n }\n const promise = Promise.resolve();\n return {\n ...promise,\n cancel: noop\n };\n }\n getMessage(politeness = \"polite\") {\n const container = this.shadowRoot?.getElementById(politeness);\n if (!container) {\n throw new Error(\"Unable to find container for message\");\n }\n return container.textContent;\n }\n /**\n * Prevent pending messages from being announced by the live region.\n */\n clear() {\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n __privateSet(this, _timeoutId, null);\n }\n __privateSet(this, _pending, false);\n __privateGet(this, _queue).clear();\n }\n}\n_pending = new WeakMap();\n_queue = new WeakMap();\n_timeoutId = new WeakMap();\n_LiveRegionElement_instances = new WeakSet();\nperformWork_fn = function() {\n if (__privateGet(this, _pending)) {\n return;\n }\n let message = __privateGet(this, _queue).peek();\n if (!message) {\n return;\n }\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n __privateSet(this, _timeoutId, null);\n }\n const now = Date.now();\n if (message.scheduled <= now) {\n message = __privateGet(this, _queue).pop();\n if (message) {\n __privateMethod(this, _LiveRegionElement_instances, updateContainerWithMessage_fn).call(this, message);\n }\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n return;\n }\n const timeout = message.scheduled - now;\n __privateSet(this, _timeoutId, window.setTimeout(() => {\n __privateSet(this, _timeoutId, null);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }, timeout));\n};\nupdateContainerWithMessage_fn = function(message) {\n __privateSet(this, _pending, true);\n const { contents, deferred, politeness } = message;\n const container = this.shadowRoot?.getElementById(politeness);\n if (!container) {\n __privateSet(this, _pending, false);\n throw new Error(`Unable to find container for message. Expected a container with id=\"${politeness}\"`);\n }\n if (container.textContent === contents) {\n container.textContent = `${contents}\\xA0`;\n } else {\n container.textContent = contents;\n }\n if (__privateGet(this, _timeoutId) !== null) {\n clearTimeout(__privateGet(this, _timeoutId));\n }\n deferred.resolve();\n if (this.delay > 0) {\n __privateSet(this, _timeoutId, window.setTimeout(() => {\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _pending, false);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }, this.delay));\n } else {\n __privateSet(this, _timeoutId, null);\n __privateSet(this, _pending, false);\n __privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);\n }\n};\nfunction getTextContent(element) {\n let value = \"\";\n if (element.hasAttribute(\"aria-label\")) {\n value = element.getAttribute(\"aria-label\");\n } else if (element.innerText) {\n value = element.innerText;\n } else if (element.textContent) {\n value = element.textContent;\n }\n return value ? value.trim() : \"\";\n}\nlet template = null;\nconst templateContent = `\n<style>\n:host {\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n</style>\n<div id=\"polite\" aria-live=\"polite\" aria-atomic=\"true\"></div>\n<div id=\"assertive\" aria-live=\"assertive\" aria-atomic=\"true\"></div>\n`;\nfunction getTemplate() {\n if (template) {\n return template;\n }\n template = document.createElement(\"template\");\n template.innerHTML = templateContent;\n return template;\n}\nfunction compareMessages(a, b) {\n if (a.politeness === b.politeness) {\n if (a.scheduled === b.scheduled) {\n return Ordering.Equal;\n }\n if (a.scheduled < b.scheduled) {\n return Ordering.Less;\n }\n return Ordering.Greater;\n }\n if (a.politeness === \"assertive\" && b.politeness !== \"assertive\") {\n return Ordering.Less;\n }\n if (a.politeness !== \"assertive\" && b.politeness === \"assertive\") {\n return Ordering.Greater;\n }\n return Ordering.Equal;\n}\nfunction noop() {\n}\n\nif (!customElements.get(\"live-region\")) {\n customElements.define(\"live-region\", LiveRegionElement);\n}\n\nfunction announce(message, options = {}) {\n let liveRegion = findLiveRegion(options.from);\n if (!liveRegion) {\n liveRegion = document.createElement(\"live-region\");\n if (options.appendTo) {\n options.appendTo.appendChild(liveRegion);\n } else {\n const container = getLiveRegionContainer(options.from);\n container.appendChild(liveRegion);\n }\n if (process.env.NODE_ENV === \"test\") {\n return liveRegion.announce(message, options);\n }\n let canceled = false;\n let cancel = () => {\n canceled = true;\n };\n const promise = wait(REGISTER_WAIT_MS).then(() => {\n if (!canceled) {\n const result = liveRegion.announce(message, options);\n cancel = result.cancel;\n return result;\n }\n });\n return {\n ...promise,\n cancel: () => {\n cancel();\n }\n };\n }\n return liveRegion.announce(message, options);\n}\nfunction announceFromElement(element, options = {}) {\n let liveRegion = findLiveRegion(options.from);\n if (!liveRegion) {\n liveRegion = document.createElement(\"live-region\");\n if (options.appendTo) {\n options.appendTo.appendChild(liveRegion);\n } else {\n const container = getLiveRegionContainer(options.from);\n container.appendChild(liveRegion);\n }\n if (process.env.NODE_ENV === \"test\") {\n return liveRegion.announceFromElement(element, options);\n }\n let canceled = false;\n let cancel = () => {\n canceled = true;\n };\n const promise = wait(REGISTER_WAIT_MS).then(() => {\n if (!canceled) {\n const result = liveRegion.announceFromElement(element, options);\n cancel = result.cancel;\n return result;\n }\n });\n return {\n ...promise,\n cancel: () => {\n cancel();\n }\n };\n }\n return liveRegion.announceFromElement(element, options);\n}\nfunction findLiveRegion(from) {\n let liveRegion = null;\n liveRegion = from ? getClosestLiveRegion(from) : null;\n if (liveRegion !== null) {\n return liveRegion;\n }\n const container = getLiveRegionContainer(from);\n liveRegion = container.querySelector(\"live-region\");\n if (liveRegion !== null) {\n return liveRegion;\n }\n return null;\n}\nfunction getClosestLiveRegion(from) {\n const dialog = from.closest(\"dialog\");\n let current = from;\n while (current = current.parentElement) {\n if (dialog && !dialog.contains(current)) {\n break;\n }\n for (const child of current.childNodes) {\n if (child instanceof LiveRegionElement) {\n return child;\n }\n }\n }\n return null;\n}\nfunction getLiveRegionContainer(from) {\n let container = document.body;\n if (from) {\n const dialog = from.closest(\"dialog\");\n if (dialog) {\n container = dialog;\n }\n }\n return container;\n}\nconst REGISTER_WAIT_MS = 150;\nfunction wait(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport { LiveRegionElement, announce, announceFromElement, templateContent };\n","import {getAnchoredPosition} from '@primer/behaviors'\nimport {controller, target} from '@github/catalyst'\nimport {IncludeFragmentElement} from '@github/include-fragment-element'\nimport type {PrimerTextFieldElement} from 'app/lib/primer/forms/primer_text_field'\nimport type {AnchorAlignment, AnchorSide} from '@primer/behaviors'\nimport type {LiveRegionElement} from '@primer/live-region-element'\nimport '@primer/live-region-element'\nimport '@oddbird/popover-polyfill'\n\ntype SelectVariant = 'none' | 'single' | 'multiple' | null\ntype SelectedItem = {\n label: string | null | undefined\n value: string | null | undefined\n inputName: string | null | undefined\n}\n\nconst validSelectors = ['[role=\"option\"]']\nconst menuItemSelectors = validSelectors.join(',')\nconst visibleMenuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(',')\n\nexport type SelectPanelItem = HTMLLIElement\n\nenum FetchStrategy {\n REMOTE,\n EVENTUALLY_LOCAL,\n LOCAL,\n}\n\nenum ErrorStateType {\n BODY,\n BANNER,\n}\n\nexport type FilterFn = (item: SelectPanelItem, query: string) => boolean\n\nconst updateWhenVisible = (() => {\n const anchors = new Set<SelectPanelElement>()\n let resizeObserver: ResizeObserver | null = null\n function updateVisibleAnchors() {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n }\n return (el: SelectPanelElement) => {\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateVisibleAnchors)\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', updateVisibleAnchors)\n\n resizeObserver ||= new ResizeObserver(() => {\n for (const anchor of anchors) {\n anchor.updateAnchorPosition()\n }\n })\n resizeObserver.observe(el.ownerDocument.documentElement)\n el.addEventListener('dialog:close', () => {\n el.invokerElement?.setAttribute('aria-expanded', 'false')\n anchors.delete(el)\n })\n el.addEventListener('dialog:open', () => {\n anchors.add(el)\n })\n }\n})()\n\n@controller\nexport class SelectPanelElement extends HTMLElement {\n @target includeFragment: IncludeFragmentElement\n @target dialog: HTMLDialogElement\n @target filterInputTextField: HTMLInputElement\n @target remoteInput: HTMLElement\n @target list: HTMLElement\n @target noResults: HTMLElement\n @target fragmentErrorElement: HTMLElement\n @target bannerErrorElement: HTMLElement\n @target bodySpinner: HTMLElement\n @target liveRegion: LiveRegionElement\n\n filterFn?: FilterFn\n\n #dialogIntersectionObserver: IntersectionObserver\n #abortController: AbortController\n #originalLabel = ''\n #inputName = ''\n #selectedItems: Map<string, SelectedItem> = new Map()\n #loadingDelayTimeoutId: number | null = null\n #loadingAnnouncementTimeoutId: number | null = null\n #hasLoadedData = false\n\n get open(): boolean {\n return this.dialog.open\n }\n\n get selectVariant(): SelectVariant {\n return this.getAttribute('data-select-variant') as SelectVariant\n }\n\n get ariaSelectionType(): string {\n return this.selectVariant === 'multiple' ? 'aria-checked' : 'aria-selected'\n }\n\n set selectVariant(variant: SelectVariant) {\n if (variant) {\n this.setAttribute('data-select-variant', variant)\n } else {\n this.removeAttribute('variant')\n }\n }\n\n get dynamicLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n get dynamicAriaLabelPrefix(): string {\n const prefix = this.getAttribute('data-dynamic-aria-label-prefix')\n if (!prefix) return ''\n return `${prefix}:`\n }\n\n set dynamicLabelPrefix(value: string) {\n this.setAttribute('data-dynamic-label', value)\n }\n\n get dynamicLabel(): boolean {\n return this.hasAttribute('data-dynamic-label')\n }\n\n set dynamicLabel(value: boolean) {\n this.toggleAttribute('data-dynamic-label', value)\n }\n\n get invokerElement(): HTMLButtonElement | null {\n const id = this.querySelector('dialog')?.id\n if (!id) return null\n for (const el of this.querySelectorAll(`[aria-controls]`)) {\n if (el.getAttribute('aria-controls') === id) {\n return el as HTMLButtonElement\n }\n }\n return null\n }\n\n get closeButton(): HTMLButtonElement | null {\n return this.querySelector('button[data-close-dialog-id]')\n }\n\n get invokerLabel(): HTMLElement | null {\n if (!this.invokerElement) return null\n return this.invokerElement.querySelector('.Button-label')\n }\n\n get selectedItems(): SelectedItem[] {\n return Array.from(this.#selectedItems.values())\n }\n\n get align(): AnchorAlignment {\n return (this.getAttribute('anchor-align') || 'start') as AnchorAlignment\n }\n\n get side(): AnchorSide {\n return (this.getAttribute('anchor-side') || 'outside-bottom') as AnchorSide\n }\n\n updateAnchorPosition() {\n // If the selectPanel is removed from the screen on resize close the dialog\n if (this && this.offsetParent === null) {\n this.hide()\n }\n\n if (this.invokerElement) {\n const {top, left} = getAnchoredPosition(this.dialog, this.invokerElement, {\n align: this.align,\n side: this.side,\n anchorOffset: 4,\n })\n this.dialog.style.top = `${top}px`\n this.dialog.style.left = `${left}px`\n this.dialog.style.bottom = 'auto'\n this.dialog.style.right = 'auto'\n }\n }\n\n connectedCallback() {\n const {signal} = (this.#abortController = new AbortController())\n this.addEventListener('keydown', this, {signal})\n this.addEventListener('click', this, {signal})\n this.addEventListener('mousedown', this, {signal})\n this.addEventListener('input', this, {signal})\n this.addEventListener('remote-input-success', this, {signal})\n this.addEventListener('remote-input-error', this, {signal})\n this.addEventListener('loadstart', this, {signal})\n this.#setDynamicLabel()\n this.#updateInput()\n this.#softDisableItems()\n updateWhenVisible(this)\n\n this.#waitForCondition(\n () => Boolean(this.remoteInput),\n () => {\n this.remoteInput.addEventListener('loadstart', this, {signal})\n this.remoteInput.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#waitForCondition(\n () => Boolean(this.includeFragment),\n () => {\n this.includeFragment.addEventListener('include-fragment-replaced', this, {signal})\n this.includeFragment.addEventListener('error', this, {signal})\n this.includeFragment.addEventListener('loadend', this, {signal})\n },\n )\n\n this.#dialogIntersectionObserver = new IntersectionObserver(entries => {\n for (const entry of entries) {\n const elem = entry.target\n if (entry.isIntersecting && elem === this.dialog) {\n // Focus on the filter input when the dialog opens to work around a Safari limitation\n // that prevents the autofocus attribute from working as it does in other browsers\n if (this.filterInputTextField) {\n if (document.activeElement !== this.filterInputTextField) {\n this.filterInputTextField.focus()\n }\n }\n\n // signal that any focus hijinks are finished (thanks Safari)\n this.dialog.setAttribute('data-ready', 'true')\n\n this.updateAnchorPosition()\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#updateItemVisibility()\n }\n }\n }\n })\n\n this.#waitForCondition(\n () => Boolean(this.dialog),\n () => {\n this.#dialogIntersectionObserver.observe(this.dialog)\n this.dialog.addEventListener('close', this, {signal})\n\n if (this.getAttribute('data-open-on-load') === 'true') {\n this.show()\n }\n },\n )\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL) {\n this.#waitForCondition(\n () => this.items.length > 0,\n () => {\n this.#updateItemVisibility()\n this.#updateInput()\n },\n )\n }\n }\n\n // Waits for condition to return true. If it returns false initially, this function creates a\n // MutationObserver that calls body() whenever the contents of the component change.\n #waitForCondition(condition: () => boolean, body: () => void) {\n if (condition()) {\n body()\n } else {\n const mutationObserver = new MutationObserver(() => {\n if (condition()) {\n body()\n mutationObserver.disconnect()\n }\n })\n\n mutationObserver.observe(this, {childList: true, subtree: true})\n }\n }\n\n disconnectedCallback() {\n this.#abortController.abort()\n }\n\n #softDisableItems() {\n const {signal} = this.#abortController\n\n for (const item of this.querySelectorAll(validSelectors.join(','))) {\n item.addEventListener('click', this.#potentiallyDisallowActivation.bind(this), {signal})\n item.addEventListener('keydown', this.#potentiallyDisallowActivation.bind(this), {signal})\n }\n }\n\n // If there is an active item in single-select mode, set its tabindex to 0. Otherwise, set the\n // first visible item's tabindex to 0. All other items should have a tabindex of -1.\n #updateTabIndices() {\n let setZeroTabIndex = false\n\n if (this.selectVariant === 'single') {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n if (!this.isItemHidden(item) && this.isItemChecked(item) && !setZeroTabIndex) {\n itemContent.setAttribute('tabindex', '0')\n setZeroTabIndex = true\n } else {\n itemContent.setAttribute('tabindex', '-1')\n }\n\n // <li> elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n } else {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n itemContent.setAttribute('tabindex', '-1')\n\n // <li> elements should not themselves be tabbable\n item.removeAttribute('tabindex')\n }\n }\n\n if (!setZeroTabIndex && this.#firstItem) {\n this.#getItemContent(this.#firstItem)?.setAttribute('tabindex', '0')\n }\n }\n\n // returns true if activation was prevented\n #potentiallyDisallowActivation(event: Event): boolean {\n if (!this.#isActivation(event)) return false\n\n const item = (event.target as HTMLElement).closest(visibleMenuItemSelectors)\n if (!item) return false\n\n if (item.getAttribute('aria-disabled')) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopImmediatePropagation()\n return true\n }\n\n return false\n }\n\n #isAnchorActivationViaSpace(event: Event): boolean {\n return (\n event.target instanceof HTMLAnchorElement &&\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isActivation(event: Event): boolean {\n // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via\n // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent\n // inherits from MouseEvent, it is enough to check for MouseEvent here.\n return (event instanceof MouseEvent && event.type === 'click') || this.#isAnchorActivationViaSpace(event)\n }\n\n #checkSelectedItems() {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n if (this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'true')\n }\n }\n }\n\n this.#updateInput()\n }\n\n #addSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n\n if (value) {\n this.#selectedItems.set(value, {\n value,\n label: itemContent.querySelector('.ActionListItem-label')?.textContent?.trim(),\n inputName: itemContent.getAttribute('data-input-name'),\n })\n }\n }\n\n #removeSelectedItem(item: SelectPanelItem) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) return\n\n const value = itemContent.getAttribute('data-value')\n if (value) {\n this.#selectedItems.delete(value)\n }\n }\n\n #setTextFieldLoadingSpinnerTimer() {\n if (!this.#filterInputTextFieldElement) return\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n\n this.#loadingAnnouncementTimeoutId = setTimeout(() => {\n this.liveRegion.announce('Loading')\n }, 2000) as unknown as number\n\n this.#loadingDelayTimeoutId = setTimeout(() => {\n this.#filterInputTextFieldElement?.showLeadingSpinner()\n }, 1000) as unknown as number\n }\n\n handleEvent(event: Event) {\n if (event.target === this.filterInputTextField) {\n this.#handleSearchFieldEvent(event)\n return\n }\n\n if (event.target === this.remoteInput) {\n this.#handleRemoteInputEvent(event)\n return\n }\n\n const targetIsInvoker = this.invokerElement?.contains(event.target as HTMLElement)\n const targetIsCloseButton = this.closeButton?.contains(event.target as HTMLElement)\n const eventIsActivation = this.#isActivation(event)\n\n if (targetIsInvoker && event.type === 'mousedown') {\n return\n }\n\n if (event.type === 'mousedown' && event.target instanceof HTMLInputElement) {\n return\n }\n\n // Prevent safari bug that dismisses menu on mousedown instead of allowing\n // the click event to propagate to the button\n if (event.type === 'mousedown') {\n event.preventDefault()\n return\n }\n\n if (targetIsInvoker && eventIsActivation) {\n this.#handleInvokerActivated(event)\n return\n }\n\n if (targetIsCloseButton && eventIsActivation) {\n // hide() will automatically be called by dialog event triggered from `data-close-dialog-id`\n return\n }\n\n if (event.target === this.dialog && event.type === 'close') {\n // Remove data-ready so it can be set the next time the panel is opened\n this.dialog.removeAttribute('data-ready')\n this.invokerElement?.setAttribute('aria-expanded', 'false')\n // When we close the dialog, clear the filter input\n\n if (this.filterInputTextField) {\n const fireSearchEvent = this.filterInputTextField.value.length > 0\n this.filterInputTextField.value = ''\n if (fireSearchEvent) {\n this.filterInputTextField.dispatchEvent(new Event('input'))\n }\n }\n\n this.dispatchEvent(\n new CustomEvent('panelClosed', {\n detail: {panel: this},\n bubbles: true,\n }),\n )\n\n return\n }\n\n const item = (event.target as Element).closest(visibleMenuItemSelectors)?.parentElement as\n | SelectPanelItem\n | null\n | undefined\n\n const targetIsItem = item !== null && item !== undefined\n\n if (targetIsItem && eventIsActivation) {\n if (this.#potentiallyDisallowActivation(event)) return\n\n const dialogInvoker = item.closest('[data-show-dialog-id]')\n\n if (dialogInvoker) {\n const dialog = this.ownerDocument.getElementById(dialogInvoker.getAttribute('data-show-dialog-id') || '')\n\n if (dialog && this.contains(dialogInvoker) && this.contains(dialog)) {\n this.#handleDialogItemActivated(event, dialog)\n return\n }\n }\n\n // Pressing the space key on a link will cause the page to scroll unless preventDefault() is called.\n // We then click it manually to navigate.\n if (this.#isAnchorActivationViaSpace(event)) {\n event.preventDefault()\n this.#getItemContent(item)?.click()\n }\n\n this.#handleItemActivated(item)\n\n return\n }\n\n if (event.type === 'click') {\n const rect = this.dialog.getBoundingClientRect()\n\n const clickWasInsideDialog =\n rect.top <= (event as MouseEvent).clientY &&\n (event as MouseEvent).clientY <= rect.top + rect.height &&\n rect.left <= (event as MouseEvent).clientX &&\n (event as MouseEvent).clientX <= rect.left + rect.width\n\n if (!clickWasInsideDialog) {\n this.hide()\n }\n }\n\n // The include fragment will have been removed from the DOM by the time\n // the include-fragment-replaced event has been dispatched, so we have to\n // check for the type of the event target manually, since this.includeFragment\n // will be null.\n if (event.target instanceof IncludeFragmentElement) {\n this.#handleIncludeFragmentEvent(event)\n }\n }\n\n #handleIncludeFragmentEvent(event: Event) {\n switch (event.type) {\n case 'include-fragment-replaced': {\n this.#updateItemVisibility()\n break\n }\n\n case 'loadstart': {\n this.#toggleIncludeFragmentElements(false)\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n\n case 'error': {\n this.#toggleIncludeFragmentElements(true)\n\n const errorElement = this.fragmentErrorElement\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n this.liveRegion.announceFromElement(errorElement, {politeness: 'assertive'})\n return\n }\n\n break\n }\n }\n }\n\n #toggleIncludeFragmentElements(showError: boolean) {\n for (const el of this.includeFragment.querySelectorAll('[data-show-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = !showError\n }\n for (const el of this.includeFragment.querySelectorAll('[data-hide-on-error]')) {\n if (el instanceof HTMLElement) el.hidden = showError\n }\n }\n\n #handleRemoteInputEvent(event: Event) {\n switch (event.type) {\n case 'remote-input-success': {\n this.#clearErrorState()\n this.#updateItemVisibility()\n this.#checkSelectedItems()\n break\n }\n\n case 'remote-input-error': {\n this.bodySpinner?.setAttribute('hidden', '')\n\n if (this.includeFragment || this.visibleItems.length === 0) {\n this.#setErrorState(ErrorStateType.BODY)\n } else {\n this.#setErrorState(ErrorStateType.BANNER)\n }\n\n break\n }\n\n case 'loadstart': {\n if (!this.#performFilteringLocally()) {\n this.#clearErrorState()\n this.bodySpinner?.removeAttribute('hidden')\n\n if (this.bodySpinner) break\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n break\n }\n\n case 'loadend': {\n this.#filterInputTextFieldElement?.hideLeadingSpinner()\n if (this.#loadingAnnouncementTimeoutId) clearTimeout(this.#loadingAnnouncementTimeoutId)\n if (this.#loadingDelayTimeoutId) clearTimeout(this.#loadingDelayTimeoutId)\n this.dispatchEvent(new CustomEvent('loadend'))\n break\n }\n }\n }\n\n #defaultFilterFn(item: HTMLElement, query: string) {\n const text = (item.getAttribute('data-filter-string') || item.textContent || '').toLowerCase()\n return text.indexOf(query.toLowerCase()) > -1\n }\n\n #handleSearchFieldEvent(event: Event) {\n if (event.type === 'keydown') {\n const key = (event as KeyboardEvent).key\n\n if (key === 'Enter') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.click()\n }\n } else if (key === 'ArrowDown') {\n const item = (this.focusableItem || this.#getItemContent(this.visibleItems[0])) as HTMLLIElement\n\n if (item) {\n item.focus()\n event.preventDefault()\n }\n } else if (key === 'Home') {\n const item = this.visibleItems[0] as HTMLLIElement | null\n\n if (item) {\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n } else if (key === 'End') {\n if (this.visibleItems.length > 0) {\n const item = this.visibleItems[this.visibleItems.length - 1] as HTMLLIElement\n const itemContent = this.#getItemContent(item)\n if (itemContent) itemContent.focus()\n event.preventDefault()\n }\n }\n }\n\n if (event.type !== 'input') return\n\n // remote-input-element does not trigger another loadstart event if a request is\n // already in-flight, so we use the input event on the text field to reset the\n // loading spinner timer instead\n if (!this.bodySpinner && !this.#performFilteringLocally()) {\n this.#setTextFieldLoadingSpinnerTimer()\n }\n\n if (this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL) {\n if (this.includeFragment) {\n this.includeFragment.refetch()\n return\n }\n\n this.#updateItemVisibility()\n }\n }\n\n #updateItemVisibility() {\n if (!this.list) return\n\n let atLeastOneResult = false\n\n if (this.#performFilteringLocally()) {\n const query = this.filterInputTextField?.value ?? ''\n const filter = this.filterFn || this.#defaultFilterFn\n\n for (const item of this.items) {\n if (filter(item, query)) {\n this.#showItem(item)\n atLeastOneResult = true\n } else {\n this.#hideItem(item)\n }\n }\n } else {\n atLeastOneResult = this.items.length > 0\n }\n\n this.#updateTabIndices()\n this.#maybeAnnounce()\n\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n\n const value = itemContent.getAttribute('data-value')\n if (this.#hasLoadedData) {\n if (value && !this.#selectedItems.has(value)) {\n itemContent.setAttribute(this.ariaSelectionType, 'false')\n }\n } else if (value && !this.#selectedItems.has(value) && this.isItemChecked(item)) {\n this.#addSelectedItem(item)\n }\n }\n\n this.#hasLoadedData = true\n\n if (!this.noResults) return\n\n if (this.#inErrorState()) {\n this.noResults.setAttribute('hidden', '')\n return\n }\n\n if (atLeastOneResult) {\n this.noResults.setAttribute('hidden', '')\n // TODO can we change this to search for `@panelId-list`\n this.list?.querySelector('.ActionListWrap')?.removeAttribute('hidden')\n } else {\n this.list?.querySelector('.ActionListWrap')?.setAttribute('hidden', '')\n this.noResults.removeAttribute('hidden')\n }\n }\n\n #inErrorState(): boolean {\n if (this.fragmentErrorElement && !this.fragmentErrorElement.hasAttribute('hidden')) {\n return true\n }\n\n if (!this.bannerErrorElement) return false\n\n return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY && this.fragmentErrorElement) {\n this.fragmentErrorElement.removeAttribute('hidden')\n this.bannerErrorElement.setAttribute('hidden', '')\n } else {\n errorElement = this.bannerErrorElement\n this.bannerErrorElement?.removeAttribute('hidden')\n this.fragmentErrorElement?.setAttribute('hidden', '')\n }\n\n // check if the errorElement is visible in the dom\n if (errorElement && !errorElement.hasAttribute('hidden')) {\n this.liveRegion.announceFromElement(errorElement, {politeness: 'assertive'})\n return\n }\n }\n\n #clearErrorState() {\n this.fragmentErrorElement?.setAttribute('hidden', '')\n this.bannerErrorElement.setAttribute('hidden', '')\n }\n\n #maybeAnnounce() {\n if (this.open && this.list) {\n const items = this.visibleItems\n\n if (items.length > 0) {\n const instructions = 'tab for results'\n this.liveRegion.announce(`${items.length} result${items.length === 1 ? '' : 's'} ${instructions}`)\n } else {\n const noResultsEl = this.noResults\n if (noResultsEl) {\n this.liveRegion.announceFromElement(noResultsEl)\n }\n }\n }\n }\n\n get #fetchStrategy(): FetchStrategy {\n if (!this.list) return FetchStrategy.REMOTE\n\n switch (this.list.getAttribute('data-fetch-strategy')) {\n case 'local':\n return FetchStrategy.LOCAL\n case 'eventually_local':\n return FetchStrategy.EVENTUALLY_LOCAL\n default:\n return FetchStrategy.REMOTE\n }\n }\n\n get #filterInputTextFieldElement(): PrimerTextFieldElement | null {\n return this.filterInputTextField?.closest('primer-text-field') as PrimerTextFieldElement | null\n }\n\n #performFilteringLocally(): boolean {\n return this.#fetchStrategy === FetchStrategy.LOCAL || this.#fetchStrategy === FetchStrategy.EVENTUALLY_LOCAL\n }\n\n #handleInvokerActivated(event: Event) {\n event.preventDefault()\n\n // eslint-disable-next-line no-restricted-syntax\n event.stopPropagation()\n\n if (this.open) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n #handleDialogItemActivated(event: Event, dialog: HTMLElement) {\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = 'none'\n const dialog_controller = new AbortController()\n const {signal} = dialog_controller\n const handleDialogClose = () => {\n dialog_controller.abort()\n this.querySelector<HTMLElement>('.ActionListWrap')!.style.display = ''\n if (this.open) {\n this.hide()\n }\n const activeElement = this.ownerDocument.activeElement\n const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body\n const focusInClosedMenu = this.contains(activeElement)\n if (lostFocus || focusInClosedMenu) {\n setTimeout(() => this.invokerElement?.focus(), 0)\n }\n }\n // a modal <dialog> element will close all popovers\n dialog.addEventListener('close', handleDialogClose, {signal})\n dialog.addEventListener('cancel', handleDialogClose, {signal})\n }\n\n #handleItemActivated(item: SelectPanelItem) {\n // Hide popover after current event loop to prevent changes in focus from\n // altering the target of the event. Not doing this specifically affects\n // <a> tags. It causes the event to be sent to the currently focused element\n // instead of the anchor, which effectively prevents navigation, i.e. it\n // appears as if hitting enter does nothing. Curiously, clicking instead\n // works fine.\n if (this.selectVariant !== 'multiple') {\n setTimeout(() => {\n if (this.open) {\n this.hide()\n }\n })\n }\n\n // The rest of the code below deals with single/multiple selection behavior, and should not\n // interfere with events fired by menu items whose behavior is specified outside the library.\n if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single') return\n\n const currentlyChecked = this.isItemChecked(item)\n const checked = !currentlyChecked\n\n const activationSuccess = this.dispatchEvent(\n new CustomEvent('beforeItemActivated', {\n bubbles: true,\n cancelable: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n\n if (!activationSuccess) return\n\n const itemContent = this.#getItemContent(item)\n\n if (this.selectVariant === 'single') {\n // Don't check anything if we have an href\n if (itemContent?.getAttribute('href')) return\n\n // disallow unchecking checked item in single-select mode\n if (!currentlyChecked) {\n for (const el of this.items) {\n this.#getItemContent(el)?.setAttribute(this.ariaSelectionType, 'false')\n }\n\n this.#selectedItems.clear()\n\n if (checked) {\n this.#addSelectedItem(item)\n itemContent?.setAttribute(this.ariaSelectionType, 'true')\n }\n\n this.#setDynamicLabel()\n }\n } else {\n // multi-select mode allows unchecking a checked item\n itemContent?.setAttribute(this.ariaSelectionType, `${checked}`)\n\n if (checked) {\n this.#addSelectedItem(item)\n } else {\n this.#removeSelectedItem(item)\n }\n }\n\n this.#updateInput()\n this.#updateTabIndices()\n\n this.dispatchEvent(\n new CustomEvent('itemActivated', {\n bubbles: true,\n detail: {\n item,\n checked,\n value: this.#getItemContent(item)?.getAttribute('data-value'),\n },\n }),\n )\n }\n\n show() {\n this.updateAnchorPosition()\n this.dialog.showModal()\n this.invokerElement?.setAttribute('aria-expanded', 'true')\n const event = new CustomEvent('dialog:open', {\n detail: {dialog: this.dialog},\n })\n this.dispatchEvent(event)\n }\n\n hide() {\n this.dialog.close()\n }\n\n #setDynamicLabel() {\n if (!this.dynamicLabel) return\n const invokerLabel = this.invokerLabel\n if (!invokerLabel) return\n this.#originalLabel ||= invokerLabel.textContent || ''\n const itemLabel =\n this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent || this.#originalLabel\n if (itemLabel) {\n const prefixSpan = document.createElement('span')\n prefixSpan.classList.add('color-fg-muted')\n const contentSpan = document.createElement('span')\n prefixSpan.textContent = `${this.dynamicLabelPrefix} `\n contentSpan.textContent = itemLabel\n invokerLabel.replaceChildren(prefixSpan, contentSpan)\n\n if (this.dynamicAriaLabelPrefix) {\n this.invokerElement?.setAttribute('aria-label', `${this.dynamicAriaLabelPrefix} ${itemLabel.trim()}`)\n }\n } else {\n invokerLabel.textContent = this.#originalLabel\n }\n }\n\n #updateInput() {\n if (this.selectVariant === 'single') {\n const input = this.querySelector(`[data-list-inputs=true] input`) as HTMLInputElement\n if (!input) return\n\n const selectedItem = this.selectedItems[0]\n\n if (selectedItem) {\n input.value = (selectedItem.value || selectedItem.label || '').trim()\n if (selectedItem.inputName) input.name = selectedItem.inputName\n input.removeAttribute('disabled')\n } else {\n input.setAttribute('disabled', 'disabled')\n }\n } else if (this.selectVariant !== 'none') {\n // multiple select variant\n const inputList = this.querySelector('[data-list-inputs=true]')\n if (!inputList) return\n\n const inputs = inputList.querySelectorAll('input')\n\n if (inputs.length > 0) {\n this.#inputName ||= (inputs[0] as HTMLInputElement).name\n }\n\n for (const selectedItem of this.selectedItems) {\n const newInput = document.createElement('input')\n newInput.setAttribute('data-list-input', 'true')\n newInput.type = 'hidden'\n newInput.autocomplete = 'off'\n newInput.name = selectedItem.inputName || this.#inputName\n newInput.value = (selectedItem.value || selectedItem.label || '').trim()\n\n inputList.append(newInput)\n }\n\n for (const input of inputs) {\n input.remove()\n }\n }\n }\n\n get #firstItem(): SelectPanelItem | null {\n return (this.querySelector(visibleMenuItemSelectors)?.parentElement || null) as SelectPanelItem | null\n }\n\n get visibleItems(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(visibleMenuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get items(): SelectPanelItem[] {\n return Array.from(this.querySelectorAll(menuItemSelectors)).map(\n element => element.parentElement! as SelectPanelItem,\n )\n }\n\n get focusableItem(): HTMLElement | undefined {\n for (const item of this.items) {\n const itemContent = this.#getItemContent(item)\n if (!itemContent) continue\n if (itemContent.getAttribute('tabindex') === '0') {\n return itemContent\n }\n }\n }\n\n getItemById(itemId: string): SelectPanelItem | null {\n return this.querySelector(`li[data-item-id=\"${itemId}\"`)\n }\n\n isItemDisabled(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.classList.contains('ActionListItem--disabled')\n } else {\n return false\n }\n }\n\n disableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.add('ActionListItem--disabled')\n this.#getItemContent(item)!.setAttribute('aria-disabled', 'true')\n }\n }\n\n enableItem(item: SelectPanelItem | null) {\n if (item) {\n item.classList.remove('ActionListItem--disabled')\n this.#getItemContent(item)!.removeAttribute('aria-disabled')\n }\n }\n\n isItemHidden(item: SelectPanelItem | null): boolean {\n if (item) {\n return item.hasAttribute('hidden')\n } else {\n return false\n }\n }\n\n #hideItem(item: SelectPanelItem | null) {\n if (item) {\n item.setAttribute('hidden', 'hidden')\n }\n }\n\n #showItem(item: SelectPanelItem | null) {\n if (item) {\n item.removeAttribute('hidden')\n }\n }\n\n isItemChecked(item: SelectPanelItem | null) {\n if (item) {\n return this.#getItemContent(item)!.getAttribute(this.ariaSelectionType) === 'true'\n } else {\n return false\n }\n }\n\n checkItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (!this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n uncheckItem(item: SelectPanelItem | null) {\n if (item && (this.selectVariant === 'single' || this.selectVariant === 'multiple')) {\n if (this.isItemChecked(item)) {\n this.#handleItemActivated(item)\n }\n }\n }\n\n #getItemContent(item: SelectPanelItem): HTMLElement | null {\n return item.querySelector('.ActionListContent')\n }\n}\n\nif (!window.customElements.get('select-panel')) {\n window.SelectPanelElement = SelectPanelElement\n window.customElements.define('select-panel', SelectPanelElement)\n}\n\ndeclare global {\n interface Window {\n SelectPanelElement: typeof SelectPanelElement\n }\n}\n"],"names":["_IncludeFragmentElement_instances","_IncludeFragmentElement_busy","_IncludeFragmentElement_observer","_IncludeFragmentElement_handleData","_IncludeFragmentElement_getData","_IncludeFragmentElement_getStringOrErrorData","_IncludeFragmentElement_task","_IncludeFragmentElement_fetchDataWithEvents","__classPrivateFieldGet","receiver","state","kind","f","TypeError","has","call","value","get","__classPrivateFieldSet","set","privateData","WeakMap","cspTrustedTypesPolicyPromise","IncludeFragmentElement","HTMLElement","constructor","super","arguments","add","this","IntersectionObserver","entries","entry","isIntersecting","target","unobserve","loading","rootMargin","threshold","static","tag","registry","customElements","define","policy","Promise","resolve","observedAttributes","src","getAttribute","link","ownerDocument","createElement","href","val","setAttribute","accept","data","attributeChangedCallback","attribute","oldVal","isConnected","connectedCallback","shadowRoot","attachShadow","mode","style","document","textContent","append","observe","request","Error","Request","method","credentials","headers","Accept","load","fetch","refetch","delete","WeakSet","async","dataTreatedAsString","template","innerHTML","fragment","importNode","content","dispatchEvent","CustomEvent","cancelable","detail","replaceWith","_a","classList","cachedData","reject","toString","eventsToDispatch","setTimeout","eventType","Event","response","status","ct","split","find","x","match","includes","responseText","text","createHTML","error","root","globalThis","window","e","DOMException","name","ReferenceError","states","RemoteInputElement","fetchResults","bind","currentQuery","oninput","debounce","controller","oldValue","input","addEventListener","disconnectedCallback","removeEventListener","querySelector","HTMLInputElement","HTMLTextAreaElement","url","remoteInput","checkCurrentQuery","event","query","resultsContainer","getElementById","URL","location","params","URLSearchParams","search","abort","AbortController","signal","html","el","options","fetchWithNetworkEvents","removeAttribute","ok","bubbles","type","undefined","callback","timeout","args","clearTimeout","__decorate","decorators","key","desc","d","c","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","controllers","bindShadow","bindElements","listenForBind","observers","closed","observer","MutationObserver","mutations","mutation","Element","bindActions","addedNodes","node","childList","subtree","attributeFilter","subscription","unsubscribe","disconnect","querySelectorAll","hasAttribute","handleEvent","currentTarget","binding","bindings","closest","getRootNode","ShadowRoot","host","matches","shadowController","action","trim","eventSep","lastIndexOf","methodSep","Math","max","slice","dasherize","str","String","description","replace","toLowerCase","mustDasherize","dashed","attrKey","attr","proto","meta","initialized","initializeAttrs","instance","names","getPrototypeOf","prefix","attrPrefix","descriptor","configurable","newValue","Number","toggleAttribute","symbol","Symbol","for","CatalystDelegate","classObject","delegate","prototype","attributes","observed","attrToAttributeName","map","concat","defineObservedAttributes","register","upgrade","element","parentElement","cloneNode","autoShadowRoot","hasOwnProperty","parent","Map","Set","tagName","findTarget","targets","push","findTargets","readyState","once","listenerOptions","passive","handler","ActionListTruncationObserver","resizeObserver","ResizeObserver","update","items","item","label","tooltip","isTruncated","scrollWidth","clientWidth","display","ActionListElement","_ActionListElement_truncationObserver","alternateOrders","alternateAlignments","start","end","center","getAnchoredPosition","floatingElement","anchorElement","settings","test","body","showPopover","_b","isOnTopLayer","parentNode","getComputedStyle","position","getPositionedParent","clippingRect","overflow","clippingNode","elemRect","getBoundingClientRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","v","parseInt","top","left","width","height","innerHeight","Infinity","getClippingRect","parentElementStyle","parentElementRect","viewportRect","relativePosition","floatingRect","anchorRect","side","align","allowOutOfBounds","anchorOffset","alignmentOffset","relativeViewportRect","pos","calculatePosition","anchorSide","anchorAlign","alternateOrder","positionAttempt","prevSide","shouldRecalculatePosition","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","assign","pureCalculateAnchoredPosition","_c","_d","_e","positionDefaults","startsWith","getDefaultSettings","elementDimensions","anchorPosition","anchorRight","anchorBottom","currentPos","containerDimensions","iterateFocusableElements","container","strict","acceptFn","onlyTabbable","isTabbable","isFocusable","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","FILTER_ACCEPT","FILTER_SKIP","nextNode","reverse","lastChild","firstChild","previousNode","getFocusableChild","next","elem","disabledAttrInert","disabled","hiddenInert","hidden","hiddenInputInert","sentinelInert","contains","sizeInert","offsetWidth","offsetHeight","visibilityInert","visibility","displayInert","offsetParent","clientRectsInert","getClientRects","HTMLAnchorElement","tabIndex","signalSupported","noop","create","polyfill","originalAddEventListener","EventTarget","originalCallback","optionsOrCapture","AbortSignal","monkeyPatch","suspendedTrapStack","activeTrap","isMac","focusTrap","initialFocus","abortSignal","sentinelStart","onfocus","lastFocusableChild","focus","sentinelEnd","firstFocusableChild","prepend","sentinels","Array","from","filter","firstElementChild","lastElementChild","insertAdjacentElement","observeFocusTrap","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","wrappingController","followSignal","suspendedTrap","getElementsByClassName","remove","suspendedTrapIndex","findIndex","t","splice","trapToReactivate","pop","originalSignal","tryReactivate","capture","activeElement","isMacOS","navigator","platform","idSeed","FocusKeys","KEY_TO_BIT","ArrowLeft","ArrowHorizontal","ArrowDown","ArrowVertical","ArrowUp","ArrowRight","h","HL","j","JK","k","l","a","AD","s","WS","w","Tab","Home","HomeAndEnd","End","PageUp","PageUpDown","PageDown","Backspace","KEY_TO_DIRECTION","getDirection","keyboardEvent","direction","shiftKey","metaKey","ctrlKey","isActiveDescendantAttribute","hasActiveDescendantAttribute","focusZone","focusableElements","savedTabIndex","bindKeys","getNextFocusable","ArrowAll","focusOutBehavior","focusInStrategy","activeDescendantControl","activeDescendantCallback","onActiveDescendantChanged","currentFocusedElement","preventScroll","getFirstFocusableElement","updateFocusedElement","to","directlyActivated","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","focusableElementFilter","elementsToInsert","firstElementToInsert","iMin","iMax","floor","followsInDocument","findInsertionIndex","first","second","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","endFocusManagement","focusableElementIndex","indexOf","savedIndex","iterateFocusableElementsOptions","removedNode","removedNodes","addedNode","attributeOldValue","elementIndexFocusedByClick","focusableElement","relatedTarget","targetElementIndex","lastKeyboardFocusDirection","targetElement","elementToFocus","console","warn","keyboardEventRecipient","keyBit","defaultPrevented","keyLength","isTextInput","HTMLSelectElement","altKey","textInput","cursorAtStart","selectionStart","selectionEnd","cursorAtEnd","shouldIgnoreFocusHandling","nextElementToFocus","lastFocusedIndex","focusedIndex","getCurrentFocusedIndex","nextFocusedIndex","preventDefault","instersectionObserver","ActionBarElement","ItemType","_ActionBarElement_focusZoneAbortController","marginLeft","marginRight","requestAnimationFrame","menuItemClick","click","firstItem","firstItemTop","previousItemType","_ActionBarElement_instances","_ActionBarElement_eachItem","index","itemTop","Item","_ActionBarElement_hideItem","moreMenu","Divider","_ActionBarElement_showItem","idx","elementIsVisibleItem","elementIsVisibleActionMenuInvoker","invokerElement","foundItem","_index","menuItem","setProperty","DetailsMenuElement","preload","details","summary","subscriptions","fromEvent","trackComposition","shouldCommit","menu","KeyboardEvent","isComposing","isSummaryFocused","close","stopPropagation","sibling","ctrlBindings","selected","isMenuItem","keydown","loadFragment","opened","closeCurrentMenu","NullSubscription","focusOnOpen","loaded","sub","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","found","def","userAgent","menuitem","checked","commit","button","textEl","labelText","contentsEl","labelHTML","updateLabel","checkState","indeterminate","updateChecked","role","updateWhenVisible","anchors","intersectionObserver","updateVisibleAnchors","anchor","documentElement","AnchoredPositionElement","_AnchoredPositionElement_anchorElement","_AnchoredPositionElement_animationFrame","alias","idRef","cancelAnimationFrame","toggle","bottom","right","dialogInvokerButtonHandler","dialogId","dialog","HTMLDialogElement","showModal","fixed","popover","stopImmediatePropagation","open","DialogHelperElement","_DialogHelperElement_abortController","innerWidth","records","record","_DialogHelperElement_instances","_DialogHelperElement_handleDialogOpenAttribute","rect","clientY","clientX","ToggleEvent","oldState","newState","init","popoverToggleTaskQueue","queuePopoverToggleEventTask","topLayerElements","autoPopoverList","visibilityState","getPopoverVisibilityState","popoverInvoker","checkPopoverValidity","expectedToBeShowing","fullscreenElement","getStackPosition","topMostClickedPopover","clickedPopover","nearestInclusiveOpenPopover","invokerPopover","nodePopover","popoverTargetElement","Document","nearestInclusiveTargetPopoverForInvoker","topMostAutoPopover","document2","documentPopovers","assignedSlot","focusTarget","HTMLButtonElement","HTMLOptGroupElement","HTMLOptionElement","HTMLFieldSetElement","popoverFocusingSteps","subject","delegatesFocus","whereToLook","autoFocusDelegate","slots","slot","assignedElements","flatten","descendant","currentNode","focusDelegate","previouslyFocusedElements","shouldRestoreFocus","originalType","hideAllPopoversUntil","newPopover","popoverPositions","topMostPopoverAncestor2","candidate","candidateAncestor","candidatePosition","checkAncestor","topMostPopoverAncestor","originallyFocusedElement","setInvokerAriaExpanded","hidePopover","focusPreviousElement","fireEvents","previouslyFocusedElement","closeAllOpenPopovers","endpoint","lastToHide","foundEndpoint","size","popoverPointerDownTargets","lightDismissOpenPopovers","isTrusted","composedPath","ancestor","sameTarget","initialAriaExpandedValue","force","initialValue","ShadowRoot2","patchSelectorFn","object","mapper","original","selector","nonEscapedPopoverSelector","getStyles","useLayer","CSSLayerBlockRule","popoverStyleSheet","injectStyles","styles","CSSStyleSheet","replaceSync","sheet","head","adoptedStyleSheets","rewriteSelector","DocumentFragment","defineProperties","enumerable","togglePopover","originalAttachShadow","writable","originalAttachInternals","attachInternals","internals","popoverTargetAssociatedElements","applyPopoverInvokerElementMixin","ElementClass","localName","form","idref","popoverTargetAction","handleInvokerActivation","invoker","popoverTargetAttributeActivationBehavior","onKeydown","addEventListeners","apply","menuItemSelector","join","getMnemonicFor","printable","FocusGroupElement","_FocusGroupElement_retainSignal","_FocusGroupElement_abortController","nowrap","retain","mnemonics","_FocusGroupElement_instances","_FocusGroupElement_items_get","toggleEvent","mnemonic","offset","focusEl","at","min","ScrollableRegionElement","hasOverflow","labelledBy","scrollHeight","clientHeight","focusIfNeeded","overlayStack","clickHandler","ModalDialogElement","openButton","show","dialogIndex","ele","keydownHandler","mousedownHandler","topLevelDialog","upEvent","_ModalDialogElement_focusAbortController","paddingRight","aborted","showButtons","closedNotCancelled","dialogEvent","NavListElement","_NavListElement_truncationObserver","topLevelList","selectItemById","itemId","selectedItem","_NavListElement_instances","_NavListElement_findSelectedNavItemById","_NavListElement_select","selectItemByHref","_NavListElement_findSelectedNavItemByHref","selectItemByCurrentLocation","expandItem","nextElementSibling","collapseItem","itemIsExpanded","handleItemWithSubItemClick","handleItemWithSubItemKeydown","button_id","navItem","selectedNavItem","pathname","currentlySelectedItem","_NavListElement_deselect","children","parentMenu","_NavListElement_findParentMenu","NavListGroupElement","_NavListGroupElement_truncateObserver","setShowMoreItemState","showMoreDisabled","showMoreItem","currentPage","totalPages","paginationSrc","paginationURL","origin","searchParams","err","_NavListGroupElement_instances","_NavListGroupElement_parseHTML","listId","focusMarkers","SegmentedControlElement","_SegmentedControlElement_instances","_SegmentedControlElement_updateButtonLabels","select","ToggleSwitchElement","turbo","toggling","csrf","csrfElement","csrfField","isRemote","isDisabled","performToggle","setLoadingState","submitForm","setErrorState","message","setSuccessState","turnOn","switch","turnOff","isOn","isOff","disable","enable","errorIcon","loadingSpinner","setFinishedState","FormData","requestHeaders","contentType","Turbo","renderStreamMessage","isPopoverOpen","setSelector","TOOLTIP_SR_ONLY_CLASS","DIRECTION_CLASSES","closeOpenTooltips","except","openTooltips","focusOutListener","focusInListener","showReason","control","tooltips","ToolTipElement","_ToolTipElement_abortController","_ToolTipElement_align","_ToolTipElement_side","_ToolTipElement_allowUpdatePosition","_ToolTipElement_showReason","htmlFor","hiddenFromView","_ToolTipElement_instances","_ToolTipElement_updateControlReference","_ToolTipElement_updateDirection","shadow","appendChild","_ToolTipElement_update","showing","shouldShow","webdriver","isMouseLeaveFromButton","isEscapeKeydown","isMouseDownOnButton","isOpeningOtherPopover","shouldHide","isOpen","_ToolTipElement_updatePosition","describedBy","XBannerElement","dismiss","_XBannerElement_instances","_XBannerElement_dismissScheme_get","removeChild","hide","Combobox","list","tabInsertsSuggestions","defaultFirstOption","random","keyboardEventHandler","combobox","clearSelection","navigate","keyboardBindings","compositionEventHandler","inputHandler","destroy","stop","commitWithElement","indicateDefaultOption","visible","indexDiff","els","focusIndex","indexOfItem","newIndex","scrollTo","fireCommitEvent","scrollTop","containerBottom","offsetTop","inViewport","SCREEN_READER_DELAY","testScreenReaderDelay","Autocomplete","results","autoselectEnabled","feedback","clearButton","clientOptions","labelElem","interactingWithList","onInputChange","wait","Rest","onResultsMouseDown","onInputBlur","onInputFocus","onCommit","handleClear","updateFeedbackForScreenReaders","identifyOptions","inputString","fetchOnEmpty","fetchResult","then","allNewOptions","hasResults","numOptions","firstOption","firstOptionValue","catch","_AutoCompleteElement_instances","_AutoCompleteElement_forElement","_AutoCompleteElement_inputElement","_AutoCompleteElement_reattachState","_AutoCompleteElement_requestController","__rest","p","getOwnPropertySymbols","propertyIsEnumerable","AutoCompleteEvent","AutoCompleteElement","forElement","inputElement","autocomplete","res","AutocompleteElement","copyNode","clipboard","writeText","selection","getSelection","removeAllRanges","range","createRange","selectNodeContents","addRange","execCommand","copyText","createNode","copy","trigger","clicked","focused","blurred","ClipboardCopyElement","showSVG","svg","hideSVG","clipboardCopyElementTimers","currentTimeout","clipboardCopyLiveRegion","copiedAnnouncement","copyIcon","checkIcon","showCheck","showCopy","_DurationFormat_options","ListFormat","Intl","formatToParts","members","parts","partsTable","twoDigitFormatOptions","minimumIntegerDigits","DurationFormat","locale","prevStyle","hours","minutes","seconds","milliseconds","years","yearsDisplay","months","monthsDisplay","weeks","weeksDisplay","days","daysDisplay","hoursDisplay","minutesDisplay","secondsDisplay","millisecondsDisplay","resolvedOptions","duration","unit","nfUnit","unitStyle","nfOpts","unitDisplay","NumberFormat","format","durationRe","unitNames","Duration","sign","blank","abs","durationLike","factor","parsed","RangeError","one","two","now","Date","oneApplied","applyDuration","getTime","twoApplied","toLocaleString","opts","date","setFullYear","getFullYear","setMonth","getMonth","setDate","getDate","setHours","getHours","setMinutes","getMinutes","setSeconds","getSeconds","roundToSingleUnit","relativeTo","round","currentYear","currentMonth","currentDate","newMonthDate","monthDateCorrection","newDate","yearDiff","monthDiff","daysDiff","monthsDiff","_RelativeTimeElement_instances","_RelativeTimeElement_customTitle","_RelativeTimeElement_updating","_RelativeTimeElement_lang_get","_RelativeTimeElement_renderRoot","_RelativeTimeElement_getFormattedTitle","_RelativeTimeElement_resolveFormat","_RelativeTimeElement_getDurationFormat","_RelativeTimeElement_getRelativeFormat","_RelativeTimeElement_getDateTimeFormat","_RelativeTimeElement_onRelativeTimeUpdated","emptyDuration","microEmptyDuration","RelativeTimeUpdatedEvent","oldText","newText","oldTitle","newTitle","composed","getUnitFactor","precision","ms","dateObserver","time","timer","nearestDistance","timeEl","RelativeTimeElement","onRelativeTimeUpdated","listener","minute","hour","weekday","formatStyle","day","month","year","getUTCFullYear","timeZoneName","tense","noTitle","datetime","parse","isNaN","toISOString","attrName","DateTimeFormat","delta","sec","hr","elapsedTime","RelativeTimeFormat","compare","empty","relativeFormat","numeric","int","rounded","getRelativeTimeUnit","formatter","getTabs","tab","TabContainerElement","tabs","currentIndex","incrementKeys","decrementKeys","some","code","selectTab","panels","panel","selectedTab","selectedPanel","PrimerMultiInputElement","activateField","fieldWithName","findField","field","fields","middle","last","cancelled","fn","cancel","throttle","_AutoCheckElement_onloadend","AllowedHttpMethods","AutoCheckEvent","phase","AutoCheckValidationEvent","setValidity","AutoCheckCompleteEvent","AutoCheckSuccessEvent","AutoCheckStartEvent","AutoCheckErrorEvent","AutoCheckSendEvent","AutoCheckElement","onloadend","checker","check","spellcheck","setCustomValidity","required","httpMethod","autoCheckElement","startEvent","clone","PrimerTextFieldElement","_PrimerTextFieldElement_abortController","setSuccess","clearError","errorMessage","setError","clearContents","validationElement","validationMessageElement","replaceChildren","setValidationMessage","toggleValidationStyling","isError","validationSuccessIcon","validationErrorIcon","showLeadingSpinner","leadingSpinner","leadingVisual","hideLeadingSpinner","ToggleSwitchInputElement","validSelectors","menuItemSelectors","ActionMenuElement","_ActionMenuElement_abortController","_ActionMenuElement_originalLabel","_ActionMenuElement_inputName","_ActionMenuElement_invokerBeingClicked","selectVariant","variant","dynamicLabelPrefix","dynamicLabel","popoverElement","invokerLabel","selectedItems","labelEl","_ActionMenuElement_instances","_ActionMenuElement_setDynamicLabel","_ActionMenuElement_updateInput","_ActionMenuElement_softDisableItems","includeFragment","targetIsInvoker","eventIsActivation","_ActionMenuElement_isActivation","_ActionMenuElement_firstItem_get","_ActionMenuElement_handleInvokerActivated","_ActionMenuElement_handleFocusOut","_ActionMenuElement_potentiallyDisallowActivation","dialogInvoker","_ActionMenuElement_isAnchorActivationViaSpace","_ActionMenuElement_handleItemActivated","_ActionMenuElement_handleIncludeFragmentReplaced","getItemById","isItemDisabled","disableItem","enableItem","isItemHidden","hideItem","showItem","isItemChecked","checkItem","itemContent","uncheckItem","MouseEvent","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","focusInDialog","newActiveElement","checkedItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput","Ordering","_compareFn","_heap","_MinHeap_instances","heapifyDown_fn","heapifyUp_fn","__typeError$2","msg","__accessCheck$2","obj","member","__privateGet$2","getter","__privateAdd$2","__privateSet$2","setter","__privateMethod$1","MinHeap","compareFn","insert","peek","swap","clear","getLeftChildIndex","getRightChildIndex","getParentIndex","hasLeftChild","hasRightChild","hasParent","leftChild","heap","rightChild","b","tmp","smallerChildIndex","_promise","_resolve","_reject","__defProp","__typeError$1","__publicField","__defNormalProp","__accessCheck$1","__privateGet$1","__privateAdd$1","__privateSet$1","toStringTag","Deferred","onfulfilled","onrejected","finally","onfinally","reason","getPromise","_pending","_queue","_timeoutId","_LiveRegionElement_instances","performWork_fn","updateContainerWithMessage_fn","__typeError","__accessCheck","__privateGet","__privateAdd","__privateSet","__privateMethod","LiveRegionElement","template2","templateContent","getTemplate","compareMessages","delay","announce","delayMs","politeness","deferred","contents","scheduled","announceFromElement","innerText","getTextContent","getMessage","visibleMenuItemSelectors","FetchStrategy","ErrorStateType","updateAnchorPosition","SelectPanelElement","_SelectPanelElement_dialogIntersectionObserver","_SelectPanelElement_abortController","_SelectPanelElement_originalLabel","_SelectPanelElement_inputName","_SelectPanelElement_selectedItems","_SelectPanelElement_loadingDelayTimeoutId","_SelectPanelElement_loadingAnnouncementTimeoutId","_SelectPanelElement_hasLoadedData","ariaSelectionType","dynamicAriaLabelPrefix","closeButton","values","_SelectPanelElement_instances","_SelectPanelElement_setDynamicLabel","_SelectPanelElement_updateInput","_SelectPanelElement_softDisableItems","_SelectPanelElement_waitForCondition","Boolean","filterInputTextField","_SelectPanelElement_fetchStrategy_get","LOCAL","_SelectPanelElement_updateItemVisibility","_SelectPanelElement_handleSearchFieldEvent","_SelectPanelElement_handleRemoteInputEvent","targetIsCloseButton","_SelectPanelElement_isActivation","_SelectPanelElement_handleInvokerActivated","fireSearchEvent","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","_SelectPanelElement_filterInputTextFieldElement_get","liveRegion","_SelectPanelElement_toggleIncludeFragmentElements","errorElement","fragmentErrorElement","showError","_SelectPanelElement_clearErrorState","_SelectPanelElement_checkSelectedItems","bodySpinner","BODY","BANNER","_SelectPanelElement_performFilteringLocally","_SelectPanelElement_setTextFieldLoadingSpinnerTimer","_SelectPanelElement_defaultFilterFn","EVENTUALLY_LOCAL","atLeastOneResult","filterFn","_SelectPanelElement_showItem","_SelectPanelElement_hideItem","_SelectPanelElement_updateTabIndices","_SelectPanelElement_maybeAnnounce","_SelectPanelElement_addSelectedItem","noResults","_SelectPanelElement_inErrorState","bannerErrorElement","instructions","noResultsEl","REMOTE","_SelectPanelElement_handleDialogItemActivated","currentlyChecked","_SelectPanelElement_removeSelectedItem"],"mappings":"yBAAA,IAWIA,EAAmCC,EAA8BC,EAAkCC,EAAoCC,EAAiCC,EAA8CC,EAA8BC,EAXpPC,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,GACnG,GAAa,MAATD,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,4EACvG,MAAgB,MAATF,EAAeC,EAAa,MAATD,EAAeC,EAAEG,KAAKN,GAAYG,EAAIA,EAAEI,MAAQN,EAAMO,IAAIR,EACxF,EACIS,EAAkE,SAAUT,EAAUC,EAAOM,EAAOL,EAAMC,GAC1G,GAAa,MAATD,EAAc,MAAM,IAAIE,UAAU,kCACtC,GAAa,MAATF,IAAiBC,EAAG,MAAM,I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