"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,6724],{98538(t,e,s){s.d(e,{S:()=>o,T:()=>a});var i=s(88961),n=s(25964),r=s(8512),l=s(63200);const a=(0,n.xE)("icon"),o=(0,l.Zz)((0,i.RF)({mappings:{fill:[{},{property:r.q.cssVarList.fill}]}}),i.VO,i.tQ)((0,i.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n      :host {\n        display: inline-flex;\n        max-height: 100%;\n      }\n      ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},56737(t,e,s){s.r(e),s.d(e,{IconClass:()=>i.S,componentName:()=>i.T}),s(53455);var i=s(98538);customElements.define(i.T,i.S)},8512(t,e,s){s.d(e,{T:()=>o,q:()=>d});var i=s(88961),n=s(72270),r=s(63200),l=s(25964),a=s(18782);const o=(0,l.xE)("image"),c=["src","src-dark"];class h extends((0,n.qu)({componentName:o,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,l.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n      :host > slot {\n        width: 100%;\n        height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n      ::slotted(*) {\n        width: 100%;\n\t\t\t}\n\n      .hidden {\n        display: none;\n      }\n      ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&this.shouldRender(t)&&this.renderImage()}}const d=(0,r.Zz)((0,i.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)(h)},18782(t,e,s){s.d(e,{m:()=>r});var i=s(25414);const n=t=>{const e=i.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},r=async(t,e)=>{try{let s;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));s=n(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),i=await e.text();s=n(i)}else s=((t,e)=>{const s=document.createElement("img");return s.setAttribute("src",t),s.setAttribute("alt",e),s})(t,e);return s.style.setProperty("max-width","100%"),s.style.setProperty("max-height","100%"),s}catch{return null}}},53455(t,e,s){s.r(e),s.d(e,{ImageClass:()=>i.q,componentName:()=>i.T});var i=s(8512);customElements.define(i.T,i.q)}}]);
//# sourceMappingURL=descope-icon.js.map