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