/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.21/esri/copyright.txt for details.
*/
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Handles.js";import s from"../../core/Logger.js";import{isSome as i}from"../../core/maybe.js";import{measurementLengthUnits as r}from"../../core/unitUtils.js";import{init as o}from"../../core/watchUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as l}from"../../properties/defaultUnit.js";import d,{isSupported as p}from"./DistanceMeasurement2DTool.js";import{InteractiveToolViewModel as u}from"../support/InteractiveToolViewModel.js";const h={handleWidth:8,handleColor:[255,128,0,.5],pathWidth:5,pathPrimaryColor:[255,128,0,255],pathSecondaryColor:[255,255,255,255]},c=s.getLogger("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DViewModel");let m=class extends u{constructor(t){super(t),this.logger=c,this.supportedViewType="2d",this.unsupportedErrorMessage="DistanceMeasurement2DViewModel is only supported in 2D views.",this._handles=new e,this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null,this.palette=h}initialize(){this._handles.add([o(this,["unit","palette","geodesicDistanceThreshold"],((t,e,s)=>{this.tool&&(this.tool[s]=t)}))])}destroy(){this._handles&&(this._handles.destroy(),this._handles=null)}get state(){var t;return this.disabled||!p(null==(t=this.view)?void 0:t.spatialReference)?"disabled":i(this.tool)&&this.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(t){void 0!==t?this._override("unit",this._validateUnit(t)):this._clearOverride("unit")}get unitOptions(){return r}set unitOptions(t){void 0!==t?this._override("unitOptions",this._validateUnits(t)):this._clearOverride("unitOptions")}start(){return this.createTool()}clear(){this.removeTool()}createToolParams(){return{toolConstructor:d,constructorArguments:()=>({geodesicDistanceThreshold:this.geodesicDistanceThreshold,palette:this.palette,unit:this.unit})}}_validateUnit(t){return-1!==this.unitOptions.indexOf(t)?t:-1!==this.unitOptions.indexOf(this.defaultUnit)?this.defaultUnit:this.unitOptions[0]}_validateUnits(t=[]){const e=t.filter((t=>-1!==r.indexOf(t)));return 0===e.length?r.slice():e}};t([n(l)],m.prototype,"defaultUnit",void 0),t([n({type:Number})],m.prototype,"geodesicDistanceThreshold",void 0),t([n({readOnly:!0,aliasOf:"tool.measurement"})],m.prototype,"measurement",void 0),t([n({readOnly:!0,aliasOf:"tool.measurementLabel"})],m.prototype,"measurementLabel",void 0),t([n()],m.prototype,"palette",void 0),t([n({readOnly:!0})],m.prototype,"state",null),t([n({type:String})],m.prototype,"unit",null),t([n({type:[String]})],m.prototype,"unitOptions",null),m=t([a("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DViewModel")],m);var f=m;export{f as default};
I expected that unminify handles the dojo import and export functions to give a readable output.
However I got the error Unexpected token "import"'
Given the following minifide code
I expected that unminify handles the dojo import and export functions to give a readable output.
However I got the error Unexpected token "import"'