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

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 (308) 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/05cba30c0d3855de7a65.js +1 -0
  81. package/assets/esri/core/workers/chunks/{7ef9bcd58af499a14a08.js → 089a19381b66cd074425.js} +1 -1
  82. package/assets/esri/core/workers/chunks/0be7a0f4c4f4f91d1957.js +1 -0
  83. package/assets/esri/core/workers/chunks/0c6f2808c57ff820bfdd.js +2 -0
  84. package/assets/esri/core/workers/chunks/{baed733a29aa65efc2a0.js.LICENSE.txt → 0c6f2808c57ff820bfdd.js.LICENSE.txt} +7 -1
  85. package/assets/esri/core/workers/chunks/103c78c8bfdb56227bc0.js +1 -0
  86. package/assets/esri/core/workers/chunks/184d7c8ea818bec5c462.js +1 -0
  87. package/assets/esri/core/workers/chunks/{4523ba4a3c8987abca56.js → 1c75f7e4d2e9c8e377e7.js} +1 -1
  88. package/assets/esri/core/workers/chunks/1e1c3243ac82c969bb1f.js +1 -0
  89. package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +1 -0
  90. package/assets/esri/core/workers/chunks/25142d431dd1e5e82234.js +1 -0
  91. package/assets/esri/core/workers/chunks/25e19bd171eeb5634a4f.js +1 -0
  92. package/assets/esri/core/workers/chunks/26924d2f03b8a1b7a9b2.js +1 -0
  93. package/assets/esri/core/workers/chunks/27482132abb939a1cdb7.js +1 -0
  94. package/assets/esri/core/workers/chunks/2ae1dbdac9f24f4a3c84.js +1 -0
  95. package/assets/esri/core/workers/chunks/{984c5047ab1fa632ca09.js → 2db5dd5638c93b0af102.js} +1 -1
  96. package/assets/esri/core/workers/chunks/31b2ceed80796c7f6c03.js +1 -0
  97. package/assets/esri/core/workers/chunks/3521a53f826f0ce6ac33.js +1 -0
  98. package/assets/esri/core/workers/chunks/3697ec74522cc5059098.js +1 -0
  99. package/assets/esri/core/workers/chunks/{60472225a228e499b1a2.js → 38557792ff9516fc991b.js} +1 -1
  100. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +1 -0
  101. package/assets/esri/core/workers/chunks/38f9ede26098eb03ca2d.js +2 -0
  102. package/assets/esri/core/workers/chunks/{239821543abbd63c5787.js.LICENSE.txt → 38f9ede26098eb03ca2d.js.LICENSE.txt} +3 -3
  103. package/assets/esri/core/workers/chunks/3b8eee013d7ca156ef2d.js +1 -0
  104. package/assets/esri/core/workers/chunks/{7f86c9ec45f4fae1fb49.js → 3ee505f9ddb671dcfa52.js} +1 -1
  105. package/assets/esri/core/workers/chunks/3f3a2c6ce48d832bf2f1.js +1 -0
  106. package/assets/esri/core/workers/chunks/{82493f51a2182f76dd2f.js → 459e3e507e8ea3e7e6ab.js} +1 -1
  107. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +1 -0
  108. package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +1 -0
  109. package/assets/esri/core/workers/chunks/53eaad20c4f55dae21e0.js +1 -0
  110. package/assets/esri/core/workers/chunks/55eff05354069f34bb1d.js +1 -0
  111. package/assets/esri/core/workers/chunks/569e9ec636199d1f1744.js +1 -0
  112. package/assets/esri/core/workers/chunks/598fade09fa4da759ac2.js +1 -0
  113. package/assets/esri/core/workers/chunks/5ac3096139e3eafd0e1d.js +1 -0
  114. package/assets/esri/core/workers/chunks/{93d06a1a0b700ddb3807.js → 5bdd5ae2d2f23ef6b331.js} +1 -1
  115. package/assets/esri/core/workers/chunks/5db336767959507c07e5.js +2 -0
  116. package/assets/esri/core/workers/chunks/{c03bffa13841e4f80379.js.LICENSE.txt → 5db336767959507c07e5.js.LICENSE.txt} +2 -2
  117. package/assets/esri/core/workers/chunks/5e5225623977e61fd0ef.js +1 -0
  118. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +1 -0
  119. package/assets/esri/core/workers/chunks/64640051f1fd787a3362.js +1 -0
  120. package/assets/esri/core/workers/chunks/6d230c55cde66ee905b3.js +1 -0
  121. package/assets/esri/core/workers/chunks/{c1bd47cde53918f454ca.js → 729407e372c8353cf871.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{29283c19e1ccdc6cfbde.js → 736a11e64e5f03e3936b.js} +34 -33
  123. package/assets/esri/core/workers/chunks/769b66cca8347f0f84db.js +1 -0
  124. package/assets/esri/core/workers/chunks/7c4746f60332620f75c5.js +1 -0
  125. package/assets/esri/core/workers/chunks/{b6dd25bccb9f6e19c18e.js → 7c7ff11246479382974c.js} +1 -1
  126. package/assets/esri/core/workers/chunks/7fce62ef3f0b011e0d35.js +1 -0
  127. package/assets/esri/core/workers/chunks/814d72abbfdd4552e4ec.js +2 -0
  128. package/assets/esri/core/workers/chunks/{373782e9f5d61616fde4.js.LICENSE.txt → 814d72abbfdd4552e4ec.js.LICENSE.txt} +1 -6
  129. package/assets/esri/core/workers/chunks/{07f206719763173faa8d.js → 873327fc41edd3830afa.js} +4 -4
  130. package/assets/esri/core/workers/chunks/8ea182c2fc20dba79ef2.js +1 -0
  131. package/assets/esri/core/workers/chunks/{d58fae2fc9d148e015ae.js → 90dc783a617ff053e862.js} +1 -1
  132. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +1 -0
  133. package/assets/esri/core/workers/chunks/93f792f5b94f3745b57d.js +2 -0
  134. package/assets/esri/core/workers/chunks/{3845e1d47bb51c06682e.js.LICENSE.txt → 93f792f5b94f3745b57d.js.LICENSE.txt} +1 -1
  135. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +1 -0
  136. package/assets/esri/core/workers/chunks/a276980c06d5d311a37e.js +1 -0
  137. package/assets/esri/core/workers/chunks/a600194cfe26aedc21dd.js +1 -0
  138. package/assets/esri/core/workers/chunks/{a4239e301728d594afa5.js → a6b14665a46c2af5ac11.js} +1 -1
  139. package/assets/esri/core/workers/chunks/ae156b99e60a2bf940e4.js +1 -0
  140. package/assets/esri/core/workers/chunks/afcb12bf54a5656f641e.js +2 -0
  141. package/assets/esri/core/workers/chunks/{75e01c6404cbd51daabc.js.LICENSE.txt → afcb12bf54a5656f641e.js.LICENSE.txt} +1 -1
  142. package/assets/esri/core/workers/chunks/b2f1d1721a9dd88a1adf.js +1 -0
  143. package/assets/esri/core/workers/chunks/{4275dcec730a11173661.js → b7fc99ec15e2c86a6425.js} +1 -1
  144. package/assets/esri/core/workers/chunks/b8248939373e25a8d6db.js +1 -0
  145. package/assets/esri/core/workers/chunks/bbaadce582df7e20397b.js +1 -0
  146. package/assets/esri/core/workers/chunks/{18404cd87d29b2bdc7bf.js → c4dba6cf17aece714d22.js} +1 -1
  147. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js +2 -0
  148. package/assets/esri/core/workers/chunks/{e4d522ade82192f32d54.js.LICENSE.txt → c5d786166a5609b85276.js.LICENSE.txt} +1 -1
  149. package/assets/esri/core/workers/chunks/{f4111bb5e5a4910b684a.js → c616139a160eab9cd717.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{c589d32f8efcca6bf712.js → c6b08fdc0421258efcf5.js} +1 -1
  151. package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +1 -0
  152. package/assets/esri/core/workers/chunks/{eb61e484f090fca28937.js → cb2be1a81bdd3443f758.js} +1 -1
  153. package/assets/esri/core/workers/chunks/ccc50f28f217e50cc2c3.js +1 -0
  154. package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +1 -0
  155. package/assets/esri/core/workers/chunks/{df1225a3e751a662c182.js → d04efa51da9b4eb3a8a7.js} +1 -1
  156. package/assets/esri/core/workers/chunks/d434d44916d32d4b10d5.js +1 -0
  157. package/assets/esri/core/workers/chunks/{50c1753ee3dc0d28ffd7.js → d696abbb1b13ac1a689b.js} +1 -1
  158. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js +2 -0
  159. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js.LICENSE.txt +3 -0
  160. package/assets/esri/core/workers/chunks/{4a15308b54734247f38e.js → dd8e72d6784a8ebc115d.js} +1 -1
  161. package/assets/esri/core/workers/chunks/de0784474d2e9e504a91.js +1 -0
  162. package/assets/esri/core/workers/chunks/{aca3ccb9599bcc444617.js → e1472af8f5d64c057d04.js} +1 -1
  163. package/assets/esri/core/workers/chunks/e27fa1e84f16b7f19a90.js +1 -0
  164. package/assets/esri/core/workers/chunks/e2cd6038d9c7167b128e.js +1 -0
  165. package/assets/esri/core/workers/chunks/{0252d853419adc203f04.js → ef6e805c49e1afdf966b.js} +1 -1
  166. package/assets/esri/core/workers/chunks/f2bc75a718a10065011d.js +1 -0
  167. package/assets/esri/core/workers/chunks/{1263391920fbb8926ced.js → f34ce3c37a385b341631.js} +1 -1
  168. package/assets/esri/core/workers/chunks/{e3d25d027885eb1a415f.js → f458a40e1f8fce3ad23c.js} +1 -1
  169. package/assets/esri/core/workers/chunks/f65b720b750aebca1bcd.js +1 -0
  170. package/assets/esri/core/workers/chunks/fdcbd28f38bc485ac5e3.js +1 -0
  171. package/assets/esri/themes/dark/main.css +1 -1
  172. package/assets/esri/themes/light/main.css +1 -1
  173. package/assets/esri/themes/light/view.css +1 -1
  174. package/chunks/ComponentShader.glsl.js +14 -14
  175. package/chunks/DefaultMaterial.glsl.js +6 -6
  176. package/chunks/OITBlend.glsl.js +1 -0
  177. package/chunks/Path.glsl.js +3 -3
  178. package/chunks/RealisticTree.glsl.js +5 -5
  179. package/chunks/SSAO.glsl.js +5 -4
  180. package/chunks/Viewshed.glsl.js +1 -1
  181. package/core/promiseUtils.d.ts +1 -0
  182. package/core/urlUtils.d.ts +4 -0
  183. package/identity/IdentityModal.js +1 -1
  184. package/interfaces.d.ts +246 -42
  185. package/intl/date.js +1 -1
  186. package/intl/messages.js +1 -1
  187. package/intl/number.js +1 -1
  188. package/layers/FeatureLayer.js +1 -1
  189. package/layers/ParquetLayer.js +1 -1
  190. package/layers/ViewshedLayer.js +1 -1
  191. package/layers/graphics/sources/ParquetSource.js +1 -1
  192. package/layers/save/featureLayerUtils.js +1 -1
  193. package/layers/support/ParquetEncodingBase.js +5 -0
  194. package/layers/support/ParquetEncodingLocation.js +5 -0
  195. package/layers/support/ParquetEncodingWkb.js +5 -0
  196. package/layers/support/layerUtils.js +1 -1
  197. package/layers/support/parquetUtils.js +5 -0
  198. package/libs/parquet/parquet.js +1 -1
  199. package/package.json +2 -2
  200. package/portal/PortalItem.js +1 -1
  201. package/portal/PortalUser.js +1 -1
  202. package/portal/support/portalItemUtils.js +1 -1
  203. package/rest/networks/trace.js +1 -1
  204. package/rest/print.js +1 -1
  205. package/support/TablesMixin.js +1 -1
  206. package/support/modeUtils.js +5 -0
  207. package/support/revision.js +1 -1
  208. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  209. package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
  210. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  211. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  212. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  213. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  214. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  215. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  216. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  217. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  218. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  219. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  220. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  221. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  222. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  223. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  224. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +1 -1
  225. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  226. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  227. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  228. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  229. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  230. package/views/ToolViewManager.js +1 -1
  231. package/views/analysis/analysisViewUtils.js +1 -1
  232. package/views/draw/support/HighlightHelper.js +1 -1
  233. package/views/interactive/InteractiveToolBase.js +1 -1
  234. package/views/interactive/Tooltip.js +1 -1
  235. package/views/interactive/interactiveToolUtils.js +1 -1
  236. package/views/interactive/keybindings.js +1 -1
  237. package/views/ui/UI.js +1 -1
  238. package/webdoc/support/saveUtils.js +1 -1
  239. package/webdoc/support/webdocSaveUtils.js +1 -1
  240. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  241. package/widgets/Feature/FeatureMedia.js +1 -1
  242. package/widgets/Feature/support/featureUtils.js +1 -1
  243. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  244. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  245. package/widgets/FeatureTable.js +1 -1
  246. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  247. package/widgets/TimeSlider.js +1 -1
  248. package/widgets/support/AnalysisViewModel.js +1 -1
  249. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  250. package/widgets/support/widget.js +1 -1
  251. package/assets/esri/core/workers/chunks/0297e55a49ca0d1231ef.js +0 -1
  252. package/assets/esri/core/workers/chunks/04008648c59031bca8ea.js +0 -1
  253. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +0 -1
  254. package/assets/esri/core/workers/chunks/0b4e63e705db09dbe171.js +0 -1
  255. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +0 -1
  256. package/assets/esri/core/workers/chunks/1b87fa15470cce26feea.js +0 -1
  257. package/assets/esri/core/workers/chunks/239821543abbd63c5787.js +0 -2
  258. package/assets/esri/core/workers/chunks/272a309760dacb13dee3.js +0 -1
  259. package/assets/esri/core/workers/chunks/2791f1f2791087d0217f.js +0 -1
  260. package/assets/esri/core/workers/chunks/35dccd3883d2e466c42e.js +0 -1
  261. package/assets/esri/core/workers/chunks/364860a42edc0c3b8d5b.js +0 -1
  262. package/assets/esri/core/workers/chunks/373782e9f5d61616fde4.js +0 -2
  263. package/assets/esri/core/workers/chunks/37e49d1a1407c193dcd0.js +0 -1
  264. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +0 -1
  265. package/assets/esri/core/workers/chunks/3845e1d47bb51c06682e.js +0 -2
  266. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +0 -1
  267. package/assets/esri/core/workers/chunks/42aab2a336ee22fd9055.js +0 -1
  268. package/assets/esri/core/workers/chunks/4ba34124054752b363c0.js +0 -1
  269. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +0 -1
  270. package/assets/esri/core/workers/chunks/593396b4c210da77a131.js +0 -1
  271. package/assets/esri/core/workers/chunks/5b32c2a1b276352593dc.js +0 -1
  272. package/assets/esri/core/workers/chunks/5df4e73905c0ae75e37c.js +0 -1
  273. package/assets/esri/core/workers/chunks/5fb9bb3ac2f60dbd59c4.js +0 -1
  274. package/assets/esri/core/workers/chunks/66e90f7d473d1f688254.js +0 -1
  275. package/assets/esri/core/workers/chunks/68d7babbe7e0d934e056.js +0 -1
  276. package/assets/esri/core/workers/chunks/6e6b60779c11efc128af.js +0 -1
  277. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +0 -1
  278. package/assets/esri/core/workers/chunks/75e01c6404cbd51daabc.js +0 -2
  279. package/assets/esri/core/workers/chunks/77660e18ea793ae85f83.js +0 -1
  280. package/assets/esri/core/workers/chunks/879d672d12f9ef2e1b50.js +0 -1
  281. package/assets/esri/core/workers/chunks/90442f47c9f31f26b453.js +0 -1
  282. package/assets/esri/core/workers/chunks/91439b59260b0fb04be9.js +0 -1
  283. package/assets/esri/core/workers/chunks/96978d039f183565bffa.js +0 -1
  284. package/assets/esri/core/workers/chunks/999a4f7ca581f28cc1c4.js +0 -1
  285. package/assets/esri/core/workers/chunks/af41dcc8006cd0f451c2.js +0 -1
  286. package/assets/esri/core/workers/chunks/af9fda47d02c51a2c7da.js +0 -1
  287. package/assets/esri/core/workers/chunks/baed733a29aa65efc2a0.js +0 -2
  288. package/assets/esri/core/workers/chunks/c03bffa13841e4f80379.js +0 -2
  289. package/assets/esri/core/workers/chunks/c7ab674764312d65348f.js +0 -1
  290. package/assets/esri/core/workers/chunks/ca0572fe5614005acceb.js +0 -1
  291. package/assets/esri/core/workers/chunks/d2c7067bb6654c0e2793.js +0 -1
  292. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +0 -1
  293. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +0 -1
  294. package/assets/esri/core/workers/chunks/e13caf9691f556071e31.js +0 -1
  295. package/assets/esri/core/workers/chunks/e14449f07ed3386f4f2b.js +0 -1
  296. package/assets/esri/core/workers/chunks/e31bb256921807464715.js +0 -1
  297. package/assets/esri/core/workers/chunks/e4d522ade82192f32d54.js +0 -2
  298. package/assets/esri/core/workers/chunks/e5713b757f770a138b8c.js +0 -1
  299. package/assets/esri/core/workers/chunks/e6544e966f14fb410157.js +0 -1
  300. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +0 -1
  301. package/assets/esri/core/workers/chunks/e7cb4003c45e42b48ea6.js +0 -1
  302. package/assets/esri/core/workers/chunks/eb011e8b14db37ddb110.js +0 -1
  303. package/assets/esri/core/workers/chunks/f0c864425f000ab87a7b.js +0 -1
  304. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +0 -1
  305. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +0 -1
  306. package/assets/esri/core/workers/chunks/fa2d836d4a844b26b84e.js +0 -1
  307. package/layers/support/parquetLayerUtils.js +0 -5
  308. 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 t from"../../request.js";import{parseUrl as s,asValidOptions as r,encode as e}from"../utils.js";import o from"./support/TraceResult.js";async function n(o,n,a){const u=s(o),i=n.toJSON();i.traceLocations=JSON.stringify(n.traceLocations),n.resultTypes&&(i.resultTypes=JSON.stringify(n.resultTypes));const y=r(u.query,{query:e({...i,f:"json"}),...a}),p=`${u.path}/trace`;return t(p,y).then((t=>c(t)))}async function a(o,n,a){const c=s(o),u=n.toJSON();u.traceLocations=JSON.stringify(n.traceLocations),n.resultTypes&&(u.resultTypes=JSON.stringify(n.resultTypes));const i=r(c.query,{query:e({...u,async:!0,f:"json"}),...a}),y=`${c.path}/trace`,{data:p}=await t(y,i);return p.statusUrl}function c(t){const{data:s}=t;return o.fromJSON(s.traceResults)}export{a as submitTraceJob,n as trace};
5
+ import t from"../../request.js";import{parseUrl as s,asValidOptions as r,encode as e}from"../utils.js";import o from"./support/TraceResult.js";async function n(o,n,a){const i=s(o),u=n.toJSON();u.traceLocations=JSON.stringify(n.traceLocations),n.resultTypes&&(u.resultTypes=JSON.stringify(n.resultTypes)),n.moment||"SDE.DEFAULT"!==n.gdbVersion?.toUpperCase()&&n.gdbVersion||(u.moment=Date.now());const y=r(i.query,{query:e({...u,f:"json"}),...a}),p=`${i.path}/trace`;return t(p,y).then((t=>c(t)))}async function a(o,n,a){const c=s(o),i=n.toJSON();i.traceLocations=JSON.stringify(n.traceLocations),n.resultTypes&&(i.resultTypes=JSON.stringify(n.resultTypes));const u=r(c.query,{query:e({...i,async:!0,f:"json"}),...a}),y=`${c.path}/trace`,{data:p}=await t(y,u);return p.statusUrl}function c(t){const{data:s}=t;return o.fromJSON(s.traceResults)}export{a as submitTraceJob,n as trace};
package/rest/print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{normalize as o,dataComponents as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,findToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as v,getContextBoundingBox as D,createPolygonLayer as T,createPolylineLayer as L,createPointLayer as O,createMultipointLayer as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as V}from"./support/reportTemplate.js";const M={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},F=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function U(e,t,i){const a=await J(e,i),r=await A(t,a);if("sync"===await j(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function J(e,i){const a=_(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function j(e,t){return he(await J(e,t))}async function k(e,t){return(await J(e,t)).gpMetadata.tasks}async function A(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:F.toJSON(e)??void 0,metricLabel:e?M[e]:void 0,nonMetricUnit:F.toJSON(t)??void 0,nonMetricLabel:t?M[t]:void 0}:void 0}}let c=null;s?.legendLayers&&(c=s.legendLayers.map((e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a})));const u=await C(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:V(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function C(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await z(a,t,i)};t.includeTables&&(n.tables=await ne(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function _(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function z(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await ie(e,r,i):S(e)?$(e):"csv"===e?.type?await B(e,r,i):"catalog-footprint"===e?.type?await q(e,r,i):"feature"===e?.type?await W(e,r,i):"geojson"===e?.type?await G(e,r,i):"graphics"===e?.type?await Q(e,r,i):"imagery"===e?.type?H(e,i):"imagery-tile"===e?.type?await X(e,r,i):"kml"===e?.type?await Y(e,r,i):"map-image"===e?.type?Z(e,r,i):"map-notes"===e?.type?await ee(r,i):"open-street-map"===e?.type?te():"stream"===e?.type?await ae(e,r,i):"subtype-group"===e?.type?await re(e,i):"tile"===e?.type?oe(e,i):"vector-tile"===e?.type?await se(e,r,i):"web-tile"===e?.type?le(e):"wfs"===e?.type?await ce(e,r,i):"wms"===e?.type?ue(e,i):"wmts"===e?.type?ye(e):await ie(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await K(null,e.graphics,t,i);r&&a.push(r)}return a}function $(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function q(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return K(e,await me(t),i,a)}const r=e.parent,n={id:(o=ge(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return pe(n,r),n}async function B(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=ge(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return K(e,await me(a),r,i)}async function K(e,t,i,a){let r;const n=T(),o=L(),s=O(),u=E(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=ge(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,be(g.symbol)?g.symbol=await fe(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter((e=>e.featureSet.features.length>0));for(const l of h){const e=l.featureSet.features.every((e=>e.symbol));if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await de(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function W(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&n<2.9||"pie-chart"===r?.type||"dot-density"===r?.type&&n<2.6)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await me(o);a=await K(e,t,s,i)}else{if(a={id:(p=ge(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,pe(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await de(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;a.selectionObjectIds=t.highlightIds,a.selectionSymbol=v(e.geometryType,t.highlightOptions??l.highlightOptions)}}var p;return a}async function G(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await me(t.layerView),t.printTemplate,i)}async function Q(e,{printTemplate:t},i){return K(e,null,t,i)}function H(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),pe(i,e),i}async function X(e,t,i){if("flow"===e.renderer?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=ge(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",pe(a,e),a}async function Y(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=ge(e,"web-map");return t.type="kml",delete t.layerType,t.url=o(e.url),t}const r=[],n=t.layerView,s="data:image/png;base64,";n.allVisibleMapImages.forEach(((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(s)?a.imageData=t.href.slice(s.length):a.url=t.href,r.push(a)}));const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await K(null,l,a,i)};return r.push(c),r}function Z(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers&&e.sublayers.forEach(l),o.length&&(o=o.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(c=ge(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),pe(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function ee({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await K(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await K(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function te(){return{type:"OpenStreetMap"}}async function ie(e,{printTemplate:t,view:i},r){const n={type:"image"},o={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(o.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(o.area={x:0,y:0,width:i.width,height:i.height},u||(o.area.width-=1),y||(o.area.height-=1),!r.ssExtent)){const e=i.toMap(a(o.area.width,o.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(o);return n.imageData=s(p.dataUrl)?.data,n}async function ae(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return K(e,await me(t),i,a)}async function re(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=ge(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(Array.isArray(i.layers))for(const r of i.layers)delete r.popupInfo;return pe(i,e),i}async function ne(e){const t=[],i=[];for(const r of e.map.allTables)"feature"!==r.type||r.loaded||i.push(r.load());i.length&&await Promise.allSettled(i);for(const r of e.map.allTables)if("feature"===r.type&&r.loaded&&r.isTable&&"feature-layer"===r.source?.type){const e={id:(a=ge(r)).id,title:a.title,customParameters:a.customParameters,layerDefinition:{definitionExpression:a.layerDefinition?.definitionExpression},url:a.url};pe(e,r),t.push(e)}var a;return t.length?t:void 0}function oe(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return pe(i,e),i}async function se(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return ie(e,t,i)}function le(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function ce(e,t,i){return parseFloat(i.cimVersion)<3.5?ie(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=ge(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function ue(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:o(e.url),version:e.version}),i}function ye(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function pe(e,t){t.url&&(e.url=o(e.url||t.url),e.token=f(e.url,t.apiKey))}async function fe(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=D(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function de(e,t){const i=e.type;if("simple"===i&&be(e.symbol))e.symbol=await fe(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){be(e.defaultSymbol)&&(e.defaultSymbol=await fe(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)be(e.symbol)&&(e.symbol=await fe(e.symbol,t))}}async function me(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function ge(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function he(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function be(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,A as getGpPrintParams,_ as getGpServerUrl,j as getMode,k as getTasks,R as printCacheMap};
5
+ import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{normalize as o,dataComponents as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,findToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as v,getContextBoundingBox as D,createPolygonLayer as T,createPolylineLayer as L,createPointLayer as O,createMultipointLayer as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as V}from"./support/reportTemplate.js";const M={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},F=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function U(e,t,i){const a=await k(e,i),r=await A(t,a);if("sync"===await J(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function k(e,i){const a=_(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function J(e,t){return he(await k(e,t))}async function j(e,t){return(await k(e,t)).gpMetadata.tasks}async function A(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:F.toJSON(e)??void 0,metricLabel:e?M[e]:void 0,nonMetricUnit:F.toJSON(t)??void 0,nonMetricLabel:t?M[t]:void 0}:void 0}}let c=null;s?.legendLayers&&(c=s.legendLayers.map((e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a})));const u=await C(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:V(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function C(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await z(a,t,i)};t.includeTables&&(n.tables=await ne(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function _(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function z(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await ie(e,r,i):S(e)?$(e):"csv"===e?.type?await B(e,r,i):"catalog-footprint"===e?.type?await q(e,r,i):"feature"===e?.type?await W(e,r,i):"geojson"===e?.type?await G(e,r,i):"graphics"===e?.type?await Q(e,r,i):"imagery"===e?.type?H(e,i):"imagery-tile"===e?.type?await X(e,r,i):"kml"===e?.type?await Y(e,r,i):"map-image"===e?.type?Z(e,r,i):"map-notes"===e?.type?await ee(r,i):"open-street-map"===e?.type?te():"stream"===e?.type?await ae(e,r,i):"subtype-group"===e?.type?await re(e,i):"tile"===e?.type?oe(e,i):"vector-tile"===e?.type?await se(e,r,i):"web-tile"===e?.type?le(e):"wfs"===e?.type?await ce(e,r,i):"wms"===e?.type?ue(e,i):"wmts"===e?.type?ye(e):await ie(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await K(null,e.graphics,t,i);r&&a.push(r)}return a}function $(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function q(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return K(e,await me(t),i,a)}const r=e.parent,n={id:(o=ge(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return pe(n,r),n}async function B(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=ge(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return K(e,await me(a),r,i)}async function K(e,t,i,a){let r;const n=T(),o=L(),s=O(),u=E(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=ge(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,be(g.symbol)?g.symbol=await fe(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter((e=>e.featureSet.features.length>0));for(const l of h){const e=l.featureSet.features.every((e=>e.symbol));if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await de(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function W(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&n<2.9||"pie-chart"===r?.type||"dot-density"===r?.type&&n<2.6)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await me(o);a=await K(e,t,s,i)}else{if(a={id:(p=ge(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,pe(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await de(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;a.selectionObjectIds=t.highlightIds,a.selectionSymbol=v(e.geometryType,t.highlightOptions??l.highlightOptions)}}var p;return a}async function G(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await me(t.layerView),t.printTemplate,i)}async function Q(e,{printTemplate:t},i){return K(e,null,t,i)}function H(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),pe(i,e),i}async function X(e,t,i){if("flow"===e.renderer?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=ge(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",pe(a,e),a}async function Y(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=ge(e,"web-map");return t.type="kml",delete t.layerType,t.url=o(e.url),t}const r=[],n=t.layerView,s="data:image/png;base64,";n.allVisibleMapImages.forEach(((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(s)?a.imageData=t.href.slice(s.length):a.url=t.href,r.push(a)}));const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await K(null,l,a,i)};return r.push(c),r}function Z(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers&&e.sublayers.forEach(l),o.length&&(o=o.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(c=ge(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),pe(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function ee({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await K(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await K(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function te(){return{type:"OpenStreetMap"}}async function ie(e,{printTemplate:t,view:i},r){const n={type:"image"},o={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(o.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(o.area={x:0,y:0,width:i.width,height:i.height},u||(o.area.width-=1),y||(o.area.height-=1),!r.ssExtent)){const e=i.toMap(a(o.area.width,o.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(o);return n.imageData=s(p.dataUrl)?.data,n}async function ae(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return K(e,await me(t),i,a)}async function re(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=ge(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(pe(i,e),Array.isArray(i.layers)){for(const e of i.layers)delete e.popupInfo;i.token&&i.layers.length>0&&(i.layers[i.layers.length-1].token=i.token,delete i.token)}return i}async function ne(e){const t=[],i=[];for(const r of e.map.allTables)"feature"!==r.type||r.loaded||i.push(r.load());i.length&&await Promise.allSettled(i);for(const r of e.map.allTables)if("feature"===r.type&&r.loaded&&r.isTable&&"feature-layer"===r.source?.type){const e={id:(a=ge(r)).id,title:a.title,customParameters:a.customParameters,layerDefinition:{definitionExpression:a.layerDefinition?.definitionExpression},url:a.url};pe(e,r),t.push(e)}var a;return t.length?t:void 0}function oe(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return pe(i,e),i}async function se(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return ie(e,t,i)}function le(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function ce(e,t,i){return parseFloat(i.cimVersion)<3.5?ie(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=ge(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function ue(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:o(e.url),version:e.version}),i}function ye(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function pe(e,t){t.url&&(e.url=o(e.url||t.url),e.token=f(e.url,t.apiKey))}async function fe(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=D(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function de(e,t){const i=e.type;if("simple"===i&&be(e.symbol))e.symbol=await fe(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){be(e.defaultSymbol)&&(e.defaultSymbol=await fe(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)be(e.symbol)&&(e.symbol=await fe(e.symbol,t))}}async function me(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function ge(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function he(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function be(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,A as getGpPrintParams,_ as getGpServerUrl,J as getMode,j as getTasks,R as printCacheMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Collection.js";import{referenceSetter as r}from"../core/collectionUtils.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";const a=new Set(["feature","subtype-group"]);function n(t,e,r){if(t)for(let s=0,o=t.length;s<o;s++){const o=t.at(s);if(o[e]===r)return o;if("group"===o?.type){const t=n(o.tables,e,r);if(t)return t}}}const l=l=>{let p=class extends l{constructor(...t){super(...t),this.tables=new e,this.addHandles([this.tables.on("after-add",(t=>{const e=t.item;e.parent&&e.parent!==this&&"tables"in e.parent&&e.parent.tables.remove(e),e.parent=this,a.has(e.type)||s.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on("after-remove",(t=>{t.item.parent=null}))])}destroy(){const t=this.tables.toArray();for(const e of t)e.destroy();this.tables.destroy()}set tables(t){this._set("tables",r(t,this._get("tables")))}findTableById(t){return n(this.tables,"id",t)}findTableByUid(t){return n(this.tables,"uid",t)}};return t([o()],p.prototype,"tables",null),p=t([i("esri.support.TablesMixin")],p),p};export{l as TablesMixin};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Collection.js";import{referenceSetter as r}from"../core/collectionUtils.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";const a=new Set(["feature","subtype-group"]);function n(t,e,r){if(t)for(let s=0,o=t.length;s<o;s++){const o=t.at(s);if(o[e]===r)return o;if("group"===o?.type){const t=n(o.tables,e,r);if(t)return t}}}const l=l=>{let p=class extends l{constructor(...t){super(...t),this.tables=new e,this.addHandles([this.tables.on("after-add",(t=>{const e=t.item;e.parent&&e.parent!==this&&"tables"in e.parent&&e.parent.tables.remove(e),e.parent=this,a.has(e.type)||s.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on("after-remove",(t=>{t.item.parent=null}))])}destroy(){const t=this.tables.toArray();for(const e of t)e.destroy();this.tables.destroy()}set tables(t){this._set("tables",r(t,this._get("tables")))}findTableById(t){return n(this.tables,"id",t)}findTableByUid(t){return n(this.tables,"uid",t)}};return t([o()],p.prototype,"tables",null),p=t([i("esri.support.TablesMixin")],p),p};export{l as TablesMixin,a as allowedTableTypes};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ const t="calcite-mode-",e="dark",c="light",r=/\W/g,n="--esri-calcite-mode-name";function o(){return getComputedStyle(document.body).getPropertyValue(n).replaceAll(r,"").toLowerCase()}function s(){return o()===e}function a(){const r=o();switch(r){case e:case c:return`${t}${r}`;default:return null}}function i(t){const e=a();e&&(l(t),t.classList.add(e))}function l(e){Array.from(e.classList).forEach((c=>{c.startsWith(t)&&e.classList.remove(c)}))}export{a as getCalciteModeClass,s as isDarkMode,n as modeNameCustomCSSProp,i as setCalciteModeClass};
@@ -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
- const c="20250416",d="b270f3a2c346824508d44d20e800819cd5697994";export{c as buildDate,d as commitHash};
5
+ const e="20250417",a="24b0d64223a7221d25133eae89073f5890f17e94";export{e as buildDate,a as commitHash};
@@ -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{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};
@@ -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"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as V,h as f,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as f,h as V,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),f(c,c),V(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z 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{getFeatureId as s,updatePointsFromFeatureReference as t}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,when as l,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectOrLoad as f,canProjectWithoutEngine as V,isLoaded as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as j,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as C}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as D}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as T}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as k,removeAnalysisViewTool as S,activateAnalysisViewTool as U}from"../../analysis/analysisViewUtils.js";let A=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this._placementTask=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}initialize(){const e=this.view;this._viewshedRenderer=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=T.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(s=>{const t=new D({renderCoordsHelper:e.renderCoordsHelper,viewshed:s}),i=Symbol();return this.addHandles([n((()=>({valid:t.isValid(),canProject:V(t.observer?.spatialReference,this.view.spatialReference)||y()})),(({valid:e,canProject:s},i)=>{this.visible&&(e&&s?this._addViewshedsToRenderer(t):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(t),s||b(this.analysis,t.observer.spatialReference,r.getLogger(this)))}),c),...this._createFeatureReferenceHandles(t)],i),{viewshedComputedData:t,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(t),t.destroy()}}})),this._analysisVisualization=new C({view:e,analysisViewData:this,isDecoration:!this.parent}),this.addHandles([n((()=>this.visible),(e=>{const s=this.viewshedComputedDataHandles;if(null==s)return;e||(this.selectedViewshed=null);const t=s.map((e=>e.viewshedComputedData)).filter((e=>e.isValid())).toArray();e?this._addViewshedsToRenderer(t):this._removeViewshedsFromRenderer(t)})),n((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:s})=>s.renderCoordsHelper=e))})),k(this,F),l((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),h)])}destroy(){this._placementTask=a(this._placementTask),S(this),this._analysisVisualization=d(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:s}=this;return[n((()=>[s.state.camera,s.slicePlane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(s,e)}),c),this._createElevationUpdateHandle(e),l((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(s,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const s=(t,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=f(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>s(t,i)));const d=a.geometry;null!=d&&(_(t,i,I,r.spatialReference),g(I,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:t})=>s(e,t)))}async createViewsheds(e){return this._placementTask=a(this._placementTask),this._placementTask=U(this,e),null!=this.tool&&this.tool.createViewsheds(),await this._placementTask.promise}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:s(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};t(e,this._intersector,d,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const s of this.view.tools.items)s!==this.tool&&s instanceof F&&(s.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"_analysisVisualization",void 0),e([p()],A.prototype,"_placementTask",void 0),e([p()],A.prototype,"_viewshedRenderer",void 0),A=e([m("esri.views.3d.analysis.ViewshedAnalysisView3D")],A);const z=A,I=j();export{z as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,when as l,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectOrLoad as f,canProjectWithoutEngine as V,isLoaded as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as j,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as C}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as D}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as T}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as k,removeAnalysisViewTool as S,activateAnalysisViewTool as U}from"../../analysis/analysisViewUtils.js";let A=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this._placementTask=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}initialize(){const e=this.view;this._viewshedRenderer=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=T.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(t=>{const s=new D({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([n((()=>({valid:s.valid,canProject:V(s.observer?.spatialReference,this.view.spatialReference)||y()})),(({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))}),c),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}})),this._analysisVisualization=new C({view:e,analysisViewData:this,isDecoration:!this.parent}),this.addHandles([n((()=>this.visible),(e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map((e=>e.viewshedComputedData)).filter((e=>e.valid)).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)})),n((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:t})=>t.renderCoordsHelper=e))})),k(this,F),l((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),h)])}destroy(){this._placementTask=a(this._placementTask),S(this),this._analysisVisualization=d(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[n((()=>[t.state.camera,t.slicePlane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(t,e)}),c),this._createElevationUpdateHandle(e),l((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=f(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>t(s,i)));const d=a.geometry;null!=d&&(_(s,i,I,r.spatialReference),g(I,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:s})=>t(e,s)))}async createViewsheds(e){return this._placementTask=a(this._placementTask),this._placementTask=U(this,e),null!=this.tool&&this.tool.createViewsheds(),await this._placementTask.promise}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};s(e,this._intersector,d,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof F&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"_analysisVisualization",void 0),e([p()],A.prototype,"_placementTask",void 0),e([p()],A.prototype,"_viewshedRenderer",void 0),A=e([m("esri.views.3d.analysis.ViewshedAnalysisView3D")],A);const z=A,I=j();export{z as default};