@arcgis/core 4.33.0-next.20250407 → 4.33.0-next.20250408

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 (251) hide show
  1. package/Color.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{69b5d0ef14fb521b0fd7.js → 04008648c59031bca8ea.js} +1 -1
  4. package/assets/esri/core/workers/chunks/07236fe57d76b1134cd4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{6a8cf1f51cc4adc268d3.js → 0747c9542172241b52ab.js} +1 -1
  6. package/assets/esri/core/workers/chunks/083548c5eea5aca6404c.js +1 -0
  7. package/assets/esri/core/workers/chunks/0d37c6aa261c8d5e5b23.js +1 -0
  8. package/assets/esri/core/workers/chunks/0d7c1de47ae006277b76.js +1 -0
  9. package/assets/esri/core/workers/chunks/{9574896c90b39fa7ecb4.js → 10fd52bc5124fced5bcc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/11b725421a823f6183a2.js +1 -0
  11. package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → 14d1a970e927ebfed9c8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 1595f3def0ba0c4f0fe7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1263391920fbb8926ced.js → 19eb465f91d07862926a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1c8cdae7736b6c907d95.js +1 -0
  15. package/assets/esri/core/workers/chunks/1cc4fc3353d217632a1b.js +1 -0
  16. package/assets/esri/core/workers/chunks/{91439b59260b0fb04be9.js → 238df0aee97315623638.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7ea5bbb52e84be9a608e.js → 23cc33576da66b3c4366.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{358a3a9326615d5e6d3b.js → 2679da0c93f05ae956c6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/26e0a0a13060cd3e4291.js +1 -0
  20. package/assets/esri/core/workers/chunks/{c2d0fc13f4b746318a38.js → 290f63304a2a81303c06.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{e6544e966f14fb410157.js → 2d5cb817e6e905103068.js} +1 -1
  22. package/assets/esri/core/workers/chunks/345f428dfcaa594ee617.js +1 -0
  23. package/assets/esri/core/workers/chunks/35dccd3883d2e466c42e.js +1 -0
  24. package/assets/esri/core/workers/chunks/{fc5ca7b08915177c5e33.js → 364860a42edc0c3b8d5b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/393fbd296817e813936c.js +1 -0
  26. package/assets/esri/core/workers/chunks/{82a58a405332d43a328f.js → 39fbac918ebd1b0e3a18.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3a649aa78e25e3c8aa8c.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4cc77769009901a112ec.js → 3b2bda2e8c08f486de27.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3e1bb914aceb3a9af898.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ee77b601fb0f3567e87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40945669f5be487b340c.js +1 -0
  32. package/assets/esri/core/workers/chunks/43a3b1b78d214aadaaad.js +1 -0
  33. package/assets/esri/core/workers/chunks/49d03bdaa9c4476b69d6.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1b87fa15470cce26feea.js → 49d6b56e21b1bc0d1948.js} +1 -1
  35. package/assets/esri/core/workers/chunks/4cbd5303f5a5a5fff391.js +1 -0
  36. package/assets/esri/core/workers/chunks/{40b33c9bd271cddbd837.js → 50ffb2620cdbcfd75723.js} +1 -1
  37. package/assets/esri/core/workers/chunks/544771f64a86b541d5bb.js +1 -0
  38. package/assets/esri/core/workers/chunks/55cc40d1b1853f779d82.js +1 -0
  39. package/assets/esri/core/workers/chunks/56e9dfd62102c32b9770.js +1 -0
  40. package/assets/esri/core/workers/chunks/576bed289aa7be03f319.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b7a1185ac49480fc1410.js → 5c80452df87024fdaa75.js} +1 -1
  42. package/assets/esri/core/workers/chunks/5ef6acd36629eae225da.js +1 -0
  43. package/assets/esri/core/workers/chunks/{e592731ac12b9bc646ff.js → 60d3b329e69f3cddb7f4.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{43b19c58b2d16ae8e7cc.js → 6275114e8ed9dd31465d.js} +1 -1
  45. package/assets/esri/core/workers/chunks/63ce66da1a52d6d07ccb.js +1 -0
  46. package/assets/esri/core/workers/chunks/6447d373a43ef6cd46cd.js +1 -0
  47. package/assets/esri/core/workers/chunks/64824ee75c643cee2aa9.js +1 -0
  48. package/assets/esri/core/workers/chunks/{48fbf887da6d19838bf0.js → 6a067a6ce0968d893142.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6a70b858e24d98845041.js +1 -0
  50. package/assets/esri/core/workers/chunks/{c589d32f8efcca6bf712.js → 6c65b966f4c952508fc1.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{cda6ae4c5cb67e22b454.js → 6d15d953baabccbbee01.js} +1 -1
  52. package/assets/esri/core/workers/chunks/6ecf2924f9f6aac61101.js +1 -0
  53. package/assets/esri/core/workers/chunks/{25a686f00479ac12a1ca.js → 6f9a17f62786af04b74e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/77334c3fed1e3a06d307.js +1 -0
  55. package/assets/esri/core/workers/chunks/{7ef9bcd58af499a14a08.js → 79036c5d7569c4e94abe.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{2ab7d36409e9af3ac3da.js → 7b47b08f4a58898273b9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{90442f47c9f31f26b453.js → 7f961954e59a232bfa88.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 86b4920f5a99576399fb.js} +2 -2
  59. package/assets/esri/core/workers/chunks/877f665c7edb26c147ea.js +1 -0
  60. package/assets/esri/core/workers/chunks/{8aae03e347ab18ae6ee2.js → 89e7cc489156ff0ebdb6.js} +1 -1
  61. package/assets/esri/core/workers/chunks/8c5619fdf125a459281d.js +1 -0
  62. package/assets/esri/core/workers/chunks/8e64687ee76e70deeb29.js +1 -0
  63. package/assets/esri/core/workers/chunks/{400f95295bbfced31076.js → 8ef755e6a7b2b71f46e6.js} +1 -1
  64. package/assets/esri/core/workers/chunks/8fe36b06a7eceeb874e9.js +1 -0
  65. package/assets/esri/core/workers/chunks/{269531e770376ed9e4fd.js → 90874dfe23035d16660c.js} +1 -1
  66. package/assets/esri/core/workers/chunks/91bb715f5ee87e97f162.js +1 -0
  67. package/assets/esri/core/workers/chunks/{5c757e20c0543e6a49b3.js → 948a3c1419ae323cca10.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{7f31dbe0ca8974a10be8.js → 96cddbbeef61a4f33f29.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{27b7ef3442700f6d6123.js → 9a84ff99756c7247dd39.js} +97 -96
  70. package/assets/esri/core/workers/chunks/9fddd759c308d3d5801a.js +1 -0
  71. package/assets/esri/core/workers/chunks/a29e99328d75b6ceb74d.js +1 -0
  72. package/assets/esri/core/workers/chunks/{af9fda47d02c51a2c7da.js → a32e697547f8ac345dd7.js} +1 -1
  73. package/assets/esri/core/workers/chunks/a426152e7eb550b8f15f.js +1 -0
  74. package/assets/esri/core/workers/chunks/a6de903f22f76d875005.js +1 -0
  75. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → aaf67ec3d580e1fee6c7.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{d2c7067bb6654c0e2793.js → ac91bd1fee9ddadc270b.js} +1 -1
  77. package/assets/esri/core/workers/chunks/ae7c1e34ed1288773ec2.js +1 -0
  78. package/assets/esri/core/workers/chunks/ae9ebc0c0553e57e85ba.js +1 -0
  79. package/assets/esri/core/workers/chunks/{49ed3ab9bd6d7c52e864.js → af41dcc8006cd0f451c2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/b199508eef1eeee72854.js +1 -0
  81. package/assets/esri/core/workers/chunks/b715fa857391931c04b9.js +1 -0
  82. package/assets/esri/core/workers/chunks/c144e00dfe6d63eaa2b1.js +1 -0
  83. package/assets/esri/core/workers/chunks/c150cd2a82260495e9de.js +1 -0
  84. package/assets/esri/core/workers/chunks/{2cbab0c078d0b844934c.js → c3c70dad8c8a93953237.js} +1 -1
  85. package/assets/esri/core/workers/chunks/c4425d5227f7e2379b0f.js +1 -0
  86. package/assets/esri/core/workers/chunks/c837379b36cf716d6215.js +1 -0
  87. package/assets/esri/core/workers/chunks/c849e3e151d78a061bf0.js +1 -0
  88. package/assets/esri/core/workers/chunks/{d2eb3802fa003c2d497e.js → caa5676636b06d743623.js} +1 -1
  89. package/assets/esri/core/workers/chunks/cb83fcfff8731c88c108.js +1 -0
  90. package/assets/esri/core/workers/chunks/cc366e4df91cf516d1b9.js +1 -0
  91. package/assets/esri/core/workers/chunks/ccd3f9b52006cd7dd11e.js +1 -0
  92. package/assets/esri/core/workers/chunks/d59aeb46bf2fb0931a9b.js +1 -0
  93. package/assets/esri/core/workers/chunks/{4ba34124054752b363c0.js → d65c30cd787b287833fb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d72d44df7e117e26e717.js +1 -0
  95. package/assets/esri/core/workers/chunks/e22cdfce2a0583f3cc50.js +1 -0
  96. package/assets/esri/core/workers/chunks/ee277dd58aa69281163f.js +1 -0
  97. package/assets/esri/core/workers/chunks/f086993f8744209d761f.js +1 -0
  98. package/assets/esri/core/workers/chunks/{8d49c79e549e90371303.js → fa2d836d4a844b26b84e.js} +1 -1
  99. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +1 -0
  100. package/assets/esri/core/workers/chunks/fb65796296b0422cf266.js +1 -0
  101. package/assets/esri/core/workers/chunks/fde544c090cc04581536.js +1 -0
  102. package/assets/esri/core/workers/chunks/fe2c48de24b25c45b3e7.js +1 -0
  103. package/chunks/CheckerBoard.glsl.js +3 -3
  104. package/chunks/ColorMaterial.glsl.js +3 -3
  105. package/chunks/ComponentShader.glsl.js +2 -2
  106. package/chunks/DefaultMaterial.glsl.js +5 -5
  107. package/chunks/ImageMaterial.glsl.js +1 -1
  108. package/chunks/LineMarker.glsl.js +4 -4
  109. package/chunks/Path.glsl.js +2 -2
  110. package/chunks/Pattern.glsl.js +3 -3
  111. package/chunks/Precipitation.glsl.js +1 -1
  112. package/chunks/RealisticTree.glsl.js +6 -6
  113. package/chunks/RibbonLine.glsl.js +1 -1
  114. package/chunks/ShadedColorMaterial.glsl.js +7 -7
  115. package/chunks/WaterSurface.glsl.js +3 -3
  116. package/chunks/vec32.js +1 -1
  117. package/colorUtils.js +1 -1
  118. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  119. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  120. package/core/libs/gl-matrix-2/vec3.js +1 -1
  121. package/geometry/support/float16.js +1 -1
  122. package/geometry/support/meshUtils/merge.js +1 -1
  123. package/identity/IdentityManagerBase.js +1 -1
  124. package/interfaces.d.ts +13 -6
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  127. package/package.json +2 -2
  128. package/support/revision.js +1 -1
  129. package/symbols/support/Symbol3DEmissive.js +5 -0
  130. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  131. package/symbols/support/Symbol3DMaterial.js +1 -1
  132. package/symbols/support/materialUtils.js +1 -1
  133. package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
  134. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  141. package/views/2d/layers/MediaLayerView2D.js +1 -1
  142. package/views/2d/layers/TileLayerView2D.js +1 -1
  143. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  144. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  145. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  146. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  147. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  148. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  149. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  150. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  151. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  152. package/views/3d/layers/I3SMeshView3D.js +1 -1
  153. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  154. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  155. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  160. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  161. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  162. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  163. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  164. package/views/3d/support/cameraUtils.js +1 -1
  165. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  166. package/views/3d/terrain/PatchRenderData.js +1 -1
  167. package/views/3d/terrain/SphericalPatch.js +1 -1
  168. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  169. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +6 -5
  170. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  171. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  172. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  173. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  174. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  175. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  176. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  177. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  178. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  179. package/views/SceneView.js +1 -1
  180. package/views/VideoView.js +1 -1
  181. package/views/interactive/SegmentLabels.js +1 -1
  182. package/views/interactive/coordinateHelper.js +1 -1
  183. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  184. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  185. package/views/interactive/sketch/constraints.js +1 -1
  186. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  187. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  188. package/views/support/geometry3dUtils.js +1 -1
  189. package/views/webgl/FramebufferObject.js +1 -1
  190. package/views/webgl/RenderbufferDescriptor.js +1 -1
  191. package/views/webgl/RenderingContext.js +1 -1
  192. package/views/webgl/TextureDescriptor.js +1 -1
  193. package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +0 -1
  194. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +0 -1
  195. package/assets/esri/core/workers/chunks/0a0e5d699ddb7052c5c0.js +0 -1
  196. package/assets/esri/core/workers/chunks/1014513c0ec85f9414a4.js +0 -1
  197. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +0 -1
  198. package/assets/esri/core/workers/chunks/114599ed0752d9a70eef.js +0 -1
  199. package/assets/esri/core/workers/chunks/19e83b184d8b4d0b3007.js +0 -1
  200. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
  201. package/assets/esri/core/workers/chunks/25ef080163f3f795911a.js +0 -1
  202. package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +0 -1
  203. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +0 -1
  204. package/assets/esri/core/workers/chunks/3b7284516a0e34a9e85e.js +0 -1
  205. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +0 -1
  206. package/assets/esri/core/workers/chunks/4275dcec730a11173661.js +0 -1
  207. package/assets/esri/core/workers/chunks/4403b3f08907e88d0d91.js +0 -1
  208. package/assets/esri/core/workers/chunks/4523ba4a3c8987abca56.js +0 -1
  209. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +0 -1
  210. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +0 -1
  211. package/assets/esri/core/workers/chunks/4e3b60156bee3b8b3367.js +0 -1
  212. package/assets/esri/core/workers/chunks/519028f42b817d3e9933.js +0 -1
  213. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +0 -1
  214. package/assets/esri/core/workers/chunks/705c1ebb327f680f8519.js +0 -1
  215. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +0 -1
  216. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +0 -1
  217. package/assets/esri/core/workers/chunks/72f4cea853ce9fcf2cb6.js +0 -1
  218. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +0 -1
  219. package/assets/esri/core/workers/chunks/7655be1470ce39f0e494.js +0 -1
  220. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +0 -1
  221. package/assets/esri/core/workers/chunks/7ccc02a4ec6d3552ecca.js +0 -1
  222. package/assets/esri/core/workers/chunks/80427cd9f0c2e07f21c3.js +0 -1
  223. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +0 -1
  224. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  225. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +0 -1
  226. package/assets/esri/core/workers/chunks/8f35416a5036897d6289.js +0 -1
  227. package/assets/esri/core/workers/chunks/8fecd1337d84c26c692b.js +0 -1
  228. package/assets/esri/core/workers/chunks/9050dad7e4f093568026.js +0 -1
  229. package/assets/esri/core/workers/chunks/9643a9516783e8c32180.js +0 -1
  230. package/assets/esri/core/workers/chunks/9e156e135f34f9b06032.js +0 -1
  231. package/assets/esri/core/workers/chunks/a3421383e48379012c9c.js +0 -1
  232. package/assets/esri/core/workers/chunks/a91f2d1deb950f46ad09.js +0 -1
  233. package/assets/esri/core/workers/chunks/b4a1f3f3a036226d6810.js +0 -1
  234. package/assets/esri/core/workers/chunks/bd0dbad694ce5531deab.js +0 -1
  235. package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
  236. package/assets/esri/core/workers/chunks/c68c68e918c72932b247.js +0 -1
  237. package/assets/esri/core/workers/chunks/cc307d34a68e44e3cbc5.js +0 -1
  238. package/assets/esri/core/workers/chunks/d3b0117ad9232e36f785.js +0 -1
  239. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +0 -1
  240. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +0 -1
  241. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  242. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +0 -1
  243. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  244. package/assets/esri/core/workers/chunks/e5aff9b10877fb04d6de.js +0 -1
  245. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +0 -1
  246. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +0 -1
  247. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +0 -1
  248. package/assets/esri/core/workers/chunks/f41a9ceb8e49baafe9fa.js +0 -1
  249. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
  250. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +0 -1
  251. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +0 -1
@@ -2,18 +2,18 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as o,isColorEmission as r,isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as t}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as i}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as a}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{glsl as s,If as u}from"../core/shaderModules/glsl.js";import{OITPass as e}from"../lib/OITPass.js";import{alphaCutoff as n}from"../../../../webscene/support/AlphaCutoff.js";function p(p,d){p.include(i,d),p.include(t,d),p.fragment.include(a);const f=d.output===o.ObjectAndLayerIdColor,c=r(d.output),m=l(d.output)&&d.oitPass===e.ColorAlpha,g=l(d.output)&&d.oitPass!==e.ColorAlpha,C=d.discardInvisibleFragments;let h=0;(g||c||m)&&p.outputs.add("fragColor","vec4",h++),c&&p.outputs.add("fragEmission","vec4",h++),m&&p.outputs.add("fragAlpha","float",h++),p.fragment.code.add(s`
6
- void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) {
7
- ${u(f,"finalColor.a = 1.0;")}
5
+ import{ShaderOutput as o,isColorEmission as r,isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as i}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as t}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as a}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{glsl as s,If as e}from"../core/shaderModules/glsl.js";import{OITPass as u}from"../lib/OITPass.js";import{alphaCutoff as n}from"../../../../webscene/support/AlphaCutoff.js";function p(p,d){p.include(t,d),p.include(i,d),p.fragment.include(a);const f=d.output===o.ObjectAndLayerIdColor,c=r(d.output),m=l(d.output)&&d.oitPass===u.ColorAlpha,C=l(d.output)&&d.oitPass!==u.ColorAlpha,g=d.discardInvisibleFragments;let h=0;(C||c||m)&&p.outputs.add("fragColor","vec4",h++),c&&p.outputs.add("fragEmission","vec4",h++),m&&p.outputs.add("fragAlpha","float",h++),p.fragment.code.add(s`
6
+ void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveBaseColor) {
7
+ ${e(f,"finalColor.a = 1.0;")}
8
8
 
9
- ${u(C,`if (finalColor.a < ${s.float(n)}) { discard; }`)}
9
+ ${e(g,`if (finalColor.a < ${s.float(n)}) { discard; }`)}
10
10
 
11
11
  finalColor = applySlice(finalColor, vWorldPosition);
12
- ${u(m,s`fragColor = premultiplyAlpha(finalColor);
12
+ ${e(m,s`fragColor = premultiplyAlpha(finalColor);
13
13
  fragAlpha = finalColor.a;`)}
14
- ${u(g,"fragColor = finalColor;")}
15
- ${u(c,"fragEmission = finalColor.a * getEmissions();")}
14
+ ${e(C,"fragColor = finalColor;")}
15
+ ${e(c,"fragEmission = finalColor.a * getEmissions(emissiveBaseColor);")}
16
16
  calculateOcclusionAndOutputHighlight();
17
- ${u(f,"outputObjectAndLayerIdColor();")}
17
+ ${e(f,"outputObjectAndLayerIdColor();")}
18
18
  }
19
19
  `)}export{p as outputColorHighlightOID};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{on as u,watch as g,initial as m,whenOnce as y,syncAndInitial as f,sync as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as _,createScreenPointArray as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import L from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import A from"../geometry/Point.js";import{canProjectWithoutEngine as I,project as H}from"../geometry/projection.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as D}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as F}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{B as q,a as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as z}from"../geometry/support/coordinateSystem.js";import{loadFloat16ArrayConstructor as B}from"../geometry/support/float16.js";import{getResolutionForScale as N}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as Q,isTiledLayer as Y,isVoxelLayer as Z,isIntegratedMeshLayer as $}from"../layers/support/layerUtils.js";import{AnalysesCollection as J}from"../support/AnalysesCollection.js";import{BreakpointsOwner as K}from"./BreakpointsOwner.js";import{DOMContainer as X}from"./DOMContainer.js";import{FocusAreas as ee}from"./FocusAreas.js";import te from"./GroundView.js";import{PopupView as ie}from"./PopupView.js";import re from"./View.js";import se from"./ViewAnimation.js";import{ViewingMode as ne,stringFromViewingMode as ae,viewingModeFromString as oe}from"./ViewingMode.js";import{layerView3DImporter as le}from"./3d/layerViewModuleImportUtils.js";import pe from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as he}from"./3d/constraints/Constraints.js";import{EnvironmentManager as de}from"./3d/environment/EnvironmentManager.js";import ce from"./3d/environment/SceneViewEnvironment.js";import ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ge}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as me}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as ye}from"./3d/layers/support/FeatureTileTree3D.js";import fe from"./3d/state/ViewState.js";import{ViewStateManager as we}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ve}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as _e}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as be}from"./3d/support/debugFlags.js";import Me from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Se}from"./3d/support/ElevationProvider.js";import{toMap as Ve,hitTest as je}from"./3d/support/hitTest.js";import{popupHitTest as Re}from"./3d/support/popupHitTest.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Oe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Te}from"./3d/support/ResourceController.js";import xe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ee}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Le}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Pe from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ae,getTiledLayerInfo as Ie,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ge}from"./3d/webgl-engine/Stage.js";import{olidEnabled as De}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as Fe}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Ue}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as We}from"./support/HighlightDefaults.js";import qe from"./support/HighlightOptions.js";import{occludeesSupported as ke}from"./support/layerViewUtils.js";import{PropertiesPool as ze}from"./support/PropertiesPool.js";import{isSupportedScreenPointEvent as Be,createScreenPointFromSupportedEvent as Ne}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Qe}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Ye,destroyTextureCompressionWorker as Ze}from"./support/TextureCompressionHelper.js";import{check as $e}from"./support/WebGLRequirements.js";import Je from"./ui/DefaultUI.js";import Ke from"./ui/3d/DefaultUI3D.js";import Xe from"../webscene/Environment.js";let et=class extends(K(ie(X(re)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new ze({slicePlane:q},this),this._resourceController=Te(this),this.deconflictor=new ge({view:this}),this.labeler=new me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new J,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new he,this.environment=new ce,this.environmentManager=new de,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new pe({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new fe({view:this}),this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ke,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.focusAreas=new ee({view:this}),S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([u((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ue({view:this}),this.stateManager=new we({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")){const e=Ye(this,this.resourceController);this.addResolvingPromise(e.promise)}this.addResolvingPromise(B()),this.groundView=new te({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles(g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),w))}destroy(){this.destroyed||(Ze(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof L?this.spatialReference&&(t=tt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ne.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:tt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=tt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=tt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new L({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof ce?e:e instanceof Xe?this.environment?.cloneWithWebsceneEnvironment(e)??ce.fromWebsceneEnvironment(e):C(ce,e):new ce}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){Me.isValidProfile(e)&&(Me.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Me.getDefaultProfile()}set slicePlane(e){if(null!=this.stage&&(this.stage.renderer.slicePlane=e),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?N(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?P.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ae(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ae(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ae(this.defaultsFromMap.viewingMode):Qe(t,ne.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===We))??new qe}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===We)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new xe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=Be(e)?Ne(this,e):e;return Ve(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Se(this.elevationProvider,e):null)??0;return F(e,it,this.renderSpatialReference,t),this.state.camera.projectToScreen(it,rt),_(rt[0],rt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;F(e,it,i);const r=this.state.camera.computeScreenPixelSizeAt(it);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Be(e)?Ne(this,e):e;return je(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Re(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!De())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return le.importLayerView(e)}hasLayerViewModule(e){return le.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=$e(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?oe(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ne.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ne.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ne.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ne.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Qe(e,i)&&(null==t||(!!Q(t)||(!Y(t)||null!=Ie(t,e,i))&&(!Z(t)||i!==ne.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(Q(t)&&(r||s)){return!s||i===ne.Local||null===He(t.tileInfo,t.fullExtent,e,ne.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return Y(t)||Z(t)||!r&&!s?Y(t)&&r&&i!==ne.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:ne.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ae(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ke(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}_initBasemapTerrain(){this._set("basemapTerrain",new Pe({view:this})),this._set("elevationProvider",new _e({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Le({view:this})),this._set("featureTiles",new ye({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?H(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>be.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&be.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||be.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Oe.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!D(e,this.basemapTerrain.spatialReference,st,t)||(this.renderCoordsHelper.extent=st)}),w),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Fe/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),w),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d");return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new ve(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ge({view:this,options:e,container:i}),this._stage.renderer.slicePlane=this.slicePlane,this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Fe/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ee({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;c(e),await y((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this,getGraphics:()=>this.graphics}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=oe(this.viewingMode);e===ne.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Ue);for(const t of this.allLayerViews)$(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Ue);for(const t of this.allLayerViews)$(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function tt(e,t){return null!=e&&I(e.spatialReference,t)?H(e,t):null}e([V()],et.prototype,"_userClippingArea",void 0),e([V()],et.prototype,"_resourceController",void 0),e([V()],et.prototype,"_stage",void 0),e([V({readOnly:!0})],et.prototype,"deconflictor",void 0),e([V({readOnly:!0})],et.prototype,"labeler",void 0),e([V(E(J,"analyses"))],et.prototype,"analyses",void 0),e([V({type:se,readOnly:!0})],et.prototype,"animation",null),e([V({readOnly:!0})],et.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],et.prototype,"elevationProvider",void 0),e([V()],et.prototype,"camera",null),e([V({type:t})],et.prototype,"contentCamera",null),e([V({readOnly:!0})],et.prototype,"canvas",void 0),e([V({type:A})],et.prototype,"center",null),e([V({type:L})],et.prototype,"clippingArea",null),e([V({type:he})],et.prototype,"constraints",void 0),e([V({type:L,readOnly:!0})],et.prototype,"renderDataExtent",null),e([V({readOnly:!0})],et.prototype,"tileInfo",null),e([V({type:L,readOnly:!0})],et.prototype,"dataExtent",null),e([V({type:L,readOnly:!0})],et.prototype,"_groundAndLayersExtent",null),e([V({type:ce})],et.prototype,"environment",void 0),e([j("environment")],et.prototype,"castEnvironment",null),e([V({readOnly:!0})],et.prototype,"environmentManager",void 0),e([V({type:L})],et.prototype,"extent",null),e([V({type:r})],et.prototype,"floors",void 0),e([V()],et.prototype,"screenCenter",null),e([V()],et.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],et.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],et.prototype,"graphicsView",void 0),e([V({readOnly:!0})],et.prototype,"analysisViewManager",void 0),e([V()],et.prototype,"groundView",void 0),e([V({type:Boolean})],et.prototype,"initialExtentRequired",null),e([V()],et.prototype,"defaultsFromMapSettings",null),e([V()],et.prototype,"interacting",null),e([V()],et.prototype,"stationary",null),e([V()],et.prototype,"navigating",null),e([V()],et.prototype,"map",void 0),e([V()],et.prototype,"padding",null),e([V({type:Le,readOnly:!0})],et.prototype,"pointsOfInterest",void 0),e([V({type:ye,readOnly:!0})],et.prototype,"featureTiles",void 0),e([V()],et.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],et.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],et.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],et.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],et.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],et.prototype,"state",void 0),e([V({readOnly:!0})],et.prototype,"inputManager",void 0),e([V({readOnly:!0})],et.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],et.prototype,"qualityProfile",null),e([V({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,Me.apply(this.qualityProfile,e)),e}})],et.prototype,"qualitySettings",void 0),e([V()],et.prototype,"slicePlane",null),e([V({readOnly:!0})],et.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],et.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],et.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],et.prototype,"resolution",null),e([V({type:Number})],et.prototype,"scale",null),e([V()],et.prototype,"heightModelInfo",null),e([V()],et.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],et.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],et.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],et.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],et.prototype,"type",void 0),e([V(),j((e=>e instanceof Je?e:O(Ke,e)))],et.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],et.prototype,"updating",null),e([V()],et.prototype,"_updatingObjects",null),e([V()],et.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],et.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],et.prototype,"viewingMode",null),e([V({type:i})],et.prototype,"viewpoint",null),e([V({readOnly:!0})],et.prototype,"visibleArea",null),e([V({type:Number})],et.prototype,"zoom",null),e([V({type:qe})],et.prototype,"highlightOptions",null),e([V({readOnly:!0})],et.prototype,"quality",null),e([V({readOnly:!0})],et.prototype,"resolutionScale",null),e([V()],et.prototype,"_defaultToMapOptions",null),e([V()],et.prototype,"_defaultHitTestOptions",null),et=e([R("esri.views.SceneView")],et);const it=x(),rt=b(),st=U(),nt=et;export{nt as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{on as u,watch as g,initial as m,whenOnce as y,syncAndInitial as f,sync as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as _,createScreenPointArray as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import L from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import A from"../geometry/Point.js";import{canProjectWithoutEngine as I,project as H}from"../geometry/projection.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as D}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as F}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{B as q,a as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as B}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as N,isTiledLayer as Q,isVoxelLayer as Y,isIntegratedMeshLayer as Z}from"../layers/support/layerUtils.js";import{AnalysesCollection as $}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import{FocusAreas as X}from"./FocusAreas.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as he}from"./3d/environment/EnvironmentManager.js";import de from"./3d/environment/SceneViewEnvironment.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as me}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import{ViewStateManager as fe}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as we}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as ve}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as _e}from"./3d/support/debugFlags.js";import be from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import{toMap as Se,hitTest as Ve}from"./3d/support/hitTest.js";import{popupHitTest as je}from"./3d/support/popupHitTest.js";import Re from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ce}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Oe}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as xe}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Ee}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Le from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Pe,getTiledLayerInfo as Ae,checkIfTileInfoSupportedForView as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as He}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ge}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as De}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as Ue}from"./support/HighlightDefaults.js";import We from"./support/HighlightOptions.js";import{occludeesSupported as qe}from"./support/layerViewUtils.js";import{PropertiesPool as ke}from"./support/PropertiesPool.js";import{isSupportedScreenPointEvent as ze,createScreenPointFromSupportedEvent as Be}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Ne}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Qe,destroyTextureCompressionWorker as Ye}from"./support/TextureCompressionHelper.js";import{check as Ze}from"./support/WebGLRequirements.js";import $e from"./ui/DefaultUI.js";import Je from"./ui/3d/DefaultUI3D.js";import Ke from"../webscene/Environment.js";let Xe=class extends(J(te(K(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new ke({slicePlane:q},this),this._resourceController=Oe(this),this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new $,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new pe,this.environment=new de,this.environmentManager=new he,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye({view:this}),this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Je,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.focusAreas=new X({view:this}),S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([u((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new fe({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")){const e=Qe(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ee({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles(g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),w))}destroy(){this.destroyed||(Ye(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof L?this.spatialReference&&(t=et(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:et(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=et(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=et(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new L({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof de?e:e instanceof Ke?this.environment?.cloneWithWebsceneEnvironment(e)??de.fromWebsceneEnvironment(e):C(de,e):new de}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){be.isValidProfile(e)&&(be.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||be.getDefaultProfile()}set slicePlane(e){if(null!=this.stage&&(this.stage.renderer.slicePlane=e),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?B(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?P.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Pe(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ne(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):Ne(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===Ue))??new We}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===Ue)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Te(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Se(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Me(this.elevationProvider,e):null)??0;return F(e,tt,this.renderSpatialReference,t),this.state.camera.projectToScreen(tt,it),_(it[0],it[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;F(e,tt,i);const r=this.state.camera.computeScreenPixelSizeAt(tt);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Ve(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return je(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Ge())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ze(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?ae(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Ne(e,i)&&(null==t||(!!N(t)||(!Q(t)||null!=Ae(t,e,i))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(N(t)&&(r||s)){return!s||i===se.Local||null===Ie(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return Q(t)||Y(t)||!r&&!s?Q(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&qe(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}_initBasemapTerrain(){this._set("basemapTerrain",new Le({view:this})),this._set("elevationProvider",new ve({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ee({view:this})),this._set("featureTiles",new me({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?H(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>_e.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&_e.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||_e.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ce.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!D(e,this.basemapTerrain.spatialReference,rt,t)||(this.renderCoordsHelper.extent=rt)}),w),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),w),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d");return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new we(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new He({view:this,options:e,container:i}),this._stage.renderer.slicePlane=this.slicePlane,this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new xe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;c(e),await y((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this,getGraphics:()=>this.graphics}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function et(e,t){return null!=e&&I(e.spatialReference,t)?H(e,t):null}e([V()],Xe.prototype,"_userClippingArea",void 0),e([V()],Xe.prototype,"_resourceController",void 0),e([V()],Xe.prototype,"_stage",void 0),e([V({readOnly:!0})],Xe.prototype,"deconflictor",void 0),e([V({readOnly:!0})],Xe.prototype,"labeler",void 0),e([V(E($,"analyses"))],Xe.prototype,"analyses",void 0),e([V({type:re,readOnly:!0})],Xe.prototype,"animation",null),e([V({readOnly:!0})],Xe.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],Xe.prototype,"elevationProvider",void 0),e([V()],Xe.prototype,"camera",null),e([V({type:t})],Xe.prototype,"contentCamera",null),e([V({readOnly:!0})],Xe.prototype,"canvas",void 0),e([V({type:A})],Xe.prototype,"center",null),e([V({type:L})],Xe.prototype,"clippingArea",null),e([V({type:pe})],Xe.prototype,"constraints",void 0),e([V({type:L,readOnly:!0})],Xe.prototype,"renderDataExtent",null),e([V({readOnly:!0})],Xe.prototype,"tileInfo",null),e([V({type:L,readOnly:!0})],Xe.prototype,"dataExtent",null),e([V({type:L,readOnly:!0})],Xe.prototype,"_groundAndLayersExtent",null),e([V({type:de})],Xe.prototype,"environment",void 0),e([j("environment")],Xe.prototype,"castEnvironment",null),e([V({readOnly:!0})],Xe.prototype,"environmentManager",void 0),e([V({type:L})],Xe.prototype,"extent",null),e([V({type:r})],Xe.prototype,"floors",void 0),e([V()],Xe.prototype,"screenCenter",null),e([V()],Xe.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],Xe.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],Xe.prototype,"graphicsView",void 0),e([V({readOnly:!0})],Xe.prototype,"analysisViewManager",void 0),e([V()],Xe.prototype,"groundView",void 0),e([V({type:Boolean})],Xe.prototype,"initialExtentRequired",null),e([V()],Xe.prototype,"defaultsFromMapSettings",null),e([V()],Xe.prototype,"interacting",null),e([V()],Xe.prototype,"stationary",null),e([V()],Xe.prototype,"navigating",null),e([V()],Xe.prototype,"map",void 0),e([V()],Xe.prototype,"padding",null),e([V({type:Ee,readOnly:!0})],Xe.prototype,"pointsOfInterest",void 0),e([V({type:me,readOnly:!0})],Xe.prototype,"featureTiles",void 0),e([V()],Xe.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],Xe.prototype,"state",void 0),e([V({readOnly:!0})],Xe.prototype,"inputManager",void 0),e([V({readOnly:!0})],Xe.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],Xe.prototype,"qualityProfile",null),e([V({type:Re,get(){let e=this._get("qualitySettings");return e||(e=new Re,be.apply(this.qualityProfile,e)),e}})],Xe.prototype,"qualitySettings",void 0),e([V()],Xe.prototype,"slicePlane",null),e([V({readOnly:!0})],Xe.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],Xe.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],Xe.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Xe.prototype,"resolution",null),e([V({type:Number})],Xe.prototype,"scale",null),e([V()],Xe.prototype,"heightModelInfo",null),e([V()],Xe.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],Xe.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],Xe.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],Xe.prototype,"type",void 0),e([V(),j((e=>e instanceof $e?e:O(Je,e)))],Xe.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Xe.prototype,"updating",null),e([V()],Xe.prototype,"_updatingObjects",null),e([V()],Xe.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],Xe.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],Xe.prototype,"viewingMode",null),e([V({type:i})],Xe.prototype,"viewpoint",null),e([V({readOnly:!0})],Xe.prototype,"visibleArea",null),e([V({type:Number})],Xe.prototype,"zoom",null),e([V({type:We})],Xe.prototype,"highlightOptions",null),e([V({readOnly:!0})],Xe.prototype,"quality",null),e([V({readOnly:!0})],Xe.prototype,"resolutionScale",null),e([V()],Xe.prototype,"_defaultToMapOptions",null),e([V()],Xe.prototype,"_defaultHitTestOptions",null),Xe=e([R("esri.views.SceneView")],Xe);const tt=x(),it=b(),rt=U(),st=Xe;export{st 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,whenOnce as m,initial as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import G from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/accessorSupport/tracking/Flags.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import"../layers/effects/EffectView.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/GLObjectType.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/JSONSupport.js";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import S from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as C}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import E from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import V from"./ui/DefaultUI.js";import R from"./ui/2d/DefaultUI2D.js";const T=new t("#000");let O;async function W(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);O=e}const k=.01;let z=class extends s{};z=e([h("esri.views.VideoView.Base")],z);let A=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(z))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new q,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new C({constraints:new G({view:this,minScale:1,maxScale:k})}),this.type="2d",this.ui=new R,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(m((()=>this.ready)))),p),a((()=>[this.layer?.effect,this._overlayContainer,this.effect]),(()=>{this._overlayContainer&&(this._overlayContainer.effect=this.effect??this.layer?.effect??null)}),l),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}))])}initialize(){this.addResolvingPromise(W().then((()=>(this._isValid=!0,m((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get effect(){return this.layer?.effect}set effect(e){this._override("effect",e)}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new O(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:T}),this._prepareStage(this.stage);const t=new x({view:this});this._set("animationManager",t);const i=new S({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new E,this._overlayContainer.addChild(t),this.stage.addChild(this._overlayContainer)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>k;r/=2)i.push(r);i.push(k);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([c()],A.prototype,"_overlayContainer",void 0),e([c()],A.prototype,"_isValid",void 0),e([c()],A.prototype,"constraintsInfo",null),e([c()],A.prototype,"effect",null),e([c()],A.prototype,"layer",void 0),e([c({type:q,nonNullable:!0})],A.prototype,"navigation",void 0),e([c({readOnly:!0})],A.prototype,"preconditionsReady",null),e([c({readOnly:!0})],A.prototype,"ready",void 0),e([c({readOnly:!0})],A.prototype,"rendering",null),e([c()],A.prototype,"scale",null),e([c()],A.prototype,"spatialReference",void 0),e([c()],A.prototype,"stateManager",void 0),e([c()],A.prototype,"type",void 0),e([c(),d((e=>e instanceof V?e:g(R,e)))],A.prototype,"ui",void 0),e([c({readOnly:!0})],A.prototype,"videoSize",null),e([c({readOnly:!0})],A.prototype,"view2dType",void 0),A=e([h("esri.views.VideoView")],A);const D=A;export{D as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,whenOnce as m,initial as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import G from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/accessorSupport/tracking/Flags.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import"../layers/effects/EffectView.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/GLObjectType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/JSONSupport.js";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import S from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as C}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import E from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import V from"./ui/DefaultUI.js";import R from"./ui/2d/DefaultUI2D.js";const T=new t("#000");let O;async function W(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);O=e}const k=.01;let z=class extends s{};z=e([h("esri.views.VideoView.Base")],z);let A=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(z))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new q,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new C({constraints:new G({view:this,minScale:1,maxScale:k})}),this.type="2d",this.ui=new R,this.view2dType="video",this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(m((()=>this.ready)))),p),a((()=>[this.layer?.effect,this._overlayContainer,this.effect]),(()=>{this._overlayContainer&&(this._overlayContainer.effect=this.effect??this.layer?.effect??null)}),l),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}))])}initialize(){this.addResolvingPromise(W().then((()=>(this._isValid=!0,m((()=>this.ready))))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get effect(){return this.layer?.effect}set effect(e){this._override("effect",e)}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new O(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:T}),this._prepareStage(this.stage);const t=new x({view:this});this._set("animationManager",t);const i=new S({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new E,this._overlayContainer.addChild(t),this.stage.addChild(this._overlayContainer)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>k;r/=2)i.push(r);i.push(k);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([c()],A.prototype,"_overlayContainer",void 0),e([c()],A.prototype,"_isValid",void 0),e([c()],A.prototype,"constraintsInfo",null),e([c()],A.prototype,"effect",null),e([c()],A.prototype,"layer",void 0),e([c({type:q,nonNullable:!0})],A.prototype,"navigation",void 0),e([c({readOnly:!0})],A.prototype,"preconditionsReady",null),e([c({readOnly:!0})],A.prototype,"ready",void 0),e([c({readOnly:!0})],A.prototype,"rendering",null),e([c()],A.prototype,"scale",null),e([c()],A.prototype,"spatialReference",void 0),e([c()],A.prototype,"stateManager",void 0),e([c()],A.prototype,"type",void 0),e([c(),d((e=>e instanceof V?e:g(R,e)))],A.prototype,"ui",void 0),e([c({readOnly:!0})],A.prototype,"videoSize",null),e([c({readOnly:!0})],A.prototype,"view2dType",void 0),A=e([h("esri.views.VideoView")],A);const D=A;export{D 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import"../../intl.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as a}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 u}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as j}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{H as L}from"../../chunks/vec32.js";import{isClockwise as I}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 w,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as D}from"../../support/getDefaultUnitForView.js";import M from"../overlay/TextOverlayItem.js";import{autoDistance2D as T}from"../support/automaticLengthMeasurementUtils.js";import{onLocaleChange as O}from"../../intl/locale.js";const P=3025,V={default:15,far:25};let A=class extends s{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))),O((()=>this._refreshMessages())),l((()=>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 V[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,n.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{components:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let l=0;l<n;++l){const o=G(r,s,e,i,l);if(o.length<2||!H(o,t.view,t.elevationInfo,i.spatialReference))continue;const a=1===n&&!I(o);let c=F,h=X;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,a),[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)<P)return void(n.visible=!1);const{spatialReference:l}=t.editGeometryOperations.data,a=T(e,o,l),h=this._messagesUnits,p=D(t.view);n.text=null!=h&&null!=a?c(h,a,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),j(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 M({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=o((()=>k("esri/core/t9n/Units")))}};function G(t,e,s,o,r){const i=[];if(e.data.components[r].iterateVertices((t=>{i.push(o.toXYZ(t.pos,C.get()))})),0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],l=i[i.length-1];return"polygon"===t.type&&i.length>2&&!L(n,l)&&i.push(n),i}function H(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=u(o),n=t=>w(e,t,o,s,S)??0;for(let l=1;l<t.length;++l){const e=t[l-1],s=t[l],o=(s[0]-e[0])*r,a=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+a*a)>R)return!1}return!0}t([f()],A.prototype,"context",void 0),t([f()],A.prototype,"stagedVertex",void 0),t([f()],A.prototype,"visible",void 0),t([f()],A.prototype,"edgeDistance",void 0),t([f()],A.prototype,"updating",null),t([f()],A.prototype,"_messageUnitsTask",void 0),t([f()],A.prototype,"_messagesUnits",null),t([f()],A.prototype,"_edgeDistancePixels",null),t([f()],A.prototype,"_colors",null),A=t([g("esri.views.interactive.SegmentLabels")],A);const R=a(5),q=U(),z=U(),F=m(),X=m();export{A as SegmentLabels};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import"../../intl.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as a}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 u}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as j}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{G as L}from"../../chunks/vec32.js";import{isClockwise as I}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 w,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as D}from"../../support/getDefaultUnitForView.js";import M from"../overlay/TextOverlayItem.js";import{autoDistance2D as T}from"../support/automaticLengthMeasurementUtils.js";import{onLocaleChange as O}from"../../intl/locale.js";const P=3025,V={default:15,far:25};let G=class extends s{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))),O((()=>this._refreshMessages())),l((()=>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 V[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,n.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{components:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let l=0;l<n;++l){const o=A(r,s,e,i,l);if(o.length<2||!R(o,t.view,t.elevationInfo,i.spatialReference))continue;const a=1===n&&!I(o);let c=H,h=X;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,a),[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)<P)return void(n.visible=!1);const{spatialReference:l}=t.editGeometryOperations.data,a=T(e,o,l),h=this._messagesUnits,p=D(t.view);n.text=null!=h&&null!=a?c(h,a,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(z,-d,m):_(z,d,-m),x(z,z),y(z,z,this._edgeDistancePixels),v(F,s,r,.5),j(F,F,z),n.position=[F[0],F[1]],Math.abs(z[0])>Math.abs(z[1])?n.anchor=z[0]>0?"left":"right":n.anchor=-z[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 M({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=o((()=>k("esri/core/t9n/Units")))}};function A(t,e,s,o,r){const i=[];if(e.data.components[r].iterateVertices((t=>{i.push(o.toXYZ(t.pos,C.get()))})),0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],l=i[i.length-1];return"polygon"===t.type&&i.length>2&&!L(n,l)&&i.push(n),i}function R(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=u(o),n=t=>w(e,t,o,s,S)??0;for(let l=1;l<t.length;++l){const e=t[l-1],s=t[l],o=(s[0]-e[0])*r,a=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+a*a)>q)return!1}return!0}t([f()],G.prototype,"context",void 0),t([f()],G.prototype,"stagedVertex",void 0),t([f()],G.prototype,"visible",void 0),t([f()],G.prototype,"edgeDistance",void 0),t([f()],G.prototype,"updating",null),t([f()],G.prototype,"_messageUnitsTask",void 0),t([f()],G.prototype,"_messagesUnits",null),t([f()],G.prototype,"_edgeDistancePixels",null),t([f()],G.prototype,"_colors",null),G=t([g("esri.views.interactive.SegmentLabels")],G);const q=a(5),z=U(),F=U(),H=m(),X=m();export{G 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as s,m as u,j as c,c as h,H as p}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return h(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
5
+ import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as s,m as u,j as c,c as h,G as p}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return h(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/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{o as h,i as o,e as a,n as _,h as c,f as l,v as p,g,m as d,H as u,c as m}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 E,copy as b,isPointInside as I,projectPoint as M,getNormal as V,intersectLine as N}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T,LineType as Z}from"../../../support/geometry2dUtils.js";class P{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=j.IMMEDIATE){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,n===j.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=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&&(a(n,e,s.direction),a(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):o(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>=y&&e<=Math.PI-y}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<A||s>1-A))return this._bisectDirection(e,i);const n=a(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=a(f(),t.direction,this._edgeDirection);_(i,i);const e=a(f(),this._edgeDirection,i);return this._planeType===z.XY&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(E(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(E(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,o=g(f(),this._left.start,this._left.direction),a=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,o),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,a),[u]=T({start:l,end:_,type:Z.LINE},{start:d,end:p,type:Z.LINE});if(!u)return;const m=e(r(),_,l);s(m,m);const D=e(r(),u,l),x=n(m,D),b=g(f(),o,c(f(),this._left.direction,-x)),I=E(t,b);this._updateDistanceConstraint(I)}_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)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&N(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=I(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return E(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=M(this._plane,e,f()),n=E(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 P&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&u(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 P(this._helper,this._planeType,this._edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(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=m(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&u(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:m(f(),t),end:null!=i?m(f(),i):null,direction:m(f(),e),isOriginalDirection:s}}}const y=i(15),A=.001;var z,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(z||(z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{P as OffsetEdgeVertex,z as PlaneType};
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{o as h,i as o,e as a,n as _,h as c,f as l,v as p,g,m as d,G as u,c as m}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 E,copy as b,isPointInside as I,projectPoint as M,getNormal as V,intersectLine as N}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T,LineType as Z}from"../../../support/geometry2dUtils.js";class P{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=j.IMMEDIATE){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,n===j.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=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&&(a(n,e,s.direction),a(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):o(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>=y&&e<=Math.PI-y}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<A||s>1-A))return this._bisectDirection(e,i);const n=a(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=a(f(),t.direction,this._edgeDirection);_(i,i);const e=a(f(),this._edgeDirection,i);return this._planeType===z.XY&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(E(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(E(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,o=g(f(),this._left.start,this._left.direction),a=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,o),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,a),[u]=T({start:l,end:_,type:Z.LINE},{start:d,end:p,type:Z.LINE});if(!u)return;const m=e(r(),_,l);s(m,m);const D=e(r(),u,l),x=n(m,D),b=g(f(),o,c(f(),this._left.direction,-x)),I=E(t,b);this._updateDistanceConstraint(I)}_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)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&N(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=I(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return E(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=M(this._plane,e,f()),n=E(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 P&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&u(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 P(this._helper,this._planeType,this._edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(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=m(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&u(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:m(f(),t),end:null!=i?m(f(),i):null,direction:m(f(),e),isOriginalDirection:s}}}const y=i(15),A=.001;var z,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(z||(z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{P as OffsetEdgeVertex,z as PlaneType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{projectAndScale as o,set as i,dot as r,min as t,max as s,subtract as n,add as e,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as c,L as f,h as m,i as g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{u as b,d as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);c(i.origin,i.origin,s),b(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;f(i.basis1,i.basis1,u,t),f(i.basis2,i.basis2,u,t),b(i)}function F(i,r,t=!1){const s=t?1/i.factor1:i.factor1,n=t?1/i.factor2:i.factor2;m(r.basis1,r.basis1,s),m(r.basis2,r.basis2,n),o(r.origin,r.origin,i.origin,i.axis1,s),o(r.origin,r.origin,i.origin,i.axis2,n),b(r)}function S(o,f,m,p,u=!1){p||(p=I());const l=i(N.get(),o[1],-o[0]),d=i(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=i(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=f.allVertices;V.forEach((({pos:n})=>{i(x,r(o,n),r(l,n)),t(d,d,x),s(j,j,x)}));const T=1e-6,E=i(N.get(),j[0]-d[0]<T?m/2:0,j[1]-d[1]<T?m/2:0);n(d,d,E),e(j,j,E);const h=u?V.reduce(((o,i)=>o+(i.pos[2]??0)),0)/V.length:0;return a(p.basis1,o,(j[0]-d[0])/2),a(p.basis2,l,(j[1]-d[1])/2),g(p.origin,d[0]*o[0]+d[1]*l[0],d[0]*o[1]+d[1]*l[1],h),c(p.origin,p.origin,p.basis1),c(p.origin,p.origin,p.basis2),b(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
5
+ import{projectAndScale as o,set as i,dot as r,min as t,max as s,subtract as n,add as e,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as c,K as f,h as m,i as g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{u as b,d as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);c(i.origin,i.origin,s),b(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;f(i.basis1,i.basis1,u,t),f(i.basis2,i.basis2,u,t),b(i)}function F(i,r,t=!1){const s=t?1/i.factor1:i.factor1,n=t?1/i.factor2:i.factor2;m(r.basis1,r.basis1,s),m(r.basis2,r.basis2,n),o(r.origin,r.origin,i.origin,i.axis1,s),o(r.origin,r.origin,i.origin,i.axis2,n),b(r)}function S(o,f,m,p,u=!1){p||(p=I());const l=i(N.get(),o[1],-o[0]),d=i(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=i(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=f.allVertices;V.forEach((({pos:n})=>{i(x,r(o,n),r(l,n)),t(d,d,x),s(j,j,x)}));const T=1e-6,E=i(N.get(),j[0]-d[0]<T?m/2:0,j[1]-d[1]<T?m/2:0);n(d,d,E),e(j,j,E);const h=u?V.reduce(((o,i)=>o+(i.pos[2]??0)),0)/V.length:0;return a(p.basis1,o,(j[0]-d[0])/2),a(p.basis2,l,(j[1]-d[1])/2),g(p.origin,d[0]*o[0]+d[1]*l[0],d[0]*o[1]+d[1]*l[1],h),c(p.origin,p.origin,p.basis1),c(p.origin,p.origin,p.basis2),b(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as a,p as h,s as f,a as l,k as d,i as p,c as m,d as g,H as _,f as L,e as k,n as x}from"../../../chunks/vec32.js";import{clone as y,create as P,UNIT_Z as z,fromValues as M}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as j}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as v,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as N,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as S}from"../../../geometry/support/plane.js";import{l as C,m as G,p as O,a as H,n as F}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as ft,pointsInsidePlane as lt,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ft(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class xt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class Pt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new zt(B(this.center),this.radius,J(0,0,1))}}class zt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||Me(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;N(this.getPlane(Tt),t,Mt);const r=l(Mt,Mt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return U(this.center,this.normal,t)}}const Mt=P(),Tt=b();class qt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||xe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(wt,0,0,this.z),U(wt,z,t)}}const wt=P();class jt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||ye(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(vt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const vt=u(),At=u(),Dt=P(),bt=P();class Et extends jt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends jt{constructor(t,e){super(t,e,it.PLANE)}}class Nt extends mt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||Te(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return H(this.sphere)}get radius(){return this.sphere[3]}}class Ut extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||qe(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ht(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||je(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class It extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||we(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(St,t,e),i(St,this._origin)||this._applyDirectionAndDistance(St),Q(St[0],St[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)v(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(Ct,this._origin,t,this._spatialReference);v(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const St=[0,0],Ct=new D;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*j);c=Math.max(0,c),v(t,e,s,c,n)}const Ot=new D;function Ht(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??ve,s}function Ft(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ft(e,t);if(qe(t))return le(t,e);if(qe(e))return le(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ft(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(xe(e))return Vt(t,e);if(ye(e))return pe(ct(e.planeLike,t.lineLike));if(Pe(e))return pe(ut(t.lineLike,e.center,e.radius));if(Me(e))return pe(at(t.lineLike,e));if(ze(e))return Yt(t,e);if(Te(e))return Bt(t,e)}else if(xe(t)){if(Le(e)||ke(e))return Ft(e,t);if(xe(e))return Kt(t,e);if(ye(e))return Qt(t,e);if(Pe(e))return Wt(t,e);if(Me(e))return $t(t,e);if(ze(e))return Xt(t,e);if(Te(e))return te(t,e)}else if(ye(t)){if(Le(e)||ke(e)||xe(e))return Ft(e,t);if(ye(e))return de(ht(t.planeLike,e.planeLike));if(Pe(e))return de(tt(t.planeLike,e.center,e.radius));if(Me(e))return se(t,e);if(ze(e))return ee(t,e);if(Te(e))return re(t,e)}else if(Pe(t)){if(Le(e)||ke(e)||xe(e)||ye(e))return Ft(e,t);if(Pe(e))return de(ft(K(t.center),t.radius,K(e.center),e.radius));if(Me(e))return ne();if(ze(e))return ie(t,e);if(Te(e))return oe()}else if(Me(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e))return Ft(e,t);if(Me(e))return ce();if(ze(e))return ce(e.asCircle());if(Te(e))return ue()}else if(ze(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||Me(e))return Ft(e,t);if(ze(e))return ae(e,t);if(Te(e))return he()}else if(Te(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||ze(e))return Ft(e,t);if(Te(e))return fe()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(F(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=P(),r=P();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=S(n),l=h*L(f,e),d=h*L(f,r);T(t,u[0],u[1],u[2],1);const p=q(n,t),m=Math.hypot(l,d),g=$(m,0);if($(I(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,f,c),x(e,e);const t=new Array,s=y(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=y(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(l/d),M=s(_)-z,w=Math.PI-M,j=new Array,v=P();a(v,u,e,h*Math.cos(M)),a(v,v,r,h*Math.sin(M)),j.push(v);const A=P();return a(A,u,e,h*Math.cos(w)),a(A,A,r,h*Math.sin(w)),j.push(A),pe(o?lt(o,j):j)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new Pt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return N(n,s,t),new gt(t)}const u=W(),h=y(S(n));return a(u,s,h,i),new zt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(ft(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(ft(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function fe(t,e){}function le(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(Pe(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(ye(e)||qe(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??ve;n.push(M(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new xt(e.filter(t))}function _e(t){return t instanceof xt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function xe(t){return t instanceof qt}function ye(t){return t instanceof jt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function Me(t){return t instanceof zt}function Te(t){return t instanceof Nt}function qe(t){return t instanceof Ut}function we(t){return t instanceof It}function je(t){return t instanceof Zt}const ve=0;export{zt as CircleConstraint,mt as Constraint,Zt as CoordinateConstraint,Ut as DrapedLineConstraint,It as GeodesicConstraint,Pt as HorizontalCircleConstraint,qt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,xt as SetConstraint,Nt as SphereConstraint,yt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,jt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as a,p as h,s as f,a as l,k as d,i as p,c as m,d as g,G as _,f as L,e as k,n as x}from"../../../chunks/vec32.js";import{clone as y,create as P,UNIT_Z as z,fromValues as M}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as j}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as v,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as N,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as G}from"../../../geometry/support/plane.js";import{l as S,m as C,p as O,a as F,n as H}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as ft,pointsInsidePlane as lt,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ht(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class xt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class Pt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new zt(B(this.center),this.radius,J(0,0,1))}}class zt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||Me(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;N(this.getPlane(Tt),t,Mt);const r=l(Mt,Mt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return U(this.center,this.normal,t)}}const Mt=P(),Tt=b();class qt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||xe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(wt,0,0,this.z),U(wt,z,t)}}const wt=P();class jt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||ye(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(vt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const vt=u(),At=u(),Dt=P(),bt=P();class Et extends jt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends jt{constructor(t,e){super(t,e,it.PLANE)}}class Nt extends mt{constructor(t,e){super(),this.sphere=S(t,e)}equals(t){return this===t||Te(t)&&C(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Ut extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||qe(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ft(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||je(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class It extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||we(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(Gt,t,e),i(Gt,this._origin)||this._applyDirectionAndDistance(Gt),Q(Gt[0],Gt[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)v(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ct(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(St,this._origin,t,this._spatialReference);v(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const Gt=[0,0],St=new D;function Ct(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*j);c=Math.max(0,c),v(t,e,s,c,n)}const Ot=new D;function Ft(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??ve,s}function Ht(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ht(e,t);if(qe(t))return le(t,e);if(qe(e))return le(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ht(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(xe(e))return Vt(t,e);if(ye(e))return pe(ct(e.planeLike,t.lineLike));if(Pe(e))return pe(ut(t.lineLike,e.center,e.radius));if(Me(e))return pe(at(t.lineLike,e));if(ze(e))return Yt(t,e);if(Te(e))return Bt(t,e)}else if(xe(t)){if(Le(e)||ke(e))return Ht(e,t);if(xe(e))return Kt(t,e);if(ye(e))return Qt(t,e);if(Pe(e))return Wt(t,e);if(Me(e))return $t(t,e);if(ze(e))return Xt(t,e);if(Te(e))return te(t,e)}else if(ye(t)){if(Le(e)||ke(e)||xe(e))return Ht(e,t);if(ye(e))return de(ht(t.planeLike,e.planeLike));if(Pe(e))return de(tt(t.planeLike,e.center,e.radius));if(Me(e))return se(t,e);if(ze(e))return ee(t,e);if(Te(e))return re(t,e)}else if(Pe(t)){if(Le(e)||ke(e)||xe(e)||ye(e))return Ht(e,t);if(Pe(e))return de(ft(K(t.center),t.radius,K(e.center),e.radius));if(Me(e))return ne();if(ze(e))return ie(t,e);if(Te(e))return oe()}else if(Me(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e))return Ht(e,t);if(Me(e))return ce();if(ze(e))return ce(e.asCircle());if(Te(e))return ue()}else if(ze(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||Me(e))return Ht(e,t);if(ze(e))return ae(e,t);if(Te(e))return he()}else if(Te(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||ze(e))return Ht(e,t);if(Te(e))return fe()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(H(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=P(),r=P();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=G(n),l=h*L(f,e),d=h*L(f,r);T(t,u[0],u[1],u[2],1);const p=q(n,t),m=Math.hypot(l,d),g=$(m,0);if($(I(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,f,c),x(e,e);const t=new Array,s=y(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=y(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(l/d),M=s(_)-z,w=Math.PI-M,j=new Array,v=P();a(v,u,e,h*Math.cos(M)),a(v,v,r,h*Math.sin(M)),j.push(v);const A=P();return a(A,u,e,h*Math.cos(w)),a(A,A,r,h*Math.sin(w)),j.push(A),pe(o?lt(o,j):j)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new Pt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return N(n,s,t),new gt(t)}const u=W(),h=y(G(n));return a(u,s,h,i),new zt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(ft(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(ft(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function fe(t,e){}function le(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(Pe(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(ye(e)||qe(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??ve;n.push(M(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new xt(e.filter(t))}function _e(t){return t instanceof xt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function xe(t){return t instanceof qt}function ye(t){return t instanceof jt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function Me(t){return t instanceof zt}function Te(t){return t instanceof Nt}function qe(t){return t instanceof Ut}function we(t){return t instanceof It}function je(t){return t instanceof Zt}const ve=0;export{zt as CircleConstraint,mt as Constraint,Zt as CoordinateConstraint,Ut as DrapedLineConstraint,It as GeodesicConstraint,Pt as HorizontalCircleConstraint,qt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,xt as SetConstraint,Nt as SphereConstraint,yt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,jt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{L as a}from"../../../chunks/vec32.js";import{isLoadedOrLoadFor as p,project as l}from"../../../geometry/projection.js";import{getClosestDenormalizedXToReference as c}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as u}from"../../../geometry/support/scaleUtils.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as d}from"../../2d/grid/constants.js";import{getScaleFactor as g,measureMetersPerUnitAtReferencePoint as f}from"../../2d/grid/gridUtils.js";import{create as h,createWritable as m}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as S}from"./snappingUtils.js";import{IntersectionSnappingCandidate as y}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as v}from"./candidates/LineSnappingCandidate.js";let w=class extends t{constructor(e){super(e),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:e,grid:t}=this;if(!t||!e||!p(t.center.spatialReference,e))return null;try{const r=l(t.center,e),i=e.isWrappable&&null!=this.view?.center?c(r.x,this.view.center.x,e):r.x;return h(i,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:e,grid:t}=this;if(!t||!e)return 1;const{majorLineInterval:r,dynamicScaling:i}=t;return r<1?null:g(r,e,i)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:e}=this;return e?n(e.spacing,e.units,"meters"):null}get viewMetersPerPixel(){const{viewMetersPerSRUnit:e}=this;return null==e?null:e*u(this.view.scale,this.view.spatialReference)}get viewMetersPerSRUnit(){const{spatialReference:e}=this.view;return this.gridCenter?f(this.gridCenter[0],this.gridCenter[1],e):null}get pixelsPerStride(){const{gridMetersPerStride:e,viewMetersPerPixel:t}=this;return t&&e?e/t:null}get updating(){return null!=this.grid&&null!=this.spatialReference&&null==this.viewMetersPerSRUnit}async fetchCandidates(e,t,r){const{options:i,view:n}=this;if(!i?.effectiveGridEnabled||!n.grid||r.feature?.attributes&&S in r.feature.attributes)return[];const o=r.coordinateHelper.arrayToPoint(e),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(o,s)}fetchCandidatesSync(e,t){const r=[],{grid:i,effectiveViewRotation:n,gridRotation:o,gridCenter:s,viewMetersPerPixel:a,viewMetersPerSRUnit:c,offsetScaleFactor:u,spatialReference:g,gridMetersPerStride:f,pixelsPerStride:m}=this;if(!(i&&a&&c&&s&&g&&u&&f&&m))return r;if(!i.dynamicScaling&&m<d)return r;if(!p(e.spatialReference,g))return r;const S=l(e,g),w=h(S.x,S.y,S.z),x=P(w,-o,s,-n),C=f/c*u,U=j(x,C,s),{shouldSnapX:b,shouldSnapY:L}=R(U,x,t,a,c);if(!b&&!L)return[];const z=h((b?U:x)[0],(L?U:x)[1]),E=P(z,o,s,n),F=P(U,o,s,n);if(L){const e=M(U,x,C,"y"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}if(b){const e=M(U,x,C,"x"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}return b&&L&&r.push(new y(E,r[0],r[1],!1)),r}};e([o({constructOnly:!0})],w.prototype,"view",void 0),e([o()],w.prototype,"options",void 0),e([o()],w.prototype,"grid",null),e([o()],w.prototype,"effectiveViewRotation",null),e([o()],w.prototype,"gridRotation",null),e([o()],w.prototype,"gridCenter",null),e([o()],w.prototype,"offsetScaleFactor",null),e([o()],w.prototype,"spatialReference",null),e([o()],w.prototype,"gridMetersPerStride",null),e([o()],w.prototype,"viewMetersPerPixel",null),e([o()],w.prototype,"viewMetersPerSRUnit",null),e([o()],w.prototype,"pixelsPerStride",null),e([o()],w.prototype,"updating",null),w=e([s("esri.views.interactive.snapping.GridSnappingEngine")],w);const P=(e,t,r,i)=>{const n=m(e[0],e[1],e[2]);return a(n,a(n,n,r,t),r,i)},j=(e,t,r)=>{const i=(e[0]-r[0])/t,n=(e[1]-r[1])/t,o=Math.trunc(i),s=Math.trunc(n),a=Math.round(i%1),p=Math.round(n%1),l=r[0]+(o+a)*t,c=r[1]+(s+p)*t;return h(l,c)},R=(e,t,r,i,n)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const o=(e[0]-t[0])/i,s=(e[1]-t[1])/i;return{shouldSnapX:Math.abs(o*n)<r,shouldSnapY:Math.abs(s*n)<r}},M=(e,t,r,i)=>{if("y"===i){const i=t[0]>e[0]?1:-1;return h(e[0]+r*i,e[1])}const n=t[1]>e[1]?1:-1;return h(e[0],e[1]+r*n)};export{w as GridSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{K as a}from"../../../chunks/vec32.js";import{isLoadedOrLoadFor as p,project as l}from"../../../geometry/projection.js";import{getClosestDenormalizedXToReference as c}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as u}from"../../../geometry/support/scaleUtils.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as d}from"../../2d/grid/constants.js";import{getScaleFactor as g,measureMetersPerUnitAtReferencePoint as f}from"../../2d/grid/gridUtils.js";import{create as h,createWritable as m}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as S}from"./snappingUtils.js";import{IntersectionSnappingCandidate as y}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as v}from"./candidates/LineSnappingCandidate.js";let w=class extends t{constructor(e){super(e),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:e,grid:t}=this;if(!t||!e||!p(t.center.spatialReference,e))return null;try{const r=l(t.center,e),i=e.isWrappable&&null!=this.view?.center?c(r.x,this.view.center.x,e):r.x;return h(i,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:e,grid:t}=this;if(!t||!e)return 1;const{majorLineInterval:r,dynamicScaling:i}=t;return r<1?null:g(r,e,i)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:e}=this;return e?n(e.spacing,e.units,"meters"):null}get viewMetersPerPixel(){const{viewMetersPerSRUnit:e}=this;return null==e?null:e*u(this.view.scale,this.view.spatialReference)}get viewMetersPerSRUnit(){const{spatialReference:e}=this.view;return this.gridCenter?f(this.gridCenter[0],this.gridCenter[1],e):null}get pixelsPerStride(){const{gridMetersPerStride:e,viewMetersPerPixel:t}=this;return t&&e?e/t:null}get updating(){return null!=this.grid&&null!=this.spatialReference&&null==this.viewMetersPerSRUnit}async fetchCandidates(e,t,r){const{options:i,view:n}=this;if(!i?.effectiveGridEnabled||!n.grid||r.feature?.attributes&&S in r.feature.attributes)return[];const o=r.coordinateHelper.arrayToPoint(e),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(o,s)}fetchCandidatesSync(e,t){const r=[],{grid:i,effectiveViewRotation:n,gridRotation:o,gridCenter:s,viewMetersPerPixel:a,viewMetersPerSRUnit:c,offsetScaleFactor:u,spatialReference:g,gridMetersPerStride:f,pixelsPerStride:m}=this;if(!(i&&a&&c&&s&&g&&u&&f&&m))return r;if(!i.dynamicScaling&&m<d)return r;if(!p(e.spatialReference,g))return r;const S=l(e,g),w=h(S.x,S.y,S.z),x=P(w,-o,s,-n),C=f/c*u,U=j(x,C,s),{shouldSnapX:b,shouldSnapY:L}=R(U,x,t,a,c);if(!b&&!L)return[];const z=h((b?U:x)[0],(L?U:x)[1]),E=P(z,o,s,n),F=P(U,o,s,n);if(L){const e=M(U,x,C,"y"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}if(b){const e=M(U,x,C,"x"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}return b&&L&&r.push(new y(E,r[0],r[1],!1)),r}};e([o({constructOnly:!0})],w.prototype,"view",void 0),e([o()],w.prototype,"options",void 0),e([o()],w.prototype,"grid",null),e([o()],w.prototype,"effectiveViewRotation",null),e([o()],w.prototype,"gridRotation",null),e([o()],w.prototype,"gridCenter",null),e([o()],w.prototype,"offsetScaleFactor",null),e([o()],w.prototype,"spatialReference",null),e([o()],w.prototype,"gridMetersPerStride",null),e([o()],w.prototype,"viewMetersPerPixel",null),e([o()],w.prototype,"viewMetersPerSRUnit",null),e([o()],w.prototype,"pixelsPerStride",null),e([o()],w.prototype,"updating",null),w=e([s("esri.views.interactive.snapping.GridSnappingEngine")],w);const P=(e,t,r,i)=>{const n=m(e[0],e[1],e[2]);return a(n,a(n,n,r,t),r,i)},j=(e,t,r)=>{const i=(e[0]-r[0])/t,n=(e[1]-r[1])/t,o=Math.trunc(i),s=Math.trunc(n),a=Math.round(i%1),p=Math.round(n%1),l=r[0]+(o+a)*t,c=r[1]+(s+p)*t;return h(l,c)},R=(e,t,r,i,n)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const o=(e[0]-t[0])/i,s=(e[1]-t[1])/i;return{shouldSnapX:Math.abs(o*n)<r,shouldSnapY:Math.abs(s*n)<r}},M=(e,t,r,i)=>{if("y"===i){const i=t[0]>e[0]?1:-1;return h(e[0]+r*i,e[1])}const n=t[1]>e[1]?1:-1;return h(e[0],e[1]+r*n)};export{w as GridSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{v as u,h as c,H as p}from"../../../chunks/vec32.js";import{clone as f,ONES as m,create as d,UNIT_Z as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a((()=>t()),(({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)}))),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=I(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(B(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const n=M(t.orientation.actual),r=T(o.rotationAxis);if(null==n||null==r)return;const i=o.rotationAngle,l=n*r,a=(n-i)*r;i!==l&&(e?.onRotateStart(0),o.rotationAngle=l,e?.onRotate(a),e?.onRotateStop(a))}function P(t,o,e){const n=t.scale.actual?.value,r=B(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=f(m);else{const t=n/r;l=c(d(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=E(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function E(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,H):null!=e?e=h(e,0,H)[0]:null!=n&&(n=h(0,n,H)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const H=[0,0];function I(t){if(!t)return 0;const o=T(t.rotationAxis);return null!=o?o*t.rotationAngle:null}function T(t){return p(t,g)?1:p(t,q)?-1:null}const q=u(d(),g);function B(t){return t?Math.max(...t.scale):1}function O(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!C(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function C(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function G(n,r){let i=null;return o([n.on("paste",(async o=>{i?.abort(),i=t((async()=>{y()||await v(),J(o,n.info,r)}))})),t((()=>v())),e((()=>i?.abort()))])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r((()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)}))}else{const t=A(n);t&&r((()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)}))}}export{G as connectPasteEvent,O as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{v as u,h as c,G as p}from"../../../chunks/vec32.js";import{clone as f,ONES as m,create as d,UNIT_Z as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a((()=>t()),(({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)}))),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=T(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(G(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const n=M(t.orientation.actual),r=q(o.rotationAxis);if(null==n||null==r)return;const i=o.rotationAngle,l=n*r,a=(n-i)*r;i!==l&&(e?.onRotateStart(0),o.rotationAngle=l,e?.onRotate(a),e?.onRotateStop(a))}function P(t,o,e){const n=t.scale.actual?.value,r=G(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=f(m);else{const t=n/r;l=c(d(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=E(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function E(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,I):null!=e?e=h(e,0,I)[0]:null!=n&&(n=h(0,n,I)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const I=[0,0];function T(t){if(!t)return 0;const o=q(t.rotationAxis);return null!=o?o*t.rotationAngle:null}function q(t){return p(t,g)?1:p(t,B)?-1:null}const B=u(d(),g);function G(t){return t?Math.max(...t.scale):1}function H(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!O(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function O(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function C(n,r){let i=null;return o([n.on("paste",(async o=>{i?.abort(),i=t((async()=>{y()||await v(),J(o,n.info,r)}))})),t((()=>v())),e((()=>i?.abort()))])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r((()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)}))}else{const t=A(n);t&&r((()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)}))}}export{C as connectPasteEvent,H as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};