import{r as i,f as t,h as n,H as o,d as s}from"./p-23450e8b.js";import{E as a,s as e}from"./p-573c3dca.js";import{r}from"./p-8538de1a.js";import{c as d,a as c,B as h,b as l,s as p,d as g,e as f,f as m}from"./p-4084433f.js";import{g as u}from"./p-b2d007f6.js";import{c as b,g as x}from"./p-1e77b5bd.js";import{c as v}from"./p-771a6f32.js";import"./p-387cea7f.js";import"./p-94c84e79.js";import"./p-b4215fed.js";import"./p-c76826f0.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const y=i=>{const t=v();const n=v();const o=v();n.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);o.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]);return t.addElement(i).easing("ease-in-out").duration(200).addAnimation([n,o])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const w=i=>{const t=v();const n=v();const o=v();n.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);o.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]);return t.addElement(i).easing("ease-in-out").duration(200).addAnimation([n,o])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const k=i=>{const t=v();const n=v();const o=v();n.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);o.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]);return t.addElement(i).easing("ease-in-out").duration(200).addAnimation([n,o])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const j=i=>{const t=v();const n=v();const o=v();n.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);o.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]);return t.addElement(i).easing("ease-in-out").duration(200).addAnimation([n,o])};const D=".sc-ion-loading-ios-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-ios-h{display:none}.loading-wrapper.sc-ion-loading-ios{display:flex;align-items:inherit;justify-content:inherit;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);background:var(--background);opacity:0;z-index:10}ion-spinner.sc-ion-loading-ios{color:var(--spinner-color)}.sc-ion-loading-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--max-height:90%;--spinner-color:var(--ion-color-step-600, #666666);--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);color:var(--ion-text-color, #000);font-size:14px}.loading-wrapper.sc-ion-loading-ios{border-radius:8px;-webkit-padding-start:34px;padding-inline-start:34px;-webkit-padding-end:34px;padding-inline-end:34px;padding-top:24px;padding-bottom:24px}@supports (backdrop-filter: blur(0)){.loading-translucent.sc-ion-loading-ios-h .loading-wrapper.sc-ion-loading-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}}.loading-content.sc-ion-loading-ios{font-weight:bold}.loading-spinner.sc-ion-loading-ios+.loading-content.sc-ion-loading-ios{-webkit-margin-start:16px;margin-inline-start:16px}";const L=".sc-ion-loading-md-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-md-h{display:none}.loading-wrapper.sc-ion-loading-md{display:flex;align-items:inherit;justify-content:inherit;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);background:var(--background);opacity:0;z-index:10}ion-spinner.sc-ion-loading-md{color:var(--spinner-color)}.sc-ion-loading-md-h{--background:var(--ion-color-step-50, #f2f2f2);--max-width:280px;--max-height:90%;--spinner-color:var(--ion-color-primary, #3880ff);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);color:var(--ion-color-step-850, #262626);font-size:14px}.loading-wrapper.sc-ion-loading-md{border-radius:2px;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px;padding-top:24px;padding-bottom:24px;box-shadow:0 16px 20px rgba(0, 0, 0, 0.4)}.loading-spinner.sc-ion-loading-md+.loading-content.sc-ion-loading-md{-webkit-margin-start:16px;margin-inline-start:16px}";const z=class{constructor(n){i(this,n);this.didPresent=t(this,"ionLoadingDidPresent",7);this.willPresent=t(this,"ionLoadingWillPresent",7);this.willDismiss=t(this,"ionLoadingWillDismiss",7);this.didDismiss=t(this,"ionLoadingDidDismiss",7);this.didPresentShorthand=t(this,"didPresent",7);this.willPresentShorthand=t(this,"willPresent",7);this.willDismissShorthand=t(this,"willDismiss",7);this.didDismissShorthand=t(this,"didDismiss",7);this.delegateController=d(this);this.triggerController=c();this.customHTMLEnabled=b.get("innerHTMLTemplatesEnabled",a);this.presented=false;this.onBackdropTap=()=>{this.dismiss(undefined,h)};this.overlayIndex=undefined;this.delegate=undefined;this.hasController=false;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.message=undefined;this.cssClass=undefined;this.duration=0;this.backdropDismiss=false;this.showBackdrop=true;this.spinner=undefined;this.translucent=false;this.animated=true;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined}onIsOpenChange(i,t){if(i===true&&t===false){this.present()}else if(i===false&&t===true){this.dismiss()}}triggerChanged(){const{trigger:i,el:t,triggerController:n}=this;if(i){n.addClickListener(t,i)}}connectedCallback(){l(this.el);this.triggerChanged()}componentWillLoad(){if(this.spinner===undefined){const i=x(this);this.spinner=b.get("loadingSpinner",b.get("spinner",i==="ios"?"lines":"crescent"))}p(this.el)}componentDidLoad(){if(this.isOpen===true){r((()=>this.present()))}}disconnectedCallback(){this.triggerController.removeClickListener()}async present(){if(this.currentTransition!==undefined){await this.currentTransition}await this.delegateController.attachViewToDom();this.currentTransition=g(this,"loadingEnter",y,k);await this.currentTransition;if(this.duration>0){this.durationTimeout=setTimeout((()=>this.dismiss()),this.duration+10)}this.currentTransition=undefined}async dismiss(i,t){if(this.durationTimeout){clearTimeout(this.durationTimeout)}this.currentTransition=f(this,i,t,"loadingLeave",w,j);const n=await this.currentTransition;if(n){this.delegateController.removeViewFromDom()}return n}onDidDismiss(){return m(this.el,"ionLoadingDidDismiss")}onWillDismiss(){return m(this.el,"ionLoadingWillDismiss")}renderLoadingMessage(i){const{customHTMLEnabled:t,message:o}=this;if(t){return n("div",{class:"loading-content",id:i,innerHTML:e(o)})}return n("div",{class:"loading-content",id:i},o)}render(){const{message:i,spinner:t,htmlAttributes:s,overlayIndex:a}=this;const e=x(this);const r=`loading-${a}-msg`;const d=i!==undefined?r:null;return n(o,Object.assign({role:"dialog","aria-modal":"true","aria-labelledby":d,tabindex:"-1"},s,{style:{zIndex:`${4e4+this.overlayIndex}`},onIonBackdropTap:this.onBackdropTap,class:Object.assign(Object.assign({},u(this.cssClass)),{[e]:true,"overlay-hidden":true,"loading-translucent":this.translucent})}),n("ion-backdrop",{visible:this.showBackdrop,tappable:this.backdropDismiss}),n("div",{tabindex:"0"}),n("div",{class:"loading-wrapper ion-overlay-wrapper"},t&&n("div",{class:"loading-spinner"},n("ion-spinner",{name:t,"aria-hidden":"true"})),i!==undefined&&this.renderLoadingMessage(r)),n("div",{tabindex:"0"}))}get el(){return s(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}};z.style={ios:D,md:L};export{z as ion_loading};
//# sourceMappingURL=p-2879063d.entry.js.map