"use strict";(globalThis.webpackChunk_ember_auto_import_=globalThis.webpackChunk_ember_auto_import_||[]).push([[121],{4121:(e,t,o)=>{o.r(t),o.d(t,{default:()=>_}) var i=window.CustomEvent function n(e,t){var o="on"+t.type.toLowerCase() return"function"==typeof e[o]&&e[o](t),e.dispatchEvent(t)}function a(e){for(;e;){if("dialog"===e.localName)return e e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function r(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement e&&e.blur&&e!==document.body&&e.blur()}function l(e,t){for(var o=0;o=0&&(e=this.dialog_),e||(e=d(this.dialog_)),r(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.") new p(e)},registerDialog:function(e){e.showModal||g.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[] var e=this.checkDOM_.bind(this) this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver((function(t){var o=[] t.forEach((function(e){for(var t,i=0;t=e.removedNodes[i];++i)t instanceof Element&&("dialog"===t.localName&&o.push(t),o=o.concat(t.querySelectorAll("dialog")))})),o.length&&e(o)})))}} if(g.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},g.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},g.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t) var i=this.pendingDialogStack[0] i?(i.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},g.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=a(e);){for(var t,o=0;t=this.pendingDialogStack[o];++o)if(t.dialog===e)return 0===o e=e.parentElement}return!1},g.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),r(t),void 0!==this.forwardTab_)){var o=this.pendingDialogStack[0] return o.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?o.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},g.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation() var t=new i("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0] o&&n(o.dialog,t)&&o.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},g.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach((function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()}))},g.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1 return!(this.pendingDialogStack.length>=t||(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),0))},g.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},g.dm=new g.DialogManager,g.formSubmitter=null,g.imagemapUseValue=null,void 0===window.HTMLDialogElement){var m=document.createElement("form") if(m.setAttribute("method","dialog"),"dialog"!==m.method){var f=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method") if(f){var b=f.get f.get=function(){return s(this)?"dialog":b.call(this)} var v=f.set f.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):v.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",f)}}document.addEventListener("click",(function(e){if(g.formSubmitter=null,g.imagemapUseValue=null,!e.defaultPrevented){var t=e.target if("composedPath"in e&&(t=e.composedPath().shift()||t),t&&s(t.form)){if(!("submit"===t.type&&["button","input"].indexOf(t.localName)>-1)){if("input"!==t.localName||"image"!==t.type)return g.imagemapUseValue=e.offsetX+","+e.offsetY}a(t)&&(g.formSubmitter=t)}}}),!1),document.addEventListener("submit",(function(e){var t=e.target if(!a(t)){var o=c(e) "dialog"===(o&&o.getAttribute("formmethod")||t.getAttribute("method"))&&e.preventDefault()}})) var y=HTMLFormElement.prototype.submit HTMLFormElement.prototype.submit=function(){if(!s(this))return y.call(this) var e=a(this) e&&e.close()}}const _=g}}])