@arcgis/core 5.2.0-next.167 → 5.2.0-next.169

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 (307) hide show
  1. package/Map.d.ts +6 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/057f245d70e57a1bcb46.js +1 -0
  4. package/assets/esri/core/workers/chunks/{1419bf346978b81b08cc.js → 094eb9677cdebfaa9e1b.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0d52e1b6d38f2670658c.js +1 -0
  6. package/assets/esri/core/workers/chunks/0f7455dbe8c2ee464194.js +1 -0
  7. package/assets/esri/core/workers/chunks/10878932826ddb60fac4.js +1 -0
  8. package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +1 -0
  9. package/assets/esri/core/workers/chunks/1a614bac5db42c6263f8.js +1 -0
  10. package/assets/esri/core/workers/chunks/{99a0a434ea2162166754.js → 2095f220dc2b8f8f62db.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{5daa9429808ca31279f2.js → 216a239142dfe1306c6c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/25c3be410d1c03f8f39d.js +1 -0
  13. package/assets/esri/core/workers/chunks/294276ed397023dcda44.js +1 -0
  14. package/assets/esri/core/workers/chunks/2a2a4650dd9b953d317c.js +1 -0
  15. package/assets/esri/core/workers/chunks/2b6684d057d9ad17ac13.js +1 -0
  16. package/assets/esri/core/workers/chunks/{ad96132bc89671e595f3.js → 2d3e0e4442dbc6ec6def.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2d83ba260dd6bbe38206.js +1 -0
  18. package/assets/esri/core/workers/chunks/{69d5f8ef78b9b8b3d33d.js → 3286cf2afeb7f48564d9.js} +1 -1
  19. package/assets/esri/core/workers/chunks/3321cb0d4cb68b2ec8bf.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e99c8c71c757bb161d87.js → 3636c2ac9b77950776d6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/367b2f25cfe37847a48d.js +1 -0
  22. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +1 -0
  23. package/assets/esri/core/workers/chunks/3c881b1adc8a5dea9a90.js +1 -0
  24. package/assets/esri/core/workers/chunks/{6a2562cc00727155fc01.js → 4024becaf4012c1f15a7.js} +1 -1
  25. package/assets/esri/core/workers/chunks/435ad7e6ed326da2b969.js +1 -0
  26. package/assets/esri/core/workers/chunks/4419732baf3459a80e6d.js +1 -0
  27. package/assets/esri/core/workers/chunks/46f0510846a309a390ca.js +1 -0
  28. package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +1 -0
  29. package/assets/esri/core/workers/chunks/509a74e9334f31b931d4.js +1 -0
  30. package/assets/esri/core/workers/chunks/50e8943d2c0b96fab2c1.js +1 -0
  31. package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +1 -0
  32. package/assets/esri/core/workers/chunks/546f5f57c9249627bb89.js +1 -0
  33. package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d90a3bfd45b5ed4092e0.js → 590fe0f56bc4c33a50e7.js} +1 -1
  35. package/assets/esri/core/workers/chunks/5d42f0898bf30ae940ea.js +1 -0
  36. package/assets/esri/core/workers/chunks/5f1cb79aec9c4a9b7ddc.js +29 -0
  37. package/assets/esri/core/workers/chunks/{5d2f043ebe1051326c56.js → 63b5418a1c3fe0a97a86.js} +1 -1
  38. package/assets/esri/core/workers/chunks/63c3a573dfe703056f8f.js +1 -0
  39. package/assets/esri/core/workers/chunks/673c61c964524150d9bc.js +1 -0
  40. package/assets/esri/core/workers/chunks/692f0093c444fcc752b5.js +1 -0
  41. package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +1 -0
  42. package/assets/esri/core/workers/chunks/{e6d10136bc08aef255ff.js → 712559f121f76c4e71ab.js} +1 -1
  43. package/assets/esri/core/workers/chunks/71a51795f715332fb4fe.js +1 -0
  44. package/assets/esri/core/workers/chunks/735c1dffc3439bdba3cc.js +1 -0
  45. package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +1 -0
  46. package/assets/esri/core/workers/chunks/{44d5508042cacdfcac47.js → 7d2be06dfbd92c8b9484.js} +1 -1
  47. package/assets/esri/core/workers/chunks/7f5b887a753bb67c8486.js +1 -0
  48. package/assets/esri/core/workers/chunks/822f83d7c09ef0a9bbdf.js +1 -0
  49. package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +1 -0
  50. package/assets/esri/core/workers/chunks/8d86b0cb0e004ad72040.js +1 -0
  51. package/assets/esri/core/workers/chunks/{76196c414e48834f7b92.js → 8f008eedb11685ee2048.js} +1 -1
  52. package/assets/esri/core/workers/chunks/98760040f0c9d47c718d.js +1 -0
  53. package/assets/esri/core/workers/chunks/{4b99b4cf729881e616bc.js → 98d1efb6f2439c6344cf.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{18f20fd43ec9ce03cef1.js → 9e04703ee5f5ec47db43.js} +1 -1
  55. package/assets/esri/core/workers/chunks/9e0b0262dec496451762.js +1 -0
  56. package/assets/esri/core/workers/chunks/{23fd4de56de352f63e2d.js → a2196a49f89d57a0a1c7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{89c8b0f684c1f27d149e.js → a2f0894218e665780a21.js} +1 -1
  58. package/assets/esri/core/workers/chunks/a79cae328e866272754a.js +1 -0
  59. package/assets/esri/core/workers/chunks/a85cdafbaf1848bb924b.js +1 -0
  60. package/assets/esri/core/workers/chunks/b01688ccc29d33bfc82d.js +1 -0
  61. package/assets/esri/core/workers/chunks/b0a612d8ffa5c46d7db4.js +1 -0
  62. package/assets/esri/core/workers/chunks/b5eff28cf482d920b9ea.js +1 -0
  63. package/assets/esri/core/workers/chunks/b70885deebc6106597ad.js +1 -0
  64. package/assets/esri/core/workers/chunks/bedaa5e64ed81803829a.js +1 -0
  65. package/assets/esri/core/workers/chunks/{a88f346786b04bd194dc.js → c0b38f8c808d434af5f6.js} +1 -1
  66. package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +1 -0
  67. package/assets/esri/core/workers/chunks/c249a91dd23104723fab.js +1 -0
  68. package/assets/esri/core/workers/chunks/c45edd0a7d57263bb7d6.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4bbe4707e90b7cd0379.js +1 -0
  70. package/assets/esri/core/workers/chunks/c52466eb1f3c33ae1f5a.js +1 -0
  71. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +1 -0
  72. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +1 -0
  73. package/assets/esri/core/workers/chunks/c7699edd14497d174445.js +1 -0
  74. package/assets/esri/core/workers/chunks/c80a3b039e510c118399.js +1 -0
  75. package/assets/esri/core/workers/chunks/{196979cc6a765be3c5cd.js → c88a70f68c8ce8c30e9b.js} +1 -1
  76. package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +1 -0
  77. package/assets/esri/core/workers/chunks/caaf6306cc73f618d27d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{b704f489d0f072a0bfcd.js → ccd19c490ca24db6ffb1.js} +1 -1
  79. package/assets/esri/core/workers/chunks/cdacc3e42f01c3b852d6.js +1 -0
  80. package/assets/esri/core/workers/chunks/d1d6154b4af1c9cc497b.js +1 -0
  81. package/assets/esri/core/workers/chunks/d20dcd4ce4b0111d924f.js +1 -0
  82. package/assets/esri/core/workers/chunks/{784a2fba3e18286958d1.js → d56fdf5ce5ff53dc0e69.js} +1 -1
  83. package/assets/esri/core/workers/chunks/d7cf32a8c6060a208f06.js +1 -0
  84. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +1 -0
  85. package/assets/esri/core/workers/chunks/dd08dff19a2ffd36f284.js +1 -0
  86. package/assets/esri/core/workers/chunks/de3f140058aa0b907b65.js +1 -0
  87. package/assets/esri/core/workers/chunks/df375d1b0dab5ecbd1be.js +1 -0
  88. package/assets/esri/core/workers/chunks/{e2775b4b753306dc8477.js → df7603ef7d2a7cbeaaa2.js} +1 -1
  89. package/assets/esri/core/workers/chunks/e9cdb0b0f074583edebd.js +1 -0
  90. package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +1 -0
  91. package/assets/esri/core/workers/chunks/edd36a1fc80b1d29907e.js +1 -0
  92. package/assets/esri/core/workers/chunks/{444e5f214abce3d607cd.js → eeb068c265bd3a22a8c1.js} +1 -1
  93. package/assets/esri/core/workers/chunks/f2cfee8a761ae91f7a3e.js +1 -0
  94. package/assets/esri/core/workers/chunks/f3fdf75843ade0ca591e.js +1 -0
  95. package/assets/esri/core/workers/chunks/f5cc78291b53931b91e8.js +1 -0
  96. package/assets/esri/core/workers/chunks/f9dc38761b314d33890f.js +1 -0
  97. package/assets/esri/core/workers/chunks/feb6e041dd0aa1c59c31.js +1 -0
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
  133. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
  134. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
  135. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
  137. package/config.js +1 -1
  138. package/core/workers/workers.js +2 -2
  139. package/core/workers.d.ts +1 -1
  140. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  141. package/geometry/operators/containsOperator.d.ts +1 -1
  142. package/geometry/operators/densifyOperator.d.ts +1 -1
  143. package/geometry/operators/differenceOperator.d.ts +6 -4
  144. package/geometry/operators/distanceOperator.d.ts +1 -1
  145. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  146. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  147. package/geometry/operators/integrateOperator.d.ts +2 -2
  148. package/geometry/operators/intersectsOperator.d.ts +3 -3
  149. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  150. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  151. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  152. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  153. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  154. package/geometry/operators/projectOperator.d.ts +2 -2
  155. package/geometry/operators/proximityOperator.d.ts +15 -15
  156. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  157. package/geometry/operators/simplifyOperator.d.ts +2 -2
  158. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  159. package/geometry/operators/support/Transformation.d.ts +8 -8
  160. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  161. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  162. package/geometry/operators/withinOperator.d.ts +3 -3
  163. package/graphic/MapNotesGraphicOrigin.d.ts +1 -0
  164. package/kernel.js +1 -1
  165. package/layers/ElevationLayer.d.ts +6 -2
  166. package/layers/GeospatialPDFLayer.d.ts +2 -2
  167. package/layers/ParquetLayer.d.ts +1 -1
  168. package/layers/VectorTileLayer.d.ts +10 -1
  169. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  170. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  171. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  172. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  173. package/layers/orientedImagery/transformations/rotationUtils.js +2 -0
  174. package/layers/orientedImagery/transformations/utils.js +1 -1
  175. package/package.json +2 -2
  176. package/popup/FeaturesModel.js +1 -1
  177. package/popup/support/featureUtils.js +1 -1
  178. package/rest/featureService/FeatureService.d.ts +0 -5
  179. package/rest/networks/support/TraceLocation.d.ts +2 -1
  180. package/rest/networks/support/TraceResult.d.ts +0 -4
  181. package/rest/support/OutDistance.d.ts +0 -1
  182. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  183. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  184. package/support/BasemapStyle.d.ts +2 -2
  185. package/symbols/cim/types.d.ts +7 -9
  186. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  187. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
  189. package/views/2d/layers/features/FeatureContainer.js +1 -1
  190. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  191. package/views/3d/environment/SunLighting.d.ts +15 -2
  192. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  193. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  194. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  195. package/views/draw/DrawOperation.js +1 -1
  196. package/views/draw/DrawScreenTool.js +1 -1
  197. package/views/input/types.d.ts +2 -4
  198. package/views/interactive/options/LabelOptions.d.ts +5 -5
  199. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  200. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
  201. package/widgets/Editor/VisibleElements.d.ts +4 -0
  202. package/widgets/Editor.d.ts +2 -0
  203. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  204. package/widgets/FeatureTable.js +1 -1
  205. package/widgets/Features/FeaturesViewModel.js +1 -1
  206. package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
  207. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  208. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  209. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  210. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  211. package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +2 -0
  212. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  213. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  214. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  215. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  216. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  217. package/widgets/OrientedImageryViewer.js +2 -2
  218. package/widgets/PanoramicViewer/utils.js +1 -1
  219. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  220. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  221. package/widgets/Sketch.d.ts +2 -0
  222. package/widgets/support/iconUtils.js +1 -1
  223. package/assets/esri/core/workers/chunks/010f57ec7fdbedf78d02.js +0 -1
  224. package/assets/esri/core/workers/chunks/02e10f44edf911832c2a.js +0 -1
  225. package/assets/esri/core/workers/chunks/07f7177bfaf9de73bc25.js +0 -1
  226. package/assets/esri/core/workers/chunks/090adefe20412e8a5084.js +0 -1
  227. package/assets/esri/core/workers/chunks/0d9c4c6c571ce26d356b.js +0 -1
  228. package/assets/esri/core/workers/chunks/1201b8c5852830836eac.js +0 -1
  229. package/assets/esri/core/workers/chunks/151e5799ede763a03ee2.js +0 -1
  230. package/assets/esri/core/workers/chunks/168a523bdc3653081f8a.js +0 -1
  231. package/assets/esri/core/workers/chunks/175c268e64ccd01f8c25.js +0 -1
  232. package/assets/esri/core/workers/chunks/18787aa685524b958561.js +0 -1
  233. package/assets/esri/core/workers/chunks/1e1c45f75020d5e05dc3.js +0 -1
  234. package/assets/esri/core/workers/chunks/28104681ba161967039f.js +0 -1
  235. package/assets/esri/core/workers/chunks/2a36fe3f3f257a779a1b.js +0 -1
  236. package/assets/esri/core/workers/chunks/30af63b3b750142faadb.js +0 -1
  237. package/assets/esri/core/workers/chunks/3dddae78286d05eb10fc.js +0 -1
  238. package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +0 -1
  239. package/assets/esri/core/workers/chunks/40d803584eeade4df433.js +0 -1
  240. package/assets/esri/core/workers/chunks/41773d858e212468db88.js +0 -1
  241. package/assets/esri/core/workers/chunks/426b4eb500fdfe9df325.js +0 -1
  242. package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +0 -1
  243. package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +0 -1
  244. package/assets/esri/core/workers/chunks/4932773663469919d10a.js +0 -1
  245. package/assets/esri/core/workers/chunks/49b967d89d2841cea675.js +0 -1
  246. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +0 -1
  247. package/assets/esri/core/workers/chunks/4cb751dc8d00bdaeb04c.js +0 -1
  248. package/assets/esri/core/workers/chunks/4d3d7ec407ee5cd5f036.js +0 -1
  249. package/assets/esri/core/workers/chunks/4fd0d9688df6fcc0d0b8.js +0 -1
  250. package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +0 -1
  251. package/assets/esri/core/workers/chunks/548b8f74a6883e364931.js +0 -1
  252. package/assets/esri/core/workers/chunks/5af8fb4ec2c72697e35b.js +0 -1
  253. package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +0 -1
  254. package/assets/esri/core/workers/chunks/5dc604e3691f36f03959.js +0 -1
  255. package/assets/esri/core/workers/chunks/611e3cdf67283c11576f.js +0 -1
  256. package/assets/esri/core/workers/chunks/61552b4b8111a8624d84.js +0 -1
  257. package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +0 -1
  258. package/assets/esri/core/workers/chunks/632fdf1d95ad69109427.js +0 -1
  259. package/assets/esri/core/workers/chunks/652faf4359ac072c5dde.js +0 -1
  260. package/assets/esri/core/workers/chunks/6b9961261241fdce0e94.js +0 -1
  261. package/assets/esri/core/workers/chunks/710b8251a59884aee31e.js +0 -1
  262. package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +0 -29
  263. package/assets/esri/core/workers/chunks/7393f63043a1da3d05a6.js +0 -1
  264. package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +0 -1
  265. package/assets/esri/core/workers/chunks/771dd92cb3e6a3427f66.js +0 -1
  266. package/assets/esri/core/workers/chunks/7748c2886d0122b40eeb.js +0 -1
  267. package/assets/esri/core/workers/chunks/78c4e43cfa1eda06b4d9.js +0 -1
  268. package/assets/esri/core/workers/chunks/7e0f04a5038e2a4f6e4b.js +0 -1
  269. package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +0 -1
  270. package/assets/esri/core/workers/chunks/7f16ae01ccd9b6114d1c.js +0 -1
  271. package/assets/esri/core/workers/chunks/82a022cc21364c9a8539.js +0 -1
  272. package/assets/esri/core/workers/chunks/8924e2f3b7d03afb3a6a.js +0 -1
  273. package/assets/esri/core/workers/chunks/90153b5230b3a4985c14.js +0 -1
  274. package/assets/esri/core/workers/chunks/9189dfe19a2a2ccd5173.js +0 -1
  275. package/assets/esri/core/workers/chunks/9215b59c5ccecf9add58.js +0 -1
  276. package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +0 -1
  277. package/assets/esri/core/workers/chunks/967b4992b400517ee712.js +0 -1
  278. package/assets/esri/core/workers/chunks/9dd1fc56eb1ea6eb705e.js +0 -1
  279. package/assets/esri/core/workers/chunks/a163c6005aba3378edaa.js +0 -1
  280. package/assets/esri/core/workers/chunks/a53823cf03dbdce1aecd.js +0 -1
  281. package/assets/esri/core/workers/chunks/a62c12925303ff802c3d.js +0 -1
  282. package/assets/esri/core/workers/chunks/acb265a22be5e12f38e5.js +0 -1
  283. package/assets/esri/core/workers/chunks/acdfd275dbf8533a67f3.js +0 -1
  284. package/assets/esri/core/workers/chunks/ace802483484519658f3.js +0 -1
  285. package/assets/esri/core/workers/chunks/b3007aedbf731dacaff1.js +0 -1
  286. package/assets/esri/core/workers/chunks/b4334713bacdfe40ce3d.js +0 -1
  287. package/assets/esri/core/workers/chunks/b83cef2d3f528726d492.js +0 -1
  288. package/assets/esri/core/workers/chunks/be97a629e2ae4d13ceb3.js +0 -1
  289. package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +0 -1
  290. package/assets/esri/core/workers/chunks/c47d095434d09b5f10c6.js +0 -1
  291. package/assets/esri/core/workers/chunks/c4b7111dcedd9d6e1c2a.js +0 -1
  292. package/assets/esri/core/workers/chunks/c5d85be6e16bc895e7fb.js +0 -1
  293. package/assets/esri/core/workers/chunks/c8d6bb5cca49926a0214.js +0 -1
  294. package/assets/esri/core/workers/chunks/cb4be68cc5085d421615.js +0 -1
  295. package/assets/esri/core/workers/chunks/cb4db5489388559d6bd9.js +0 -1
  296. package/assets/esri/core/workers/chunks/cc794bb94ebc1cb66024.js +0 -1
  297. package/assets/esri/core/workers/chunks/cc94bf05b235e65291fc.js +0 -1
  298. package/assets/esri/core/workers/chunks/d4af9faa5d901274fad2.js +0 -1
  299. package/assets/esri/core/workers/chunks/d77c68e0fc3b259bf4f9.js +0 -1
  300. package/assets/esri/core/workers/chunks/daf9b691817e83a11f3c.js +0 -1
  301. package/assets/esri/core/workers/chunks/de0f335f702ae85a1df3.js +0 -1
  302. package/assets/esri/core/workers/chunks/e11159e3dc3353b27c57.js +0 -1
  303. package/assets/esri/core/workers/chunks/f8379cd45f750f28a3d8.js +0 -1
  304. package/assets/esri/core/workers/chunks/f905f1a1aa4c123cbe83.js +0 -1
  305. package/assets/esri/core/workers/chunks/fd4635410b27bcedb752.js +0 -1
  306. package/assets/esri/core/workers/chunks/fda83bcb8e40e8044c24.js +0 -1
  307. package/assets/esri/core/workers/chunks/feb4f8c807bb0dca488f.js +0 -1
@@ -266,13 +266,13 @@ export interface CIMLineCallout extends CIMCallout {
266
266
  * Represents the leader line style for callouts. Line leaders will always be drawn with their own geometry.
267
267
  *
268
268
  * Supported values:
269
- * - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
269
+ * - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
270
270
  * - `MidPoint`: The line callout leader is a single line originating from the midpoint of the left or right side of the text box with the gap applied or from the midpoint of the accent bar if the callout has one.
271
271
  * - `ThreePoint`: The line callout leader is a 3-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
272
272
  * - `FourPoint`: The line callout leader is a 4-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
273
- * - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either and underline or an "overline" is drawn along the closest side (bottom or top) of the text.
274
- * - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
275
- * - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
273
+ * - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either an underline or an "overline" is drawn along the closest side (bottom or top) of the text.
274
+ * - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
275
+ * - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
276
276
  *
277
277
  * @since 5.2
278
278
  */
@@ -343,7 +343,7 @@ export type LeaderLineStyle = "Base" | "MidPoint" | "ThreePoint" | "FourPoint" |
343
343
  * "accentBarSymbol": {
344
344
  * "type": "CIMLineSymbol",
345
345
  * "symbolLayers": [
346
- * * {
346
+ * {
347
347
  * "type": "CIMSolidStroke",
348
348
  * "enable": true,
349
349
  * "capStyle": "Round",
@@ -2693,7 +2693,6 @@ export interface CIMSymbolAnimationOffset extends CIMBaseAnimation {
2693
2693
  *
2694
2694
  * @since 5.1
2695
2695
  * @see [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine)
2696
- * @beta
2697
2696
  */
2698
2697
  export type MovementAlongLineType = "Distance" | "Speed";
2699
2698
 
@@ -2703,7 +2702,6 @@ export type MovementAlongLineType = "Distance" | "Speed";
2703
2702
  * The starting position of the marker(s) on the line geometry is determined by the [CIMMarkerPlacement](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMMarkerPlacement) properties of the symbol layer.
2704
2703
  *
2705
2704
  * @since 5.1
2706
- * @beta
2707
2705
  */
2708
2706
  export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
2709
2707
  /**
@@ -2756,7 +2754,7 @@ export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
2756
2754
  * [CIMSymbolAnimationTransparency](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationTransparency) | Represents a symbol animation that changes the transparency of a symbol.
2757
2755
  * [CIMSymbolAnimationRotation](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationRotation) | Represents a symbol animation that rotates a symbol to a given value.
2758
2756
  * [CIMSymbolAnimationOffset](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationOffset) | Represents a symbol animation that offsets a symbol to a given X or Y value.
2759
- * [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine) (beta) | Represents a symbol animation that moves a symbol along a line geometry.
2757
+ * [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine) | Represents a symbol animation that moves a symbol along a line geometry.
2760
2758
  *
2761
2759
  * > [!WARNING]
2762
2760
  * >
@@ -3025,7 +3023,7 @@ export interface CIMPointSymbolCallout extends CIMLineCallout {
3025
3023
  */
3026
3024
  pointSymbol: CIMPointSymbol;
3027
3025
  /**
3028
- * Defines how the background is scaled to fit the dimensions of the symbol.
3026
+ * Defines how the background is scaled to fit the dimensions of the text symbol.
3029
3027
  *
3030
3028
  * @since 5.2
3031
3029
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){if(t!==0){if(e===this.recordStart+this.recordCount){this.recordCount+=t;return}this.additionalRecordRanges.push({recordStart:e,recordCount:t})}}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this._colliders=null)}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this._colliders=null)}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
2
+ import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}invalidateColliders(){this._colliders=null}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){if(t!==0){if(e===this.recordStart+this.recordCount){this.recordCount+=t;return}this.additionalRecordRanges.push({recordStart:e,recordCount:t})}}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.invalidateColliders())}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this.invalidateColliders())}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
2
+ import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}invalidateColliders(){for(let e of this._entries.values())e.invalidateColliders()}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{i1616to32 as e,i16 as t}from"../../../number.js";import{AlignedVertexSpec as n}from"./AlignedVertexSpec.js";import{unpackDataView as r,packDataView as i}from"./dataViewUtils.js";import{bitsetGenericLabelInstance as a}from"../shaders/constants.js";class o{static fromVertexSpec(e,t){let r=n.fromVertexSpec(e,t);return new o(r)}constructor(e){this._spec=e,this.collisionVisibility=!1,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,t,n,i,o,s){for(let e=0;e<this._spec.packVertexCount;e++){let c=e*this._spec.stride;this._packPosition(n,i,c),this._packId(t,c);let l=this._spec.bitset;if(s){if(l.packTessellation){let e=l.packTessellation(s,o,n,i);this._pack(e,l,c)}for(let e of this._spec.standardAttributes)if(e.packTessellation!=null){let t=e.packTessellation(s,o,n,i);this._pack(t,e,c)}else if(e.packAlternating?.packTessellation){let t=e.packAlternating.packTessellation(s,o,n,i);for(let n=0;n<this._spec.packVertexCount;n++){let r=t[n];this._pack(r,e,n*this._spec.stride)}}}let u=r(this._dataView,l,c),d=1<<a,f=u;this.collisionVisibility?f|=d:f&=~d,this._pack(f,l,c)}e.vertexWriteRegion(this._packedU32View)}pack(e,t){for(let n of this._spec.standardAttributes)if(n.pack&&typeof n.pack!=`string`){let r=n.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++)this._pack(r,n,e*this._spec.stride)}else if(n.packAlternating?.pack){let r=n.packAlternating.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++){let t=r[e];this._pack(t,n,e*this._spec.stride)}}}_packPosition(n,r,i){let{offset:a}=this._spec.position,o=this._spec.position.packPrecisionFactor??1,s=t(n*o),c=t(r*o),l=e(s,c);this._dataView.setUint32(i+a,l,!0)}_packId(e,t){let n=e*(this._spec.id.packPrecisionFactor??1),r=this._dataView.getUint32(t+this._spec.id.offset,!0)&4278190080;this._dataView.setUint32(t+this._spec.id.offset,n|r,!0)}_pack(e,t,n){i(this._dataView,e,t,n)}}export{o as MeshWriterVertexPack};
2
+ import{i1616to32 as e,i16 as t}from"../../../number.js";import{AlignedVertexSpec as n}from"./AlignedVertexSpec.js";import{unpackDataView as r,packDataView as i}from"./dataViewUtils.js";import{bitsetGenericLabelInstance as a}from"../shaders/constants.js";class o{static fromVertexSpec(e,t){let r=n.fromVertexSpec(e,t);return new o(r)}constructor(e){this._spec=e,this.collisionVisibility=!1,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,t,n,i,o,s){for(let e=0;e<this._spec.packVertexCount;e++){let c=e*this._spec.stride;this._packPosition(n,i,c),this._packId(this.collisionVisibility?0:t,c);let l=this._spec.bitset;if(s){if(l.packTessellation){let e=l.packTessellation(s,o,n,i);this._pack(e,l,c)}for(let e of this._spec.standardAttributes)if(e.packTessellation!=null){let t=e.packTessellation(s,o,n,i);this._pack(t,e,c)}else if(e.packAlternating?.packTessellation){let t=e.packAlternating.packTessellation(s,o,n,i);for(let n=0;n<this._spec.packVertexCount;n++){let r=t[n];this._pack(r,e,n*this._spec.stride)}}}let u=r(this._dataView,l,c),d=1<<a,f=u;this.collisionVisibility?f|=d:f&=~d,this._pack(f,l,c)}e.vertexWriteRegion(this._packedU32View)}pack(e,t){for(let n of this._spec.standardAttributes)if(n.pack&&typeof n.pack!=`string`){let r=n.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++)this._pack(r,n,e*this._spec.stride)}else if(n.packAlternating?.pack){let r=n.packAlternating.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++){let t=r[e];this._pack(t,n,e*this._spec.stride)}}}_packPosition(n,r,i){let{offset:a}=this._spec.position,o=this._spec.position.packPrecisionFactor??1,s=t(n*o),c=t(r*o),l=e(s,c);this._dataView.setUint32(i+a,l,!0)}_packId(e,t){let n=e*(this._spec.id.packPrecisionFactor??1),r=this._dataView.getUint32(t+this._spec.id.offset,!0)&4278190080;this._dataView.setUint32(t+this._spec.id.offset,n|r,!0)}_pack(e,t,n){i(this._dataView,e,t,n)}}export{o as MeshWriterVertexPack};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}get batching(){return has(`featurelayer-strict-draw-order`)?1:has(`featurelayer-force-marker-text-draw-order`)?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e+=this.labelStore.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw Error(`InternalError: DeconflictionInfo not defined. Was update called?`);return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this.labelStore.upload(e.context),this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(let{tileId:t,version:n}of e.subscribe){if(!this._subscriptions.has(t)){let e=new g(t,n);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=n}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&=(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),!1),this._lockStatisticUpdates=!1;for(let e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate){this._pendingLevelUpdate.messages.push(e);return}return this._applyMessage(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null){for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);return}super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has(`esri-2d-update-debug`)&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ as FeatureContainer};
2
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}get batching(){return has(`featurelayer-strict-draw-order`)?1:has(`featurelayer-force-marker-text-draw-order`)?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e+=this.labelStore.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw Error(`InternalError: DeconflictionInfo not defined. Was update called?`);return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this.labelStore.upload(e.context),this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(let{tileId:t,version:n}of e.subscribe){if(!this._subscriptions.has(t)){let e=new g(t,n);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=n}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&=(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),!1),this._lockStatisticUpdates=!1;for(let e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate){this._pendingLevelUpdate.messages.push(e);return}return this._applyMessage(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null){for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);return}super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads(),this.hasLabels&&(this.labelStore.invalidateColliders(),this.requestDeclutter()),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has(`esri-2d-update-debug`)&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ as FeatureContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(e.valueExpression===`$view.scale`?n:t,e,n)}function a(e,t,n){return e+(i(t.minSize,e,n)||t.minDataValue)}function o(e,t,n){let r=e.stops,a=r?.length&&r[0].size;return a??=e.minSize,i(a,t,n)}function s(e,t,n){let r=t.minDataValue,a=t.maxDataValue,o=(e-r)/(a-r),s=i(t.minSize,e,n),c=i(t.maxSize,e,n);return e<=r?s:e>=a?c:s+o*(c-s)}function c(t,n,r){let a=t/n.minDataValue,o=i(n.minSize,t,r),s=i(n.maxSize,t,r),c=null;return c=a*o,e(c,o,s)}function l(e,t,n){let[r,a,o]=d(e,t.cache.ipData);if(r===a)return i(t.stops[r].size,e,n);{let s=i(t.stops[r].size,e,n);return s+(i(t.stops[a].size,e,n)-s)*o}}function u(e,r){let i=t[r.valueUnit],{valueRepresentation:a}=r,o=null;return o=a===`area`?2*Math.sqrt(e/n)/i:a===`radius`||a===`distance`?2*e/i:e/i,o}function d(e,t){if(!t)return;let n=0,r=t.length-1;return t.some((t,i)=>e<t?(r=i,!0):(n=i,!1)),[n,r,(e-t[n])/(t[r]-t[n])]}export{r as getSizeForValueSimple};
2
+ import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.valueExpression===`$view.scale`&&(e=n),t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(t,e,n)}function a(e,t,n){return e+(i(t.minSize,e,n)||t.minDataValue)}function o(e,t,n){let r=e.stops,a=r?.length&&r[0].size;return a??=e.minSize,i(a,t,n)}function s(e,t,n){let r=t.minDataValue,a=t.maxDataValue,o=(e-r)/(a-r),s=i(t.minSize,e,n),c=i(t.maxSize,e,n);return e<=r?s:e>=a?c:s+o*(c-s)}function c(t,n,r){let a=t/n.minDataValue,o=i(n.minSize,t,r),s=i(n.maxSize,t,r),c=null;return c=a*o,e(c,o,s)}function l(e,t,n){let[r,a,o]=d(e,t.cache.ipData);if(r===a)return i(t.stops[r].size,e,n);{let s=i(t.stops[r].size,e,n);return s+(i(t.stops[a].size,e,n)-s)*o}}function u(e,r){let i=t[r.valueUnit],{valueRepresentation:a}=r,o=null;return o=a===`area`?2*Math.sqrt(e/n)/i:a===`radius`||a===`distance`?2*e/i:e/i,o}function d(e,t){if(!t)return;let n=0,r=t.length-1;return t.some((t,i)=>e<t?(r=i,!0):(n=i,!1)),[n,r,(e-t[n])/(t[r]-t[n])]}export{r as getSizeForValueSimple};
@@ -64,8 +64,19 @@ export default class SunLighting extends SunLightingSuperclass {
64
64
  get date(): Date;
65
65
  set date(value: (Date | number | string));
66
66
  /**
67
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
68
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
67
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
68
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
69
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
70
+ *
71
+ * <figure>
72
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
73
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
74
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
75
+ * </figure>
76
+ *
77
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
78
+ *
79
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
69
80
  *
70
81
  * **Known limitations**
71
82
  *
@@ -74,8 +85,10 @@ export default class SunLighting extends SunLightingSuperclass {
74
85
  * - May produce temporarily noisy lighting after camera or scene changes.
75
86
  * - May reduce rendering performance.
76
87
  *
88
+ * @default false
77
89
  * @beta
78
90
  * @since 5.2
91
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
79
92
  */
80
93
  accessor globalIllumination: boolean;
81
94
  /** Indicates that the light source is simulated position of the sun. */
@@ -42,8 +42,19 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
42
42
  export default class VirtualLighting extends VirtualLightingSuperclass {
43
43
  constructor(properties?: VirtualLightingProperties);
44
44
  /**
45
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
46
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
45
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
46
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
47
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
48
+ *
49
+ * <figure>
50
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
51
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
52
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
53
+ * </figure>
54
+ *
55
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
56
+ *
57
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
47
58
  *
48
59
  * **Known limitations**
49
60
  *
@@ -52,8 +63,10 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
52
63
  * - May produce temporarily noisy lighting after camera or scene changes.
53
64
  * - May reduce rendering performance.
54
65
  *
66
+ * @default false
55
67
  * @beta
56
68
  * @since 5.2
69
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
57
70
  */
58
71
  accessor globalIllumination: boolean;
59
72
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as ge}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as E,screenToRenderPlaneFromEvent as _e,convertToMapCoordinates as ve}from"../dragEventPipeline3D.js";import{orientation as ye}from"../geometryUtils.js";import{canMoveZOperations as D}from"../manipulatorUtils.js";import{Settings as be}from"../settings.js";import{createVisualElements as xe}from"../visualElementUtils.js";import{discRadiusSmall as Se}from"../manipulations/config.js";import{MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Ce}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as k,createEdgeOffsetIntersectionPlane as A,createEdgeOffsetOperation as j,edgeOffsetRotationMatrix as we,screenEdgeLengthSquared as Te,getDistanceInGeometrySR as Ee}from"./edgeOffsetUtils.js";import{createTooltipInfos as De,connectTooltipToManipulatedObject as Oe,getUpdatedTranslateObjectTooltipInfo as ke,getUpdatedEdgeOffsetTooltipInfo as M}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as Ae}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as F}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as I,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Me}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Ne,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Pe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),Fe=Symbol(),G=Symbol();let K=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(G)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new be({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Pe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=De(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Ne(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),Oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Me.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(G),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),(!this._operations||this._segmentLabels?.context?.editGeometryOperations!==this._operations)&&(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(!e.manipulator.grabbing&&(!i||e.manipulator.selected)&&r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],G)}_showReshapeControls(){this.removeHandles(G)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Ce({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new O({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&D(t.operations,t.elevationInfo),snapToScene:!1,radius:O.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(I(this.view,e,t.graphic??void 0)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Fe),e&&this.addHandles(Ae({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Fe)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=xe({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof N?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=P(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=P(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?k(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Te(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=A(this.view,e.manipulator.elevationAlignedLocation,j(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:we(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(E(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(_e(this.view)).next(ve(this.view,n.data.spatialReference)).next(L()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,s=j(n.data.coordinateHelper,e.handle,t),c=n.createUndoGroup(),u=A(i,e.manipulator.elevationAlignedLocation,s);this._splitEdgesBeforeEdgeOffset(e,s),this._selectEdgeOffsetArrow(e,s);let d,f=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),d=l(d)},p=this.events.on(`undo`,f);return d=o([this._initializeEdgeOffsetVisualElement(e,a,t,n),c,p,this._connectEdgeOffsetTooltip(e,s,n,()=>{r.execute({action:`cancel`})})]),{initializeStep:e=>s==null||u==null?(f(),null):{...e,operation:s,plane:u},cleanup:f}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new N({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>this.destroyed||t.operation==null||!this._operations?t:(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t)),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Le){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Le){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=j(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(i),this._exitEdgeOffsetInputMode()})],i)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??k(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Ee(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):E(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(I(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),!this.destroyed&&this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)if(a.type===`vertex`){if(!a.manipulator.selected){n=!0;continue}t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)}let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&D(this._operations,a.elevationInfo),this._moveManipulation.angle=ye(o),this._moveManipulation.radius=O.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&D(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=q(t,e):a&&(n=q(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=Se}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===F.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===F.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=ke(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=M(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?M(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],K.prototype,`_numGrabbing`,void 0),e([g()],K.prototype,`_numDragging`,void 0),e([g()],K.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],K.prototype,`_operations`,null),e([g()],K.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],K.prototype,`tool`,void 0),e([g()],K.prototype,`tooltip`,void 0),e([g()],K.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],K.prototype,`updating`,null),e([g()],K.prototype,`manipulators`,null),e([g()],K.prototype,`view`,null),e([g()],K.prototype,`object`,null),e([g()],K.prototype,`enableZShape`,null),e([g()],K.prototype,`enableDeleteVertices`,null),e([g()],K.prototype,`enableZVertex`,null),e([g()],K.prototype,`autoHideManipulators`,null),e([g()],K.prototype,`enableMoveObject`,null),e([g()],K.prototype,`enableMidpoints`,null),e([g()],K.prototype,`enableEdgeOffset`,null),e([g()],K.prototype,`_toolOptions`,null),e([g()],K.prototype,`_accentColor`,null),e([g()],K.prototype,`_tooltipsContext`,null),K=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],K);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function q(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Le=1e-6,Q=16,$=32;export{K as ReshapeOperation};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as E}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as D,screenToRenderPlaneFromEvent as ge,convertToMapCoordinates as _e}from"../dragEventPipeline3D.js";import{orientation as ve}from"../geometryUtils.js";import{canMoveZOperations as O}from"../manipulatorUtils.js";import{Settings as ye}from"../settings.js";import{createVisualElements as be}from"../visualElementUtils.js";import{discRadiusSmall as xe}from"../manipulations/config.js";import{MoveManipulation as k}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Se}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as Ce,createEdgeOffsetIntersectionPlane as we,createEdgeOffsetOperation as A,edgeOffsetRotationMatrix as Te,screenEdgeLengthSquared as Ee,getDistanceInGeometrySR as De}from"./edgeOffsetUtils.js";import{createTooltipInfos as Oe,connectTooltipToManipulatedObject as ke,getUpdatedTranslateObjectTooltipInfo as Ae,getUpdatedEdgeOffsetTooltipInfo as j}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as M}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as je}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as N}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as P}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as F,addMapDelta as I,createManipulatorDragEventPipeline as L,dragAtLocation as R,addScreenDelta as Me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Ne}from"../../../../interactive/keybindings.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Pe,enterInputModeIfAvailable as V}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Fe}from"../../../../support/GeometryWorkerHandle.js";const H=Symbol(),U=Symbol(),W=Symbol(),G=Symbol(),K=Symbol();let q=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(K)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new ye({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Fe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=Oe(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Pe(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),ke(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Ne.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):V(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(U),this.removeHandles(K),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._pendingEdgeOffsetInfo&&this._exitEdgeOffsetInputMode()}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),(!this._operations||this._segmentLabels?.context?.editGeometryOperations!==this._operations)&&(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(!e.manipulator.grabbing&&(!i||e.manipulator.selected)&&r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],K)}_showReshapeControls(){this.removeHandles(K)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(U),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],U))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(H):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,H)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Se({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new k({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&O(t.operations,t.elevationInfo),snapToScene:!1,radius:k.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=B({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(F(this.view,e,t.graphic??void 0)).next(...l).next(I()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(G),e&&this.addHandles(je({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),G)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=be({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof M?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=N(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=N(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),L(_,this._createEdgeOffsetPipeline(y,t,r)),L(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?Ce(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Ee(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=we(this.view,e.manipulator.elevationAlignedLocation,A(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:Te(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(R(this.view,s)).next(D(this.view,s,t,o,e)).next(Me()).next(I()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(R(this.view,r.elevationAlignedLocation)).next(s).next(ge(this.view)).next(_e(this.view,n.data.spatialReference)).next(I()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,o=A(n.data.coordinateHelper,e.handle,t),s=n.createUndoGroup(),c=we(i,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let l=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),this.removeHandles(W)},u=this.events.on(`undo`,l);return this.addHandles([this._initializeEdgeOffsetVisualElement(e,a,t,n),s,u,this._connectEdgeOffsetTooltip(e,o,n,()=>{r.execute({action:`cancel`})})],W),{initializeStep:e=>o==null||c==null?(l(),null):{...e,operation:o,plane:c},cleanup:l}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new M({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>this.destroyed||t.operation==null||!this._operations?t:(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t)),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Re){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Re){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&V(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=A(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(W),this._exitEdgeOffsetInputMode()})],W)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??Ce(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,De(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=L(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=B({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):D(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(R(r,f)).next(h).next(F(r,t,p)).next(...u).next(I()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),!this.destroyed&&this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(U),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)if(a.type===`vertex`){if(!a.manipulator.selected){n=!0;continue}t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)}let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&O(this._operations,a.elevationInfo),this._moveManipulation.angle=ve(o),this._moveManipulation.radius=k.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&O(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=Le(t,e):a&&(n=Le(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=xe}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===P.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===P.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=Ae(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=j(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?j(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],q.prototype,`_numGrabbing`,void 0),e([g()],q.prototype,`_numDragging`,void 0),e([g()],q.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],q.prototype,`_operations`,null),e([g()],q.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],q.prototype,`tool`,void 0),e([g()],q.prototype,`tooltip`,void 0),e([g()],q.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],q.prototype,`updating`,null),e([g()],q.prototype,`manipulators`,null),e([g()],q.prototype,`view`,null),e([g()],q.prototype,`object`,null),e([g()],q.prototype,`enableZShape`,null),e([g()],q.prototype,`enableDeleteVertices`,null),e([g()],q.prototype,`enableZVertex`,null),e([g()],q.prototype,`autoHideManipulators`,null),e([g()],q.prototype,`enableMoveObject`,null),e([g()],q.prototype,`enableMidpoints`,null),e([g()],q.prototype,`enableEdgeOffset`,null),e([g()],q.prototype,`_toolOptions`,null),e([g()],q.prototype,`_accentColor`,null),e([g()],q.prototype,`_tooltipsContext`,null),q=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],q);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function Le(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Re=1e-6,Q=16,$=32;export{q as ReshapeOperation};