/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{a as p}from"./P5EZZH6S.js";import b from"./7PXQ5F5K.js";import{g as c}from"./EH5576ZY.js";import"./7QZVR2UR.js";import a from"./KTDXN3YM.js";import"./ZNBKMZP7.js";import{O as l,R as r,U as h,b as e,p as o,x as n}from"./GRFF5Y4R.js";import"./ALDX5YZO.js";export default $arcgis.t(([{when:y},,{a:m}])=>{var a=t=>t==="hidden"?"hide-link-chart-nonspatial-data":"show-link-chart-nonspatial-data",s=class extends l{constructor(){super(...arguments),this.messages=p(),this._state="disabled",this.view=d.useView(this),this.autoDestroyDisabled=!1,this.icon=a(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible"),this.visualScale="m",this.arcgisPropertyChange=c()("state"),this.arcgisReady=n()}static{this.properties={_state:16,view:0,autoDestroyDisabled:5,icon:1,label:1,messageOverrides:0,referenceElement:1,state:32,visualScale:1}}get state(){return this._state}async destroy(){await this.manager.destroy()}async switchNonspatialVisibility(i){this.view&&(d.changeNonspatialDataDisplay(this.view,i),this.icon=a(i))}loaded(){this.manager.onLifecycle(()=>[y(()=>this.view?.ready?"ready":"disabled",i=>{this._state=i,this.icon=a(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible")},{sync:!0,initial:!0})])}_handleToggle(){let i=(this.view?.map?.linkChartProperties?.nonspatialDataDisplay?.mode??"visible")==="hidden"?"visible":"hidden";this.switchNonspatialVisibility(i)}render(){let{messages:i}=this;return this.state==="ready"&&this.view?.map&&this.view?.map.mapType!=="webLinkChart"&&o("error",this,"The <arcgis-link-chart-nonspatial-visibility-toggle> component must be used with an <arcgis-link-chart> component to provide the view"),e`<calcite-action class="root" .scale=${this.visualScale} .icon=${this.icon} @click=${this._handleToggle} @keyup=${g=>{g.key==="Enter"&&this._handleToggle()}} .disabled=${this.view?.map?.mapType!=="webLinkChart"} .text=${i.toggleLabel} title=${i.toggleLabel??r} data-testid=link-chart-nonspatial-visibility-toggle-action></calcite-action>`}},d={changeNonspatialDataDisplay:(t,i)=>{t.map.changeNonspatialDataDisplay(i)},useView:t=>m(t)};h("arcgis-link-chart-nonspatial-visibility-toggle",s);return{ArcgisLinkChartNonspatialVisibilityToggle:s,exportsForTests:d}},"core/reactiveUtils",a,b)