@arcgis/core 5.1.0-next.105 → 5.1.0-next.107

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 (478) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
  2. package/analysis/DimensionAnalysis.d.ts +3 -3
  3. package/analysis/DimensionSimpleStyle.d.ts +2 -2
  4. package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
  5. package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
  6. package/analysis/ElevationProfileAnalysis.d.ts +3 -3
  7. package/analysis/LengthDimension.d.ts +2 -2
  8. package/analysis/LineOfSightAnalysis.d.ts +4 -4
  9. package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
  10. package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
  11. package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
  12. package/analysis/ShadowCast/types.d.ts +1 -1
  13. package/analysis/ShadowCastAnalysis.d.ts +11 -6
  14. package/analysis/SliceAnalysis.d.ts +4 -4
  15. package/analysis/SlicePlane.d.ts +3 -3
  16. package/analysis/Viewshed.d.ts +2 -2
  17. package/analysis/ViewshedAnalysis.d.ts +3 -3
  18. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
  19. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
  20. package/applications/Components/imageryUtils.d.ts +24 -0
  21. package/applications/Components/layerUtils.d.ts +21 -0
  22. package/applications/Components/layerUtils.js +2 -0
  23. package/applications/Components/templateUtils.d.ts +11 -1
  24. package/applications/Components/templateUtils.js +1 -1
  25. package/arcgisGlobal.d.ts +6 -0
  26. package/assets/components/assets/icon/buttons16.json +1 -0
  27. package/assets/components/assets/icon/buttons24.json +1 -0
  28. package/assets/components/assets/icon/buttons32.json +1 -0
  29. package/assets/components/assets/icon/entityTypes16.json +1 -0
  30. package/assets/components/assets/icon/entityTypes24.json +1 -0
  31. package/assets/components/assets/icon/entityTypes32.json +1 -0
  32. package/assets/esri/core/t9n/Units_ar.json +1 -1
  33. package/assets/esri/core/t9n/Units_bg.json +1 -1
  34. package/assets/esri/core/t9n/Units_bs.json +1 -1
  35. package/assets/esri/core/t9n/Units_ca.json +1 -1
  36. package/assets/esri/core/t9n/Units_cs.json +1 -1
  37. package/assets/esri/core/t9n/Units_da.json +1 -1
  38. package/assets/esri/core/t9n/Units_de.json +1 -1
  39. package/assets/esri/core/t9n/Units_el.json +1 -1
  40. package/assets/esri/core/t9n/Units_es.json +1 -1
  41. package/assets/esri/core/t9n/Units_et.json +1 -1
  42. package/assets/esri/core/t9n/Units_fi.json +1 -1
  43. package/assets/esri/core/t9n/Units_fr.json +1 -1
  44. package/assets/esri/core/t9n/Units_he.json +1 -1
  45. package/assets/esri/core/t9n/Units_hr.json +1 -1
  46. package/assets/esri/core/t9n/Units_hu.json +1 -1
  47. package/assets/esri/core/t9n/Units_id.json +1 -1
  48. package/assets/esri/core/t9n/Units_it.json +1 -1
  49. package/assets/esri/core/t9n/Units_ja.json +1 -1
  50. package/assets/esri/core/t9n/Units_ko.json +1 -1
  51. package/assets/esri/core/t9n/Units_lt.json +1 -1
  52. package/assets/esri/core/t9n/Units_lv.json +1 -1
  53. package/assets/esri/core/t9n/Units_nl.json +1 -1
  54. package/assets/esri/core/t9n/Units_no.json +1 -1
  55. package/assets/esri/core/t9n/Units_pl.json +1 -1
  56. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  57. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  58. package/assets/esri/core/t9n/Units_ro.json +1 -1
  59. package/assets/esri/core/t9n/Units_ru.json +1 -1
  60. package/assets/esri/core/t9n/Units_sk.json +1 -1
  61. package/assets/esri/core/t9n/Units_sl.json +1 -1
  62. package/assets/esri/core/t9n/Units_sr.json +1 -1
  63. package/assets/esri/core/t9n/Units_sv.json +1 -1
  64. package/assets/esri/core/t9n/Units_th.json +1 -1
  65. package/assets/esri/core/t9n/Units_tr.json +1 -1
  66. package/assets/esri/core/t9n/Units_uk.json +1 -1
  67. package/assets/esri/core/t9n/Units_vi.json +1 -1
  68. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  69. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  70. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  71. package/assets/esri/core/workers/RemoteClient.js +1 -1
  72. package/assets/esri/core/workers/chunks/{6854b28853f5dd195110.js → 01c70c27aa3a955e2928.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{b7a81fd4994eabba1869.js → 0c8e6ccb5a8174718d62.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a943bd2e6fb7443c2b66.js → 17604cbd4d24158e2c16.js} +1 -1
  75. package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
  76. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
  77. package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
  78. package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
  79. package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
  80. package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
  81. package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
  82. package/assets/esri/core/workers/chunks/{2dced41ff2aa1bd86665.js → 33ec193e6d7a0cb9d8dd.js} +1 -1
  83. package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
  84. package/assets/esri/core/workers/chunks/37c63570c0b4981cd519.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a0e72b107991ba38a9f0.js → 502c3da8c49bf885f51d.js} +1 -1
  86. package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +1 -0
  87. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +1 -0
  88. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
  89. package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js → 55334ad3618899cdbf78.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{1e8d5bfc5f8c2664190c.js → 56d9d3f108ff6e719dd4.js} +1 -1
  92. package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
  93. package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
  94. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
  95. package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
  96. package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
  97. package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +1 -0
  98. package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
  99. package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{e90afd914f2ccd4f5374.js → 7ce60331f94ee0a5d674.js} +6 -6
  101. package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
  102. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
  103. package/assets/esri/core/workers/chunks/{7617bd0f3a70dfe61637.js → 8557dd9ef336b23f768f.js} +1 -1
  104. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
  105. package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
  106. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
  108. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
  109. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
  110. package/assets/esri/core/workers/chunks/{fb415b01f0f1d644832d.js → ac408c62565e2c8b5975.js} +1 -1
  111. package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
  112. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +2 -0
  113. package/assets/esri/core/workers/chunks/{0cc74bc3772be51cabc1.js → bbaf8baa3ca6195467e4.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
  115. package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
  116. package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
  117. package/assets/esri/core/workers/chunks/{39a8e6c9d710d3faea3c.js → cdb48d198145493f76f3.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{359dbfbfb9acfb18bc6e.js → d4014213c476bf8099af.js} +1 -1
  119. package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
  120. package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
  121. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
  122. package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
  123. package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
  124. package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
  125. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
  126. package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
  127. package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
  128. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  129. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  130. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  131. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
  132. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -24
  133. package/assets/esri/themes/dark/main.css +1 -1
  134. package/assets/esri/themes/light/main.css +1 -1
  135. package/assets/esri/themes/light/view.css +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  137. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  138. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  139. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  140. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  141. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  142. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  143. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  144. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  145. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  146. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  147. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  148. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  149. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  150. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  151. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  152. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  153. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  154. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  155. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  156. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  157. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  158. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  159. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  160. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  161. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  162. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  163. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  164. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  165. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  166. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  167. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  168. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  169. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  170. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  171. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  172. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  173. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  174. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  175. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  176. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  179. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  185. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  186. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  187. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  188. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  189. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  190. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  191. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  192. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  193. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  218. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  219. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  220. package/chunks/ComponentShader.glsl.js +11 -15
  221. package/chunks/Fog.glsl.js +3 -3
  222. package/chunks/GlowComposition.glsl.js +38 -56
  223. package/chunks/OITDimOpaque.glsl.js +8 -3
  224. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  225. package/chunks/lyr3DWorker.js +1 -1
  226. package/chunks/pe-wasm.js +1 -1
  227. package/config.js +1 -1
  228. package/core/generatorUtils.js +2 -0
  229. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  230. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  231. package/core/mathUtils.js +1 -1
  232. package/core/typedArrayUtil.js +1 -1
  233. package/geometry/HeightModelInfo.js +1 -1
  234. package/geometry/geometryEngine.d.ts +2 -2
  235. package/geometry/support/WKIDUnitConversion.js +1 -1
  236. package/geometry/support/buffer/BufferView.js +1 -1
  237. package/geometry/support/vcsData.js +1 -1
  238. package/geometry/support/vcsLookup.js +1 -1
  239. package/identity/IdentityManagerBase.js +1 -1
  240. package/kernel.js +1 -1
  241. package/layers/DimensionLayer.d.ts +5 -5
  242. package/layers/FeatureLayer.d.ts +2 -2
  243. package/layers/GaussianSplatLayer.d.ts +3 -3
  244. package/layers/LineOfSightLayer.d.ts +5 -5
  245. package/layers/ParquetLayer.d.ts +6 -4
  246. package/layers/SubtypeGroupLayer.d.ts +2 -2
  247. package/layers/ViewshedLayer.d.ts +3 -3
  248. package/layers/graphics/sources/ParquetSource.js +1 -1
  249. package/layers/graphics/sources/parquet/FileProvider.js +2 -0
  250. package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
  251. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
  252. package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
  253. package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
  254. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  255. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  256. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  257. package/layers/raster/datasets/MRFRaster.js +1 -1
  258. package/layers/raster/datasets/pixelReader.js +1 -1
  259. package/layers/raster/formats/JpgPlus.js +1 -1
  260. package/layers/raster/formats/RasterCodec.js +1 -1
  261. package/layers/raster/functions/clipUtils.js +1 -1
  262. package/layers/support/AggregateField.d.ts +2 -1
  263. package/layers/support/LayerContingentValuesCache.js +1 -1
  264. package/layers/support/SubtypeSublayer.d.ts +4 -4
  265. package/layers/support/parquetUtils.d.ts +18 -7
  266. package/layers/support/parquetUtils.js +1 -1
  267. package/layers/support/rasterFunctionUtils.d.ts +2 -2
  268. package/libs/parquet/parquet.js +1 -1
  269. package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
  270. package/networks/CircuitManager.d.ts +3 -3
  271. package/networks/UnitIdentifierManager.d.ts +1 -1
  272. package/networks/UnitIdentifierManager.js +1 -1
  273. package/networks/UtilityNetwork.d.ts +2 -2
  274. package/networks/UtilityNetwork.js +1 -1
  275. package/networks/support/Circuit.d.ts +1 -1
  276. package/networks/support/CircuitLocation.d.ts +1 -1
  277. package/networks/support/CircuitSection.d.ts +1 -1
  278. package/networks/support/Subcircuit.d.ts +1 -1
  279. package/networks/support/TraceJobInfo.js +1 -1
  280. package/networks/support/jsonTypes.d.ts +10 -3
  281. package/package.json +4 -4
  282. package/popup/FieldInfo.d.ts +4 -2
  283. package/popup/support/FieldInfoFormat.d.ts +3 -2
  284. package/rest/featureService/FeatureService.d.ts +1 -1
  285. package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
  286. package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
  287. package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
  288. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
  289. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  290. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
  291. package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
  292. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
  293. package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
  294. package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
  295. package/rest/networks/support/TraceParameters.js +1 -1
  296. package/rest/networks/support/TraceResult.js +1 -1
  297. package/rest/networks/trace.js +1 -1
  298. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
  299. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  300. package/rest/support/GeneralizeParameters.d.ts +1 -1
  301. package/rest/support/Query.d.ts +1 -1
  302. package/rest/support/RelationParameters.d.ts +1 -1
  303. package/rest/support/types.d.ts +1 -1
  304. package/support/revision.js +1 -1
  305. package/symbols/CIMSymbol.d.ts +1 -1
  306. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
  307. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  308. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  309. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  310. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  311. package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
  312. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
  313. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
  314. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
  315. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
  316. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  317. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  318. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  319. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  320. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
  321. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +5 -1
  322. package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
  323. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  324. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
  325. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  326. package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
  327. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
  328. package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
  329. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
  330. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
  331. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
  332. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  333. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  334. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  335. package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
  336. package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
  337. package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
  338. package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
  339. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  340. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  341. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
  342. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  343. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  344. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  345. package/views/3d/environment/FoggyWeather.js +1 -1
  346. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  347. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  348. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  349. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  350. package/views/3d/layers/i3s/Intersector.js +1 -1
  351. package/views/3d/layers/support/UVWorkspace.js +2 -0
  352. package/views/3d/layers/support/patternUtils.js +1 -1
  353. package/views/3d/layers/support/uvUtils.js +1 -1
  354. package/views/3d/support/ResourceController.js +1 -1
  355. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  356. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  357. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  358. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  359. package/views/3d/support/meshProcessing.js +1 -1
  360. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  361. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
  362. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
  364. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  365. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  366. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  367. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  368. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  369. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  370. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  371. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  372. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  373. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  374. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  375. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  376. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  377. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  378. package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
  379. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  380. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  381. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  382. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  383. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  384. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
  385. package/views/PopupView.d.ts +77 -1
  386. package/views/PopupView.js +1 -1
  387. package/views/SceneView.js +1 -1
  388. package/views/draw/DrawTool.d.ts +77 -0
  389. package/views/draw/support/editingSessionUtils.js +1 -1
  390. package/views/draw/support/managers/PluginLifecycleManager.d.ts +10 -0
  391. package/views/interactive/InteractiveToolBase.d.ts +11 -0
  392. package/views/interactive/editGeometry/interfaces.d.ts +8 -0
  393. package/views/interactive/interfaces.d.ts +20 -0
  394. package/views/layers/DimensionLayerView.d.ts +2 -1
  395. package/views/layers/LineOfSightLayerView.d.ts +2 -1
  396. package/views/layers/ViewshedLayerView.d.ts +2 -1
  397. package/views/webgl/capabilities/load.js +1 -1
  398. package/webscene/Slide.js +1 -1
  399. package/widgets/Attachments/types.d.ts +1 -1
  400. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
  401. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  402. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
  403. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  404. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  405. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  406. package/widgets/BatchAttributeForm/css.js +1 -1
  407. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
  408. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  409. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
  410. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  411. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  412. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  413. package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
  414. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  415. package/widgets/BatchAttributeForm/types.d.ts +30 -2
  416. package/widgets/BatchAttributeForm.d.ts +52 -1
  417. package/widgets/BatchAttributeForm.js +1 -1
  418. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +9 -1
  419. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  420. package/widgets/Editor.d.ts +1 -1
  421. package/widgets/FeatureTable/FieldColumn.js +1 -1
  422. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  423. package/widgets/LayerList/LayerListItem.js +1 -1
  424. package/widgets/Sketch/SketchViewModel.d.ts +67 -2
  425. package/widgets/Sketch/SketchViewModel.js +1 -1
  426. package/widgets/Sketch/VisibleElements.d.ts +19 -1
  427. package/widgets/Sketch/VisibleElements.js +1 -1
  428. package/widgets/Sketch/support/OperationHandle.js +1 -1
  429. package/widgets/Sketch/support/PluginManager.d.ts +12 -0
  430. package/widgets/Sketch/support/PluginManager.js +1 -1
  431. package/widgets/Sketch.js +1 -1
  432. package/widgets/TimeSlider.d.ts +3 -3
  433. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
  434. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  435. package/widgets/support/ContingentValuesManager.js +1 -1
  436. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +81 -0
  437. package/widgets/support/SelectionToolbar/types.d.ts +4 -0
  438. package/widgets/support/forms/formUtils.js +1 -1
  439. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
  440. package/assets/esri/core/workers/chunks/130851b81f04e6a008cd.js +0 -1
  441. package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
  442. package/assets/esri/core/workers/chunks/1c8a21b7b60c0709e6b2.js +0 -1
  443. package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
  444. package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
  445. package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +0 -1
  446. package/assets/esri/core/workers/chunks/2ecb21c402cdd8c82533.js +0 -1
  447. package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
  448. package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
  449. package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
  450. package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
  451. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
  452. package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
  453. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
  454. package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
  455. package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
  456. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
  457. package/assets/esri/core/workers/chunks/855bf811cd79b97c169a.js +0 -1
  458. package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
  459. package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
  460. package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
  461. package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
  462. package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
  463. package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
  464. package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
  465. package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
  466. package/assets/esri/core/workers/chunks/aec4a4cd7044fdbbbe34.js +0 -1
  467. package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
  468. package/assets/esri/core/workers/chunks/b262478da29470abb72b.js +0 -2
  469. package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
  470. package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
  471. package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
  472. package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
  473. package/assets/esri/core/workers/chunks/d3f08f1a9a250cd8a2c8.js +0 -1
  474. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
  475. /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
  476. /package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js.LICENSE.txt → 55334ad3618899cdbf78.js.LICENSE.txt} +0 -0
  477. /package/assets/esri/core/workers/chunks/{b262478da29470abb72b.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
  478. /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → b69d1d528e271568cbd8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{absoluteHeightElevationInfo as n,getConvertedElevation as o,getGraphicEffectiveElevationInfo as e}from"../../../../support/elevationInfoUtils.js";import t from"../../../../symbols/support/ElevationInfo.js";function l(n){return n?.clone()??null}function r(n){return n?.clone()??null}function u(n){const o=l(n);return n&&o?{observer:n,snapshot:o}:null}function i(n){return{target:n,snapshot:r(n)??n.clone()}}function a(e,t,l,r=null){const u=l.clone();return u.z=o(t,l,r??n,n),e.getMapPointIntersection(u)}function c(l,r,u,i=u.mapPoint,a=null,c=n){if(null==i)return r.position=null,r.elevationInfo=null,void(r.feature=null);const s=i.clone();s.z=o(l,i,c??n,n);const f=!("relative-to-ground"===c?.mode||"on-the-ground"===c?.mode)&&!u.mapPoint?.equals(s);switch(u.context?.type){case"graphic":{const n=u.context.graphic,o=e(n);"on-the-ground"===o.mode&&(o.mode="relative-to-ground",o.offset=0),r.elevationInfo=new t(o),r.feature=n;break}case"ground":r.elevationInfo=a?.clone()??new t({mode:"on-the-ground"}),r.feature=null;break;default:r.elevationInfo=a?.clone()??null,r.feature=null}f&&(r.elevationInfo=null);const p=s.clone();p.z=o(l,s,n,r.elevationInfo),r.position=p}export{u as createLineOfSightObserverItem,i as createLineOfSightTargetItem,a as getLineOfSightMapPointIntersection,l as snapshotLineOfSightObserverState,r as snapshotLineOfSightTargetState,c as updateLineOfSightItemFromIntersection};
2
+ import{length as n,normalize as e,scaleAndAdd as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as t,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as l,absoluteHeightElevationInfo as i,getGraphicEffectiveElevationInfo as u}from"../../../../support/elevationInfoUtils.js";import a from"../../../../symbols/support/ElevationInfo.js";function s(n){return n?.clone()??null}function c(n){return n?.clone()??null}function f(n){const e=s(n);return n&&e?{observer:n,snapshot:e}:null}function p(n){return{target:n,snapshot:c(n)??n.clone()}}function m(n,e,o,t=null){const r=o.clone();return r.z=l(e,o,t??i,i),n.getMapPointIntersection(r)}function d(n,e,o,t=o.mapPoint,r=null,s=i){if(null==t)return e.position=null,e.elevationInfo=null,void(e.feature=null);const c=t.clone();c.z=l(n,t,s??i,i);const f=!("relative-to-ground"===s?.mode||"on-the-ground"===s?.mode)&&!o.mapPoint?.equals(c);switch(o.context?.type){case"graphic":{const n=o.context.graphic,t=u(n);"on-the-ground"===t.mode&&(t.mode="relative-to-ground",t.offset=0),e.elevationInfo=new a(t),e.feature=n;break}case"gaussian-splat":return e.elevationInfo=r?.clone()??null,e.feature=null,f&&(e.elevationInfo=null),void(e.position=v(n,c,e.elevationInfo,o.normal));case"ground":e.elevationInfo=r?.clone()??new a({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=r?.clone()??null,e.feature=null}f&&(e.elevationInfo=null);const p=c.clone();p.z=l(n,c,i,e.elevationInfo),e.position=p}function v(u,a,s,c){const f=a.clone(),p=t(a.x,a.y,a.z??0);if(!u.renderCoordsHelper.toRenderCoords(p,a.spatialReference,p)||0===n(c))return f.z=l(u,f,i,s),f;const m=4,d=u.state.camera.computeScreenPixelSizeAt(p)*m,v=e(r(),c);o(p,p,v,d);const g=u.renderCoordsHelper.fromRenderCoords(p,f);return null==g?(f.z=l(u,f,i,s),f):(g.z=l(u,g,i,s),g)}export{f as createLineOfSightObserverItem,p as createLineOfSightTargetItem,v as getGaussianSplatOffsetPosition,m as getLineOfSightMapPointIntersection,s as snapshotLineOfSightObserverState,c as snapshotLineOfSightTargetState,d as updateLineOfSightItemFromIntersection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as e}from"../../../../core/maybe.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends o{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&e(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&r(this.normal,t.normal)&&c(this.ray,t.ray)}};t([s({constructOnly:!0})],p.prototype,"context",void 0),t([s({constructOnly:!0})],p.prototype,"id",void 0),t([s({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([s({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([s({constructOnly:!0})],p.prototype,"normal",void 0),t([s({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const l=new y;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,l as lineOfSightIntersectionContextGround};
2
+ import{__decorate as t}from"tslib";import r from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends r{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&s(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&o(this.normal,t.normal)&&c(this.ray,t.ray)}};t([e({constructOnly:!0})],p.prototype,"context",void 0),t([e({constructOnly:!0})],p.prototype,"id",void 0),t([e({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([e({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([e({constructOnly:!0})],p.prototype,"normal",void 0),t([e({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const l=new y;class u{constructor(){this.type="gaussian-splat"}equals(t){return t.type===this.type}}const h=new u;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,h as lineOfSightIntersectionContextGaussianSplat,l as lineOfSightIntersectionContextGround};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as o,normalize as s,scaleAndAdd as a,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m,clone as p,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{fromPoints as f,copy as g,create as y}from"../../../../geometry/support/ray.js";import{sv2d as w}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as h,lineOfSightIntersectionContextGround as v,LineOfSightIntersectionContextGraphic as I}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as P,isIntegratedMeshIntersectorResult as b}from"../../terrain/Intersector.js";import{Intersector as x}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{isIntegratedMeshLayerView as L}from"../../../support/layerViewUtils.js";let _=class extends t{constructor(e){super(e)}initialize(){this.intersector=new x(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}get _integratedMeshLayerViews(){return this.view.allLayerViews.items.filter(L)}get _terrainIntersectionOptionsLayerUids(){return new Set([U,...this._integratedMeshLayerViews.map(e=>e.uid)])}getScreenPointIntersection(e){const t=r(e,w.get()),i=j(this.view.state.camera,t,C);return this._getRayIntersection(i)}getMapPointIntersection(e){const t=m(e.x,e.y,e.z??0);if(!this.view.renderCoordsHelper.toRenderCoords(t,e.spatialReference,t))return null;const r=this.view.state.camera.eye;return f(r,t,C),this._getRayIntersection(C)}_getRayIntersection(e,t){const{view:r,intersector:i}=this;if(null==e||null==r.sceneIntersectionHelper)return null;i.options.store=0,r.sceneIntersectionHelper.intersectToolIntersectorRay(e,i,t);const n=i.results.min;if(null==n.target)return null;const o=u();if(!n.getIntersectionPoint(o))return null;if(null!=t?.maxDistance&&!n.withinDistance(t.maxDistance))return null;const s=r.renderCoordsHelper.fromRenderCoords(o,new d({spatialReference:r.spatialReference})),a=p(n.normal);if(P(n))return new h({context:v,id:n.target.lij.slice(),mapPoint:s,renderPoint:o,normal:a,ray:g(e)});if(b(r,n))return new h({context:v,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)});const l=R(n,r);if(null!=l){const{layer:t}=l,r=l.getObjectId()??l.uid;return new h({context:new I(l),id:`${t?.uid}/${r}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}const c="layerViewUid"in n.target?`${n.target.layerViewUid}`:"";return new h({context:null,id:c,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}updateFromGroundIntersection(e,t,r){const i=V,n=O,m=M;o(n,e),this.view.renderCoordsHelper.worldUpAtPosition(n,m),s(m,m);const u=this.view.groundView?.visibleElevationRange,d=(t>=0?1:-1)*((u?Math.abs(u.maxElevation-u.minElevation):100)+Math.abs(t)),g=.001*d;a(i,n,m,d-g),a(n,n,m,g),f(i,n,C);const y=this._getRayIntersection(C,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=y){const e=S;return l(e,m,t),c(r,y.renderPoint,e),p(y.normal)}return o(r,e),null}};e([i()],_.prototype,"view",void 0),e([i()],_.prototype,"intersector",void 0),e([i()],_.prototype,"_integratedMeshLayerViews",null),e([i()],_.prototype,"_terrainIntersectionOptionsLayerUids",null),_=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],_);const V=u(),O=u(),M=u(),S=u(),C=y();export{_ as LineOfSightRayIntersector};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as o,normalize as s,scaleAndAdd as a,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m,clone as p,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{fromPoints as f,copy as g,create as y}from"../../../../geometry/support/ray.js";import{sv2d as w}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as h,lineOfSightIntersectionContextGaussianSplat as v,lineOfSightIntersectionContextGround as I,LineOfSightIntersectionContextGraphic as j}from"./LineOfSightIntersectionResult.js";import{isGaussianSplatIntersectorResult as P}from"../../layers/i3s/Intersector.js";import{fromScreen as x}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as b,isIntegratedMeshIntersectorResult as R}from"../../terrain/Intersector.js";import{Intersector as U}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as L}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as V}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{isIntegratedMeshLayerView as _}from"../../../support/layerViewUtils.js";let O=class extends t{constructor(e){super(e)}initialize(){this.intersector=new U(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}get _integratedMeshLayerViews(){return this.view.allLayerViews.items.filter(_)}get _terrainIntersectionOptionsLayerUids(){return new Set([V,...this._integratedMeshLayerViews.map(e=>e.uid)])}getScreenPointIntersection(e){const t=r(e,w.get()),i=x(this.view.state.camera,t,H);return this._getRayIntersection(i)}getMapPointIntersection(e){const t=m(e.x,e.y,e.z??0);if(!this.view.renderCoordsHelper.toRenderCoords(t,e.spatialReference,t))return null;const r=this.view.state.camera.eye;return f(r,t,H),this._getRayIntersection(H)}_getRayIntersection(e,t){const{view:r,intersector:i}=this;if(null==e||null==r.sceneIntersectionHelper)return null;i.options.store=0,r.sceneIntersectionHelper.intersectToolIntersectorRay(e,i,t);const n=i.results.min;if(null==n.target)return null;const o=u();if(!n.getIntersectionPoint(o))return null;if(null!=t?.maxDistance&&!n.withinDistance(t.maxDistance))return null;const s=r.renderCoordsHelper.fromRenderCoords(o,new d({spatialReference:r.spatialReference}));if(P(n))return new h({context:v,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:p(n.target.outwardDirection),ray:g(e)});const a=p(n.normal);if(b(n))return new h({context:I,id:n.target.lij.slice(),mapPoint:s,renderPoint:o,normal:a,ray:g(e)});if(R(r,n))return new h({context:I,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)});const l=L(n,r);if(null!=l){const{layer:t}=l,r=l.getObjectId()??l.uid;return new h({context:new j(l),id:`${t?.uid}/${r}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}const c="layerViewUid"in n.target?`${n.target.layerViewUid}`:"";return new h({context:null,id:c,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}updateFromGroundIntersection(e,t,r){const i=M,n=S,m=C;o(n,e),this.view.renderCoordsHelper.worldUpAtPosition(n,m),s(m,m);const u=this.view.groundView?.visibleElevationRange,d=(t>=0?1:-1)*((u?Math.abs(u.maxElevation-u.minElevation):100)+Math.abs(t)),g=.001*d;a(i,n,m,d-g),a(n,n,m,g),f(i,n,H);const y=this._getRayIntersection(H,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=y){const e=D;return l(e,m,t),c(r,y.renderPoint,e),p(y.normal)}return o(r,e),null}};e([i()],O.prototype,"view",void 0),e([i()],O.prototype,"intersector",void 0),e([i()],O.prototype,"_integratedMeshLayerViews",null),e([i()],O.prototype,"_terrainIntersectionOptionsLayerUids",null),O=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],O);const M=u(),S=u(),C=u(),D=u(),H=y();export{O as LineOfSightRayIntersector};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{fromPoints as g,create as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as T,laserLineConfiguration as P}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as w,LineOfSightObserverManipulator as S}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as k}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as C}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as O}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as I}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as j}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as V}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as x}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as G}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as A}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as F}from"../../../support/screenUtils.js";let U=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new V({elevationInfo:b,pointer:e,editGeometryOperations:new E(new j("point",I(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new k}))}initialize(){this._intersector=new L({view:this.view}),this._snappingOperation=new G({view:this.view}),A(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>T(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),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),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}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 n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>B(e),()=>W(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.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._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=x(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new w(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new S(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}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=D({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(z(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=D({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),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,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,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:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,q):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=P;this._laserlineVisualElement=new C({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,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_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,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==O.Right&&(this._addPointFromClickEvent(F(e),e.pointerType),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==O.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker)return void this._clearCursorTracker();const t=F(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==O.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function z(e){const t=e.position?.clone();return n=>(e.position=t,n)}function W(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function B(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({constructOnly:!0})],U.prototype,"analysis",void 0),e([c()],U.prototype,"_creationMode",void 0),e([c({readOnly:!0})],U.prototype,"state",null),e([c({readOnly:!0})],U.prototype,"cursor",null),e([c()],U.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],U.prototype,"_showTracker",null),e([c()],U.prototype,"_latestPointerMovePointerType",void 0),e([c()],U.prototype,"_shouldRenderTracker",null),e([c()],U.prototype,"_laserlineVisualElement",void 0),e([c()],U.prototype,"_grabbedManipulator",void 0),e([c()],U.prototype,"_trackerIntersection",void 0),e([c()],U.prototype,"_trackerMapPoint",void 0),e([c()],U.prototype,"_snappingManagerResult",void 0),U=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],U);const q=_();export{U as LineOfSightTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{fromPoints as g,create as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getGaussianSplatOffsetPosition as T}from"./LineOfSightAuthoringUtils.js";import{getLaserLineColors as P,laserLineConfiguration as w}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as S,LineOfSightObserverManipulator as L}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as k}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as C}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as O}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as j}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as E}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as x}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as G}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as A}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as F}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as U}from"../../../support/screenUtils.js";let z=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new D({elevationInfo:b,pointer:e,editGeometryOperations:new V(new E("point",j(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new C}))}initialize(){this._intersector=new k({view:this.view}),this._snappingOperation=new A({view:this.view}),F(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>P(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),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),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}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 n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>q(e),()=>B(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.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._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=G(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new S(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new L(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}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=x({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(W(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=x({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),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,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,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:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,N):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=w;this._laserlineVisualElement=new O({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,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_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,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==I.Right&&(this._addPointFromClickEvent(U(e),e.pointerType),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)return void this._clearCursorTracker();const t=U(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"gaussian-splat":return e.elevationInfo=null,e.feature=null,void(e.position=T(this.view,n,e.elevationInfo,t.normal));case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,b,e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==I.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function W(e){const t=e.position?.clone();return n=>(e.position=t,n)}function B(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function q(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],z.prototype,"view",void 0),e([c({constructOnly:!0})],z.prototype,"analysis",void 0),e([c()],z.prototype,"_creationMode",void 0),e([c({readOnly:!0})],z.prototype,"state",null),e([c({readOnly:!0})],z.prototype,"cursor",null),e([c()],z.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],z.prototype,"updating",null),e([c({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],z.prototype,"_showTracker",null),e([c()],z.prototype,"_latestPointerMovePointerType",void 0),e([c()],z.prototype,"_shouldRenderTracker",null),e([c()],z.prototype,"_laserlineVisualElement",void 0),e([c()],z.prototype,"_grabbedManipulator",void 0),e([c()],z.prototype,"_trackerIntersection",void 0),e([c()],z.prototype,"_trackerMapPoint",void 0),e([c()],z.prototype,"_snappingManagerResult",void 0),z=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],z);const N=_();export{z as LineOfSightTool};
@@ -33,6 +33,7 @@ import type { LineOfSightPlacementResult } from "./LineOfSight/types.js";
33
33
  * @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
34
34
  * @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
35
35
  * @see [Sample - Line of sight component](https://developers.arcgis.com/javascript/latest/sample-code/line-of-sight/)
36
+ * @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
36
37
  */
37
38
  export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
38
39
  /**
@@ -61,7 +62,7 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
61
62
  * indexed directly:
62
63
  *
63
64
  * ```js
64
- * const analysisView = await view.whenAnalysisView(lineOfSightAnalysis);
65
+ * const analysisView = await view.whenAnalysisView(analysis);
65
66
  * const result = analysisView.results.at(targetIdx);
66
67
  * ```
67
68
  *
@@ -11,6 +11,9 @@ import type { ScreenPoint } from "../../../core/types.js";
11
11
  * on the analysis view provides developers with the ability to obtain the specific shadow or sunlight duration at a
12
12
  * certain [point](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) on the screen or to [disable](#interactive) the tooltip attached to the cursor.
13
13
  *
14
+ * This analysis view controls the shadow or sunlight overlay produced by [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/). It does
15
+ * not control the scene's illumination. To change the scene lighting itself, use [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/).
16
+ *
14
17
  * The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
15
18
  * similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
16
19
  * ```js
@@ -25,6 +28,7 @@ import type { ScreenPoint } from "../../../core/types.js";
25
28
  * @see [DiscreteOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/DiscreteOptions/)
26
29
  * @see [MinDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/MinDurationOptions/)
27
30
  * @see [TotalDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/TotalDurationOptions/)
31
+ * @see [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/)
28
32
  * @see [Sample - Shadow Cast analysis object](https://developers.arcgis.com/javascript/latest/sample-code/analysis-shadow-cast/)
29
33
  * @see [Sample - Sunlight analysis](https://developers.arcgis.com/javascript/latest/sample-code/analysis-sunlight/)
30
34
  * @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
@@ -77,7 +81,7 @@ export default abstract class ShadowCastAnalysisView3D extends AnalysisView3D {
77
81
  * @example
78
82
  * ```js
79
83
  * // use getDurationAtScreen method from the analysis view once available
80
- * const analysisView = await view.whenAnalysisView(shadowCastAnalysis);
84
+ * const analysisView = await view.whenAnalysisView(analysis);
81
85
  *
82
86
  * // get shadow or sunlight duration at the pointer location
83
87
  * view.on("pointer-move", async (event) => {
@@ -24,15 +24,16 @@ import type { SlicePlacementResult } from "./Slice/types.js";
24
24
  *
25
25
  * ```js
26
26
  * // retrieve analysis view for analysis
27
- * const sliceAnalysis = new SliceAnalysis();
28
- * view.analyses.add(sliceAnalysis); // add to the scene view
29
- * const sliceAnalysisView = await view.whenAnalysisView(sliceAnalysis);
27
+ * const analysis = new SliceAnalysis();
28
+ * view.analyses.add(analysis); // add to the scene view
29
+ * const analysisView = await view.whenAnalysisView(analysis);
30
30
  * ```
31
31
  *
32
32
  * @see [SliceAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/SliceAnalysis/)
33
33
  * @see [SlicePlane](https://developers.arcgis.com/javascript/latest/references/core/analysis/SlicePlane/)
34
34
  * @see [Slice component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slice/)
35
35
  * @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
36
+ * @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
36
37
  */
37
38
  export default abstract class SliceAnalysisView3D extends AnalysisView3D {
38
39
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../Color.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import o from"../../../../symbols/support/ElevationInfo.js";const r=2,s=4,c=t(2),n=new o({mode:"absolute-height",offset:1.5});class l{constructor(){this.collisionRadius=5,this.fovUnfocusedArcWidth=s,this.fovFocusedArcWidth=r*this.fovUnfocusedArcWidth,this.scaleOrientSize=90,this.scaleOrientHandleRadius=.025,this.scaleOrientMinDistance=1,this.scaleOrientArrowTipLength=.3,this.scaleOrientArrowTipFocusMultiplier=r/1.5,this.observerSize=5,this.hoverTimeoutMilliseconds=1e3,this.viewAngleThreshold=10}getFovArcWidth(e){return e?this.fovFocusedArcWidth:this.fovUnfocusedArcWidth}getScaleOrientArrowTipLength(e){return this.scaleOrientArrowTipLength*(e?this.scaleOrientArrowTipFocusMultiplier:1)}}const h=new l;class a{constructor(){this.frameWidthNotSelected=.3,this.frameWidthSelected=1,this.frameColor=new e([255,255,255,.99]),this.observerPointConfiguration={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0,color:new e([3,252,111,1]).toUnitRGBA()},this.shapeMaterialParameters={color:i(.33,.33,.33,.25),renderOccluded:1,cullFace:2,writeDepth:!1}}}const d=new a;export{c as arcAnglePerSegment,n as creationElevationInfo,h as viewshedToolManipulatorConfiguration,d as viewshedVisualizationConfiguration};
2
+ import e from"../../../../Color.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";const r=2,s=4,o=i(2),c=1.5;class n{constructor(){this.collisionRadius=5,this.fovUnfocusedArcWidth=s,this.fovFocusedArcWidth=r*this.fovUnfocusedArcWidth,this.scaleOrientSize=90,this.scaleOrientHandleRadius=.025,this.scaleOrientMinDistance=1,this.scaleOrientArrowTipLength=.3,this.scaleOrientArrowTipFocusMultiplier=r/1.5,this.observerSize=5,this.hoverTimeoutMilliseconds=1e3,this.viewAngleThreshold=10}getFovArcWidth(e){return e?this.fovFocusedArcWidth:this.fovUnfocusedArcWidth}getScaleOrientArrowTipLength(e){return this.scaleOrientArrowTipLength*(e?this.scaleOrientArrowTipFocusMultiplier:1)}}const h=new n;class l{constructor(){this.frameWidthNotSelected=.3,this.frameWidthSelected=1,this.frameColor=new e([255,255,255,.99]),this.observerPointConfiguration={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0,color:new e([3,252,111,1]).toUnitRGBA()},this.shapeMaterialParameters={color:t(.33,.33,.33,.25),renderOccluded:1,cullFace:2,writeDepth:!1}}}const a=new l;export{o as arcAnglePerSegment,c as creationVerticalOffset,h as viewshedToolManipulatorConfiguration,a as viewshedVisualizationConfiguration};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import i from"../../../../core/Accessor.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import s from"../../../../core/ReactiveMap.js";import{property as o,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewshedInteractionVisuals as l}from"./ViewshedInteractionVisuals.js";let c=class extends i{constructor(t){super(t),this._active=!1,this.analysisVisible=!0,this._visuals=new s,this._placementLocation=a(),this._hasPlacementLocation=!1,this._interactionVisuals=null}initialize(){this._interactionVisuals=new l({view:this.view})}destroy(){this._visuals.clear(),this._interactionVisuals=e(this._interactionVisuals)}get _interactionPoint(){let t=null;for(const i of this._visuals.values()){const e=u(i.geometry);if(null!=e){if("cursor"===i.role&&"active"===i.state)return e;("cursor"===i.role||null==t&&"outputGeometry"===i.role)&&(t=e)}}return t}activate(){this._active=!0,this._refreshInteractionVisuals()}deactivate(){this._active=!1,this._interactionVisuals?.setVisibility(!1)}addOrUpdateGraphic(t,i){}updatePlacementLocation(t){const i=null!=t;this._hasPlacementLocation=i,i&&n(this._placementLocation,t),this._refreshInteractionVisuals()}addOrUpdateVisual(t,i){this._visuals.set(t,p(i,this._visuals.get(t))),this._refreshInteractionVisuals()}removeGraphic(t){}removeVisual(t){this._visuals.delete(t),this._refreshInteractionVisuals()}hitTestVisualDistance(t,i){return null}_refreshInteractionVisuals(){const t=this._getInteractionLocation(m);this._interactionVisuals?.update({location:t,laserlineVisible:this._active&&this.analysisVisible})}_getInteractionLocation(t){if(this._hasPlacementLocation)return this._placementLocation;const i=this._interactionPoint;return null!=i&&this.view.renderCoordsHelper.toRenderCoords(i,t)?t:null}};function u(t){if(!t)return null;switch(t.type){case"point":return t;case"multipoint":return h(t);default:return null}}function h(t){return 0===t.points.length?null:t.getPoint(t.points.length-1)}function p(t,i={geometry:null,role:"outputGeometry",state:"idle"}){return{...i,...t}}t([o({constructOnly:!0})],c.prototype,"view",void 0),t([o()],c.prototype,"_active",void 0),t([o()],c.prototype,"analysisVisible",void 0),t([o()],c.prototype,"_interactionPoint",null),c=t([r("esri.views.3d.analysis.Viewshed.ViewshedDrawToolRenderer")],c);const m=a();export{c as ViewshedDrawToolRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as i,initial as l}from"../../../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{createSubToolHandles as r,findSubTool as d}from"./viewshedSubToolUtils.js";import{InteractiveToolBase as u}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as c}from"../../../interactive/keybindings.js";let h=class extends u{constructor(e){super(e),this.subToolHandles=new t,this._selectedManipulator=null}initialize(){this.subToolHandles=r({analysis:this.analysis,analysisViewData:this.analysisViewData,onBeforeSubToolRemove:e=>{this.selectedViewshed===e&&(this.selectedViewshed=null)},parentTool:this,view:this.view,viewshedComputedDataHandles:this.analysisViewData.viewshedComputedDataHandles}),this.addHandles([o(()=>this.firstGrabbedManipulator,e=>{null==e?this._selectedSubTool?.onManipulatorSelectionChanged():this.selectedViewshed=this._findSubTool(e)?.viewshed??null},i),o(()=>this.selectedViewshed,e=>this._syncSelectedManipulator(e),l)])}destroy(){this._selectManipulator(null),this.view.activeTool===this&&(this.view.activeTool=null),this.view.tools.includes(this)&&this.view.tools.remove(this),s(this.subToolHandles)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get cursor(){return null}get creating(){return!1}get isPlacingTarget(){return!1}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){}onInputEvent(e){if("key-down"===e.type)this._onKeyDown(e)}_onKeyDown(e){if(c.cancel!==e.key)return;this.subToolHandles.some(({subTool:e})=>e.grabbing)||(this.selectedViewshed=null,e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return d(this.subToolHandles,e)}_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())}_syncSelectedManipulator(e){if(null==e)return void this._selectManipulator(null);const t=this._selectedSubTool;if(null==t)return;const s=this._selectedManipulator,o=null!=s&&t.hasManipulator(s)?s:t.discManipulator;o!==s&&this._selectManipulator(o)}get test(){}};e([n({constructOnly:!0})],h.prototype,"analysis",void 0),e([n({constructOnly:!0})],h.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n()],h.prototype,"subToolHandles",void 0),e([n()],h.prototype,"_selectedManipulator",void 0),e([n()],h.prototype,"updating",null),e([n()],h.prototype,"cursor",null),e([n()],h.prototype,"creating",null),e([n()],h.prototype,"isPlacingTarget",null),e([n()],h.prototype,"selectedViewshed",null),e([n()],h.prototype,"selectedViewshedComputedData",null),e([n()],h.prototype,"_selectedSubTool",null),h=e([a("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],h);export{h as ViewshedEditTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as c}from"./ViewshedSnappingController.js";import{ViewshedSubTool as u}from"./ViewshedSubTool.js";import{findSubTool as p}from"./viewshedSubToolUtils.js";import{InteractiveToolBase as h}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as g}from"../../../interactive/keybindings.js";let b=class extends h{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.creating=!1,this.isPlacingTarget=!1,this._selectedManipulator=null}initialize(){this._interactionVisuals=new d({view:this.view}),this._snappingController=new c({view:this.view});const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>e,({viewshedComputedData:e})=>{const t=new u({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(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},n),o(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},a),o(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),a),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)},a)])}destroy(){this._selectManipulator(null),s(this._interactionVisuals),s(this.subToolHandles),s(this._snappingController)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)||this._snappingController?.updating}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const s=t.moveInteractionState,o=e?s.grabbing:s.dragging,n=t.scaleOrientInteractionState,a=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(o||a)))return void this._interactionVisuals?.setVisibility(!1);const l=o?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:l,laserlineVisible:!0,verticalLineVisible:o,intersectsWorldUp:o})}createObserverMoveSnappingPipeline(e,t,i){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i)}onInputEvent(e){switch(e.type){case"key-down":this._onKeyDown(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_onKeyDown(e){g.cancel===e.key&&(this.grabbing||(this.selectedViewshed=null,e.stopPropagation()))}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return p(this.subToolHandles,e)}_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 test(){}};e([l({constructOnly:!0})],b.prototype,"analysis",void 0),e([l({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],b.prototype,"view",void 0),e([l()],b.prototype,"subToolHandles",void 0),e([l()],b.prototype,"removeIncompleteOnCancel",void 0),e([l()],b.prototype,"automaticManipulatorSelection",void 0),e([l()],b.prototype,"creating",void 0),e([l()],b.prototype,"isPlacingTarget",void 0),e([l()],b.prototype,"_selectedManipulator",void 0),e([l()],b.prototype,"_interactionVisuals",void 0),e([l()],b.prototype,"_snappingController",void 0),e([l()],b.prototype,"updating",null),e([l()],b.prototype,"grabbing",null),e([l()],b.prototype,"cursor",null),e([l()],b.prototype,"selectedViewshed",null),e([l()],b.prototype,"selectedViewshedComputedData",null),e([l()],b.prototype,"_selectedSubTool",null),b=e([r("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],b);export{b as ViewshedEditTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as s,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{Settings as r}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as a}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as c}from"../../interactive/visualElements/LaserlineVisualElement.js";const d=Symbol("visualElements");let h=class extends t{constructor(e){super(e),this._settings=new r({getTheme:()=>this.view.effectiveTheme}),this._visualElements=null}initialize(){this._createVisuals()}destroy(){this.removeHandles(d)}update({location:e,laserlineVisible:t,verticalLineVisible:i=!1,intersectsWorldUp:s=!1}){this.updateLocation(e,s),this.setVisibility(t,i)}updateLocation(e,t){const i=this._visualElements;if(null==i)return;const{laserline:s,verticalLine:l}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&l.setStartEndFromWorldDownAtLocation(e)}setVisibility(e,t=!1){const i=this._visualElements;null!=i&&(i.laserline.attached=e,i.verticalLine.attached=t)}get test(){}_createVisuals(){const e=this._settings.visualElements,t=new c({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),n=new a({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._visualElements={laserline:t,verticalLine:n},this.addHandles([s(()=>e.zVerticalLine,e=>e.apply(n),l),s(()=>e.heightPlane,e=>e.apply(t),l),i(()=>{t.destroy(),n.destroy(),this._visualElements=null})],d)}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n()],h.prototype,"_settings",void 0),e([n()],h.prototype,"_visualElements",void 0),h=e([o("esri.views.3d.analysis.Viewshed.ViewshedInteractionVisuals")],h);export{h as ViewshedInteractionVisuals};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as a,throwIfAborted as o,onAbort as s}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/units.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{createDrawTool as d,createPlacementResult as p}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import{creationVerticalOffset as _}from"./ViewshedConfiguration.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{Manipulator3D as P}from"../../interactive/Manipulator3D.js";import{ViewEventPriorities as g}from"../../../input/InputManager.js";import{sketchKeys as y}from"../../../interactive/keybindings.js";import O from"../../../interactive/sketch/SketchOptions.js";const b="multiple",C=new O({tooltips:{enabled:!0}}),T=Symbol("hiddenManipulatorHandle");let f=class extends i{constructor(e){super(e),this.placementMode=b,this.creationState=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),g.DEFAULT),n(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(a()),o(t);const{resolve:i,reject:n,promise:r}=Promise.withResolvers(),l=s(t,()=>this._cancelPlacementOperation());return this._placeOperation=new u({abortHandle:l,reject:n,resolve:i}),this.place(e),r}place(e){this.callbacks.setSelectedViewshed(null),this.placementMode=e,this._startObserverPlacement()}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(y.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):y.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e){const i=l(e.mapPoint.spatialReference);e.mapPoint.z=(e.mapPoint.z??0)+_/i;const a=new t({observer:e.mapPoint.clone(),feature:e.feature});this.analysis.viewsheds.add(a),this.stagedViewshed=a,this.creationState="placing-target",this._updateStagedViewshed(e.scenePoint),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e.scenePoint);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),"multiple"!==this.placementMode||(this.creationState="placing-observer")}_handleTargetPlacementPreview(e){this._updateStagedViewshed(e.scenePoint)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:i}=d({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:C,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e)});this._drawTool=e,this._renderer=i;try{this.view.addAndActivateTool(e),e.begin([w({mode:this.placementMode,onObserverComplete:i=>this._onObserverMapPointComplete(e,t,i),onTargetComplete:i=>this._onTargetMapPointComplete(e,t,i),onTargetPreview:i=>this._onTargetMapPointPreview(e,t,i)})])}catch(a){this._destroyDrawTool(e),this._rejectPlaceOperation(a instanceof Error?a:new Error(String(a)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleObserverPlacementComplete(a)):this._onCancel(e)}_onTargetMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementComplete(a),"multiple"===this.placementMode&&this._renderer?.updatePlacementLocation(null)):this._onCancel(e)}_onTargetMapPointPreview(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a&&(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementPreview(a))}_onManipulatorCountChange(e){e.removeHandles(T);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,T)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&m(this.view,e)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const i=this.callbacks.findViewshedComputedData(t);if(!i)return;const{heading:a,tilt:o,farDistance:s}=v(this.view,i,e);t.farDistance=s,t.tilt=o,t.heading=a}get test(){}};e([c({constructOnly:!0})],f.prototype,"analysis",void 0),e([c({constructOnly:!0})],f.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],f.prototype,"view",void 0),e([c({constructOnly:!0})],f.prototype,"callbacks",void 0),e([c()],f.prototype,"placementMode",void 0),e([c()],f.prototype,"creationState",void 0),e([c()],f.prototype,"stagedViewshed",void 0),e([c()],f.prototype,"_placeOperation",void 0),e([c()],f.prototype,"_drawTool",void 0),e([c()],f.prototype,"_renderer",void 0),e([c()],f.prototype,"updating",null),e([c()],f.prototype,"active",null),f=e([h("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],f);export{f as ViewshedPlacementController};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import s from"../../../../core/Accessor.js";import{createAbortError as r}from"../../../../core/promiseUtils.js";import{property as t,subclass as o}from"../../../../core/accessorSupport/decorators.js";let a=class extends s{constructor(e){super(),this.hasPlacedViewshed=!1,this._abortHandle=null,this._abortHandle=e.abortHandle,this._reject=e.reject,this._resolve=e.resolve}markPlacedViewshed(){this.hasPlacedViewshed=!0}reject(e){this._clearAbortHandle(),this._reject(e)}resolve(){this._clearAbortHandle(),this._resolve()}finish(){this.hasPlacedViewshed?this.resolve():this.reject(r())}_clearAbortHandle(){this._abortHandle?.remove(),this._abortHandle=null}};e([t()],a.prototype,"hasPlacedViewshed",void 0),e([t()],a.prototype,"_abortHandle",void 0),a=e([o("esri.views.3d.analysis.Viewshed.ViewshedPlacementOperation")],a);export{a as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{watch as e,sync as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as n}from"../../../draw/plugins/PluginBase.js";var a;const p=Symbol("viewshed-placement-point-plugin-marker");let r=class extends n{static{a=p}constructor(t){super(t),this[a]=!0,this.defaultCaptureMode="capture-always",this.inputMapPosition=null,this.outputMapPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol("viewshed-placement-point-vertex")}start(t){super.start(t);const{positionOfLastUserInput:e,session:i}=t,o=this._getInitialMapPoint(e);!o||"grabbable-object"!==this.defaultCaptureMode&&this._interactiveHandle||(i.appendOrReplacePoint(this._vertexId,o),this.outputMapPosition=o.clone()),this._ensureInteractiveHandle(t,o)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(t,o){this._interactiveHandle||(this._interactiveHandle=t.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:"grabbable-object"===this.defaultCaptureMode?o:void 0}),this.addHandles(e(()=>this._interactiveHandle?.outputMapPosition,t=>{this.outputMapPosition=t?.clone(),t&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,t)},i),this._ownHandlesKey))}_getInitialMapPoint(t){return"grabbable-object"===this.defaultCaptureMode?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??t:this.inputMapPosition??t}};function d(t){return{uniqueId:Symbol(`viewshed-${t}-plugin`),kind:["vertex"],geometryType:"point",hidden:!0,localizationKey:"leaf-point-segment",icon:"point",create:()=>new r({step:t})}}t([o({constructOnly:!0})],r.prototype,"step",void 0),t([o()],r.prototype,"defaultCaptureMode",void 0),t([o()],r.prototype,"inputMapPosition",void 0),t([o()],r.prototype,"outputMapPosition",void 0),t([o()],r.prototype,"hasCommittedPoint",void 0),t([o()],r.prototype,"_interactiveHandle",void 0),r=t([s("esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin")],r);export{r as ViewshedPlacementPointPlugin,d as createViewshedPlacementPointPluginConfiguration};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{watch as e,sync as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{createViewshedPlacementPointPluginConfiguration as i}from"./ViewshedPlacementPointPlugin.js";import{PluginBase as n}from"../../../draw/plugins/PluginBase.js";let l=class extends n{constructor(t){super(t),this._downstreamPlugin=null,this._step="observer"}start(t){super.start(t),t.session.appendOrReplacePart(null,[]),this._restartDownstreamPlugin()}beforeAttachPlugin(t){return{geometryType:"point",useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:"target"===this._step&&this._downstreamPlugin?.hasCommittedPoint?"complete":"cancel"}}attachPlugin(t){this._downstreamPlugin=t,"target"===t.step&&this.addHandles([e(()=>t.outputMapPosition,t=>{null==t||this._isComplete||this.onTargetPreview(t)},o)],this._downstreamHandlesKey)}detachPlugin(t,e){if(this._downstreamPlugin===t&&(this._downstreamPlugin=null),this.removeHandles(this._downstreamHandlesKey),"complete"!==e)return;const o=t.outputMapPosition;if(null!=o){if("observer"===t.step)return this.onObserverComplete(o),this._step="target",void this._restartDownstreamPlugin();if(this.onTargetComplete(o),"multiple"===this.mode)return this._step="observer",void this._restartDownstreamPlugin();this._context?.requestComplete()}}_restartDownstreamPlugin(){const t=i(this._step);this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}};function a(t){return{uniqueId:Symbol("viewshed-placement-root-plugin"),kind:["multipart"],geometryType:"multipoint",hidden:!0,localizationKey:"viewshed-root",icon:"point",create:()=>new l(t)}}t([s({constructOnly:!0})],l.prototype,"mode",void 0),t([s({constructOnly:!0})],l.prototype,"onObserverComplete",void 0),t([s({constructOnly:!0})],l.prototype,"onTargetComplete",void 0),t([s({constructOnly:!0})],l.prototype,"onTargetPreview",void 0),t([s()],l.prototype,"_downstreamPlugin",void 0),t([s()],l.prototype,"_step",void 0),l=t([r("esri.views.3d.analysis.Viewshed.ViewshedPlacementRootPlugin")],l);export{a as createViewshedPlacementRootPluginConfiguration};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as n}from"tslib";import e from"../../../../core/Accessor.js";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as a}from"../../../../core/support/UpdatingHandles.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as r}from"../../interactive/SnappingVisualizer3D.js";import{SnappingContext as s}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as o}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as g}from"../../../interactive/snapping/SnappingManagerPool.js";let l=class extends e{constructor(n){super(n),this._updatingHandles=new a,this._snappingManagerResult=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get _snappingManager(){return this._snappingManagerResult?.snappingManager}destroy(){this._updatingHandles.destroy()}createObserverMoveSnappingPipeline(n,e,t){if(0!==n)return null;const i=new s({elevationInfo:p,pointer:t,editGeometryOperations:e,visualizer:new r});return o({snappingContext:i,snappingManager:this._ensureSnappingManager(),updatingHandles:this._updatingHandles})}_ensureSnappingManager(){if(null==this._snappingManagerResult){const n=g(this.view);this._snappingManagerResult=n,this.addHandles(n)}return this._snappingManagerResult.snappingManager}};n([t({constructOnly:!0})],l.prototype,"view",void 0),n([t()],l.prototype,"updating",null),n([t()],l.prototype,"_snappingManager",null),n([t()],l.prototype,"_snappingManagerResult",void 0),l=n([i("esri.views.3d.analysis.Viewshed.ViewshedSnappingController")],l);export{l as ViewshedSnappingController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";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 n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}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 d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as m,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as M,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as T,flipSide as D}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as C}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as j}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as A}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const k=Symbol("dragHandles"),x=Symbol("hideManipulators"),E=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 y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new C(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(k),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),k))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{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),d(()=>{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),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{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(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.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&&this.parentTool.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 updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}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 elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}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:j})}_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,n,o,r)=>{o=o.next(S(this,["observer"]));const s=w(t,a);if(null==s)return{steps:n,cancel:o};const l=P.fromGeometry(s,O(this.view.viewingMode));return{steps:n.next(A({operations:l})).next(e=>(this.observer=l.data.geometry,e)),cancel:o}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(S(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=T(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?D(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return T(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(S(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=I.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(R,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=M(a)*i.metersPerUnit,o=b(a,i.targetDirection)<0?V.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,x),n=[]),e||!a&&i||a&&t?this.removeHandles(E):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,E)),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,"_forceHoveringTask",void 0),e([m()],U.prototype,"updating",null),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),e([m()],U.prototype,"elevationAlignedObserverRenderSpace",null),U=e([g("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const R=_(),I=new o(0,180);export{U as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";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 n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}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 d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as g,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as b,dot as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as T,flipSide as D}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as S}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as j}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as F,sceneSnappingAtLocation as x,dragManipulatedObject as A}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const k=Symbol("dragHandles"),E=Symbol("hideManipulators"),z=Symbol("hideFoVManipulators"),U=Symbol("hideObserverManipulator");let R=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 y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new S(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(k),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),k))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{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),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData,{creating:t,isPlacingTarget:a}=this.parentTool;return{fovManipulationAvailable:e&&!a,nonFOVManipulationAvailable:e&&(!t||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{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(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.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&&this.parentTool.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 updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}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 elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}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 j({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((n,o,r,s,l)=>{s=s.next(F(this,["observer"]));const p=w(t,a),h=w(e.elevationAlignedObserver,a);if(null==p||null==h)return{steps:r,cancel:s};const u=P.fromGeometry(p,O(this.view.viewingMode)),d=P.fromGeometry(h,O(this.view.viewingMode)),c=this.parentTool.createObserverMoveSnappingPipeline?.(n,d,l);if(null!=c){const{snappingStep:e,cancelSnapping:t}=c,{coordinateHelper:a}=d.data;s=s.next(t);return{steps:r.next(e=>({...e,snapOrigin:a.pointToVector(h)})).next(x(this.view,i)).next(...e).next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}}return{steps:r.next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(F(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=T(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?D(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return T(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(F(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=G.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=b(a)*i.metersPerUnit,o=M(a,i.targetDirection)<0?V.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(E):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,E),n=[]),e||!a&&i||a&&t?this.removeHandles(z):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,z)),e||!a?this.removeHandles(U):this.addHandles(this._observerManipulator.disableDisplay(),U)}_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([g({constructOnly:!0})],R.prototype,"analysis",void 0),e([g({constructOnly:!0})],R.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],R.prototype,"parentTool",void 0),e([g({constructOnly:!0,nonNullable:!0})],R.prototype,"view",void 0),e([g()],R.prototype,"_forceHoveringTask",void 0),e([g()],R.prototype,"updating",null),e([g()],R.prototype,"viewshed",null),e([g()],R.prototype,"_grabbing",void 0),e([g()],R.prototype,"grabbing",null),e([g()],R.prototype,"viewshedComputedData",void 0),e([g()],R.prototype,"observer",null),e([g()],R.prototype,"elevationAlignedObserverRenderSpace",null),R=e([m("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],R);const I=_(),G=new o(0,180);export{R as ViewshedSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as i}from"../../../../core/lang.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as m,set as d,sub as u,len as p,normalize as _,scale as V,angle as f,negate as v,copy as w,add as E}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b,clone as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOtherViewshedToolCreating as A}from"./analysisViewRegister.js";import{viewshedVisualizationConfiguration as C,arcAnglePerSegment as L}from"./ViewshedConfiguration.js";import{ViewshedShapeVisualElement as D}from"./ViewshedShapeVisualElement.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let R=class extends t{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:b(),topRight:b(),bottomLeft:b(),bottomRight:b()},this._arcCenterPoints={top:b(),bottom:b(),left:b(),right:b()},this._parallelCenters={top:b(),bottom:b()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},s={...t,stipplePattern:O(2)};this._observerVisualElement=new j({...e,...C.observerPointConfiguration}),this._shapeVisualElement=new D({...e,isDecoration:this.isDecoration}),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(s),this._centralLatitude=new y(s),this.addHandles([o(()=>{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:i}),o(()=>{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()},a),o(()=>{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?C.frameWidthSelected:C.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(r?C.frameWidthSelected:C.frameWidthNotSelected),i.visible=e&&t})},a),o(()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=!t?.active&&A(this.view,this.analysisViewData);return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||r),color:this._color}},({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement(e=>e.color=t)},a)])}get _color(){const{viewshedComputedData:e,_selected:t,analysisViewData:i}=this;if(null==e)return C.frameColor.toUnitRGBA();const s=i.tool?.active||i.interactive,r=e.viewshed===i.tool?.stagedViewshed;return(s&&(t||r)?this.view.effectiveTheme.accentColor:C.frameColor).toUnitRGBA()}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=r(this._observerVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(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;this._observerVisualElement.geometry=t.elevationAlignedObserver,this._shapeVisualElement.updateTransform(),this._updateFrameLines(t,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){const i=e.elevationAlignedObserverRenderSpace;this._frameLinesVisualElement.geometry=[[i,t.topLeft],[i,t.topRight],[i,t.bottomLeft],[i,t.bottomRight]]}_updateFrameArcs(e,t,i){const{elevationAlignedObserverRenderSpace:r,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=s(a),u=b(),p=c();h(p,n/2,l),m(u,o,p),F(this._leftArcVisualElement,r,t.bottomLeft,t.topLeft,"forward",u),h(p,-n/2,l),d(u,0,0,0),m(u,o,p),F(this._rightArcVisualElement,r,t.bottomRight,t.topRight,"forward",u);const _=a>180?"backward":"forward";F(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),F(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.elevationAlignedObserverRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";F(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),F(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function F(e,t,i,s,r,o,a=L){const l=b();u(l,i,t);const n=p(l),d=b();u(d,s,t),_(d,d),V(d,d,n);let A=f(l,d);const C=g(o);"backward"===r&&(v(C,C),A=-(2*Math.PI-A));const D=[],y=Math.ceil(Math.abs(A)/a),j=c();h(j,A/y,C);const O=b();w(O,l);const R=b();w(R,i);for(let h=0;h<y;h++){const e=b();w(e,R),m(O,O,j),E(R,t,O);const i=b();w(i,R),D.push([e,i])}e.geometry=D}e([l()],R.prototype,"view",void 0),e([l({constructOnly:!0})],R.prototype,"isDecoration",void 0),e([l()],R.prototype,"analysisViewData",void 0),e([l()],R.prototype,"viewshedComputedData",void 0),e([l()],R.prototype,"visible",void 0),e([l()],R.prototype,"_color",null),e([l()],R.prototype,"_selected",null),e([l()],R.prototype,"_staged",null),R=e([n("esri.views.3d.analysis.Viewshed.ViewshedSubVisualization")],R);export{R as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as i}from"../../../../core/lang.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as m,set as d,sub as u,len as p,normalize as _,scale as f,angle as V,negate as v,copy as w,add as E}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b,clone as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOtherViewshedToolCreating as A}from"./analysisViewRegister.js";import{viewshedVisualizationConfiguration as C,arcAnglePerSegment as L}from"./ViewshedConfiguration.js";import{ViewshedShapeVisualElement as D}from"./ViewshedShapeVisualElement.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let R=class extends t{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:b(),topRight:b(),bottomLeft:b(),bottomRight:b()},this._arcCenterPoints={top:b(),bottom:b(),left:b(),right:b()},this._parallelCenters={top:b(),bottom:b()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},s={...t,stipplePattern:O(2)};this._observerVisualElement=new j({...e,...C.observerPointConfiguration}),this._shapeVisualElement=new D({...e,isDecoration:this.isDecoration}),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(s),this._centralLatitude=new y(s),this.addHandles([o(()=>{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:i}),o(()=>{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()},a),o(()=>{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?C.frameWidthSelected:C.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(r?C.frameWidthSelected:C.frameWidthNotSelected),i.visible=e&&t})},a),o(()=>{const{analysisViewData:{interactive:e,effectiveTool:t},_selected:i,visible:s}=this,r=!t?.active&&A(this.view,this.analysisViewData);return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||r),color:this._color}},({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement(e=>e.color=t)},a)])}get _color(){const{viewshedComputedData:e,_selected:t,analysisViewData:i}=this;if(null==e)return C.frameColor.toUnitRGBA();const s=i.effectiveTool?.active||i.interactive,r=e.viewshed===i.stagedViewshed;return(s&&(t||r)?this.view.effectiveTheme.accentColor:C.frameColor).toUnitRGBA()}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:e,viewshedComputedData:t}=this,{effectiveTool:i}=e;return null!=i&&i.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(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;this._observerVisualElement.geometry=t.elevationAlignedObserver,this._shapeVisualElement.updateTransform(),this._updateFrameLines(t,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){const i=e.elevationAlignedObserverRenderSpace;this._frameLinesVisualElement.geometry=[[i,t.topLeft],[i,t.topRight],[i,t.bottomLeft],[i,t.bottomRight]]}_updateFrameArcs(e,t,i){const{elevationAlignedObserverRenderSpace:r,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=s(a),u=b(),p=h();c(p,n/2,l),m(u,o,p),F(this._leftArcVisualElement,r,t.bottomLeft,t.topLeft,"forward",u),c(p,-n/2,l),d(u,0,0,0),m(u,o,p),F(this._rightArcVisualElement,r,t.bottomRight,t.topRight,"forward",u);const _=a>180?"backward":"forward";F(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),F(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.elevationAlignedObserverRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";F(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),F(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function F(e,t,i,s,r,o,a=L){const l=b();u(l,i,t);const n=p(l),d=b();u(d,s,t),_(d,d),f(d,d,n);let A=V(l,d);const C=g(o);"backward"===r&&(v(C,C),A=-(2*Math.PI-A));const D=[],y=Math.ceil(Math.abs(A)/a),j=h();c(j,A/y,C);const O=b();w(O,l);const R=b();w(R,i);for(let c=0;c<y;c++){const e=b();w(e,R),m(O,O,j),E(R,t,O);const i=b();w(i,R),D.push([e,i])}e.geometry=D}e([l()],R.prototype,"view",void 0),e([l({constructOnly:!0})],R.prototype,"isDecoration",void 0),e([l()],R.prototype,"analysisViewData",void 0),e([l()],R.prototype,"viewshedComputedData",void 0),e([l()],R.prototype,"visible",void 0),e([l()],R.prototype,"_color",null),e([l()],R.prototype,"_selected",null),e([l()],R.prototype,"_staged",null),R=e([n("esri.views.3d.analysis.Viewshed.ViewshedSubVisualization")],R);export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";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{destroyMaybe as n}from"../../../../core/maybe.js";import{when as a,syncAndInitial as o,watch as l,sync as r,initial as d}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{creationElevationInfo as g}from"./ViewshedConfiguration.js";import{ViewshedSubTool as m}from"./ViewshedSubTool.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{Manipulator3D as w}from"../../interactive/Manipulator3D.js";import{Settings as _}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as V}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as b}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as y}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as S}from"../../../interactive/keybindings.js";import{newToolIntersector as T}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as C}from"../../../support/screenUtils.js";const D=Symbol("interactionVisuals");let M=class extends y{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=I,this._creationState=!1,this._interactionVisualElements=null,this._settings=new _({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=T(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new m({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([a(()=>this._valid,()=>this.finishToolCreation(),o),l(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},o),this.analysis.viewsheds.on("after-remove",e=>{const t=this._stagedViewshed;null!=t&&e.item===t&&this.analysis.viewsheds.add(t)}),l(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},r),l(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),a(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},d),l(()=>this.creating,()=>this.updateInteractionVisualsVisibility()),l(()=>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(D)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some(e=>e.viewshedComputedData.valid)??!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}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}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":S.cancel===e.key?this._cancelKeyHandler(e):S.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=I}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,H);if(null!=i){if("placing-observer"===this._creationState){const e=new t({observer:i.mapPoint.clone(),elevationInfo:g.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._stagedViewshed=null,"multiple"===this._placementMode?this._creationState="placing-observer":(this._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=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,H);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:n,farDistance:a}=v(this.view,i,e);t.farDistance=a,t.tilt=n,t.heading=s}removeStaged(){const e=this._stagedViewshed;return null!=e&&(this._stagedViewshed=null,this.analysis.viewsheds.remove(e),!0)}_intersectScreen(e,t){const i=C(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=f(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(D);const e=this._settings.visualElements,t=new b({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new V({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l(()=>e.zVerticalLine,e=>e.apply(s),o),l(()=>e.heightPlane,e=>e.apply(t),o),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],D)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!1,!1);const o=s.moveInteractionState,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof w?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};e([c()],M.prototype,"updating",null),e([c({constructOnly:!0})],M.prototype,"view",void 0),e([c()],M.prototype,"analysisViewData",void 0),e([c()],M.prototype,"removeIncompleteOnCancel",void 0),e([c()],M.prototype,"automaticManipulatorSelection",void 0),e([c()],M.prototype,"multiTouchEnabled",void 0),e([c({constructOnly:!0})],M.prototype,"analysis",void 0),e([c()],M.prototype,"subToolHandles",void 0),e([c()],M.prototype,"_stagedViewshed",void 0),e([c()],M.prototype,"_stagedViewshedComputedData",void 0),e([c()],M.prototype,"_placementMode",void 0),e([c()],M.prototype,"_creationState",void 0),e([c()],M.prototype,"_valid",null),e([c({readOnly:!0})],M.prototype,"cursor",null),e([c()],M.prototype,"_selectedManipulator",void 0),e([c()],M.prototype,"_selectedSubTool",null),e([c()],M.prototype,"selectedViewshed",null),e([c()],M.prototype,"selectedViewshedComputedData",null),e([c()],M.prototype,"stagedViewshed",null),e([c()],M.prototype,"grabbing",null),e([c()],M.prototype,"creating",null),e([c()],M.prototype,"isPlacingTarget",null),M=e([h("esri.views.3d.analysis.Viewshed.ViewshedTool")],M);const H={mapPoint:new p,scenePoint:u(),feature:null},I="multiple";export{M as default};
2
+ import{__decorate as e}from"tslib";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{destroyMaybe as n}from"../../../../core/maybe.js";import{when as a,syncAndInitial as o,watch as l,sync as r,initial as d}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as c}from"../../../../core/units.js";import{property as h,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../../../geometry/Point.js";import{creationVerticalOffset as m}from"./ViewshedConfiguration.js";import{ViewshedSubTool as v}from"./ViewshedSubTool.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{Manipulator3D as _}from"../../interactive/Manipulator3D.js";import{Settings as V}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as b}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as f}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as y}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as S}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as T}from"../../../interactive/keybindings.js";import{newToolIntersector as C}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as D}from"../../../support/screenUtils.js";const M=Symbol("interactionVisuals");let H=class extends S{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=P,this._creationState=!1,this._interactionVisualElements=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=C(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new v({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([a(()=>this._valid,()=>this.finishToolCreation(),o),l(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},o),this.analysis.viewsheds.on("after-remove",e=>{const t=this._stagedViewshed;null!=t&&e.item===t&&this.analysis.viewsheds.add(t)}),l(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},r),l(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),a(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},d),l(()=>this.creating,()=>this.updateInteractionVisualsVisibility()),l(()=>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(){n(this.subToolHandles),this.removeHandles(M)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some(e=>e.viewshedComputedData.valid)??!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}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}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":T.cancel===e.key?this._cancelKeyHandler(e):T.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=P}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,I);if(null!=i){if("placing-observer"===this._creationState){const e=c(i.mapPoint.spatialReference);i.mapPoint.z=(i.mapPoint.z??0)+m/e;const s=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(s),this._stagedViewshed=s,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._stagedViewshed=null,"multiple"===this._placementMode?this._creationState="placing-observer":(this._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=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,I);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:n,farDistance:a}=w(this.view,i,e);t.farDistance=a,t.tilt=n,t.heading=s}removeStaged(){const e=this._stagedViewshed;return null!=e&&(this._stagedViewshed=null,this.analysis.viewsheds.remove(e),!0)}_intersectScreen(e,t){const i=D(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=y(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(M);const e=this._settings.visualElements,t=new f({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new b({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l(()=>e.zVerticalLine,e=>e.apply(s),o),l(()=>e.heightPlane,e=>e.apply(t),o),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],M)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!1,!1);const o=s.moveInteractionState,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof _?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};e([h()],H.prototype,"updating",null),e([h({constructOnly:!0})],H.prototype,"view",void 0),e([h()],H.prototype,"analysisViewData",void 0),e([h()],H.prototype,"removeIncompleteOnCancel",void 0),e([h()],H.prototype,"automaticManipulatorSelection",void 0),e([h()],H.prototype,"multiTouchEnabled",void 0),e([h({constructOnly:!0})],H.prototype,"analysis",void 0),e([h()],H.prototype,"subToolHandles",void 0),e([h()],H.prototype,"_stagedViewshed",void 0),e([h()],H.prototype,"_stagedViewshedComputedData",void 0),e([h()],H.prototype,"_placementMode",void 0),e([h()],H.prototype,"_creationState",void 0),e([h()],H.prototype,"_valid",null),e([h({readOnly:!0})],H.prototype,"cursor",null),e([h()],H.prototype,"_selectedManipulator",void 0),e([h()],H.prototype,"_selectedSubTool",null),e([h()],H.prototype,"selectedViewshed",null),e([h()],H.prototype,"selectedViewshedComputedData",null),e([h()],H.prototype,"stagedViewshed",null),e([h()],H.prototype,"grabbing",null),e([h()],H.prototype,"creating",null),e([h()],H.prototype,"isPlacingTarget",null),H=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],H);const I={mapPoint:new g,scenePoint:p(),feature:null},P="multiple";export{H as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";let n=class extends t{constructor(e){super(e),this._editTool=null}initialize(){const{view:e}=this;this.addHandles([s(()=>({interactive:this.analysisViewData.interactive,selectedViewshed:this.analysisViewData.selectedViewshed,selectedViewshedComputedData:this._selectedViewshedComputedData}),({interactive:t,selectedViewshed:s,selectedViewshedComputedData:a})=>{t?null==s||null!=a?this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,view:e}),e.addAndActivateTool(this._editTool)):this.analysisViewData.selectedViewshed=null:this._editTool=i(this._editTool)},a),s(()=>e.activeTool,e=>{null!=e&&e!==this._editTool&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._editTool=i(this._editTool)}get selectedViewshedComputedData(){return this._selectedViewshedComputedData}async place(e,t){if(this.analysisViewData.interactive=!0,"single"===e)return{}}get _selectedViewshedComputedData(){const e=this.analysisViewData.selectedViewshed;return null==e?null:this._findViewshedComputedData(e)}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}};e([o({constructOnly:!0})],n.prototype,"view",void 0),e([o({constructOnly:!0})],n.prototype,"analysis",void 0),e([o({constructOnly:!0})],n.prototype,"analysisViewData",void 0),e([o()],n.prototype,"_editTool",void 0),e([o()],n.prototype,"selectedViewshedComputedData",null),e([o()],n.prototype,"_selectedViewshedComputedData",null),n=e([d("esri.views.3d.analysis.Viewshed.ViewshedTool2")],n);export{n as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{detachToolFromView as d}from"./toolLifecycleUtils.js";import{ViewshedEditTool as n}from"./ViewshedEditTool.js";import{ViewshedPlacementController as r}from"./ViewshedPlacementController.js";let c=class extends t{constructor(e){super(e),this._editTool=null}initialize(){const{view:e}=this;this._placementController=new r({analysis:this.analysis,analysisViewData:this.analysisViewData,view:e,callbacks:{cancelTool:()=>{null!=e.activeTool&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),isToolDestroyed:()=>this.destroyed,setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),this.addHandles([s(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive,selectedViewshed:this.analysisViewData.selectedViewshed,selectedViewshedComputedData:this._selectedViewshedComputedData}),({creationState:t,interactive:i,selectedViewshed:s,selectedViewshedComputedData:a})=>{if(!i)return this._placementController.cancelPlaceOperation(),this.analysisViewData.selectedViewshed=null,void this._destroyEditTool();null==s||null!=a?null==t?this._editTool||(this._editTool=new n({analysis:this.analysis,analysisViewData:this.analysisViewData,view:e}),e.tools.add(this._editTool)):this._destroyEditTool():this.analysisViewData.selectedViewshed=null},a),s(()=>e.activeTool,e=>{null!=e&&e!==this._editTool&&null==this._placementController.creationState&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),i(this._placementController)}get selectedViewshedComputedData(){return this._selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._placementController.updating||!!this._editTool?.updating}get creating(){return null!=this._placementController.creationState}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),"single"===e)return{}}get _selectedViewshedComputedData(){const e=this.analysisViewData.selectedViewshed;return null==e?null:this._findViewshedComputedData(e)}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){const e=this._editTool;this._editTool=null,null!=e&&(d(this.view,e),i(e))}get test(){}};e([o({constructOnly:!0})],c.prototype,"view",void 0),e([o({constructOnly:!0})],c.prototype,"analysis",void 0),e([o({constructOnly:!0})],c.prototype,"analysisViewData",void 0),e([o()],c.prototype,"_placementController",void 0),e([o()],c.prototype,"_editTool",void 0),e([o()],c.prototype,"selectedViewshedComputedData",null),e([o()],c.prototype,"stagedViewshed",null),e([o()],c.prototype,"active",null),e([o()],c.prototype,"updating",null),e([o()],c.prototype,"creating",null),e([o()],c.prototype,"_selectedViewshedComputedData",null),c=e([l("esri.views.3d.analysis.Viewshed.ViewshedTool2")],c);export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{createAnalysisViewRegister as e}from"../support/analysisViewRegister.js";const r=e();function t(e,t){return r.register(e,t)}function n(e,t){r.forEveryOther(e,t,e=>{e.interactive&&(e.selectedViewshed=null)})}function i(e,t){let n=!1;return r.forEveryOther(e,t,e=>{n||=e.tool?.creating??!1}),n}export{i as isOtherViewshedToolCreating,t as registerAnalysisView,n as unselectViewshedInOtherAnalysisViews};
2
+ import{createAnalysisViewRegister as e}from"../support/analysisViewRegister.js";const r=e();function t(e,t){return r.register(e,t)}function n(e,t){r.forEveryOther(e,t,e=>{e.interactive&&(e.selectedViewshed=null)})}function i(e,t){let n=!1;return r.forEveryOther(e,t,e=>{n||=e.creating??!1}),n}export{i as isOtherViewshedToolCreating,t as registerAnalysisView,n as unselectViewshedInOtherAnalysisViews};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,sync as t,initial as r}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{clone as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Point.js";import{pointEquals as l}from"../../../../layers/graphics/dehydratedFeatureComparison.js";import{makeDehydratedPoint as c}from"../../../../layers/graphics/dehydratedPoint.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{ViewshedDrawToolRenderer as d}from"./ViewshedDrawToolRenderer.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as u}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as f}from"../../../draw/DrawTool.js";import{acquire as g}from"../../../interactive/snapping/SnappingManagerPool.js";function j(o){const{analysisViewData:i,view:a,sketchOptions:s,onCancel:l,onComplete:c,onManipulatorCountChange:u}=o,j=new d({view:a}),P=g(a),w=new m(a.state.viewingMode),b=new f({elevationInfo:p,enableVertexVisuals:!1,hasZ:!0,renderer:j,sketchOptions:s,snappingManager:P.snappingManager,view:a});return b.addHandles([P,e(j),b.on("cancel",()=>l(b)),b.on("complete",()=>c(b)),n(()=>b.manipulators.length,()=>u(b),t),n(()=>i.visible,e=>j.analysisVisible=e,r)]),{drawTool:b,intersector:w,renderer:j}}function P({drawTool:e,intersector:n,mapPoint:t,view:r}){const{interactiveHandleManager:o,lastScreenPosition:s}=e,l=e.getVertexSnappingCandidates(),c=a();if(!r.renderCoordsHelper.toRenderCoords(t,c))return null;const p=o?.capturingHandle??o?.allhandles?.at(0),d=p?.screenPosition??s,m=null!=p?w({handle:p,spatialReference:r.spatialReference,vertexSnappingCandidates:l}):null,u=null!=d?v(d,r,n):null;return{mapPoint:(u?.mapPoint??t).clone(),scenePoint:u?.scenePoint?i(u.scenePoint):c,feature:null!=m?h(m):u?.feature}}function w({handle:e,spatialReference:n,vertexSnappingCandidates:t}){const r=e.selectedSnappingResult;if(!r)return null;const o=r.spatialReference??n;return t.find(({targetPoint:e})=>l(r,c(e.x,e.y,e.z,o)))}const b={mapPoint:new s,scenePoint:a(),feature:null};function v(e,n,t){n.sceneIntersectionHelper.intersectToolIntersectorScreen(o(e.x,e.y),t);const r=b,i=t.results.min;return i.getIntersectionPoint(r.scenePoint)?(r.mapPoint.spatialReference=n.spatialReference,n.renderCoordsHelper.fromRenderCoords(r.scenePoint,r.mapPoint),r.feature=u(i,n),r):null}function h(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{j as createDrawTool,P as createPlacementResult};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ function o(o,l){o.activeTool===l&&(o.activeTool=null),o.tools.includes(l)&&o.tools.remove(l)}export{o as detachToolFromView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import o from"../../../../core/Collection.js";import{mapCollection as e}from"../../../../core/mapCollectionUtils.js";import{ViewshedSubTool as t}from"./ViewshedSubTool.js";import{Manipulator3D as a}from"../../interactive/Manipulator3D.js";function i({analysis:a,analysisViewData:i,onBeforeSubToolRemove:n,parentTool:s,view:l,viewshedComputedDataHandles:r}){return null==r?new o:e(()=>r,({viewshedComputedData:o})=>{const e=new t({analysis:a,analysisViewData:i,parentTool:s,view:l,viewshedComputedData:o});return{subTool:e,remove:()=>{n(o.viewshed),e.destroy()}}})}function n(o,e){return e?o.find(e instanceof a?({subTool:o})=>o.hasManipulator(e):({subTool:o})=>o.viewshed===e)?.subTool??null:null}export{i as createSubToolHandles,n as findSubTool};
2
+ import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";function n(n,i){return i?n.find(i instanceof o?({subTool:o})=>o.hasManipulator(i):({subTool:o})=>o.viewshed===i)?.subTool??null:null}export{n as findSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{rad2deg as e,clamp as r}from"../../../../core/mathUtils.js";import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i,normalize as o,copy as a,angle as s,dot as c,sub as m,add as l,scale as d,len as p,set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,getNormal as h,fromPositionAndNormal as b,projectPoint as j}from"../../../../geometry/support/plane.js";import{viewshedToolManipulatorConfiguration as v}from"./ViewshedConfiguration.js";import{calculateTranslateRotateFromBases as x,calculateInputRotationTransform as S}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as A}from"../../interactive/editingTools/dragEventPipeline3D.js";import{headingTiltToDirectionUp as R}from"../../support/cameraUtils.js";import{createDirectionUp as U}from"../../support/cameraUtilsInternal.js";function C({tiltedUpVector:e,rightVector:r,elevationAlignedObserverRenderSpace:t},n){const i=x(e,r,t,n);return i[12]=0,i[13]=0,i[14]=0,i}function D(t,n,i,s){const p=g(),f=h(i.plane),j=E(n,f);let x;if(Math.abs(j)>v.viewAngleThreshold)x=t.next(A(n,i.plane));else{const e=b(s.elevationAlignedTargetRenderSpace,i.basis1,u()),a=o(T,i.basis1),p=o(V,i.basis2);x=t.next(A(n,e)).next(e=>{const t=e=>{const t=c(m(w,e,i.origin),p),n=Math.acos(r(t/s.farDistanceRenderSpace,-1,1)),o=Math.sin(n)*s.farDistanceRenderSpace;return l(g(),i.origin,l(g(),d(w,a,o),d(H,p,t)))},n=t(e.renderStart),o=t(e.renderEnd);return{...e,renderStart:n,renderEnd:o}})}return x.next(r=>{"start"===r.action&&a(p,r.renderStart);const t=e(S(p,r.renderEnd,i.origin,f));return{...r,deltaAngle:t}})}function E(r,t){const n=T;r.renderCoordsHelper.toRenderCoords(r.camera.position,n);const i=R(r,n,r.camera.heading,r.camera.tilt,U()).direction;return e(s(i,t))-90}function M(e,r,n,o){return t(O,n,o),i(e,r,O)}function P(r,t,n){const i=t.elevationAlignedObserverRenderSpace,o=m(y,n,i),a=p(o)*t.metersPerUnit,l=r.renderCoordsHelper.basisMatrixAtPosition(i,B),d=f(I,l[8],l[9],l[10]),g=b(i,d,F),u=j(g,n,k),h=m(u,u,i),v=(p(h)<1e-4?90:e(s(o,h)))*(c(d,o)<0?-1:1)+90,x=f(q,l[4],l[5],l[6]),S=e(s(x,h)),A=f(z,l[0],l[1],l[2]);return{heading:c(h,A)<0?360-S:S,tilt:v,farDistance:a}}const T=g(),V=g(),w=g(),H=g(),O=n(),y=g(),I=g(),k=g(),q=g(),z=g(),B=n(),F=u();export{P as computeParametersFromTargetPoint,C as getViewshedRotationMatrix,M as rotateBy,D as screenToCircleAngle};
2
+ import{rad2deg as e,clamp as r}from"../../../../core/mathUtils.js";import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i,sub as o,len as a,set as s,angle as c,dot as m,normalize as l,copy as d,add as p,scale as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as u,projectPoint as h,create as b,getNormal as j}from"../../../../geometry/support/plane.js";import{viewshedToolManipulatorConfiguration as v}from"./ViewshedConfiguration.js";import{calculateTranslateRotateFromBases as x,calculateInputRotationTransform as S}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as A}from"../../interactive/editingTools/dragEventPipeline3D.js";import{headingTiltToDirectionUp as R}from"../../support/cameraUtils.js";import{createDirectionUp as U}from"../../support/cameraUtilsInternal.js";function C({tiltedUpVector:e,rightVector:r,elevationAlignedObserverRenderSpace:t},n){const i=x(e,r,t,n);return i[12]=0,i[13]=0,i[14]=0,i}function D(t,n,i,a){const s=g(),c=j(i.plane),h=E(n,c);let x;if(Math.abs(h)>v.viewAngleThreshold)x=t.next(A(n,i.plane));else{const e=u(a.elevationAlignedTargetRenderSpace,i.basis1,b()),s=l(T,i.basis1),c=l(V,i.basis2);x=t.next(A(n,e)).next(e=>{const t=e=>{const t=m(o(w,e,i.origin),c),n=Math.acos(r(t/a.farDistanceRenderSpace,-1,1)),l=Math.sin(n)*a.farDistanceRenderSpace;return p(g(),i.origin,p(g(),f(w,s,l),f(H,c,t)))},n=t(e.renderStart),l=t(e.renderEnd);return{...e,renderStart:n,renderEnd:l}})}return x.next(r=>{"start"===r.action&&d(s,r.renderStart);const t=e(S(s,r.renderEnd,i.origin,c));return{...r,deltaAngle:t}})}function E(r,t){const n=T;r.renderCoordsHelper.toRenderCoords(r.camera.position,n);const i=R(r,n,r.camera.heading,r.camera.tilt,U()).direction;return e(c(i,t))-90}function M(e,r,n,o){return t(O,n,o),i(e,r,O)}function P(r,t,n){const i=t.elevationAlignedObserverRenderSpace,l=o(y,n,i),d=a(l)*t.metersPerUnit,p=r.renderCoordsHelper.basisMatrixAtPosition(i,B),f=s(I,p[8],p[9],p[10]),g=u(i,f,F),b=h(g,n,k),j=o(b,b,i),v=(a(j)<1e-4?90:e(c(l,j)))*(m(f,l)<0?-1:1)+90,x=s(q,p[4],p[5],p[6]),S=e(c(x,j)),A=s(z,p[0],p[1],p[2]);return{heading:m(j,A)<0?360-S:S,tilt:v,farDistance:d}}const T=g(),V=g(),w=g(),H=g(),O=n(),y=g(),I=g(),k=g(),q=g(),z=g(),B=n(),F=b();export{P as computeParametersFromTargetPoint,C as getViewshedRotationMatrix,M as rotateBy,D as screenToCircleAngle};