@arcgis/core 5.0.0-next.67 → 5.0.0-next.68

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 (313) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +9 -6
  2. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.js +1 -1
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/batchExec.js +1 -1
  7. package/arcade/compilerUtils.js +1 -1
  8. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  9. package/arcade/geometry/unitConversion.js +1 -1
  10. package/arcade/treeAnalysis.js +1 -1
  11. package/arcade.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{251eb6e00f99a816d55c.js → 0326314947734b8e640a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/04176244b0a3539c9681.js +1 -0
  15. package/assets/esri/core/workers/chunks/{942fad4ec96295672ce8.js → 10e474d664b20adcd917.js} +1 -1
  16. package/assets/esri/core/workers/chunks/12f9a55253084a910b2e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{0629087bd5bb8048493e.js → 14dedd80fb797303f91f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{81d89107ff82604a3ea0.js → 1b445981fbc8373f4dd8.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{6ba3c2b9f699d94d62b8.js → 1ec1a1997b5577619040.js} +1 -1
  20. package/assets/esri/core/workers/chunks/2085084324cd5a81783f.js +1 -0
  21. package/assets/esri/core/workers/chunks/2c2c0f66cffc521df736.js +1 -0
  22. package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +1 -0
  23. package/assets/esri/core/workers/chunks/2dfa7abf2d39fa5a3874.js +1 -0
  24. package/assets/esri/core/workers/chunks/322085d63719da6e443c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{76086517591d0eb35156.js → 34a2e0462eb05986cdd1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{a6dcd13c792b6538ac50.js → 35593a9790818b689455.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3a04153ca9d8e4f01185.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4e9a8fce55cad841c731.js → 3b25f5d9c8f78bb6e011.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ed317900f0edf635508.js +1 -0
  31. package/assets/esri/core/workers/chunks/401ce5cb98fa14c1a725.js +1 -0
  32. package/assets/esri/core/workers/chunks/4319b89cfa02894a8cae.js +1 -0
  33. package/assets/esri/core/workers/chunks/4a060147d25929680ec8.js +1 -0
  34. package/assets/esri/core/workers/chunks/{7bed14d9bcd7fc5e2eec.js → 4bcd74951477e8977ba1.js} +1 -1
  35. package/assets/esri/core/workers/chunks/4d0eaeb4cd6cd55e25fd.js +1 -0
  36. package/assets/esri/core/workers/chunks/{687d2b761dc5b5cf0c31.js → 4d4d71d24c1a9cb342b8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
  38. package/assets/esri/core/workers/chunks/50f03813fba4b752ca9f.js +1 -0
  39. package/assets/esri/core/workers/chunks/{abc236e99b52be1c83b9.js → 52a14266fe239b95c5ce.js} +1 -1
  40. package/assets/esri/core/workers/chunks/53b5c77832df7df4d4e3.js +1 -0
  41. package/assets/esri/core/workers/chunks/{34178ace79e8dea3567d.js → 562cddaf63985e53ee6e.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{6599cc702a46f81a5634.js → 5dd5be91038df8902dc4.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{49a1b7f700b8a42de817.js → 60c7f896f2246a8aa6d7.js} +19 -19
  44. package/assets/esri/core/workers/chunks/60f363ee2add089e8f0b.js +1 -0
  45. package/assets/esri/core/workers/chunks/61801bb8c7be8fe77086.js +1 -0
  46. package/assets/esri/core/workers/chunks/68074a484d7f9bc713c0.js +1 -0
  47. package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3fe7be535affae31de7e.js → 6b85a8776ec2beff63cb.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6df484faf54e90a6cc77.js +1 -0
  50. package/assets/esri/core/workers/chunks/6ea6ad894ac634aa4391.js +1 -0
  51. package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +1 -0
  52. package/assets/esri/core/workers/chunks/75fd2ef1236a9364ca7f.js +1 -0
  53. package/assets/esri/core/workers/chunks/7be9bbae23895d1cfa92.js +1 -0
  54. package/assets/esri/core/workers/chunks/7ea48661f1087d06aa41.js +1 -0
  55. package/assets/esri/core/workers/chunks/{47e5149765beee46f208.js → 7ee68f67f9cc48a328f0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/866477acdf03b8a40bc9.js +1 -0
  57. package/assets/esri/core/workers/chunks/8e83c133b201b9b61e70.js +1 -0
  58. package/assets/esri/core/workers/chunks/9086a4933d3d3d9ffa72.js +1 -0
  59. package/assets/esri/core/workers/chunks/94174d40de39dbe7d0bf.js +1 -0
  60. package/assets/esri/core/workers/chunks/98f4b44eca91c42ca08e.js +1 -0
  61. package/assets/esri/core/workers/chunks/{dd99b77a7c0a052507bb.js → 9d88b4ba8e511da64583.js} +3 -3
  62. package/assets/esri/core/workers/chunks/a808be466812db51813d.js +1 -0
  63. package/assets/esri/core/workers/chunks/{6b4a24248182245167ca.js → a931515a2569713e743b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +1 -0
  65. package/assets/esri/core/workers/chunks/adc68e2c6d2698a52bfe.js +1 -0
  66. package/assets/esri/core/workers/chunks/b2a1e5e9182b643909eb.js +316 -0
  67. package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +1 -0
  68. package/assets/esri/core/workers/chunks/{07639f406b71bb49ffd6.js → bdbb5b33f0f49661bf6d.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c042269586921e337be9.js +1 -0
  70. package/assets/esri/core/workers/chunks/c623918e289a09905cd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/c7391b0b5a9c916a53f7.js +1 -0
  72. package/assets/esri/core/workers/chunks/{43d28c6509c21b8917a8.js → ca7523c14d81c470e92e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/cd2708fb7636b3ace229.js +1 -0
  74. package/assets/esri/core/workers/chunks/d445e9399fe4ca3d2a50.js +1 -0
  75. package/assets/esri/core/workers/chunks/d7683a95775c9f401a7e.js +1 -0
  76. package/assets/esri/core/workers/chunks/{9d6945cda99d14af83ac.js → d7d9656b990ce8be2152.js} +1 -1
  77. package/assets/esri/core/workers/chunks/df4a0af329ce94a47a7b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e10d6e511921394474ca.js +1 -0
  79. package/assets/esri/core/workers/chunks/e4b6aa8f67c2bd285020.js +1 -0
  80. package/assets/esri/core/workers/chunks/e6ca02f98f855024f74b.js +1 -0
  81. package/assets/esri/core/workers/chunks/{892157696e8f9e38c472.js → e6e837e43b9348050832.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{d3325ed8d224e2350db7.js → e8a3ad00936f2ccaf362.js} +1 -1
  83. package/assets/esri/core/workers/chunks/ef7063ee790d2d64d4b2.js +1 -0
  84. package/assets/esri/core/workers/chunks/{b65fcfde62d49de1fa54.js → ef977be20a647aeded0a.js} +1 -1
  85. package/assets/esri/core/workers/chunks/efb631371b6bb3f043bb.js +1 -0
  86. package/assets/esri/core/workers/chunks/{0f5693541111fcae0c2f.js → f0914715e90e43466f8c.js} +1 -1
  87. package/assets/esri/core/workers/chunks/f95e488d2b86e320624f.js +1 -0
  88. package/assets/esri/core/workers/chunks/{bfc063d4431bfa162160.js → fd09f38fb4d99bf34988.js} +1 -1
  89. package/chunks/boundedPlane.js +1 -1
  90. package/config.js +1 -1
  91. package/core/accessorSupport/ensureType.js +1 -1
  92. package/core/compilerUtils.js +1 -1
  93. package/core/typedArrayUtil.js +1 -1
  94. package/core/units.js +1 -1
  95. package/core/workers/loaderConfig.js +1 -1
  96. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  97. package/geometry/support/MeshTexture.js +1 -1
  98. package/geometry/support/aaBoundingRect.js +1 -1
  99. package/geometry/support/boundedPlane.js +1 -1
  100. package/geometry/support/heightModelInfoUtils.js +1 -1
  101. package/geometry/support/meshUtils/External.js +1 -1
  102. package/geometry/support/meshUtils/exporters/gltf/imageutils.js +1 -1
  103. package/geometry/support/meshUtils/loadExternal.js +1 -1
  104. package/geometry/support/rotate.js +1 -1
  105. package/interfaces.d.ts +0 -1
  106. package/kernel.js +1 -1
  107. package/layers/BuildingSceneLayer.d.ts +1 -1
  108. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
  109. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  110. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  111. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  112. package/layers/graphics/dehydratedFeatures.js +1 -1
  113. package/layers/graphics/hydratedFeatures.js +1 -1
  114. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  115. package/layers/raster/functions/changeDetectionUtils.js +1 -1
  116. package/layers/raster/functions/customBandIndexUtils.js +1 -1
  117. package/layers/raster/functions/focalStatUtils.js +1 -1
  118. package/layers/raster/functions/pixelTransformUtils.js +1 -1
  119. package/layers/save/featureLayerUtils.js +1 -1
  120. package/layers/support/ElevationSampler.js +1 -1
  121. package/layers/support/SubtypeSublayer.js +1 -1
  122. package/layers/support/domains.js +1 -1
  123. package/networks/support/TopologyValidationJobInfo.js +1 -1
  124. package/networks/support/TraceJobInfo.js +1 -1
  125. package/package.json +2 -2
  126. package/renderers/support/RasterSymbolizer.js +1 -1
  127. package/renderers/support/rendererConversion.js +1 -1
  128. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  129. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  130. package/rest/support/JobInfo.js +1 -1
  131. package/rest/support/ServiceAreaParameters.js +1 -1
  132. package/smartMapping/heuristics/sizeRange.js +1 -1
  133. package/smartMapping/renderers/support/utils.js +1 -1
  134. package/smartMapping/statistics/support/statsWorker.js +1 -1
  135. package/smartMapping/statistics/support/utils.js +1 -1
  136. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  137. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  138. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  139. package/smartMapping/support/utils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/symbols/support/ElevationInfo.d.ts +2 -2
  142. package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
  143. package/symbols/support/defaults.js +1 -1
  144. package/symbols/support/defaults3D.js +1 -1
  145. package/symbols/support/previewSymbol3D.js +1 -1
  146. package/symbols/support/symbolLayerUtils3D.js +1 -1
  147. package/symbols/support/symbolUtils.js +1 -1
  148. package/symbols/support/utils.js +1 -1
  149. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  150. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +16 -11
  151. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  152. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  153. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  154. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  155. package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
  156. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  157. package/views/2d/input/handlers/DoubleTapDragZoom.js +1 -1
  158. package/views/2d/input/handlers/KeyZoom.js +1 -1
  159. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  160. package/views/2d/layers/TileLayerView2D.js +1 -1
  161. package/views/3d/analysis/AreaMeasurement/support/utils.js +1 -1
  162. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  163. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  164. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +16 -11
  165. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  166. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  167. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  168. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  169. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  170. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  171. package/views/3d/environment/CloudsParameters.js +1 -1
  172. package/views/3d/environment/CloudsRenderer.js +1 -1
  173. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  174. package/views/3d/glTF/internal/Resource.js +1 -1
  175. package/views/3d/glTF/internal/fillDefaults.js +1 -1
  176. package/views/3d/interactive/Manipulator3D.js +1 -1
  177. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  178. package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
  179. package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
  180. package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
  181. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  182. package/views/3d/layers/I3SMeshView3D.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  184. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  185. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  187. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  188. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  189. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  190. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  191. package/views/3d/layers/graphics/lineUtils.js +1 -1
  192. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  193. package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
  194. package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
  195. package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
  196. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  197. package/views/3d/layers/i3s/I3SNode.js +1 -1
  198. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  199. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  200. package/views/3d/layers/i3s/SphereCone.js +5 -0
  201. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  202. package/views/3d/layers/support/edgeUtils.js +1 -1
  203. package/views/3d/layers/support/featureReference.js +1 -1
  204. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  205. package/views/3d/layers/support/patternUtils.js +1 -1
  206. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  207. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  208. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  209. package/views/3d/support/buffer/glUtil.js +1 -1
  210. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  211. package/views/3d/support/viewpointUtils.js +1 -1
  212. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  213. package/views/3d/webgl/RenderNode.js +1 -1
  214. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +8 -8
  215. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  216. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  217. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -2
  218. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -2
  219. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +6 -6
  220. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
  221. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -5
  222. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +3 -3
  223. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
  224. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  225. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  226. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  228. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +4 -4
  229. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
  230. package/views/VideoView.js +1 -1
  231. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  232. package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +5 -0
  233. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  234. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  235. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  236. package/views/analysis/ElevationProfile/constants.js +1 -1
  237. package/views/draw/Draw.js +1 -1
  238. package/views/input/ViewEvents.js +1 -1
  239. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  240. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  241. package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
  242. package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
  243. package/views/support/PromiseQueue.js +1 -1
  244. package/views/support/screenUtils.js +1 -1
  245. package/views/support/screenshotUtils.js +1 -1
  246. package/views/webgl/FramebufferObject.js +1 -1
  247. package/views/webgl/Uniform.js +1 -1
  248. package/views/webgl/Util.js +1 -1
  249. package/webscene/Slide.d.ts +2 -2
  250. package/webscene/spec-certification/api.js +1 -1
  251. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm.js +1 -1
  254. package/widgets/Editor/workflowUtils.js +1 -1
  255. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  256. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  257. package/widgets/FeatureForm.js +1 -1
  258. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  259. package/widgets/Sketch/support/OperationHandle.js +1 -1
  260. package/widgets/TimeSlider.js +1 -1
  261. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  262. package/widgets/support/dateUtils.js +1 -1
  263. package/assets/esri/core/workers/chunks/055fdc5134d54174444d.js +0 -316
  264. package/assets/esri/core/workers/chunks/058fb2cd6387acfd458c.js +0 -1
  265. package/assets/esri/core/workers/chunks/08359ae020238a565955.js +0 -1
  266. package/assets/esri/core/workers/chunks/0ae018098906d6a88904.js +0 -1
  267. package/assets/esri/core/workers/chunks/0cd3acfbf9ee991bdab4.js +0 -1
  268. package/assets/esri/core/workers/chunks/0dc3a04ce717b7ddd957.js +0 -1
  269. package/assets/esri/core/workers/chunks/0e5cd0cf6ab7cb37d723.js +0 -1
  270. package/assets/esri/core/workers/chunks/0ee407b8db5c07a00d82.js +0 -1
  271. package/assets/esri/core/workers/chunks/10373885604655f673df.js +0 -1
  272. package/assets/esri/core/workers/chunks/119822a646834c1cebc0.js +0 -1
  273. package/assets/esri/core/workers/chunks/13d61d34e55c80e4ecdf.js +0 -1
  274. package/assets/esri/core/workers/chunks/17dea03fc4eb414f0022.js +0 -1
  275. package/assets/esri/core/workers/chunks/1967239713b58dccfd81.js +0 -1
  276. package/assets/esri/core/workers/chunks/1c350a2c4014146dbcd9.js +0 -1
  277. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
  278. package/assets/esri/core/workers/chunks/226acd251ad7d7ee3b57.js +0 -1
  279. package/assets/esri/core/workers/chunks/22b07c54a5fcc27771b0.js +0 -1
  280. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +0 -1
  281. package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +0 -1
  282. package/assets/esri/core/workers/chunks/27f096c434f049b8df01.js +0 -1
  283. package/assets/esri/core/workers/chunks/3371935a4fd6346d3a17.js +0 -1
  284. package/assets/esri/core/workers/chunks/3c4f8597f602779174f1.js +0 -1
  285. package/assets/esri/core/workers/chunks/3da53c017f9c5d2d778a.js +0 -1
  286. package/assets/esri/core/workers/chunks/4773a358832f87963766.js +0 -1
  287. package/assets/esri/core/workers/chunks/492515860198f38dd698.js +0 -1
  288. package/assets/esri/core/workers/chunks/4f33a2ecb154a2c2449c.js +0 -1
  289. package/assets/esri/core/workers/chunks/4f6f181ee83b4d484518.js +0 -1
  290. package/assets/esri/core/workers/chunks/52726458f590e726d52c.js +0 -1
  291. package/assets/esri/core/workers/chunks/536c492fdda30f2f1288.js +0 -1
  292. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +0 -1
  293. package/assets/esri/core/workers/chunks/63b8cd7d5cafbaeed894.js +0 -1
  294. package/assets/esri/core/workers/chunks/6cb44cd319cb6c2539c8.js +0 -1
  295. package/assets/esri/core/workers/chunks/7f4fa2f2e85863d3cfb9.js +0 -1
  296. package/assets/esri/core/workers/chunks/8f4c480c418eba299c2b.js +0 -1
  297. package/assets/esri/core/workers/chunks/a3836f6a93924ee4816e.js +0 -1
  298. package/assets/esri/core/workers/chunks/ab520fd1ae917daf07d8.js +0 -1
  299. package/assets/esri/core/workers/chunks/acc7ff44bfcb5c195114.js +0 -1
  300. package/assets/esri/core/workers/chunks/b25a131c04092c3ab75d.js +0 -1
  301. package/assets/esri/core/workers/chunks/b7960ab9a9da7f88184c.js +0 -1
  302. package/assets/esri/core/workers/chunks/b9909264cfea68d5f2a1.js +0 -1
  303. package/assets/esri/core/workers/chunks/bb08359610a41e304b55.js +0 -1
  304. package/assets/esri/core/workers/chunks/bfbbcaa1fb04f17fc869.js +0 -1
  305. package/assets/esri/core/workers/chunks/d30cfc5fa302cc08d862.js +0 -1
  306. package/assets/esri/core/workers/chunks/d75adfd4acb3c92accc9.js +0 -1
  307. package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +0 -1
  308. package/assets/esri/core/workers/chunks/de71db3b0fb947b13c97.js +0 -1
  309. package/assets/esri/core/workers/chunks/dfbbead4c24d13682891.js +0 -1
  310. package/assets/esri/core/workers/chunks/e4ba850e8344ac2c5fc0.js +0 -1
  311. package/assets/esri/core/workers/chunks/e705d041f6c1632bfbcc.js +0 -1
  312. package/assets/esri/core/workers/chunks/f9370830051865a3435b.js +0 -1
  313. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{clamp as a}from"../../../core/mathUtils.js";import{signal as e}from"../../../core/signal.js";import{rotate as s}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{D as h,n as o,j as n,d as c,b as d,e as l}from"../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f,fromPoints as p,axis as m}from"../../../geometry/support/axisAngleDegrees.js";import{earth as F}from"../../../geometry/support/Ellipsoid.js";import{ensureClouds as P}from"./Clouds.js";import{heightLimit as x}from"./weather.js";class v{constructor(){this.startTime=0,this._data=e(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new g,this.parallaxNew=new g,this._anchorPoint=_(),this._fadeState=e(0),this._fadeFactor=e(1)}get data(){return this._data.value}set data(t){this._data.value=t}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,e,s){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=s?a((e-this.startTime)/(C*s),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(t,e),this._updateParallax(t)}_evaluateState(t,a){const e=t.relativeElevation,s=this._updateAnchorPoint(t);(Math.abs(e)>1.7*x||s>k)&&this.opacity>0?this._startFade(0,a):this.isFading||(Math.abs(e)>x||s>j*k?this.opacity>0&&this._startFade(4,a):P(this.data)&&(0===this.opacity?this._startFade(1,a):2===this.data.state&&(2===this.fadeState?this._startFade(3,a):this._startFade(2,a))))}_updateParallax(t){const a=h(t.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(a-F.radius*F.radius,0))/Math.sqrt(a),p(w,this.parallax.anchorPoint,S),s(this.parallax.transform,i,S[3],m(S)),p(w,this.parallaxNew.anchorPoint,S),s(this.parallaxNew.transform,i,S[3],m(S))}_updateAnchorPoint(t){return o(this._anchorPoint,t.eye),n(this._anchorPoint,this._anchorPoint,F.radius),0===this.fadeState&&2===this.data?.state?(c(this.parallax.anchorPoint,this._anchorPoint),0):d(l(b,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(t,a){switch(this._fadeState.value=t,this.startTime=a,t){case 3:this.requestFade(),this._switchReadChannels(),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:c(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:t(this.fadeState)}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class g{constructor(){this.anchorPoint=_(),this.radiusCurvatureCorrection=0,this.transform=r()}}const w=u(0,0,1),S=f(),b=_(),C=1.25,j=.5,k=2e5;export{v as CloudsParameters};
5
+ import{clamp as a}from"../../../core/mathUtils.js";import{signal as t}from"../../../core/signal.js";import{rotate as e}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as i}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{D as r,n as h,j as o,d as n,b as c,e as d}from"../../../chunks/vec32.js";import{create as l,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,fromPoints as f,axis as p}from"../../../geometry/support/axisAngleDegrees.js";import{earth as m}from"../../../geometry/support/Ellipsoid.js";import{ensureClouds as F}from"./Clouds.js";import{heightLimit as P}from"./weather.js";class x{constructor(){this.startTime=0,this._data=t(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new v,this.parallaxNew=new v,this._anchorPoint=l(),this._fadeState=t(0),this._fadeFactor=t(1)}get data(){return this._data.value}set data(a){this._data.value=a}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,e,s){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=s?a((e-this.startTime)/(b*s),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(t,e),this._updateParallax(t)}_evaluateState(a,t){const e=a.relativeElevation,s=this._updateAnchorPoint(a);(Math.abs(e)>1.7*P||s>j)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(e)>P||s>C*j?this.opacity>0&&this._startFade(4,t):F(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(a){const t=r(a.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-m.radius*m.radius,0))/Math.sqrt(t),f(g,this.parallax.anchorPoint,w),e(this.parallax.transform,s,w[3],p(w)),f(g,this.parallaxNew.anchorPoint,w),e(this.parallaxNew.transform,s,w[3],p(w))}_updateAnchorPoint(a){return h(this._anchorPoint,a.eye),o(this._anchorPoint,this._anchorPoint,m.radius),0===this.fadeState&&2===this.data?.state?(n(this.parallax.anchorPoint,this._anchorPoint),0):c(d(S,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(a,t){switch(this._fadeState.value=a,this.startTime=t,a){case 3:this.requestFade(),this._switchReadChannels(),n(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),n(this.parallax.anchorPoint,this._anchorPoint),n(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),n(this.parallax.anchorPoint,this._anchorPoint),n(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:n(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class v{constructor(){this.anchorPoint=l(),this.radiusCurvatureCorrection=0,this.transform=i()}}const g=_(0,0,1),w=u(),S=l(),b=1.25,C=.5,j=2e5;export{x as CloudsParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{neverReached as s}from"../../../core/compilerUtils.js";import{lerp as i}from"../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as o}from"../../../core/maybe.js";import{watch as a,initial as h}from"../../../core/reactiveUtils.js";import{signal as n}from"../../../core/signal.js";import{property as l,subclass as c}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as m,copy as f,set as _}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as x,zeros as y}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as b}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as T}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../geometry/ellipsoidUtils.js";import{C as S,c as w}from"../../../chunks/Clouds.glsl.js";import{cloudPresets as C}from"./CloudsPresets.js";import{CloudsTechnique as P}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as j}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as z}from"./NoiseTextureAtlas.js";import{TaskPriority as I}from"../../support/Scheduler.js";import{Yield as M}from"../../support/Yield.js";import{ColorAttachment0 as H}from"../../webgl/enums.js";import{FramebufferObject as q}from"../../webgl/FramebufferObject.js";import{TextureDescriptor as R}from"../../webgl/TextureDescriptor.js";let U=class extends e{constructor(t){super(t),this._state=n(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=i(C.default.coverage[0],C.default.coverage[1],.5),this.density=i(C.default.density[0],C.default.density[1],.5),this.absorption=i(C.default.absorption[0],C.default.absorption[1],.5),this.cloudSize=i(C.default.cloudSize[0],C.default.cloudSize[1],.5),this.detailSize=i(C.default.detailSize[0],C.default.detailSize[1],.5),this.smoothness=i(C.default.smoothness[0],C.default.smoothness[1],.5),this.cloudHeight=i(C.default.cloudHeight[0],C.default.cloudHeight[1],.5),this.raymarchingSteps=C.default.raymarchingSteps,this._viewMatrix=p(),this._dirty=!0,this.readyToRun=!0,this._configuration=new j}initialize(){const t=v(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(I.CLOUDS_GENERATOR,this),a(()=>this.coverage,e,h),a(()=>this.density,e,h),a(()=>this.absorption,e,h),a(()=>this.cloudSize,e,h),a(()=>this.detailSize,e,h),a(()=>this.smoothness,e,h),a(()=>this.cloudHeight,e,h),a(()=>this.raymarchingSteps,e,h)]);const s=g(this._computeWeatherTile());let i=0;this.addHandles(a(()=>{const t=this._computeWeatherTile();return m(s,t)||(++i,f(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=0,this.context.techniques.precompile(P,this._configuration),this._configuration.writeTextureChannels=1,this.context.techniques.precompile(P,this._configuration)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:s(this.raymarchingSteps)}return this._configuration.writeTextureChannels=1-this.parameters.readChannels,this._configuration.steps=this.raymarchingSteps,this.context.techniques.get(P,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return x;_(A,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*A[0]-1));A[0]=Math.floor(2*this._weatherTileCount*A[0]),A[1]=Math.floor(4*(this._weatherTileCount-r)*A[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return A[0]=(A[0]+o)%(2*this._weatherTileCount),A[1]=(A[1]+a%100)%(4*this._weatherTileCount),A}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new z({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.renderContext.rctx;if(null==this._fbo){const s=new R(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new q(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.renderContext.bind.clouds}destroyCubeMap(){this._fbo=o(this._fbo),this.parameters.data=null}applyPreset(t,e){const s=t.median,r=t=>{const r=i(t[0],t[1],s);return e<.5?i(t[0],r,2*e):i(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps,this._precompile()}setDirty(){this._dirty=this.readyToRun=!0}runTask(t){if(3===this.state)return M;this._dirty&&(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e.compiled)return M;const s=O[this._sliceIndex],i=k[this._sliceIndex];d(this._viewMatrix,D,s,i),u(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.renderContext.rctx,o=r.getViewport(),a=w/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,w,a);const n=this._ensureFrameBufferCube(w);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.renderContext.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,H,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),M}};t([l({constructOnly:!0})],U.prototype,"context",void 0),t([l({constructOnly:!0})],U.prototype,"view",void 0),t([l({constructOnly:!0})],U.prototype,"requestRender",void 0),t([l()],U.prototype,"coverage",void 0),t([l()],U.prototype,"density",void 0),t([l()],U.prototype,"absorption",void 0),t([l()],U.prototype,"cloudSize",void 0),t([l()],U.prototype,"detailSize",void 0),t([l()],U.prototype,"smoothness",void 0),t([l()],U.prototype,"cloudHeight",void 0),t([l()],U.prototype,"raymarchingSteps",void 0),t([l()],U.prototype,"readyToRun",void 0),U=t([c("esri.views.3d.environment.CloudsRenderer")],U);const O=[b(1,0,0),b(-1,0,0),b(0,1,0),b(0,-1,0),b(0,0,1),b(0,0,1)],k=[b(0,0,-1),b(0,0,-1),b(0,0,-1),b(0,0,-1),b(0,1,0),b(0,1,0)],D=T(),A=y();export{U as CloudsRenderer};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{lerp as s}from"../../../core/mathUtils.js";import{destroyMaybe as i,disposeMaybe as r}from"../../../core/maybe.js";import{watch as o,initial as a}from"../../../core/reactiveUtils.js";import{signal as h}from"../../../core/signal.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as p,copy as m,set as _}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as f,ZEROS as g,zeros as x}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{C as v,c as S}from"../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as C}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as j}from"./NoiseTextureAtlas.js";import{TaskPriority as z}from"../../support/Scheduler.js";import{Yield as I}from"../../support/Yield.js";import{ColorAttachment0 as M}from"../../webgl/enums.js";import{FramebufferObject as H}from"../../webgl/FramebufferObject.js";import{TextureDescriptor as q}from"../../webgl/TextureDescriptor.js";let R=class extends e{constructor(t){super(t),this._state=h(0),this._passParameters=new v,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=s(w.default.coverage[0],w.default.coverage[1],.5),this.density=s(w.default.density[0],w.default.density[1],.5),this.absorption=s(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=s(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=s(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=s(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=s(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=d(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o(()=>this.coverage,e,a),o(()=>this.density,e,a),o(()=>this.absorption,e,a),o(()=>this.cloudSize,e,a),o(()=>this.detailSize,e,a),o(()=>this.smoothness,e,a),o(()=>this.cloudHeight,e,a),o(()=>this.raymarchingSteps,e,a)]);const s=f(this._computeWeatherTile());let i=0;this.addHandles(o(()=>{const t=this._computeWeatherTile();return p(s,t)||(++i,m(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=i(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=0,this.context.techniques.precompile(C,this._configuration),this._configuration.writeTextureChannels=1,this.context.techniques.precompile(C,this._configuration)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:this.raymarchingSteps}return this._configuration.writeTextureChannels=1-this.parameters.readChannels,this._configuration.steps=this.raymarchingSteps,this.context.techniques.get(C,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return g;_(D,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*D[0]-1));D[0]=Math.floor(2*this._weatherTileCount*D[0]),D[1]=Math.floor(4*(this._weatherTileCount-r)*D[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return D[0]=(D[0]+o)%(2*this._weatherTileCount),D[1]=(D[1]+a%100)%(4*this._weatherTileCount),D}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new j({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.renderContext.rctx;if(null==this._fbo){const s=new q(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new H(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.renderContext.bind.clouds}destroyCubeMap(){this._fbo=r(this._fbo),this.parameters.data=null}applyPreset(t,e){const i=t.median,r=t=>{const r=s(t[0],t[1],i);return e<.5?s(t[0],r,2*e):s(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps,this._precompile()}setDirty(){this._dirty=this.readyToRun=!0}runTask(t){if(3===this.state)return I;this._dirty&&(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e.compiled)return I;const s=U[this._sliceIndex],i=O[this._sliceIndex];u(this._viewMatrix,k,s,i),c(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.renderContext.rctx,o=r.getViewport(),a=S/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,S,a);const n=this._ensureFrameBufferCube(S);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.renderContext.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,M,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),I}};t([n({constructOnly:!0})],R.prototype,"context",void 0),t([n({constructOnly:!0})],R.prototype,"view",void 0),t([n({constructOnly:!0})],R.prototype,"requestRender",void 0),t([n()],R.prototype,"coverage",void 0),t([n()],R.prototype,"density",void 0),t([n()],R.prototype,"absorption",void 0),t([n()],R.prototype,"cloudSize",void 0),t([n()],R.prototype,"detailSize",void 0),t([n()],R.prototype,"smoothness",void 0),t([n()],R.prototype,"cloudHeight",void 0),t([n()],R.prototype,"raymarchingSteps",void 0),t([n()],R.prototype,"readyToRun",void 0),R=t([l("esri.views.3d.environment.CloudsRenderer")],R);const U=[y(1,0,0),y(-1,0,0),y(0,1,0),y(0,-1,0),y(0,0,1),y(0,0,1)],O=[y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,0,-1),y(0,1,0),y(0,1,0)],k=b(),D=x();export{R as CloudsRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{neverReached as i}from"../../../core/compilerUtils.js";import{destroyHandle as e}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/lang.js";import{property as r,cast as s,subclass as g}from"../../../core/accessorSupport/decorators.js";import{ensureOneOfType as h}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as o}from"./lightingUtils.js";import l from"./SunLighting.js";import a from"./VirtualLighting.js";import c from"../../../webscene/Environment.js";import p from"../../../webscene/SunLighting.js";import u from"../../../webscene/VirtualLighting.js";var m;let b=class extends c{static{m=this}constructor(t){super(t),this.lighting=this.castLighting(),this._computeWeatherAvailable=void 0,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new m({...i,lighting:i.lighting?"virtual"===i.lighting.type?a.fromWebsceneLighting(i.lighting):l.fromWebsceneLighting(i.lighting):void 0})}get weatherAvailable(){return this._computeWeatherAvailable?.()??!1}setComputeWeatherAvailable(t){this._computeWeatherAvailable=t}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const i=this._convertLighting(t);return i!==t&&this.addHandles(e(i)),i}_convertLighting(t){return t?t instanceof l||t instanceof a?t:t instanceof p?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new l({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof u?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new a({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):h(o,t):new l}clone(){return new m({lighting:this.lighting.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background)})}cloneWithWebsceneEnvironment(t){return new m({weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):l.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):a.fromWebsceneLighting(t.lighting);default:return i(t.lighting),l.fromWebsceneLighting(t.lighting)}}};t([r({types:{defaultKeyValue:"sun",...o},nonNullable:!0})],b.prototype,"lighting",void 0),t([r()],b.prototype,"_computeWeatherAvailable",void 0),t([r({readOnly:!0})],b.prototype,"weatherAvailable",null),t([s("lighting")],b.prototype,"castLighting",null),b=m=t([g("esri.views.3d.environment.SceneViewEnvironment")],b);const d=b;export{d as default};
5
+ import{__decorate as t}from"tslib";import{destroyHandle as i}from"../../../core/handleUtils.js";import{clone as e}from"../../../core/lang.js";import{property as n,cast as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import{ensureOneOfType as g}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as h}from"./lightingUtils.js";import o from"./SunLighting.js";import l from"./VirtualLighting.js";import a from"../../../webscene/Environment.js";import c from"../../../webscene/SunLighting.js";import p from"../../../webscene/VirtualLighting.js";var u;let m=class extends a{static{u=this}constructor(t){super(t),this.lighting=this.castLighting(),this._computeWeatherAvailable=void 0,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new u({...i,lighting:i.lighting?"virtual"===i.lighting.type?l.fromWebsceneLighting(i.lighting):o.fromWebsceneLighting(i.lighting):void 0})}get weatherAvailable(){return this._computeWeatherAvailable?.()??!1}setComputeWeatherAvailable(t){this._computeWeatherAvailable=t}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const e=this._convertLighting(t);return e!==t&&this.addHandles(i(e)),e}_convertLighting(t){return t?t instanceof o||t instanceof l?t:t instanceof c?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new o({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof p?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new l({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):g(h,t):new o}clone(){return new u({lighting:this.lighting.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:e(this.background)})}cloneWithWebsceneEnvironment(t){return new u({weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:e(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):o.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):l.fromWebsceneLighting(t.lighting);default:return t.lighting,o.fromWebsceneLighting(t.lighting)}}};t([n({types:{defaultKeyValue:"sun",...h},nonNullable:!0})],m.prototype,"lighting",void 0),t([n()],m.prototype,"_computeWeatherAvailable",void 0),t([n({readOnly:!0})],m.prototype,"weatherAvailable",null),t([r("lighting")],m.prototype,"castLighting",null),m=u=t([s("esri.views.3d.environment.SceneViewEnvironment")],m);const b=m;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{getKey as o}from"../../../../core/object.js";import{allSettledValues as n}from"../../../../core/promiseUtils.js";import{isDataProtocol as s,dataComponents as a,dataToArrayBuffer as i,makeAbsolute as u}from"../../../../core/urlUtils.js";import f from"../../../../core/Version.js";import{fromXRotation as c,multiply as d,translate as l,rotate as p,scale as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as b}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as w}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as g,BufferViewVec2u32 as T,BufferViewVec2u16 as _,BufferViewVec2i16 as x,BufferViewVec2u8 as O,BufferViewVec2i8 as N,BufferViewUint32 as S,BufferViewUint16 as C,BufferViewUint8 as A,BufferViewVec3f as R,BufferViewVec4f as L,BufferViewVec4u8 as v,BufferViewVec4u16 as E,BufferViewVec3u8 as I,BufferViewVec3u16 as D}from"../../../../geometry/support/buffer/BufferView.js";import{m as B}from"../../../../chunks/scalar.js";import"../../../../core/has.js";import{getDracoMeshDecoder as U}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as M}from"./BinaryStreamReader.js";import{material as j,textureSampler as G}from"./fillDefaults.js";import{splitURI as F}from"./pathUtils.js";import{jsonFromBinaryData as H,EncodedMeshTexture as P,imageFromBinaryData as V,isEncodedMeshTexture as K}from"./resourceUtils.js";import{DataType as z}from"../../../webgl/enums.js";const k={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression","KHR_materials_emissive_strength"],this._baseUri=F(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(t,r,o){if(s(r)){const e=a(r);if(e&&"model/gltf-binary"!==e.mediaType)try{const o=JSON.parse(e.isBase64?atob(e.data):e.data);return new Y(t,r,o)}catch{}const o=i(r);if(Y._isGLBData(o))return this._fromGLBData(t,r,o)}if(te.test(r)||"gltf"===o?.expectedType){const e=await t.loadJSON(r,o);return new Y(t,r,e)}const n=await t.loadBinary(r,o);if(Y._isGLBData(n))return this._fromGLBData(t,r,n);if(re.test(r)||"glb"===o?.expectedType)throw new e("gltf-loader-invalid-glb","This is not a valid glb file.");const u=await t.loadJSON(r,o);return new Y(t,r,u)}static _isGLBData(e){if(null==e)return!1;const t=new M(e);return t.remainingBytes()>=4&&t.readUint32()===k.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new M(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","glb binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==k.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(r.byteLength<a)throw new e("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==k.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First glb chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await H(o.readUint8Array(r))}else if(1===f){if(n!==k.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,n),n}_validateAccessor(t){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[t];if(r.type in["MAT2","MAT3","MAT4"])throw new e("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);return r}_getComponentInfo(e,t){const r=$[e.type],o=t?.componentType||e.componentType,n=W[o];return{componentType:o,componentCount:r,componentByteSize:n,denseByteStride:r*n}}getDracoAccessor(e,t){const r=this._validateAccessor(e),o=t.accessorInfos.get(e),{componentType:n,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,o);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(o?.byteOffset||0),entryCount:o?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:n,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(t,r){const o=this._validateAccessor(t);if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:s,denseByteStride:a}=this._getComponentInfo(o),i=this.json.bufferViews[o.bufferView],u=await this.getBuffer(i.buffer,r),f=i.byteStride||a;return{raw:u.buffer,byteStride:f,byteOffset:u.byteOffset+(i.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===a,componentCount:n,componentByteSize:s,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const o=e.indices,n=r?this.getDracoAccessor(o,r):await this.getAccessor(o,t);if(n.isDenselyPacked)switch(n.componentType){case z.UNSIGNED_BYTE:return new Uint8Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_SHORT:return new Uint16Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_INT:return new Uint32Array(n.raw,n.byteOffset,n.entryCount)}else switch(n.componentType){case z.UNSIGNED_BYTE:return B(Z(A,n));case z.UNSIGNED_SHORT:return B(Z(C,n));case z.UNSIGNED_INT:return B(Z(S,n))}}async getPositionData(t,r,n){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const s=t.attributes.POSITION,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getNormalData(t,r,n){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const s=t.attributes.NORMAL,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getTangentData(t,r,n){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const s=t.attributes.TANGENT,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+o(z,a.componentType));if(4!==a.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+a.componentCount.toFixed());return Z(L,a)}async getTextureCoordinates(t,r,o){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=t.attributes.TEXCOORD_0,s=o?this.getDracoAccessor(n,o):await this.getAccessor(n,r);if(2!==s.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed());if(s.componentType===z.FLOAT)return Z(g,s);if(!s.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Q(s)}async getVertexColors(t,r,n){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const s=t.attributes.COLOR_0,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(4!==a.componentCount&&3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+a.componentCount.toFixed());if(4===a.componentCount){if(a.componentType===z.FLOAT)return Z(L,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(v,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(E,a)}else if(3===a.componentCount){if(a.componentType===z.FLOAT)return Z(R,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(I,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(D,a)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+o(z,a.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r,o){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const s=null!=e.material?j(this.json.materials[e.material]):j(),a=s.pbrMetallicRoughness,i=this.hasVertexColors(e),u=this.getTexture(a.baseColorTexture,t),f=this.getTexture(s.normalTexture,t),c=r?this.getTexture(s.occlusionTexture,t):void 0,d=o?this.getTexture(s.emissiveTexture,t):void 0,l=r?this.getTexture(a.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;n={alphaMode:s.alphaMode,alphaCutoff:s.alphaCutoff,color:a.baseColorFactor,doubleSided:!!s.doubleSided,colorTexture:await u,normalTexture:await f,name:s.name,id:p,occlusionTexture:await c,emissiveTexture:await d,emissiveFactor:s.emissiveFactor,emissiveStrengthKHR:s.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await l,hasVertexColors:i,ESRI_externalColorMixMode:s.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:s.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:s.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:s.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:s.extras.ESRI_receiveAmbientOcclusion,receiveShadows:s.extras.ESRI_receiveShadows}}return n}async decode(t,r){const o=t.extensions?.KHR_draco_mesh_compression;if(!o)return;if(null==t.indices)throw new e("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=(await U()).decode(new Uint8Array(s.buffer,s.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[t.indices,a.indices],[t.attributes.POSITION,a.positions]]);return t.attributes.TEXCOORD_0&&i.set(t.attributes.TEXCOORD_0,a.uvs),t.attributes.NORMAL&&i.set(t.attributes.NORMAL,a.normals),t.attributes.COLOR_0&&i.set(t.attributes.COLOR_0,a.colors),t.attributes.TANGENT&&i.set(t.attributes.TANGENT,a.tangents),this._dracoBuffersSize+=a.buffer.byteLength,{data:a.buffer,accessorInfos:i}}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=G(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=ee(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}})}getNodeTransform(e){if(void 0===e)return X;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=d(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=b(r),o.translation&&l(t,t,o.translation),o.rotation&&(J[3]=w(J,o.rotation),p(t,t,J[3],J)),o.scale&&m(t,t,o.scale)):t=b(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return u(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=f.parse(this.json.asset.version,"glTF");q.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(t,r){const o=ee(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new P(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return V(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await n(Array.from(this._bufferLoaders.values())),t=await n(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?K(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const X=c(h(),Math.PI/2),q=new f(2,0,"glTF"),J=y(),$={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[z.BYTE]:1,[z.UNSIGNED_BYTE]:1,[z.SHORT]:2,[z.UNSIGNED_SHORT]:2,[z.HALF_FLOAT]:2,[z.FLOAT]:4,[z.INT]:4,[z.UNSIGNED_INT]:4};function Q(e){switch(e.componentType){case z.BYTE:return new N(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_BYTE:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_SHORT:return new _(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_INT:return new T(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.FLOAT:return new g(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Z(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function ee(t){if(null!=t.extensions?.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const te=/\.gltf$/i,re=/\.glb$/i;export{Y as GLTFResource,X as transformGltfToEngine};
5
+ import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{getKey as o}from"../../../../core/object.js";import{allSettledValues as n}from"../../../../core/promiseUtils.js";import{isDataProtocol as s,dataComponents as a,dataToArrayBuffer as i,makeAbsolute as u}from"../../../../core/urlUtils.js";import f from"../../../../core/Version.js";import{fromXRotation as c,multiply as d,translate as l,rotate as p,scale as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as b}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as w}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as g,BufferViewVec2u32 as T,BufferViewVec2u16 as _,BufferViewVec2i16 as x,BufferViewVec2u8 as O,BufferViewVec2i8 as N,BufferViewUint32 as S,BufferViewUint16 as C,BufferViewUint8 as A,BufferViewVec3f as R,BufferViewVec4f as L,BufferViewVec4u8 as v,BufferViewVec4u16 as E,BufferViewVec3u8 as I,BufferViewVec3u16 as D}from"../../../../geometry/support/buffer/BufferView.js";import{m as B}from"../../../../chunks/scalar.js";import{getDracoMeshDecoder as U}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as M}from"./BinaryStreamReader.js";import{material as j,textureSampler as G}from"./fillDefaults.js";import{splitURI as F}from"./pathUtils.js";import{jsonFromBinaryData as H,EncodedMeshTexture as P,imageFromBinaryData as V,isEncodedMeshTexture as K}from"./resourceUtils.js";import{DataType as z}from"../../../webgl/enums.js";const k={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression","KHR_materials_emissive_strength"],this._baseUri=F(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(t,r,o){if(s(r)){const e=a(r);if(e&&"model/gltf-binary"!==e.mediaType)try{const o=JSON.parse(e.isBase64?atob(e.data):e.data);return new Y(t,r,o)}catch{}const o=i(r);if(Y._isGLBData(o))return this._fromGLBData(t,r,o)}if(te.test(r)||"gltf"===o?.expectedType){const e=await t.loadJSON(r,o);return new Y(t,r,e)}const n=await t.loadBinary(r,o);if(Y._isGLBData(n))return this._fromGLBData(t,r,n);if(re.test(r)||"glb"===o?.expectedType)throw new e("gltf-loader-invalid-glb","This is not a valid glb file.");const u=await t.loadJSON(r,o);return new Y(t,r,u)}static _isGLBData(e){if(null==e)return!1;const t=new M(e);return t.remainingBytes()>=4&&t.readUint32()===k.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new M(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","glb binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==k.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(r.byteLength<a)throw new e("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==k.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First glb chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await H(o.readUint8Array(r))}else if(1===f){if(n!==k.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,n),n}_validateAccessor(t){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[t];if(r.type in["MAT2","MAT3","MAT4"])throw new e("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);return r}_getComponentInfo(e,t){const r=$[e.type],o=t?.componentType||e.componentType,n=W[o];return{componentType:o,componentCount:r,componentByteSize:n,denseByteStride:r*n}}getDracoAccessor(e,t){const r=this._validateAccessor(e),o=t.accessorInfos.get(e),{componentType:n,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,o);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(o?.byteOffset||0),entryCount:o?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:n,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(t,r){const o=this._validateAccessor(t);if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:s,denseByteStride:a}=this._getComponentInfo(o),i=this.json.bufferViews[o.bufferView],u=await this.getBuffer(i.buffer,r),f=i.byteStride||a;return{raw:u.buffer,byteStride:f,byteOffset:u.byteOffset+(i.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===a,componentCount:n,componentByteSize:s,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const o=e.indices,n=r?this.getDracoAccessor(o,r):await this.getAccessor(o,t);if(n.isDenselyPacked)switch(n.componentType){case z.UNSIGNED_BYTE:return new Uint8Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_SHORT:return new Uint16Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_INT:return new Uint32Array(n.raw,n.byteOffset,n.entryCount)}else switch(n.componentType){case z.UNSIGNED_BYTE:return B(Z(A,n));case z.UNSIGNED_SHORT:return B(Z(C,n));case z.UNSIGNED_INT:return B(Z(S,n))}}async getPositionData(t,r,n){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const s=t.attributes.POSITION,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getNormalData(t,r,n){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const s=t.attributes.NORMAL,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getTangentData(t,r,n){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const s=t.attributes.TANGENT,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+o(z,a.componentType));if(4!==a.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+a.componentCount.toFixed());return Z(L,a)}async getTextureCoordinates(t,r,o){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=t.attributes.TEXCOORD_0,s=o?this.getDracoAccessor(n,o):await this.getAccessor(n,r);if(2!==s.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed());if(s.componentType===z.FLOAT)return Z(g,s);if(!s.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Q(s)}async getVertexColors(t,r,n){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const s=t.attributes.COLOR_0,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(4!==a.componentCount&&3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+a.componentCount.toFixed());if(4===a.componentCount){if(a.componentType===z.FLOAT)return Z(L,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(v,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(E,a)}else if(3===a.componentCount){if(a.componentType===z.FLOAT)return Z(R,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(I,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(D,a)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+o(z,a.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r,o){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const s=null!=e.material?j(this.json.materials[e.material]):j(),a=s.pbrMetallicRoughness,i=this.hasVertexColors(e),u=this.getTexture(a.baseColorTexture,t),f=this.getTexture(s.normalTexture,t),c=r?this.getTexture(s.occlusionTexture,t):void 0,d=o?this.getTexture(s.emissiveTexture,t):void 0,l=r?this.getTexture(a.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;n={alphaMode:s.alphaMode,alphaCutoff:s.alphaCutoff,color:a.baseColorFactor,doubleSided:!!s.doubleSided,colorTexture:await u,normalTexture:await f,name:s.name,id:p,occlusionTexture:await c,emissiveTexture:await d,emissiveFactor:s.emissiveFactor,emissiveStrengthKHR:s.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await l,hasVertexColors:i,ESRI_externalColorMixMode:s.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:s.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:s.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:s.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:s.extras.ESRI_receiveAmbientOcclusion,receiveShadows:s.extras.ESRI_receiveShadows}}return n}async decode(t,r){const o=t.extensions?.KHR_draco_mesh_compression;if(!o)return;if(null==t.indices)throw new e("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=(await U()).decode(new Uint8Array(s.buffer,s.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[t.indices,a.indices],[t.attributes.POSITION,a.positions]]);return t.attributes.TEXCOORD_0&&i.set(t.attributes.TEXCOORD_0,a.uvs),t.attributes.NORMAL&&i.set(t.attributes.NORMAL,a.normals),t.attributes.COLOR_0&&i.set(t.attributes.COLOR_0,a.colors),t.attributes.TANGENT&&i.set(t.attributes.TANGENT,a.tangents),this._dracoBuffersSize+=a.buffer.byteLength,{data:a.buffer,accessorInfos:i}}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=G(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=ee(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}})}getNodeTransform(e){if(void 0===e)return X;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=d(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=b(r),o.translation&&l(t,t,o.translation),o.rotation&&(J[3]=w(J,o.rotation),p(t,t,J[3],J)),o.scale&&m(t,t,o.scale)):t=b(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return u(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=f.parse(this.json.asset.version,"glTF");q.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(t,r){const o=ee(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new P(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return V(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await n(Array.from(this._bufferLoaders.values())),t=await n(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?K(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const X=c(h(),Math.PI/2),q=new f(2,0,"glTF"),J=y(),$={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[z.BYTE]:1,[z.UNSIGNED_BYTE]:1,[z.SHORT]:2,[z.UNSIGNED_SHORT]:2,[z.HALF_FLOAT]:2,[z.FLOAT]:4,[z.INT]:4,[z.UNSIGNED_INT]:4};function Q(e){switch(e.componentType){case z.BYTE:return new N(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_BYTE:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_SHORT:return new _(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_INT:return new T(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.FLOAT:return new g(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Z(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function ee(t){if(null!=t.extensions?.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const te=/\.gltf$/i,re=/\.glb$/i;export{Y as GLTFResource,X as transformGltfToEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";const o={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},r={pbrMetallicRoughness:o,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},t={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},a=(e={})=>{const a={...o,...e.pbrMetallicRoughness},i=l({...t,...e.extras});return{...r,...e,pbrMetallicRoughness:a,extras:i}};function l(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:e(o.ESRI_externalColorMixMode),o.ESRI_externalColorMixMode="tint"}return o}const i={magFilter:9729,minFilter:9987,wrapS:10497,wrapT:10497},s=e=>({...i,...e});export{a as material,s as textureSampler};
5
+ const e={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},t={pbrMetallicRoughness:e,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},o={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},r=(r={})=>{const l={...e,...r.pbrMetallicRoughness},i=a({...o,...r.extras});return{...t,...r,pbrMetallicRoughness:l,extras:i}};function a(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:e.ESRI_externalColorMixMode,e.ESRI_externalColorMixMode="tint"}return e}const l={magFilter:9729,minFilter:9987,wrapS:10497,wrapT:10497},i=e=>({...l,...e});export{r as material,i as textureSampler};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../core/compilerUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as p,t as b,p as v,j as y,d as j,s as L,h as S,e as O}from"../../../chunks/vec32.js";import{create as R,ZEROS as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projectionUtils.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{distance2 as C,fromPoints as x,create as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as I,create as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as H}from"../../../geometry/support/vectorStacks.js";import{clonePoint as q,hydratedSpatialReference as G}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as V}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as J}from"../support/ElevationProvider.js";import{fromScreen as K}from"../support/geometryUtils/ray.js";import N from"../webgl/RenderCamera.js";import{Object3D as Q}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";class Y{constructor(e){this.metadata=void 0,this._camera=new N,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=R(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new t,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=ge,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i(()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){Z(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),$(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){q(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){q(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=G(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(Z(this._modelTransform)){const t=this._calculateModelTransformOffset(_e);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,ee),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,re),n=o*this.screenLocation.pixelSize,a=K(this._camera,s,ie);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(ae,s[0],i);for(let t=1;t<s.length;t++){const o=v(ce,s[t],i),l=k(x(e,o,te),a);if(null!=l&&l<n*n){const t=p(H.get(),e,o);y(t,t,.5);const i=c(H.get());if(this._camera.projectToRenderScreen(t,i))return i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,re),a=o*this.screenLocation.pixelSize,c=K(this._camera,s,ie);if(null==c)return null;const h=l(se,n),d=b(he,e,h),_=v(de,t,n);I(_,d,ne);const u=le;if(W(ne,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,re),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=K(this._camera,s,ie);if(null==h)return null;const d=l(se,n),_=b(he,t,d),u=this._calculateModelTransformPosition(de);I(u,_,ne);const g=le;if(!W(ne,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(ae,s[0],n);for(let t=1;t<s.length;t++){const i=v(ce,s[t],n),o=C(x(e,i,te),g);if(null!=o&&o<a*a){const t=p(H.get(),e,i);y(t,t,.5);const s=c(H.get());if(this._camera.projectToRenderScreen(t,s))return s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:1}),i.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,ue,e.spatialReference)&&P(e.extent,ue)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=V(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=J(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(J(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(J(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=re;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?2:1)|(this.selected?8:4),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=!!!(15&r)||(s&r)===(15&r),i=!!!(65520&r)||(this.state&r)===(65520&r);if(e&&i)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach(({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))});const s=new Map;this._renderObjects.forEach(e=>{const t=new Q({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)});const o=[];s.forEach((e,t)=>o.push({stateMask:t,objects:e})),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.addMany(e)),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.removeMany(e)),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,oe);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return O(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function Z(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function $(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,ae,0,o.radius),F(s(ae[0]),s(ae[1]),i),!0}}}const ee=n(),te=M(),ie=B(),se=h(),oe=m(),re=m(),ne=U(),ae=R(),ce=R(),le=R(),he=R(),de=R(),_e=R(),ue=new A({x:0,y:0,z:0,spatialReference:null}),ge=()=>{};export{Y as Manipulator3D};
5
+ import{EventEmitter as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as o,createScreenPointArray as n,screenPointObjectToArray as r,castRenderScreenPointArray as a}from"../../../core/screenUtils.js";import{fromMat4 as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as h,set as d,multiply as _,identity as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as f,t as p,p as b,j as v,d as y,s as j,h as L,e as S}from"../../../chunks/vec32.js";import{create as O,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as w}from"../../../geometry/ellipsoidUtils.js";import T from"../../../geometry/Point.js";import{canProjectWithoutEngine as A,projectPoint as E}from"../../../geometry/projectionUtils.js";import{computeENUToPCPFLocalRotation as D}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as F}from"../../../geometry/projection/projectors.js";import{containsPointObject as z}from"../../../geometry/support/aaBoundingRect.js";import{distance2 as P,fromPoints as C,create as x,closestRayDistance2 as M}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as k,create as I,intersectRay as U}from"../../../geometry/support/plane.js";import{create as W}from"../../../geometry/support/ray.js";import{sv3d as B}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as J}from"../support/geometryUtils/ray.js";import K from"../webgl/RenderCamera.js";import{Object3D as N}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as Q}from"../webgl-engine/lib/WebGLLayer.js";class X{constructor(t){this.metadata=void 0,this._camera=new K,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=g(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new T({x:0,y:0,z:0}),this._elevationAlignedLocation=new T,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new e,this._screenLocation={screenPointArray:n(),renderScreenPointArray:o(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=t.view.spatialReference,Object.assign(this,t);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=ue,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),t(()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){Y(e)&&(this._screenLocationDirty=!0),h(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=g()),Z(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(Y(this._modelTransform)){const t=this._calculateModelTransformOffset(de);e=f(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;const i=r(e,$),s=this._getCollisionRadius(t),o=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(m(this.screenLocation.screenPointArray,i)<s*s)return this.screenLocation.renderScreenPointArray[2]+o;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(t,oe),r=s*this.screenLocation.pixelSize,c=J(this._camera,i,te);if(null==c)return null;for(const i of e){if(0===i.length)continue;const e=b(re,i[0],n);for(let t=1;t<i.length;t++){const s=b(ae,i[t],n),l=M(C(e,s,ee),c);if(null!=l&&l<r*r){const t=f(B.get(),e,s);v(t,t,.5);const i=a(B.get());if(this._camera.projectToRenderScreen(t,i))return i[2]+o}y(e,s)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,n=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(n,oe),a=s*this.screenLocation.pixelSize,l=J(this._camera,i,te);if(null==l)return null;const h=c(ie,r),d=p(le,e,h),_=b(he,t,r);k(_,d,ne);const u=ce;if(U(ne,l,u)&&j(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+o;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,n=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(n,oe),l=s*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=J(this._camera,i,te);if(null==h)return null;const d=c(ie,r),_=p(le,t,d),u=this._calculateModelTransformPosition(he);k(u,_,ne);const g=ce;if(!U(ne,h,g))break;for(const i of e){if(0===i.length)continue;const e=b(re,i[0],r);for(let t=1;t<i.length;t++){const s=b(ae,i[t],r),n=P(C(e,s,ee),g);if(null!=n&&n<l*l){const t=f(B.get(),e,s);v(t,t,.5);const i=a(B.get());if(this._camera.projectToRenderScreen(t,i))return i[2]+o}y(e,s)}}break}default:this.collisionType}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new Q(t,{pickable:!1,updatePolicy:1}),i.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new T({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,s(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,_e,e.spatialReference)&&z(e.extent,_e)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=oe;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?2:1)|(this.selected?8:4),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=!!!(15&n)||(s&n)===(15&n),i=!!!(65520&n)||(this.state&n)===(65520&n);if(e&&i)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach(({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))});const s=new Map;this._renderObjects.forEach(e=>{const t=new N({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)});const o=[];s.forEach((e,t)=>o.push({stateMask:t,objects:e})),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.addMany(e)),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.removeMany(e)),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,se);return L(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return S(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return d(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&_(t,t,this._worldFrame),_(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function Y(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function Z(e,t,s){switch(e.viewingMode){case"local":return u(s),!0;case"global":{const o=w(e.renderCoordsHelper.spatialReference);return F(t,0,re,0,o.radius),D(i(re[0]),i(re[1]),s),!0}}}const $=n(),ee=x(),te=W(),ie=l(),se=g(),oe=g(),ne=I(),re=O(),ae=O(),ce=O(),le=O(),he=O(),de=O(),_e=new T({x:0,y:0,z:0,spatialReference:null}),ue=()=>{};export{X as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{multiplyOpacity as e}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as i}from"../../../core/handleUtils.js";import{l as n}from"../../../chunks/vec32.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as r,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{vectorToRender as a}from"./support/viewUtils.js";import{ExtendedLineVisualElement as s}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as c}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as p}from"./visualElements/RightAngleQuadVisualElement.js";import{toDehydratedPoint as u,isTarget as m,withSelfSnappingZ as f}from"../../interactive/sketch/normalizedPoint.js";import{defaults as g}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as v}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as h}from"../../interactive/snapping/hints/LineSnappingHint.js";class C extends v{sortUniqueHints(e){return e.sort((e,i)=>(i instanceof h?i.length:0)-(e instanceof h?e.length:0))}visualizeIntersectionPoint(e,n){const{spatialReference:t,view:o}=n,a=w(n);return i(new d({view:o,primitive:"circle",geometry:u(e.intersectionPoint,t),elevationInfo:e.isDraped?r:l,size:20,outlineSize:2,color:a.intersectionPointColor,outlineColor:a.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=E(e.point,e.domain,n);return i(new d({view:t,primitive:"circle",geometry:u(l,o),elevationInfo:j(e),size:20,outlineSize:2,color:r.pointColor,outlineColor:r.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=E(e.lineStart,e.domain,n),a=E(e.lineEnd,e.domain,n);return i(x(e.type,l,a,o,j(e),t,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,t){const{view:o,spatialReference:r}=t,l=w(t),{isDraped:a}=e,s=j(e),d=E(e.lineStart,e.domain,t),p=E(e.lineEnd,e.domain,t),u=D(d,r,s,o,a),m=D(p,r,s,o,a),f=n(m,u,m,.5),v=new c({view:o,attached:!1,offset:g.parallelLineHintOffset,length:g.parallelLineHintLength,width:g.parallelLineHintWidth,color:l.parallelSignColor,location:f,renderOccluded:a?4:16,isDraped:a,renderGroup:3,isDecoration:!0});return v.setDirectionFromPoints(u,f),v.attached=!0,i(v)}visualizeRightAngleQuad(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=j(e),{isDraped:a}=e,s=E(e.previousVertex,e.domain,n),c=E(e.centerVertex,e.domain,n),d=E(e.nextVertex,e.domain,n),u=D(s,o,l,t,a),m=D(c,o,l,t,a),f=D(d,o,l,t,a);return i(new p({view:t,attached:!0,color:a?r.rightAngleColorDraped:r.rightAngleColor,renderOccluded:a?4:2,outlineRenderOccluded:a?4:16,outlineColor:r.rightAngleOutlineColor,outlineSize:g.rightAngleHintOutlineSize,size:g.rightAngleHintSize,isDraped:a,geometry:{previous:u,center:m,next:f},renderGroup:3,isDecoration:!0}))}}function w(i){const{effectiveTheme:n}=i.view,t=n.accentColor.toUnitRGBA(),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:t,pointColor:o,pointOutlineColor:t,lineColor:t,lineOutlineColor:void 0,parallelSignColor:t,rightAngleColor:t,rightAngleColorDraped:e(n.accentColor,.5).toUnitRGBA(),rightAngleOutlineColor:t}}function E(e,i,{selfSnappingZ:n,view:t,spatialReference:o}){return 2&i&&m(e)&&null!=n?f(e,n,t,o):e}function j(e){return e.isDraped?r:l}function x(e,i,n,t,o,r,l,a=!1,c=!0,d=!0){const p=D(i,t,o,r,a),u=D(n,t,o,r,a),m=new s({view:r,extensionType:3,start:p,end:u,isDraped:a,color:l.lineColor,renderOccluded:a?4:16,renderGroup:3,isDecoration:!0});switch(e){case 0:m.width=g.lineHintWidthTarget,m.fadedExtensions={start:0,end:g.lineHintFadedExtensions};break;case 2:m.width=g.lineHintWidthReference,m.fadedExtensions={start:0,end:0};break;case 1:m.width=g.lineHintWidthReference,m.fadedExtensions={start:c?g.lineHintFadedExtensions:0,end:d?g.lineHintFadedExtensions:0}}return m.attached=!0,m}function D(e,i,n,r,l){const s=t();if(l){const n=r.overlayManager.spatialReference;o(e,i,s,n)}else a(e,i,n,r,s);return s}export{C as SnappingVisualizer3D};
5
+ import{multiplyOpacity as e}from"../../../core/colorUtils.js";import{destroyHandle as i}from"../../../core/handleUtils.js";import{l as n}from"../../../chunks/vec32.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as r,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{vectorToRender as a}from"./support/viewUtils.js";import{ExtendedLineVisualElement as s}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as c}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as p}from"./visualElements/RightAngleQuadVisualElement.js";import{toDehydratedPoint as u,isTarget as m,withSelfSnappingZ as f}from"../../interactive/sketch/normalizedPoint.js";import{defaults as g}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as v}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as h}from"../../interactive/snapping/hints/LineSnappingHint.js";class C extends v{sortUniqueHints(e){return e.sort((e,i)=>(i instanceof h?i.length:0)-(e instanceof h?e.length:0))}visualizeIntersectionPoint(e,n){const{spatialReference:t,view:o}=n,a=w(n);return i(new d({view:o,primitive:"circle",geometry:u(e.intersectionPoint,t),elevationInfo:e.isDraped?r:l,size:20,outlineSize:2,color:a.intersectionPointColor,outlineColor:a.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=E(e.point,e.domain,n);return i(new d({view:t,primitive:"circle",geometry:u(l,o),elevationInfo:x(e),size:20,outlineSize:2,color:r.pointColor,outlineColor:r.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=E(e.lineStart,e.domain,n),a=E(e.lineEnd,e.domain,n);return i(j(e.type,l,a,o,x(e),t,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,t){const{view:o,spatialReference:r}=t,l=w(t),{isDraped:a}=e,s=x(e),d=E(e.lineStart,e.domain,t),p=E(e.lineEnd,e.domain,t),u=D(d,r,s,o,a),m=D(p,r,s,o,a),f=n(m,u,m,.5),v=new c({view:o,attached:!1,offset:g.parallelLineHintOffset,length:g.parallelLineHintLength,width:g.parallelLineHintWidth,color:l.parallelSignColor,location:f,renderOccluded:a?4:16,isDraped:a,renderGroup:3,isDecoration:!0});return v.setDirectionFromPoints(u,f),v.attached=!0,i(v)}visualizeRightAngleQuad(e,n){const{view:t,spatialReference:o}=n,r=w(n),l=x(e),{isDraped:a}=e,s=E(e.previousVertex,e.domain,n),c=E(e.centerVertex,e.domain,n),d=E(e.nextVertex,e.domain,n),u=D(s,o,l,t,a),m=D(c,o,l,t,a),f=D(d,o,l,t,a);return i(new p({view:t,attached:!0,color:a?r.rightAngleColorDraped:r.rightAngleColor,renderOccluded:a?4:2,outlineRenderOccluded:a?4:16,outlineColor:r.rightAngleOutlineColor,outlineSize:g.rightAngleHintOutlineSize,size:g.rightAngleHintSize,isDraped:a,geometry:{previous:u,center:m,next:f},renderGroup:3,isDecoration:!0}))}}function w(i){const{effectiveTheme:n}=i.view,t=n.accentColor.toUnitRGBA(),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:t,pointColor:o,pointOutlineColor:t,lineColor:t,lineOutlineColor:void 0,parallelSignColor:t,rightAngleColor:t,rightAngleColorDraped:e(n.accentColor,.5).toUnitRGBA(),rightAngleOutlineColor:t}}function E(e,i,{selfSnappingZ:n,view:t,spatialReference:o}){return 2&i&&m(e)&&null!=n?f(e,n,t,o):e}function x(e){return e.isDraped?r:l}function j(e,i,n,t,o,r,l,a=!1,c=!0,d=!0){const p=D(i,t,o,r,a),u=D(n,t,o,r,a),m=new s({view:r,extensionType:3,start:p,end:u,isDraped:a,color:l.lineColor,renderOccluded:a?4:16,renderGroup:3,isDecoration:!0});switch(e){case 0:m.width=g.lineHintWidthTarget,m.fadedExtensions={start:0,end:g.lineHintFadedExtensions};break;case 2:m.width=g.lineHintWidthReference,m.fadedExtensions={start:0,end:0};break;case 1:m.width=g.lineHintWidthReference,m.fadedExtensions={start:c?g.lineHintFadedExtensions:0,end:d?g.lineHintFadedExtensions:0}}return m.attached=!0,m}function D(e,i,n,r,l){const s=t();if(l){const n=r.overlayManager.spatialReference;o(e,i,s,n)}else a(e,i,n,r,s);return s}export{C as SnappingVisualizer3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";function e(e){switch(e){case 0:break;case 1:return"not owned by a graphics layer";case 2:return"no geometry";case 3:return"the geometry type is not supported";case 4:return"the symbol type is not supported"}return""}export{e as isSupportedObjectResultMessage};
5
+ function e(e){switch(e){case 0:break;case 1:return"not owned by a graphics layer";case 2:return"no geometry";case 3:return"the geometry type is not supported";case 4:return"the symbol type is not supported"}return""}export{e as isSupportedObjectResultMessage};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";function e(e){if(e.graphic&&"graphics"!==e.graphic.layer?.type)return 1;const r=e.operations?.data.type;if(!r)return 3;switch(r){case"polygon":case"point":case"polyline":case"mesh":break;default:return 3}return 0}export{e as isSupportedObject};
5
+ function e(e){if(e.graphic&&"graphics"!==e.graphic.layer?.type)return 1;const r=e.operations?.data.type;if(!r)return 3;switch(r){case"polygon":case"point":case"polyline":case"mesh":break;default:return 3}return 0}export{e as isSupportedObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";function e(e){if("graphics"!==e.layer?.type)return 1;if(null==e.geometry)return 2;switch(e.geometry.type){case"point":break;case"polygon":case"polyline":case"multipoint":case"extent":case"mesh":return 0;default:return 3}const t=null!=e.symbol&&"point-3d"===e.symbol.type&&e.symbol.symbolLayers;return t&&t.some(e=>"object"===e.type)?0:4}export{e as isSupportedGraphic};
5
+ function e(e){if("graphics"!==e.layer?.type)return 1;if(null==e.geometry)return 2;switch(e.geometry.type){case"point":break;case"polygon":case"polyline":case"multipoint":case"extent":case"mesh":return 0;default:return 3}const t=null!=e.symbol&&"point-3d"===e.symbol.type&&e.symbol.symbolLayers;return t&&t.some(e=>"object"===e.type)?0:4}export{e as isSupportedGraphic};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{d as e,e as t,m as r,q as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,f as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as d,create as _,getStart as p,getEnd as c}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as f,fromPoints as m,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as w}from"./LaserlineVisualElement.js";import{drapedZ as O}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as j}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as E}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=A,this._laserline=new w({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:x,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:x,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??A,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new E(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new E(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new C(t)}_createGeometry(e){const t=3===this.extensionType,r=t?[s(),s(),s(),s()]:[s(),s()];return j(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return 3===this._extensionType?this._updateLineSegmentFinite(M):this._updateLineSegmentInfinite(this._extensionType,M)}_updateLineSegmentFinite(e){return m(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(d(this._ray,P),e){case 0:P.c0=-Number.MAX_VALUE;break;case 1:case 2:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(P.ray.direction,P.ray.direction),2===this._extensionType&&null!=t&&(P.c1=Math.abs(r-t));break}}if(!u(r.frustum,P))return this._updateLineSegmentFinite(t);const s=p(P,v),n=c(P,R);return m(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],"position")}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=O;e.invalidateBoundingInfo()}*_lineVertices(e){3===this.extensionType?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function x(e){e.geometries=[]}const P=_(),v=s(),R=s(),M=f(),V=1/3,A={start:V,end:V};export{G as ExtendedLineVisualElement};
5
+ import{d as e,e as t,m as r,q as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,f as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as d,create as _,getStart as p,getEnd as c}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as f,fromPoints as m,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as w}from"./LaserlineVisualElement.js";import{drapedZ as O}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as j}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as E}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=A,this._laserline=new w({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:x,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:x,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??A,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new E(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new E(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new C(t)}_createGeometry(e){const t=3===this.extensionType,r=t?[s(),s(),s(),s()]:[s(),s()];return j(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return 3===this._extensionType?this._updateLineSegmentFinite(M):this._updateLineSegmentInfinite(this._extensionType,M)}_updateLineSegmentFinite(e){return m(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(d(this._ray,P),e){case 0:P.c0=-Number.MAX_VALUE;break;case 1:case 2:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(P.ray.direction,P.ray.direction),2===this._extensionType&&null!=t&&(P.c1=Math.abs(r-t));break}}if(!u(r.frustum,P))return this._updateLineSegmentFinite(t);const s=p(P,v),n=c(P,R);return m(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],"position")}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=O;e.invalidateBoundingInfo()}*_lineVertices(e){3===this.extensionType?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function x(e){e.geometries=[]}const P=_(),v=s(),R=s(),M=f(),V=1/3,A={start:V,end:V};export{G as ExtendedLineVisualElement};