@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240823

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 (376) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
  5. package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
  6. package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
  7. package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
  9. package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
  10. package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
  14. package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
  15. package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
  16. package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
  19. package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
  20. package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
  22. package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
  26. package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
  27. package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
  28. package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
  29. package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
  30. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
  31. package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
  33. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  34. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  35. package/assets/esri/themes/base/_core.scss +2 -0
  36. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  37. package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
  38. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  43. package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
  44. package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
  45. package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
  46. package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
  47. package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
  48. package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
  49. package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
  50. package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
  51. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  52. package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
  53. package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
  54. package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
  55. package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
  56. package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
  57. package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
  58. package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
  59. package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
  60. package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
  61. package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
  62. package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
  63. package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
  64. package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
  65. package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
  66. package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
  67. package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
  68. package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
  69. package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
  70. package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
  71. package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
  72. package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
  73. package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
  74. package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
  75. package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
  76. package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
  77. package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
  78. package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
  79. package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
  80. package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
  83. package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
  84. package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
  85. package/chunks/CloudsComposition.glsl.js +3 -3
  86. package/chunks/ComponentShader.glsl.js +53 -61
  87. package/chunks/DefaultMaterial.glsl.js +1 -1
  88. package/chunks/FocusAreaColor.glsl.js +12 -0
  89. package/chunks/FocusAreaMask.glsl.js +5 -0
  90. package/chunks/Laserlines.glsl.js +1 -1
  91. package/chunks/Path.glsl.js +22 -17
  92. package/chunks/PointRenderer.glsl.js +3 -3
  93. package/chunks/Precipitation.glsl.js +1 -1
  94. package/chunks/Terrain.glsl.js +1 -1
  95. package/chunks/WaterSurface.glsl.js +18 -18
  96. package/chunks/boundedPlane.js +1 -1
  97. package/chunks/cameraUtilsPlanar.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/sphere.js +1 -1
  100. package/chunks/terrainUtilsPlanar.js +1 -1
  101. package/chunks/vec32.js +1 -1
  102. package/chunks/vxlLayer.js +1 -1
  103. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  104. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  105. package/core/mathUtils.js +1 -1
  106. package/core/perspectiveUtils.js +1 -1
  107. package/exports/csv.js +1 -1
  108. package/geometry/operators/support/converterAPI.js +1 -1
  109. package/geometry/projection/localLinearScaleFactors.js +1 -1
  110. package/geometry/support/buffer/internals/Vec3.js +1 -1
  111. package/geometry/support/clipRay.js +1 -1
  112. package/geometry/support/coordinateSystem.js +1 -1
  113. package/geometry/support/frustum.js +1 -1
  114. package/geometry/support/heightModelInfoUtils.js +1 -1
  115. package/geometry/support/lineSegment.js +1 -1
  116. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  117. package/geometry/support/meshUtils/rotate.js +1 -1
  118. package/geometry/support/meshUtils/scale.js +1 -1
  119. package/geometry/support/plane.js +1 -1
  120. package/geometry/support/polygonUtils.js +1 -1
  121. package/geometry/support/ray.js +1 -1
  122. package/geometry/support/sphere.js +1 -1
  123. package/geometry/support/sphereUtils.js +5 -0
  124. package/geometry/support/triangle.js +1 -1
  125. package/geometry/support/vector.js +1 -1
  126. package/interfaces.d.ts +68 -9
  127. package/layers/FocusAreaLayer.js +5 -0
  128. package/layers/VoxelLayer.js +1 -1
  129. package/layers/VoxelWasmPerSceneView.js +1 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  131. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  132. package/layers/video/VideoCameraSensorModel.js +1 -1
  133. package/package.json +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  136. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  137. package/symbols/support/Symbol3DMaterial.js +1 -1
  138. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  140. package/views/2d/grid/GridView2D.js +1 -1
  141. package/views/2d/grid/constants.js +5 -0
  142. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  143. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  144. package/views/2d/layerViewModuleImportUtils.js +1 -1
  145. package/views/2d/support/highlightGroupUtils.js +1 -1
  146. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  148. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  149. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  151. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  153. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  156. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  160. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  161. package/views/3d/analysis/support/measurementUtils.js +1 -1
  162. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  163. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  164. package/views/3d/camera/constraintUtils/common.js +1 -1
  165. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  166. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  167. package/views/3d/camera/intersectionUtils.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  170. package/views/3d/environment/CloudsParameters.js +1 -1
  171. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  172. package/views/3d/environment/Fog.js +1 -1
  173. package/views/3d/environment/MarsAtmosphere.js +1 -1
  174. package/views/3d/interactive/Manipulator3D.js +1 -1
  175. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  176. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  177. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  178. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  179. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  181. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  182. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  183. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  184. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  185. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  186. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  187. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  188. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  189. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  190. package/views/3d/layerViewModuleImportUtils.js +1 -1
  191. package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
  192. package/views/3d/layers/I3SMeshView3D.js +1 -1
  193. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  195. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  196. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  197. package/views/3d/layers/VoxelGraphic.js +5 -0
  198. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  200. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  209. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  210. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  211. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  212. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  213. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  214. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  215. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  216. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  217. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  218. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  219. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  220. package/views/3d/layers/support/uvUtils.js +1 -1
  221. package/views/3d/state/NearFarHeuristic.js +1 -1
  222. package/views/3d/state/ViewStateManager.js +1 -1
  223. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  224. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  225. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  226. package/views/3d/state/controllers/RotateController.js +1 -1
  227. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  228. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  229. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  231. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  232. package/views/3d/state/utils/navigationUtils.js +1 -1
  233. package/views/3d/state/utils/viewUtils.js +1 -1
  234. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  235. package/views/3d/support/cameraUtilsInternal.js +1 -1
  236. package/views/3d/support/geometryUtils/ray.js +1 -1
  237. package/views/3d/support/intersectionUtils.js +1 -1
  238. package/views/3d/support/mathUtils.js +1 -1
  239. package/views/3d/support/orientedBoundingBox.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/sunUtils.js +1 -1
  242. package/views/3d/support/viewpointUtils.js +1 -1
  243. package/views/3d/terrain/OverlayRenderer.js +1 -1
  244. package/views/3d/terrain/PatchRenderData.js +1 -1
  245. package/views/3d/terrain/SphericalPatch.js +1 -1
  246. package/views/3d/terrain/TerrainRenderer.js +1 -1
  247. package/views/3d/terrain/TerrainSurface.js +1 -1
  248. package/views/3d/terrain/Tile.js +1 -1
  249. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  250. package/views/3d/webgl/RenderCamera.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  255. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  256. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  257. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  258. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  260. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  261. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
  262. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
  263. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  264. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
  265. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
  267. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
  268. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
  269. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  270. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
  275. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
  276. package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
  278. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  280. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  281. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  282. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  283. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  284. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  285. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  286. package/views/3d/webgl-engine/lib/Path.js +1 -1
  287. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  288. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  289. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  290. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  291. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  292. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  294. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  295. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  296. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  297. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  298. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  299. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  309. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  311. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  312. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
  313. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
  314. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  315. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  316. package/views/draw/support/helpMessageUtils3d.js +1 -1
  317. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  318. package/views/input/gamepad/GamepadSource.js +1 -1
  319. package/views/interactive/coordinateHelper.js +1 -1
  320. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  321. package/views/interactive/sketch/constraints.js +1 -1
  322. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  323. package/views/interactive/snapping/GridSnappingEngine.js +5 -0
  324. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  325. package/views/interactive/snapping/SnappingOptions.js +1 -1
  326. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  327. package/views/interactive/snapping/snappingUtils.js +1 -1
  328. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  329. package/views/support/angularMeasurementUtils.js +1 -1
  330. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  331. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  332. package/views/support/geometry3dUtils.js +1 -1
  333. package/webscene/Slide.js +1 -1
  334. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  335. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  336. package/widgets/Feature/FeatureMedia.js +1 -1
  337. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  338. package/widgets/FeatureTable/Grid/Column.js +1 -1
  339. package/widgets/FeatureTable.js +1 -1
  340. package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
  341. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  342. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  343. package/widgets/Print/CustomTemplate.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print/TemplateOptions.js +1 -1
  346. package/widgets/Print/utils.js +5 -0
  347. package/widgets/Print.js +1 -1
  348. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  349. package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
  350. package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
  351. package/widgets/support/GridControls/VisibleElements.js +5 -0
  352. package/widgets/support/GridControls/gridUtils.js +5 -0
  353. package/widgets/support/GridControls.d.ts +4 -0
  354. package/widgets/support/GridControls.js +5 -0
  355. package/widgets/support/exportUtils.js +1 -1
  356. package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
  357. package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
  358. package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
  359. package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
  360. package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
  361. package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
  362. package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
  363. package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
  365. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
  366. package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
  367. package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
  368. package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
  369. package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
  370. package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
  371. package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
  372. package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
  373. package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
  374. package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
  375. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,n as e,f as r,b as s,p as o,h as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as p}from"../core/shaderLibrary/util/AlphaCutoff.js";import u from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as h}from"../lib/Material.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as g,MeasurementArrowAttributeLocations as O,MeasurementArrowTechnique as b}from"../shaders/MeasurementArrowTechnique.js";class A extends f{constructor(t){super(t,v),this._configuration=new g,this._vertexAttributeLocations=O,this.produces=new Map([[m.OPAQUE_MATERIAL,t=>!this._transparent&&t===l.Color],[m.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,t=>this._transparent&&t===l.Color]])}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=p||e[3]>=p||r[3]>=p}intersect(){}createGLMaterial(t){return new _(t)}createBufferWriter(){return new I}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class _ extends u{beginSlot(t){return this.ensureTechnique(b,t)}}class v extends h{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const C=c().vec3f(d.POSITION).vec3f(d.NORMAL).vec2f(d.UV0).f32(d.LENGTH),L=n(),T=n(),E=n(),j=n(),y=n();class I{constructor(){this.vertexBufferLayout=C}elementCount(t){return 2*(t.get(d.POSITION).indices.length/2+1)}write(n,a,c,l,p,u){const{data:f,indices:h}=c.get(d.POSITION),m=c.get(d.NORMAL).data,g=f.length/3;h&&h.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const O=L,b=T,A=E,_=j,v=y,C=p.position,I=p.normal,M=p.uv0;let w=0;for(let d=0;d<g;++d){const c=3*d;if(t(O,f[c],f[c+1],f[c+2]),d<g-1){const o=3*(d+1);t(b,f[o],f[o+1],f[o+2]),t(v,m[o],m[o+1],m[o+2]),e(v,v),r(A,b,O),e(A,A),s(_,v,A),e(_,_)}const l=o(O,b);n&&a&&(i(O,O,n),i(b,b,n),i(_,_,a));const p=u+2*d,h=p+1;C.setVec(p,O),C.setVec(h,O),I.setVec(p,_),I.setVec(h,_),M.set(p,0,w),M.set(p,1,-1),M.set(h,0,w),M.set(h,1,1),d<g-1&&(w+=l)}const x=p.length;for(let t=0;t<2*g;++t)x.set(u+t,w)}}export{A as MeasurementArrowMaterial,v as Parameters};
5
+ import{a as t,n as e,f as r,b as s,p as o,h as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as p}from"../core/shaderLibrary/util/AlphaCutoff.js";import u from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as h}from"../lib/Material.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as g,MeasurementArrowAttributeLocations as O,MeasurementArrowTechnique as b}from"../shaders/MeasurementArrowTechnique.js";class A extends f{constructor(t){super(t,v),this._configuration=new g,this._vertexAttributeLocations=O,this.produces=new Map([[m.OPAQUE_MATERIAL,t=>!this._transparent&&t===l.Color],[m.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,t=>this._transparent&&t===l.Color]])}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=p||e[3]>=p||r[3]>=p}intersect(){}createGLMaterial(t){return new _(t)}createBufferWriter(){return new I}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class _ extends u{beginSlot(t){return this.ensureTechnique(b,t)}}class v extends h{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const C=c().vec3f(d.POSITION).vec3f(d.NORMAL).vec2f(d.UV0).f32(d.LENGTH),L=n(),T=n(),E=n(),j=n(),y=n();class I{constructor(){this.vertexBufferLayout=C}elementCount(t){return 2*(t.get(d.POSITION).indices.length/2+1)}write(n,a,c,l,p,u){const{data:f,indices:h}=c.get(d.POSITION),m=c.get(d.NORMAL).data,g=f.length/3;h&&h.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const O=L,b=T,A=E,_=j,v=y,C=p.position,I=p.normal,M=p.uv0;let w=0;for(let d=0;d<g;++d){const c=3*d;if(t(O,f[c],f[c+1],f[c+2]),d<g-1){const o=3*(d+1);t(b,f[o],f[o+1],f[o+2]),t(v,m[o],m[o+1],m[o+2]),e(v,v),r(A,b,O),e(A,A),s(_,v,A),e(_,_)}const l=o(O,b);n&&a&&(i(O,O,n),i(b,b,n),i(_,_,a));const p=u+2*d,h=p+1;C.setVec(p,O),C.setVec(h,O),I.setVec(p,_),I.setVec(h,_),M.set(p,0,w),M.set(p,1,-1),M.set(h,0,w),M.set(h,1,1),d<g-1&&(w+=l)}const x=p.length;for(let t=0;t<2*g;++t)x.set(u+t,w)}}export{A as MeasurementArrowMaterial,v as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as o,f as i,m as a,j as n,g as c,c as m,l,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as h}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as g,fromPoints as j,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as _,signedDistance as A,getNormal as O}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as L,ShaderOutput as x}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as y}from"../core/shaderLibrary/util/AlphaCutoff.js";import N from"../lib/GLMaterial.js";import{Material as R,MaterialParameters as v}from"../lib/Material.js";import{RenderSlot as E}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as w}from"./DefaultBufferWriter.js";import{PositionColorLayout as C,PositionLayout as P}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as U}from"../shaders/NativeLineTechniqueConfiguration.js";class I extends R{constructor(e){super(e,B),this._configuration=new U,this.produces=new Map([[E.OPAQUE_MATERIAL,e=>L(e)]])}getConfiguration(e){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=y}intersect(t,r,f,p,d,S){if(!f.options.selectionMode||!t.visible)return;if(!M(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const L=t.attributes.get(T.POSITION).data,x=f.camera,y=J;s(y,f.point);const N=2;o(K[0],y[0]-N,y[1]+N,0),o(K[1],y[0]+N,y[1]+N,0),o(K[2],y[0]+N,y[1]-N,0),o(K[3],y[0]-N,y[1]-N,0);for(let e=0;e<4;e++)if(!x.unprojectFromRenderScreen(K[e],Y[e]))return;_(x.eye,Y[0],Y[1],$),_(x.eye,Y[1],Y[2],ee),_(x.eye,Y[2],Y[3],te),_(x.eye,Y[3],Y[0],re);let R=Number.MAX_VALUE,v=0;for(let e=0;e<L.length-5;e+=3){if(D[0]=L[e]+r[12],D[1]=L[e+1]+r[13],D[2]=L[e+2]+r[14],W[0]=L[e+3]+r[12],W[1]=L[e+4]+r[13],W[2]=L[e+5]+r[14],A($,D)<0&&A($,W)<0||A(ee,D)<0&&A(ee,W)<0||A(te,D)<0&&A(te,W)<0||A(re,D)<0&&A(re,W)<0)continue;if(x.projectToRenderScreen(D,k),x.projectToRenderScreen(W,F),k[2]<0&&F[2]>0){i(X,D,W);const e=x.frustum,t=-A(e[h.NEAR],D)/a(X,O(e[h.NEAR]));n(X,X,t),c(D,D,X),x.projectToRenderScreen(D,k)}else if(k[2]>0&&F[2]<0){i(X,W,D);const e=x.frustum,t=-A(e[h.NEAR],W)/a(X,O(e[h.NEAR]));n(X,X,t),c(W,W,X),x.projectToRenderScreen(W,F)}else if(k[2]<0&&F[2]<0)continue;k[2]=0,F[2]=0;const t=g(j(k,F,z),y);t<R&&(R=t,m(Q,D),m(Z,W),v=e/3)}const E=f.rayBegin,w=f.rayEnd;if(R<N*N){let e=Number.MAX_VALUE;if(b(j(Q,Z,z),j(E,w,H),G)){i(G,G,E);const t=l(G);n(G,G,1/t),e=t/u(E,w)}S(e,G,v,!1)}}intersectDraped(e,r,s,o,i,a){if(!s.options.selectionMode)return;const n=e.attributes.get(T.POSITION).data,c=e.attributes.get(T.SIZE),m=c?c.data[0]:0,l=o[0],u=o[1],f=((m+1)/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,h=0;for(let d=0;d<n.length-5;d+=3){const e=n[d],r=n[d+1],s=l-e,o=u-r,i=n[d+3]-e,a=n[d+4]-r,c=t((i*s+a*o)/(i*i+a*a),0,1),m=i*c-s,f=a*c-o,g=m*m+f*f;g<p&&(p=g,h=d/3)}p<f*f&&i(a.dist,a.normal,h,!1)}createGLMaterial(e){return new q(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?C:P;return new w(e)}}class q extends N{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===x.Color&&this._updateOccludeeState(e),this.ensureTechnique(V,e)}}class B extends v{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.hasOccludees=!1}}const D=f(),W=f(),X=f(),G=f(),k=r(),F=r(),Q=f(),Z=f(),z=d(),H=d(),J=f(),K=[r(),r(),r(),r()],Y=[f(),f(),f(),f()],$=S(),ee=S(),te=S(),re=S();export{I as NativeLineMaterial,B as Parameters};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{a as o,f as i,l as a,j as n,g as c,c as m,m as l,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as h}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as g,fromPoints as j,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as _,signedDistance as A,getNormal as O}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as L,ShaderOutput as x}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as y}from"../core/shaderLibrary/util/AlphaCutoff.js";import N from"../lib/GLMaterial.js";import{Material as R,MaterialParameters as v}from"../lib/Material.js";import{RenderSlot as E}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as w}from"./DefaultBufferWriter.js";import{PositionColorLayout as C,PositionLayout as P}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as U}from"../shaders/NativeLineTechniqueConfiguration.js";class I extends R{constructor(e){super(e,B),this._configuration=new U,this.produces=new Map([[E.OPAQUE_MATERIAL,e=>L(e)]])}getConfiguration(e){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=y}intersect(t,r,f,p,d,S){if(!f.options.selectionMode||!t.visible)return;if(!M(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const L=t.attributes.get(T.POSITION).data,x=f.camera,y=J;s(y,f.point);const N=2;o(K[0],y[0]-N,y[1]+N,0),o(K[1],y[0]+N,y[1]+N,0),o(K[2],y[0]+N,y[1]-N,0),o(K[3],y[0]-N,y[1]-N,0);for(let e=0;e<4;e++)if(!x.unprojectFromRenderScreen(K[e],Y[e]))return;_(x.eye,Y[0],Y[1],$),_(x.eye,Y[1],Y[2],ee),_(x.eye,Y[2],Y[3],te),_(x.eye,Y[3],Y[0],re);let R=Number.MAX_VALUE,v=0;for(let e=0;e<L.length-5;e+=3){if(D[0]=L[e]+r[12],D[1]=L[e+1]+r[13],D[2]=L[e+2]+r[14],W[0]=L[e+3]+r[12],W[1]=L[e+4]+r[13],W[2]=L[e+5]+r[14],A($,D)<0&&A($,W)<0||A(ee,D)<0&&A(ee,W)<0||A(te,D)<0&&A(te,W)<0||A(re,D)<0&&A(re,W)<0)continue;if(x.projectToRenderScreen(D,k),x.projectToRenderScreen(W,F),k[2]<0&&F[2]>0){i(X,D,W);const e=x.frustum,t=-A(e[h.NEAR],D)/a(X,O(e[h.NEAR]));n(X,X,t),c(D,D,X),x.projectToRenderScreen(D,k)}else if(k[2]>0&&F[2]<0){i(X,W,D);const e=x.frustum,t=-A(e[h.NEAR],W)/a(X,O(e[h.NEAR]));n(X,X,t),c(W,W,X),x.projectToRenderScreen(W,F)}else if(k[2]<0&&F[2]<0)continue;k[2]=0,F[2]=0;const t=g(j(k,F,z),y);t<R&&(R=t,m(Q,D),m(Z,W),v=e/3)}const E=f.rayBegin,w=f.rayEnd;if(R<N*N){let e=Number.MAX_VALUE;if(b(j(Q,Z,z),j(E,w,H),G)){i(G,G,E);const t=l(G);n(G,G,1/t),e=t/u(E,w)}S(e,G,v,!1)}}intersectDraped(e,r,s,o,i,a){if(!s.options.selectionMode)return;const n=e.attributes.get(T.POSITION).data,c=e.attributes.get(T.SIZE),m=c?c.data[0]:0,l=o[0],u=o[1],f=((m+1)/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,h=0;for(let d=0;d<n.length-5;d+=3){const e=n[d],r=n[d+1],s=l-e,o=u-r,i=n[d+3]-e,a=n[d+4]-r,c=t((i*s+a*o)/(i*i+a*a),0,1),m=i*c-s,f=a*c-o,g=m*m+f*f;g<p&&(p=g,h=d/3)}p<f*f&&i(a.dist,a.normal,h,!1)}createGLMaterial(e){return new q(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?C:P;return new w(e)}}class q extends N{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===x.Color&&this._updateOccludeeState(e),this.ensureTechnique(V,e)}}class B extends v{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.hasOccludees=!1}}const D=f(),W=f(),X=f(),G=f(),k=r(),F=r(),Q=f(),Z=f(),z=d(),H=d(),J=f(),K=[r(),r(),r(),r()],Y=[f(),f(),f(),f()],$=S(),ee=S(),te=S(),re=S();export{I as NativeLineMaterial,B as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{fromValues as t}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as i,is3DGeometryOutput as s,ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import{alphaCutoff as n}from"../core/shaderLibrary/util/AlphaCutoff.js";import h from"../lib/GLMaterial.js";import{Material as u}from"../lib/Material.js";import{isPathGeometry as c}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as d,intersectAabbInvDir as l}from"../lib/RayIntersections.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{PathTechniqueConfiguration as b,vertexAttributeLocations as S,PathTechnique as v,PathPassParameters as g}from"./PathTechnique.js";class _ extends u{constructor(e){super(e,y),this._vertexBufferLayout=O(),this._configuration=new b,this._vertexAttributeLocations=S,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&i(e)||s(e))&&!this.parameters.transparent],[p.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&i(e)||s(e))&&this.parameters.transparent]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,e===a.Color&&(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?o.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?o.WindingOrder:o.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=null!=t.ssao),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==a.Shadow&&e!==a.ShadowExcludeHighlight&&e!==a.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=n}intersect(r,i,s,a,o,n){const h=r;if(!c(h))return;const u=h.path,p=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:t,factor:r,minSize:i,maxSize:s}=this.parameters.vvSize,a=u.sizeAttributeValue;p[0]*=e(t[0]+a*r[0],i[0],s[0]),p[1]*=e(t[2]+a*r[2],i[2],s[2])}const m=new d(!1,s.options.normalRequired),f=Math.max(p[0],p[1]),b=r.boundingInfo;if(null==b)return void A(u,p,a,o,m,n);const S=t(b.bbMin[0]-f,b.bbMin[1]-f,b.bbMin[2]-f,b.bbMax[0]+f,b.bbMax[1]+f,b.bbMax[2]+f),v=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],g=Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]),_=[g/v[0],g/v[1],g/v[2]];l(S,a,_,s.tolerance)&&A(u,p,a,o,m,n)}createBufferWriter(){return new f(this._vertexBufferLayout)}createGLMaterial(e){return new w(e)}}function O(){const e=r().vec3f(m.POSITION).vec4f(m.PROFILERIGHT).vec4f(m.PROFILEUP).vec4f(m.PROFILEVERTEXANDNORMAL).vec4f(m.FEATUREVALUE);return has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(m.OBJECTANDLAYERIDCOLOR),e}class w extends h{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){null!=this.technique&&e.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return this._output===a.Color&&(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(v,e)}}function A(e,t,r,i,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(r,i,s,a)}class y extends g{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1}}export{y as Parameters,_ as PathMaterial};
5
+ import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{e as t}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as a,is3DGeometryOutputMRT as o,isColorOrColorEmission as n,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as c}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as d}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as m}from"../core/shaderLibrary/util/AlphaCutoff.js";import p from"../lib/GLMaterial.js";import{Material as l}from"../lib/Material.js";import{isPathGeometry as f}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as b,intersectAabbInvDir as g}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as v}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as _}from"./DefaultBufferWriter.js";import{PathTechniqueConfiguration as O,vertexAttributeLocations as y,PathTechnique as w,PathPassParameters as A}from"./PathTechnique.js";class L extends l{constructor(e){super(e,R),this._vertexBufferLayout=P(),this._configuration=new O,this._vertexAttributeLocations=y,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&a(e)||o(e))&&!this.parameters.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&a(e)||o(e))&&this.parameters.transparent]])}get hasEmissions(){return!t(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,n(e)&&(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=null!=t.ssao),this._configuration.pbrMode=this.parameters.usePBR?d.Schematic:d.Disabled,this._configuration.emissionSource=this.parameters.usePBR?c.Value:c.None,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=m}intersect(t,r,i,a,o,n){const h=t;if(!f(h))return;const c=h.path,u=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:t,factor:r,minSize:s,maxSize:i}=this.parameters.vvSize,a=c.sizeAttributeValue;u[0]*=e(t[0]+a*r[0],s[0],i[0]),u[1]*=e(t[2]+a*r[2],s[2],i[2])}const d=new b(!1,i.options.normalRequired),m=Math.max(u[0],u[1]),p=t.boundingInfo;if(null==p)return void E(c,u,a,o,d,n);const l=s(p.bbMin[0]-m,p.bbMin[1]-m,p.bbMin[2]-m,p.bbMax[0]+m,p.bbMax[1]+m,p.bbMax[2]+m),S=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],v=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),_=[v/S[0],v/S[1],v/S[2]];g(l,a,_,i.tolerance)&&E(c,u,a,o,d,n)}createBufferWriter(){return new _(this._vertexBufferLayout)}createGLMaterial(e){return new j(e)}}function P(){const e=i().vec3f(v.POSITION).vec4f(v.PROFILERIGHT).vec4f(v.PROFILEUP).vec4f(v.PROFILEVERTEXANDNORMAL).vec4f(v.FEATUREVALUE);return has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(v.OBJECTANDLAYERIDCOLOR),e}class j extends p{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){null!=this.technique&&e.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return n(this._output)&&(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(w,e)}}function E(e,t,r,s,i,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(r,s,i,a)}class R extends A{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.usePBR=!1}}export{R as Parameters,L as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{fromValues as o,create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as s}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{TextureCoordinateType as n}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as a}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as d}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as u}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blending as h,oitDepthTest as m,getDrawBuffers as v,OITPolygonOffset as b}from"../lib/OrderIndependentTransparency.js";import{Program as y}from"../lib/Program.js";import{stencilWriteMaskOn as f,stencilBaseAllZerosParams as g}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as P}from"./DefaultTechniqueConfiguration.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as N}from"../../../webgl/enums.js";import{makePipelineState as S,frontFaceCullingParams as E,defaultDepthWriteParams as C,defaultColorWriteParams as R}from"../../../webgl/renderState.js";const L=new Map([[T.POSITION,0],[T.PROFILERIGHT,1],[T.PROFILEUP,2],[T.PROFILEVERTEXANDNORMAL,3],[T.FEATUREVALUE,4],[T.OBJECTANDLAYERIDCOLOR,5]]);class V extends s{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1,this.origin=t(),this.modelTransformation=null}}class x extends d{constructor(e,o,t){o.spherical=e.viewingMode===r.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,super(e,o,t)}initializeProgram(e){return new y(e.rctx,x.shader.get().build(this.configuration),L)}initializePipeline(){const e=this.configuration.transparencyPassType,{output:o,transparent:t,hasSlicePlane:r,doubleSidedMode:s,hasOccludees:n}=this.configuration,a=e===O.NONE,p=e===O.FrontFace;return S({blending:o===i.Color&&t?h(e):null,culling:r&&!t&&s!==l.None?E:null,depthTest:{func:m(e)},depthWrite:a||p?C:null,drawBuffers:o===i.Depth?{buffers:[N.NONE]}:v(e,o),colorWrite:R,stencilWrite:n?f:null,stencilTest:n?g:null,polygonOffset:a||p?null:b})}}x.shader=new c(j,(()=>import("../shaders/Path.glsl.js")));class A extends P{constructor(){super(...arguments),this.output=i.Color,this.doubleSidedMode=l.None,this.transparencyPassType=O.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.discardInvisibleFragments=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1,this.objectAndLayerIdColorInstanced=!1}}e([u({count:i.COUNT})],A.prototype,"output",void 0),e([u({count:l.COUNT})],A.prototype,"doubleSidedMode",void 0),e([u({count:O.COUNT})],A.prototype,"transparencyPassType",void 0),e([u()],A.prototype,"spherical",void 0),e([u()],A.prototype,"receiveShadows",void 0),e([u()],A.prototype,"receiveAmbientOcclusion",void 0),e([u()],A.prototype,"vvSize",void 0),e([u()],A.prototype,"vvColor",void 0),e([u()],A.prototype,"vvOpacity",void 0),e([u()],A.prototype,"hasSlicePlane",void 0),e([u()],A.prototype,"transparent",void 0),e([u()],A.prototype,"discardInvisibleFragments",void 0),e([u()],A.prototype,"hasOccludees",void 0),e([u()],A.prototype,"multipassEnabled",void 0),e([u()],A.prototype,"cullAboveGround",void 0),e([u()],A.prototype,"doublePrecisionRequiresObfuscation",void 0),e([u({constValue:n.None})],A.prototype,"textureCoordinateType",void 0),e([u({constValue:a.None})],A.prototype,"emissionSource",void 0),e([u({constValue:!1})],A.prototype,"occlusionPass",void 0),e([u({constValue:p.Disabled})],A.prototype,"pbrMode",void 0),e([u({constValue:!0})],A.prototype,"hasVvInstancing",void 0),e([u({constValue:!1})],A.prototype,"useCustomDTRExponentForWater",void 0),e([u({constValue:!1})],A.prototype,"useFillLights",void 0),e([u({constValue:!1})],A.prototype,"hasColorTexture",void 0);export{V as PathPassParameters,x as PathTechnique,A as PathTechniqueConfiguration,L as vertexAttributeLocations};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{fromValues as o,create as t,fromArray as r,ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as s}from"../../../ViewingMode.js";import{ShaderOutput as n,isColorOrColorEmission as a}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as l}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{TextureCoordinateType as p}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as c}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as d}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReloadableShaderModule as h}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as m}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as v}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blending as y,oitDepthTest as b,getDrawBuffers as f,OITPolygonOffset as g}from"../lib/OrderIndependentTransparency.js";import{Program as O}from"../lib/Program.js";import{stencilWriteMaskOn as T,stencilBaseAllZerosParams as P}from"../lib/StencilUtils.js";import{TransparencyPassType as j}from"../lib/TransparencyPassType.js";import{VertexAttribute as N}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as x}from"./DefaultTechniqueConfiguration.js";import{defaultAdvancedMRRFactors as S}from"./pbrUtils.js";import{P as E}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as R}from"../../../webgl/enums.js";import{makePipelineState as C,frontFaceCullingParams as L,defaultDepthWriteParams as V,defaultColorWriteParams as A}from"../../../webgl/renderState.js";const I=new Map([[N.POSITION,0],[N.PROFILERIGHT,1],[N.PROFILEUP,2],[N.PROFILEVERTEXANDNORMAL,3],[N.FEATUREVALUE,4],[N.OBJECTANDLAYERIDCOLOR,5]]);class F extends l{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1,this.origin=t(),this.modelTransformation=null,this.mrrFactors=r(S),this.emissiveFactor=i,this.texture=null,this.textureNormal=null,this.textureEmissive=null,this.textureOcclusion=null,this.textureMetallicRoughness=null}}class M extends m{constructor(e,o,t){o.spherical=e.viewingMode===s.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,super(e,o,t)}initializeProgram(e){return new O(e.rctx,M.shader.get().build(this.configuration),I)}initializePipeline(){const e=this.configuration.transparencyPassType,{output:o,transparent:t,hasSlicePlane:r,doubleSidedMode:i,hasOccludees:s}=this.configuration,l=e===j.NONE,p=e===j.FrontFace;return C({blending:a(o)&&t?y(e):null,culling:r&&!t&&i!==c.None?L:null,depthTest:{func:b(e)},depthWrite:l||p?V:null,drawBuffers:o===n.Depth?{buffers:[R.NONE]}:f(e,o),colorWrite:A,stencilWrite:s?T:null,stencilTest:s?P:null,polygonOffset:l||p?null:g})}}M.shader=new h(E,(()=>import("../shaders/Path.glsl.js")));class q extends x{constructor(){super(...arguments),this.output=n.Color,this.doubleSidedMode=c.None,this.transparencyPassType=j.NONE,this.pbrMode=d.Disabled,this.emissionSource=u.None,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.discardInvisibleFragments=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1,this.objectAndLayerIdColorInstanced=!1}}e([v({count:n.COUNT})],q.prototype,"output",void 0),e([v({count:c.COUNT})],q.prototype,"doubleSidedMode",void 0),e([v({count:j.COUNT})],q.prototype,"transparencyPassType",void 0),e([v({count:d.COUNT})],q.prototype,"pbrMode",void 0),e([v({count:u.COUNT})],q.prototype,"emissionSource",void 0),e([v()],q.prototype,"spherical",void 0),e([v()],q.prototype,"receiveShadows",void 0),e([v()],q.prototype,"receiveAmbientOcclusion",void 0),e([v()],q.prototype,"vvSize",void 0),e([v()],q.prototype,"vvColor",void 0),e([v()],q.prototype,"vvOpacity",void 0),e([v()],q.prototype,"hasSlicePlane",void 0),e([v()],q.prototype,"transparent",void 0),e([v()],q.prototype,"discardInvisibleFragments",void 0),e([v()],q.prototype,"hasOccludees",void 0),e([v()],q.prototype,"multipassEnabled",void 0),e([v()],q.prototype,"cullAboveGround",void 0),e([v()],q.prototype,"doublePrecisionRequiresObfuscation",void 0),e([v({constValue:p.None})],q.prototype,"textureCoordinateType",void 0),e([v({constValue:!1})],q.prototype,"occlusionPass",void 0),e([v({constValue:!0})],q.prototype,"hasVvInstancing",void 0),e([v({constValue:!1})],q.prototype,"useCustomDTRExponentForWater",void 0),e([v({constValue:!1})],q.prototype,"useFillLights",void 0),e([v({constValue:!1})],q.prototype,"hasColorTexture",void 0),e([v({constValue:!1})],q.prototype,"hasMetallicRoughnessTexture",void 0),e([v({constValue:!1})],q.prototype,"hasOcclusionTexture",void 0),e([v({constValue:!1})],q.prototype,"hasNormalTexture",void 0);export{F as PathPassParameters,M as PathTechnique,q as PathTechniqueConfiguration,I as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{s as i,f as a,m as n,j as o,g as l,c,l as p,p as u,h}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as T,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as S,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as v,isColor as P,isDepth as b,isColorHighlightOIDOrDepth as L,ShaderOutput as N,is2DGeometryOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as y}from"../core/shaderLibrary/util/AlphaCutoff.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as U}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as J}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as M}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as z}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as H,CapType as k}from"../shaders/RibbonLineTechniqueConfiguration.js";var V;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(V||(V={}));class Z extends D{constructor(e){super(e,Y),this._configuration=new H,this._vertexAttributeLocations=G,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>v(e)||P(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.OPAQUE_NO_SSAO_DEPTH,e=>b(e)],[F.OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>e===N.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==U.OccludeAndTransparentStencil],[F.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>e===N.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==U.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==N.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&K(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===U.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=y||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>y}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.attributes.get(B.POSITION).data,l=e.attributes.get(B.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.attributes.get(B.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=i[0],u=i[1],h=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let d=0;d<o.length-5;d+=3){const e=o[d],r=o[d+1],s=p-e,i=u-r,a=o[d+3]-e,n=o[d+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),c=a*l-s,h=n*l-i,T=c*c+h*h;T<m&&(m=T,f=d/3)}m<h*h&&a(n.dist,n.normal,f,!1)}intersect(r,h,m,f,T,R){if(!m.options.selectionMode||!r.visible)return;if(!w(h))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.attributes,v=g.get(B.POSITION).data;let P=this.parameters.width;if(this.parameters.vvSize){const e=g.get(B.SIZEFEATUREATTRIBUTE).data[0];P*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(B.SIZE)&&(P*=g.get(B.SIZE).data[0]);const b=m.camera,L=se;s(L,m.point);const N=P*b.pixelRatio/2+4*b.pixelRatio;i(me[0],L[0]-N,L[1]+N,0),i(me[1],L[0]+N,L[1]+N,0),i(me[2],L[0]+N,L[1]-N,0),i(me[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(me[e],fe[e]))return;O(b.eye,fe[0],fe[1],de),O(b.eye,fe[1],fe[2],Te),O(b.eye,fe[2],fe[3],_e),O(b.eye,fe[3],fe[0],Ee);let C=Number.MAX_VALUE,y=0;const j=Q(this.parameters,g)?v.length-2:v.length-5;for(let e=0;e<j;e+=3){$[0]=v[e]+h[12],$[1]=v[e+1]+h[13],$[2]=v[e+2]+h[14];const t=(e+3)%v.length;if(ee[0]=v[t]+h[12],ee[1]=v[t+1]+h[13],ee[2]=v[t+2]+h[14],S(de,$)<0&&S(de,ee)<0||S(Te,$)<0&&S(Te,ee)<0||S(_e,$)<0&&S(_e,ee)<0||S(Ee,$)<0&&S(Ee,ee)<0)continue;if(b.projectToRenderScreen($,ie),b.projectToRenderScreen(ee,ae),ie[2]<0&&ae[2]>0){a(te,$,ee);const e=b.frustum,t=-S(e[d.NEAR],$)/n(te,I(e[d.NEAR]));o(te,te,t),l($,$,te),b.projectToRenderScreen($,ie)}else if(ie[2]>0&&ae[2]<0){a(te,ee,$);const e=b.frustum,t=-S(e[d.NEAR],ee)/n(te,I(e[d.NEAR]));o(te,te,t),l(ee,ee,te),b.projectToRenderScreen(ee,ae)}else if(ie[2]<0&&ae[2]<0)continue;ie[2]=0,ae[2]=0;const r=_(E(ie,ae,le),L);r<C&&(C=r,c(ne,$),c(oe,ee),y=e/3)}const D=m.rayBegin,U=m.rayEnd;if(C<N*N){let e=Number.MAX_VALUE;if(A(E(ne,oe,le),E(D,U,ce),re)){a(re,re,D);const t=p(re);o(re,re,1/t),e=t/u(D,U)}R(e,re,y,!1)}}get _layout(){const e=g().vec3f(B.POSITION).vec3f(B.PREVPOSITION).vec3f(B.NEXTPOSITION).f32(B.SUBDIVISIONFACTOR).vec2f(B.UV0);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4f(B.COLOR),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(B.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new q(this._layout,this.parameters)}createGLMaterial(e){return new W(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class W extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===N.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(z,e)}}class Y extends x{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=k.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class q{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=M+r}}_isClosed(e){return Q(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a,n){const o=pe,l=ue,p=he,m=r.get(B.POSITION),f=m.indices,d=m.data.length/3,T=r.get(B.DISTANCETOSTART)?.data;f&&f.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const _=r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]??r.get(B.SIZE)?.data[0]??1;let E=[1,1,1,1],A=0;const R=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);R?A=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const O=has("enable-feature:objectAndLayerId-rendering")?s:null,S=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),I=S?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),v=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(a.buffer):null,P=this.vertexBufferLayout.stride/4;let b=n*P;const L=b;let N=0;const C=T?(e,t,r)=>N=T[r]:(e,t,r)=>N+=u(e,t),y=has("enable-feature:objectAndLayerId-rendering"),j=(e,t,r,s,i,a,n)=>{if(g[b++]=t[0],g[b++]=t[1],g[b++]=t[2],g[b++]=e[0],g[b++]=e[1],g[b++]=e[2],g[b++]=r[0],g[b++]=r[1],g[b++]=r[2],g[b++]=s,g[b++]=n,g[b++]=i,g[b++]=_,R)g[b++]=A;else{const e=Math.min(4*a,E.length-4);g[b++]=E[e],g[b++]=E[e+1],g[b++]=E[e+2],g[b++]=E[e+3]}S&&(g[b++]=I),y&&(null!=O&&(v[4*b]=O[0],v[4*b+1]=O[1],v[4*b+2]=O[2],v[4*b+3]=O[3]),b++)};b+=P,i(l,m.data[0],m.data[1],m.data[2]),e&&h(l,l,e);const D=this._isClosed(r);if(D){const t=m.data.length-3;i(o,m.data[t],m.data[t+1],m.data[t+2]),e&&h(o,o,e)}else i(p,m.data[3],m.data[4],m.data[5]),e&&h(p,p,e),j(l,l,p,1,V.LEFT_CAP_START,0,0),j(l,l,p,1,V.RIGHT_CAP_START,0,0),c(o,l),c(l,p);const U=D?0:1,F=D?d:d-1;for(let u=U;u<F;u++){const t=(u+1)%d*3;i(p,m.data[t],m.data[t+1],m.data[t+2]),e&&h(p,p,e),C(o,l,u),j(o,l,p,0,V.LEFT_JOIN_END,u,N),j(o,l,p,0,V.RIGHT_JOIN_END,u,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(o,l,p,t,V.LEFT_JOIN_END,u,N),j(o,l,p,t,V.RIGHT_JOIN_END,u,N)}j(o,l,p,1,V.LEFT_JOIN_START,u,N),j(o,l,p,1,V.RIGHT_JOIN_START,u,N),c(o,l),c(l,p)}D?(i(p,m.data[3],m.data[4],m.data[5]),e&&h(p,p,e),N=C(o,l,F),j(o,l,p,0,V.LEFT_JOIN_END,U,N),j(o,l,p,0,V.RIGHT_JOIN_END,U,N)):(N=C(o,l,F),j(o,l,l,0,V.LEFT_CAP_END,F,N),j(o,l,l,0,V.RIGHT_CAP_END,F,N)),X(g,L+P,g,L,P);b=X(g,b-P,g,b,P),this._parameters.wireframe&&this._addWireframeVertices(a,L,b,P)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=X(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function X(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Q(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function K(e){return e.anchor===J.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const $=m(),ee=m(),te=m(),re=m(),se=m(),ie=r(),ae=r(),ne=m(),oe=m(),le=T(),ce=T(),pe=m(),ue=m(),he=m(),me=[r(),r(),r(),r()],fe=[m(),m(),m(),m()],de=R(),Te=R(),_e=R(),Ee=R();export{Y as Parameters,Z as RibbonLineMaterial};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{a as i,f as a,l as n,j as o,g as l,c,m as p,p as u,h}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as T,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as S,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as v,isColor as P,isDepth as b,isColorHighlightOIDOrDepth as L,ShaderOutput as N,is2DGeometryOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as y}from"../core/shaderLibrary/util/AlphaCutoff.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as U}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as J}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as M}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as z}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as H,CapType as k}from"../shaders/RibbonLineTechniqueConfiguration.js";var V;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(V||(V={}));class Z extends D{constructor(e){super(e,Y),this._configuration=new H,this._vertexAttributeLocations=G,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>v(e)||P(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.OPAQUE_NO_SSAO_DEPTH,e=>b(e)],[F.OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===U.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>e===N.Color&&this.parameters.writeDepth&&this.parameters.renderOccluded!==U.OccludeAndTransparentStencil],[F.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>e===N.Color&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==U.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==N.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&K(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===U.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=y||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>y}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.attributes.get(B.POSITION).data,l=e.attributes.get(B.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.attributes.get(B.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=i[0],u=i[1],h=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let d=0;d<o.length-5;d+=3){const e=o[d],r=o[d+1],s=p-e,i=u-r,a=o[d+3]-e,n=o[d+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),c=a*l-s,h=n*l-i,T=c*c+h*h;T<m&&(m=T,f=d/3)}m<h*h&&a(n.dist,n.normal,f,!1)}intersect(r,h,m,f,T,R){if(!m.options.selectionMode||!r.visible)return;if(!w(h))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.attributes,v=g.get(B.POSITION).data;let P=this.parameters.width;if(this.parameters.vvSize){const e=g.get(B.SIZEFEATUREATTRIBUTE).data[0];P*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(B.SIZE)&&(P*=g.get(B.SIZE).data[0]);const b=m.camera,L=se;s(L,m.point);const N=P*b.pixelRatio/2+4*b.pixelRatio;i(me[0],L[0]-N,L[1]+N,0),i(me[1],L[0]+N,L[1]+N,0),i(me[2],L[0]+N,L[1]-N,0),i(me[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(me[e],fe[e]))return;O(b.eye,fe[0],fe[1],de),O(b.eye,fe[1],fe[2],Te),O(b.eye,fe[2],fe[3],_e),O(b.eye,fe[3],fe[0],Ee);let C=Number.MAX_VALUE,y=0;const j=Q(this.parameters,g)?v.length-2:v.length-5;for(let e=0;e<j;e+=3){$[0]=v[e]+h[12],$[1]=v[e+1]+h[13],$[2]=v[e+2]+h[14];const t=(e+3)%v.length;if(ee[0]=v[t]+h[12],ee[1]=v[t+1]+h[13],ee[2]=v[t+2]+h[14],S(de,$)<0&&S(de,ee)<0||S(Te,$)<0&&S(Te,ee)<0||S(_e,$)<0&&S(_e,ee)<0||S(Ee,$)<0&&S(Ee,ee)<0)continue;if(b.projectToRenderScreen($,ie),b.projectToRenderScreen(ee,ae),ie[2]<0&&ae[2]>0){a(te,$,ee);const e=b.frustum,t=-S(e[d.NEAR],$)/n(te,I(e[d.NEAR]));o(te,te,t),l($,$,te),b.projectToRenderScreen($,ie)}else if(ie[2]>0&&ae[2]<0){a(te,ee,$);const e=b.frustum,t=-S(e[d.NEAR],ee)/n(te,I(e[d.NEAR]));o(te,te,t),l(ee,ee,te),b.projectToRenderScreen(ee,ae)}else if(ie[2]<0&&ae[2]<0)continue;ie[2]=0,ae[2]=0;const r=_(E(ie,ae,le),L);r<C&&(C=r,c(ne,$),c(oe,ee),y=e/3)}const D=m.rayBegin,U=m.rayEnd;if(C<N*N){let e=Number.MAX_VALUE;if(A(E(ne,oe,le),E(D,U,ce),re)){a(re,re,D);const t=p(re);o(re,re,1/t),e=t/u(D,U)}R(e,re,y,!1)}}get _layout(){const e=g().vec3f(B.POSITION).vec3f(B.PREVPOSITION).vec3f(B.NEXTPOSITION).f32(B.SUBDIVISIONFACTOR).vec2f(B.UV0);return this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4f(B.COLOR),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(B.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new q(this._layout,this.parameters)}createGLMaterial(e){return new W(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class W extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===N.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(z,e)}}class Y extends x{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=k.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class q{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=M+r}}_isClosed(e){return Q(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a,n){const o=pe,l=ue,p=he,m=r.get(B.POSITION),f=m.indices,d=m.data.length/3,T=r.get(B.DISTANCETOSTART)?.data;f&&f.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const _=r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]??r.get(B.SIZE)?.data[0]??1;let E=[1,1,1,1],A=0;const R=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);R?A=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const O=has("enable-feature:objectAndLayerId-rendering")?s:null,S=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),I=S?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),v=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(a.buffer):null,P=this.vertexBufferLayout.stride/4;let b=n*P;const L=b;let N=0;const C=T?(e,t,r)=>N=T[r]:(e,t,r)=>N+=u(e,t),y=has("enable-feature:objectAndLayerId-rendering"),j=(e,t,r,s,i,a,n)=>{if(g[b++]=t[0],g[b++]=t[1],g[b++]=t[2],g[b++]=e[0],g[b++]=e[1],g[b++]=e[2],g[b++]=r[0],g[b++]=r[1],g[b++]=r[2],g[b++]=s,g[b++]=n,g[b++]=i,g[b++]=_,R)g[b++]=A;else{const e=Math.min(4*a,E.length-4);g[b++]=E[e],g[b++]=E[e+1],g[b++]=E[e+2],g[b++]=E[e+3]}S&&(g[b++]=I),y&&(null!=O&&(v[4*b]=O[0],v[4*b+1]=O[1],v[4*b+2]=O[2],v[4*b+3]=O[3]),b++)};b+=P,i(l,m.data[0],m.data[1],m.data[2]),e&&h(l,l,e);const D=this._isClosed(r);if(D){const t=m.data.length-3;i(o,m.data[t],m.data[t+1],m.data[t+2]),e&&h(o,o,e)}else i(p,m.data[3],m.data[4],m.data[5]),e&&h(p,p,e),j(l,l,p,1,V.LEFT_CAP_START,0,0),j(l,l,p,1,V.RIGHT_CAP_START,0,0),c(o,l),c(l,p);const U=D?0:1,F=D?d:d-1;for(let u=U;u<F;u++){const t=(u+1)%d*3;i(p,m.data[t],m.data[t+1],m.data[t+2]),e&&h(p,p,e),C(o,l,u),j(o,l,p,0,V.LEFT_JOIN_END,u,N),j(o,l,p,0,V.RIGHT_JOIN_END,u,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(o,l,p,t,V.LEFT_JOIN_END,u,N),j(o,l,p,t,V.RIGHT_JOIN_END,u,N)}j(o,l,p,1,V.LEFT_JOIN_START,u,N),j(o,l,p,1,V.RIGHT_JOIN_START,u,N),c(o,l),c(l,p)}D?(i(p,m.data[3],m.data[4],m.data[5]),e&&h(p,p,e),N=C(o,l,F),j(o,l,p,0,V.LEFT_JOIN_END,U,N),j(o,l,p,0,V.RIGHT_JOIN_END,U,N)):(N=C(o,l,F),j(o,l,l,0,V.LEFT_CAP_END,F,N),j(o,l,l,0,V.RIGHT_CAP_END,F,N)),X(g,L+P,g,L,P);b=X(g,b-P,g,b,P),this._parameters.wireframe&&this._addWireframeVertices(a,L,b,P)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=X(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function X(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Q(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function K(e){return e.anchor===J.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const $=m(),ee=m(),te=m(),re=m(),se=m(),ie=r(),ae=r(),ne=m(),oe=m(),le=T(),ce=T(),pe=m(),ue=m(),he=m(),me=[r(),r(),r(),r()],fe=[m(),m(),m(),m()],de=R(),Te=R(),_e=R(),Ee=R();export{Y as Parameters,Z as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{n as e,s as t,j as r,g as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as h,isColorOrOID as p}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as u}from"../core/shaderLibrary/util/AlphaCutoff.js";import{CullFaceOptions as m}from"../lib/basicInterfaces.js";import f from"../lib/GLMaterial.js";import{Material as d,MaterialParameters as b}from"../lib/Material.js";import{intersectTriangleGeometry as S}from"../lib/RayIntersections.js";import{RenderSlot as g}from"../lib/RenderSlot.js";import{assert as E}from"../lib/Util.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as A,writePosition as _}from"./internal/bufferWriterUtils.js";import{ShadedColorMaterialTechniqueConfiguration as F,vertexAttributeLocations as j,ShadedColorMaterialTechnique as v}from"../shaders/ShadedColorMaterialTechnique.js";class w extends d{constructor(e){super(e,z),this._configuration=new F,this._vertexAttributeLocations=j,this.supportsEdges=!0,this.produces=new Map([[g.OPAQUE_MATERIAL,e=>e===h.Highlight||p(e)&&!this.parameters.transparent],[g.TRANSPARENT_MATERIAL,e=>p(e)&&this.parameters.transparent&&this.parameters.writeDepth],[g.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>p(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}get visible(){return this.parameters.color[3]>=u}intersect(e,s,a,c,l,h){if(this.parameters.screenSizeEnabled){const s=e.attributes.get(T.OFFSET),p={applyToVertex:(e,n,o,c)=>{const l=t(O,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),h=t(I,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(l)),i(h,h,l),[h[0],h[1],h[2]]},applyToAabb:e=>{const t=n(e,O);return o(e,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(t))}};S(e,a,c,l,p,h)}else S(e,a,c,l,void 0,h)}createGLMaterial(e){return new x(e)}createBufferWriter(){return new y(this.parameters.screenSizeEnabled)}}class x extends f{beginSlot(e){return this.ensureTechnique(v,e)}}class z extends b{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=m.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class y{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(T.POSITION).vec3f(T.NORMAL);this.screenSizeEnabled&&t.vec3f(T.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.get(T.POSITION).indices.length}write(e,t,r,i,s,a){if(A(r,i,this.vertexBufferLayout,e,t,s,a),this.screenSizeEnabled){if(!r.has(T.OFFSET))throw new Error(`${T.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.get(T.OFFSET);E(3===e.size);const i=s.getField(T.OFFSET,c);if(!i)throw new Error("unable to acquire view for "+T.OFFSET);_(e,t,i,a)}}}}const O=s(),I=s();export{z as Parameters,w as ShadedColorMaterial};
5
+ import{n as e,a as t,j as r,g as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as h,isColorOrOID as p}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as u}from"../core/shaderLibrary/util/AlphaCutoff.js";import{CullFaceOptions as m}from"../lib/basicInterfaces.js";import f from"../lib/GLMaterial.js";import{Material as d,MaterialParameters as b}from"../lib/Material.js";import{intersectTriangleGeometry as S}from"../lib/RayIntersections.js";import{RenderSlot as g}from"../lib/RenderSlot.js";import{assert as E}from"../lib/Util.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as A,writePosition as _}from"./internal/bufferWriterUtils.js";import{ShadedColorMaterialTechniqueConfiguration as F,vertexAttributeLocations as j,ShadedColorMaterialTechnique as v}from"../shaders/ShadedColorMaterialTechnique.js";class w extends d{constructor(e){super(e,z),this._configuration=new F,this._vertexAttributeLocations=j,this.supportsEdges=!0,this.produces=new Map([[g.OPAQUE_MATERIAL,e=>e===h.Highlight||p(e)&&!this.parameters.transparent],[g.TRANSPARENT_MATERIAL,e=>p(e)&&this.parameters.transparent&&this.parameters.writeDepth],[g.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>p(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}get visible(){return this.parameters.color[3]>=u}intersect(e,s,a,c,l,h){if(this.parameters.screenSizeEnabled){const s=e.attributes.get(T.OFFSET),p={applyToVertex:(e,n,o,c)=>{const l=t(O,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),h=t(I,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(l)),i(h,h,l),[h[0],h[1],h[2]]},applyToAabb:e=>{const t=n(e,O);return o(e,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(t))}};S(e,a,c,l,p,h)}else S(e,a,c,l,void 0,h)}createGLMaterial(e){return new x(e)}createBufferWriter(){return new y(this.parameters.screenSizeEnabled)}}class x extends f{beginSlot(e){return this.ensureTechnique(v,e)}}class z extends b{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=m.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class y{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(T.POSITION).vec3f(T.NORMAL);this.screenSizeEnabled&&t.vec3f(T.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.get(T.POSITION).indices.length}write(e,t,r,i,s,a){if(A(r,i,this.vertexBufferLayout,e,t,s,a),this.screenSizeEnabled){if(!r.has(T.OFFSET))throw new Error(`${T.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.get(T.OFFSET);E(3===e.size);const i=s.getField(T.OFFSET,c);if(!i)throw new Error("unable to acquire view for "+T.OFFSET);_(e,t,i,a)}}}}const O=s(),I=s();export{z as Parameters,w as ShadedColorMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{fromArray as e,ZEROS as t,fromValues as i,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewingMode as o}from"../../../ViewingMode.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as a}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as n}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as u}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{EmissionSource as h}from"../core/shaderLibrary/output/Emissions.glsl.js";import{alphaCutoff as m}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as p}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as d}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as f,DepthTestFunction as b,AlphaDiscardMode as g}from"../lib/basicInterfaces.js";import{Default3D as y}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as j}from"../lib/Material.js";import{blending as x,oitDepthTest as T,getDrawBuffers as P,getOITPolygonOffset as S}from"../lib/OrderIndependentTransparency.js";import{Program as v}from"../lib/Program.js";import{stencilWriteMaskOn as O,stencilToolMaskBaseParams as L,stencilBaseAllZerosParams as C}from"../lib/StencilUtils.js";import{TransparencyPassType as M}from"../lib/TransparencyPassType.js";import{defaultAdvancedMRRFactors as w}from"../materials/pbrUtils.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{SpecialDrawBuffers as D,CompareFunction as N}from"../../../webgl/enums.js";import{makePipelineState as E,cullingParams as F,defaultDepthWriteParams as _,defaultColorWriteParams as k}from"../../../webgl/renderState.js";class q extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(w),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=f.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=t,this.instancedDoublePrecision=!1,this.normalType=a.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=i(.2,.2,.2),this.diffuse=i(.8,.8,.8),this.externalColor=s(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=b.Less,this.textureAlphaMode=g.Blend,this.textureAlphaCutoff=m,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=j.Occlude,this.isDecoration=!1}}class I extends u{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}class R extends d{constructor(e,t,i){t.spherical=e.viewingMode===o.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.emissionSource===h.Texture||t.hasOcclusionTexture||t.hasNormalTexture?n.Default:n.None,t.objectAndLayerIdColorInstanced=t.instanced,super(e,t,i)}initializeProgram(e){return this._initializeProgram(e,R.shader)}_initializeProgram(e,t){return new v(e.rctx,t.get().build(this.configuration),y)}_makePipeline(e,t){const{output:i,transparent:r,cullFace:s,customDepthTest:o,writeDepth:a,hasOccludees:n,enableOffset:c}=this.configuration,u=e===M.NONE,h=e===M.FrontFace;return E({blending:i!==l.Color&&i!==l.ColorEmission||!r?null:x(e),culling:B(this.configuration)?F(s):null,depthTest:{func:T(e,z(o))},depthWrite:(u||h)&&a?_:null,drawBuffers:i===l.Depth?{buffers:[D.NONE]}:P(e,i),colorWrite:k,stencilWrite:n?O:null,stencilTest:n?t?L:C:null,polygonOffset:u||h?null:S(c)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function z(e){return e===b.Lequal?N.LEQUAL:N.LESS}function B(e){return e.cullFace!==f.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}R.shader=new p(A,(()=>import("./DefaultMaterial.glsl.js")));export{I as DefaultMaterialDrawParameters,q as DefaultMaterialPassParameters,R as DefaultMaterialTechnique};
5
+ import{fromArray as e,ZEROS as t,fromValues as i,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewingMode as o}from"../../../ViewingMode.js";import{isColorOrColorEmission as a,ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as n}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as c}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as u,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{EmissionSource as m}from"../core/shaderLibrary/output/Emissions.glsl.js";import{alphaCutoff as p}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as d}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as f}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as b,DepthTestFunction as g,AlphaDiscardMode as y}from"../lib/basicInterfaces.js";import{Default3D as j}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as x}from"../lib/Material.js";import{blending as T,oitDepthTest as P,getDrawBuffers as S,getOITPolygonOffset as v}from"../lib/OrderIndependentTransparency.js";import{Program as O}from"../lib/Program.js";import{stencilWriteMaskOn as L,stencilToolMaskBaseParams as M,stencilBaseAllZerosParams as w}from"../lib/StencilUtils.js";import{TransparencyPassType as A}from"../lib/TransparencyPassType.js";import{defaultAdvancedMRRFactors as D}from"../materials/pbrUtils.js";import{D as C}from"../../../../chunks/DefaultMaterial.glsl.js";import{SpecialDrawBuffers as N,CompareFunction as F}from"../../../webgl/enums.js";import{makePipelineState as _,cullingParams as k,defaultDepthWriteParams as q,defaultColorWriteParams as E}from"../../../webgl/renderState.js";class I extends u{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(D),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=b.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=t,this.instancedDoublePrecision=!1,this.normalType=n.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=i(.2,.2,.2),this.diffuse=i(.8,.8,.8),this.externalColor=s(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=g.Less,this.textureAlphaMode=y.Blend,this.textureAlphaCutoff=p,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=x.Occlude,this.isDecoration=!1}}class R extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}class z extends f{constructor(e,t,i){t.spherical=e.viewingMode===o.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.emissionSource===m.Texture||t.hasOcclusionTexture||t.hasNormalTexture?c.Default:c.None,t.objectAndLayerIdColorInstanced=t.instanced,super(e,t,i)}initializeProgram(e){return this._initializeProgram(e,z.shader)}_initializeProgram(e,t){return new O(e.rctx,t.get().build(this.configuration),j)}_makePipeline(e,t){const{output:i,transparent:r,cullFace:s,customDepthTest:o,writeDepth:n,hasOccludees:c,enableOffset:u}=this.configuration,h=e===A.NONE,m=e===A.FrontFace;return _({blending:a(i)&&r?T(e):null,culling:V(this.configuration)?k(s):null,depthTest:{func:P(e,B(o))},depthWrite:(h||m)&&n?q:null,drawBuffers:i===l.Depth?{buffers:[N.NONE]}:S(e,i),colorWrite:E,stencilWrite:c?L:null,stencilTest:c?t?M:w:null,polygonOffset:h||m?null:v(u)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function B(e){return e===g.Lequal?F.LEQUAL:F.LESS}function V(e){return e.cullFace!==b.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}z.shader=new d(C,(()=>import("./DefaultMaterial.glsl.js")));export{R as DefaultMaterialDrawParameters,I as DefaultMaterialPassParameters,z as DefaultMaterialTechnique};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DPassUniform.js";export{b as build}from"../../../../chunks/FocusAreaColor.glsl.js";
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/FocusAreaMask.glsl.js";
@@ -2,21 +2,21 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as t}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{alphaCutoff as i}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as l}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{glsl as a,If as s}from"../core/shaderModules/interfaces.js";import{TransparencyPassType as e}from"../lib/TransparencyPassType.js";function n(n,u){n.include(t,u),n.include(r,u),n.fragment.include(l);const p=u.output===o.ObjectAndLayerIdColor,d=u.output===o.ColorEmission,f=(u.output===o.Color||d)&&u.transparencyPassType===e.ColorAlpha,c=(u.output===o.Color||d)&&u.transparencyPassType!==e.ColorAlpha,m=u.discardInvisibleFragments;let g=0;(c||d||f)&&n.outputs.add("fragColor","vec4",g++),d&&n.outputs.add("fragEmission","vec4",g++),f&&n.outputs.add("fragAlpha","float",g++),n.fragment.code.add(a`
5
+ import{ShaderOutput as o,isColorEmission as r,isColorOrColorEmission as t}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as a}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as i}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{alphaCutoff as l}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{glsl as e,If as n}from"../core/shaderModules/interfaces.js";import{TransparencyPassType as u}from"../lib/TransparencyPassType.js";function p(p,d){p.include(i,d),p.include(a,d),p.fragment.include(s);const f=d.output===o.ObjectAndLayerIdColor,c=r(d.output),g=t(d.output)&&d.transparencyPassType===u.ColorAlpha,h=t(d.output)&&d.transparencyPassType!==u.ColorAlpha,m=d.discardInvisibleFragments;let C=0;(h||c||g)&&p.outputs.add("fragColor","vec4",C++),c&&p.outputs.add("fragEmission","vec4",C++),g&&p.outputs.add("fragAlpha","float",C++),p.fragment.code.add(e`
6
6
  void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) {
7
- ${s(p,a`finalColor.a = 1.0;`)}
7
+ ${n(f,e`finalColor.a = 1.0;`)}
8
8
 
9
- ${s(m,a`if (finalColor.a < ${a.float(i)}){
9
+ ${n(m,e`if (finalColor.a < ${e.float(l)}){
10
10
  discard;
11
11
  return;
12
12
  }`)}
13
13
 
14
14
  finalColor = highlightSlice(finalColor, vWorldPosition);
15
- ${s(f,a`fragColor = premultiplyAlpha(finalColor);
15
+ ${n(g,e`fragColor = premultiplyAlpha(finalColor);
16
16
  fragAlpha = finalColor.a;`)}
17
- ${s(c,"fragColor = finalColor;")}
18
- ${s(d,"fragEmission = getEmissions();")}
17
+ ${n(h,"fragColor = finalColor;")}
18
+ ${n(c,"fragEmission = getEmissions();")}
19
19
  outputHighlight();
20
- ${s(p,"outputObjectAndLayerIdColor();")}
20
+ ${n(f,"outputObjectAndLayerIdColor();")}
21
21
  }
22
- `)}export{n as outputColorHighlightOID};
22
+ `)}export{p as outputColorHighlightOID};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"./OutputColorHighlightOID.glsl.js";export{b as build}from"../../../../chunks/Path.glsl.js";
5
+ import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"./OutputColorHighlightOID.glsl.js";export{b as build}from"../../../../chunks/Path.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{getMetersPerUnitForSR as e,getMetersPerVerticalUnitForSR as t}from"../../../core/unitUtils.js";import{s as r}from"../../../chunks/vec32.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getGraphicEffectiveElevationInfo as s,zValueInAbsoluteHeightMode as n}from"../../../support/elevationInfoUtils.js";function i(o,i){const l=o?.geometry;if(!o||"mesh"!==l?.type||!i)return;const{renderCoordsHelper:p,elevationProvider:u}=i,{camera:h}=i.state,{extent:d}=l,{center:x,spatialReference:g}=d,v=e(g),j=t(g),z=e(p.spatialReference),y=d.width*v,C=d.height*j,R=(d.zmax??0)*j,U=R-(d.zmin??0)*j,b=Math.max(y,C,U)/z,{x:w,y:P}=x,S=x.z??0;r(f,w,P,S),p.toRenderCoords(f,g,f);const T=b/h.computeScreenPixelSizeAt(f);if(T>h.width*a)return"meshTooClose";if(T<m)return"meshTooFar";const k=s(o),{absoluteZ:A}=n(w,P,R,g,i,k);return A<(u.getElevation(w,P,S,g,"ground")??0)*j+U*c?"meshUnderground":"mesh"}const m=20,a=1,c=.1,f=o();export{i as getDrawMeshHelpMessage};
5
+ import{getMetersPerUnitForSR as e,getMetersPerVerticalUnitForSR as t}from"../../../core/unitUtils.js";import{a as r}from"../../../chunks/vec32.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getGraphicEffectiveElevationInfo as n,zValueInAbsoluteHeightMode as s}from"../../../support/elevationInfoUtils.js";function i(o,i){const l=o?.geometry;if(!o||"mesh"!==l?.type||!i)return;const{renderCoordsHelper:p,elevationProvider:u}=i,{camera:h}=i.state,{extent:d}=l,{center:x,spatialReference:g}=d,v=e(g),j=t(g),z=e(p.spatialReference),y=d.width*v,C=d.height*j,R=(d.zmax??0)*j,U=R-(d.zmin??0)*j,b=Math.max(y,C,U)/z,{x:w,y:P}=x,S=x.z??0;r(f,w,P,S),p.toRenderCoords(f,g,f);const T=b/h.computeScreenPixelSizeAt(f);if(T>h.width*a)return"meshTooClose";if(T<m)return"meshTooFar";const k=n(o),{absoluteZ:A}=s(w,P,R,g,i,k);return A<(u.getElevation(w,P,S,g,"ground")??0)*j+U*c?"meshUnderground":"mesh"}const m=20,a=1,c=.1,f=o();export{i as getDrawMeshHelpMessage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{isSome as t}from"../../../core/arrayUtils.js";import{invert as r}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as e,clone as s}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{rotationTo as a,invert as o}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as n,m as l,f as h,n as m,b as c,u as f}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as d}from"../../../geometry/support/Axis.js";import u from"../../../geometry/Point.js";function g(t,r,e=null){return null!=e?[t,r,e]:[t,r]}function w(t,r,e=null){return null!=e?{x:t,y:r,z:e}:{x:t,y:r}}class R{constructor(t){this.spatialReference=t}mapToLocalMultiple(r){return r.map((t=>this.mapToLocal(t))).filter(t)}get doUnnormalization(){return!1}}class W extends R{constructor(t,a,o=null){super(a),this._defaultZ=o,this.transform=e(),this.transformInv=e(),this.transform=s(t),r(this.transformInv,this.transform)}makeMapPoint(t,r){return g(t,r,this._defaultZ)}mapToLocal(t){return w(this.transform[0]*t[0]+this.transform[2]*t[1]+this.transform[4],this.transform[1]*t[0]+this.transform[3]*t[1]+this.transform[5])}localToMap(t){return g(this.transformInv[0]*t.x+this.transformInv[2]*t.y+this.transformInv[4],this.transformInv[1]*t.x+this.transformInv[3]*t.y+this.transformInv[5],this._defaultZ)}}class v extends R{constructor(t,r){super(t.spatialReference),this.view=t,this.defaultZ=null,this.pWS=p(),this.tangentFrameUpWS=p(),this.tangentFrameRightWS=p(),this.tangentFrameForwardWS=p(),this.localFrameRightWS=p(),this.localFrameUpWS=p(),this.worldToLocalTransform=i(),this.localToWorldTransform=i(),this.scale=1,this.scale=t.resolution,this.referenceMapPoint=r,this.defaultZ=r.hasZ?r.z:null;const e=t.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.Z,this.tangentFrameForwardWS);const s=p();n(s,this.tangentFrameForwardWS,l(e,this.tangentFrameForwardWS)),h(this.localFrameRightWS,e,s),m(this.localFrameRightWS,this.localFrameRightWS),c(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),a(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),o(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return"global"===this.view.viewingMode}makeMapPoint(t,r){return g(t,r,this.defaultZ)}mapToLocal(t){const r=p();this.view.renderCoordsHelper.toRenderCoords(new u({x:t[0],y:t[1],spatialReference:this.spatialReference}),r),f(r,r,this.worldToLocalTransform);const e=this.view.renderCoordsHelper.fromRenderCoords(r,new u({spatialReference:this.view.spatialReference}));return null!=e?w(e.x/this.scale,e.y/this.scale):null}localToMap(t){const r=p();this.view.renderCoordsHelper.toRenderCoords(new u({x:t.x*this.scale,y:t.y*this.scale,spatialReference:this.spatialReference}),r),f(r,r,this.localToWorldTransform);const e=this.view.renderCoordsHelper.fromRenderCoords(r,new u({spatialReference:this.view.spatialReference}));return null!=e?g(e.x,e.y,this.defaultZ):null}}function F(t,r){if("2d"===t.type)return new W(t.state.transform,t.spatialReference,r.length>2?r[2]:null);if("3d"===t.type){const e=r.length>2?new u({x:r[0],y:r[1],z:r[2],spatialReference:t.spatialReference}):new u({x:r[0],y:r[1],spatialReference:t.spatialReference});return new v(t,e)}return null}export{W as AffineCoordinateSystem,v as SceneViewCoordinateSystem,R as SurfaceCoordinateSystem,F as createViewAlignedCoordinateSystem,g as makeMapPoint,w as makeSurfacePoint};
5
+ import"../../../geometry.js";import{isSome as t}from"../../../core/arrayUtils.js";import{invert as r}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as e,clone as s}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{rotationTo as a,invert as o}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as n,l,f as h,n as m,b as c,u as f}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as d}from"../../../geometry/support/Axis.js";import u from"../../../geometry/Point.js";function g(t,r,e=null){return null!=e?[t,r,e]:[t,r]}function w(t,r,e=null){return null!=e?{x:t,y:r,z:e}:{x:t,y:r}}class R{constructor(t){this.spatialReference=t}mapToLocalMultiple(r){return r.map((t=>this.mapToLocal(t))).filter(t)}get doUnnormalization(){return!1}}class W extends R{constructor(t,a,o=null){super(a),this._defaultZ=o,this.transform=e(),this.transformInv=e(),this.transform=s(t),r(this.transformInv,this.transform)}makeMapPoint(t,r){return g(t,r,this._defaultZ)}mapToLocal(t){return w(this.transform[0]*t[0]+this.transform[2]*t[1]+this.transform[4],this.transform[1]*t[0]+this.transform[3]*t[1]+this.transform[5])}localToMap(t){return g(this.transformInv[0]*t.x+this.transformInv[2]*t.y+this.transformInv[4],this.transformInv[1]*t.x+this.transformInv[3]*t.y+this.transformInv[5],this._defaultZ)}}class v extends R{constructor(t,r){super(t.spatialReference),this.view=t,this.defaultZ=null,this.pWS=p(),this.tangentFrameUpWS=p(),this.tangentFrameRightWS=p(),this.tangentFrameForwardWS=p(),this.localFrameRightWS=p(),this.localFrameUpWS=p(),this.worldToLocalTransform=i(),this.localToWorldTransform=i(),this.scale=1,this.scale=t.resolution,this.referenceMapPoint=r,this.defaultZ=r.hasZ?r.z:null;const e=t.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,d.Z,this.tangentFrameForwardWS);const s=p();n(s,this.tangentFrameForwardWS,l(e,this.tangentFrameForwardWS)),h(this.localFrameRightWS,e,s),m(this.localFrameRightWS,this.localFrameRightWS),c(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),a(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),o(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return"global"===this.view.viewingMode}makeMapPoint(t,r){return g(t,r,this.defaultZ)}mapToLocal(t){const r=p();this.view.renderCoordsHelper.toRenderCoords(new u({x:t[0],y:t[1],spatialReference:this.spatialReference}),r),f(r,r,this.worldToLocalTransform);const e=this.view.renderCoordsHelper.fromRenderCoords(r,new u({spatialReference:this.view.spatialReference}));return null!=e?w(e.x/this.scale,e.y/this.scale):null}localToMap(t){const r=p();this.view.renderCoordsHelper.toRenderCoords(new u({x:t.x*this.scale,y:t.y*this.scale,spatialReference:this.spatialReference}),r),f(r,r,this.localToWorldTransform);const e=this.view.renderCoordsHelper.fromRenderCoords(r,new u({spatialReference:this.view.spatialReference}));return null!=e?g(e.x,e.y,this.defaultZ):null}}function F(t,r){if("2d"===t.type)return new W(t.state.transform,t.spatialReference,r.length>2?r[2]:null);if("3d"===t.type){const e=r.length>2?new u({x:r[0],y:r[1],z:r[2],spatialReference:t.spatialReference}):new u({x:r[0],y:r[1],spatialReference:t.spatialReference});return new v(t,e)}return null}export{W as AffineCoordinateSystem,v as SceneViewCoordinateSystem,R as SurfaceCoordinateSystem,F as createViewAlignedCoordinateSystem,g as makeMapPoint,w as makeSurfacePoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{addFrameTask as e}from"../../../core/scheduling.js";import t from"./GamepadInputDevice.js";import{extractState as n,stateIdle as s,stateEqual as i}from"./GamepadState.js";class a{constructor(e,t){this._element=e,this._input=t,this._hasEventListeners=!1,this._onConnectGamepad=e=>{this._connectGamepad(e.gamepad)},this._onDisconnectGamepad=e=>{const t=e.gamepad,s=t.index,i=this._inputDevices[s];i&&(this._emitGamepadEvent(t,n(i),!1),this._inputDevices.splice(s,1),this._latestUpdate.splice(s,1),this._input.gamepad.devices.remove(i),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const s="getGamepads"in window.navigator,i=window.isSecureContext;this.supported=s&&i,this.supported&&(d((e=>this._connectGamepad(e))),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const n=new t(e);"unknown"!==n.deviceType&&(this._inputDevices[e.index]=n,this._input.gamepad.devices.add(n)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){null==this._frameTask&&(this._frameTask=e({update:()=>this._readGamepadState()}))}_stopPolling(){null!=this._frameTask&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),t=this._element.contains(document.activeElement),a="document"===this._input.gamepad.enabledFocusMode&&!e||"view"===this._input.gamepad.enabledFocusMode&&!t;d((e=>{const t=this._inputDevices[e.index];if(!t)return;const o=this._latestUpdate[e.index],d=n(t),c=a||s(d);if(o){if(o.timestamp===e.timestamp)return;if(!o.active&&c)return;if(i(o.state,d))return}this._emitGamepadEvent(e,d,!c)}))}_emitGamepadEvent(e,t,n){const s=this._latestUpdate[e.index],i=s&&s.active;if(!i&&!n)return;const a=!i&&n?"start":i&&n?"update":"end";this._latestUpdate[e.index]={timestamp:e.timestamp,state:t,active:n},this._callback&&this._callback({device:this._inputDevices[e.index],state:t,action:a})}}function o(e){if(!e)return!1;if(!e.connected)return!1;for(let t=0;t<e.axes.length;t++)if(isNaN(e.axes[t]))return!1;return!0}function d(e){const t=window.navigator.getGamepads();for(let n=0;n<t.length;n++){const s=t[n];o(s)&&e(s)}}export{a as GamepadSource};
5
+ import{addFrameTask as e}from"../../../core/scheduling.js";import t from"./GamepadInputDevice.js";import{extractState as s,stateIdle as n,stateEqual as i}from"./GamepadState.js";class a{constructor(e,t){this._element=e,this._input=t,this._hasEventListeners=!1,this._onConnectGamepad=e=>{this._connectGamepad(e.gamepad)},this._onDisconnectGamepad=e=>{const t=e.gamepad,n=t.index,i=this._inputDevices[n];i&&(this._emitGamepadEvent(t,s(i),!1),this._inputDevices.splice(n,1),this._latestUpdate.splice(n,1),this._input.gamepad.devices.remove(i),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const n="getGamepads"in window.navigator,i=window.isSecureContext;this.supported=n&&i,this.supported&&(d((e=>this._connectGamepad(e))),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const s=new t(e);"unknown"!==s.deviceType&&(this._inputDevices[e.index]=s,this._input.gamepad.devices.add(s)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){null==this._frameTask&&(this._frameTask=e({update:()=>this._readGamepadState()}))}_stopPolling(){null!=this._frameTask&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),t=this._element.contains(document.activeElement),a="document"===this._input.gamepad.enabledFocusMode&&!e||"view"===this._input.gamepad.enabledFocusMode&&!t;d((e=>{const t=this._inputDevices[e.index];if(!t)return;const o=this._latestUpdate[e.index],d=s(t),c=a||n(d);if(o){if(o.timestamp===e.timestamp)return;if(!o.active&&c)return;if(i(o.state,d))return}this._emitGamepadEvent(e,d,!c)}))}_emitGamepadEvent(e,t,s){const n=this._latestUpdate[e.index],i=n&&n.active;if(!i&&!s)return;const a=!i&&s?"start":i&&s?"update":"end";this._latestUpdate[e.index]={timestamp:e.timestamp,state:t,active:s},this._callback&&this._callback({device:this._inputDevices[e.index],state:t,action:a})}}function o(e){if(!e)return!1;if(!e.connected)return!1;for(let t=0;t<e.axes.length;t++)if(isNaN(e.axes[t]))return!1;return!0}function d(e){for(const t of navigator.getGamepads())o(t)&&e(t)}export{a as GamepadSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s,o as u,p as c,c as p,H as h}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return p(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return h(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
5
+ import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as s,o as u,p as c,c as p,H as h}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return p(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return h(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../../../core/mathUtils.js";import{subtract as i,normalize as e,dot as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as r,s as h,b as o,n as a,j as _,m as c,k as l,g as p,H as g,c as d}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,fromPositionAndNormal as f,signedDistance as D,copy as E,isPointInside as x,getNormal as b,intersectLine as I}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as N}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as V,LineType as X}from"../../../support/geometry2dUtils.js";class Y{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=y.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=m(),this._offsetPlane=m(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===y.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=r(u(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=u();if(i){r(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(o(n,e,s.direction),o(n,n,e),a(n,n),Math.sign(n[1])!==Math.sign(e[0])&&_(n,n,-1)):h(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=P&&e<=Math.PI-P}_bisectVectorsPerpendicular(t,i){const e=c(t,i)<0?t:l(u(),t),s=Math.abs(c(e,i));if(!(s<T||s>1-T))return this._bisectDirection(e,i);const n=o(u(),e,[0,0,1]);return a(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return a(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);c(t,i)<0&&l(i,i),f(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(u(),t.direction,this._edgeDirection);a(i,i);const e=o(u(),this._edgeDirection,i);return this._planeType===Z.XY&&(e[2]=0),a(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(D(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(D(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const r=b(t),h=this._edgeDirection,o=p(u(),this._left.start,this._left.direction),a=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(n(),r,h,this._left.start),l=this._pointInBasis2D(n(),r,h,o),g=this._pointInBasis2D(n(),r,h,this._right.start),d=this._pointInBasis2D(n(),r,h,a),[m]=V({start:l,end:c,type:X.LINE},{start:d,end:g,type:X.LINE});if(!m)return;const f=i(n(),c,l);e(f,f);const E=i(n(),m,l),x=s(f,E),I=p(u(),o,_(u(),this._left.direction,-x)),M=D(t,I);this._updateDistanceConstraint(M)}_pointInBasis2D(t,i,e,s){return t[0]=N(i,s),t[1]=N(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),E(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&I(this._offsetPlane,t,p(u(),t,i),e),s=u();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=x(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return D(this.plane,this._pointToXYZ(t))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Y&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(b(this._plane),b(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Y(this._helper,this._planeType,this._edge,this.distance,y.DEFERRED);return E(t._plane,this._plane),E(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=d(u(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&g(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:d(u(),t),end:null!=i?d(u(),i):null,direction:d(u(),e),isOriginalDirection:s}}}const P=t(15),T=.001;var Z,y;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(Z||(Z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(y||(y={}));export{Y as OffsetEdgeVertex,Z as PlaneType};
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{subtract as i,normalize as e,dot as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as r,a as h,b as o,n as a,j as _,l as c,k as l,g as p,H as g,c as d}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,fromPositionAndNormal as f,signedDistance as D,copy as E,isPointInside as x,getNormal as b,intersectLine as I}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as N}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as V,LineType as X}from"../../../support/geometry2dUtils.js";class Y{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=y.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=m(),this._offsetPlane=m(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===y.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=r(u(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=u();if(i){r(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(o(n,e,s.direction),o(n,n,e),a(n,n),Math.sign(n[1])!==Math.sign(e[0])&&_(n,n,-1)):h(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=P&&e<=Math.PI-P}_bisectVectorsPerpendicular(t,i){const e=c(t,i)<0?t:l(u(),t),s=Math.abs(c(e,i));if(!(s<T||s>1-T))return this._bisectDirection(e,i);const n=o(u(),e,[0,0,1]);return a(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return a(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);c(t,i)<0&&l(i,i),f(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(u(),t.direction,this._edgeDirection);a(i,i);const e=o(u(),this._edgeDirection,i);return this._planeType===Z.XY&&(e[2]=0),a(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(D(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(D(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const r=b(t),h=this._edgeDirection,o=p(u(),this._left.start,this._left.direction),a=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(n(),r,h,this._left.start),l=this._pointInBasis2D(n(),r,h,o),g=this._pointInBasis2D(n(),r,h,this._right.start),d=this._pointInBasis2D(n(),r,h,a),[m]=V({start:l,end:c,type:X.LINE},{start:d,end:g,type:X.LINE});if(!m)return;const f=i(n(),c,l);e(f,f);const E=i(n(),m,l),x=s(f,E),I=p(u(),o,_(u(),this._left.direction,-x)),M=D(t,I);this._updateDistanceConstraint(M)}_pointInBasis2D(t,i,e,s){return t[0]=N(i,s),t[1]=N(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),E(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&I(this._offsetPlane,t,p(u(),t,i),e),s=u();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=x(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return D(this.plane,this._pointToXYZ(t))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Y&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(b(this._plane),b(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Y(this._helper,this._planeType,this._edge,this.distance,y.DEFERRED);return E(t._plane,this._plane),E(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=d(u(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&g(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:d(u(),t),end:null!=i?d(u(),i):null,direction:d(u(),e),isOriginalDirection:s}}}const P=t(15),T=.001;var Z,y;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(Z||(Z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(y||(y={}));export{Y as OffsetEdgeVertex,Z as PlaneType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{r as a,e as h,a as l,z as f,q as d,s as p,c as m,f as g,H as _,m as L,b as k,n as M}from"../../../chunks/vec32.js";import{clone as x,create as y,UNIT_Z as P,fromValues as z}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as v,h as T}from"../../../chunks/vec42.js";import{create as q}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as w}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as N,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as S}from"../../../geometry/support/plane.js";import{l as C,m as G,p as O,g as H,n as F}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as lt,pointsInsidePlane as ft,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ft(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class Mt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=l(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class xt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ye(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new Pt(B(this.center),this.radius,J(0,0,1))}}class Pt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;N(this.getPlane(vt),t,zt);const r=f(zt,zt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return U(this.center,this.normal,t)}}const zt=y(),vt=b();class Tt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||Me(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(qt,0,0,this.z),U(qt,P,t)}}const qt=y();class wt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||xe(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(jt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const jt=u(),At=u(),Dt=y(),bt=y();class Et extends wt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends wt{constructor(t,e){super(t,e,it.PLANE)}}class Nt extends mt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||ve(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return H(this.sphere)}get radius(){return this.sphere[3]}}class Ut extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||Te(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ht(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||we(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class It extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._elevationMeters=r,this._directionDegrees=n}equals(t){return this===t||qe(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._elevationMeters===t._elevationMeters&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(St,t,e),i(St,this._origin)||this._applyDirectionAndDistance(St),Q(St[0],St[1],this._elevationMeters??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(Ct,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const St=[0,0],Ct=new D;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*w);c=Math.max(0,c),j(t,e,s,c,n)}const Ot=new D;function Ht(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??je,s}function Ft(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ft(e,t);if(Te(t))return fe(t,e);if(Te(e))return fe(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ft(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(Me(e))return Vt(t,e);if(xe(e))return pe(ct(e.planeLike,t.lineLike));if(ye(e))return pe(ut(t.lineLike,e.center,e.radius));if(ze(e))return pe(at(t.lineLike,e));if(Pe(e))return Yt(t,e);if(ve(e))return Bt(t,e)}else if(Me(t)){if(Le(e)||ke(e))return Ft(e,t);if(Me(e))return Kt(t,e);if(xe(e))return Qt(t,e);if(ye(e))return Wt(t,e);if(ze(e))return $t(t,e);if(Pe(e))return Xt(t,e);if(ve(e))return te(t,e)}else if(xe(t)){if(Le(e)||ke(e)||Me(e))return Ft(e,t);if(xe(e))return de(ht(t.planeLike,e.planeLike));if(ye(e))return de(tt(t.planeLike,e.center,e.radius));if(ze(e))return se(t,e);if(Pe(e))return ee(t,e);if(ve(e))return re(t,e)}else if(ye(t)){if(Le(e)||ke(e)||Me(e)||xe(e))return Ft(e,t);if(ye(e))return de(lt(K(t.center),t.radius,K(e.center),e.radius));if(ze(e))return ne();if(Pe(e))return ie(t,e);if(ve(e))return oe()}else if(ze(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e))return Ft(e,t);if(ze(e))return ce();if(Pe(e))return ce(e.asCircle());if(ve(e))return ue()}else if(Pe(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e)||ze(e))return Ft(e,t);if(Pe(e))return ae(e,t);if(ve(e))return he()}else if(ve(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e)||Pe(e))return Ft(e,t);if(ve(e))return le()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(F(e,t.start,t.end))}const Jt=(()=>{const t=q(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const l=S(n),f=h*L(l,e),d=h*L(l,r);v(t,u[0],u[1],u[2],1);const p=T(n,t),m=Math.hypot(f,d),g=$(m,0);if($(I(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,l,c),M(e,e);const t=new Array,s=x(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=x(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const P=Math.atan(f/d),z=s(_)-P,q=Math.PI-z,w=new Array,j=y();a(j,u,e,h*Math.cos(z)),a(j,j,r,h*Math.sin(z)),w.push(j);const A=y();return a(A,u,e,h*Math.cos(q)),a(A,A,r,h*Math.sin(q)),w.push(A),pe(o?ft(o,w):w)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new yt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new yt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return N(n,s,t),new gt(t)}const u=W(),h=x(S(n));return a(u,s,h,i),new Pt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(lt(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(lt(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function le(t,e){}function fe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(ye(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(z(i,o,t))}else if(xe(e)||Te(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??je;n.push(z(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new Mt(e.filter(t))}function _e(t){return t instanceof Mt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function Me(t){return t instanceof Tt}function xe(t){return t instanceof wt}function ye(t){return t instanceof xt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function ve(t){return t instanceof Nt}function Te(t){return t instanceof Ut}function qe(t){return t instanceof It}function we(t){return t instanceof Zt}const je=0;export{Pt as CircleConstraint,mt as Constraint,Zt as CoordinateConstraint,Ut as DrapedLineConstraint,It as GeodesicConstraint,yt as HorizontalCircleConstraint,Tt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,Mt as SetConstraint,Nt as SphereConstraint,xt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,wt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{r as a,e as h,s as l,z as f,q as d,a as p,c as m,f as g,H as _,l as L,b as k,n as M}from"../../../chunks/vec32.js";import{clone as x,create as y,UNIT_Z as P,fromValues as z}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as v,h as T}from"../../../chunks/vec42.js";import{create as q}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as w}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as j,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as N,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as S}from"../../../geometry/support/plane.js";import{l as C,m as G,p as O,g as H,n as F}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as lt,pointsInsidePlane as ft,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ft(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class Mt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=l(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class xt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ye(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new Pt(B(this.center),this.radius,J(0,0,1))}}class Pt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;N(this.getPlane(vt),t,zt);const r=f(zt,zt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return U(this.center,this.normal,t)}}const zt=y(),vt=b();class Tt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||Me(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(qt,0,0,this.z),U(qt,P,t)}}const qt=y();class wt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||xe(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(jt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const jt=u(),At=u(),Dt=y(),bt=y();class Et extends wt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends wt{constructor(t,e){super(t,e,it.PLANE)}}class Nt extends mt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||ve(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return H(this.sphere)}get radius(){return this.sphere[3]}}class Ut extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||Te(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ht(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||we(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class It extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._elevationMeters=r,this._directionDegrees=n}equals(t){return this===t||qe(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._elevationMeters===t._elevationMeters&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(St,t,e),i(St,this._origin)||this._applyDirectionAndDistance(St),Q(St[0],St[1],this._elevationMeters??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(Ct,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const St=[0,0],Ct=new D;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*w);c=Math.max(0,c),j(t,e,s,c,n)}const Ot=new D;function Ht(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??je,s}function Ft(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ft(e,t);if(Te(t))return fe(t,e);if(Te(e))return fe(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ft(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(Me(e))return Vt(t,e);if(xe(e))return pe(ct(e.planeLike,t.lineLike));if(ye(e))return pe(ut(t.lineLike,e.center,e.radius));if(ze(e))return pe(at(t.lineLike,e));if(Pe(e))return Yt(t,e);if(ve(e))return Bt(t,e)}else if(Me(t)){if(Le(e)||ke(e))return Ft(e,t);if(Me(e))return Kt(t,e);if(xe(e))return Qt(t,e);if(ye(e))return Wt(t,e);if(ze(e))return $t(t,e);if(Pe(e))return Xt(t,e);if(ve(e))return te(t,e)}else if(xe(t)){if(Le(e)||ke(e)||Me(e))return Ft(e,t);if(xe(e))return de(ht(t.planeLike,e.planeLike));if(ye(e))return de(tt(t.planeLike,e.center,e.radius));if(ze(e))return se(t,e);if(Pe(e))return ee(t,e);if(ve(e))return re(t,e)}else if(ye(t)){if(Le(e)||ke(e)||Me(e)||xe(e))return Ft(e,t);if(ye(e))return de(lt(K(t.center),t.radius,K(e.center),e.radius));if(ze(e))return ne();if(Pe(e))return ie(t,e);if(ve(e))return oe()}else if(ze(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e))return Ft(e,t);if(ze(e))return ce();if(Pe(e))return ce(e.asCircle());if(ve(e))return ue()}else if(Pe(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e)||ze(e))return Ft(e,t);if(Pe(e))return ae(e,t);if(ve(e))return he()}else if(ve(t)){if(Le(e)||ke(e)||Me(e)||xe(e)||ye(e)||Pe(e))return Ft(e,t);if(ve(e))return le()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(F(e,t.start,t.end))}const Jt=(()=>{const t=q(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const l=S(n),f=h*L(l,e),d=h*L(l,r);v(t,u[0],u[1],u[2],1);const p=T(n,t),m=Math.hypot(f,d),g=$(m,0);if($(I(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,l,c),M(e,e);const t=new Array,s=x(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=x(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const P=Math.atan(f/d),z=s(_)-P,q=Math.PI-z,w=new Array,j=y();a(j,u,e,h*Math.cos(z)),a(j,j,r,h*Math.sin(z)),w.push(j);const A=y();return a(A,u,e,h*Math.cos(q)),a(A,A,r,h*Math.sin(q)),w.push(A),pe(o?ft(o,w):w)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new yt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new yt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return N(n,s,t),new gt(t)}const u=W(),h=x(S(n));return a(u,s,h,i),new Pt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(lt(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(lt(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function le(t,e){}function fe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(ye(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(z(i,o,t))}else if(xe(e)||Te(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??je;n.push(z(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new Mt(e.filter(t))}function _e(t){return t instanceof Mt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function Me(t){return t instanceof Tt}function xe(t){return t instanceof wt}function ye(t){return t instanceof xt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function ve(t){return t instanceof Nt}function Te(t){return t instanceof Ut}function qe(t){return t instanceof It}function we(t){return t instanceof Zt}const je=0;export{Pt as CircleConstraint,mt as Constraint,Zt as CoordinateConstraint,Ut as DrapedLineConstraint,It as GeodesicConstraint,yt as HorizontalCircleConstraint,Tt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,Mt as SetConstraint,Nt as SphereConstraint,xt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,wt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as r}from"../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../core/handleUtils.js";import"../../../core/has.js";import{allSettledValues as n,throwIfAborted as s}from"../../../core/promiseUtils.js";import{mapCollectionAsync as i,watch as o,sync as c}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as u,getMetersPerVerticalUnitForSR as l}from"../../../core/unitUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{a as g,c as h}from"../../../chunks/vec32.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as f}from"../../../core/libs/gl-matrix-2/math/common.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as _}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as v}from"../sketch/constraints.js";import{fromAnyMapPoint as w,asVec2 as j,markAsTarget as F}from"../sketch/normalizedPoint.js";import{FeatureSnappingSourceInfo as b}from"./FeatureSnappingSourceInfo.js";import{SnappingDomain as x}from"./SnappingDomain.js";import{sortCandidatesInPlace as C,screenDistance as R}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as E}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as M}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as L}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as I,OtherVertexType as G}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as H}from"../support/viewUtils.js";let P=class extends t{get updating(){return this._snappingSources.some((e=>null==e?.valid||!0===e.valid&&!0===e.snappingSource?.updating))||this._updatingHandles.updating}constructor(e){super(e),this.options=null,this._domain=x.FEATURE,this._updatingHandles=new y,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){const e=i((()=>this.options?._effectiveFeatureSources),((e,t)=>this._createSourceInfo(e,t)));this._snappingSources=e,this.addHandles([a(e),o((()=>({rulesEnabled:!!this.options?.attributeRulesEnabled,sources:this._snappingSources.filter(r)})),(({rulesEnabled:e,sources:t})=>{for(const r of t)r.attributeRulesEnabled=e}),c)])}destroy(){this._set("options",null),this._updatingHandles.destroy()}async fetchCandidates(e,t,r,a){if(!(t&this._domain&&null!=this.options&&this.options.effectiveFeatureEnabled))return[];const i=[],o=this._computeScreenSizeDistanceParameters(e,r);for(const n of this._snappingSources){if(!n?.valid||!n.snappingSource?.layerSource?.enabled||n.layerView?.suspended)continue;const t=n.getFetchCandidatesParameters(e,r,o);for(const e of t)i.push(n.snappingSource.fetchCandidates(e,a).then((e=>e.filter((e=>!this._candidateIsExcluded(n.snappingSource,e,r.excludeFeature))))))}const c=(await n(i)).flat();return this._addRightAngleCandidates(c,e,o,r),s(a),C(e,c),c}_addRightAngleCandidates(e,t,r,a){const n=null!=a.vertexHandle?a.vertexHandle.rightEdge?.rightVertex?.pos:null!=a.editGeometryOperations&&"polygon"===a.editGeometryOperations.data.type?a.editGeometryOperations.data.components[0]?.getFirstVertex()?.pos:null,s=null!=a.vertexHandle?a.vertexHandle.leftEdge?.leftVertex?.pos:null!=a.editGeometryOperations?a.editGeometryOperations.data.components[0]?.getLastVertex()?.pos:null,{view:i}=this,o=w(n,i,a),c=w(s,i,a),u=e.length;for(let l=0;l<u;l++)this._addRightAngleCandidate(e[l],c,t,r,e),this._addRightAngleCandidate(e[l],o,t,r,e)}_addRightAngleCandidate(e,t,r,a,n){if(null==t||!A(e))return;const s=e.constraint.closestTo(t),i=(s[0]-r[0])/a.x,o=(s[1]-r[1])/a.y,{start:c,end:u}=e.constraint;if(i*i+o*o<=1){const r=m(j(s),j(c))>m(j(s),j(u))?c:u,a=new I({targetPoint:F(s),otherVertex:t,otherVertexType:G.NEXT,previousVertex:r,constraint:new v(t,s),objectId:e.objectId,isDraped:e.isDraped,domain:x.FEATURE});n.push(a)}}_computeScreenSizeDistanceParameters(e,t){let r=null!=this.options?this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1):0;return null==this.view?{x:r,y:r,z:r,distance:r}:"2d"===this.view.type?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreenSizeDistanceParameters3D(e,t,r,a){const{spatialReference:n}=a;r.renderCoordsHelper.toRenderCoords(e,n,D);const s=r.state.camera.computeScreenPixelSizeAt(D),i=s*r.renderCoordsHelper.unitInMeters,o=i/u(n),c=i/l(n),p=t*o,d=t*c,m=H(e,n,_,r),g=m?z(m,e,o,0,0,r,a):0,h=m?z(m,e,0,o,0,r,a):0,S=m?z(m,e,0,0,c,r,a):0;return{x:0===g?0:p/g,y:0===h?0:p/h,z:0===S?0:d/S,distance:s*t}}_candidateIsExcluded(e,t,r){if(null==r)return!1;const a=this._getCandidateObjectId(t);if(null==a)return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===a:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===a)}_getCandidateObjectId(e){return e instanceof L?e.objectId:null}async _createSourceInfo(e,t){const r=e.layer;r.loaded||(await r.load(),s(t));const{view:a}=this,n=await this._createFeatureSnappingSourceType(e);return s(t),new b(null==n?{}:{snappingSource:n,view:a,layer:r})}async _createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}async _createFeatureSnappingSourceSceneLayer(e){const{view:t}=this;if(null==t||"3d"!==t.type)return null;return new((await this._getSourceModule("scene")).SceneLayerSnappingSource)({layerSource:e,view:t})}async _createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source?.type){case"feature-layer":case"oriented-imagery":return new((await this._getSourceModule("featureService")).FeatureServiceSnappingSource)({spatialReference:this.spatialReference,view:this.view,layerSource:e});case"memory":case"csv":case"geojson":case"wfs":if("mesh"===e.layer.geometryType)return null;return new((await this._getSourceModule("featureCollection")).FeatureCollectionSnappingSource)({layerSource:e,view:this.view})}return null}async _createFeatureSnappingSourceGraphicsLayer(e){return new((await this._getSourceModule("graphics")).GraphicsSnappingSource)({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _createFeatureSnappingSourceMapNotesLayer(e){return new((await this._getSourceModule("notes")).GraphicsSnappingSource)({getGraphicsLayers:()=>e.layer.sublayers?.toArray()??[],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _getSourceModule(e){const t=this._sourceModules[e];if(null==t.loader){const t=this._loadSourceModule(e),r={module:null,loader:t};this._sourceModules[e]=r;const a=await t,n={module:a,loader:t};return this._sourceModules[e]=n,a}return null==t.module?t.loader:t.module}_loadSourceModule(e){const t=this._updatingHandles;switch(e){case"featureService":return t.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return t.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":case"notes":return t.addPromise(import("./featureSources/GraphicsSnappingSource.js"));case"scene":return t.addPromise(import("./featureSources/SceneLayerSnappingSource.js"))}}get test(){}};function A(e){return(e instanceof M||e instanceof E)&&!U(e)}function U({constraint:{start:e,end:t}}){const r=g(e,t),a=m(j(e),j(t));return r<f()||a/r<T}function z(e,t,r,a,n,s,{spatialReference:i}){const o=h(O,t);o[0]+=r,o[1]+=a,o[2]+=n;const c=H(o,i,_,s);return c?R(c,e):1/0}e([p({constructOnly:!0})],P.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],P.prototype,"view",void 0),e([p()],P.prototype,"options",void 0),e([p({readOnly:!0})],P.prototype,"updating",null),e([p()],P.prototype,"_snappingSources",void 0),P=e([d("esri.views.interactive.snapping.FeatureSnappingEngine")],P);const D=S(),O=S(),T=1e-4;export{P as FeatureSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as r}from"../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../core/handleUtils.js";import"../../../core/has.js";import{allSettledValues as n,throwIfAborted as s}from"../../../core/promiseUtils.js";import{mapCollectionAsync as i,watch as o,sync as c}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as u,getMetersPerVerticalUnitForSR as l}from"../../../core/unitUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{s as g,c as h}from"../../../chunks/vec32.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as f}from"../../../core/libs/gl-matrix-2/math/common.js";import{UpdatingHandles as y}from"../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as _}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as v}from"../sketch/constraints.js";import{fromAnyMapPoint as w,asVec2 as j,markAsTarget as F}from"../sketch/normalizedPoint.js";import{FeatureSnappingSourceInfo as b}from"./FeatureSnappingSourceInfo.js";import{SnappingDomain as x}from"./SnappingDomain.js";import{sortCandidatesInPlace as C,screenDistance as R}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as E}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as M}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as L}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as I,OtherVertexType as G}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as H}from"../support/viewUtils.js";let P=class extends t{get updating(){return this._snappingSources.some((e=>null==e?.valid||!0===e.valid&&!0===e.snappingSource?.updating))||this._updatingHandles.updating}constructor(e){super(e),this.options=null,this._domain=x.FEATURE,this._updatingHandles=new y,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){const e=i((()=>this.options?._effectiveFeatureSources),((e,t)=>this._createSourceInfo(e,t)));this._snappingSources=e,this.addHandles([a(e),o((()=>({rulesEnabled:!!this.options?.attributeRulesEnabled,sources:this._snappingSources.filter(r)})),(({rulesEnabled:e,sources:t})=>{for(const r of t)r.attributeRulesEnabled=e}),c)])}destroy(){this._set("options",null),this._updatingHandles.destroy()}async fetchCandidates(e,t,r,a){if(!(t&this._domain&&null!=this.options&&this.options.effectiveFeatureEnabled))return[];const i=[],o=this._computeScreenSizeDistanceParameters(e,r);for(const n of this._snappingSources){if(!n?.valid||!n.snappingSource?.layerSource?.enabled||n.layerView?.suspended)continue;const t=n.getFetchCandidatesParameters(e,r,o);for(const e of t)i.push(n.snappingSource.fetchCandidates(e,a).then((e=>e.filter((e=>!this._candidateIsExcluded(n.snappingSource,e,r.excludeFeature))))))}const c=(await n(i)).flat();return this._addRightAngleCandidates(c,e,o,r),s(a),C(e,c),c}_addRightAngleCandidates(e,t,r,a){const n=null!=a.vertexHandle?a.vertexHandle.rightEdge?.rightVertex?.pos:null!=a.editGeometryOperations&&"polygon"===a.editGeometryOperations.data.type?a.editGeometryOperations.data.components[0]?.getFirstVertex()?.pos:null,s=null!=a.vertexHandle?a.vertexHandle.leftEdge?.leftVertex?.pos:null!=a.editGeometryOperations?a.editGeometryOperations.data.components[0]?.getLastVertex()?.pos:null,{view:i}=this,o=w(n,i,a),c=w(s,i,a),u=e.length;for(let l=0;l<u;l++)this._addRightAngleCandidate(e[l],c,t,r,e),this._addRightAngleCandidate(e[l],o,t,r,e)}_addRightAngleCandidate(e,t,r,a,n){if(null==t||!A(e))return;const s=e.constraint.closestTo(t),i=(s[0]-r[0])/a.x,o=(s[1]-r[1])/a.y,{start:c,end:u}=e.constraint;if(i*i+o*o<=1){const r=m(j(s),j(c))>m(j(s),j(u))?c:u,a=new I({targetPoint:F(s),otherVertex:t,otherVertexType:G.NEXT,previousVertex:r,constraint:new v(t,s),objectId:e.objectId,isDraped:e.isDraped,domain:x.FEATURE});n.push(a)}}_computeScreenSizeDistanceParameters(e,t){let r=null!=this.options?this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1):0;return null==this.view?{x:r,y:r,z:r,distance:r}:"2d"===this.view.type?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreenSizeDistanceParameters3D(e,t,r,a){const{spatialReference:n}=a;r.renderCoordsHelper.toRenderCoords(e,n,D);const s=r.state.camera.computeScreenPixelSizeAt(D),i=s*r.renderCoordsHelper.unitInMeters,o=i/u(n),c=i/l(n),p=t*o,d=t*c,m=H(e,n,_,r),g=m?z(m,e,o,0,0,r,a):0,h=m?z(m,e,0,o,0,r,a):0,S=m?z(m,e,0,0,c,r,a):0;return{x:0===g?0:p/g,y:0===h?0:p/h,z:0===S?0:d/S,distance:s*t}}_candidateIsExcluded(e,t,r){if(null==r)return!1;const a=this._getCandidateObjectId(t);if(null==a)return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===a:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===a)}_getCandidateObjectId(e){return e instanceof L?e.objectId:null}async _createSourceInfo(e,t){const r=e.layer;r.loaded||(await r.load(),s(t));const{view:a}=this,n=await this._createFeatureSnappingSourceType(e);return s(t),new b(null==n?{}:{snappingSource:n,view:a,layer:r})}async _createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}async _createFeatureSnappingSourceSceneLayer(e){const{view:t}=this;if(null==t||"3d"!==t.type)return null;return new((await this._getSourceModule("scene")).SceneLayerSnappingSource)({layerSource:e,view:t})}async _createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source?.type){case"feature-layer":case"oriented-imagery":return new((await this._getSourceModule("featureService")).FeatureServiceSnappingSource)({spatialReference:this.spatialReference,view:this.view,layerSource:e});case"memory":case"csv":case"geojson":case"wfs":if("mesh"===e.layer.geometryType)return null;return new((await this._getSourceModule("featureCollection")).FeatureCollectionSnappingSource)({layerSource:e,view:this.view})}return null}async _createFeatureSnappingSourceGraphicsLayer(e){return new((await this._getSourceModule("graphics")).GraphicsSnappingSource)({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _createFeatureSnappingSourceMapNotesLayer(e){return new((await this._getSourceModule("notes")).GraphicsSnappingSource)({getGraphicsLayers:()=>e.layer.sublayers?.toArray()??[],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _getSourceModule(e){const t=this._sourceModules[e];if(null==t.loader){const t=this._loadSourceModule(e),r={module:null,loader:t};this._sourceModules[e]=r;const a=await t,n={module:a,loader:t};return this._sourceModules[e]=n,a}return null==t.module?t.loader:t.module}_loadSourceModule(e){const t=this._updatingHandles;switch(e){case"featureService":return t.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return t.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":case"notes":return t.addPromise(import("./featureSources/GraphicsSnappingSource.js"));case"scene":return t.addPromise(import("./featureSources/SceneLayerSnappingSource.js"))}}get test(){}};function A(e){return(e instanceof M||e instanceof E)&&!U(e)}function U({constraint:{start:e,end:t}}){const r=g(e,t),a=m(j(e),j(t));return r<f()||a/r<T}function z(e,t,r,a,n,s,{spatialReference:i}){const o=h(O,t);o[0]+=r,o[1]+=a,o[2]+=n;const c=H(o,i,_,s);return c?R(c,e):1/0}e([p({constructOnly:!0})],P.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],P.prototype,"view",void 0),e([p()],P.prototype,"options",void 0),e([p({readOnly:!0})],P.prototype,"updating",null),e([p()],P.prototype,"_snappingSources",void 0),P=e([d("esri.views.interactive.snapping.FeatureSnappingEngine")],P);const D=S(),O=S(),T=1e-4;export{P as FeatureSnappingEngine};