import{w as e}from"./p-5ab6b26f.js";const a="ionViewWillLeave",i="ionViewDidLeave",n="ionViewWillUnload",t=a=>new Promise((i,n)=>{e(()=>{s(a),o(a).then(e=>{e.animation&&e.animation.destroy(),l(a),i(e)},e=>{l(a),n(e)})})}),s=e=>{const a=e.enteringEl,i=e.leavingEl;h(a,i,e.direction),e.showGoBack?a.classList.add("can-go-back"):a.classList.remove("can-go-back"),u(a,!1),i&&u(i,!1)},o=async e=>{const a=await r(e);return a?d(a,e):c(e)},l=e=>{const a=e.leavingEl;e.enteringEl.classList.remove("ion-page-invisible"),void 0!==a&&a.classList.remove("ion-page-invisible")},r=async e=>{if(e.leavingEl&&e.animated&&0!==e.duration)return e.animationBuilder?e.animationBuilder:"ios"===e.mode?(await(()=>__sc_import_webmapgl("./p-eb538b34.js"))()).iosTransitionAnimation:(await(()=>__sc_import_webmapgl("./p-2a37ef9c.js"))()).mdTransitionAnimation},d=async(e,a)=>{await m(a,!0);const i=await __sc_import_webmapgl("./p-d3aa5dba.js").then(i=>i.create(e,a.baseEl,a));return v(a.enteringEl,a.leavingEl),await g(i,a),a.progressCallback&&a.progressCallback(void 0),i.hasCompleted&&w(a.enteringEl,a.leavingEl),{hasCompleted:i.hasCompleted,animation:i}},c=async e=>{const a=e.enteringEl,i=e.leavingEl;return await m(e,!1),v(a,i),w(a,i),{hasCompleted:!0}},m=async(e,a)=>{const i=(void 0!==e.deepWait?e.deepWait:a)?[y(e.enteringEl),y(e.leavingEl)]:[E(e.enteringEl),E(e.leavingEl)];await Promise.all(i),await p(e.viewIsReady,e.enteringEl)},p=async(e,a)=>{e&&await e(a)},g=(e,a)=>{const i=a.progressCallback,n=new Promise(a=>e.onFinish(a));return i?(e.progressStart(),i(e)):e.play(),n},v=(e,a)=>{b(a,"ionViewWillLeave"),b(e,"ionViewWillEnter")},w=(e,a)=>{b(e,"ionViewDidEnter"),b(a,"ionViewDidLeave")},b=(e,a)=>{if(e){const i=new CustomEvent(a,{bubbles:!1,cancelable:!1});e.dispatchEvent(i)}},E=e=>e&&e.componentOnReady?e.componentOnReady():Promise.resolve(),y=async e=>{const a=e;if(a){if(null!=a.componentOnReady&&null!=await a.componentOnReady())return;await Promise.all(Array.from(a.children).map(y))}},u=(e,a)=>{a?(e.setAttribute("aria-hidden","true"),e.classList.add("ion-page-hidden")):(e.hidden=!1,e.removeAttribute("aria-hidden"),e.classList.remove("ion-page-hidden"))},h=(e,a,i)=>{void 0!==e&&(e.style.zIndex="back"===i?"99":"101"),void 0!==a&&(a.style.zIndex="100")};export{n as L,a,i as b,y as d,b as l,u as s,t};