/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as registerInstance,h,H as Host}from"./index-a0b4dca2.js";import{w as watchHeadingLevel}from"./validation-e83461ea.js";import{K as KolAlertFc}from"./Alert-a0cdc528.js";import{b as watchBoolean,s as setState,w as watchValidator}from"./prop.validators-c5e6ad2d.js";import{v as validateHasCloser}from"./has-closer-aa8f6369.js";import{v as validateLabel}from"./label-d70e7c34.js";import"./tslib.es6-2e5096f8.js";import"./clsx-09a06a12.js";import"./i18n-5fe08f1c.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./component-names-aa3cbc3c.js";import"./Heading-781aa65b.js";import"./dev.utils-fab45cbc.js";import"./index-541b643a.js";const alertTypeOptions=["default","info","success","warning","error"],alertVariantOptions=["card","msg"],KolAlertWc=class{constructor(a){registerInstance(this,a),this.close=()=>{var a,t;null===(t=null===(a=this._on)||void 0===a?void 0:a.onClose)||void 0===t||t.call(a,new Event("Close"))},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=a=>"object"==typeof a&&null!==a&&"function"==typeof a.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){const{_alert:a,_hasCloser:t,_label:e,_level:l,_type:i,_variant:s}=this.state,o={alert:a,hasCloser:t,label:e,level:l,type:i,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return h(Host,{key:"8474b6eb8e56583abb97f2aa7b786216b5cd14a0"},h(KolAlertFc,Object.assign({key:"ec4f2676790c69196690d3b91a09cbb3dddda0ab"},o),h("slot",{key:"af19597be7443687ce020ac5557aeee053baa602"})))}validateAlert(a){watchBoolean(this,"_alert",a)}validateHasCloser(a){validateHasCloser(this,a)}validateLabel(a){validateLabel(this,a)}validateLevel(a){watchHeadingLevel(this,a)}validateOn(a){this.validateOnValue(a)&&setState(this,"_on",{onClose:a.onClose})}validateType(a){watchValidator(this,"_type",(a=>"string"==typeof a&&alertTypeOptions.includes(a)),new Set(`String {${alertTypeOptions.join(", ")}`),a)}validateVariant(a){watchValidator(this,"_variant",(a=>"string"==typeof a&&alertVariantOptions.includes(a)),new Set(`AlertVariant {${alertVariantOptions.join(", ")}`),a)}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)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{KolAlertWc as kol_alert_wc};