/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-87a7393a.js"),validation=require("./validation-7ea25fa6.js"),events=require("./events-fc641593.js"),Alert=require("./Alert-ea442259.js"),prop_validators=require("./prop.validators-96dfedce.js"),hasCloser=require("./has-closer-9b3c14a7.js"),label=require("./label-b8654499.js");require("./tslib.es6-5e301284.js"),require("./clsx-dd4d6dd1.js"),require("./i18n-1d085d07.js"),require("./i18n-737701e2.js"),require("./reuse-8cfefa9b.js"),require("./component-names-cf0c0d8a.js"),require("./Heading-d79de8bf.js"),require("./index-38f5f0b2.js"),require("./dev.utils-58fde089.js");const alertTypeOptions=["default","info","success","warning","error"],alertVariantOptions=["card","msg"],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.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=0,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:0}}render(){const{_alert:e,_hasCloser:t,_label:a,_level:i,_type:l,_variant:s}=this.state,r={alert:e,hasCloser:t,label:a,level:i,type:l,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return index.h(Alert.KolAlertFc,Object.assign({key:"8d045b87e0ccf5ee926c8774da3d94bda07d9660"},r),index.h("slot",{key:"a665623f7355e2e30b728d37d3d9e59e9ad0f43f"}))}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)}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;