@arcgis/core 5.0.0-next.32 → 5.0.0-next.34

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 (285) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{9252854b512237b6a0ef.js → 0446562aee0639c61485.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 1fa55d4c4b092a98bdd7.js} +1 -1
  4. package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +1 -0
  5. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +1 -0
  6. package/assets/esri/core/workers/chunks/{e7f4d135ef9665de1468.js → 33431e8131f6017de2f9.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{1dfca37f95f2b968aa54.js → 39d2b540738431adec98.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{096e5f94eaa226814569.js → 4356274cfa477eb6d749.js} +1 -1
  9. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +1 -0
  10. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +1 -0
  11. package/assets/esri/core/workers/chunks/{25fd0884dd14973c89f5.js → 486e69261aa2caf9ec3c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{3c1e50c3505e5e7c946a.js → 4d5591c1b4ef37075921.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +1 -0
  14. package/assets/esri/core/workers/chunks/52ecbaa2d32692d6d8df.js +1 -0
  15. package/assets/esri/core/workers/chunks/{3777b41b4fa2f1418402.js → 55818fe7a7aa1e5c8bbd.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{d21ae4980741be98f948.js → 59889855d23baec1adf9.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7e6fae3660e7a6a0fa16.js → 5f781ef46ce7c4048c2f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/5f9e64f00329cb646f0c.js +1 -0
  19. package/assets/esri/core/workers/chunks/61cb30e2e8edd18ebbf0.js +1 -0
  20. package/assets/esri/core/workers/chunks/63933cbcb5c12df09715.js +1 -0
  21. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +1 -0
  22. package/assets/esri/core/workers/chunks/{e6df4327ac1d9b65b80d.js → 71dd80231ea656a6380c.js} +1 -1
  23. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +1 -0
  24. package/assets/esri/core/workers/chunks/{d786b17cc9062b1450ac.js → 726a797f5df7eeee0b3d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +1 -0
  26. package/assets/esri/core/workers/chunks/{bd58c027408dc858f23c.js → 77b45957cfe42523c1c8.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{a2cee5ac0d4df0108425.js → 82cc758bddd9f8397b9f.js} +1 -1
  28. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +1 -0
  29. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +1 -0
  30. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +1 -0
  31. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +1 -0
  32. package/assets/esri/core/workers/chunks/{433d249c35c56bf15806.js → 97650ee3d0eecb69ccbb.js} +3 -3
  33. package/assets/esri/core/workers/chunks/{add17e95f47e6904bf6d.js → a59dab47a58695c639da.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → abb05a903440d97a6a74.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{3bacd904cd93c8013f6a.js → ae793d814cf32db9fbde.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{e0b70652da4a7f672cfc.js → b21cf62652ca772108c8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{5baef729beef0199c3d9.js → b536fdb655ad293d9024.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → c7c721de93bc8688e13c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +1 -0
  40. package/assets/esri/core/workers/chunks/c8d2cce4a426c72ab173.js +1 -0
  41. package/assets/esri/core/workers/chunks/c9c2e00fed979c21e2f0.js +1 -0
  42. package/assets/esri/core/workers/chunks/{94005916d321c879bea1.js → cb500d673ca7ec1ef945.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{14feb12826e0c8ba7fb8.js → d14bd320f72d8e8a0ad8.js} +1 -1
  44. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +1 -0
  45. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  46. package/assets/esri/core/workers/chunks/d6d03f22c91f528b97e5.js +1 -0
  47. package/assets/esri/core/workers/chunks/{4ab89c990a82c745c0fd.js → d764b6273974f4bca31b.js} +1 -1
  48. package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +1 -0
  49. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +1 -0
  50. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → dd34d56caafa38d4b8e4.js} +1 -1
  51. package/assets/esri/core/workers/chunks/df458ad51be27df3d79d.js +1 -0
  52. package/assets/esri/core/workers/chunks/{01b8e680befff83e7d3e.js → e093e745708f722bc1b9.js} +1 -1
  53. package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +1 -0
  54. package/assets/esri/core/workers/chunks/ea5bf896acfcc3106bf5.js +1 -0
  55. package/assets/esri/core/workers/chunks/{a74e6d505a55ed27f004.js → f11453f24c0b728669d2.js} +1 -1
  56. package/assets/esri/core/workers/chunks/f2ebd6471e1259a6eac0.js +1 -0
  57. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +1 -0
  58. package/assets/esri/core/workers/chunks/{2a17991923abc64c84c6.js → f55328aabf84770c8e6a.js} +1 -1
  59. package/assets/esri/core/workers/chunks/fa01d1813fa78034526e.js +1 -0
  60. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  61. package/chunks/ComponentShader.glsl.js +19 -21
  62. package/chunks/Envelope.js +1 -1
  63. package/chunks/GaussianSplat.glsl.js +2 -2
  64. package/chunks/Geometry.js +1 -1
  65. package/chunks/GlowComposition.glsl.js +5 -5
  66. package/chunks/Laserlines.glsl.js +1 -1
  67. package/chunks/MultiPathImpl.js +1 -1
  68. package/chunks/Point2D.js +1 -1
  69. package/chunks/Terrain.glsl.js +9 -11
  70. package/chunks/UnitFactory.js +1 -1
  71. package/chunks/boundedPlane.js +1 -1
  72. package/chunks/cameraUtilsSpherical.js +1 -1
  73. package/chunks/lyr3DMain.js +1 -1
  74. package/chunks/vec32.js +1 -1
  75. package/config.js +1 -1
  76. package/core/deprecate.js +1 -1
  77. package/core/has.js +1 -1
  78. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  79. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  80. package/geometry/SpatialReference.js +1 -1
  81. package/geometry/operators/integrateOperator.js +1 -1
  82. package/geometry/operators/support/apiConverter.js +1 -1
  83. package/geometry/operators/support/jsonConverter.js +1 -1
  84. package/geometry/support/lineSegment.js +1 -1
  85. package/geometry/support/meshUtils/merge.js +1 -1
  86. package/geometry/support/spatialReferenceUtils.js +1 -1
  87. package/geometry/support/sphere.js +1 -1
  88. package/interfaces.d.ts +522 -5
  89. package/intl/locale.js +1 -1
  90. package/kernel.js +1 -1
  91. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  92. package/layers/VoxelWasmPerSceneView.js +1 -1
  93. package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
  94. package/layers/graphics/data/AttributesBuilder.js +1 -1
  95. package/layers/graphics/data/QueryEngineResult.js +1 -1
  96. package/layers/mixins/ArcGISImageService.js +1 -1
  97. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  98. package/layers/support/layerOriginUtils.js +1 -1
  99. package/layers/voxel/VoxelVolume.js +1 -1
  100. package/package.json +3 -3
  101. package/portal/schemas/definitions.js +1 -1
  102. package/request/config.js +1 -1
  103. package/request/process.js +1 -1
  104. package/rest/query/operations/query.js +1 -1
  105. package/rest/support/LocateSetting.d.ts +4 -0
  106. package/rest/support/LocateSetting.js +5 -0
  107. package/rest/support/LocateSettingBase.d.ts +4 -0
  108. package/rest/support/LocateSettingBase.js +5 -0
  109. package/rest/support/LocateSettingSource.d.ts +4 -0
  110. package/rest/support/LocateSettingSource.js +5 -0
  111. package/rest/support/LocateSettings.d.ts +4 -0
  112. package/rest/support/LocateSettings.js +5 -0
  113. package/rest/support/LocateSettingsOverrides.d.ts +4 -0
  114. package/rest/support/LocateSettingsOverrides.js +5 -0
  115. package/rest/support/RouteParameters.js +1 -1
  116. package/statistics/utils.js +1 -1
  117. package/support/revision.js +1 -1
  118. package/views/3d/GroundView3D.js +1 -1
  119. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  120. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  121. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  122. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  123. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  124. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  125. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  126. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  127. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  128. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  129. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  130. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  131. package/views/3d/camera/constraintUtils/distance.js +1 -1
  132. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  133. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  134. package/views/3d/environment/CloudsParameters.js +1 -1
  135. package/views/3d/environment/EnvironmentManager.js +1 -1
  136. package/views/3d/environment/MarsAtmosphere.js +1 -1
  137. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  138. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  139. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  140. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  141. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  142. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  143. package/views/3d/layers/I3SMeshView3D.js +1 -1
  144. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  145. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  146. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  147. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  148. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  149. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  150. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  151. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  152. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  153. package/views/3d/state/ConstraintsManager.js +1 -1
  154. package/views/3d/state/Frustum.js +1 -1
  155. package/views/3d/state/NearFarHeuristic.js +1 -1
  156. package/views/3d/state/controllers/FovController.js +1 -1
  157. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  158. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  159. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  160. package/views/3d/support/CombinedElevationProvider.js +1 -1
  161. package/views/3d/support/ElevationRange.js +1 -1
  162. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  163. package/views/3d/support/cameraUtils.js +1 -1
  164. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  165. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +5 -0
  166. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +5 -0
  167. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  168. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  169. package/views/3d/support/intersectionUtils.js +1 -1
  170. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  171. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  172. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  173. package/views/3d/support/viewpointUtils.js +1 -1
  174. package/views/3d/terrain/ElevationBounds.js +1 -1
  175. package/views/3d/terrain/ElevationData.js +1 -1
  176. package/views/3d/terrain/OverlayManager.js +1 -1
  177. package/views/3d/terrain/PatchRenderData.js +1 -1
  178. package/views/3d/terrain/SphericalPatch.js +1 -1
  179. package/views/3d/terrain/TerrainSurface.js +1 -1
  180. package/views/3d/terrain/Tile.js +1 -1
  181. package/views/3d/webgl/RenderCamera.js +1 -1
  182. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  183. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  184. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +57 -0
  185. package/views/3d/webgl-engine/collections/Component/Material/ComponentDataConstants.js +5 -0
  186. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +5 -0
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/Material/{shader/DecodeSymbolColor.glsl.js → DecodeSymbolColor.glsl.js} +1 -1
  191. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  192. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -13
  193. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +7 -1
  194. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
  195. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  196. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  197. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  198. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  199. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  200. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  201. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  202. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  203. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  204. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  205. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  206. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  207. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  208. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  209. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  210. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  211. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  212. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  213. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  214. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  219. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  220. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  221. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  222. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +24 -31
  223. package/views/Attribution.js +1 -1
  224. package/views/DOMContainer.js +1 -1
  225. package/views/SelectionManager.js +1 -1
  226. package/views/View.js +1 -1
  227. package/views/interactive/GraphicManipulator.js +1 -1
  228. package/views/interactive/SegmentLabels.js +1 -1
  229. package/views/interactive/coordinateHelper.js +1 -1
  230. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  231. package/views/interactive/sketch/constraints.js +1 -1
  232. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  233. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  234. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  235. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  236. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  237. package/views/support/GroundElevationSampler.js +1 -1
  238. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  239. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  240. package/views/support/geometry3dUtils.js +1 -1
  241. package/views/support/selectionUtils.js +1 -1
  242. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  243. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  244. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  245. package/widgets/BuildingExplorer.js +1 -1
  246. package/widgets/Editor/EditorViewModel.js +1 -1
  247. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  248. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  249. package/widgets/ShadowCast/DiscreteOptions.js +1 -1
  250. package/widgets/ShadowCast/DurationOptions.js +1 -1
  251. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  252. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  253. package/widgets/ShadowCast.js +1 -1
  254. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  255. package/assets/esri/core/workers/chunks/0a1df5a724fe253b3866.js +0 -1
  256. package/assets/esri/core/workers/chunks/155d74b9c0ef31dc2316.js +0 -1
  257. package/assets/esri/core/workers/chunks/2c8c48433b380da59831.js +0 -1
  258. package/assets/esri/core/workers/chunks/31b5747a254d13acc58e.js +0 -1
  259. package/assets/esri/core/workers/chunks/3ac84e324d212815e252.js +0 -1
  260. package/assets/esri/core/workers/chunks/41a00c77e6f7ce61e476.js +0 -1
  261. package/assets/esri/core/workers/chunks/45729d006db6a569715f.js +0 -1
  262. package/assets/esri/core/workers/chunks/50cf3cbcad2be1c1e210.js +0 -1
  263. package/assets/esri/core/workers/chunks/565358ea8d1bdc4d1ebc.js +0 -1
  264. package/assets/esri/core/workers/chunks/592afe1a41bed3b0cc31.js +0 -1
  265. package/assets/esri/core/workers/chunks/5aeda8a1f2ccabfdf40f.js +0 -1
  266. package/assets/esri/core/workers/chunks/657d9e5145da1306ace8.js +0 -1
  267. package/assets/esri/core/workers/chunks/7f7a81ed8893ab649af7.js +0 -1
  268. package/assets/esri/core/workers/chunks/7ffef8a19166f6b564d8.js +0 -1
  269. package/assets/esri/core/workers/chunks/819781a209608dcdd678.js +0 -1
  270. package/assets/esri/core/workers/chunks/8d57e3a0e5687ce15557.js +0 -1
  271. package/assets/esri/core/workers/chunks/8e9a5d38da40702def80.js +0 -1
  272. package/assets/esri/core/workers/chunks/aac313257a8b1ae75b75.js +0 -1
  273. package/assets/esri/core/workers/chunks/be06c8a58c217a17451b.js +0 -1
  274. package/assets/esri/core/workers/chunks/d56548a994753b08403c.js +0 -1
  275. package/assets/esri/core/workers/chunks/dd95e679618b7b21a7b1.js +0 -1
  276. package/assets/esri/core/workers/chunks/e08a1934d98e7324776d.js +0 -1
  277. package/assets/esri/core/workers/chunks/e5deb72df8b2505fd325.js +0 -1
  278. package/assets/esri/core/workers/chunks/e689a4849f5af3f2f641.js +0 -1
  279. package/assets/esri/core/workers/chunks/f259ad785ce3aa970792.js +0 -1
  280. package/assets/esri/core/workers/chunks/f3127bdf28a1d9b8db27.js +0 -1
  281. package/assets/esri/core/workers/chunks/f4919950a9a3703d9da3.js +0 -1
  282. package/assets/esri/core/workers/chunks/f6ce485c082d0d640b01.js +0 -1
  283. package/assets/esri/core/workers/chunks/fd9ef4b8c969962cf72b.js +0 -1
  284. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +0 -57
  285. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,watch as h,initial as l,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as _}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as g}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as w}from"../../environment/CloudsComposition.js";import{Fog as x}from"../../environment/Fog.js";import{LocalAtmosphere as v}from"../../environment/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as j}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as R}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ObjectAndLayerIDRenderNode as C}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as A}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as O}from"../effects/glow/GlowRenderNode.js";import{Haze as S}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as U}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as M}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as L}from"../effects/ssao/SSAO.js";import{Stars as D}from"../effects/stars/Stars.js";import H from"../lib/CompositingHelper.js";import{GLMaterialRepository as F}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as W}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as B}from"../lib/Renderer.js";import{RenderingContext as E}from"../lib/RenderingContext.js";import{RenderingContextOptions as N}from"../lib/RenderingContextOptions.js";import{TextureRepository as z}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as G}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as P}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as I}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as V}from"./contextCache.js";import{removeLoadedShaderModules as X}from"./renderUtils.js";import{ScreenshotManager as Q,ScreenshotContext as J}from"./ScreenshotManager.js";import{contextCache as K}from"./testUtils.js";import{noBudget as Y}from"../../../support/Scheduler.js";import{checkWebGLError as Z}from"../../../webgl/checkWebGLError.js";let $=class extends t{constructor(e,t){super(e),this._waterTextures=new I,this.olidRenderHelper=T()?new W:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=P(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=G(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new b(new R(this._rctx,t.viewingMode,t.sphericalSpatialReference,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new z(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const i=new F(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new H(this._rctx,this._techniques),this._renderer=new B(t,i,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),l),h(()=>this.waterTextures?.updating,()=>this.requestRender(),l),h(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),p)]);const s={renderScene:(e,t,r,i)=>this.renderer.render(e,t,r,i),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new Q(this._rctx,s,e=>t.view.overlayManager.updateOverlays(Y,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjectCollection=o(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=o(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new D({view:e}),f(e.spatialReference)||(2===t?(new v({view:e}),this.glow=new O({view:e})):_(e.spatialReference)?(new y({view:e}),this.glow=new O({view:e})):(new g({view:e}),new w({view:e}),this.glow=new O({view:e}),new S({view:e}),this.fog=new x({view:e}))),new L({view:e,isEnabled:()=>this.renderer.hasSSAO}),new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new M({view:e}),new q({view:e}),new U({view:e,viewingMode:t}),new A({view:e}),T()&&new C({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,s,n,o=n){const a=s.constrainWindowSize(t,r,n*s.pixelRatio,o*s.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>i(t,e)*(r[1]-r[0])+r[0];let p=Number.MAX_VALUE;for(let i=0;i<a[2]*a[3];i++){const e=l(4*i,h,s.nearFar);p>e&&e!==s.nearFar[0]&&e!==s.nearFar[1]&&(p=e)}if(e){const i=e.pickDepth(t*s.pixelRatio,r*s.pixelRatio,s);null!=i&&p>i&&i!==s.nearFar[0]&&i!==s.nearFar[1]&&(p=i)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){X(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=c(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),s=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this._textures.update();const r=new J(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=d(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");Z(n,!0),this._rctx=ee(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new j(this.renderer.renderPassManager,this._viewingMode,this.stage.sphericalSpatialReference)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=c(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function ee(e,t){const r=new N(t);if(K.enabled){let t=te.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new E(e,r),te.set(e,t),t.ref(),t)}return new E(e,r)}e([m({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([m({constructOnly:!0})],$.prototype,"view",void 0),e([m({readOnly:!0})],$.prototype,"stippleTextures",null),e([m({readOnly:!0})],$.prototype,"markerTextures",null),e([m({readOnly:!0})],$.prototype,"waterTextures",null),e([m({readOnly:!0})],$.prototype,"olidRenderHelper",void 0),e([m()],$.prototype,"_textures",void 0),e([m({readOnly:!0})],$.prototype,"renderer",null),e([m()],$.prototype,"_screenshotManager",void 0),e([m()],$.prototype,"componentObjectCollection",null),e([m()],$.prototype,"_componentObjectCollection",void 0),e([m()],$.prototype,"_needsUpdate",void 0),e([m()],$.prototype,"_needsWaterReflectionUpdate",void 0),$=e([u("esri.views.3d.webgl-engine.parts.RenderView")],$);const te=V();export{$ as RenderView};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,watch as h,initial as l,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as _}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as g}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as w}from"../../environment/CloudsComposition.js";import{Fog as x}from"../../environment/Fog.js";import{LocalAtmosphere as v}from"../../environment/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as j}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as R}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ObjectAndLayerIDRenderNode as C}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as A}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as O}from"../effects/glow/GlowRenderNode.js";import{Haze as S}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as U}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as M}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as L}from"../effects/ssao/SSAO.js";import{Stars as D}from"../effects/stars/Stars.js";import H from"../lib/CompositingHelper.js";import{GLMaterialRepository as F}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as W}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as B}from"../lib/Renderer.js";import{RenderingContext as E}from"../lib/RenderingContext.js";import{RenderingContextOptions as N}from"../lib/RenderingContextOptions.js";import{TextureRepository as z}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as G}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as P}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as I}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as V}from"./contextCache.js";import{removeLoadedShaderModules as X}from"./renderUtils.js";import{ScreenshotManager as Q,ScreenshotContext as J}from"./ScreenshotManager.js";import{contextCache as K}from"./testUtils.js";import{noBudget as Y}from"../../../support/Scheduler.js";import{checkWebGLError as Z}from"../../../webgl/checkWebGLError.js";let $=class extends t{constructor(e,t){super(e),this._waterTextures=new I,this.olidRenderHelper=T()?new W:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=P(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=G(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new b(new R(this._rctx,t.viewingMode,t.sphericalSpatialReference,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new z(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const i=new F(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new H(this._rctx,this._techniques),this._renderer=new B(t,i,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),l),h(()=>this.waterTextures?.updating,()=>this.requestRender(),l),h(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),p)]);const s={renderScene:(e,t,r,i)=>this.renderer.render(e,t,r,i),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new Q(this._rctx,s,e=>t.view.overlayManager.updateOverlays(Y,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjectCollection=o(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=o(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new D({view:e}),f(e.spatialReference)||(2===t?(new v({view:e}),this.glow=new O({view:e})):_(e.spatialReference)?(new y({view:e}),this.glow=new O({view:e})):(new g({view:e}),new w({view:e}),this.glow=new O({view:e}),new S({view:e}),this.fog=new x({view:e}))),new L({view:e,isEnabled:()=>this.renderer.hasSSAO}),new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new M({view:e}),new q({view:e}),new U({view:e,viewingMode:t}),new A({view:e}),T()&&new C({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,s,n,o=n){const a=s.constrainWindowSize(t,r,n*s.pixelRatio,o*s.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>i(t,e)*(r[1]-r[0])+r[0];let p=Number.MAX_VALUE;for(let i=0;i<a[2]*a[3];i++){const e=l(4*i,h,s.nearFar);p>e&&e!==s.nearFar[0]&&e!==s.nearFar[1]&&(p=e)}if(e){const i=e.pickDepth(t*s.pixelRatio,r*s.pixelRatio,s);null!=i&&p>i&&i!==s.nearFar[0]&&i!==s.nearFar[1]&&(p=i)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){X(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=c(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),s=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this._textures.update();const r=new J(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=d(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");Z(n,!0),this._rctx=ee(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new j(this.renderer.renderPassManager,this._viewingMode,this.stage.sphericalSpatialReference)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=c(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function ee(e,t){const r=new N(t);if(K.enabled){let t=te.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new E(e,r),te.set(e,t),t.ref(),t)}return new E(e,r)}e([m({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([m({constructOnly:!0})],$.prototype,"view",void 0),e([m({readOnly:!0})],$.prototype,"stippleTextures",null),e([m({readOnly:!0})],$.prototype,"markerTextures",null),e([m({readOnly:!0})],$.prototype,"waterTextures",null),e([m({readOnly:!0})],$.prototype,"olidRenderHelper",void 0),e([m()],$.prototype,"_textures",void 0),e([m({readOnly:!0})],$.prototype,"renderer",null),e([m()],$.prototype,"_screenshotManager",void 0),e([m()],$.prototype,"componentObjectCollection",null),e([m()],$.prototype,"_componentObjectCollection",void 0),e([m()],$.prototype,"_needsUpdate",void 0),e([m()],$.prototype,"_needsWaterReflectionUpdate",void 0),$=e([u("esri.views.3d.webgl-engine.parts.RenderView")],$);const te=V();export{$ as RenderView};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class o extends e{constructor(t=!1){super(),this.alphaCutoff=1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.depthPass=t}}function s(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([r({count:3})],o.prototype,"alphaCutoff",void 0),t([r()],o.prototype,"terrainDepthTest",void 0),t([r()],o.prototype,"cullAboveTerrain",void 0);export{o as GaussianSplatTechniqueConfiguration,s as getGaussianSplatAlphaCutoffValue};
5
+ import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(t=!1){super(),this.alphaCutoff=1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.fadingEnabled=!1,this.occlusionPass=!1,this.depthPass=t}}function i(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([o({count:3})],r.prototype,"alphaCutoff",void 0),t([o()],r.prototype,"terrainDepthTest",void 0),t([o()],r.prototype,"cullAboveTerrain",void 0),t([o()],r.prototype,"fadingEnabled",void 0);export{r as GaussianSplatTechniqueConfiguration,i as getGaussianSplatAlphaCutoffValue};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{smoothstep as e}from"../../../../core/mathUtils.js";import{E as r}from"../../../../chunks/vec32.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as a}from"../core/shaderModules/Float3BindUniform.js";import{Float4BindUniform as o}from"../core/shaderModules/Float4BindUniform.js";import{glsl as s}from"../core/shaderModules/glsl.js";import{SphereIntersect as n}from"./SphereIntersect.glsl.js";function i(i,h){i.fragment.uniforms.add(new o("heightParameters",a=>{const o=a.camera,s=r(o.eye),n=Math.sqrt(s),i=h.radius,l=s-i*i;let m=e(4e6,5e6,n-i);return m=Math.min(m,.98),t(m,l,0,0)}),new a("cameraPosition",e=>e.camera.eye)),i.fragment.include(n),i.fragment.code.add(s`float sphereFade() {return heightParameters[0];}
5
+ import{smoothstep as e}from"../../../../core/mathUtils.js";import{F as r}from"../../../../chunks/vec32.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as a}from"../core/shaderModules/Float3BindUniform.js";import{Float4BindUniform as o}from"../core/shaderModules/Float4BindUniform.js";import{glsl as s}from"../core/shaderModules/glsl.js";import{SphereIntersect as n}from"./SphereIntersect.glsl.js";function i(i,h){i.fragment.uniforms.add(new o("heightParameters",a=>{const o=a.camera,s=r(o.eye),n=Math.sqrt(s),i=h.radius,l=s-i*i;let m=e(4e6,5e6,n-i);return m=Math.min(m,.98),t(m,l,0,0)}),new a("cameraPosition",e=>e.camera.eye)),i.fragment.include(n),i.fragment.code.add(s`float sphereFade() {return heightParameters[0];}
6
6
  float sphereDepthInterpolate(vec3 worldRay, vec3 viewRay, float currentLinearDepth) {
7
7
  vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, worldRay, heightParameters[1]);
8
8
  bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 0.0;
@@ -2,16 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{maxElevationOffset as o}from"../../../collections/Component/Material/shader/ComponentData.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{RgbaFloatEncoding as t}from"../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3DrawUniform as a}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as l}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as n}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as d}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as m}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as s}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DDrawUniform as i}from"../../../core/shaderModules/Texture2DDrawUniform.js";function c(c,f){const{vertex:v}=c;v.include(t),c.include(e,f);const{silhouette:u,legacy:x,spherical:p}=f;v.uniforms.add(new i("componentDataTex",o=>o.componentDataTexture)),c.attributes.add("componentIndex","float");const w=0,F=1,h=2,M=3,T=8,P=128;v.constants.add("lineWidthFractionFactor","float",8),v.constants.add("extensionLengthOffset","float",128),v.code.add(n`
6
- vec2 _componentTextureCoords(float componentIndex, float fieldOffset) {
7
- float fieldIndex = ${n.float(M)} * componentIndex + fieldOffset;
8
- float texSize = float(textureSize(componentDataTex, 0).x);
9
- float colIndex = mod(fieldIndex, texSize);
10
- float rowIndex = floor(fieldIndex / texSize);
11
-
12
- return vec2(colIndex, rowIndex) + 0.5;
13
- }
14
-
5
+ import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{RgbaFloatEncoding as t}from"../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3DrawUniform as a}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as l}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as n}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as d}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as m}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as i}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DDrawUniform as s}from"../../../core/shaderModules/Texture2DDrawUniform.js";import{edgeViewTextureLayout as c}from"../../../lib/edgeRendering/bufferLayouts.js";const f=new o(c,"componentIndex",new s("componentDataTex",o=>o.componentDataTexture));function v(o,s){const{vertex:c}=o;c.include(t),o.include(e,s);const{silhouette:v,legacy:u,spherical:w}=s;o.attributes.add("componentIndex","float");const{getTextureAttribute:p,TextureBackedBufferModule:F}=f;o.include(F);const M=8,h=128;c.constants.add("lineWidthFractionFactor","float",M),c.constants.add("extensionLengthOffset","float",h),c.code.add(n`
15
6
  struct ComponentData {
16
7
  vec4 color;
17
8
  vec3 normal;
@@ -23,40 +14,42 @@ import{maxElevationOffset as o}from"../../../collections/Component/Material/shad
23
14
  };
24
15
 
25
16
  ComponentData readComponentData() {
26
- vec2 colorIndex = _componentTextureCoords(componentIndex, ${n.float(w)});
27
- vec2 otherIndex = _componentTextureCoords(componentIndex, ${n.float(F)});
28
- vec2 verticalOffsetIndex = _componentTextureCoords(float(componentIndex), ${n.float(h)} );
29
17
  vec3 normal = normalModel();
30
- vec3 normal2 = ${u?n`decompressNormal(normal2Compressed)`:n`normal`};
18
+ vec3 normal2 = ${v?n`decompressNormal(normal2Compressed)`:n`normal`};
19
+
20
+ vec4 colorValue = ${p("color")};
21
+ float lineWidth = ${p("lineWidth")} * (255.0 / lineWidthFractionFactor);
22
+ float extensionLength = ${p("extensionLength")} * 255.0 - extensionLengthOffset;
23
+ // SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0;
24
+ float type = -(${p("materialType")} * 255.0) + 0.5;
25
+ float opacity = ${p("opacity")};
31
26
 
32
- vec4 colorValue = texelFetch(componentDataTex, ivec2(colorIndex), 0);
33
- vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0);
34
- float verticalOffset = uninterpolatedRGBAToFloat(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) * ${n.float(o)};
27
+ float verticalOffset = ${p("elevationOffset")};
35
28
 
36
29
  return ComponentData(
37
- vec4(colorValue.rgb, colorValue.a * otherValue.w), // otherValue.w stores separate opacity
30
+ vec4(colorValue.rgb, colorValue.a * opacity),
38
31
  normal, normal2,
39
- otherValue.x * (255.0 / ${n.float(T)} ),
40
- otherValue.y * 255.0 - ${n.float(P)},
41
- -(otherValue.z * 255.0) + 0.5, // SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0;
32
+ lineWidth,
33
+ extensionLength,
34
+ type,
42
35
  verticalOffset
43
36
  );
44
37
  }
45
- `),x?v.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
38
+ `),u?c.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
46
39
  return (model * vec4(normal, 0.0)).xyz;
47
40
  }
48
41
  vec3 _modelToViewNormal(vec3 normal) {
49
42
  return (localView * model * vec4(normal, 0.0)).xyz;
50
- }`):(v.uniforms.add(new d("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),v.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
43
+ }`):(c.uniforms.add(new d("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),c.code.add(n`vec3 _modelToWorldNormal(vec3 normal) {
51
44
  return transformNormalGlobalFromModel * normal;
52
- }`)),u?(c.attributes.add("normal2Compressed","vec2"),v.code.add(n`vec3 worldNormal(ComponentData data) {
45
+ }`)),v?(o.attributes.add("normal2Compressed","vec2"),c.code.add(n`vec3 worldNormal(ComponentData data) {
53
46
  return _modelToWorldNormal(normalize(data.normal + data.normal2));
54
- }`)):v.code.add(n`vec3 worldNormal(ComponentData data) {
47
+ }`)):c.code.add(n`vec3 worldNormal(ComponentData data) {
55
48
  return _modelToWorldNormal(data.normal);
56
- }`),x?v.code.add(n`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
49
+ }`),u?c.code.add(n`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
57
50
  worldPos = (model * vec4(modelPos, 1.0)).xyz;
58
51
  viewPos = (localView * vec4(worldPos, 1.0)).xyz;
59
- }`):(v.include(r,f),v.uniforms.add(new m("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new d("transformWorldFromModelRS",o=>o.transformWorldFromModelRS),new a("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new a("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new l("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new l("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),v.code.add(n`
52
+ }`):(c.include(r,s),c.uniforms.add(new m("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new d("transformWorldFromModelRS",o=>o.transformWorldFromModelRS),new a("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new a("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new l("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new l("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),c.code.add(n`
60
53
  void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
61
54
  vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos;
62
55
 
@@ -70,14 +63,14 @@ viewPos = (localView * vec4(worldPos, 1.0)).xyz;
70
63
  worldPos = transformCameraRelativeFromModel + rotatedModelPosition;
71
64
 
72
65
  if (verticalOffset != 0.0) {
73
- vec3 vUp = ${p?"normalize(transformWorldFromModelTL + rotatedModelPosition);":"vec3(0.0, 0.0, 1.0);"}
66
+ vec3 vUp = ${w?"normalize(transformWorldFromModelTL + rotatedModelPosition);":"vec3(0.0, 0.0, 1.0);"}
74
67
  worldPos += verticalOffset * vUp;
75
68
  }
76
69
 
77
70
  viewPos = transformViewFromCameraRelativeRS * worldPos;
78
71
  }
79
- `)),v.uniforms.add(new s("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(n`vec4 projFromViewPosition(vec3 position) {
72
+ `)),c.uniforms.add(new i("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(n`vec4 projFromViewPosition(vec3 position) {
80
73
  return transformProjFromView * vec4(position, 1.0);
81
- }`),v.code.add(n`float calculateExtensionLength(float extensionLength, float lineLength) {
74
+ }`),c.code.add(n`float calculateExtensionLength(float extensionLength, float lineLength) {
82
75
  return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
83
- }`)}function f(o){return 1===o||2===o}export{c as EdgeUtil,f as usesSketchLogic};
76
+ }`)}function u(o){return 1===o||2===o}export{v as EdgeUtil,u as usesSketchLogic};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o}from"../core/reactiveUtils.js";import{addFrameTask as r}from"../core/scheduling.js";import{property as n,subclass as a}from"../core/accessorSupport/decorators.js";import{setCalciteModeClass as c}from"../support/modeUtils.js";import{globalCss as h}from"../widgets/support/globalCss.js";const d="esri-attribution",l={poweredBy:`${d}__powered-by`,sources:`${d}__sources`,sourcesOpen:`${d}__sources--open`,link:`${d}__link`};let u=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=r({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}initialize(){const e=document.createElement("div");c(e),e.classList.add("esri-view-attribution"),e.classList.add("esri-attribution"),this._set("surface",e),e.innerHTML=`\n <div class="${l.sources}" dir="ltr"></div>\n <div class="${l.poweredBy}">\n Powered by\n <a class="${l.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"))]);const t=e.querySelector(`.${l.sources}`);this._previousSourceHeight=t.clientHeight;const r=new ResizeObserver(()=>{this._invalidate("overflow")});r.observe(t),this.addHandles(s(()=>r.disconnect()));const n=new MutationObserver(()=>{this._invalidate("overflow")});n.observe(t,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>n.disconnect())),t.onclick=this._toggleState,t.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${l.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(h.interactive,t),e.classList.toggle(l.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerText=this.attributionItems?.map(e=>e.text).join(" | ")??"")}};e([n()],u.prototype,"attributionItems",void 0),e([n({readOnly:!0})],u.prototype,"surface",void 0),u=e([a("esri.views.Attribution")],u);export{u as Attribution};
5
+ import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as a,subclass as c}from"../core/accessorSupport/decorators.js";import{setCalciteModeClass as h}from"../support/modeUtils.js";import{globalCss as d}from"../widgets/support/globalCss.js";const l="esri-attribution",u={poweredBy:`${l}__powered-by`,sources:`${l}__sources`,sourcesOpen:`${l}__sources--open`,link:`${l}__link`};let p=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=n({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}initialize(){const e=document.createElement("div");h(e),e.setAttribute("dir","ltr"),e.classList.add("esri-view-attribution"),e.classList.add("esri-attribution"),this._set("surface",e),e.innerHTML=`\n <div class="${u.sources}"></div>\n <div class="${u.poweredBy}">\n Powered by\n <a class="${u.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"),r)]);const t=e.querySelector(`.${u.sources}`);this._previousSourceHeight=t.clientHeight;const n=new ResizeObserver(()=>{this._invalidate("overflow")});n.observe(t),this.addHandles(s(()=>n.disconnect()));const a=new MutationObserver(()=>{this._invalidate("overflow")});a.observe(t,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>a.disconnect())),t.onclick=this._toggleState,t.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${u.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(d.interactive,t),e.classList.toggle(u.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerText=this.attributionItems?.map(e=>e.text).join(" | ")??"")}};e([a()],p.prototype,"attributionItems",void 0),e([a({readOnly:!0})],p.prototype,"surface",void 0),p=e([c("esri.views.Attribution")],p);export{p as Attribution};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as u,subclass as c}from"../core/accessorSupport/decorators.js";import{Attribution as p}from"./Attribution.js";import m from"./overlay/ViewOverlay.js";const f=[0,0];function _(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return f[0]=i.left+(e?.pageXOffset??0),f[1]=i.top+(e?.pageYOffset??0),f}function y(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const g=16,v=750,b=512,w=2,C=f=>{const C=f;let H=class extends C{constructor(...t){super(...t),this._freqInfo={freq:g,time:v},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),l),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused")),h(()=>this.attributionItems,t=>{this._attribution&&(this._attribution.attributionItems=t)}),h(()=>this.attributionVisible,t=>{t?!this._attribution&&t&&(this._attribution=new p({attributionItems:this.attributionItems}),this.root&&this.root.appendChild(this._attribution.surface)):this._attribution=o(this._attribution)},l)])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(y(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),y(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",i(r,l),r.appendChild(l),this._set("userContent",l);const u=document.createElement("div");u.className="esri-view-root",r.insertBefore(u,r.firstChild),this._set("root",u);const c=document.createElement("div");c.className="esri-view-surface",c.setAttribute("role","application"),c.tabIndex=0,u.appendChild(c),this._set("surface",c);const f=new m;u.appendChild(f.surface),this._set("overlay",f),this.addHandles(h(()=>f.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=d({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}));const _=new p({attributionItems:this.attributionItems});u.appendChild(_.surface),this._attribution=_,this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},l),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=g,t.time=v;const e=d({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=g,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?g:Math.min(v,s.freq*w),!i&&s.freq>=b&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=g,t.time=v,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=g,t.time=v,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&_(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([u()],H.prototype,"aria",void 0),t([u()],H.prototype,"container",null),t([u({readOnly:!0})],H.prototype,"focused",null),t([u({readOnly:!0})],H.prototype,"height",void 0),t([u()],H.prototype,"messagesCommon",void 0),t([u({type:m})],H.prototype,"overlay",void 0),t([u({readOnly:!0})],H.prototype,"position",void 0),t([u({readOnly:!0})],H.prototype,"resizing",void 0),t([u({readOnly:!0})],H.prototype,"root",void 0),t([u({value:null,readOnly:!0})],H.prototype,"size",null),t([u({readOnly:!0})],H.prototype,"surface",void 0),t([u({readOnly:!0})],H.prototype,"suspended",void 0),t([u({nonNullable:!0})],H.prototype,"ui",null),t([u({readOnly:!0})],H.prototype,"userContent",void 0),t([u({readOnly:!0})],H.prototype,"width",void 0),t([u()],H.prototype,"widthBreakpoint",void 0),H=t([c("esri.views.DOMContainer")],H),H};export{C as DOMContainer};
5
+ import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as l,syncAndInitial as d,sync as u}from"../core/reactiveUtils.js";import{addFrameTask as c}from"../core/scheduling.js";import{property as p,subclass as m}from"../core/accessorSupport/decorators.js";import{Attribution as f}from"./Attribution.js";import _ from"./overlay/ViewOverlay.js";const y=[0,0];function g(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return y[0]=i.left+(e?.pageXOffset??0),y[1]=i.top+(e?.pageYOffset??0),y}function v(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const b=16,w=750,C=512,H=2,O=y=>{const O=y;let z=class extends O{constructor(...t){super(...t),this._freqInfo={freq:b,time:w},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),l),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),this.removeHandles("container"),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(v(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),v(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",i(r,l),r.appendChild(l),this._set("userContent",l);const p=document.createElement("div");p.className="esri-view-root",r.insertBefore(p,r.firstChild),this._set("root",p);const m=document.createElement("div");m.className="esri-view-surface",m.setAttribute("role","application"),m.tabIndex=0,p.appendChild(m),this._set("surface",m);const y=new _;p.appendChild(y.surface),this._set("overlay",y),this.addHandles(h(()=>y.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=c({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}),"container"),this.addHandles([h(()=>this.attributionVisible,t=>{t?!this._attribution&&t&&(this._attribution=new f({attributionItems:this.attributionItems}),p.appendChild(this._attribution.surface)):this._attribution=o(this._attribution)},d),h(()=>this.attributionItems,t=>{this._attribution&&(this._attribution.attributionItems=t)},u)],"container"),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},l),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=b,t.time=w;const e=c({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=b,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?b:Math.min(w,s.freq*H),!i&&s.freq>=C&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=b,t.time=w,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=b,t.time=w,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&g(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([p()],z.prototype,"aria",void 0),t([p()],z.prototype,"container",null),t([p({readOnly:!0})],z.prototype,"focused",null),t([p({readOnly:!0})],z.prototype,"height",void 0),t([p()],z.prototype,"messagesCommon",void 0),t([p({type:_})],z.prototype,"overlay",void 0),t([p({readOnly:!0})],z.prototype,"position",void 0),t([p({readOnly:!0})],z.prototype,"resizing",void 0),t([p({readOnly:!0})],z.prototype,"root",void 0),t([p({value:null,readOnly:!0})],z.prototype,"size",null),t([p({readOnly:!0})],z.prototype,"surface",void 0),t([p({readOnly:!0})],z.prototype,"suspended",void 0),t([p({nonNullable:!0})],z.prototype,"ui",null),t([p({readOnly:!0})],z.prototype,"userContent",void 0),t([p({readOnly:!0})],z.prototype,"width",void 0),t([p()],z.prototype,"widthBreakpoint",void 0),z=t([m("esri.views.DOMContainer")],z),z};export{O as DOMContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import o from"../core/Collection.js";import{referenceSetter as i}from"../core/collectionUtils.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{getOrCreateMapValue as l}from"../core/MapUtils.js";import{removeMaybe as c}from"../core/maybe.js";import a from"../core/ReactiveMap.js";import{watch as h,on as u,initial as d}from"../core/reactiveUtils.js";import{symmetricDifference as f}from"../core/SetUtils.js";import{property as p,subclass as g}from"../core/accessorSupport/decorators.js";import{isSubtypeSublayer as y,isSubtypeGroupLayer as m,isKnowledgeGraphLayer as _,isMapImageLayer as v}from"../layers/support/layerUtils.js";import w from"../rest/support/Query.js";import{isSelectableLayer as S}from"./support/selectionUtils.js";let b=class extends n{constructor(e){super(e),this._selectionMap=new a,this._sources=new o,this._trashCan=[],this._layerEditHandles=new o,this._vizTaskId=0,this.view=null,this.showHighlight=!0,this.highlightName="default"}initialize(){this.addHandles([h(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),h(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},d),u(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const o of e.removed){const e=t.get(o);e&&(t.delete(o),e.highlightHandle?.remove(),s.push({layer:o,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.drain(c)}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(e){i(e,this._sources)}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{_(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):v(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):m(t)?t.sublayers?.forEach(s):S(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},o="layerView"){const{view:i,selections:n}=this;if(!i&&"layerView"===o)return r.getLogger(this).warn("Cannot query layer views without a view."),[];const l=(e?.length?n.filter(t=>e.includes(t.layer)):n).map(async e=>{const{layer:t,selection:n}=e;if(!n.length)return;const r=y(t)?t.parent:t;if(null!=r){if(i&&"layerView"===o&&!j(r)&&E(r)){const e=await i.whenLayerView(r).catch(()=>null);if(e)return L(e,n,s)}return L(r,n,s)}}).filter(t);return(await Promise.all(l)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,[...n.selection]);let o=!1;const i=e.current.concat(e.added);for(const s of i){const e=s.sourceLayer,i=s.getObjectId();if(this.sources.includes(e)&&(S(e)||y(e))&&null!==i){const s=l(t,e,()=>[]);s.includes(i)||(s.push(i),o=!0)}}for(const s of e.removed){const e=s.sourceLayer,i=s.getObjectId();if(this.sources.includes(e)&&(S(e)||y(e))&&null!==i){const s=t.get(e),n=s?.indexOf(i);void 0!==n&&n>=0&&(s?.splice(n,1),o=!0)}}if(o){const{_selectionMap:e,_trashCan:o}=this,i=[];for(const[n,r]of t){const t=e.get(n);void 0!==t&&o.push(t),e.set(n,{selection:r}),i.push({layer:n,selection:r,...s(void 0!==t?t.selection:[],r)})}this._onSelectionChange(i)}}setSelection(e,t){this._setSelection(e,t)}getSelection(e){const t=this._selectionMap.get(e);return t?.selection}appendToSelection(e,t){const s=this._selectionMap.get(e),o=void 0!==s?[...s.selection]:[];for(const i of t)o.includes(i)||o.push(i);this._setSelection(e,o)}removeFromSelection(e,t){const s=this._selectionMap.get(e);if(!s)return;const o=[];for(const i of s.selection)t.includes(i)||o.push(i);this._setSelection(e,o)}toggleInSelection(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const o=new Set(s.selection),i=new Set(t),n=f(o,i);this._setSelection(e,Array.from(n))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,o]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...o.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}if(null==this.view)return;const{sources:e,view:t,_selectionMap:s,showHighlight:o}=this,i=this._vizTaskId;for(const n of e){const e=s.get(n),r=y(n)?n.parent:n;if(null!=r&&E(r)){if(j(r))continue;t.whenLayerView(r).then(t=>{e?.highlightHandle?.remove(),null!=e&&o&&i===this._vizTaskId&&"highlight"in t&&"function"==typeof t.highlight&&e.selection.length>0&&(e.highlightHandle=t.highlight(e.selection,this.highlightName))}).catch(()=>{e?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(c);const e=new Set(this.sources.map(e=>y(e)?e.parent:e));for(const t of e)S(t)&&"on"in t&&t.on&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(e,t)))}_onLayerEdit(e,t){if(m(t))this._onParentLayerEdit(e,t);else if(e.deletedFeatures.length&&this._selectionMap.has(t)){const s=[];e.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.removeFromSelection(t,s)}}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:o,updatedFeatures:i}=e;if(o?.updateFeatures?.forEach(e=>{const s=e.getObjectId()??e.attributes[t.objectIdField];if(null==s)return;if(i.find(e=>e.objectId===s)?.error)return;const o=t.findSublayerForFeature(e);if(!S(o))return;const n=t.sublayers.find(e=>!(!S(e)||!this.getSelection(e)?.includes(s)));S(n)&&n!==o&&(this.removeFromSelection(n,[s]),this.appendToSelection(o,[s]))}),s.length){const e=[];s.forEach(({error:t,objectId:s})=>{null!=s&&null==t&&e.push(s)}),t.sublayers.forEach(t=>{S(t)&&this._selectionMap.has(t)&&this.removeFromSelection(t,e)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const o=this._selectionMap.get(e);if(void 0===o||!F(o,{selection:t})){void 0!==o&&this._trashCan.push(o),this._selectionMap.set(e,{selection:[...t]});const i={layer:e,selection:[...t],...s(void 0!==o?o.selection:[],t)};this._onSelectionChange([i])}}};e([p()],b.prototype,"_selectionMap",void 0),e([p()],b.prototype,"_sources",void 0),e([p({readOnly:!0,nonNullable:!0})],b.prototype,"selections",null),e([p({readOnly:!0,nonNullable:!0})],b.prototype,"count",null),e([p()],b.prototype,"view",void 0),e([p({readOnly:!0,nonNullable:!0})],b.prototype,"hasSelection",null),e([p()],b.prototype,"showHighlight",void 0),e([p()],b.prototype,"sources",null),e([p()],b.prototype,"highlightName",void 0),b=e([g("esri.views.SelectionManager")],b);const j=e=>y(e)?!0===e.parent?.isTable:e.isTable,M=e=>void 0!==e.layer,E=e=>void 0!==e?.when,F=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],o=[...t.selection];if(s.length!==o.length)return!1;s.sort(),o.sort();for(let e=0;e<s.length;e++)if(s[e]!==o[e])return!1}return!0},L=async(e,t,s={})=>{let o;if(M(e)){const i=e;o=void 0===i?null:await i.queryFeatures(new w({...s,objectIds:t})).then(t=>({data:t,layer:e.layer}))}else{const i=e;o=void 0===i?null:await i.queryFeatures(new w({...s,objectIds:t})).then(e=>({data:e,layer:i}))}return o},C=b;export{C as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n}from"../core/deprecate.js";import{EventedAccessor as r}from"../core/Evented.js";import l from"../core/Logger.js";import{getOrCreateMapValue as c}from"../core/MapUtils.js";import{removeMaybe as h}from"../core/maybe.js";import a from"../core/ReactiveMap.js";import{watch as u,on as d,initial as p}from"../core/reactiveUtils.js";import{symmetricDifference as f}from"../core/SetUtils.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as _,isKnowledgeGraphLayer as v,isMapImageLayer as w}from"../layers/support/layerUtils.js";import S from"../rest/support/Query.js";import{isISelectableLayer as b}from"./support/selectionUtils.js";let E=class extends r{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new a,this._sources=new i,this._trashCan=[],this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>this._refreshVisualization()),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},p),d(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.drain(h)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(l.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{v(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):w(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):_(t)?t.sublayers?.forEach(s):b(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return l.getLogger(this).warn("Cannot query layer views without a view."),[];const r=(e?.length?n.filter(t=>e.includes(t.layer)):n).map(async e=>{const{layer:t,selection:n}=e;if(!n.length)return;const r=m(t)?t.parent:t;if(null!=r){if(o&&"layerView"===i&&!j(r)&&L(r)){const e=await o.whenLayerView(r).catch(()=>null);if(e)return C(e,n,s)}return C(r,n,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,[...n.selection]);let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=s.sourceLayer,o=s.getObjectId();if(this.sources.includes(e)&&(b(e)||m(e))&&null!==o){const s=c(t,e,()=>[]);s.includes(o)||(s.push(o),i=!0)}}for(const s of e.removed){const e=s.sourceLayer,o=s.getObjectId();if(this.sources.includes(e)&&(b(e)||m(e))&&null!==o){const s=t.get(e),n=s?.indexOf(o);void 0!==n&&n>=0&&(s?.splice(n,1),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n);void 0!==t&&i.push(t),e.set(n,{selection:r}),o.push({layer:n,selection:r,...s(void 0!==t?t.selection:[],r)})}this._onSelectionChange(o)}}setSelection(e,t){this._setSelection(e,t)}appendToSelection(e,t){const s=this._selectionMap.get(e),i=void 0!==s?[...s.selection]:[];for(const o of t)i.includes(o)||i.push(o);this._setSelection(e,i)}removeFromSelection(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[];for(const o of s.selection)t.includes(o)||i.push(o);this._setSelection(e,i)}toggleInSelection(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const i=new Set(s.selection),o=new Set(t),n=f(i,o);this._setSelection(e,Array.from(n))}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}if(null==this.view)return;const{sources:e,view:t,_selectionMap:s,highlightEnabled:i}=this,o=this._vizTaskId;for(const n of e){const e=s.get(n),r=m(n)?n.parent:n;if(null!=r&&L(r)){if(j(r))continue;t.whenLayerView(r).then(t=>{e?.highlightHandle?.remove(),null!=e&&i&&o===this._vizTaskId&&"highlight"in t&&"function"==typeof t.highlight&&e.selection.length>0&&(e.highlightHandle=t.highlight(e.selection,this.highlightName))}).catch(()=>{e?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(h);const e=new Set(this.sources.map(e=>m(e)?e.parent:e));for(const t of e)b(t)&&"on"in t&&t.on&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(e,t)))}_onLayerEdit(e,t){if(_(t))this._onParentLayerEdit(e,t);else if(e.deletedFeatures.length&&this._selectionMap.has(t)){const s=[];e.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.removeFromSelection(t,s)}}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=e;if(i?.updateFeatures?.forEach(e=>{const s=e.getObjectId()??e.attributes[t.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=t.findSublayerForFeature(e);if(!b(i))return;const n=t.sublayers.find(e=>!(!b(e)||!this.getSelection(e)?.includes(s)));b(n)&&n!==i&&(this.removeFromSelection(n,[s]),this.appendToSelection(i,[s]))}),s.length){const e=[];s.forEach(({error:t,objectId:s})=>{null!=s&&null==t&&e.push(s)}),t.sublayers.forEach(t=>{b(t)&&this._selectionMap.has(t)&&this.removeFromSelection(t,e)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(void 0===i||!F(i,{selection:t})){void 0!==i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o={layer:e,selection:[...t],...s(void 0!==i?i.selection:[],t)};this._onSelectionChange([o])}}};e([g()],E.prototype,"_selectionMap",void 0),e([g()],E.prototype,"_sources",void 0),e([g({readOnly:!0,nonNullable:!0})],E.prototype,"count",null),e([g({readOnly:!0,nonNullable:!0})],E.prototype,"hasSelection",null),e([g()],E.prototype,"highlightEnabled",void 0),e([g()],E.prototype,"highlightName",void 0),e([g({readOnly:!0,nonNullable:!0})],E.prototype,"selections",null),e([g()],E.prototype,"showHighlight",null),e([g()],E.prototype,"sources",null),e([g()],E.prototype,"view",void 0),E=e([y("esri.views.SelectionManager")],E);const j=e=>m(e)?!0===e.parent?.isTable:e.isTable,M=e=>void 0!==e.layer,L=e=>void 0!==e?.when,F=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},C=async(e,t,s={})=>{let i;if(M(e)){const o=e;i=void 0===o?null:await o.queryFeatures(new S({...s,objectIds:t})).then(t=>({data:t,layer:e.layer}))}else{const o=e;i=void 0===o?null:await o.queryFeatures(new S({...s,objectIds:t})).then(e=>({data:e,layer:o}))}return i},H=E;export{H as default};
package/views/View.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V,subclass as M}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as b}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import I from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as P}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import Z from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import N from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(n(m)){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new R,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:X}),this.analyses=new F,this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new Z,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new P({view:this}),this.selectionManager=new I({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return B._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(B.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return U(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(N)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([V()],J.prototype,"_userSpatialReference",void 0),e([V()],J.prototype,"activeTool",null),e([V({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],J.prototype,"layerviewCollections",null),e([V(b(F,"analyses"))],J.prototype,"analyses",void 0),e([V()],J.prototype,"animation",null),e([V()],J.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],J.prototype,"attributionItems",null),e([V()],J.prototype,"attributionVisible",void 0),e([V()],J.prototype,"basemapView",void 0),e([V()],J.prototype,"center",null),e([V()],J.prototype,"defaultsFromMapSettings",null),e([V()],J.prototype,"defaultsFromMap",null),e([V()],J.prototype,"dependencies",void 0),e([V()],J.prototype,"displayFilterEnabled",void 0),e([V({type:S})],J.prototype,"extent",null),e([V()],J.prototype,"fatalError",void 0),e([V(b(L,"graphics"))],J.prototype,"graphics",void 0),e([V({readOnly:!0,type:T})],J.prototype,"heightModelInfo",null),e([V({type:r.ofType(N)})],J.prototype,"highlights",null),e([V({readOnly:!0})],J.prototype,"interacting",null),e([V({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],J.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([V({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],J.prototype,"layerViews",void 0),e([V()],J.prototype,"resolution",null),e([V({type:H})],J.prototype,"magnifier",void 0),e([V({value:null,type:t})],J.prototype,"map",null),e([V()],J.prototype,"padding",void 0),e([V({readOnly:!0})],J.prototype,"ready",void 0),e([V()],J.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],J.prototype,"readyState",null),e([V({type:E})],J.prototype,"spatialReference",null),e([V()],J.prototype,"stationary",null),e([V({type:k})],J.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([V()],J.prototype,"tools",null),e([V()],J.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],J.prototype,"type",void 0),e([V({type:Number})],J.prototype,"scale",void 0),e([V({readOnly:!0})],J.prototype,"updating",void 0),e([V({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],J.prototype,"initialExtent",null),e([V()],J.prototype,"cursor",null),e([V({readOnly:!0})],J.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([V()],J.prototype,"layerViewManager",void 0),e([V()],J.prototype,"analysisViewManager",void 0),e([V()],J.prototype,"selectionManager",void 0),e([V()],J.prototype,"width",void 0),e([V()],J.prototype,"height",void 0),e([V({readOnly:!0})],J.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],J.prototype,"size",null),e([V({readOnly:!0})],J.prototype,"suspended",void 0),e([V({readOnly:!0})],J.prototype,"viewEvents",void 0),e([V({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([V()],J.prototype,"_isValid",void 0),e([V()],J.prototype,"_readyCycleForced",void 0),e([V()],J.prototype,"_lockedSpatialReference",void 0),e([V()],J.prototype,"_userTimeZone",void 0),e([V()],J.prototype,"_lockedTimeZone",void 0),e([V()],J.prototype,"_userTimeExtent",void 0),e([V()],J.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],J.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],J.prototype,"effectiveTheme",null),J=B=e([M("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
5
+ import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import h from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V,subclass as M}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as b}from"../core/support/OwningCollection.js";import{UpdatingHandles as R}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as j}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as F}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import{system as x}from"../time/constants.js";import k from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import O from"./BasemapView.js";import H from"./Magnifier.js";import I from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as P}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import Z from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import N from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(n(m)){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new R,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:X}),this.analyses=new F,this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new L,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new Z,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this._validateWithErrorDisplay()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new O({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new P({view:this}),this.selectionManager=new I({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{h.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}get _layerToLayerviewMapping(){return B._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(B.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return h.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return this.suspended?[]:U(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(N)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(h.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!j(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??x}set timeZone(e){this._userTimeZone=e,C(e)||h.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&h.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}async _validateWithErrorDisplay(){try{await this.validate()}catch(e){const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const a=document.createElement("a");a.innerHTML="https://esriurl.com/webgl-faq",a.target="_blank",a.setAttribute("style","font-size: 18px;"),a.href="https://esriurl.com/webgl-faq",t.appendChild(i),t.appendChild(r),t.appendChild(a);const s=this.getSurface();throw s&&s.appendChild(t),e}}};e([V()],J.prototype,"_userSpatialReference",void 0),e([V()],J.prototype,"activeTool",null),e([V({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],J.prototype,"layerviewCollections",null),e([V(b(F,"analyses"))],J.prototype,"analyses",void 0),e([V()],J.prototype,"animation",null),e([V()],J.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],J.prototype,"attributionItems",null),e([V()],J.prototype,"attributionVisible",void 0),e([V()],J.prototype,"basemapView",void 0),e([V()],J.prototype,"center",null),e([V()],J.prototype,"defaultsFromMapSettings",null),e([V()],J.prototype,"defaultsFromMap",null),e([V()],J.prototype,"dependencies",void 0),e([V()],J.prototype,"displayFilterEnabled",void 0),e([V({type:S})],J.prototype,"extent",null),e([V()],J.prototype,"fatalError",void 0),e([V(b(L,"graphics"))],J.prototype,"graphics",void 0),e([V({readOnly:!0,type:T})],J.prototype,"heightModelInfo",null),e([V({type:r.ofType(N)})],J.prototype,"highlights",null),e([V({readOnly:!0})],J.prototype,"interacting",null),e([V({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],J.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([V({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],J.prototype,"layerViews",void 0),e([V()],J.prototype,"resolution",null),e([V({type:H})],J.prototype,"magnifier",void 0),e([V({value:null,type:t})],J.prototype,"map",null),e([V()],J.prototype,"padding",void 0),e([V({readOnly:!0})],J.prototype,"ready",void 0),e([V()],J.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],J.prototype,"readyState",null),e([V({type:E})],J.prototype,"spatialReference",null),e([V()],J.prototype,"stationary",null),e([V({type:k})],J.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([V()],J.prototype,"tools",null),e([V()],J.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],J.prototype,"type",void 0),e([V({type:Number})],J.prototype,"scale",void 0),e([V({readOnly:!0})],J.prototype,"updating",void 0),e([V({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],J.prototype,"initialExtent",null),e([V()],J.prototype,"cursor",null),e([V({readOnly:!0})],J.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([V()],J.prototype,"layerViewManager",void 0),e([V()],J.prototype,"analysisViewManager",void 0),e([V()],J.prototype,"selectionManager",void 0),e([V()],J.prototype,"width",void 0),e([V()],J.prototype,"height",void 0),e([V({readOnly:!0})],J.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],J.prototype,"size",null),e([V({readOnly:!0})],J.prototype,"suspended",void 0),e([V({readOnly:!0})],J.prototype,"viewEvents",void 0),e([V({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([V()],J.prototype,"_isValid",void 0),e([V()],J.prototype,"_readyCycleForced",void 0),e([V()],J.prototype,"_lockedSpatialReference",void 0),e([V()],J.prototype,"_userTimeZone",void 0),e([V()],J.prototype,"_lockedTimeZone",void 0),e([V()],J.prototype,"_userTimeExtent",void 0),e([V()],J.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],J.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],J.prototype,"effectiveTheme",null),J=B=e([M("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{EventEmitter as i}from"../../core/Evented.js";import{watch as o,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as l,pt2px as r,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a,subclass as c}from"../../core/accessorSupport/decorators.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{C as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,i=b(this.graphic),o=e?e.offset:0;return new f({mode:i,offset:o})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new i,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const i=e.geometry;if(null==i)return null;const o=this._get("focusedSymbol"),s=null!=o?o:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,i,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=o(()=>this.graphic?.symbol,t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))},s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,i,o){if(null==(o=o||d(i)))return null;const s=1;let n=this._circleCollisionCache;if("point"===i.type&&"cim"===o.type&&"CIMPointSymbol"===o.data.symbol?.type&&o.data.symbol.symbolLayers){const{offsetX:r,offsetY:n,size:a}=_(o),c=l(e,j),p=a/2,m=t.toScreen(i),u=m.x+r,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==i.type||"simple-marker"!==o.type)return v(e,i,t)?s:null;if(null==n||!n.originalPoint.equals(i)){const e=i,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:r(o.size)},this._circleCollisionCache=n}}if(null!=n){const i=l(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+r(o.xoffset),m=a.y-r(o.yoffset);return h(i,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,i){const o=t.toMap(e,{include:[i]});return o&&g(o,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{EventEmitter as i}from"../../core/Evented.js";import{watch as o,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as l,pt2px as r,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a,subclass as c}from"../../core/accessorSupport/decorators.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{D as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,i=b(this.graphic),o=e?e.offset:0;return new f({mode:i,offset:o})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new i,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const i=e.geometry;if(null==i)return null;const o=this._get("focusedSymbol"),s=null!=o?o:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,i,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=o(()=>this.graphic?.symbol,t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))},s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,i,o){if(null==(o=o||d(i)))return null;const s=1;let n=this._circleCollisionCache;if("point"===i.type&&"cim"===o.type&&"CIMPointSymbol"===o.data.symbol?.type&&o.data.symbol.symbolLayers){const{offsetX:r,offsetY:n,size:a}=_(o),c=l(e,j),p=a/2,m=t.toScreen(i),u=m.x+r,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==i.type||"simple-marker"!==o.type)return v(e,i,t)?s:null;if(null==n||!n.originalPoint.equals(i)){const e=i,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:r(o.size)},this._circleCollisionCache=n}}if(null!=n){const i=l(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+r(o.xoffset),m=a.y-r(o.yoffset);return h(i,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,i){const o=t.toMap(e,{include:[i]});return o&&g(o,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../Color.js";import{onLocaleChange as s}from"../../intl.js";import o from"../../core/Accessor.js";import{createTask as r}from"../../core/asyncUtils.js";import{multiplyOpacity as i,getContrast as n}from"../../core/colorUtils.js";import{makeHandle as a}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as l}from"../../core/mathUtils.js";import{formatLength as c}from"../../core/quantityFormatUtils.js";import{watch as h,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../core/screenUtils.js";import{getMetersPerUnit as d,getMetersPerVerticalUnitForSR as f}from"../../core/units.js";import{property as u,subclass as g}from"../../core/accessorSupport/decorators.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as U}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as j}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{F as I}from"../../chunks/vec32.js";import{isClockwise as L}from"../../geometry/support/coordsUtils.js";import{sv3d as C}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as D,absoluteHeightElevationInfo as w}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as M}from"../../support/getDefaultUnitForView.js";import S from"../overlay/TextOverlayItem.js";const T=3025,O={default:15,far:25};let P=class extends o{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([h(()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(t=>p(()=>this.context?.editGeometryOperations,t,()=>this._update())),h(()=>this._colors,t=>this._updateStyle(t)),s(()=>this._refreshMessages()),a(()=>this._messageUnitsTask?.abort())]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return O[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:i(n(t,160),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{parts:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let a=0;a<n;++a){const o=V(r,s,e,i,a);if(o.length<2||!A(o,t.view,t.elevationInfo,i.spatialReference))continue;const l=1===n&&!L(o);let c=z,h=H;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,l),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||b(s,r)<T)return void(n.visible=!1);const{spatialReference:a}=t.editGeometryOperations.data,l=t.automaticLengthMeasurementUtils.autoDistance2D(e,o,a),h=this._messagesUnits,p=M(t.view);n.text=null!=h&&null!=l?c(h,l,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(G,-d,m):_(G,d,-m),x(G,G),y(G,G,this._edgeDistancePixels),v(q,s,r,.5),U(q,q,G),n.position=[q[0],q[1]],Math.abs(G[0])>Math.abs(G[1])?n.anchor=G[0]>0?"left":"right":n.anchor=-G[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new S({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=r(()=>k("esri/core/t9n/Units"))}};function V(t,e,s,o,r){const i=[];for(const l of e.data.parts[r].iterateVertices())i.push(o.toXYZ(l.pos,C.get()));if(0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],a=i[i.length-1];return"polygon"===t.type&&i.length>2&&!I(n,a)&&i.push(n),i}function A(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=f(o),n=t=>D(e,t,o,s,w)??0;for(let a=1;a<t.length;++a){const e=t[a-1],s=t[a],o=(s[0]-e[0])*r,l=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+l*l)>F)return!1}return!0}t([u()],P.prototype,"context",void 0),t([u()],P.prototype,"stagedVertex",void 0),t([u()],P.prototype,"visible",void 0),t([u()],P.prototype,"edgeDistance",void 0),t([u()],P.prototype,"updating",null),t([u()],P.prototype,"_messageUnitsTask",void 0),t([u()],P.prototype,"_messagesUnits",null),t([u()],P.prototype,"_edgeDistancePixels",null),t([u()],P.prototype,"_colors",null),P=t([g("esri.views.interactive.SegmentLabels")],P);const F=l(5),G=j(),q=j(),z=m(),H=m();export{P as SegmentLabels};
5
+ import{__decorate as t}from"tslib";import e from"../../Color.js";import{onLocaleChange as s}from"../../intl.js";import o from"../../core/Accessor.js";import{createTask as r}from"../../core/asyncUtils.js";import{multiplyOpacity as i,getContrast as n}from"../../core/colorUtils.js";import{makeHandle as a}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as l}from"../../core/mathUtils.js";import{formatLength as c}from"../../core/quantityFormatUtils.js";import{watch as h,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../core/screenUtils.js";import{getMetersPerUnit as d,getMetersPerVerticalUnitForSR as f}from"../../core/units.js";import{property as u,subclass as g}from"../../core/accessorSupport/decorators.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as U}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as j}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{G as I}from"../../chunks/vec32.js";import{isClockwise as L}from"../../geometry/support/coordsUtils.js";import{sv3d as C}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as D,absoluteHeightElevationInfo as w}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as M}from"../../support/getDefaultUnitForView.js";import S from"../overlay/TextOverlayItem.js";const T=3025,O={default:15,far:25};let P=class extends o{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([h(()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(t=>p(()=>this.context?.editGeometryOperations,t,()=>this._update())),h(()=>this._colors,t=>this._updateStyle(t)),s(()=>this._refreshMessages()),a(()=>this._messageUnitsTask?.abort())]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return O[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:i(n(t,160),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{parts:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let a=0;a<n;++a){const o=V(r,s,e,i,a);if(o.length<2||!A(o,t.view,t.elevationInfo,i.spatialReference))continue;const l=1===n&&!L(o);let c=F,h=H;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,l),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||b(s,r)<T)return void(n.visible=!1);const{spatialReference:a}=t.editGeometryOperations.data,l=t.automaticLengthMeasurementUtils.autoDistance2D(e,o,a),h=this._messagesUnits,p=M(t.view);n.text=null!=h&&null!=l?c(h,l,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(q,-d,m):_(q,d,-m),x(q,q),y(q,q,this._edgeDistancePixels),v(z,s,r,.5),U(z,z,q),n.position=[z[0],z[1]],Math.abs(q[0])>Math.abs(q[1])?n.anchor=q[0]>0?"left":"right":n.anchor=-q[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new S({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=r(()=>k("esri/core/t9n/Units"))}};function V(t,e,s,o,r){const i=[];for(const l of e.data.parts[r].iterateVertices())i.push(o.toXYZ(l.pos,C.get()));if(0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],a=i[i.length-1];return"polygon"===t.type&&i.length>2&&!I(n,a)&&i.push(n),i}function A(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=f(o),n=t=>D(e,t,o,s,w)??0;for(let a=1;a<t.length;++a){const e=t[a-1],s=t[a],o=(s[0]-e[0])*r,l=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+l*l)>G)return!1}return!0}t([u()],P.prototype,"context",void 0),t([u()],P.prototype,"stagedVertex",void 0),t([u()],P.prototype,"visible",void 0),t([u()],P.prototype,"edgeDistance",void 0),t([u()],P.prototype,"updating",null),t([u()],P.prototype,"_messageUnitsTask",void 0),t([u()],P.prototype,"_messagesUnits",null),t([u()],P.prototype,"_edgeDistancePixels",null),t([u()],P.prototype,"_colors",null),P=t([g("esri.views.interactive.SegmentLabels")],P);const G=l(5),q=j(),z=j(),F=m(),H=m();export{P as SegmentLabels};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{distance as e,lerp 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{C as s,h as u,l as c,d as l,F as p}from"../../chunks/vec32.js";import{create as h,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,d as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";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 x){if(e)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 x){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(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,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=h()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(h())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?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=0===this._valueType,a=1===this._valueType;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 c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(V(r),V(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return l(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=h()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(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 x){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 x){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 s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=h()){return u(r,e[0],e[1],e[2])}pointToXYZ(e,r=h()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function M(e){return e}function V(e){return e}function w(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,w as createCoordinateHelper};
5
+ import{distance as e,lerp 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{D as s,h as u,l as c,d as l,G as p}from"../../chunks/vec32.js";import{create as h,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,d as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";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 x){if(e)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 x){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(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,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=h()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(h())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?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=0===this._valueType,a=1===this._valueType;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 c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(V(r),V(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return l(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=h()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}pointToXYZ(e,r=h()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(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 x){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 x){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 s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=h()){return u(r,e[0],e[1],e[2])}pointToXYZ(e,r=h()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function M(e){return e}function V(e){return e}function w(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,w 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as h,h as a,f as o,n as _,j as c,g as l,q as p,i as g,l as d,F as m,d as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as b,getNormal as V,copy as N,intersectLine as P,isPointInside as y,projectPoint as Z}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T}from"../../../support/geometry2dUtils.js";class M{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=0){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,0===n&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftSegment?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightSegment?.rightVertex?.pos);this._edgeDirection=h(f(),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=f();if(i){h(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),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):a(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=j&&e<=Math.PI-j}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<z||s>1-z))return this._bisectDirection(e,i);const n=o(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(f(),t.direction,this._edgeDirection);_(i,i);const e=o(f(),this._edgeDirection,i);return 1===this._planeType&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(b(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(b(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 i=V(t),h=this._edgeDirection,a=g(f(),this._left.start,this._left.direction),o=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,a),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,o),[m]=T({start:l,end:_,type:1},{start:d,end:p,type:1});if(!m)return;const u=e(r(),_,l);s(u,u);const D=e(r(),m,l),x=n(u,D),N=g(f(),a,c(f(),this._left.direction,-x)),P=b(t,N);this._updateDistanceConstraint(P)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(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)),N(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&P(this._offsetPlane,t,g(f(),t,i),e),s=f();(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=y(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return b(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=Z(this._plane,e,f()),n=b(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof M&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.part===t._edge.part&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&m(V(this._plane),V(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 M(this._helper,this._planeType,this._edge,this.distance,1);return N(t._plane,this._plane),N(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=u(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&m(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:u(f(),t),end:null!=i?u(f(),i):null,direction:u(f(),e),isOriginalDirection:s}}}const j=i(15),z=.001;export{M as OffsetEdgeVertex};
5
+ import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as h,h as a,f as o,n as _,j as c,g as l,q as p,i as g,l as d,G as m,d as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as b,getNormal as V,copy as N,intersectLine as P,isPointInside as y,projectPoint as Z}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T}from"../../../support/geometry2dUtils.js";class M{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=0){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,0===n&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftSegment?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightSegment?.rightVertex?.pos);this._edgeDirection=h(f(),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=f();if(i){h(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),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):a(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=j&&e<=Math.PI-j}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<z||s>1-z))return this._bisectDirection(e,i);const n=o(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(f(),t.direction,this._edgeDirection);_(i,i);const e=o(f(),this._edgeDirection,i);return 1===this._planeType&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(b(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(b(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 i=V(t),h=this._edgeDirection,a=g(f(),this._left.start,this._left.direction),o=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,a),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,o),[m]=T({start:l,end:_,type:1},{start:d,end:p,type:1});if(!m)return;const u=e(r(),_,l);s(u,u);const D=e(r(),m,l),x=n(u,D),N=g(f(),a,c(f(),this._left.direction,-x)),P=b(t,N);this._updateDistanceConstraint(P)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(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)),N(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&P(this._offsetPlane,t,g(f(),t,i),e),s=f();(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=y(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return b(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=Z(this._plane,e,f()),n=b(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof M&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.part===t._edge.part&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&m(V(this._plane),V(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 M(this._helper,this._planeType,this._edge,this.distance,1);return N(t._plane,this._plane),N(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=u(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&m(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:u(f(),t),end:null!=i?u(f(),i):null,direction:u(f(),e),isOriginalDirection:s}}}const j=i(15),z=.001;export{M as OffsetEdgeVertex};