import{r as v,d as c,a as p,h as i,m as _,s as m,g as f,w as s}from"./index-B6uGkrgD.js";import{K as y}from"./Alert-Yti79ERR-4xSe09mG.js";import{v as b}from"./has-closer-BbY1hw6m-BEiGMaH1.js";import{v as C}from"./label-Cw7rCjUo-YeMVw3_3.js";import{w as u}from"./validation-s-zBxvaI-O3gCOY3s.js";import"./tslib.es6-CxX45GIN-BGVaTf34.js";import"./i18n-DvMeCREp-Du7miH0i.js";import"./component-N8_W7bhu-Q1tppvIJ.js";import"./normalizers-MuBx2xIG-CzHg60vA.js";import"./_Uint8Array-UP73qmmG-BbaGLgZa.js";import"./isArray-CcrBs4JM-CqO_RI43.js";import"./clsx-COFh-Vc8-D7cYsJM5.js";import"./Heading-D7bFHALO-CWSaVFum.js";import"./level-C5jpNYbv-DNe4OaAn.js";import"./isObject-BJgq02Md-C3e4t58V.js";const l=["default","info","success","warning","error"],A=t=>typeof t=="string"&&l.includes(t),g=(t,e)=>{s(t,"_type",A,new Set(l),e)},o=["card","msg"],w=t=>typeof t=="string"&&o.includes(t),T=(t,e)=>{s(t,"_variant",w,new Set(o),e)},I=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,p.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 i(y,Object.assign({key:"ab90b52cbda1d61514c3acd292d0bd6d91f0c9d5"},d),i("slot",{key:"6a7e2a89cfabde71c1140d4cf5de28e99bc09ef4"}))}validateAlert(t){_(this,"_alert",t)}validateHasCloser(t){b(this,t)}validateLabel(t){C(this,t)}validateLevel(t){u(this,t)}validateOn(t){this.validateOnValue(t)&&m(this,"_on",{onClose:t.onClose})}validateType(t){g(this,t)}validateVariant(t){T(this,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 f(this)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};export{I as kol_alert_wc};
//# sourceMappingURL=kol-alert-wc.entry-B92G43R4.js.map
