import{html as y,nothing as b,render as x}from"./../lit/lit.js";var d=`:host{display:flex;max-width:var(--sys-size-35);width:100%}:host([hidden]){display:none}#card{break-inside:avoid;min-width:var(--sys-size-31);margin:var(--sys-size-3) var(--sys-size-6) var(--sys-size-5) var(--sys-size-5);flex:1;#heading{display:flex;white-space:nowrap;margin-bottom:var(--sys-size-5);[role="heading"]{color:var(--sys-color-on-surface);font:var(--sys-typescale-body2-medium)}[name="heading-prefix"]::slotted(*){margin-right:var(--sys-size-3)}[name="heading-suffix"]::slotted(*){margin-left:auto}}#content{border-radius:var(--sys-shape-corner-small);box-shadow:var(--sys-elevation-level2);display:flex;flex-direction:column;background:var(--app-color-card-background);&::slotted(*){padding:var(--sys-size-4) var(--sys-size-6)}&::slotted(*:not(:first-child)){border-top:var(--sys-size-1) solid var(--app-color-card-divider)}}}
/*# sourceURL=${import.meta.resolve("./cards/card.css")} */`;var a=class extends HTMLElement{static observedAttributes=["heading"];#e=this.attachShadow({mode:"open"});constructor(){super(),this.#t()}get heading(){return this.getAttribute("heading")}set heading(t){t?this.setAttribute("heading",t):this.removeAttribute("heading")}attributeChangedCallback(t,e,i){e!==i&&this.#t()}#t(){x(y`
        <style>${d}</style>
        <div id="card">
          <div id="heading">
            <slot name="heading-prefix"></slot>
            <div role="heading" aria-level="2">${this.heading??b}</div>
            <slot name="heading-suffix"></slot>
          </div>
          <slot id="content"></slot>
        </div>`,this.#e,{host:this})}};customElements.define("devtools-card",a);import"./../../Images/Images.js";var m=`:host{flex-grow:0;flex-shrink:0;display:inline-block;width:20px;height:20px;color:var(--icon-default);vertical-align:sub;position:relative}:host(.extra-small){height:var(--sys-size-6);width:var(--sys-size-6)}:host(.small){height:var(--sys-size-7);width:var(--sys-size-7)}:host(.medium){height:var(--sys-size-8);width:var(--sys-size-8)}:host(.large){height:18px;width:18px}:host(.extra-large){height:var(--sys-size-9);width:var(--sys-size-9)}:host(.toggled){color:var(--icon-toggled)}:host([hidden]){display:none}:host([name="warning-filled"]),
:host([name="issue-exclamation-filled"]){color:var(--icon-warning)}:host([name="cross-circle"]),
:host([name="cross-circle-filled"]),
:host([name="issue-cross-filled"]),
:host([name="small-status-dot"]){color:var(--icon-error)}:host([name="issue-text-filled"]){color:var(--icon-info)}:host([name="large-arrow-right-filled"]){color:var(--icon-arrow-main-thread)}:host([name="code-circle"]){color:var(--icon-link)}:host([name="file-document"]){color:var(--icon-file-document)}:host([name="file-font"]){color:var(--icon-file-font)}:host([name="file-script"]){color:var(--icon-file-script)}:host([name="file-stylesheet"]){color:var(--icon-file-styles)}:host([name="file-media"]){color:var(--icon-file-media)}:host([name="triangle-up"]),
:host([name="triangle-down"]),
:host([name="triangle-left"]),
:host([name="triangle-right"]){width:14px;height:14px;vertical-align:baseline}span{display:block;width:100%;height:100%;background-color:currentcolor;mask:var(--icon-url,url("data:image/svg+xml,%3Csvg width='1' height='1' fill='%23000' xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E ")) center /contain no-repeat}@media (forced-colors: active){span{forced-color-adjust:none}}
/*# sourceURL=${import.meta.resolve("./icons/icon.css")} */`;var n=class extends HTMLElement{static observedAttributes=["name"];#e;#t;constructor(){super(),this.role||(this.role="presentation");let t=document.createElement("style");t.textContent=m,this.#t=document.createElement("span"),this.#e=this.attachShadow({mode:"open"}),this.#e.append(t,this.#t)}get data(){return{color:this.style.color,width:this.style.width,height:this.style.height,iconName:this.name??""}}set data(t){let{color:e,width:i,height:s}=t;if(e&&(this.style.color=e),i&&(this.style.width=i),s&&(this.style.height=s),"iconName"in t&&t.iconName)this.name=t.iconName;else if("iconPath"in t&&t.iconPath)this.name=t.iconPath;else throw new Error("Misconfigured `iconName` or `iconPath`.")}get name(){return this.getAttribute("name")}set name(t){t===null?this.removeAttribute("name"):this.setAttribute("name",t)}attributeChangedCallback(t,e,i){if(e!==i)switch(t){case"name":{if(i===null)this.#t.style.removeProperty("--icon-url");else{let s=URL.canParse(i)?`url(${i})`:`var(--image-file-${i})`;this.#t.style.setProperty("--icon-url",s)}break}}}},S=(r,t)=>{let e=new n;return e.name=r,t!==void 0&&(e.className=t),e};customElements.define("devtools-icon",n);import*as l from"./../../core/platform/platform.js";import*as f from"./../helpers/helpers.js";import{html as w,render as k}from"./../lit/lit.js";import*as u from"./../visual_logging/visual_logging.js";var g=`:host{display:inline;cursor:pointer;text-decoration:underline;color:var(--text-link)}@media (forced-colors: active){:host{forced-color-adjust:none;color:linktext}}:host(:focus-visible){outline:var(--sys-size-2) solid var(--sys-color-state-focus-ring);outline-offset:2px;outline-style:solid!important;border-radius:var(--sys-shape-corner-extra-small)}
/*# sourceURL=${import.meta.resolve("./link/link.css")} */`;var h=class r extends HTMLElement{#e=this.attachShadow({mode:"open"});static observedAttributes=["href","jslogcontext"];connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.#s(),this.#i(),this.setAttribute("role","link"),this.setAttribute("target","_blank"),this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#r),this.#n()}disconnectedCallback(){this.removeEventListener("click",this.#o),this.removeEventListener("keydown",this.#r)}#t(t){let e=this.href;e&&(f.openInNewTab(e,this.allowPrivileged),t.consume())}get href(){return this.getAttribute("href")}set href(t){this.setAttribute("href",t)}get allowPrivileged(){return this.hasAttribute("allow-privileged")}set allowPrivileged(t){t?this.setAttribute("allow-privileged",""):this.removeAttribute("allow-privileged")}get jslogContext(){return this.getAttribute("jslogcontext")}set jslogContext(t){this.setAttribute("jslogcontext",t)}#i(){let t=this.jslogContext??void 0,e=u.link().track({click:!0,keydown:"Enter|Space"}).context(t);this.setAttribute("jslog",e.toString())}#s(){!this.hasAttribute("title")&&this.href&&this.setAttribute("title",this.href)}attributeChangedCallback(t,e,i){if(e!==i){if(t==="jslogcontext")return this.#i();t==="href"&&this.#s(),this.#n()}}#o=t=>{this.#t(t)};#r=t=>{l.KeyboardUtilities.isEnterOrSpaceKey(t)&&this.#t(t)};#n(){k(w`<style>
          ${g}
        </style><slot></slot>`,this.#e,{host:this})}static create(t,e,i,s,c=0,v=!1){let o=new r;o.href=t,o.allowPrivileged=v,e=e??t,o.textContent=l.StringUtilities.trimMiddle(e,150);let p=i?`${i} devtools-link`:"devtools-link";return o.setAttribute("class",p),s&&o.setAttribute("jslogcontext",s),c!==0&&o.setAttribute("tabindex",String(c)),o}};customElements.define("devtools-link",h);export{a as Card,n as Icon,h as Link,S as createIcon};
//# sourceMappingURL=kit.js.map
