/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-2e5096f8.js";import{h as a}from"./index-a0b4dca2.js";import{c as e}from"./clsx-09a06a12.js";import{t as l}from"./i18n-5fe08f1c.js";import{d as c,a as i}from"./component-names-aa3cbc3c.js";import{K as s}from"./Heading-781aa65b.js";import{L as n}from"./dev.utils-fab45cbc.js";const r=({ariaLabel:o,icon:e})=>a(c,{class:"heading-icon",_label:o,_icons:e}),t=({type:o,label:e})=>{switch(o){case"error":return a(r,{ariaLabel:l("kol-error"),icon:"codicon codicon-error",label:e});case"info":return a(r,{ariaLabel:l("kol-info"),icon:"codicon codicon-info",label:e});case"warning":return a(r,{ariaLabel:l("kol-warning"),icon:"codicon codicon-warning",label:e});case"success":return a(r,{ariaLabel:l("kol-success"),icon:"codicon codicon-pass",label:e});default:return a(r,{ariaLabel:l("kol-message"),icon:"codicon codicon-comment",label:e})}},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,k=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(a){n.debug("Navigator does not support vibration.")}setTimeout((()=>{null==g||g()}),1e4)}const j=Object.assign({class:e("kol-alert-wc","alert",b,m,{hasCloser:!!f},t),role:v?"alert":void 0},k);return a("div",Object.assign({},j),a("div",{class:"heading"},a(d,{label:u,type:b}),a("div",{class:"heading-content"},u?a(s,{level:h},u):null,"msg"===m&&a("div",{class:"content"},r)),f&&a(i,{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&&a("div",{class:"content"},r))},m=b;export{m as K};