import{r as i,h as t,g as s}from"./p-52e3bb32.js";import{L as d}from"./p-5ba6737a.js";import{l as e}from"./p-e3d2e899.js";const l=class{constructor(t){i(this,t),this.listItems=[],this.hasSlottedItems=void 0,this.afListType=d.BULLET}componentWillLoad(){this.getListItems()}componentWillUpdate(){this.getListItems()}componentDidLoad(){this._observer=new MutationObserver((()=>{this.getListItems()})),this._observer.observe(this.hostElement,{childList:!0}),this.applyCheckedListStyling()}componentDidUpdate(){this.applyCheckedListStyling()}disconnectedCallback(){this._observer&&this._observer.disconnect()}applyCheckedListStyling(){this.afListType===d.CHECKED?this.hostElement.querySelectorAll("li").forEach((i=>{if(!i.querySelector("digi-icon-check")){const t=document.createElement("digi-icon-check");t.classList.add("digi-list__icon"),i.insertBefore(t,i.firstChild)}})):this.hostElement.querySelectorAll("li").forEach((i=>{const t=i.querySelector("digi-icon-check");t&&i.removeChild(t)}))}getListItems(){const i=this.hostElement.querySelectorAll("li");if(!i||i.length<=0)return this.hasSlottedItems=!1,this.listItems=[],void e.warn("The slot contains no <li> elements.",this.hostElement);this.hasSlottedItems=!0,this.listItems=Array.from(i)}render(){return t("digi-typography",{key:"c891426704febd087cea0e032483d8d821097a6b"},t(this.afListType===d.NUMBERED?"ol":"ul",{key:"a4b01c02c8c61fba4a1fcb64fc465f836063d9dd",class:{"digi-list":!0,[`digi-list--${this.afListType}`]:!0}},t("slot",{key:"3b36dafaafcd40c15a47678894dba13d864af18c"})))}get hostElement(){return s(this)}};l.style=".sc-digi-list-h{--digi--list--padding-inline-start:0.25rem}.sc-digi-list-h .digi-list--checked.sc-digi-list{list-style-position:inside;padding-inline-start:var(--digi--list--padding-inline-start)}.sc-digi-list-h .digi-list--checked.sc-digi-list li.sc-digi-list{list-style:none;display:flex;align-items:flex-start}.sc-digi-list-s .digi-list--checked .digi-list__icon{padding-right:var(--digi--padding--small);width:1rem;min-height:auto;flex-shrink:0;align-items:start;margin-top:rem(7)}";export{l as digi_list}