import{r as t,d as o,w as e,h as i,H as s,e as a}from"./p-03169580.js";import{g as r,c as n}from"./p-4cb16df5.js";import{a as d,i as c,d as l,r as h,f as p,p as f}from"./p-5e38ef53.js";import{C as m,a as u,d as b}from"./p-ca7b7028.js";import{l as w,a as g,r as x}from"./p-7cbdb4ea.js";import{KEYBOARD_DID_OPEN as v}from"./p-7e7ce516.js";import{b as k}from"./p-b5cdbd99.js";import{B as y,a as D,b as A,c as Y,d as B,e as C}from"./p-c5cf028c.js";import{g as E}from"./p-0e4de1d0.js";import{d as M}from"./p-cd2253e7.js";import{c as S}from"./p-d5da637d.js";import{g as j}from"./p-4d4077ea.js";import{createGesture as T}from"./p-e9431eeb.js";import"./p-076f0239.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,o,e;return((o=(t=I)===null||t===void 0?void 0:t.Capacitor)===null||o===void 0?void 0:o.isPluginAvailable("StatusBar"))&&((e=I)===null||e===void 0?void 0:e.Capacitor.Plugins.StatusBar)},supportsDefaultStatusBarStyle(){var t,o;return!!((o=(t=I)===null||t===void 0?void 0:t.Capacitor)===null||o===void 0?void 0:o.PluginHeaders)},setStyle(t){const o=this.getEngine();if(!o){return}o.setStyle(t)}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const P=(t,o)=>{if(o===1){return 0}const e=1/(1-o);const i=-(o*e);return t*e+i};const W=()=>{if(!I||I.innerWidth>=768||!O.supportsDefaultStatusBarStyle()){return}O.setStyle({style:$.Dark})};const z=()=>{if(!I||I.innerWidth>=768||!O.supportsDefaultStatusBarStyle()){return}O.setStyle({style:$.Default})};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const L=async(t,o)=>{if(typeof t.canDismiss!=="function"){return}const e=await t.canDismiss();if(!e){return}if(o.isRunning()){o.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,o,e)=>{const i=.5;const s=t.offsetHeight;let a=false;let r=false;let n=null;let p=null;const f=.2;let m=true;let u=0;const b=()=>{if(n&&c(n)){return n.scrollY}else{return true}};const x=t=>{const o=t.event.target;if(o===null||!o.closest){return true}n=d(o);if(n){if(c(n)){const t=w(n);p=t.querySelector(".inner-scroll")}else{p=n}const t=!!n.querySelector("ion-refresher");return!t&&p.scrollTop===0}const e=o.closest("ion-footer");if(e===null){return true}return false};const v=e=>{const{deltaY:i}=e;m=b();r=t.canDismiss!==undefined&&t.canDismiss!==true;if(i>0&&n){l(n)}o.progressStart(true,a?1:0)};const k=t=>{const{deltaY:e}=t;if(e>0&&n){l(n)}const a=t.deltaY/s;const d=a>=0&&r;const c=d?f:.9999;const h=d?R(a/c):a;const p=g(1e-4,h,c);o.progressStep(p);if(p>=i&&u<i){z()}else if(p<i&&u>=i){W()}u=p};const y=d=>{const c=d.velocityY;const l=d.deltaY/s;const p=l>=0&&r;const u=p?f:.9999;const b=p?R(l/u):l;const w=g(1e-4,b,u);const x=(d.deltaY+c*1e3)/s;const v=!p&&x>=i;let k=v?-.001:.001;if(!v){o.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=j([0,0],[1,0],[.68,.28],[1,1],w)[0]}else{o.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=j([0,0],[.32,.72],[0,1],[1,1],w)[0]}const y=v?K(l*s,c):K((1-w)*s,c);a=v;D.enable(false);if(n){h(n,m)}o.onFinish((()=>{if(!v){D.enable(true)}})).progressEnd(v?1:0,k,y);if(p&&w>u/4){L(t,o)}else if(v){e()}};const D=T({el:t,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:x,onStart:v,onMove:k,onEnd:y});return D};const K=(t,o)=>g(400,t/Math.abs(o*1.1),500);
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const V=t=>{const{currentBreakpoint:o,backdropBreakpoint:e}=t;const i=e===undefined||e<o;const s=i?`calc(var(--backdrop-opacity) * ${o})`:"0";const a=S("backdropAnimation").fromTo("opacity",0,s);if(i){a.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}const r=S("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-o*100}%)`}]);return{wrapperAnimation:r,backdropAnimation:a}};const F=t=>{const{currentBreakpoint:o,backdropBreakpoint:e}=t;const i=`calc(var(--backdrop-opacity) * ${P(o,e)})`;const s=[{offset:0,opacity:i},{offset:1,opacity:0}];const a=[{offset:0,opacity:i},{offset:e,opacity:0},{offset:1,opacity:0}];const r=S("backdropAnimation").keyframes(e!==0?a:s);const n=S("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-o*100}%)`},{offset:1,opacity:1,transform:`translateY(100%)`}]);return{wrapperAnimation:n,backdropAnimation:r}};
/*!
 * (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 o=S().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:o}};const H=(t,o)=>{const{presentingEl:e,currentBreakpoint:i}=o;const s=w(t);const{wrapperAnimation:a,backdropAnimation:r}=i!==undefined?V(o):G();r.addElement(s.querySelector("ion-backdrop"));a.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const n=S("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(a);if(e){const t=window.innerWidth<768;const o=e.tagName==="ION-MODAL"&&e.presentingElement!==undefined;const i=w(e);const s=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=o?"-10px":t;const a=N.MIN_PRESENTING_SCALE;const r=`translateY(${i}) scale(${a})`;s.afterStyles({transform:r}).beforeAddWrite((()=>d.style.setProperty("background-color","black"))).addElement(e).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:r,borderRadius:"10px 10px 0 0"}]);n.addAnimation(s)}else{n.addAnimation(r);if(!o){a.fromTo("opacity","0","1")}else{const t=o?N.MIN_PRESENTING_SCALE:1;const e=`translateY(-10px) scale(${t})`;s.afterStyles({transform:e}).addElement(i.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:e}]);const a=S().afterStyles({transform:e}).addElement(i.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:e}]);n.addAnimation([s,a])}}}else{n.addAnimation(r)}return n};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Z=()=>{const t=S().fromTo("opacity","var(--backdrop-opacity)",0);const o=S().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:o}};const U=(t,o,e=500)=>{const{presentingEl:i,currentBreakpoint:s}=o;const a=w(t);const{wrapperAnimation:r,backdropAnimation:n}=s!==undefined?F(o):Z();n.addElement(a.querySelector("ion-backdrop"));r.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(e).addAnimation(r);if(i){const t=window.innerWidth<768;const o=i.tagName==="ION-MODAL"&&i.presentingElement!==undefined;const e=w(i);const s=S().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{if(t!==1){return}i.style.setProperty("overflow","");const o=Array.from(a.querySelectorAll("ion-modal")).filter((t=>t.presentingElement!==undefined)).length;if(o<=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 e=o?"-10px":t;const a=N.MIN_PRESENTING_SCALE;const r=`translateY(${e}) scale(${a})`;s.addElement(i).keyframes([{offset:0,filter:"contrast(0.85)",transform:r,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);d.addAnimation(s)}else{d.addAnimation(n);if(!o){r.fromTo("opacity","1","0")}else{const t=o?N.MIN_PRESENTING_SCALE:1;const i=`translateY(-10px) scale(${t})`;s.addElement(e.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(e.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([s,a])}}}else{d.addAnimation(n)}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 o=S().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:`translateY(0px)`}]);return{backdropAnimation:t,wrapperAnimation:o}};const J=(t,o)=>{const{currentBreakpoint:e}=o;const i=w(t);const{wrapperAnimation:s,backdropAnimation:a}=e!==undefined?V(o):q();a.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelector(".modal-wrapper"));return S().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([a,s])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Q=()=>{const t=S().fromTo("opacity","var(--backdrop-opacity)",0);const o=S().keyframes([{offset:0,opacity:.99,transform:`translateY(0px)`},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:o}};const X=(t,o)=>{const{currentBreakpoint:e}=o;const i=w(t);const{wrapperAnimation:s,backdropAnimation:a}=e!==undefined?F(o):Q();a.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelector(".modal-wrapper"));return S().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([a,s])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const tt=(t,o,e,i,s,a,r=[],n,d,c)=>{const l=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];const h=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-s,opacity:0},{offset:1,opacity:0}];const p={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:s!==0?h:l};const f=t.querySelector("ion-content");const m=e.clientHeight;let u=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=r[r.length-1];const A=r[0];const Y=()=>{t.style.setProperty("pointer-events","auto");o.style.setProperty("pointer-events","auto");t.classList.remove("ion-disable-focus-trap")};const B=()=>{t.style.setProperty("pointer-events","none");o.style.setProperty("pointer-events","none");t.classList.add("ion-disable-focus-trap")};if(k&&y){k.keyframes([...p.WRAPPER_KEYFRAMES]);y.keyframes([...p.BACKDROP_KEYFRAMES]);a.progressStart(true,1-u);const t=u>s;if(t){Y()}else{B()}}if(f&&u!==D){f.scrollY=false}const C=t=>{const o=t.event.target.closest("ion-content");u=n();if(u===1&&o){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-u)};const M=t=>{const o=1-u;const e=r.length>1?1-r[1]:undefined;const i=o+t.deltaY/m;const s=e!==undefined&&i>=e&&w;const n=s?v:.9999;const d=s&&e!==undefined?e+R((i-e)/(n-e)):i;b=g(1e-4,d,n);a.progressStep(b)};const S=t=>{const o=t.velocityY;const e=(t.deltaY+o*100)/m;const i=u-e;const s=r.reduce(((t,o)=>Math.abs(o-i)<Math.abs(t-i)?o:t));j({breakpoint:s,breakpointOffset:b,canDismiss:w})};const j=o=>{const{breakpoint:e,canDismiss:i,breakpointOffset:n}=o;const l=i&&e===0;const h=l?u:e;const m=h!==0;u=0;if(k&&y){k.keyframes([{offset:0,transform:`translateY(${n*100}%)`},{offset:1,transform:`translateY(${(1-h)*100}%)`}]);y.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${P(1-n,s)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${P(h,s)})`}]);a.progressStep(0)}I.enable(false);a.onFinish((()=>{if(m){if(k&&y){x((()=>{k.keyframes([...p.WRAPPER_KEYFRAMES]);y.keyframes([...p.BACKDROP_KEYFRAMES]);a.progressStart(true,1-h);u=h;c(u);if(f&&u===r[r.length-1]){f.scrollY=true}const t=u>s;if(t){Y()}else{B()}I.enable(true)}))}else{I.enable(true)}}}),{oneTimeCallback:true}).progressEnd(1,0,500);if(l){L(t,a)}else if(!m){d()}};const I=T({el:e,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:E,onMove:M,onEnd:S});return{gesture:I,moveSheetToBreakpoint:j}};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);background:var(--ion-color-step-350, #c0c0be);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}}: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 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);background:var(--ion-color-step-350, #c0c0be);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}}: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(e){t(this,e);this.didPresent=o(this,"ionModalDidPresent",7);this.willPresent=o(this,"ionModalWillPresent",7);this.willDismiss=o(this,"ionModalWillDismiss",7);this.didDismiss=o(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=o(this,"ionBreakpointDidChange",7);this.didPresentShorthand=o(this,"didPresent",7);this.willPresentShorthand=o(this,"willPresent",7);this.willDismissShorthand=o(this,"willDismiss",7);this.didDismissShorthand=o(this,"didDismiss",7);this.modalIndex=at++;this.coreDelegate=m();this.isSheetModal=false;this.inline=false;this.gestureAnimationDismissing=false;this.presented=false;this.hasController=false;this.keyboardClose=true;this.backdropBreakpoint=0;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.swipeToClose=false;this.isOpen=false;this.configureTriggerInteraction=()=>{const{trigger:t,el:o,destroyTriggerInteraction:e}=this;if(e){e()}const i=t!==undefined?document.getElementById(t):null;if(!i){return}const s=(t,o)=>{const e=()=>{o.present()};t.addEventListener("click",e);return()=>{t.removeEventListener("click",e)}};this.destroyTriggerInteraction=s(i,o)};this.onBackdropTap=()=>{this.dismiss(undefined,y)};this.onLifecycle=t=>{const o=this.usersElement;const e=st[t.type];if(o&&e){const i=new CustomEvent(e,{bubbles:false,cancelable:false,detail:t.detail});o.dispatchEvent(i)}}}onIsOpenChange(t,o){if(t===true&&o===false){this.present()}else if(t===false&&o===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,o)=>t-o))}}connectedCallback(){D(this.el)}componentWillLoad(){const{breakpoints:t,initialBreakpoint:o,swipeToClose:e}=this;this.modalId=this.el.hasAttribute("id")?this.el.getAttribute("id"):`ion-modal-${this.modalIndex}`;const i=this.isSheetModal=t!==undefined&&o!==undefined;if(i){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&o!==undefined&&!t.includes(o)){k("Your breakpoints array must include the initialBreakpoint value.")}if(e){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 o=this.el.parentNode;const e=this.inline=o!==null&&!this.hasController;const i=this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate;return{inline:e,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:o,delegate:i}=this.getDelegate(true);this.usersElement=await u(i,this.el,this.component,["ion-page"],t,o);await M(this.usersElement);e((()=>this.el.classList.add("show-modal")));this.currentTransition=A(this,"modalEnter",H,J,{presentingEl:this.presentingElement,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});const s=this.swipeToClose||this.canDismiss!==undefined&&this.presentingElement!==undefined;if(s&&r(this)==="ios"){W()}await this.currentTransition;if(this.isSheetModal){this.initSheetGesture()}else if(s){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(r(this)!=="ios"){return}const{el:t}=this;const o=this.leaveAnimation||n.get("modalLeave",U);const e=this.animation=o(t,{presentingEl:this.presentingElement});const i=p(t);if(!i){f(t);return}this.gesture=_(t,e,(()=>{this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{await this.dismiss(undefined,"gesture");this.gestureAnimationDismissing=false}))}));this.gesture.enable(true)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:o,backdropBreakpoint:e}=this;if(!t||o===undefined){return}const i=this.enterAnimation||n.get("modalEnter",H);const s=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:o,backdropBreakpoint:e});s.progressStart(true,1);const{gesture:a,moveSheetToBreakpoint:r}=tt(this.el,this.backdropEl,t,o,e,s,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=r;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,o){if(this.gestureAnimationDismissing&&o!=="gesture"){return false}if(o!=="handler"&&!await this.checkCanDismiss()){return false}const i=this.swipeToClose||this.canDismiss!==undefined&&this.presentingElement!==undefined;if(i&&r(this)==="ios"){z()}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(v,this.keyboardOpenCallback)}if(this.currentTransition!==undefined){await this.currentTransition}const s=Y.get(this)||[];this.currentTransition=B(this,t,o,"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);e((()=>this.el.classList.remove("show-modal")));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}s.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:o,moveSheetToBreakpoint:e,canDismiss:i,breakpoints:s}=this;if(o===t){return}if(e){e({breakpoint:t,breakpointOffset:1-o,canDismiss:i!==undefined&&i!==true&&s[0]===0})}}async getCurrentBreakpoint(){return this.currentBreakpoint}render(){const{handle:t,isSheetModal:o,presentingElement:e,htmlAttributes:a}=this;const n=t!==false&&o;const d=r(this);const{modalId:c}=this;const l=e!==undefined&&d==="ios";return i(s,Object.assign({"no-router":true,"aria-modal":"true",tabindex:"-1"},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[d]:true,["modal-default"]:!l&&!o,[`modal-card`]:l,[`modal-sheet`]:o,"overlay-hidden":true},E(this.cssClass)),id:c,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"}),d==="ios"&&i("div",{class:"modal-shadow"}),i("div",{role:"dialog",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},n&&i("div",{class:"modal-handle",part:"handle"}),i("slot",null)))}get el(){return a(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["onTriggerChange"],swipeToClose:["swipeToCloseChanged"]}}};const st={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};let at=0;it.style={ios:ot,md:et};export{it as ion_modal};
//# sourceMappingURL=p-1ca30f02.entry.js.map