const e=window.Ema.h;import"./chunk-de721f0a.js";import{m as t,e as s}from"./chunk-f41c48db.js";class i{constructor(){this.fullscreenClass="iframe-holder-fullscreen",this.width="100%",this.height="420px",this.fullscreen=!1,this.fullscreenMargin="0,0,0,0"}onIframeLoaded(){this.iframeLoaded.emit({src:this.src})}componentDidLoad(){this.postRender()}componentDidUpdate(){this.postRender()}postRender(){let e=this.el.getElementsByClassName("ema-iframe-iframe")[0],i=this.el.getElementsByClassName("ema-iframe-holder")[0];if(this.fullscreen||(t.setVar("width",this.width,this.el),t.setVar("height",this.height,this.el),e.setAttribute("width",t.getVar("width",this.el)),e.setAttribute("height",t.getVar("height",this.el))),this.fullscreen){let e=this.fullscreenMargin.split(",");e.length&&1===e.length&&(t.setVar("top",e[0],this.el),t.setVar("right",e[0],this.el),t.setVar("bottom",e[0],this.el),t.setVar("left",e[0],this.el)),e.length&&2===e.length&&(t.setVar("top",e[0],this.el),t.setVar("right",e[1],this.el),t.setVar("bottom",e[0],this.el),t.setVar("left",e[1],this.el)),e.length&&3===e.length&&(t.setVar("top",e[0],this.el),t.setVar("right",e[1],this.el),t.setVar("bottom",e[2],this.el)),e.length&&4===e.length&&(t.setVar("top",e[0],this.el),t.setVar("right",e[1],this.el),t.setVar("bottom",e[2],this.el),t.setVar("left",e[3],this.el)),s.addClass(i,this.fullscreenClass)}this.zIndex&&t.setVar("zIndex",this.zIndex,this.el),e.onload=(()=>{t.setVar("visibility","visible",this.el),this.iframeLoaded.emit({src:this.src,el:this.el})})}render(){return e("div",{class:"ema-iframe-holder "},e("iframe",{src:this.src,frameborder:"0",class:"ema-iframe-iframe"}))}static get is(){return"ema-iframe"}static get properties(){return{el:{elementRef:!0},fullscreen:{type:Boolean,attr:"fullscreen"},fullscreenMargin:{type:String,attr:"fullscreen-margin"},height:{type:String,attr:"height"},src:{type:String,attr:"src"},width:{type:String,attr:"width"},zIndex:{type:Number,attr:"z-index"}}}static get events(){return[{name:"iframeLoaded",method:"iframeLoaded",bubbles:!0,cancelable:!0,composed:!0}]}static get style(){return":root{--ema-color:#343a40;--ema-primary:#007bff;--ema-secondary:#6c757d;--ema-success:#28a745;--ema-info:#17a2b8;--ema-warning:#ffc107;--ema-danger:#dc3545;--ema-light:#f8f9fa;--ema-dark:#343a40;--ema-background:#fff;--ema-background-diap:rgba(29,29,29,0.97);--ema-border-color:#c5c9cd;--ema-border:1px solid #c5c9cd;--ema-border-radius:3px 3px 3px 3px;--ema-box-shadow:1px 1px 10px 1px #ccc;--ema-margin:0.25rem;--ema-margin-sm:0.5rem;--ema-margin-md:1rem;--ema-margin-lg:1.5rem;--ema-margin-xl:2rem;--ema-padding:0.25rem;--ema-padding-sm:0.5rem;--ema-padding-md:1rem;--ema-padding-lg:1.5rem;--ema-padding-xl:2rem;--ema-gray-100:#f8f9fa;--ema-gray-200:#e9ecef;--ema-gray-300:#dee2e6;--ema-gray-400:#ced4da;--ema-gray-500:#adb5bd;--ema-gray-600:#868e96;--ema-gray-700:#495057;--ema-gray-800:#343a40;--ema-gray-900:#212529}ema-iframe{--top:0;--right:0;--bottom:0;--left:0;--visibility:hidden}ema-iframe .ema-iframe-holder{z-index:var(--zIndex);width:var(--width);height:var(--height);visibility:var(--visibility,\"visible\")}ema-iframe .ema-iframe-holder iframe{height:100%;width:100%}ema-iframe .iframe-holder-fullscreen{position:fixed;top:var(--top);right:var(--right);bottom:var(--bottom);left:var(--left);-webkit-overflow-scrolling:touch;overflow-y:scroll}ema-iframe .iframe-holder-fullscreen iframe{height:100%;width:100%}"}}export{i as EmaIframe};