import{r as t,f as e,w as o,h as i,H as r,d as s}from"./p-23450e8b.js";import{a as n,i as a,d,r as c,f as h,p}from"./p-0f957630.js";import{C as l,a as f,d as u}from"./p-387cea7f.js";import{n as m,a as b,r as w,b as x,p as g}from"./p-8538de1a.js";import{p as v}from"./p-b4215fed.js";import{g as k}from"./p-eb6f4547.js";import{G as y,a as A,B as D,b as B,s as Y,d as E,h as M,e as S,f as j}from"./p-4084433f.js";import{g as C}from"./p-b2d007f6.js";import{d as P,w as $}from"./p-64f725e8.js";import{g as O,c as I}from"./p-1e77b5bd.js";import{KEYBOARD_DID_OPEN as T}from"./p-5424a32a.js";import{c as z}from"./p-771a6f32.js";import{g as W}from"./p-8e599a9d.js";import{createGesture as L}from"./p-f2599c25.js";import{w as R}from"./p-c76826f0.js";import"./p-94c84e79.js";import"./p-565ab761.js";import"./p-45316f86.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */var N;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})(N||(N={}));const _={getEngine(){const t=k();if(t===null||t===void 0?void 0:t.isPluginAvailable("StatusBar")){return t.Plugins.StatusBar}return undefined},supportsDefaultStatusBarStyle(){const t=k();return!!(t===null||t===void 0?void 0:t.PluginHeaders)},setStyle(t){const e=this.getEngine();if(!e){return}e.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t){return N.Default}const{style:e}=await t.getInfo();return e}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const G=(t,e)=>{if(e===1){return 0}const o=1/(1-e);const i=-(e*o);return t*o+i};const K=()=>{if(!R||R.innerWidth>=768||!_.supportsDefaultStatusBarStyle()){return}_.setStyle({style:N.Dark})};const V=(t=N.Default)=>{if(!R||R.innerWidth>=768||!_.supportsDefaultStatusBarStyle()){return}_.setStyle({style:t})};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const F=async(t,e)=>{if(typeof t.canDismiss!=="function"){return}const o=await t.canDismiss(undefined,y);if(!o){return}if(e.isRunning()){e.onFinish((()=>{t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}};const H=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Z={MIN_PRESENTING_SCALE:.93};const U=(t,e,o,i)=>{const r=.5;const s=t.offsetHeight;let h=false;let p=false;let l=null;let f=null;const u=.2;let w=true;let x=0;const g=()=>{if(l&&a(l)){return l.scrollY}else{return true}};const v=t=>{const e=t.event.target;if(e===null||!e.closest){return true}l=n(e);if(l){if(a(l)){const t=m(l);f=t.querySelector(".inner-scroll")}else{f=l}const t=!!l.querySelector("ion-refresher");return!t&&f.scrollTop===0}const o=e.closest("ion-footer");if(o===null){return true}return false};const k=o=>{const{deltaY:i}=o;w=g();p=t.canDismiss!==undefined&&t.canDismiss!==true;if(i>0&&l){d(l)}e.progressStart(true,h?1:0)};const y=t=>{const{deltaY:i}=t;if(i>0&&l){d(l)}const n=t.deltaY/s;const a=n>=0&&p;const c=a?u:.9999;const h=a?H(n/c):n;const f=b(1e-4,h,c);e.progressStep(f);if(f>=r&&x<r){V(o)}else if(f<r&&x>=r){K()}x=f};const A=o=>{const n=o.velocityY;const a=o.deltaY/s;const d=a>=0&&p;const f=d?u:.9999;const m=d?H(a/f):a;const x=b(1e-4,m,f);const g=(o.deltaY+n*1e3)/s;const v=!d&&g>=r;let k=v?-.001:.001;if(!v){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=W([0,0],[1,0],[.68,.28],[1,1],x)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=W([0,0],[.32,.72],[0,1],[1,1],x)[0]}const y=v?q(a*s,n):q((1-x)*s,n);h=v;D.enable(false);if(l){c(l,w)}e.onFinish((()=>{if(!v){D.enable(true)}})).progressEnd(v?1:0,k,y);if(d&&x>f/4){F(t,e)}else if(v){i()}};const D=L({el:t,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:v,onStart:k,onMove:y,onEnd:A});return D};const q=(t,e)=>b(400,t/Math.abs(e*1.1),500);
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const J=t=>{const{currentBreakpoint:e,backdropBreakpoint:o}=t;const i=o===undefined||o<e;const r=i?`calc(var(--backdrop-opacity) * ${e})`:"0";const s=z("backdropAnimation").fromTo("opacity",0,r);if(i){s.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}const n=z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-e*100}%)`}]);return{wrapperAnimation:n,backdropAnimation:s}};const Q=t=>{const{currentBreakpoint:e,backdropBreakpoint:o}=t;const i=`calc(var(--backdrop-opacity) * ${G(e,o)})`;const r=[{offset:0,opacity:i},{offset:1,opacity:0}];const s=[{offset:0,opacity:i},{offset:o,opacity:0},{offset:1,opacity:0}];const n=z("backdropAnimation").keyframes(o!==0?s:r);const a=z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-e*100}%)`},{offset:1,opacity:1,transform:`translateY(100%)`}]);return{wrapperAnimation:a,backdropAnimation:n}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const X=()=>{const t=z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const e=z().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e}};const tt=(t,e)=>{const{presentingEl:o,currentBreakpoint:i}=e;const r=m(t);const{wrapperAnimation:s,backdropAnimation:n}=i!==undefined?J(e):X();n.addElement(r.querySelector("ion-backdrop"));s.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const a=z("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(s);if(o){const t=window.innerWidth<768;const e=o.tagName==="ION-MODAL"&&o.presentingElement!==undefined;const i=m(o);const r=z().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 s=Z.MIN_PRESENTING_SCALE;const n=`translateY(${i}) scale(${s})`;r.afterStyles({transform:n}).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:n,borderRadius:"10px 10px 0 0"}]);a.addAnimation(r)}else{a.addAnimation(n);if(!e){s.fromTo("opacity","0","1")}else{const t=e?Z.MIN_PRESENTING_SCALE:1;const o=`translateY(-10px) scale(${t})`;r.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 s=z().afterStyles({transform:o}).addElement(i.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:o}]);a.addAnimation([r,s])}}}else{a.addAnimation(n)}return a};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const et=()=>{const t=z().fromTo("opacity","var(--backdrop-opacity)",0);const e=z().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};const ot=(t,e,o=500)=>{const{presentingEl:i,currentBreakpoint:r}=e;const s=m(t);const{wrapperAnimation:n,backdropAnimation:a}=r!==undefined?Q(e):et();a.addElement(s.querySelector("ion-backdrop"));n.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=z("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(n);if(i){const t=window.innerWidth<768;const e=i.tagName==="ION-MODAL"&&i.presentingElement!==undefined;const o=m(i);const r=z().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{if(t!==1){return}i.style.setProperty("overflow","");const e=Array.from(s.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>t.presentingElement!==undefined)).length;if(e<=1){s.style.setProperty("background-color","")}}));const s=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 s=Z.MIN_PRESENTING_SCALE;const n=`translateY(${o}) scale(${s})`;r.addElement(i).keyframes([{offset:0,filter:"contrast(0.85)",transform:n,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);d.addAnimation(r)}else{d.addAnimation(a);if(!e){n.fromTo("opacity","1","0")}else{const t=e?Z.MIN_PRESENTING_SCALE:1;const i=`translateY(-10px) scale(${t})`;r.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 s=z().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([r,s])}}}else{d.addAnimation(a)}return d};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const it=()=>{const t=z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const e=z().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:`translateY(0px)`}]);return{backdropAnimation:t,wrapperAnimation:e}};const rt=(t,e)=>{const{currentBreakpoint:o}=e;const i=m(t);const{wrapperAnimation:r,backdropAnimation:s}=o!==undefined?J(e):it();s.addElement(i.querySelector("ion-backdrop"));r.addElement(i.querySelector(".modal-wrapper"));return z().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,r])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const st=()=>{const t=z().fromTo("opacity","var(--backdrop-opacity)",0);const e=z().keyframes([{offset:0,opacity:.99,transform:`translateY(0px)`},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};const nt=(t,e)=>{const{currentBreakpoint:o}=e;const i=m(t);const{wrapperAnimation:r,backdropAnimation:s}=o!==undefined?Q(e):st();s.addElement(i.querySelector("ion-backdrop"));r.addElement(i.querySelector(".modal-wrapper"));return z().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,r])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const at=(t,e,o,i,r,s,n=[],a,d,c)=>{const h=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];const p=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-r,opacity:0},{offset:1,opacity:0}];const l={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:r!==0?p:h};const f=t.querySelector("ion-content");const u=o.clientHeight;let m=i;let x=0;let g=false;const v=.95;const k=s.childAnimations.find((t=>t.id==="wrapperAnimation"));const y=s.childAnimations.find((t=>t.id==="backdropAnimation"));const A=n[n.length-1];const D=n[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([...l.WRAPPER_KEYFRAMES]);y.keyframes([...l.BACKDROP_KEYFRAMES]);s.progressStart(true,1-m);const t=m>r;if(t){B()}else{Y()}}if(f&&m!==A){f.scrollY=false}const E=t=>{const e=t.event.target.closest("ion-content");m=a();if(m===1&&e){return false}return true};const M=()=>{g=t.canDismiss!==undefined&&t.canDismiss!==true&&D===0;if(f){f.scrollY=false}w((()=>{t.focus()}));s.progressStart(true,1-m)};const S=t=>{const e=1-m;const o=n.length>1?1-n[1]:undefined;const i=e+t.deltaY/u;const r=o!==undefined&&i>=o&&g;const a=r?v:.9999;const d=r&&o!==undefined?o+H((i-o)/(a-o)):i;x=b(1e-4,d,a);s.progressStep(x)};const j=t=>{const e=t.velocityY;const o=(t.deltaY+e*350)/u;const i=m-o;const r=n.reduce(((t,e)=>Math.abs(e-i)<Math.abs(t-i)?e:t));C({breakpoint:r,breakpointOffset:x,canDismiss:g})};const C=e=>{const{breakpoint:o,canDismiss:i,breakpointOffset:a}=e;const h=i&&o===0;const p=h?m:o;const u=p!==0;m=0;if(k&&y){k.keyframes([{offset:0,transform:`translateY(${a*100}%)`},{offset:1,transform:`translateY(${(1-p)*100}%)`}]);y.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${G(1-a,r)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${G(p,r)})`}]);s.progressStep(0)}P.enable(false);if(h){F(t,s)}else if(!u){d()}return new Promise((t=>{s.onFinish((()=>{if(u){if(k&&y){w((()=>{k.keyframes([...l.WRAPPER_KEYFRAMES]);y.keyframes([...l.BACKDROP_KEYFRAMES]);s.progressStart(true,1-p);m=p;c(m);if(f&&m===n[n.length-1]){f.scrollY=true}const e=m>r;if(e){B()}else{Y()}P.enable(true);t()}))}else{P.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,500)}))};const P=L({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:E,onStart:M,onMove:S,onEnd:j});return{gesture:P,moveSheetToBreakpoint:C}};const dt=':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;color:var(--ion-text-color, #000);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;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:""}: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: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 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}@supports selector(:dir(rtl)){:host(.modal-card) .modal-wrapper:dir(rtl){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}@supports selector(:dir(rtl)){:host(.modal-sheet) .modal-wrapper:dir(rtl){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 ct=':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;color:var(--ion-text-color, #000);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;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:""}: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}';const ht=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.ionMount=e(this,"ionMount",7);this.triggerController=A();this.coreDelegate=l();this.isSheetModal=false;this.inheritedAttributes={};this.inline=false;this.gestureAnimationDismissing=false;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,D)};this.onLifecycle=t=>{const e=this.usersElement;const o=pt[t.type];if(e&&o){const i=new CustomEvent(o,{bubbles:false,cancelable:false,detail:t.detail});e.dispatchEvent(i)}};this.presented=false;this.hasController=false;this.overlayIndex=undefined;this.delegate=undefined;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.breakpoints=undefined;this.initialBreakpoint=undefined;this.backdropBreakpoint=0;this.handle=undefined;this.handleBehavior="none";this.component=undefined;this.componentProps=undefined;this.cssClass=undefined;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.presentingElement=undefined;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined;this.keepContentsMounted=false;this.canDismiss=true}onIsOpenChange(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}}triggerChanged(){const{trigger:t,el:e,triggerController:o}=this;if(t){o.addClickListener(e,t)}}breakpointsChanged(t){if(t!==undefined){this.sortedBreakpoints=t.sort(((t,e)=>t-e))}}connectedCallback(){const{el:t}=this;B(t);this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){const{breakpoints:t,initialBreakpoint:e,el:o}=this;const i=this.isSheetModal=t!==undefined&&e!==undefined;this.inheritedAttributes=x(o,["aria-label","role"]);if(i){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&e!==undefined&&!t.includes(e)){v("Your breakpoints array must include the initialBreakpoint value.")}Y(o)}componentDidLoad(){if(this.isOpen===true){w((()=>this.present()))}this.breakpointsChanged(this.breakpoints)}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(t,e){const{canDismiss:o}=this;if(typeof o==="function"){return o(t,e)}return o}async present(){if(this.presented){return}const{presentingElement:t,el:e}=this;if(this.currentTransition!==undefined){await this.currentTransition}this.currentBreakpoint=this.initialBreakpoint;const{inline:i,delegate:r}=this.getDelegate(true);this.usersElement=await f(r,e,this.component,["ion-page"],this.componentProps,i);this.ionMount.emit();if(g(e)){await P(this.usersElement)}else if(!this.keepContentsMounted){await $()}o((()=>this.el.classList.add("show-modal")));this.currentTransition=E(this,"modalEnter",tt,rt,{presentingEl:t,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});if(typeof window!=="undefined"){this.keyboardOpenCallback=()=>{if(this.gesture){this.gesture.enable(false);w((()=>{if(this.gesture){this.gesture.enable(true)}}))}};window.addEventListener(T,this.keyboardOpenCallback)}const s=t!==undefined;if(s&&O(this)==="ios"){this.statusBarStyle=await _.getStyle();K()}await this.currentTransition;if(this.isSheetModal){this.initSheetGesture()}else if(s){this.initSwipeToClose()}this.currentTransition=undefined}initSwipeToClose(){var t;if(O(this)!=="ios"){return}const{el:e}=this;const o=this.leaveAnimation||I.get("modalLeave",ot);const i=this.animation=o(e,{presentingEl:this.presentingElement});const r=h(e);if(!r){p(e);return}const s=(t=this.statusBarStyle)!==null&&t!==void 0?t:N.Default;this.gesture=U(e,i,s,(()=>{this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{await this.dismiss(undefined,y);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||I.get("modalEnter",tt);const r=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:e,backdropBreakpoint:o});r.progressStart(true,1);const{gesture:s,moveSheetToBreakpoint:n}=at(this.el,this.backdropEl,t,e,o,r,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=s;this.moveSheetToBreakpoint=n;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,y);this.gestureAnimationDismissing=false}))}async dismiss(t,e){var i;if(this.gestureAnimationDismissing&&e!==y){return false}if(e!=="handler"&&!await this.checkCanDismiss(t,e)){return false}const{presentingElement:r}=this;const s=r!==undefined;if(s&&O(this)==="ios"){V(this.statusBarStyle)}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(T,this.keyboardOpenCallback);this.keyboardOpenCallback=undefined}if(this.currentTransition!==undefined){await this.currentTransition}const n=M.get(this)||[];this.currentTransition=S(this,t,e,"modalLeave",ot,nt,{presentingEl:r,currentBreakpoint:(i=this.currentBreakpoint)!==null&&i!==void 0?i:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});const a=await this.currentTransition;if(a){const{delegate:t}=this.getDelegate();await u(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 j(this.el,"ionModalDidDismiss")}onWillDismiss(){return j(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal){v("setCurrentBreakpoint is only supported on sheet modals.");return}if(!this.breakpoints.includes(t)){v(`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:r}=this;if(e===t){return}if(o){this.sheetTransition=o({breakpoint:t,breakpointOffset:1-e,canDismiss:i!==undefined&&i!==true&&r[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 r=(i+1)%o.length;const s=o[r];await this.setCurrentBreakpoint(s);return true}render(){const{handle:t,isSheetModal:e,presentingElement:o,htmlAttributes:s,handleBehavior:n,inheritedAttributes:a}=this;const d=t!==false&&e;const c=O(this);const h=o!==undefined&&c==="ios";const p=n==="cycle";return i(r,Object.assign({"no-router":true,tabindex:"-1"},s,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[c]:true,["modal-default"]:!h&&!e,[`modal-card`]:h,[`modal-sheet`]:e,"overlay-hidden":true},C(this.cssClass)),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",Object.assign({role:"dialog"},a,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t}),d&&i("button",{class:"modal-handle",tabIndex:!p?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:p?this.onHandleClick:undefined,part:"handle"}),i("slot",null)))}get el(){return s(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}};const pt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};ht.style={ios:dt,md:ct};export{ht as ion_modal};
//# sourceMappingURL=p-21350eb6.entry.js.map