import{r as v,d as c,a as _,h as l,m as p,s as f,w as s,g as m}from"./index-yJ8X--q8.js";import{v as y}from"./has-closer-DB5qR5TQ-mszbYHeI.js";import{v as C}from"./label-D3d1qqIG-BD7RiEyC.js";import{w as b}from"./validation-C2b7CFWx-BgTAXxIP.js";import{K as g}from"./Alert-DnD_hO6X-DpaZH47L.js";import"./Heading-D_vnx163-UWSZHCcZ.js";import"./i18n-H9CUbi---DysS2qV6.js";import"./clsx-eK3rPvPS-BT_IL7Fz.js";/*!
 * KoliBri - The accessible HTML-Standard
 */const i=["default","info","success","warning","error"],o=["card","msg"],j=class{constructor(t){v(this,t),this.close=()=>{var e,a;(a=(e=this._on)===null||e===void 0?void 0:e.onClose)===null||a===void 0||a.call(e,new Event("Close")),this.host&&c(this.host,_.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=>typeof e=="object"&&e!==null&&typeof e.onClose=="function"}render(){const{_alert:t,_hasCloser:e,_label:a,_level:r,_type:n,_variant:h}=this.state,d={alert:t,hasCloser:e,label:a,level:r,type:n,variant:h,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return l(g,Object.assign({key:"2b0d74465270eef8d8d6f3da8c04377f862e8630"},d),l("slot",{key:"55e8ad62be763c26af16813e5ebfac2ce1f63b54"}))}validateAlert(t){p(this,"_alert",t)}validateHasCloser(t){y(this,t)}validateLabel(t){C(this,t)}validateLevel(t){b(this,t)}validateOn(t){this.validateOnValue(t)&&f(this,"_on",{onClose:t.onClose})}validateType(t){s(this,"_type",e=>typeof e=="string"&&i.includes(e),new Set(`String {${i.join(", ")}`),t)}validateVariant(t){s(this,"_variant",e=>typeof e=="string"&&o.includes(e),new Set(`AlertVariant {${o.join(", ")}`),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 m(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{j as kol_alert_wc};
//# sourceMappingURL=kol-alert-wc.entry-Dax0s_Q2.js.map
