import*as LitHtml from"../../third_party/lit-html/lit-html.js";const isString=t=>void 0!==t;export class Icon extends HTMLElement{constructor(){super(...arguments),this.shadow=this.attachShadow({mode:"open"}),this.iconPath="",this.color="rgb(110 110 110)",this.width="100%",this.height="100%"}set data(t){const{width:i,height:e}=t;this.color=t.color,this.width=isString(i)?i:isString(e)?e:this.width,this.height=isString(e)?e:isString(i)?i:this.height,this.iconPath="iconPath"in t?t.iconPath:`Images/${t.iconName}.svg`,"iconName"in t&&(this.iconName=t.iconName),this.render()}get data(){const t={color:this.color,width:this.width,height:this.height};return this.iconName?{...t,iconName:this.iconName}:{...t,iconPath:this.iconPath}}getStyles(){const{iconPath:t,width:i,height:e,color:o}=this,s={width:i,height:e,display:"block"};return o?{...s,webkitMaskImage:`url(${t})`,webkitMaskPosition:"center",webkitMaskRepeat:"no-repeat",webkitMaskSize:"99%",backgroundColor:`var(--icon-color, ${o})`}:{...s,backgroundImage:`url(${t})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"99%"}}render(){LitHtml.render(LitHtml.html`
      <style>
        :host {
          display: inline-block;
          white-space: nowrap;
        }
      </style>
      <div class="icon-basic" style=${LitHtml.Directives.styleMap(this.getStyles())}></div>
    `,this.shadow)}}customElements.get("devtools-icon")||customElements.define("devtools-icon",Icon);