import{r as e,c as t,h as s,g as i}from"./p-3b76effa.js";import"./p-d7ac2f15.js";import{C as r,D as h}from"./p-18ca1c85.js";class a{constructor(s){e(this,s),this.fullscreenClass="iframe-holder-fullscreen",this.width="100%",this.height="420px",this.fullscreen=!1,this.fullscreenMargin="0 0 0 0",this.iframeLoaded=t(this,"iframeLoaded",7)}onIframeLoaded(){this.iframeLoaded.emit({src:this.src})}componentDidLoad(){this.postRender()}componentDidUpdate(){this.postRender()}postRender(){let e=this.el.getElementsByClassName("ema-iframe-iframe")[0],t=this.el.getElementsByClassName("ema-iframe-holder")[0];if(this.fullscreen||(r.setVar("width",this.width,this.el),r.setVar("height",this.height,this.el),e.setAttribute("width",r.getVar("width",this.el)),e.setAttribute("height",r.getVar("height",this.el))),this.fullscreen){let e=this.fullscreenMargin.split(" ");e.length&&1===e.length&&(r.setVar("top",e[0],this.el),r.setVar("right",e[0],this.el),r.setVar("bottom",e[0],this.el),r.setVar("left",e[0],this.el)),e.length&&2===e.length&&(r.setVar("top",e[0],this.el),r.setVar("right",e[1],this.el),r.setVar("bottom",e[0],this.el),r.setVar("left",e[1],this.el)),e.length&&3===e.length&&(r.setVar("top",e[0],this.el),r.setVar("right",e[1],this.el),r.setVar("bottom",e[2],this.el)),e.length&&4===e.length&&(r.setVar("top",e[0],this.el),r.setVar("right",e[1],this.el),r.setVar("bottom",e[2],this.el),r.setVar("left",e[3],this.el)),h.addClass(t,this.fullscreenClass)}this.zIndex&&r.setVar("zIndex",this.zIndex,this.el),e.onload=()=>{r.setVar("visibility","visible",this.el),this.iframeLoaded.emit({src:this.src,el:this.el})}}render(){return s("div",{class:"ema-iframe-holder "},s("iframe",{src:this.src,frameborder:"0",class:"ema-iframe-iframe"}))}get el(){return i(this)}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{a as ema_iframe};