/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";var index=require("./index-D0FxsaCe.js"),Alert=require("./Alert-BtlJVPF2.js"),common=require("./common-Cd2qH809.js"),hasCloser=require("./has-closer-COtNvUI4.js"),label=require("./label-Nicf9N_T.js"),events=require("./events-cX8h6I3p.js"),validation=require("./validation-DsxRnVmU.js");require("./tslib.es6-7DbU_BSw.js"),require("./clsx-CkZlkaek.js"),require("./component-names-CuI-0Pbo.js"),require("./i18n-DNWGj4j8.js"),require("./i18n-BnIFsVIa.js"),require("./bem-CWXmxX43.js"),require("./browser-D7A31aEp.js"),require("./Heading-CsroEQcs.js");const alertTypeOptions=["default","info","success","warning","error"],isAlertTypePropType=e=>"string"==typeof e&&alertTypeOptions.includes(e),validateAlertType=(e,t)=>{common.watchValidator(e,"_type",isAlertTypePropType,new Set(alertTypeOptions),t)},alertVariantOptions=["card","msg"],isAlertVariantPropType=e=>"string"==typeof e&&alertVariantOptions.includes(e),validateAlertVariant=(e,t)=>{common.watchValidator(e,"_variant",isAlertVariantPropType,new Set(alertVariantOptions),t)},KolAlertWc=class{constructor(e){index.registerInstance(this,e),this.close=()=>{var e,t;null===(t=null===(e=this._on)||void 0===e?void 0:e.onClose)||void 0===t||t.call(e,new Event("Close")),this.host&&events.dispatchDomEvent(this.host,events.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=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose}render(){const{_alert:e,_hasCloser:t,_label:a,_level:l,_type:i,_variant:s}=this.state,r={alert:e,hasCloser:t,label:a,level:l,type:i,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return index.h(Alert.KolAlertFc,Object.assign({key:"5db3514131f644ab76a9bddc438cdf0af412e6e8"},r),index.h("slot",{key:"61ef793542ae680a090596e44fcb98b9f4e55708"}))}validateAlert(e){common.watchBoolean(this,"_alert",e)}validateHasCloser(e){hasCloser.validateHasCloser(this,e)}validateLabel(e){label.validateLabel(this,e)}validateLevel(e){validation.watchHeadingLevel(this,e)}validateOn(e){this.validateOnValue(e)&&common.setState(this,"_on",{onClose:e.onClose})}validateType(e){validateAlertType(this,e)}validateVariant(e){validateAlertVariant(this,e)}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 index.getElement(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};exports.kol_alert_wc=KolAlertWc;