/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import{css as r}from"./NavigationToggle/css.js";import a from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{messageBundle as p,tsx as c}from"./support/widget.js";import{setFocus as d}from"./support/widgetUtils.js";let u=class extends l{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new a({suppressDeprecationWarning:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;d(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","arcgis-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return c("div",{class:this.classes(r.base,g.widget,{[r.isLayoutHorizontal]:"horizontal"===this.layout})},c("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),c("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),p("esri/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:a})],u.prototype,"viewModel",void 0),u=t([s("esri.widgets.NavigationToggle")],u);const v=u;export{v as default};
