import{r as e,c,h as t}from"./p-ytAlchvh.js";const a=class{constructor(t){e(this,t),this.removeTag=c(this,"removeTag"),this.external=!1,this.variant="link",this.url="",this.noWrap=!1,this.toBeRemoved=!1}getClass(){const e=["ecl-tag",`ecl-tag--${this.variant}`,this.styleClass];return this.colorMode&&e.push(`ecl-color-mode--${this.colorMode}`),this.noWrap&&e.push("ecl-tag--nowrap"),e.join(" ")}getTag(e){switch(e){case"link":return"a";case"removable":return"button"}}getExternal(){return t("ecl-icon",{icon:"external","style-class":`ecl-tag__icon ecl-tag__icon--external sc-ecl-tag-${this.theme}`,size:"2xs"})}getRemovable(){return t("span",{class:"ecl-tag__icon",onClick:()=>{this.toBeRemoved=!0,this.removeTag.emit(!0)}},t("ecl-icon",{icon:"close-outline","style-class":`ecl-tag__icon-close sc-ecl-tag-${this.theme}`,size:"xs"}))}componentWillLoad(){var e;this.theme=null!==(e=document.documentElement.getAttribute("data-ecl-theme"))&&void 0!==e?e:this.theme||"ec"}render(){const e=this.getTag(this.variant);return t(e,Object.assign({key:"296901fb9f5082b40d146abdcbf09b91d5b519e5",class:this.getClass()},"link"===this.variant&&{href:this.url},"removable"===this.variant&&{type:"button"}),t("slot",{key:"bbf5b9b4bbedd390c77456c822333492645926c7"}),"link"===this.variant&&this.external?this.getExternal():"","removable"===this.variant?this.getRemovable():"")}};a.style={ec:".ecl-tag.sc-ecl-tag-ec{align-items:center;background-color:var(--cm-surface-low-2);border-radius:12px;border-width:0;box-sizing:border-box;color:var(--cm-on-surface-brand);display:inline-flex;font:var(--f-s);padding:var(--s-2xs) var(--s-s);text-align:left;text-decoration:underline;text-underline-offset:5px}.ecl-tag.sc-ecl-tag-ec:focus-visible{background-color:var(--cm-surface-inverted);color:var(--cm-on-surface-brand);outline:2px solid var(--cm-border-primary);outline-offset:-2px}.ecl-tag.sc-ecl-tag-ec:hover{background-color:var(--cm-surface-medium,var(--cm-surface-medium-0))}.ecl-tag.sc-ecl-tag-ec:active,.ecl-tag.sc-ecl-tag-ec:hover{color:var(--cm-on-surface-brand)}.ecl-tag.sc-ecl-tag-ec:active{background-color:var(--cm-surface-inverted);outline:1px solid var(--cm-border-brand);outline-offset:-1px}.ecl-tag[disabled].sc-ecl-tag-ec{cursor:not-allowed;opacity:.5}.ecl-tag--nowrap.sc-ecl-tag-ec{white-space:nowrap}.ecl-tag--removable.sc-ecl-tag-ec{text-decoration:none}.ecl-tag__icon.sc-ecl-tag-ec{appearance:none;background:none;border-width:0;color:var(--cm-on-surface-brand);flex-shrink:0;height:1.125rem;margin-inline-start:var(--s-2xs);padding:0;pointer-events:auto;position:relative;width:1.125rem}.ecl-tag__icon.ecl-tag__icon--external.sc-ecl-tag-ec{height:1rem;width:1rem}.ecl-tag__icon-close.sc-ecl-tag-ec{fill:currentcolor;left:0;position:absolute;top:0}.ecl-tag-set.sc-ecl-tag-ec{display:inline-flex;flex-wrap:wrap;list-style:none;margin:calc(var(--s-xs)*-1) 0 0;padding:0}.ecl-tag-set.sc-ecl-tag-ec .ecl-tag-set__item.sc-ecl-tag-ec{margin-inline-end:var(--s-xs);margin-inline-start:0;margin-top:var(--s-xs);padding:0}.ecl-tag-set.sc-ecl-tag-ec .ecl-tag-set__item.sc-ecl-tag-ec:last-child{margin-inline-end:0}.ecl-tag__icon.sc-ecl-tag-ec{vertical-align:middle}",eu:".ecl-tag.sc-ecl-tag-eu{align-items:center;background-color:var(--c-p);border-radius:calc(var(--s-2xs)*2 + 1.5rem);border-width:0;box-sizing:border-box;color:#fff;display:inline-flex;font:var(--f-ui-s);padding:var(--s-2xs) var(--s-s);text-align:left;text-decoration:underline;text-underline-offset:5px}.ecl-tag.sc-ecl-tag-eu:focus-visible{background-color:var(--c-p);color:#fff;outline:2px solid var(--c-p);outline-offset:1px}.ecl-tag.sc-ecl-tag-eu:hover{background-color:var(--cm-surface-medium,var(--c-p-80));color:#fff}.ecl-tag.sc-ecl-tag-eu:active{background-color:var(--c-p-140);color:#fff;outline:1px solid var(--c-p-140);outline-offset:-1px}.ecl-tag[disabled].sc-ecl-tag-eu{cursor:not-allowed;opacity:.5}.ecl-tag--nowrap.sc-ecl-tag-eu{white-space:nowrap}.ecl-tag--removable.sc-ecl-tag-eu{text-decoration:none}.ecl-tag__icon.sc-ecl-tag-eu{appearance:none;background:none;border-width:0;color:#fff;flex-shrink:0;height:1rem;margin-inline-start:var(--s-2xs);padding:0;pointer-events:auto;position:relative;width:1rem}.ecl-tag__icon.ecl-tag__icon--external.sc-ecl-tag-eu{height:.75rem;width:.75rem}.ecl-tag__icon-close.sc-ecl-tag-eu{fill:currentcolor;left:0;position:absolute;top:0}.ecl-tag-set.sc-ecl-tag-eu{display:inline-flex;flex-wrap:wrap;list-style:none;margin:calc(var(--s-xs)*-1) 0 0;padding:0}.ecl-tag-set.sc-ecl-tag-eu .ecl-tag-set__item.sc-ecl-tag-eu{margin-inline-end:var(--s-xs);margin-inline-start:0;margin-top:var(--s-xs);padding:0}.ecl-tag-set.sc-ecl-tag-eu .ecl-tag-set__item.sc-ecl-tag-eu:last-child{margin-inline-end:0}.ecl-tag__icon.sc-ecl-tag-eu{vertical-align:middle}"};export{a as ecl_tag}