openproject-primer_view_components 0.42.0 → 0.43.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/app/assets/javascripts/app/components/primer/shared_events.d.ts +2 -0
  4. data/app/assets/javascripts/primer_view_components.js +1 -1
  5. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  6. data/app/assets/styles/primer_view_components.css +1 -1
  7. data/app/assets/styles/primer_view_components.css.map +1 -1
  8. data/app/components/primer/alpha/action_list.css +1 -1
  9. data/app/components/primer/alpha/action_list.css.json +33 -50
  10. data/app/components/primer/alpha/action_list.css.map +1 -1
  11. data/app/components/primer/alpha/action_menu/action_menu_element.js +20 -7
  12. data/app/components/primer/alpha/action_menu/action_menu_element.ts +20 -7
  13. data/app/components/primer/alpha/auto_complete.css +1 -1
  14. data/app/components/primer/alpha/auto_complete.css.json +3 -5
  15. data/app/components/primer/alpha/auto_complete.css.map +1 -1
  16. data/app/components/primer/alpha/banner.css +1 -1
  17. data/app/components/primer/alpha/banner.css.json +5 -5
  18. data/app/components/primer/alpha/banner.css.map +1 -1
  19. data/app/components/primer/alpha/button_marketing.css +1 -1
  20. data/app/components/primer/alpha/button_marketing.css.json +1 -4
  21. data/app/components/primer/alpha/button_marketing.css.map +1 -1
  22. data/app/components/primer/alpha/dialog.css +1 -1
  23. data/app/components/primer/alpha/dialog.css.json +7 -7
  24. data/app/components/primer/alpha/dialog.css.map +1 -1
  25. data/app/components/primer/alpha/layout.css +1 -1
  26. data/app/components/primer/alpha/layout.css.json +9 -15
  27. data/app/components/primer/alpha/layout.css.map +1 -1
  28. data/app/components/primer/alpha/menu.css +1 -1
  29. data/app/components/primer/alpha/menu.css.json +1 -3
  30. data/app/components/primer/alpha/menu.css.map +1 -1
  31. data/app/components/primer/alpha/segmented_control.css +1 -1
  32. data/app/components/primer/alpha/segmented_control.css.json +5 -5
  33. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  34. data/app/components/primer/alpha/select_panel.rb +3 -3
  35. data/app/components/primer/alpha/select_panel_element.js +25 -15
  36. data/app/components/primer/alpha/select_panel_element.ts +26 -16
  37. data/app/components/primer/alpha/tab_nav.css +1 -1
  38. data/app/components/primer/alpha/tab_nav.css.json +1 -3
  39. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  40. data/app/components/primer/alpha/text_field.css +1 -1
  41. data/app/components/primer/alpha/text_field.css.json +37 -78
  42. data/app/components/primer/alpha/text_field.css.map +1 -1
  43. data/app/components/primer/alpha/toggle_switch.css +1 -1
  44. data/app/components/primer/alpha/toggle_switch.css.json +1 -1
  45. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  46. data/app/components/primer/alpha/toggle_switch.rb +2 -1
  47. data/app/components/primer/alpha/underline_nav.css +1 -1
  48. data/app/components/primer/alpha/underline_nav.css.json +2 -4
  49. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  50. data/app/components/primer/beta/avatar_stack.css +1 -1
  51. data/app/components/primer/beta/avatar_stack.css.json +8 -8
  52. data/app/components/primer/beta/avatar_stack.css.map +1 -1
  53. data/app/components/primer/beta/border_box.css +1 -1
  54. data/app/components/primer/beta/border_box.css.json +4 -4
  55. data/app/components/primer/beta/border_box.css.map +1 -1
  56. data/app/components/primer/beta/breadcrumbs.css +1 -1
  57. data/app/components/primer/beta/breadcrumbs.css.json +1 -2
  58. data/app/components/primer/beta/breadcrumbs.css.map +1 -1
  59. data/app/components/primer/beta/button.css +1 -1
  60. data/app/components/primer/beta/button.css.json +6 -8
  61. data/app/components/primer/beta/button.css.map +1 -1
  62. data/app/components/primer/beta/button_group.css +1 -1
  63. data/app/components/primer/beta/button_group.css.json +3 -3
  64. data/app/components/primer/beta/button_group.css.map +1 -1
  65. data/app/components/primer/beta/label.css +1 -1
  66. data/app/components/primer/beta/label.css.json +1 -2
  67. data/app/components/primer/beta/label.css.map +1 -1
  68. data/app/components/primer/beta/link.css +1 -1
  69. data/app/components/primer/beta/link.css.json +1 -3
  70. data/app/components/primer/beta/link.css.map +1 -1
  71. data/app/components/primer/beta/popover.css +1 -1
  72. data/app/components/primer/beta/popover.css.json +16 -22
  73. data/app/components/primer/beta/popover.css.map +1 -1
  74. data/app/components/primer/beta/spinner.html.erb +1 -1
  75. data/app/components/primer/beta/truncate.css +1 -1
  76. data/app/components/primer/beta/truncate.css.json +5 -5
  77. data/app/components/primer/beta/truncate.css.map +1 -1
  78. data/app/components/primer/open_project/side_panel/section.css +1 -1
  79. data/app/components/primer/open_project/side_panel/section.css.json +1 -2
  80. data/app/components/primer/open_project/side_panel/section.css.map +1 -1
  81. data/app/components/primer/shared_events.d.ts +2 -0
  82. data/app/components/primer/shared_events.ts +2 -0
  83. data/lib/primer/forms/primer_text_field.js +3 -0
  84. data/lib/primer/forms/primer_text_field.ts +4 -0
  85. data/lib/primer/view_components/version.rb +1 -1
  86. data/previews/primer/alpha/select_panel_preview/no_values.html.erb +19 -0
  87. data/previews/primer/alpha/select_panel_preview/playground.html.erb +1 -1
  88. data/previews/primer/alpha/select_panel_preview/remote_fetch.html.erb +4 -1
  89. data/previews/primer/alpha/select_panel_preview/single_select.html.erb +4 -4
  90. data/previews/primer/alpha/select_panel_preview.rb +14 -9
  91. data/static/arguments.json +1 -1
  92. data/static/classes.json +39 -21
  93. data/static/info_arch.json +15 -2
  94. data/static/previews.json +13 -0
  95. metadata +3 -2
@@ -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","../../../node_modules/@github/image-crop-element/dist/index.js","../../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","../../components/primer/open_project/page_header_element.ts","../../components/primer/open_project/zen_mode_button.ts","../../components/primer/open_project/sub_header_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 */\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;\r\n return g = { next: verb(0), \"throw\": verb(1), \"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 = {}, 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 function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\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 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 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 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\n// eslint-disable-next-line no-unused-vars\nenum ItemType {\n // eslint-disable-next-line no-unused-vars\n Item,\n // eslint-disable-next-line no-unused-vars\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 // eslint-disable-next-line no-unused-vars\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 this.ownerDocument.body.classList.toggle('has-modal', this.dialog.matches(':modal'))\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))\n 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\")\n 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)\n 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)\n return false;\n return true;\n}\nfunction getStackPosition(popover) {\n if (!popover)\n 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)\n 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.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot)\n node = node.host;\n if (node instanceof Document)\n return;\n }\n}\nfunction nearestInclusiveTargetPopoverForInvoker(node) {\n while (node) {\n const nodePopover = node.popoverTargetElement;\n if (nodePopover instanceof HTMLElement)\n return nodePopover;\n node = node.parentElement || getRootNode(node);\n if (node instanceof ShadowRoot)\n node = node.host;\n if (node instanceof Document)\n 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)\n 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)\n 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)\n 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)\n return;\n const target = event.composedPath()[0];\n if (!target)\n return;\n const document2 = target.ownerDocument;\n const topMostPopover = topMostAutoPopover(document2);\n if (!topMostPopover)\n 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)\n 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\")\n 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 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\"))\n return null;\n const value = (this.getAttribute(\"popover\") || \"\").toLowerCase();\n if (value === \"\" || value == \"auto\")\n 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\")\n 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())\n 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","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: ' ';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class=\"crop-wrapper\">\n <img width=\"100%\" class=\"crop-image\" alt=\"\">\n <div class=\"crop-container\">\n <div data-crop-box class=\"crop-box\">\n <div class=\"crop-outline\"></div>\n <div data-direction=\"nw\" class=\"handle nw\"></div>\n <div data-direction=\"ne\" class=\"handle ne\"></div>\n <div data-direction=\"sw\" class=\"handle sw\"></div>\n <div data-direction=\"se\" class=\"handle se\"></div>\n </div>\n </div>\n</div>\n`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\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\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n if (this.#dismissScheme === 'remove') {\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\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 })(), \"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 __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\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@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 }\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) && 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 ;(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 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.#isOpen()) {\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: 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 '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.dialog.close()\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 if (!this.isItemHidden(item) && !setZeroTabIndex) {\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 }\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.#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\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.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.#hasLoadedData = true\n this.#addSelectedItem(item)\n }\n }\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 return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY) {\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 {\n return this.filterInputTextField.closest('primer-text-field') as PrimerTextFieldElement\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 checked = !this.isItemChecked(item)\n\n const activationSuccess = this.dispatchEvent(\n new CustomEvent('beforeItemActivated', {\n bubbles: true,\n detail: {item, checked},\n cancelable: true,\n }),\n )\n\n if (!activationSuccess) return\n\n const itemContent = this.#getItemContent(item)\n\n if (this.selectVariant === 'single') {\n const value = this.selectedItems[0]?.value\n const element = this.visibleItems.find(el => this.#getItemContent(el)?.getAttribute('data-value') === value)\n\n if (element) {\n this.#getItemContent(element)?.setAttribute(this.ariaSelectionType, 'false')\n }\n\n this.#selectedItems.clear()\n\n // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.\n if (checked) {\n this.#addSelectedItem(item)\n itemContent?.setAttribute(this.ariaSelectionType, 'true')\n }\n\n this.#setDynamicLabel()\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: {item, checked},\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","import {controller} from '@github/catalyst'\n\n@controller\nclass PageHeaderElement extends HTMLElement {\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\ndeclare global {\n interface Window {\n PageHeaderElement: typeof PageHeaderElement\n }\n}\n\nif (!window.customElements.get('page-header')) {\n window.PageHeaderElement = PageHeaderElement\n window.customElements.define('page-header', PageHeaderElement)\n}\n","import {controller, target} from '@github/catalyst'\n\n@controller\nclass ZenModeButtonElement extends HTMLElement {\n @target button: HTMLElement\n inZenMode = false\n\n private deactivateZenMode() {\n this.inZenMode = false\n this.button.setAttribute('aria-pressed', 'false')\n if (document.exitFullscreen) {\n void document.exitFullscreen()\n }\n }\n\n private activateZenMode() {\n this.inZenMode = true\n this.button.setAttribute('aria-pressed', 'true')\n if (document.documentElement.requestFullscreen) {\n void document.documentElement.requestFullscreen()\n }\n }\n\n public performAction() {\n if (this.inZenMode) {\n this.deactivateZenMode()\n } else {\n this.activateZenMode()\n }\n }\n}\n\ndeclare global {\n interface Window {\n ZenModeButtonElement: typeof ZenModeButtonElement\n }\n}\n\nif (!window.customElements.get('zen-mode-button')) {\n window.ZenModeButtonElement = ZenModeButtonElement\n window.customElements.define('zen-mode-button', ZenModeButtonElement)\n}\n","import {controller, target, targets} from '@github/catalyst'\n\n@controller\nclass SubHeaderElement extends HTMLElement {\n @target filterInput: HTMLElement\n @targets hiddenItemsOnExpandedFilter: HTMLElement[]\n @targets shownItemsOnExpandedFilter: HTMLElement[]\n\n expandFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n this.classList.add('d-flex')\n\n this.filterInput.focus()\n }\n\n collapseFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n this.classList.remove('d-flex')\n }\n}\n\ndeclare global {\n interface Window {\n SubHeaderElement: typeof SubHeaderElement\n }\n}\n\nif (!window.customElements.get('sub-header')) {\n window.SubHeaderElement = SubHeaderElement\n window.customElements.define('sub-header', SubHeaderElement)\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","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","firstFocusableChild","prepend","wrappingController","followSignal","suspendedTrap","sentinels","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","from","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","filter","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","Array","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","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","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","MouseEvent","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","offsetLeft","y","offsetTop","fireChangeEvent","updateCropArea","getShadowHost","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","startUpdate","reposition","newSide","abs","round","stopUpdate","result","ratio","naturalWidth","slottedInput","HTMLImageElement","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","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","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","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","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","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","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","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","ariaLiveContainer","_SelectPanelElement_filterInputTextFieldElement_get","_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","clear","_SelectPanelElement_removeSelectedItem","PageHeaderElement","ZenModeButtonElement","inZenMode","deactivateZenMode","exitFullscreen","activateZenMode","requestFullscreen","performAction","SubHeaderElement","expandFilterInput","hiddenItemsOnExpandedFilter","shownItemsOnExpandedFilter","filterInput","collapseFilterInput"],"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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IAAI,UAEnBC,KAAK25C,YAAYvgC,OAClB,CAEDwgC,sBACE,IAAK,MAAM7pC,KAAQ/P,KAAKy5C,4BACtB1pC,EAAK5L,UAAU6V,OAAO,UAGxB,IAAK,MAAMjK,KAAQ/P,KAAK05C,2BACtB3pC,EAAK5L,UAAUpE,IAAI,UAGrBC,KAAKmE,UAAU6V,OAAO,SACvB,GA5BOtR,EAAA,CAAPrI,GAA+Bk5C,GAAAxrC,UAAA,mBAAA,GACvBrF,EAAA,CAARwG,GAAkDqqC,GAAAxrC,UAAA,mCAAA,GAC1CrF,EAAA,CAARwG,GAAiDqqC,GAAAxrC,UAAA,kCAAA,GAH9CwrC,GAAgB7wC,EAAA,CADrBrC,GACKkzC,IAsCD9zC,OAAO5E,eAAezB,IAAI,gBAC7BqG,OAAO8zC,iBAAmBA,GAC1B9zC,OAAO5E,eAAeC,OAAO,aAAcy4C"}
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","../../../node_modules/@github/image-crop-element/dist/index.js","../../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","../../components/primer/open_project/page_header_element.ts","../../components/primer/open_project/zen_mode_button.ts","../../components/primer/open_project/sub_header_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 */\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;\r\n return g = { next: verb(0), \"throw\": verb(1), \"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 = {}, 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 function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\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 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 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 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\n// eslint-disable-next-line no-unused-vars\nenum ItemType {\n // eslint-disable-next-line no-unused-vars\n Item,\n // eslint-disable-next-line no-unused-vars\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 // eslint-disable-next-line no-unused-vars\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 this.ownerDocument.body.classList.toggle('has-modal', this.dialog.matches(':modal'))\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","const startPositions = new WeakMap();\nconst dragStartPositions = new WeakMap();\nconst constructedElements = new WeakMap();\nfunction moveCropArea(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n const { box, image } = constructedElements.get(el) || {};\n if (!box || !image)\n return;\n let deltaX = 0;\n let deltaY = 0;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'ArrowUp') {\n deltaY = -1;\n }\n else if (event.key === 'ArrowDown') {\n deltaY = 1;\n }\n else if (event.key === 'ArrowLeft') {\n deltaX = -1;\n }\n else if (event.key === 'ArrowRight') {\n deltaX = 1;\n }\n }\n else if (dragStartPositions.has(el) && event instanceof MouseEvent) {\n const pos = dragStartPositions.get(el);\n deltaX = event.pageX - pos.dragStartX;\n deltaY = event.pageY - pos.dragStartY;\n }\n else if (dragStartPositions.has(el) && event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n const { dragStartX, dragStartY } = dragStartPositions.get(el);\n deltaX = pageX - dragStartX;\n deltaY = pageY - dragStartY;\n }\n if (deltaX !== 0 || deltaY !== 0) {\n const x = Math.min(Math.max(0, box.offsetLeft + deltaX), image.width - box.offsetWidth);\n const y = Math.min(Math.max(0, box.offsetTop + deltaY), image.height - box.offsetHeight);\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n fireChangeEvent(el, { x, y, width: box.offsetWidth, height: box.offsetHeight });\n }\n if (event instanceof MouseEvent) {\n dragStartPositions.set(el, {\n dragStartX: event.pageX,\n dragStartY: event.pageY\n });\n }\n else if (event instanceof TouchEvent) {\n const { pageX, pageY } = event.changedTouches[0];\n dragStartPositions.set(el, {\n dragStartX: pageX,\n dragStartY: pageY\n });\n }\n}\nfunction updateCropArea(event) {\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n const el = getShadowHost(target);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const rect = el.getBoundingClientRect();\n let deltaX, deltaY, delta;\n if (event instanceof KeyboardEvent) {\n if (event.key === 'Escape')\n return setInitialPosition(el);\n if (event.key === '-')\n delta = -10;\n if (event.key === '=')\n delta = +10;\n if (!delta)\n return;\n deltaX = box.offsetWidth + delta;\n deltaY = box.offsetHeight + delta;\n startPositions.set(el, { startX: box.offsetLeft, startY: box.offsetTop });\n }\n else if (event instanceof MouseEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.pageY - pos.startY - rect.top - window.pageYOffset;\n }\n else if (event instanceof TouchEvent) {\n const pos = startPositions.get(el);\n if (!pos)\n return;\n deltaX = event.changedTouches[0].pageX - pos.startX - rect.left - window.pageXOffset;\n deltaY = event.changedTouches[0].pageY - pos.startY - rect.top - window.pageYOffset;\n }\n if (deltaX && deltaY)\n updateDimensions(el, deltaX, deltaY, !(event instanceof KeyboardEvent));\n}\nfunction getShadowHost(el) {\n const rootNode = el.getRootNode();\n if (!(rootNode instanceof ShadowRoot))\n return el;\n return rootNode.host;\n}\nfunction startUpdate(event) {\n const currentTarget = event.currentTarget;\n if (!(currentTarget instanceof HTMLElement))\n return;\n const el = getShadowHost(currentTarget);\n if (!(el instanceof ImageCropElement))\n return;\n const { box } = constructedElements.get(el) || {};\n if (!box)\n return;\n const target = event.target;\n if (!(target instanceof HTMLElement))\n return;\n if (target.hasAttribute('data-direction')) {\n const direction = target.getAttribute('data-direction') || '';\n el.addEventListener('mousemove', updateCropArea);\n el.addEventListener('touchmove', updateCropArea, { passive: true });\n if (['nw', 'se'].indexOf(direction) >= 0)\n el.classList.add('nwse');\n if (['ne', 'sw'].indexOf(direction) >= 0)\n el.classList.add('nesw');\n startPositions.set(el, {\n startX: box.offsetLeft + (['se', 'ne'].indexOf(direction) >= 0 ? 0 : box.offsetWidth),\n startY: box.offsetTop + (['se', 'sw'].indexOf(direction) >= 0 ? 0 : box.offsetHeight)\n });\n updateCropArea(event);\n }\n else {\n el.addEventListener('mousemove', moveCropArea);\n el.addEventListener('touchmove', moveCropArea, { passive: true });\n }\n}\nfunction updateDimensions(target, deltaX, deltaY, reposition = true) {\n let newSide = Math.max(Math.abs(deltaX), Math.abs(deltaY), 10);\n const pos = startPositions.get(target);\n if (!pos)\n return;\n const { box, image } = constructedElements.get(target) || {};\n if (!box || !image)\n return;\n newSide = Math.min(newSide, deltaY > 0 ? image.height - pos.startY : pos.startY, deltaX > 0 ? image.width - pos.startX : pos.startX);\n const x = reposition ? Math.round(Math.max(0, deltaX > 0 ? pos.startX : pos.startX - newSide)) : box.offsetLeft;\n const y = reposition ? Math.round(Math.max(0, deltaY > 0 ? pos.startY : pos.startY - newSide)) : box.offsetTop;\n box.style.left = `${x}px`;\n box.style.top = `${y}px`;\n box.style.width = `${newSide}px`;\n box.style.height = `${newSide}px`;\n fireChangeEvent(target, { x, y, width: newSide, height: newSide });\n}\nfunction setInitialPosition(el) {\n const { image } = constructedElements.get(el) || {};\n if (!image)\n return;\n const side = Math.round(image.clientWidth > image.clientHeight ? image.clientHeight : image.clientWidth);\n startPositions.set(el, {\n startX: (image.clientWidth - side) / 2,\n startY: (image.clientHeight - side) / 2\n });\n updateDimensions(el, side, side);\n}\nfunction stopUpdate(event) {\n const el = event.currentTarget;\n if (!(el instanceof ImageCropElement))\n return;\n dragStartPositions.delete(el);\n el.classList.remove('nwse', 'nesw');\n el.removeEventListener('mousemove', updateCropArea);\n el.removeEventListener('mousemove', moveCropArea);\n el.removeEventListener('touchmove', updateCropArea);\n el.removeEventListener('touchmove', moveCropArea);\n}\nfunction fireChangeEvent(target, result) {\n const { image } = constructedElements.get(target) || {};\n if (!image)\n return;\n const ratio = image.naturalWidth / image.width;\n for (const key in result) {\n const value = Math.round(result[key] * ratio);\n result[key] = value;\n const slottedInput = target.querySelector(`[data-image-crop-input='${key}']`);\n if (slottedInput instanceof HTMLInputElement)\n slottedInput.value = value.toString();\n }\n target.dispatchEvent(new CustomEvent('image-crop-change', { bubbles: true, detail: result }));\n}\nclass ImageCropElement extends HTMLElement {\n connectedCallback() {\n if (constructedElements.has(this))\n return;\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.innerHTML = `\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: ' ';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class=\"crop-wrapper\">\n <img width=\"100%\" class=\"crop-image\" alt=\"\">\n <div class=\"crop-container\">\n <div data-crop-box class=\"crop-box\">\n <div class=\"crop-outline\"></div>\n <div data-direction=\"nw\" class=\"handle nw\"></div>\n <div data-direction=\"ne\" class=\"handle ne\"></div>\n <div data-direction=\"sw\" class=\"handle sw\"></div>\n <div data-direction=\"se\" class=\"handle se\"></div>\n </div>\n </div>\n</div>\n`;\n const box = shadowRoot.querySelector('[data-crop-box]');\n if (!(box instanceof HTMLElement))\n return;\n const image = shadowRoot.querySelector('img');\n if (!(image instanceof HTMLImageElement))\n return;\n constructedElements.set(this, { box, image });\n image.addEventListener('load', () => {\n this.loaded = true;\n setInitialPosition(this);\n });\n this.addEventListener('mouseleave', stopUpdate);\n this.addEventListener('touchend', stopUpdate);\n this.addEventListener('mouseup', stopUpdate);\n box.addEventListener('mousedown', startUpdate);\n box.addEventListener('touchstart', startUpdate, { passive: true });\n this.addEventListener('keydown', moveCropArea);\n this.addEventListener('keydown', updateCropArea);\n if (this.src)\n image.src = this.src;\n }\n static get observedAttributes() {\n return ['src'];\n }\n get src() {\n return this.getAttribute('src');\n }\n set src(val) {\n if (val) {\n this.setAttribute('src', val);\n }\n else {\n this.removeAttribute('src');\n }\n }\n get loaded() {\n return this.hasAttribute('loaded');\n }\n set loaded(val) {\n if (val) {\n this.setAttribute('loaded', '');\n }\n else {\n this.removeAttribute('loaded');\n }\n }\n attributeChangedCallback(attribute, oldValue, newValue) {\n const { image } = constructedElements.get(this) || {};\n if (attribute === 'src') {\n this.loaded = false;\n if (image)\n image.src = newValue;\n }\n }\n}\nexport default ImageCropElement;\nif (!window.customElements.get('image-crop')) {\n window.ImageCropElement = ImageCropElement;\n window.customElements.define('image-crop', ImageCropElement);\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\n@controller\nclass XBannerElement extends HTMLElement {\n @target titleText: HTMLElement\n\n dismiss() {\n const parentElement = this.parentElement\n if (!parentElement) return\n\n if (this.#dismissScheme === 'remove') {\n parentElement.removeChild(this)\n } else {\n this.hide()\n }\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 })(), \"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 __classPrivateFieldSet(this, _RelativeTimeElement_updating, false, \"f\");\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\nconst SCREENREADER_TEXT_CLASSNAME = 'spinner-screenreader-text'\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 }\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.leadingSpinner?.querySelector(SCREENREADER_TEXT_CLASSNAME)?.removeAttribute('hidden')\n this.leadingVisual?.setAttribute('hidden', '')\n }\n\n hideLeadingSpinner(): void {\n this.leadingSpinner?.setAttribute('hidden', '')\n this.leadingSpinner?.querySelector(SCREENREADER_TEXT_CLASSNAME)?.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 '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.dialog.close()\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 if (!this.isItemHidden(item) && !setZeroTabIndex) {\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 }\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.#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\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 return !this.bannerErrorElement.hasAttribute('hidden')\n }\n\n #setErrorState(type: ErrorStateType) {\n let errorElement = this.fragmentErrorElement\n\n if (type === ErrorStateType.BODY) {\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 {\n return this.filterInputTextField.closest('primer-text-field') as PrimerTextFieldElement\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 // 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","import {controller} from '@github/catalyst'\n\n@controller\nclass PageHeaderElement extends HTMLElement {\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\ndeclare global {\n interface Window {\n PageHeaderElement: typeof PageHeaderElement\n }\n}\n\nif (!window.customElements.get('page-header')) {\n window.PageHeaderElement = PageHeaderElement\n window.customElements.define('page-header', PageHeaderElement)\n}\n","import {controller, target} from '@github/catalyst'\n\n@controller\nclass ZenModeButtonElement extends HTMLElement {\n @target button: HTMLElement\n inZenMode = false\n\n private deactivateZenMode() {\n this.inZenMode = false\n this.button.setAttribute('aria-pressed', 'false')\n if (document.exitFullscreen) {\n void document.exitFullscreen()\n }\n }\n\n private activateZenMode() {\n this.inZenMode = true\n this.button.setAttribute('aria-pressed', 'true')\n if (document.documentElement.requestFullscreen) {\n void document.documentElement.requestFullscreen()\n }\n }\n\n public performAction() {\n if (this.inZenMode) {\n this.deactivateZenMode()\n } else {\n this.activateZenMode()\n }\n }\n}\n\ndeclare global {\n interface Window {\n ZenModeButtonElement: typeof ZenModeButtonElement\n }\n}\n\nif (!window.customElements.get('zen-mode-button')) {\n window.ZenModeButtonElement = ZenModeButtonElement\n window.customElements.define('zen-mode-button', ZenModeButtonElement)\n}\n","import {controller, target, targets} from '@github/catalyst'\n\n@controller\nclass SubHeaderElement extends HTMLElement {\n @target filterInput: HTMLElement\n @targets hiddenItemsOnExpandedFilter: HTMLElement[]\n @targets shownItemsOnExpandedFilter: HTMLElement[]\n\n expandFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n this.classList.add('d-flex')\n\n this.filterInput.focus()\n }\n\n collapseFilterInput() {\n for (const item of this.hiddenItemsOnExpandedFilter) {\n item.classList.remove('d-none')\n }\n\n for (const item of this.shownItemsOnExpandedFilter) {\n item.classList.add('d-none')\n }\n\n this.classList.remove('d-flex')\n }\n}\n\ndeclare global {\n interface Window {\n SubHeaderElement: typeof SubHeaderElement\n }\n}\n\nif (!window.customElements.get('sub-header')) {\n window.SubHeaderElement = SubHeaderElement\n window.customElements.define('sub-header', SubHeaderElement)\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","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","firstFocusableChild","prepend","wrappingController","followSignal","suspendedTrap","sentinels","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","from","setActiveDescendant","clearActiveDescendant","id","previouslyActiveElement","beginFocusManagement","elements","filteredElements","filter","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","Array","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","startPositions","dragStartPositions","constructedElements","moveCropArea","ImageCropElement","box","image","deltaX","deltaY","MouseEvent","pageX","dragStartX","pageY","dragStartY","TouchEvent","changedTouches","offsetLeft","y","offsetTop","fireChangeEvent","updateCropArea","getShadowHost","delta","setInitialPosition","startX","startY","pageXOffset","pageYOffset","updateDimensions","rootNode","startUpdate","reposition","newSide","abs","round","stopUpdate","result","ratio","naturalWidth","slottedInput","HTMLImageElement","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","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","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","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","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","SCREENREADER_TEXT_CLASSNAME","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","_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","_SelectPanelElement_potentiallyDisallowActivation","_SelectPanelElement_isAnchorActivationViaSpace","_SelectPanelElement_getItemContent","_SelectPanelElement_handleItemActivated","_SelectPanelElement_handleIncludeFragmentEvent","visibleItems","focusableItem","condition","mutationObserver","setZeroTabIndex","_SelectPanelElement_firstItem_get","inputName","ariaLiveContainer","_SelectPanelElement_filterInputTextFieldElement_get","_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","PageHeaderElement","ZenModeButtonElement","inZenMode","deactivateZenMode","exitFullscreen","activateZenMode","requestFullscreen","performAction","SubHeaderElement","expandFilterInput","hiddenItemsOnExpandedFilter","shownItemsOnExpandedFilter","filterInput","collapseFilterInput"],"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,IAA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