/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Widget.js";import i from"./Compass/CompassViewModel.js";import{css as r}from"./Compass/css.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as l}from"./support/globalCss.js";import{messageBundle as a,tsx as d}from"./support/widget.js";let p=class extends s{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new i,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=e=>({transform:`rotateZ(${e.z}deg)`})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"rotation"===this.viewModel.state?"arrow-up":"compass-needle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,{messages:o}=this;return d("div",{class:this.classes(r.base,l.widget)},d("calcite-button",{class:l.widgetButton,disabled:"disabled"===t,kind:"neutral",label:o.reset,onclick:this._reset,round:!0,scale:"s",title:o.reset},d("div",{"aria-hidden":"true",class:r.iconContainer,title:o.reset},d("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(e)}))))}};e([t()],p.prototype,"goToOverride",null),e([t()],p.prototype,"icon",null),e([t()],p.prototype,"label",null),e([t(),a("esri/widgets/Compass/t9n/Compass")],p.prototype,"messages",void 0),e([t()],p.prototype,"view",null),e([t({type:i})],p.prototype,"viewModel",void 0),p=e([o("esri.widgets.Compass")],p);const c=p;export{c as default};
