/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
const o=o=>({create:e=>r(o,e),dismiss:(e,n,t)=>a(document,e,n,o,t),getTop:async()=>s(document,o)}),e=o("ion-action-sheet"),n=o("ion-loading"),t=o("ion-modal"),i=o("ion-toast"),r=(o,e)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(o).then((()=>{const n=document.createElement(o);return n.classList.add("overlay-hidden"),Object.assign(n,Object.assign(Object.assign({},e),{hasController:!0})),d(document).appendChild(n),new Promise((o=>{return i=o,void((t=n).componentOnReady?t.componentOnReady().then((o=>i(o))):(e=()=>i(t),"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e)));var e,t,i}))})):Promise.resolve(),a=(o,e,n,t,i)=>{const r=s(o,t,i);return r?r.dismiss(e,n):Promise.reject("overlay does not exist")},s=(o,e,n)=>{const t=((o,e)=>(void 0===e&&(e="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(o.querySelectorAll(e)).filter((o=>o.overlayIndex>0))))(o,e).filter((o=>!o.classList.contains("overlay-hidden")));return void 0===n?t[t.length-1]:t.find((o=>o.id===n))},d=o=>o.querySelector("ion-app")||o.body;export{e as a,n as l,t as m,i as t}