/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
import{a as f}from"./VK24LKXI.js";import{a as b}from"./LL7T22QC.js";import a from"./DTE4O2DP.js";import{e as y}from"./LYMDZ73M.js";import"./MG6XDMQJ.js";import"./HITJFSBP.js";import{B as d,E as g,P as h,Q as m,S as e,U as v,j as l,k as p}from"./3VKC6PRK.js";export default $geoscene.t(([{when:M},{a:u}])=>{var _="geoscene-navigation-toggle",w={base:_},x=l`@layer{.geoscene-navigation-toggle{display:flex;box-shadow:0 1px 2px #0000004d;inline-size:fit-content;block-size:fit-content}}`,s={pan:"move",rotate:"rotate"},o=class extends h{constructor(){super(...arguments),this.view=u(this),this._messages=f(),this._state="disabled",this.icon=s.pan,this.layout="vertical",this.navigationMode="pan",this.position="top-left",this.geoscenePropertyChange=y()("layout","state"),this.geosceneReady=d()}static{this.properties={_state:16,icon:1,label:1,layout:3,messageOverrides:0,navigationMode:3,position:1,referenceElement:1,state:35}}static{this.shadowRootOptions=g}static{this.styles=x}get state(){return this._state}async toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}load(){this.manager.onLifecycle(()=>[M(()=>this.view?.navigation?.actionMap,()=>this._updateNavigationActionMap()),M(()=>{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:$}=this,n=t.pan??"",c=t.rotate??"",i=$==="disabled",r=a==="pan";return p`<calcite-action-bar class=${m({[w.base]:!0,[b.disabled]:i})} expand-disabled .layout=${this.layout} scale=s><calcite-action .active=${r} appearance=solid .disabled=${i} .icon=${s.pan} @click=${this._onPanClick} scale=s .text=${n} title=${n??e}></calcite-action><calcite-action .active=${!r} appearance=solid .disabled=${i} .icon=${s.rotate} @click=${this._onRotateClick} scale=s .text=${c} title=${c??e}></calcite-action></calcite-action-bar>`}};v("geoscene-navigation-toggle",o);return o},"core/reactiveUtils",a)