/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-4e35d174.js"),validation=require("./validation-6f90f7a8.js"),Alert=require("./Alert-574bed11.js"),prop_validators=require("./prop.validators-37d21dea.js"),hasCloser=require("./has-closer-9e124723.js"),label=require("./label-d84e4f92.js");require("./tslib.es6-16e4524f.js"),require("./clsx-dd4d6dd1.js"),require("./i18n-1d085d07.js"),require("./i18n-737701e2.js"),require("./reuse-8cfefa9b.js"),require("./component-names-7808fb62.js"),require("./Heading-7a5bdb54.js"),require("./dev.utils-58fde089.js"),require("./index-bf4a6924.js");const alertTypeOptions=["default","info","success","warning","error"],alertVariantOptions=["card","msg"],KolAlertWc=class{constructor(e){index.registerInstance(this,e),this.close=()=>{var e,a;null===(a=null===(e=this._on)||void 0===e?void 0:e.onClose)||void 0===a||a.call(e,new Event("Close"))},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.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:e,_hasCloser:a,_label:t,_level:i,_type:l,_variant:s}=this.state,r={alert:e,hasCloser:a,label:t,level:i,type:l,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return index.h(index.Host,{key:"8474b6eb8e56583abb97f2aa7b786216b5cd14a0"},index.h(Alert.KolAlertFc,Object.assign({key:"ec4f2676790c69196690d3b91a09cbb3dddda0ab"},r),index.h("slot",{key:"af19597be7443687ce020ac5557aeee053baa602"})))}validateAlert(e){prop_validators.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)&&prop_validators.setState(this,"_on",{onClose:e.onClose})}validateType(e){prop_validators.watchValidator(this,"_type",(e=>"string"==typeof e&&alertTypeOptions.includes(e)),new Set(`String {${alertTypeOptions.join(", ")}`),e)}validateVariant(e){prop_validators.watchValidator(this,"_variant",(e=>"string"==typeof e&&alertVariantOptions.includes(e)),new Set(`AlertVariant {${alertVariantOptions.join(", ")}`),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)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};exports.kol_alert_wc=KolAlertWc;