/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import b from"./7JC52SFZ.js";import a from"./4AFANEZZ.js";import{c as y}from"./C5KDPY7R.js";import"./YM4U4HSN.js";import{a as m}from"./ONARC6AZ.js";import{b as h}from"./HVT2WBVC.js";import"./ISFTCFSJ.js";import{E as r,F as o,G as p,I as i,h as d,i as t}from"./FFF5HUPM.js";import"./EXBEKVP5.js";export default $arcgis.t(([,{b:c}])=>{var f=d`:host{display:block}:host .esri-legend__layer-table,:host .instant-apps-interactive-legend__nested-unique-symbol{margin:0}:host .hide{display:none}`,e={layerTableSizeRamp:"esri-legend__layer-table--size-ramp",layerChildTable:"esri-legend__layer-child-table",layerTable:"esri-legend__layer-table",nestedUniqueSymbol:"instant-apps-interactive-legend__nested-unique-symbol",nonInteractive:"instant-apps-interactive-legend__non-interactive"},n=class extends p{constructor(){super(),this.legendLayerCaption=r(),this.expanded=!0,this.titleText="",this.listenOn(window,"legendLayerExpandUpdated",this.legendLayerExpandUpdatedEmitted)}static{this.properties={expanded:16,activeLayerInfo:0,isSizeRamp:5,isChild:5,isColorRamp:5,isRelationshipRamp:5,isInteractive:5,zoomTo:5,legendElement:0,titleText:1,legendvm:0,legendElementIndex:9}}static{this.styles=f}legendLayerExpandUpdatedEmitted(){this.legendLayerCaption.value&&(this.expanded=this.legendLayerCaption.value.expanded)}render(){let g=this.isChild?e.layerChildTable:e.layerTable,a=this.legendElement?.infos?.length===1&&!this.activeLayerInfo?.layer?.renderer?.field,v=(this.isSizeRamp||!this.isChild)&&!this.isColorRamp?` ${e.layerTableSizeRamp}`:"",$=this.isInteractive?"":` ${e.nonInteractive}`,x=y(this.activeLayerInfo)?` ${e.nestedUniqueSymbol}`:"",s=a&&!this.expanded&&!this.zoomTo?!0:this.expanded;if(this.isRelationshipRamp){let l=c.get("relationshipRampExpandStates")[this.activeLayerInfo.layer.id];s=l===void 0?!0:l}return t`<div class=${`${g}${v}${$}${x}`}><div .id=${`${this.activeLayerInfo?.layer?.id}-legend-element-caption`} class=${i(this.isRelationshipRamp||!this.titleText&&!this.zoomTo&&a?"hide":"show")}><instant-apps-interactive-legend-legend-element-caption .legendvm=${this.legendvm} .activeLayerInfo=${this.activeLayerInfo} .layer=${this.activeLayerInfo.layer} .titleText=${this.titleText} .legendElement=${this.legendElement} .legendElementIndex=${this.legendElementIndex} .zoomTo=${this.zoomTo} .isInteractive=${this.isInteractive} ${o(this.legendLayerCaption)}></instant-apps-interactive-legend-legend-element-caption></div>${m("content",t`<div .id=${`${this.activeLayerInfo?.layer?.id}-legend-element-content-${this.legendElementIndex}`} class=${i(s?"show":"hide")}><slot name=content></slot></div>`)}</div>`}};h("instant-apps-interactive-legend-legend-element",n);return n},a,b)