import{g as n,c as o}from"./p-24c4a299.js";import{c as t,m as e,q as i,n as a,l as d}from"./p-8cd54418.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const s=99,r=Object.freeze({__proto__:null,blockHardwareBackButton:()=>{document.addEventListener("backbutton",(()=>{}))},startHardwareBackButton:()=>{const n=document;let o=!1;n.addEventListener("backbutton",(()=>{if(o)return;let t=0,e=[];const i=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(n,o){e.push({priority:n,handler:o,id:t++})}}});n.dispatchEvent(i);const a=()=>{if(e.length>0){let n={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};e.forEach((o=>{o.priority>=n.priority&&(n=o)})),o=!0,e=e.filter((o=>o.id!==n.id)),(async n=>{try{if(null==n?void 0:n.handler){const o=n.handler(a);null!=o&&await o}}catch(n){console.error(n)}})(n).then((()=>o=!1))}};a()}))},OVERLAY_BACK_BUTTON_PRIORITY:100,MENU_BACK_BUTTON_PRIORITY:99});
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
let c=0;const l=new WeakMap,u=n=>({create:o=>y(n,o),dismiss:(o,t,e)=>O(document,o,t,n,e),getTop:async()=>_(document,n)}),p=u("ion-alert"),b=u("ion-action-sheet"),v=u("ion-modal"),m=u("ion-popover"),f=u("ion-toast"),h=n=>{"undefined"!=typeof document&&x(document);const o=c++;n.overlayIndex=o,n.hasAttribute("id")||(n.id=`ion-overlay-${o}`)},y=(n,o)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(n).then((()=>{const e=document.createElement(n);return e.classList.add("overlay-hidden"),Object.assign(e,Object.assign(Object.assign({},o),{hasController:!0})),P(document).appendChild(e),new Promise((n=>t(e,n)))})):Promise.resolve(),w='[tabindex]:not([tabindex^="-"]):not([hidden]):not([disabled]), input:not([type=hidden]):not([tabindex^="-"]):not([hidden]):not([disabled]), textarea:not([tabindex^="-"]):not([hidden]):not([disabled]), button:not([tabindex^="-"]):not([hidden]):not([disabled]), select:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable:not([tabindex^="-"]):not([hidden]):not([disabled]), .ion-focusable[disabled="false"]:not([tabindex^="-"]):not([hidden])',k=(n,o)=>{let t=n.querySelector(w);const e=null==t?void 0:t.shadowRoot;e&&(t=e.querySelector(w)||t),t?i(t):o.focus()},B=(n,o)=>{const t=Array.from(n.querySelectorAll(w));let e=t.length>0?t[t.length-1]:null;const i=null==e?void 0:e.shadowRoot;i&&(e=i.querySelector(w)||e),e?e.focus():o.focus()},x=n=>{0===c&&(c=1,n.addEventListener("focus",(o=>{((n,o)=>{const t=_(o,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover"),e=n.target;t&&e&&(t.classList.contains("ion-disable-focus-trap")||(t.shadowRoot?(()=>{if(t.contains(e))t.lastFocus=e;else{const n=t.lastFocus;k(t,t),n===o.activeElement&&B(t,t),t.lastFocus=o.activeElement}})():(()=>{if(t===e)t.lastFocus=void 0;else{const n=d(t);if(!n.contains(e))return;const i=n.querySelector(".ion-overlay-wrapper");if(!i)return;if(i.contains(e))t.lastFocus=e;else{const n=t.lastFocus;k(i,t),n===o.activeElement&&B(i,t),t.lastFocus=o.activeElement}}})()))})(o,n)}),!0),n.addEventListener("ionBackButton",(o=>{const t=_(n);(null==t?void 0:t.backdropDismiss)&&o.detail.register(100,(()=>t.dismiss(void 0,U)))})),n.addEventListener("keyup",(o=>{if("Escape"===o.key){const o=_(n);(null==o?void 0:o.backdropDismiss)&&o.dismiss(void 0,U)}})))},O=(n,o,t,e,i)=>{const a=_(n,e,i);return a?a.dismiss(o,t):Promise.reject("overlay does not exist")},_=(n,o,t)=>{const e=((n,o)=>(void 0===o&&(o="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(n.querySelectorAll(o)).filter((n=>n.overlayIndex>0))))(n,o).filter((n=>!n.classList.contains("overlay-hidden")));return void 0===t?e[e.length-1]:e.find((n=>n.id===t))},T=(n=!1)=>{const o=P(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");o&&(n?o.setAttribute("aria-hidden","true"):o.removeAttribute("aria-hidden"))},g=async(t,e,i,a,d)=>{var s,r;if(t.presented)return;T(!0),t.presented=!0,t.willPresent.emit(),null===(s=t.willPresentShorthand)||void 0===s||s.emit();const c=n(t),l=t.enterAnimation?t.enterAnimation:o.get(e,"ios"===c?i:a);await I(t,l,t.el,d)&&(t.didPresent.emit(),null===(r=t.didPresentShorthand)||void 0===r||r.emit()),"ION-TOAST"!==t.el.tagName&&j(t.el),!t.keyboardClose||null!==document.activeElement&&t.el.contains(document.activeElement)||t.el.focus()},j=async n=>{let o=document.activeElement;if(!o)return;const t=null==o?void 0:o.shadowRoot;t&&(o=t.querySelector(w)||o),await n.onDidDismiss(),o.focus()},A=async(t,e,i,a,d,s,r)=>{var c,u;if(!t.presented)return!1;T(!1),t.presented=!1;try{t.el.style.setProperty("pointer-events","none"),t.willDismiss.emit({data:e,role:i}),null===(c=t.willDismissShorthand)||void 0===c||c.emit({data:e,role:i});const p=n(t),b=t.leaveAnimation?t.leaveAnimation:o.get(a,"ios"===p?d:s);"gesture"!==i&&await I(t,b,t.el,r),t.didDismiss.emit({data:e,role:i}),null===(u=t.didDismissShorthand)||void 0===u||u.emit({data:e,role:i}),l.delete(t),t.el.classList.add("overlay-hidden"),t.el.style.removeProperty("pointer-events")}catch(n){console.error(n)}return t.el.remove(),!0},P=n=>n.querySelector("ion-app")||n.body,I=async(n,t,e,i)=>{e.classList.remove("overlay-hidden");const a=t(n.el,i);n.animated&&o.getBoolean("animated",!0)||a.duration(0),n.keyboardClose&&a.beforeAddWrite((()=>{const n=e.ownerDocument.activeElement;(null==n?void 0:n.matches("input,ion-input, ion-textarea"))&&n.blur()}));const d=l.get(n)||[];return l.set(n,[...d,a]),await a.play(),!0},N=(n,o)=>{let t;const e=new Promise((n=>t=n));return R(n,o,(n=>{t(n.detail)})),e},R=(n,o,t)=>{const i=e=>{a(n,o,i),t(e)};e(n,o,i)},C=n=>"cancel"===n||n===U,E=n=>n(),M=(n,t)=>{if("function"==typeof n)return o.get("_zoneGate",E)((()=>{try{return n(t)}catch(n){throw n}}))},U="backdrop";export{U as B,s as M,g as a,h as b,b as c,A as d,N as e,k as f,_ as g,p as h,C as i,l as j,r as k,v as m,m as p,M as s,f as t}