@arcgis/core 5.2.0-next.140 → 5.2.0-next.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +1 -0
  3. package/assets/esri/core/workers/chunks/{5e90c1b49f2b7e21d05a.js → 55766692b578e60dd70e.js} +22 -22
  4. package/chunks/RibbonLine.glsl.js +9 -11
  5. package/config.js +1 -1
  6. package/kernel.js +1 -1
  7. package/layers/ParquetLayer.d.ts +7 -1
  8. package/layers/ParquetLayer.js +1 -1
  9. package/package.json +2 -2
  10. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  11. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +2 -0
  12. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  13. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  14. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +2 -0
  15. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
  16. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  17. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  18. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  19. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  20. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  21. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  22. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  23. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  24. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  25. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  26. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  27. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  28. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +3 -3
  29. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -9
  30. package/views/draw/support/PluginContext.js +1 -1
  31. package/views/draw/support/managers/TooltipManager.js +1 -1
  32. package/views/interactive/snapping/SnappingVisualizer.js +1 -1
  33. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  34. package/widgets/BatchAttributeForm.js +1 -1
  35. package/widgets/Directions.js +1 -1
  36. package/assets/esri/core/workers/chunks/1f3148cebee1961249a4.js +0 -1
@@ -336,9 +336,10 @@ float stippleDistanceToScreenRatio = computeWorldToScreenRatio(segmentCenter);`)
336
336
  float startPseudoScreen = u0 * discreteStippleDistanceToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):M.main.add(S`float startPseudoScreen = segmentStartRender * discreteStippleDistanceToScreenRatio;
337
337
  float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceToScreenRatio;`),M.uniforms.add(new x(`stipplePatternPixelSize`,e=>i(e))),M.main.add(S`
338
338
  float patternLength = patternLineSize * stipplePatternPixelSize;
339
+ vec2 stippleDistanceLimits;
339
340
 
340
341
  ${C(G,S`
341
- vStippleDistanceLimits = vec2(segmentStartRender, segmentStartRender + segmentLengthRender);
342
+ stippleDistanceLimits = vec2(segmentStartRender, segmentStartRender + segmentLengthRender);
342
343
  vStipplePatternStretch = 1.0;
343
344
 
344
345
  ${C(K,S`
@@ -349,10 +350,10 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
349
350
  `,S`
350
351
  // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the
351
352
  // fragment shader
352
- vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
353
+ stippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
353
354
  `)}
354
355
 
355
- vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
356
+ vStippleDistance = mix(stippleDistanceLimits.x, stippleDistanceLimits.y, isEndVertex);
356
357
 
357
358
  // Adjust the coordinate to the displaced position (the pattern is shortened/overextended on the in/outside of
358
359
  // joins)
@@ -363,28 +364,25 @@ float segmentLengthPseudoScreen = segmentLengthRender * discreteStippleDistanceT
363
364
  float stippleDisplacementFactor = dot(segment.xy, stippleDisplacement.xy) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
364
365
 
365
366
  // Apply this offset to the actual vertex coordinate (can be screen or pseudo-screen space)
366
- vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
367
+ vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (stippleDistanceLimits.y - stippleDistanceLimits.x);
367
368
  }
368
369
 
369
370
  ${C(Z,S`
370
371
  float segmentStartInverseW = 1.0 / mix(pos.w, prev.w, isEndVertex);
371
372
  float segmentEndInverseW = 1.0 / mix(next.w, pos.w, isEndVertex);
372
373
  vStipplePerspective = noPerspectiveWrite(
373
- vec4(vStippleDistanceLimits, segmentStartInverseW, segmentEndInverseW),
374
+ vec4(stippleDistanceLimits, segmentStartInverseW, segmentEndInverseW),
374
375
  pos.w
375
376
  );
376
377
  `)}
377
378
 
378
379
  // Cancel out perspective-correct interpolation for screen-space stipple distances.
379
- vStippleDistanceLimits = noPerspectiveWrite(vStippleDistanceLimits, pos.w);
380
+ vStippleLimitsAndCaps.xy = noPerspectiveWrite(stippleDistanceLimits, pos.w);
380
381
  vStippleDistance = noPerspectiveWrite(vStippleDistance, pos.w);
381
382
 
382
383
  // Disable stipple distance limits on caps
383
- vStippleDistanceLimits = isJoin ?
384
- vStippleDistanceLimits :
385
- isStartVertex ?
386
- vec2(-1e34, vStippleDistanceLimits.y) :
387
- vec2(vStippleDistanceLimits.x, 1e34);
384
+ vStippleLimitsAndCaps.zw = isJoin ? vec2(0.0) :
385
+ isStartVertex ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
388
386
  `)),M.main.add(S`
389
387
  // Convert back into NDC
390
388
  pos.xy = (pos.xy / viewport.zw) * pos.w;
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.139/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.140/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.139`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}has(`host-webworker`)||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has(`host-webworker`);export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import has from"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.140`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}has(`host-webworker`)||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has(`host-webworker`);export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -46,7 +46,7 @@ import type { ParquetFilesDataProperties } from "./support/ParquetFilesData.js";
46
46
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
47
47
  import type { LayerProperties } from "./Layer.js";
48
48
 
49
- export interface ParquetLayerProperties extends LayerProperties, CustomParametersMixinProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, DataSeriesLayerProperties, OrderedLayerProperties, BlendLayerProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, Partial<Pick<ParquetLayer, "copyright" | "definitionExpression" | "geometryType" | "labelsVisible" | "legendEnabled" | "outFields" | "popupEnabled">> {
49
+ export interface ParquetLayerProperties extends LayerProperties, CustomParametersMixinProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, DataSeriesLayerProperties, OrderedLayerProperties, BlendLayerProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, Partial<Pick<ParquetLayer, "charts" | "copyright" | "definitionExpression" | "geometryType" | "labelsVisible" | "legendEnabled" | "outFields" | "popupEnabled">> {
50
50
  /**
51
51
  * The data source for the ParquetLayer. Set this property to [parquet files](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/)
52
52
  * or a [portal item](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetPortalItemData/) to define which Parquet content the layer loads.
@@ -332,6 +332,12 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
332
332
  constructor(properties?: ParquetLayerProperties);
333
333
  /** Describes the layer's supported capabilities. */
334
334
  get capabilities(): FeatureLayerCapabilities | null | undefined;
335
+ /**
336
+ * Array of Chart Items of type WebMapWebChart available on the parquet layer.
337
+ *
338
+ * @since 5.2
339
+ */
340
+ accessor charts: object[] | null | undefined;
335
341
  /** Copyright information for the layer. */
336
342
  accessor copyright: string | null | undefined;
337
343
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import a from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{getFilename as u}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import g from"../graphic/ParquetGraphicOrigin.js";import _ from"./Layer.js";import{ParquetSource as v}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{FeatureEffectLayer as S}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as C}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{OrderedLayer as T}from"./mixins/OrderedLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as D}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as O,legendEnabled as k,popupEnabled as A}from"./support/commonProperties.js";import j from"./support/FeatureTemplate.js";import M from"./support/Field.js";import{defineFieldProperties as N}from"./support/fieldProperties.js";import{fixRendererFields as P}from"./support/fieldUtils.js";import F from"./support/GeometryEncodingLocation.js";import I from"./support/GeometryEncodingWkb.js";import L from"./support/LabelClass.js";import{reader as R}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import B from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as V}from"./support/parquetUtils.js";import{rendererTypes as H}from"../renderers/support/typeUtils.js";import U from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{utc as G}from"../time/constants.js";const K=N(),q=`__OBJECTID`,J={types:{key:`type`,base:null,typeMap:{wkb:I,location:F}},json:{name:`layerDefinition.geometryEncoding`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryEncoding`}}}}};let Y=class extends C(S(y(T(x(D(E(w(s(b(n(_))))))))))){constructor(e){super(e),this._emptyUrls=new r,this.copyright=null,this.definitionExpression=null,this.returnM=void 0,this.returnZ=void 0,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new g(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=q,this.operationalLayerType=`ParquetLayer`,this.outFields=null,this.persistenceEnabled=!!has(`parquetlayer-persistence-enabled`),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.type=`parquet`,this.data=null}initialize(){this.addHandles(l(()=>this.source,`source-changed`,()=>{this.emit(`refresh`,{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get dateFieldsTimeZone(){return G}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,n,r){let i=e.filter(e=>e.name!==q||e.type!==`oid`).map(e=>e.toJSON(r));c(n,i,t)}get isTable(){return this.geometryEncoding==null&&this.displayOptimization==null}set renderer(e){P(e,this.fieldsIndex),this._set(`renderer`,e)}get title(){let e=this._get(`title`);if(e&&this.originOf(`title`)!==`defaults`)return e;switch(this.data?.type){case`files`:{let t=this.data.urls?.at(0);e=t?u(t,[`parquet`]):null;break}case`portal-item`:e=this.data.portalItem?.title}return e||`Parquet`}set title(e){this._set(`title`,e)}writeData(e,t,n,r){if(!e)return;if(e.type===`portal-item`&&e.portalItem?.type!==`Parquet Feature Layer`){r.messages?.push(new a(`parquet-layer:unsupported-data`,`Portal item with type '${e.portalItem?.type}' is not supported in web maps`,{layer:this,itemId:e.portalItem?.id}));return}let i=e.write({},r);i&&(t.source=i)}get urls(){return this.data?.type===`files`?this.data.urls:this._emptyUrls}set urls(e){i(o.getLogger(this),`urls`,{replacement:`data`,version:`5.1`,warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return W(this,e)}createQuery(){let e=new U;return e.returnGeometry=!0,e.outFields=[`*`],e.where=this.definitionExpression||`1=1`,e}async createSource(e){let t=new v({layer:this});return await t.load(e),t}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();let n=await this.source.queryFeatures(this._normalizeQuery(e),t),r=this.graphicOrigin;if(n?.features)for(let e of n.features)e.layer=e.sourceLayer=this,e.origin=r;return n}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}async hasDataChanged(){if(this.data?.type===`portal-item`){let e=this.data.portalItem,t=e.modified?.getTime();if(await e.reload(),t===e.modified?.getTime())return!1}return await this.source.reload(null),!0}_normalizeQuery(e){return U.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new r(e):e??new r}async _load(e){this.data?.type===`portal-item`&&await this.data.portalItem.load();let t=await this.createSource(e);this._set(`source`,t),this.read(t.sourceJSON,{origin:`service`}),[`fields`].forEach(e=>this.revertToOrigin(e,`service`)),P(this.renderer,this.fieldsIndex),this.spatialReference??=h.WGS84}};e([d({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,`capabilities`,null),e([d({type:String})],Y.prototype,`copyright`,void 0),e([d({readOnly:!0})],Y.prototype,`dateFieldsTimeZone`,null),e([d({readOnly:!0})],Y.prototype,`defaultPopupTemplate`,null),e([d({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Y.prototype,`definitionExpression`,void 0),e([d({type:Boolean})],Y.prototype,`returnM`,void 0),e([d({type:Boolean})],Y.prototype,`returnZ`,void 0),e([d()],Y.prototype,`displayOptimization`,void 0),e([d({type:[M],json:{name:`layerDefinition.fields`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:`fields`}}}})],Y.prototype,`fields`,void 0),e([p(`fields`)],Y.prototype,`writeFields`,null),e([d(K.fieldsIndex)],Y.prototype,`fieldsIndex`,void 0),e([d(J)],Y.prototype,`geometryEncoding`,void 0),e([d({type:m,json:{name:`extent`}})],Y.prototype,`fullExtent`,void 0),e([d({type:V.apiValues,json:{name:`layerDefinition.geometryType`,read:{reader:V.read},write:{writer:V.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryType`,reader:V.read}}}}})],Y.prototype,`geometryType`,void 0),e([d({readOnly:!0,clonable:!1})],Y.prototype,`graphicOrigin`,void 0),e([d(O)],Y.prototype,`labelsVisible`,void 0),e([d({type:[L],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:R},write:!0}})],Y.prototype,`labelingInfo`,void 0),e([d(k)],Y.prototype,`legendEnabled`,void 0),e([d()],Y.prototype,`file`,void 0),e([d({type:String,readOnly:!0})],Y.prototype,`objectIdField`,void 0),e([d({type:[`ParquetLayer`]})],Y.prototype,`operationalLayerType`,void 0),e([d(K.outFields)],Y.prototype,`outFields`,void 0),e([d(A)],Y.prototype,`popupEnabled`,void 0),e([d({type:t,json:{name:`popupInfo`,write:!0}})],Y.prototype,`popupTemplate`,void 0),e([d({types:H,json:{name:`layerDefinition.drawingInfo.renderer`,write:!0,origins:{service:{read:{source:`drawingInfo.renderer`}}}}})],Y.prototype,`renderer`,null),e([d({type:v,readOnly:!0,cast:null,json:{read:!1}})],Y.prototype,`source`,void 0),e([d({type:h,json:{name:`layerDefinition.spatialReference`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`extent.spatialReference`}}}}})],Y.prototype,`spatialReference`,void 0),e([d({type:[j]})],Y.prototype,`templates`,void 0),e([d()],Y.prototype,`title`,null),e([d({json:{read:!1},readOnly:!0})],Y.prototype,`type`,void 0),e([d({types:{key:`type`,base:null,typeMap:{files:z,"portal-item":B}},json:{name:`source`,origins:{"web-map":{write:{target:`source`,ignoreOrigin:!0}}}}})],Y.prototype,`data`,void 0),e([p(`web-map`,`data`)],Y.prototype,`writeData`,null),e([d({type:r.ofType(String),json:{read:!1,write:!1}})],Y.prototype,`urls`,null),Y=e([f(`esri.layers.ParquetLayer`)],Y);export{Y as default};
2
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import a from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{getFilename as u}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import g from"../graphic/ParquetGraphicOrigin.js";import _ from"./Layer.js";import{ParquetSource as v}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{FeatureEffectLayer as S}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as C}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{OrderedLayer as T}from"./mixins/OrderedLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as D}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as O,legendEnabled as k,popupEnabled as A}from"./support/commonProperties.js";import j from"./support/FeatureTemplate.js";import M from"./support/Field.js";import{defineFieldProperties as N}from"./support/fieldProperties.js";import{fixRendererFields as P}from"./support/fieldUtils.js";import F from"./support/GeometryEncodingLocation.js";import I from"./support/GeometryEncodingWkb.js";import L from"./support/LabelClass.js";import{reader as R}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import B from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as V}from"./support/parquetUtils.js";import{rendererTypes as H}from"../renderers/support/typeUtils.js";import U from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{utc as G}from"../time/constants.js";const K=N(),q=`__OBJECTID`,J={types:{key:`type`,base:null,typeMap:{wkb:I,location:F}},json:{name:`layerDefinition.geometryEncoding`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryEncoding`}}}}};let Y=class extends C(S(y(T(x(D(E(w(s(b(n(_))))))))))){constructor(e){super(e),this._emptyUrls=new r,this.charts=null,this.copyright=null,this.definitionExpression=null,this.returnM=void 0,this.returnZ=void 0,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new g(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=q,this.operationalLayerType=`ParquetLayer`,this.outFields=null,this.persistenceEnabled=!!has(`parquetlayer-persistence-enabled`),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.type=`parquet`,this.data=null}initialize(){this.addHandles(l(()=>this.source,`source-changed`,()=>{this.emit(`refresh`,{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get dateFieldsTimeZone(){return G}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,n,r){let i=e.filter(e=>e.name!==q||e.type!==`oid`).map(e=>e.toJSON(r));c(n,i,t)}get isTable(){return this.geometryEncoding==null&&this.displayOptimization==null}set renderer(e){P(e,this.fieldsIndex),this._set(`renderer`,e)}get title(){let e=this._get(`title`);if(e&&this.originOf(`title`)!==`defaults`)return e;switch(this.data?.type){case`files`:{let t=this.data.urls?.at(0);e=t?u(t,[`parquet`]):null;break}case`portal-item`:e=this.data.portalItem?.title}return e||`Parquet`}set title(e){this._set(`title`,e)}writeData(e,t,n,r){if(!e)return;if(e.type===`portal-item`&&e.portalItem?.type!==`Parquet Feature Layer`){r.messages?.push(new a(`parquet-layer:unsupported-data`,`Portal item with type '${e.portalItem?.type}' is not supported in web maps`,{layer:this,itemId:e.portalItem?.id}));return}let i=e.write({},r);i&&(t.source=i)}get urls(){return this.data?.type===`files`?this.data.urls:this._emptyUrls}set urls(e){i(o.getLogger(this),`urls`,{replacement:`data`,version:`5.1`,warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return W(this,e)}createQuery(){let e=new U;return e.returnGeometry=!0,e.outFields=[`*`],e.where=this.definitionExpression||`1=1`,e}async createSource(e){let t=new v({layer:this});return await t.load(e),t}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();let n=await this.source.queryFeatures(this._normalizeQuery(e),t),r=this.graphicOrigin;if(n?.features)for(let e of n.features)e.layer=e.sourceLayer=this,e.origin=r;return n}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}async hasDataChanged(){if(this.data?.type===`portal-item`){let e=this.data.portalItem,t=e.modified?.getTime();if(await e.reload(),t===e.modified?.getTime())return!1}return await this.source.reload(null),!0}_normalizeQuery(e){return U.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new r(e):e??new r}async _load(e){this.data?.type===`portal-item`&&await this.data.portalItem.load();let t=await this.createSource(e);this._set(`source`,t),this.read(t.sourceJSON,{origin:`service`}),[`fields`].forEach(e=>this.revertToOrigin(e,`service`)),P(this.renderer,this.fieldsIndex),this.spatialReference??=h.WGS84}};e([d({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,`capabilities`,null),e([d({json:{origins:{"web-scene":{write:!1}},write:!0}})],Y.prototype,`charts`,void 0),e([d({type:String})],Y.prototype,`copyright`,void 0),e([d({readOnly:!0})],Y.prototype,`dateFieldsTimeZone`,null),e([d({readOnly:!0})],Y.prototype,`defaultPopupTemplate`,null),e([d({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Y.prototype,`definitionExpression`,void 0),e([d({type:Boolean})],Y.prototype,`returnM`,void 0),e([d({type:Boolean})],Y.prototype,`returnZ`,void 0),e([d()],Y.prototype,`displayOptimization`,void 0),e([d({type:[M],json:{name:`layerDefinition.fields`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:`fields`}}}})],Y.prototype,`fields`,void 0),e([p(`fields`)],Y.prototype,`writeFields`,null),e([d(K.fieldsIndex)],Y.prototype,`fieldsIndex`,void 0),e([d(J)],Y.prototype,`geometryEncoding`,void 0),e([d({type:m,json:{name:`extent`}})],Y.prototype,`fullExtent`,void 0),e([d({type:V.apiValues,json:{name:`layerDefinition.geometryType`,read:{reader:V.read},write:{writer:V.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryType`,reader:V.read}}}}})],Y.prototype,`geometryType`,void 0),e([d({readOnly:!0,clonable:!1})],Y.prototype,`graphicOrigin`,void 0),e([d(O)],Y.prototype,`labelsVisible`,void 0),e([d({type:[L],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:R},write:!0}})],Y.prototype,`labelingInfo`,void 0),e([d(k)],Y.prototype,`legendEnabled`,void 0),e([d()],Y.prototype,`file`,void 0),e([d({type:String,readOnly:!0})],Y.prototype,`objectIdField`,void 0),e([d({type:[`ParquetLayer`]})],Y.prototype,`operationalLayerType`,void 0),e([d(K.outFields)],Y.prototype,`outFields`,void 0),e([d(A)],Y.prototype,`popupEnabled`,void 0),e([d({type:t,json:{name:`popupInfo`,write:!0}})],Y.prototype,`popupTemplate`,void 0),e([d({types:H,json:{name:`layerDefinition.drawingInfo.renderer`,write:!0,origins:{service:{read:{source:`drawingInfo.renderer`}}}}})],Y.prototype,`renderer`,null),e([d({type:v,readOnly:!0,cast:null,json:{read:!1}})],Y.prototype,`source`,void 0),e([d({type:h,json:{name:`layerDefinition.spatialReference`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`extent.spatialReference`}}}}})],Y.prototype,`spatialReference`,void 0),e([d({type:[j]})],Y.prototype,`templates`,void 0),e([d()],Y.prototype,`title`,null),e([d({json:{read:!1},readOnly:!0})],Y.prototype,`type`,void 0),e([d({types:{key:`type`,base:null,typeMap:{files:z,"portal-item":B}},json:{name:`source`,origins:{"web-map":{write:{target:`source`,ignoreOrigin:!0}}}}})],Y.prototype,`data`,void 0),e([p(`web-map`,`data`)],Y.prototype,`writeData`,null),e([d({type:r.ofType(String),json:{read:!1,write:!1}})],Y.prototype,`urls`,null),Y=e([f(`esri.layers.ParquetLayer`)],Y);export{Y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.140",
3
+ "version": "5.2.0-next.141",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.8",
23
- "@arcgis/toolkit": "5.2.0-next.140",
23
+ "@arcgis/toolkit": "5.2.0-next.141",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0-next.89",
26
26
  "@vaadin/grid": "~25.3.2",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as n}from"../../../../core/colorUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{isAborted as i,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../symbols/SimpleFillSymbol.js";import f from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as p}from"../../../analysis/ExclusiveOperationManager.js";import{bindViewToolOptions as m}from"../../../interactive/options/bindViewToolOptions.js";import h from"../../../../widgets/Sketch/SketchViewModel.js";function g(e){return e?.type===`polygon`}let _=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new d({color:null,outline:null}),this._invisibleLineSymbol=new f({color:null,width:0}),this._operationManager=new p,this._updatingHandles=new u}initialize(){this._sketchViewModel=new h({defaultCreateOptions:{mode:`click`},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:`none`,shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},updateOnGraphicClick:!1,cancelUpdateOnClickAway:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?this._operationManager.currentOperationType!==`place`&&this.reshape().catch(()=>{}):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},s),m(this._sketchViewModel.sketchOptions,()=>this.view.options,()=>({values:{displayUnits:{area:this._analysis.unit}}})),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new d({color:n(e,.3),outline:new f({color:e,width:2})})},s)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._invisibleLineSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return`placing`;case`reshape`:return`reshaping`}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start(`place`,async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;let n=this._analysis.clone(),o=this._sketchViewModel.on([`create`,`undo`,`redo`],e=>{let n=`state`in e?e.state:`active`,r=`graphic`in e?e.graphic:e.graphics?.at(0);switch(n){case`start`:case`active`:{let e=r?.geometry;e?.type===`polygon`&&(this._analysis.geometry=e);break}case`cancel`:case`complete`:t.stop(),a(this.reshape())}});t.handles.push(o,r(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();let r=this._analysis;if(!r.valid)return r.clear(),t.reject();if(i(e)||n.equals(r))return t.reject();t.resolve({})})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(a(this._sketchViewModel.create(`polygon`)))},e)}async reshape(e){return this._operationManager.start(`reshape`,async t=>{if(!this._sketchViewModel)return;let n=()=>!this._areaSymbol||!this._sketchViewModel||!this.measurementViewData.manipulatorGraphic||!this.measurementViewData.manipulatorGraphicsLayer?Promise.resolve():(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(a(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:`reshape`})))),o=this._sketchViewModel.on(`update`,e=>{let r=e.graphics[0]?.geometry;this._analysis.geometry=g(r)?r:null,e.state===`complete`&&(this.measurementViewData.interactive?n():t.stop())});t.handles.push(o,r(()=>{if(o.remove(),this._sketchViewModel?.cancel(),i(e))return t.reject();t.resolve()})),await n()},e)}get _analysis(){return this.measurementViewData.analysis}};e([c()],_.prototype,`_sketchViewModel`,void 0),e([c()],_.prototype,`measurementViewData`,void 0),e([c()],_.prototype,`state`,null),e([c()],_.prototype,`updating`,null),e([c()],_.prototype,`view`,void 0),_=e([l(`esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool`)],_);export{_ as AreaMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as n}from"../../../../core/colorUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{isAborted as i,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../symbols/SimpleFillSymbol.js";import f from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as p}from"../../../analysis/ExclusiveOperationManager.js";import{bindViewToolOptions as m}from"../../../interactive/options/bindViewToolOptions.js";import h from"../../../../widgets/Sketch/SketchViewModel.js";function g(e){return e?.type===`polygon`}let _=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new d({color:null,outline:null}),this._invisibleLineSymbol=new f({color:null,width:0}),this._operationManager=new p,this._updatingHandles=new u}initialize(){this._sketchViewModel=new h({defaultCreateOptions:{mode:`click`},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:`none`,shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},updateOnGraphicClick:!1,cancelUpdateOnClickAway:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{!t||!e?this._operationManager.stop():this._analysis.geometry&&this._operationManager.currentOperationType!==`place`&&this.reshape().catch(()=>{})}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},s),m(this._sketchViewModel.sketchOptions,()=>this.view.options,()=>({values:{displayUnits:{area:this._analysis.unit}}})),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new d({color:n(e,.3),outline:new f({color:e,width:2})})},s)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._invisibleLineSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return`placing`;case`reshape`:return`reshaping`}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start(`place`,async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;let n=this._analysis.clone(),o=this._sketchViewModel.on([`create`,`undo`,`redo`],e=>{let n=`state`in e?e.state:`active`,r=`graphic`in e?e.graphic:e.graphics?.at(0);switch(n){case`start`:case`active`:{let e=r?.geometry;e?.type===`polygon`&&(this._analysis.geometry=e);break}case`cancel`:case`complete`:t.stop(),a(this.reshape())}});t.handles.push(o,r(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();let r=this._analysis;if(!r.valid)return r.clear(),t.reject();if(i(e)||n.equals(r))return t.reject();t.resolve({})})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(a(this._sketchViewModel.create(`polygon`)))},e)}async reshape(e){return this._operationManager.start(`reshape`,async t=>{if(!this._sketchViewModel)return;let n=()=>!this._areaSymbol||!this._sketchViewModel||!this.measurementViewData.manipulatorGraphic||!this.measurementViewData.manipulatorGraphicsLayer?Promise.resolve():(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(a(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:`reshape`})))),o=this._sketchViewModel.on(`update`,e=>{let r=e.graphics[0]?.geometry;this._analysis.geometry=g(r)?r:null,e.state===`complete`&&(this.measurementViewData.interactive?n():t.stop())});t.handles.push(o,r(()=>{if(o.remove(),this._sketchViewModel?.cancel(),i(e))return t.reject();t.resolve()})),await n()},e)}get _analysis(){return this.measurementViewData.analysis}};e([c()],_.prototype,`_sketchViewModel`,void 0),e([c()],_.prototype,`measurementViewData`,void 0),e([c()],_.prototype,`state`,null),e([c()],_.prototype,`updating`,null),e([c()],_.prototype,`view`,void 0),_=e([l(`esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool`)],_);export{_ as AreaMeasurementTool};
@@ -98,6 +98,8 @@ export default abstract class AreaMeasurementAnalysisView2D extends AnalysisView
98
98
  /**
99
99
  * Starts an interactive placement operation to create a new [AreaMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/AreaMeasurementAnalysis/).
100
100
  *
101
+ * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/#interactive) to `true`.
102
+ *
101
103
  * The placement operation will finish when the user presses the escape key, double taps, or double clicks.
102
104
  * To stop the placing programmatically, pass an abort signal as an argument when calling the method.
103
105
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{toAdaptiveLengthUnitForArea as t,toAdaptiveAreaUnit as n}from"../../../core/quantity.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView2D.js";import{AreaMeasurementAreaVisualization as s}from"./AreaMeasurement/AreaMeasurementAreaVisualization.js";import{AreaMeasurementController as c}from"./AreaMeasurement/AreaMeasurementController.js";import{AreaMeasurementManipulatorVisualization as l}from"./AreaMeasurement/AreaMeasurementManipulatorVisualization.js";import{AreaMeasurementSketchVisualization as u}from"./AreaMeasurement/AreaMeasurementSketchVisualization.js";import{AreaMeasurementTool as d}from"./AreaMeasurement/AreaMeasurementTool.js";import f from"../../interactive/snapping/SnappingOptions.js";let p=class extends o{constructor(e){super(e),this.analysis=null,this.snappingOptions=new f,this.type=`area-measurement-view-2d`}initialize(){let{view:e}=this;this._areaVisualization=new s({view:e,measurementViewData:this}),this._controller=new c({view:e,measurementViewData:this}),this._manipulatorVisualization=new l({view:e,measurementViewData:this}),this._sketchVisualization=new u({view:e,measurementViewData:this}),this._tool=new d({view:e,measurementViewData:this})}destroy(){this._areaVisualization?.destroy(),this._controller?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get result(){let e=this._controller?.result;if(!e)return e;let{unit:r}=this,{area:i,display:a,mode:o,perimeter:s}=e;return{area:i?n(i,r):null,display:a,mode:o,perimeter:s?t(s,r):null}}get unit(){return this.analysis.unit??this.view.options.displayUnits.area??a(this.view)}get updating(){return(this._areaVisualization?.updating??!0)||(this._controller?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(e){super.visible=e}async place(e){return this._tool.place(e)}};e([r()],p.prototype,`_areaVisualization`,void 0),e([r()],p.prototype,`_controller`,void 0),e([r()],p.prototype,`_manipulatorVisualization`,void 0),e([r()],p.prototype,`_sketchVisualization`,void 0),e([r()],p.prototype,`_tool`,void 0),e([r({constructOnly:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`manipulatorGraphic`,null),e([r()],p.prototype,`manipulatorGraphicsLayer`,null),e([r()],p.prototype,`sketchGraphicsLayer`,null),e([r({readOnly:!0})],p.prototype,`result`,null),e([r({type:f,nonNullable:!0})],p.prototype,`snappingOptions`,void 0),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({readOnly:!0})],p.prototype,`unit`,null),e([r({readOnly:!0})],p.prototype,`updating`,null),p=e([i(`esri.views.2d.analysis.AreaMeasurementAnalysisView2D`)],p);const m=p;export{m as default};
2
+ import{__decorate as e}from"tslib";import{toAdaptiveLengthUnitForArea as t,toAdaptiveAreaUnit as n}from"../../../core/quantity.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView2D.js";import{AreaMeasurementAreaVisualization as s}from"./AreaMeasurement/AreaMeasurementAreaVisualization.js";import{AreaMeasurementController as c}from"./AreaMeasurement/AreaMeasurementController.js";import{AreaMeasurementManipulatorVisualization as l}from"./AreaMeasurement/AreaMeasurementManipulatorVisualization.js";import{AreaMeasurementSketchVisualization as u}from"./AreaMeasurement/AreaMeasurementSketchVisualization.js";import{AreaMeasurementTool as d}from"./AreaMeasurement/AreaMeasurementTool.js";import f from"../../interactive/snapping/SnappingOptions.js";let p=class extends o{constructor(e){super(e),this.analysis=null,this.snappingOptions=new f,this.type=`area-measurement-view-2d`}initialize(){let{view:e}=this;this._areaVisualization=new s({view:e,measurementViewData:this}),this._controller=new c({view:e,measurementViewData:this}),this._manipulatorVisualization=new l({view:e,measurementViewData:this}),this._sketchVisualization=new u({view:e,measurementViewData:this}),this._tool=new d({view:e,measurementViewData:this})}destroy(){this._areaVisualization?.destroy(),this._controller?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get result(){let e=this._controller?.result;if(!e)return e;let{unit:r}=this,{area:i,display:a,mode:o,perimeter:s}=e;return{area:i?n(i,r):null,display:a,mode:o,perimeter:s?t(s,r):null}}get unit(){return this.analysis.unit??this.view.options.displayUnits.area??a(this.view)}get updating(){return(this._areaVisualization?.updating??!0)||(this._controller?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(e){super.visible=e}async place(e){return this.interactive=!0,this._tool.place(e)}};e([r()],p.prototype,`_areaVisualization`,void 0),e([r()],p.prototype,`_controller`,void 0),e([r()],p.prototype,`_manipulatorVisualization`,void 0),e([r()],p.prototype,`_sketchVisualization`,void 0),e([r()],p.prototype,`_tool`,void 0),e([r({constructOnly:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`manipulatorGraphic`,null),e([r()],p.prototype,`manipulatorGraphicsLayer`,null),e([r()],p.prototype,`sketchGraphicsLayer`,null),e([r({readOnly:!0})],p.prototype,`result`,null),e([r({type:f,nonNullable:!0})],p.prototype,`snappingOptions`,void 0),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({readOnly:!0})],p.prototype,`unit`,null),e([r({readOnly:!0})],p.prototype,`updating`,null),p=e([i(`esri.views.2d.analysis.AreaMeasurementAnalysisView2D`)],p);const m=p;export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as n}from"../../../../core/colorUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as i,isAborted as a}from"../../../../core/promiseUtils.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as f}from"../../../analysis/ExclusiveOperationManager.js";import{bindViewToolOptions as p}from"../../../interactive/options/bindViewToolOptions.js";import m from"../../../../widgets/Sketch/SketchViewModel.js";function h(e){return e?.type===`polyline`}let g=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new d({color:null,width:0}),this._operationManager=new f,this._updatingHandles=new u}initialize(){this._sketchViewModel=new m({defaultCreateOptions:{mode:`click`},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:`none`,shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?this._operationManager.currentOperationType!==`place`&&this.reshape().catch(()=>{}):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},s),p(this._sketchViewModel.sketchOptions,()=>this.view.options,()=>({values:{displayUnits:{length:this._analysis.unit}}})),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new d({color:n(e,.3),width:2})},s)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return`placing`;case`reshape`:return`reshaping`}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start(`place`,async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;let n=this._analysis.clone(),o=this._sketchViewModel.on(`create`,e=>{switch(e.state){case`start`:case`active`:{let t=e.graphic?.geometry;t?.type===`polyline`&&(this._analysis.geometry=t);break}case`cancel`:case`complete`:t.stop(),i(this.reshape())}});t.handles.push(o,r(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();let r=this._analysis;if(!r.valid)return r.clear(),t.reject();if(a(e)||n.equals(r))return t.reject();t.resolve({})})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(i(this._sketchViewModel.create(`polyline`)))},e)}async reshape(e){return this._operationManager.start(`reshape`,async t=>{if(!this._sketchViewModel)return;let n=()=>!this._lineSymbol||!this._sketchViewModel||!this.measurementViewData.manipulatorGraphic||!this.measurementViewData.manipulatorGraphicsLayer?Promise.resolve():(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(i(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:`reshape`})))),o=this._sketchViewModel.on(`update`,e=>{let r=e.graphics[0]?.geometry;this._analysis.geometry=h(r)?r:null,e.state===`complete`&&(this.measurementViewData.interactive?n():t.stop())});t.handles.push(o,r(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await n()},e)}get _analysis(){return this.measurementViewData.analysis}};e([c()],g.prototype,`_sketchViewModel`,void 0),e([c()],g.prototype,`measurementViewData`,void 0),e([c()],g.prototype,`state`,null),e([c()],g.prototype,`updating`,null),e([c()],g.prototype,`view`,void 0),g=e([l(`esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool`)],g);export{g as DistanceMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as n}from"../../../../core/colorUtils.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as i,isAborted as a}from"../../../../core/promiseUtils.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as f}from"../../../analysis/ExclusiveOperationManager.js";import{bindViewToolOptions as p}from"../../../interactive/options/bindViewToolOptions.js";import m from"../../../../widgets/Sketch/SketchViewModel.js";function h(e){return e?.type===`polyline`}let g=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new d({color:null,width:0}),this._operationManager=new f,this._updatingHandles=new u}initialize(){this._sketchViewModel=new m({defaultCreateOptions:{mode:`click`},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:`none`,shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{!t||!e?this._operationManager.stop():this._analysis.geometry&&this._operationManager.currentOperationType!==`place`&&this.reshape().catch(()=>{})}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},s),p(this._sketchViewModel.sketchOptions,()=>this.view.options,()=>({values:{displayUnits:{length:this._analysis.unit}}})),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new d({color:n(e,.3),width:2})},s)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return`placing`;case`reshape`:return`reshaping`}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start(`place`,async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;let n=this._analysis.clone(),o=this._sketchViewModel.on(`create`,e=>{switch(e.state){case`start`:case`active`:{let t=e.graphic?.geometry;t?.type===`polyline`&&(this._analysis.geometry=t);break}case`cancel`:case`complete`:t.stop(),i(this.reshape())}});t.handles.push(o,r(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();let r=this._analysis;if(!r.valid)return r.clear(),t.reject();if(a(e)||n.equals(r))return t.reject();t.resolve({})})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(i(this._sketchViewModel.create(`polyline`)))},e)}async reshape(e){return this._operationManager.start(`reshape`,async t=>{if(!this._sketchViewModel)return;let n=()=>!this._lineSymbol||!this._sketchViewModel||!this.measurementViewData.manipulatorGraphic||!this.measurementViewData.manipulatorGraphicsLayer?Promise.resolve():(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(i(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:`reshape`})))),o=this._sketchViewModel.on(`update`,e=>{let r=e.graphics[0]?.geometry;this._analysis.geometry=h(r)?r:null,e.state===`complete`&&(this.measurementViewData.interactive?n():t.stop())});t.handles.push(o,r(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await n()},e)}get _analysis(){return this.measurementViewData.analysis}};e([c()],g.prototype,`_sketchViewModel`,void 0),e([c()],g.prototype,`measurementViewData`,void 0),e([c()],g.prototype,`state`,null),e([c()],g.prototype,`updating`,null),e([c()],g.prototype,`view`,void 0),g=e([l(`esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool`)],g);export{g as DistanceMeasurementTool};
@@ -97,6 +97,8 @@ export default abstract class DistanceMeasurementAnalysisView2D extends Analysis
97
97
  /**
98
98
  * Starts an interactive placement operation to create a new [DistanceMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/).
99
99
  *
100
+ * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/#interactive) to `true`.
101
+ *
100
102
  * The placement operation will finish when the user presses the escape key, double taps, or double clicks.
101
103
  * To stop the placing programmatically, pass an abort signal as an argument when calling the method.
102
104
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{toAdaptiveLengthUnit as t}from"../../../core/quantity.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as i}from"../../../support/getDefaultUnitForView.js";import a from"./AnalysisView2D.js";import{DistanceMeasurementController as o}from"./DistanceMeasurement/DistanceMeasurementController.js";import{DistanceMeasurementLineVisualization as s}from"./DistanceMeasurement/DistanceMeasurementLineVisualization.js";import{DistanceMeasurementManipulatorVisualization as c}from"./DistanceMeasurement/DistanceMeasurementManipulatorVisualization.js";import{DistanceMeasurementSketchVisualization as l}from"./DistanceMeasurement/DistanceMeasurementSketchVisualization.js";import{DistanceMeasurementTool as u}from"./DistanceMeasurement/DistanceMeasurementTool.js";import d from"../../interactive/snapping/SnappingOptions.js";let f=class extends a{constructor(e){super(e),this.analysis=null,this.snappingOptions=new d,this.type=`distance-measurement-view-2d`}initialize(){let{view:e}=this;this._lineVisualization=new s({view:e,measurementViewData:this}),this._controller=new o({view:e,measurementViewData:this}),this._manipulatorVisualization=new c({view:e,measurementViewData:this}),this._sketchVisualization=new l({view:e,measurementViewData:this}),this._tool=new u({view:e,measurementViewData:this})}destroy(){this._lineVisualization?.destroy(),this._controller?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get result(){let e=this._controller?.result;return e&&{...e,length:t(e.length,this.unit)}}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??i(this.view)}get updating(){return(this._controller?.updating??!0)||(this._lineVisualization?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(e){super.visible=e}async place(e){return this._tool.place(e)}};e([n()],f.prototype,`_lineVisualization`,void 0),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_manipulatorVisualization`,void 0),e([n()],f.prototype,`_sketchVisualization`,void 0),e([n()],f.prototype,`_tool`,void 0),e([n({constructOnly:!0})],f.prototype,`analysis`,void 0),e([n()],f.prototype,`manipulatorGraphic`,null),e([n()],f.prototype,`manipulatorGraphicsLayer`,null),e([n()],f.prototype,`sketchGraphicsLayer`,null),e([n({readOnly:!0})],f.prototype,`result`,null),e([n({type:d,nonNullable:!0})],f.prototype,`snappingOptions`,void 0),e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({readOnly:!0})],f.prototype,`unit`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),f=e([r(`esri.views.2d.analysis.DistanceMeasurementAnalysisView2D`)],f);const p=f;export{p as default};
2
+ import{__decorate as e}from"tslib";import{toAdaptiveLengthUnit as t}from"../../../core/quantity.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as i}from"../../../support/getDefaultUnitForView.js";import a from"./AnalysisView2D.js";import{DistanceMeasurementController as o}from"./DistanceMeasurement/DistanceMeasurementController.js";import{DistanceMeasurementLineVisualization as s}from"./DistanceMeasurement/DistanceMeasurementLineVisualization.js";import{DistanceMeasurementManipulatorVisualization as c}from"./DistanceMeasurement/DistanceMeasurementManipulatorVisualization.js";import{DistanceMeasurementSketchVisualization as l}from"./DistanceMeasurement/DistanceMeasurementSketchVisualization.js";import{DistanceMeasurementTool as u}from"./DistanceMeasurement/DistanceMeasurementTool.js";import d from"../../interactive/snapping/SnappingOptions.js";let f=class extends a{constructor(e){super(e),this.analysis=null,this.snappingOptions=new d,this.type=`distance-measurement-view-2d`}initialize(){let{view:e}=this;this._lineVisualization=new s({view:e,measurementViewData:this}),this._controller=new o({view:e,measurementViewData:this}),this._manipulatorVisualization=new c({view:e,measurementViewData:this}),this._sketchVisualization=new l({view:e,measurementViewData:this}),this._tool=new u({view:e,measurementViewData:this})}destroy(){this._lineVisualization?.destroy(),this._controller?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get result(){let e=this._controller?.result;return e&&{...e,length:t(e.length,this.unit)}}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??i(this.view)}get updating(){return(this._controller?.updating??!0)||(this._lineVisualization?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(e){super.visible=e}async place(e){return this.interactive=!0,this._tool.place(e)}};e([n()],f.prototype,`_lineVisualization`,void 0),e([n()],f.prototype,`_controller`,void 0),e([n()],f.prototype,`_manipulatorVisualization`,void 0),e([n()],f.prototype,`_sketchVisualization`,void 0),e([n()],f.prototype,`_tool`,void 0),e([n({constructOnly:!0})],f.prototype,`analysis`,void 0),e([n()],f.prototype,`manipulatorGraphic`,null),e([n()],f.prototype,`manipulatorGraphicsLayer`,null),e([n()],f.prototype,`sketchGraphicsLayer`,null),e([n({readOnly:!0})],f.prototype,`result`,null),e([n({type:d,nonNullable:!0})],f.prototype,`snappingOptions`,void 0),e([n({readOnly:!0})],f.prototype,`type`,void 0),e([n({readOnly:!0})],f.prototype,`unit`,null),e([n({readOnly:!0})],f.prototype,`updating`,null),f=e([r(`esri.views.2d.analysis.DistanceMeasurementAnalysisView2D`)],f);const p=f;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Float as s,step as c,min as l,ifElse as u,greaterThan as d,max as f,Vec3 as p,length as m,clamp as h}from"../../graph/glsl.js";import{BaseHittestVertexInput as g,FeatureVertexInput as _,AFeatureShader as v,FeatureFragmentInput as y}from"./AFeatureShader.js";import{noHit as b,trueHit as x,epsilon as S,thinLineWidthFactor as C,thinLineHalfWidth as w}from"./constants.js";import{distPointSegment as T,isRectHittest as E,hittestMarkerRect as D,isPolygonHittest as O,hittestPolygon as k,isPointHittest as A}from"./hittestUtils.js";import{VisualVariableColor as j}from"./VisualVariableColor.js";import{VisualVariableOpacity as M}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as N}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as P}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as F}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as I}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as L,getVisualVariableOpacity as R,hasVisualVariableSize as z,getVisualVariableSize as B}from"./vvUtils.js";class V extends _{}e([n(3,a)],V.prototype,`color`,void 0),e([n(4,o)],V.prototype,`offset`,void 0),e([n(5,o)],V.prototype,`normal`,void 0),e([n(6,s)],V.prototype,`halfWidth`,void 0),e([n(7,s)],V.prototype,`referenceHalfWidth`,void 0),e([n(8,o)],V.prototype,`zoomRange`,void 0);class H extends y{}function U(e){return f(new s(C).multiply(c(e,new s(w))),new s(1))}function W(e,t){let{halfWidth:n,normal:r}=e,i=U(n),a=m(r).multiply(n);return h(i.multiply(n.subtract(a)).divide(t.add(i).subtract(new s(1))),new s(0),new s(1))}function G(e,t,n){let{halfWidth:r,referenceHalfWidth:i}=t;if(z(e)){let t=new s(2).multiply(i),a=B(e,n,t),o=new s(S),c=u(d(r,o),r.divide(f(i,o)),new s(1));return new s(.5).multiply(c).multiply(a)}return r}function K(e,t){let{id:n,offset:r,pos:i,normal:o,zoomRange:l}=t,u=e.getFeatureId(n,t.bitset),d=e.view.getDisplayViewMat3(),m=e.tile.getDisplayViewScreenMat3(e.view),h=L(e,u,t.color),g=R(e,u),_=G(e,t,u),v=new s(.5).multiply(e.view.getAntialiasing()),y=f(_.add(v),new s(.45)).add(new s(.1).multiply(v)),b=U(y).multiply(y).multiply(r).multiply(e.tileInfo.scaleFactor),x=e.getLabelOffset(b,t.bitset),S=d.multiply(new p(x,new s(0))),C=m.multiply(new p(e.getLabelPosition(i,n,t.bitset),new s(1))).add(S),w=new s(2).multiply(c(_,new s(0))).add(e.clip(n,t.bitset,l)),T=new a(C.xy,w,1);return{color:h,opacity:g,halfWidth:y,normal:o,scaledOffset:b,scaledHalfWidth:_,glPosition:new a(T.xy,w,1)}}function q(e,t){let{opacity:n,color:r}=e,i=W(e,t);return n.multiply(r).multiply(i)}class J extends v{constructor(){super(...arguments),this.type=`LineShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=K(this,e);return{...n,...this.maybeRunHittest(e,t,n.halfWidth)}}fragment(e){let t=q(e,this.view.getAntialiasing());return this.getFragmentOutput(t,e)}hittest(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,null),{distance:o,smallSymbolDistance:f,smallSymbolSizeThreshold:p}=this.hittestRequest,m=c(n,p.multiply(.5)).multiply(o.subtract(f)),h=this.hittestRequest.position,g=l(T(h,r,i),T(h,r,a)).subtract(n).add(m);return u(A(this.hittestRequest),u(d(g,o),new s(b),new s(x)),()=>u(E(this.hittestRequest),D({pos0:r,pos1:i,pos2:a},this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),u(O(this.hittestRequest),k({pos0:r,pos1:i,pos2:a},this.hittestRequest.viewSize,this.hittestMaskTexture),new s(b))))}}e([r(j)],J.prototype,`visualVariableColor`,void 0),e([r(M)],J.prototype,`visualVariableOpacity`,void 0),e([r(N)],J.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(P)],J.prototype,`visualVariableSizeScaleStops`,void 0),e([r(F)],J.prototype,`visualVariableSizeStops`,void 0),e([r(I)],J.prototype,`visualVariableSizeUnitValue`,void 0),e([t(0,i(V)),t(1,i(g))],J.prototype,`vertex`,null),e([t(0,i(H))],J.prototype,`fragment`,null);export{H as LineFragmentInput,J as LineShader,V as LineVertexInput,W as getLineAntialiasing,q as getLineFragmentColor,U as getLineThinFactor,K as getLineVertexData};
2
+ import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Float as s,step as c,min as l,ifElse as u,greaterThan as d,max as f,Vec3 as p,cond as m,lessThanEqual as h,length as g,clamp as _}from"../../graph/glsl.js";import{BaseHittestVertexInput as v,FeatureVertexInput as y,AFeatureShader as b,FeatureFragmentInput as x}from"./AFeatureShader.js";import{noHit as S,trueHit as C,epsilon as w,thinLineWidthFactor as T,thinLineHalfWidth as E}from"./constants.js";import{distPointSegment as D,isRectHittest as O,hittestMarkerRect as k,isPolygonHittest as A,hittestPolygon as j,isPointHittest as M}from"./hittestUtils.js";import{VisualVariableColor as N}from"./VisualVariableColor.js";import{VisualVariableOpacity as P}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as F}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as I}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as L}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as R}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as z,getVisualVariableOpacity as B,hasVisualVariableSize as V,getVisualVariableSize as H}from"./vvUtils.js";class U extends y{}e([n(3,a)],U.prototype,`color`,void 0),e([n(4,o)],U.prototype,`offset`,void 0),e([n(5,o)],U.prototype,`normal`,void 0),e([n(6,s)],U.prototype,`halfWidth`,void 0),e([n(7,s)],U.prototype,`referenceHalfWidth`,void 0),e([n(8,o)],U.prototype,`zoomRange`,void 0);class W extends x{}function G(e){return f(new s(T).multiply(c(e,new s(E))),new s(1))}function K(e,t){let{halfWidth:n,normal:r}=e,i=G(n),a=g(r).multiply(n);return _(i.multiply(n.subtract(a)).divide(t.add(i).subtract(new s(1))),new s(0),new s(1))}function q(e,t,n){let{halfWidth:r,referenceHalfWidth:i}=t;if(V(e)){let t=new s(2).multiply(i),a=H(e,n,t),o=new s(.5).multiply(a),c=new s(w);return m([h(r,c),o],[h(i,c),r],[!0,r.divide(f(i,c)).multiply(o)])}return r}function J(e,t){let{id:n,offset:r,pos:i,normal:o,zoomRange:l}=t,u=e.getFeatureId(n,t.bitset),d=e.view.getDisplayViewMat3(),m=e.tile.getDisplayViewScreenMat3(e.view),h=z(e,u,t.color),g=B(e,u),_=q(e,t,u),v=new s(.5).multiply(e.view.getAntialiasing()),y=f(_.add(v),new s(.45)).add(new s(.1).multiply(v)),b=G(y).multiply(y).multiply(r).multiply(e.tileInfo.scaleFactor),x=e.getLabelOffset(b,t.bitset),S=d.multiply(new p(x,new s(0))),C=m.multiply(new p(e.getLabelPosition(i,n,t.bitset),new s(1))).add(S),w=new s(2).multiply(c(_,new s(0))).add(e.clip(n,t.bitset,l)),T=new a(C.xy,w,1);return{color:h,opacity:g,halfWidth:y,normal:o,scaledOffset:b,scaledHalfWidth:_,glPosition:new a(T.xy,w,1)}}function Y(e,t){let{opacity:n,color:r}=e,i=K(e,t);return n.multiply(r).multiply(i)}class X extends b{constructor(){super(...arguments),this.type=`LineShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=J(this,e);return{...n,...this.maybeRunHittest(e,t,n.halfWidth)}}fragment(e){let t=Y(e,this.view.getAntialiasing());return this.getFragmentOutput(t,e)}hittest(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,null),{distance:o,smallSymbolDistance:f,smallSymbolSizeThreshold:p}=this.hittestRequest,m=c(n,p.multiply(.5)).multiply(o.subtract(f)),h=this.hittestRequest.position,g=l(D(h,r,i),D(h,r,a)).subtract(n).add(m);return u(M(this.hittestRequest),u(d(g,o),new s(S),new s(C)),()=>u(O(this.hittestRequest),k({pos0:r,pos1:i,pos2:a},this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),u(A(this.hittestRequest),j({pos0:r,pos1:i,pos2:a},this.hittestRequest.viewSize,this.hittestMaskTexture),new s(S))))}}e([r(N)],X.prototype,`visualVariableColor`,void 0),e([r(P)],X.prototype,`visualVariableOpacity`,void 0),e([r(F)],X.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(I)],X.prototype,`visualVariableSizeScaleStops`,void 0),e([r(L)],X.prototype,`visualVariableSizeStops`,void 0),e([r(R)],X.prototype,`visualVariableSizeUnitValue`,void 0),e([t(0,i(U)),t(1,i(v))],X.prototype,`vertex`,null),e([t(0,i(W))],X.prototype,`fragment`,null);export{W as LineFragmentInput,X as LineShader,U as LineVertexInput,K as getLineAntialiasing,Y as getLineFragmentColor,G as getLineThinFactor,J as getLineVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as s}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as c,snapshotLineOfSightObserverState as l,snapshotLineOfSightTargetState as u,restoreLineOfSightObserverState as d,restoreLineOfSightTargetState as f,updateLineOfSightItemFromAuthoredPoint as p}from"./LineOfSightAuthoringUtils.js";import{EditGeometryOperations as m}from"../../../interactive/editGeometry/EditGeometryOperations.js";const h=Symbol(`line-of-sight-item-operations`);let g=class extends t{constructor(e){super(e),this._operations=null,this._dragIntersectionContext=null,this._syncSource=null}initialize(){this.addHandles([r(()=>{let{elevationInfo:e,feature:t,position:n}=this.item;return{elevationInfo:e,elevationMode:e?.mode,elevationOffset:e?.offset,elevationUnit:e?.unit,feature:t,position:n,positionCoordinates:n?.toArray(),spatialReference:n?.spatialReference}},()=>this._syncOperationsFromItem(),i),r(()=>{let{origin:e}=this;return{origin:e,originCoordinates:e?.toArray(),spatialReference:e?.spatialReference}},()=>this.emit(`committed`),i)])}destroy(){this.removeHandles(h),this._operations=n(this._operations),this._dragIntersectionContext=null}get operations(){return this._operations}get elevationInfo(){return this.item.elevationInfo??s}get visible(){return this.analysisViewData.visible&&this.origin!=null}get isDraped(){return this.elevationInfo.mode===`on-the-ground`}get origin(){return this.item.type===`observer`?this.analysisViewData.elevationAlignedObserver:this.analysisViewData.computations.find(e=>e.target===this.item)?.elevationAlignedTargetLocation??null}get updating(){return!1}toMap(e){return this.intersector.getScreenPointIntersection(e)?.mapPoint}createUndoRecord(){let e=this._snapshotState(),t=null;return{undo:()=>{t=this._snapshotState(),this._restoreSnapshot(e)},redo:()=>{t!=null&&(e=this._snapshotState(),this._restoreSnapshot(t))}}}setElevationMode(e){let{position:t,elevationInfo:n}=this.item;if(t==null||e===this.elevationInfo.mode)return null;let r=c({view:this.view,point:t,sourceElevationInfo:n,mode:e,preserveZ:!0}),i=this.createUndoRecord();this._syncSource=`operations`;try{this.item.elevationInfo=r.elevationInfo,this.item.position=r.position}finally{this._syncSource=null}return this._syncOperationsFromItem(!1),i}updateDragIntersection(e){if(e.action===`cancel`){this._dragIntersectionContext=null;return}this._dragIntersectionContext={dragging:e.action!==`end`,intersection:this.intersector.getScreenPointIntersection(e.screenPoint)}}_snapshotState(){let{item:e}=this;return e.type===`observer`?l(e):u(e)}_restoreSnapshot(e){let{item:t}=this;t.type===`observer`?d(e,t):f(e,t),this.destroyed||(this._syncOperationsFromItem(),this.emit(`committed`))}_replaceOperations(e){this.removeHandles(h),this._operations=n(this._operations),this._operations=e,e!=null&&this.addHandles(e.data.on(`change`,()=>this._operationsGeometryChanged()),h)}_syncOperationsFromItem(e=!0){let{position:t}=this.item,n=this._operations;if(this._syncSource!==`operations`){this._syncSource=`item`;try{if(t==null){if(n==null)return;this._replaceOperations(null)}else!n?.data.geometry?.equals(t)&&!n?.trySetGeometry(t)&&this._replaceOperations(m.fromGeometry(t,this.view.state.viewingMode));e?this._emitModifiedExternally():this.emit(`committed`)}finally{this._syncSource=null}}}_operationsGeometryChanged(){let e=this._operations?.data.geometry;if(this._syncSource===`item`||e?.type!==`point`)return;let t=this._dragIntersectionContext;this._syncSource=`operations`;try{t==null?this.item.position=e:p(this.view,this.item,this.intersector,e,{elevationInfo:this.item.elevationInfo,preservedIntersection:t.intersection})}finally{this._syncSource=null}t!=null&&!t.dragging&&(this._dragIntersectionContext=null),this.emit(`committed`)}_emitModifiedExternally(){this.emit(`modified-externally`),this.emit(`committed`)}};e([a({constructOnly:!0})],g.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],g.prototype,`intersector`,void 0),e([a({constructOnly:!0})],g.prototype,`item`,void 0),e([a({constructOnly:!0})],g.prototype,`view`,void 0),e([a()],g.prototype,`_operations`,void 0),g=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightItemManipulatedObject3D`)],g);export{g as LineOfSightItemManipulatedObject3D};
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{getGeometryEffectiveElevationInfo as s}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as c,snapshotLineOfSightObserverState as l,snapshotLineOfSightTargetState as u,restoreLineOfSightObserverState as d,restoreLineOfSightTargetState as f,updateLineOfSightItemFromAuthoredPoint as p}from"./LineOfSightAuthoringUtils.js";import{EditGeometryOperations as m}from"../../../interactive/editGeometry/EditGeometryOperations.js";const h=Symbol(`line-of-sight-item-operations`);let g=class extends t{constructor(e){super(e),this._operations=null,this._dragIntersectionContext=null,this._syncSource=null}initialize(){this.addHandles([r(()=>{let{elevationInfo:e,feature:t,position:n}=this.item;return{elevationInfo:e,elevationMode:e?.mode,elevationOffset:e?.offset,elevationUnit:e?.unit,feature:t,position:n,positionCoordinates:n?.toArray(),spatialReference:n?.spatialReference}},()=>this._syncOperationsFromItem(),i),r(()=>{let{origin:e}=this;return{origin:e,originCoordinates:e?.toArray(),spatialReference:e?.spatialReference}},()=>this.emit(`committed`),i)])}destroy(){this.removeHandles(h),this._operations=n(this._operations),this._dragIntersectionContext=null}get operations(){return this._operations}get elevationInfo(){let{position:e,elevationInfo:t}=this.item;return s(e,t)}get visible(){return this.analysisViewData.visible&&this.origin!=null}get isDraped(){return this.elevationInfo.mode===`on-the-ground`}get origin(){return this.item.type===`observer`?this.analysisViewData.elevationAlignedObserver:this.analysisViewData.computations.find(e=>e.target===this.item)?.elevationAlignedTargetLocation??null}get updating(){return!1}toMap(e){return this.intersector.getScreenPointIntersection(e)?.mapPoint}createUndoRecord(){let e=this._snapshotState(),t=null;return{undo:()=>{t=this._snapshotState(),this._restoreSnapshot(e)},redo:()=>{t!=null&&(e=this._snapshotState(),this._restoreSnapshot(t))}}}setElevationMode(e){let{position:t,elevationInfo:n}=this.item;if(t==null||e===this.elevationInfo.mode)return null;let r=c({view:this.view,point:t,sourceElevationInfo:n,mode:e,preserveZ:!0}),i=this.createUndoRecord();this._syncSource=`operations`;try{this.item.elevationInfo=r.elevationInfo,this.item.position=r.position}finally{this._syncSource=null}return this._syncOperationsFromItem(!1),i}updateDragIntersection(e){if(e.action===`cancel`){this._dragIntersectionContext=null;return}this._dragIntersectionContext={dragging:e.action!==`end`,intersection:this.intersector.getScreenPointIntersection(e.screenPoint)}}_snapshotState(){let{item:e}=this;return e.type===`observer`?l(e):u(e)}_restoreSnapshot(e){let{item:t}=this;t.type===`observer`?d(e,t):f(e,t),this.destroyed||(this._syncOperationsFromItem(),this.emit(`committed`))}_replaceOperations(e){this.removeHandles(h),this._operations=n(this._operations),this._operations=e,e!=null&&this.addHandles(e.data.on(`change`,()=>this._operationsGeometryChanged()),h)}_syncOperationsFromItem(e=!0){let{position:t}=this.item,n=this._operations;if(this._syncSource!==`operations`){this._syncSource=`item`;try{if(t==null){if(n==null)return;this._replaceOperations(null)}else!n?.data.geometry?.equals(t)&&!n?.trySetGeometry(t)&&this._replaceOperations(m.fromGeometry(t,this.view.state.viewingMode));e?this._emitModifiedExternally():this.emit(`committed`)}finally{this._syncSource=null}}}_operationsGeometryChanged(){let e=this._operations?.data.geometry;if(this._syncSource===`item`||e?.type!==`point`)return;let t=this._dragIntersectionContext;this._syncSource=`operations`;try{t==null?this.item.position=e:p(this.view,this.item,this.intersector,e,{elevationInfo:this.item.elevationInfo,preservedIntersection:t.intersection})}finally{this._syncSource=null}t!=null&&!t.dragging&&(this._dragIntersectionContext=null),this.emit(`committed`)}_emitModifiedExternally(){this.emit(`modified-externally`),this.emit(`committed`)}};e([a({constructOnly:!0})],g.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],g.prototype,`intersector`,void 0),e([a({constructOnly:!0})],g.prototype,`item`,void 0),e([a({constructOnly:!0})],g.prototype,`view`,void 0),e([a()],g.prototype,`_operations`,void 0),g=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightItemManipulatedObject3D`)],g);export{g as LineOfSightItemManipulatedObject3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createDrawTool as u}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as d}from"./LineOfSightRootPlugin.js";import{isLineOfSightTargetPlugin as f}from"./LineOfSightTargetPlugin.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _snapToSceneEnabled(){let e=this._effectiveElevationInfo.mode;return e===`relative-to-ground`||e===`on-the-ground`?!1:null}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;f(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([d({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return u({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`parent`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createDrawTool as u}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as d}from"./LineOfSightRootPlugin.js";import{isLineOfSightTargetPlugin as f}from"./LineOfSightTargetPlugin.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;f(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([d({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return u({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`parent`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as t,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{LineOfSightDrawToolRenderer as r}from"./LineOfSightDrawToolRenderer.js";import{isLineOfSightPlacementLeafPlugin as i}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as a}from"./LineOfSightRayIntersector.js";import{DrawTool as o}from"../../../draw/DrawTool.js";import{bindViewToolOptions as s}from"../../../interactive/options/bindViewToolOptions.js";import c from"../../../interactive/options/InteractiveToolOptions.js";import{createScreenPointFromEvent as l}from"../../../support/screenUtils.js";function u(u){let{analysis:d,analysisViewData:f,snappingManager:p,view:m,getVisible:h,getSourceElevationInfo:g,getSnapToSceneEnabled:_,onCancel:v,onComplete:y,onManipulatorCountChange:b,shouldPreventVertexAdd:x}=u,S=g(),C=new r({analysis:d,analysisViewData:f,view:m}),w=new a({view:m}),T=new c,E=new o({elevationInfo:S,enableVertexVisuals:!1,hasZ:!0,renderer:C,toolOptions:T,snappingManager:p,view:m});return C.elevationInfo=S,E.addHandles([e(C),e(w),s(T,()=>m.options),E.on(`cancel`,()=>v(E)),E.on(`complete`,()=>y(E)),t(()=>[E.surfaceManager,_()],([e,t])=>{e&&(e.snapToSceneEnabled=t)},n),t(()=>[h(),f.visible,g()],([e,t,n])=>{E.visible=e&&t,C.analysisVisible=E.visible,E.elevationInfo=n,C.elevationInfo=n,C.refresh()},n),t(()=>E.manipulators.length,()=>b(E),n),t(()=>E.mostDownstreamPlugin,()=>{E.defaultZ=0},n),E.on([`before-vertex-add`,`before-vertex-add-at-point`],e=>{let t=e.detail.originalEvent;if(t?.type!==`immediate-click`)return;let n=l(t);if(x(n,t.pointerType)){e.preventDefault();return}let r=w.getScreenPointIntersection(n);if(r?.mapPoint==null)e.preventDefault();else{let e=E.mostDownstreamPlugin;i(e)&&(e.preservedIntersection=r)}})]),{drawTool:E,renderer:C}}export{u as createDrawTool};
2
+ import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as t,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{LineOfSightDrawToolRenderer as r}from"./LineOfSightDrawToolRenderer.js";import{isLineOfSightPlacementLeafPlugin as i}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as a}from"./LineOfSightRayIntersector.js";import{DrawTool as o}from"../../../draw/DrawTool.js";import{bindViewToolOptions as s}from"../../../interactive/options/bindViewToolOptions.js";import c from"../../../interactive/options/InteractiveToolOptions.js";import{createScreenPointFromEvent as l}from"../../../support/screenUtils.js";function u(u){let{analysis:d,analysisViewData:f,snappingManager:p,view:m,getVisible:h,getSourceElevationInfo:g,onCancel:_,onComplete:v,onManipulatorCountChange:y,shouldPreventVertexAdd:b}=u,x=g(),S=new r({analysis:d,analysisViewData:f,view:m}),C=new a({view:m}),w=new c,T=new o({elevationInfo:x,enableVertexVisuals:!1,hasZ:!0,renderer:S,toolOptions:w,snappingManager:p,view:m});return S.elevationInfo=x,T.addHandles([e(S),e(C),s(w,()=>m.options),T.on(`cancel`,()=>_(T)),T.on(`complete`,()=>v(T)),t(()=>[h(),f.visible,g()],([e,t,n])=>{T.visible=e&&t,S.analysisVisible=T.visible,T.elevationInfo=n,S.elevationInfo=n,S.refresh()},n),t(()=>T.manipulators.length,()=>y(T),n),t(()=>T.mostDownstreamPlugin,()=>{T.defaultZ=0},n),T.on([`before-vertex-add`,`before-vertex-add-at-point`],e=>{let t=e.detail.originalEvent;if(t?.type!==`immediate-click`)return;let n=l(t);if(b(n,t.pointerType)){e.preventDefault();return}let r=C.getScreenPointIntersection(n);if(r?.mapPoint==null)e.preventDefault();else{let e=T.mostDownstreamPlugin;i(e)&&(e.preservedIntersection=r)}})]),{drawTool:T,renderer:S}}export{u as createDrawTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,this._setDrawToolElevationInfo(i),n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a,this._onObserverMapPointPreview(a)}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}get _snapToSceneEnabled(){let e=this.observerPlacementElevationInfo?.mode;return this.creationState!==`placing-observer`||e==null||e===`absolute-height`?null:!1}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,t.elevationInfo=i,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?r:void 0}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey))}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
2
+ import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as t,syncAndInitial as n,sync as r,initial as i}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as o}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as c}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as l}from"../../../draw/DrawTool.js";function u(a){let{analysisViewData:s,snappingManager:c,view:u,toolOptions:d,elevationInfo:f,getSnapToSceneEnabled:p,onCancel:m,onComplete:h,onManipulatorCountChange:g,isPlacingObserver:_}=a,v=new o({view:u,isPlacingObserver:_}),y=new l({elevationInfo:f,enableVertexVisuals:!1,hasZ:!0,renderer:v,toolOptions:d,snappingManager:c,view:u});return y.addHandles([e(v),y.on(`cancel`,()=>m(y)),y.on(`complete`,()=>h(y)),t(()=>[y.surfaceManager,p()],([e,t])=>{e&&(e.snapToSceneEnabled=t)},n),t(()=>y.manipulators.length,()=>g(y),r),t(()=>s.visible,e=>v.analysisVisible=e,i)]),{drawTool:y,renderer:v}}function d({intersector:e,snappingManager:t,screenPoint:n,view:r}){let i=t.getMainFeatureCandidate();return i?p(i):n?f(n,r,e):null}function f(e,t,n){t.sceneIntersectionHelper.intersectToolIntersectorScreen(a(e.x,e.y),n);let r=n.results.min;return s(r)?c(r,t):null}function p(e){let t={id:e.layer.id,objectIdField:`objectIdField`in e.layer?e.layer.objectIdField:void 0};return{attributes:{[t.objectIdField??`ObjectId`]:e.objectId},layer:t,objectId:e.objectId,uid:null}}export{u as createDrawTool,d as getFeatureReference};
2
+ import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as t,syncAndInitial as n,sync as r,initial as i}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as o}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as c}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as l}from"../../../draw/DrawTool.js";function u(a){let{analysisViewData:s,snappingManager:c,view:u,toolOptions:d,elevationInfo:f,onCancel:p,onComplete:m,onManipulatorCountChange:h,isPlacingObserver:g}=a,_=new o({view:u,isPlacingObserver:g}),v=new l({elevationInfo:f,enableVertexVisuals:!1,hasZ:!0,renderer:_,toolOptions:d,snappingManager:c,view:u});return v.addHandles([e(_),v.on(`cancel`,()=>p(v)),v.on(`complete`,()=>m(v)),t(()=>v.mostDownstreamPlugin,()=>v.defaultZ=0,n),t(()=>v.manipulators.length,()=>h(v),r),t(()=>s.visible,e=>_.analysisVisible=e,i)]),{drawTool:v,renderer:_}}function d({intersector:e,snappingManager:t,screenPoint:n,view:r}){let i=t.getMainFeatureCandidate();return i?p(i):n?f(n,r,e):null}function f(e,t,n){t.sceneIntersectionHelper.intersectToolIntersectorScreen(a(e.x,e.y),n);let r=n.results.min;return s(r)?c(r,t):null}function p(e){let t={id:e.layer.id,objectIdField:`objectIdField`in e.layer?e.layer.objectIdField:void 0};return{attributes:{[t.objectIdField??`ObjectId`]:e.objectId},layer:t,objectId:e.objectId,uid:null}}export{u as createDrawTool,d as getFeatureReference};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{multiplyOpacity as e}from"../../../core/colorUtils.js";import{destroyHandle as t,makeHandle as n}from"../../../core/handleUtils.js";import{lerp as r}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as a}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as o,absoluteHeightElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{vectorToRender as c}from"./support/viewUtils.js";import{ExtendedLineVisualElement as l}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as u}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as f}from"./visualElements/RightAngleQuadVisualElement.js";import{createDehydratedPoint as p,isTarget as m,withSelfSnappingZ as h}from"../../interactive/sketch/normalizedPoint.js";import{defaults as g}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as _}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as v}from"../../interactive/snapping/hints/LineSnappingHint.js";class y extends _{sortUniqueHints(e){return e.sort((e,t)=>(t instanceof v?t.length:0)-(e instanceof v?e.length:0))}visualizeIntersectionPoint(e,n){let{spatialReference:r,view:i}=n,a=b(n);return t(new d({view:i,primitive:`circle`,geometry:p(e.intersectionPoint,r),elevationInfo:e.isDraped?o:s,size:20,outlineSize:2,color:a.intersectionPointColor,outlineColor:a.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){let{view:r,spatialReference:i}=n,a=b(n),o=x(e.point,e.domain,n);return t(new d({view:r,primitive:`circle`,geometry:p(o,i),elevationInfo:S(e),size:20,outlineSize:2,color:a.pointColor,outlineColor:a.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n){let{view:r,spatialReference:i}=n,a=b(n),o=x(e.lineStart,e.domain,n),s=x(e.lineEnd,e.domain,n);return t(C(e.type,o,s,i,S(e),r,a,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeCurve(e,t){return n()}visualizeParallelSign(e,n){let{view:i,spatialReference:a}=n,o=b(n),{isDraped:s}=e,c=S(e),l=x(e.lineStart,e.domain,n),d=x(e.lineEnd,e.domain,n),f=w(l,a,c,i,s),p=w(d,a,c,i,s),m=r(p,f,p,.5),h=new u({view:i,attached:!1,offset:g.parallelLineHintOffset,length:g.parallelLineHintLength,width:g.parallelLineHintWidth,color:o.parallelSignColor,location:m,renderOccluded:s?4:16,isDraped:s,renderGroup:3,isDecoration:!0});return h.setDirectionFromPoints(f,m),h.attached=!0,t(h)}visualizeRightAngleQuad(e,n){let{view:r,spatialReference:i}=n,a=b(n),o=S(e),{isDraped:s}=e,c=x(e.previousVertex,e.domain,n),l=x(e.centerVertex,e.domain,n),u=x(e.nextVertex,e.domain,n),d=w(c,i,o,r,s),p=w(l,i,o,r,s),m=w(u,i,o,r,s);return t(new f({view:r,attached:!0,color:s?a.rightAngleColorDraped:a.rightAngleColor,renderOccluded:s?4:2,outlineRenderOccluded:s?4:16,outlineColor:a.rightAngleOutlineColor,outlineSize:g.rightAngleHintOutlineSize,size:g.rightAngleHintSize,isDraped:s,geometry:{previous:d,center:p,next:m},renderGroup:3,isDecoration:!0}))}}function b(t){let{effectiveTheme:n}=t.view,r=n.accentColor.toUnitRGBA(),i=[0,0,0,0];return{intersectionPointColor:i,intersectionPointOutlineColor:r,pointColor:i,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e(n.accentColor,.5).toUnitRGBA(),rightAngleOutlineColor:r}}function x(e,t,{selfSnappingZ:n,view:r,spatialReference:i}){return t&2&&m(e)&&n!=null?h(e,n,r,i):e}function S(e){return e.isDraped?o:s}function C(e,t,n,r,i,a,o,s=!1,c=!0,u=!0){let d=w(t,r,i,a,s),f=w(n,r,i,a,s),p=new l({view:a,extensionType:3,start:d,end:f,isDraped:s,color:o.lineColor,renderOccluded:s?4:16,renderGroup:3,isDecoration:!0});switch(e){case 0:p.width=g.lineHintWidthTarget,p.fadedExtensions={start:0,end:g.lineHintFadedExtensions};break;case 2:p.width=g.lineHintWidthReference,p.fadedExtensions={start:0,end:0};break;case 1:p.width=g.lineHintWidthReference,p.fadedExtensions={start:c?g.lineHintFadedExtensions:0,end:u?g.lineHintFadedExtensions:0}}return p.attached=!0,p}function w(e,t,n,r,o){let s=i();if(o){let n=r.overlayManager.spatialReference;a(e,t,s,n)}else c(e,t,n,r,s);return s}export{y as SnappingVisualizer3D};
2
+ import{multiplyOpacity as e}from"../../../core/colorUtils.js";import{destroyHandle as t,makeHandle as n}from"../../../core/handleUtils.js";import{lerp as r}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as a}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as o,absoluteHeightElevationInfo as s}from"../../../support/elevationInfoUtils.js";import{vectorToRender as c}from"./support/viewUtils.js";import{ExtendedLineVisualElement as l}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as u}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as f}from"./visualElements/RightAngleQuadVisualElement.js";import{createDehydratedPoint as p,isTarget as m,withSelfSnappingZ as h}from"../../interactive/sketch/normalizedPoint.js";import{defaults as g}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as _}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as v}from"../../interactive/snapping/hints/LineSnappingHint.js";class y extends _{sortUniqueHints(e){return e.sort((e,t)=>(t instanceof v?t.length:0)-(e instanceof v?e.length:0))}visualizeIntersectionPoint(e,n){let{spatialReference:r,view:i}=n,a=b(n);return t(new d({view:i,primitive:`circle`,geometry:p(e.intersectionPoint,r),elevationInfo:e.isDraped?o:s,size:20,outlineSize:2,color:a.intersectionPointColor,outlineColor:a.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){let{view:r,spatialReference:i}=n,a=b(n),o=x(e.point,e.domain,n);return t(new d({view:r,primitive:`circle`,geometry:p(o,i),elevationInfo:S(e),size:20,outlineSize:2,color:a.pointColor,outlineColor:a.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n,r){let{view:i,spatialReference:a}=n,o=b(n),s=x(e.lineStart,e.domain,n),c=x(e.lineEnd,e.domain,n);return t(C(e.type,s,c,a,S(e),i,o,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeCurve(e,t){return n()}visualizeParallelSign(e,n,i){let{view:a,spatialReference:o}=n,s=b(n),{isDraped:c}=e,l=S(e),d=x(e.lineStart,e.domain,n),f=x(e.lineEnd,e.domain,n),p=w(d,o,l,a,c),m=w(f,o,l,a,c),h=r(m,p,m,.5),_=new u({view:a,attached:!1,offset:g.parallelLineHintOffset,length:g.parallelLineHintLength,width:g.parallelLineHintWidth,color:s.parallelSignColor,location:h,renderOccluded:c?4:16,transparentRenderOrder:i,isDraped:c,renderGroup:3,isDecoration:!0});return _.setDirectionFromPoints(p,h),_.attached=!0,t(_)}visualizeRightAngleQuad(e,n,r){let{view:i,spatialReference:a}=n,o=b(n),s=S(e),{isDraped:c}=e,l=x(e.previousVertex,e.domain,n),u=x(e.centerVertex,e.domain,n),d=x(e.nextVertex,e.domain,n),p=w(l,a,s,i,c),m=w(u,a,s,i,c),h=w(d,a,s,i,c);return t(new f({view:i,attached:!0,color:c?o.rightAngleColorDraped:o.rightAngleColor,renderOccluded:c?4:2,outlineRenderOccluded:c?4:16,outlineColor:o.rightAngleOutlineColor,outlineSize:g.rightAngleHintOutlineSize,size:g.rightAngleHintSize,transparentRenderOrder:r,isDraped:c,geometry:{previous:p,center:m,next:h},renderGroup:3,isDecoration:!0}))}}function b(t){let{effectiveTheme:n}=t.view,r=n.accentColor.toUnitRGBA(),i=[0,0,0,0];return{intersectionPointColor:i,intersectionPointOutlineColor:r,pointColor:i,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e(n.accentColor,.5).toUnitRGBA(),rightAngleOutlineColor:r}}function x(e,t,{selfSnappingZ:n,view:r,spatialReference:i}){return t&2&&m(e)&&n!=null?h(e,n,r,i):e}function S(e){return e.isDraped?o:s}function C(e,t,n,r,i,a,o,s,c=!1,u=!0,d=!0){let f=w(t,r,i,a,c),p=w(n,r,i,a,c),m=new l({view:a,extensionType:3,start:f,end:p,isDraped:c,color:o.lineColor,renderOccluded:c?4:16,transparentRenderOrder:s,renderGroup:3,isDecoration:!0});switch(e){case 0:m.width=g.lineHintWidthTarget,m.fadedExtensions={start:0,end:g.lineHintFadedExtensions};break;case 2:m.width=g.lineHintWidthReference,m.fadedExtensions={start:0,end:0};break;case 1:m.width=g.lineHintWidthReference,m.fadedExtensions={start:u?g.lineHintFadedExtensions:0,end:d?g.lineHintFadedExtensions:0}}return m.attached=!0,m}function w(e,t,n,r,o){let s=i();if(o){let n=r.overlayManager.spatialReference;a(e,t,s,n)}else c(e,t,n,r,s);return s}export{y as SnappingVisualizer3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(e==null||this._stippleOffColor==null||!o(e,this._stippleOffColor))&&(this._stippleOffColor=e==null?null:l(e),this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??N,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset?3:0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new T(this.materialParameters,this.view.state.isGlobal),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){let r=this._createGeometry(e);n.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new T(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new w(t)}_createGeometry(e){let t=this.extensionType===3,n=t?[i(),i(),i(),i()]:[i(),i()];return C(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===3?this._updateLineSegmentFinite(j):this._updateLineSegmentInfinite(this._extensionType,j)}_updateLineSegmentFinite(e){return h(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let n=this.view.state.camera;switch(u(this._ray,O),e){case 0:O.c0=-Number.MAX_VALUE;break;case 1:case 2:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,`ground`)??0,n=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&n<t&&r(O.ray.direction,O.ray.direction),this._extensionType===2&&t!=null&&(O.c1=Math.abs(n-t));break}}if(!m(n.frustum,O))return this._updateLineSegmentFinite(t);let i=d(O,k),a=f(O,A);return h(i,a,t)}_updateVertexAttributesObject3D(e,t){let n=e.geometries[0].getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],`position`)}_updateVertexAttributesDraped(e,t){let n=e.getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=S;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===3?(yield g(e,-this.fadedExtensions.start,k),yield g(e,0,k),yield g(e,1,k),yield g(e,1+this.fadedExtensions.end,k)):(yield g(e,0,k),yield g(e,1,k))}}function D(e){e.geometries=[]}const O=p(),k=i(),A=i(),j=_(),M=1/3,N={start:M,end:M};export{E as ExtendedLineVisualElement};
2
+ import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(e==null||this._stippleOffColor==null||!o(e,this._stippleOffColor))&&(this._stippleOffColor=e==null?null:l(e),this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??N,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset?3:0,renderOccluded:this._normalizedRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new T(this.materialParameters,this.view.state.isGlobal),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){let r=this._createGeometry(e);n.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new T(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new w(t)}_createGeometry(e){let t=this.extensionType===3,n=t?[i(),i(),i(),i()]:[i(),i()];return C(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===3?this._updateLineSegmentFinite(j):this._updateLineSegmentInfinite(this._extensionType,j)}_updateLineSegmentFinite(e){return h(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let n=this.view.state.camera;switch(u(this._ray,O),e){case 0:O.c0=-Number.MAX_VALUE;break;case 1:case 2:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,`ground`)??0,n=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&n<t&&r(O.ray.direction,O.ray.direction),this._extensionType===2&&t!=null&&(O.c1=Math.abs(n-t));break}}if(!m(n.frustum,O))return this._updateLineSegmentFinite(t);let i=d(O,k),a=f(O,A);return h(i,a,t)}_updateVertexAttributesObject3D(e,t){let n=e.geometries[0].getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],`position`)}_updateVertexAttributesDraped(e,t){let n=e.getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=S;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===3?(yield g(e,-this.fadedExtensions.start,k),yield g(e,0,k),yield g(e,1,k),yield g(e,1+this.fadedExtensions.end,k)):(yield g(e,0,k),yield g(e,1,k))}}function D(e){e.geometries=[]}const O=p(),k=i(),A=i(),j=_(),M=1/3,N={start:M,end:M};export{E as ExtendedLineVisualElement};