/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as __rest}from"./tslib.es6.js";import{h}from"@stencil/core/internal/client";import{c as clsx}from"./clsx.js";import{t as translate}from"./i18n2.js";import{c as KolIconTag,a as KolButtonWcTag}from"./component-names.js";import{K as KolHeadingFc}from"./Heading.js";import{L as Log}from"./dev.utils.js";const Icon=({ariaLabel:o,icon:l})=>h(KolIconTag,{class:"heading-icon",_label:o,_icons:l}),AlertIcon=({type:o,label:l})=>{switch(o){case"error":return h(Icon,{ariaLabel:translate("kol-error"),icon:"codicon codicon-error",label:l});case"info":return h(Icon,{ariaLabel:translate("kol-info"),icon:"codicon codicon-info",label:l});case"warning":return h(Icon,{ariaLabel:translate("kol-warning"),icon:"codicon codicon-warning",label:l});case"success":return h(Icon,{ariaLabel:translate("kol-success"),icon:"codicon codicon-pass",label:l});default:return h(Icon,{ariaLabel:translate("kol-message"),icon:"codicon codicon-comment",label:l})}},AlertIcon$1=AlertIcon,KolAlertFc=(o,l)=>{const{class:e={},type:a="default",variant:c="msg",label:n,hasCloser:t,alert:r,onAlertTimeout:s,onCloserClick:i,level:d}=o,g=__rest(o,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);if(r){try{Log.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(o){Log.debug("Navigator does not support vibration.")}setTimeout((()=>{null==s||s()}),1e4)}const b=Object.assign({class:clsx("kol-alert-wc","alert",a,c,{hasCloser:!!t},e),role:r?"alert":void 0},g);return h("div",Object.assign({},b),h("div",{class:"heading"},h(AlertIcon$1,{label:n,type:a}),h("div",{class:"heading-content"},n?h(KolHeadingFc,{level:d},n):null,"msg"===c&&h("div",{class:"content"},l)),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"},l))},KolAlertFc$1=KolAlertFc;export{KolAlertFc$1 as K};