import{w as i}from"./p-8e32a29b.js";const a="ionViewWillLeave",n="ionViewDidLeave",e="ionViewWillUnload",o=a=>new Promise((n,e)=>{i(()=>{s(a),t(a).then(i=>{i.animation&&i.animation.destroy(),r(a),n(i)},i=>{r(a),e(i)})})}),s=i=>{const a=i.enteringEl,n=i.leavingEl;f(a,n,i.direction),i.showGoBack?a.classList.add("can-go-back"):a.classList.remove("can-go-back"),g(a,!1),n&&g(n,!1)},t=async i=>{const a=await c(i);return a?w(a,i):d(i)},r=i=>{const a=i.leavingEl;i.enteringEl.classList.remove("ion-page-invisible"),void 0!==a&&a.classList.remove("ion-page-invisible")},c=async i=>{if(i.leavingEl&&i.animated&&0!==i.duration)return i.animationBuilder?i.animationBuilder:"ios"===i.mode?(await(()=>__sc_import_dos_wc_library("./p-636d80c1.js"))()).iosTransitionAnimation:(await(()=>__sc_import_dos_wc_library("./p-14b924ba.js"))()).mdTransitionAnimation},w=async(i,a)=>{let n;await l(a,!0);try{const e=await __sc_import_dos_wc_library("./p-559f1738.js");n=await e.create(i,a.baseEl,a)}catch(e){n=i(a.baseEl,a)}_(a.enteringEl,a.leavingEl);const e=await b(n,a);return a.progressCallback&&a.progressCallback(void 0),e&&m(a.enteringEl,a.leavingEl),{hasCompleted:e,animation:n}},d=async i=>{const a=i.enteringEl,n=i.leavingEl;return await l(i,!1),_(a,n),m(a,n),{hasCompleted:!0}},l=async(i,a)=>{const n=(void 0!==i.deepWait?i.deepWait:a)?[y(i.enteringEl),y(i.leavingEl)]:[v(i.enteringEl),v(i.leavingEl)];await Promise.all(n),await p(i.viewIsReady,i.enteringEl)},p=async(i,a)=>{i&&await i(a)},b=(i,a)=>{const n=a.progressCallback,e=new Promise(a=>{i.onFinish(n=>{"number"==typeof n?a(1===n):void 0!==i.hasCompleted&&a(i.hasCompleted)})});return n?(i.progressStart(!0),n(i)):i.play(),e},_=(i,a)=>{u(a,"ionViewWillLeave"),u(i,"ionViewWillEnter")},m=(i,a)=>{u(i,"ionViewDidEnter"),u(a,"ionViewDidLeave")},u=(i,a)=>{if(i){const n=new CustomEvent(a,{bubbles:!1,cancelable:!1});i.dispatchEvent(n)}},v=i=>i&&i.componentOnReady?i.componentOnReady():Promise.resolve(),y=async i=>{const a=i;if(a){if(null!=a.componentOnReady&&null!=await a.componentOnReady())return;await Promise.all(Array.from(a.children).map(y))}},g=(i,a)=>{a?(i.setAttribute("aria-hidden","true"),i.classList.add("ion-page-hidden")):(i.hidden=!1,i.removeAttribute("aria-hidden"),i.classList.remove("ion-page-hidden"))},f=(i,a,n)=>{void 0!==i&&(i.style.zIndex="back"===n?"99":"101"),void 0!==a&&(a.style.zIndex="100")},h=i=>{if(i.classList.contains("ion-page"))return i;return i.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||i};export{e as L,a,n as b,y as d,h as g,u as l,g as s,o as t};