/*! 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{a as b}from"./B7UYEEQJ.js";import{a as y}from"./2Z6ISORA.js";import a from"./K2TY4WFO.js";import{g as u}from"./SRDD32D4.js";import"./EPSDPGVP.js";import"./IMJMO6DB.js";import{J as p,K as h,M as e,P as v,a as l,b as g,s as d}from"./RNRMSLW5.js";import"./G6QKOIC3.js";export default $arcgis.t(([{when:f},{a:m}])=>{var $="arcgis-navigation-toggle",x={base:$,button:"arcgis-button"},_=l`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}calcite-button{width:var(--calcite-spacing-xxxl);height:var(--calcite-spacing-xxxl)}}:host{display:flex;inline-size:fit-content;block-size:fit-content}`,o={pan:"move",rotate:"rotate"},s=class extends p{constructor(){super(...arguments),this._messages=b(),this._state="disabled",this.autoDestroyDisabled=!1,this.view=m(this),this.icon=o.pan,this.layout="vertical",this.navigationMode="pan",this.arcgisPropertyChange=u()("layout","state"),this.arcgisReady=d()}static{this.properties={_state:16,autoDestroyDisabled:5,view:0,icon:1,label:1,layout:3,messageOverrides:0,navigationMode:3,position:1,referenceElement:1,state:35}}static{this.styles=_}get state(){return this._state}async destroy(){await this.manager.destroy()}async toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}load(){this.manager.onLifecycle(()=>[f(()=>this.view?.navigation?.actionMap,()=>this._updateNavigationActionMap()),f(()=>{let{view:t}=this;return t?.ready&&t?.type==="3d"?"ready":"disabled"},t=>{this._state=t},{sync:!0,initial:!0})])}willUpdate(t){t.has("navigationMode")&&this._updateNavigationActionMap()}_onPanClick(){this.navigationMode="pan"}_onRotateClick(){this.navigationMode="rotate"}_updateNavigationActionMap(){let t=this.view?.navigation?.actionMap;if(!t)return;let a=this.navigationMode==="pan";t.dragPrimary=a?"pan":"rotate",t.dragSecondary=a?"rotate":"pan"}render(){let{_messages:t,navigationMode:a,state:M}=this,n=t.pan??"",c=t.rotate??"",i=M==="disabled",r=a==="pan";return g`<calcite-action-bar class=${h({[x.base]:!0,[x.button]:!0,[y.disabled]:i})} expand-disabled .layout=${this.layout} scale=s><calcite-action .active=${r} appearance=solid .disabled=${i} .icon=${o.pan} @click=${this._onPanClick} scale=s .text=${n} title=${n??e}></calcite-action><calcite-action .active=${!r} appearance=solid .disabled=${i} .icon=${o.rotate} @click=${this._onRotateClick} scale=s .text=${c} title=${c??e}></calcite-action></calcite-action-bar>`}};v("arcgis-navigation-toggle",s);return s},"core/reactiveUtils",a)