/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as registerInstance,h,g as getElement}from"./index-C_yiBYg2.js";import{K as KolAlertFc}from"./Alert-Cyr4RO_F.js";import{w as watchValidator,d as watchBoolean,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{d as dispatchDomEvent,K as KolEvent}from"./events-9-skLO0f.js";import{w as watchHeadingLevel}from"./validation-aqgnZOL6.js";import"./tslib.es6-CxX45GIN.js";import"./clsx-eK3rPvPS.js";import"./component-names-C3fyby67.js";import"./i18n-LBpyQ66X.js";import"./i18n-CfLoIZ8T.js";import"./bem-Dj4gWVFO.js";import"./browser-DiRe0qUf.js";import"./Heading-1FTzB33X.js";const alertTypeOptions=["default","info","success","warning","error"],isAlertTypePropType=t=>"string"==typeof t&&alertTypeOptions.includes(t),validateAlertType=(t,e)=>{watchValidator(t,"_type",isAlertTypePropType,new Set(alertTypeOptions),e)},alertVariantOptions=["card","msg"],isAlertVariantPropType=t=>"string"==typeof t&&alertVariantOptions.includes(t),validateAlertVariant=(t,e)=>{watchValidator(t,"_variant",isAlertVariantPropType,new Set(alertVariantOptions),e)},KolAlertWc=class{constructor(t){registerInstance(this,t),this.close=()=>{var t,e;null===(e=null===(t=this._on)||void 0===t?void 0:t.onClose)||void 0===e||e.call(t,new Event("Close")),this.host&&dispatchDomEvent(this.host,KolEvent.close)},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this._alert=!1,this._hasCloser=!1,this._level=0,this._type="default",this._variant="msg",this.state={_level:0},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose}render(){const{_alert:t,_hasCloser:e,_label:a,_level:l,_type:i,_variant:s}=this.state,r={alert:t,hasCloser:e,label:a,level:l,type:i,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return h(KolAlertFc,Object.assign({key:"5db3514131f644ab76a9bddc438cdf0af412e6e8"},r),h("slot",{key:"61ef793542ae680a090596e44fcb98b9f4e55708"}))}validateAlert(t){watchBoolean(this,"_alert",t)}validateHasCloser(t){validateHasCloser(this,t)}validateLabel(t){validateLabel(this,t)}validateLevel(t){watchHeadingLevel(this,t)}validateOn(t){this.validateOnValue(t)&&setState(this,"_on",{onClose:t.onClose})}validateType(t){validateAlertType(this,t)}validateVariant(t){validateAlertVariant(this,t)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}get host(){return getElement(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{KolAlertWc as kol_alert_wc};