1var e;import{B as t}from"./BaseElement.DAzHg0T6.min.js";import{t as r,e as o}from"./focusTrap.CuaWSB2G.min.js";import{a as n}from"./amplitude-visual-labeling.DyWU5gKm.min.js";import{n as i,e as a,g as s}from"./vendor-lit.Cg17OMaX.min.js";function l(e){return/auto|scroll/.test(e)}function d(e){n()||(document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%")}function u(){document.body.style.removeProperty("position"),document.body.style.removeProperty("top"),document.body.style.removeProperty("width")}var c=Object.defineProperty,h=(e,t,r,o)=>{for(var n,i=void 0,a=e.length-1;a>=0;a--)(n=e[a])&&(i=n(t,r,i)||i);return i&&c(t,r,i),i};function p(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.setTimeout(e,520)})})}let y=0,m=0;function w(){0!==y&&(y--,0===y&&(u(),document.documentElement.classList.remove("overflow-hidden"),document.body.classList.remove("overflow-hidden"),window.scrollTo({top:m,left:0,behavior:"auto"})))}const f=((e=class extends t{constructor(){super(),this.open=!1,this.flyoutKey="",this.detachedTrigger=null,this.invokerElement=null,this.openDrawer=this.openDrawer.bind(this),this.closeDrawer=this.closeDrawer.bind(this),this.openDrawerById=this.openDrawerById.bind(this),this.closeDrawerById=this.closeDrawerById.bind(this),this.handleEscapeKey=this.handleEscapeKey.bind(this),this.handleTrapKeydown=this.handleTrapKeydown.bind(this)}get flyoutDrawerOpenButton(){return this.detachedTrigger??this.querySelector("[data-flyout-drawer-open-button]")??void 0}get externalTriggers(){return this.id?Array.from(document.querySelectorAll(`[data-flyout-drawer-external-trigger="${this.id}"]`)):[]}connectedCallback(){var e,t,r;super.connectedCallback(),this.classList.add("group/flyout"),null==(e=this.flyoutDrawerOpenButton)||e.addEventListener("click",this.openDrawer),null==(t=this.flyoutDrawerBackdrop)||t.addEventListener("click",this.closeDrawer),null==(r=this.flyoutDrawerCloseButtons)||r.forEach(e=>{e.addEventListener("click",this.closeDrawer)}),document.addEventListener("flyout-drawer:open",this.openDrawerById),document.addEventListener("flyout-drawer:close",this.closeDrawerById),document.addEventListener("keydown",this.handleEscapeKey),this.setupDialogSemantics(),this.setDrawerInert(!this.open)}firstUpdated(e){super.firstUpdated(e),this.openFromQueryParamIfMatching()}disconnectedCallback(){var t,r,o;this.open&&w(),super.disconnectedCallback(),e.openDrawerStack=e.openDrawerStack.filter(e=>e!==this),null==(t=this.flyoutDrawerOpenButton)||t.removeEventListener("click",this.openDrawer),null==(r=this.flyoutDrawerBackdrop)||r.removeEventListener("click",this.closeDrawer),null==(o=this.flyoutDrawerCloseButtons)||o.forEach(e=>{e.removeEventListener("click",this.closeDrawer)}),document.removeEventListener("flyout-drawer:open",this.openDrawerById),document.removeEventListener("flyout-drawer:close",this.closeDrawerById),document.removeEventListener("keydown",this.handleEscapeKey),document.removeEventListener("keydown",this.handleTrapKeydown)}updated(e){super.updated(e),e.has("open")&&(this.open?(0===y&&(m=window.scrollY,d(m),document.documentElement.classList.add("overflow-hidden"),document.body.classList.add("overflow-hidden")),y++):w()),this.syncDialogA11yState(e)}syncDialogA11yState(e){var t;null==(t=this.flyoutDrawerOpenButton)||t.setAttribute("aria-expanded",String(this.open)),this.externalTriggers.forEach(e=>{e.setAttribute("aria-expanded",String(this.open))}),e.has("open")&&(this.open?this.onDialogOpened():this.onDialogClosed())}setupDialogSemantics(){const e=this.flyoutDrawerContent;e&&(e.id||(e.id=`${this.id||`flyout-${Math.random().toString(36).slice(2,8)}`}-dialog`),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),this.applyDialogLabelFromHeading(e),[this.flyoutDrawerOpenButton,...this.externalTriggers].forEach(t=>{t&&(t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"))}))}applyDialogLabelFromHeading(e){if(e.hasAttribute("aria-label"))return;const t=e.getAttribute("aria-labelledby");if(t&&document.getElementById(t))return;e.removeAttribute("aria-labelledby");const r=e.querySelector("h1, h2, h3, h4, h5, h6");r&&(r.id||(r.id=`${e.id}-title`),e.setAttribute("aria-labelledby",r.id))}get isTopmostOpenDrawer(){const t=e.openDrawerStack;return t[t.length-1]===this}handleTrapKeydown(e){this.isTopmostOpenDrawer&&this.flyoutDrawerContent&&r(e,this.flyoutDrawerContent)}setDrawerInert(e){const t=this.flyoutDrawerContent;t&&(e?t.setAttribute("inert",""):t.removeAttribute("inert"))}onDialogOpened(){const t=document.activeElement;this.invokerElement=t instanceof HTMLElement&&t!==document.body?t:this.flyoutDrawerOpenButton??this.externalTriggers[
10]??null,e.openDrawerStack=[...e.openDrawerStack.filter(e=>e!==this),this];const r=this.flyoutDrawerContent;r&&(this.applyDialogLabelFromHeading(r),this.setDrawerInert(!1),document.addEventListener("keydown",this.handleTrapKeydown),r.focus({preventScroll:!0}))}onDialogClosed(){var t;e.openDrawerStack=e.openDrawerStack.filter(e=>e!==this),document.removeEventListener("keydown",this.handleTrapKeydown),this.setDrawerInert(!0),(null==(t=this.invokerElement)?void 0:t.isConnected)&&this.invokerElement.focus({preventScroll:!0}),this.invokerElement=null}escapeScrollContainers(){if("true"===this.dataset.portaled)return;if(!function(e){if(e.closest("dialog, modal-dialog"))return null;let t=e.parentElement;for(;t&&t!==document.body;){const{overflowX:e,overflowY:r}=getComputedStyle(t);if(l(e)||l(r))return t;t=t.parentElement}return null}(this))return;const e=this.querySelector("[data-flyout-drawer-open-button]");e&&this.parentElement&&(this.detachedTrigger=e,this.parentElement.insertBefore(e,this)),this.dataset.portaled="true",document.body.appendChild(this)}openDrawer(e){e.preventDefault(),this.escapeScrollContainers(),this.open=!0}getFlyoutQueryKey(){return this.flyoutKey.trim()||null}openFromQueryParamIfMatching(){const e=(null==(t=new URLSearchParams(window.location.search).get("flyout"))?void 0:t.trim())||null;var t;const r=this.getFlyoutQueryKey();e&&r&&e===r&&!this.open&&this.openDrawer(new Event("flyout-drawer:query-param"))}closeDrawer(e,t){e.preventDefault(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0,detail:{id:this.id}})),(null==t?void 0:t.callback)&&t.callback(),(null==t?void 0:t.callbackAfterClose)&&p(t.callbackAfterClose)}openDrawerById(e){this.id&&e.detail.id&&this.id===e.detail.id&&this.openDrawer(e)}closeDrawerById(e){this.id&&e.detail.id&&this.id===e.detail.id&&this.closeDrawer(e)}handleEscapeKey(e){"Escape"===e.key&&this.open&&this.isTopmostOpenDrawer&&(o(e)||e.composedPath().some(e=>e instanceof Element&&e.matches("ritual-custom-select[open]"))||this.closeDrawer(e))}}).openDrawerStack=[],e);h([i({type:Boolean,reflect:!0})],f.prototype,"open"),h([i({type:String,attribute:"data-flyout-key"})],f.prototype,"flyoutKey"),h([a("[data-flyout-drawer-backdrop]")],f.prototype,"flyoutDrawerBackdrop"),h([a("[data-flyout-drawer-content]")],f.prototype,"flyoutDrawerContent"),h([s("[data-flyout-drawer-close-button]")],f.prototype,"flyoutDrawerCloseButtons");let D=f;customElements.get("flyout-drawer")||customElements.define("flyout-drawer",D);export{D as F,d as p,p as s,u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.