/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-2e5096f8.js";import{h as e}from"./index-12b1e13a.js";import{c as a}from"./clsx-09a06a12.js";import{t as l}from"./i18n-5fe08f1c.js";import{g as c,b as i,c as s}from"./component-names-d278f819.js";import{L as n}from"./dev.utils-fab45cbc.js";const r=({ariaLabel:o,icon:a})=>e(c,{class:"heading-icon",_label:o,_icons:a}),t=({type:o,label:a})=>{switch(o){case"error":return e(r,{ariaLabel:l("kol-error"),icon:"codicon codicon-error",label:a});case"info":return e(r,{ariaLabel:l("kol-info"),icon:"codicon codicon-info",label:a});case"warning":return e(r,{ariaLabel:l("kol-warning"),icon:"codicon codicon-warning",label:a});case"success":return e(r,{ariaLabel:l("kol-success"),icon:"codicon codicon-pass",label:a});default:return e(r,{ariaLabel:l("kol-message"),icon:"codicon codicon-comment",label:a})}},d=t,b=(c,r)=>{const{class:t={},type:b="default",variant:m="msg",label:u,hasCloser:f,alert:v,onAlertTimeout:g,onCloserClick:p,level:h}=c,_=o(c,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);if(v){try{n.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(e){n.debug("Navigator does not support vibration.")}setTimeout((()=>{null==g||g()}),1e4)}const k=Object.assign({class:a("kol-alert-wc","alert",b,m,{hasCloser:!!f},t),role:v?"alert":void 0},_);return e("div",Object.assign({},k),e("div",{class:"heading"},e(d,{label:u,type:b}),e("div",{class:"heading-content"},u?e(i,{_label:u,_level:h}):null,"msg"===m&&e("div",{class:"content"},r)),f&&e(s,{class:"close",_ariaDescription:(null==u?void 0:u.trim())||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:l("kol-close-alert"),_on:{onClick:p},_tooltipAlign:"left"})),"card"===m&&e("div",{class:"content"},r))},m=b;export{m as K};