import{r as a,h as t,d as o,H as i,e}from"./p-846bd001.js";import{g as s}from"./p-18891da7.js";import{a as l}from"./p-8cd54418.js";const r=class{constructor(t){a(this,t),this.icon=void 0,this.message=void 0}render(){return t("div",{class:"fallback-wrapper"},this.icon?t("ion-icon",{name:this.icon}):null,t("p",null,this.message))}};r.style="floodteam-fallback{font-family:var(\n    --floodteam-error-font-family,\n    var(--ion-font-family, Arial, Helvetica, sans-serif)\n  )}floodteam-fallback .fallback-wrapper ion-icon{display:block;margin:var(--floodteam-fallback-icon-margin, 0 auto);padding:var(--floodteam-fallback-icon-padding, 0);height:var(\n    --floodteam-fallback-icon-height,\n    var(--floodteam-fallback-icon-size, 150px)\n  );width:var(\n    --floodteam-fallback-icon-width,\n    var(--floodteam-fallback-icon-size, 150px)\n  );color:var(\n    --floodteam-fallback-icon-color,\n    var(--floodteam-fallback-color, #bdbdbd)\n  )}floodteam-fallback .fallback-wrapper p{display:block;padding:var(--floodteam-fallback-message-padding, 0);margin:var(--floodteam-fallback-message-margin, 0);font-size:var(--floodteam-fallback-message-font-size, 14px);color:var(\n    --floodteam-fallback-message-color,\n    var(--floodteam-fallback-color, #999)\n  );font-weight:var(--floodteam-fallback-message-font-weight, bold);text-align:var(--floodteam-fallback-message-text-align, center)}";const n=class{constructor(t){a(this,t),this.ionImgWillLoad=o(this,"ionImgWillLoad",7),this.ionImgDidLoad=o(this,"ionImgDidLoad",7),this.ionError=o(this,"ionError",7),this.inheritedAttributes={},this.onLoad=()=>{this.ionImgDidLoad.emit()},this.onError=()=>{this.ionError.emit()}}srcChanged(){this.addIO()}componentWillLoad(){this.inheritedAttributes=l(this.el,["draggable"])}componentDidLoad(){this.addIO()}addIO(){void 0!==this.src&&("undefined"!=typeof window&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype?(this.removeIO(),this.io=new IntersectionObserver((a=>{a[a.length-1].isIntersecting&&(this.load(),this.removeIO())})),this.io.observe(this.el)):setTimeout((()=>this.load()),200))}load(){this.loadError=this.onError,this.loadSrc=this.src,this.ionImgWillLoad.emit()}removeIO(){this.io&&(this.io.disconnect(),this.io=void 0)}render(){const{loadSrc:a,alt:o,onLoad:e,loadError:l,inheritedAttributes:r}=this,{draggable:n}=r;return t(i,{class:s(this)},t("img",{decoding:"async",src:a,alt:o,onLoad:e,onError:l,part:"image",draggable:d(n)}))}get el(){return e(this)}static get watchers(){return{src:["srcChanged"]}}},d=a=>{switch(a){case"true":return!0;case"false":return!1;default:return}};n.style=":host{display:block;object-fit:contain}img{display:block;width:100%;height:100%;object-fit:inherit;object-position:inherit}";export{r as floodteam_fallback,n as ion_img}