/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as registerInstance,h,H as Host,g as getElement}from"./index-C_yiBYg2.js";import{s as setState}from"./common-Dd0zJQbD.js";import{v as validateHasCloser}from"./has-closer-CQzjaTkv.js";import{v as validateLabel}from"./label-Dnmzb2S_.js";import{t as translate}from"./i18n-LBpyQ66X.js";import{w as watchHeadingLevel}from"./validation-aqgnZOL6.js";import{d as KolButtonWcTag}from"./component-names-C3fyby67.js";import"./Alert-Cyr4RO_F.js";import{K as KolHeadingFc}from"./Heading-1FTzB33X.js";import"./markdown-BSkXjaSn.js";import{n as nonce}from"./dev.utils-D2KUwuu5.js";import{d as dispatchDomEvent,K as KolEvent}from"./events-9-skLO0f.js";import"./i18n-CfLoIZ8T.js";import"./tslib.es6-CxX45GIN.js";import"./clsx-eK3rPvPS.js";import"./bem-Dj4gWVFO.js";import"./browser-DiRe0qUf.js";const KolCardWc=class{constructor(e){registerInstance(this,e),this.nonce=nonce(),this.translateClose=translate("kol-close"),this.close=()=>{var e;void 0!==(null===(e=this._on)||void 0===e?void 0:e.onClose)&&this._on.onClose(new Event("Close")),this.host&&dispatchDomEvent(this.host,KolEvent.close)},this.on={onClick:this.close},this._hasCloser=!1,this._level=0,this.state={_label:""},this.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose}render(){return h(Host,{key:"31a21a7dd16b81042127406bc4cd091f16f230d4"},h("div",{key:"22001ed9c1f73d9b6445b0b6e36109c9cc8ef608","aria-labelledby":this.nonce,class:"kol-card",role:"group"},h(KolHeadingFc,{key:"5b6760cafee75437ba6ef208d35e05e96ec3f76a",class:"kol-card__header",id:this.nonce,level:this.state._level},this.state._label),h("div",{key:"9b780b199200df0ce78ad4f3d2f1ad746f838a8e",class:"kol-card__content"},h("slot",{key:"cdf53c951f6980b6827db3bf37ea7ad216037c69"})),this.state._hasCloser&&h(KolButtonWcTag,{key:"dd2b363336c1f891f7c6dfa4a46eca9ab1850dcf",class:"kol-card__close-button kol-close-button","data-testid":"card-close-button",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:this.translateClose,_on:this.on,_tooltipAlign:"left"})))}validateOn(e){this.validateOnValue(e)&&setState(this,"_on",{onClose:e.onClose})}validateHasCloser(e){validateHasCloser(this,e)}validateLabel(e){validateLabel(this,e,{required:!0})}validateLevel(e){watchHeadingLevel(this,e)}componentWillLoad(){this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on)}get host(){return getElement(this)}static get watchers(){return{_on:["validateOn"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"]}}};export{KolCardWc as kol_card_wc};