import{r as t,d as e,w as o,h as i,H as n,e as a}from"./p-03169580.js";import{g as s,c as r}from"./p-4cb16df5.js";import{a as d,i as c,d as l,r as p,f as h,p as f}from"./p-9817ba8b.js";import{C as u,a as m,d as b}from"./p-4a01d54b.js";import{l as w,a as g,e as x}from"./p-f44f0a67.js";import{KEYBOARD_DID_OPEN as v}from"./p-7e7ce516.js";import{b as k}from"./p-9a866be1.js";import{B as y,b as D,a as A,j as B,d as Y,e as C}from"./p-5a032a89.js";import{g as E}from"./p-0e4de1d0.js";import{d as M}from"./p-b6b05afd.js";import{c as S}from"./p-fa62bb38.js";import{g as T}from"./p-4d4077ea.js";import{createGesture as j}from"./p-31f845ed.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const I=typeof window!=="undefined"?window:undefined;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */var $;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})($||($={}));const O={getEngine(){var t,e,o;return((e=(t=I)===null||t===void 0?void 0:t.Capacitor)===null||e===void 0?void 0:e.isPluginAvailable("StatusBar"))&&((o=I)===null||o===void 0?void 0:o.Capacitor.Plugins.StatusBar)},supportsDefaultStatusBarStyle(){var t,e;return!!((e=(t=I)===null||t===void 0?void 0:t.Capacitor)===null||e===void 0?void 0:e.PluginHeaders)},setStyle(t){const e=this.getEngine();if(!e){return}e.setStyle(t)}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const P=(t,e)=>{if(e===1){return 0}const o=1/(1-e);const i=-(e*o);return t*o+i};const z=()=>{if(!I||I.innerWidth>=768||!O.supportsDefaultStatusBarStyle()){return}O.setStyle({style:$.Dark})};const W=()=>{if(!I||I.innerWidth>=768||!O.supportsDefaultStatusBarStyle()){return}O.setStyle({style:$.Default})};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const L=async(t,e)=>{if(typeof t.canDismiss!=="function"){return}const o=await t.canDismiss();if(!o){return}if(e.isRunning()){e.onFinish((()=>{t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}};const R=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const N={MIN_PRESENTING_SCALE:.93};const _=(t,e,o)=>{const i=.5;const n=t.offsetHeight;let a=false;let s=false;let r=null;let h=null;const f=.2;let u=true;let m=0;const b=()=>{if(r&&c(r)){return r.scrollY}else{return true}};const x=t=>{const e=t.event.target;if(e===null||!e.closest){return true}r=d(e);if(r){if(c(r)){const t=w(r);h=t.querySelector(".inner-scroll")}else{h=r}const t=!!r.querySelector("ion-refresher");return!t&&h.scrollTop===0}const o=e.closest("ion-footer");if(o===null){return true}return false};const v=o=>{const{deltaY:i}=o;u=b();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(i>0&&r){l(r)}e.progressStart(true,a?1:0)};const k=t=>{const{deltaY:o}=t;if(o>0&&r){l(r)}const a=t.deltaY/n;const d=a>=0&&s;const c=d?f:.9999;const p=d?R(a/c):a;const h=g(1e-4,p,c);e.progressStep(h);if(h>=i&&m<i){W()}else if(h<i&&m>=i){z()}m=h};const y=d=>{const c=d.velocityY;const l=d.deltaY/n;const h=l>=0&&s;const m=h?f:.9999;const b=h?R(l/m):l;const w=g(1e-4,b,m);const x=(d.deltaY+c*1e3)/n;const v=!h&&x>=i;let k=v?-.001:.001;if(!v){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=T([0,0],[1,0],[.68,.28],[1,1],w)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=T([0,0],[.32,.72],[0,1],[1,1],w)[0]}const y=v?K(l*n,c):K((1-w)*n,c);a=v;D.enable(false);if(r){p(r,u)}e.onFinish((()=>{if(!v){D.enable(true)}})).progressEnd(v?1:0,k,y);if(h&&w>m/4){L(t,e)}else if(v){o()}};const D=j({el:t,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:x,onStart:v,onMove:k,onEnd:y});return D};const K=(t,e)=>g(400,t/Math.abs(e*1.1),500);
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const V=t=>{const{currentBreakpoint:e,backdropBreakpoint:o}=t;const i=o===undefined||o<e;const n=i?`calc(var(--backdrop-opacity) * ${e})`:"0";const a=S("backdropAnimation").fromTo("opacity",0,n);if(i){a.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}const s=S("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-e*100}%)`}]);return{wrapperAnimation:s,backdropAnimation:a}};const F=t=>{const{currentBreakpoint:e,backdropBreakpoint:o}=t;const i=`calc(var(--backdrop-opacity) * ${P(e,o)})`;const n=[{offset:0,opacity:i},{offset:1,opacity:0}];const a=[{offset:0,opacity:i},{offset:o,opacity:0},{offset:1,opacity:0}];const s=S("backdropAnimation").keyframes(o!==0?a:n);const r=S("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-e*100}%)`},{offset:1,opacity:1,transform:`translateY(100%)`}]);return{wrapperAnimation:r,backdropAnimation:s}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const G=()=>{const t=S().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const e=S().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e}};const H=(t,e)=>{const{presentingEl:o,currentBreakpoint:i}=e;const n=w(t);const{wrapperAnimation:a,backdropAnimation:s}=i!==undefined?V(e):G();s.addElement(n.querySelector("ion-backdrop"));a.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const r=S("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(a);if(o){const t=window.innerWidth<768;const e=o.tagName==="ION-MODAL"&&o.presentingElement!==undefined;const i=w(o);const n=S().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});const d=document.body;if(t){const t=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";const i=e?"-10px":t;const a=N.MIN_PRESENTING_SCALE;const s=`translateY(${i}) scale(${a})`;n.afterStyles({transform:s}).beforeAddWrite((()=>d.style.setProperty("background-color","black"))).addElement(o).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:s,borderRadius:"10px 10px 0 0"}]);r.addAnimation(n)}else{r.addAnimation(s);if(!e){a.fromTo("opacity","0","1")}else{const t=e?N.MIN_PRESENTING_SCALE:1;const o=`translateY(-10px) scale(${t})`;n.afterStyles({transform:o}).addElement(i.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:o}]);const a=S().afterStyles({transform:o}).addElement(i.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:o}]);r.addAnimation([n,a])}}}else{r.addAnimation(s)}return r};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Z=()=>{const t=S().fromTo("opacity","var(--backdrop-opacity)",0);const e=S().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};const U=(t,e,o=500)=>{const{presentingEl:i,currentBreakpoint:n}=e;const a=w(t);const{wrapperAnimation:s,backdropAnimation:r}=n!==undefined?F(e):Z();r.addElement(a.querySelector("ion-backdrop"));s.addElement(a.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=S("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(s);if(i){const t=window.innerWidth<768;const e=i.tagName==="ION-MODAL"&&i.presentingElement!==undefined;const o=w(i);const n=S().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{if(t!==1){return}i.style.setProperty("overflow","");const e=Array.from(a.querySelectorAll("ion-modal")).filter((t=>t.presentingElement!==undefined)).length;if(e<=1){a.style.setProperty("background-color","")}}));const a=document.body;if(t){const t=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";const o=e?"-10px":t;const a=N.MIN_PRESENTING_SCALE;const s=`translateY(${o}) scale(${a})`;n.addElement(i).keyframes([{offset:0,filter:"contrast(0.85)",transform:s,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);d.addAnimation(n)}else{d.addAnimation(r);if(!e){s.fromTo("opacity","1","0")}else{const t=e?N.MIN_PRESENTING_SCALE:1;const i=`translateY(-10px) scale(${t})`;n.addElement(o.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:i},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=S().addElement(o.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:i},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([n,a])}}}else{d.addAnimation(r)}return d};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const q=()=>{const t=S().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const e=S().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:`translateY(0px)`}]);return{backdropAnimation:t,wrapperAnimation:e}};const J=(t,e)=>{const{currentBreakpoint:o}=e;const i=w(t);const{wrapperAnimation:n,backdropAnimation:a}=o!==undefined?V(e):q();a.addElement(i.querySelector("ion-backdrop"));n.addElement(i.querySelector(".modal-wrapper"));return S().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([a,n])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Q=()=>{const t=S().fromTo("opacity","var(--backdrop-opacity)",0);const e=S().keyframes([{offset:0,opacity:.99,transform:`translateY(0px)`},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};const X=(t,e)=>{const{currentBreakpoint:o}=e;const i=w(t);const{wrapperAnimation:n,backdropAnimation:a}=o!==undefined?F(e):Q();a.addElement(i.querySelector("ion-backdrop"));n.addElement(i.querySelector(".modal-wrapper"));return S().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([a,n])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const tt=(t,e,o,i,n,a,s=[],r,d,c)=>{const l=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];const p=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-n,opacity:0},{offset:1,opacity:0}];const h={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:n!==0?p:l};const f=t.querySelector("ion-content");const u=o.clientHeight;let m=i;let b=0;let w=false;const v=.95;const k=a.childAnimations.find((t=>t.id==="wrapperAnimation"));const y=a.childAnimations.find((t=>t.id==="backdropAnimation"));const D=s[s.length-1];const A=s[0];const B=()=>{t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove("ion-disable-focus-trap")};const Y=()=>{t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add("ion-disable-focus-trap")};if(k&&y){k.keyframes([...h.WRAPPER_KEYFRAMES]);y.keyframes([...h.BACKDROP_KEYFRAMES]);a.progressStart(true,1-m);const t=m>n;if(t){B()}else{Y()}}if(f&&m!==D){f.scrollY=false}const C=t=>{const e=t.event.target.closest("ion-content");m=r();if(m===1&&e){return false}return true};const E=()=>{w=t.canDismiss!==undefined&&t.canDismiss!==true&&A===0;if(f){f.scrollY=false}x((()=>{t.focus()}));a.progressStart(true,1-m)};const M=t=>{const e=1-m;const o=s.length>1?1-s[1]:undefined;const i=e+t.deltaY/u;const n=o!==undefined&&i>=o&&w;const r=n?v:.9999;const d=n&&o!==undefined?o+R((i-o)/(r-o)):i;b=g(1e-4,d,r);a.progressStep(b)};const S=t=>{const e=t.velocityY;const o=(t.deltaY+e*100)/u;const i=m-o;const n=s.reduce(((t,e)=>Math.abs(e-i)<Math.abs(t-i)?e:t));T({breakpoint:n,breakpointOffset:b,canDismiss:w})};const T=e=>{const{breakpoint:o,canDismiss:i,breakpointOffset:r}=e;const l=i&&o===0;const p=l?m:o;const u=p!==0;m=0;if(k&&y){k.keyframes([{offset:0,transform:`translateY(${r*100}%)`},{offset:1,transform:`translateY(${(1-p)*100}%)`}]);y.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${P(1-r,n)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${P(p,n)})`}]);a.progressStep(0)}I.enable(false);if(l){L(t,a)}else if(!u){d()}return new Promise((t=>{a.onFinish((()=>{if(u){if(k&&y){x((()=>{k.keyframes([...h.WRAPPER_KEYFRAMES]);y.keyframes([...h.BACKDROP_KEYFRAMES]);a.progressStart(true,1-p);m=p;c(m);if(f&&m===s[s.length-1]){f.scrollY=true}const e=m>n;if(e){B()}else{Y()}I.enable(true);t()}))}else{I.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,500)}))};const I=j({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:E,onMove:M,onEnd:S});return{gesture:I,moveSheetToBreakpoint:T}};const et=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:""}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{transform:translate3d(0,  100%,  0)}@media screen and (max-width: 767px){@supports (width: 1px){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: 1px){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{box-shadow:none}:host(.modal-card) .modal-shadow{box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}';const ot=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:""}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{transform:translate3d(0,  40px,  0);opacity:0.01}';let it=class{constructor(o){t(this,o);this.didPresent=e(this,"ionModalDidPresent",7);this.willPresent=e(this,"ionModalWillPresent",7);this.willDismiss=e(this,"ionModalWillDismiss",7);this.didDismiss=e(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=e(this,"ionBreakpointDidChange",7);this.didPresentShorthand=e(this,"didPresent",7);this.willPresentShorthand=e(this,"willPresent",7);this.willDismissShorthand=e(this,"willDismiss",7);this.didDismissShorthand=e(this,"didDismiss",7);this.modalIndex=at++;this.coreDelegate=u();this.isSheetModal=false;this.inline=false;this.gestureAnimationDismissing=false;this.presented=false;this.hasController=false;this.keyboardClose=true;this.backdropBreakpoint=0;this.handleBehavior="none";this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.swipeToClose=false;this.isOpen=false;this.keepContentsMounted=false;this.configureTriggerInteraction=()=>{const{trigger:t,el:e,destroyTriggerInteraction:o}=this;if(o){o()}const i=t!==undefined?document.getElementById(t):null;if(!i){return}const n=(t,e)=>{const o=()=>{e.present()};t.addEventListener("click",o);return()=>{t.removeEventListener("click",o)}};this.destroyTriggerInteraction=n(i,e)};this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:e}=this;if(e!=="cycle"||t!==undefined){return}this.moveToNextBreakpoint()};this.onBackdropTap=()=>{const{sheetTransition:t}=this;if(t!==undefined){return}this.dismiss(undefined,y)};this.onLifecycle=t=>{const e=this.usersElement;const o=nt[t.type];if(e&&o){const i=new CustomEvent(o,{bubbles:false,cancelable:false,detail:t.detail});e.dispatchEvent(i)}}}onIsOpenChange(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}}onTriggerChange(){this.configureTriggerInteraction()}async swipeToCloseChanged(t){if(this.gesture){this.gesture.enable(t)}else if(t){await this.initSwipeToClose()}}breakpointsChanged(t){if(t!==undefined){this.sortedBreakpoints=t.sort(((t,e)=>t-e))}}connectedCallback(){D(this.el)}componentWillLoad(){const{breakpoints:t,initialBreakpoint:e,swipeToClose:o}=this;this.modalId=this.el.hasAttribute("id")?this.el.getAttribute("id"):`ion-modal-${this.modalIndex}`;const i=this.isSheetModal=t!==undefined&&e!==undefined;if(i){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&e!==undefined&&!t.includes(e)){k("Your breakpoints array must include the initialBreakpoint value.")}if(o){k("swipeToClose has been deprecated in favor of canDismiss.\n\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.")}}componentDidLoad(){if(this.isOpen===true){x((()=>this.present()))}this.breakpointsChanged(this.breakpoints);this.configureTriggerInteraction()}getDelegate(t=false){if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}const e=this.el.parentNode;const o=this.inline=e!==null&&!this.hasController;const i=this.workingDelegate=o?this.delegate||this.coreDelegate:this.delegate;return{inline:o,delegate:i}}async checkCanDismiss(){const{canDismiss:t}=this;if(t===undefined){return true}if(typeof t==="function"){return t()}return t}async present(){if(this.presented){return}if(this.currentTransition!==undefined){await this.currentTransition}this.currentBreakpoint=this.initialBreakpoint;const t=Object.assign(Object.assign({},this.componentProps),{modal:this.el});const{inline:e,delegate:i}=this.getDelegate(true);this.usersElement=await m(i,this.el,this.component,["ion-page"],t,e);await M(this.usersElement);o((()=>this.el.classList.add("show-modal")));this.currentTransition=A(this,"modalEnter",H,J,{presentingEl:this.presentingElement,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});const n=this.swipeToClose||this.canDismiss!==undefined&&this.presentingElement!==undefined;if(n&&s(this)==="ios"){z()}await this.currentTransition;if(this.isSheetModal){this.initSheetGesture()}else if(n){await this.initSwipeToClose()}if(typeof window!=="undefined"){this.keyboardOpenCallback=()=>{if(this.gesture){this.gesture.enable(false);x((()=>{if(this.gesture){this.gesture.enable(true)}}))}};window.addEventListener(v,this.keyboardOpenCallback)}this.currentTransition=undefined}initSwipeToClose(){if(s(this)!=="ios"){return}const{el:t}=this;const e=this.leaveAnimation||r.get("modalLeave",U);const o=this.animation=e(t,{presentingEl:this.presentingElement});const i=h(t);if(!i){f(t);return}this.gesture=_(t,o,(()=>{this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{await this.dismiss(undefined,"gesture");this.gestureAnimationDismissing=false}))}));this.gesture.enable(true)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:e,backdropBreakpoint:o}=this;if(!t||e===undefined){return}const i=this.enterAnimation||r.get("modalEnter",H);const n=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:e,backdropBreakpoint:o});n.progressStart(true,1);const{gesture:a,moveSheetToBreakpoint:s}=tt(this.el,this.backdropEl,t,e,o,n,this.sortedBreakpoints,(()=>{var t;return(t=this.currentBreakpoint)!==null&&t!==void 0?t:0}),(()=>this.sheetOnDismiss()),(t=>{if(this.currentBreakpoint!==t){this.currentBreakpoint=t;this.ionBreakpointDidChange.emit({breakpoint:t})}}));this.gesture=a;this.moveSheetToBreakpoint=s;this.gesture.enable(true)}sheetOnDismiss(){this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});await this.dismiss(undefined,"gesture");this.gestureAnimationDismissing=false}))}async dismiss(t,e){if(this.gestureAnimationDismissing&&e!=="gesture"){return false}if(e!=="handler"&&!await this.checkCanDismiss()){return false}const i=this.swipeToClose||this.canDismiss!==undefined&&this.presentingElement!==undefined;if(i&&s(this)==="ios"){W()}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(v,this.keyboardOpenCallback)}if(this.currentTransition!==undefined){await this.currentTransition}const n=B.get(this)||[];this.currentTransition=Y(this,t,e,"modalLeave",U,X,{presentingEl:this.presentingElement,currentBreakpoint:this.currentBreakpoint||this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});const a=await this.currentTransition;if(a){const{delegate:t}=this.getDelegate();await b(t,this.usersElement);o((()=>this.el.classList.remove("show-modal")));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}n.forEach((t=>t.destroy()))}this.currentBreakpoint=undefined;this.currentTransition=undefined;this.animation=undefined;return a}onDidDismiss(){return C(this.el,"ionModalDidDismiss")}onWillDismiss(){return C(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal){k("setCurrentBreakpoint is only supported on sheet modals.");return}if(!this.breakpoints.includes(t)){k(`Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);return}const{currentBreakpoint:e,moveSheetToBreakpoint:o,canDismiss:i,breakpoints:n}=this;if(e===t){return}if(o){this.sheetTransition=o({breakpoint:t,breakpointOffset:1-e,canDismiss:i!==undefined&&i!==true&&n[0]===0});await this.sheetTransition;this.sheetTransition=undefined}}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:e}=this;if(!t||e==null){return false}const o=t.filter((t=>t!==0));const i=o.indexOf(e);const n=(i+1)%o.length;const a=o[n];await this.setCurrentBreakpoint(a);return true}render(){const{handle:t,isSheetModal:e,presentingElement:o,htmlAttributes:a,handleBehavior:r}=this;const d=t!==false&&e;const c=s(this);const{modalId:l}=this;const p=o!==undefined&&c==="ios";const h=r==="cycle";return i(n,Object.assign({"no-router":true,"aria-modal":"true",tabindex:"-1"},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[c]:true,["modal-default"]:!p&&!e,[`modal-card`]:p,[`modal-sheet`]:e,"overlay-hidden":true},E(this.cssClass)),id:l,onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),i("ion-backdrop",{ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),c==="ios"&&i("div",{class:"modal-shadow"}),i("div",{role:"dialog",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},d&&i("button",{class:"modal-handle",tabIndex:!h?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:h?this.onHandleClick:undefined,part:"handle"}),i("slot",null)))}get el(){return a(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["onTriggerChange"],swipeToClose:["swipeToCloseChanged"]}}};const nt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};let at=0;it.style={ios:et,md:ot};export{it as ion_modal};
//# sourceMappingURL=p-a6d1f19c.entry.js.map