import{h}from"@stencil/core";import{isRtl}from"../../../functions/page-align";export class ScStackedListRow{constructor(){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((e=>{e.forEach((e=>{this.width=e.contentRect.width}))})).observe(this.el)}handleSlotChange(){this.hasPrefix=!!Array.from(this.el.children).some((e=>"prefix"===e.slot)),this.hasSuffix=!!Array.from(this.el.children).some((e=>"suffix"===e.slot))}render(){const e=this.href?"a":"div";return h(e,{key:"e5672c255546369dac09ce5ca7acbf8a1fd981b7",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:"448664893b37ead09b9767877d66a264275d2524",class:"list-row__prefix"},h("slot",{key:"c55119e138a3fe27dc1834ee074f2b10fbf4fa42",name:"prefix",onSlotchange:()=>this.handleSlotChange()})),h("slot",{key:"8b2607215a58c6c1a25ef382a55e5579244d711e",onSlotchange:()=>this.handleSlotChange()}),h("span",{key:"c807925824d64fb644bacd722c1257b3ee34662a",class:"list-row__suffix"},h("slot",{key:"22fb3554975d5127114c024213409a9042ea486b",name:"suffix",onSlotchange:()=>this.handleSlotChange()})))}static get is(){return"sc-stacked-list-row"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-stacked-list-row.scss"]}}static get styleUrls(){return{$:["sc-stacked-list-row.css"]}}static get properties(){return{href:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"href",reflect:!1},target:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"target",reflect:!1,defaultValue:"'_self'"},mobileSize:{type:"number",mutable:!1,complexType:{original:"number",resolved:"number",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"mobile-size",reflect:!1,defaultValue:"600"}}}static get states(){return{width:{},hasPrefix:{},hasSuffix:{}}}static get elementRef(){return"el"}}