@arcgis/core 4.33.0-next.20250416 → 4.33.0-next.20250418

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 (352) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/analysis/DimensionAnalysis.js +1 -1
  4. package/analysis/DirectLineMeasurementAnalysis.js +1 -1
  5. package/analysis/LengthDimension.js +1 -1
  6. package/analysis/LineOfSightAnalysis.js +1 -1
  7. package/analysis/SliceAnalysis.js +1 -1
  8. package/analysis/Viewshed.js +1 -1
  9. package/analysis/ViewshedAnalysis.js +1 -1
  10. package/assets/components/assets/icon/browserJoin16.json +1 -0
  11. package/assets/components/assets/icon/browserJoin24.json +1 -0
  12. package/assets/components/assets/icon/browserJoin32.json +1 -0
  13. package/assets/components/assets/icon/browserPlus16.json +1 -0
  14. package/assets/components/assets/icon/browserPlus24.json +1 -0
  15. package/assets/components/assets/icon/browserPlus32.json +1 -0
  16. package/assets/components/assets/icon/check16.json +1 -1
  17. package/assets/components/assets/icon/check24.json +1 -1
  18. package/assets/components/assets/icon/check32.json +1 -1
  19. package/assets/components/assets/icon/classroomGis16.json +1 -0
  20. package/assets/components/assets/icon/classroomGis24.json +1 -0
  21. package/assets/components/assets/icon/classroomGis32.json +1 -0
  22. package/assets/components/assets/icon/documentLearning16.json +1 -0
  23. package/assets/components/assets/icon/documentLearning24.json +1 -0
  24. package/assets/components/assets/icon/documentLearning32.json +1 -0
  25. package/assets/components/assets/icon/doubleFloatSet16.json +1 -0
  26. package/assets/components/assets/icon/doubleFloatSet24.json +1 -0
  27. package/assets/components/assets/icon/doubleFloatSet32.json +1 -0
  28. package/assets/components/assets/icon/eLearningGis16.json +1 -0
  29. package/assets/components/assets/icon/eLearningGis24.json +1 -0
  30. package/assets/components/assets/icon/eLearningGis32.json +1 -0
  31. package/assets/components/assets/icon/language216.json +1 -0
  32. package/assets/components/assets/icon/language224.json +1 -0
  33. package/assets/components/assets/icon/language232.json +1 -0
  34. package/assets/components/assets/icon/layerSet16.json +1 -0
  35. package/assets/components/assets/icon/layerSet24.json +1 -0
  36. package/assets/components/assets/icon/layerSet32.json +1 -0
  37. package/assets/components/assets/icon/learningGisWorkflow16.json +1 -0
  38. package/assets/components/assets/icon/learningGisWorkflow24.json +1 -0
  39. package/assets/components/assets/icon/learningGisWorkflow32.json +1 -0
  40. package/assets/components/assets/icon/learningSteps16.json +1 -0
  41. package/assets/components/assets/icon/learningSteps24.json +1 -0
  42. package/assets/components/assets/icon/learningSteps32.json +1 -0
  43. package/assets/components/assets/icon/learningWebCourse16.json +1 -0
  44. package/assets/components/assets/icon/learningWebCourse24.json +1 -0
  45. package/assets/components/assets/icon/learningWebCourse32.json +1 -0
  46. package/assets/components/assets/icon/mapInformation16.json +1 -0
  47. package/assets/components/assets/icon/mapInformation24.json +1 -0
  48. package/assets/components/assets/icon/mapInformation32.json +1 -0
  49. package/assets/components/assets/icon/mooc16.json +1 -0
  50. package/assets/components/assets/icon/mooc24.json +1 -0
  51. package/assets/components/assets/icon/mooc32.json +1 -0
  52. package/assets/components/assets/icon/multipleVariablesSet16.json +1 -0
  53. package/assets/components/assets/icon/multipleVariablesSet24.json +1 -0
  54. package/assets/components/assets/icon/multipleVariablesSet32.json +1 -0
  55. package/assets/components/assets/icon/parameters16.json +1 -0
  56. package/assets/components/assets/icon/parameters24.json +1 -0
  57. package/assets/components/assets/icon/parameters32.json +1 -0
  58. package/assets/components/assets/icon/parametersGear16.json +1 -0
  59. package/assets/components/assets/icon/parametersGear24.json +1 -0
  60. package/assets/components/assets/icon/parametersGear32.json +1 -0
  61. package/assets/components/assets/icon/parametersPlus16.json +1 -0
  62. package/assets/components/assets/icon/parametersPlus24.json +1 -0
  63. package/assets/components/assets/icon/parametersPlus32.json +1 -0
  64. package/assets/components/assets/icon/storymapExperience16.json +1 -0
  65. package/assets/components/assets/icon/storymapExperience24.json +1 -0
  66. package/assets/components/assets/icon/storymapExperience32.json +1 -0
  67. package/assets/components/assets/icon/stringSet16.json +1 -0
  68. package/assets/components/assets/icon/stringSet24.json +1 -0
  69. package/assets/components/assets/icon/stringSet32.json +1 -0
  70. package/assets/components/assets/icon/tableSet16.json +1 -0
  71. package/assets/components/assets/icon/tableSet24.json +1 -0
  72. package/assets/components/assets/icon/tableSet32.json +1 -0
  73. package/assets/components/assets/icon/variablePlus16.json +1 -0
  74. package/assets/components/assets/icon/variablePlus24.json +1 -0
  75. package/assets/components/assets/icon/variablePlus32.json +1 -0
  76. package/assets/components/assets/icon/videoLearning16.json +1 -0
  77. package/assets/components/assets/icon/videoLearning24.json +1 -0
  78. package/assets/components/assets/icon/videoLearning32.json +1 -0
  79. package/assets/esri/core/workers/RemoteClient.js +1 -1
  80. package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +2 -0
  81. package/assets/esri/core/workers/chunks/{75e01c6404cbd51daabc.js.LICENSE.txt → 02176f84d6d57f1bc1c8.js.LICENSE.txt} +1 -1
  82. package/assets/esri/core/workers/chunks/05cba30c0d3855de7a65.js +1 -0
  83. package/assets/esri/core/workers/chunks/{7ef9bcd58af499a14a08.js → 089a19381b66cd074425.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{984c5047ab1fa632ca09.js → 0a7cba60a5286ba621d4.js} +1 -1
  85. package/assets/esri/core/workers/chunks/0be7a0f4c4f4f91d1957.js +1 -0
  86. package/assets/esri/core/workers/chunks/0c6f2808c57ff820bfdd.js +2 -0
  87. package/assets/esri/core/workers/chunks/{baed733a29aa65efc2a0.js.LICENSE.txt → 0c6f2808c57ff820bfdd.js.LICENSE.txt} +7 -1
  88. package/assets/esri/core/workers/chunks/103c78c8bfdb56227bc0.js +1 -0
  89. package/assets/esri/core/workers/chunks/184d7c8ea818bec5c462.js +1 -0
  90. package/assets/esri/core/workers/chunks/{4523ba4a3c8987abca56.js → 1c75f7e4d2e9c8e377e7.js} +1 -1
  91. package/assets/esri/core/workers/chunks/1e1c3243ac82c969bb1f.js +1 -0
  92. package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +1 -0
  93. package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +1 -0
  94. package/assets/esri/core/workers/chunks/25142d431dd1e5e82234.js +1 -0
  95. package/assets/esri/core/workers/chunks/25e19bd171eeb5634a4f.js +1 -0
  96. package/assets/esri/core/workers/chunks/26924d2f03b8a1b7a9b2.js +1 -0
  97. package/assets/esri/core/workers/chunks/27482132abb939a1cdb7.js +1 -0
  98. package/assets/esri/core/workers/chunks/2ae1dbdac9f24f4a3c84.js +1 -0
  99. package/assets/esri/core/workers/chunks/31b2ceed80796c7f6c03.js +1 -0
  100. package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +1 -0
  101. package/assets/esri/core/workers/chunks/3521a53f826f0ce6ac33.js +1 -0
  102. package/assets/esri/core/workers/chunks/3697ec74522cc5059098.js +1 -0
  103. package/assets/esri/core/workers/chunks/{60472225a228e499b1a2.js → 38557792ff9516fc991b.js} +1 -1
  104. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +1 -0
  105. package/assets/esri/core/workers/chunks/38f9ede26098eb03ca2d.js +2 -0
  106. package/assets/esri/core/workers/chunks/{239821543abbd63c5787.js.LICENSE.txt → 38f9ede26098eb03ca2d.js.LICENSE.txt} +3 -3
  107. package/assets/esri/core/workers/chunks/3f3a2c6ce48d832bf2f1.js +1 -0
  108. package/assets/esri/core/workers/chunks/{82493f51a2182f76dd2f.js → 459e3e507e8ea3e7e6ab.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{f4111bb5e5a4910b684a.js → 4867a515ddbdab97cc61.js} +1 -1
  110. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +1 -0
  111. package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +1 -0
  112. package/assets/esri/core/workers/chunks/53eaad20c4f55dae21e0.js +1 -0
  113. package/assets/esri/core/workers/chunks/55eff05354069f34bb1d.js +1 -0
  114. package/assets/esri/core/workers/chunks/569e9ec636199d1f1744.js +1 -0
  115. package/assets/esri/core/workers/chunks/598fade09fa4da759ac2.js +1 -0
  116. package/assets/esri/core/workers/chunks/5ac3096139e3eafd0e1d.js +1 -0
  117. package/assets/esri/core/workers/chunks/{93d06a1a0b700ddb3807.js → 5bdd5ae2d2f23ef6b331.js} +1 -1
  118. package/assets/esri/core/workers/chunks/5db336767959507c07e5.js +2 -0
  119. package/assets/esri/core/workers/chunks/{c03bffa13841e4f80379.js.LICENSE.txt → 5db336767959507c07e5.js.LICENSE.txt} +2 -2
  120. package/assets/esri/core/workers/chunks/5e5225623977e61fd0ef.js +1 -0
  121. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +1 -0
  122. package/assets/esri/core/workers/chunks/64640051f1fd787a3362.js +1 -0
  123. package/assets/esri/core/workers/chunks/6d230c55cde66ee905b3.js +1 -0
  124. package/assets/esri/core/workers/chunks/{c1bd47cde53918f454ca.js → 729407e372c8353cf871.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{29283c19e1ccdc6cfbde.js → 736a11e64e5f03e3936b.js} +34 -33
  126. package/assets/esri/core/workers/chunks/769b66cca8347f0f84db.js +1 -0
  127. package/assets/esri/core/workers/chunks/7c4746f60332620f75c5.js +1 -0
  128. package/assets/esri/core/workers/chunks/{b6dd25bccb9f6e19c18e.js → 7c7ff11246479382974c.js} +1 -1
  129. package/assets/esri/core/workers/chunks/7fce62ef3f0b011e0d35.js +1 -0
  130. package/assets/esri/core/workers/chunks/814d72abbfdd4552e4ec.js +2 -0
  131. package/assets/esri/core/workers/chunks/{373782e9f5d61616fde4.js.LICENSE.txt → 814d72abbfdd4552e4ec.js.LICENSE.txt} +1 -6
  132. package/assets/esri/core/workers/chunks/{07f206719763173faa8d.js → 873327fc41edd3830afa.js} +4 -4
  133. package/assets/esri/core/workers/chunks/8ea182c2fc20dba79ef2.js +1 -0
  134. package/assets/esri/core/workers/chunks/{d58fae2fc9d148e015ae.js → 90dc783a617ff053e862.js} +1 -1
  135. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +1 -0
  136. package/assets/esri/core/workers/chunks/93f792f5b94f3745b57d.js +2 -0
  137. package/assets/esri/core/workers/chunks/{3845e1d47bb51c06682e.js.LICENSE.txt → 93f792f5b94f3745b57d.js.LICENSE.txt} +1 -1
  138. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +1 -0
  139. package/assets/esri/core/workers/chunks/a276980c06d5d311a37e.js +1 -0
  140. package/assets/esri/core/workers/chunks/a600194cfe26aedc21dd.js +1 -0
  141. package/assets/esri/core/workers/chunks/{a4239e301728d594afa5.js → a6b14665a46c2af5ac11.js} +1 -1
  142. package/assets/esri/core/workers/chunks/ae13bd77a25ce8b54631.js +1 -0
  143. package/assets/esri/core/workers/chunks/ae156b99e60a2bf940e4.js +1 -0
  144. package/assets/esri/core/workers/chunks/b2f1d1721a9dd88a1adf.js +1 -0
  145. package/assets/esri/core/workers/chunks/{4275dcec730a11173661.js → b7fc99ec15e2c86a6425.js} +1 -1
  146. package/assets/esri/core/workers/chunks/b8248939373e25a8d6db.js +1 -0
  147. package/assets/esri/core/workers/chunks/bbaadce582df7e20397b.js +1 -0
  148. package/assets/esri/core/workers/chunks/{18404cd87d29b2bdc7bf.js → c4dba6cf17aece714d22.js} +1 -1
  149. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js +2 -0
  150. package/assets/esri/core/workers/chunks/{e4d522ade82192f32d54.js.LICENSE.txt → c5d786166a5609b85276.js.LICENSE.txt} +1 -1
  151. package/assets/esri/core/workers/chunks/{c589d32f8efcca6bf712.js → c6b08fdc0421258efcf5.js} +1 -1
  152. package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +1 -0
  153. package/assets/esri/core/workers/chunks/{eb61e484f090fca28937.js → cb2be1a81bdd3443f758.js} +1 -1
  154. package/assets/esri/core/workers/chunks/ccc50f28f217e50cc2c3.js +1 -0
  155. package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +1 -0
  156. package/assets/esri/core/workers/chunks/{df1225a3e751a662c182.js → d04efa51da9b4eb3a8a7.js} +1 -1
  157. package/assets/esri/core/workers/chunks/d28e2c9bdf514236b011.js +1 -0
  158. package/assets/esri/core/workers/chunks/d434d44916d32d4b10d5.js +1 -0
  159. package/assets/esri/core/workers/chunks/{50c1753ee3dc0d28ffd7.js → d696abbb1b13ac1a689b.js} +1 -1
  160. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js +2 -0
  161. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js.LICENSE.txt +3 -0
  162. package/assets/esri/core/workers/chunks/{4a15308b54734247f38e.js → dd8e72d6784a8ebc115d.js} +1 -1
  163. package/assets/esri/core/workers/chunks/de0784474d2e9e504a91.js +1 -0
  164. package/assets/esri/core/workers/chunks/{aca3ccb9599bcc444617.js → e1472af8f5d64c057d04.js} +1 -1
  165. package/assets/esri/core/workers/chunks/e27fa1e84f16b7f19a90.js +1 -0
  166. package/assets/esri/core/workers/chunks/e2cd6038d9c7167b128e.js +1 -0
  167. package/assets/esri/core/workers/chunks/{0252d853419adc203f04.js → ef6e805c49e1afdf966b.js} +1 -1
  168. package/assets/esri/core/workers/chunks/f2bc75a718a10065011d.js +1 -0
  169. package/assets/esri/core/workers/chunks/{1263391920fbb8926ced.js → f34ce3c37a385b341631.js} +1 -1
  170. package/assets/esri/core/workers/chunks/{e3d25d027885eb1a415f.js → f458a40e1f8fce3ad23c.js} +1 -1
  171. package/assets/esri/core/workers/chunks/f65b720b750aebca1bcd.js +1 -0
  172. package/assets/esri/core/workers/chunks/fdcbd28f38bc485ac5e3.js +1 -0
  173. package/assets/esri/themes/dark/main.css +1 -1
  174. package/assets/esri/themes/light/main.css +1 -1
  175. package/assets/esri/themes/light/view.css +1 -1
  176. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  177. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  178. package/chunks/BloomComposition.glsl.js +25 -19
  179. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  180. package/chunks/ComponentShader.glsl.js +14 -14
  181. package/chunks/DefaultMaterial.glsl.js +6 -6
  182. package/chunks/Fog.glsl.js +3 -3
  183. package/chunks/Haze.glsl.js +1 -1
  184. package/chunks/OITBlend.glsl.js +1 -0
  185. package/chunks/Path.glsl.js +3 -3
  186. package/chunks/RealisticTree.glsl.js +5 -5
  187. package/chunks/SSAO.glsl.js +5 -4
  188. package/chunks/Viewshed.glsl.js +1 -1
  189. package/core/promiseUtils.d.ts +1 -0
  190. package/core/urlUtils.d.ts +4 -0
  191. package/identity/IdentityModal.js +1 -1
  192. package/interfaces.d.ts +335 -42
  193. package/intl/date.js +1 -1
  194. package/intl/messages.js +1 -1
  195. package/intl/number.js +1 -1
  196. package/layers/FeatureLayer.js +1 -1
  197. package/layers/ParquetLayer.js +1 -1
  198. package/layers/VideoLayer.js +1 -1
  199. package/layers/ViewshedLayer.js +1 -1
  200. package/layers/graphics/sources/ParquetSource.js +1 -1
  201. package/layers/save/featureLayerUtils.js +1 -1
  202. package/layers/support/ParquetEncodingBase.js +5 -0
  203. package/layers/support/ParquetEncodingLocation.js +5 -0
  204. package/layers/support/ParquetEncodingWkb.js +5 -0
  205. package/layers/support/domainUtils.js +1 -1
  206. package/layers/support/fieldUtils.js +1 -1
  207. package/layers/support/labelingInfo.js +1 -1
  208. package/layers/support/layerUtils.js +1 -1
  209. package/layers/support/parquetUtils.js +5 -0
  210. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  211. package/layers/video/VideoController.js +1 -1
  212. package/layers/video/videoUtils.js +1 -1
  213. package/libs/parquet/parquet.js +1 -1
  214. package/networks/UtilityNetwork.js +1 -1
  215. package/package.json +2 -2
  216. package/portal/PortalItem.js +1 -1
  217. package/portal/PortalUser.js +1 -1
  218. package/portal/support/portalItemUtils.js +1 -1
  219. package/rest/featureService/FeatureService.js +1 -1
  220. package/rest/networks/support/NetworkElement.js +1 -1
  221. package/rest/networks/support/TelecomNetworkElement.js +5 -0
  222. package/rest/networks/trace.js +1 -1
  223. package/rest/print.js +1 -1
  224. package/support/TablesMixin.js +1 -1
  225. package/support/modeUtils.js +5 -0
  226. package/support/revision.js +1 -1
  227. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  228. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  229. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  230. package/views/2d/layers/VideoLayerView2D.js +1 -1
  231. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  232. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  233. package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
  234. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  235. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  236. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  237. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  238. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  239. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  240. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  241. package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
  242. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  243. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  244. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  245. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  246. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  247. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  248. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  249. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +1 -1
  250. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
  251. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  252. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +5 -0
  253. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  254. package/views/3d/webgl-engine/effects/haze/HazeTechniqueConfiguration.js +1 -1
  255. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  256. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  257. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  258. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  259. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  260. package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +20 -2
  261. package/views/ToolViewManager.js +1 -1
  262. package/views/analysis/analysisViewUtils.js +1 -1
  263. package/views/draw/support/HighlightHelper.js +1 -1
  264. package/views/interactive/InteractiveToolBase.js +1 -1
  265. package/views/interactive/Tooltip.js +1 -1
  266. package/views/interactive/interactiveToolUtils.js +1 -1
  267. package/views/interactive/keybindings.js +1 -1
  268. package/views/ui/UI.js +1 -1
  269. package/webdoc/support/saveUtils.js +1 -1
  270. package/webdoc/support/webdocSaveUtils.js +1 -1
  271. package/widgets/Editor.js +1 -1
  272. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  273. package/widgets/Feature/FeatureMedia.js +1 -1
  274. package/widgets/Feature/support/featureUtils.js +1 -1
  275. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  276. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  277. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  278. package/widgets/FeatureTable.js +1 -1
  279. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  280. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  281. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  282. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  283. package/widgets/OrientedImageryViewer.js +1 -1
  284. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  285. package/widgets/Slider/SliderViewModel.js +1 -1
  286. package/widgets/Slider.js +1 -1
  287. package/widgets/TimeSlider.js +1 -1
  288. package/widgets/support/AnalysisViewModel.js +1 -1
  289. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  290. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  291. package/widgets/support/widget.js +1 -1
  292. package/assets/esri/core/workers/chunks/0297e55a49ca0d1231ef.js +0 -1
  293. package/assets/esri/core/workers/chunks/04008648c59031bca8ea.js +0 -1
  294. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +0 -1
  295. package/assets/esri/core/workers/chunks/0b4e63e705db09dbe171.js +0 -1
  296. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +0 -1
  297. package/assets/esri/core/workers/chunks/1b87fa15470cce26feea.js +0 -1
  298. package/assets/esri/core/workers/chunks/239821543abbd63c5787.js +0 -2
  299. package/assets/esri/core/workers/chunks/272a309760dacb13dee3.js +0 -1
  300. package/assets/esri/core/workers/chunks/2791f1f2791087d0217f.js +0 -1
  301. package/assets/esri/core/workers/chunks/35dccd3883d2e466c42e.js +0 -1
  302. package/assets/esri/core/workers/chunks/364860a42edc0c3b8d5b.js +0 -1
  303. package/assets/esri/core/workers/chunks/373782e9f5d61616fde4.js +0 -2
  304. package/assets/esri/core/workers/chunks/37e49d1a1407c193dcd0.js +0 -1
  305. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +0 -1
  306. package/assets/esri/core/workers/chunks/3845e1d47bb51c06682e.js +0 -2
  307. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +0 -1
  308. package/assets/esri/core/workers/chunks/42aab2a336ee22fd9055.js +0 -1
  309. package/assets/esri/core/workers/chunks/4ba34124054752b363c0.js +0 -1
  310. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +0 -1
  311. package/assets/esri/core/workers/chunks/593396b4c210da77a131.js +0 -1
  312. package/assets/esri/core/workers/chunks/5b32c2a1b276352593dc.js +0 -1
  313. package/assets/esri/core/workers/chunks/5df4e73905c0ae75e37c.js +0 -1
  314. package/assets/esri/core/workers/chunks/5fb9bb3ac2f60dbd59c4.js +0 -1
  315. package/assets/esri/core/workers/chunks/66e90f7d473d1f688254.js +0 -1
  316. package/assets/esri/core/workers/chunks/68d7babbe7e0d934e056.js +0 -1
  317. package/assets/esri/core/workers/chunks/6e6b60779c11efc128af.js +0 -1
  318. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +0 -1
  319. package/assets/esri/core/workers/chunks/75e01c6404cbd51daabc.js +0 -2
  320. package/assets/esri/core/workers/chunks/77660e18ea793ae85f83.js +0 -1
  321. package/assets/esri/core/workers/chunks/7f36cffc6ed984b7e467.js +0 -1
  322. package/assets/esri/core/workers/chunks/7f86c9ec45f4fae1fb49.js +0 -1
  323. package/assets/esri/core/workers/chunks/879d672d12f9ef2e1b50.js +0 -1
  324. package/assets/esri/core/workers/chunks/90442f47c9f31f26b453.js +0 -1
  325. package/assets/esri/core/workers/chunks/91439b59260b0fb04be9.js +0 -1
  326. package/assets/esri/core/workers/chunks/96978d039f183565bffa.js +0 -1
  327. package/assets/esri/core/workers/chunks/999a4f7ca581f28cc1c4.js +0 -1
  328. package/assets/esri/core/workers/chunks/af41dcc8006cd0f451c2.js +0 -1
  329. package/assets/esri/core/workers/chunks/af9fda47d02c51a2c7da.js +0 -1
  330. package/assets/esri/core/workers/chunks/baed733a29aa65efc2a0.js +0 -2
  331. package/assets/esri/core/workers/chunks/c03bffa13841e4f80379.js +0 -2
  332. package/assets/esri/core/workers/chunks/c7ab674764312d65348f.js +0 -1
  333. package/assets/esri/core/workers/chunks/ca0572fe5614005acceb.js +0 -1
  334. package/assets/esri/core/workers/chunks/d2c7067bb6654c0e2793.js +0 -1
  335. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +0 -1
  336. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +0 -1
  337. package/assets/esri/core/workers/chunks/e13caf9691f556071e31.js +0 -1
  338. package/assets/esri/core/workers/chunks/e14449f07ed3386f4f2b.js +0 -1
  339. package/assets/esri/core/workers/chunks/e31bb256921807464715.js +0 -1
  340. package/assets/esri/core/workers/chunks/e4d522ade82192f32d54.js +0 -2
  341. package/assets/esri/core/workers/chunks/e5713b757f770a138b8c.js +0 -1
  342. package/assets/esri/core/workers/chunks/e6544e966f14fb410157.js +0 -1
  343. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +0 -1
  344. package/assets/esri/core/workers/chunks/e7cb4003c45e42b48ea6.js +0 -1
  345. package/assets/esri/core/workers/chunks/eb011e8b14db37ddb110.js +0 -1
  346. package/assets/esri/core/workers/chunks/efb0f3ec2344adcb24f3.js +0 -1
  347. package/assets/esri/core/workers/chunks/f0c864425f000ab87a7b.js +0 -1
  348. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +0 -1
  349. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +0 -1
  350. package/assets/esri/core/workers/chunks/fa2d836d4a844b26b84e.js +0 -1
  351. package/layers/support/parquetLayerUtils.js +0 -5
  352. package/support/themeUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{AFeatureTile as i}from"./AFeatureTile.js";import{RESHUFFLING_EXEMPT_MEMORY_BYTES as r,RESHUFFLING_TARGET_MEMORY_EFFICIENCY as n,RESHUFFLING_EXEMPT_DRAW_CALLS as o,RESHUFFLING_TARGET_DRAW_EFFICIENCY as d,tileSize as h}from"./definitions.js";import a from"./DisplayEntity.js";import{FeatureBatchingStrategy as l}from"./enums.js";import{DisplayList as c}from"./FeatureDisplayList.js";import{ReshufflePlan as f}from"./ReshufflePlan.js";import{LabelMetric as u}from"./collisions/LabelMetric.js";import{MappedMesh as _}from"./cpuMapped/MappedMesh.js";import{debugMeshDataInfo as m}from"./mesh/meshDebugUtils.js";import p from"./util/Reader.js";import{deserializeList as y}from"./util/serializationUtils.js";const g=()=>e.getLogger("esri.views.2d.engine.webgl.FeatureTile");let b=0;class I extends i{constructor(e,i,r,n,o,d,h=!1){super(e,i,r,n),this._fader=o,this._labelInstanceId=d,this._meshes=new Map,this._entities=[],this._entityIndex=new Map,this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=b++,this._metrics=[],this._clearedMetrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.neededForCoverage=!1,this.isCoverage=!1,this.rendering=!1,this._decluttered=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=t(),this.transforms.tileUnitsToPixels=s(),this.enableDeferredUploads=h}destroy(){super.destroy(),this.clear(),this._finalizeMetricClear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._clearedMetrics=this._metrics,this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this.isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),this.decluttered=!1,!0)}get decluttered(){return this._decluttered}set decluttered(e){this._decluttered=e,this.requestRender()}get id(){return this.key.id}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}get _hasMetrics(){return this._metrics.length>0}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t){if(this._uploadAllowed&&this._invalidated){this._entities.sort(((e,t)=>{const s=t.sortKey,i=e.sortKey;return i===s?e.id-t.id:i-s})),t===l.BATCHING&&this.reshuffle(!0),this._displayList=c.fromDisplayEntities(this._entities,this,e,t);for(const e of this._meshes.values())e.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:s,sortKey:i}of this._entities)if(e.has(s)&&t.set(s,i),t.size===e.size)break;return t}onMessage(e){if(e.objectIdMap)for(const t in e.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[t]=e.objectIdMap[t];switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}this.writeLabelVisibility()}_onAppendMessage(e){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:m(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=y(new p(e.append.entities),a);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:m(e.modify),remove:e.remove});const t=y(new p(e.modify.entities),a),s=t.map((e=>e.id)),i=e.isPixelBuffer??!1,r=[...e.remove,...s];i?this._removeByIdsFromBuffer(r):this._removeByIds(r),this._insert(t,e.modify.data,i)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const s of this._entities)for(const i of s.records){const s=this._meshes.get(i.instanceId);let r=t.get(s);r||(r=new f(e),t.set(s,r)),r.copyRecord(i)}for(const[s,i]of t)s.reshuffle(i);this._invalidated=!0,this._aggregateMemoryStats(),has("esri-2d-update-debug")&&g().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,s,i){const r=s*h,n=i*h;for(const o of e._entities){let s=null;for(const i of o.records)if(i.overlaps&t){const t=e.getMesh(i.instanceId),d=this._ensureMesh(i.instanceId,t.layout,t.useVisibility).copyRecordFrom(t,i,r,n);s||(s=new a(o.id,o.sortKey),this._entityIdsFromBuffer.add(o.id),this._entityIndex.set(s.id,s),this._entities.push(s)),s.records.push(d)}}this._invalidated=!0}writeLabelVisibility(){if(this._clearedMetrics.length)return this._finalizeMetricClear();const e=this._meshes.get(this._labelInstanceId);if(e&&this._hasMetrics){for(const t of this._metrics){const s=this._entityIndex.get(t.entityTexel);if(!s)continue;const i=t.uniqueSymbol.show&&t.selectedForRendering;e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}this._invalidated=!0}}_ensureMesh(e,t,s){return this._meshes.has(e)||this._meshes.set(e,new _(this._stage.bufferPool,t,s)),this._meshes.get(e)}_insert(e,t,s){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const i=this._insertVertexData(t);for(const r of e){for(const e of r.records)e.updateBaseOffsets(i.get(e.instanceId));s?this._tryInsertBufferedEntity(r):this._insertEntity(r)}this._invalidated=!0}_insertMetrics(e){for(const t of e)t.tile=this;this._metrics.push(...e),this._fader?.insertFeatureTileMetrics(this,e)}_insertVertexData(e){const t=new Map;for(const s of e){const{instanceId:e,layout:i}=s,r=i.attributes.some((e=>"visibility"===e.name)),n=this._ensureMesh(e,i,r).append(s);if(s.metrics){const e=y(new p(s.metrics),u)??[];this._insertMetrics(e)}t.set(e,n)}return t}_insertEntity(e){has("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEntity: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const s of e)this._entityIdsFromBuffer.has(s.id)&&t.push(s.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter((e=>this._entityIdsFromBuffer.has(e))))}_removeByIds(e){if(0===e.length)return;const t=new Set(e),s=[];for(const r of this._entities)t.has(r.id)?(this._remove(r),this._entityIndex.delete(r.id)):s.push(r);const i=[];for(const r of this._metrics)t.has(r.entityTexel)?this._clearedMetrics.push(r):i.push(r);this._entities=s,this._metrics=i,this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:e,indexStart:s,indexCount:i,vertexStart:r,vertexCount:n}=t;this._meshes.get(e)?.remove(s,i,r,n)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const e of this._meshes.values())this.debugInfo.memory.bytesUsed+=e.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=e.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,s=e/t,{minOrderedLength:i,length:h}=this.debugInfo.display;return t>r&&s<n||h>o&&i/h<d}get entityIds(){return this._objectIdMap?this._entities.map((({id:e})=>({objectId:this._objectIdMap[e],displayId:e}))):[]}_finalizeMetricClear(){if(!this._clearedMetrics.length)return;this._fader.removeFeatureTileMetrics(this,this._clearedMetrics),this._clearedMetrics.length=0,this._invalidated=!0;const e=this._meshes.get(this._labelInstanceId);if(e)for(const t of this._metrics){const s=this._entityIndex.get(t.entityTexel);if(!s)continue;const i=t.uniqueSymbol.show&&t.uniqueSymbol.tileSymbols.some((e=>e.selectedForRendering&&e.tile.key.equals(this.key)));e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}}}export{I as FeatureTile};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{AFeatureTile as i}from"./AFeatureTile.js";import{RESHUFFLING_EXEMPT_MEMORY_BYTES as r,RESHUFFLING_TARGET_MEMORY_EFFICIENCY as n,RESHUFFLING_EXEMPT_DRAW_CALLS as o,RESHUFFLING_TARGET_DRAW_EFFICIENCY as d,tileSize as h}from"./definitions.js";import a from"./DisplayEntity.js";import{FeatureBatchingStrategy as l}from"./enums.js";import{DisplayList as c}from"./FeatureDisplayList.js";import{ReshufflePlan as f}from"./ReshufflePlan.js";import{LabelMetric as u}from"./collisions/LabelMetric.js";import{MappedMesh as _}from"./cpuMapped/MappedMesh.js";import{debugMeshDataInfo as m}from"./mesh/meshDebugUtils.js";import p from"./util/Reader.js";import{deserializeList as y}from"./util/serializationUtils.js";const g=()=>e.getLogger("esri.views.2d.engine.webgl.FeatureTile");let b=0;class I extends i{constructor(e,i,r,n,o,d,h=!1){super(e,i,r,n),this._fader=o,this._labelInstanceId=d,this._meshes=new Map,this._entities=[],this._entityIndex=new Map,this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=b++,this._metrics=[],this._clearedMetrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.neededForCoverage=!1,this.isCoverage=!1,this.rendering=!1,this._decluttered=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=t(),this.transforms.tileUnitsToPixels=s(),this.enableDeferredUploads=h}destroy(){super.destroy(),this.clear(),this._finalizeMetricClear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._clearedMetrics=this._metrics,this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this.isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),this.decluttered=!1,!0)}get decluttered(){return this._decluttered}set decluttered(e){this._decluttered=e,this.requestRender()}get id(){return this.key.id}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}get _hasMetrics(){return this._metrics.length>0}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t){if(this._uploadAllowed&&this._invalidated){this._entities.sort(((e,t)=>{const s=t.sortKey,i=e.sortKey;return i===s?e.id-t.id:i-s})),t===l.BATCHING&&this.reshuffle(!0),this._displayList=c.fromDisplayEntities(this._entities,this,e,t);for(const e of this._meshes.values())e.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:s,sortKey:i}of this._entities)if(e.has(s)&&t.set(s,i),t.size===e.size)break;return t}onMessage(e){if(e.objectIdMap)for(const t in e.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[t]=e.objectIdMap[t];switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}this.writeLabelVisibility()}_onAppendMessage(e){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:m(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=y(new p(e.append.entities),a);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:m(e.modify),remove:e.remove});const t=y(new p(e.modify.entities),a),s=t.map((e=>e.id)),i=e.isPixelBuffer??!1,r=[...e.remove,...s];i?this._removeByIdsFromBuffer(r):this._removeByIds(r),this._insert(t,e.modify.data,i)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const s of this._entities)for(const i of s.records){const s=this._meshes.get(i.instanceId);let r=t.get(s);r||(r=new f(e),t.set(s,r)),r.copyRecord(i)}for(const[s,i]of t)s.reshuffle(i);this._invalidated=!0,this._aggregateMemoryStats(),has("esri-2d-update-debug")&&g().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,s,i){const r=s*h,n=i*h;for(const o of e._entities){let s=null;for(const i of o.records)if(i.overlaps&t){const t=e.getMesh(i.instanceId),d=this._ensureMesh(i.instanceId,t.layout,t.useVisibility).copyRecordFrom(t,i,r,n);s||(s=new a(o.id,o.sortKey),this._entityIdsFromBuffer.add(o.id),this._entityIndex.set(s.id,s),this._entities.push(s)),s.records.push(d)}}this._invalidated=!0}writeLabelVisibility(){if(this._clearedMetrics.length)return this._finalizeMetricClear();const e=this._meshes.get(this._labelInstanceId);if(e&&this._hasMetrics){for(const t of this._metrics){const s=this._entityIndex.get(t.featureID);if(!s)continue;const i=t.uniqueSymbol.show&&t.selectedForRendering;e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}this._invalidated=!0}}_ensureMesh(e,t,s){return this._meshes.has(e)||this._meshes.set(e,new _(this._stage.bufferPool,t,s)),this._meshes.get(e)}_insert(e,t,s){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const i=this._insertVertexData(t);for(const r of e){for(const e of r.records)e.updateBaseOffsets(i.get(e.instanceId));s?this._tryInsertBufferedEntity(r):this._insertEntity(r)}this._invalidated=!0}_insertMetrics(e){for(const t of e)t.tile=this;this._metrics.push(...e),this._fader?.insertFeatureTileMetrics(this,e)}_insertVertexData(e){const t=new Map;for(const s of e){const{instanceId:e,layout:i}=s,r=i.attributes.some((e=>"visibility"===e.name)),n=this._ensureMesh(e,i,r).append(s);if(s.metrics){const e=y(new p(s.metrics),u)??[];this._insertMetrics(e)}t.set(e,n)}return t}_insertEntity(e){has("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEntity: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const s of e)this._entityIdsFromBuffer.has(s.id)&&t.push(s.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter((e=>this._entityIdsFromBuffer.has(e))))}_removeByIds(e){if(0===e.length)return;const t=new Set(e),s=[];for(const r of this._entities)t.has(r.id)?(this._remove(r),this._entityIndex.delete(r.id)):s.push(r);const i=[];for(const r of this._metrics)t.has(r.featureID)?this._clearedMetrics.push(r):i.push(r);this._entities=s,this._metrics=i,this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:e,indexStart:s,indexCount:i,vertexStart:r,vertexCount:n}=t;this._meshes.get(e)?.remove(s,i,r,n)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const e of this._meshes.values())this.debugInfo.memory.bytesUsed+=e.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=e.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,s=e/t,{minOrderedLength:i,length:h}=this.debugInfo.display;return t>r&&s<n||h>o&&i/h<d}get entityIds(){return this._objectIdMap?this._entities.map((({id:e})=>({objectId:this._objectIdMap[e],displayId:e}))):[]}_finalizeMetricClear(){if(!this._clearedMetrics.length)return;this._fader.removeFeatureTileMetrics(this,this._clearedMetrics),this._clearedMetrics.length=0,this._invalidated=!0;const e=this._meshes.get(this._labelInstanceId);if(e)for(const t of this._metrics){const s=this._entityIndex.get(t.featureID);if(!s)continue;const i=t.uniqueSymbol.show&&t.uniqueSymbol.tileSymbols.some((e=>e.selectedForRendering&&e.tile.key.equals(this.key)));e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}}}export{I as FeatureTile};
@@ -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{numericHash as e}from"../../../../../core/string.js";import{labelPlacementOffsetPadding as i}from"../definitions.js";import{VVBinding as t}from"../enums.js";import r from"./BoundingBox.js";import{serializeList as s,deserializeList as n}from"../util/serializationUtils.js";const o=2;class h{constructor(i,t,r,s,n,o,h,a,l,c=[],d=0,u=0){this.entityTexel=i,this.labelClassId=t,this.anchorX=r,this.anchorY=s,this.directionX=n,this.directionY=o,this.maxScale=h,this.minScale=a,this.referenceBounds=l,this.bounds=c,this.recordStart=d,this.recordCount=u,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1,this.hash=e(`${i} ${t}`)}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(e){if(!this._colliders){const r=e.attributeView,s=i;let n=this.referenceBounds?.size??0;const h=e.layerView.labelingCollisionInfos[0].vvEvaluators[0];if(null!=h){const e=h(r.getVisualVariableData(this.entityTexel,t.SIZE));n=isNaN(e)||null==e||e===1/0?n:e}const a=this.minScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.minScale):0,l=this.maxScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.maxScale):25,c=this.directionX*(s+n/2),d=this.directionY*(s+n/2);this._colliders=this.bounds.map((e=>({xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+c,dyPixels:e.y-e.halfHeight+d,hard:!0,partIndex:1,width:e.width+o,height:e.height+o,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:a,maxLod:l})))}return this._colliders}get featureID(){return this.entityTexel}serialize(e){e.push(this.entityTexel),e.push(this.labelClassId),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),null===this.referenceBounds?(e.writeF32(0),e.writeF32(0),e.writeF32(0)):(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)),s(e,this.bounds)}static deserialize(e){const i=e.readInt32(),t=e.readInt32(),s=e.readInt32(),o=e.readInt32(),a=e.readF32(),l=e.readF32(),c=e.readF32(),d=e.readF32(),u=e.readF32(),f=e.readF32(),m=e.readF32(),F=e.readF32(),w=e.readF32(),x=n(e,r)??[];return new h(i,t,a,l,c,d,u,f,{size:m,offsetX:F,offsetY:w},x,s,o)}}export{h as LabelMetric};
5
+ import{numericHash as e}from"../../../../../core/string.js";import{labelPlacementOffsetPadding as i}from"../definitions.js";import{VVBinding as t}from"../enums.js";import s from"./BoundingBox.js";import{serializeList as r,deserializeList as n}from"../util/serializationUtils.js";const a=2;class h{constructor(i,t,s,r,n,a,h,o,l,d,c=[],u=0,f=0){this.displayId=i,this.labelId=t,this.labelClassId=s,this.anchorX=r,this.anchorY=n,this.directionX=a,this.directionY=h,this.maxScale=o,this.minScale=l,this.referenceBounds=d,this.bounds=c,this.recordStart=u,this.recordCount=f,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1,this.hash=e(`${i}${t}${s}`)}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(e){if(!this._colliders){const s=e.attributeView,r=i;let n=this.referenceBounds?.size??0;const h=e.layerView.labelingCollisionInfos[0].vvEvaluators[0];if(null!=h){const e=h(s.getVisualVariableData(this.displayId,t.SIZE));n=isNaN(e)||null==e||e===1/0?n:e}const o=this.minScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.minScale):0,l=this.maxScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.maxScale):25,d=this.directionX*(r+n/2),c=this.directionY*(r+n/2);this._colliders=this.bounds.map((e=>({xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+c,hard:!0,partIndex:1,width:e.width+a,height:e.height+a,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:o,maxLod:l})))}return this._colliders}get featureID(){return this.displayId}serialize(e){e.push(this.displayId),e.push(this.labelId),e.push(this.labelClassId),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){const i=e.readInt32(),t=e.readInt32(),r=e.readInt32(),a=e.readInt32(),o=e.readInt32(),l=e.readF32(),d=e.readF32(),c=e.readF32(),u=e.readF32(),f=e.readF32(),m=e.readF32(),F=e.readF32(),w=e.readF32(),p=e.readF32(),S=n(e,s)??[];return new h(i,t,r,l,d,c,u,f,m,{size:F,offsetX:w,offsetY:p},S,a,o)}}export{h as LabelMetric};
@@ -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{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{fromRotation as i,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as r}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as n,sub as a,normalize as l,add as c,scale as h}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as m}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{generalizeOptimizedGeometry as u,convertToGeometry as f}from"../../../../../../../layers/graphics/featureConversionUtils.js";import g from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as p,minMaxZoomPrecisionFactor as _}from"../../../definitions.js";import{getDisplayIdTexel as b}from"../../../DisplayId.js";import M from"../../../collisions/BoundingBox.js";import{LabelMetric as x}from"../../../collisions/LabelMetric.js";import{smoothPaths as v,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as P,processColorInput as w}from"../fill/meshWriterUtils.js";import{TextMeshWriter as L,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,D=128,I=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class A extends L{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),s=t.readYForDisplay();this._writePoint(e,i,s,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const i=t.readCentroidForDisplay();if(!i)return;const[s,r]=i.coords;this._writePoint(e,s,r,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,s){const r=b(e),[o,n]=this._getMetricDir(),a=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,c=this.evaluatedMeshParams.labelClassId;return new x(r,c,t,i,o,n,a,l,s??null)}_writePoint(e,t,i,s){if(t<0||t>p||i<0||i>p)return;const r=this._getShaping();if(!r)return;const o=s.getDisplayId(),n=this.evaluatedMeshParams.labelClassId,[a,l]=this._getMetricDir(),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,m=b(s.getDisplayId()),d=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new x(m,n,t,i,a,l,c,h,d)),this._writeGlyphs(e,o,t,i,r,0,d,void 0,!1),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,s)=>this._placeSubdivGlyphs(e,t,i,s),a=(o.bounds.width+r)/(1<<S);this._current={out:e,id:t.getDisplayId(),shaping:o,zoomRange:P(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null},this._verticalPlacement="bottom"===s?"above":"top"===s?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=r.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new g;u(a,n,!1,!1,"esriGeometryPolyline",1);const l=G(new g,a,o),c=G(new g,a,-o),h=f(c,"esriGeometryPolyline",!1,!1),m=f(l,"esriGeometryPolyline",!1,!1),d=v(m.paths,r.bounds.width),p=v(h.paths,r.bounds.width);this._current.offsetDirection="above";for(const u of d)y(u,i,t,!!s);this._current.offsetDirection="below";for(const u of p)y(u,i,t,!!s)}_writeCenterAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=v(e.readLegacyGeometryForDisplay().paths,r.bounds.width);for(const n of o)y(n,i,t,!!s)}_placeSubdivGlyphs(e,t,i,s){const{allowOverrun:r,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=I(t),c=this._current.shaping.bounds.width/(1<<S),h=Math.sqrt(n||D)/(1<<S),m=Math.min(i,s-i),d=this._current.shaping.isMultiline?B:Math.log2(m/(h+c/2)),u=0===t?d:Math.min(l,d),f=Math.max(a,this._zoomLevel+S-u),g=this._zoomLevel-f,p=this._current.shaping.bounds.width/2*2**g;this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f):r&&g<0?this._placeStraightAlong(e,a):"parallel"===o?this._placeStraightAlong(e,f):"curved"===o&&this._placeCurved(e,f,p)}_placeStraight(e,t){const{out:i,id:s,shaping:r,referenceBounds:o}=this._current,{x:n,y:a}=e;i.metricStart(this._createLineLabelMetric(s,n,a)),i.metricBoxWrite(r.boundsT);const l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360,h={clipAngle:l,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,h,!1);const m={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,m,!1),i.metricEnd()}_placeCurved(e,t,i){const{out:s,id:r}=this._current;s.metricStart(this._createLineLabelMetric(r,e.x,e.y));const o=e.clone(),n=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(o,t,1,n),this._placeBack(e,o,t,i,1,n),this._placeForward(e,o,t,i,1,n)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(o,t,0,a),this._placeBack(e,o,t,i,0,a),this._placeForward(e,o,t,i,0,a)),s.metricEnd()}_placeStraightAlong(e,o){const{out:n,id:a,shaping:l,zoomRange:c,referenceBounds:h}=this._current,{boxBorderLineColor:d,boxBackgroundColor:u}=this.evaluatedMeshParams,f=e.clone(),g=e.angle*(180/Math.PI)%360,p=(e.angle*(180/Math.PI)+180)%360,_=l.glyphs.length>0&&!(!d&&!u);if(n.metricStart(this._createLineLabelMetric(a,e.x,e.y)),_){const d=Math.max(o,c[0],0),u=Math.min(B,c[1]),f=i(r(),-e.angle),_={minZoom:d,maxZoom:u,clipAngle:g,mapAligned:!0,isLineLabel:!0},b=t(this.evaluatedMeshParams.offsetX),M=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=m(b,-1*M),[i,o]=l.shapeBackground(s(r(),f,t));n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,_),n.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=m(b,M),[i,o]=l.shapeBackground(s(r(),f,t));_.clipAngle=p,n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,_),n.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(f,o,1,g,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(f,o,0,p,!0),n.metricEnd()}_placeBack(e,t,i,s,r,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=s);)this._placeOnSegment(n,t,a,i,-1,r,o),a+=n.length+z}_placeForward(e,t,i,s,r,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,t,a,i,1,r,o),a+=n.length+z}_placeFirst(e,s,n,a,l=!1){const{out:c,id:h,shaping:d,zoomRange:u,referenceBounds:f}=this._current,g=d.glyphs,p=t(this.evaluatedMeshParams.offsetX),_=t(this.evaluatedMeshParams.offsetY),b=m(p,_),x=i(r(),-e.angle);o(b,b,x);for(const t of g){const i=t.x>d.bounds.x?n:1-n,r=i*e.remainingLength+(1-i)*e.backwardLength,o=Math.abs(t.x+t.width/2-d.bounds.x),m=Math.max(0,this._zoomLevel+Math.log2(o/(r+z))),g=Math.max(s,l?0:m);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-n)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(n||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new M(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,s,n,a,l,c,h){const{out:d,id:u,shaping:f,referenceBounds:g}=this._current,p=f.glyphs,_=e.dx/e.length,b=e.dy/e.length,x={x:e.x+n*-l*_,y:e.y+n*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=m(v,y),w=i(r(),-e.angle);o(P,P,w);for(const t of p){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const s=Math.abs(t.x+t.width/2-f.bounds.x),r=Math.max(0,this._zoomLevel+Math.log2(s/n)-.1),o=Math.max(a,this._zoomLevel+Math.log2(s/(n+e.length+z)));if(0!==r&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=o,t.maxZoom=r,this._writeLineGlyph(d,u,x.x,x.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new M(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);d.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,s,r,o,n,a){if(i<0||i>p||s<0||s>p)return;e.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:l,offsets:c}=r,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:w(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],r.minZoom),maxZoom:Math.min(this._current.zoomRange[1],r.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*_)/_}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),s=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),s=this._packedZoom(s);const r=this._packedZoom(this._zoomLevel);return i<=r&&r<=s}}function G(e,t,i){const{coords:s,lengths:r}=t,o=d(),m=d(),u=d(),f=d(),g=d(),p=d(),_=2;let b=0;for(let d=0;d<r.length;d++){const t=r[d];for(let r=0;r<t;r++){const d=_*(r+b-1),M=_*(r+b),x=_*(r+b+1);r>0?n(o,s[d],s[d+1]):n(o,0,0),n(m,s[M],s[M+1]),r<t-1?n(u,s[x],s[x+1]):n(u,0,0),0===r?n(f,0,0):(a(f,m,o),l(f,f),n(f,f[1],-f[0])),r===t-1?n(g,0,0):(a(g,u,m),l(g,g),n(g,g[1],-g[0])),c(p,f,g),l(p,p);const v=p[0]*g[0]+p[1]*g[1];0!==v&&h(p,p,v),h(p,p,i),e.coords.push(m[0]+p[0],m[1]+p[1])}e.lengths.push(t),b+=t}return e}export{A as LabelMeshWriter};
5
+ import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{fromRotation as i,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as r}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as n,sub as a,normalize as l,add as c,scale as h}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as m}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as u}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as f,convertToGeometry as g}from"../../../../../../../layers/graphics/featureConversionUtils.js";import _ from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as p,minMaxZoomPrecisionFactor as b}from"../../../definitions.js";import x from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as v,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as P,processColorInput as w}from"../fill/meshWriterUtils.js";import{TextMeshWriter as L,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,A=128,D=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class I extends L{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),s=t.readYForDisplay();this._writePoint(e,i,s,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[s,r]=i.coords;this._writePoint(e,s,r,0,t);break}case"esriGeometryMultipoint":{let i=0;const s=u.fromFeatureSetReader(t);if(s?.nextPath())for(;s.nextPoint();)this._writePoint(e,s.x,s.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,s){const[r,o]=this._getMetricDir(),n=this.evaluatedMeshParams.scaleInfo?.maxScale??0,a=this.evaluatedMeshParams.scaleInfo?.minScale??0,l=this.evaluatedMeshParams.labelClassId;return new M(e,0,l,t,i,r,o,n,a,s)}_writePoint(e,t,i,s,r){if(t<0||t>p||i<0||i>p)return;const o=this._getShaping();if(!o)return;const n=r.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,[l,c]=this._getMetricDir(),h=this.evaluatedMeshParams.scaleInfo?.maxScale??0,m=this.evaluatedMeshParams.scaleInfo?.minScale??0,d=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,s,a,t,i,l,c,h,m,d)),this._writeGlyphs(e,n,t,i,o,0,d,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,s)=>this._placeSubdivGlyphs(e,t,i,s),a=(o.bounds.width+r)/(1<<S);this._current={out:e,id:t.getDisplayId(),shaping:o,zoomRange:P(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null},this._verticalPlacement="bottom"===s?"above":"top"===s?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=r.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new _;f(a,n,!1,!1,"esriGeometryPolyline",1);const l=G(new _,a,o),c=G(new _,a,-o),h=g(c,"esriGeometryPolyline",!1,!1),m=g(l,"esriGeometryPolyline",!1,!1),d=v(m.paths,r.bounds.width),u=v(h.paths,r.bounds.width);this._current.offsetDirection="above";for(const f of d)y(f,i,t,!!s);this._current.offsetDirection="below";for(const f of u)y(f,i,t,!!s)}_writeCenterAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=v(e.readLegacyGeometryForDisplay().paths,r.bounds.width);for(const n of o)y(n,i,t,!!s)}_placeSubdivGlyphs(e,t,i,s){const{allowOverrun:r,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=D(t),c=this._current.shaping.bounds.width/(1<<S),h=Math.sqrt(n||A)/(1<<S),m=Math.min(i,s-i),d=this._current.shaping.isMultiline?B:Math.log2(m/(h+c/2)),u=0===t?d:Math.min(l,d),f=Math.max(a,this._zoomLevel+S-u),g=this._zoomLevel-f,_=this._current.shaping.bounds.width/2*2**g;this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f):r&&g<0?this._placeStraightAlong(e,a):"parallel"===o?this._placeStraightAlong(e,f):"curved"===o&&this._placeCurved(e,f,_)}_placeStraight(e,t){const{out:i,id:s,shaping:r,referenceBounds:o}=this._current,{x:n,y:a}=e;i.metricStart(this._createLineLabelMetric(s,n,a)),i.metricBoxWrite(r.boundsT);const l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360,h={clipAngle:l,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,h,!1);const m={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,m,!1),i.metricEnd()}_placeCurved(e,t,i){const{out:s,id:r}=this._current;s.metricStart(this._createLineLabelMetric(r,e.x,e.y));const o=e.clone(),n=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(o,t,1,n),this._placeBack(e,o,t,i,1,n),this._placeForward(e,o,t,i,1,n)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(o,t,0,a),this._placeBack(e,o,t,i,0,a),this._placeForward(e,o,t,i,0,a)),s.metricEnd()}_placeStraightAlong(e,o){const{out:n,id:a,shaping:l,zoomRange:c,referenceBounds:h}=this._current,{boxBorderLineColor:d,boxBackgroundColor:u}=this.evaluatedMeshParams,f=e.clone(),g=e.angle*(180/Math.PI)%360,_=(e.angle*(180/Math.PI)+180)%360,p=l.glyphs.length>0&&!(!d&&!u);if(n.metricStart(this._createLineLabelMetric(a,e.x,e.y)),p){const d=Math.max(o,c[0],0),u=Math.min(B,c[1]),f=i(r(),-e.angle),p={minZoom:d,maxZoom:u,clipAngle:g,mapAligned:!0,isLineLabel:!0},b=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=m(b,-1*x),[i,o]=l.shapeBackground(s(r(),f,t));n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,p),n.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=m(b,x),[i,o]=l.shapeBackground(s(r(),f,t));p.clipAngle=_,n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,p),n.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(f,o,1,g,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(f,o,0,_,!0),n.metricEnd()}_placeBack(e,t,i,s,r,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=s);)this._placeOnSegment(n,t,a,i,-1,r,o),a+=n.length+z}_placeForward(e,t,i,s,r,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,t,a,i,1,r,o),a+=n.length+z}_placeFirst(e,s,n,a,l=!1){const{out:c,id:h,shaping:d,zoomRange:u,referenceBounds:f}=this._current,g=d.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=m(_,p),M=i(r(),-e.angle);o(b,b,M);for(const t of g){const i=t.x>d.bounds.x?n:1-n,r=i*e.remainingLength+(1-i)*e.backwardLength,o=Math.abs(t.x+t.width/2-d.bounds.x),m=Math.max(0,this._zoomLevel+Math.log2(o/(r+z))),g=Math.max(s,l?0:m);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-n)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(n||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new x(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,s,n,a,l,c,h){const{out:d,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,M={x:e.x+n*-l*p,y:e.y+n*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=m(v,y),w=i(r(),-e.angle);o(P,P,w);for(const t of _){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const s=Math.abs(t.x+t.width/2-f.bounds.x),r=Math.max(0,this._zoomLevel+Math.log2(s/n)-.1),o=Math.max(a,this._zoomLevel+Math.log2(s/(n+e.length+z)));if(0!==r&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=o,t.maxZoom=r,this._writeLineGlyph(d,u,M.x,M.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new x(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);d.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,s,r,o,n,a){if(i<0||i>p||s<0||s>p)return;e.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:l,offsets:c}=r,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:w(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],r.minZoom),maxZoom:Math.min(this._current.zoomRange[1],r.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*b)/b}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),s=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),s=this._packedZoom(s);const r=this._packedZoom(this._zoomLevel);return i<=r&&r<=s}}function G(e,t,i){const{coords:s,lengths:r}=t,o=d(),m=d(),u=d(),f=d(),g=d(),_=d(),p=2;let b=0;for(let d=0;d<r.length;d++){const t=r[d];for(let r=0;r<t;r++){const d=p*(r+b-1),x=p*(r+b),M=p*(r+b+1);r>0?n(o,s[d],s[d+1]):n(o,0,0),n(m,s[x],s[x+1]),r<t-1?n(u,s[M],s[M+1]):n(u,0,0),0===r?n(f,0,0):(a(f,m,o),l(f,f),n(f,f[1],-f[0])),r===t-1?n(g,0,0):(a(g,u,m),l(g,g),n(g,g[1],-g[0])),c(_,f,g),l(_,_);const v=_[0]*g[0]+_[1]*g[1];0!==v&&h(_,_,v),h(_,_,i),e.coords.push(m[0]+_[0],m[1]+_[1])}e.lengths.push(t),b+=t}return e}export{I as LabelMeshWriter};
@@ -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 i from"../../../Color.js";import r from"../../../Graphic.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import h from"../../../layers/support/TelemetryDisplay.js";import m from"../../../symbols/SimpleFillSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import c from"../engine/webgl/OverlayContainer.js";import f from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import u from"./graphics/GraphicsView2D.js";import b from"../../layers/LayerView.js";const v=new i([255,127,0]);let _=class extends(d(b)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new r({symbol:new m({outline:{type:"simple-line",color:v}})}),this._sensorTrailGraphic=new r({symbol:new y({color:v})}),this._lineOfSightGraphic=new r({symbol:new y({color:v})}),this._sensorLocationGraphic=new r({symbol:new p({color:v})}),this._frameCenterGraphic=new r({symbol:new p({color:v,style:"cross"})}),this._overlayContainer=null,this.layer=null,this.symbolColor=v,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=t(this._graphicsLayer)}initialize(){this.addHandles(s((()=>this.symbolColor),(()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor}),l)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new h({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new c,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new u({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new g(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),l),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=t(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:i}=this;e&&i&&(i.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,i.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,i.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,i.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,i.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new f(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints]),(()=>{const{visibleTelemetryElements:i}=this;i?.frame?(e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=1):e.opacity=0}),l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([a()],_.prototype,"graphicsView",void 0),e([a()],_.prototype,"layer",void 0),e([a()],_.prototype,"symbolColor",void 0),e([a({type:h})],_.prototype,"visibleTelemetryElements",void 0),_=e([o("esri.views.2d.layers.VideoLayerView2D")],_);const C=_;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Color.js";import r from"../../../Graphic.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import h from"../../../layers/support/TelemetryDisplay.js";import m from"../../../symbols/SimpleFillSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{symbolTypes as c}from"../../../symbols/support/typeUtils.js";import f from"../engine/webgl/OverlayContainer.js";import d from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import b from"./graphics/GraphicContainer.js";import u from"./graphics/GraphicsView2D.js";import _ from"../../layers/LayerView.js";const v=new i([255,127,0]);let C=class extends(g(_)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new r({symbol:new m({outline:{type:"simple-line",color:v}})}),this._sensorTrailGraphic=new r({symbol:new y({color:v})}),this._lineOfSightGraphic=new r({symbol:new y({color:v})}),this._sensorLocationGraphic=new r({symbol:new p({color:v})}),this._frameCenterGraphic=new r({symbol:new p({color:v,style:"cross"})}),this._overlayContainer=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolColor=null,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=t(this._graphicsLayer)}initialize(){this.addHandles(s((()=>this.symbolColor),(()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor}),l)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new h({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0}),this.symbolColor=this.layer?.telemetryColor??v;const e=this.layer?.sensorSymbol.type;switch(e){case"simple-marker":this._sensorLocationGraphic.symbol=this.layer?.sensorSymbol;break;case"picture-marker":case"cim":this._sensorLocationGraphic.symbol=this.layer.sensorSymbol;break;default:return}}attach(){this._overlayContainer=new f,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new u({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new b(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),l),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=t(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:i}=this;e&&i&&(i.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,i.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,i.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,i.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,i.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new d(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints]),(()=>{const{visibleTelemetryElements:i}=this;i?.frame?(e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=1):e.opacity=0}),l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],C.prototype,"graphicsView",void 0),e([o()],C.prototype,"layer",void 0),e([o({types:c})],C.prototype,"sensorLocationSymbol",void 0),e([o()],C.prototype,"symbolColor",void 0),e([o({type:h})],C.prototype,"visibleTelemetryElements",void 0),C=e([a("esri.views.2d.layers.VideoLayerView2D")],C);const w=C;export{w 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{toParquetGeometryInfoJSON as e}from"../../../../../layers/support/parquetLayerUtils.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as t,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const l=this.layer,a=t(l,e)??i(l),o=r(l,e),n=[...l.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(l.renderer)},deconflictionEnabled:a,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>r(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(r){const t=l(this.layer),i=r.spatialReference.toJSON();return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:i,geometryInfo:e(this.layer.source.geometryInfo),metadata:{spatialReference:this.layer.spatialReference,outSpatialReference:i,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map((e=>e.name)):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,l,t){const i={fields:this.layer.fields.map((e=>e.toJSON())),renderer:this.layer.renderer?.clone(),layerId:this.layer.id,featureReduction:r(this.layer,l),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return a(e,l,i,t)}}export{n as ParquetLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as l}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??i(r),o=l(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>l(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(l){const a=t(this.layer),i=l.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:i,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()},metadata:{spatialReference:this.layer.spatialReference,outSpatialReference:i,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:a,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map((e=>e.name)):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,t){const a={fields:this.layer.fields.map((e=>e.toJSON())),renderer:this.layer.renderer?.clone(),layerId:this.layer.id,featureReduction:l(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,a,t)}}export{y as ParquetLayerAdapter};
@@ -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}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as m}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as p,convertToGeometry as f,convertFromNestedArray as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as _}from"../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,TrackPart as I,externalTrackLineOidPrefix as k,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as F}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as j}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as T}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as R}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as w}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as L}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as A}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as G}from"../support/FeatureSetReaderJSON.js";let C;const P=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),z=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return k+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new b}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:I.TrackLine};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e){const r=new Set(this._nextObservationRecords.map((t=>t.objectId))),i=this._observationRecords.filter((t=>!r.has(t.objectId))).map((t=>t.objectId));let a,o;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort(((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0})),this._schema.timeField){case"startTimeField":a=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":a=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":a=this._isStream?v:null}o=this._isStream?e?.end??Date.now():e?.end??-1/0;const n=t.map((t=>t.reader.getCursor()));let l;for(let c=this._nextObservationRecords.length-1;c>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);c--){const t=this._nextObservationRecords[c],e=n[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=a?e.readAttributeAsTimestamp(a):null;(null!=r?o-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),l??=t)}if(null!=l){const{chunkIndex:t,featureIndex:e,objectId:r,displayId:i}=l,a=n[t];s(a),a.setIndex(e);const o=new _(a.readGeometryWorldSpace(),{...a.readAttributes(),[y]:I.LatestObservation},null,r,i);this._latestObservationFeature=o}else this._latestObservationFeature=null;return this._trackLineGeometry=E(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=Z(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=j.create(this._fields);const r=t.map((t=>t.reader.getCursor()));for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,z))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new b;p(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);X(a,((t,e)=>u(o,[t,e])));if(!c(o,l(0,0,F,F)))return null;return new _(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new b;p(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new _(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new _(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class U extends x{constructor(t){super(t),this.done=!1}}class q extends T{static async create(t,e,s,a,o,n){const l=new w({spatialReference:e}),c=await Promise.all(t.fields.map((async t=>O.create(l,t)))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then((([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}})),new q(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=L.createFeature({geometryType:"esriGeometryPolyline",objectIdField:"aggregateId",fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return this._source.chunks().some((t=>!this._handledChunks.has(t.chunkId)))}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new U(t)}async*applyOverrideUpdate(t){P().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null==t)for(const e of a.observations()){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId)}}else{const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId)}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map((t=>t.reader.getCursor()));for(const a of this._tracks.values()){e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature());for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,attributes:{},...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),(t=>t.objectId));return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=W.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new W(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,R(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=G.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=G.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map((()=>[]));for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map(((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=A.from(i,s[r]);return a.setProcessorAttributes({[y]:I.PreviousObservation}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a})).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function E(t,e,s){if(e.length<2)return g(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=m({paths:[e],spatialReference:s});if(null!=r)return g(t,r.paths,!1,!1)}return g(t,[e],!1,!1)}const r=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=C.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=C.toGeometry(e,i);if(null!=s&&"paths"in s)return g(t,s.paths,!1,!1)}}return g(t,[e],!1,!1)}function X(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function Z(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{q as TrackStrategy};
5
+ import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as m}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as p,convertToGeometry as f,convertFromNestedArray as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as _}from"../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,TrackPart as I,externalTrackLineOidPrefix as k,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as F}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as j}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as T}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as R}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as w}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as L}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as A}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as C}from"../support/FeatureSetReaderJSON.js";let G;const P=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),z=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return k+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new b}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:I.TrackLine};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e){const r=new Set(this._nextObservationRecords.map((t=>t.objectId))),i=this._observationRecords.filter((t=>!r.has(t.objectId))).map((t=>t.objectId));let a,o;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort(((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0})),this._schema.timeField){case"startTimeField":a=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":a=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":a=this._isStream?v:null}o=this._isStream?e?.end??Date.now():e?.end??-1/0;const n=t.map((t=>t.reader.getCursor()));let l;for(let c=this._nextObservationRecords.length-1;c>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);c--){const t=this._nextObservationRecords[c],e=n[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=a?e.readAttributeAsTimestamp(a):null;(null!=r?o-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),l??=t)}if(null!=l){const{chunkIndex:t,featureIndex:e,objectId:r,displayId:i}=l,a=n[t];s(a),a.setIndex(e);const o=new _(a.readGeometryWorldSpace(),{...a.readAttributes(),[y]:I.LatestObservation},null,r,i);this._latestObservationFeature=o}else this._latestObservationFeature=null;return this._trackLineGeometry=E(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=Z(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=j.create(this._fields);const r=t.map((t=>t.reader.getCursor()));for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,z))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new b;p(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);X(a,((t,e)=>u(o,[t,e])));if(!c(o,l(0,0,F,F)))return null;return new _(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new b;p(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new _(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new _(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class U extends x{constructor(t){super(t),this.done=!1}}class q extends T{static async create(t,e,s,a,o,n){const l=new w({spatialReference:e}),c=await Promise.all(t.fields.map((async t=>O.create(l,t)))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then((([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}})),new q(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=L.createFeature({geometryType:"esriGeometryPolyline",objectIdField:"aggregateId",fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map((t=>t.chunkId)));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new U(t)}async*applyOverrideUpdate(t){P().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map((t=>[e(t),t]))),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null==t)for(const e of a.observations()){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId)}}else{const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId)}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map((t=>t.reader.getCursor()));for(const a of this._tracks.values()){e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature());for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,attributes:{},...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),(t=>t.objectId));return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=W.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new W(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,R(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=C.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=C.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map((()=>[]));for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map(((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=A.from(i,s[r]);return a.setProcessorAttributes({[y]:I.PreviousObservation}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a})).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function E(t,e,s){if(e.length<2)return g(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=m({paths:[e],spatialReference:s});if(null!=r)return g(t,r.paths,!1,!1)}return g(t,[e],!1,!1)}const r=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=G.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=G.toGeometry(e,i);if(null!=s&&"paths"in s)return g(t,s.paths,!1,!1)}}return g(t,[e],!1,!1)}function X(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function Z(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{q as TrackStrategy};
@@ -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{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{difference as t,union as s}from"../../../../../../core/SetUtils.js";import i from"../../../../../../layers/support/FieldsIndex.js";import{ParquetFile as a}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as l}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as n}from"../../support/FeatureSetReaderParquet.js";class m extends r{constructor(e,t,s,i){super(i),this._service=e,this._metadata=t,this._schema=s,this._chunkId=0,this._files=[],this._availableFields=new Set(s.mutable.availableFields);const{geometryInfo:a}=this._service;if("location"===a.type)this._availableFields.add(a.latitudeFieldName),this._availableFields.add(a.longitudeFieldName);else if(null!=a.multiscale&&a.multiscale.levels.length>=1){const e=a.multiscale.levels[0];this._availableFields.add(e.column)}else this._availableFields.add(a.primaryFieldName)}destroy(){for(const e of this._files)e.destroy()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(e){await this._promise;const i=new Set(e),a=t(i,this._availableFields);this._availableFields=s(a,this._availableFields),a.size&&await Promise.all(this._files.map((e=>{const t=Array.from(a).map((t=>e.metadata.getFieldIndex(t)));return e.inner.updateChunks(new Uint16Array(t))})))}async load(e){return null==this._promise&&(this._promise=this._download().then((()=>{this._loadHigherResGeometry()}))),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _loadHigherResGeometry(){const{geometryInfo:e}=this._service;if("geometry"===e.type){if(!(null!=e.multiscale&&e.multiscale.levels.length>=1))return;await this.updateFields([e.primaryFieldName])}const t=Array.from(this._store.chunks());this._store.clear();for(const s of t)this._store.insert(s);this._store.refresh()}async _insert(t){const s=await a.create(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;e(this._options);const{fields:o,timeZoneByFieldName:m}=this._service.metadata.fieldsIndex,d=o.map((e=>({...e,index:s.metadata.getFieldIndex(e.name)}))),h=i.fromJSON({fields:d,timeZoneByFieldName:m}),u=new Uint16Array(Array.from(this._availableFields.values()).map((e=>h.get(e)?.index)).filter((e=>null!=e)));await s.inner.readChunksWithCallback(u,(e=>{const t=this._chunkId++,s=new n(this._metadata,h,r,e,t),i=new l(s,null,t,!1);this._store.insert(i)})),this._files.push(s)}async _download(){try{await Promise.all(this._service.source.urls.map((e=>this._insert(e))));const e=new l(o.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}export{m as ParquetLoadStrategy};
5
+ import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{difference as t,union as i}from"../../../../../../core/SetUtils.js";import s from"../../../../../../layers/support/FieldsIndex.js";import{ParquetFile as a}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as l}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as n}from"../../support/FeatureSetReaderParquet.js";class d extends r{constructor(e,t,i,s){super(s),this._service=e,this._metadata=t,this._schema=i,this._chunkId=0,this._files=[],this._availableFields=new Set(i.mutable.availableFields);const{geometryInfo:a}=this._service;if("location"===a.encoding.type)this._availableFields.add(a.encoding.latitudeFieldName),this._availableFields.add(a.encoding.longitudeFieldName);else if(null!=a.encoding.multiscale&&a.encoding.multiscale.levels.length>=1){const e=a.encoding.multiscale.levels[0];this._availableFields.add(e.column)}else this._availableFields.add(a.encoding.primaryFieldName)}destroy(){for(const e of this._files)e.destroy()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(e){await this._promise;const s=new Set(e),a=t(s,this._availableFields);this._availableFields=i(a,this._availableFields),a.size&&await Promise.all(this._files.map((e=>{const t=Array.from(a).map((t=>e.metadata.getFieldIndex(t)));return e.inner.updateChunks(new Uint16Array(t))})))}async load(e){return null==this._promise&&(this._promise=this._download().then((()=>{this._loadHigherResGeometry()}))),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _loadHigherResGeometry(){const{geometryInfo:e}=this._service;if("wkb"===e.encoding.type){if(!(null!=e.encoding.multiscale&&e.encoding.multiscale.levels.length>=1))return;await this.updateFields([e.encoding.primaryFieldName])}const t=Array.from(this._store.chunks());this._store.clear();for(const i of t)this._store.insert(i);this._store.refresh()}async _insert(t){const i=await a.create(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;e(this._options);const{fields:o,timeZoneByFieldName:d}=this._service.metadata.fieldsIndex,m=o.map((e=>({...e,index:i.metadata.getFieldIndex(e.name)}))),c=s.fromJSON({fields:m,timeZoneByFieldName:d}),h=new Uint16Array(Array.from(this._availableFields.values()).map((e=>c.get(e)?.index)).filter((e=>null!=e)));await i.inner.readChunksWithCallback(h,(e=>{const t=this._chunkId++,i=new n(this._metadata,c,r,e,t),s=new l(i,null,t,!1);this._store.insert(s)})),this._files.push(i)}async _download(){try{await Promise.all(this._service.source.urls.map((e=>this._insert(e))));const e=new l(o.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}export{d as ParquetLoadStrategy};
@@ -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"../../../../analysis/LineOfSightAnalysisObserver.js";import a from"../../../../analysis/LineOfSightAnalysisTarget.js";import n from"../../../../core/Handles.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as p,fromPoints as g}from"../../../../geometry/support/lineSegment.js";import{getGraphicEffectiveElevationInfo as _,getConvertedElevation as m}from"../../../../support/elevationInfoUtils.js";import v from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as b,laserLineConfiguration as y}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as f,LineOfSightObserverManipulator as T}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{LaserlineVisualElement as w}from"../../interactive/visualElements/LaserlineVisualElement.js";import{IntersectorType as M}from"../../webgl-engine/lib/IntersectorInterfaces.js";import"../../../input/ViewEvents.js";import{AnalysisToolBase as C}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as H}from"../../../interactive/interfaces.js";import{createScreenPointFromEvent as V}from"../../../support/screenUtils.js";import{MouseButton as P}from"../../../input/IViewEvents.js";var I;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(I||(I={}));let O=class extends C{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new n,this._updatingHandles=new d,this._manipulatorHandles=new n,this._targetTrackerManipulator=null}initialize(){this._intersector=new L({view:this.view}),this.addHandles(o((()=>this.state),(e=>{e===I.Created&&this.finishToolCreation()}),l)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add((()=>this.analysisViewData?.elevationAlignedObserver),(e=>this._onObserverLocationChange(e)),u),this._updatingHandles.add((()=>b(this.view.effectiveTheme)),(({glowColor:e,innerColor:t,globalAlpha:i})=>this._updateLaserLineStyle(e,t,i)),u),this._updatingHandles.add((()=>this._laserLineRendererDependencies()),(e=>this._updateLaserLineRenderer(e))),this._connectComputations(),this._updatingHandles.addWhen((()=>!this._shouldRenderTracker),(()=>this._clearCursorTracker()),u),this._updatingHandles.add((()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators})),(({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)}),u)])}destroy(){this._updatingHandles=s(this._updatingHandles),this._manipulatorHandles=s(this._manipulatorHandles),this._analysisHandles=s(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?I.Creating:I.Created:null!=this.analysis.observer?.position?I.Created:I.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return null!=this.analysisViewData&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"key-down":this._keyDownHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this.analysisViewData.computations),(e=>this._onComputationsCollectionChange(e)),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_connectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const i=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&i.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=i,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add((()=>j(e)),(()=>D(i,e)),u),this._updatingHandles.add((()=>e.elevationAlignedTargetLocation),(e=>this._onTargetLocationChange(e,i)),u)],e)}_disconnectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=s(this.analysisViewData.cursorTarget)}_createTargetManipulator(e){const t={target:e,type:"target"},i=new f(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(i),i.events.on("grab-changed",(e=>this._manipulatorGrabChanged(i,e))),i.events.on("immediate-click",(e=>this._manipulatorClick(i,e)))],i),this.manipulators.add(i),null!=e.position?i.elevationAlignedLocation=e.position:i.available=!1,i}_getTargetManipulator(e){let t=null;return this.manipulators.forEach((i=>{const a=i.manipulator;null==t&&"target"===a.metadata.type&&a.metadata.target===e&&(t=a)})),t}_createObserverManipulator(){const e=new T(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",(t=>this._manipulatorGrabChanged(e,t))),e.events.on("immediate-click",(t=>this._manipulatorClick(e,t)))],e),this.manipulators.add(e),e}_screenToIntersection(){return e=>{const t=this._intersector.getScreenPointIntersection(e.screenEnd);return null==t?null:{...e,intersection:t}}}_createTargetManipulatorDragPipeline(e){return k(e,((t,i,a)=>{i.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next((()=>this._updateLaserLineRenderer())),a.next(R(e.metadata.target)).next((()=>this._updateLaserLineRenderer()))}))}_createObserverManipulatorDragPipeline(e){return k(e,((e,t,i)=>{t.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next((()=>this._updateLaserLineRenderer())),i.next(this._cancelObserverDragStep()).next((()=>this._updateLaserLineRenderer()))}))}_updateObserverDragStep(){return e=>(null!=e.intersection.mapPoint?(null==this.analysis.observer&&(this.analysis.observer=new i),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>{this._updateFromIntersection(e.metadata.target,t.intersection);const i=t.intersection.mapPoint;return null!=i&&(e.elevationAlignedLocation=i),t}}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:i,shouldRenderTracker:a,observerPosition:n,visible:r}=e;if(null==t)return;const s=null!=i?i:a&&null!=n?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,E):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=y;this._laserlineVisualElement=new w({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,i,a){const n=this._laserlineVisualElement;if(null==n)return;const r=n.style;n.style={...r,glowColor:t.toUnitRGB(e),innerColor:t.toUnitRGB(i),globalAlpha:a}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e){const t=this._intersector.getScreenPointIntersection(e);if(null!=t?.mapPoint)if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new a;this._updateFromIntersection(e,t),this.analysis.targets.add(e)}else{const e=new i;this._updateFromIntersection(e,t),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==P.Right&&(this._addPointFromClickEvent(V(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==P.Right&&(this.stop(),e.stopPropagation())}_keyDownHandler(e){this.active&&"Escape"===e.key&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||null==this.analysis.observer?.position)return;const t=V(e),i=this._intersector.getScreenPointIntersection(t);null!=i?.mapPoint&&(null==this.analysisViewData.cursorTarget&&(this.analysisViewData.cursorTarget=new a),this._updateFromIntersection(this.analysisViewData.cursorTarget,i),this._updateLaserLineRenderer())}_updateFromIntersection(e,t){if(null==t.mapPoint)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(t.type){case M.OBJECT:if(null!=t.graphic){const i=t.graphic,a=_(i);"on-the-ground"===a.mode&&(a.mode="relative-to-ground",a.offset=0),e.elevationInfo=new v(a),e.feature=i}else e.elevationInfo=null,e.feature=null;break;case M.TERRAIN:e.elevationInfo=new v({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const i=t.mapPoint.clone();i.z=m(this.view,i,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=i}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==P.Right||this.analysis.targets.length<=1)return;const{target:i}=e.metadata;this.analysis.targets.remove(i),t.stopPropagation()}get testInfo(){}};function R(e){const t=e.position?.clone();return i=>(e.position=t,i)}function D(e,t){const{isValid:i,isTargetVisible:a}=t.computationResult;e.state=i?a?H.Custom1:H.Custom2:H.Custom3}function j(e){const{isValid:t,isTargetVisible:i}=e.computationResult;return{isValid:t,isTargetVisible:i}}e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c({constructOnly:!0})],O.prototype,"analysis",void 0),e([c()],O.prototype,"_creationMode",void 0),e([c({readOnly:!0})],O.prototype,"state",null),e([c({readOnly:!0})],O.prototype,"cursor",null),e([c()],O.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],O.prototype,"updating",null),e([c({constructOnly:!0})],O.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],O.prototype,"_showTracker",null),e([c()],O.prototype,"_latestPointerMovePointerType",void 0),e([c()],O.prototype,"_shouldRenderTracker",null),e([c()],O.prototype,"_laserlineVisualElement",void 0),e([c()],O.prototype,"_grabbedManipulator",void 0),O=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],O);const E=p();export{O as LineOfSightTool};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../analysis/LineOfSightAnalysisObserver.js";import a from"../../../../analysis/LineOfSightAnalysisTarget.js";import n from"../../../../core/Handles.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as p,fromPoints as g}from"../../../../geometry/support/lineSegment.js";import{getGraphicEffectiveElevationInfo as _,getConvertedElevation as m}from"../../../../support/elevationInfoUtils.js";import v from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as b,laserLineConfiguration as y}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as f,LineOfSightObserverManipulator as T}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{LaserlineVisualElement as w}from"../../interactive/visualElements/LaserlineVisualElement.js";import{IntersectorType as M}from"../../webgl-engine/lib/IntersectorInterfaces.js";import"../../../input/ViewEvents.js";import{AnalysisToolBase as C}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as V}from"../../../interactive/interfaces.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import{MouseButton as I}from"../../../input/IViewEvents.js";var O;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(O||(O={}));let P=class extends C{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new n,this._updatingHandles=new d,this._manipulatorHandles=new n,this._targetTrackerManipulator=null}initialize(){this._intersector=new L({view:this.view}),this.addHandles(o((()=>this.state),(e=>{e===O.Created&&this.finishToolCreation()}),l)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add((()=>this.analysisViewData?.elevationAlignedObserver),(e=>this._onObserverLocationChange(e)),u),this._updatingHandles.add((()=>b(this.view.effectiveTheme)),(({glowColor:e,innerColor:t,globalAlpha:i})=>this._updateLaserLineStyle(e,t,i)),u),this._updatingHandles.add((()=>this._laserLineRendererDependencies()),(e=>this._updateLaserLineRenderer(e))),this._connectComputations(),this._updatingHandles.addWhen((()=>!this._shouldRenderTracker),(()=>this._clearCursorTracker()),u),this._updatingHandles.add((()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators})),(({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)}),u)])}destroy(){this._updatingHandles=s(this._updatingHandles),this._manipulatorHandles=s(this._manipulatorHandles),this._analysisHandles=s(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?O.Creating:O.Created:null!=this.analysis.observer?.position?O.Created:O.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return null!=this.analysisViewData&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this.analysisViewData.computations),(e=>this._onComputationsCollectionChange(e)),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_connectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const i=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&i.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=i,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add((()=>j(e)),(()=>D(i,e)),u),this._updatingHandles.add((()=>e.elevationAlignedTargetLocation),(e=>this._onTargetLocationChange(e,i)),u)],e)}_disconnectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=s(this.analysisViewData.cursorTarget)}_createTargetManipulator(e){const t={target:e,type:"target"},i=new f(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(i),i.events.on("grab-changed",(e=>this._manipulatorGrabChanged(i,e))),i.events.on("immediate-click",(e=>this._manipulatorClick(i,e)))],i),this.manipulators.add(i),null!=e.position?i.elevationAlignedLocation=e.position:i.available=!1,i}_getTargetManipulator(e){let t=null;return this.manipulators.forEach((i=>{const a=i.manipulator;null==t&&"target"===a.metadata.type&&a.metadata.target===e&&(t=a)})),t}_createObserverManipulator(){const e=new T(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",(t=>this._manipulatorGrabChanged(e,t))),e.events.on("immediate-click",(t=>this._manipulatorClick(e,t)))],e),this.manipulators.add(e),e}_screenToIntersection(){return e=>{const t=this._intersector.getScreenPointIntersection(e.screenEnd);return null==t?null:{...e,intersection:t}}}_createTargetManipulatorDragPipeline(e){return k(e,((t,i,a)=>{i.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next((()=>this._updateLaserLineRenderer())),a.next(R(e.metadata.target)).next((()=>this._updateLaserLineRenderer()))}))}_createObserverManipulatorDragPipeline(e){return k(e,((e,t,i)=>{t.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next((()=>this._updateLaserLineRenderer())),i.next(this._cancelObserverDragStep()).next((()=>this._updateLaserLineRenderer()))}))}_updateObserverDragStep(){return e=>(null!=e.intersection.mapPoint?(null==this.analysis.observer&&(this.analysis.observer=new i),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>{this._updateFromIntersection(e.metadata.target,t.intersection);const i=t.intersection.mapPoint;return null!=i&&(e.elevationAlignedLocation=i),t}}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:i,shouldRenderTracker:a,observerPosition:n,visible:r}=e;if(null==t)return;const s=null!=i?i:a&&null!=n?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,S):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=y;this._laserlineVisualElement=new w({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,i,a){const n=this._laserlineVisualElement;if(null==n)return;const r=n.style;n.style={...r,glowColor:t.toUnitRGB(e),innerColor:t.toUnitRGB(i),globalAlpha:a}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e){const t=this._intersector.getScreenPointIntersection(e);if(null!=t?.mapPoint)if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new a;this._updateFromIntersection(e,t),this.analysis.targets.add(e)}else{const e=new i;this._updateFromIntersection(e,t),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==I.Right&&(this._addPointFromClickEvent(H(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==I.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||null==this.analysis.observer?.position)return;const t=H(e),i=this._intersector.getScreenPointIntersection(t);null!=i?.mapPoint&&(null==this.analysisViewData.cursorTarget&&(this.analysisViewData.cursorTarget=new a),this._updateFromIntersection(this.analysisViewData.cursorTarget,i),this._updateLaserLineRenderer())}_updateFromIntersection(e,t){if(null==t.mapPoint)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(t.type){case M.OBJECT:if(null!=t.graphic){const i=t.graphic,a=_(i);"on-the-ground"===a.mode&&(a.mode="relative-to-ground",a.offset=0),e.elevationInfo=new v(a),e.feature=i}else e.elevationInfo=null,e.feature=null;break;case M.TERRAIN:e.elevationInfo=new v({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const i=t.mapPoint.clone();i.z=m(this.view,i,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=i}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==I.Right||this.analysis.targets.length<=1)return;const{target:i}=e.metadata;this.analysis.targets.remove(i),t.stopPropagation()}get testInfo(){}};function R(e){const t=e.position?.clone();return i=>(e.position=t,i)}function D(e,t){const{isValid:i,isTargetVisible:a}=t.computationResult;e.state=i?a?V.Custom1:V.Custom2:V.Custom3}function j(e){const{isValid:t,isTargetVisible:i}=e.computationResult;return{isValid:t,isTargetVisible:i}}e([c({constructOnly:!0})],P.prototype,"view",void 0),e([c({constructOnly:!0})],P.prototype,"analysis",void 0),e([c()],P.prototype,"_creationMode",void 0),e([c({readOnly:!0})],P.prototype,"state",null),e([c({readOnly:!0})],P.prototype,"cursor",null),e([c()],P.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],P.prototype,"updating",null),e([c({constructOnly:!0})],P.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],P.prototype,"_showTracker",null),e([c()],P.prototype,"_latestPointerMovePointerType",void 0),e([c()],P.prototype,"_shouldRenderTracker",null),e([c()],P.prototype,"_laserlineVisualElement",void 0),e([c()],P.prototype,"_grabbedManipulator",void 0),P=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],P);const S=p();export{P as LineOfSightTool};
@@ -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 i from"../../../core/Accessor.js";import s from"../../../core/Collection.js";import o from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as l}from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as y}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as u}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as h,removeAnalysisViewTool as c}from"../../analysis/analysisViewUtils.js";let m=class extends(l(o.EventedMixin(i))){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new s,this.elevationAlignedObserver=null,this.observerEngineLocation=n(),this.cursorTarget=null,this.editable=!0}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new u({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",(t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)})),h(this,y)])}destroy(){c(this),this._analysisController=r(this._analysisController),this._analysisVisualization=r(this._analysisVisualization)}get results(){return this.computations.map((t=>t.result))}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}getResultForTarget(t){return this.computations.find((i=>i.target===t))?.result}get testInfo(){}};t([e({readOnly:!0})],m.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],m.prototype,"analysis",void 0),t([e()],m.prototype,"tool",void 0),t([e({readOnly:!0})],m.prototype,"results",null),t([e()],m.prototype,"priority",null),t([e()],m.prototype,"computations",void 0),t([e()],m.prototype,"elevationAlignedObserver",void 0),t([e()],m.prototype,"observerEngineLocation",void 0),t([e()],m.prototype,"cursorTarget",void 0),t([e()],m.prototype,"updating",null),t([e()],m.prototype,"editable",void 0),t([e()],m.prototype,"_analysisController",void 0),t([e()],m.prototype,"_analysisVisualization",void 0),m=t([a("esri.views.3d.analysis.LineOfSightAnalysisView3D")],m);const d=m;export{d as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import s from"../../../core/Collection.js";import o from"../../../core/Evented.js";import"../../../core/has.js";import{abortMaybe as r,destroyMaybe as e}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as p}from"./AnalysisView3D.js";import{LineOfSightController as u}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as y}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as h}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as c,removeAnalysisViewTool as m,startExclusiveInteractiveOperation as d}from"../../analysis/analysisViewUtils.js";let g=class extends(p(o.EventedMixin(i))){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new s,this.elevationAlignedObserver=null,this.observerEngineLocation=l(),this.cursorTarget=null,this.editable=!0,this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new u({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new h({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",(t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)})),c(this,y)])}destroy(){m(this),this.userOperation=r(this.userOperation),this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get results(){return this.computations.map((t=>t.result))}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}async place(t){return this.userOperation=d(this,t),await this.userOperation.promise}getResultForTarget(t){return this.computations.find((i=>i.target===t))?.result}get testInfo(){}};t([a({readOnly:!0})],g.prototype,"type",void 0),t([a({constructOnly:!0,nonNullable:!0})],g.prototype,"analysis",void 0),t([a()],g.prototype,"tool",void 0),t([a({readOnly:!0})],g.prototype,"results",null),t([a()],g.prototype,"priority",null),t([a()],g.prototype,"computations",void 0),t([a()],g.prototype,"elevationAlignedObserver",void 0),t([a()],g.prototype,"observerEngineLocation",void 0),t([a()],g.prototype,"cursorTarget",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"editable",void 0),t([a()],g.prototype,"userOperation",void 0),t([a()],g.prototype,"_analysisController",void 0),t([a()],g.prototype,"_analysisVisualization",void 0),g=t([n("esri.views.3d.analysis.LineOfSightAnalysisView3D")],g);const f=g;export{f 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"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,e as a,v as c,g as l,h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}isValid(){return this.viewshed.isValid()}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"isValid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,e as a,v as c,g as l,h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}get valid(){return this.viewshed.valid}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"valid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
@@ -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 i}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)}),d),c((()=>this.viewshedComputedData?.heading),(i=>{i&&(this._moveManipulation.angle=r(90-i))}),v),c((()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}}),(({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.isValid()&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)}),v),c((()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}}),(({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i}),v),c((()=>{const i=this.viewshedComputedData;if(!i?.isValid())return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)}),v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",(()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach((({subTool:i})=>{i._resetHoveringTask()})),this._someManipulatorSelected()||i||(this._forceHoveringTask=a((async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),i.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)})),this._setInteractive((e=>e.hasManipulator(i)||!this._grabbing))})),i.events.on("drag",(i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation((t=>t.interactive=e?i:i(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator((t=>{e=e||t===i})),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((i=>(this.observer=l.data.geometry,i))),cancel:n}}),e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a))),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((i,e)=>t=>{const a=g(I,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=_(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t})),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation((e=>{e.forEachManipulator(i)})),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],U.prototype,"analysis",void 0),i([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],U.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),i([m()],U.prototype,"viewshed",null),i([m()],U.prototype,"_grabbing",void 0),i([m()],U.prototype,"grabbing",null),i([m()],U.prototype,"viewshedComputedData",void 0),i([m()],U.prototype,"observer",null),U=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=b(),R=new n(0,180);export{U as ViewshedSubTool};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)}),d),c((()=>this.viewshedComputedData?.heading),(e=>{e&&(this._moveManipulation.angle=r(90-e))}),v),c((()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:e?.observer}}),(({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(E),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),E))}),v),c((()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.targetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)}),v),c((()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null}),(e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)}),v),c((()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:e&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:e&&(!this.parentTool.creating||i)}}),(({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e}),v),c((()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)}),v)]);const e=e=>{const i=this.analysisViewData;this.addHandles([e.events.on("focus-changed",(()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach((({subTool:e})=>{e._resetHoveringTask()})),this._someManipulatorSelected()||e||(this._forceHoveringTask=a((async e=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),e.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&i.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)})),this._setInteractive((i=>i.hasManipulator(e)||!this._grabbing))})),e.events.on("drag",(e=>{"start"===e.action&&i.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation((t=>t.interactive=i?e:e(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator((t=>{i=i||t===e})),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((e,i,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((e=>(this.observer=l.data.geometry,e))),cancel:n}}),i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==e)return{steps:n,cancel:s};const r=e.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const e="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===i&&e||360===i&&!e:0===t&&e}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=i/2-n;break;case"right":p=i/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,o,n)=>{if(null==e)return{steps:o,cancel:n};const s=e.viewshed;return n=n.next(S(s,[i])),{steps:o=o.next(t(s,e)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=o.normalize(t+a.deltaAngle),a))),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(i=e.tilt);let o=i+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((e,i)=>t=>{const a=g(I,t.renderEnd,i.observerRenderSpace),o=M(a)*i.metersPerUnit,n=_(a,i.targetDirection)<0?H.scaleOrientMinDistance:o;return e.farDistance=n,t})),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=e=>{o.push(e.disableDisplay())};e||!a&&i?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),e||!a&&i||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),e||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation((i=>{i.forEachManipulator(e)})),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([m({constructOnly:!0})],U.prototype,"analysis",void 0),e([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],U.prototype,"parentTool",void 0),e([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),e([m()],U.prototype,"viewshed",null),e([m()],U.prototype,"_grabbing",void 0),e([m()],U.prototype,"grabbing",null),e([m()],U.prototype,"viewshedComputedData",void 0),e([m()],U.prototype,"observer",null),U=e([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=b(),R=new n(0,180);export{U as ViewshedSubTool};
@@ -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"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.isValid()))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;export{q as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.valid))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;export{q as default};