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