/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as a,h as t,H as s}from"./index-5d2ba3a9.js";import{t as e}from"./i18n-5fe08f1c.js";import{v as r}from"./image-source-90db908f.js";import{v as i}from"./label-e8ec0e3a.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./prop.validators-64749272.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const c=a=>0===a.length?"":a[0].toUpperCase(),o=a=>{const t=a.split(/\s+/),s=t.at(0),e=t.at(-1);return t.length>=2&&s&&e?`${c(s)}${c(e)}`:c(a)},l=class{constructor(t){a(this,t),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return t(s,{key:"b45a03c214f69fa12120c1ab077cbdda68af4d03",class:"kol-avatar-wc"},t("div",{key:"11c5ec00e290a3e045ec6d355bd9afd9b65cb396","aria-label":e("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"container",role:"img"},this.state._src?t("img",{alt:"","aria-hidden":"true",class:"image",src:this.state._src}):t("span",{"aria-hidden":"true",class:"initials"},o(this.state._label.trim()))))}validateSrc(a){r(this,a)}validateLabel(a){i(this,a,{required:!0})}componentWillLoad(){this.validateSrc(this._src),this.validateLabel(this._label)}static get watchers(){return{_src:["validateSrc"],_label:["validateLabel"]}}};export{l as kol_avatar_wc};