/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import{I as l,J as h,M as o,P as g,a as c,b as a,s as r}from"./RNRMSLW5.js";import"./G6QKOIC3.js";var p=c`calcite-popover[calcite-hydrated-hidden]{inset-block-start:-999999px;inset-inline-start:-999999px}.popover-content{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);padding:var(--esri-widget-padding);min-width:180px}.uniform-chart-scaling-label{--calcite-label-margin-bottom: 0}`,s=class extends h{constructor(){super(...arguments),this._onUniformChartScalingChange=e=>{this.arcgisElevationProfileSettingsUniformChartScalingChange.emit(e.currentTarget.checked)},this._onActionRef=e=>{this._actionElement=e??void 0},this._popoverIsOpen=!1,this.hideUniformChartScalingToggle=!1,this.hideUnitSelector=!1,this.arcgisElevationProfileSettingsUniformChartScalingChange=r()}static{this.properties={_popoverIsOpen:16,_actionElement:16,analysis:0,hideUniformChartScalingToggle:5,hideUnitSelector:5,messages:0,uniformChartScaling:5,unitOptionsDistance:0,unitOptionsElevation:0}}static{this.styles=p}async destroy(){await this.manager.destroy()}_onPopoverClose(){this._popoverIsOpen=!1}_onPopoverOpen(){this._popoverIsOpen=!0}render(){let{messages:e}=this;if(!e||this.hideUnitSelector&&this.hideUniformChartScalingToggle)return;let t=(this._popoverIsOpen?e.hideSettings:e.showSettings)??"";return a`<calcite-action appearance=transparent data-testid=settings-button icon=gear scale=s .text=${t} title=${t??o} ${l(this._onActionRef)}></calcite-action>${this._actionElement?a`<calcite-popover auto-close .label=${t} placement=bottom-end .referenceElement=${this._actionElement} @calcitePopoverOpen=${this._onPopoverOpen} @calcitePopoverClose=${this._onPopoverClose}><div class="popover-content">${this._renderUnitSelector()}${this._renderUniformChartScalingToggle()}</div></calcite-popover>`:void 0}`}_renderUnitSelector(){let{messages:e,hideUnitSelector:t}=this;if(t)return;let i=this.analysis.displayUnits;return a`<arcgis-unit-select .options=${this.unitOptionsDistance} .selectLabel=${e.unitDistanceSelectLabel} .value=${i.distance??void 0} @arcgisUnitSelectChange=${n=>{i.distance=n.detail}}></arcgis-unit-select><arcgis-unit-select .options=${this.unitOptionsElevation} .selectLabel=${e.unitElevationSelectLabel} .value=${i.elevation??void 0} @arcgisUnitSelectChange=${n=>{i.elevation=n.detail}}></arcgis-unit-select>`}_renderUniformChartScalingToggle(){let{messages:e,hideUniformChartScalingToggle:t,uniformChartScaling:i}=this;if(t)return;let n=e?.[i?"uniformChartScalingDisable":"uniformChartScalingEnable"]??"";return a`<calcite-label class="uniform-chart-scaling-label" layout=inline><calcite-checkbox .checked=${i} class="uniform-chart-scaling-checkbox" title=${n??o} @calciteCheckboxChange=${this._onUniformChartScalingChange}></calcite-checkbox>${e?.uniformChartScalingLabel}</calcite-label>`}};g("arcgis-elevation-profile-settings",s);export{s as ArcgisElevationProfileSettings};
