primer_view_components 0.21.1 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +1 -1
- data/app/components/primer/alpha/action_list.js +15 -12
- data/app/components/primer/alpha/action_list.ts +12 -9
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.json +1 -0
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +4 -0
- data/app/components/primer/alpha/overlay/header.html.erb +1 -0
- data/app/components/primer/alpha/overlay/header.rb +12 -0
- data/app/components/primer/alpha/tool_tip.js +1 -1
- data/app/components/primer/alpha/tool_tip.ts +1 -1
- data/lib/primer/view_components/version.rb +2 -2
- data/previews/primer/alpha/action_list_preview.rb +19 -1
- data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +16 -0
- data/previews/primer/alpha/overlay_preview.rb +4 -0
- data/previews/primer/alpha/tab_nav_preview.rb +1 -1
- data/previews/primer/alpha/tab_panels_preview.rb +2 -2
- data/previews/primer/alpha/underline_nav_preview.rb +3 -3
- data/previews/primer/alpha/underline_panels_preview.rb +38 -0
- data/previews/primer/beta/avatar_stack_preview.rb +1 -1
- data/previews/primer/beta/breadcrumbs_preview.rb +2 -2
- data/previews/primer/beta/nav_list_preview.rb +9 -3
- data/static/classes.json +3 -0
- data/static/info_arch.json +52 -2
- data/static/previews.json +40 -1
- 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/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.js","../../../node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js","../../../node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js","../../../node_modules/@primer/behaviors/dist/esm/focus-trap.js","../../../node_modules/@primer/behaviors/dist/esm/utils/user-agent.js","../../../node_modules/@primer/behaviors/dist/esm/utils/unique-id.js","../../../node_modules/@primer/behaviors/dist/esm/focus-zone.js","../../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","../../../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"],"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","/******************************************************************************\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\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\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;\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 }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\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\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 label = el.querySelector('.ActionListItem-label')\n if (!label) return\n\n const tooltip = el.querySelector('.ActionListItem-truncationTooltip') as HTMLElement | null\n if (!tooltip) return\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@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};\nexport function 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","export 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}\nexport function getFocusableChild(container, lastChild = false) {\n return iterateFocusableElements(container, { reverse: lastChild, strict: true, onlyTabbable: true }).next().value;\n}\nexport function 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}\nexport function isTabbable(elem, strict = false) {\n return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';\n}\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}\nexport function polyfill() {\n if (!featureSupported()) {\n monkeyPatch();\n signalSupported = true;\n }\n}\n","import { getFocusableChild, isTabbable } from './utils/iterate-focusable-elements.js';\nimport { polyfill as eventListenerSignalPolyfill } from './polyfills/event-listener-signal.js';\neventListenerSignalPolyfill();\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}\nexport function 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","let isMac = undefined;\nexport function isMacOS() {\n if (isMac === undefined) {\n isMac = /^mac/i.test(window.navigator.platform);\n }\n return isMac;\n}\n","let idSeed = 10000;\nexport function uniqueId() {\n return `__primer_id_${idSeed++}`;\n}\n","import { polyfill as eventListenerSignalPolyfill } from './polyfills/event-listener-signal.js';\nimport { isMacOS } from './utils/user-agent.js';\nimport { iterateFocusableElements } from './utils/iterate-focusable-elements.js';\nimport { uniqueId } from './utils/unique-id.js';\neventListenerSignalPolyfill();\nexport var 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}\nexport const isActiveDescendantAttribute = 'data-is-active-descendant';\nexport const activeDescendantActivatedDirectly = 'activated-directly';\nexport const activeDescendantActivatedIndirectly = 'activated-indirectly';\nexport const hasActiveDescendantAttribute = 'data-has-active-descendant';\nexport function 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, iterateFocusableElementsOptions));\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 }\n });\n observer.observe(container, {\n subtree: true,\n childList: 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","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 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 const document2 = newPopover.ownerDocument;\n for (const popover of autoPopoverList.get(document2) || []) {\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);\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;\nvar hasLayerSupport = typeof window.CSSLayerBlockRule === \"function\";\nvar styles = `\n${hasLayerSupport ? \"@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(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\n :where([popover]:not(.\\\\:popover-open)) {\n display: none;\n }\n${hasLayerSupport ? \"}\" : \"\"}\n`;\nvar popoverStyleSheet = null;\nfunction injectStyles(root) {\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 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\"]']\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 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} from '@github/catalyst'\n\n@controller\nclass ToggleSwitchElement extends HTMLElement {\n @target switch: HTMLElement\n @target loadingSpinner: HTMLElement\n @target errorIcon: HTMLElement\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('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 try {\n response = await fetch(this.src, {\n credentials: 'same-origin',\n method: 'POST',\n headers: {\n 'Requested-With': 'XMLHttpRequest',\n },\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}\n\ndeclare global {\n interface Window {\n ToggleSwitchElement: typeof ToggleSwitchElement\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(--fgColor-onEmphasis, var(--color-fg-on-emphasis)) !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(--bgColor-emphasis, var(--color-neutral-emphasis-plus)) !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: 12px;\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\n if (currentTimeout) {\n clearTimeout(currentTimeout)\n clipboardCopyElementTimers.delete(target)\n } else {\n showCheck(target)\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 let currentMonth = relativeTo.getMonth();\n const currentDate = relativeTo.getDate();\n if (days >= 27 || years + months + days) {\n const newDate = new Date(relativeTo);\n newDate.setFullYear(currentYear + years * sign);\n newDate.setMonth(currentMonth + months * sign);\n newDate.setDate(currentDate + 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));\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 currentMonth = relativeTo.getMonth();\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 '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 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)\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, 'second');\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';\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}\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 state = states.get(autoCheckElement);\n if (!src || !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 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 if (!src || !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 body.append(csrfField, csrf);\n body.append('value', input.value);\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, src, {\n credentials: 'same-origin',\n signal: state.controller.signal,\n method: 'POST',\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","import '@github/auto-check-element'\nimport {controller, target} from '@github/catalyst'\n\n// eslint-disable-next-line custom-elements/expose-class-on-global\n@controller\n// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nclass PrimerTextFieldElement extends HTMLElement {\n @target inputElement: HTMLInputElement\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n @target validationSuccessIcon: HTMLElement\n @target validationErrorIcon: 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: any) => {\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: any) => {\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","/* 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\nexport type ItemActivatedEvent = {\n item: Element\n checked: boolean\n}\n\ndeclare global {\n interface HTMLElementEventMap {\n itemActivated: CustomEvent<ItemActivatedEvent>\n }\n}\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 #isKeyboardActivation(event: Event): boolean {\n return this.#isKeyboardActivationViaEnter(event) || this.#isKeyboardActivationViaSpace(event)\n }\n\n #isKeyboardActivationViaEnter(event: Event): boolean {\n return (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === 'Enter'\n )\n }\n\n #isKeyboardActivationViaSpace(event: Event): boolean {\n return (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isMouseActivation(event: Event): boolean {\n return event instanceof MouseEvent && event.type === 'click'\n }\n\n #isActivation(event: Event): boolean {\n return this.#isMouseActivation(event) || this.#isKeyboardActivation(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 this.#activateItem(event, item)\n this.#handleItemActivated(item)\n\n // Pressing the space key on a button or link will cause the page to scroll unless preventDefault()\n // is called. While calling preventDefault() appears to have no effect on link navigation, it skips\n // form submission. The code below therefore only calls preventDefault() if the button has been\n // activated by the space key, and manually submits the form if the button is a submit button.\n if (this.#isKeyboardActivationViaSpace(event)) {\n event.preventDefault()\n\n if (item.getAttribute('type') === 'submit') {\n item.closest('form')?.submit()\n }\n }\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 this.dispatchEvent(\n new CustomEvent('itemActivated', {\n detail: {item: item.parentElement, checked: this.isItemChecked(item.parentElement)},\n }),\n )\n }\n\n #activateItem(event: Event, item: Element) {\n const eventWillActivateByDefault =\n (event instanceof MouseEvent && event.type === 'click') ||\n (event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === 'Enter')\n\n // if the event will result in activating the current item by default, i.e. is a\n // mouse click or keyboard enter, bail out\n if (eventWillActivateByDefault) return\n\n // otherwise, event will not result in activation by default, so we stop it and\n // simulate a click\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n const elem = item as HTMLElement\n elem.click()\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"],"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","__decorate","decorators","key","desc","d","c","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","controllers","bindShadow","bindElements","listenForBind","observers","el","closed","observer","MutationObserver","mutations","mutation","type","Element","bindActions","addedNodes","node","childList","subtree","attributeFilter","subscription","unsubscribe","disconnect","querySelectorAll","hasAttribute","handleEvent","event","currentTarget","binding","bindings","controller","closest","getRootNode","ShadowRoot","host","matches","shadowController","action","trim","eventSep","lastIndexOf","methodSep","Math","max","slice","addEventListener","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","disconnectedCallback","oldValue","attributes","observed","attrToAttributeName","map","concat","defineObservedAttributes","register","upgrade","element","parentElement","cloneNode","autoShadowRoot","bind","hasOwnProperty","parent","Map","Set","tagName","findTarget","targets","push","findTargets","readyState","once","AbortController","signal","listenerOptions","passive","handler","abort","ActionListTruncationObserver","resizeObserver","ResizeObserver","update","label","querySelector","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","options","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","HTMLInputElement","sentinelInert","contains","sizeInert","offsetWidth","offsetHeight","visibilityInert","visibility","displayInert","offsetParent","clientRectsInert","getClientRects","HTMLAnchorElement","tabIndex","signalSupported","noop","create","removeEventListener","polyfill","originalAddEventListener","EventTarget","originalCallback","optionsOrCapture","AbortSignal","monkeyPatch","eventListenerSignalPolyfill","suspendedTrapStack","activeTrap","isMac","focusTrap","initialFocus","abortSignal","sentinelStart","onfocus","lastFocusableChild","focus","sentinelEnd","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","firstFocusableChild","prepend","wrappingController","followSignal","suspendedTrap","undefined","removeAttribute","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","elementIndexFocusedByClick","focusableElement","relatedTarget","targetElementIndex","lastKeyboardFocusDirection","targetElement","elementToFocus","console","warn","keyboardEventRecipient","keyBit","defaultPrevented","keyLength","isTextInput","HTMLTextAreaElement","HTMLSelectElement","altKey","textInput","cursorAtStart","selectionStart","selectionEnd","cursorAtEnd","shouldIgnoreFocusHandling","nextElementToFocus","lastFocusedIndex","focusedIndex","getCurrentFocusedIndex","nextFocusedIndex","preventDefault","instersectionObserver","ActionBarElement","ItemType","_ActionBarElement_focusZoneAbortController","item","items","marginLeft","marginRight","requestAnimationFrame","menuItemClick","getElementById","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","callback","DetailsMenuElement","preload","details","summary","subscriptions","fromEvent","trackComposition","shouldCommit","menu","KeyboardEvent","states","isComposing","isSummaryFocused","close","stopPropagation","sibling","ctrlBindings","selected","isMenuItem","keydown","loadFragment","opened","closeCurrentMenu","NullSubscription","focusOnOpen","loaded","sub","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","input","Array","found","def","userAgent","menuitem","checked","commit","button","textEl","labelText","html","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","hasLayerSupport","CSSLayerBlockRule","styles","popoverStyleSheet","injectStyles","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","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","bubbles","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","location","pathname","currentlySelectedItem","_NavListElement_deselect","children","parentMenu","_NavListElement_findParentMenu","NavListGroupElement","_NavListGroupElement_truncateObserver","setShowMoreItemState","showMoreDisabled","showMoreItem","currentPage","totalPages","paginationSrc","paginationURL","URL","origin","searchParams","ok","err","_NavListGroupElement_instances","_NavListGroupElement_parseHTML","listId","focusMarkers","SegmentedControlElement","_SegmentedControlElement_instances","_SegmentedControlElement_updateButtonLabels","select","ToggleSwitchElement","toggling","csrf","csrfElement","csrfField","isRemote","isDisabled","performToggle","setLoadingState","submitForm","setErrorState","message","setSuccessState","turnOn","switch","turnOff","isOn","isOff","disable","enable","errorIcon","loadingSpinner","setFinishedState","FormData","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","timeout","Rest","clearTimeout","debounce","onResultsMouseDown","onInputBlur","onInputFocus","onCommit","handleClear","updateFeedbackForScreenReaders","fetchResults","identifyOptions","inputString","query","fetchOnEmpty","url","params","URLSearchParams","search","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","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","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","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","args","cancel","throttle","_AutoCheckElement_onloadend","AutoCheckEvent","phase","AutoCheckValidationEvent","setValidity","AutoCheckCompleteEvent","AutoCheckSuccessEvent","AutoCheckStartEvent","AutoCheckErrorEvent","AutoCheckSendEvent","AutoCheckElement","onloadend","checker","check","spellcheck","setCustomValidity","required","autoCheckElement","startEvent","fetchWithNetworkEvents","clone","PrimerTextFieldElement","_PrimerTextFieldElement_abortController","setSuccess","clearError","errorMessage","setError","clearContents","validationElement","validationMessageElement","replaceChildren","setValidationMessage","toggleValidationStyling","isError","validationSuccessIcon","validationErrorIcon","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_handleItemActivated","_ActionMenuElement_isKeyboardActivationViaSpace","submit","_ActionMenuElement_handleIncludeFragmentReplaced","getItemById","isItemDisabled","disableItem","enableItem","isItemHidden","hideItem","showItem","isItemChecked","checkItem","itemContent","uncheckItem","_ActionMenuElement_isKeyboardActivationViaEnter","_ActionMenuElement_isMouseActivation","_ActionMenuElement_isKeyboardActivation","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","checkedItem","_ActionMenuElement_activateItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput"],"mappings":"yBAAA,IAWIA,EAAmCC,EAA8BC,EAAkCC,EAAoCC,EAAiCC,EAA8CC,EAA8BC,EAXpPC,EAAkE,SAA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,IAAK,MAAMpuB,KAASmuB,EAClBnuB,EAAMjM,QAET,CACH,gBAGE,OAAOpY,KAAK8N,cAAc+gC,GAAkB/f,KAAK,KACnD,EAnaAhpB,EAAA,CADCzF,GACsCyuC,GAAAtjC,UAAA,uBAAA,GAF5BsjC,GAAiBhpC,EAAA,CAD7B4C,GACYomC,IAwfRrpC,OAAO5E,eAAezB,IAAI,iBAC7BqG,OAAOqpC,kBAAoBA,GAC3BrpC,OAAO5E,eAAeC,OAAO,cAAeguC"}
|
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/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.js","../../../node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js","../../../node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js","../../../node_modules/@primer/behaviors/dist/esm/focus-trap.js","../../../node_modules/@primer/behaviors/dist/esm/utils/user-agent.js","../../../node_modules/@primer/behaviors/dist/esm/utils/unique-id.js","../../../node_modules/@primer/behaviors/dist/esm/focus-zone.js","../../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","../../../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"],"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","/******************************************************************************\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\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\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;\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 }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\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\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};\nexport function 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","export 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}\nexport function getFocusableChild(container, lastChild = false) {\n return iterateFocusableElements(container, { reverse: lastChild, strict: true, onlyTabbable: true }).next().value;\n}\nexport function 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}\nexport function isTabbable(elem, strict = false) {\n return isFocusable(elem, strict) && elem.getAttribute('tabindex') !== '-1';\n}\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}\nexport function polyfill() {\n if (!featureSupported()) {\n monkeyPatch();\n signalSupported = true;\n }\n}\n","import { getFocusableChild, isTabbable } from './utils/iterate-focusable-elements.js';\nimport { polyfill as eventListenerSignalPolyfill } from './polyfills/event-listener-signal.js';\neventListenerSignalPolyfill();\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}\nexport function 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","let isMac = undefined;\nexport function isMacOS() {\n if (isMac === undefined) {\n isMac = /^mac/i.test(window.navigator.platform);\n }\n return isMac;\n}\n","let idSeed = 10000;\nexport function uniqueId() {\n return `__primer_id_${idSeed++}`;\n}\n","import { polyfill as eventListenerSignalPolyfill } from './polyfills/event-listener-signal.js';\nimport { isMacOS } from './utils/user-agent.js';\nimport { iterateFocusableElements } from './utils/iterate-focusable-elements.js';\nimport { uniqueId } from './utils/unique-id.js';\neventListenerSignalPolyfill();\nexport var 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}\nexport const isActiveDescendantAttribute = 'data-is-active-descendant';\nexport const activeDescendantActivatedDirectly = 'activated-directly';\nexport const activeDescendantActivatedIndirectly = 'activated-indirectly';\nexport const hasActiveDescendantAttribute = 'data-has-active-descendant';\nexport function 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, iterateFocusableElementsOptions));\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 }\n });\n observer.observe(container, {\n subtree: true,\n childList: 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","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 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 const document2 = newPopover.ownerDocument;\n for (const popover of autoPopoverList.get(document2) || []) {\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);\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;\nvar hasLayerSupport = typeof window.CSSLayerBlockRule === \"function\";\nvar styles = `\n${hasLayerSupport ? \"@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(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\n :where([popover]:not(.\\\\:popover-open)) {\n display: none;\n }\n${hasLayerSupport ? \"}\" : \"\"}\n`;\nvar popoverStyleSheet = null;\nfunction injectStyles(root) {\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 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\"]']\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 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} from '@github/catalyst'\n\n@controller\nclass ToggleSwitchElement extends HTMLElement {\n @target switch: HTMLElement\n @target loadingSpinner: HTMLElement\n @target errorIcon: HTMLElement\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('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 try {\n response = await fetch(this.src, {\n credentials: 'same-origin',\n method: 'POST',\n headers: {\n 'Requested-With': 'XMLHttpRequest',\n },\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}\n\ndeclare global {\n interface Window {\n ToggleSwitchElement: typeof ToggleSwitchElement\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(--fgColor-onEmphasis, var(--color-fg-on-emphasis)) !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(--bgColor-emphasis, var(--color-neutral-emphasis-plus)) !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\n if (currentTimeout) {\n clearTimeout(currentTimeout)\n clipboardCopyElementTimers.delete(target)\n } else {\n showCheck(target)\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 let currentMonth = relativeTo.getMonth();\n const currentDate = relativeTo.getDate();\n if (days >= 27 || years + months + days) {\n const newDate = new Date(relativeTo);\n newDate.setFullYear(currentYear + years * sign);\n newDate.setMonth(currentMonth + months * sign);\n newDate.setDate(currentDate + 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));\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 currentMonth = relativeTo.getMonth();\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 '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 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)\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, 'second');\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';\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}\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 state = states.get(autoCheckElement);\n if (!src || !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 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 if (!src || !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 body.append(csrfField, csrf);\n body.append('value', input.value);\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, src, {\n credentials: 'same-origin',\n signal: state.controller.signal,\n method: 'POST',\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","import '@github/auto-check-element'\nimport {controller, target} from '@github/catalyst'\n\n// eslint-disable-next-line custom-elements/expose-class-on-global\n@controller\n// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\nclass PrimerTextFieldElement extends HTMLElement {\n @target inputElement: HTMLInputElement\n @target validationElement: HTMLElement\n @target validationMessageElement: HTMLElement\n @target validationSuccessIcon: HTMLElement\n @target validationErrorIcon: 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: any) => {\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: any) => {\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","/* 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\nexport type ItemActivatedEvent = {\n item: Element\n checked: boolean\n}\n\ndeclare global {\n interface HTMLElementEventMap {\n itemActivated: CustomEvent<ItemActivatedEvent>\n }\n}\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 #isKeyboardActivation(event: Event): boolean {\n return this.#isKeyboardActivationViaEnter(event) || this.#isKeyboardActivationViaSpace(event)\n }\n\n #isKeyboardActivationViaEnter(event: Event): boolean {\n return (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === 'Enter'\n )\n }\n\n #isKeyboardActivationViaSpace(event: Event): boolean {\n return (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === ' '\n )\n }\n\n #isMouseActivation(event: Event): boolean {\n return event instanceof MouseEvent && event.type === 'click'\n }\n\n #isActivation(event: Event): boolean {\n return this.#isMouseActivation(event) || this.#isKeyboardActivation(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 this.#activateItem(event, item)\n this.#handleItemActivated(item)\n\n // Pressing the space key on a button or link will cause the page to scroll unless preventDefault()\n // is called. While calling preventDefault() appears to have no effect on link navigation, it skips\n // form submission. The code below therefore only calls preventDefault() if the button has been\n // activated by the space key, and manually submits the form if the button is a submit button.\n if (this.#isKeyboardActivationViaSpace(event)) {\n event.preventDefault()\n\n if (item.getAttribute('type') === 'submit') {\n item.closest('form')?.submit()\n }\n }\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 this.dispatchEvent(\n new CustomEvent('itemActivated', {\n detail: {item: item.parentElement, checked: this.isItemChecked(item.parentElement)},\n }),\n )\n }\n\n #activateItem(event: Event, item: Element) {\n const eventWillActivateByDefault =\n (event instanceof MouseEvent && event.type === 'click') ||\n (event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&\n event.key === 'Enter')\n\n // if the event will result in activating the current item by default, i.e. is a\n // mouse click or keyboard enter, bail out\n if (eventWillActivateByDefault) return\n\n // otherwise, event will not result in activation by default, so we stop it and\n // simulate a click\n /* eslint-disable-next-line no-restricted-syntax */\n event.stopPropagation()\n const elem = item as HTMLElement\n elem.click()\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"],"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","__decorate","decorators","key","desc","d","c","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","controllers","bindShadow","bindElements","listenForBind","observers","el","closed","observer","MutationObserver","mutations","mutation","type","Element","bindActions","addedNodes","node","childList","subtree","attributeFilter","subscription","unsubscribe","disconnect","querySelectorAll","hasAttribute","handleEvent","event","currentTarget","binding","bindings","controller","closest","getRootNode","ShadowRoot","host","matches","shadowController","action","trim","eventSep","lastIndexOf","methodSep","Math","max","slice","addEventListener","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","disconnectedCallback","oldValue","attributes","observed","attrToAttributeName","map","concat","defineObservedAttributes","register","upgrade","element","parentElement","cloneNode","autoShadowRoot","bind","hasOwnProperty","parent","Map","Set","tagName","findTarget","targets","push","findTargets","readyState","once","AbortController","signal","listenerOptions","passive","handler","abort","ActionListTruncationObserver","resizeObserver","ResizeObserver","update","items","item","label","querySelector","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","options","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","HTMLInputElement","sentinelInert","contains","sizeInert","offsetWidth","offsetHeight","visibilityInert","visibility","displayInert","offsetParent","clientRectsInert","getClientRects","HTMLAnchorElement","tabIndex","signalSupported","noop","create","removeEventListener","polyfill","originalAddEventListener","EventTarget","originalCallback","optionsOrCapture","AbortSignal","monkeyPatch","eventListenerSignalPolyfill","suspendedTrapStack","activeTrap","isMac","focusTrap","initialFocus","abortSignal","sentinelStart","onfocus","lastFocusableChild","focus","sentinelEnd","lastFocusedChild","ensureTrapZoneHasFocus","focusedElement","firstFocusableChild","prepend","wrappingController","followSignal","suspendedTrap","undefined","removeAttribute","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","elementIndexFocusedByClick","focusableElement","relatedTarget","targetElementIndex","lastKeyboardFocusDirection","targetElement","elementToFocus","console","warn","keyboardEventRecipient","keyBit","defaultPrevented","keyLength","isTextInput","HTMLTextAreaElement","HTMLSelectElement","altKey","textInput","cursorAtStart","selectionStart","selectionEnd","cursorAtEnd","shouldIgnoreFocusHandling","nextElementToFocus","lastFocusedIndex","focusedIndex","getCurrentFocusedIndex","nextFocusedIndex","preventDefault","instersectionObserver","ActionBarElement","ItemType","_ActionBarElement_focusZoneAbortController","marginLeft","marginRight","requestAnimationFrame","menuItemClick","getElementById","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","callback","DetailsMenuElement","preload","details","summary","subscriptions","fromEvent","trackComposition","shouldCommit","menu","KeyboardEvent","states","isComposing","isSummaryFocused","close","stopPropagation","sibling","ctrlBindings","selected","isMenuItem","keydown","loadFragment","opened","closeCurrentMenu","NullSubscription","focusOnOpen","loaded","sub","eventName","onNext","loader","autofocus","isMouse","focusFirstItem","input","Array","found","def","userAgent","menuitem","checked","commit","button","textEl","labelText","html","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","hasLayerSupport","CSSLayerBlockRule","styles","popoverStyleSheet","injectStyles","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","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","bubbles","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","location","pathname","currentlySelectedItem","_NavListElement_deselect","children","parentMenu","_NavListElement_findParentMenu","NavListGroupElement","_NavListGroupElement_truncateObserver","setShowMoreItemState","showMoreDisabled","showMoreItem","currentPage","totalPages","paginationSrc","paginationURL","URL","origin","searchParams","ok","err","_NavListGroupElement_instances","_NavListGroupElement_parseHTML","listId","focusMarkers","SegmentedControlElement","_SegmentedControlElement_instances","_SegmentedControlElement_updateButtonLabels","select","ToggleSwitchElement","toggling","csrf","csrfElement","csrfField","isRemote","isDisabled","performToggle","setLoadingState","submitForm","setErrorState","message","setSuccessState","turnOn","switch","turnOff","isOn","isOff","disable","enable","errorIcon","loadingSpinner","setFinishedState","FormData","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","timeout","Rest","clearTimeout","debounce","onResultsMouseDown","onInputBlur","onInputFocus","onCommit","handleClear","updateFeedbackForScreenReaders","fetchResults","identifyOptions","inputString","query","fetchOnEmpty","url","params","URLSearchParams","search","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","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","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","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","args","cancel","throttle","_AutoCheckElement_onloadend","AutoCheckEvent","phase","AutoCheckValidationEvent","setValidity","AutoCheckCompleteEvent","AutoCheckSuccessEvent","AutoCheckStartEvent","AutoCheckErrorEvent","AutoCheckSendEvent","AutoCheckElement","onloadend","checker","check","spellcheck","setCustomValidity","required","autoCheckElement","startEvent","fetchWithNetworkEvents","clone","PrimerTextFieldElement","_PrimerTextFieldElement_abortController","setSuccess","clearError","errorMessage","setError","clearContents","validationElement","validationMessageElement","replaceChildren","setValidationMessage","toggleValidationStyling","isError","validationSuccessIcon","validationErrorIcon","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_handleItemActivated","_ActionMenuElement_isKeyboardActivationViaSpace","submit","_ActionMenuElement_handleIncludeFragmentReplaced","getItemById","isItemDisabled","disableItem","enableItem","isItemHidden","hideItem","showItem","isItemChecked","checkItem","itemContent","uncheckItem","_ActionMenuElement_isKeyboardActivationViaEnter","_ActionMenuElement_isMouseActivation","_ActionMenuElement_isKeyboardActivation","_ActionMenuElement_isOpen","_ActionMenuElement_hide","_ActionMenuElement_show","_ActionMenuElement_handleDialogItemActivated","dialog_controller","handleDialogClose","lostFocus","focusInClosedMenu","checkedItem","_ActionMenuElement_activateItem","itemLabel","prefixSpan","contentSpan","inputList","inputs","newInput"],"mappings":"yBAAA,IAWIA,EAAmCC,EAA8BC,EAAkCC,EAAoCC,EAAiCC,EAA8CC,EAA8BC,EAXpPC,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,GACnG,GAAa,MAATD,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,4EACvG,MAAgB,MAATF,EAAeC,EAAa,MAATD,EAAeC,EAAEG,KAAKN,GAAYG,EAAIA,EAAEI,MAAQN,EAAMO,IAAIR,EACxF,EACIS,EAAkE,SAAUT,EAAUC,EAAOM,EAAOL,EAAMC,GAC1G,GAAa,MAATD,EAAc,MAAM,IAAIE,UAAU,kCACtC,GAAa,MAATF,IAAiBC,EAAG,MAAM,IAAIC,UAAU,iDAC5C,GAAqB,mBAAVH,EAAuBD,IAAaC,IAAUE,GAAKF,EAAMI,IAAIL,GAAW,MAAM,IAAII,UAAU,2EACvG,MAAiB,MAATF,EAAeC,EAAEG,KAAKN,EAAUO,GAASJ,EAAIA,EAAEI,MAAQA,EAAQN,EAAMS,IAAIV,EAAUO,GAASA,CACxG,EAEA,MAAMI,EAAc,IAAIC,QAIxB,IAAIC,EAA+B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