@arcgis/core 5.2.0-next.30 → 5.2.0-next.32

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 (156) hide show
  1. package/WebDocument2D.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/ArcadePortal.js +1 -1
  4. package/arcade/Attachment.js +1 -1
  5. package/arcade/Dictionary.js +1 -1
  6. package/arcade/Feature.js +1 -1
  7. package/arcade/arcadeAsyncRuntime.js +1 -1
  8. package/arcade/arcadeCompiler.js +1 -1
  9. package/arcade/arcadeRuntime.js +1 -1
  10. package/arcade/containerUtils.js +1 -1
  11. package/arcade/debug.js +1 -1
  12. package/arcade/deepClone.js +1 -1
  13. package/arcade/featureSetUtils.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  15. package/arcade/featureset/support/shared.js +1 -1
  16. package/arcade/functions/convertdirection.js +1 -1
  17. package/arcade/functions/date.js +1 -1
  18. package/arcade/functions/feature.js +1 -1
  19. package/arcade/functions/featuresetbase.js +1 -1
  20. package/arcade/functions/featuresetgeom.js +1 -1
  21. package/arcade/functions/featuresetstats.js +1 -1
  22. package/arcade/functions/featuresetstring.js +1 -1
  23. package/arcade/functions/geomasync.js +1 -1
  24. package/arcade/functions/geometry.js +1 -1
  25. package/arcade/functions/geomsync.js +1 -1
  26. package/arcade/functions/knowledgegraph.js +1 -1
  27. package/arcade/functions/maths.js +1 -1
  28. package/arcade/functions/stats.js +1 -1
  29. package/arcade/functions/string.js +1 -1
  30. package/arcade/geometry/constructors.js +1 -1
  31. package/arcade/geometry/functions.js +1 -1
  32. package/arcade/languageUtils.js +1 -1
  33. package/assets/esri/core/workers/RemoteClient.js +1 -1
  34. package/assets/esri/core/workers/chunks/{e5d2fab228d54b18a8a8.js → 08405116b5feb2d00101.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{774615303c1cc9a77e20.js → 11af659688cf963ea6cd.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{2665337e1b665e7e2b70.js → 15081b361fc42f40b865.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{bcb2092c87d8d21c6458.js → 197b9f8483fad2258650.js} +1 -1
  38. package/assets/esri/core/workers/chunks/1cd8dff4373494b01ad4.js +1 -0
  39. package/assets/esri/core/workers/chunks/1d92da90fbbc3f98b201.js +1 -0
  40. package/assets/esri/core/workers/chunks/210ffc448c73a7bf63aa.js +1 -0
  41. package/assets/esri/core/workers/chunks/{a14e5607c5c091c77e3d.js → 2540beb53f1443a070d7.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{689673173ca1c0e098fe.js → 25932fa010f9a32475c1.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{e2d500ac1a264d09c857.js → 32b5d2537feefe6e94a3.js} +1 -1
  44. package/assets/esri/core/workers/chunks/34a024eda22d228e1fbe.js +1 -0
  45. package/assets/esri/core/workers/chunks/3f63b14b53b5ca716e3a.js +1 -0
  46. package/assets/esri/core/workers/chunks/{6df54132299b9e8f6dad.js → 456b77b8f13933a75b68.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{3c342e662c13a05f4caf.js → 49713dfa4c8b788079d1.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{45e4b9069263adeae394.js → 49a45083a9a155614c1c.js} +1 -1
  49. package/assets/esri/core/workers/chunks/4be31fcc5482a2526d2b.js +1 -0
  50. package/assets/esri/core/workers/chunks/{31d92ba9089617aa59ab.js → 57c003c6745d450558a7.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{8104ac2eee69d79ada86.js → 6048c89fc4dcd2e9988d.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{1b9c68e8431bb4608209.js → 6162f6735ea4622e54d8.js} +1 -1
  53. package/assets/esri/core/workers/chunks/684c9b4bd9590d2db12f.js +1 -0
  54. package/assets/esri/core/workers/chunks/684d3cb4fb233180b2d0.js +1 -0
  55. package/assets/esri/core/workers/chunks/{fe6385115d76e16e8da0.js → 75baf6dff6e7658b17b3.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{166a0df6e37627e18976.js → 7a2dfa42610fe8414ed7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{43847d66726fd0bcbbb7.js → 83ae56c7fa8d84865605.js} +1 -1
  58. package/assets/esri/core/workers/chunks/8722e2790272e90a1897.js +1 -0
  59. package/assets/esri/core/workers/chunks/{1282598516cd0e3056b7.js → 977e6f589bd266d6067d.js} +2 -2
  60. package/assets/esri/core/workers/chunks/9f3d37e5f42bf1529673.js +1 -0
  61. package/assets/esri/core/workers/chunks/a833fc9250635eb4152f.js +1 -0
  62. package/assets/esri/core/workers/chunks/{47290f27375c76bcc9c7.js → b0253fe7b3529bc22270.js} +1 -1
  63. package/assets/esri/core/workers/chunks/b324bdb9c74fc3f956db.js +1 -0
  64. package/assets/esri/core/workers/chunks/{1bd7b7f4ee7ea6cb7ef9.js → b60f24a6c777301803f4.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bd155794e9bc16dd0474.js +1 -0
  66. package/assets/esri/core/workers/chunks/{906f4c0fa8135e6c2f03.js → c660a5a1086870a3a6b9.js} +1 -1
  67. package/assets/esri/core/workers/chunks/cb58aff1ff186fa18345.js +1 -0
  68. package/assets/esri/core/workers/chunks/{17b98787a0698f584882.js → e7cb1b72f0b54e845741.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{21122f3f3e19a7fd7d33.js → f69d3ff8a69c1985bca3.js} +1 -1
  70. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  71. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  72. package/chunks/ShadowCastVisualize.glsl.js +4 -10
  73. package/chunks/aiServices.js +1 -1
  74. package/chunks/array.js +1 -1
  75. package/chunks/languageUtils.js +1 -1
  76. package/chunks/lyr3DMain.js +1 -1
  77. package/config.js +1 -1
  78. package/core/has.js +1 -1
  79. package/graphic/AnnotationFeatureGraphicOrigin.d.ts +3 -3
  80. package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
  81. package/intl/messages.d.ts +12 -2
  82. package/intl/t9n.d.ts +8 -1
  83. package/intl.d.ts +4 -0
  84. package/kernel.js +1 -1
  85. package/layers/AnnotationFeatureLayer.d.ts +1 -4
  86. package/layers/AnnotationFeatureLayer.js +1 -1
  87. package/layers/DimensionFeatureLayer.js +1 -1
  88. package/layers/VoxelWasmPerSceneView.js +1 -1
  89. package/layers/mixins/DataElementMixin.js +2 -0
  90. package/layers/support/AnnotationFeatureSublayer.js +1 -1
  91. package/layers/support/parquetUtils.js +1 -1
  92. package/package.json +1 -1
  93. package/support/ArcadeExpression.js +1 -1
  94. package/support/arcadeUtils.js +1 -1
  95. package/support/revision.js +1 -1
  96. package/symbols/cim/supportUtils.js +2 -0
  97. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  98. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  99. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  100. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  101. package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
  102. package/views/2d/layers/support/annodime/dimensionSchema.js +1 -1
  103. package/views/2d/layers/support/annodime/utils.js +1 -1
  104. package/views/2d/layers/support/annodime/virtualFields.js +1 -1
  105. package/views/3d/camera/constraintUtils.js +1 -1
  106. package/views/3d/state/ConstraintsManager.js +1 -1
  107. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  108. package/views/3d/terrain/PatchRenderData.js +1 -1
  109. package/views/3d/terrain/PatchRenderDataWaterproofness.js +2 -0
  110. package/views/3d/terrain/PlanarPatch.js +1 -1
  111. package/views/3d/terrain/SphericalPatch.js +1 -1
  112. package/views/3d/terrain/TileRenderer.js +1 -1
  113. package/views/3d/webgl-engine/effects/OpaqueEnvironment.js +1 -1
  114. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  115. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  116. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
  117. package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerID.js +1 -1
  118. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  119. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  120. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  121. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  122. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  123. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  124. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  125. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  126. package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
  127. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  128. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  129. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  130. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  131. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  132. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  133. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  134. package/views/3d/webgl.js +1 -1
  135. package/views/PopupView.js +1 -1
  136. package/views/layers/FeatureLikeLayerView.js +1 -1
  137. package/views/popupAdapter.js +1 -1
  138. package/webdoc/support/thumbnailUtils.js +1 -1
  139. package/webdoc/support/webdocSaveUtils.js +1 -1
  140. package/widgets/support/widget.d.ts +1 -0
  141. package/assets/esri/core/workers/chunks/125edba5c618c6257cb8.js +0 -1
  142. package/assets/esri/core/workers/chunks/168be2eac0fa3c67ae27.js +0 -1
  143. package/assets/esri/core/workers/chunks/32740b075d7a890d7888.js +0 -1
  144. package/assets/esri/core/workers/chunks/5189413a83faf3480e29.js +0 -1
  145. package/assets/esri/core/workers/chunks/a2be8784f2cfdbb42681.js +0 -1
  146. package/assets/esri/core/workers/chunks/a9db775210ebeee41738.js +0 -1
  147. package/assets/esri/core/workers/chunks/bca6abc185dedec0f41b.js +0 -1
  148. package/assets/esri/core/workers/chunks/bee56a6ac99312f03109.js +0 -1
  149. package/assets/esri/core/workers/chunks/d1d135a54233092ad637.js +0 -1
  150. package/assets/esri/core/workers/chunks/d750e4abeb777caa8c36.js +0 -1
  151. package/assets/esri/core/workers/chunks/daf539e9f88fc9e101e4.js +0 -1
  152. package/assets/esri/core/workers/chunks/e774303efefee31952d0.js +0 -1
  153. package/assets/esri/core/workers/chunks/e8546ab510fc9515bd23.js +0 -1
  154. package/assets/esri/core/workers/chunks/fc9664d3282b052ef40f.js +0 -1
  155. package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +0 -2
  156. package/views/2d/layers/support/annodime/unsupported.js +0 -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"../request.js";import has from"../core/has.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as o,subclass as l}from"../core/accessorSupport/decorators.js";import{distance as h}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as u}from"../geometry/support/coordinateSystem.js";import{loadVoxelWASM as _}from"../libs/vxl/VxlModule.js";import{InternalRenderCategory as c}from"../views/3d/webgl.js";import{VoxelGraphic as m}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as f}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as p}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as g}from"../views/3d/support/RenderCoordsHelper.js";import y from"../views/3d/webgl/RenderNode.js";import{IntersectorResult as x}from"../views/3d/webgl-engine/lib/IntersectorResult.js";let v=class extends y{constructor(e){super(e),this._havePreparedWithAllLayers=!1,this.produces="disabled",this.consumes={required:[c.VOXEL]},this._vxlPromise=null,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=9,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerViewUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(4===e?s.getLogger(this).error(t):s.getLogger(this).warn(t))}initialize(){this._dbg(1,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i(()=>"local"===this.view.viewingMode,e=>{e?(this._dbg(1,"view switched to local view, enabling rendering"),this.produces=c.VOXEL,this.view.sceneIntersectionHelper.addIntersectionHandler(this)):(this._dbg(1,"view switched to global view, disabling rendering"),this.view.sceneIntersectionHelper.removeIntersectionHandler(this),this.produces="disabled")},a),i(()=>this.view?.qualityProfile,e=>{this._dbg(3,"qualityProfile changed to "+e),this._vxl?.set_quality(this._toWasmQuality(e))},a),i(()=>this.view?.timeExtent,()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(3,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this.requestRender(1)}},a),i(()=>this.view?.stationary,e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this.requestRender(1)})])}get _rctx(){return this.renderContext?.rctx}get _halfIntTexturesAvailable(){return!!this._rctx?.capabilities.textureNorm16}get _textureFloatLinearAvailable(){return!!this._rctx?.capabilities.textureFloatLinear}_restoreFramebuffer(){if(!this._renderTargetToRestore||!this._rctx)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(4,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){if(!this._rctx||!this._renderTargetToRestore)return 0;const s=this._renderTargetToRestore.fbo?.depthStencilTexture;return s?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(s,e,!0),1):(this._dbg(4,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(4,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(4,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(4,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(519,0,255),this._rctx.setStencilOpSeparate(1028,7680,7682,7680),this._rctx.setStencilOpSeparate(1029,7680,7683,7680)):this._dbg(4,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case 1:this._rctx.setFaceCullingEnabled(!1);break;case 3:this._rctx.setCullFace(1029),this._rctx.setFaceCullingEnabled(!0);break;case 2:this._rctx.setCullFace(1028),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(4,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(4,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl?.estimate_memory_usage(t)??0;s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}})}_syncRequestsResponses(){this._vxl&&this._layers.forEach((e,s)=>{const i=[];e.responses.forEach((t,r)=>{i.push(r),this._dbg(2,"responding for requestID:"+r+" size:"+t.size),this._vxl?.respond(s,r,t),0!==t.requestType&&4!==t.requestType||(e.needMemoryUsageUpdate=!0)});const a=e.responses;for(const t of i)a.delete(t);const n=this._vxl.get_new_requests(s),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const s=n[l],i={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(2,"making requestID:"+l+" url:"+s.url),t(s.url,i).then(t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(2,"have response for requestID:"+l);let r=0;if(t.data.byteLength>0&&this._vxl){r=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),s=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=s[r]}a.set(+l,{responseType:s.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:s.requestType})}).catch(t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(4,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:s.responseType,ptr:0,size:0,success:!1,requestType:s.requestType}))})}})}updateWasmCamera(e){this._vxl?.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl?.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl?.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._vxl?(this._layers.forEach((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}}),t):t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl?.get_layer_current_time_id(r)??0)}),t}setEnabled(e,t){this._layers.forEach((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this.requestRender(1))})}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl?.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this.requestRender(1))}setStaticSections(e,t){const s={mask:1,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:1024,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:8192,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:256,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:32768,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:65536,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:4096,containerIsVisible:t,container:1};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:4096,containerIsVisible:t,container:0};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:4096,containerIsVisible:t,container:2};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:131072,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=n(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl?.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this.requestRender(1)}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl?.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl?._free(e.ptr))}}),r&&s&&this.requestRender(1),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[0],o=this._frustum.points[1],l=this._frustum.points[2],h=this._frustum.points[3],d=this._frustum.points[4],u=this._frustum.points[5],_=this._frustum.points[6],c=this._frustum.points[7];let m=0,f=0;const p=this._frustum.planes[4];m=this._addTriangleToWasmBuffer(r,m,l,o,n),f=this._addNormalToWasmBuffer(a,f,p),m=this._addTriangleToWasmBuffer(r,m,n,h,l),f=this._addNormalToWasmBuffer(a,f,p);const g=this._frustum.planes[5];m=this._addTriangleToWasmBuffer(r,m,d,u,_),f=this._addNormalToWasmBuffer(a,f,g),m=this._addTriangleToWasmBuffer(r,m,_,c,d),f=this._addNormalToWasmBuffer(a,f,g);const y=this._frustum.planes[3];m=this._addTriangleToWasmBuffer(r,m,_,l,h),f=this._addNormalToWasmBuffer(a,f,y),m=this._addTriangleToWasmBuffer(r,m,h,c,_),f=this._addNormalToWasmBuffer(a,f,y);const x=this._frustum.planes[2];m=this._addTriangleToWasmBuffer(r,m,n,o,u),f=this._addNormalToWasmBuffer(a,f,x),m=this._addTriangleToWasmBuffer(r,m,u,d,n),f=this._addNormalToWasmBuffer(a,f,x);const v=this._frustum.planes[0];m=this._addTriangleToWasmBuffer(r,m,h,n,d),f=this._addNormalToWasmBuffer(a,f,v),m=this._addTriangleToWasmBuffer(r,m,d,c,h),f=this._addNormalToWasmBuffer(a,f,v);const b=this._frustum.planes[1];m=this._addTriangleToWasmBuffer(r,m,l,_,u),f=this._addNormalToWasmBuffer(a,f,b),this._addTriangleToWasmBuffer(r,m,u,o,l),this._addNormalToWasmBuffer(a,f,b),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this.requestRender(1)}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=g.create(2,u(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new p(this._renderCoordsHelper)),this._captureFrustum=!0,this.requestRender(1)}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.toggle_full_volume_extent_draw(s),this.requestRender(1))})}dropQueryRenderTarget(){this._vxl?.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise((e,s)=>{t.resolveCallback=e,t.rejectCallback=s});return this._newLayers.push(t),s}const t=this._addVoxelLayer(e,this._vxl);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex(t=>e.uid===t.layerView.uid);t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(1,"No voxel layers left after removing a layer, destroying render node"),this.destroy()),s}let t=-1;this._layers.forEach((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl?.remove_layer(t);const i=this.layerViewUid.indexOf(e.uid);-1!==i&&this.layerViewUid.splice(i,1)}}),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(1,"No voxel layers left after removing a layer, destroying render node"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){if(!this._vxl)return!1;e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e,t){const r=e.layer;let i=-1;const a=r.getConfiguration();if(a.length<1)return-1;const o={str:a,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(o))return-1;const l=this._getTimeArgs(r.timeExtent),h=this.view.spatialReference.isWGS84&&r.spatialReference.isWGS84?111319.49079327357:1;let d=0;if(r.timeOffset&&(d=n(r.timeOffset.value,r.timeOffset.unit,"seconds")),i=t.add_layer(r.serviceRoot,o.ptr,o.byteCount,h,h,l.startTime,l.endTime,l.hasTime,r.useViewTime,d,this._toWasmQuality(this.view.qualityProfile)),o.isReusable||t._free(o.ptr),i>=0){r.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const t=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:t,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerViewUid.push(e.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let r="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let r="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&s.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}_prepareRender(){if(!this._vxl)return void this._initializeWasm();const e=this.bindParameters.camera.viewForward,t=this.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(t[0],t[1],t[2],e[0],e[1],e[2]);const s=this._vxl.cull();this._dbg(2,"missingResourceCount="+s),this._moreToLoad=s>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}render(){this._prepareRender();const e=this.bindRenderTarget();if(!this._vxl||!this._rctx)return this.requestRender(1),e;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView,this._vxl);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return this._dbg(4,"No voxel layers but RenderNode is being asked to render!"),e;this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(this._rctx),this._vxl.begin_color_frame(!this.view.stage.renderer.isFeatureEnabled(1),this.bindParameters.lighting.mainLight.direction[0],this.bindParameters.lighting.mainLight.direction[1],this.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;return t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(e=>e.needMemoryUsageUpdate=!0)),0===t.x&&0===t.y||this._dbg(4,"Unsupported viewport parameters detected!"),this.updateWasmCamera(this.bindParameters.camera),this._captureFrustum&&(this._frustum.update(this.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(this._rctx,this._vxl),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this.requestRender(1),e}destroy(){this._dbg(1,"--destroy--"),this._vxl&&(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{0!==e&&this._vxl?._free(e)}),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(){if(this._vxl||this._vxlPromise||!this._rctx?.gl)return;const e=this._rctx.gl;this._vxlPromise=_(e).then(t=>{if(t.specialHTMLTargets.jsAPI3DRenderingContext=e,this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(1," no voxel layers left after WASM downloaded, removing RenderNode and destroying"),void this.destroy();const s=this._getTimeArgs(this.view?.timeExtent),r=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),i=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),a=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),n=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),o=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),l=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),h=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),d=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),u=this._halfIntTexturesAvailable&&!has("mac"),_=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(r,i,a,n,o,l,h,d,s.startTime,s.endTime,s.hasTime,u,_),this.requestRender(1)}).catch(()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(4," WASM failed to download, destroying render node"),this.destroy()})}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(4,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw(this._rctx);const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(this._rctx,this._vxl),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(4,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw(this._rctx);const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(this._rctx,this._vxl),l}async getOtherFieldPopupValues(e,s){if(!this._vxl)return[];for(const r of e){const e=r.gpuResult;if(!e)continue;const i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;const a=i.layerView.layer,n={responseType:"array-buffer",signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},o=e.voxelSpacePosition,l=[Math.floor(o[0]/32),Math.floor(o[1]/32),Math.floor(o[2]/32)],h=[-4&l[0],-4&l[1],-4&l[2]];let d=0;if(e.epochTime){const t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let s=0;s<t.length;++s)if(t[s]===e.epochTime/1e3){d=s;break}}const u=[],_={varIds:[],ptrs:[],sizes:[]};for(const r of s){const e=a.variables.findIndex(e=>e.name===r);if(-1===e)continue;const s=a.variables.getItemAt(e)?.id;if(null==s)continue;const i=`${a.url}/variables/${s}/${d}/bundles/0/${h[0]}-${h[1]}-${h[2]}`;u.push(t(i,n).then(e=>e.data)),_.varIds.push(s)}const c=await Promise.allSettled(u),m=c.length;for(let t=0;t<m;++t){const e=c[t];if("fulfilled"===e.status){const t=e.value,s=this._vxl._malloc(t.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,s,t.byteLength).set(new Uint8Array(t)),_.ptrs.push(s),_.sizes.push(t.byteLength)}else _.varIds.splice(t,1)}const f=this._vxl.get_other_field_popup_values(e,_);for(let t=0;t<_.ptrs.length;++t)this._vxl._free(_.ptrs[t]);if(f.continuousValues)for(const t in f.continuousValues)r.attributes[t]=f.continuousValues[t];if(f.uniqueValues)for(const t in f.uniqueValues)r.attributes[t]=f.uniqueValues[t]}return e}_beforeDraw(e){this._renderTargetToRestore={fbo:e.boundFramebuffer,viewport:e.getViewport()},e.setPolygonOffsetFillEnabled(!1),e.setScissorTestEnabled(!1),e.setColorMask(!0,!0,!0,!0)}_afterDraw(e,t){this._renderTargetToRestore.fbo=null,e.externalTextureUnitUpdate(t.get_texture_units_bound_in_frame(),t.get_active_texture_unit()),e.externalVertexArrayObjectUpdate(),e.externalVertexBufferUpdate(),e.externalProgramUpdate()}intersectRay(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered||!e.camera)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(4,i?`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`:"[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=null"),null;const a=[];this._layers.forEach(t=>{e.options.filteredLayerViewUids.includes(t.layerView.uid)&&a.push(t.layerView.wasmLayerId)});const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/h(s,r),a=d();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={},u=o.layerView.layer,_=u.variables.findIndex(e=>e.id===u.currentVariableId);if(_>=0){const e=u.variables.getItemAt(_);null!=e&&(null!=n.continuousValue?l[e.name]=n.continuousValue:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l[e.name]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l[e.name]=`${n.uniqueValue}`),e.description.length>0?l["Voxel.CurrentVariable"]=e.description:e.name?.length>0&&(l["Voxel.CurrentVariable"]=e.name))}if(l["Voxel.Position"]=`[${n.voxelSpacePosition.toString()}]`,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.LocalTime"]=e,l["Voxel.SourceTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&(l["Voxel.Depth"]=n.depth);const c=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const m=e=>{const s=new f(a,t,()=>this._createVoxelGraphic(o.layerView.layer,l,n));e.set(this.type,s,i,c)},p=e.results,g=2===e.options.store;if((null==p.min.distance||i<p.min.distance)&&m(p.min),(null==p.max.distance||i>p.max.distance)&&m(p.max),g){const t=new x(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,s){return new m({layer:e,sourceLayer:e,origin:e.graphicOrigin,attributes:t,gpuResult:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}};e([o()],v.prototype,"produces",void 0),e([o()],v.prototype,"consumes",void 0),v=e([l("esri.layers.VoxelWasmPerSceneView")],v);const b=v;export{b as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import has from"../core/has.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as o,subclass as l}from"../core/accessorSupport/decorators.js";import{distance as h}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as u}from"../geometry/support/coordinateSystem.js";import{loadVoxelWASM as _}from"../libs/vxl/VxlModule.js";import{InternalRenderCategory as c}from"../views/3d/webgl.js";import{VoxelGraphic as m}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as f}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as p}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as g}from"../views/3d/support/RenderCoordsHelper.js";import y from"../views/3d/webgl/RenderNode.js";import{IntersectorResult as x}from"../views/3d/webgl-engine/lib/IntersectorResult.js";let v=class extends y{constructor(e){super(e),this._havePreparedWithAllLayers=!1,this.consumes={required:[c.VOXEL]},this.produces="disabled",this._vxlPromise=null,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=9,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerViewUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(4===e?s.getLogger(this).error(t):s.getLogger(this).warn(t))}initialize(){this._dbg(1,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i(()=>"local"===this.view.viewingMode,e=>{e?(this._dbg(1,"view switched to local view, enabling rendering"),this.produces=c.VOXEL,this.view.sceneIntersectionHelper.addIntersectionHandler(this)):(this._dbg(1,"view switched to global view, disabling rendering"),this.view.sceneIntersectionHelper.removeIntersectionHandler(this),this.produces="disabled")},a),i(()=>this.view?.qualityProfile,e=>{this._dbg(3,"qualityProfile changed to "+e),this._vxl?.set_quality(this._toWasmQuality(e))},a),i(()=>this.view?.timeExtent,()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(3,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this.requestRender(1)}},a),i(()=>this.view?.stationary,e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this.requestRender(1)})])}get _rctx(){return this.renderContext?.rctx}get _halfIntTexturesAvailable(){return!!this._rctx?.capabilities.textureNorm16}get _textureFloatLinearAvailable(){return!!this._rctx?.capabilities.textureFloatLinear}_restoreFramebuffer(){if(!this._renderTargetToRestore||!this._rctx)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(4,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){if(!this._rctx||!this._renderTargetToRestore)return 0;const s=this._renderTargetToRestore.fbo?.depthStencilTexture;return s?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(s,e,!0),1):(this._dbg(4,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(4,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(4,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(4,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(519,0,255),this._rctx.setStencilOpSeparate(1028,7680,7682,7680),this._rctx.setStencilOpSeparate(1029,7680,7683,7680)):this._dbg(4,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case 1:this._rctx.setFaceCullingEnabled(!1);break;case 3:this._rctx.setCullFace(1029),this._rctx.setFaceCullingEnabled(!0);break;case 2:this._rctx.setCullFace(1028),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(4,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(4,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl?.estimate_memory_usage(t)??0;s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}})}_syncRequestsResponses(){this._vxl&&this._layers.forEach((e,s)=>{const i=[];e.responses.forEach((t,r)=>{i.push(r),this._dbg(2,"responding for requestID:"+r+" size:"+t.size),this._vxl?.respond(s,r,t),0!==t.requestType&&4!==t.requestType||(e.needMemoryUsageUpdate=!0)});const a=e.responses;for(const t of i)a.delete(t);const n=this._vxl.get_new_requests(s),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const s=n[l],i={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(2,"making requestID:"+l+" url:"+s.url),t(s.url,i).then(t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(2,"have response for requestID:"+l);let r=0;if(t.data.byteLength>0&&this._vxl){r=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),s=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=s[r]}a.set(+l,{responseType:s.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:s.requestType})}).catch(t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(4,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:s.responseType,ptr:0,size:0,success:!1,requestType:s.requestType}))})}})}updateWasmCamera(e){this._vxl?.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl?.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl?.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._vxl?(this._layers.forEach((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}}),t):t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl?.get_layer_current_time_id(r)??0)}),t}setEnabled(e,t){this._layers.forEach((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this.requestRender(1))})}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl?.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this.requestRender(1))}setStaticSections(e,t){const s={mask:1,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:1024,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:8192,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:256,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:32768,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:65536,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:4096,containerIsVisible:t,container:1};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:4096,containerIsVisible:t,container:0};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:4096,containerIsVisible:t,container:2};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:131072,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=n(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl?.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this.requestRender(1)}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl?.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl?._free(e.ptr))}}),r&&s&&this.requestRender(1),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[0],o=this._frustum.points[1],l=this._frustum.points[2],h=this._frustum.points[3],d=this._frustum.points[4],u=this._frustum.points[5],_=this._frustum.points[6],c=this._frustum.points[7];let m=0,f=0;const p=this._frustum.planes[4];m=this._addTriangleToWasmBuffer(r,m,l,o,n),f=this._addNormalToWasmBuffer(a,f,p),m=this._addTriangleToWasmBuffer(r,m,n,h,l),f=this._addNormalToWasmBuffer(a,f,p);const g=this._frustum.planes[5];m=this._addTriangleToWasmBuffer(r,m,d,u,_),f=this._addNormalToWasmBuffer(a,f,g),m=this._addTriangleToWasmBuffer(r,m,_,c,d),f=this._addNormalToWasmBuffer(a,f,g);const y=this._frustum.planes[3];m=this._addTriangleToWasmBuffer(r,m,_,l,h),f=this._addNormalToWasmBuffer(a,f,y),m=this._addTriangleToWasmBuffer(r,m,h,c,_),f=this._addNormalToWasmBuffer(a,f,y);const x=this._frustum.planes[2];m=this._addTriangleToWasmBuffer(r,m,n,o,u),f=this._addNormalToWasmBuffer(a,f,x),m=this._addTriangleToWasmBuffer(r,m,u,d,n),f=this._addNormalToWasmBuffer(a,f,x);const v=this._frustum.planes[0];m=this._addTriangleToWasmBuffer(r,m,h,n,d),f=this._addNormalToWasmBuffer(a,f,v),m=this._addTriangleToWasmBuffer(r,m,d,c,h),f=this._addNormalToWasmBuffer(a,f,v);const b=this._frustum.planes[1];m=this._addTriangleToWasmBuffer(r,m,l,_,u),f=this._addNormalToWasmBuffer(a,f,b),this._addTriangleToWasmBuffer(r,m,u,o,l),this._addNormalToWasmBuffer(a,f,b),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this.requestRender(1)}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=g.create(2,u(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new p(this._renderCoordsHelper)),this._captureFrustum=!0,this.requestRender(1)}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl?.toggle_full_volume_extent_draw(s),this.requestRender(1))})}dropQueryRenderTarget(){this._vxl?.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise((e,s)=>{t.resolveCallback=e,t.rejectCallback=s});return this._newLayers.push(t),s}const t=this._addVoxelLayer(e,this._vxl);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex(t=>e.uid===t.layerView.uid);t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(1,"No voxel layers left after removing a layer, destroying render node"),this.destroy()),s}let t=-1;this._layers.forEach((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl?.remove_layer(t);const i=this.layerViewUid.indexOf(e.uid);-1!==i&&this.layerViewUid.splice(i,1)}}),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(1,"No voxel layers left after removing a layer, destroying render node"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){if(!this._vxl)return!1;e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e,t){const r=e.layer;let i=-1;const a=r.getConfiguration();if(a.length<1)return-1;const o={str:a,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(o))return-1;const l=this._getTimeArgs(r.timeExtent),h=this.view.spatialReference.isWGS84&&r.spatialReference.isWGS84?111319.49079327357:1;let d=0;if(r.timeOffset&&(d=n(r.timeOffset.value,r.timeOffset.unit,"seconds")),i=t.add_layer(r.serviceRoot,o.ptr,o.byteCount,h,h,l.startTime,l.endTime,l.hasTime,r.useViewTime,d,this._toWasmQuality(this.view.qualityProfile)),o.isReusable||t._free(o.ptr),i>=0){r.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const t=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:t,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerViewUid.push(e.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let r="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let r="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&s.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}_prepareRender(){if(!this._vxl)return void this._initializeWasm();const e=this.bindParameters.camera.viewForward,t=this.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(t[0],t[1],t[2],e[0],e[1],e[2]);const s=this._vxl.cull();this._dbg(2,"missingResourceCount="+s),this._moreToLoad=s>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}render(){this._prepareRender();const e=this.bindRenderTarget();if(!this._vxl||!this._rctx)return this.requestRender(1),e;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView,this._vxl);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return this._dbg(4,"No voxel layers but RenderNode is being asked to render!"),e;this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(this._rctx),this._vxl.begin_color_frame(!this.view.stage.renderer.isFeatureEnabled(1),this.bindParameters.lighting.mainLight.direction[0],this.bindParameters.lighting.mainLight.direction[1],this.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;return t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(e=>e.needMemoryUsageUpdate=!0)),0===t.x&&0===t.y||this._dbg(4,"Unsupported viewport parameters detected!"),this.updateWasmCamera(this.bindParameters.camera),this._captureFrustum&&(this._frustum.update(this.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(this._rctx,this._vxl),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this.requestRender(1),e}destroy(){this._dbg(1,"--destroy--"),this._vxl&&(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{0!==e&&this._vxl?._free(e)}),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(){if(this._vxl||this._vxlPromise||!this._rctx?.gl)return;const e=this._rctx.gl;this._vxlPromise=_(e).then(t=>{if(t.specialHTMLTargets.jsAPI3DRenderingContext=e,this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(1," no voxel layers left after WASM downloaded, removing RenderNode and destroying"),void this.destroy();const s=this._getTimeArgs(this.view?.timeExtent),r=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),i=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),a=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),n=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),o=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),l=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),h=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),d=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),u=this._halfIntTexturesAvailable&&!has("mac"),_=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(r,i,a,n,o,l,h,d,s.startTime,s.endTime,s.hasTime,u,_),this.requestRender(1)}).catch(()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(4," WASM failed to download, destroying render node"),this.destroy()})}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(4,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw(this._rctx);const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(this._rctx,this._vxl),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(4,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw(this._rctx);const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(this._rctx,this._vxl),l}async getOtherFieldPopupValues(e,s){if(!this._vxl)return[];for(const r of e){const e=r.gpuResult;if(!e)continue;const i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;const a=i.layerView.layer,n={responseType:"array-buffer",signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},o=e.voxelSpacePosition,l=[Math.floor(o[0]/32),Math.floor(o[1]/32),Math.floor(o[2]/32)],h=[-4&l[0],-4&l[1],-4&l[2]];let d=0;if(e.epochTime){const t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let s=0;s<t.length;++s)if(t[s]===e.epochTime/1e3){d=s;break}}const u=[],_={varIds:[],ptrs:[],sizes:[]};for(const r of s){const e=a.variables.findIndex(e=>e.name===r);if(-1===e)continue;const s=a.variables.getItemAt(e)?.id;if(null==s)continue;const i=`${a.url}/variables/${s}/${d}/bundles/0/${h[0]}-${h[1]}-${h[2]}`;u.push(t(i,n).then(e=>e.data)),_.varIds.push(s)}const c=await Promise.allSettled(u),m=c.length;for(let t=0;t<m;++t){const e=c[t];if("fulfilled"===e.status){const t=e.value,s=this._vxl._malloc(t.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,s,t.byteLength).set(new Uint8Array(t)),_.ptrs.push(s),_.sizes.push(t.byteLength)}else _.varIds.splice(t,1)}const f=this._vxl.get_other_field_popup_values(e,_);for(let t=0;t<_.ptrs.length;++t)this._vxl._free(_.ptrs[t]);if(f.continuousValues)for(const t in f.continuousValues)r.attributes[t]=f.continuousValues[t];if(f.uniqueValues)for(const t in f.uniqueValues)r.attributes[t]=f.uniqueValues[t]}return e}_beforeDraw(e){this._renderTargetToRestore={fbo:e.boundFramebuffer,viewport:e.getViewport()},e.setPolygonOffsetFillEnabled(!1),e.setScissorTestEnabled(!1),e.setColorMask(!0,!0,!0,!0)}_afterDraw(e,t){this._renderTargetToRestore.fbo=null,e.externalTextureUnitUpdate(t.get_texture_units_bound_in_frame(),t.get_active_texture_unit()),e.externalVertexArrayObjectUpdate(),e.externalVertexBufferUpdate(),e.externalProgramUpdate()}intersectRay(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered||!e.camera)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(4,i?`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`:"[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=null"),null;const a=[];this._layers.forEach(t=>{e.options.filteredLayerViewUids.includes(t.layerView.uid)&&a.push(t.layerView.wasmLayerId)});const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/h(s,r),a=d();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={},u=o.layerView.layer,_=u.variables.findIndex(e=>e.id===u.currentVariableId);if(_>=0){const e=u.variables.getItemAt(_);null!=e&&(null!=n.continuousValue?l[e.name]=n.continuousValue:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l[e.name]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l[e.name]=`${n.uniqueValue}`),e.description.length>0?l["Voxel.CurrentVariable"]=e.description:e.name?.length>0&&(l["Voxel.CurrentVariable"]=e.name))}if(l["Voxel.Position"]=`[${n.voxelSpacePosition.toString()}]`,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.LocalTime"]=e,l["Voxel.SourceTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&(l["Voxel.Depth"]=n.depth);const c=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const m=e=>{const s=new f(a,t,()=>this._createVoxelGraphic(o.layerView.layer,l,n));e.set(this.type,s,i,c)},p=e.results,g=2===e.options.store;if((null==p.min.distance||i<p.min.distance)&&m(p.min),(null==p.max.distance||i>p.max.distance)&&m(p.max),g){const t=new x(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,s){return new m({layer:e,sourceLayer:e,origin:e.graphicOrigin,attributes:t,gpuResult:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}};e([o()],v.prototype,"consumes",void 0),e([o()],v.prototype,"produces",void 0),v=e([l("esri.layers.VoxelWasmPerSceneView")],v);const b=v;export{b as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import{join as o}from"../../core/urlUtils.js";import{subclass as n}from"../../core/accessorSupport/decorators.js";import{fixUnsupportedCIM as s}from"../../symbols/cim/supportUtils.js";const l=l=>{const a=l;let i=class extends a{async loadDataElement(e){if(!this.url||null==this.layerId)throw new r("fetchDataElement:missing-url-or-layerId","The layer must have a url and a layerId to fetch the data element.");const n=o(this.url,"queryDataElements"),l={f:"json",layers:this.layerId},{data:a}=await t(n,{...e,responseType:"json",query:l}),i=a.layerDataElements.find(e=>e.layerId===this.layerId)?.dataElement;if(!i)throw new r("fetchDataElement:not-available","A data element for this layer could not be retrieved.");const f=i.extensionProperties?.propertySetItems??[],y=c(f),d=s(m(f)),p=s(u(f));this.read({referenceScale:y,symbolCollection:d,styleCollection:p},{origin:"service"})}};return i=e([n("esri.layers.mixins.DataElementMixin")],i),i};function a(e,t){const r=e.indexOf(t);if(-1===r)return;return e[r+1]}function i(e,t){const r=a(e,t);return r&&"string"==typeof r?JSON.parse(r):null}function c(e){const t=a(e,"ReferenceScale")??0;return"string"!=typeof t?t:parseFloat(t)}function m(e){return i(e,"SymbolCollection")??void 0}function u(e){return i(e,"StyleCollection")??void 0}export{l as DataElementMixin};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{Loadable as r}from"../../core/Loadable.js";import{property as i,subclass as p}from"../../core/accessorSupport/decorators.js";import s from"../../graphic/AnnotationFeatureGraphicOrigin.js";let a=class extends(e(o(r))){constructor(t){super(t),this.graphicOrigin=new s(this),this.parent=null,this.subtypeCode=null,this.type="annotation-feature-sublayer",this.visible=!0}get title(){return this.parent?.subtypes?.find(t=>t.code===this.subtypeCode)?.name??null}};t([i({readOnly:!0,clonable:!1})],a.prototype,"graphicOrigin",void 0),t([i({clonable:!1})],a.prototype,"parent",void 0),t([i({type:Number})],a.prototype,"subtypeCode",void 0),t([i({readOnly:!0})],a.prototype,"title",null),t([i({readOnly:!0})],a.prototype,"type",void 0),t([i({type:Boolean})],a.prototype,"visible",void 0),a=t([p("esri.layers.support.AnnotationFeatureSublayer")],a);export{a as default};
2
+ import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{IdentifiableMixin as r}from"../../core/Identifiable.js";import{Loadable as o}from"../../core/Loadable.js";import{property as i,subclass as p}from"../../core/accessorSupport/decorators.js";import n from"../../graphic/AnnotationFeatureGraphicOrigin.js";let a=class extends(e(r(o))){constructor(t){super(t),this.parent=null,this.subtypeCode=null,this.type="annotation-feature-sublayer",this.visible=!0}get graphicOrigin(){return new n(this.parent,this)}get title(){return this.parent?.subtypes?.find(t=>t.code===this.subtypeCode)?.name??null}};t([i({readOnly:!0,clonable:!1})],a.prototype,"graphicOrigin",null),t([i({clonable:!1})],a.prototype,"parent",void 0),t([i({type:Number})],a.prototype,"subtypeCode",void 0),t([i({readOnly:!0})],a.prototype,"title",null),t([i({readOnly:!0})],a.prototype,"type",void 0),t([i({type:Boolean})],a.prototype,"visible",void 0),a=t([p("esri.layers.support.AnnotationFeatureSublayer")],a);export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../geometry/SpatialReference.js";import{createFileProvider as o}from"../graphics/sources/parquet/createFileProvider.js";import n from"./Field.js";import{isNumericField as a}from"./fieldUtils.js";import{fromParquetGeometryEncodingJSON as s}from"./parquetEncodingUtils.js";import l from"./ParquetFilesData.js";const p=new r({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function m(e){return p.toJSON(e)}function d(e){return p.fromJSON(e)}async function f(t,r={}){const i=Array.isArray(t)?new l({urls:new e(t)}):t,n=await y(i,r),a=o(n,null,()=>r.customParameters);return u(await a.getMetadata(),{data:i})}async function u(e,r){if(r.geometryType&&r.spatialReference&&r.geometryEncoding&&r.fields&&r.displayOptimization)return r;if(!e)throw new t("parquet:bad-input","No metadata found");const o={...r};if(null==o.fields)o.fields=e.fields.map(e=>n.fromJSON(e));else{const t=new Set(o.fields.map(e=>e.name)),r=e.fields.map(e=>n.fromJSON(e));for(const e of r)t.has(e.name)||o.fields.push(e)}if(null!=o.geometryEncoding){const e=o.geometryEncoding;switch(e.type){case"wkb":{const r=o.fields.find(t=>t.name===e.field);if(!r)throw new t("parquet:unsupported",`Geometry encoding references field ${e.field} which does not exist`);if("blob"!==r.type)throw new t("parquet:unsupported",`Invalid field type for geometry encoding. Found ${r.type} but expected 'blob'`);break}case"location":for(const r of[e.xField,e.yField])if(null!=r){const e=o.fields.find(e=>e.name===r);if(!e)throw new t("parquet:unsupported",`Geometry encoding references field ${r} which does not exist`);if(!a(e))throw new t("parquet:unsupported",`Invalid field type for location geometry encoding. Found ${e.type} but expected a numeric`)}}}return null==o.geometryEncoding&&(o.geometryEncoding=e.geometryEncoding?s(e.geometryEncoding):null),o.fields=c(o.fields,e),!o.displayOptimization&&e.displayOptimization&&(o.displayOptimization=e.displayOptimization),!o.geometryType&&e.geometryType&&(o.geometryType=d(e.geometryType)),!o.spatialReference&&e.spatialReference&&(o.spatialReference=i.fromJSON(e.spatialReference)),o}function c(e,t){const r=t.geoMetadata;if(null==r)return e;const i=new Set(Object.keys(r.columns));return e.filter(e=>!i.has(e.name))}async function y(e,r){switch(e.type){case"files":return{type:"urls",urls:e.urls.toArray()};case"portal-item":{const i=await e.portalItem.load(r);switch(i.type){case"Apache Parquet":return{type:"portal-parquet-file",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,modified:i.modified,size:i.size};case"Parquet layer":case"Parquet Layer":case"Parquet feature layer":case"Parquet Feature Layer":if(!i.url)throw new t("parquet:bad-item",`Item of type ${i.type} must have a url defined`,i);return{type:"portal-parquet-layer",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,itemMetadata:{modified:i.modified,url:i.url}};default:throw new t("parquet:bad-item",`Item of type ${i.type} is not supported`,i)}}}}export{u as completeParquetLayerInfo,y as createFileProviderSchema,d as fromParquetJSONGeometryType,f as getParquetLayerInfo,p as parquetGeometryTypeKebabDict,m as toParquetJSONGeometryType};
2
+ import e from"../../core/Collection.js";import t from"../../core/Error.js";import has from"../../core/has.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../geometry/SpatialReference.js";import{createFileProvider as o}from"../graphics/sources/parquet/createFileProvider.js";import n from"./Field.js";import{isNumericField as a}from"./fieldUtils.js";import{fromParquetGeometryEncodingJSON as l}from"./parquetEncodingUtils.js";import s from"./ParquetFilesData.js";const p=new r({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function m(e){return p.toJSON(e)}function d(e){return p.fromJSON(e)}async function f(t,r={}){const i=Array.isArray(t)?new s({urls:new e(t)}):t,n=await y(i,r),a=o(n,null,()=>r.customParameters);return u(await a.getMetadata(),{data:i})}async function u(e,r){if(r.geometryType&&r.spatialReference&&r.geometryEncoding&&r.fields&&r.displayOptimization)return r;if(!e)throw new t("parquet:bad-input","No metadata found");const o={...r},s=e.fields.map(e=>n.fromJSON(e));if(null==o.fields)o.fields=s;else{const e=new Set(o.fields.map(e=>e.name));if(!has("parquetlayer-legacy-field-overrides-enabled"))for(const t of s)e.has(t.name)||o.fields.push(t)}if(null!=o.geometryEncoding){const e=o.geometryEncoding;switch(e.type){case"wkb":{const r=s.find(t=>t.name===e.field);if(!r)throw new t("parquet:unsupported",`Geometry encoding references field ${e.field} which does not exist`);if("blob"!==r.type)throw new t("parquet:unsupported",`Invalid field type for geometry encoding. Found ${r.type} but expected 'blob'`);break}case"location":for(const r of[e.xField,e.yField])if(null!=r){const e=s.find(e=>e.name===r);if(!e)throw new t("parquet:unsupported",`Geometry encoding references field ${r} which does not exist`);if(!a(e))throw new t("parquet:unsupported",`Invalid field type for location geometry encoding. Found ${e.type} but expected a numeric`)}}}return null==o.geometryEncoding&&(o.geometryEncoding=e.geometryEncoding?l(e.geometryEncoding):null),o.fields=c(o.fields,e),!o.displayOptimization&&e.displayOptimization&&(o.displayOptimization=e.displayOptimization),!o.geometryType&&e.geometryType&&(o.geometryType=d(e.geometryType)),!o.spatialReference&&e.spatialReference&&(o.spatialReference=i.fromJSON(e.spatialReference)),o}function c(e,t){const r=t.geoMetadata;if(null==r)return e;const i=new Set(Object.keys(r.columns));return e.filter(e=>!i.has(e.name))}async function y(e,r){switch(e.type){case"files":return{type:"urls",urls:e.urls.toArray()};case"portal-item":{const i=await e.portalItem.load(r);switch(i.type){case"Apache Parquet":return{type:"portal-parquet-file",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,modified:i.modified,size:i.size};case"Parquet layer":case"Parquet Layer":case"Parquet feature layer":case"Parquet Feature Layer":if(!i.url)throw new t("parquet:bad-item",`Item of type ${i.type} must have a url defined`,i);return{type:"portal-parquet-layer",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,itemMetadata:{modified:i.modified,url:i.url}};default:throw new t("parquet:bad-item",`Item of type ${i.type} is not supported`,i)}}}}export{u as completeParquetLayerInfo,y as createFileProviderSchema,d as fromParquetJSONGeometryType,f as getParquetLayerInfo,p as parquetGeometryTypeKebabDict,m as toParquetJSONGeometryType};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.30",
3
+ "version": "5.2.0-next.32",
4
4
  "type": "module",
5
5
  "homepage": "https://js.arcgis.com",
6
6
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ArcadeDate as e}from"../arcade/ArcadeDate.js";import t from"../core/Error.js";import"../core/has.js";import{DateOnly as r}from"../core/sql/DateOnly.js";import{TimeOnly as i}from"../core/sql/TimeOnly.js";import{fromJSON as n}from"../geometry/support/jsonUtils.js";import s from"../layers/support/FieldsIndex.js";import{loadArcade as a}from"./loadArcade.js";import{unknown as o,system as c}from"../time/constants.js";const l=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const r of l)t.hasArcadeDependency(r)&&e.add(r);return e}function u(e,t){return p.create(e,t,null,["$feature","$view"])}function h(e,t){return p.create(e,t,null,["$feature","$view"])}function m(e,t,r){return p.create(e,t,r,["$feature","$view","$config"])}class p{static async create(e,r,i,n){const{arcade:s,Dictionary:o}=await a();let c;try{c=s.parseScript(e)}catch(f){throw new t("arcade-bad-expression","Failed to parse arcade script",{script:e,error:f})}const l=s.scriptUsesGeometryEngine(c);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,c,null,!1,l);const d={vars:n.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:r,useAsync:!1},u=s.compileScript(c,d);let h=null;null!=i&&(h=new o(i),h.immutable=!0);const m=new o;return m.immutable=!1,m.setField("scale",0),new p(e,s,c,u,r,m,h,o)}constructor(e,t,r,i,n,s,a,o){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=a,this._dictionaryCtor=o,this._dependencies=new Map,this._featureReader=new f,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(t,r){const i=r.$view?.timeZone;if(r.$view){let t;if(this._viewDict.setField("scale",r.$view.scale),null!=r.$view.timeProperties){const{currentStart:n,currentEnd:s}=r.$view.timeProperties;t=new this._dictionaryCtor({currentStart:null!=n?null!=i?e.epochToArcadeDate(n,i):e.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=i?e.epochToArcadeDate(s,i):e.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",t)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:t},spatialReference:this._spatialReference,timeZone:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class f{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new s(_(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=n(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===o}field(t,n=!0){const s=this._getField(t);if(s){const n=this._boundTarget.attributes[s.name];if(null==n)return null;switch(s.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(n);case"time-only":case"esriFieldTypeTimeOnly":return i.fromReader(n);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(n);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(t)?e.unknownEpochToArcadeDate(n):e.epochToArcadeDate(n,this.contextTimeZone??c);default:return n}}if(n)throw new Error(`Field ${t} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(){return{attributes:this._boundTarget.attributes,geometry:this.geometry()?.toJSON()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}}function _(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}export{p as ArcadeExpression,f as ArcadeFeatureReader,d as collectExpressionDependencies,m as createDictionaryExpression,u as createLabelExpression,h as createRendererExpression,_ as deriveFields};
2
+ import{ArcadeDate as e}from"../arcade/ArcadeDate.js";import t from"../core/Error.js";import"../core/has.js";import{DateOnly as r}from"../core/sql/DateOnly.js";import{TimeOnly as i}from"../core/sql/TimeOnly.js";import{fromJSON as n}from"../geometry/support/jsonUtils.js";import s from"../layers/support/FieldsIndex.js";import{loadArcade as a}from"./loadArcade.js";import{unknown as o,system as c}from"../time/constants.js";const l=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const r of l)t.hasArcadeDependency(r)&&e.add(r);return e}function u(e,t){return p.create(e,t,null,["$feature","$view"])}function h(e,t){return p.create(e,t,null,["$feature","$view"])}function m(e,t,r){return p.create(e,t,r,["$feature","$view","$config"])}class p{static async create(e,r,i,n){const{arcade:s,Dictionary:o}=await a();let c;try{c=s.parseScript(e)}catch(f){throw new t("arcade-bad-expression","Failed to parse arcade script",{script:e,error:f})}const l=s.scriptUsesGeometryEngine(c);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,c,null,!1,l);const d={vars:n.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:r,useAsync:!1},u=s.compileScript(c,d);let h=null;null!=i&&(h=new o(i),h.immutable=!0);const m=new o;return m.immutable=!1,m.setField("scale",0),new p(e,s,c,u,r,m,h,o)}constructor(e,t,r,i,n,s,a,o){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=a,this._dictionaryCtor=o,this._dependencies=new Map,this._featureReader=new f,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(t,r){const i=r.$view?.timeZone;if(r.$view){let t;if(this._viewDict.setField("scale",r.$view.scale),null!=r.$view.timeProperties){const{currentStart:n,currentEnd:s}=r.$view.timeProperties;t=new this._dictionaryCtor({__proto__:null,currentStart:null!=n?null!=i?e.epochToArcadeDate(n,i):e.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=i?e.epochToArcadeDate(s,i):e.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",t)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:t},spatialReference:this._spatialReference,timeZone:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class f{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new s(_(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=n(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===o}field(t,n=!0){const s=this._getField(t);if(s){const n=this._boundTarget.attributes[s.name];if(null==n)return null;switch(s.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(n);case"time-only":case"esriFieldTypeTimeOnly":return i.fromReader(n);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(n);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(t)?e.unknownEpochToArcadeDate(n):e.epochToArcadeDate(n,this.contextTimeZone??c);default:return n}}if(n)throw new Error(`Field ${t} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(){return{attributes:this._boundTarget.attributes,geometry:this.geometry()?.toJSON()??null}}castAsJsonAsync(){return Promise.resolve(this.castAsJson())}}function _(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}export{p as ArcadeExpression,f as ArcadeFeatureReader,d as collectExpressionDependencies,m as createDictionaryExpression,u as createLabelExpression,h as createRendererExpression,_ as deriveFields};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isPopupTemplate as e}from"../popupTemplateUtils.js";import{c as r,p as n,r as t,e as o,a,b as l,d as u,l as s,f as c,s as f,g as p,h as m}from"../chunks/arcade.js";export{i as arcade}from"../chunks/arcade.js";import{ArcadeDate as d}from"../arcade/ArcadeDate.js";import{toSymbolId as y}from"../arcade/arcadeEnvironment.js";import v from"../arcade/Dictionary.js";import{Feature as g}from"../arcade/Feature.js";import{j as x,e as j,k as S,m as h,l as w}from"../chunks/languageUtils.js";import{Pixel as b}from"../arcade/Pixel.js";import{Voxel as A}from"../arcade/Voxel.js";import{clone as $}from"../core/lang.js";import{DateOnly as E}from"../core/sql/DateOnly.js";import{TimeOnly as F}from"../core/sql/TimeOnly.js";import I from"../geometry/Extent.js";import P from"../geometry/Multipoint.js";import M from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import D from"../geometry/Polyline.js";import{isLabelClass as R}from"../layers/support/labelUtils.js";import{isSizeVariable as T}from"../renderers/visualVariables/support/sizeVariableUtils.js";import{isArray as k,isString as z,isBoolean as J,isNumber as C}from"./guards.js";const O={vars:{$feature:"any",$view:"any"}};function U(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function V(e){return null==e?null:k(e)||x(e)?"array":j(e)?"date":z(e)?"text":J(e)?"boolean":C(e)?"number":e instanceof v?"dictionary":S(e)?"feature":e instanceof M?"point":e instanceof _?"polygon":e instanceof D?"polyline":e instanceof P?"multipoint":e instanceof I?"extent":e instanceof E?"dateOnly":e instanceof F?"time":h(e)?"featureSet":w(e)?"featureSetCollection":null}function Z(e){if(!e)return null;try{return n(e)}catch(r){}return null}function q(e,n){const t="string"==typeof e?Z(e):e;if(!t)return null;try{return n=n||$(O),r(t,n)}catch(o){}return null}function G(e,r,n){return{vars:{$feature:null==e?new g:g.createFromGraphic(e,n),$view:r?.view},spatialReference:r?.sr,timeZone:n??null}}function L(e,r,n){return g.createFromGraphicLikeObject(r,e,n,null)}function N(e,r){null!=e.vars&&(e.vars.$feature=r)}function B(e,r){let n;try{n=l(e,r)}catch(t){n=null}return n}function H(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function K(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}const Q=["$feature","$aggregatedFeatures","$voxel"].map(e=>y(e));function W(e,r){if(!e)return[];const n="string"==typeof e?Z(e):e;if(!n)return[];const t=new Map;if(Array.isArray(r)||null==r)for(const i of Q)t.set(i,r);else for(const[i,a]of r)t.set(y(i),a);const o=u(n).flatMap(({varId:e,memberNamePattern:r})=>{if(!t.has(e))return[];if(r.includes("*")){const n=t.get(e);if(null==n)return[];const o=new RegExp(`^${r.split(/\*+/).map(U).join(".*")}$`,"i");return n.filter(e=>o.test(e))}return r.toLowerCase()});return[...new Set(o.sort())]}function X(e){return t(e,"$view")}function Y(e,r){return!!e&&t(e,r)}function ee(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;let r,n;const{timeProperties:t,timeZone:o}=e;if(null!=t){const{currentStart:e,currentEnd:i}=t;null!=o?(r=null!=e?d.dateJSAndZoneToArcadeDate(e,o):null,n=null!=i?d.dateJSAndZoneToArcadeDate(i,o):null):(r=null!=e?d.dateJSToArcadeDate(e):null,n=null!=i?d.dateJSToArcadeDate(i):null)}return{view:e.viewingMode&&null!=e.scale?new v({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:null!=r||null!=n?new v({__proto__:null,currentStart:r,currentEnd:n,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function re({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=c();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function ne({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:i}){if(null===e)return null;const a=c();return a?a.constructFeatureSet(e,r,n,t??!0,o,i):null}function te(e){if(null===e?.map)return null;const r=c();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function oe(e,r){return v.convertJsonToArcade(e,r)}function ie(e,r,n=[]){return s(e,r,n)}function ae(){return a()}function le(){return o()}function ue(e){return"type"in e&&("class-breaks"===e.type||"dictionary"===e.type||"dot-density"===e.type||"pie-chart"===e.type||"simple"===e.type||"unique-value"===e.type)}function se(r,n){if(!r)return!1;if("string"==typeof r)return n(r);const t=r;if(ue(t)){if("dot-density"===t.type){const e=t.attributes?.some(e=>n(e.valueExpression));if(e)return e}const e=t.visualVariables,r=!!e&&e.some(e=>{let r=n(e.valueExpression);return"size"===e.type&&(T(e.minSize)&&(r=r||n(e.minSize.valueExpression)),T(e.maxSize)&&(r=r||n(e.maxSize.valueExpression))),r});return!(!("valueExpression"in t)||!n(t.valueExpression))||r}if(R(t)){const e=t.labelExpressionInfo?.expression;return!(!e||!n(e))||!1}return!!e(t)&&(!!t.expressionInfos&&t.expressionInfos.some(e=>n(e.expression))||Array.isArray(t.content)&&t.content.some(e=>"expression"===e.type&&n(e.expressionInfo?.expression)))}function ce(e){const r=Z(e);return!!r&&p(r)}function fe(e){return se(e,ce)}function pe(e){if("renderer"in e&&e.renderer&&fe(e.renderer))return!0;if("labelingInfo"in e&&e.labelingInfo)for(const r of e.labelingInfo)if(fe(r))return!0;return!1}function me(e){const r=Z(e);return!!r&&m(r)}function de(e){return se(e,me)}function ye(e){return se(e,e=>{const r=Z(e);return!!r&&f(r)})}export{v as Dictionary,b as Pixel,A as Voxel,g as arcadeFeature,ne as convertFeatureLayerToFeatureSet,oe as convertJsonToArcade,te as convertMapToFeatureSetCollection,re as convertServiceUrlToWorkspace,G as createExecContext,L as createFeature,q as createFunction,Z as createSyntaxTree,X as dependsOnView,le as enableFeatureSetOperations,ae as enableGeometryOperations,B as evalSyntaxTree,K as executeAsyncFunction,H as executeFunction,W as extractFieldNames,V as getArcadeType,ee as getViewInfo,fe as hasGeometryFunctions,de as hasGeometryOperations,Y as hasVariable,pe as layerHasGeometryFunctions,ie as loadScriptDependencies,ye as requiresTrack,N as updateExecContext};
2
+ import{isPopupTemplate as e}from"../popupTemplateUtils.js";import{c as r,p as n,r as t,e as o,a,b as l,d as s,l as u,f as c,s as f,g as p,h as m}from"../chunks/arcade.js";export{i as arcade}from"../chunks/arcade.js";import{ArcadeDate as d}from"../arcade/ArcadeDate.js";import{toSymbolId as y}from"../arcade/arcadeEnvironment.js";import g from"../arcade/Dictionary.js";import{Feature as v}from"../arcade/Feature.js";import{g as x,e as j,h,k as S,j as w}from"../chunks/languageUtils.js";import{Pixel as b}from"../arcade/Pixel.js";import{Voxel as $}from"../arcade/Voxel.js";import{clone as A}from"../core/lang.js";import{DateOnly as E}from"../core/sql/DateOnly.js";import{TimeOnly as F}from"../core/sql/TimeOnly.js";import I from"../geometry/Extent.js";import P from"../geometry/Multipoint.js";import M from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import D from"../geometry/Polyline.js";import{isLabelClass as R}from"../layers/support/labelUtils.js";import{isSizeVariable as k}from"../renderers/visualVariables/support/sizeVariableUtils.js";import{isArray as z,isString as T,isBoolean as C,isNumber as J}from"./guards.js";const O={vars:{$feature:"any",$view:"any"}};function U(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function V(e){return null==e?null:z(e)||x(e)?"array":j(e)?"date":T(e)?"text":C(e)?"boolean":J(e)?"number":e instanceof g?"dictionary":h(e)?"feature":e instanceof M?"point":e instanceof _?"polygon":e instanceof D?"polyline":e instanceof P?"multipoint":e instanceof I?"extent":e instanceof E?"dateOnly":e instanceof F?"time":S(e)?"featureSet":w(e)?"featureSetCollection":null}function Z(e){if(!e)return null;try{return n(e)}catch(r){}return null}function q(e,n){const t="string"==typeof e?Z(e):e;if(!t)return null;try{return n=n||A(O),r(t,n)}catch(o){}return null}function G(e,r,n){return{vars:{$feature:null==e?new v:v.createFromGraphic(e,n),$view:r?.view},spatialReference:r?.sr,timeZone:n??null}}function L(e,r,n){return v.createFromGraphicLikeObject(r,e,n,null)}function N(e,r){null!=e.vars&&(e.vars.$feature=r)}function B(e,r){let n;try{n=l(e,r)}catch(t){n=null}return n}function H(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function K(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}const Q=["$feature","$aggregatedFeatures","$voxel"].map(e=>y(e));function W(e,r){if(!e)return[];const n="string"==typeof e?Z(e):e;if(!n)return[];const t=new Map;if(Array.isArray(r)||null==r)for(const i of Q)t.set(i,r);else for(const[i,a]of r)t.set(y(i),a);const o=s(n).flatMap(({varId:e,memberNamePattern:r})=>{if(!t.has(e))return[];if(r.includes("*")){const n=t.get(e);if(null==n)return[];const o=new RegExp(`^${r.split(/\*+/).map(U).join(".*")}$`,"i");return n.filter(e=>o.test(e))}return r.toLowerCase()});return[...new Set(o.sort())]}function X(e){return t(e,"$view")}function Y(e,r){return!!e&&t(e,r)}function ee(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;let r,n;const{timeProperties:t,timeZone:o}=e;if(null!=t){const{currentStart:e,currentEnd:i}=t;null!=o?(r=null!=e?d.dateJSAndZoneToArcadeDate(e,o):null,n=null!=i?d.dateJSAndZoneToArcadeDate(i,o):null):(r=null!=e?d.dateJSToArcadeDate(e):null,n=null!=i?d.dateJSToArcadeDate(i):null)}return{view:e.viewingMode&&null!=e.scale?new g({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:null!=r||null!=n?new g({__proto__:null,currentStart:r,currentEnd:n,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function re({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=c();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function ne({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:i}){if(null===e)return null;const a=c();return a?a.constructFeatureSet(e,r,n,t??!0,o,i):null}function te(e){if(null===e?.map)return null;const r=c();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function oe(e,r,n=[]){return u(e,r,n)}function ie(){return a()}function ae(){return o()}function le(e){return"type"in e&&("class-breaks"===e.type||"dictionary"===e.type||"dot-density"===e.type||"pie-chart"===e.type||"simple"===e.type||"unique-value"===e.type)}function se(r,n){if(!r)return!1;if("string"==typeof r)return n(r);const t=r;if(le(t)){if("dot-density"===t.type){const e=t.attributes?.some(e=>n(e.valueExpression));if(e)return e}const e=t.visualVariables,r=!!e&&e.some(e=>{let r=n(e.valueExpression);return"size"===e.type&&(k(e.minSize)&&(r=r||n(e.minSize.valueExpression)),k(e.maxSize)&&(r=r||n(e.maxSize.valueExpression))),r});return!(!("valueExpression"in t)||!n(t.valueExpression))||r}if(R(t)){const e=t.labelExpressionInfo?.expression;return!(!e||!n(e))||!1}return!!e(t)&&(!!t.expressionInfos&&t.expressionInfos.some(e=>n(e.expression))||Array.isArray(t.content)&&t.content.some(e=>"expression"===e.type&&n(e.expressionInfo?.expression)))}function ue(e){const r=Z(e);return!!r&&p(r)}function ce(e){return se(e,ue)}function fe(e){if("renderer"in e&&e.renderer&&ce(e.renderer))return!0;if("labelingInfo"in e&&e.labelingInfo)for(const r of e.labelingInfo)if(ce(r))return!0;return!1}function pe(e){const r=Z(e);return!!r&&m(r)}function me(e){return se(e,pe)}function de(e){return se(e,e=>{const r=Z(e);return!!r&&f(r)})}export{g as Dictionary,b as Pixel,$ as Voxel,v as arcadeFeature,ne as convertFeatureLayerToFeatureSet,te as convertMapToFeatureSetCollection,re as convertServiceUrlToWorkspace,G as createExecContext,L as createFeature,q as createFunction,Z as createSyntaxTree,X as dependsOnView,ae as enableFeatureSetOperations,ie as enableGeometryOperations,B as evalSyntaxTree,K as executeAsyncFunction,H as executeFunction,W as extractFieldNames,V as getArcadeType,ee as getViewInfo,ce as hasGeometryFunctions,me as hasGeometryOperations,Y as hasVariable,fe as layerHasGeometryFunctions,oe as loadScriptDependencies,de as requiresTrack,N as updateExecContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const c="20260626",e="f095fce950bcdfc3fa54c6ec057024279e41b0bc";export{c as buildDate,e as commitHash};
2
+ const c="20260628",e="8f6461e1fe7a9cf1b743d6c32a22157ec904f779";export{c as buildDate,e as commitHash};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function e(e){return t(e,{CIMRGBColor:r,CIMCharacterMarker:n})}function t(e,r){if(null==e)return e;if(Array.isArray(e))return e.map(e=>t(e,r));if("object"==typeof e){if("type"in e&&"string"==typeof e.type&&r[e.type])return r[e.type](e);const n={};for(const[o,i]of Object.entries(e))n[o]=t(i,r);return n}return e}function r(e){const[t,r,n,o]=e.values;return[t,r,n,255*o/100]}function n(){return{type:"CIMVectorMarker",enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-10,ymin:-10,xmax:10,ymax:10},markerGraphics:[{type:"CIMMarkerGraphic",textString:"■",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",underline:!1,blockProgression:"TTB",depth3D:0,extrapolateBaselines:!0,flipAngle:90,fontEffects:"Normal",fontEncoding:"Unicode",haloSize:0,height:8,hinting:"Default",horizontalAlignment:"Center",kerning:!0,letterSpacing:10,letterWidth:100,ligatures:!1,lineGapType:"ExtraLeading",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},symbol3DProperties:{type:"CIM3DSymbolProperties",dominantSizeAxis3D:"Z",rotationOrder3D:"XYZ",scaleZ:1,scaleY:1},textCase:"Normal",textDirection:"LTR",verticalAlignment:"Center",verticalGlyphOrientation:"Right",wordSpacing:100,billboardMode3D:"FaceNearPlane"}}],scaleSymbolsProportionally:!0,respectFrame:!0}}export{e as fixUnsupportedCIM};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{OverrideHelper as e}from"../../../../../symbols/cim/OverrideHelper.js";import{FeatureMatcher as t}from"./Matcher.js";import{createDebugWriters as r}from"../../../layers/support/annodime/debugUtils.js";import s from"../../../layers/support/annodime/DimensionInfo.js";import{dimensionSymbols as i}from"../../../layers/support/annodime/dimensionSymbols.js";import{getFontForCIMTextSymbol as o,getFontNameForCIMTextSymbol as n}from"../../../layers/support/annodime/dimensionUtils.js";import{createDimensionMatcherFeatureInfo as a,mixFeature as m}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";class h extends t{constructor(e,t){super(),this._context=e,this._schema=t,this._meshWriters=new Map,this._dimensionInfos=new Map,this._matcherGeometryOverrides=new Map,this._cachedGlyphsPerFont=new Map}static async fromDimensionSchema(e,t){return new h(e,t)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,r,s){this._meshWriters.clear(),this._dimensionInfos.clear(),this._matcherGeometryOverrides.clear();const i=t.metadata.outSpatialReference,o=t.getCursor();for(;o.next();){const r=a(o);if(!r)continue;const n=m(o,r);if(!n)continue;const h=this._readStyleId(o),l=this._getStyle(h);if(!l)continue;const y=c(s,o.getObjectId()),d=await this._createDimensionInfo(l,n,i);await this._cacheGlyphs(d,n,e),this._dimensionInfos.set(y,d),this._matcherGeometryOverrides.set(y,r.geometryOverride);let p=this._meshWriters.get(y);p||(p=await this._createGroup(l,o,n,e,t.geometryType),this._meshWriters.set(y,p))}}async _createDimensionInfo(e,t,r){return await s.create(e,t,r,e=>this._getGlyphCacheForSymbol(e))}async _createGroup(e,t,s,o,n){const a=i.processDimensionStyle(e),[m,c,h,l,y]=await Promise.all([this._createMeshesForSymbol(a.beginDimensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.endDimensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.beginExtensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.endExtensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.textSymbol,a.primitiveOverrides,t,s,o)]),d=await this._context.createMeshWriters([...m,...c,...h,...l,...y]);if(has("esri-2d-annotation-dimension-debug")){const e=await r(this._context,o,n);return e.length?[...d,...e]:d}return d}async _createMeshesForSymbol(t,r,s,i,o){if(!t)return[];const n=await e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:r,symbol:t},i,s.metadata.outSpatialReference,null,s.geometryType);if(!n)return[];const a=await o.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:{type:"CIMSymbolReference",symbol:n}});return a?.meshes??[]}_readStyleId(e){return parseInt(`${e.readAttribute("STYLEID")}`,10)}_getStyle(e){return this._schema.styleCollection.find(t=>(t.iD??0)===e)}async _cacheGlyphs(e,t,r){const s=e.getTextString(t);if(!s)return;const i=await r.fetchResourceImmediate({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:o(e.textSymbol)}});if(i&&"glyphs"in i){const t=i.glyphs;if(null!=t){const r=this._getGlyphCacheForSymbol(e.textSymbol);if(!r)return;for(const e of t)e&&!r.glyphs[e.code]&&(r.glyphs[e.code]=e)}}}_getGlyphCacheForSymbol(e){if(!e)return null;const t=n(e);let r=this._cachedGlyphsPerFont.get(t);return r||(r={type:"glyphs",glyphs:[],isRightToLeft:!1,sdfSize:24,sdfRadius:8,sdfPadding:3},this._cachedGlyphsPerFont.set(t,r)),r}cleanup(e,t,r){const s=t.getObjectId(),i=c(r,s);this._meshWriters.delete(i),this._dimensionInfos.delete(i),this._matcherGeometryOverrides.delete(i)}getAnalyzedGraphic(e){return this._dimensionInfos.get(e)||null}getMatcherGeometryOverride(e){return this._matcherGeometryOverrides.get(e)??null}}export{h as DimensionMatcher};
2
+ import has from"../../../../../core/has.js";import{OverrideHelper as e}from"../../../../../symbols/cim/OverrideHelper.js";import{FeatureMatcher as t}from"./Matcher.js";import{createDebugWriters as r}from"../../../layers/support/annodime/debugUtils.js";import s from"../../../layers/support/annodime/DimensionInfo.js";import{dimensionSymbols as i}from"../../../layers/support/annodime/dimensionSymbols.js";import{getFontForCIMTextSymbol as o,getFontNameForCIMTextSymbol as n}from"../../../layers/support/annodime/dimensionUtils.js";import{createDimensionMatcherFeatureInfo as a,mixFeature as m}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";class h extends t{constructor(e,t){super(),this._context=e,this._schema=t,this._meshWriters=new Map,this._dimensionInfos=new Map,this._matcherGeometryOverrides=new Map,this._cachedGlyphsPerFont=new Map}static async fromDimensionSchema(e,t){return new h(e,t)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,s,i){this._meshWriters.clear(),this._dimensionInfos.clear(),this._matcherGeometryOverrides.clear();const o=t.metadata.outSpatialReference,n=t.getCursor();for(;n.next();){const s=a(n);if(!s)continue;const h=m(n,s);if(!h)continue;const l=c(i,n.getObjectId()),y=this._readStyleId(n),d=this._getStyle(y);if(!d){let s=this._meshWriters.get(l);s||(s=await r(this._context,e,t.geometryType),this._meshWriters.set(l,s));continue}const p=await this._createDimensionInfo(d,h,o);await this._cacheGlyphs(p,h,e),this._dimensionInfos.set(l,p),this._matcherGeometryOverrides.set(l,s.geometryOverride);let u=this._meshWriters.get(l);u||(u=await this._createGroup(d,n,h,e,t.geometryType),this._meshWriters.set(l,u))}}async _createDimensionInfo(e,t,r){return await s.create(e,t,r,e=>this._getGlyphCacheForSymbol(e))}async _createGroup(e,t,s,o,n){const a=i.processDimensionStyle(e),[m,c,h,l,y]=await Promise.all([this._createMeshesForSymbol(a.beginDimensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.endDimensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.beginExtensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.endExtensionLineSymbol,a.primitiveOverrides,t,s,o),this._createMeshesForSymbol(a.textSymbol,a.primitiveOverrides,t,s,o)]),d=await this._context.createMeshWriters([...m,...c,...h,...l,...y]);if(has("esri-2d-annotation-dimension-debug")){const e=await r(this._context,o,n);return e.length?[...d,...e]:d}return d}async _createMeshesForSymbol(t,r,s,i,o){if(!t)return[];const n=await e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:r,symbol:t},i,s.metadata.outSpatialReference,null,s.geometryType);if(!n)return[];const a=await o.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:{type:"CIMSymbolReference",symbol:n}});return a?.meshes??[]}_readStyleId(e){return parseInt(`${e.readAttribute("STYLEID")}`,10)}_getStyle(e){return this._schema.styleCollection.find(t=>(t.iD??0)===e)}async _cacheGlyphs(e,t,r){const s=e.getTextString(t);if(!s)return;const i=await r.fetchResourceImmediate({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:o(e.textSymbol)}});if(i&&"glyphs"in i){const t=i.glyphs;if(null!=t){const r=this._getGlyphCacheForSymbol(e.textSymbol);if(!r)return;for(const e of t)e&&!r.glyphs[e.code]&&(r.glyphs[e.code]=e)}}}_getGlyphCacheForSymbol(e){if(!e)return null;const t=n(e);let r=this._cachedGlyphsPerFont.get(t);return r||(r={type:"glyphs",glyphs:[],isRightToLeft:!1,sdfSize:24,sdfRadius:8,sdfPadding:3},this._cachedGlyphsPerFont.set(t,r)),r}cleanup(e,t,r){const s=t.getObjectId(),i=c(r,s);this._meshWriters.delete(i),this._dimensionInfos.delete(i),this._matcherGeometryOverrides.delete(i)}getAnalyzedGraphic(e){return this._dimensionInfos.get(e)||null}getMatcherGeometryOverride(e){return this._matcherGeometryOverrides.get(e)??null}}export{h as DimensionMatcher};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as m}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as y}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";import{getReferenceScale as h}from"../../support/annodime/utils.js";class f{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,i=!s&&a,o=p("isSourceHosted"in r&&r.isSourceHosted,i,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:a}=await this._fetchAnnotationDataElementRequest(e,{type:"annotation-data-element-request"}),{objectIdField:i}=this.layer,o=m(null,null,i);return{storage:y(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s);const i=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const n=t(this.layer.subtypeField,i.toArray());return e.where=r(e.where,n),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin}_createServiceInfo(t){const r=this.layer,{capabilities:a,editingInfo:o,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:p,subtypeField:c}=r,m=l(r),y=r.timeInfo?.toJSON(),d=r.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=s(h.path),S=t.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:S,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:r.fieldsIndex.toJSON(),geometryType:m,featureIdInfo:i(r),timeInfo:y,spatialReference:d,outSpatialReference:S,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:a.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:a.query.supportsReturnExceededLimitGeometries}}}async _fetchAnnotationDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,a=await s.fetchDataElement(),i=h(a);return{type:"annotation-data-element-response",dataElement:a,meshes:await d(a,r),referenceScale:i}}}export{f as AnnotationLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as t,sqlNotIn as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as a}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as y}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as m}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";class h{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,a=!s&&i,o=p("isSourceHosted"in r&&r.isSourceHosted,a,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,symbolCollection:i,referenceScale:a}=this.layer,o=await d(i,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null}),l=y(null,null,s);return{storage:m(null,t.filters),mesh:{properties:{sortKey:l,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s),this.layer.unplacedAnnotationsVisible||(e??=new i,e.where=t(e?.where,`${this.layer.statusField} = 0`));const a=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!a.length)return e;e??=new i;const l=r(this.layer.subtypeField,a.toArray());return e.where=t(e.where,l),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.unplacedAnnotationsVisible,()=>l(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin??this.layer.graphicOrigin}_createServiceInfo(t){const r=this.layer,{capabilities:i,editingInfo:o,globalIdField:l,datesInUnknownTimezone:u,dateFieldsTimeZone:p,subtypeField:c}=r,y=n(r),m=r.timeInfo?.toJSON(),d=r.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=s(h.path),b=t.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:b,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,subtypeField:c,globalIdField:l,fieldsIndex:r.fieldsIndex.toJSON(),geometryType:y,featureIdInfo:a(r),timeInfo:m,spatialReference:d,outSpatialReference:b,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:i.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:i.query.maxRecordCount,tileMaxRecordCount:i.query.tileMaxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:i.query.supportsReturnExceededLimitGeometries}}}}export{h as AnnotationLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{getReferenceScale as p}from"../../support/annodime/utils.js";class u{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,{capabilities:o,editingInfo:n,globalIdField:l,datesInUnknownTimezone:c,dateFieldsTimeZone:p,subtypeField:u}=a,m=s(a),d=a.timeInfo?.toJSON(),y=a.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=t(h.path),S=i.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:S,metadata:{timeReferenceUnknownClient:c,dateFieldsTimeZone:p,subtypeField:u,globalIdField:l,fieldsIndex:a.fieldsIndex.toJSON(),geometryType:m,featureIdInfo:r(a),timeInfo:d,spatialReference:y,outSpatialReference:S,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}async _fetchDimensionDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,i=await s.fetchDataElement(),a=p(i);return{type:"dimension-data-element-response",dataElement:i,meshes:await c(i,r),referenceScale:a}}}export{u as DimensionLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";class p{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);return o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{objectIdField:s,referenceScale:i,styleCollection:a}=this.layer,o=await c(a,{cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null}),p=n(null,null,s);return{storage:l(null,t.filters),mesh:{properties:{sortKey:p,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:o,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,{capabilities:o,editingInfo:n,globalIdField:l,datesInUnknownTimezone:c,dateFieldsTimeZone:p,subtypeField:u}=a,m=s(a),y=a.timeInfo?.toJSON(),d=a.spatialReference.toJSON(),h=e(this.layer.parsedUrl),f=this.layer.objectIdField,g=t(h.path),S=i.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:f,outSpatialReference:S,metadata:{timeReferenceUnknownClient:c,dateFieldsTimeZone:p,subtypeField:u,globalIdField:l,fieldsIndex:a.fieldsIndex.toJSON(),geometryType:m,featureIdInfo:r(a),timeInfo:y,spatialReference:d,outSpatialReference:S,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}}export{p as DimensionLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import{minInt16 as t}from"../../../../../core/typedArrayUtil.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import{getParquetObjectId as r}from"../../../../../layers/graphics/sources/support/parquetIdUtils.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";const o=new TextDecoder;class d extends n{constructor(i,s,r,n,o,d=new Uint32Array(r.size()),h,a){if(super(i),this._indexMap=s,this._inner=r,this._fileId=n,this._transform=o,this._displayIds=d,this._points=h,this._rowIds=a,this._index=-1,this._emptyNumberValue=0,this.usedMemory=e,this._size=this._inner.size(),this._rowIds||(this._rowIds=this._inner.readIdsUnsafe().slice()),!this._points&&"esriGeometryPoint"===this.geometryType){const e=this._inner.readPointCoordsQuantizedUnsafe()?.slice();e?(this._emptyNumberValue=t,this._points=e):(this._emptyNumberValue=NaN,this._points=this._inner.readPointCoordsUnsafe()?.slice())}i.featureIdInfo.type}destroy(){super.destroy(),this._inner.free()}get fields(){return this.metadata.fieldsIndex}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}async updateFields(e,t,i,s){const r=this._inner.rowGroup(),n=new Uint32Array(this._inner.readIdsUnsafe()),o=await e.createPatch(t,r,n,i,s);this._inner.insertPatchBytes(new Uint8Array(o))}getInTransform(){return this._transform}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){const e=this._rowIds[this._index];return r(this._fileId,e)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}getBounds(e){const t=this._inner.boundsXMin(this._index);return!!Number.isFinite(t)&&(i(e,t,this._inner.boundsYMin(this._index),this._inner.boundsXMax(this._index),this._inner.boundsYMax(this._index)),!0)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new d(this.metadata,this._indexMap,this._inner,this._fileId,this._transform,this._displayIds,this._points,this._rowIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}_readGeometry(e){const t=this._inner.readCoordsUnsafe(this._index),i=this._inner.readLengthsUnsafe(this._index);return t&&i?new s(i,t,this.hasZ,this.hasM):null}_readX(){if(this._points){const e=this._points[2*this._index];return e===this._emptyNumberValue?NaN:e}return this._inner.readX(this._index)}_readY(){if(this._points){const e=this._points[2*this._index+1];return e===this._emptyNumberValue?NaN:e}return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const i=this.fields.get(e);if(!i)return;const s=this._indexMap[i.name];if(null==s)return this.getObjectId();const r=this._inner.readAttribute(this._index,s);if(null==r)return r;if("esriFieldTypeString"===i.type||"esriFieldTypeDateOnly"===i.type||"esriFieldTypeTimeOnly"===i.type||"esriFieldTypeTimestampOffset"===i.type){const e=this._inner.readAttribute(this._index,s);return o.decode(e)}const n=this.fields.isDateField(i.name);return t?null==r?r:n?new Date(r):r:r}_readAttributes(){const e={};for(const t of this.metadata.fieldsIndex.fields){if(null==this._indexMap[t.name])continue;const i=this._readAttribute(t.name,!1);void 0!==i&&(e[t.name]=i)}return e.__OBJECTID=this.getObjectId(),e}}export{d as FeatureSetReaderParquet};
2
+ import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import{minInt16 as t}from"../../../../../core/typedArrayUtil.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import{getParquetObjectId as r}from"../../../../../layers/graphics/sources/support/parquetIdUtils.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";const o=new TextDecoder;class d extends n{constructor(i,s,r,n,o,d=new Uint32Array(r.size()),h,a,u){if(super(i),this._indexMap=s,this._inner=r,this._fileId=n,this._transform=o,this._displayIds=d,this._points=h,this._rowIds=a,this._emptyNumberValue=u,this._index=-1,this.usedMemory=e,this._size=this._inner.size(),this._rowIds||(this._rowIds=this._inner.readIdsUnsafe().slice()),!this._points&&"esriGeometryPoint"===this.geometryType){const e=this._inner.readPointCoordsQuantizedUnsafe()?.slice();e?(this._emptyNumberValue=t,this._points=e):(this._emptyNumberValue=NaN,this._points=this._inner.readPointCoordsUnsafe()?.slice())}i.featureIdInfo.type}destroy(){super.destroy(),this._inner.free()}get fields(){return this.metadata.fieldsIndex}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}async updateFields(e,t,i,s){const r=this._inner.rowGroup(),n=new Uint32Array(this._inner.readIdsUnsafe()),o=await e.createPatch(t,r,n,i,s);this._inner.insertPatchBytes(new Uint8Array(o))}getInTransform(){return this._transform}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){const e=this._rowIds[this._index];return r(this._fileId,e)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}getBounds(e){const t=this._inner.boundsXMin(this._index);return!!Number.isFinite(t)&&(i(e,t,this._inner.boundsYMin(this._index),this._inner.boundsXMax(this._index),this._inner.boundsYMax(this._index)),!0)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new d(this.metadata,this._indexMap,this._inner,this._fileId,this._transform,this._displayIds,this._points,this._rowIds,this._emptyNumberValue);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}_readGeometry(e){const t=this._inner.readCoordsUnsafe(this._index),i=this._inner.readLengthsUnsafe(this._index);return t&&i?new s(i,t,this.hasZ,this.hasM):null}_readX(){if(this._points){const e=this._points[2*this._index];return e===this._emptyNumberValue?NaN:e}return this._inner.readX(this._index)}_readY(){if(this._points){const e=this._points[2*this._index+1];return e===this._emptyNumberValue?NaN:e}return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const i=this.fields.get(e);if(!i)return;const s=this._indexMap[i.name];if(null==s)return this.getObjectId();const r=this._inner.readAttribute(this._index,s);if(null==r)return r;if("esriFieldTypeString"===i.type||"esriFieldTypeDateOnly"===i.type||"esriFieldTypeTimeOnly"===i.type||"esriFieldTypeTimestampOffset"===i.type){const e=this._inner.readAttribute(this._index,s);return o.decode(e)}const n=this.fields.isDateField(i.name);return t?null==r?r:n?new Date(r):r:r}_readAttributes(){const e={};for(const t of this.metadata.fieldsIndex.fields){if(null==this._indexMap[t.name])continue;const i=this._readAttribute(t.name,!1);void 0!==i&&(e[t.name]=i)}return e.__OBJECTID=this.getObjectId(),e}}export{d as FeatureSetReaderParquet};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createComplexSymbolInstances as a}from"../../features/schema/processor/symbols/ComplexSymbolSchema.js";import{getCIMSymbols as i}from"./cimAnnotations.js";import{getSymbolCollection as t}from"./utils.js";async function l(i,t){const l={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};return{point:await a({...i.point.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l}),line:await a({...i.line.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l}),multipoint:await a({...i.multipoint.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l})}}async function e(a,e){const n=t(a),s=i(n),o={};for(const i in s){const a=s[i],t=await l(a,e);o[i]=t}return{type:"annotation-feature",meshes:o,symbolCollection:n}}export{e as getAnnotationMatcherSchema};
2
+ import{createComplexSymbolInstances as a}from"../../features/schema/processor/symbols/ComplexSymbolSchema.js";import{getCIMSymbols as i}from"./cimAnnotations.js";async function t(i,t){const l={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};return{point:await a({...i.point.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l}),line:await a({...i.line.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l}),multipoint:await a({...i.multipoint.data,hasTextStringTemplates:!0},{schemaOptions:t,uniforms:l})}}async function l(a,l){const e=i(a),n={};for(const i in e){const a=e[i],s=await t(a,l);n[i]=s}return{type:"annotation-feature",meshes:n,symbolCollection:a}}export{l as getAnnotationMatcherSchema};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getStyleMatcherSchemas as e}from"./DimensionMatcherSchema.js";import{getStyleCollection as t}from"./utils.js";async function s(s,o){const{meshes:i}=await e(s,o);return{type:"dimension-feature",styleCollection:t(s),meshes:i}}export{s as getDimensionMatcherSchema};
2
+ import{createComplexSymbolInstances as e}from"../../features/schema/processor/symbols/ComplexSymbolSchema.js";import{dimensionSymbols as i}from"./dimensionSymbols.js";async function n(e,i){return{type:"dimension-feature",styleCollection:e,meshes:await r(e,i)}}async function r(e,i){const n={};for(const r of e){n[r.iD]=await l(r,i)}return n}async function l(n,r){const l=i.processDimensionStyle(n),s={schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}};return{beginDimensionLine:await e({type:"CIMSymbolReference",primitiveOverrides:l.primitiveOverrides,symbol:l.beginDimensionLineSymbol},s),endDimensionLine:await e({type:"CIMSymbolReference",primitiveOverrides:l.primitiveOverrides,symbol:l.endDimensionLineSymbol},s),beginExtensionLine:await e({type:"CIMSymbolReference",primitiveOverrides:l.primitiveOverrides,symbol:l.beginExtensionLineSymbol},s),endExtensionLine:await e({type:"CIMSymbolReference",primitiveOverrides:l.primitiveOverrides,symbol:l.endExtensionLineSymbol},s),textPoint:await e({type:"CIMSymbolReference",primitiveOverrides:l.primitiveOverrides,symbol:l.textSymbol},s)}}export{n as getDimensionMatcherSchema};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../geometry/Point.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as n}from"../../../../../layers/graphics/data/projectionSupport.js";import{parseAnnotationGraphic as r}from"./annotationGraphic.js";import{fixCIMUnsupported as o}from"./unsupported.js";function s({scale:e,translate:t},n){return(n-t[0])/e[0]}function i({scale:e,translate:t},n){return(n-t[1])/e[1]}function p(r,o,c,u){if("custom-point"===r.type||"point"===r.type){const{x:p,y:f}=r,a=n(new e({x:p,y:f,spatialReference:o}),o,c);return new t([1],[s(u,a.x),i(u,a.y)])}if("custom-two-point"===r.type){const[p,f]=r.from,a=n(new e({x:p,y:f,spatialReference:o}),o,c),[y,l]=r.to,m=n(new e({x:y,y:l,spatialReference:o}),o,c);return new t([2],[s(u,a.x),i(u,a.y),s(u,m.x),i(u,m.y)])}if("custom-multipoint"===r.type){const p=r.points.map(([t,r])=>n(new e({x:t,y:r,spatialReference:o}),o,c)),f=p.map(({x:e,y:t})=>[s(u,e),i(u,t)]).flat();return new t([p.length],f)}if("geometry-bag"===r.type){let e=[],n=[],s=!0;for(const t of r.geometries){s||(e.push(2),n.push(0,0,1,1)),s=!1;const r=p(t,o,c,u);r&&(e=[...e,...r.lengths],n=[...n,...r.coords])}if(0===e.length||0===n.length)return;return new t(e,n)}if("polyline"===r.type){const[p,f]=r.paths[0][0],a=n(new e({x:p,y:f,spatialReference:o}),o,c),[y,l]=r.paths[0][1],m=n(new e({x:y,y:l,spatialReference:o}),o,c);return new t([2],[s(u,a.x),i(u,a.y),s(u,m.x),i(u,m.y)])}throw new Error("Unsupported geometry type!")}function c(e,t){return r(e,t)}function u(e,...t){const n={};for(const r of t)n[r]=e[r];return n}function f(e,t){const n=e.indexOf(t);if(-1===n)return null;return e[n+1]}function a(e){const{propertySetItems:t}=e.extensionProperties,n=f(t,"ReferenceScale");return parseInt(n,10)}function y(e){const{propertySetItems:t}=e.extensionProperties,n=f(t,"SymbolCollection");if(!n)return[];const r=JSON.parse(n);return o(r)}function l(e){const{propertySetItems:t}=e.extensionProperties,n=f(t,"StyleCollection");if(!n)return[];const r=JSON.parse(n);return o(r)}function m(e,t){const n=e.toLowerCase();for(const r in t){if(n===r.toLowerCase())return r}return e}function x(e,t){return t[m(e,t)]}function w(e,t,n){n[m(e,n)]=t}export{x as getAttributeValue,a as getReferenceScale,l as getStyleCollection,y as getSymbolCollection,c as parseElement,u as pick,s as quantizeXf,i as quantizeYf,p as reprojectAndQuantize,w as setAttributeValue};
2
+ import e from"../../../../../geometry/Point.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as n}from"../../../../../layers/graphics/data/projectionSupport.js";import{parseAnnotationGraphic as r}from"./annotationGraphic.js";function o({scale:e,translate:t},n){return(n-t[0])/e[0]}function i({scale:e,translate:t},n){return(n-t[1])/e[1]}function s(r,p,a,c){if("custom-point"===r.type||"point"===r.type){const{x:s,y:f}=r,u=n(new e({x:s,y:f,spatialReference:p}),p,a);return new t([1],[o(c,u.x),i(c,u.y)])}if("custom-two-point"===r.type){const[s,f]=r.from,u=n(new e({x:s,y:f,spatialReference:p}),p,a),[y,l]=r.to,m=n(new e({x:y,y:l,spatialReference:p}),p,a);return new t([2],[o(c,u.x),i(c,u.y),o(c,m.x),i(c,m.y)])}if("custom-multipoint"===r.type){const s=r.points.map(([t,r])=>n(new e({x:t,y:r,spatialReference:p}),p,a)),f=s.map(({x:e,y:t})=>[o(c,e),i(c,t)]).flat();return new t([s.length],f)}if("geometry-bag"===r.type){let e=[],n=[],o=!0;for(const t of r.geometries){o||(e.push(2),n.push(0,0,1,1)),o=!1;const r=s(t,p,a,c);r&&(e=[...e,...r.lengths],n=[...n,...r.coords])}if(0===e.length||0===n.length)return;return new t(e,n)}if("polyline"===r.type){const[s,f]=r.paths[0][0],u=n(new e({x:s,y:f,spatialReference:p}),p,a),[y,l]=r.paths[0][1],m=n(new e({x:y,y:l,spatialReference:p}),p,a);return new t([2],[o(c,u.x),i(c,u.y),o(c,m.x),i(c,m.y)])}throw new Error("Unsupported geometry type!")}function p(e,t){return r(e,t)}function a(e,t){const n=e.toLowerCase();for(const r in t){if(n===r.toLowerCase())return r}return e}function c(e,t){return t[a(e,t)]}function f(e,t,n){n[a(e,n)]=t}export{c as getAttributeValue,p as parseElement,o as quantizeXf,i as quantizeYf,s as reprojectAndQuantize,f as setAttributeValue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fixCIMColors as e}from"./unsupported.js";let t=0;class r{}class s extends r{constructor(e,t){super(),this.kind="feature";const r=`__virtual_fi_${e}`;this.realField={name:r,alias:r,type:t,editable:!1,nullable:!0}}addToFeature(e,t){const r=this.getValue(t);e.attributes[this.realField.name]=r}addToSymbol(e){const r=this.findTargetNode(e.symbol);let{primitiveName:s}=r;s||(t++,s=`primitive_${t}`,r.primitiveName=s);const i={type:"CIMPrimitiveOverride",primitiveName:s,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realField.name};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(i)}}class i extends s{constructor(){super("text","esriFieldTypeString"),this.cimPropertyName="TextString"}findTargetNode(e){return e.symbolLayers[0].markerGraphics[0]}getValue(e){return e.graphic?e.graphic.text:e.text}}class n extends s{constructor(){super("color","esriFieldTypeString"),this.cimPropertyName="Color"}findTargetNode(e){return e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type)}getValue(t){const r=t.color||"#000000";if(r.startsWith("#"))return r;if(r.startsWith("rgb"))return r;const s=JSON.parse(r),i=e(s);return`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/255})`}}class o extends s{constructor(){super("rotation","esriFieldTypeDouble"),this.cimPropertyName="Rotation"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return null!=e.textAngle?-e.textAngle:void 0}}class a extends s{constructor(){super("offsetX","esriFieldTypeDouble"),this.cimPropertyName="OffsetX"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return e.xOffset}}class l extends s{constructor(){super("offsetY","esriFieldTypeDouble"),this.cimPropertyName="OffsetY"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return e.yOffset}}class u extends r{constructor(){super(...arguments),this.kind="symbol"}addToSymbol(e,t){const r=this.getValue(t);if(null==r)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=r}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}class c extends u{constructor(){super(...arguments),this.cimPropertyName="VerticalAlignment"}findTargetNode(e){return e}getValue(e){return null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]}}class m extends u{constructor(){super(...arguments),this.cimPropertyName="HorizontalAlignment"}findTargetNode(e){return e}getValue(e){return null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]}}class d extends u{constructor(){super(...arguments),this.cimPropertyName="FontFamilyName"}findTargetNode(e){return e}getValue(e){return e.fontFamilyName}}class p extends u{constructor(){super(...arguments),this.cimPropertyName="FontStyleName"}findTargetNode(e){return e}getValue(e){return e.fontStyleName}}class y extends u{constructor(){super(...arguments),this.cimPropertyName="Height"}findTargetNode(e){return e}getValue(e){return e.size}}class g extends u{constructor(){super(...arguments),this.cimPropertyName="Underline"}findTargetNode(e){return e}getValue(e){return e.underline}}const f=new i,N=new n,h=new o,x=new a,T=new l,b=new y,v=new g,P=[f,N,h,x,T],F=[new m,new c,new d,new p,b,v];export{P as featureFields,F as symbolFields};
2
+ import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class r{}class s extends r{constructor(e,t){super(),this.kind="feature";const r=`__virtual_fi_${e}`;this.realField={name:r,alias:r,type:t,editable:!1,nullable:!0}}addToFeature(e,t){const r=this.getValue(t);e.attributes[this.realField.name]=r}addToSymbol(e){const r=this.findTargetNode(e.symbol);let{primitiveName:s}=r;s||(t++,s=`primitive_${t}`,r.primitiveName=s);const i={type:"CIMPrimitiveOverride",primitiveName:s,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realField.name};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(i)}}class i extends s{constructor(){super("text","esriFieldTypeString"),this.cimPropertyName="TextString"}findTargetNode(e){return e.symbolLayers[0].markerGraphics[0]}getValue(e){return e.graphic?e.graphic.text:e.text}}class n extends s{constructor(){super("color","esriFieldTypeString"),this.cimPropertyName="Color"}findTargetNode(e){return e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type)}getValue(t){const r=t.color||"#000000";if(r.startsWith("#"))return r;if(r.startsWith("rgb"))return r;const s=JSON.parse(r),i=e(s);return`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/255})`}}class o extends s{constructor(){super("rotation","esriFieldTypeDouble"),this.cimPropertyName="Rotation"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return null!=e.textAngle?-e.textAngle:void 0}}class a extends s{constructor(){super("offsetX","esriFieldTypeDouble"),this.cimPropertyName="OffsetX"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return e.xOffset}}class l extends s{constructor(){super("offsetY","esriFieldTypeDouble"),this.cimPropertyName="OffsetY"}findTargetNode(e){return e.symbolLayers[0]}getValue(e){return e.yOffset}}class u extends r{constructor(){super(...arguments),this.kind="symbol"}addToSymbol(e,t){const r=this.getValue(t);if(null==r)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=r}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}class c extends u{constructor(){super(...arguments),this.cimPropertyName="VerticalAlignment"}findTargetNode(e){return e}getValue(e){return null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]}}class m extends u{constructor(){super(...arguments),this.cimPropertyName="HorizontalAlignment"}findTargetNode(e){return e}getValue(e){return null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]}}class d extends u{constructor(){super(...arguments),this.cimPropertyName="FontFamilyName"}findTargetNode(e){return e}getValue(e){return e.fontFamilyName}}class p extends u{constructor(){super(...arguments),this.cimPropertyName="FontStyleName"}findTargetNode(e){return e}getValue(e){return e.fontStyleName}}class y extends u{constructor(){super(...arguments),this.cimPropertyName="Height"}findTargetNode(e){return e}getValue(e){return e.size}}class g extends u{constructor(){super(...arguments),this.cimPropertyName="Underline"}findTargetNode(e){return e}getValue(e){return e.underline}}const f=new i,N=new n,h=new o,x=new a,T=new l,b=new y,v=new g,P=[f,N,h,x,T],F=[new m,new c,new d,new p,b,v];export{P as featureFields,F as symbolFields};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{applyAltitudeConstraint as t,getAltitudeConstraintError as o}from"./constraintUtils/altitude.js";import{hasConstraintType as r}from"./constraintUtils/common.js";import{ConstraintOptions as n}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as i,getDistanceConstraintError as e}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as s}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as a,getTiltConstraintError as c}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function l(t,o,n=U,i=o){i!==o&&i.copyFrom(o),i.computeUp(t.state.viewingMode);let e=!1;for(let s=0;s<j;s++){let o=0;for(const s of y)if(r(n.selection,s.type)){const r=Math.abs(s.error(t,i,n));s.apply(t,i,n)&&(e=!0,o+=r)}if(0===o)break}const a=r(n.selection,8),c=m(n.interactionType,t);return a&&s(t,null,i,c)&&(e=!0),e&&i.computeUp(t.state.viewingMode),e}function m(t,o){switch(t){case 4:return 1;case 5:return o.state.isGlobal?2:1;default:return 0}}function f(t){const o=Math.min(1,t/150);return p(o)}function u(t,o,r){return c(t,o,r)*o.distance}const y=[{type:1,error:u,apply:a},{type:2,error:o,apply:t},{type:4,error:e,apply:i}],U=new n,j=5;export{l as applyAll,f as pixelDistanceToInteractionFactor};
2
+ import{applyAltitudeConstraint as t,getAltitudeConstraintError as o}from"./constraintUtils/altitude.js";import{hasConstraintType as r}from"./constraintUtils/common.js";import{ConstraintOptions as n}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as i,getDistanceConstraintError as e}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as s}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as a,getTiltConstraintError as c}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function l(t,o,n=U,i=o,e=null){i!==o&&i.copyFrom(o),i.computeUp(t.state.viewingMode);let a=!1;for(let s=0;s<j;s++){let o=0;for(const e of y)if(r(n.selection,e.type)){const r=Math.abs(e.error(t,i,n));e.apply(t,i,n)&&(a=!0,o+=r)}if(0===o)break}e?.copyFrom(i);const c=r(n.selection,8),p=m(n.interactionType,t);return c&&s(t,null,i,p)&&(a=!0),a&&i.computeUp(t.state.viewingMode),a}function m(t,o){switch(t){case 4:return 1;case 5:return o.state.isGlobal?2:1;default:return 0}}function f(t){const o=Math.min(1,t/150);return p(o)}function u(t,o,r){return c(t,o,r)*o.distance}const y=[{type:1,error:u,apply:a},{type:2,error:o,apply:t},{type:4,error:e,apply:i}],U=new n,j=5;export{l as applyAll,f as pixelDistanceToInteractionFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import i from"../../../core/Accessor.js";import{deg2rad as e,rad2deg as a}from"../../../core/mathUtils.js";import{watch as s,sync as n,initial as r}from"../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{applyAll as c}from"../camera/constraintUtils.js";import{surfaceElevationBelowRenderLocation as u}from"../camera/intersectionUtils.js";import{ConstraintOptions as d}from"../camera/constraintUtils/ConstraintOptions.js";import{createNearFarHeuristic as h}from"./NearFarHeuristic.js";import{SurfaceCollisionConstraint as p}from"./SurfaceCollisionConstraint.js";let m=class extends i{constructor(t){super(t),this.nearFarHeuristic=h(t.view.state.viewingMode,t.view.groundView,t.view.renderCoordsHelper.spatialReference)}initialize(){const t=()=>this._updateNearFar();this.addHandles([s(()=>[this.view.constraints.clipDistance.near,this.view.constraints.clipDistance.far],()=>this._clipDistanceNearFarChanged()),this.view.state.events.on("before-camera-change",({camera:t,sceneDepthRange:i})=>this._updateCameraNearFar(t,i)),s(()=>this.view.constraints.clipDistance.mode,t),s(()=>this.view.stage.renderer.sceneDepthRange.value,t,n),s(()=>this.view.renderDataExtent,t,n),s(()=>this.view.groundView.visibleElevationRange,t,n),s(()=>[this.view.constraints.altitude.min,this.view.constraints.altitude.max],()=>this._updateAltitude(),n),s(()=>this.view.constraints.tilt.max,()=>this._updateTiltMax(),n),s(()=>this.view.constraints.tilt.mode,()=>this._updateTilt(),n),s(()=>this.view.state?.camera,()=>this._updateTiltAutoMax(),n),s(()=>[this.view.map?.ground?.navigationConstraint?.type,this.view.state.constraints.collision.enabled],()=>this._updateCollision(),n)]),this.view.state.isLocal&&this.addHandles(s(()=>this.view.renderDataExtent,t=>this._updateLocalSurfaceDistance(t),r)),this._updateNearFar(),2!==this.view.state.viewingMode&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new p({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const t=this.view.constraints.clipDistance;"auto"!==t.mode&&this.view.state.updateCamera(i=>v(i,t))}_updateNearFar(){this.view.state.updateCamera(t=>this._updateCameraNearFar(t))}_updateCameraNearFar(t,i){const e=this.view.constraints.clipDistance;"manual"===e.mode?v(t,e):this._updateCameraNearFarAuto(t,e,i)}_updateCameraNearFarAuto(t,i,e=this.view.stage.renderer.sceneDepthRange.value){const a=u(this.view,t.eye),s=this.nearFarHeuristic.compute(t,this.view.renderDataExtent,e,a);t.near=s.near,t.far=s.far,i&&i.autoUpdate(t.near,t.far)}_updateCollision(){const t=this.view.map?.ground?.navigationConstraint?.type,i=!t||"stay-above"===t,e=this.view.state.constraints.collision;if(i!==e.enabled){e.enabled=i,i&&this._reapplyConstraints(8);"auto"===this.view.constraints.tilt.mode&&this._updateTiltAuto()}}_updateAltitude(){const t=this.view.constraints.altitude;1===this.view.state.viewingMode?this.view.state.constraints.altitude={min:t.min,max:t.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const t=this.view.constraints.tilt;"auto"!==t.mode&&(this._updateTiltManual(t),this._reapplyConstraints())}_updateTilt(){const t=this.view.constraints.tilt;"manual"===t.mode?this._updateTiltManual(t):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(t){const i=this.view.state.constraints;i.tilt=i.createConstantMaxTilt(e(t.max))}_updateTiltAuto(){const t=this.view.state.constraints;t.tilt=t.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const t=this.view.constraints.tilt;if("auto"!==t.mode)return;const i=this.view.state.constraints;if(i.tilt){const e=i.tilt(this.view.state.camera.distance).max;t.autoUpdate(a(e))}}_updateLocalSurfaceDistance(t){if(null==t)return;let i=Math.max(t.width,t.height);if(i<=0)return;null!=t.zmax&&null!=t.zmin&&(i=Math.max(i,t.zmax-t.zmin));const e=this.view.state,a=3*i/Math.atan(e.camera.fov/2);a!==e.constraints.distance&&(e.constraints.distance=a)}_reapplyConstraints(t=15){this.view.state.updateCamera(i=>c(this.view,i,new d(t,0,null)))}};function v(t,i){i&&(t.near=i.near,t.far=i.far)}t([o({constructOnly:!0})],m.prototype,"view",void 0),t([o({readOnly:!0})],m.prototype,"surfaceCollisionConstraint",void 0),m=t([l("esri.views.3d.state.ConstraintsManager")],m);export{m as ConstraintsManager};
2
+ import{__decorate as t}from"tslib";import i from"../../../core/Accessor.js";import{deg2rad as e,rad2deg as a}from"../../../core/mathUtils.js";import{watch as s,sync as n,initial as r}from"../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{applyAll as c}from"../camera/constraintUtils.js";import{surfaceElevationBelowRenderLocation as u}from"../camera/intersectionUtils.js";import{ConstraintOptions as d}from"../camera/constraintUtils/ConstraintOptions.js";import{createNearFarHeuristic as h}from"./NearFarHeuristic.js";import{SurfaceCollisionConstraint as p}from"./SurfaceCollisionConstraint.js";let m=class extends i{constructor(t){super(t),this.nearFarHeuristic=h(t.view.state.viewingMode,t.view.groundView,t.view.renderCoordsHelper.spatialReference)}initialize(){const t=()=>this._updateNearFar();this.addHandles([s(()=>[this.view.constraints.clipDistance.near,this.view.constraints.clipDistance.far],()=>this._clipDistanceNearFarChanged()),this.view.state.events.on("before-camera-change",({camera:t,sceneDepthRange:i})=>this._updateCameraNearFar(t,i)),s(()=>this.view.constraints.clipDistance.mode,t),s(()=>this.view.stage.renderer.sceneDepthRange.value,t,n),s(()=>this.view.renderDataExtent,t,n),s(()=>this.view.groundView.visibleElevationRange,t,n),s(()=>[this.view.constraints.altitude.min,this.view.constraints.altitude.max],()=>this._updateAltitude(),n),s(()=>this.view.constraints.tilt.max,()=>this._updateTiltMax(),n),s(()=>this.view.constraints.tilt.mode,()=>this._updateTilt(),n),s(()=>this.view.state?.camera,()=>this._updateTiltAutoMax(),n),s(()=>[this.view.map?.ground?.navigationConstraint?.type,this.view.state.constraints.collision.enabled],()=>this._updateCollision(),n)]),this.view.state.isLocal&&this.addHandles(s(()=>this.view.renderDataExtent,t=>this._updateLocalSurfaceDistance(t),r)),this._updateNearFar(),2!==this.view.state.viewingMode&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new p({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const t=this.view.constraints.clipDistance;"auto"!==t.mode&&this.view.state.updateCamera(i=>v(i,t))}_updateNearFar(){this.view.state.updateCamera(t=>this._updateCameraNearFar(t))}_updateCameraNearFar(t,i){const e=this.view.constraints.clipDistance;"manual"===e.mode?v(t,e):this._updateCameraNearFarAuto(t,e,i)}_updateCameraNearFarAuto(t,i,e=this.view.stage.renderer.sceneDepthRange.value){const a=u(this.view,t.eye),s=this.nearFarHeuristic.compute(t,this.view.renderDataExtent,e,a);t.near=s.near,t.far=s.far,i&&i.autoUpdate(t.near,t.far)}_updateCollision(){const t=this.view.map?.ground?.navigationConstraint?.type,i=!t||"stay-above"===t,e=this.view.state.constraints.collision;if(i!==e.enabled){e.enabled=i,i&&this._reapplyConstraints(8);"auto"===this.view.constraints.tilt.mode&&this._updateTiltAuto()}}_updateAltitude(){const t=this.view.constraints.altitude;1===this.view.state.viewingMode?this.view.state.constraints.altitude={min:t.min,max:t.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const t=this.view.constraints.tilt;"auto"!==t.mode&&(this._updateTiltManual(t),this._reapplyConstraints())}_updateTilt(){const t=this.view.constraints.tilt;"manual"===t.mode?this._updateTiltManual(t):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(t){const i=this.view.state.constraints;i.tilt=i.createConstantMaxTilt(e(t.max))}_updateTiltAuto(){const t=this.view.state.constraints;t.tilt=t.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const t=this.view.constraints.tilt;if("auto"!==t.mode)return;const i=this.view.state.constraints;if(i.tilt){const e=i.tilt(this.view.state.camera.distance).max;t.autoUpdate(a(e))}}_updateLocalSurfaceDistance(t){if(null==t)return;let i=Math.max(t.width,t.height);if(i<=0)return;null!=t.zmax&&null!=t.zmin&&(i=Math.max(i,t.zmax-t.zmin));const e=this.view.state,a=3*i/Math.atan(e.camera.fov/2);a!==e.constraints.distance&&(e.constraints.distance=a)}_reapplyConstraints(t=15){this.view.state.updateCamera(i=>{const e=i.clone();c(this.view,i,new d(t,0,null),i,e),this.surfaceCollisionConstraint?.setSourceCamera(e)})}};function v(t,i){i&&(t.near=i.near,t.far=i.far)}t([o({constructOnly:!0})],m.prototype,"view",void 0),t([o({readOnly:!0})],m.prototype,"surfaceCollisionConstraint",void 0),m=t([l("esri.views.3d.state.ConstraintsManager")],m);export{m as ConstraintsManager};