import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{i as isRtl}from"./page-align.js";const scStackedListRowCss=":host{display:block;--column-width-min:125px;position:relative}:host(:not(:last-child)){border-bottom:1px solid var(--sc-stacked-list-border-color, var(--sc-color-gray-200))}:host(:focus-within){z-index:2}.list-row{background:var(--sc-list-row-background-color, var(--sc-color-white));color:var(--sc-list-row-color, var(--sc-color-gray-800));text-decoration:none;display:grid;justify-content:var(--sc-stacked-list-row-justify-content, space-between);align-items:var(--sc-stacked-list-row-align-items, start);grid-template-columns:repeat(auto-fit, minmax(100%, 1fr));gap:var(--sc-spacing-xx-small);padding:var(--sc-spacing-medium) var(--sc-spacing-large);transition:background-color var(--sc-transition-fast) ease;border-radius:var(--sc-stacked-list-row-border-radius, var(--sc-input-border-radius-medium));min-width:0px;min-height:0px}.list-row[href]:hover{background:var(--sc-stacked-list-row-hover-color, var(--sc-color-gray-50))}.list-row__prefix,.list-row__suffix{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.list-row__prefix{left:var(--sc-spacing-large)}.list-row__suffix{right:var(--sc-spacing-large)}.list-row--has-prefix{padding-left:3.5em}.list-row--has-suffix{padding-right:3.5em;gap:var(--sc-spacing-xxxx-large)}.list-row.breakpoint-lg{grid-template-columns:repeat(calc(var(--columns) - 1), 1fr) 1fr;gap:var(--sc-spacing-large)}.list-row.breakpoint-lg ::slotted(:last-child:not(:first-child)){display:flex;justify-content:flex-end}.list-row--is-rtl.list-row__prefix,.list-row--is-rtl.list-row__suffix{left:20px;width:20px;transform:rotate(180deg)}.list-row--is-rtl.list-row__suffix{right:auto}.list-row--is-rtl.list-row--has-suffix{gap:var(--sc-spacing-large)}",ScStackedListRowStyle0=scStackedListRowCss,ScStackedListRow=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.href=void 0,this.target="_self",this.mobileSize=600,this.width=void 0,this.hasPrefix=!1,this.hasSuffix=!1}componentDidLoad(){"ResizeObserver"in window&&new window.ResizeObserver((t=>{t.forEach((t=>{this.width=t.contentRect.width}))})).observe(this.el)}handleSlotChange(){this.hasPrefix=!!Array.from(this.el.children).some((t=>"prefix"===t.slot)),this.hasSuffix=!!Array.from(this.el.children).some((t=>"suffix"===t.slot))}render(){const t=this.href?"a":"div";return h(t,{key:"36b3942fe6fe111e4e5676ceb438de6b870b70d6",href:this.href,target:this.target,part:"base",class:{"list-row":!0,"list-row--has-prefix":this.hasPrefix,"list-row--has-suffix":this.hasSuffix,"breakpoint-lg":this.width>=this.mobileSize,"list-row--is-rtl":isRtl()}},h("span",{key:"02c1e7661da40dff022f1b0fbd08d5c95ab8e9aa",class:"list-row__prefix"},h("slot",{key:"33dacca64320faec5cc53f4cc3daa14473accf55",name:"prefix",onSlotchange:()=>this.handleSlotChange()})),h("slot",{key:"7b6f270d842a5ffd1b5c14aaf1701d06479ee81d",onSlotchange:()=>this.handleSlotChange()}),h("span",{key:"6aef5e7e15ababfaada19cbdfa05f24bd1e7fbd7",class:"list-row__suffix"},h("slot",{key:"617dd44d4e340f1dc1b6254fb621c4dc91e65e6a",name:"suffix",onSlotchange:()=>this.handleSlotChange()})))}get el(){return this}static get style(){return ScStackedListRowStyle0}},[1,"sc-stacked-list-row",{href:[1],target:[1],mobileSize:[2,"mobile-size"],width:[32],hasPrefix:[32],hasSuffix:[32]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-stacked-list-row"].forEach((t=>{"sc-stacked-list-row"===t&&(customElements.get(t)||customElements.define(t,ScStackedListRow))}))}export{ScStackedListRow as S,defineCustomElement as d};