@openproject/primer-view-components 0.90.0-rc.8fe43154e → 0.90.0-rc.a13a26a4d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t,e,i,n,s,o,r,a,l=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},c=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const d=new WeakMap;let h=null;class IncludeFragmentElement extends HTMLElement{constructor(){super(...arguments),t.add(this),e.set(this,!1),i.set(this,new IntersectionObserver((e=>{for(const s of e)if(s.isIntersecting){const{target:e}=s;if(l(this,i,"f").unobserve(e),!(e instanceof IncludeFragmentElement))return;"lazy"===e.loading&&l(this,t,"m",n).call(this)}}),{rootMargin:"0px 0px 256px 0px",threshold:.01}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){h=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",o).call(this)}attributeChangedCallback(e,i){"src"===e?this.isConnected&&"eager"===this.loading&&l(this,t,"m",n).call(this):"loading"===e&&this.isConnected&&"eager"!==i&&"eager"===this.loading&&l(this,t,"m",n).call(this)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",n).call(this),"lazy"===this.loading&&l(this,i,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",o).call(this)}fetch(t){return fetch(t)}refetch(){d.delete(this),l(this,t,"m",n).call(this)}}e=new WeakMap,i=new WeakMap,t=new WeakSet,n=async function(){if(!l(this,e,"f")){c(this,e,!0,"f"),l(this,i,"f").unobserve(this);try{const i=await l(this,t,"m",s).call(this);if(i instanceof Error)throw i;const n=i,o=document.createElement("template");o.innerHTML=n;const r=document.importNode(o.content,!0);if(!this.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:r}})))return void c(this,e,!1,"f");this.replaceWith(r),this.dispatchEvent(new CustomEvent("include-fragment-replaced"))}catch(t){this.classList.add("is-error")}finally{c(this,e,!1,"f")}}},s=async function(){const e=this.src,i=d.get(this);if(i&&i.src===e)return i.data;{let i;return i=e?l(this,t,"m",a).call(this):Promise.reject(new Error("missing src")),d.set(this,{src:e,data:i}),i}},o=async function(){const e=await l(this,t,"m",s).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t,e){await new Promise((t=>setTimeout(t,0)));for(const i of t)this.dispatchEvent(e?new CustomEvent(i,{detail:{error:e}}):new Event(i))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const i=await this.fetch(this.request()),n=i.headers.get("Content-Type");if(!(e=this.accept,e&&e.split(",").find((t=>t.match(/^\s*\*\/\*/)))||n&&n.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${n}`);if(200!==i.status)throw new Error(`Failed to load resource: the server responded with a status of ${i.status}`);const s=await i.text();let o=s;if(h){o=(await h).createHTML(s,i)}return l(this,t,"m",r).call(this,["load","loadend"]),o}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"],e),e}var e};const u="undefined"!=typeof globalThis?globalThis:window;try{u.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(u.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}const m=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=f.bind(null,this,!0),e={currentQuery:null,oninput:p((e=>t(e))),fetch:t,controller:null};m.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&f(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=m.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=m.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function f(t,e,i){const n=t.input;if(!n)return;const s=m.get(t);if(!s)return;const o=n.value;if(e&&s.currentQuery===o)return;s.currentQuery=o;const r=t.src;if(!r)return;const a=document.getElementById(t.getAttribute("aria-owns")||"");if(!a)return;const l=new URL(r,window.location.href),c=new URLSearchParams(l.search);let d;c.append(t.getAttribute("param")||"q",o),l.search=c.toString(),s.controller?s.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let h="";try{d=await async function(t,e,i){try{const n=await fetch(e,i);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),n}catch(e){throw e instanceof Error&&"AbortError"!==(null==e?void 0:e.name)&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,l.toString(),{signal:s.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),h=await d.text(),t.removeAttribute("loading"),s.controller=null}catch(e){return void(e instanceof Error&&"AbortError"!==e.name&&(t.removeAttribute("loading"),s.controller=null))}d&&d.ok?(a.innerHTML=h,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0,detail:{eventType:i?i.type:void 0}}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function p(t){let e;return function(i){clearTimeout(e),e=setTimeout((()=>{clearTimeout(e),t(i)}),300)}}function g(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}function b(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function v(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i}window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement)),"function"==typeof SuppressedError&&SuppressedError;const w=new WeakSet;function y(t){k(t),A(t)}const E=new WeakMap;function A(t=document){if(E.has(t))return E.get(t);let e=!1;const i=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)S(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&k(t)}));i.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const n={get closed(){return e},unsubscribe(){e=!0,E.delete(t),i.disconnect()}};return E.set(t,n),n}function k(t){for(const e of t.querySelectorAll("[data-action]"))S(e);t instanceof Element&&t.hasAttribute("data-action")&&S(t)}function L(t){const e=t.currentTarget;for(const i of T(e))if(t.type===i.type){const n=e.closest(i.tag);w.has(n)&&"function"==typeof n[i.method]&&n[i.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&w.has(s.host)&&s.host.matches(i.tag)){const e=s.host;"function"==typeof e[i.method]&&e[i.method](t)}}}function*T(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),i=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,i),method:e.slice(i+1)||"handleEvent"}||"handleEvent"}}function S(t){for(const e of T(t))t.addEventListener(e.type,L)}const C=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),x=(t,e="property")=>{const i=C(t);if(!i.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return i};const M="attr";function I(t,e){$(t,M).add(e)}const D=new WeakSet;function P(t,e){if(D.has(t))return;D.add(t);const i=Object.getPrototypeOf(t),n=i?.constructor?.attrPrefix??"data-";e||(e=$(i,M));for(const i of e){const e=t[i],s=x(`${n}${i}`);let o={configurable:!0,get(){return this.getAttribute(s)||""},set(t){this.setAttribute(s,t||"")}};"number"==typeof e?o={configurable:!0,get(){return Number(this.getAttribute(s)||0)},set(t){this.setAttribute(s,t)}}:"boolean"==typeof e&&(o={configurable:!0,get(){return this.hasAttribute(s)},set(t){this.toggleAttribute(s,t)}}),Object.defineProperty(t,i,o),i in t&&!t.hasAttribute(s)&&o.set.call(t,e)}}const N=new Map,H=new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),F=new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const i={once:!0,passive:!0,signal:e.signal},n=()=>e.abort();document.addEventListener("mousedown",n,i),document.addEventListener("touchstart",n,i),document.addEventListener("keydown",n,i),document.addEventListener("pointerdown",n,i)})),O={ready:()=>H,firstInteraction:()=>F,visible:t=>new Promise((e=>{const i=new IntersectionObserver((t=>{for(const n of t)if(n.isIntersecting)return e(),void i.disconnect()}),{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const e of document.querySelectorAll(t))i.observe(e)}))},q=new WeakMap;function V(t){cancelAnimationFrame(q.get(t)||0),q.set(t,requestAnimationFrame((()=>{for(const e of N.keys()){const i=t instanceof Element&&t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||i){const n=i?.getAttribute("data-load-on")||"ready",s=n in O?O[n]:O.ready;for(const t of N.get(e)||[])s(e).then(t);N.delete(e),q.delete(t)}}})))}let R;const W=Symbol.for("catalyst");class B{constructor(t,e){const i=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){i.connectedCallback(this,n)};const s=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){i.disconnectedCallback(this,s)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,e,n){i.attributeChangedCallback(this,t,e,n,o)};let r=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return i.observedAttributes(this,r)},set(t){r=t}}),function(t){let e=t.observedAttributes||[];const i=t.attrPrefix??"data-",n=t=>x(`${i}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...$(t.prototype,M)].map(n).concat(e),set(t){e=t}})}(t),function(t,e){const i=e||C(t.name).replace(/-element$/,"");try{window.customElements.define(i,t),window[t.name]=customElements.get(i)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t,e)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),P(t),function(t){w.add(t),t.shadowRoot&&y(t.shadowRoot),k(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){R||(R=new MutationObserver((t=>{if(N.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&V(t)}))),V(t),R.observe(t,{subtree:!0,childList:!0})}(t.shadowRoot))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,i,n,s){P(t),"data-catalyst"!==e&&s&&s.call(t,e,i,n)}}function $(t,e){if(!Object.prototype.hasOwnProperty.call(t,W)){const e=t[W],i=t[W]=new Map;if(e)for(const[t,n]of e)i.set(t,new Set(n))}const i=t[W];return i.has(e)||i.set(e,new Set),i.get(e)}function U(t,e){$(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase();if(t.shadowRoot)for(const n of t.shadowRoot.querySelectorAll(`[data-target~="${i}.${e}"]`))if(!n.closest(i))return n;for(const n of t.querySelectorAll(`[data-target~="${i}.${e}"]`))if(n.closest(i)===t)return n}(this,e)}})}function K(t,e){$(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase(),n=[];if(t.shadowRoot)for(const s of t.shadowRoot.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)||n.push(s);for(const s of t.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)===t&&n.push(s);return n}(this,e)}})}function j(t){if("string"==typeof t)return e=>{new B(e,t)};new B(t)}var z;class _{constructor(t){this.resizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof HTMLElement&&this.update(t)}})),this.resizeObserver.observe(t)}unobserve(t){this.resizeObserver.unobserve(t)}update(t){const e=t.querySelectorAll("li");for(const t of e){const e=t.querySelector(".ActionListItem-label");if(!e)continue;const i=t.querySelector(".ActionListItem-truncationTooltip");if(!i)continue;const n=e.scrollWidth>e.clientWidth;i.style.display=n?"":"none"}}}let Z=class ActionListElement extends HTMLElement{constructor(){super(...arguments),z.set(this,void 0)}connectedCallback(){v(this,z,new _(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,Z=g([j("action-list")],Z);const Y={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},G={start:["end","center"],end:["start","center"],center:["end","start"]};function J(t,e,i={}){const n=function(t){if(function(t){var e;if("DIALOG"===t.tagName)return!0;try{if(t.matches(":popover-open")&&/native code/.test(null===(e=document.body.showPopover)||void 0===e?void 0:e.toString()))return!0}catch(t){return!1}return!1}(t))return document.body;let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),s=function(t){let e=t;for(;null!==e&&e instanceof Element;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const i=e!==document.body&&e instanceof HTMLElement?e:document.body,n=i.getBoundingClientRect(),s=getComputedStyle(i),[o,r,a,l]=[s.borderTopWidth,s.borderLeftWidth,s.borderRightWidth,s.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:n.top+o,left:n.left+r,width:n.width-a-r,height:Math.max(n.height-o-l,i===document.body?window.innerHeight:-1/0)}}(n),o=getComputedStyle(n),r=n.getBoundingClientRect(),[a,l]=[o.borderTopWidth,o.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,i,n,{side:s,align:o,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let d=Q(i,n,s,o,a,l),h=s,u=o;if(d.top-=e.top,d.left-=e.left,!r){const r=Y[s];let m=0;if(r){let t=s;for(;m<r.length&&tt(t,d,c,i);){const s=r[m++];t=s,d=Q(i,n,s,o,a,l),d.top-=e.top,d.left-=e.left,h=s}}const f=G[o];let p=0;if(f){let t=o;for(;p<f.length&&et(t,d,c,i);){const s=f[p++];t=s,d=Q(i,n,h,s,a,l),d.top-=e.top,d.left-=e.left,u=s}}d.top<c.top&&(d.top=c.top),d.left<c.left&&(d.left=c.left),d.left+i.width>t.width+c.left&&(d.left=t.width+c.left-i.width),r&&m<r.length&&d.top+i.height>t.height+c.top&&(d.top=Math.max(t.height+c.top-i.height,0))}return Object.assign(Object.assign({},d),{anchorSide:h,anchorAlign:u})}(s,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,i,n,s,o;const r=null!==(e=t.side)&&void 0!==e?e:X.side,a=null!==(i=t.align)&&void 0!==i?i:X.align;return{side:r,align:a,anchorOffset:null!==(n=t.anchorOffset)&&void 0!==n?n:"inside-center"===r?0:X.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==a&&r.startsWith("inside")?X.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:X.allowOutOfBounds}}(i))}const X={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Q(t,e,i,n,s,o){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===i?l=e.top-s-t.height:"outside-bottom"===i?l=a+s:"outside-left"===i?c=e.left-s-t.width:"outside-right"===i&&(c=r+s),"outside-top"!==i&&"outside-bottom"!==i||(c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o),"outside-left"!==i&&"outside-right"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),"inside-top"===i?l=e.top+s:"inside-bottom"===i?l=a-s-t.height:"inside-left"===i?c=e.left+s:"inside-right"===i?c=r-s-t.width:"inside-center"===i&&(c=(r+e.left)/2-t.width/2+s),"inside-top"===i||"inside-bottom"===i?c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o:"inside-left"!==i&&"inside-right"!==i&&"inside-center"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),{top:l,left:c}}function tt(t,e,i,n){return"outside-top"===t||"outside-bottom"===t?e.top<i.top||e.top+n.height>i.height+i.top:e.left<i.left||e.left+n.width>i.width+i.left}function et(t,e,i,n){return"end"===t?e.left<i.left:"start"===t||"center"===t?e.left+n.width>i.left+i.width||e.left<i.left:void 0}function*it(t,e={}){var i,n;const s=null!==(i=e.strict)&&void 0!==i&&i,o=null!==(n=e.onlyTabbable)&&void 0!==n&&n?ot:st,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&o(t,s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&o(t,s)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&o(t,s)&&(yield t)}function nt(t,e=!1){return it(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function st(t,e=!1){const i=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,n=t.hidden,s=t instanceof HTMLInputElement&&"hidden"===t.type,o=t.classList.contains("sentinel");if(i||n||s||o)return!1;if(e){const e=getComputedStyle(t),i=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(e.visibility),s="none"===e.display||!t.offsetParent,o=0===t.getClientRects().length;if(i||n||o||s)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function ot(t,e=!1){return st(t,e)&&"-1"!==t.getAttribute("tabindex")}let rt=!1;function at(){}try{const t=Object.create({},{signal:{get(){rt=!0}}});window.addEventListener("test",at,t),window.removeEventListener("test",at,t)}catch(t){}function lt(){rt||(!function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,i,n){return"object"==typeof n&&"signal"in n&&n.signal instanceof AbortSignal&&t.call(n.signal,"abort",(()=>{this.removeEventListener(e,i,n)})),t.call(this,e,i,n)}}(),rt=!0)}lt();const ct=[];let dt,ht;function ut(t,e,i){const n=new AbortController,s=null!=i?i:n.signal;t.setAttribute("data-focus-trap","active");const o=document.createElement("span");o.setAttribute("class","sentinel"),o.setAttribute("tabindex","0"),o.setAttribute("aria-hidden","true"),o.onfocus=()=>{const e=nt(t,!0);null==e||e.focus()};const r=document.createElement("span");r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=nt(t);null==e||e.focus()};Array.from(t.children).filter((t=>t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length||(t.prepend(o),t.append(r));const a=function(t,e){const i=new MutationObserver((i=>{for(const n of i)if("childList"===n.type&&n.addedNodes.length){if(Array.from(n.addedNodes).filter((t=>t instanceof HTMLElement&&t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length)return;const i=t.firstElementChild,s=t.lastElementChild,[o,r]=e;(null==i?void 0:i.classList.contains("sentinel"))||t.insertAdjacentElement("afterbegin",o),(null==s?void 0:s.classList.contains("sentinel"))||t.insertAdjacentElement("beforeend",r)}}));return i.observe(t,{childList:!0}),i}(t,[o,r]);let l;function c(i){if(i instanceof HTMLElement&&document.contains(t)){if(t.contains(i))return void(l=i);if(l&&ot(l)&&t.contains(l))return void l.focus();if(e&&t.contains(e))return void e.focus();{const e=nt(t);return void(null==e||e.focus())}}}const d=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(s);if(dt){const t=dt;dt.container.setAttribute("data-focus-trap","suspended"),dt.controller.abort(),ct.push(t)}d.signal.addEventListener("abort",(()=>{dt=void 0})),s.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const i=ct.findIndex((e=>e.container===t));i>=0&&ct.splice(i,1),a.disconnect(),function(){const t=ct.pop();t&&ut(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:d.signal,capture:!0}),c(document.activeElement),dt={container:t,controller:d,initialFocus:e,originalSignal:s};const h=ct.findIndex((e=>e.container===t));if(h>=0&&ct.splice(h,1),!i)return n}function mt(){return void 0===ht&&(ht=/^mac/i.test(window.navigator.platform)),ht}let ft=1e4;const pt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);var gt;lt(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(gt||(gt={}));const bt={ArrowLeft:gt.ArrowHorizontal,ArrowDown:gt.ArrowVertical,ArrowUp:gt.ArrowVertical,ArrowRight:gt.ArrowHorizontal,h:gt.HL,j:gt.JK,k:gt.JK,l:gt.HL,a:gt.AD,s:gt.WS,w:gt.WS,d:gt.AD,Tab:gt.Tab,Home:gt.HomeAndEnd,End:gt.HomeAndEnd,PageUp:gt.PageUpDown,PageDown:gt.PageUpDown,Backspace:gt.Backspace},vt={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function wt(t){const e=vt[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const i=mt();if(i&&t.metaKey||!i&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}function yt(t,e){const i=t.key,n=[...i].length,s=function(t){var e,i;if(!(t instanceof HTMLElement))return!1;const n=t.nodeName.toLowerCase(),s=null!==(i=null===(e=t.getAttribute("type"))||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"text",o="true"===t.ariaReadOnly||"true"===t.getAttribute("aria-readonly")||null!==t.getAttribute("readonly");return("select"===n||"textarea"===n||"input"===n&&!pt.has(s)||t.isContentEditable)&&!o}(e),o=e instanceof HTMLSelectElement;if(s&&(1===n||"Home"===i||"End"===i))return!0;if(o)return!("ArrowDown"!==i||!mt()||t.metaKey)||!("ArrowDown"!==i||mt()||!t.altKey);if(s&&!o){const t=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement,n=t&&0===e.selectionStart&&0===e.selectionEnd,s=t&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length;if("ArrowLeft"===i&&!n)return!0;if("ArrowRight"===i&&!s)return!0;const o=e instanceof HTMLElement&&e.isContentEditable;if(e instanceof HTMLTextAreaElement||o){if("PageUp"===i||"PageDown"===i)return!0;if("ArrowUp"===i&&!n)return!0;if("ArrowDown"===i&&!s)return!0}}return!1}const Et="data-is-active-descendant",At="activated-directly",kt="activated-indirectly",Lt="data-has-active-descendant";function Tt(t,e){var i,n,s,o,r,a;const l=[],c=new WeakMap,d=null!==(i=null==e?void 0:e.bindKeys)&&void 0!==i?i:((null==e?void 0:e.getNextFocusable)?gt.ArrowAll:gt.ArrowVertical)|gt.HomeAndEnd,h=null!==(n=null==e?void 0:e.focusOutBehavior)&&void 0!==n?n:"stop",u=null!==(s=null==e?void 0:e.focusInStrategy)&&void 0!==s?s:"previous",m=null==e?void 0:e.activeDescendantControl,f=null==e?void 0:e.onActiveDescendantChanged,p=null!==(o=null==e?void 0:e.ignoreHoverEvents)&&void 0!==o&&o;let g;const b=null!==(r=null==e?void 0:e.preventScroll)&&void 0!==r&&r,v="initial"===u&&(null==e?void 0:e.activeDescendantControl);function w(){return l[0]}function y(t,e=!1){const i=g;g=t,m?t&&document.activeElement===m?E(i,t,e):A():(i&&i!==t&&c.has(i)&&i.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function E(e,i,n=!1){i.id||i.setAttribute("id","__primer_id_"+ft++),e&&e!==i&&e.removeAttribute(Et),m&&(n||m.getAttribute("aria-activedescendant")!==i.id)&&(m.setAttribute("aria-activedescendant",i.id),t.setAttribute(Lt,i.id),i.setAttribute(Et,n?At:kt),null==f||f(i,e,n))}function A(e=g){"first"===u&&(g=void 0),null==m||m.removeAttribute("aria-activedescendant"),t.removeAttribute(Lt),null==e||e.removeAttribute(Et);for(const e of t.querySelectorAll(`[${Et}]`))null==e||e.removeAttribute(Et);null==f||f(void 0,e,!1)}function k(...t){const i=t.filter((t=>{var i,n;return null===(n=null===(i=null==e?void 0:e.focusableElementFilter)||void 0===i?void 0:i.call(e,t))||void 0===n||n}));if(0!==i.length){l.splice(function(t){const e=t[0];if(0===l.length)return 0;let i=0,n=l.length-1;for(;i<=n;){const t=Math.floor((i+n)/2);L(e,l[t])?n=t-1:i=t+1}return i}(i),0,...i);for(const t of i)c.has(t)||c.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");g||v||y(w())}}function L(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function T(...t){for(const e of t){const t=l.indexOf(e);t>=0&&l.splice(t,1);const i=c.get(e);if(void 0!==i&&(null===i?e.removeAttribute("tabindex"):e.setAttribute("tabindex",i),c.delete(e)),e===g){y(w())}}}const S={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};k(...it(t,S));const C="function"==typeof u?u(document.body):w();v||y(C);new MutationObserver((t=>{for(const e of t){for(const t of e.removedNodes)t instanceof HTMLElement&&T(...it(t));"attributes"===e.type&&null===e.oldValue&&e.target instanceof HTMLElement&&T(e.target)}for(const e of t){for(const t of e.addedNodes)t instanceof HTMLElement&&k(...it(t,S));"attributes"===e.type&&null!==e.oldValue&&e.target instanceof HTMLElement&&k(e.target)}})).observe(t,{subtree:!0,childList:!0,attributeFilter:["hidden","disabled"],attributeOldValue:!0});const x=new AbortController,M=null!==(a=null==e?void 0:e.abortSignal)&&void 0!==a?a:x.signal;let I;M.addEventListener("abort",(()=>{T(...l)})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(I=l.indexOf(t.target))}),{signal:M}),m?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&l.includes(t.target)&&(m.focus({preventScroll:b}),y(t.target))}),{signal:M}),p||t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;const e=l.find((e=>e.contains(t)));e&&y(e)}),{signal:M,capture:!0}),m.addEventListener("focusin",(()=>{g?E(void 0,g):v||y(w())}),{signal:M}),m.addEventListener("focusout",(()=>{A()}),{signal:M})):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==I)I>=0&&l[I]!==g&&y(l[I]),I=void 0;else if("previous"===u)y(e.target);else if("closest"===u||"first"===u){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===P?l.length-1:0,e=l[t];return void(null==e||e.focus({preventScroll:b}))}y(e.target)}else if("function"==typeof u)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=u(e.relatedTarget);if((t?l.indexOf(t):-1)>=0&&t instanceof HTMLElement)return void t.focus({preventScroll:b});console.warn("Element requested is not a known focusable element.")}else y(e.target);P=void 0}),{signal:M});const D=null!=m?m:t;let P;return"closest"===u&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(P=wt(t))}),{signal:M,capture:!0}),D.addEventListener("keydown",(i=>{var n;if(i.key in vt){const s=bt[i.key];if(!i.defaultPrevented&&(s&d)>0&&!yt(i,document.activeElement)){const s=wt(i);let o;if((null==e?void 0:e.getNextFocusable)&&(o=e.getNextFocusable(s,null!==(n=document.activeElement)&&void 0!==n?n:void 0,i)),!o){const e=function(){if(!g)return v?-1:0;const e=l.indexOf(g);return-1!==e?e:g===t?-1:0}();let n=e;"previous"===s?n-=1:"start"===s?n=0:"next"===s?n+=1:n=l.length-1,n<0&&(n="wrap"===h&&"Tab"!==i.key?l.length-1:0),n>=l.length&&(n="wrap"===h&&"Tab"!==i.key?0:l.length-1),e!==n&&(o=l[n])}m?y(o||g,!0):o&&(P=s,o.focus({preventScroll:b})),("Tab"!==i.key||o)&&i.preventDefault()}}}),{signal:M}),x}var St,Ct,xt,Mt,It,Dt,Pt,Nt;const Ht=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof Ot&&t.update()}})),Ft=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof Ot&&t.update()}}));let Ot=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),St.add(this),Ct.set(this,null),xt.set(this,!1)}connectedCallback(){Ft.observe(this),Ht.observe(this),this.style.overflow="visible",this.update()}disconnectedCallback(){Ft.unobserve(this),Ht.unobserve(this)}menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}update(){b(this,xt,"f")||(v(this,xt,!0,"f"),requestAnimationFrame((()=>{v(this,xt,!1,"f"),b(this,St,"m",Mt).call(this)})))}};Ct=new WeakMap,xt=new WeakMap,St=new WeakSet,Mt=function(){const t=b(this,St,"a",It);if(!t)return;const e=t.getBoundingClientRect().top,i=b(this,St,"a",Nt),n=Array.from(this.items,(t=>({top:t.getBoundingClientRect().top,isDivider:t.classList.contains("ActionBar-divider")})));let s=!1;for(let t=0;t<n.length;t++){const o=n[t];o.isDivider?s=!0:(o.top>e?(b(this,St,"m",Pt).call(this,t,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),s&&b(this,St,"m",Pt).call(this,t-1,i)):(b(this,St,"m",Dt).call(this,t,i),t===this.items.length-1&&(this.moreMenu.hidden=!0),s&&b(this,St,"m",Dt).call(this,t-1,i)),s=!1)}b(this,Ct,"f")&&b(this,Ct,"f").abort(),v(this,Ct,Tt(this,{bindKeys:gt.ArrowHorizontal|gt.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),i=e>-1&&"visible"===this.items[e].style.visibility,n=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return i||n}}),"f")},It=function(){return this.items.find((t=>!t.classList.contains("ActionBar-divider")))??null},Dt=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","visible"),n.hidden=!0)},Pt=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","hidden"),n.hidden=!1)},Nt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},g([K],Ot.prototype,"items",void 0),g([U],Ot.prototype,"itemContainer",void 0),g([U],Ot.prototype,"moreMenu",void 0),Ot=g([j("action-bar")],Ot),window.ActionBarElement=Ot;class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const i=[Rt(t,"compositionstart",(t=>Yt(this,t))),Rt(t,"compositionend",(t=>Yt(this,t))),Rt(t,"click",(e=>jt(t,e))),Rt(t,"change",(e=>jt(t,e))),Rt(t,"keydown",(e=>function(t,e,i){if(!(i instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const n=qt.get(e);if(!n||n.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":t.hasAttribute("open")&&(Zt(t),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!0);e&&e.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!1);e&&e.focus(),i.preventDefault()}break;case"n":if(Kt&&i.ctrlKey){const e=Ut(t,!0);e&&e.focus(),i.preventDefault()}break;case"p":if(Kt&&i.ctrlKey){const e=Ut(t,!1);e&&e.focus(),i.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&_t(e)&&e.closest("details")===t&&(i.preventDefault(),i.stopPropagation(),e.click())}}}(t,this,e))),Rt(t,"toggle",(()=>Wt(t,this)),{once:!0}),Rt(t,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const i=e.closest("details");i&&i!==t&&!i.contains(t)&&i.removeAttribute("open")}}(t))),this.preload?Rt(t,"mouseover",(()=>Wt(t,this)),{once:!0}):Vt,...Bt(t)];qt.set(this,{subscriptions:i,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=qt.get(this);if(t){qt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const qt=new WeakMap,Vt={unsubscribe(){}};function Rt(t,e,i,n=!1){return t.addEventListener(e,i,n),{unsubscribe:()=>{t.removeEventListener(e,i,n)}}}function Wt(t,e){const i=e.getAttribute("src");if(!i)return;const n=qt.get(e);if(!n)return;if(n.loaded)return;n.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",(()=>$t(t))),s.setAttribute("src",i))}function Bt(t){let e=!1;return[Rt(t,"mousedown",(()=>e=!0)),Rt(t,"keydown",(()=>e=!1)),Rt(t,"toggle",(()=>{t.hasAttribute("open")&&($t(t)||e||function(t){const e=document.activeElement;if(e&&_t(e)&&t.contains(e))return;const i=Ut(t,!0);i&&i.focus()}(t))}))]}function $t(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Ut(t,e){const i=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),n=document.activeElement,s=n instanceof HTMLElement?i.indexOf(n):-1,o=e?i[s+1]:i[s-1],r=e?i[0]:i[i.length-1];return o||r}const Kt=navigator.userAgent.match(/Macintosh/);function jt(t,e){const i=e.target;if(i instanceof Element&&i.closest("details")===t)if("click"===e.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const n=e.querySelector("input");if("LABEL"===e.tagName&&i===n)return;"LABEL"===e.tagName&&n&&!n.checked||zt(e,t)}else if("change"===e.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&zt(e,t)}}function zt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const i=t.closest("details-menu");if(!i)return;i.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const i=e.querySelector("[data-menu-button]");if(!i)return;const n=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(n)i.textContent=n;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(i.innerHTML=e)}}(t,e),function(t,e){for(const i of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=i.querySelector('input[type="radio"], input[type="checkbox"]');let n=(i===t).toString();e instanceof HTMLInputElement&&(n=e.indeterminate?"mixed":e.checked.toString()),i.setAttribute("aria-checked",n)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Zt(e),i.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function _t(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Zt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Yt(t,e){const i=qt.get(t);i&&(i.isComposing="compositionstart"===e.type)}var Gt,Jt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Xt=(()=>{const t=new Set;let e=null,i=null;function n(){for(const e of t)e.update()}return s=>{window.addEventListener("resize",n),window.addEventListener("scroll",n),e||(e=new IntersectionObserver((e=>{for(const i of e){const e=i.target;i.isIntersecting?(e.update(),t.add(e)):t.delete(e)}}))),i||(i=new ResizeObserver((()=>{for(const e of t)e.update()}))),i.observe(s.ownerDocument.documentElement),e.observe(s)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),Gt.set(this,null),Jt.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(b(this,Gt,"f"))return b(this,Gt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){v(this,Gt,t,"f"),b(this,Gt,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",(()=>this.update())),Xt(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,Jt,"f")),v(this,Jt,requestAnimationFrame((()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:i}=J(this,t,this);this.style.top=`${i}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"})),"f"))}}var Qt,te,ee;function ie(t){t.body.style.getPropertyValue("--dialog-scrollgutter")||t.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-t.body.clientWidth+"px")}function ne(t){t.body.classList.toggle("has-modal",Boolean(t.querySelector("dialog[open]"))),t.body.classList.toggle("has-modal-disable-scroll",Boolean(t.querySelector("dialog[open].Overlay--disableScroll")))}function se(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){const e=document.getElementById(n);if(e instanceof HTMLDialogElement){ie(e.ownerDocument),e.showModal(),t.preventDefault();let n=i,s=!1;for(;n;)n=n.parentElement?.closest("[popover]"),n&&"auto"===n.popover&&(n.classList.add("dialog-inside-popover-fix"),n.popover="manual",n.showPopover(),s=!0);s&&(e.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",(()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())}),{once:!0})),ne(e.ownerDocument)}}if(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n){const t=document.getElementById(n);t instanceof HTMLDialogElement&&t.open&&(t.close(),ne(t.ownerDocument))}}Gt=new WeakMap,Jt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),Qt.add(this),te.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,te,new AbortController,"f");document.addEventListener("click",se,!0),document.addEventListener("click",this,{signal:t}),this.dialog?.addEventListener("close",(()=>ne(this.dialog.ownerDocument)),{signal:t}),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&b(this,Qt,"m",ee).call(this)})).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,Qt,"m",ee).call(this)}disconnectedCallback(){b(this,te,"f")?.abort()}handleEvent(t){const e=t.target,i=this.dialog;if(e!==i||!i?.open)return;if(i.querySelector("form"))return;const n=i.getBoundingClientRect();n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width||i.close()}}te=new WeakMap,Qt=new WeakSet,ee=function(){if(!this.dialog)return;const{ownerDocument:t}=this.dialog;this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),this.dialog.close(),ie(t),this.dialog.showModal()),ne(t)},window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var oe=class extends Event{oldState;newState;constructor(t,{oldState:e="",newState:i="",...n}={}){super(t,n),this.oldState=String(e||""),this.newState=String(i||"")}},re=new WeakMap;function ae(t,e,i){re.set(t,setTimeout((()=>{re.has(t)&&t.dispatchEvent(new oe("toggle",{cancelable:!1,oldState:e,newState:i}))}),0))}var le=globalThis.ShadowRoot||function(){},ce=globalThis.HTMLDialogElement||function(){},de=new WeakMap,he=new WeakMap,ue=new WeakMap;function me(t){return ue.get(t)||"hidden"}var fe=new WeakMap;function pe(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===me(t))&&(!(!e&&"hidden"!==me(t))&&(!(t instanceof ce&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function ge(t){return t?Array.from(he.get(t.ownerDocument)||[]).indexOf(t)+1:0}function be(t){const e=ye(t),i=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||we(t))instanceof le&&(t=t.host),t instanceof Document)return}}(t);return ge(e)>ge(i)?e:i}function ve(t){const e=he.get(t);for(const t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function we(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?we(t.parentNode):t}function ye(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===ue.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||we(t))instanceof le&&(t=t.host),t instanceof Document)return}}function Ee(t){return!(t.hidden||t instanceof le)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function Ae(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(i=e.querySelector("[autofocus]"),i)return i}}}const n=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let s=n.currentNode;for(;s;){if(Ee(s))return s;s=n.nextNode()}})(t)?.focus()}var ke=new WeakMap;function Le(t){if(!pe(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new oe("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!pe(t,!1))return;let i=!1;if("auto"===t.popover){const i=t.getAttribute("popover");if(Ce(function(t){const e=new Map;let i=0;for(const n of he.get(t.ownerDocument)||[])e.set(n,i),i+=1;e.set(t,i),i+=1;let n=null;return function(t){const i=ye(t);if(null===i)return null;const s=e.get(i);(null===n||e.get(n)<s)&&(n=i)}(t.parentElement||we(t)),n}(t)||e,!1,!0),i!==t.getAttribute("popover")||!pe(t,!1))return}ve(e)||(i=!0),ke.delete(t);const n=e.activeElement;t.classList.add(":popover-open"),ue.set(t,"showing"),de.has(e)||de.set(e,new Set),de.get(e).add(t),Ae(t),"auto"===t.popover&&(he.has(e)||he.set(e,new Set),he.get(e).add(t),De(fe.get(t),!0)),i&&n&&"auto"===t.popover&&ke.set(t,n),ae(t,"closed","open")}function Te(t,e=!1,i=!1){if(!pe(t,!0))return;const n=t.ownerDocument;if("auto"===t.popover&&(Ce(t,e,i),!pe(t,!0)))return;if(De(fe.get(t),!1),fe.delete(t),i&&(t.dispatchEvent(new oe("beforetoggle",{oldState:"open",newState:"closed"})),!pe(t,!0)))return;de.get(n)?.delete(t),he.get(n)?.delete(t),t.classList.remove(":popover-open"),ue.set(t,"hidden"),i&&ae(t,"open","closed");const s=ke.get(t);s&&(ke.delete(t),e&&s.focus())}function Se(t,e=!1,i=!1){let n=ve(t);for(;n;)Te(n,e,i),n=ve(t)}function Ce(t,e,i){const n=t.ownerDocument||t;if(t instanceof Document)return Se(n,e,i);let s=null,o=!1;for(const e of he.get(n)||[])if(e===t)o=!0;else if(o){s=e;break}if(!o)return Se(n,e,i);for(;s&&"showing"===me(s)&&he.get(n)?.size;)Te(s,e,i)}var xe=new WeakMap;function Me(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const i=e.ownerDocument;if(!ve(i))return;const n=be(e);if(n&&"pointerdown"===t.type)xe.set(i,n);else if("pointerup"===t.type){const t=xe.get(i)===n;xe.delete(i),t&&Ce(n||i,!1,!0)}}var Ie=new WeakMap;function De(t,e=!1){if(!t)return;Ie.has(t)||Ie.set(t,t.getAttribute("aria-expanded"));const i=t.popoverTargetElement;if(i instanceof HTMLElement&&"auto"===i.popover)t.setAttribute("aria-expanded",String(e));else{const e=Ie.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var Pe=globalThis.ShadowRoot||function(){};function Ne(t,e,i){const n=t[e];Object.defineProperty(t,e,{value(t){return n.call(this,i(t))}})}var He=/(^|[^\\]):popover-open\b/g;function Fe(){const t="function"==typeof globalThis.CSSLayerBlockRule;return`\n${t?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${t?"}":""}\n`}var Oe,qe,Ve,Re,We=null;function Be(t){const e=Fe();if(null===We)try{(We=new CSSStyleSheet).replaceSync(e)}catch{We=!1}if(!1===We){const i=document.createElement("style");i.textContent=e,t instanceof Document?t.head.prepend(i):t.prepend(i)}else t.adoptedStyleSheets=[We,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){if("undefined"==typeof window)return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(He,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||oe,Ne(Document.prototype,"querySelector",t),Ne(Document.prototype,"querySelectorAll",t),Ne(Element.prototype,"querySelector",t),Ne(Element.prototype,"querySelectorAll",t),Ne(Element.prototype,"matches",t),Ne(Element.prototype,"closest",t),Ne(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){Le(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Te(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===ue.get(this)&&void 0===t||!1===t?Te(this,!0,!0):void 0!==t&&!0!==t||Le(this)}}});const e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const i=e.call(this,t);return Be(i),i}}});const i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=i.call(this);return t.shadowRoot&&Be(t.shadowRoot),t}}});const n=new WeakMap;function s(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),n.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),n.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=n.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return n.delete(this),null;const e=we(this),i=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof Pe)&&i&&e.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}s(HTMLButtonElement),s(HTMLInputElement);const o=t=>{const e=t.composedPath(),i=e[0];if(!(i instanceof Element)||i?.shadowRoot)return;const n=we(i);if(!(n instanceof Pe||n instanceof Document))return;const s=e.find((t=>t.matches?.("[popovertargetaction],[popovertarget]")));return s?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const i=me(e);"show"===t.popoverTargetAction&&"showing"===i||"hide"===t.popoverTargetAction&&"hidden"===i||("showing"===i?Te(e,!0,!0):pe(e,!1)&&(fe.set(e,t),Le(e)))}(s),void t.preventDefault()):void 0},r=t=>{const e=t.key,i=t.target;t.defaultPrevented||!i||"Escape"!==e&&"Esc"!==e||Ce(i.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",o),t.addEventListener("keydown",r),t.addEventListener("pointerdown",Me),t.addEventListener("pointerup",Me)})(document),Be(document)}();const $e=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),Ue=t=>t.textContent?.trim()[0].toLowerCase(),Ke=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),Oe.add(this),qe.set(this,null),Ve.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){v(this,Ve,new AbortController,"f");const{signal:t}=b(this,Ve,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){b(this,Ve,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:i}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches($e)){b(this,qe,"f")?.abort();const{signal:e}=v(this,qe,new AbortController,"f");for(const i of b(this,Oe,"a",Re)){i.setAttribute("tabindex",i===t.target?"0":"-1");const n=t.target.closest("[popover]");i===t.target&&"auto"===n?.popover&&n.closest("focus-group")===this&&n.addEventListener("toggle",(t=>{if(t.target instanceof Element&&"closed"===t.newState&&(b(this,qe,"f")?.abort(),i.setAttribute("tabindex","-1"),n.id)){const t=this.querySelector(`[popovertarget="${n.id}"]`);t?t.setAttribute("tabindex","0"):b(this,Oe,"a",Re)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const n=Array.from(b(this,Oe,"a",Re));let s=n.indexOf(t.target);const o=t.key;if("Up"===o||"ArrowUp"===o)"vertical"!==e&&"both"!==e||(s-=s<0?0:1,t.preventDefault());else if("Down"===o||"ArrowDown"===o)"vertical"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(s-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)s=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)s=n.length-1,t.preventDefault();else{if(!this.mnemonics||!Ke.test(o))return;{const e=o.toLowerCase(),r=s>0&&Ue(t.target)===e?s:0;s=n.findIndex(((t,i)=>i>r&&Ue(t)===e)),s<0&&!i&&(s=n.findIndex((t=>Ue(t)===e)))}}i&&s<0&&(s=0),!i&&s>=n.length&&(s=0);const r=n.at(Math.min(s,n.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}qe=new WeakMap,Ve=new WeakMap,Oe=new WeakSet,Re=function(){return this.querySelectorAll($e)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let je=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver((t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth})),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};g([I],je.prototype,"hasOverflow",void 0),g([I],je.prototype,"labelledBy",void 0),je=g([j("scrollable-region")],je),window.ScrollableRegionElement=je;const ze=(t,e,i)=>{if(e())i();else{const n=new MutationObserver((()=>{e()&&(i(),n.disconnect())}));n.observe(t,{childList:!0,subtree:!0})}};var _e,Ze,Ye,Ge;function Je(t){document.activeElement!==t&&t?.focus()}const Xe=[];function Qe(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){t.stopPropagation();const e=document.getElementById(n);if(e instanceof ModalDialogElement)return e.openButton=i,e.show(),void t.preventDefault()}if(Xe.length&&(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n)){const t=document.getElementById(n);if(t instanceof ModalDialogElement){const e=Xe.findIndex((t=>t.id===n));Xe.splice(e,1),t.close(i.hasAttribute("data-submit-dialog-id"))}}}function ti(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||Qe(t)}function ei(t){const e=t.target;if(e?.closest("button"))return;const i=Xe[Xe.length-1];if(!i)return;!e.closest(`#${i.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Xe.pop(),i.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),_e.add(this),Ze.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",b(this,_e,"a",Ye)?.classList.remove("Overlay--hidden"),b(this,Ze,"f").signal.aborted&&v(this,Ze,new AbortController,"f"),ut(this,this.querySelector("[autofocus]"),b(this,Ze,"f").signal),Xe.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,_e,"a",Ye)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,Ze,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");Je(t?nt(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",Qe),document.addEventListener("keydown",ti),document.addEventListener("mousedown",ei),this.addEventListener("keydown",(t=>b(this,_e,"m",Ge).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var ii,ni,si,oi,ri,ai,li,ci;Ze=new WeakMap,_e=new WeakSet,Ye=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},Ge=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let di=class NavListElement extends HTMLElement{constructor(){super(...arguments),ii.add(this),ni.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,ni,new _(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&b(this,ni,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=b(this,ii,"m",si).call(this,t);return!!e&&(b(this,ii,"m",ai).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=b(this,ii,"m",oi).call(this,t);return!!e&&(b(this,ii,"m",ai).call(this,e),!0)}selectItemByCurrentLocation(){const t=b(this,ii,"m",ri).call(this);return!!t&&(b(this,ii,"m",ai).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const i=e.closest("button");i&&(this.itemIsExpanded(i)?this.collapseItem(i):this.expandItem(i),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let i=e.closest("button");if(!i){const t=e.getAttribute("aria-labelledby");if(!t)return;i=document.getElementById(t)}this.itemIsExpanded(i)&&"Escape"===t.key&&this.collapseItem(i),t.stopPropagation()}};var hi,ui,mi;ni=new WeakMap,ii=new WeakSet,si=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},oi=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},ri=function(){return b(this,ii,"m",oi).call(this,window.location.pathname)},ai=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&b(this,ii,"m",li).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const i=b(this,ii,"m",ci).call(this,t);i&&(this.expandItem(i),i.classList.add("ActionListContent--hasActiveSubItem"))},li=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,ii,"m",ci).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},ci=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([K],di.prototype,"items",void 0),g([U],di.prototype,"topLevelList",void 0),di=g([j("nav-list")],di);let fi=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),hi.add(this),mi.set(this,new _(this))}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const i=await fetch(t);if(!i.ok)return;e=await i.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=b(this,hi,"m",ui).call(this,document,e);i?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const n=t.target.closest("button").getAttribute("data-list-id");document.getElementById(n).append(i),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var pi,gi;mi=new WeakMap,hi=new WeakSet,ui=function(t,e){const i=t.createElement("template");return i.innerHTML=e,t.importNode(i.content,!0)},g([U],fi.prototype,"showMoreItem",void 0),g([K],fi.prototype,"focusMarkers",void 0),fi=g([j("nav-list-group")],fi),window.NavListGroupElement=fi;let bi=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),pi.add(this)}connectedCallback(){b(this,pi,"m",gi).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true"),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:e,checked:!1,value:e.querySelector(".Button-label")?.textContent}}))}get current(){return this.querySelector("[aria-current=true]")}};pi=new WeakSet,gi=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([K],bi.prototype,"items",void 0),bi=g([j("segmented-control")],bi),window.customElements.get("segmented-control")||(window.SegmentedControlElement=bi,window.customElements.define("segmented-control",bi));let vi=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),this.turbo=!1,this.toggling=!1}get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("data-csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.isRemote())return this.performToggle(),void(this.toggling=!1);this.performToggle(),this.setLoadingState();try{await this.submitForm()}catch(t){return void(t instanceof Error&&(this.setErrorState(t.message||"An error occurred, please try again."),this.performToggle()))}finally{this.toggling=!1}this.setSuccessState()}}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-pressed")}isOff(){return!this.isOn()}isDisabled(){return null!=this.switch.getAttribute("disabled")}disable(){this.switch.setAttribute("disabled","disabled")}enable(){this.switch.removeAttribute("disabled")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden");const t=new CustomEvent("toggleSwitchLoading",{bubbles:!0});this.dispatchEvent(t)}setSuccessState(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden")}async submitForm(){const t=new FormData;if(this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0"),!this.src)throw new Error("invalid src");let e;const i={"Requested-With":"XMLHttpRequest","X-Requested-With":"XMLHttpRequest"};this.turbo&&(i.Accept="text/vnd.turbo-stream.html");try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:i,body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());const n=e.headers.get("Content-Type");window.Turbo&&this.turbo&&n?.startsWith("text/vnd.turbo-stream.html")&&window.Turbo.renderStreamMessage(await e.text())}};var wi,yi,Ei,Ai,ki,Li,Ti,Si,Ci,xi,Mi,Ii;g([U],vi.prototype,"switch",void 0),g([U],vi.prototype,"loadingSpinner",void 0),g([U],vi.prototype,"errorIcon",void 0),g([I],vi.prototype,"turbo",void 0),vi=g([j("toggle-switch")],vi),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=vi,window.customElements.define("toggle-switch",vi));const Di=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),Pi="sr-only",Ni=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Hi(t){for(const e of Vi)e!==t&&(Di(e)?e.hidePopover():Vi.delete(e))}function Fi(){Hi()}function Oi(t){setTimeout((()=>{for(const e of Vi)Di(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const qi=new Set,Vi=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),wi.add(this),yi.set(this,void 0),Ei.set(this,"center"),Ai.set(this,"outside-bottom"),ki.set(this,!1),Li.set(this,"mouse"),Ti.set(this,!1)}styles(){return'\n :host {\n --tooltip-top: var(--tool-tip-position-top, 0);\n --tooltip-left: var(--tool-tip-position-left, 0);\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: min(var(--overlay-width-small), 100vw);\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 '}get showReason(){return b(this,Li,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&Di(this)?this.hidePopover():t||Di(this)||this.showPopover()}get hiddenFromView(){return!Di(this)}connectedCallback(){if(qi.add(this),b(this,wi,"m",xi).call(this),b(this,wi,"m",Mi).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}b(this,wi,"m",Si).call(this,!1),v(this,ki,!0,"f"),b(this,wi,"m",Ci).call(this)}disconnectedCallback(){qi.delete(this),Vi.delete(this),b(this,yi,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=Di(this);"beforetoggle"===t.type&&t.currentTarget!==this&&v(this,Ti,"open"===t.newState,"f");const i=("mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")))&&!b(this,Ti,"f"),n="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,s="keydown"===t.type&&"Escape"===t.key,o="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this&&"open"===t.newState,a=n||s||o||r;e&&s&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!i||Di(this)?e&&a&&Di(this)&&this.hidePopover():(v(this,Li,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&b(this,wi,"m",Si).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("for"===t?b(this,wi,"m",Ci).call(this):"id"===t||"data-type"===t?b(this,wi,"m",xi).call(this):"data-direction"===t&&b(this,wi,"m",Mi).call(this))}}var Ri,Wi;yi=new WeakMap,Ei=new WeakMap,Ai=new WeakMap,ki=new WeakMap,Li=new WeakMap,Ti=new WeakMap,wi=new WeakSet,Si=function(t){t?(Vi.add(this),this.classList.remove(Pi),Hi(this),b(this,wi,"m",Ii).call(this)):(Vi.delete(this),this.classList.remove(...Ni),this.classList.add(Pi))},Ci=function(){if(!this.control)return;this.setAttribute("role","tooltip"),b(this,yi,"f")?.abort(),v(this,yi,new AbortController,"f");const{signal:t}=b(this,yi,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",Fi),this.ownerDocument.addEventListener("focusin",Oi),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})},xi=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Mi=function(){this.classList.remove(...Ni);const t=this.direction;"n"===t?(v(this,Ei,"center","f"),v(this,Ai,"outside-top","f")):"ne"===t?(v(this,Ei,"end","f"),v(this,Ai,"outside-top","f")):"e"===t?(v(this,Ei,"center","f"),v(this,Ai,"outside-right","f")):"se"===t?(v(this,Ei,"end","f"),v(this,Ai,"outside-bottom","f")):"s"===t?(v(this,Ei,"center","f"),v(this,Ai,"outside-bottom","f")):"sw"===t?(v(this,Ei,"start","f"),v(this,Ai,"outside-bottom","f")):"w"===t?(v(this,Ei,"center","f"),v(this,Ai,"outside-left","f")):"nw"===t&&(v(this,Ei,"start","f"),v(this,Ai,"outside-top","f"))},Ii=function(){if(!this.control)return;if(!b(this,ki,"f")||!Di(this))return;const t=J(this,this.control,{side:b(this,Ai,"f"),align:b(this,Ei,"f"),anchorOffset:0}),e=t.anchorSide,i=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let n="s";n="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===i?"n":"start"===i?"ne":"nw":"center"===i?"s":"start"===i?"se":"sw",this.classList.add(`tooltip-${n}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id","for"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let Bi=class XBannerElement extends HTMLElement{constructor(){super(...arguments),Ri.add(this)}dismiss(){if("remove"===b(this,Ri,"a",Wi)){const t=this.parentElement;if(!t)return;t.removeChild(this)}else this.hide();this.dispatchEvent(new CustomEvent("banner:dismiss"))}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};Ri=new WeakSet,Wi=function(){return this.getAttribute("data-dismiss-scheme")},g([U],Bi.prototype,"titleText",void 0),Bi=g([j("x-banner")],Bi),window.customElements.get("x-banner")||(window.XBannerElement=Bi,window.customElements.define("x-banner",Bi));class $i{constructor(t,e,{tabInsertsSuggestions:i,defaultFirstOption:n}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.defaultFirstOption=null!=n&&n,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!e.ctrlBindings&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":Ki(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Ki(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const i=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!i)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Ui),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Ui)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(ji)[0])||void 0===t||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(ji)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(ji),n=i.indexOf(e);if(n===i.length-1&&1===t||0===n&&-1===t)return this.clearSelection(),void this.input.focus();let s=1===t?0:i.length-1;if(e&&n>=0){const e=n+t;e>=0&&e<i.length&&(s=e)}const o=i[s];if(o)for(const t of i)t.removeAttribute("data-combobox-option-default"),o===t?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),zi(this.list,o)):t.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Ui(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t,e){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:e}))}(e,{event:t})}function Ki(t,e){const i=e.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return!!i&&("true"===i.getAttribute("aria-disabled")||i.click(),!0)}function ji(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function zi(t,e){(function(t,e){const i=t.scrollTop,n=i+t.clientHeight,s=e.offsetTop,o=s+e.clientHeight;return s>=i&&o<=n})(t,e)||(t.scrollTop=e.offsetTop)}const _i=window.testScreenReaderDelay||100;class Zi{constructor(t,e,i,n=!1){var s;if(this.container=t,this.input=e,this.results=i,this.combobox=new $i(e,i,{defaultFirstOption:n}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=n,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let i;return function(...n){clearTimeout(i),i=window.setTimeout((()=>{clearTimeout(i),t(...n)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if("Escape"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.close(),e instanceof HTMLAnchorElement)return;const i=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=i,i||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),_i)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void this.close();const e=this.container.src;if(!e)return;const i=new URL(e,window.location.href),n=new URLSearchParams(i.search.slice(1));n.append("q",t),i.search=n.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(i).then((t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),i=!!e.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,n=e.length,[s]=e,o=null==s?void 0:s.textContent;this.autoselectEnabled&&o?this.updateFeedbackForScreenReaders(`${n} results. ${o} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${n||"No"} results.`),i?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var Yi,Gi,Ji,Xi,Qi,tn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},en=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},nn=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const sn=globalThis.HTMLElement||null;class on extends Event{constructor(t,e){var{relatedTarget:i}=e;super(t,nn(e,["relatedTarget"])),this.relatedTarget=i}}const rn=new WeakMap;let an=null;class AutoCompleteElement extends sn{constructor(){super(...arguments),Yi.add(this),Gi.set(this,null),Ji.set(this,null),Qi.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){an=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=tn(this,Gi,"f"))||void 0===t?void 0:t.isConnected)return tn(this,Gi,"f");const e=this.getAttribute("for"),i=this.getRootNode();return e&&(i instanceof Document||i instanceof ShadowRoot)?i.getElementById(e):null}set forElement(t){en(this,Gi,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=tn(this,Ji,"f"))||void 0===t?void 0:t.isConnected)?tn(this,Ji,"f"):this.querySelector("input")}set inputElement(t){en(this,Ji,t,"f"),tn(this,Yi,"m",Xi).call(this)}connectedCallback(){this.isConnected&&(tn(this,Yi,"m",Xi).call(this),new MutationObserver((()=>{rn.get(this)||tn(this,Yi,"m",Xi).call(this)})).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=rn.get(this);t&&(t.destroy(),rn.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;null===(e=tn(this,Qi,"f"))||void 0===e||e.abort();const{signal:i}=en(this,Qi,new AbortController,"f"),n=await fetch(t.toString(),{signal:i,headers:{Accept:"text/fragment+html"}});if(!n.ok)throw new Error(await n.text());if(an){return(await an).createHTML(await n.text(),n)}return await n.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,i){var n,s;if(e===i)return;const o=rn.get(this);if(o)switch(this.forElement===(null===(n=rn.get(this))||void 0===n?void 0:n.results)&&this.inputElement===(null===(s=rn.get(this))||void 0===s?void 0:s.input)||tn(this,Yi,"m",Xi).call(this),t){case"open":null===i?o.close():o.open();break;case"value":null!==i&&(o.input.value=i),this.dispatchEvent(new on("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}Gi=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,Yi=new WeakSet,Xi=function(){var t;null===(t=rn.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:i}=this;if(!e||!i)return;const n="true"===this.getAttribute("data-autoselect");rn.set(this,new Zi(this,i,e,n)),e.setAttribute("role","listbox")};const ln="undefined"!=typeof globalThis?globalThis:window;try{ln.AutocompleteElement=ln.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(ln.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function cn(t){const e=function(t){return t.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g," ").replace(/[\u200B-\u200D\u2060\uFEFF\u180E]/g,"")}(t);if("clipboard"in navigator)return navigator.clipboard.writeText(e);const i=document.body;if(!i)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(e);return i.appendChild(n),function(t){const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const i=document.createRange();i.selectNodeContents(t),e.addRange(i),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}(n),i.removeChild(n),Promise.resolve()}async function dn(t){const e=t.getAttribute("for"),i=t.getAttribute("value");function n(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var s;if("true"!==t.getAttribute("aria-disabled"))if(i)await cn(i),n();else if(e){const i="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const o=i.getElementById(e);o&&(await(s=o,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?cn(s.value):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?cn(s.href):function(t){return cn(t.textContent||"")}(s)),n())}}function hn(t){const e=t.currentTarget;e instanceof HTMLElement&&dn(e)}function un(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),dn(e))}}function mn(t){t.currentTarget.addEventListener("keydown",un)}function fn(t){t.currentTarget.removeEventListener("keydown",un)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",hn),this.addEventListener("focus",mn),this.addEventListener("blur",fn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const pn="undefined"!=typeof globalThis?globalThis:window;try{pn.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(pn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function gn(t){t.style.display="inline-block"}function bn(t){t.style.display="none"}const vn=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=vn.get(t),i=t.parentNode?.querySelector("[data-clipboard-copy-feedback]"),n="Copied!";e?(clearTimeout(e),vn.delete(t)):(!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(bn(e),gn(i))}(t),i&&(i.textContent===n?i.textContent=`${n} `:i.textContent=n)),vn.set(t,setTimeout((()=>{!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(gn(e),bn(i))}(t),vn.delete(t)}),2e3))}));var wn,yn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},En=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};const An="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const i of t)e.push({type:"element",value:i}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},kn=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Ln={minimumIntegerDigits:2};class Tn{constructor(t,e={}){wn.set(this,void 0);let i=String(e.style||"short");"long"!==i&&"short"!==i&&"narrow"!==i&&"digital"!==i&&(i="short");let n="digital"===i?"numeric":i;const s=e.hours||n;n="2-digit"===s?"numeric":s;const o=e.minutes||n;n="2-digit"===o?"numeric":o;const r=e.seconds||n;n="2-digit"===r?"numeric":r;const a=e.milliseconds||n;yn(this,wn,{locale:t,style:i,years:e.years||"digital"===i?"short":i,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===i?"short":i,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===i?"short":i,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===i?"short":i,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:s,hoursDisplay:"always"===e.hoursDisplay||"digital"===i?"always":"auto",minutes:o,minutesDisplay:"always"===e.minutesDisplay||"digital"===i?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===i?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return En(this,wn,"f")}formatToParts(t){const e=[],i=En(this,wn,"f"),n=i.style,s=i.locale;for(const[o,r]of kn){const a=t[o];if("auto"===i[`${o}Display`]&&!a)continue;const l=i[o],c="2-digit"===l?Ln:"numeric"===l?{}:{style:"unit",unit:r,unitDisplay:l};let d=new Intl.NumberFormat(s,c).format(a);"months"===o&&("narrow"===l||"narrow"===n&&d.endsWith("m"))&&(d=d.replace(/(\d+)m$/,"$1mo")),e.push(d)}return new An(s,{type:"unit",style:"digital"===n?"short":n}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}wn=new WeakMap;const Sn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Cn=["year","month","week","day","hour","minute","second","millisecond"];class xn{constructor(t=0,e=0,i=0,n=0,s=0,o=0,r=0,a=0){this.years=t,this.months=e,this.weeks=i,this.days=n,this.hours=s,this.minutes=o,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new xn(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))}static from(t){var e;if("string"==typeof t){const i=String(t).trim(),n=i.startsWith("-")?-1:1,s=null===(e=i.match(Sn))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*n));return s?new xn(...s):new xn}if("object"==typeof t){const{years:e,months:i,weeks:n,days:s,hours:o,minutes:r,seconds:a,milliseconds:l}=t;return new xn(e,i,n,s,o,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const i=Date.now(),n=Math.abs(Mn(i,xn.from(t)).getTime()-i),s=Math.abs(Mn(i,xn.from(e)).getTime()-i);return n>s?-1:n<s?1:0}toLocaleString(t,e){return new Tn(t,e).format(this)}}function Mn(t,e){const i=new Date(t);return e.sign<0?(i.setUTCSeconds(i.getUTCSeconds()+e.seconds),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCFullYear(i.getUTCFullYear()+e.years)):(i.setUTCFullYear(i.getUTCFullYear()+e.years),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCSeconds(i.getUTCSeconds()+e.seconds)),i}function In(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const i=t.sign;let n=Math.abs(t.years),s=Math.abs(t.months),o=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),d=Math.abs(t.milliseconds);d>=900&&(c+=Math.round(d/1e3)),(c||l||a||r||o||s||n)&&(d=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||o||s||n)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||o||s||n)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||o||s||n)&&(a=0);const h=e.getFullYear(),u=e.getMonth(),m=e.getDate();if(r>=27||n+s+r){const t=new Date(e);t.setDate(1),t.setMonth(u+s*i+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(h+n*i),l.setDate(m-a),l.setMonth(u+s*i),l.setDate(m-a+r*i);const c=l.getFullYear()-e.getFullYear(),d=l.getMonth()-e.getMonth(),f=Math.abs(Math.round((Number(l)-Number(e))/864e5))+a,p=Math.abs(12*c+d);f<27?(r>=6?(o+=Math.round(r/7),r=0):r=f,s=n=0):p<=11?(s=p,n=0):(s=0,n=c*i),(s||n)&&(r=0)}return n&&(s=0),o>=4&&(s+=Math.round(o/4)),(s||n)&&(o=0),r&&o&&!s&&!n&&(o+=Math.round(r/7),r=0),new xn(n*i,s*i,o*i,r*i,a*i,l*i,c*i,d*i)}var Dn,Pn,Nn,Hn,Fn,On,qn,Vn,Rn,Wn,Bn,$n,Un,Kn,jn,zn,_n=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Zn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const Yn=globalThis.HTMLElement||null,Gn=new xn,Jn=new xn(0,0,0,0,0,1);class Xn extends Event{constructor(t,e,i,n){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=i,this.newTitle=n}}function Qn(t){if(!t.date)return 1/0;if("duration"===t.format||"elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const ts=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=Qn(t),i=Date.now()+e;i<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=i)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,Qn(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends Yn{constructor(){super(...arguments),Dn.add(this),Pn.set(this,!1),Nn.set(this,!1),Fn.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),zn.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}get timeZone(){var t;return(null===(t=this.closest("[time-zone]"))||void 0===t?void 0:t.getAttribute("time-zone"))||this.ownerDocument.documentElement.getAttribute("time-zone")||void 0}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title","aria-hidden","time-zone"]}get onRelativeTimeUpdated(){return _n(this,zn,"f")}set onRelativeTimeUpdated(t){_n(this,zn,"f")&&this.removeEventListener("relative-time-updated",_n(this,zn,"f")),Zn(this,zn,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,Sn.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return Cn.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){ts.unobserve(this)}attributeChangedCallback(t,e,i){e!==i&&("title"===t&&Zn(this,Pn,null!==i&&(this.date&&_n(this,Dn,"m",On).call(this,this.date))!==i,"f"),_n(this,Nn,"f")||"title"===t&&_n(this,Pn,"f")||Zn(this,Nn,(async()=>{await Promise.resolve(),this.update(),Zn(this,Nn,!1,"f")})(),"f"))}update(){const t=_n(this,Fn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let i=e;const n=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!n)return void(_n(this,Fn,"f").textContent=t);const s=Date.now();_n(this,Pn,"f")||(i=_n(this,Dn,"m",On).call(this,n)||"",i&&!this.noTitle&&this.setAttribute("title",i));const o=function(t,e="second",i=Date.now()){const n=t.getTime()-i;if(0===n)return new xn;const s=Math.sign(n),o=Math.abs(n),r=Math.floor(o/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),d=Math.floor(c/30),h=Math.floor(d/12),u=Cn.indexOf(e)||Cn.length;return new xn(u>=0?h*s:0,u>=1?(d-12*h)*s:0,0,u>=3?(c-30*d)*s:0,u>=4?(l-24*c)*s:0,u>=5?(a-60*l)*s:0,u>=6?(r-60*a)*s:0,u>=7?(o-1e3*r)*s:0)}(n,this.precision,s),r=_n(this,Dn,"m",qn).call(this,o);let a=t;const l=_n(this,Dn,"m",jn).call(this,r);a=l?_n(this,Dn,"m",Un).call(this,n):"duration"===r?_n(this,Dn,"m",Vn).call(this,o):"relative"===r?_n(this,Dn,"m",Rn).call(this,o):_n(this,Dn,"m",Wn).call(this,n),a?_n(this,Dn,"m",Kn).call(this,a):this.shadowRoot===_n(this,Fn,"f")&&this.textContent&&_n(this,Dn,"m",Kn).call(this,this.textContent),a===t&&i===e||this.dispatchEvent(new Xn(t,a,e,i));"relative"===r||"duration"===r||l&&(_n(this,Dn,"m",Bn).call(this,n)||_n(this,Dn,"m",$n).call(this,n))?ts.observe(this):ts.unobserve(this)}}Pn=new WeakMap,Nn=new WeakMap,Fn=new WeakMap,zn=new WeakMap,Dn=new WeakSet,Hn=function(){var t;const e=(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(null!=e?e:"").toString()}catch(t){return"default"}},On=function(t){return new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone}).format(t)},qn=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===xn.compare(t,this.threshold))return"relative"}return"datetime"},Vn=function(t){const e=_n(this,Dn,"a",Hn),i=this.format,n=this.formatStyle,s=this.tense;let o=Gn;"micro"===i?(t=In(t),o=Jn,0===t.months&&("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=Jn)):("past"===s&&-1!==t.sign||"future"===s&&1!==t.sign)&&(t=o);const r=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:n,[r]:"always"}):t.abs().toLocaleString(e,{style:n})},Rn=function(t){const e=new Intl.RelativeTimeFormat(_n(this,Dn,"a",Hn),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=Gn),"past"===i&&-1!==t.sign&&(t=Gn);const[n,s]=function(t,e){const i=In(t,e);if(i.blank)return[0,"second"];for(const t of Cn){if("millisecond"===t)continue;const e=i[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===s&&n<10?e.format(0,"millisecond"===this.precision?"second":this.precision):e.format(n,s)},Wn=function(t){const e=new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:this.timeZone});return`${this.prefix} ${e.format(t)}`.trim()},Bn=function(t){const e=new Date,i=new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),{timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit"});return i.format(e)===i.format(t)},$n=function(t){const e=new Date,i=new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),{timeZone:this.timeZone,year:"numeric"});return i.format(e)===i.format(t)},Un=function(t){const e={hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone};if(_n(this,Dn,"m",Bn).call(this,t)){let i=new Intl.RelativeTimeFormat(_n(this,Dn,"a",Hn),{numeric:"auto"}).format(0,"day");i=i.charAt(0).toLocaleUpperCase(_n(this,Dn,"a",Hn))+i.slice(1);return`${i} ${new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),e).format(t)}`}const i=Object.assign(Object.assign({},e),{day:"numeric",month:"short"});return _n(this,Dn,"m",$n).call(this,t)?new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),i).format(t):new Intl.DateTimeFormat(_n(this,Dn,"a",Hn),Object.assign(Object.assign({},i),{year:"numeric"})).format(t)},Kn=function(t){if(this.hasAttribute("aria-hidden")&&"true"===this.getAttribute("aria-hidden")){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=t,_n(this,Fn,"f").replaceChildren(e)}else _n(this,Fn,"f").textContent=t},jn=function(t){var e;return"duration"!==t&&("true"===this.ownerDocument.documentElement.getAttribute("data-prefers-absolute-time")||"true"===(null===(e=this.ownerDocument.body)||void 0===e?void 0:e.getAttribute("data-prefers-absolute-time")))};const es="undefined"!=typeof globalThis?globalThis:window;try{es.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(es.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function is(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const i=t.target;if(!(i instanceof HTMLElement))return;if(i.closest(this.tagName)!==this)return;if("tab"!==i.getAttribute("role")&&!i.closest('[role="tablist"]'))return;const n=is(this),s=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,r]="vertical"===(null===(e=i.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=s+1;t>=n.length&&(t=0),this.selectTab(t)}else if(r.some((e=>t.code===e))){let t=s-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=is(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const i=t.target.closest('[role="tab"]');if(!(i instanceof HTMLElement&&i.closest('[role="tablist"]')))return;const n=e.indexOf(i);this.selectTab(n)}));for(const t of is(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=is(this),i=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const n=e[t],s=i[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),n.focus(),s.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}}const ns="undefined"!=typeof globalThis?globalThis:window;try{ns.TabContainerElement=TabContainerElement.define()}catch(t){if(!(ns.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let ss=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function os(t,e=0,{start:i=!1,middle:n=!1,once:s=!1}={}){return function(t,e=0,{start:i=!0,middle:n=!0,once:s=!1}={}){let o,r=0,a=!1;function l(...c){if(a)return;const d=Date.now()-r;r=Date.now(),i?(i=!1,t.apply(this,c),s&&l.cancel()):(n&&d<e||!n)&&(clearTimeout(o),o=setTimeout((()=>{r=Date.now(),t.apply(this,c),s&&l.cancel()}),n?e-d:e))}return l.cancel=()=>{clearTimeout(o),a=!0},l}(t,e,{start:i,middle:n,once:s})}g([K],ss.prototype,"fields",void 0),ss=g([j("primer-multi-input")],ss),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:ss}),window.customElements.define("primer-multi-input",ss));var rs,as,ls=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},cs=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};!function(t){t.GET="GET",t.POST="POST"}(as||(as={}));const ds=new WeakMap;class hs extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class us extends hs{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class ms extends hs{constructor(){super("complete")}}class fs extends hs{constructor(t){super("success"),this.response=t}}class ps extends us{constructor(){super("start","Verifying…")}}class gs extends us{constructor(t){super("error","Validation failed"),this.response=t}}class bs extends hs{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),rs.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return ls(this,rs,"f")}set onloadend(t){ls(this,rs,"f")&&this.removeEventListener("loadend",ls(this,rs,"f")),cs(this,rs,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("loadend",t)}connectedCallback(){const t=this.input;if(!t)return;const e=os(ys.bind(null,this),300),i={check:e,controller:null};ds.set(this,i);const n=vs.bind(null,e);t.addEventListener("blur",n),t.addEventListener("input",n),t.addEventListener("triggervalidation",n),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=ds.get(this);e&&(ds.delete(this),t.removeEventListener("input",ws),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}triggerValidation(){const t=this.input;t&&t.dispatchEvent(new CustomEvent("triggervalidation"))}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}get httpMethod(){return as[this.getAttribute("http-method")]||"POST"}set validateOnKeystroke(t){t?this.setAttribute("validate-on-keystroke",""):this.removeAttribute("validate-on-keystroke")}get validateOnKeystroke(){const t=this.getAttribute("validate-on-keystroke");return"true"===t||""===t}}function vs(t,e){const i=e.currentTarget;if(!(i instanceof HTMLInputElement))return;const n=i.closest("auto-check");n instanceof AutoCheckElement&&("input"===e.type&&n.setAttribute("dirty",""),0!==i.value.length&&("blur"===e.type&&!n.validateOnKeystroke&&n.hasAttribute("dirty")||"input"===e.type&&n.validateOnKeystroke||"triggervalidation"===e.type)&&(ws(e),t()))}function ws(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const i=e.closest("auto-check");if(!(i instanceof AutoCheckElement))return;const n=i.src,s=i.csrf,o=i.httpMethod,r=ds.get(i);if(!n||"POST"===o&&!s||!r)return;const a=new ps;e.dispatchEvent(a),i.required&&e.setCustomValidity(a.message)}async function ys(t){const e=t.input;if(!e)return;const i=t.csrfField,n=t.src,s=t.csrf,o=ds.get(t),r=t.httpMethod;if(!n||"POST"===r&&!s||!o)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const a=new FormData,l=new URL(n,window.location.origin);"POST"===r?(a.append(i,s),a.append("value",e.value)):l.search=new URLSearchParams({value:e.value}).toString(),e.dispatchEvent(new bs(a)),o.controller?o.controller.abort():t.dispatchEvent(new Event("loadstart")),o.controller="AbortController"in window?new AbortController:{signal:null,abort(){}},t.removeAttribute("dirty");try{const i=await async function(t,e,i){"GET"===i.method&&delete i.body;try{const n=await fetch(e,i);return t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend")),n}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new Event("error")),t.dispatchEvent(new Event("loadend"))),e}}(t,l.toString(),{credentials:"same-origin",signal:o.controller.signal,method:r,body:a});if(i.ok)t.required&&e.setCustomValidity(""),t.validateOnKeystroke=!1,e.dispatchEvent(new fs(i.clone()));else{t.validateOnKeystroke=!0;const n=new gs(i.clone());e.dispatchEvent(n),t.required&&e.setCustomValidity(n.message)}o.controller=null,e.dispatchEvent(new ms)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new ms))}}rs=new WeakMap;const Es="undefined"!=typeof globalThis?globalThis:window;try{Es.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(Es.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class As{constructor(t,e,i){this.inputElement=t,this.characterLimitElement=e,this.characterLimitSrElement=i,this.SCREEN_READER_DELAY=500,this.announceTimeout=null,this.isInitialLoad=!0}initialize(t){this.inputElement.addEventListener("keyup",(()=>this.updateCharacterCount()),t?{signal:t}:void 0),this.inputElement.addEventListener("paste",(()=>setTimeout((()=>this.updateCharacterCount()),50)),t?{signal:t}:void 0),this.updateCharacterCount(),this.isInitialLoad=!1}cleanup(){this.announceTimeout&&clearTimeout(this.announceTimeout)}pluralize(t,e){return 1===t?e:`${e}s`}updateCharacterCount(){if(!this.characterLimitElement)return;const t=this.characterLimitElement.getAttribute("data-max-length");if(!t)return;const e=parseInt(t,10)-this.inputElement.value.length;let i="";if(e>=0){i=`${e} ${this.pluralize(e,"character")} remaining`;const t=this.characterLimitElement.querySelector(".FormControl-caption-text");t&&(t.textContent=i),this.clearError()}else{const t=-e;i=`${t} ${this.pluralize(t,"character")} over`;const n=this.characterLimitElement.querySelector(".FormControl-caption-text");n&&(n.textContent=i),this.setError()}this.isInitialLoad||this.announceToScreenReader(i)}announceToScreenReader(t){this.announceTimeout&&clearTimeout(this.announceTimeout),this.announceTimeout=window.setTimeout((()=>{this.characterLimitSrElement&&(this.characterLimitSrElement.textContent=t)}),this.SCREEN_READER_DELAY)}setError(){this.inputElement.setAttribute("invalid","true"),this.inputElement.setAttribute("aria-invalid","true"),this.characterLimitElement.classList.add("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.removeAttribute("hidden")}clearError(){this.inputElement.removeAttribute("invalid"),this.inputElement.removeAttribute("aria-invalid"),this.characterLimitElement.classList.remove("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.setAttribute("hidden","")}}var ks,Ls;let Ts=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),ks.set(this,void 0),Ls.set(this,null)}connectedCallback(){b(this,ks,"f")?.abort();const{signal:t}=v(this,ks,new AbortController,"f");this.addEventListener("auto-check-success",(async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()}),{signal:t}),this.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:t}),this.characterLimitElement&&(v(this,Ls,new As(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Ls,"f").initialize(t))}disconnectedCallback(){b(this,ks,"f")?.abort(),b(this,Ls,"f")?.cleanup()}clearContents(){this.inputElement.value="",this.inputElement.focus(),this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const i=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(i)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}showLeadingSpinner(){this.leadingSpinner?.removeAttribute("hidden"),this.leadingVisual?.setAttribute("hidden","")}hideLeadingSpinner(){this.leadingSpinner?.setAttribute("hidden",""),this.leadingVisual?.removeAttribute("hidden")}};var Ss;ks=new WeakMap,Ls=new WeakMap,g([U],Ts.prototype,"inputElement",void 0),g([U],Ts.prototype,"validationElement",void 0),g([U],Ts.prototype,"validationMessageElement",void 0),g([U],Ts.prototype,"validationSuccessIcon",void 0),g([U],Ts.prototype,"validationErrorIcon",void 0),g([U],Ts.prototype,"leadingVisual",void 0),g([U],Ts.prototype,"leadingSpinner",void 0),g([U],Ts.prototype,"characterLimitElement",void 0),g([U],Ts.prototype,"characterLimitSrElement",void 0),Ts=g([j("primer-text-field")],Ts);let Cs=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Ss.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Ss,new As(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Ss,"f").initialize())}disconnectedCallback(){b(this,Ss,"f")?.cleanup()}};Ss=new WeakMap,g([U],Cs.prototype,"inputElement",void 0),g([U],Cs.prototype,"characterLimitElement",void 0),g([U],Cs.prototype,"characterLimitSrElement",void 0),Cs=g([j("primer-text-area")],Cs),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:Cs}),window.customElements.define("primer-text-area",Cs));let xs=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.textContent=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")})),this.addEventListener("toggleSwitchLoading",(()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")}))}};var Ms,Is,Ds,Ps,Ns,Hs,Fs,Os,qs,Vs,Rs,Ws,Bs,$s,Us,Ks,js,zs,_s,Zs,Ys,Gs,Js,Xs,Qs,to,eo,io,no,so,oo,ro,ao;g([U],xs.prototype,"validationElement",void 0),g([U],xs.prototype,"validationMessageElement",void 0),xs=g([j("toggle-switch-input")],xs);class lo{constructor(){Ms.add(this),Is.set(this,void 0),v(this,Is,[],"f")}get current(){return b(this,Is,"f")[b(this,Is,"f").length-1]}push(t,e={trapFocus:!0}){const{trapFocus:i}=e;b(this,Is,"f").push({element:t,abortController:b(this,Ms,"m",Ds).call(this,t,i)})}pop(t){if(t)for(;b(this,Is,"f").length>0&&this.current?.element!==t;){const t=b(this,Is,"f").pop();t?.abortController?.abort()}const e=b(this,Is,"f").pop();e?.abortController?.abort()}elementIsMenuItem(t){return b(this,Ms,"a",Ps).includes(t.getAttribute("role")||"")}get isEmpty(){return 0===b(this,Is,"f").length}}Is=new WeakMap,Ms=new WeakSet,Ds=function(t,e){const i=Tt(t,{bindKeys:gt.ArrowVertical|gt.ArrowHorizontal|gt.HomeAndEnd|gt.Backspace,focusOutBehavior:"wrap",focusableElementFilter:e=>this.elementIsMenuItem(e)&&e.closest("anchored-position")===t});if(e){const{signal:e}=i;return ut(t,void 0,e)}return i},Ps=function(){return co.validItemRoles};let co=ao=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),Ns.add(this),Hs.set(this,void 0),Fs.set(this,""),Os.set(this,""),qs.set(this,!1),Vs.set(this,void 0),Rs.set(this,void 0)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get childPopoverElements(){return Array.from(this.overlay.querySelectorAll("anchored-position"))}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const i of t){const t=i.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:i?.getAttribute("data-value"),element:i})}return e}connectedCallback(){const{signal:t}=v(this,Hs,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("toggle",this,{signal:t,capture:!0}),b(this,Ns,"m",io).call(this),b(this,Ns,"m",no).call(this),b(this,Ns,"m",Bs).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,Ns,"m",eo).call(this)&&this.overlay?.update()};v(this,Vs,new IntersectionObserver((t=>{for(const i of t){i.target===this.invokerElement&&(i.isIntersecting?window.addEventListener("scroll",e,{capture:!0}):window.removeEventListener("scroll",e,{capture:!0}))}})),"f"),ze(this,(()=>Boolean(this.invokerElement)),(()=>b(this,Vs,"f").observe(this.invokerElement))),this.includeFragment||this.setAttribute("data-ready","true");new MutationObserver((()=>b(this,Ns,"m",Ws).call(this))).observe(this,{childList:!0,subtree:!0}),b(this,Ns,"m",Ws).call(this),v(this,Rs,new lo,"f")}disconnectedCallback(){b(this,Hs,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),i=b(this,Ns,"m",js).call(this,t);if("toggle"===t.type&&t instanceof ToggleEvent)return void b(this,Ns,"m",_s).call(this,t);if(e&&"mousedown"===t.type)return void v(this,qs,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&i)return b(this,Ns,"m",Zs).call(this,t),void v(this,qs,!1,"f");if("focusout"===t.type){if(b(this,qs,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,Ns,"m",Xs).call(this)}))}const n=t.target.closest(ao.menuItemSelectors.join(",")),s=null!==n;if(s&&i){if(b(this,Ns,"m",$s).call(this,t))return;const e=n.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e))return void b(this,Ns,"m",Ys).call(this,t,i)}b(this,Ns,"m",Us).call(this,t)&&(t.preventDefault(),n.click());const i=b(this,Ns,"m",oo).call(this,n);return i?(t.preventDefault(),void i.showPopover()):void b(this,Ns,"m",Gs).call(this,n)}"include-fragment-replaced"!==t.type?s&&t instanceof KeyboardEvent&&b(this,Ns,"m",zs).call(this,t,n):b(this,Ns,"m",Js).call(this)}get items(){return Array.from(this.querySelectorAll(ao.menuItemSelectors.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||b(this,Ns,"m",Gs).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&b(this,Ns,"m",Gs).call(this,e)}}};Hs=new WeakMap,Fs=new WeakMap,Os=new WeakMap,qs=new WeakMap,Vs=new WeakMap,Rs=new WeakMap,Ns=new WeakSet,Ws=function(){let t=1;for(const e of this.querySelectorAll("[role=menu]"))e.setAttribute("data-level",t.toString()),t++},Bs=function(){const{signal:t}=b(this,Hs,"f");for(const e of this.querySelectorAll(ao.validSelectors.join(",")))e.addEventListener("click",b(this,Ns,"m",$s).bind(this),{signal:t}),e.addEventListener("keydown",b(this,Ns,"m",$s).bind(this),{signal:t})},$s=function(t){if(!b(this,Ns,"m",js).call(this,t))return!1;const e=t.target.closest(ao.menuItemSelectors.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Us=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Ks=function(t){return t.target instanceof ClipboardCopyElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(" "===t.key||"Enter"===t.key)},js=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,Ns,"m",Us).call(this,t)||b(this,Ns,"m",Ks).call(this,t)},zs=function(t,e){switch(t.key){case"ArrowRight":{const t=b(this,Ns,"m",oo).call(this,e);t?.showPopover();break}case"ArrowLeft":if(e.closest("role[menu]")!==this.list){const t=e.closest("anchored-position");t?.hidePopover()}}},_s=function(t){const e=t.target;if(t.target instanceof AnchoredPositionElement)if("open"===t.newState){const t=e===this.overlay;b(this,Rs,"f").push(e,{trapFocus:!t}),window.requestAnimationFrame((()=>{const t=e.querySelector(ao.menuItemSelectors.join(","));t?.focus()}))}else{b(this,Rs,"f").pop(e);const t=b(this,Ns,"m",ro).call(this,e),i=document.querySelector(":popover-open");t&&!i&&t.focus()}},Zs=function(t){t.preventDefault(),t.stopPropagation(),b(this,Ns,"m",eo).call(this)?b(this,Ns,"m",to).call(this):b(this,Ns,"m",Qs).call(this)},Ys=function(t,e){this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="none");const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="",b(this,Ns,"m",eo).call(this)&&b(this,Ns,"m",to).call(this));const t=this.ownerDocument.activeElement,n=this.ownerDocument.activeElement===this.ownerDocument.body,s=this.contains(t),o=e.contains(t);(n||s||o)&&setTimeout((()=>{const e=this.ownerDocument.activeElement;e!==t&&e!==this.ownerDocument.body||this.invokerElement?.focus()}),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},Gs=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{b(this,Ns,"m",eo).call(this)&&b(this,Ns,"m",to).call(this)})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");b(this,Ns,"m",io).call(this)}else t.setAttribute("aria-checked",`${e}`),b(this,Ns,"m",io).call(this);b(this,Ns,"m",no).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},Js=function(){b(this,Ns,"a",so)?.focus(),b(this,Ns,"m",Bs).call(this),this.setAttribute("data-ready","true")},Xs=function(){b(this,Ns,"m",to).call(this)},Qs=function(){this.popoverElement?.showPopover()},to=function(){this.popoverElement?.hidePopover();for(const t of this.childPopoverElements)t.hidePopover()},eo=function(){return this.popoverElement?.matches(":popover-open")},io=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;let e;if(v(this,Fs,b(this,Fs,"f")||t.textContent||"","f"),"single"===this.selectVariant?e=this.querySelector("[aria-checked=true] .ActionListItem-label")?.textContent?.trim():"multiple"===this.selectVariant&&(e=Array.from(this.querySelectorAll("[aria-checked=true] .ActionListItem-label")).map((t=>(t.textContent||"").trim())).filter(Boolean).join(", ")),e||(e=b(this,Fs,"f")),e&&this.dynamicLabel){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=this.dynamicLabelPrefix?`${this.dynamicLabelPrefix} `:"",n.textContent=e,t.replaceChildren(i,n)}else t.textContent=b(this,Fs,"f")},no=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),t.removeAttribute("disabled")):t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=this.querySelector("[data-list-inputs=true]");if(!t)return;const e=t.querySelectorAll("input");e.length>0&&v(this,Os,b(this,Os,"f")||e[0].name,"f");for(const e of this.selectedItems){const i=document.createElement("input");i.setAttribute("data-list-input","true"),i.type="hidden",i.autocomplete="off",i.name=b(this,Os,"f"),i.value=(e.value||e.label||"").trim(),t.append(i)}for(const t of e)t.remove()}},so=function(){return this.querySelector(ao.menuItemSelectors.join(","))},oo=function(t){const e=t.getAttribute("popovertarget");return e?this.querySelector(`[id="${e}"]`):null},ro=function(t){const e=t.getAttribute("anchor");return e?this.querySelector(`[id="${e}"]`):null},co.validItemRoles=["menuitem","menuitemcheckbox","menuitemradio"],co.validSelectors=ao.validItemRoles.map((t=>`[role="${t}"]`)),co.menuItemSelectors=ao.validSelectors.map((t=>`:not([hidden]) > ${t}`)),g([U],co.prototype,"includeFragment",void 0),g([U],co.prototype,"overlay",void 0),g([U],co.prototype,"list",void 0),co=ao=g([j("action-menu")],co),window.customElements.get("action-menu")||(window.ActionMenuElement=co,window.customElements.define("action-menu",co));const ho="less",uo="equal",mo="greater";var fo,po,go,bo,vo,wo=t=>{throw TypeError(t)},yo=(t,e,i)=>e.has(t)||wo("Cannot "+i),Eo=(t,e,i)=>(yo(t,e,"read from private field"),i?i.call(t):e.get(t)),Ao=(t,e,i)=>e.has(t)?wo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ko=(t,e,i,n)=>(yo(t,e,"write to private field"),e.set(t,i),i),Lo=(t,e,i)=>(yo(t,e,"access private method"),i);class To{constructor({compareFn:t}){Ao(this,go),Ao(this,fo),Ao(this,po),ko(this,fo,t),ko(this,po,[])}insert(t){Eo(this,po).push(t),Lo(this,go,vo).call(this)}pop(){const t=Eo(this,po)[0];return Eo(this,po)[Eo(this,po).length-1]&&(Eo(this,po)[0]=Eo(this,po)[Eo(this,po).length-1],Eo(this,po).pop()),Lo(this,go,bo).call(this),t}peek(){return Eo(this,po)[0]}delete(t){const e=Eo(this,po).indexOf(t);-1!==e&&(Fo(Eo(this,po),e,Eo(this,po).length-1),Eo(this,po).pop(),Lo(this,go,bo).call(this))}clear(){ko(this,po,[])}get size(){return Eo(this,po).length}}function So(t){return 2*t+1}function Co(t){return 2*t+2}function xo(t){return Math.floor((t-1)/2)}function Mo(t,e){return So(t)<e}function Io(t,e){return Co(t)<e}function Do(t){return t>0}function Po(t,e){return t[So(e)]}function No(t,e){return t[Co(e)]}function Ho(t,e){return t[xo(e)]}function Fo(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}fo=new WeakMap,po=new WeakMap,go=new WeakSet,bo=function(){let t=0;for(;Mo(t,Eo(this,po).length);){let e=So(t);if(Io(t,Eo(this,po).length)&&Eo(this,fo).call(this,No(Eo(this,po),t),Po(Eo(this,po),t))===ho&&(e=Co(t)),Eo(this,fo).call(this,Eo(this,po)[t],Eo(this,po)[e])===ho)break;Fo(Eo(this,po),t,e),t=e}},vo=function(){let t=Eo(this,po).length-1;for(;Do(t)&&Eo(this,fo).call(this,Eo(this,po)[t],Ho(Eo(this,po),t))===ho;)Fo(Eo(this,po),t,xo(t)),t=xo(t)};var Oo,qo,Vo,Ro,Wo=Object.defineProperty,Bo=t=>{throw TypeError(t)},$o=(t,e,i)=>((t,e,i)=>e in t?Wo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Uo=(t,e,i)=>e.has(t)||Bo("Cannot "+i),Ko=(t,e,i)=>(Uo(t,e,"read from private field"),i?i.call(t):e.get(t)),jo=(t,e,i)=>e.has(t)?Bo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),zo=(t,e,i,n)=>(Uo(t,e,"write to private field"),e.set(t,i),i);Oo=Symbol.toStringTag;class _o{constructor(){$o(this,Oo,"Deferred"),jo(this,qo),jo(this,Vo),jo(this,Ro),zo(this,qo,new Promise(((t,e)=>{zo(this,Vo,t),zo(this,Ro,e)})))}then(t,e){return Promise.prototype.then.apply(Ko(this,qo),[t,e])}catch(t){return Promise.prototype.catch.apply(Ko(this,qo),[t])}finally(t){return Promise.prototype.finally.apply(Ko(this,qo),[t])}resolve(t){Ko(this,Vo).call(this,t)}reject(t){Ko(this,Ro).call(this,t)}getPromise(){return Ko(this,qo)}}qo=new WeakMap,Vo=new WeakMap,Ro=new WeakMap;var Zo,Yo,Go,Jo,Xo,Qo,tr=t=>{throw TypeError(t)},er=(t,e,i)=>e.has(t)||tr("Cannot "+i),ir=(t,e,i)=>(er(t,e,"read from private field"),i?i.call(t):e.get(t)),nr=(t,e,i)=>e.has(t)?tr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),sr=(t,e,i,n)=>(er(t,e,"write to private field"),e.set(t,i),i),or=(t,e,i)=>(er(t,e,"access private method"),i);class LiveRegionElement extends HTMLElement{constructor(){if(super(),nr(this,Jo),nr(this,Zo),nr(this,Yo),nr(this,Go),!this.shadowRoot){const t=function(){if(rr)return rr;return rr=document.createElement("template"),rr.innerHTML=ar,rr}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}sr(this,Zo,!1),sr(this,Go,null),sr(this,Yo,new To({compareFn:lr}))}get delay(){const t=this.getAttribute("delay");return t?parseInt(t,10):150}set delay(t){this.setAttribute("delay",`${t}`)}announce(t,e={}){const{delayMs:i,politeness:n="polite"}=e,s=Date.now(),o=new _o,r={deferred:o,politeness:n,contents:t,scheduled:void 0!==i?s+i:s};return ir(this,Yo).insert(r),or(this,Jo,Xo).call(this),{...o.getPromise(),cancel:()=>{ir(this,Yo).delete(r),o.resolve()}}}announceFromElement(t,e){const i=function(t){let e="";t.hasAttribute("aria-label")?e=t.getAttribute("aria-label"):t.innerText?e=t.innerText:t.textContent&&(e=t.textContent);return e?e.trim():""}(t);if(""!==i)return this.announce(i,e);return{...Promise.resolve(),cancel:cr}}getMessage(t="polite"){const e=this.shadowRoot?.getElementById(t);if(!e)throw new Error("Unable to find container for message");return e.textContent}clear(){null!==ir(this,Go)&&(clearTimeout(ir(this,Go)),sr(this,Go,null)),sr(this,Zo,!1),ir(this,Yo).clear()}}Zo=new WeakMap,Yo=new WeakMap,Go=new WeakMap,Jo=new WeakSet,Xo=function(){if(ir(this,Zo))return;let t=ir(this,Yo).peek();if(!t)return;null!==ir(this,Go)&&(clearTimeout(ir(this,Go)),sr(this,Go,null));const e=Date.now();if(t.scheduled<=e)return t=ir(this,Yo).pop(),t&&or(this,Jo,Qo).call(this,t),void or(this,Jo,Xo).call(this);const i=t.scheduled-e;sr(this,Go,window.setTimeout((()=>{sr(this,Go,null),or(this,Jo,Xo).call(this)}),i))},Qo=function(t){sr(this,Zo,!0);const{contents:e,deferred:i,politeness:n}=t,s=this.shadowRoot?.getElementById(n);if(!s)throw sr(this,Zo,!1),new Error(`Unable to find container for message. Expected a container with id="${n}"`);s.textContent===e?s.textContent=`${e} `:s.textContent=e,null!==ir(this,Go)&&clearTimeout(ir(this,Go)),i.resolve(),this.delay>0?sr(this,Go,window.setTimeout((()=>{sr(this,Go,null),sr(this,Zo,!1),or(this,Jo,Xo).call(this)}),this.delay)):(sr(this,Go,null),sr(this,Zo,!1),or(this,Jo,Xo).call(this))};let rr=null;const ar='\n<style>\n:host {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n</style>\n<div id="polite" aria-live="polite" aria-atomic="true"></div>\n<div id="assertive" aria-live="assertive" aria-atomic="true"></div>\n';function lr(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?uo:t.scheduled<e.scheduled?ho:mo:"assertive"===t.politeness&&"assertive"!==e.politeness?ho:"assertive"!==t.politeness&&"assertive"===e.politeness?mo:uo}function cr(){}var dr,hr,ur,mr,fr,pr,gr,br,vr,wr,yr,Er,Ar,kr,Lr,Tr,Sr,Cr,xr,Mr,Ir,Dr,Pr,Nr,Hr,Fr,Or,qr,Vr,Rr,Wr,Br,$r,Ur,Kr,jr,zr,_r,Zr,Yr;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const Gr=['[role="option"]'],Jr=Gr.join(","),Xr=Gr.map((t=>`:not([hidden]) > ${t}`)).join(",");var Qr,ta;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(Qr||(Qr={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}(ta||(ta={}));const ea=(()=>{const t=new Set;let e=null;function i(){for(const e of t)e.updateAnchorPosition()}return n=>{window.addEventListener("resize",i),window.addEventListener("scroll",i),e||(e=new ResizeObserver((()=>{for(const e of t)e.updateAnchorPosition()}))),e.observe(n.ownerDocument.documentElement),n.addEventListener("dialog:close",(()=>{n.invokerElement?.setAttribute("aria-expanded","false"),t.delete(n)})),n.addEventListener("dialog:open",(()=>{t.add(n)}))}})();let ia=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),dr.add(this),hr.set(this,void 0),ur.set(this,void 0),mr.set(this,""),fr.set(this,""),pr.set(this,new Map),gr.set(this,null),br.set(this,null),vr.set(this,!1)}get open(){return this.dialog.open}get selectVariant(){return this.getAttribute("data-select-variant")}get ariaSelectionType(){return"aria-selected"}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}get dynamicAriaLabelPrefix(){const t=this.getAttribute("data-dynamic-aria-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get invokerElement(){const t=this.querySelector("dialog")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get closeButton(){return this.querySelector("button[data-close-dialog-id]")}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){return Array.from(b(this,pr,"f").values())}get align(){return this.getAttribute("anchor-align")||"start"}get side(){return this.getAttribute("anchor-side")||"outside-bottom"}updateAnchorPosition(){if(this&&null===this.offsetParent&&this.hide(),this.invokerElement){const{top:t,left:e}=J(this.dialog,this.invokerElement,{align:this.align,side:this.side,anchorOffset:4});this.dialog.style.top=`${Math.round(t)}px`,this.dialog.style.left=`${Math.round(e)}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,ur,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("remote-input-success",this,{signal:t}),this.addEventListener("remote-input-error",this,{signal:t}),this.addEventListener("loadstart",this,{signal:t}),b(this,dr,"m",Kr).call(this),b(this,dr,"m",jr).call(this),b(this,dr,"m",wr).call(this),ea(this),ze(this,(()=>Boolean(this.remoteInput)),(()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})})),ze(this,(()=>Boolean(this.includeFragment)),(()=>{this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("loadend",this,{signal:t})})),v(this,hr,new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t===this.dialog&&(this.filterInputTextField&&document.activeElement!==this.filterInputTextField&&this.filterInputTextField.focus(),this.dialog.setAttribute("data-ready","true"),this.updateAnchorPosition(),b(this,dr,"a",Vr)===Qr.LOCAL&&b(this,dr,"m",Nr).call(this))}})),"f"),ze(this,(()=>Boolean(this.dialog)),(()=>{b(this,hr,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()})),b(this,dr,"a",Vr)===Qr.LOCAL&&ze(this,(()=>this.items.length>0),(()=>{b(this,dr,"m",Nr).call(this),b(this,dr,"m",jr).call(this)}))}disconnectedCallback(){b(this,ur,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,dr,"m",Pr).call(this,t);if(t.target===this.remoteInput)return void b(this,dr,"m",Ir).call(this,t);const e=this.invokerElement?.contains(t.target),i=this.closeButton?.contains(t.target),n=b(this,dr,"m",kr).call(this,t);if(e&&"mousedown"===t.type)return;if("mousedown"===t.type&&t.target instanceof HTMLInputElement)return;if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return void b(this,dr,"m",Br).call(this,t);if(i&&n)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(Xr)){const e=t.ctrlKey||t.altKey||t.metaKey,i=1===t.key.length&&/[a-z\d]/i.test(t.key);!e&&i&&t.stopPropagation()}if(t.target===this.dialog&&"close"===t.type){if(this.dialog.removeAttribute("data-ready"),this.invokerElement?.setAttribute("aria-expanded","false"),this.filterInputTextField){const t=this.filterInputTextField.value.length>0;this.filterInputTextField.value="",t&&this.filterInputTextField.dispatchEvent(new Event("input"))}return void this.dispatchEvent(new CustomEvent("panelClosed",{detail:{panel:this},bubbles:!0}))}const s=t.target.closest(Xr)?.parentElement;if(null!=s&&n){if(b(this,dr,"m",Er).call(this,t))return;const e=s.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e)&&this.contains(i))return void b(this,dr,"m",$r).call(this,t,i)}return b(this,dr,"m",Ar).call(this,t)&&(t.preventDefault(),b(this,dr,"m",Yr).call(this,s)?.click()),void b(this,dr,"m",Ur).call(this,s)}if("click"===t.type){const e=this.dialog.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.hide()}t.target instanceof IncludeFragmentElement&&b(this,dr,"m",xr).call(this,t)}show(){this.updateAnchorPosition(),this.dialog.showModal(),this.invokerElement?.setAttribute("aria-expanded","true");const t=new CustomEvent("dialog:open",{detail:{dialog:this.dialog}});this.dispatchEvent(t)}hide(){this.dialog.close()}get visibleItems(){return Array.from(this.querySelectorAll(Xr)).map((t=>t.parentElement))}get items(){return Array.from(this.querySelectorAll(Jr)).map((t=>t.parentElement))}get focusableItem(){for(const t of this.items){const e=b(this,dr,"m",Yr).call(this,t);if(e&&"0"===e.getAttribute("tabindex"))return e}}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),b(this,dr,"m",Yr).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,dr,"m",Yr).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,dr,"m",Yr).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,dr,"m",Ur).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,dr,"m",Ur).call(this,t)}};hr=new WeakMap,ur=new WeakMap,mr=new WeakMap,fr=new WeakMap,pr=new WeakMap,gr=new WeakMap,br=new WeakMap,vr=new WeakMap,dr=new WeakSet,wr=function(){const{signal:t}=b(this,ur,"f");for(const e of this.querySelectorAll(Gr.join(",")))e.addEventListener("click",b(this,dr,"m",Er).bind(this),{signal:t}),e.addEventListener("keydown",b(this,dr,"m",Er).bind(this),{signal:t})},yr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const i=b(this,dr,"m",Yr).call(this,e);i&&(this.isItemHidden(e)||!this.isItemChecked(e)||t?i.setAttribute("tabindex","-1"):(i.setAttribute("tabindex","0"),t=!0),e.removeAttribute("tabindex"))}else for(const t of this.items){const e=b(this,dr,"m",Yr).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,dr,"a",zr)&&b(this,dr,"m",Yr).call(this,b(this,dr,"a",zr))?.setAttribute("tabindex","0")},Er=function(t){if(!b(this,dr,"m",kr).call(this,t))return!1;const e=t.target.closest(Xr);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Ar=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},kr=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,dr,"m",Ar).call(this,t)},Lr=function(){for(const t of this.items){const e=b(this,dr,"m",Yr).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");i&&b(this,pr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,dr,"m",jr).call(this)},Tr=function(t){const e=b(this,dr,"m",Yr).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,pr,"f").set(i,{value:i,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},Sr=function(t){const e=b(this,dr,"m",Yr).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,pr,"f").delete(i)},Cr=function(){b(this,dr,"a",Rr)&&(b(this,gr,"f")&&clearTimeout(b(this,gr,"f")),b(this,br,"f")&&clearTimeout(b(this,br,"f")),v(this,br,setTimeout((()=>{this.liveRegion.announce("Loading")}),2e3),"f"),v(this,gr,setTimeout((()=>{b(this,dr,"a",Rr)?.showLeadingSpinner()}),1e3),"f"))},xr=function(t){switch(t.type){case"include-fragment-replaced":b(this,dr,"m",Nr).call(this);break;case"loadstart":b(this,dr,"m",Mr).call(this,!1);break;case"loadend":b(this,dr,"a",Rr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,dr,"m",Mr).call(this,!0);const e=this.fragmentErrorElement;throw e&&!e.hasAttribute("hidden")&&this.liveRegion.announceFromElement(e,{politeness:"assertive"}),new Error(t.detail.error)}}},Mr=function(t){for(const e of this.includeFragment.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of this.includeFragment.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)},Ir=function(t){switch(t.type){case"remote-input-success":b(this,dr,"m",Or).call(this),b(this,dr,"m",Nr).call(this),b(this,dr,"m",Lr).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,dr,"m",Fr).call(this,ta.BODY):b(this,dr,"m",Fr).call(this,ta.BANNER);break;case"loadstart":if(!b(this,dr,"m",Wr).call(this)){if(b(this,dr,"m",Or).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,dr,"m",Cr).call(this)}break;case"loadend":b(this,dr,"a",Rr)?.hideLeadingSpinner(),b(this,br,"f")&&clearTimeout(b(this,br,"f")),b(this,gr,"f")&&clearTimeout(b(this,gr,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},Dr=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},Pr=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,dr,"m",Yr).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,dr,"m",Yr).call(this,this.visibleItems[0]);e&&(e.focus(),t.preventDefault())}else if("Home"===e){const e=this.visibleItems[0];if(e){const i=b(this,dr,"m",Yr).call(this,e);i&&i.focus(),t.preventDefault()}}else if("End"===e&&this.visibleItems.length>0){const e=this.visibleItems[this.visibleItems.length-1],i=b(this,dr,"m",Yr).call(this,e);i&&i.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,dr,"m",Wr).call(this)||b(this,dr,"m",Cr).call(this),b(this,dr,"a",Vr)===Qr.LOCAL||b(this,dr,"a",Vr)===Qr.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,dr,"m",Nr).call(this)}},Nr=function(){if(!this.list)return;let t=!1;if(b(this,dr,"m",Wr).call(this)){const e=this.filterInputTextField?.value??"",i=this.filterFn||b(this,dr,"m",Dr);for(const n of this.items)i(n,e)?(b(this,dr,"m",Zr).call(this,n),t=!0):b(this,dr,"m",_r).call(this,n)}else t=this.items.length>0;b(this,dr,"m",yr).call(this),b(this,dr,"m",qr).call(this);for(const t of this.items){const e=b(this,dr,"m",Yr).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");b(this,vr,"f")?i&&!b(this,pr,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"false"):i&&!b(this,pr,"f").has(i)&&this.isItemChecked(t)&&b(this,dr,"m",Tr).call(this,t)}v(this,vr,!0,"f"),this.noResults&&(b(this,dr,"m",Hr).call(this)?this.noResults.setAttribute("hidden",""):t?(this.noResults.setAttribute("hidden",""),this.list?.querySelector(".ActionListWrap")?.removeAttribute("hidden")):(this.list?.querySelector(".ActionListWrap")?.setAttribute("hidden",""),this.noResults.removeAttribute("hidden")))},Hr=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},Fr=function(t){let e=this.fragmentErrorElement;t===ta.BODY&&this.fragmentErrorElement?(this.fragmentErrorElement.removeAttribute("hidden"),this.bannerErrorElement.setAttribute("hidden","")):(e=this.bannerErrorElement,this.bannerErrorElement?.removeAttribute("hidden"),this.fragmentErrorElement?.setAttribute("hidden","")),!e||e.hasAttribute("hidden")||this.liveRegion.announceFromElement(e,{politeness:"assertive"})},Or=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},qr=function(){if(this.open&&this.list){const t=this.visibleItems;if(t.length>0){const e="tab for results";this.liveRegion.announce(`${t.length} result${1===t.length?"":"s"} ${e}`)}else{const t=this.noResults;t&&this.liveRegion.announceFromElement(t)}}},Vr=function(){if(!this.list)return Qr.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return Qr.LOCAL;case"eventually_local":return Qr.EVENTUALLY_LOCAL;default:return Qr.REMOTE}},Rr=function(){return this.filterInputTextField?.closest("primer-text-field")},Wr=function(){return b(this,dr,"a",Vr)===Qr.LOCAL||b(this,dr,"a",Vr)===Qr.EVENTUALLY_LOCAL},Br=function(t){this.invokerElement?.dispatchEvent(new CustomEvent("invokerClicked",{bubbles:!0})),t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},$r=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.querySelector(".ActionListWrap").style.display="",this.open&&this.hide();const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,n=this.contains(t);(e||n)&&setTimeout((()=>this.invokerElement?.focus()),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},Ur=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{this.open&&this.hide()})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=this.isItemChecked(t),i=!e;if(!this.dispatchEvent(new CustomEvent("beforeItemActivated",{bubbles:!0,cancelable:!0,detail:{item:t,checked:i,value:b(this,dr,"m",Yr).call(this,t)?.getAttribute("data-value")}})))return;const n=b(this,dr,"m",Yr).call(this,t);if("single"===this.selectVariant){if(n?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,dr,"m",Yr).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,pr,"f").clear(),i&&(b(this,dr,"m",Tr).call(this,t),n?.setAttribute(this.ariaSelectionType,"true")),b(this,dr,"m",Kr).call(this)}}else n?.setAttribute(this.ariaSelectionType,`${i}`),i?b(this,dr,"m",Tr).call(this,t):b(this,dr,"m",Sr).call(this,t),b(this,dr,"m",Kr).call(this);b(this,dr,"m",jr).call(this),b(this,dr,"m",yr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:i,value:b(this,dr,"m",Yr).call(this,t)?.getAttribute("data-value")}}))},Kr=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;let e;if(v(this,mr,b(this,mr,"f")||t.textContent||"","f"),"single"===this.selectVariant?e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent:"multiple"===this.selectVariant&&(e=Array.from(this.querySelectorAll(`[${this.ariaSelectionType}=true] .ActionListItem-label`)).map((t=>t.textContent?.trim()??"")).join(", ")),e||(e=b(this,mr,"f")),e){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=`${this.dynamicLabelPrefix} `,n.textContent=e,t.replaceChildren(i,n),this.dynamicAriaLabelPrefix&&this.invokerElement?.setAttribute("aria-label",`${this.dynamicAriaLabelPrefix} ${e.trim()}`)}else t.textContent=b(this,mr,"f")},jr=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-select-panel-inputs=true] input")??this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),e.inputName&&(t.name=e.inputName),t.removeAttribute("disabled")):b(this,vr,"f")&&t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=!!this.querySelector("[data-select-panel-inputs=true]"),e=this.querySelector("[data-select-panel-inputs=true]")??this.querySelector("[data-list-inputs=true]");if(!e)return;const i=e.querySelectorAll("input");i.length>0&&v(this,fr,b(this,fr,"f")||i[0].name,"f");for(const i of this.selectedItems){const n=document.createElement("input");n.setAttribute(""+(t?"data-select-panel-input":"data-list-input"),"true"),n.type="hidden",n.autocomplete="off",n.name=i.inputName||b(this,fr,"f"),n.value=(i.value||i.label||"").trim(),e.append(n)}for(const t of i)t.remove()}},zr=function(){return this.querySelector(Xr)?.parentElement||null},_r=function(t){t&&t.setAttribute("hidden","hidden")},Zr=function(t){t&&t.removeAttribute("hidden")},Yr=function(t){return t.querySelector(".ActionListContent")},g([U],ia.prototype,"includeFragment",void 0),g([U],ia.prototype,"dialog",void 0),g([U],ia.prototype,"filterInputTextField",void 0),g([U],ia.prototype,"remoteInput",void 0),g([U],ia.prototype,"list",void 0),g([U],ia.prototype,"noResults",void 0),g([U],ia.prototype,"fragmentErrorElement",void 0),g([U],ia.prototype,"bannerErrorElement",void 0),g([U],ia.prototype,"bodySpinner",void 0),g([U],ia.prototype,"liveRegion",void 0),ia=g([j("select-panel")],ia),window.customElements.get("select-panel")||(window.SelectPanelElement=ia,window.customElements.define("select-panel",ia));let na=class DetailsToggleElement extends HTMLElement{toggle(){if(this.detailsTarget.hasAttribute("open")){const t=this.summaryTarget.getAttribute("data-aria-label-closed");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","false")}else{const t=this.summaryTarget.getAttribute("data-aria-label-open");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","true")}}};function sa(t){Tt(t,{bindKeys:gt.ArrowVertical|gt.ArrowHorizontal|gt.HomeAndEnd|gt.Backspace,getNextFocusable:(t,e,i)=>{if(e instanceof HTMLElement){try{if(e.closest("dialog:modal"))return}catch{}return function(t,e){switch(`${function(t){if("treeitem"!==t.getAttribute("role"))throw new Error("Element is not a treeitem");switch(t.getAttribute("aria-expanded")){case"true":return"open";case"false":return"closed";default:return"end"}}(t)} ${e.key}`){case"open ArrowRight":return function(t){const e=t.querySelector("[role=treeitem]");return e instanceof HTMLElement?e:void 0}(t);case"open ArrowLeft":case"closed ArrowRight":case"end ArrowRight":return;case"closed ArrowLeft":case"end ArrowLeft":return aa(t)}switch(e.key){case"ArrowUp":return oa(t,"previous");case"ArrowDown":return oa(t,"next");case"Backspace":return aa(t)}}(e,i)??e}},focusInStrategy:()=>{let e=t.querySelector("[aria-current]");e=e?.checkVisibility()?e:null;const i=t.querySelector('[role="treeitem"]');return e instanceof HTMLElement?e:document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&"treeitem"===document.activeElement.getAttribute("role")?document.activeElement:i instanceof HTMLElement?i:void 0}})}function oa(t,e){const i=t.closest("[role=tree]");if(!i)return;const n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,(t=>t instanceof HTMLElement&&"treeitem"===t.getAttribute("role")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));let s=n.firstChild();for(;s!==t;)s=n.nextNode();let o="next"===e?n.nextNode():n.previousNode();for(;o instanceof HTMLElement&&ra(o,i);)o="next"===e?n.nextNode():n.previousNode();return o instanceof HTMLElement?o:void 0}function ra(t,e){for(const i of e.querySelectorAll("[role=treeitem][aria-expanded=false]"))if(t!==i&&i.closest("li")?.contains(t))return i;return null}function aa(t){const e=t.closest("[role=group]"),i=e?.closest("[role=treeitem]");return i instanceof HTMLElement?i:void 0}var la,ca,da,ha,ua,ma,fa,pa,ga,ba,va,wa,ya;g([U],na.prototype,"detailsTarget",void 0),g([U],na.prototype,"summaryTarget",void 0),na=g([j("details-toggle")],na),window.DetailsToggleElement=na;let Ea=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),la.add(this),ca.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,ca,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),sa(this),new MutationObserver((t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.querySelector("[aria-expanded=true]")&&b(this,la,"m",da).call(this,t)})).observe(this,{childList:!0,subtree:!0});new MutationObserver((t=>{if(!this.formInputContainer)return;t.some((t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue))&&this.updateHiddenFormInputs()})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),this.formInputContainer&&this.updateHiddenFormInputs(),customElements.whenDefined("tree-view-sub-tree-node").then((()=>{b(this,la,"m",da).call(this,this)}))}rootLeafNodes(){return this.querySelectorAll(":scope > ul > li > .TreeViewItemContainer [role=treeitem]")}rootSubTreeNodes(){return this.querySelectorAll(":scope > ul > tree-view-sub-tree-node")}disconnectedCallback(){b(this,ca,"f").abort()}handleEvent(t){const e=b(this,la,"m",ua).call(this,t);e&&b(this,la,"m",ma).call(this,e,t)}handleSingleSelection(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i="true"===this.getNodeCheckedValue(e)?"false":"true",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("false"===i?this.setNodeCheckedValue(e,"false"):b(this,la,"m",ya).call(this,e),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,detail:[n]})))}getFormInputValueForNode(t){return t.getAttribute("data-value")}getNodePath(t){const e=t.getAttribute("data-path");return e?JSON.parse(e):[]}getNodeType(t){return t.getAttribute("data-node-type")}markCurrentAtPath(t){const e=JSON.stringify(t),i=this.querySelector(`[data-path="${CSS.escape(e)}"`);i&&(this.currentNode?.setAttribute("aria-current","false"),i.setAttribute("aria-current","true"))}get currentNode(){return this.querySelector("[aria-current=true]")}get activeNodes(){return this.querySelectorAll('[aria-checked="true"]')}expandAtPath(t){const e=this.subTreeAtPath(t);e&&e.expand()}collapseAtPath(t){const e=this.subTreeAtPath(t);e&&e.collapse()}toggleAtPath(t){const e=this.subTreeAtPath(t);e&&e.toggle()}checkAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"true")}uncheckAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"false")}checkOnlyAtPath(t){const e=this.nodeAtPath(t);e&&b(this,la,"m",ya).call(this,e)}toggleCheckedAtPath(t){const e=this.nodeAtPath(t);e&&"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.uncheckAtPath(t):this.checkAtPath(t))}checkedValueAtPath(t){const e=this.nodeAtPath(t);return e?this.getNodeCheckedValue(e):"false"}disabledValueAtPath(t){const e=this.nodeAtPath(t);return!!e&&this.getNodeDisabledValue(e)}nodeAtPath(t,e){const i=JSON.stringify(t);return this.querySelector(`${e||""}[data-path="${CSS.escape(i)}"]`)}subTreeAtPath(t){const e=this.nodeAtPath(t,"[data-node-type=sub-tree]");return e?e.closest("tree-view-sub-tree-node"):null}leafAtPath(t){return this.nodeAtPath(t,"[data-node-type=leaf]")}setNodeCheckedValue(t,e){t.setAttribute("aria-checked",e.toString())}getNodeCheckedValue(t){return t.getAttribute("aria-checked")||"false"}getNodeDisabledValue(t){return"true"===t.getAttribute("aria-disabled")}setNodeDisabledValue(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}nodeHasCheckBox(t){return null!==t.querySelector(".TreeViewItemCheckbox")}nodeHasNativeAction(t){return t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement}expandAncestorsForNode(t){const e=t.closest("tree-view-sub-tree-node");if(e)for(const t of e.eachAncestorSubTreeNode())t.expanded||t.expand()}changeSelectStrategy(t){for(const e of this.querySelectorAll("tree-view-sub-tree-node"))e.changeSelectStrategy(t)}infoFromNode(t,e){const i=this.getNodeType(t);if(!i)return null;const n=this.getNodeCheckedValue(t);return{node:t,type:i,path:this.getNodePath(t),checkedValue:e||n,previousCheckedValue:n}}selectVariant(t){return t.getAttribute("data-select-variant")||"none"}updateHiddenFormInputs(){const t=[];for(const e of this.querySelectorAll("[role=treeitem][aria-checked=true]")){const i=this.formInputPrototype.cloneNode();i.removeAttribute("data-target"),i.removeAttribute("form");const n={path:this.getNodePath(e)},s=e.getAttribute("data-node-id");s&&(n.nodeId=s);const o=this.getFormInputValueForNode(e);o&&(n.value=o),i.value=JSON.stringify(n),t.push(i)}this.formInputContainer.replaceChildren(...t)}};var Aa,ka;ca=new WeakMap,la=new WeakSet,da=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},ha=function(t){return"click"===t.type},ua=function(t){const e=t.target,i=e.closest("[role=treeitem]");return i?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:i:null},ma=function(t,e){b(this,la,"m",fa).call(this,e,t)?b(this,la,"m",pa).call(this,e,t):b(this,la,"m",ga).call(this,e,t)?this.handleSingleSelection(e,t):b(this,la,"m",ha).call(this,e)?b(this,la,"m",ba).call(this,e,t):"focusin"===e.type?b(this,la,"m",va).call(this,t):e instanceof KeyboardEvent&&b(this,la,"m",wa).call(this,e,t)},fa=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},pa=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if("leaf"!==this.getNodeType(e))return;const i="false"===this.getNodeCheckedValue(e)?"true":"false",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]})))},ga=function(t,e){return"click"===t.type&&"single"===this.selectVariant(e)},ba=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeActivated",{bubbles:!0,cancelable:!0,detail:this.infoFromNode(e)}))&&(this.nodeHasNativeAction(e)||this.toggleAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeActivated",{bubbles:!0,detail:this.infoFromNode(e)})))},va=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},wa=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}"multiple"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):"single"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):b(this,la,"m",ya).call(this,e)):e instanceof HTMLAnchorElement&&e.click()}},ya=function(t){for(const e of this.activeNodes)e!==t&&this.setNodeCheckedValue(e,"false");this.setNodeCheckedValue(t,"true")},g([U],Ea.prototype,"formInputContainer",void 0),g([U],Ea.prototype,"formInputPrototype",void 0),Ea=g([j("tree-view")],Ea),window.customElements.get("tree-view")||(window.TreeViewElement=Ea,window.customElements.define("tree-view",Ea));let La=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),Aa.add(this)}connectedCallback(){ze(this,(()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon)),(()=>{this.expanded=Boolean(this.collapsedIcon.hidden)}))}showExpanded(){this.expanded=!0,b(this,Aa,"m",ka).call(this)}showCollapsed(){this.expanded=!1,b(this,Aa,"m",ka).call(this)}toggle(){this.expanded=!this.expanded,b(this,Aa,"m",ka).call(this)}};var Ta,Sa,Ca,xa,Ma,Ia,Da,Pa,Na,Ha,Fa,Oa,qa;Aa=new WeakSet,ka=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([U],La.prototype,"expandedIcon",void 0),g([U],La.prototype,"collapsedIcon",void 0),La=g([j("tree-view-icon-pair")],La),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=La,window.customElements.define("tree-view-icon-pair",La));let Va=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),Ta.add(this),Sa.set(this,null),Ca.set(this,"success"),xa.set(this,void 0),Ma.set(this,!1)}connectedCallback(){ze(this,(()=>Boolean(this.node)&&Boolean(this.subTree)),(()=>{b(this,Ta,"m",Fa).call(this)}));const{signal:t}=v(this,xa,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),ze(this,(()=>Boolean(this.includeFragment)),(()=>{this.includeFragment.addEventListener("loadstart",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replace",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replaced",(t=>{b(this,Ta,"m",Da).call(this,t)}),{signal:t})})),ze(this,(()=>Boolean(this.retryButton)),(()=>{this.retryButton.addEventListener("click",(t=>{b(this,Ta,"m",Pa).call(this,t)}),{signal:t})}));new MutationObserver((()=>{if("mixed_descendants"!==this.selectStrategy)return;let t="unknown";for(const e of this.eachDirectDescendantNode())switch(`${t} ${e.getAttribute("aria-checked")||"false"}`){case"unknown mixed":case"false mixed":case"true mixed":case"false true":case"true false":t="mixed";break;case"unknown false":t="false";break;case"unknown true":t="true"}"unknown"!==t&&this.node?.getAttribute("aria-checked")!==t&&this.node?.setAttribute("aria-checked",t)})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]})}get expanded(){return null===b(this,Sa,"f")&&v(this,Sa,"true"===this.node.getAttribute("aria-expanded"),"f"),b(this,Sa,"f")}set expanded(t){v(this,Sa,t,"f"),b(this,Ta,"m",Fa).call(this)}get loadingState(){return b(this,Ca,"f")}set loadingState(t){v(this,Ca,t,"f"),b(this,Ta,"m",Fa).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}get selectVariant(){return this.node.getAttribute("data-select-variant")||"none"}get level(){return parseInt(this.node.getAttribute("aria-level")||"0")}disconnectedCallback(){b(this,xa,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,Ta,"m",Ia).call(this,t):t.target===this.includeFragment?b(this,Ta,"m",Da).call(this,t):t instanceof KeyboardEvent?b(this,Ta,"m",Na).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,Ta,"a",qa)&&b(this,Ta,"m",Ha).call(this,t)}expand(){const t=this.expanded;this.expanded=!0,!t&&this.treeView&&this.treeView.dispatchEvent(new CustomEvent("treeViewNodeExpanded",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}collapse(){const t=!this.expanded;if(this.expanded=!1,!t&&this.treeView){const t=this.subTree.querySelector("[tabindex='0']");t?.setAttribute("tabindex","-1"),b(this,Ta,"m",Oa).call(this)&&"0"===this.subTree.getAttribute("tabindex")&&this.subTree.setAttribute("tabindex","-1"),this.node.setAttribute("tabindex","0"),this.treeView.dispatchEvent(new CustomEvent("treeViewNodeCollapsed",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}}toggle(){this.expanded?this.collapse():this.expand()}get nodes(){return this.querySelectorAll(":scope > [role=treeitem]")}*eachDirectDescendantNode(){for(const t of this.subTree.querySelectorAll(":scope > li > .TreeViewItemContainer > [role=treeitem]"))yield t;for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node > li > .TreeViewItemContainer > [role=treeitem]"))yield t}*eachDirectDescendantSubTreeNode(){for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node"))yield t}*eachDescendantNode(){for(const t of this.subTree.querySelectorAll("[role=treeitem]"))yield t}*eachAncestorSubTreeNode(){if(!this.treeView)return;let t=this;for(;t&&this.treeView.contains(t);)yield t,t=t.parentElement?.closest("tree-view-sub-tree-node")}get isEmpty(){return 0===this.nodes.length}get treeView(){return this.closest("tree-view")}toggleChecked(){const t="false"===(this.treeView?.getNodeCheckedValue(this.node)||"false")?"true":"false",e=[],i=this.treeView?.infoFromNode(this.node,t);if(i&&e.push(i),"descendants"===this.selectStrategy||"mixed_descendants"===this.selectStrategy)for(const i of this.eachDescendantNode()){const n=this.treeView?.infoFromNode(i,t);n&&e.push(n)}if(this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))){for(const i of e)i.node.setAttribute("aria-checked",t);this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))}}changeSelectStrategy(t){this.node.setAttribute("data-select-strategy",t)}};Sa=new WeakMap,Ca=new WeakMap,xa=new WeakMap,Ma=new WeakMap,Ta=new WeakSet,Ia=function(t){"click"===t.type&&(this.toggle(),t.stopPropagation())},Da=function(t){switch(t.type){case"loadstart":this.loadingState="loading";break;case"error":this.loadingState="error";break;case"include-fragment-replace":v(this,Ma,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),!b(this,Ma,"f")&&document.activeElement===this.subTree&&b(this,Ta,"m",Oa).call(this)&&v(this,Ma,!0,"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,Ma,"f")){const t=this.querySelector("[role=group] > :first-child");if(!t)return;const e=t.querySelector("[role=treeitem]");if(!e)return;e.focus()}v(this,Ma,!1,"f")}},Pa=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},Na=function(t){const e=t.target.closest("[role=treeitem]");if(e&&"sub-tree"===this.treeView?.getNodeType(e))switch(t.key){case"Enter":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}t.stopPropagation(),b(this,Ta,"a",qa)?this.toggleChecked():"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):this.treeView?.nodeHasNativeAction(e)||this.toggle();break;case"ArrowRight":t.stopPropagation(),this.expand();break;case"ArrowLeft":t.stopPropagation(),this.collapse();break;case" ":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}b(this,Ta,"a",qa)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},Ha=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},Fa=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!1),b(this,Ta,"m",Oa).call(this)&&(this.subTree.setAttribute("role","treeitem"),this.subTree.hasAttribute("tabindex")||this.subTree.setAttribute("tabindex","-1")),this.node.setAttribute("aria-expanded","true"),this.treeView?.expandAncestorsForNode(this),this.iconPair&&this.iconPair.showExpanded(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.removeAttribute("hidden"),this.collapsedToggleIcon.setAttribute("hidden","hidden"))):(this.subTree&&(this.subTree.hidden=!0),b(this,Ta,"m",Oa).call(this)&&(this.subTree.removeAttribute("role"),this.subTree.removeAttribute("tabindex")),this.node.setAttribute("aria-expanded","false"),this.iconPair&&this.iconPair.showCollapsed(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.setAttribute("hidden","hidden"),this.collapsedToggleIcon.removeAttribute("hidden"))),this.loadingState){case"loading":this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0),this.loadingIndicator&&(this.loadingIndicator.hidden=!1);break;case"error":this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!1);break;default:this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0)}},Oa=function(){return this.subTree?.getAttribute("data-target")?.includes("tree-view-sub-tree-node.includeFragment")??!1},qa=function(){return this.querySelector(".TreeViewItemCheckbox")},g([U],Va.prototype,"node",void 0),g([U],Va.prototype,"subTree",void 0),g([U],Va.prototype,"iconPair",void 0),g([U],Va.prototype,"toggleButton",void 0),g([U],Va.prototype,"expandedToggleIcon",void 0),g([U],Va.prototype,"collapsedToggleIcon",void 0),g([U],Va.prototype,"includeFragment",void 0),g([U],Va.prototype,"loadingIndicator",void 0),g([U],Va.prototype,"loadingFailureMessage",void 0),g([U],Va.prototype,"retryButton",void 0),Va=g([j("tree-view-sub-tree-node")],Va),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=Va,window.customElements.define("tree-view-sub-tree-node",Va));let Ra=class TreeViewIncludeFragmentElement extends IncludeFragmentElement{request(){const t=super.request(),e=new URL(t.url);return e.searchParams.set("path",this.getAttribute("data-path")||""),new Request(e,{method:t.method,headers:t.headers,credentials:t.credentials})}};Ra=g([j("tree-view-include-fragment")],Ra),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=Ra,window.customElements.define("tree-view-include-fragment",Ra));let Wa=class AvatarFallbackElement extends HTMLElement{constructor(){super(...arguments),this.img=null,this.testImage=null}connectedCallback(){if(this.img=this.querySelector("img")??null,!this.img)return;const t=this.getAttribute("data-unique-id")||"",e=this.getAttribute("data-alt-text")||"",i=this.getAttribute("data-avatar-src")||"";this.applyColor(this.img,t,e),i&&this.testLoadImage(i)}disconnectedCallback(){this.testImage&&(this.testImage.onload=null,this.testImage=null),this.img=null}testLoadImage(t){this.testImage=new Image,this.testImage.onload=()=>{this.img&&(this.img.src=t)},this.testImage.src=t}applyColor(t,e,i){if(!e||!i)return;const n=`${e}${i}`,s=`hsl(${this.valueHash(n)}, 50%, 30%)`;this.updateSvgColor(t,s)}valueHash(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);return e%360}updateSvgColor(t,e){const i=t.src;if(!i.startsWith("data:image/svg+xml;base64,"))return;const n=i.replace("data:image/svg+xml;base64,","");try{const i=atob(n).replace(/fill="hsl\([^"]+\)"/,`fill="${e}"`);t.src=`data:image/svg+xml;base64,${btoa(i)}`}catch{}}};Wa=g([j("avatar-fallback")],Wa);let Ba=class PageHeaderElement extends HTMLElement{menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}};Ba=g([j("page-header")],Ba),window.customElements.get("page-header")||(window.PageHeaderElement=Ba,window.customElements.define("page-header",Ba));let $a=class ZenModeButtonElement extends HTMLElement{constructor(){super(),this.inZenMode=!1,document.addEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}fullscreenChangeEventHandler(){this.changeButtonState(!this.inZenMode),this.dispatchZenModeStatus()}dispatchZenModeStatus(){const t=new CustomEvent("zenModeToggled",{detail:{active:this.inZenMode}});window.dispatchEvent(t)}deactivateZenMode(){document.exitFullscreen&&document.exitFullscreen()}activateZenMode(){document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}changeButtonState(t){this.inZenMode=t,this.button.setAttribute("aria-pressed",t.toString())}performAction(){this.inZenMode?this.deactivateZenMode():this.activateZenMode()}};g([U],$a.prototype,"button",void 0),$a=g([j("zen-mode-button")],$a),window.customElements.get("zen-mode-button")||(window.ZenModeButtonElement=$a,window.customElements.define("zen-mode-button",$a));let Ua=class SubHeaderElement extends HTMLElement{connectedCallback(){this.setupFilterInputClearButton()}setupFilterInputClearButton(){this.waitForCondition((()=>Boolean(this.filterInput)),(()=>{this.toggleFilterInputClearButton()}))}toggleFilterInputClearButton(){this.filterInput.value.length>0?this.filterInput.classList.remove("SubHeader-filterInput_hiddenClearButton"):this.filterInput.classList.add("SubHeader-filterInput_hiddenClearButton")}expandFilterInput(){for(const t of this.shownItemsOnExpandedFilter)t.classList.remove("d-none","d-sm-none");for(const t of this.filterExpandButton)t.classList.remove("d-inline-flex","d-sm-inline-flex"),t.classList.add("d-none");this.classList.add("SubHeader--expandedSearch"),this.filterInput.focus()}collapseFilterInput(){for(const t of this.filterExpandButton)t.classList.remove("d-none");for(const t of this.shownItemsOnExpandedFilter)t.classList.add("d-none","d-sm-none");this.classList.remove("SubHeader--expandedSearch")}waitForCondition(t,e){if(t())e();else{const i=new MutationObserver((()=>{t()&&(e(),i.disconnect())}));i.observe(this,{childList:!0,subtree:!0})}}};var Ka,ja;g([U],Ua.prototype,"filterInput",void 0),g([K],Ua.prototype,"shownItemsOnExpandedFilter",void 0),g([K],Ua.prototype,"filterExpandButton",void 0),Ua=g([j("sub-header")],Ua),window.customElements.get("sub-header")||(window.SubHeaderElement=Ua,window.customElements.define("sub-header",Ua));let za=class DangerDialogFormHelperElement extends HTMLElement{constructor(){super(...arguments),Ka.add(this),this.confirmationLiveMessageChecked="",this.confirmationLiveMessageUnchecked=""}get form(){return this.querySelector("form")}get submitButton(){return this.querySelector("input[type=submit],button[type=submit],button[data-submit-dialog-id]")}connectedCallback(){this.style.display="contents",this.form&&(this.form.style.display="contents"),b(this,Ka,"m",ja).call(this)}toggle(){if(!this.checkbox||!this.submitButton)return;const t=this.checkbox.checked;if(this.submitButton.disabled=!t,this.liveRegion){const e=t?this.confirmationLiveMessageChecked:this.confirmationLiveMessageUnchecked;this.liveRegion.announce(e,{politeness:"assertive"})}}};Ka=new WeakSet,ja=function(){this.toggle()},g([U],za.prototype,"checkbox",void 0),g([U],za.prototype,"liveRegion",void 0),g([I],za.prototype,"confirmationLiveMessageChecked",void 0),g([I],za.prototype,"confirmationLiveMessageUnchecked",void 0),za=g([j("danger-dialog-form-helper")],za),window.customElements.get("danger-dialog-form-helper")||(window.DangerDialogFormHelperElement=za,window.customElements.define("danger-dialog-form-helper",za));class CollapsibleElement extends HTMLElement{constructor(){super(...arguments),this.collapsed=!1}toggleViaKeyboard(t){"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),this.toggle())}toggle(){this.collapsed=!this.collapsed}attributeChangedCallback(t){"data-collapsed"===t&&(this.collapsed?this.hideAll():this.expandAll())}hideAll(){this.arrowDown?.removeAttribute("hidden"),this.arrowUp?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","false");for(const t of this.collapsibleElements)t.hidden=!0;this.classList.add(`${this.baseClass}--collapsed`)}expandAll(){this.arrowUp?.removeAttribute("hidden"),this.arrowDown?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","true");for(const t of this.collapsibleElements)t.hidden=!1;this.classList.remove(`${this.baseClass}--collapsed`)}}g([U],CollapsibleElement.prototype,"arrowDown",void 0),g([U],CollapsibleElement.prototype,"arrowUp",void 0),g([U],CollapsibleElement.prototype,"triggerElement",void 0),g([K],CollapsibleElement.prototype,"collapsibleElements",void 0),g([I],CollapsibleElement.prototype,"collapsed",void 0);let _a=class CollapsibleHeaderElement extends CollapsibleElement{connectedCallback(){if(!this.closest(".Box"))throw new Error("No surrounding BorderBox found")}get baseClass(){return"CollapsibleHeader"}};_a=g([j("collapsible-header")],_a);let Za=class CollapsibleSectionElement extends CollapsibleElement{get baseClass(){return"CollapsibleSection"}};var Ya,Ga,Ja,Xa,Qa,tl,el,il,nl,sl,ol,rl,al,ll,cl,dl,hl,ul,ml,fl,pl,gl,bl,vl,wl,yl,El,Al,kl,Ll,Tl,Sl,Cl,xl,Ml,Il,Dl,Pl,Nl,Hl,Fl;Za=g([j("collapsible-section")],Za);let Ol=class FilterableTreeViewElement extends HTMLElement{constructor(){super(...arguments),Ya.add(this),Ga.set(this,void 0),Ja.set(this,void 0),Xa.set(this,new Map),Qa.set(this,null),tl.set(this,null),el.set(this,null),il.set(this,null),nl.set(this,new Map),sl.set(this,new Map),ol.set(this,!1)}connectedCallback(){const{signal:t}=v(this,Ja,new AbortController,"f");this.addEventListener("treeViewNodeChecked",this,{signal:t}),this.addEventListener("itemActivated",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),b(this,Ya,"a",al)&&b(this,Ya,"m",kl).call(this)}disconnectedCallback(){b(this,Ja,"f").abort(),b(this,tl,"f")?.abort(),null!==b(this,Qa,"f")&&clearTimeout(b(this,Qa,"f"))}handleEvent(t){t.target===this.filterModeControl?b(this,Ya,"m",ml).call(this,t):t.target===this.filterInput?"keydown"===t.type?b(this,Ya,"m",gl).call(this,t):b(this,Ya,"m",pl).call(this,t):t.target===this.includeSubItemsCheckBox?b(this,Ya,"m",vl).call(this,t):t.target instanceof Ea||t.target instanceof Va?b(this,Ya,"m",cl).call(this,t):"keydown"===t.type&&this.treeViewList?.contains(t.target)&&b(this,Ya,"m",bl).call(this,t)}get filterModeControl(){return this.filterModeControlList.closest("segmented-control")}get treeView(){return this.treeViewList.closest("tree-view")}set filterFn(t){v(this,Ga,t,"f")}get filterFn(){return b(this,Ga,"f")?b(this,Ga,"f"):this.defaultFilterFn}defaultFilterFn(t,e,i){const n=[];if(e.length>0){const i=e.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=s.nextNode();for(;o;){const t=o.textContent?.toLocaleLowerCase()||"";let e=0;for(;e<t.length;){const s=t.indexOf(i,e);if(-1===s)break;const r=new Range;r.setStart(o,s),r.setEnd(o,s+i.length),n.push(r),e=s+i.length}o=s.nextNode()}}if(0===n.length&&e.length>0)return null;switch(i){case"selected":if("false"!==this.treeView?.getNodeCheckedValue(t))return n;break;case"all":return n}return null}get filterMode(){const t=this.filterModeControl?.current;return t?t.getAttribute("data-name"):null}get queryString(){return this.filterInput.value}*eachDescendantDepthFirst(t,e,i){for(const n of t.querySelectorAll(`[role=treeitem][data-node-type='sub-tree'][aria-level='${e}']`)){const t=n.closest("tree-view-sub-tree-node");yield*this.eachDescendantDepthFirst(t,e+1,[...i,t])}const n=t.querySelectorAll(`[role=treeitem][data-node-type='leaf'][aria-level='${e}']`);yield[n,i]}*eachShallowestCheckedSubTree(t){if("true"!==this.treeView?.getNodeCheckedValue(t.node))for(const e of t.eachDirectDescendantSubTreeNode())yield*this.eachShallowestCheckedSubTree(e);else yield t}};Ga=new WeakMap,Ja=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,tl=new WeakMap,el=new WeakMap,il=new WeakMap,nl=new WeakMap,sl=new WeakMap,ol=new WeakMap,Ya=new WeakSet,rl=function(){return this.getAttribute("src")},al=function(){return!!b(this,Ya,"a",rl)},ll=function(){return"false"!==this.getAttribute("data-show-search-highlighting")},cl=function(t){const e=t;if("treeViewNodeChecked"===t.type)b(this,Ya,"m",dl).call(this,e),b(this,Ya,"m",hl).call(this,e)},dl=function(t){if(b(this,Ya,"a",al)){for(const e of t.detail){const t=e.node,i=t.getAttribute("data-node-id");if(i)if("false"===e.checkedValue)b(this,nl,"f").delete(i),b(this,sl,"f").delete(i);else{"single"===t.getAttribute("data-select-variant")&&(b(this,nl,"f").clear(),b(this,sl,"f").clear()),b(this,nl,"f").set(i,e.checkedValue);const n={path:e.path};n.nodeId=i;const s=t.getAttribute("data-value");s&&(n.value=s),b(this,sl,"f").set(i,n)}}b(this,Ya,"m",Dl).call(this)}},hl=function(t){if(!this.treeView)return;if(!this.includeSubItemsCheckBox.checked)return;const e=t.detail[0];if("sub-tree"!==this.treeView.getNodeType(e.node))return;const i=e.node.closest("tree-view-sub-tree-node");"false"===e.checkedValue?b(this,Ya,"m",ul).call(this,i):b(this,Ya,"m",yl).call(this,i)},ul=function(t){if(!this.treeView)return;if(!b(this,Xa,"f").has(t))return;const e=b(this,Xa,"f").get(t);for(const[t,i]of e.entries()){let e=t;t instanceof Va&&(e=t.node),this.treeView.setNodeCheckedValue(e,i.checked?"true":"false"),this.treeView.setNodeDisabledValue(e,i.disabled)}b(this,Xa,"f").delete(t)},ml=function(t){"itemActivated"===t.type&&(b(this,Ya,"a",al)?"selected"===this.filterMode?(v(this,il,b(this,Ya,"m",Ll).call(this),"f"),b(this,Ya,"m",Pl).call(this)):null!==b(this,il,"f")&&0===this.queryString.length?(b(this,Ya,"m",fl).call(this),b(this,Ya,"m",Tl).call(this,b(this,il,"f")),v(this,il,null,"f")):(v(this,il,null,"f"),b(this,Ya,"m",Al).call(this)):b(this,Ya,"m",Pl).call(this))},fl=function(){for(const t of this.querySelectorAll("tree-view li[hidden], tree-view-sub-tree-node[hidden]"))t.removeAttribute("hidden")},pl=function(t){"input"===t.type&&(b(this,Ya,"a",al)&&"selected"!==this.filterMode?b(this,Ya,"m",Al).call(this):b(this,Ya,"m",Pl).call(this))},gl=function(t){if("ArrowDown"!==t.key&&"ArrowUp"!==t.key)return;const e=[...this.treeViewList?.querySelectorAll("[role=treeitem]")??[]].filter((t=>!t.closest("[hidden]")));if(0===e.length)return;t.preventDefault();("ArrowDown"===t.key?e[0]:e[e.length-1]).focus()},bl=function(t){"Escape"===t.key&&(t.preventDefault(),this.filterInput.focus())},vl=function(t){this.treeView&&"input"===t.type&&(b(this,Ya,"a",al)||b(this,Ya,"m",Pl).call(this),this.includeSubItemsCheckBox.checked?b(this,Ya,"m",wl).call(this):b(this,Ya,"m",El).call(this))},wl=function(){if(this.treeView)for(const t of this.treeView.rootSubTreeNodes())for(const e of this.eachShallowestCheckedSubTree(t))b(this,Ya,"m",yl).call(this,e)},yl=function(t){if(!this.treeView)return;const e=new Map;for(const i of t.eachDescendantNode())e.set(i,{checked:"true"===this.treeView.getNodeCheckedValue(i),disabled:this.treeView.getNodeDisabledValue(i)}),this.treeView.setNodeCheckedValue(i,"true"),this.treeView.setNodeDisabledValue(i,!0);b(this,Xa,"f").set(t,e)},El=function(){for(const t of b(this,Xa,"f").keys())b(this,Ya,"m",ul).call(this,t)},Al=function(){null!==b(this,Qa,"f")&&clearTimeout(b(this,Qa,"f")),v(this,Qa,setTimeout((()=>{v(this,Qa,null,"f"),b(this,Ya,"m",kl).call(this)}),300),"f")},kl=async function(){const t=b(this,Ya,"a",rl);if(!t)return;const e=this.queryString,i=this.filterMode||"all",n=this.includeSubItemsCheckBox?.checked??!1;!b(this,ol,"f")&&e.length>0?(b(this,Ya,"m",Sl).call(this),v(this,ol,!0,"f")):b(this,ol,"f")&&0===e.length&&v(this,ol,!1,"f");const s=e.length>0;b(this,tl,"f")?.abort();const{signal:o}=v(this,tl,new AbortController,"f"),r=new URL(t,window.location.href);r.searchParams.set("query",e),r.searchParams.set("filter_mode",i),r.searchParams.set("include_sub_items",String(n));for(const t of b(this,nl,"f").keys())r.searchParams.append("checked_ids[]",t);this.setAttribute("data-loading",""),this.setAttribute("aria-busy","true");try{const t=await fetch(r.toString(),{signal:o,headers:{Accept:"text/html"},credentials:"same-origin",method:"GET"});if(!t.ok)return;const i=await t.text(),a=(new DOMParser).parseFromString(i,"text/html").querySelector("tree-view");if(!a)return;const l=this.treeViewList?.closest("tree-view");if(!l)return;if(b(this,Xa,"f").clear(),l.replaceWith(a),b(this,Ya,"m",xl).call(this),n&&b(this,Ya,"m",wl).call(this),s){b(this,Ya,"m",Ml).call(this),b(this,Ya,"a",ll)&&b(this,Ya,"m",Il).call(this,e);const t=!!this.treeViewList?.querySelector("[role=treeitem]");this.noResultsMessage.toggleAttribute("hidden",t),this.treeViewList?.toggleAttribute("hidden",!t)}else b(this,Ya,"a",ll)&&b(this,Ya,"m",Fl).call(this),b(this,Ya,"m",Cl).call(this),this.noResultsMessage.setAttribute("hidden","hidden"),this.treeViewList?.removeAttribute("hidden");b(this,Ya,"m",Dl).call(this)}catch(t){if("AbortError"===t.name)return;throw t}finally{this.removeAttribute("data-loading"),this.setAttribute("aria-busy","false")}},Ll=function(){const t=new Map;for(const e of this.querySelectorAll("[role=treeitem][data-node-id][data-node-type=sub-tree]"))t.set(e.getAttribute("data-node-id"),"true"===e.getAttribute("aria-expanded"));return t},Tl=function(t){for(const[e,i]of t){const t=this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`),n=t?.closest("tree-view-sub-tree-node");n&&(i?n.expand():n.collapse())}},Sl=function(){v(this,el,b(this,Ya,"m",Ll).call(this),"f")},Cl=function(){b(this,el,"f")&&(b(this,Ya,"m",Tl).call(this,b(this,el,"f")),v(this,el,null,"f"))},xl=function(){if(this.treeView)for(const t of this.querySelectorAll("[role=treeitem][data-node-id]")){const e=t.getAttribute("data-node-id"),i=b(this,nl,"f").get(e);void 0!==i&&this.treeView.setNodeCheckedValue(t,i)}},Ml=function(){for(const t of this.querySelectorAll("tree-view-sub-tree-node"))t.expand()},Il=function(t){b(this,Ya,"m",Fl).call(this);const e=[];for(const i of this.querySelectorAll("[role=treeitem]")){const n=this.defaultFilterFn(i,t,"all");n&&e.push(...n)}e.length>0&&b(this,Ya,"m",Nl).call(this,e)},Dl=function(){const t=this.treeView?.formInputPrototype;if(t){for(const t of this.querySelectorAll("[data-filterable-tree-view-retained]"))t.remove();for(const[e,i]of b(this,sl,"f")){if(!!this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`))continue;const n=document.createElement("input");n.type="hidden",n.name=t.name,n.value=JSON.stringify(i),n.setAttribute("data-filterable-tree-view-retained",""),this.appendChild(n)}}},Pl=function(){if(!this.treeView)return;b(this,Ya,"m",Fl).call(this);const t=this.queryString,e=this.filterMode||void 0,i=window.crypto.randomUUID(),n=new Map,s=(...n)=>{for(const s of n)s.expand(),s.removeAttribute("hidden"),s.setAttribute("data-generation",i),o(s.node,t,e)?s.node.removeAttribute("aria-disabled"):s.node.setAttribute("aria-disabled","true")},o=(t,e,i)=>(n.has(t)||n.set(t,this.filterFn(t,e,i)),null!==n.get(t));for(const[n,r]of this.eachDescendantDepthFirst(this.treeViewList,1,[])){const a=r[r.length-1];let l=!1;for(const i of n)o(i,t,e)?(i.closest("li")?.removeAttribute("hidden"),l=!0):i.closest("li")?.setAttribute("hidden","hidden");l?s(...r):a&&(o(a.node,t,e)?s(...r):a.getAttribute("data-generation")!==i&&(a.collapse(),a.setAttribute("hidden","hidden")))}const r=Array.from(n.values()).flat().filter((t=>null!==t));0===r.length&&t.length>0?(this.treeViewList.setAttribute("hidden","hidden"),this.noResultsMessage.removeAttribute("hidden")):(this.treeViewList.removeAttribute("hidden"),this.noResultsMessage.setAttribute("hidden","hidden"),b(this,Ya,"a",ll)&&b(this,Ya,"m",Nl).call(this,r))},Nl=function(t){CSS.highlights?CSS.highlights.set("primer-filterable-tree-view-search-results",new Highlight(...t)):b(this,Ya,"m",Hl).call(this,t)},Hl=function(t){const e=t[0].startContainer,i=e.parentNode,n=e.textContent,s=[];let o=0;for(const{startOffset:e,endOffset:i}of t){e>o&&s.push(document.createTextNode(n.slice(o,e)));const t=document.createElement("mark");t.textContent=n.slice(e,i),s.push(t),o=i}o<n.length&&s.push(document.createTextNode(n.slice(o)));for(const t of s.reverse())i.insertBefore(t,e.nextSibling);i.removeChild(e)},Fl=function(){for(const t of this.querySelectorAll("mark"))t.parentElement&&t.parentElement.replaceChildren(t.parentElement.textContent)},g([U],Ol.prototype,"filterInput",void 0),g([U],Ol.prototype,"filterModeControlList",void 0),g([U],Ol.prototype,"treeViewList",void 0),g([U],Ol.prototype,"noResultsMessage",void 0),g([U],Ol.prototype,"includeSubItemsCheckBox",void 0),Ol=g([j("filterable-tree-view")],Ol),window.customElements.get("filterable-tree-view")||(window.FilterableTreeViewElement=Ol,window.customElements.define("filterable-tree-view",Ol))}();
1
+ !function(){"use strict";var t,e,i,n,s,o,r,a,l=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},c=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const d=new WeakMap;let h=null;class IncludeFragmentElement extends HTMLElement{constructor(){super(...arguments),t.add(this),e.set(this,!1),i.set(this,new IntersectionObserver((e=>{for(const s of e)if(s.isIntersecting){const{target:e}=s;if(l(this,i,"f").unobserve(e),!(e instanceof IncludeFragmentElement))return;"lazy"===e.loading&&l(this,t,"m",n).call(this)}}),{rootMargin:"0px 0px 256px 0px",threshold:.01}))}static define(t="include-fragment",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){h=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return l(this,t,"m",o).call(this)}attributeChangedCallback(e,i){"src"===e?this.isConnected&&"eager"===this.loading&&l(this,t,"m",n).call(this):"loading"===e&&this.isConnected&&"eager"!==i&&"eager"===this.loading&&l(this,t,"m",n).call(this)}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=":host {display: block;}",this.shadowRoot.append(t,document.createElement("slot"))}this.src&&"eager"===this.loading&&l(this,t,"m",n).call(this),"lazy"===this.loading&&l(this,i,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return l(this,t,"m",o).call(this)}fetch(t){return fetch(t)}refetch(){d.delete(this),l(this,t,"m",n).call(this)}}e=new WeakMap,i=new WeakMap,t=new WeakSet,n=async function(){if(!l(this,e,"f")){c(this,e,!0,"f"),l(this,i,"f").unobserve(this);try{const i=await l(this,t,"m",s).call(this);if(i instanceof Error)throw i;const n=i,o=document.createElement("template");o.innerHTML=n;const r=document.importNode(o.content,!0);if(!this.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:r}})))return void c(this,e,!1,"f");this.replaceWith(r),this.dispatchEvent(new CustomEvent("include-fragment-replaced"))}catch(t){this.classList.add("is-error")}finally{c(this,e,!1,"f")}}},s=async function(){const e=this.src,i=d.get(this);if(i&&i.src===e)return i.data;{let i;return i=e?l(this,t,"m",a).call(this):Promise.reject(new Error("missing src")),d.set(this,{src:e,data:i}),i}},o=async function(){const e=await l(this,t,"m",s).call(this);if(e instanceof Error)throw e;return e.toString()},r=async function(t,e){await new Promise((t=>setTimeout(t,0)));for(const i of t)this.dispatchEvent(e?new CustomEvent(i,{detail:{error:e}}):new Event(i))},a=async function(){try{await l(this,t,"m",r).call(this,["loadstart"]);const i=await this.fetch(this.request()),n=i.headers.get("Content-Type");if(!(e=this.accept,e&&e.split(",").find((t=>t.match(/^\s*\*\/\*/)))||n&&n.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${n}`);if(200!==i.status)throw new Error(`Failed to load resource: the server responded with a status of ${i.status}`);const s=await i.text();let o=s;if(h){o=(await h).createHTML(s,i)}return l(this,t,"m",r).call(this,["load","loadend"]),o}catch(e){throw l(this,t,"m",r).call(this,["error","loadend"],e),e}var e};const u="undefined"!=typeof globalThis?globalThis:window;try{u.IncludeFragmentElement=IncludeFragmentElement.define()}catch(t){if(!(u.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}const m=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=f.bind(null,this,!0),e={currentQuery:null,oninput:p((e=>t(e))),fetch:t,controller:null};m.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&f(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=m.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=m.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function f(t,e,i){const n=t.input;if(!n)return;const s=m.get(t);if(!s)return;const o=n.value;if(e&&s.currentQuery===o)return;s.currentQuery=o;const r=t.src;if(!r)return;const a=document.getElementById(t.getAttribute("aria-owns")||"");if(!a)return;const l=new URL(r,window.location.href),c=new URLSearchParams(l.search);let d;c.append(t.getAttribute("param")||"q",o),l.search=c.toString(),s.controller?s.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let h="";try{d=await async function(t,e,i){try{const n=await fetch(e,i);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),n}catch(e){throw e instanceof Error&&"AbortError"!==(null==e?void 0:e.name)&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,l.toString(),{signal:s.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),h=await d.text(),t.removeAttribute("loading"),s.controller=null}catch(e){return void(e instanceof Error&&"AbortError"!==e.name&&(t.removeAttribute("loading"),s.controller=null))}d&&d.ok?(a.innerHTML=h,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0,detail:{eventType:i?i.type:void 0}}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function p(t){let e;return function(i){clearTimeout(e),e=setTimeout((()=>{clearTimeout(e),t(i)}),300)}}function g(t,e,i,n){var s,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,i,r):s(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r}function b(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function v(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i}window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement)),"function"==typeof SuppressedError&&SuppressedError;const w=new WeakSet;function y(t){k(t),A(t)}const E=new WeakMap;function A(t=document){if(E.has(t))return E.get(t);let e=!1;const i=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)T(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&k(t)}));i.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const n={get closed(){return e},unsubscribe(){e=!0,E.delete(t),i.disconnect()}};return E.set(t,n),n}function k(t){for(const e of t.querySelectorAll("[data-action]"))T(e);t instanceof Element&&t.hasAttribute("data-action")&&T(t)}function L(t){const e=t.currentTarget;for(const i of S(e))if(t.type===i.type){const n=e.closest(i.tag);w.has(n)&&"function"==typeof n[i.method]&&n[i.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&w.has(s.host)&&s.host.matches(i.tag)){const e=s.host;"function"==typeof e[i.method]&&e[i.method](t)}}}function*S(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),i=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,i),method:e.slice(i+1)||"handleEvent"}||"handleEvent"}}function T(t){for(const e of S(t))t.addEventListener(e.type,L)}const C=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),x=(t,e="property")=>{const i=C(t);if(!i.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return i};const M="attr";function I(t,e){$(t,M).add(e)}const D=new WeakSet;function P(t,e){if(D.has(t))return;D.add(t);const i=Object.getPrototypeOf(t),n=i?.constructor?.attrPrefix??"data-";e||(e=$(i,M));for(const i of e){const e=t[i],s=x(`${n}${i}`);let o={configurable:!0,get(){return this.getAttribute(s)||""},set(t){this.setAttribute(s,t||"")}};"number"==typeof e?o={configurable:!0,get(){return Number(this.getAttribute(s)||0)},set(t){this.setAttribute(s,t)}}:"boolean"==typeof e&&(o={configurable:!0,get(){return this.hasAttribute(s)},set(t){this.toggleAttribute(s,t)}}),Object.defineProperty(t,i,o),i in t&&!t.hasAttribute(s)&&o.set.call(t,e)}}const N=new Map,H=new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),F=new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const i={once:!0,passive:!0,signal:e.signal},n=()=>e.abort();document.addEventListener("mousedown",n,i),document.addEventListener("touchstart",n,i),document.addEventListener("keydown",n,i),document.addEventListener("pointerdown",n,i)})),O={ready:()=>H,firstInteraction:()=>F,visible:t=>new Promise((e=>{const i=new IntersectionObserver((t=>{for(const n of t)if(n.isIntersecting)return e(),void i.disconnect()}),{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const e of document.querySelectorAll(t))i.observe(e)}))},q=new WeakMap;function V(t){cancelAnimationFrame(q.get(t)||0),q.set(t,requestAnimationFrame((()=>{for(const e of N.keys()){const i=t instanceof Element&&t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||i){const n=i?.getAttribute("data-load-on")||"ready",s=n in O?O[n]:O.ready;for(const t of N.get(e)||[])s(e).then(t);N.delete(e),q.delete(t)}}})))}let R;const W=Symbol.for("catalyst");class B{constructor(t,e){const i=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){i.connectedCallback(this,n)};const s=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){i.disconnectedCallback(this,s)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,e,n){i.attributeChangedCallback(this,t,e,n,o)};let r=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return i.observedAttributes(this,r)},set(t){r=t}}),function(t){let e=t.observedAttributes||[];const i=t.attrPrefix??"data-",n=t=>x(`${i}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...$(t.prototype,M)].map(n).concat(e),set(t){e=t}})}(t),function(t,e){const i=e||C(t.name).replace(/-element$/,"");try{window.customElements.define(i,t),window[t.name]=customElements.get(i)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t,e)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),P(t),function(t){w.add(t),t.shadowRoot&&y(t.shadowRoot),k(t),A(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&(y(t.shadowRoot),function(t){R||(R=new MutationObserver((t=>{if(N.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&V(t)}))),V(t),R.observe(t,{subtree:!0,childList:!0})}(t.shadowRoot))}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,i,n,s){P(t),"data-catalyst"!==e&&s&&s.call(t,e,i,n)}}function $(t,e){if(!Object.prototype.hasOwnProperty.call(t,W)){const e=t[W],i=t[W]=new Map;if(e)for(const[t,n]of e)i.set(t,new Set(n))}const i=t[W];return i.has(e)||i.set(e,new Set),i.get(e)}function U(t,e){$(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase();if(t.shadowRoot)for(const n of t.shadowRoot.querySelectorAll(`[data-target~="${i}.${e}"]`))if(!n.closest(i))return n;for(const n of t.querySelectorAll(`[data-target~="${i}.${e}"]`))if(n.closest(i)===t)return n}(this,e)}})}function K(t,e){$(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const i=t.tagName.toLowerCase(),n=[];if(t.shadowRoot)for(const s of t.shadowRoot.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)||n.push(s);for(const s of t.querySelectorAll(`[data-targets~="${i}.${e}"]`))s.closest(i)===t&&n.push(s);return n}(this,e)}})}function j(t){if("string"==typeof t)return e=>{new B(e,t)};new B(t)}var z;class _{constructor(t){this.resizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof HTMLElement&&this.update(t)}})),this.resizeObserver.observe(t)}unobserve(t){this.resizeObserver.unobserve(t)}update(t){const e=t.querySelectorAll("li");for(const t of e){const e=t.querySelector(".ActionListItem-label");if(!e)continue;const i=t.querySelector(".ActionListItem-truncationTooltip");if(!i)continue;const n=e.scrollWidth>e.clientWidth;i.style.display=n?"":"none"}}}let Z=class ActionListElement extends HTMLElement{constructor(){super(...arguments),z.set(this,void 0)}connectedCallback(){v(this,z,new _(this),"f")}disconnectedCallback(){b(this,z,"f").unobserve(this)}};z=new WeakMap,Z=g([j("action-list")],Z);const Y={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},G={start:["end","center"],end:["start","center"],center:["end","start"]};function J(t,e,i={}){const n=function(t){if(function(t){var e;if("DIALOG"===t.tagName)return!0;try{if(t.matches(":popover-open")&&/native code/.test(null===(e=document.body.showPopover)||void 0===e?void 0:e.toString()))return!0}catch(t){return!1}return!1}(t))return document.body;let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),s=function(t){let e=t;for(;null!==e&&e instanceof Element;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const i=e!==document.body&&e instanceof HTMLElement?e:document.body,n=i.getBoundingClientRect(),s=getComputedStyle(i),[o,r,a,l]=[s.borderTopWidth,s.borderLeftWidth,s.borderRightWidth,s.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:n.top+o,left:n.left+r,width:n.width-a-r,height:Math.max(n.height-o-l,i===document.body?window.innerHeight:-1/0)}}(n),o=getComputedStyle(n),r=n.getBoundingClientRect(),[a,l]=[o.borderTopWidth,o.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,i,n,{side:s,align:o,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let d=Q(i,n,s,o,a,l),h=s,u=o;if(d.top-=e.top,d.left-=e.left,!r){const r=Y[s];let m=0;if(r){let t=s;for(;m<r.length&&tt(t,d,c,i);){const s=r[m++];t=s,d=Q(i,n,s,o,a,l),d.top-=e.top,d.left-=e.left,h=s}}const f=G[o];let p=0;if(f){let t=o;for(;p<f.length&&et(t,d,c,i);){const s=f[p++];t=s,d=Q(i,n,h,s,a,l),d.top-=e.top,d.left-=e.left,u=s}}d.top<c.top&&(d.top=c.top),d.left<c.left&&(d.left=c.left),d.left+i.width>t.width+c.left&&(d.left=t.width+c.left-i.width),r&&m<r.length&&d.top+i.height>t.height+c.top&&(d.top=Math.max(t.height+c.top-i.height,0))}return Object.assign(Object.assign({},d),{anchorSide:h,anchorAlign:u})}(s,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,i,n,s,o;const r=null!==(e=t.side)&&void 0!==e?e:X.side,a=null!==(i=t.align)&&void 0!==i?i:X.align;return{side:r,align:a,anchorOffset:null!==(n=t.anchorOffset)&&void 0!==n?n:"inside-center"===r?0:X.anchorOffset,alignmentOffset:null!==(s=t.alignmentOffset)&&void 0!==s?s:"center"!==a&&r.startsWith("inside")?X.alignmentOffset:0,allowOutOfBounds:null!==(o=t.allowOutOfBounds)&&void 0!==o?o:X.allowOutOfBounds}}(i))}const X={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Q(t,e,i,n,s,o){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===i?l=e.top-s-t.height:"outside-bottom"===i?l=a+s:"outside-left"===i?c=e.left-s-t.width:"outside-right"===i&&(c=r+s),"outside-top"!==i&&"outside-bottom"!==i||(c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o),"outside-left"!==i&&"outside-right"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),"inside-top"===i?l=e.top+s:"inside-bottom"===i?l=a-s-t.height:"inside-left"===i?c=e.left+s:"inside-right"===i?c=r-s-t.width:"inside-center"===i&&(c=(r+e.left)/2-t.width/2+s),"inside-top"===i||"inside-bottom"===i?c="start"===n?e.left+o:"center"===n?e.left-(t.width-e.width)/2+o:r-t.width-o:"inside-left"!==i&&"inside-right"!==i&&"inside-center"!==i||(l="start"===n?e.top+o:"center"===n?e.top-(t.height-e.height)/2+o:a-t.height-o),{top:l,left:c}}function tt(t,e,i,n){return"outside-top"===t||"outside-bottom"===t?e.top<i.top||e.top+n.height>i.height+i.top:e.left<i.left||e.left+n.width>i.width+i.left}function et(t,e,i,n){return"end"===t?e.left<i.left:"start"===t||"center"===t?e.left+n.width>i.left+i.width||e.left<i.left:void 0}function*it(t,e={}){var i,n;const s=null!==(i=e.strict)&&void 0!==i&&i,o=null!==(n=e.onlyTabbable)&&void 0!==n&&n?ot:st,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&o(t,s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&o(t,s)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&o(t,s)&&(yield t)}function nt(t,e=!1){return it(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function st(t,e=!1){const i=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,n=t.hidden,s=t instanceof HTMLInputElement&&"hidden"===t.type,o=t.classList.contains("sentinel");if(i||n||s||o)return!1;if(e){const e=getComputedStyle(t),i=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(e.visibility),s="none"===e.display||!t.offsetParent,o=0===t.getClientRects().length;if(i||n||o||s)return!1}return null!=t.getAttribute("tabindex")||("true"===t.getAttribute("contenteditable")||"plaintext-only"===t.getAttribute("contenteditable")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex)}function ot(t,e=!1){return st(t,e)&&"-1"!==t.getAttribute("tabindex")}let rt=!1;function at(){}try{const t=Object.create({},{signal:{get(){rt=!0}}});window.addEventListener("test",at,t),window.removeEventListener("test",at,t)}catch(t){}function lt(){rt||(!function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,i,n){return"object"==typeof n&&"signal"in n&&n.signal instanceof AbortSignal&&t.call(n.signal,"abort",(()=>{this.removeEventListener(e,i,n)})),t.call(this,e,i,n)}}(),rt=!0)}lt();const ct=[];let dt,ht;function ut(t,e,i){const n=new AbortController,s=null!=i?i:n.signal;t.setAttribute("data-focus-trap","active");const o=document.createElement("span");o.setAttribute("class","sentinel"),o.setAttribute("tabindex","0"),o.setAttribute("aria-hidden","true"),o.onfocus=()=>{const e=nt(t,!0);null==e||e.focus()};const r=document.createElement("span");r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=nt(t);null==e||e.focus()};Array.from(t.children).filter((t=>t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length||(t.prepend(o),t.append(r));const a=function(t,e){const i=new MutationObserver((i=>{for(const n of i)if("childList"===n.type&&n.addedNodes.length){if(Array.from(n.addedNodes).filter((t=>t instanceof HTMLElement&&t.classList.contains("sentinel")&&"SPAN"===t.tagName)).length)return;const i=t.firstElementChild,s=t.lastElementChild,[o,r]=e;(null==i?void 0:i.classList.contains("sentinel"))||t.insertAdjacentElement("afterbegin",o),(null==s?void 0:s.classList.contains("sentinel"))||t.insertAdjacentElement("beforeend",r)}}));return i.observe(t,{childList:!0}),i}(t,[o,r]);let l;function c(i){if(i instanceof HTMLElement&&document.contains(t)){if(t.contains(i))return void(l=i);if(l&&ot(l)&&t.contains(l))return void l.focus();if(e&&t.contains(e))return void e.focus();{const e=nt(t);return void(null==e||e.focus())}}}const d=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(s);if(dt){const t=dt;dt.container.setAttribute("data-focus-trap","suspended"),dt.controller.abort(),ct.push(t)}d.signal.addEventListener("abort",(()=>{dt=void 0})),s.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const i=ct.findIndex((e=>e.container===t));i>=0&&ct.splice(i,1),a.disconnect(),function(){const t=ct.pop();t&&ut(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:d.signal,capture:!0}),c(document.activeElement),dt={container:t,controller:d,initialFocus:e,originalSignal:s};const h=ct.findIndex((e=>e.container===t));if(h>=0&&ct.splice(h,1),!i)return n}function mt(){return void 0===ht&&(ht=/^mac/i.test(window.navigator.platform)),ht}let ft=1e4;const pt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);var gt;lt(),function(t){t[t.ArrowHorizontal=1]="ArrowHorizontal",t[t.ArrowVertical=2]="ArrowVertical",t[t.JK=4]="JK",t[t.HL=8]="HL",t[t.HomeAndEnd=16]="HomeAndEnd",t[t.PageUpDown=256]="PageUpDown",t[t.WS=32]="WS",t[t.AD=64]="AD",t[t.Tab=128]="Tab",t[t.Backspace=512]="Backspace",t[t.ArrowAll=3]="ArrowAll",t[t.HJKL=12]="HJKL",t[t.WASD=96]="WASD",t[t.All=511]="All"}(gt||(gt={}));const bt={ArrowLeft:gt.ArrowHorizontal,ArrowDown:gt.ArrowVertical,ArrowUp:gt.ArrowVertical,ArrowRight:gt.ArrowHorizontal,h:gt.HL,j:gt.JK,k:gt.JK,l:gt.HL,a:gt.AD,s:gt.WS,w:gt.WS,d:gt.AD,Tab:gt.Tab,Home:gt.HomeAndEnd,End:gt.HomeAndEnd,PageUp:gt.PageUpDown,PageDown:gt.PageUpDown,Backspace:gt.Backspace},vt={ArrowLeft:"previous",ArrowDown:"next",ArrowUp:"previous",ArrowRight:"next",h:"previous",j:"next",k:"previous",l:"next",a:"previous",s:"next",w:"previous",d:"next",Tab:"next",Home:"start",End:"end",PageUp:"start",PageDown:"end",Backspace:"previous"};function wt(t){const e=vt[t.key];if("Tab"===t.key&&t.shiftKey)return"previous";const i=mt();if(i&&t.metaKey||!i&&t.ctrlKey){if("ArrowLeft"===t.key||"ArrowUp"===t.key)return"start";if("ArrowRight"===t.key||"ArrowDown"===t.key)return"end"}return e}function yt(t,e){const i=t.key,n=[...i].length,s=function(t){var e,i;if(!(t instanceof HTMLElement))return!1;const n=t.nodeName.toLowerCase(),s=null!==(i=null===(e=t.getAttribute("type"))||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"text",o="true"===t.ariaReadOnly||"true"===t.getAttribute("aria-readonly")||null!==t.getAttribute("readonly");return("select"===n||"textarea"===n||"input"===n&&!pt.has(s)||t.isContentEditable)&&!o}(e),o=e instanceof HTMLSelectElement;if(s&&(1===n||"Home"===i||"End"===i))return!0;if(o)return!("ArrowDown"!==i||!mt()||t.metaKey)||!("ArrowDown"!==i||mt()||!t.altKey);if(s&&!o){const t=e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement,n=t&&0===e.selectionStart&&0===e.selectionEnd,s=t&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length;if("ArrowLeft"===i&&!n)return!0;if("ArrowRight"===i&&!s)return!0;const o=e instanceof HTMLElement&&e.isContentEditable;if(e instanceof HTMLTextAreaElement||o){if("PageUp"===i||"PageDown"===i)return!0;if("ArrowUp"===i&&!n)return!0;if("ArrowDown"===i&&!s)return!0}}return!1}const Et="data-is-active-descendant",At="activated-directly",kt="activated-indirectly",Lt="data-has-active-descendant";function St(t,e){var i,n,s,o,r,a;const l=[],c=new WeakMap,d=null!==(i=null==e?void 0:e.bindKeys)&&void 0!==i?i:((null==e?void 0:e.getNextFocusable)?gt.ArrowAll:gt.ArrowVertical)|gt.HomeAndEnd,h=null!==(n=null==e?void 0:e.focusOutBehavior)&&void 0!==n?n:"stop",u=null!==(s=null==e?void 0:e.focusInStrategy)&&void 0!==s?s:"previous",m=null==e?void 0:e.activeDescendantControl,f=null==e?void 0:e.onActiveDescendantChanged,p=null!==(o=null==e?void 0:e.ignoreHoverEvents)&&void 0!==o&&o;let g;const b=null!==(r=null==e?void 0:e.preventScroll)&&void 0!==r&&r,v="initial"===u&&(null==e?void 0:e.activeDescendantControl);function w(){return l[0]}function y(t,e=!1){const i=g;g=t,m?t&&document.activeElement===m?E(i,t,e):A():(i&&i!==t&&c.has(i)&&i.setAttribute("tabindex","-1"),null==t||t.setAttribute("tabindex","0"))}function E(e,i,n=!1){i.id||i.setAttribute("id","__primer_id_"+ft++),e&&e!==i&&e.removeAttribute(Et),m&&(n||m.getAttribute("aria-activedescendant")!==i.id)&&(m.setAttribute("aria-activedescendant",i.id),t.setAttribute(Lt,i.id),i.setAttribute(Et,n?At:kt),null==f||f(i,e,n))}function A(e=g){"first"===u&&(g=void 0),null==m||m.removeAttribute("aria-activedescendant"),t.removeAttribute(Lt),null==e||e.removeAttribute(Et);for(const e of t.querySelectorAll(`[${Et}]`))null==e||e.removeAttribute(Et);null==f||f(void 0,e,!1)}function k(...t){const i=t.filter((t=>{var i,n;return null===(n=null===(i=null==e?void 0:e.focusableElementFilter)||void 0===i?void 0:i.call(e,t))||void 0===n||n}));if(0!==i.length){l.splice(function(t){const e=t[0];if(0===l.length)return 0;let i=0,n=l.length-1;for(;i<=n;){const t=Math.floor((i+n)/2);L(e,l[t])?n=t-1:i=t+1}return i}(i),0,...i);for(const t of i)c.has(t)||c.set(t,t.getAttribute("tabindex")),t.setAttribute("tabindex","-1");g||v||y(w())}}function L(t,e){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)>0}function S(...t){for(const e of t){const t=l.indexOf(e);t>=0&&l.splice(t,1);const i=c.get(e);if(void 0!==i&&(null===i?e.removeAttribute("tabindex"):e.setAttribute("tabindex",i),c.delete(e)),e===g){y(w())}}}const T={reverse:null==e?void 0:e.reverse,strict:null==e?void 0:e.strict,onlyTabbable:null==e?void 0:e.onlyTabbable};k(...it(t,T));const C="function"==typeof u?u(document.body):w();v||y(C);new MutationObserver((t=>{for(const e of t){for(const t of e.removedNodes)t instanceof HTMLElement&&S(...it(t));"attributes"===e.type&&null===e.oldValue&&e.target instanceof HTMLElement&&S(e.target)}for(const e of t){for(const t of e.addedNodes)t instanceof HTMLElement&&k(...it(t,T));"attributes"===e.type&&null!==e.oldValue&&e.target instanceof HTMLElement&&k(e.target)}})).observe(t,{subtree:!0,childList:!0,attributeFilter:["hidden","disabled"],attributeOldValue:!0});const x=new AbortController,M=null!==(a=null==e?void 0:e.abortSignal)&&void 0!==a?a:x.signal;let I;M.addEventListener("abort",(()=>{S(...l)})),t.addEventListener("mousedown",(t=>{t.target instanceof HTMLElement&&t.target!==document.activeElement&&(I=l.indexOf(t.target))}),{signal:M}),m?(t.addEventListener("focusin",(t=>{t.target instanceof HTMLElement&&l.includes(t.target)&&(m.focus({preventScroll:b}),y(t.target))}),{signal:M}),p||t.addEventListener("mousemove",(({target:t})=>{if(!(t instanceof Node))return;const e=l.find((e=>e.contains(t)));e&&y(e)}),{signal:M,capture:!0}),m.addEventListener("focusin",(()=>{g?E(void 0,g):v||y(w())}),{signal:M}),m.addEventListener("focusout",(()=>{A()}),{signal:M})):t.addEventListener("focusin",(e=>{if(e.target instanceof HTMLElement)if(void 0!==I)I>=0&&l[I]!==g&&y(l[I]),I=void 0;else if("previous"===u)y(e.target);else if("closest"===u||"first"===u){if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t="previous"===P?l.length-1:0,e=l[t];return void(null==e||e.focus({preventScroll:b}))}y(e.target)}else if("function"==typeof u)if(e.relatedTarget instanceof Element&&!t.contains(e.relatedTarget)){const t=u(e.relatedTarget);if((t?l.indexOf(t):-1)>=0&&t instanceof HTMLElement)return void t.focus({preventScroll:b});console.warn("Element requested is not a known focusable element.")}else y(e.target);P=void 0}),{signal:M});const D=null!=m?m:t;let P;return"closest"===u&&document.addEventListener("keydown",(t=>{"Tab"===t.key&&(P=wt(t))}),{signal:M,capture:!0}),D.addEventListener("keydown",(i=>{var n;if(i.key in vt){const s=bt[i.key];if(!i.defaultPrevented&&(s&d)>0&&!yt(i,document.activeElement)){const s=wt(i);let o;if((null==e?void 0:e.getNextFocusable)&&(o=e.getNextFocusable(s,null!==(n=document.activeElement)&&void 0!==n?n:void 0,i)),!o){const e=function(){if(!g)return v?-1:0;const e=l.indexOf(g);return-1!==e?e:g===t?-1:0}();let n=e;"previous"===s?n-=1:"start"===s?n=0:"next"===s?n+=1:n=l.length-1,n<0&&(n="wrap"===h&&"Tab"!==i.key?l.length-1:0),n>=l.length&&(n="wrap"===h&&"Tab"!==i.key?0:l.length-1),e!==n&&(o=l[n])}m?y(o||g,!0):o&&(P=s,o.focus({preventScroll:b})),("Tab"!==i.key||o)&&i.preventDefault()}}}),{signal:M}),x}var Tt,Ct,xt,Mt,It,Dt,Pt,Nt;const Ht=new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t instanceof Ot&&t.update()}})),Ft=new ResizeObserver((t=>{for(const e of t){const t=e.target;t instanceof Ot&&t.update()}}));let Ot=class ActionBarElement extends HTMLElement{constructor(){super(...arguments),Tt.add(this),Ct.set(this,null),xt.set(this,!1)}connectedCallback(){Ft.observe(this),Ht.observe(this),this.style.overflow="visible",this.update()}disconnectedCallback(){Ft.unobserve(this),Ht.unobserve(this)}menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}update(){b(this,xt,"f")||(v(this,xt,!0,"f"),requestAnimationFrame((()=>{v(this,xt,!1,"f"),b(this,Tt,"m",Mt).call(this)})))}};Ct=new WeakMap,xt=new WeakMap,Tt=new WeakSet,Mt=function(){const t=b(this,Tt,"a",It);if(!t)return;const e=t.getBoundingClientRect().top,i=b(this,Tt,"a",Nt),n=Array.from(this.items,(t=>({top:t.getBoundingClientRect().top,isDivider:t.classList.contains("ActionBar-divider")})));let s=!1;for(let t=0;t<n.length;t++){const o=n[t];o.isDivider?s=!0:(o.top>e?(b(this,Tt,"m",Pt).call(this,t,i),this.moreMenu.hidden&&(this.moreMenu.hidden=!1),s&&b(this,Tt,"m",Pt).call(this,t-1,i)):(b(this,Tt,"m",Dt).call(this,t,i),t===this.items.length-1&&(this.moreMenu.hidden=!0),s&&b(this,Tt,"m",Dt).call(this,t-1,i)),s=!1)}b(this,Ct,"f")&&b(this,Ct,"f").abort(),v(this,Ct,St(this,{bindKeys:gt.ArrowHorizontal|gt.HomeAndEnd,focusOutBehavior:"wrap",focusableElementFilter:t=>{const e=this.items.indexOf(t.parentElement),i=e>-1&&"visible"===this.items[e].style.visibility,n=t===this.moreMenu.invokerElement&&!this.moreMenu.hidden;return i||n}}),"f")},It=function(){return this.items.find((t=>!t.classList.contains("ActionBar-divider")))??null},Dt=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","visible"),n.hidden=!0)},Pt=function(t,e){const i=this.items[t],n=e[t];i&&n&&(i.style.setProperty("visibility","hidden"),n.hidden=!1)},Nt=function(){return this.moreMenu.querySelectorAll('[role="menu"] > li')},g([K],Ot.prototype,"items",void 0),g([U],Ot.prototype,"itemContainer",void 0),g([U],Ot.prototype,"moreMenu",void 0),Ot=g([j("action-bar")],Ot),window.ActionBarElement=Ot;class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const i=[Rt(t,"compositionstart",(t=>Yt(this,t))),Rt(t,"compositionend",(t=>Yt(this,t))),Rt(t,"click",(e=>jt(t,e))),Rt(t,"change",(e=>jt(t,e))),Rt(t,"keydown",(e=>function(t,e,i){if(!(i instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const n=qt.get(e);if(!n||n.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":t.hasAttribute("open")&&(Zt(t),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!0);e&&e.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Ut(t,!1);e&&e.focus(),i.preventDefault()}break;case"n":if(Kt&&i.ctrlKey){const e=Ut(t,!0);e&&e.focus(),i.preventDefault()}break;case"p":if(Kt&&i.ctrlKey){const e=Ut(t,!1);e&&e.focus(),i.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&_t(e)&&e.closest("details")===t&&(i.preventDefault(),i.stopPropagation(),e.click())}}}(t,this,e))),Rt(t,"toggle",(()=>Wt(t,this)),{once:!0}),Rt(t,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const i=e.closest("details");i&&i!==t&&!i.contains(t)&&i.removeAttribute("open")}}(t))),this.preload?Rt(t,"mouseover",(()=>Wt(t,this)),{once:!0}):Vt,...Bt(t)];qt.set(this,{subscriptions:i,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=qt.get(this);if(t){qt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const qt=new WeakMap,Vt={unsubscribe(){}};function Rt(t,e,i,n=!1){return t.addEventListener(e,i,n),{unsubscribe:()=>{t.removeEventListener(e,i,n)}}}function Wt(t,e){const i=e.getAttribute("src");if(!i)return;const n=qt.get(e);if(!n)return;if(n.loaded)return;n.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",(()=>$t(t))),s.setAttribute("src",i))}function Bt(t){let e=!1;return[Rt(t,"mousedown",(()=>e=!0)),Rt(t,"keydown",(()=>e=!1)),Rt(t,"toggle",(()=>{t.hasAttribute("open")&&($t(t)||e||function(t){const e=document.activeElement;if(e&&_t(e)&&t.contains(e))return;const i=Ut(t,!0);i&&i.focus()}(t))}))]}function $t(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Ut(t,e){const i=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),n=document.activeElement,s=n instanceof HTMLElement?i.indexOf(n):-1,o=e?i[s+1]:i[s-1],r=e?i[0]:i[i.length-1];return o||r}const Kt=navigator.userAgent.match(/Macintosh/);function jt(t,e){const i=e.target;if(i instanceof Element&&i.closest("details")===t)if("click"===e.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const n=e.querySelector("input");if("LABEL"===e.tagName&&i===n)return;"LABEL"===e.tagName&&n&&!n.checked||zt(e,t)}else if("change"===e.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&zt(e,t)}}function zt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const i=t.closest("details-menu");if(!i)return;i.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const i=e.querySelector("[data-menu-button]");if(!i)return;const n=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(n)i.textContent=n;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(i.innerHTML=e)}}(t,e),function(t,e){for(const i of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=i.querySelector('input[type="radio"], input[type="checkbox"]');let n=(i===t).toString();e instanceof HTMLInputElement&&(n=e.indeterminate?"mixed":e.checked.toString()),i.setAttribute("aria-checked",n)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Zt(e),i.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function _t(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Zt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Yt(t,e){const i=qt.get(t);i&&(i.isComposing="compositionstart"===e.type)}var Gt,Jt;window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Xt=(()=>{const t=new Set;let e=null,i=null;function n(){for(const e of t)e.update()}return s=>{window.addEventListener("resize",n),window.addEventListener("scroll",n),e||(e=new IntersectionObserver((e=>{for(const i of e){const e=i.target;i.isIntersecting?(e.update(),t.add(e)):t.delete(e)}}))),i||(i=new ResizeObserver((()=>{for(const e of t)e.update()}))),i.observe(s.ownerDocument.documentElement),e.observe(s)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),Gt.set(this,null),Jt.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(b(this,Gt,"f"))return b(this,Gt,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){v(this,Gt,t,"f"),b(this,Gt,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",(()=>this.update())),Xt(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(b(this,Jt,"f")),v(this,Jt,requestAnimationFrame((()=>{const t=this.anchorElement;if(this.classList.toggle("not-anchored",!t),t){const{left:e,top:i}=J(this,t,this);this.style.top=`${i}px`,this.style.left=`${e}px`,this.style.bottom="auto",this.style.right="auto"}else this.style.top="0",this.style.left="0",this.style.bottom="0",this.style.right="0"})),"f"))}}var Qt,te,ee;function ie(t){t.body.style.getPropertyValue("--dialog-scrollgutter")||t.body.style.setProperty("--dialog-scrollgutter",window.innerWidth-t.body.clientWidth+"px")}function ne(t){t.body.classList.toggle("has-modal",Boolean(t.querySelector("dialog[open]"))),t.body.classList.toggle("has-modal-disable-scroll",Boolean(t.querySelector("dialog[open].Overlay--disableScroll")))}function se(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){const e=document.getElementById(n);if(e instanceof HTMLDialogElement){ie(e.ownerDocument),e.showModal(),t.preventDefault();let n=i,s=!1;for(;n;)n=n.parentElement?.closest("[popover]"),n&&"auto"===n.popover&&(n.classList.add("dialog-inside-popover-fix"),n.popover="manual",n.showPopover(),s=!0);s&&(e.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),e.close(),e.showModal(),e.addEventListener("close",(()=>{for(const t of e.ownerDocument.querySelectorAll(".dialog-inside-popover-fix"))t.contains(e)&&(t.classList.remove("dialog-inside-popover-fix"),t.popover="auto",t.showPopover())}),{once:!0})),ne(e.ownerDocument)}}if(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n){const t=document.getElementById(n);t instanceof HTMLDialogElement&&t.open&&(t.close(),ne(t.ownerDocument))}}Gt=new WeakMap,Jt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));class DialogHelperElement extends HTMLElement{constructor(){super(...arguments),Qt.add(this),te.set(this,null)}get dialog(){return this.querySelector("dialog")}connectedCallback(){const{signal:t}=v(this,te,new AbortController,"f");document.addEventListener("click",se,!0),document.addEventListener("click",this,{signal:t}),this.dialog?.addEventListener("close",(()=>ne(this.dialog.ownerDocument)),{signal:t}),new MutationObserver((t=>{for(const e of t)e.target===this.dialog&&b(this,Qt,"m",ee).call(this)})).observe(this,{subtree:!0,attributeFilter:["open"]}),b(this,Qt,"m",ee).call(this)}disconnectedCallback(){b(this,te,"f")?.abort()}handleEvent(t){const e=t.target,i=this.dialog;if(e!==i||!i?.open)return;if(i.querySelector("form"))return;const n=i.getBoundingClientRect();n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width||i.close()}}te=new WeakMap,Qt=new WeakSet,ee=function(){if(!this.dialog)return;const{ownerDocument:t}=this.dialog;this.dialog.matches("[open]:not(:modal)")&&(this.dialog.addEventListener("close",(t=>t.stopImmediatePropagation()),{once:!0}),this.dialog.close(),ie(t),this.dialog.showModal()),ne(t)},window.customElements.get("dialog-helper")||(window.DialogHelperElement=DialogHelperElement,window.customElements.define("dialog-helper",DialogHelperElement));var oe=class extends Event{oldState;newState;constructor(t,e={}){const i=Object.assign({},e);delete i.oldState,delete i.newState,super(t,i),this.oldState=String(e.oldState||""),this.newState=String(e.newState||"")}},re=new WeakMap;function ae(t,e,i){re.set(t,setTimeout((()=>{re.has(t)&&t.dispatchEvent(new oe("toggle",{cancelable:!1,oldState:e,newState:i}))}),0))}var le=globalThis.ShadowRoot||function(){},ce=globalThis.HTMLDialogElement||function(){},de=new WeakMap,he=new WeakMap,ue=new WeakMap,me=new WeakMap;function fe(t){return me.get(t)||"hidden"}var pe=new WeakMap;function ge(t){return[...t].pop()}function be(t,e){return("auto"===t.popover||"manual"===t.popover||"hint"===t.popover)&&(!!t.isConnected&&((!e||"showing"===fe(t))&&(!(!e&&"hidden"!==fe(t))&&(!(t instanceof ce&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function ve(t){if(!t)return 0;const e=he.get(document)||new Set,i=ue.get(document)||new Set;return i.has(t)?[...i].indexOf(t)+e.size+1:e.has(t)?[...e].indexOf(t)+1:0}function we(t){const e=ke(t),i=function(t){for(;t;){const e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Ae(t))instanceof le&&(t=t.host),t instanceof Document)return}}(t);return ve(e)>ve(i)?e:i}function ye(t){let e;const i=ue.get(t)||new Set,n=he.get(t)||new Set,s=i.size>0?i:n.size>0?n:null;return s?(e=ge(s),e.isConnected?e:(s.delete(e),ye(t))):null}function Ee(t){for(const e of t||[]){if(e.isConnected)return e;t.delete(e)}return null}function Ae(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Ae(t.parentNode):t}function ke(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===me.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||Ae(t))instanceof le&&(t=t.host),t instanceof Document)return}}function Le(t,e){const i=new Map;let n=0;for(const t of e||[])i.set(t,n),n+=1;i.set(t,n),n+=1;let s=null;return function(e){if(!e)return;let n=!1,o=null;for(;!n;){if(o=ke(e)||null,null===o)return;if(!i.has(o))return;"hint"!==t.popover&&"auto"!==o.popover||(n=!0),n||(e=o.parentElement)}const r=i.get(o)??null;(null===s||i.get(s)<r)&&(s=o)}(t.parentElement||Ae(t)),s}function Se(t){return!(t.hidden||t instanceof le)&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&("number"==typeof t.tabIndex&&-1!==t.tabIndex))))}function Te(t){var e;null==(e=function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);let i=e.querySelector("[autofocus]");if(i)return i;{const t=e.querySelectorAll("slot");for(const e of t){const t=e.assignedElements({flatten:!0});for(const e of t){if(e.hasAttribute("autofocus"))return e;if(i=e.querySelector("[autofocus]"),i)return i}}}const n=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let s=n.currentNode;for(;s;){if(Se(s))return s;s=n.nextNode()}}(t))||e.focus()}var Ce=new WeakMap;function xe(t){if(!be(t,!1))return;const e=t.ownerDocument;if(!t.dispatchEvent(new oe("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!be(t,!1))return;let i=!1;const n=t.popover;let s=null;const o=Le(t,he.get(e)||new Set),r=Le(t,ue.get(e)||new Set);if("auto"===n){Ie(ue.get(e)||new Set,i,!0);Pe(o||e,i,!0),s="auto"}if("hint"===n&&(r?(Pe(r,i,!0),s="hint"):(Ie(ue.get(e)||new Set,i,!0),o?(Pe(o,i,!0),s="auto"):s="hint")),"auto"===n||"hint"===n){if(n!==t.popover||!be(t,!1))return;ye(e)||(i=!0),"auto"===s?(he.has(e)||he.set(e,new Set),he.get(e).add(t)):"hint"===s&&(ue.has(e)||ue.set(e,new Set),ue.get(e).add(t))}Ce.delete(t);const a=e.activeElement;t.classList.add(":popover-open"),me.set(t,"showing"),de.has(e)||de.set(e,new Set),de.get(e).add(t),Oe(pe.get(t),!0),Te(t),i&&a&&"auto"===t.popover&&Ce.set(t,a),ae(t,"closed","open")}function Me(t,e=!1,i=!1){var n,s;if(!be(t,!0))return;const o=t.ownerDocument;if(["auto","hint"].includes(t.popover)&&(Pe(t,e,i),!be(t,!0)))return;const r=he.get(o)||new Set,a=r.has(t)&&ge(r)===t;if(Oe(pe.get(t),!1),pe.delete(t),i&&(t.dispatchEvent(new oe("beforetoggle",{oldState:"open",newState:"closed"})),a&&ge(r)!==t&&Pe(t,e,i),!be(t,!0)))return;null==(n=de.get(o))||n.delete(t),r.delete(t),null==(s=ue.get(o))||s.delete(t),t.classList.remove(":popover-open"),me.set(t,"hidden"),i&&ae(t,"open","closed");const l=Ce.get(t);l&&(Ce.delete(t),e&&l.focus())}function Ie(t,e=!1,i=!1){let n=Ee(t);for(;n;)Me(n,e,i),n=Ee(t)}function De(t,e,i,n){let s=!1,o=!1;for(;s||!o;){o=!0;let r=null,a=!1;for(const i of e)if(i===t)a=!0;else if(a){r=i;break}if(!r)return;for(;"showing"===fe(r)&&e.size;)Me(ge(e),i,n);e.has(t)&&ge(e)!==t&&(s=!0),s&&(n=!1)}}function Pe(t,e,i){var n,s;const o=t.ownerDocument||t;if(t instanceof Document)return function(t,e=!1,i=!1){let n=ye(t);for(;n;)Me(n,e,i),n=ye(t)}(o,e,i);(null==(n=ue.get(o))?void 0:n.has(t))?De(t,ue.get(o),e,i):(Ie(ue.get(o)||new Set,e,i),(null==(s=he.get(o))?void 0:s.has(t))&&De(t,he.get(o),e,i))}var Ne=new WeakMap;function He(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const i=e.ownerDocument;if(!ye(i))return;const n=we(e);if(n&&"pointerdown"===t.type)Ne.set(i,n);else if("pointerup"===t.type){const t=Ne.get(i)===n;Ne.delete(i),t&&Pe(n||i,!1,!0)}}var Fe=new WeakMap;function Oe(t,e=!1){if(!t)return;Fe.has(t)||Fe.set(t,t.getAttribute("aria-expanded"));const i=t.popoverTargetElement;if(i instanceof HTMLElement&&"auto"===i.popover)t.setAttribute("aria-expanded",String(e));else{const e=Fe.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}var qe=globalThis.ShadowRoot||function(){},Ve="popover-polyfill";function Re(t,e,i){const n=t[e];Object.defineProperty(t,e,{value(t){return n.call(this,i(t))}})}var We=/(^|[^\\]):popover-open\b/g;function Be(t){var e;const i="function"==typeof globalThis.CSSLayerBlockRule,n=(t??(null==(e=window.POPOVER_POLYFILL_OPTIONS)?void 0:e.layerName)??Ve).split(".").map(CSS.escape).join(".");return`\n${i?`@layer ${n} {`:""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${i?"}":""}\n`}var $e,Ue,Ke,je,ze=null;function _e(t,e){const i=Be(e);if(null===ze)try{(ze=new CSSStyleSheet).replaceSync(i)}catch{ze=!1}if(!1===ze){const e=document.createElement("style");e.textContent=i,t instanceof Document?t.head.prepend(e):t.prepend(e)}else t.adoptedStyleSheets=[ze,...t.adoptedStyleSheets]}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(t){if("undefined"==typeof window)return;const e=null==t?void 0:t.layerName;function i(t){return(null==t?void 0:t.includes(":popover-open"))&&(t=t.replace(We,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||oe,Re(Document.prototype,"querySelector",i),Re(Document.prototype,"querySelectorAll",i),Re(Element.prototype,"querySelector",i),Re(Element.prototype,"querySelectorAll",i),Re(Element.prototype,"matches",i),Re(Element.prototype,"closest",i),Re(DocumentFragment.prototype,"querySelectorAll",i),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"hint"==t?"hint":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(t={}){xe(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Me(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t={}){return"boolean"==typeof t&&(t={force:t}),"showing"===me.get(this)&&void 0===t.force||!1===t.force?Me(this,!0,!0):void 0!==t.force&&!0!==t.force||xe(this),"showing"===me.get(this)}}});const n=Element.prototype.attachShadow;n&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){const i=n.call(this,t);return _e(i,e),i}}});const s=HTMLElement.prototype.attachInternals;s&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){const t=s.call(this);return t.shadowRoot&&_e(t.shadowRoot,e),t}}});const o=new WeakMap;function r(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=o.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return o.delete(this),null;const e=Ae(this),i=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof qe)&&i&&e.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}r(HTMLButtonElement),r(HTMLInputElement);const a=t=>{if(t.defaultPrevented)return;const e=t.composedPath(),i=e[0];if(!(i instanceof Element)||(null==i?void 0:i.shadowRoot))return;const n=Ae(i);if(!(n instanceof qe||n instanceof Document))return;const s=e.find((t=>{var e;return null==(e=t.matches)?void 0:e.call(t,"[popovertargetaction],[popovertarget]")}));return s?(function(t){const e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;const i=fe(e);"show"===t.popoverTargetAction&&"showing"===i||"hide"===t.popoverTargetAction&&"hidden"===i||("showing"===i?Me(e,!0,!0):be(e,!1)&&(pe.set(e,t),xe(e)))}(s),void t.preventDefault()):void 0},l=t=>{const e=t.key,i=t.target;t.defaultPrevented||!i||"Escape"!==e&&"Esc"!==e||Pe(i.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",a),t.addEventListener("keydown",l),t.addEventListener("pointerdown",He),t.addEventListener("pointerup",He)})(document),_e(document,e)}();const Ze=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]'].map((t=>`:not([hidden]) > ${t}`)).join(", "),Ye=t=>t.textContent?.trim()[0].toLowerCase(),Ge=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),$e.add(this),Ue.set(this,null),Ke.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){v(this,Ke,new AbortController,"f");const{signal:t}=b(this,Ke,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){b(this,Ke,"f")?.abort()}handleEvent(t){const{direction:e,nowrap:i}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(Ze)){b(this,Ue,"f")?.abort();const{signal:e}=v(this,Ue,new AbortController,"f");for(const i of b(this,$e,"a",je)){i.setAttribute("tabindex",i===t.target?"0":"-1");const n=t.target.closest("[popover]");i===t.target&&"auto"===n?.popover&&n.closest("focus-group")===this&&n.addEventListener("toggle",(t=>{if(t.target instanceof Element&&"closed"===t.newState&&(b(this,Ue,"f")?.abort(),i.setAttribute("tabindex","-1"),n.id)){const t=this.querySelector(`[popovertarget="${n.id}"]`);t?t.setAttribute("tabindex","0"):b(this,$e,"a",je)[0]?.setAttribute("tabindex","0")}}),{signal:e})}}}else if(t instanceof KeyboardEvent){const n=Array.from(b(this,$e,"a",je));let s=n.indexOf(t.target);const o=t.key;if("Up"===o||"ArrowUp"===o)"vertical"!==e&&"both"!==e||(s-=s<0?0:1,t.preventDefault());else if("Down"===o||"ArrowDown"===o)"vertical"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(s-=1,t.preventDefault());else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(s+=1,t.preventDefault());else if("Home"===t.key||"PageUp"===t.key)s=0,t.preventDefault();else if("End"===t.key||"PageDown"===t.key)s=n.length-1,t.preventDefault();else{if(!this.mnemonics||!Ge.test(o))return;{const e=o.toLowerCase(),r=s>0&&Ye(t.target)===e?s:0;s=n.findIndex(((t,i)=>i>r&&Ye(t)===e)),s<0&&!i&&(s=n.findIndex((t=>Ye(t)===e)))}}i&&s<0&&(s=0),!i&&s>=n.length&&(s=0);const r=n.at(Math.min(s,n.length-1));{let e=r;do{e=e.closest("[popover]:not(:popover-open)"),"auto"!==e?.popover||["ArrowRight","ArrowLeft"].includes(t.key)||e.showPopover(),e=e?.parentElement||null}while(e)}r?.focus()}}}Ue=new WeakMap,Ke=new WeakMap,$e=new WeakSet,je=function(){return this.querySelectorAll(Ze)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));let Je=class ScrollableRegionElement extends HTMLElement{constructor(){super(...arguments),this.hasOverflow=!1,this.labelledBy=""}connectedCallback(){this.style.overflow="auto",this.observer=new ResizeObserver((t=>{for(const e of t)this.hasOverflow=e.target.scrollHeight>e.target.clientHeight||e.target.scrollWidth>e.target.clientWidth})),this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}attributeChangedCallback(t){"data-has-overflow"===t&&(this.hasOverflow?(this.setAttribute("aria-labelledby",this.labelledBy),this.setAttribute("role","region"),this.setAttribute("tabindex","0")):(this.removeAttribute("aria-labelledby"),this.removeAttribute("role"),this.removeAttribute("tabindex")))}};g([I],Je.prototype,"hasOverflow",void 0),g([I],Je.prototype,"labelledBy",void 0),Je=g([j("scrollable-region")],Je),window.ScrollableRegionElement=Je;const Xe=(t,e,i)=>{if(e())i();else{const n=new MutationObserver((()=>{e()&&(i(),n.disconnect())}));n.observe(t,{childList:!0,subtree:!0})}};var Qe,ti,ei,ii;function ni(t){document.activeElement!==t&&t?.focus()}const si=[];function oi(t){const e=t.target,i=e?.closest("button");if(!i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;let n=i?.getAttribute("data-show-dialog-id");if(n){t.stopPropagation();const e=document.getElementById(n);if(e instanceof ModalDialogElement)return e.openButton=i,e.show(),void t.preventDefault()}if(si.length&&(n=i.getAttribute("data-close-dialog-id")||i.getAttribute("data-submit-dialog-id"),n)){const t=document.getElementById(n);if(t instanceof ModalDialogElement){const e=si.findIndex((t=>t.id===n));si.splice(e,1),t.close(i.hasAttribute("data-submit-dialog-id"))}}}function ri(t){!(t instanceof KeyboardEvent&&"keydown"===t.type&&"Enter"===t.key)||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey||oi(t)}function ai(t){const e=t.target;if(e?.closest("button"))return;const i=si[si.length-1];if(!i)return;!e.closest(`#${i.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(si.pop(),i.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Qe.add(this),ti.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){if(t){if(this.open)return;this.setAttribute("open",""),this.setAttribute("aria-disabled","false"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",b(this,Qe,"a",ei)?.classList.remove("Overlay--hidden"),b(this,ti,"f").signal.aborted&&v(this,ti,new AbortController,"f"),ut(this,this.querySelector("[autofocus]"),b(this,ti,"f").signal),si.push(this)}else{if(!this.open)return;this.removeAttribute("open"),this.setAttribute("aria-disabled","true"),b(this,Qe,"a",ei)?.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",b(this,ti,"f").abort();const t=this.openButton?.closest("details")||this.openButton?.closest("action-menu");ni(t?nt(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",oi),document.addEventListener("keydown",ri),document.addEventListener("mousedown",ai),this.addEventListener("keydown",(t=>b(this,Qe,"m",ii).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}var li,ci,di,hi,ui,mi,fi,pi;ti=new WeakMap,Qe=new WeakSet,ei=function(){return this.parentElement?.hasAttribute("data-modal-dialog-overlay")?this.parentElement:null},ii=function(t){if(t instanceof KeyboardEvent&&!t.isComposing&&this.open)switch(t.key){case"Escape":this.close(),t.preventDefault(),t.stopPropagation();break;case"Enter":t.target.getAttribute("data-close-dialog-id")===this.id&&t.stopPropagation();break}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));let gi=class NavListElement extends HTMLElement{constructor(){super(...arguments),li.add(this),ci.set(this,void 0)}connectedCallback(){this.topLevelList&&v(this,ci,new _(this.topLevelList),"f")}disconnectedCallback(){this.topLevelList&&b(this,ci,"f").unobserve(this.topLevelList)}selectItemById(t){if(!t)return!1;const e=b(this,li,"m",di).call(this,t);return!!e&&(b(this,li,"m",mi).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=b(this,li,"m",hi).call(this,t);return!!e&&(b(this,li,"m",mi).call(this,e),!0)}selectItemByCurrentLocation(){const t=b(this,li,"m",ui).call(this);return!!t&&(b(this,li,"m",mi).call(this,t),!0)}expandItem(t){t.nextElementSibling?.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){t.nextElementSibling?.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false"),t.focus()}itemIsExpanded(t){return"A"===t?.tagName||"true"===t?.getAttribute("aria-expanded")}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const i=e.closest("button");i&&(this.itemIsExpanded(i)?this.collapseItem(i):this.expandItem(i),t.stopPropagation())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let i=e.closest("button");if(!i){const t=e.getAttribute("aria-labelledby");if(!t)return;i=document.getElementById(t)}this.itemIsExpanded(i)&&"Escape"===t.key&&this.collapseItem(i),t.stopPropagation()}};var bi,vi,wi;ci=new WeakMap,li=new WeakSet,di=function(t){for(const e of this.items){if(e.classList.contains("ActionListItem--hasSubItem"))continue;if((e.getAttribute("data-item-id")?.split(" ")||[]).includes(t))return e}return null},hi=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},ui=function(){return b(this,li,"m",hi).call(this,window.location.pathname)},mi=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&b(this,li,"m",fi).call(this,e),t.classList.add("ActionListItem--navActive"),t.children.length>0&&t.children[0].setAttribute("aria-current","page");const i=b(this,li,"m",pi).call(this,t);i&&(this.expandItem(i),i.classList.add("ActionListContent--hasActiveSubItem"))},fi=function(t){t.classList.remove("ActionListItem--navActive"),t.children.length>0&&t.children[0].removeAttribute("aria-current");const e=b(this,li,"m",pi).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},pi=function(t){if(!t.classList.contains("ActionListItem--subItem"))return null;const e=t.closest("li.ActionListItem--hasSubItem")?.querySelector("button.ActionListContent");return e||null},g([K],gi.prototype,"items",void 0),g([U],gi.prototype,"topLevelList",void 0),gi=g([j("nav-list")],gi);let yi=class NavListGroupElement extends HTMLElement{constructor(){super(...arguments),bi.add(this),wi.set(this,new _(this))}connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}async showMore(t){if(t.preventDefault(),this.showMoreDisabled)return;let e;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const i=await fetch(t);if(!i.ok)return;e=await i.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=b(this,bi,"m",vi).call(this,document,e);i?.querySelector("li > a")?.setAttribute("data-targets","nav-list-group.focusMarkers");const n=t.target.closest("button").getAttribute("data-list-id");document.getElementById(n).append(i),this.focusMarkers.pop()?.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}};var Ei,Ai;wi=new WeakMap,bi=new WeakSet,vi=function(t,e){const i=t.createElement("template");return i.innerHTML=e,t.importNode(i.content,!0)},g([U],yi.prototype,"showMoreItem",void 0),g([K],yi.prototype,"focusMarkers",void 0),yi=g([j("nav-list-group")],yi),window.NavListGroupElement=yi;let ki=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Ei.add(this)}connectedCallback(){b(this,Ei,"m",Ai).call(this)}select(t){const e=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),t.querySelector("[aria-current]")?.setAttribute("aria-current","false");e.closest("li.SegmentedControl-item")?.classList.add("SegmentedControl-item--selected"),e.setAttribute("aria-current","true"),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:e,checked:!1,value:e.querySelector(".Button-label")?.textContent}}))}get current(){return this.querySelector("[aria-current=true]")}};Ei=new WeakSet,Ai=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},g([K],ki.prototype,"items",void 0),ki=g([j("segmented-control")],ki),window.customElements.get("segmented-control")||(window.SegmentedControlElement=ki,window.customElements.define("segmented-control",ki));let Li=class ToggleSwitchElement extends HTMLElement{constructor(){super(...arguments),this.turbo=!1,this.toggling=!1}get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("data-csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.isRemote())return this.performToggle(),void(this.toggling=!1);this.performToggle(),this.setLoadingState();try{await this.submitForm()}catch(t){return void(t instanceof Error&&(this.setErrorState(t.message||"An error occurred, please try again."),this.performToggle()))}finally{this.toggling=!1}this.setSuccessState()}}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-pressed","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-pressed")}isOff(){return!this.isOn()}isDisabled(){return null!=this.switch.getAttribute("disabled")}disable(){this.switch.setAttribute("disabled","disabled")}enable(){this.switch.removeAttribute("disabled")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden");const t=new CustomEvent("toggleSwitchLoading",{bubbles:!0});this.dispatchEvent(t)}setSuccessState(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden")}async submitForm(){const t=new FormData;if(this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0"),!this.src)throw new Error("invalid src");let e;const i={"Requested-With":"XMLHttpRequest","X-Requested-With":"XMLHttpRequest"};this.turbo&&(i.Accept="text/vnd.turbo-stream.html");try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:i,body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());const n=e.headers.get("Content-Type");window.Turbo&&this.turbo&&n?.startsWith("text/vnd.turbo-stream.html")&&window.Turbo.renderStreamMessage(await e.text())}};var Si,Ti,Ci,xi,Mi,Ii,Di,Pi,Ni,Hi,Fi,Oi;g([U],Li.prototype,"switch",void 0),g([U],Li.prototype,"loadingSpinner",void 0),g([U],Li.prototype,"errorIcon",void 0),g([I],Li.prototype,"turbo",void 0),Li=g([j("toggle-switch")],Li),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Li,window.customElements.define("toggle-switch",Li));const qi=(()=>{let t;return e=>t?e.matches(t):function(e){try{return t=":popover-open",e.matches(t)}catch{try{return t=":open",e.matches(":open")}catch{return t=".\\:popover-open",e.matches(".\\:popover-open")}}}(e)})(),Vi="sr-only",Ri=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];function Wi(t){for(const e of Ki)e!==t&&(qi(e)?e.hidePopover():Ki.delete(e))}function Bi(){Wi()}function $i(t){setTimeout((()=>{for(const e of Ki)qi(e)&&"focus"===e.showReason&&e.control!==t.target&&e.hidePopover()}),0)}const Ui=new Set,Ki=new Set;class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Si.add(this),Ti.set(this,void 0),Ci.set(this,"center"),xi.set(this,"outside-bottom"),Mi.set(this,!1),Ii.set(this,"mouse"),Di.set(this,!1)}styles(){return'\n :host {\n --tooltip-top: var(--tool-tip-position-top, 0);\n --tooltip-left: var(--tool-tip-position-left, 0);\n padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;\n font: var(--text-body-shorthand-small);\n color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;\n border-radius: var(--borderRadius-medium);\n border: 0 !important;\n opacity: 0;\n max-width: min(var(--overlay-width-small), 100vw);\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 '}get showReason(){return b(this,Ii,"f")}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){t&&qi(this)?this.hidePopover():t||qi(this)||this.showPopover()}get hiddenFromView(){return!qi(this)}connectedCallback(){if(Ui.add(this),b(this,Si,"m",Hi).call(this),b(this,Si,"m",Fi).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}b(this,Si,"m",Pi).call(this,!1),v(this,Mi,!0,"f"),b(this,Si,"m",Ni).call(this)}disconnectedCallback(){Ui.delete(this),Ki.delete(this),b(this,Ti,"f")?.abort()}async handleEvent(t){if(!this.control)return;const e=qi(this);"beforetoggle"===t.type&&t.currentTarget!==this&&v(this,Di,"open"===t.newState,"f");const i=("mouseenter"===t.type||"focus"===t.type&&(navigator.webdriver||this.control.matches(":focus-visible")))&&!b(this,Di,"f"),n="mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this,s="keydown"===t.type&&"Escape"===t.key,o="mousedown"===t.type&&t.currentTarget===this.control,r="beforetoggle"===t.type&&t.currentTarget!==this&&"open"===t.newState,a=n||s||o||r;e&&s&&(t.stopImmediatePropagation(),t.preventDefault()),await Promise.resolve(),e||!i||qi(this)?e&&a&&qi(this)&&this.hidePopover():(v(this,Ii,"mouseenter"===t.type?"mouse":"focus","f"),this.showPopover()),"toggle"===t.type&&b(this,Si,"m",Pi).call(this,"open"===t.newState)}attributeChangedCallback(t){this.isConnected&&("for"===t?b(this,Si,"m",Ni).call(this):"id"===t||"data-type"===t?b(this,Si,"m",Hi).call(this):"data-direction"===t&&b(this,Si,"m",Fi).call(this))}}var ji,zi;Ti=new WeakMap,Ci=new WeakMap,xi=new WeakMap,Mi=new WeakMap,Ii=new WeakMap,Di=new WeakMap,Si=new WeakSet,Pi=function(t){t?(Ki.add(this),this.classList.remove(Vi),Wi(this),b(this,Si,"m",Oi).call(this)):(Ki.delete(this),this.classList.remove(...Ri),this.classList.add(Vi))},Ni=function(){if(!this.control)return;this.setAttribute("role","tooltip"),b(this,Ti,"f")?.abort(),v(this,Ti,new AbortController,"f");const{signal:t}=b(this,Ti,"f");this.addEventListener("mouseleave",this,{signal:t}),this.addEventListener("toggle",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("mousedown",this,{signal:t}),this.control.popoverTargetElement?.addEventListener("beforetoggle",this,{signal:t}),this.ownerDocument.addEventListener("focusout",Bi),this.ownerDocument.addEventListener("focusin",$i),this.ownerDocument.addEventListener("keydown",this,{signal:t,capture:!0})},Hi=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Fi=function(){this.classList.remove(...Ri);const t=this.direction;"n"===t?(v(this,Ci,"center","f"),v(this,xi,"outside-top","f")):"ne"===t?(v(this,Ci,"end","f"),v(this,xi,"outside-top","f")):"e"===t?(v(this,Ci,"center","f"),v(this,xi,"outside-right","f")):"se"===t?(v(this,Ci,"end","f"),v(this,xi,"outside-bottom","f")):"s"===t?(v(this,Ci,"center","f"),v(this,xi,"outside-bottom","f")):"sw"===t?(v(this,Ci,"start","f"),v(this,xi,"outside-bottom","f")):"w"===t?(v(this,Ci,"center","f"),v(this,xi,"outside-left","f")):"nw"===t&&(v(this,Ci,"start","f"),v(this,xi,"outside-top","f"))},Oi=function(){if(!this.control)return;if(!b(this,Mi,"f")||!qi(this))return;const t=J(this,this.control,{side:b(this,xi,"f"),align:b(this,Ci,"f"),anchorOffset:0}),e=t.anchorSide,i=t.anchorAlign;this.style.setProperty("--tool-tip-position-top",`${t.top}px`),this.style.setProperty("--tool-tip-position-left",`${t.left}px`);let n="s";n="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===i?"n":"start"===i?"ne":"nw":"center"===i?"s":"start"===i?"se":"sw",this.classList.add(`tooltip-${n}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id","for"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let _i=class XBannerElement extends HTMLElement{constructor(){super(...arguments),ji.add(this)}dismiss(){if("remove"===b(this,ji,"a",zi)){const t=this.parentElement;if(!t)return;t.removeChild(this)}else this.hide();this.dispatchEvent(new CustomEvent("banner:dismiss"))}show(){this.style.setProperty("display","initial")}hide(){this.style.setProperty("display","none")}};ji=new WeakSet,zi=function(){return this.getAttribute("data-dismiss-scheme")},g([U],_i.prototype,"titleText",void 0),_i=g([j("x-banner")],_i),window.customElements.get("x-banner")||(window.XBannerElement=_i,window.customElements.define("x-banner",_i));class Zi{constructor(t,e,{tabInsertsSuggestions:i,defaultFirstOption:n}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=null==i||i,this.defaultFirstOption=null!=n&&n,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!e.ctrlBindings&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":Gi(e.input,e.list)&&t.preventDefault();break;case"Tab":e.tabInsertsSuggestions&&Gi(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":e.ctrlBindings&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":e.ctrlBindings&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;const i=document.getElementById(e.input.getAttribute("aria-controls")||"");if(!i)return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Yi),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Yi)}indicateDefaultOption(){var t;this.defaultFirstOption&&(null===(t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Ji)[0])||void 0===t||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Ji)[0],i=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Ji),n=i.indexOf(e);if(n===i.length-1&&1===t||0===n&&-1===t)return this.clearSelection(),void this.input.focus();let s=1===t?0:i.length-1;if(e&&n>=0){const e=n+t;e>=0&&e<i.length&&(s=e)}const o=i[s];if(o)for(const t of i)t.removeAttribute("data-combobox-option-default"),o===t?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),Xi(this.list,o)):t.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Yi(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t,e){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:e}))}(e,{event:t})}function Gi(t,e){const i=e.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return!!i&&("true"===i.getAttribute("aria-disabled")||i.click(),!0)}function Ji(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Xi(t,e){(function(t,e){const i=t.scrollTop,n=i+t.clientHeight,s=e.offsetTop,o=s+e.clientHeight;return s>=i&&o<=n})(t,e)||(t.scrollTop=e.offsetTop)}const Qi=window.testScreenReaderDelay||100;class tn{constructor(t,e,i,n=!1){var s;if(this.container=t,this.input=e,this.results=i,this.combobox=new Zi(e,i,{defaultFirstOption:n}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=n,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let i;return function(...n){clearTimeout(i),i=window.setTimeout((()=>{clearTimeout(i),t(...n)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if("Escape"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.close(),e instanceof HTMLAnchorElement)return;const i=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=i,i||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),Qi)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)return void this.close();const e=this.container.src;if(!e)return;const i=new URL(e,window.location.href),n=new URLSearchParams(i.search.slice(1));n.append("q",t),i.search=n.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(i).then((t=>{this.results.innerHTML=t,this.identifyOptions(),this.combobox.indicateDefaultOption();const e=this.results.querySelectorAll('[role="option"]'),i=!!e.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,n=e.length,[s]=e,o=null==s?void 0:s.textContent;this.autoselectEnabled&&o?this.updateFeedbackForScreenReaders(`${n} results. ${o} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${n||"No"} results.`),i?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var en,nn,sn,on,rn,an=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ln=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},cn=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const dn=globalThis.HTMLElement||null;class hn extends Event{constructor(t,e){var{relatedTarget:i}=e;super(t,cn(e,["relatedTarget"])),this.relatedTarget=i}}const un=new WeakMap;let mn=null;class AutoCompleteElement extends dn{constructor(){super(...arguments),en.add(this),nn.set(this,null),sn.set(this,null),rn.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){mn=null===t?t:Promise.resolve(t)}get forElement(){var t;if(null===(t=an(this,nn,"f"))||void 0===t?void 0:t.isConnected)return an(this,nn,"f");const e=this.getAttribute("for"),i=this.getRootNode();return e&&(i instanceof Document||i instanceof ShadowRoot)?i.getElementById(e):null}set forElement(t){ln(this,nn,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return(null===(t=an(this,sn,"f"))||void 0===t?void 0:t.isConnected)?an(this,sn,"f"):this.querySelector("input")}set inputElement(t){ln(this,sn,t,"f"),an(this,en,"m",on).call(this)}connectedCallback(){this.isConnected&&(an(this,en,"m",on).call(this),new MutationObserver((()=>{un.get(this)||an(this,en,"m",on).call(this)})).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=un.get(this);t&&(t.destroy(),un.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;null===(e=an(this,rn,"f"))||void 0===e||e.abort();const{signal:i}=ln(this,rn,new AbortController,"f"),n=await fetch(t.toString(),{signal:i,headers:{Accept:"text/fragment+html"}});if(!n.ok)throw new Error(await n.text());if(mn){return(await mn).createHTML(await n.text(),n)}return await n.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,i){var n,s;if(e===i)return;const o=un.get(this);if(o)switch(this.forElement===(null===(n=un.get(this))||void 0===n?void 0:n.results)&&this.inputElement===(null===(s=un.get(this))||void 0===s?void 0:s.input)||an(this,en,"m",on).call(this),t){case"open":null===i?o.close():o.open();break;case"value":null!==i&&(o.input.value=i),this.dispatchEvent(new hn("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}nn=new WeakMap,sn=new WeakMap,rn=new WeakMap,en=new WeakSet,on=function(){var t;null===(t=un.get(this))||void 0===t||t.destroy();const{forElement:e,inputElement:i}=this;if(!e||!i)return;const n="true"===this.getAttribute("data-autoselect");un.set(this,new tn(this,i,e,n)),e.setAttribute("role","listbox")};const fn="undefined"!=typeof globalThis?globalThis:window;try{fn.AutocompleteElement=fn.AutoCompleteElement=AutoCompleteElement.define()}catch(t){if(!(fn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function pn(t){const e=function(t){return t.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g," ").replace(/[\u200B-\u200D\u2060\uFEFF\u180E]/g,"")}(t);if("clipboard"in navigator)return navigator.clipboard.writeText(e);const i=document.body;if(!i)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(e);return i.appendChild(n),function(t){const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const i=document.createRange();i.selectNodeContents(t),e.addRange(i),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}(n),i.removeChild(n),Promise.resolve()}async function gn(t){const e=t.getAttribute("for"),i=t.getAttribute("value");function n(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}var s;if("true"!==t.getAttribute("aria-disabled"))if(i)await pn(i),n();else if(e){const i="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const o=i.getElementById(e);o&&(await(s=o,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?pn(s.value):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?pn(s.href):function(t){return pn(t.textContent||"")}(s)),n())}}function bn(t){const e=t.currentTarget;e instanceof HTMLElement&&gn(e)}function vn(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),gn(e))}}function wn(t){t.currentTarget.addEventListener("keydown",vn)}function yn(t){t.currentTarget.removeEventListener("keydown",vn)}class ClipboardCopyElement extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",bn),this.addEventListener("focus",wn),this.addEventListener("blur",yn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const En="undefined"!=typeof globalThis?globalThis:window;try{En.ClipboardCopyElement=ClipboardCopyElement.define()}catch(t){if(!(En.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function An(t){t.style.display="inline-block"}function kn(t){t.style.display="none"}const Ln=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=Ln.get(t),i=t.parentNode?.querySelector("[data-clipboard-copy-feedback]"),n="Copied!";e?(clearTimeout(e),Ln.delete(t)):(!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(kn(e),An(i))}(t),i&&(i.textContent===n?i.textContent=`${n} `:i.textContent=n)),Ln.set(t,setTimeout((()=>{!function(t){const[e,i]=t.querySelectorAll(".octicon");e&&i&&(An(e),kn(i))}(t),Ln.delete(t)}),2e3))}));var Sn,Tn=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i},Cn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};const xn="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const i of t)e.push({type:"element",value:i}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},Mn=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],In={minimumIntegerDigits:2};class Dn{constructor(t,e={}){Sn.set(this,void 0);let i=String(e.style||"short");"long"!==i&&"short"!==i&&"narrow"!==i&&"digital"!==i&&(i="short");let n="digital"===i?"numeric":i;const s=e.hours||n;n="2-digit"===s?"numeric":s;const o=e.minutes||n;n="2-digit"===o?"numeric":o;const r=e.seconds||n;n="2-digit"===r?"numeric":r;const a=e.milliseconds||n;Tn(this,Sn,{locale:t,style:i,years:e.years||"digital"===i?"short":i,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===i?"short":i,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===i?"short":i,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===i?"short":i,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:s,hoursDisplay:"always"===e.hoursDisplay||"digital"===i?"always":"auto",minutes:o,minutesDisplay:"always"===e.minutesDisplay||"digital"===i?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===i?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return Cn(this,Sn,"f")}formatToParts(t){const e=[],i=Cn(this,Sn,"f"),n=i.style,s=i.locale;for(const[o,r]of Mn){const a=t[o];if("auto"===i[`${o}Display`]&&!a)continue;const l=i[o],c="2-digit"===l?In:"numeric"===l?{}:{style:"unit",unit:r,unitDisplay:l};let d=new Intl.NumberFormat(s,c).format(a);"months"===o&&("narrow"===l||"narrow"===n&&d.endsWith("m"))&&(d=d.replace(/(\d+)m$/,"$1mo")),e.push(d)}return new xn(s,{type:"unit",style:"digital"===n?"short":n}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}Sn=new WeakMap;const Pn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Nn=["year","month","week","day","hour","minute","second","millisecond"];class Hn{constructor(t=0,e=0,i=0,n=0,s=0,o=0,r=0,a=0){this.years=t,this.months=e,this.weeks=i,this.days=n,this.hours=s,this.minutes=o,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new Hn(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))}static from(t){var e;if("string"==typeof t){const i=String(t).trim(),n=i.startsWith("-")?-1:1,s=null===(e=i.match(Pn))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*n));return s?new Hn(...s):new Hn}if("object"==typeof t){const{years:e,months:i,weeks:n,days:s,hours:o,minutes:r,seconds:a,milliseconds:l}=t;return new Hn(e,i,n,s,o,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const i=Date.now(),n=Math.abs(Fn(i,Hn.from(t)).getTime()-i),s=Math.abs(Fn(i,Hn.from(e)).getTime()-i);return n>s?-1:n<s?1:0}toLocaleString(t,e){return new Dn(t,e).format(this)}}function Fn(t,e){const i=new Date(t);return e.sign<0?(i.setUTCSeconds(i.getUTCSeconds()+e.seconds),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCFullYear(i.getUTCFullYear()+e.years)):(i.setUTCFullYear(i.getUTCFullYear()+e.years),i.setUTCMonth(i.getUTCMonth()+e.months),i.setUTCDate(i.getUTCDate()+7*e.weeks+e.days),i.setUTCHours(i.getUTCHours()+e.hours),i.setUTCMinutes(i.getUTCMinutes()+e.minutes),i.setUTCSeconds(i.getUTCSeconds()+e.seconds)),i}function On(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const i=t.sign;let n=Math.abs(t.years),s=Math.abs(t.months),o=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),d=Math.abs(t.milliseconds);d>=900&&(c+=Math.round(d/1e3)),(c||l||a||r||o||s||n)&&(d=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||o||s||n)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||o||s||n)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||o||s||n)&&(a=0);const h=e.getFullYear(),u=e.getMonth(),m=e.getDate();if(r>=27||n+s+r){const t=new Date(e);t.setDate(1),t.setMonth(u+s*i+1),t.setDate(0);const a=Math.max(0,m-t.getDate()),l=new Date(e);l.setFullYear(h+n*i),l.setDate(m-a),l.setMonth(u+s*i),l.setDate(m-a+r*i);const c=l.getFullYear()-e.getFullYear(),d=l.getMonth()-e.getMonth(),f=Math.abs(Math.round((Number(l)-Number(e))/864e5))+a,p=Math.abs(12*c+d);f<27?(r>=6?(o+=Math.round(r/7),r=0):r=f,s=n=0):p<=11?(s=p,n=0):(s=0,n=c*i),(s||n)&&(r=0)}return n&&(s=0),o>=4&&(s+=Math.round(o/4)),(s||n)&&(o=0),r&&o&&!s&&!n&&(o+=Math.round(r/7),r=0),new Hn(n*i,s*i,o*i,r*i,a*i,l*i,c*i,d*i)}var qn,Vn,Rn,Wn,Bn,$n,Un,Kn,jn,zn,_n,Zn,Yn,Gn,Jn,Xn,Qn=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ts=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};const es=globalThis.HTMLElement||null,is=new Hn,ns=new Hn(0,0,0,0,0,1);class ss extends Event{constructor(t,e,i,n){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=i,this.newTitle=n}}function os(t){if(!t.date)return 1/0;if("duration"===t.format||"elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const rs=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=os(t),i=Date.now()+e;i<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=i)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,os(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends es{constructor(){super(...arguments),qn.add(this),Vn.set(this,!1),Rn.set(this,!1),Bn.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Xn.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}get timeZone(){var t;return(null===(t=this.closest("[time-zone]"))||void 0===t?void 0:t.getAttribute("time-zone"))||this.ownerDocument.documentElement.getAttribute("time-zone")||void 0}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title","aria-hidden","time-zone"]}get onRelativeTimeUpdated(){return Qn(this,Xn,"f")}set onRelativeTimeUpdated(t){Qn(this,Xn,"f")&&this.removeEventListener("relative-time-updated",Qn(this,Xn,"f")),ts(this,Xn,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,Pn.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return Nn.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){rs.unobserve(this)}attributeChangedCallback(t,e,i){e!==i&&("title"===t&&ts(this,Vn,null!==i&&(this.date&&Qn(this,qn,"m",$n).call(this,this.date))!==i,"f"),Qn(this,Rn,"f")||"title"===t&&Qn(this,Vn,"f")||ts(this,Rn,(async()=>{await Promise.resolve(),this.update(),ts(this,Rn,!1,"f")})(),"f"))}update(){const t=Qn(this,Bn,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let i=e;const n=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!n)return void(Qn(this,Bn,"f").textContent=t);const s=Date.now();Qn(this,Vn,"f")||(i=Qn(this,qn,"m",$n).call(this,n)||"",i&&!this.noTitle&&this.setAttribute("title",i));const o=function(t,e="second",i=Date.now()){const n=t.getTime()-i;if(0===n)return new Hn;const s=Math.sign(n),o=Math.abs(n),r=Math.floor(o/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),d=Math.floor(c/30),h=Math.floor(d/12),u=Nn.indexOf(e)||Nn.length;return new Hn(u>=0?h*s:0,u>=1?(d-12*h)*s:0,0,u>=3?(c-30*d)*s:0,u>=4?(l-24*c)*s:0,u>=5?(a-60*l)*s:0,u>=6?(r-60*a)*s:0,u>=7?(o-1e3*r)*s:0)}(n,this.precision,s),r=Qn(this,qn,"m",Un).call(this,o);let a=t;const l=Qn(this,qn,"m",Jn).call(this,r);a=l?Qn(this,qn,"m",Yn).call(this,n):"duration"===r?Qn(this,qn,"m",Kn).call(this,o):"relative"===r?Qn(this,qn,"m",jn).call(this,o):Qn(this,qn,"m",zn).call(this,n),a?Qn(this,qn,"m",Gn).call(this,a):this.shadowRoot===Qn(this,Bn,"f")&&this.textContent&&Qn(this,qn,"m",Gn).call(this,this.textContent),a===t&&i===e||this.dispatchEvent(new ss(t,a,e,i));"relative"===r||"duration"===r||l&&(Qn(this,qn,"m",_n).call(this,n)||Qn(this,qn,"m",Zn).call(this,n))?rs.observe(this):rs.unobserve(this)}}Vn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Xn=new WeakMap,qn=new WeakSet,Wn=function(){var t;const e=(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(null!=e?e:"").toString()}catch(t){return"default"}},$n=function(t){return new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone}).format(t)},Un=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===Hn.compare(t,this.threshold))return"relative"}return"datetime"},Kn=function(t){const e=Qn(this,qn,"a",Wn),i=this.format,n=this.formatStyle,s=this.tense;let o=is;"micro"===i?(t=On(t),o=ns,0===t.months&&("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=ns)):("past"===s&&-1!==t.sign||"future"===s&&1!==t.sign)&&(t=o);const r=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:n,[r]:"always"}):t.abs().toLocaleString(e,{style:n})},jn=function(t){const e=new Intl.RelativeTimeFormat(Qn(this,qn,"a",Wn),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=is),"past"===i&&-1!==t.sign&&(t=is);const[n,s]=function(t,e){const i=On(t,e);if(i.blank)return[0,"second"];for(const t of Nn){if("millisecond"===t)continue;const e=i[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===s&&n<10?e.format(0,"millisecond"===this.precision?"second":this.precision):e.format(n,s)},zn=function(t){const e=new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:this.timeZone});return`${this.prefix} ${e.format(t)}`.trim()},_n=function(t){const e=new Date,i=new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),{timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit"});return i.format(e)===i.format(t)},Zn=function(t){const e=new Date,i=new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),{timeZone:this.timeZone,year:"numeric"});return i.format(e)===i.format(t)},Yn=function(t){const e={hour:"numeric",minute:"2-digit",timeZoneName:"short",timeZone:this.timeZone};if(Qn(this,qn,"m",_n).call(this,t)){let i=new Intl.RelativeTimeFormat(Qn(this,qn,"a",Wn),{numeric:"auto"}).format(0,"day");i=i.charAt(0).toLocaleUpperCase(Qn(this,qn,"a",Wn))+i.slice(1);return`${i} ${new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),e).format(t)}`}const i=Object.assign(Object.assign({},e),{day:"numeric",month:"short"});return Qn(this,qn,"m",Zn).call(this,t)?new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),i).format(t):new Intl.DateTimeFormat(Qn(this,qn,"a",Wn),Object.assign(Object.assign({},i),{year:"numeric"})).format(t)},Gn=function(t){if(this.hasAttribute("aria-hidden")&&"true"===this.getAttribute("aria-hidden")){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=t,Qn(this,Bn,"f").replaceChildren(e)}else Qn(this,Bn,"f").textContent=t},Jn=function(t){var e;return"duration"!==t&&("true"===this.ownerDocument.documentElement.getAttribute("data-prefers-absolute-time")||"true"===(null===(e=this.ownerDocument.body)||void 0===e?void 0:e.getAttribute("data-prefers-absolute-time")))};const as="undefined"!=typeof globalThis?globalThis:window;try{as.RelativeTimeElement=RelativeTimeElement.define()}catch(t){if(!(as.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ls(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{static define(t="tab-container",e=customElements){return e.define(t,this),this}connectedCallback(){this.addEventListener("keydown",(t=>{var e;const i=t.target;if(!(i instanceof HTMLElement))return;if(i.closest(this.tagName)!==this)return;if("tab"!==i.getAttribute("role")&&!i.closest('[role="tablist"]'))return;const n=ls(this),s=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,r]="vertical"===(null===(e=i.closest('[role="tablist"]'))||void 0===e?void 0:e.getAttribute("aria-orientation"))?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=s+1;t>=n.length&&(t=0),this.selectTab(t)}else if(r.some((e=>t.code===e))){let t=s-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=ls(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const i=t.target.closest('[role="tab"]');if(!(i instanceof HTMLElement&&i.closest('[role="tablist"]')))return;const n=e.indexOf(i);this.selectTab(n)}));for(const t of ls(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=ls(this),i=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const n=e[t],s=i[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),n.focus(),s.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}}const cs="undefined"!=typeof globalThis?globalThis:window;try{cs.TabContainerElement=TabContainerElement.define()}catch(t){if(!(cs.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}let ds=class PrimerMultiInputElement extends HTMLElement{activateField(t){const e=this.findField(t);if(e){for(const t of this.fields)t!==e&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),t.parentElement?.setAttribute("hidden","hidden"));e.removeAttribute("disabled"),e.removeAttribute("hidden"),e.parentElement?.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function hs(t,e=0,{start:i=!1,middle:n=!1,once:s=!1}={}){return function(t,e=0,{start:i=!0,middle:n=!0,once:s=!1}={}){let o,r=0,a=!1;function l(...c){if(a)return;const d=Date.now()-r;r=Date.now(),i?(i=!1,t.apply(this,c),s&&l.cancel()):(n&&d<e||!n)&&(clearTimeout(o),o=setTimeout((()=>{r=Date.now(),t.apply(this,c),s&&l.cancel()}),n?e-d:e))}return l.cancel=()=>{clearTimeout(o),a=!0},l}(t,e,{start:i,middle:n,once:s})}g([K],ds.prototype,"fields",void 0),ds=g([j("primer-multi-input")],ds),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:ds}),window.customElements.define("primer-multi-input",ds));var us,ms,fs=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},ps=function(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i};!function(t){t.GET="GET",t.POST="POST"}(ms||(ms={}));const gs=new WeakMap;class bs extends Event{constructor(t){super(`auto-check-${t}`,{bubbles:!0}),this.phase=t}get detail(){return this}}class vs extends bs{constructor(t,e=""){super(t),this.phase=t,this.message=e,this.setValidity=t=>{this.message=t}}}class ws extends bs{constructor(){super("complete")}}class ys extends bs{constructor(t){super("success"),this.response=t}}class Es extends vs{constructor(){super("start","Verifying…")}}class As extends vs{constructor(t){super("error","Validation failed"),this.response=t}}class ks extends bs{constructor(t){super("send"),this.body=t}}class AutoCheckElement extends HTMLElement{constructor(){super(...arguments),us.set(this,null)}static define(t="auto-check",e=customElements){return e.define(t,this),this}get onloadend(){return fs(this,us,"f")}set onloadend(t){fs(this,us,"f")&&this.removeEventListener("loadend",fs(this,us,"f")),ps(this,us,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("loadend",t)}connectedCallback(){const t=this.input;if(!t)return;const e=hs(Ts.bind(null,this),300),i={check:e,controller:null};gs.set(this,i);const n=Ls.bind(null,e);t.addEventListener("blur",n),t.addEventListener("input",n),t.addEventListener("triggervalidation",n),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=gs.get(this);e&&(gs.delete(this),t.removeEventListener("input",Ss),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}triggerValidation(){const t=this.input;t&&t.dispatchEvent(new CustomEvent("triggervalidation"))}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}get httpMethod(){return ms[this.getAttribute("http-method")]||"POST"}set validateOnKeystroke(t){t?this.setAttribute("validate-on-keystroke",""):this.removeAttribute("validate-on-keystroke")}get validateOnKeystroke(){const t=this.getAttribute("validate-on-keystroke");return"true"===t||""===t}}function Ls(t,e){const i=e.currentTarget;if(!(i instanceof HTMLInputElement))return;const n=i.closest("auto-check");n instanceof AutoCheckElement&&("input"===e.type&&n.setAttribute("dirty",""),0!==i.value.length&&("blur"===e.type&&!n.validateOnKeystroke&&n.hasAttribute("dirty")||"input"===e.type&&n.validateOnKeystroke||"triggervalidation"===e.type)&&(Ss(e),t()))}function Ss(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const i=e.closest("auto-check");if(!(i instanceof AutoCheckElement))return;const n=i.src,s=i.csrf,o=i.httpMethod,r=gs.get(i);if(!n||"POST"===o&&!s||!r)return;const a=new Es;e.dispatchEvent(a),i.required&&e.setCustomValidity(a.message)}async function Ts(t){const e=t.input;if(!e)return;const i=t.csrfField,n=t.src,s=t.csrf,o=gs.get(t),r=t.httpMethod;if(!n||"POST"===r&&!s||!o)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const a=new FormData,l=new URL(n,window.location.origin);"POST"===r?(a.append(i,s),a.append("value",e.value)):l.search=new URLSearchParams({value:e.value}).toString(),e.dispatchEvent(new ks(a)),o.controller?o.controller.abort():t.dispatchEvent(new Event("loadstart")),o.controller="AbortController"in window?new AbortController:{signal:null,abort(){}},t.removeAttribute("dirty");try{const i=await async function(t,e,i){"GET"===i.method&&delete i.body;try{const n=await fetch(e,i);return t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend")),n}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new Event("error")),t.dispatchEvent(new Event("loadend"))),e}}(t,l.toString(),{credentials:"same-origin",signal:o.controller.signal,method:r,body:a});if(i.ok)t.required&&e.setCustomValidity(""),t.validateOnKeystroke=!1,e.dispatchEvent(new ys(i.clone()));else{t.validateOnKeystroke=!0;const n=new As(i.clone());e.dispatchEvent(n),t.required&&e.setCustomValidity(n.message)}o.controller=null,e.dispatchEvent(new ws)}catch(t){"AbortError"!==t.name&&(o.controller=null,e.dispatchEvent(new ws))}}us=new WeakMap;const Cs="undefined"!=typeof globalThis?globalThis:window;try{Cs.AutoCheckElement=AutoCheckElement.define()}catch(t){if(!(Cs.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}class xs{constructor(t,e,i){this.inputElement=t,this.characterLimitElement=e,this.characterLimitSrElement=i,this.SCREEN_READER_DELAY=500,this.announceTimeout=null,this.isInitialLoad=!0}initialize(t){this.inputElement.addEventListener("keyup",(()=>this.updateCharacterCount()),t?{signal:t}:void 0),this.inputElement.addEventListener("paste",(()=>setTimeout((()=>this.updateCharacterCount()),50)),t?{signal:t}:void 0),this.updateCharacterCount(),this.isInitialLoad=!1}cleanup(){this.announceTimeout&&clearTimeout(this.announceTimeout)}pluralize(t,e){return 1===t?e:`${e}s`}updateCharacterCount(){if(!this.characterLimitElement)return;const t=this.characterLimitElement.getAttribute("data-max-length");if(!t)return;const e=parseInt(t,10)-this.inputElement.value.length;let i="";if(e>=0){i=`${e} ${this.pluralize(e,"character")} remaining`;const t=this.characterLimitElement.querySelector(".FormControl-caption-text");t&&(t.textContent=i),this.clearError()}else{const t=-e;i=`${t} ${this.pluralize(t,"character")} over`;const n=this.characterLimitElement.querySelector(".FormControl-caption-text");n&&(n.textContent=i),this.setError()}this.isInitialLoad||this.announceToScreenReader(i)}announceToScreenReader(t){this.announceTimeout&&clearTimeout(this.announceTimeout),this.announceTimeout=window.setTimeout((()=>{this.characterLimitSrElement&&(this.characterLimitSrElement.textContent=t)}),this.SCREEN_READER_DELAY)}setError(){this.inputElement.setAttribute("invalid","true"),this.inputElement.setAttribute("aria-invalid","true"),this.characterLimitElement.classList.add("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.removeAttribute("hidden")}clearError(){this.inputElement.removeAttribute("invalid"),this.inputElement.removeAttribute("aria-invalid"),this.characterLimitElement.classList.remove("fgColor-danger");const t=this.characterLimitElement.querySelector(".FormControl-caption-icon");t&&t.setAttribute("hidden","")}}var Ms,Is;let Ds=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Ms.set(this,void 0),Is.set(this,null)}connectedCallback(){b(this,Ms,"f")?.abort();const{signal:t}=v(this,Ms,new AbortController,"f");this.addEventListener("auto-check-success",(async t=>{const e=await t.detail.response.text();e&&e.length>0?this.setSuccess(e):this.clearError()}),{signal:t}),this.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:t}),this.characterLimitElement&&(v(this,Is,new xs(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Is,"f").initialize(t))}disconnectedCallback(){b(this,Ms,"f")?.abort(),b(this,Is,"f")?.cleanup()}clearContents(){this.inputElement.value="",this.inputElement.focus(),this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.replaceChildren()}setValidationMessage(t){const e=document.createElement("template");e.innerHTML=t;const i=document.importNode(e.content,!0);this.validationMessageElement.replaceChildren(i)}toggleValidationStyling(t){t?this.validationElement.classList.remove("FormControl-inlineValidation--success"):this.validationElement.classList.add("FormControl-inlineValidation--success"),this.validationSuccessIcon.hidden=t,this.validationErrorIcon.hidden=!t,this.inputElement.setAttribute("invalid",t?"true":"false")}setSuccess(t){this.toggleValidationStyling(!1),this.setValidationMessage(t),this.validationElement.hidden=!1}setError(t){this.toggleValidationStyling(!0),this.setValidationMessage(t),this.validationElement.hidden=!1}showLeadingSpinner(){this.leadingSpinner?.removeAttribute("hidden"),this.leadingVisual?.setAttribute("hidden","")}hideLeadingSpinner(){this.leadingSpinner?.setAttribute("hidden",""),this.leadingVisual?.removeAttribute("hidden")}};var Ps;Ms=new WeakMap,Is=new WeakMap,g([U],Ds.prototype,"inputElement",void 0),g([U],Ds.prototype,"validationElement",void 0),g([U],Ds.prototype,"validationMessageElement",void 0),g([U],Ds.prototype,"validationSuccessIcon",void 0),g([U],Ds.prototype,"validationErrorIcon",void 0),g([U],Ds.prototype,"leadingVisual",void 0),g([U],Ds.prototype,"leadingSpinner",void 0),g([U],Ds.prototype,"characterLimitElement",void 0),g([U],Ds.prototype,"characterLimitSrElement",void 0),Ds=g([j("primer-text-field")],Ds);let Ns=class PrimerTextAreaElement extends HTMLElement{constructor(){super(...arguments),Ps.set(this,null)}connectedCallback(){this.characterLimitElement&&(v(this,Ps,new xs(this.inputElement,this.characterLimitElement,this.characterLimitSrElement),"f"),b(this,Ps,"f").initialize())}disconnectedCallback(){b(this,Ps,"f")?.cleanup()}};Ps=new WeakMap,g([U],Ns.prototype,"inputElement",void 0),g([U],Ns.prototype,"characterLimitElement",void 0),g([U],Ns.prototype,"characterLimitSrElement",void 0),Ns=g([j("primer-text-area")],Ns),window.customElements.get("primer-text-area")||(Object.assign(window,{PrimerTextAreaElement:Ns}),window.customElements.define("primer-text-area",Ns));let Hs=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.textContent=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")})),this.addEventListener("toggleSwitchLoading",(()=>{this.validationMessageElement.textContent="",this.validationElement.setAttribute("hidden","hidden")}))}};var Fs,Os,qs,Vs,Rs,Ws,Bs,$s,Us,Ks,js,zs,_s,Zs,Ys,Gs,Js,Xs,Qs,to,eo,io,no,so,oo,ro,ao,lo,co,ho,uo,mo,fo;g([U],Hs.prototype,"validationElement",void 0),g([U],Hs.prototype,"validationMessageElement",void 0),Hs=g([j("toggle-switch-input")],Hs);class po{constructor(){Fs.add(this),Os.set(this,void 0),v(this,Os,[],"f")}get current(){return b(this,Os,"f")[b(this,Os,"f").length-1]}push(t,e={trapFocus:!0}){const{trapFocus:i}=e;b(this,Os,"f").push({element:t,abortController:b(this,Fs,"m",qs).call(this,t,i)})}pop(t){if(t)for(;b(this,Os,"f").length>0&&this.current?.element!==t;){const t=b(this,Os,"f").pop();t?.abortController?.abort()}const e=b(this,Os,"f").pop();e?.abortController?.abort()}elementIsMenuItem(t){return b(this,Fs,"a",Vs).includes(t.getAttribute("role")||"")}get isEmpty(){return 0===b(this,Os,"f").length}}Os=new WeakMap,Fs=new WeakSet,qs=function(t,e){const i=St(t,{bindKeys:gt.ArrowVertical|gt.ArrowHorizontal|gt.HomeAndEnd|gt.Backspace,focusOutBehavior:"wrap",focusableElementFilter:e=>this.elementIsMenuItem(e)&&e.closest("anchored-position")===t});if(e){const{signal:e}=i;return ut(t,void 0,e)}return i},Vs=function(){return go.validItemRoles};let go=fo=class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),Rs.add(this),Ws.set(this,void 0),Bs.set(this,""),$s.set(this,""),Us.set(this,!1),Ks.set(this,void 0),js.set(this,void 0)}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.invokerElement?.popoverTargetElement||null}get childPopoverElements(){return Array.from(this.overlay.querySelectorAll("anchored-position"))}get invokerElement(){const t=this.querySelector("[role=menu]")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){const t=this.querySelectorAll("[aria-checked=true]"),e=[];for(const i of t){const t=i.querySelector(".ActionListItem-label");e.push({label:t?.textContent,value:i?.getAttribute("data-value"),element:i})}return e}connectedCallback(){const{signal:t}=v(this,Ws,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("toggle",this,{signal:t,capture:!0}),b(this,Rs,"m",lo).call(this),b(this,Rs,"m",co).call(this),b(this,Rs,"m",_s).call(this),this.includeFragment&&this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t});const e=()=>{b(this,Rs,"m",ao).call(this)&&this.overlay?.update()};v(this,Ks,new IntersectionObserver((t=>{for(const i of t){i.target===this.invokerElement&&(i.isIntersecting?window.addEventListener("scroll",e,{capture:!0}):window.removeEventListener("scroll",e,{capture:!0}))}})),"f"),Xe(this,(()=>Boolean(this.invokerElement)),(()=>b(this,Ks,"f").observe(this.invokerElement))),this.includeFragment||this.setAttribute("data-ready","true");new MutationObserver((()=>b(this,Rs,"m",zs).call(this))).observe(this,{childList:!0,subtree:!0}),b(this,Rs,"m",zs).call(this),v(this,js,new po,"f")}disconnectedCallback(){b(this,Ws,"f").abort()}handleEvent(t){const e=this.invokerElement?.contains(t.target),i=b(this,Rs,"m",Js).call(this,t);if("toggle"===t.type&&t instanceof ToggleEvent)return void b(this,Rs,"m",Qs).call(this,t);if(e&&"mousedown"===t.type)return void v(this,Us,!0,"f");if("mousedown"===t.type)return void t.preventDefault();if(e&&i)return b(this,Rs,"m",to).call(this,t),void v(this,Us,!1,"f");if("focusout"===t.type){if(b(this,Us,"f"))return;return void requestAnimationFrame((()=>{this.contains(document.activeElement)&&document.activeElement!==this.invokerElement||b(this,Rs,"m",so).call(this)}))}const n=t.target.closest(fo.menuItemSelectors.join(",")),s=null!==n;if(s&&i){if(b(this,Rs,"m",Zs).call(this,t))return;const e=n.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e))return void b(this,Rs,"m",eo).call(this,t,i)}b(this,Rs,"m",Ys).call(this,t)&&(t.preventDefault(),n.click());const i=b(this,Rs,"m",uo).call(this,n);return i?(t.preventDefault(),void i.showPopover()):void b(this,Rs,"m",io).call(this,n)}"include-fragment-replaced"!==t.type?s&&t instanceof KeyboardEvent&&b(this,Rs,"m",Xs).call(this,t,n):b(this,Rs,"m",no).call(this)}get items(){return Array.from(this.querySelectorAll(fo.menuItemSelectors.join(",")))}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),t.querySelector(".ActionListContent").setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),t.querySelector(".ActionListContent").removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}hideItem(t){t&&t.setAttribute("hidden","hidden")}showItem(t){t&&t.removeAttribute("hidden")}isItemChecked(t){return!!t&&"true"===t.querySelector(".ActionListContent").getAttribute("aria-checked")}checkItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")||b(this,Rs,"m",io).call(this,e)}}uncheckItem(t){if(t&&("single"===this.selectVariant||"multiple"===this.selectVariant)){const e=t.querySelector(".ActionListContent");"true"===e.getAttribute("aria-checked")&&b(this,Rs,"m",io).call(this,e)}}};Ws=new WeakMap,Bs=new WeakMap,$s=new WeakMap,Us=new WeakMap,Ks=new WeakMap,js=new WeakMap,Rs=new WeakSet,zs=function(){let t=1;for(const e of this.querySelectorAll("[role=menu]"))e.setAttribute("data-level",t.toString()),t++},_s=function(){const{signal:t}=b(this,Ws,"f");for(const e of this.querySelectorAll(fo.validSelectors.join(",")))e.addEventListener("click",b(this,Rs,"m",Zs).bind(this),{signal:t}),e.addEventListener("keydown",b(this,Rs,"m",Zs).bind(this),{signal:t})},Zs=function(t){if(!b(this,Rs,"m",Js).call(this,t))return!1;const e=t.target.closest(fo.menuItemSelectors.join(","));return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},Ys=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Gs=function(t){return t.target instanceof ClipboardCopyElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(" "===t.key||"Enter"===t.key)},Js=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,Rs,"m",Ys).call(this,t)||b(this,Rs,"m",Gs).call(this,t)},Xs=function(t,e){switch(t.key){case"ArrowRight":{const t=b(this,Rs,"m",uo).call(this,e);t?.showPopover();break}case"ArrowLeft":if(e.closest("role[menu]")!==this.list){const t=e.closest("anchored-position");t?.hidePopover()}}},Qs=function(t){const e=t.target;if(t.target instanceof AnchoredPositionElement)if("open"===t.newState){const t=e===this.overlay;b(this,js,"f").push(e,{trapFocus:!t}),window.requestAnimationFrame((()=>{const t=e.querySelector(fo.menuItemSelectors.join(","));t?.focus()}))}else{b(this,js,"f").pop(e);const t=b(this,Rs,"m",mo).call(this,e),i=document.querySelector(":popover-open");t&&!i&&t.focus()}},to=function(t){t.preventDefault(),t.stopPropagation(),b(this,Rs,"m",ao).call(this)?b(this,Rs,"m",ro).call(this):b(this,Rs,"m",oo).call(this)},eo=function(t,e){this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="none");const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.contains(e)&&(this.querySelector(".ActionListWrap").style.display="",b(this,Rs,"m",ao).call(this)&&b(this,Rs,"m",ro).call(this));const t=this.ownerDocument.activeElement,n=this.ownerDocument.activeElement===this.ownerDocument.body,s=this.contains(t),o=e.contains(t);(n||s||o)&&setTimeout((()=>{const e=this.ownerDocument.activeElement;e!==t&&e!==this.ownerDocument.body||this.invokerElement?.focus()}),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},io=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{b(this,Rs,"m",ao).call(this)&&b(this,Rs,"m",ro).call(this)})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e="true"!==t.getAttribute("aria-checked");if("single"===this.selectVariant){e&&t.setAttribute("aria-checked","true");for(const e of this.querySelectorAll("[aria-checked]"))e!==t&&e.setAttribute("aria-checked","false");b(this,Rs,"m",lo).call(this)}else t.setAttribute("aria-checked",`${e}`),b(this,Rs,"m",lo).call(this);b(this,Rs,"m",co).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t.parentElement,checked:this.isItemChecked(t.parentElement)}}))},no=function(){b(this,Rs,"a",ho)?.focus(),b(this,Rs,"m",_s).call(this),this.setAttribute("data-ready","true")},so=function(){b(this,Rs,"m",ro).call(this)},oo=function(){this.popoverElement?.showPopover()},ro=function(){this.popoverElement?.hidePopover();for(const t of this.childPopoverElements)t.hidePopover()},ao=function(){return this.popoverElement?.matches(":popover-open")},lo=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;let e;if(v(this,Bs,b(this,Bs,"f")||t.textContent||"","f"),"single"===this.selectVariant?e=this.querySelector("[aria-checked=true] .ActionListItem-label")?.textContent?.trim():"multiple"===this.selectVariant&&(e=Array.from(this.querySelectorAll("[aria-checked=true] .ActionListItem-label")).map((t=>(t.textContent||"").trim())).filter(Boolean).join(", ")),e||(e=b(this,Bs,"f")),e&&this.dynamicLabel){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=this.dynamicLabelPrefix?`${this.dynamicLabelPrefix} `:"",n.textContent=e,t.replaceChildren(i,n)}else t.textContent=b(this,Bs,"f")},co=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),t.removeAttribute("disabled")):t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=this.querySelector("[data-list-inputs=true]");if(!t)return;const e=t.querySelectorAll("input");e.length>0&&v(this,$s,b(this,$s,"f")||e[0].name,"f");for(const e of this.selectedItems){const i=document.createElement("input");i.setAttribute("data-list-input","true"),i.type="hidden",i.autocomplete="off",i.name=b(this,$s,"f"),i.value=(e.value||e.label||"").trim(),t.append(i)}for(const t of e)t.remove()}},ho=function(){return this.querySelector(fo.menuItemSelectors.join(","))},uo=function(t){const e=t.getAttribute("popovertarget");return e?this.querySelector(`[id="${e}"]`):null},mo=function(t){const e=t.getAttribute("anchor");return e?this.querySelector(`[id="${e}"]`):null},go.validItemRoles=["menuitem","menuitemcheckbox","menuitemradio"],go.validSelectors=fo.validItemRoles.map((t=>`[role="${t}"]`)),go.menuItemSelectors=fo.validSelectors.map((t=>`:not([hidden]) > ${t}`)),g([U],go.prototype,"includeFragment",void 0),g([U],go.prototype,"overlay",void 0),g([U],go.prototype,"list",void 0),go=fo=g([j("action-menu")],go),window.customElements.get("action-menu")||(window.ActionMenuElement=go,window.customElements.define("action-menu",go));const bo="less",vo="equal",wo="greater";var yo,Eo,Ao,ko,Lo,So=t=>{throw TypeError(t)},To=(t,e,i)=>e.has(t)||So("Cannot "+i),Co=(t,e,i)=>(To(t,e,"read from private field"),i?i.call(t):e.get(t)),xo=(t,e,i)=>e.has(t)?So("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Mo=(t,e,i,n)=>(To(t,e,"write to private field"),e.set(t,i),i),Io=(t,e,i)=>(To(t,e,"access private method"),i);class Do{constructor({compareFn:t}){xo(this,Ao),xo(this,yo),xo(this,Eo),Mo(this,yo,t),Mo(this,Eo,[])}insert(t){Co(this,Eo).push(t),Io(this,Ao,Lo).call(this)}pop(){const t=Co(this,Eo)[0];return Co(this,Eo)[Co(this,Eo).length-1]&&(Co(this,Eo)[0]=Co(this,Eo)[Co(this,Eo).length-1],Co(this,Eo).pop()),Io(this,Ao,ko).call(this),t}peek(){return Co(this,Eo)[0]}delete(t){const e=Co(this,Eo).indexOf(t);-1!==e&&(Bo(Co(this,Eo),e,Co(this,Eo).length-1),Co(this,Eo).pop(),Io(this,Ao,ko).call(this))}clear(){Mo(this,Eo,[])}get size(){return Co(this,Eo).length}}function Po(t){return 2*t+1}function No(t){return 2*t+2}function Ho(t){return Math.floor((t-1)/2)}function Fo(t,e){return Po(t)<e}function Oo(t,e){return No(t)<e}function qo(t){return t>0}function Vo(t,e){return t[Po(e)]}function Ro(t,e){return t[No(e)]}function Wo(t,e){return t[Ho(e)]}function Bo(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}yo=new WeakMap,Eo=new WeakMap,Ao=new WeakSet,ko=function(){let t=0;for(;Fo(t,Co(this,Eo).length);){let e=Po(t);if(Oo(t,Co(this,Eo).length)&&Co(this,yo).call(this,Ro(Co(this,Eo),t),Vo(Co(this,Eo),t))===bo&&(e=No(t)),Co(this,yo).call(this,Co(this,Eo)[t],Co(this,Eo)[e])===bo)break;Bo(Co(this,Eo),t,e),t=e}},Lo=function(){let t=Co(this,Eo).length-1;for(;qo(t)&&Co(this,yo).call(this,Co(this,Eo)[t],Wo(Co(this,Eo),t))===bo;)Bo(Co(this,Eo),t,Ho(t)),t=Ho(t)};var $o,Uo,Ko,jo,zo=Object.defineProperty,_o=t=>{throw TypeError(t)},Zo=(t,e,i)=>((t,e,i)=>e in t?zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Yo=(t,e,i)=>e.has(t)||_o("Cannot "+i),Go=(t,e,i)=>(Yo(t,e,"read from private field"),i?i.call(t):e.get(t)),Jo=(t,e,i)=>e.has(t)?_o("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Xo=(t,e,i,n)=>(Yo(t,e,"write to private field"),e.set(t,i),i);$o=Symbol.toStringTag;class Qo{constructor(){Zo(this,$o,"Deferred"),Jo(this,Uo),Jo(this,Ko),Jo(this,jo),Xo(this,Uo,new Promise(((t,e)=>{Xo(this,Ko,t),Xo(this,jo,e)})))}then(t,e){return Promise.prototype.then.apply(Go(this,Uo),[t,e])}catch(t){return Promise.prototype.catch.apply(Go(this,Uo),[t])}finally(t){return Promise.prototype.finally.apply(Go(this,Uo),[t])}resolve(t){Go(this,Ko).call(this,t)}reject(t){Go(this,jo).call(this,t)}getPromise(){return Go(this,Uo)}}Uo=new WeakMap,Ko=new WeakMap,jo=new WeakMap;var tr,er,ir,nr,sr,or,rr=t=>{throw TypeError(t)},ar=(t,e,i)=>e.has(t)||rr("Cannot "+i),lr=(t,e,i)=>(ar(t,e,"read from private field"),i?i.call(t):e.get(t)),cr=(t,e,i)=>e.has(t)?rr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),dr=(t,e,i,n)=>(ar(t,e,"write to private field"),e.set(t,i),i),hr=(t,e,i)=>(ar(t,e,"access private method"),i);class LiveRegionElement extends HTMLElement{constructor(){if(super(),cr(this,nr),cr(this,tr),cr(this,er),cr(this,ir),!this.shadowRoot){const t=function(){if(ur)return ur;return ur=document.createElement("template"),ur.innerHTML=mr,ur}();this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}dr(this,tr,!1),dr(this,ir,null),dr(this,er,new Do({compareFn:fr}))}get delay(){const t=this.getAttribute("delay");return t?parseInt(t,10):150}set delay(t){this.setAttribute("delay",`${t}`)}announce(t,e={}){const{delayMs:i,politeness:n="polite"}=e,s=Date.now(),o=new Qo,r={deferred:o,politeness:n,contents:t,scheduled:void 0!==i?s+i:s};return lr(this,er).insert(r),hr(this,nr,sr).call(this),{...o.getPromise(),cancel:()=>{lr(this,er).delete(r),o.resolve()}}}announceFromElement(t,e){const i=function(t){let e="";t.hasAttribute("aria-label")?e=t.getAttribute("aria-label"):t.innerText?e=t.innerText:t.textContent&&(e=t.textContent);return e?e.trim():""}(t);if(""!==i)return this.announce(i,e);return{...Promise.resolve(),cancel:pr}}getMessage(t="polite"){const e=this.shadowRoot?.getElementById(t);if(!e)throw new Error("Unable to find container for message");return e.textContent}clear(){null!==lr(this,ir)&&(clearTimeout(lr(this,ir)),dr(this,ir,null)),dr(this,tr,!1),lr(this,er).clear()}}tr=new WeakMap,er=new WeakMap,ir=new WeakMap,nr=new WeakSet,sr=function(){if(lr(this,tr))return;let t=lr(this,er).peek();if(!t)return;null!==lr(this,ir)&&(clearTimeout(lr(this,ir)),dr(this,ir,null));const e=Date.now();if(t.scheduled<=e)return t=lr(this,er).pop(),t&&hr(this,nr,or).call(this,t),void hr(this,nr,sr).call(this);const i=t.scheduled-e;dr(this,ir,window.setTimeout((()=>{dr(this,ir,null),hr(this,nr,sr).call(this)}),i))},or=function(t){dr(this,tr,!0);const{contents:e,deferred:i,politeness:n}=t,s=this.shadowRoot?.getElementById(n);if(!s)throw dr(this,tr,!1),new Error(`Unable to find container for message. Expected a container with id="${n}"`);s.textContent===e?s.textContent=`${e} `:s.textContent=e,null!==lr(this,ir)&&clearTimeout(lr(this,ir)),i.resolve(),this.delay>0?dr(this,ir,window.setTimeout((()=>{dr(this,ir,null),dr(this,tr,!1),hr(this,nr,sr).call(this)}),this.delay)):(dr(this,ir,null),dr(this,tr,!1),hr(this,nr,sr).call(this))};let ur=null;const mr='\n<style>\n:host {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n</style>\n<div id="polite" aria-live="polite" aria-atomic="true"></div>\n<div id="assertive" aria-live="assertive" aria-atomic="true"></div>\n';function fr(t,e){return t.politeness===e.politeness?t.scheduled===e.scheduled?vo:t.scheduled<e.scheduled?bo:wo:"assertive"===t.politeness&&"assertive"!==e.politeness?bo:"assertive"!==t.politeness&&"assertive"===e.politeness?wo:vo}function pr(){}var gr,br,vr,wr,yr,Er,Ar,kr,Lr,Sr,Tr,Cr,xr,Mr,Ir,Dr,Pr,Nr,Hr,Fr,Or,qr,Vr,Rr,Wr,Br,$r,Ur,Kr,jr,zr,_r,Zr,Yr,Gr,Jr,Xr,Qr,ta,ea;customElements.get("live-region")||customElements.define("live-region",LiveRegionElement);const ia=['[role="option"]'],na=ia.join(","),sa=ia.map((t=>`:not([hidden]) > ${t}`)).join(",");var oa,ra;!function(t){t[t.REMOTE=0]="REMOTE",t[t.EVENTUALLY_LOCAL=1]="EVENTUALLY_LOCAL",t[t.LOCAL=2]="LOCAL"}(oa||(oa={})),function(t){t[t.BODY=0]="BODY",t[t.BANNER=1]="BANNER"}(ra||(ra={}));const aa=(()=>{const t=new Set;let e=null;function i(){for(const e of t)e.updateAnchorPosition()}return n=>{window.addEventListener("resize",i),window.addEventListener("scroll",i),e||(e=new ResizeObserver((()=>{for(const e of t)e.updateAnchorPosition()}))),e.observe(n.ownerDocument.documentElement),n.addEventListener("dialog:close",(()=>{n.invokerElement?.setAttribute("aria-expanded","false"),t.delete(n)})),n.addEventListener("dialog:open",(()=>{t.add(n)}))}})();let la=class SelectPanelElement extends HTMLElement{constructor(){super(...arguments),gr.add(this),br.set(this,void 0),vr.set(this,void 0),wr.set(this,""),yr.set(this,""),Er.set(this,new Map),Ar.set(this,null),kr.set(this,null),Lr.set(this,!1)}get open(){return this.dialog.open}get selectVariant(){return this.getAttribute("data-select-variant")}get ariaSelectionType(){return"aria-selected"}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}get dynamicAriaLabelPrefix(){const t=this.getAttribute("data-dynamic-aria-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get invokerElement(){const t=this.querySelector("dialog")?.id;if(!t)return null;for(const e of this.querySelectorAll("[aria-controls]"))if(e.getAttribute("aria-controls")===t)return e;return null}get closeButton(){return this.querySelector("button[data-close-dialog-id]")}get invokerLabel(){return this.invokerElement?this.invokerElement.querySelector(".Button-label"):null}get selectedItems(){return Array.from(b(this,Er,"f").values())}get align(){return this.getAttribute("anchor-align")||"start"}get side(){return this.getAttribute("anchor-side")||"outside-bottom"}updateAnchorPosition(){if(this&&null===this.offsetParent&&this.hide(),this.invokerElement){const{top:t,left:e}=J(this.dialog,this.invokerElement,{align:this.align,side:this.side,anchorOffset:4});this.dialog.style.top=`${Math.round(t)}px`,this.dialog.style.left=`${Math.round(e)}px`,this.dialog.style.bottom="auto",this.dialog.style.right="auto"}}connectedCallback(){const{signal:t}=v(this,vr,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mousedown",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("remote-input-success",this,{signal:t}),this.addEventListener("remote-input-error",this,{signal:t}),this.addEventListener("loadstart",this,{signal:t}),b(this,gr,"m",Gr).call(this),b(this,gr,"m",Jr).call(this),b(this,gr,"m",Sr).call(this),aa(this),Xe(this,(()=>Boolean(this.remoteInput)),(()=>{this.remoteInput.addEventListener("loadstart",this,{signal:t}),this.remoteInput.addEventListener("loadend",this,{signal:t})})),Xe(this,(()=>Boolean(this.includeFragment)),(()=>{this.includeFragment.addEventListener("include-fragment-replaced",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("loadend",this,{signal:t})})),v(this,br,new IntersectionObserver((t=>{for(const e of t){const t=e.target;e.isIntersecting&&t===this.dialog&&(this.filterInputTextField&&document.activeElement!==this.filterInputTextField&&this.filterInputTextField.focus(),this.dialog.setAttribute("data-ready","true"),this.updateAnchorPosition(),b(this,gr,"a",Kr)===oa.LOCAL&&b(this,gr,"m",Rr).call(this))}})),"f"),Xe(this,(()=>Boolean(this.dialog)),(()=>{b(this,br,"f").observe(this.dialog),this.dialog.addEventListener("close",this,{signal:t}),"true"===this.getAttribute("data-open-on-load")&&this.show()})),b(this,gr,"a",Kr)===oa.LOCAL&&Xe(this,(()=>this.items.length>0),(()=>{b(this,gr,"m",Rr).call(this),b(this,gr,"m",Jr).call(this)}))}disconnectedCallback(){b(this,vr,"f").abort()}handleEvent(t){if(t.target===this.filterInputTextField)return void b(this,gr,"m",Vr).call(this,t);if(t.target===this.remoteInput)return void b(this,gr,"m",Or).call(this,t);const e=this.invokerElement?.contains(t.target),i=this.closeButton?.contains(t.target),n=b(this,gr,"m",Mr).call(this,t);if(e&&"mousedown"===t.type)return;if("mousedown"===t.type&&t.target instanceof HTMLInputElement)return;if("mousedown"===t.type)return void t.preventDefault();if(e&&n)return void b(this,gr,"m",_r).call(this,t);if(i&&n)return;if("keydown"===t.type&&t instanceof KeyboardEvent&&t.target.closest(sa)){const e=t.ctrlKey||t.altKey||t.metaKey,i=1===t.key.length&&/[a-z\d]/i.test(t.key);!e&&i&&t.stopPropagation()}if(t.target===this.dialog&&"close"===t.type){if(this.dialog.removeAttribute("data-ready"),this.invokerElement?.setAttribute("aria-expanded","false"),this.filterInputTextField){const t=this.filterInputTextField.value.length>0;this.filterInputTextField.value="",t&&this.filterInputTextField.dispatchEvent(new Event("input"))}return void this.dispatchEvent(new CustomEvent("panelClosed",{detail:{panel:this},bubbles:!0}))}const s=t.target.closest(sa)?.parentElement;if(null!=s&&n){if(b(this,gr,"m",Cr).call(this,t))return;const e=s.closest("[data-show-dialog-id]");if(e){const i=this.ownerDocument.getElementById(e.getAttribute("data-show-dialog-id")||"");if(i&&this.contains(e)&&this.contains(i))return void b(this,gr,"m",Zr).call(this,t,i)}return b(this,gr,"m",xr).call(this,t)&&(t.preventDefault(),b(this,gr,"m",ea).call(this,s)?.click()),void b(this,gr,"m",Yr).call(this,s)}if("click"===t.type){const e=this.dialog.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.hide()}t.target instanceof IncludeFragmentElement&&b(this,gr,"m",Hr).call(this,t)}show(){this.updateAnchorPosition(),this.dialog.showModal(),this.invokerElement?.setAttribute("aria-expanded","true");const t=new CustomEvent("dialog:open",{detail:{dialog:this.dialog}});this.dispatchEvent(t)}hide(){this.dialog.close()}get visibleItems(){return Array.from(this.querySelectorAll(sa)).map((t=>t.parentElement))}get items(){return Array.from(this.querySelectorAll(na)).map((t=>t.parentElement))}get focusableItem(){for(const t of this.items){const e=b(this,gr,"m",ea).call(this,t);if(e&&"0"===e.getAttribute("tabindex"))return e}}getItemById(t){return this.querySelector(`li[data-item-id="${t}"`)}isItemDisabled(t){return!!t&&t.classList.contains("ActionListItem--disabled")}disableItem(t){t&&(t.classList.add("ActionListItem--disabled"),b(this,gr,"m",ea).call(this,t).setAttribute("aria-disabled","true"))}enableItem(t){t&&(t.classList.remove("ActionListItem--disabled"),b(this,gr,"m",ea).call(this,t).removeAttribute("aria-disabled"))}isItemHidden(t){return!!t&&t.hasAttribute("hidden")}isItemChecked(t){return!!t&&"true"===b(this,gr,"m",ea).call(this,t).getAttribute(this.ariaSelectionType)}checkItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)||b(this,gr,"m",Yr).call(this,t)}uncheckItem(t){!t||"single"!==this.selectVariant&&"multiple"!==this.selectVariant||this.isItemChecked(t)&&b(this,gr,"m",Yr).call(this,t)}};br=new WeakMap,vr=new WeakMap,wr=new WeakMap,yr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,kr=new WeakMap,Lr=new WeakMap,gr=new WeakSet,Sr=function(){const{signal:t}=b(this,vr,"f");for(const e of this.querySelectorAll(ia.join(",")))e.addEventListener("click",b(this,gr,"m",Cr).bind(this),{signal:t}),e.addEventListener("keydown",b(this,gr,"m",Cr).bind(this),{signal:t})},Tr=function(){let t=!1;if("single"===this.selectVariant)for(const e of this.items){const i=b(this,gr,"m",ea).call(this,e);i&&(this.isItemHidden(e)||!this.isItemChecked(e)||t?i.setAttribute("tabindex","-1"):(i.setAttribute("tabindex","0"),t=!0),e.removeAttribute("tabindex"))}else for(const t of this.items){const e=b(this,gr,"m",ea).call(this,t);e&&(e.setAttribute("tabindex","-1"),t.removeAttribute("tabindex"))}!t&&b(this,gr,"a",Xr)&&b(this,gr,"m",ea).call(this,b(this,gr,"a",Xr))?.setAttribute("tabindex","0")},Cr=function(t){if(!b(this,gr,"m",Mr).call(this,t))return!1;const e=t.target.closest(sa);return!!e&&(!!e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!0))},xr=function(t){return t.target instanceof HTMLAnchorElement&&t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&" "===t.key},Mr=function(t){return t instanceof MouseEvent&&"click"===t.type||b(this,gr,"m",xr).call(this,t)},Ir=function(){for(const t of this.items){const e=b(this,gr,"m",ea).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");i&&b(this,Er,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"true")}b(this,gr,"m",Jr).call(this)},Dr=function(t){const e=b(this,gr,"m",ea).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Er,"f").set(i,{value:i,label:e.querySelector(".ActionListItem-label")?.textContent?.trim(),inputName:e.getAttribute("data-input-name")})},Pr=function(t){const e=b(this,gr,"m",ea).call(this,t);if(!e)return;const i=e.getAttribute("data-value");i&&b(this,Er,"f").delete(i)},Nr=function(){b(this,gr,"a",jr)&&(b(this,Ar,"f")&&clearTimeout(b(this,Ar,"f")),b(this,kr,"f")&&clearTimeout(b(this,kr,"f")),v(this,kr,setTimeout((()=>{this.liveRegion.announce("Loading")}),2e3),"f"),v(this,Ar,setTimeout((()=>{b(this,gr,"a",jr)?.showLeadingSpinner()}),1e3),"f"))},Hr=function(t){switch(t.type){case"include-fragment-replaced":b(this,gr,"m",Rr).call(this);break;case"loadstart":b(this,gr,"m",Fr).call(this,!1);break;case"loadend":b(this,gr,"a",jr)?.hideLeadingSpinner(),this.dispatchEvent(new CustomEvent("loadend"));break;case"error":{b(this,gr,"m",Fr).call(this,!0);const e=this.fragmentErrorElement;throw e&&!e.hasAttribute("hidden")&&this.liveRegion.announceFromElement(e,{politeness:"assertive"}),new Error(t.detail.error)}}},Fr=function(t){for(const e of this.includeFragment.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of this.includeFragment.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)},Or=function(t){switch(t.type){case"remote-input-success":b(this,gr,"m",$r).call(this),b(this,gr,"m",Rr).call(this),b(this,gr,"m",Ir).call(this);break;case"remote-input-error":this.bodySpinner?.setAttribute("hidden",""),this.includeFragment||0===this.visibleItems.length?b(this,gr,"m",Br).call(this,ra.BODY):b(this,gr,"m",Br).call(this,ra.BANNER);break;case"loadstart":if(!b(this,gr,"m",zr).call(this)){if(b(this,gr,"m",$r).call(this),this.bodySpinner?.removeAttribute("hidden"),this.bodySpinner)break;b(this,gr,"m",Nr).call(this)}break;case"loadend":b(this,gr,"a",jr)?.hideLeadingSpinner(),b(this,kr,"f")&&clearTimeout(b(this,kr,"f")),b(this,Ar,"f")&&clearTimeout(b(this,Ar,"f")),this.dispatchEvent(new CustomEvent("loadend"))}},qr=function(t,e){return(t.getAttribute("data-filter-string")||t.textContent||"").toLowerCase().indexOf(e.toLowerCase())>-1},Vr=function(t){if("keydown"===t.type){const e=t.key;if("Enter"===e){const t=this.visibleItems[0];if(t){const e=b(this,gr,"m",ea).call(this,t);e&&e.click()}}else if("ArrowDown"===e){const e=this.focusableItem||b(this,gr,"m",ea).call(this,this.visibleItems[0]);e&&(e.focus(),t.preventDefault())}else if("Home"===e){const e=this.visibleItems[0];if(e){const i=b(this,gr,"m",ea).call(this,e);i&&i.focus(),t.preventDefault()}}else if("End"===e&&this.visibleItems.length>0){const e=this.visibleItems[this.visibleItems.length-1],i=b(this,gr,"m",ea).call(this,e);i&&i.focus(),t.preventDefault()}}if("input"===t.type&&(this.bodySpinner||b(this,gr,"m",zr).call(this)||b(this,gr,"m",Nr).call(this),b(this,gr,"a",Kr)===oa.LOCAL||b(this,gr,"a",Kr)===oa.EVENTUALLY_LOCAL)){if(this.includeFragment)return void this.includeFragment.refetch();b(this,gr,"m",Rr).call(this)}},Rr=function(){if(!this.list)return;let t=!1;if(b(this,gr,"m",zr).call(this)){const e=this.filterInputTextField?.value??"",i=this.filterFn||b(this,gr,"m",qr);for(const n of this.items)i(n,e)?(b(this,gr,"m",ta).call(this,n),t=!0):b(this,gr,"m",Qr).call(this,n)}else t=this.items.length>0;b(this,gr,"m",Tr).call(this),b(this,gr,"m",Ur).call(this);for(const t of this.items){const e=b(this,gr,"m",ea).call(this,t);if(!e)continue;const i=e.getAttribute("data-value");b(this,Lr,"f")?i&&!b(this,Er,"f").has(i)&&e.setAttribute(this.ariaSelectionType,"false"):i&&!b(this,Er,"f").has(i)&&this.isItemChecked(t)&&b(this,gr,"m",Dr).call(this,t)}v(this,Lr,!0,"f"),this.noResults&&(b(this,gr,"m",Wr).call(this)?this.noResults.setAttribute("hidden",""):t?(this.noResults.setAttribute("hidden",""),this.list?.querySelector(".ActionListWrap")?.removeAttribute("hidden")):(this.list?.querySelector(".ActionListWrap")?.setAttribute("hidden",""),this.noResults.removeAttribute("hidden")))},Wr=function(){return!(!this.fragmentErrorElement||this.fragmentErrorElement.hasAttribute("hidden"))||!!this.bannerErrorElement&&!this.bannerErrorElement.hasAttribute("hidden")},Br=function(t){let e=this.fragmentErrorElement;t===ra.BODY&&this.fragmentErrorElement?(this.fragmentErrorElement.removeAttribute("hidden"),this.bannerErrorElement.setAttribute("hidden","")):(e=this.bannerErrorElement,this.bannerErrorElement?.removeAttribute("hidden"),this.fragmentErrorElement?.setAttribute("hidden","")),!e||e.hasAttribute("hidden")||this.liveRegion.announceFromElement(e,{politeness:"assertive"})},$r=function(){this.fragmentErrorElement?.setAttribute("hidden",""),this.bannerErrorElement.setAttribute("hidden","")},Ur=function(){if(this.open&&this.list){const t=this.visibleItems;if(t.length>0){const e="tab for results";this.liveRegion.announce(`${t.length} result${1===t.length?"":"s"} ${e}`)}else{const t=this.noResults;t&&this.liveRegion.announceFromElement(t)}}},Kr=function(){if(!this.list)return oa.REMOTE;switch(this.list.getAttribute("data-fetch-strategy")){case"local":return oa.LOCAL;case"eventually_local":return oa.EVENTUALLY_LOCAL;default:return oa.REMOTE}},jr=function(){return this.filterInputTextField?.closest("primer-text-field")},zr=function(){return b(this,gr,"a",Kr)===oa.LOCAL||b(this,gr,"a",Kr)===oa.EVENTUALLY_LOCAL},_r=function(t){this.invokerElement?.dispatchEvent(new CustomEvent("invokerClicked",{bubbles:!0})),t.preventDefault(),t.stopPropagation(),this.open?this.hide():this.show()},Zr=function(t,e){this.querySelector(".ActionListWrap").style.display="none";const i=new AbortController,{signal:n}=i,s=()=>{i.abort(),this.querySelector(".ActionListWrap").style.display="",this.open&&this.hide();const t=this.ownerDocument.activeElement,e=this.ownerDocument.activeElement===this.ownerDocument.body,n=this.contains(t);(e||n)&&setTimeout((()=>this.invokerElement?.focus()),0)};e.addEventListener("close",s,{signal:n}),e.addEventListener("cancel",s,{signal:n})},Yr=function(t){if("multiple"!==this.selectVariant&&setTimeout((()=>{this.open&&this.hide()})),"multiple"!==this.selectVariant&&"single"!==this.selectVariant)return;const e=this.isItemChecked(t),i=!e;if(!this.dispatchEvent(new CustomEvent("beforeItemActivated",{bubbles:!0,cancelable:!0,detail:{item:t,checked:i,value:b(this,gr,"m",ea).call(this,t)?.getAttribute("data-value")}})))return;const n=b(this,gr,"m",ea).call(this,t);if("single"===this.selectVariant){if(n?.getAttribute("href"))return;if(!e){for(const t of this.items)b(this,gr,"m",ea).call(this,t)?.setAttribute(this.ariaSelectionType,"false");b(this,Er,"f").clear(),i&&(b(this,gr,"m",Dr).call(this,t),n?.setAttribute(this.ariaSelectionType,"true")),b(this,gr,"m",Gr).call(this)}}else n?.setAttribute(this.ariaSelectionType,`${i}`),i?b(this,gr,"m",Dr).call(this,t):b(this,gr,"m",Pr).call(this,t),b(this,gr,"m",Gr).call(this);b(this,gr,"m",Jr).call(this),b(this,gr,"m",Tr).call(this),this.dispatchEvent(new CustomEvent("itemActivated",{bubbles:!0,detail:{item:t,checked:i,value:b(this,gr,"m",ea).call(this,t)?.getAttribute("data-value")}}))},Gr=function(){if(!this.dynamicLabel)return;const t=this.invokerLabel;if(!t)return;let e;if(v(this,wr,b(this,wr,"f")||t.textContent||"","f"),"single"===this.selectVariant?e=this.querySelector(`[${this.ariaSelectionType}=true] .ActionListItem-label`)?.textContent:"multiple"===this.selectVariant&&(e=Array.from(this.querySelectorAll(`[${this.ariaSelectionType}=true] .ActionListItem-label`)).map((t=>t.textContent?.trim()??"")).join(", ")),e||(e=b(this,wr,"f")),e){const i=document.createElement("span");i.classList.add("color-fg-muted");const n=document.createElement("span");i.textContent=`${this.dynamicLabelPrefix} `,n.textContent=e,t.replaceChildren(i,n),this.dynamicAriaLabelPrefix&&this.invokerElement?.setAttribute("aria-label",`${this.dynamicAriaLabelPrefix} ${e.trim()}`)}else t.textContent=b(this,wr,"f")},Jr=function(){if("single"===this.selectVariant){const t=this.querySelector("[data-select-panel-inputs=true] input")??this.querySelector("[data-list-inputs=true] input");if(!t)return;const e=this.selectedItems[0];e?(t.value=(e.value||e.label||"").trim(),e.inputName&&(t.name=e.inputName),t.removeAttribute("disabled")):b(this,Lr,"f")&&t.setAttribute("disabled","disabled")}else if("none"!==this.selectVariant){const t=!!this.querySelector("[data-select-panel-inputs=true]"),e=this.querySelector("[data-select-panel-inputs=true]")??this.querySelector("[data-list-inputs=true]");if(!e)return;const i=e.querySelectorAll("input");i.length>0&&v(this,yr,b(this,yr,"f")||i[0].name,"f");for(const i of this.selectedItems){const n=document.createElement("input");n.setAttribute(""+(t?"data-select-panel-input":"data-list-input"),"true"),n.type="hidden",n.autocomplete="off",n.name=i.inputName||b(this,yr,"f"),n.value=(i.value||i.label||"").trim(),e.append(n)}for(const t of i)t.remove()}},Xr=function(){return this.querySelector(sa)?.parentElement||null},Qr=function(t){t&&t.setAttribute("hidden","hidden")},ta=function(t){t&&t.removeAttribute("hidden")},ea=function(t){return t.querySelector(".ActionListContent")},g([U],la.prototype,"includeFragment",void 0),g([U],la.prototype,"dialog",void 0),g([U],la.prototype,"filterInputTextField",void 0),g([U],la.prototype,"remoteInput",void 0),g([U],la.prototype,"list",void 0),g([U],la.prototype,"noResults",void 0),g([U],la.prototype,"fragmentErrorElement",void 0),g([U],la.prototype,"bannerErrorElement",void 0),g([U],la.prototype,"bodySpinner",void 0),g([U],la.prototype,"liveRegion",void 0),la=g([j("select-panel")],la),window.customElements.get("select-panel")||(window.SelectPanelElement=la,window.customElements.define("select-panel",la));let ca=class DetailsToggleElement extends HTMLElement{toggle(){if(this.detailsTarget.hasAttribute("open")){const t=this.summaryTarget.getAttribute("data-aria-label-closed");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","false")}else{const t=this.summaryTarget.getAttribute("data-aria-label-open");t&&this.summaryTarget.setAttribute("aria-label",t),this.summaryTarget.setAttribute("aria-expanded","true")}}};function da(t){St(t,{bindKeys:gt.ArrowVertical|gt.ArrowHorizontal|gt.HomeAndEnd|gt.Backspace,getNextFocusable:(t,e,i)=>{if(e instanceof HTMLElement){try{if(e.closest("dialog:modal"))return}catch{}return function(t,e){switch(`${function(t){if("treeitem"!==t.getAttribute("role"))throw new Error("Element is not a treeitem");switch(t.getAttribute("aria-expanded")){case"true":return"open";case"false":return"closed";default:return"end"}}(t)} ${e.key}`){case"open ArrowRight":return function(t){const e=t.querySelector("[role=treeitem]");return e instanceof HTMLElement?e:void 0}(t);case"open ArrowLeft":case"closed ArrowRight":case"end ArrowRight":return;case"closed ArrowLeft":case"end ArrowLeft":return ma(t)}switch(e.key){case"ArrowUp":return ha(t,"previous");case"ArrowDown":return ha(t,"next");case"Backspace":return ma(t)}}(e,i)??e}},focusInStrategy:()=>{let e=t.querySelector("[aria-current]");e=e?.checkVisibility()?e:null;const i=t.querySelector('[role="treeitem"]');return e instanceof HTMLElement?e:document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&"treeitem"===document.activeElement.getAttribute("role")?document.activeElement:i instanceof HTMLElement?i:void 0}})}function ha(t,e){const i=t.closest("[role=tree]");if(!i)return;const n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,(t=>t instanceof HTMLElement&&"treeitem"===t.getAttribute("role")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));let s=n.firstChild();for(;s!==t;)s=n.nextNode();let o="next"===e?n.nextNode():n.previousNode();for(;o instanceof HTMLElement&&ua(o,i);)o="next"===e?n.nextNode():n.previousNode();return o instanceof HTMLElement?o:void 0}function ua(t,e){for(const i of e.querySelectorAll("[role=treeitem][aria-expanded=false]"))if(t!==i&&i.closest("li")?.contains(t))return i;return null}function ma(t){const e=t.closest("[role=group]"),i=e?.closest("[role=treeitem]");return i instanceof HTMLElement?i:void 0}var fa,pa,ga,ba,va,wa,ya,Ea,Aa,ka,La,Sa,Ta;g([U],ca.prototype,"detailsTarget",void 0),g([U],ca.prototype,"summaryTarget",void 0),ca=g([j("details-toggle")],ca),window.DetailsToggleElement=ca;let Ca=class TreeViewElement extends HTMLElement{constructor(){super(...arguments),fa.add(this),pa.set(this,void 0)}connectedCallback(){const{signal:t}=v(this,pa,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("focusin",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),da(this),new MutationObserver((t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.querySelector("[aria-expanded=true]")&&b(this,fa,"m",ga).call(this,t)})).observe(this,{childList:!0,subtree:!0});new MutationObserver((t=>{if(!this.formInputContainer)return;t.some((t=>t.target instanceof HTMLElement&&t.target.getAttribute("aria-checked")!==t.oldValue))&&this.updateHiddenFormInputs()})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]}),this.formInputContainer&&this.updateHiddenFormInputs(),customElements.whenDefined("tree-view-sub-tree-node").then((()=>{b(this,fa,"m",ga).call(this,this)}))}rootLeafNodes(){return this.querySelectorAll(":scope > ul > li > .TreeViewItemContainer [role=treeitem]")}rootSubTreeNodes(){return this.querySelectorAll(":scope > ul > tree-view-sub-tree-node")}disconnectedCallback(){b(this,pa,"f").abort()}handleEvent(t){const e=b(this,fa,"m",va).call(this,t);e&&b(this,fa,"m",wa).call(this,e,t)}handleSingleSelection(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i="true"===this.getNodeCheckedValue(e)?"false":"true",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("false"===i?this.setNodeCheckedValue(e,"false"):b(this,fa,"m",Ta).call(this,e),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,detail:[n]})))}getFormInputValueForNode(t){return t.getAttribute("data-value")}getNodePath(t){const e=t.getAttribute("data-path");return e?JSON.parse(e):[]}getNodeType(t){return t.getAttribute("data-node-type")}markCurrentAtPath(t){const e=JSON.stringify(t),i=this.querySelector(`[data-path="${CSS.escape(e)}"`);i&&(this.currentNode?.setAttribute("aria-current","false"),i.setAttribute("aria-current","true"))}get currentNode(){return this.querySelector("[aria-current=true]")}get activeNodes(){return this.querySelectorAll('[aria-checked="true"]')}expandAtPath(t){const e=this.subTreeAtPath(t);e&&e.expand()}collapseAtPath(t){const e=this.subTreeAtPath(t);e&&e.collapse()}toggleAtPath(t){const e=this.subTreeAtPath(t);e&&e.toggle()}checkAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"true")}uncheckAtPath(t){const e=this.nodeAtPath(t);e&&this.setNodeCheckedValue(e,"false")}checkOnlyAtPath(t){const e=this.nodeAtPath(t);e&&b(this,fa,"m",Ta).call(this,e)}toggleCheckedAtPath(t){const e=this.nodeAtPath(t);e&&"leaf"===this.getNodeType(e)&&("true"===this.getNodeCheckedValue(e)?this.uncheckAtPath(t):this.checkAtPath(t))}checkedValueAtPath(t){const e=this.nodeAtPath(t);return e?this.getNodeCheckedValue(e):"false"}disabledValueAtPath(t){const e=this.nodeAtPath(t);return!!e&&this.getNodeDisabledValue(e)}nodeAtPath(t,e){const i=JSON.stringify(t);return this.querySelector(`${e||""}[data-path="${CSS.escape(i)}"]`)}subTreeAtPath(t){const e=this.nodeAtPath(t,"[data-node-type=sub-tree]");return e?e.closest("tree-view-sub-tree-node"):null}leafAtPath(t){return this.nodeAtPath(t,"[data-node-type=leaf]")}setNodeCheckedValue(t,e){t.setAttribute("aria-checked",e.toString())}getNodeCheckedValue(t){return t.getAttribute("aria-checked")||"false"}getNodeDisabledValue(t){return"true"===t.getAttribute("aria-disabled")}setNodeDisabledValue(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}nodeHasCheckBox(t){return null!==t.querySelector(".TreeViewItemCheckbox")}nodeHasNativeAction(t){return t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement}expandAncestorsForNode(t){const e=t.closest("tree-view-sub-tree-node");if(e)for(const t of e.eachAncestorSubTreeNode())t.expanded||t.expand()}changeSelectStrategy(t){for(const e of this.querySelectorAll("tree-view-sub-tree-node"))e.changeSelectStrategy(t)}infoFromNode(t,e){const i=this.getNodeType(t);if(!i)return null;const n=this.getNodeCheckedValue(t);return{node:t,type:i,path:this.getNodePath(t),checkedValue:e||n,previousCheckedValue:n}}selectVariant(t){return t.getAttribute("data-select-variant")||"none"}updateHiddenFormInputs(){const t=[];for(const e of this.querySelectorAll("[role=treeitem][aria-checked=true]")){const i=this.formInputPrototype.cloneNode();i.removeAttribute("data-target"),i.removeAttribute("form");const n={path:this.getNodePath(e)},s=e.getAttribute("data-node-id");s&&(n.nodeId=s);const o=this.getFormInputValueForNode(e);o&&(n.value=o),i.value=JSON.stringify(n),t.push(i)}this.formInputContainer.replaceChildren(...t)}};var xa,Ma;pa=new WeakMap,fa=new WeakSet,ga=function(t){for(const e of t.querySelectorAll("[aria-expanded=true]"))this.expandAncestorsForNode(e)},ba=function(t){return"click"===t.type},va=function(t){const e=t.target,i=e.closest("[role=treeitem]");return i?e.closest(".TreeViewItemToggle")||e.closest(".TreeViewItemLeadingAction")?null:i:null},wa=function(t,e){b(this,fa,"m",ya).call(this,e,t)?b(this,fa,"m",Ea).call(this,e,t):b(this,fa,"m",Aa).call(this,e,t)?this.handleSingleSelection(e,t):b(this,fa,"m",ba).call(this,e)?b(this,fa,"m",ka).call(this,e,t):"focusin"===e.type?b(this,fa,"m",La).call(this,t):e instanceof KeyboardEvent&&b(this,fa,"m",Sa).call(this,e,t)},ya=function(t,e){return"click"===t.type&&this.nodeHasCheckBox(e)},Ea=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if("leaf"!==this.getNodeType(e))return;const i="false"===this.getNodeCheckedValue(e)?"true":"false",n=this.infoFromNode(e,i);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]}))&&("true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true"),this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:[n]})))},Aa=function(t,e){return"click"===t.type&&"single"===this.selectVariant(e)},ka=function(t,e){if(this.getNodeDisabledValue(e))return void t.preventDefault();if(!(e instanceof HTMLDivElement))return;const i=this.getNodePath(e);this.dispatchEvent(new CustomEvent("treeViewBeforeNodeActivated",{bubbles:!0,cancelable:!0,detail:this.infoFromNode(e)}))&&(this.nodeHasNativeAction(e)||this.toggleAtPath(i),this.dispatchEvent(new CustomEvent("treeViewNodeActivated",{bubbles:!0,detail:this.infoFromNode(e)})))},La=function(t){const e=this.querySelector("[aria-selected=true]");e?.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true")},Sa=function(t,e){if(e&&"leaf"===this.getNodeType(e))switch(t.key){case" ":case"Enter":if(this.getNodeDisabledValue(e)){t.preventDefault();break}"multiple"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):this.setNodeCheckedValue(e,"true")):"single"===this.selectVariant(e)?(t.preventDefault(),"true"===this.getNodeCheckedValue(e)?this.setNodeCheckedValue(e,"false"):b(this,fa,"m",Ta).call(this,e)):e instanceof HTMLAnchorElement&&e.click()}},Ta=function(t){for(const e of this.activeNodes)e!==t&&this.setNodeCheckedValue(e,"false");this.setNodeCheckedValue(t,"true")},g([U],Ca.prototype,"formInputContainer",void 0),g([U],Ca.prototype,"formInputPrototype",void 0),Ca=g([j("tree-view")],Ca),window.customElements.get("tree-view")||(window.TreeViewElement=Ca,window.customElements.define("tree-view",Ca));let Ia=class TreeViewIconPairElement extends HTMLElement{constructor(){super(...arguments),xa.add(this)}connectedCallback(){Xe(this,(()=>Boolean(this.collapsedIcon)&&Boolean(this.expandedIcon)),(()=>{this.expanded=Boolean(this.collapsedIcon.hidden)}))}showExpanded(){this.expanded=!0,b(this,xa,"m",Ma).call(this)}showCollapsed(){this.expanded=!1,b(this,xa,"m",Ma).call(this)}toggle(){this.expanded=!this.expanded,b(this,xa,"m",Ma).call(this)}};var Da,Pa,Na,Ha,Fa,Oa,qa,Va,Ra,Wa,Ba,$a,Ua;xa=new WeakSet,Ma=function(){this.expanded?(this.expandedIcon.hidden=!1,this.collapsedIcon.hidden=!0):(this.expandedIcon.hidden=!0,this.collapsedIcon.hidden=!1)},g([U],Ia.prototype,"expandedIcon",void 0),g([U],Ia.prototype,"collapsedIcon",void 0),Ia=g([j("tree-view-icon-pair")],Ia),window.customElements.get("tree-view-icon-pair")||(window.TreeViewIconPairElement=Ia,window.customElements.define("tree-view-icon-pair",Ia));let Ka=class TreeViewSubTreeNodeElement extends HTMLElement{constructor(){super(...arguments),Da.add(this),Pa.set(this,null),Na.set(this,"success"),Ha.set(this,void 0),Fa.set(this,!1)}connectedCallback(){Xe(this,(()=>Boolean(this.node)&&Boolean(this.subTree)),(()=>{b(this,Da,"m",Ba).call(this)}));const{signal:t}=v(this,Ha,new AbortController,"f");this.addEventListener("click",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),Xe(this,(()=>Boolean(this.includeFragment)),(()=>{this.includeFragment.addEventListener("loadstart",this,{signal:t}),this.includeFragment.addEventListener("error",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replace",this,{signal:t}),this.includeFragment.addEventListener("include-fragment-replaced",(t=>{b(this,Da,"m",qa).call(this,t)}),{signal:t})})),Xe(this,(()=>Boolean(this.retryButton)),(()=>{this.retryButton.addEventListener("click",(t=>{b(this,Da,"m",Va).call(this,t)}),{signal:t})}));new MutationObserver((()=>{if("mixed_descendants"!==this.selectStrategy)return;let t="unknown";for(const e of this.eachDirectDescendantNode())switch(`${t} ${e.getAttribute("aria-checked")||"false"}`){case"unknown mixed":case"false mixed":case"true mixed":case"false true":case"true false":t="mixed";break;case"unknown false":t="false";break;case"unknown true":t="true"}"unknown"!==t&&this.node?.getAttribute("aria-checked")!==t&&this.node?.setAttribute("aria-checked",t)})).observe(this,{childList:!0,subtree:!0,attributeFilter:["aria-checked"]})}get expanded(){return null===b(this,Pa,"f")&&v(this,Pa,"true"===this.node.getAttribute("aria-expanded"),"f"),b(this,Pa,"f")}set expanded(t){v(this,Pa,t,"f"),b(this,Da,"m",Ba).call(this)}get loadingState(){return b(this,Na,"f")}set loadingState(t){v(this,Na,t,"f"),b(this,Da,"m",Ba).call(this)}get selectStrategy(){return this.node.getAttribute("data-select-strategy")||"descendants"}get selectVariant(){return this.node.getAttribute("data-select-variant")||"none"}get level(){return parseInt(this.node.getAttribute("aria-level")||"0")}disconnectedCallback(){b(this,Ha,"f").abort()}handleEvent(t){t.target===this.toggleButton?b(this,Da,"m",Oa).call(this,t):t.target===this.includeFragment?b(this,Da,"m",qa).call(this,t):t instanceof KeyboardEvent?b(this,Da,"m",Ra).call(this,t):t.target.closest("[role=treeitem]")===this.node&&"click"===t.type&&b(this,Da,"a",Ua)&&b(this,Da,"m",Wa).call(this,t)}expand(){const t=this.expanded;this.expanded=!0,!t&&this.treeView&&this.treeView.dispatchEvent(new CustomEvent("treeViewNodeExpanded",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}collapse(){const t=!this.expanded;if(this.expanded=!1,!t&&this.treeView){const t=this.subTree.querySelector("[tabindex='0']");t?.setAttribute("tabindex","-1"),b(this,Da,"m",$a).call(this)&&"0"===this.subTree.getAttribute("tabindex")&&this.subTree.setAttribute("tabindex","-1"),this.node.setAttribute("tabindex","0"),this.treeView.dispatchEvent(new CustomEvent("treeViewNodeCollapsed",{bubbles:!0,detail:this.treeView?.infoFromNode(this.node)}))}}toggle(){this.expanded?this.collapse():this.expand()}get nodes(){return this.querySelectorAll(":scope > [role=treeitem]")}*eachDirectDescendantNode(){for(const t of this.subTree.querySelectorAll(":scope > li > .TreeViewItemContainer > [role=treeitem]"))yield t;for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node > li > .TreeViewItemContainer > [role=treeitem]"))yield t}*eachDirectDescendantSubTreeNode(){for(const t of this.subTree.querySelectorAll(":scope > tree-view-sub-tree-node"))yield t}*eachDescendantNode(){for(const t of this.subTree.querySelectorAll("[role=treeitem]"))yield t}*eachAncestorSubTreeNode(){if(!this.treeView)return;let t=this;for(;t&&this.treeView.contains(t);)yield t,t=t.parentElement?.closest("tree-view-sub-tree-node")}get isEmpty(){return 0===this.nodes.length}get treeView(){return this.closest("tree-view")}toggleChecked(){const t="false"===(this.treeView?.getNodeCheckedValue(this.node)||"false")?"true":"false",e=[],i=this.treeView?.infoFromNode(this.node,t);if(i&&e.push(i),"descendants"===this.selectStrategy||"mixed_descendants"===this.selectStrategy)for(const i of this.eachDescendantNode()){const n=this.treeView?.infoFromNode(i,t);n&&e.push(n)}if(this.dispatchEvent(new CustomEvent("treeViewBeforeNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))){for(const i of e)i.node.setAttribute("aria-checked",t);this.dispatchEvent(new CustomEvent("treeViewNodeChecked",{bubbles:!0,cancelable:!0,detail:e}))}}changeSelectStrategy(t){this.node.setAttribute("data-select-strategy",t)}};Pa=new WeakMap,Na=new WeakMap,Ha=new WeakMap,Fa=new WeakMap,Da=new WeakSet,Oa=function(t){"click"===t.type&&(this.toggle(),t.stopPropagation())},qa=function(t){switch(t.type){case"loadstart":this.loadingState="loading";break;case"error":this.loadingState="error";break;case"include-fragment-replace":v(this,Fa,document.activeElement===this.loadingIndicator.closest("[role=treeitem]"),"f"),!b(this,Fa,"f")&&document.activeElement===this.subTree&&b(this,Da,"m",$a).call(this)&&v(this,Fa,!0,"f"),this.loadingState="success";break;case"include-fragment-replaced":if(this.expanded=!0,b(this,Fa,"f")){const t=this.querySelector("[role=group] > :first-child");if(!t)return;const e=t.querySelector("[role=treeitem]");if(!e)return;e.focus()}v(this,Fa,!1,"f")}},Va=function(t){"click"===t.type&&(this.loadingState="loading",this.includeFragment.refetch())},Ra=function(t){const e=t.target.closest("[role=treeitem]");if(e&&"sub-tree"===this.treeView?.getNodeType(e))switch(t.key){case"Enter":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}t.stopPropagation(),b(this,Da,"a",Ua)?this.toggleChecked():"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):this.treeView?.nodeHasNativeAction(e)||this.toggle();break;case"ArrowRight":t.stopPropagation(),this.expand();break;case"ArrowLeft":t.stopPropagation(),this.collapse();break;case" ":if(this.treeView?.getNodeDisabledValue(e)){t.preventDefault();break}b(this,Da,"a",Ua)?(t.stopPropagation(),t.preventDefault(),this.toggleChecked()):"single"===this.selectVariant?this.treeView.handleSingleSelection(t,e):e instanceof HTMLAnchorElement?e.click():this.treeView?.nodeHasNativeAction(e)||this.toggle()}},Wa=function(t){this.treeView?.getNodeDisabledValue(this.node)?t.preventDefault():"click"===t.type&&(this.toggleChecked(),t.stopPropagation())},Ba=function(){switch(this.expanded?(this.subTree&&(this.subTree.hidden=!1),b(this,Da,"m",$a).call(this)&&(this.subTree.setAttribute("role","treeitem"),this.subTree.hasAttribute("tabindex")||this.subTree.setAttribute("tabindex","-1")),this.node.setAttribute("aria-expanded","true"),this.treeView?.expandAncestorsForNode(this),this.iconPair&&this.iconPair.showExpanded(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.removeAttribute("hidden"),this.collapsedToggleIcon.setAttribute("hidden","hidden"))):(this.subTree&&(this.subTree.hidden=!0),b(this,Da,"m",$a).call(this)&&(this.subTree.removeAttribute("role"),this.subTree.removeAttribute("tabindex")),this.node.setAttribute("aria-expanded","false"),this.iconPair&&this.iconPair.showCollapsed(),this.expandedToggleIcon&&this.collapsedToggleIcon&&(this.expandedToggleIcon.setAttribute("hidden","hidden"),this.collapsedToggleIcon.removeAttribute("hidden"))),this.loadingState){case"loading":this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0),this.loadingIndicator&&(this.loadingIndicator.hidden=!1);break;case"error":this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!1);break;default:this.loadingIndicator&&(this.loadingIndicator.hidden=!0),this.loadingFailureMessage&&(this.loadingFailureMessage.hidden=!0)}},$a=function(){return this.subTree?.getAttribute("data-target")?.includes("tree-view-sub-tree-node.includeFragment")??!1},Ua=function(){return this.querySelector(".TreeViewItemCheckbox")},g([U],Ka.prototype,"node",void 0),g([U],Ka.prototype,"subTree",void 0),g([U],Ka.prototype,"iconPair",void 0),g([U],Ka.prototype,"toggleButton",void 0),g([U],Ka.prototype,"expandedToggleIcon",void 0),g([U],Ka.prototype,"collapsedToggleIcon",void 0),g([U],Ka.prototype,"includeFragment",void 0),g([U],Ka.prototype,"loadingIndicator",void 0),g([U],Ka.prototype,"loadingFailureMessage",void 0),g([U],Ka.prototype,"retryButton",void 0),Ka=g([j("tree-view-sub-tree-node")],Ka),window.customElements.get("tree-view-sub-tree-node")||(window.TreeViewSubTreeNodeElement=Ka,window.customElements.define("tree-view-sub-tree-node",Ka));let ja=class TreeViewIncludeFragmentElement extends IncludeFragmentElement{request(){const t=super.request(),e=new URL(t.url);return e.searchParams.set("path",this.getAttribute("data-path")||""),new Request(e,{method:t.method,headers:t.headers,credentials:t.credentials})}};ja=g([j("tree-view-include-fragment")],ja),window.customElements.get("tree-view-include-fragment")||(window.TreeViewIncludeFragmentElement=ja,window.customElements.define("tree-view-include-fragment",ja));let za=class AvatarFallbackElement extends HTMLElement{constructor(){super(...arguments),this.img=null,this.testImage=null}connectedCallback(){if(this.img=this.querySelector("img")??null,!this.img)return;const t=this.getAttribute("data-unique-id")||"",e=this.getAttribute("data-alt-text")||"",i=this.getAttribute("data-avatar-src")||"";this.applyColor(this.img,t,e),i&&this.testLoadImage(i)}disconnectedCallback(){this.testImage&&(this.testImage.onload=null,this.testImage=null),this.img=null}testLoadImage(t){this.testImage=new Image,this.testImage.onload=()=>{this.img&&(this.img.src=t)},this.testImage.src=t}applyColor(t,e,i){if(!e||!i)return;const n=`${e}${i}`,s=`hsl(${this.valueHash(n)}, 50%, 30%)`;this.updateSvgColor(t,s)}valueHash(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);return e%360}updateSvgColor(t,e){const i=t.src;if(!i.startsWith("data:image/svg+xml;base64,"))return;const n=i.replace("data:image/svg+xml;base64,","");try{const i=atob(n).replace(/fill="hsl\([^"]+\)"/,`fill="${e}"`);t.src=`data:image/svg+xml;base64,${btoa(i)}`}catch{}}};za=g([j("avatar-fallback")],za);let _a=class PageHeaderElement extends HTMLElement{menuItemClick(t){const e=t.currentTarget,i=e?.getAttribute("data-for");i&&document.getElementById(i)?.click()}};_a=g([j("page-header")],_a),window.customElements.get("page-header")||(window.PageHeaderElement=_a,window.customElements.define("page-header",_a));let Za=class ZenModeButtonElement extends HTMLElement{constructor(){super(),this.inZenMode=!1,document.addEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}disconnectedCallback(){document.removeEventListener("fullscreenchange",this.fullscreenChangeEventHandler.bind(this))}fullscreenChangeEventHandler(){this.changeButtonState(!this.inZenMode),this.dispatchZenModeStatus()}dispatchZenModeStatus(){const t=new CustomEvent("zenModeToggled",{detail:{active:this.inZenMode}});window.dispatchEvent(t)}deactivateZenMode(){document.exitFullscreen&&document.exitFullscreen()}activateZenMode(){document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()}changeButtonState(t){this.inZenMode=t,this.button.setAttribute("aria-pressed",t.toString())}performAction(){this.inZenMode?this.deactivateZenMode():this.activateZenMode()}};g([U],Za.prototype,"button",void 0),Za=g([j("zen-mode-button")],Za),window.customElements.get("zen-mode-button")||(window.ZenModeButtonElement=Za,window.customElements.define("zen-mode-button",Za));let Ya=class SubHeaderElement extends HTMLElement{connectedCallback(){this.setupFilterInputClearButton()}setupFilterInputClearButton(){this.waitForCondition((()=>Boolean(this.filterInput)),(()=>{this.toggleFilterInputClearButton()}))}toggleFilterInputClearButton(){this.filterInput.value.length>0?this.filterInput.classList.remove("SubHeader-filterInput_hiddenClearButton"):this.filterInput.classList.add("SubHeader-filterInput_hiddenClearButton")}expandFilterInput(){for(const t of this.shownItemsOnExpandedFilter)t.classList.remove("d-none","d-sm-none");for(const t of this.filterExpandButton)t.classList.remove("d-inline-flex","d-sm-inline-flex"),t.classList.add("d-none");this.classList.add("SubHeader--expandedSearch"),this.filterInput.focus()}collapseFilterInput(){for(const t of this.filterExpandButton)t.classList.remove("d-none");for(const t of this.shownItemsOnExpandedFilter)t.classList.add("d-none","d-sm-none");this.classList.remove("SubHeader--expandedSearch")}waitForCondition(t,e){if(t())e();else{const i=new MutationObserver((()=>{t()&&(e(),i.disconnect())}));i.observe(this,{childList:!0,subtree:!0})}}};var Ga,Ja;g([U],Ya.prototype,"filterInput",void 0),g([K],Ya.prototype,"shownItemsOnExpandedFilter",void 0),g([K],Ya.prototype,"filterExpandButton",void 0),Ya=g([j("sub-header")],Ya),window.customElements.get("sub-header")||(window.SubHeaderElement=Ya,window.customElements.define("sub-header",Ya));let Xa=class DangerDialogFormHelperElement extends HTMLElement{constructor(){super(...arguments),Ga.add(this),this.confirmationLiveMessageChecked="",this.confirmationLiveMessageUnchecked=""}get form(){return this.querySelector("form")}get submitButton(){return this.querySelector("input[type=submit],button[type=submit],button[data-submit-dialog-id]")}connectedCallback(){this.style.display="contents",this.form&&(this.form.style.display="contents"),b(this,Ga,"m",Ja).call(this)}toggle(){if(!this.checkbox||!this.submitButton)return;const t=this.checkbox.checked;if(this.submitButton.disabled=!t,this.liveRegion){const e=t?this.confirmationLiveMessageChecked:this.confirmationLiveMessageUnchecked;this.liveRegion.announce(e,{politeness:"assertive"})}}};Ga=new WeakSet,Ja=function(){this.toggle()},g([U],Xa.prototype,"checkbox",void 0),g([U],Xa.prototype,"liveRegion",void 0),g([I],Xa.prototype,"confirmationLiveMessageChecked",void 0),g([I],Xa.prototype,"confirmationLiveMessageUnchecked",void 0),Xa=g([j("danger-dialog-form-helper")],Xa),window.customElements.get("danger-dialog-form-helper")||(window.DangerDialogFormHelperElement=Xa,window.customElements.define("danger-dialog-form-helper",Xa));class CollapsibleElement extends HTMLElement{constructor(){super(...arguments),this.collapsed=!1}toggleViaKeyboard(t){"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),this.toggle())}toggle(){this.collapsed=!this.collapsed}attributeChangedCallback(t){"data-collapsed"===t&&(this.collapsed?this.hideAll():this.expandAll())}hideAll(){this.arrowDown?.removeAttribute("hidden"),this.arrowUp?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","false");for(const t of this.collapsibleElements)t.hidden=!0;this.classList.add(`${this.baseClass}--collapsed`)}expandAll(){this.arrowUp?.removeAttribute("hidden"),this.arrowDown?.setAttribute("hidden",""),this.triggerElement.setAttribute("aria-expanded","true");for(const t of this.collapsibleElements)t.hidden=!1;this.classList.remove(`${this.baseClass}--collapsed`)}}g([U],CollapsibleElement.prototype,"arrowDown",void 0),g([U],CollapsibleElement.prototype,"arrowUp",void 0),g([U],CollapsibleElement.prototype,"triggerElement",void 0),g([K],CollapsibleElement.prototype,"collapsibleElements",void 0),g([I],CollapsibleElement.prototype,"collapsed",void 0);let Qa=class CollapsibleHeaderElement extends CollapsibleElement{connectedCallback(){if(!this.closest(".Box"))throw new Error("No surrounding BorderBox found")}get baseClass(){return"CollapsibleHeader"}};Qa=g([j("collapsible-header")],Qa);let tl=class CollapsibleSectionElement extends CollapsibleElement{get baseClass(){return"CollapsibleSection"}};var el,il,nl,sl,ol,rl,al,ll,cl,dl,hl,ul,ml,fl,pl,gl,bl,vl,wl,yl,El,Al,kl,Ll,Sl,Tl,Cl,xl,Ml,Il,Dl,Pl,Nl,Hl,Fl,Ol,ql,Vl,Rl,Wl,Bl;tl=g([j("collapsible-section")],tl);let $l=class FilterableTreeViewElement extends HTMLElement{constructor(){super(...arguments),el.add(this),il.set(this,void 0),nl.set(this,void 0),sl.set(this,new Map),ol.set(this,null),rl.set(this,null),al.set(this,null),ll.set(this,null),cl.set(this,new Map),dl.set(this,new Map),hl.set(this,!1)}connectedCallback(){const{signal:t}=v(this,nl,new AbortController,"f");this.addEventListener("treeViewNodeChecked",this,{signal:t}),this.addEventListener("itemActivated",this,{signal:t}),this.addEventListener("input",this,{signal:t}),this.addEventListener("keydown",this,{signal:t}),b(this,el,"a",ml)&&b(this,el,"m",Ml).call(this)}disconnectedCallback(){b(this,nl,"f").abort(),b(this,rl,"f")?.abort(),null!==b(this,ol,"f")&&clearTimeout(b(this,ol,"f"))}handleEvent(t){t.target===this.filterModeControl?b(this,el,"m",wl).call(this,t):t.target===this.filterInput?"keydown"===t.type?b(this,el,"m",Al).call(this,t):b(this,el,"m",El).call(this,t):t.target===this.includeSubItemsCheckBox?b(this,el,"m",Ll).call(this,t):t.target instanceof Ca||t.target instanceof Ka?b(this,el,"m",pl).call(this,t):"keydown"===t.type&&this.treeViewList?.contains(t.target)&&b(this,el,"m",kl).call(this,t)}get filterModeControl(){return this.filterModeControlList.closest("segmented-control")}get treeView(){return this.treeViewList.closest("tree-view")}set filterFn(t){v(this,il,t,"f")}get filterFn(){return b(this,il,"f")?b(this,il,"f"):this.defaultFilterFn}defaultFilterFn(t,e,i){const n=[];if(e.length>0){const i=e.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=s.nextNode();for(;o;){const t=o.textContent?.toLocaleLowerCase()||"";let e=0;for(;e<t.length;){const s=t.indexOf(i,e);if(-1===s)break;const r=new Range;r.setStart(o,s),r.setEnd(o,s+i.length),n.push(r),e=s+i.length}o=s.nextNode()}}if(0===n.length&&e.length>0)return null;switch(i){case"selected":if("false"!==this.treeView?.getNodeCheckedValue(t))return n;break;case"all":return n}return null}get filterMode(){const t=this.filterModeControl?.current;return t?t.getAttribute("data-name"):null}get queryString(){return this.filterInput.value}*eachDescendantDepthFirst(t,e,i){for(const n of t.querySelectorAll(`[role=treeitem][data-node-type='sub-tree'][aria-level='${e}']`)){const t=n.closest("tree-view-sub-tree-node");yield*this.eachDescendantDepthFirst(t,e+1,[...i,t])}const n=t.querySelectorAll(`[role=treeitem][data-node-type='leaf'][aria-level='${e}']`);yield[n,i]}*eachShallowestCheckedSubTree(t){if("true"!==this.treeView?.getNodeCheckedValue(t.node))for(const e of t.eachDirectDescendantSubTreeNode())yield*this.eachShallowestCheckedSubTree(e);else yield t}};il=new WeakMap,nl=new WeakMap,sl=new WeakMap,ol=new WeakMap,rl=new WeakMap,al=new WeakMap,ll=new WeakMap,cl=new WeakMap,dl=new WeakMap,hl=new WeakMap,el=new WeakSet,ul=function(){return this.getAttribute("src")},ml=function(){return!!b(this,el,"a",ul)},fl=function(){return"false"!==this.getAttribute("data-show-search-highlighting")},pl=function(t){const e=t;if("treeViewNodeChecked"===t.type)b(this,el,"m",gl).call(this,e),b(this,el,"m",bl).call(this,e)},gl=function(t){if(b(this,el,"a",ml)){for(const e of t.detail){const t=e.node,i=t.getAttribute("data-node-id");if(i)if("false"===e.checkedValue)b(this,cl,"f").delete(i),b(this,dl,"f").delete(i);else{"single"===t.getAttribute("data-select-variant")&&(b(this,cl,"f").clear(),b(this,dl,"f").clear()),b(this,cl,"f").set(i,e.checkedValue);const n={path:e.path};n.nodeId=i;const s=t.getAttribute("data-value");s&&(n.value=s),b(this,dl,"f").set(i,n)}}b(this,el,"m",ql).call(this)}},bl=function(t){if(!this.treeView)return;if(!this.includeSubItemsCheckBox.checked)return;const e=t.detail[0];if("sub-tree"!==this.treeView.getNodeType(e.node))return;const i=e.node.closest("tree-view-sub-tree-node");"false"===e.checkedValue?b(this,el,"m",vl).call(this,i):b(this,el,"m",Tl).call(this,i)},vl=function(t){if(!this.treeView)return;if(!b(this,sl,"f").has(t))return;const e=b(this,sl,"f").get(t);for(const[t,i]of e.entries()){let e=t;t instanceof Ka&&(e=t.node),this.treeView.setNodeCheckedValue(e,i.checked?"true":"false"),this.treeView.setNodeDisabledValue(e,i.disabled)}b(this,sl,"f").delete(t)},wl=function(t){"itemActivated"===t.type&&(b(this,el,"a",ml)?"selected"===this.filterMode?(v(this,ll,b(this,el,"m",Il).call(this),"f"),b(this,el,"m",Vl).call(this)):null!==b(this,ll,"f")&&0===this.queryString.length?(b(this,el,"m",yl).call(this),b(this,el,"m",Dl).call(this,b(this,ll,"f")),v(this,ll,null,"f")):(v(this,ll,null,"f"),b(this,el,"m",xl).call(this)):b(this,el,"m",Vl).call(this))},yl=function(){for(const t of this.querySelectorAll("tree-view li[hidden], tree-view-sub-tree-node[hidden]"))t.removeAttribute("hidden")},El=function(t){"input"===t.type&&(b(this,el,"a",ml)&&"selected"!==this.filterMode?b(this,el,"m",xl).call(this):b(this,el,"m",Vl).call(this))},Al=function(t){if("ArrowDown"!==t.key&&"ArrowUp"!==t.key)return;const e=[...this.treeViewList?.querySelectorAll("[role=treeitem]")??[]].filter((t=>!t.closest("[hidden]")));if(0===e.length)return;t.preventDefault();("ArrowDown"===t.key?e[0]:e[e.length-1]).focus()},kl=function(t){"Escape"===t.key&&(t.preventDefault(),this.filterInput.focus())},Ll=function(t){this.treeView&&"input"===t.type&&(b(this,el,"a",ml)||b(this,el,"m",Vl).call(this),this.includeSubItemsCheckBox.checked?b(this,el,"m",Sl).call(this):b(this,el,"m",Cl).call(this))},Sl=function(){if(this.treeView)for(const t of this.treeView.rootSubTreeNodes())for(const e of this.eachShallowestCheckedSubTree(t))b(this,el,"m",Tl).call(this,e)},Tl=function(t){if(!this.treeView)return;const e=new Map;for(const i of t.eachDescendantNode())e.set(i,{checked:"true"===this.treeView.getNodeCheckedValue(i),disabled:this.treeView.getNodeDisabledValue(i)}),this.treeView.setNodeCheckedValue(i,"true"),this.treeView.setNodeDisabledValue(i,!0);b(this,sl,"f").set(t,e)},Cl=function(){for(const t of b(this,sl,"f").keys())b(this,el,"m",vl).call(this,t)},xl=function(){null!==b(this,ol,"f")&&clearTimeout(b(this,ol,"f")),v(this,ol,setTimeout((()=>{v(this,ol,null,"f"),b(this,el,"m",Ml).call(this)}),300),"f")},Ml=async function(){const t=b(this,el,"a",ul);if(!t)return;const e=this.queryString,i=this.filterMode||"all",n=this.includeSubItemsCheckBox?.checked??!1;!b(this,hl,"f")&&e.length>0?(b(this,el,"m",Pl).call(this),v(this,hl,!0,"f")):b(this,hl,"f")&&0===e.length&&v(this,hl,!1,"f");const s=e.length>0;b(this,rl,"f")?.abort();const{signal:o}=v(this,rl,new AbortController,"f"),r=new URL(t,window.location.href);r.searchParams.set("query",e),r.searchParams.set("filter_mode",i),r.searchParams.set("include_sub_items",String(n));for(const t of b(this,cl,"f").keys())r.searchParams.append("checked_ids[]",t);this.setAttribute("data-loading",""),this.setAttribute("aria-busy","true");try{const t=await fetch(r.toString(),{signal:o,headers:{Accept:"text/html"},credentials:"same-origin",method:"GET"});if(!t.ok)return;const i=await t.text(),a=(new DOMParser).parseFromString(i,"text/html").querySelector("tree-view");if(!a)return;const l=this.treeViewList?.closest("tree-view");if(!l)return;if(b(this,sl,"f").clear(),l.replaceWith(a),b(this,el,"m",Hl).call(this),n&&b(this,el,"m",Sl).call(this),s){b(this,el,"m",Fl).call(this),b(this,el,"a",fl)&&b(this,el,"m",Ol).call(this,e);const t=!!this.treeViewList?.querySelector("[role=treeitem]");this.noResultsMessage.toggleAttribute("hidden",t),this.treeViewList?.toggleAttribute("hidden",!t)}else b(this,el,"a",fl)&&b(this,el,"m",Bl).call(this),b(this,el,"m",Nl).call(this),this.noResultsMessage.setAttribute("hidden","hidden"),this.treeViewList?.removeAttribute("hidden");b(this,el,"m",ql).call(this)}catch(t){if("AbortError"===t.name)return;throw t}finally{this.removeAttribute("data-loading"),this.setAttribute("aria-busy","false")}},Il=function(){const t=new Map;for(const e of this.querySelectorAll("[role=treeitem][data-node-id][data-node-type=sub-tree]"))t.set(e.getAttribute("data-node-id"),"true"===e.getAttribute("aria-expanded"));return t},Dl=function(t){for(const[e,i]of t){const t=this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`),n=t?.closest("tree-view-sub-tree-node");n&&(i?n.expand():n.collapse())}},Pl=function(){v(this,al,b(this,el,"m",Il).call(this),"f")},Nl=function(){b(this,al,"f")&&(b(this,el,"m",Dl).call(this,b(this,al,"f")),v(this,al,null,"f"))},Hl=function(){if(this.treeView)for(const t of this.querySelectorAll("[role=treeitem][data-node-id]")){const e=t.getAttribute("data-node-id"),i=b(this,cl,"f").get(e);void 0!==i&&this.treeView.setNodeCheckedValue(t,i)}},Fl=function(){for(const t of this.querySelectorAll("tree-view-sub-tree-node"))t.expand()},Ol=function(t){b(this,el,"m",Bl).call(this);const e=[];for(const i of this.querySelectorAll("[role=treeitem]")){const n=this.defaultFilterFn(i,t,"all");n&&e.push(...n)}e.length>0&&b(this,el,"m",Rl).call(this,e)},ql=function(){const t=this.treeView?.formInputPrototype;if(t){for(const t of this.querySelectorAll("[data-filterable-tree-view-retained]"))t.remove();for(const[e,i]of b(this,dl,"f")){if(!!this.querySelector(`[role=treeitem][data-node-id="${CSS.escape(e)}"]`))continue;const n=document.createElement("input");n.type="hidden",n.name=t.name,n.value=JSON.stringify(i),n.setAttribute("data-filterable-tree-view-retained",""),this.appendChild(n)}}},Vl=function(){if(!this.treeView)return;b(this,el,"m",Bl).call(this);const t=this.queryString,e=this.filterMode||void 0,i=window.crypto.randomUUID(),n=new Map,s=(...n)=>{for(const s of n)s.expand(),s.removeAttribute("hidden"),s.setAttribute("data-generation",i),o(s.node,t,e)?s.node.removeAttribute("aria-disabled"):s.node.setAttribute("aria-disabled","true")},o=(t,e,i)=>(n.has(t)||n.set(t,this.filterFn(t,e,i)),null!==n.get(t));for(const[n,r]of this.eachDescendantDepthFirst(this.treeViewList,1,[])){const a=r[r.length-1];let l=!1;for(const i of n)o(i,t,e)?(i.closest("li")?.removeAttribute("hidden"),l=!0):i.closest("li")?.setAttribute("hidden","hidden");l?s(...r):a&&(o(a.node,t,e)?s(...r):a.getAttribute("data-generation")!==i&&(a.collapse(),a.setAttribute("hidden","hidden")))}const r=Array.from(n.values()).flat().filter((t=>null!==t));0===r.length&&t.length>0?(this.treeViewList.setAttribute("hidden","hidden"),this.noResultsMessage.removeAttribute("hidden")):(this.treeViewList.removeAttribute("hidden"),this.noResultsMessage.setAttribute("hidden","hidden"),b(this,el,"a",fl)&&b(this,el,"m",Rl).call(this,r))},Rl=function(t){CSS.highlights?CSS.highlights.set("primer-filterable-tree-view-search-results",new Highlight(...t)):b(this,el,"m",Wl).call(this,t)},Wl=function(t){const e=t[0].startContainer,i=e.parentNode,n=e.textContent,s=[];let o=0;for(const{startOffset:e,endOffset:i}of t){e>o&&s.push(document.createTextNode(n.slice(o,e)));const t=document.createElement("mark");t.textContent=n.slice(e,i),s.push(t),o=i}o<n.length&&s.push(document.createTextNode(n.slice(o)));for(const t of s.reverse())i.insertBefore(t,e.nextSibling);i.removeChild(e)},Bl=function(){for(const t of this.querySelectorAll("mark"))t.parentElement&&t.parentElement.replaceChildren(t.parentElement.textContent)},g([U],$l.prototype,"filterInput",void 0),g([U],$l.prototype,"filterModeControlList",void 0),g([U],$l.prototype,"treeViewList",void 0),g([U],$l.prototype,"noResultsMessage",void 0),g([U],$l.prototype,"includeSubItemsCheckBox",void 0),$l=g([j("filterable-tree-view")],$l),window.customElements.get("filterable-tree-view")||(window.FilterableTreeViewElement=$l,window.customElements.define("filterable-tree-view",$l))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map