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:"8c9c116e0f0ea929bad1080bf2a5d4e663d947e8",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:"c16c3bac56ff8164d85aa231564803467ed87c07",class:"list-row__prefix"},h("slot",{key:"78babb939b03d45adadb4bb202935ac1f41f0e82",name:"prefix",onSlotchange:()=>this.handleSlotChange()})),h("slot",{key:"9e1531a4bb8b5359ce6619df163a643e455e59e3",onSlotchange:()=>this.handleSlotChange()}),h("span",{key:"9368fc7b2dabad0a04fc61c6538bb49f6b142344",class:"list-row__suffix"},h("slot",{key:"11ea3e46fe3cb4192cf4a0ef2fab43c030df9fb2",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"}}