@arcgis/core 4.24.0-next.20220521 → 4.24.0-next.20220525

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 (509) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0ad179f4332d5242cc5f.js +1 -0
  4. package/assets/esri/core/workers/chunks/{d63f736b3560c577a8a4.js → 112b851bc61ae59fb558.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{9d738aab0d907cd09a9d.js → 1f4ba2fd71425b875eb4.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8cd8dad8bcd5c0ef445e.js → 222d51ad2b897188363c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/4e982d988c343d71c35e.js +1 -0
  8. package/assets/esri/core/workers/chunks/{ab2a0480dc2b608deda3.js → 51b0bcd367a563512cbb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{18b4f015e1d6be7a8965.js → 5242c9badca17ba2ab25.js} +1 -1
  10. package/assets/esri/core/workers/chunks/525b24097af208a100da.js +1 -0
  11. package/assets/esri/core/workers/chunks/533d190f63c31246f3fb.js +1 -0
  12. package/assets/esri/core/workers/chunks/58b39f18cd0c6579e2fd.js +1 -0
  13. package/assets/esri/core/workers/chunks/5bfd11944c4bd19f50fb.js +1 -0
  14. package/assets/esri/core/workers/chunks/660abe7152e55e2bf39c.js +1 -0
  15. package/assets/esri/core/workers/chunks/{7391422fc51acb96a25d.js → 7727b55b4198eb5d5037.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3c8c020d9e723888352b.js → 7f4c1c67551584bb9f0f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/8bc3129cd2bd85dfd7e3.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b597c04a4abb98e29d1c.js → 9391126baab105086d1d.js} +1 -1
  19. package/assets/esri/core/workers/chunks/9b4159f2e4150414b594.js +1 -0
  20. package/assets/esri/core/workers/chunks/a595e1026c3f7b905b00.js +1 -0
  21. package/assets/esri/core/workers/chunks/{b362d1ae9a87397ce2c5.js → aa40e324e59038c2f123.js} +1 -1
  22. package/assets/esri/core/workers/chunks/b86c18b188955aa7f48f.js +1 -0
  23. package/assets/esri/core/workers/chunks/be78dd8dbb8d8149d27a.js +1 -0
  24. package/assets/esri/core/workers/chunks/{7cf3cff7b28ff007dbad.js → d29751b88b6bd05e9c9b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/d8a355386a75adb29980.js +1 -0
  26. package/assets/esri/core/workers/chunks/ddf3cbca19a02d085b1d.js +1 -0
  27. package/assets/esri/core/workers/chunks/e47d24c5b9ff34393dbf.js +1 -0
  28. package/assets/esri/core/workers/chunks/eb20148c756ff919bbbf.js +1 -0
  29. package/assets/esri/core/workers/chunks/{2f4a8eff11d263fa798a.js → f5d10ea7b8888f822b0c.js} +1 -1
  30. package/assets/esri/themes/base/_core.scss +0 -2
  31. package/assets/esri/themes/base/widgets/_Editor.scss +4 -3
  32. package/assets/esri/themes/dark/main.css +1 -1
  33. package/assets/esri/themes/light/main.css +1 -1
  34. package/assets/esri/themes/light/view.css +1 -1
  35. package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
  36. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  37. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  38. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  39. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  40. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  41. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  42. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  43. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  44. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
  45. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  46. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  47. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  48. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  49. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  50. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  51. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  52. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  53. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  54. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  55. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  56. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  57. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  58. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nb.json +1 -1
  59. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  60. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  61. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  62. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  63. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  64. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  65. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  66. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  67. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  68. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  69. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  70. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  71. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  72. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  73. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  74. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  75. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  76. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  77. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  78. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  79. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  80. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  81. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  82. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  83. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  84. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  98. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  99. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  100. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  101. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  102. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  103. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  104. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  105. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  106. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  107. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  108. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  109. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  110. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  111. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  112. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  113. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  114. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  115. package/assets/esri/widgets/Daylight/t9n/Daylight.json +1 -1
  116. package/assets/esri/widgets/Daylight/t9n/Daylight_ar.json +1 -1
  117. package/assets/esri/widgets/Daylight/t9n/Daylight_bg.json +1 -1
  118. package/assets/esri/widgets/Daylight/t9n/Daylight_bs.json +1 -1
  119. package/assets/esri/widgets/Daylight/t9n/Daylight_ca.json +1 -1
  120. package/assets/esri/widgets/Daylight/t9n/Daylight_cs.json +1 -1
  121. package/assets/esri/widgets/Daylight/t9n/Daylight_da.json +1 -1
  122. package/assets/esri/widgets/Daylight/t9n/Daylight_de.json +1 -1
  123. package/assets/esri/widgets/Daylight/t9n/Daylight_el.json +1 -1
  124. package/assets/esri/widgets/Daylight/t9n/Daylight_en.json +1 -1
  125. package/assets/esri/widgets/Daylight/t9n/Daylight_es.json +1 -1
  126. package/assets/esri/widgets/Daylight/t9n/Daylight_et.json +1 -1
  127. package/assets/esri/widgets/Daylight/t9n/Daylight_fi.json +1 -1
  128. package/assets/esri/widgets/Daylight/t9n/Daylight_fr.json +1 -1
  129. package/assets/esri/widgets/Daylight/t9n/Daylight_he.json +1 -1
  130. package/assets/esri/widgets/Daylight/t9n/Daylight_hr.json +1 -1
  131. package/assets/esri/widgets/Daylight/t9n/Daylight_hu.json +1 -1
  132. package/assets/esri/widgets/Daylight/t9n/Daylight_id.json +1 -1
  133. package/assets/esri/widgets/Daylight/t9n/Daylight_it.json +1 -1
  134. package/assets/esri/widgets/Daylight/t9n/Daylight_ja.json +1 -1
  135. package/assets/esri/widgets/Daylight/t9n/Daylight_ko.json +1 -1
  136. package/assets/esri/widgets/Daylight/t9n/Daylight_lt.json +1 -1
  137. package/assets/esri/widgets/Daylight/t9n/Daylight_lv.json +1 -1
  138. package/assets/esri/widgets/Daylight/t9n/Daylight_nb.json +1 -1
  139. package/assets/esri/widgets/Daylight/t9n/Daylight_nl.json +1 -1
  140. package/assets/esri/widgets/Daylight/t9n/Daylight_pl.json +1 -1
  141. package/assets/esri/widgets/Daylight/t9n/Daylight_pt-BR.json +1 -1
  142. package/assets/esri/widgets/Daylight/t9n/Daylight_pt-PT.json +1 -1
  143. package/assets/esri/widgets/Daylight/t9n/Daylight_ro.json +1 -1
  144. package/assets/esri/widgets/Daylight/t9n/Daylight_ru.json +1 -1
  145. package/assets/esri/widgets/Daylight/t9n/Daylight_sk.json +1 -1
  146. package/assets/esri/widgets/Daylight/t9n/Daylight_sl.json +1 -1
  147. package/assets/esri/widgets/Daylight/t9n/Daylight_sr.json +1 -1
  148. package/assets/esri/widgets/Daylight/t9n/Daylight_sv.json +1 -1
  149. package/assets/esri/widgets/Daylight/t9n/Daylight_th.json +1 -1
  150. package/assets/esri/widgets/Daylight/t9n/Daylight_tr.json +1 -1
  151. package/assets/esri/widgets/Daylight/t9n/Daylight_uk.json +1 -1
  152. package/assets/esri/widgets/Daylight/t9n/Daylight_vi.json +1 -1
  153. package/assets/esri/widgets/Daylight/t9n/Daylight_zh-CN.json +1 -1
  154. package/assets/esri/widgets/Daylight/t9n/Daylight_zh-HK.json +1 -1
  155. package/assets/esri/widgets/Daylight/t9n/Daylight_zh-TW.json +1 -1
  156. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  157. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  158. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  159. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  160. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  161. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  162. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  163. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  164. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  165. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  166. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  167. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  168. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  169. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  170. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  171. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  172. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  173. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  174. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  175. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  176. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  177. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  178. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  179. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  180. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  181. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  182. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  183. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  184. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  185. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  186. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  187. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  188. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  189. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  190. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  191. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  192. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  193. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  194. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  195. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  196. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  197. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  198. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  199. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  200. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  201. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  202. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  203. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  204. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  205. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  206. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  207. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  208. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  209. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  210. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  211. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  212. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  213. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  214. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  215. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  216. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  217. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  218. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  219. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  220. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  221. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  222. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  223. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  224. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  225. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  226. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  227. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  228. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  229. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  230. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  231. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  232. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  233. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  234. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  235. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  236. package/chunks/Heatmap.glsl.js +7 -11
  237. package/chunks/HeatmapDensity.glsl.js +7 -20
  238. package/chunks/Terrain.glsl.js +38 -41
  239. package/chunks/geometryEngineBase.js +1 -1
  240. package/core/Identifiable.js +1 -1
  241. package/core/accessorSupport/originUtils.js +1 -1
  242. package/core/accessorSupport/watch.js +1 -1
  243. package/core/has.js +1 -1
  244. package/core/lang.js +1 -1
  245. package/core/maybe.js +1 -1
  246. package/core/scheduling.js +1 -1
  247. package/core/watchUtils.js +1 -1
  248. package/geometry/projection.js +1 -1
  249. package/geometry/support/aaBoundingRect.js +1 -1
  250. package/interfaces.d.ts +762 -234
  251. package/layers/ImageryTileLayer.js +1 -1
  252. package/layers/TileLayer.js +1 -1
  253. package/layers/VectorTileLayer.js +1 -1
  254. package/layers/WMSLayer.js +1 -1
  255. package/layers/WMTSLayer.js +1 -1
  256. package/layers/WebTileLayer.js +1 -1
  257. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  258. package/layers/graphics/controllers/StreamController.js +1 -1
  259. package/layers/mixins/ArcGISImageService.js +1 -1
  260. package/layers/mixins/ImageryTileMixin.js +1 -1
  261. package/layers/support/ImageElement.js +1 -1
  262. package/layers/support/LocalMediaElementSource.js +1 -1
  263. package/layers/support/VideoElement.d.ts +4 -0
  264. package/layers/support/VideoElement.js +5 -0
  265. package/layers/support/imageryRendererUtils.js +1 -1
  266. package/networks/UtilityNetwork.js +1 -1
  267. package/package.json +1 -1
  268. package/portal/schemas/definitions.js +1 -1
  269. package/renderers/HeatmapRenderer.js +1 -1
  270. package/renderers/support/HeatmapColorStop.js +1 -1
  271. package/renderers/support/heatmapUtils.js +1 -1
  272. package/renderers/support/types.js +1 -1
  273. package/smartMapping/renderers/heatmap.js +1 -1
  274. package/smartMapping/statistics/heatmapStatistics.js +1 -1
  275. package/smartMapping/statistics/support/statsWorker.js +1 -1
  276. package/smartMapping/statistics/support/utils.js +1 -1
  277. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  278. package/support/revision.js +1 -1
  279. package/views/2d/PaddedViewState.js +1 -1
  280. package/views/2d/engine/webgl/Overlay.js +1 -1
  281. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  282. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  283. package/views/2d/engine/webgl/enums.js +1 -1
  284. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  285. package/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js +1 -1
  286. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  287. package/views/2d/layers/MediaLayerView2D.js +1 -1
  288. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  289. package/views/2d/layers/features/schemaUtils.js +1 -1
  290. package/views/2d/layers/features/support/pixelBuffering.js +1 -1
  291. package/views/2d/layers/features/support/rendererUtils.js +1 -1
  292. package/views/2d/layers/features/tileRenderers/HeatmapTileRenderer.js +1 -1
  293. package/views/2d/layers/features/tileRenderers/support/HeatmapSource.js +1 -1
  294. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  295. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  296. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  297. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  298. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  299. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  300. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  301. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  302. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  303. package/views/3d/environment/CloudsGenerator.js +1 -1
  304. package/views/3d/environment/CloudyWeather.js +1 -1
  305. package/views/3d/environment/FoggyWeather.js +1 -1
  306. package/views/3d/environment/RainyWeather.js +1 -1
  307. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  308. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  309. package/views/3d/environment/SnowyWeather.js +1 -1
  310. package/views/3d/environment/Stars.js +1 -1
  311. package/views/3d/environment/SunLighting.js +1 -1
  312. package/views/3d/environment/SunnyWeather.js +1 -1
  313. package/views/3d/environment/VirtualLighting.js +1 -1
  314. package/views/3d/environment/weather.js +1 -1
  315. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  316. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  317. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  318. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  319. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  320. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  321. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  322. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  323. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  324. package/views/3d/layers/MediaLayerView3D.js +1 -1
  325. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  326. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  327. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  328. package/views/3d/state/ConstraintsManager.js +1 -1
  329. package/views/3d/state/ViewStateManager.js +1 -1
  330. package/views/3d/terrain/GeometryState.js +1 -1
  331. package/views/3d/terrain/OverlayManager.js +1 -1
  332. package/views/3d/terrain/PatchGeometry.js +1 -1
  333. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  334. package/views/3d/terrain/PatchGeometryLUT.js +5 -0
  335. package/views/3d/terrain/PatchRenderData.js +1 -1
  336. package/views/3d/terrain/PlanarPatch.js +1 -1
  337. package/views/3d/terrain/SphericalPatch.js +1 -1
  338. package/views/3d/terrain/TerrainConst.js +1 -1
  339. package/views/3d/terrain/TerrainRenderer.js +1 -1
  340. package/views/3d/terrain/TerrainSurface.js +1 -1
  341. package/views/3d/terrain/Tile.js +1 -1
  342. package/views/3d/terrain/TileCompositor.js +1 -1
  343. package/views/3d/terrain/terrainUtils.js +1 -1
  344. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  345. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js +5 -0
  346. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  347. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  348. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  349. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  350. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  351. package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +1 -1
  352. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  353. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  354. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  355. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  356. package/views/SceneView.js +1 -1
  357. package/views/analysis/analysisViewUtils.js +1 -1
  358. package/views/draw/DrawAction.js +1 -1
  359. package/views/draw/DrawOperation.js +1 -1
  360. package/views/draw/SegmentDrawAction.js +1 -1
  361. package/views/interactive/GraphicManipulator.js +1 -1
  362. package/views/interactive/InteractiveToolBase.js +1 -1
  363. package/views/interactive/SegmentLabels.js +1 -1
  364. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  365. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  366. package/views/interactive/sketch/SketchLabelOptions.d.ts +4 -0
  367. package/views/interactive/sketch/SketchLabelOptions.js +5 -0
  368. package/views/interactive/sketch/SketchTooltipOptions.d.ts +4 -0
  369. package/views/interactive/sketch/SketchTooltipOptions.js +5 -0
  370. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  371. package/views/interactive/snapping/SceneSnappingManagerPool.js +5 -0
  372. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  373. package/views/interactive/snapping/SnappingManager.js +1 -1
  374. package/views/interactive/snapping/SnappingOperation.js +5 -0
  375. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  376. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +1 -1
  377. package/views/interactive/support/viewUtils.js +1 -1
  378. package/views/interactive/tooltip/DrawTooltipInfos.js +1 -1
  379. package/views/interactive/tooltip/ExtentTooltipInfos.js +1 -1
  380. package/views/interactive/tooltip/ReshapeTooltipInfos.js +1 -1
  381. package/views/interactive/tooltip/SketchTooltipInfo.js +5 -0
  382. package/views/interactive/tooltip/Tooltip.js +1 -1
  383. package/views/interactive/tooltip/TransformTooltipInfos.js +1 -1
  384. package/views/interactive/tooltip/TranslateTooltipInfos.js +5 -0
  385. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  386. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  387. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  388. package/views/interactive/tooltip/content/TooltipContentExtentMoveZ.js +1 -1
  389. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  390. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  391. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  392. package/views/interactive/tooltip/content/TooltipContentReshapeMoveGraphic.js +5 -0
  393. package/views/interactive/tooltip/content/TooltipContentTransformAbsolute.js +1 -1
  394. package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
  395. package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
  396. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  397. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  398. package/views/overlay/TextOverlayItem.js +1 -1
  399. package/views/support/lengthMeasurementUtils.js +1 -1
  400. package/webscene/Environment.js +1 -1
  401. package/webscene/Slide.js +1 -1
  402. package/webscene/SunLighting.d.ts +4 -0
  403. package/webscene/SunLighting.js +5 -0
  404. package/webscene/VirtualLighting.d.ts +4 -0
  405. package/webscene/VirtualLighting.js +5 -0
  406. package/webscene/lightingTypes.js +5 -0
  407. package/webscene/support/SlideEnvironment.js +1 -1
  408. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  409. package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
  410. package/widgets/Daylight/DaylightViewModel.js +1 -1
  411. package/widgets/Daylight.js +1 -1
  412. package/widgets/Editor/EditorViewModel.js +1 -1
  413. package/widgets/Editor/workflowUtils.js +1 -1
  414. package/widgets/Editor.js +1 -1
  415. package/widgets/ElevationProfile.js +1 -1
  416. package/widgets/Feature/FeatureMedia.js +1 -1
  417. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  418. package/widgets/FeatureForm.js +1 -1
  419. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  420. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  421. package/widgets/LayerList/LayerListViewModel.js +1 -1
  422. package/widgets/Legend/LegendViewModel.js +1 -1
  423. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  424. package/widgets/Measurement.js +1 -1
  425. package/widgets/Popup/PopupViewModel.js +1 -1
  426. package/widgets/Popup.js +1 -1
  427. package/widgets/Print/FileLink.js +1 -1
  428. package/widgets/ScaleBar.js +1 -1
  429. package/widgets/Search/SearchViewModel.js +1 -1
  430. package/widgets/Sketch/SketchViewModel.js +1 -1
  431. package/widgets/Sketch.js +1 -1
  432. package/widgets/Swipe/SwipeViewModel.js +1 -1
  433. package/widgets/TableList/TableListViewModel.js +1 -1
  434. package/widgets/Weather.js +1 -1
  435. package/widgets/Widget.js +1 -1
  436. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  437. package/widgets/support/AnalysisViewModel.js +1 -1
  438. package/widgets/support/AnchorElementViewModel.js +1 -1
  439. package/widgets/support/tests.js +5 -0
  440. package/assets/esri/core/workers/chunks/1d109cd048170e2d529a.js +0 -1
  441. package/assets/esri/core/workers/chunks/38a752f8bd456c8912a8.js +0 -1
  442. package/assets/esri/core/workers/chunks/4487fb2d274e49bdb2b0.js +0 -1
  443. package/assets/esri/core/workers/chunks/55b2b80b9e3684feaa8e.js +0 -1
  444. package/assets/esri/core/workers/chunks/605202e3c29250650492.js +0 -1
  445. package/assets/esri/core/workers/chunks/7ea06c86adfc827fda08.js +0 -1
  446. package/assets/esri/core/workers/chunks/816ae3f0513ecf856f8f.js +0 -1
  447. package/assets/esri/core/workers/chunks/8417b3d5821b306a0fc4.js +0 -1
  448. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +0 -1
  449. package/assets/esri/core/workers/chunks/88912dbc2b60623bc6a3.js +0 -1
  450. package/assets/esri/core/workers/chunks/b97a34d2e7cceef1ac41.js +0 -1
  451. package/assets/esri/core/workers/chunks/cd04bae81e5fc27ec97b.js +0 -1
  452. package/assets/esri/core/workers/chunks/f6aaee4db0bd5096164c.js +0 -1
  453. package/assets/esri/core/workers/chunks/f9d83a48b69c5728feba.js +0 -1
  454. package/assets/esri/core/workers/chunks/fc9b5f40c5179a8c90de.js +0 -1
  455. package/assets/esri/core/workers/chunks/fe18d2d251a5ad80eb54.js +0 -1
  456. package/assets/esri/images/search/search-symbol-32.svg +0 -1
  457. package/assets/esri/themes/base/widgets/_NumericalFeedbackControls.scss +0 -23
  458. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls.json +0 -1
  459. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ar.json +0 -1
  460. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_bg.json +0 -1
  461. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_bs.json +0 -1
  462. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ca.json +0 -1
  463. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_cs.json +0 -1
  464. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_da.json +0 -1
  465. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_de.json +0 -1
  466. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_el.json +0 -1
  467. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_en.json +0 -1
  468. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_es.json +0 -1
  469. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_et.json +0 -1
  470. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_fi.json +0 -1
  471. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_fr.json +0 -1
  472. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_he.json +0 -1
  473. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_hr.json +0 -1
  474. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_hu.json +0 -1
  475. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_id.json +0 -1
  476. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_it.json +0 -1
  477. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ja.json +0 -1
  478. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ko.json +0 -1
  479. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_lt.json +0 -1
  480. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_lv.json +0 -1
  481. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_nb.json +0 -1
  482. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_nl.json +0 -1
  483. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_pl.json +0 -1
  484. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_pt-BR.json +0 -1
  485. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_pt-PT.json +0 -1
  486. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ro.json +0 -1
  487. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_ru.json +0 -1
  488. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_sk.json +0 -1
  489. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_sl.json +0 -1
  490. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_sr.json +0 -1
  491. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_sv.json +0 -1
  492. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_th.json +0 -1
  493. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_tr.json +0 -1
  494. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_uk.json +0 -1
  495. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_vi.json +0 -1
  496. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_zh-CN.json +0 -1
  497. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_zh-HK.json +0 -1
  498. package/assets/esri/widgets/support/NumericalFeedbackControls/t9n/NumericalFeedbackControls_zh-TW.json +0 -1
  499. package/views/interactive/tooltip/NumericalFeedbackOptions.d.ts +0 -4
  500. package/views/interactive/tooltip/NumericalFeedbackOptions.js +0 -5
  501. package/views/interactive/tooltip/SegmentLabelOptions.js +0 -5
  502. package/views/interactive/tooltip/TooltipOptions.js +0 -5
  503. package/views/interactive/tooltip/content/TooltipContentExtentMoveXY.js +0 -5
  504. package/webscene/Lighting.d.ts +0 -4
  505. package/webscene/Lighting.js +0 -5
  506. package/widgets/support/NumericalFeedbackControls/NumericalFeedbackControlsViewModel.js +0 -5
  507. package/widgets/support/NumericalFeedbackControls/VisibleElements.js +0 -5
  508. package/widgets/support/NumericalFeedbackControls/css.js +0 -5
  509. package/widgets/support/NumericalFeedbackControls.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as n,destroyHandle as o}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,isSome as s,isNone as l,unwrap as p,removeMaybe as h}from"../../../../../core/maybe.js";import{createLength as d}from"../../../../../core/quantityUtils.js";import{watch as u,when as c,initial as m}from"../../../../../core/reactiveUtils.js";import{createScreenPoint as g}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as _}from"../../../../../core/unitUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as M}from"../../../../../chunks/mat4f64.js";import{l as y,b as x,h as O,s as b,a as E,g as G}from"../../../../../chunks/vec3.js";import{f as S,c as V}from"../../../../../chunks/vec3f64.js";import I from"../../../../../geometry/Polyline.js";import{makeDehydratedPoint as H}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as w}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as L}from"../../../../../symbols/support/utils.js";import{Manipulator3D as A}from"../../Manipulator3D.js";import{createManipulatorMaterial as D,createManipulatorOutlineMaterial as P,placeAtGraphic as j}from"../../manipulatorUtils.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as N}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as k,convertToMapCoordinates as T,screenToMapXYAtLocation as R,screenToMapXYForGraphicAtLocation as C}from"../dragEventPipeline3D.js";import{ManipulatorType as F}from"../ManipulatorType.js";import{canMoveZ as z}from"../manipulatorUtils.js";import{settings as Z,colors as X}from"../settings.js";import{createVisualElements as Y}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as q}from"../manipulations/config.js";import{MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{shapeOrientation as K}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as B}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as J,createEdgeOffsetOperation as Q,edgeOffsetRotationMatrix as $,screenEdgeLengthSquared as ee}from"./edgeOffsetUtils.js";import{OutlineVisualElement as te}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as ie}from"../../../layers/graphics/GraphicState.js";import ae from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as ne}from"../../../../input/IViewEvents.js";import{addMapDelta as oe,createManipulatorDragEventPipeline as re,dragAtLocation as se,addScreenDelta as le}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as pe,ManipulatorStateCustomFlags as he}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as de}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as ue}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as ce}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as me}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as ge}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as _e}from"../../../../interactive/tooltip/Tooltip.js";let fe=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=D(Z.colorToVec4(Z.reshapeManipulators.vertex.color),Z.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=P(Z.colorToVec4(Z.reshapeManipulators.vertex.outlineColor),Z.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=P(Z.colorToVec4(Z.reshapeManipulators.vertex.hoverOutlineColor),Z.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=D(Z.colorToVec4(Z.reshapeManipulators.edge.color),Z.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=P(Z.colorToVec4(Z.reshapeManipulators.edge.outlineColor),Z.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=D(Z.colorToVec4(Z.reshapeManipulators.edgeOffset.color),Z.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=D(Z.colorToVec4(Z.reshapeManipulators.edgeOffset.hoverColor),Z.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=D(Z.colorToVec4(Z.reshapeManipulators.selected.color),Z.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=P(Z.colorToVec4(Z.reshapeManipulators.selected.outlineColor),Z.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=P(Z.colorToVec4(Z.reshapeManipulators.selected.hoverOutlineColor),Z.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Oe.NONE,this._outlineVisualElement=null,this._segmentLabels=null,this.outputGeometry=null,this._snappingPipeline=new me,this._snappingPipelineHandle=new me,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:e,view:t}=this,i=new ie({graphic:e});this._graphicState=i,this._tooltip=new _e({view:t}),this.own([u((()=>i.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),u((()=>this._segmentLabelsEnabled),(()=>this._updateSegmentLabelsVisibility()),m),c((()=>!this._tooltipEnabled),(()=>this._tooltip.clear()),m),this.view.trackGraphicState(i)])}destroy(){this._segmentLabels=r(this._segmentLabels),this._tooltip=r(this._tooltip),this._editGeometryOperations=r(this._editGeometryOperations),this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles=r(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _segmentLabelsEnabled(){return this.tool.feedbackOptions.labelsEnabled}get _tooltipEnabled(){return this.tool.feedbackOptions.tooltipEnabled}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=w(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),l(e)||(r(this._editGeometryOperations),this._editGeometryOperations=de.fromGeometry(e,this.view.state.viewingMode),this._createManipulators(),r(this._segmentLabels),this._segmentLabels=new U({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:w(this.graphic)}}),this._updateSegmentLabelsVisibility())}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return;let i=0;const a=[],n=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===be.SELECTED_OR_ALL&&n;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.grabbing||o&&!r.manipulator.selected||a.push(r),i++);if(0===a.length)return;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Oe.MOVING),this.destroyed)return;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Oe.RESHAPING),this.destroyed)return;this.emit("reshape",{type:"reshape",mover:this.graphic})}}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)"vertex"===t.type&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Oe.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,ue.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Oe.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Oe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Oe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Oe.MOVING:switch(this._reshapeEventState){case Oe.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Oe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case Oe.RESHAPING:switch(this._reshapeEventState){case Oe.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Oe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){if(this._graphicMoveManipulation=new B({tool:this.tool,view:this.view,graphicState:this._graphicState}),this.enableMoveGraphic){let e=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((t=>{this._perGraphicManipulatorDragAction(be.ALL,t),"end"===t.action&&(e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new W({tool:this.tool,view:this.view,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&z(this.graphic),snapToScene:!1,radius:W.radiusForSymbol(this.graphic.symbol)}),this._moveManipulation.forEachManipulator((e=>{this.handles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()}))])})),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const t=p(this.graphic.geometry).spatialReference,i=this.handles;i.add([this._moveManipulation.createDragPipeline(((t,i,a,n,o)=>{const r=a.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===F.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:n,snappingManager:this.tool.snappingManager,snappingContext:new ce({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:o,excludeFeature:this.graphic,visualizer:new N}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(oe()).next((e=>(this._perGraphicManipulatorDragAction(be.SELECTED_OR_ALL,e),e)));return n.next(this._cancelDragOperation()),r}),e,t,this.graphic),u((()=>this._graphicState?.displaying),(()=>{this._updateMoveManipulationPosition()}),m),this._graphicState.on("changed",(()=>this._updateMoveManipulationPosition())),u((()=>this._graphicState?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),m)]),this._updateMoveManipulationPosition();const a=Y({view:this.view,graphic:this.graphic,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,F.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(a)&&(this._outlineVisualElement=a.visualElement instanceof te?a.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()})),u((()=>this._graphicState.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(a)}_createEdgeOffsetManipulator(e,t=w(this.graphic)){const i=Z.reshapeManipulators.edgeOffset,a=i.size/2,o=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/o,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=ae.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=ae.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const r=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:pe.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:pe.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:pe.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:pe.Focused}],p=new A({view:this.view,renderObjects:r,elevationInfo:"on-the-ground"!==t.mode||L(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:o,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:S(0,0,1)},collisionPriority:1}),h=new A({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=this._getManipulatorInfoFromHandle(d.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))),c=this._getManipulatorInfoFromHandle(d.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d)));d.locationUpdateHandle=n([u,c]),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(re(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(re(h,((e,i,a,n)=>{if("touch"===n){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const n=this.graphic,o=s(n.geometry)?n.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(se(this.view,e.elevationAlignedLocation)).next(R(this.view,e.elevationAlignedLocation,t,o,n)).next(le()).next(oe()).next((e=>this._perGraphicManipulatorDragAction(be.ALL,e))),a.next(this._cancelDragOperation())}})),p);const m=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m),p.events.on("focus-changed",(({action:e})=>{"focus"===e&&this._tooltipEnabled?(this._tooltip.info=new ge,this._tooltip.screenPoint=g(...p.screenLocation.screenPointArray)):this._tooltip.clear()}))],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,o=()=>{h(e.visibilityHandle);const o=ee(this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||o)&&(i.grabbable=!o,a.grabbable=!o,e.visibilityHandle=n([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",o),a.events.on("focus-changed",o),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),o()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=J(this.view,e.manipulator.elevationAlignedLocation,Q(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,n=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,o=s(i)?$(i,a,n):M;e.manipulator.modelTransform=o,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=o;const r=y(x(ye,a,n))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-r,0,0],[r,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,n)=>{this._clearSelection();const{step:o,cleanup:r}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(se(this.view,i.elevationAlignedLocation)).next(o).next(k(this.view)).next(T(this.view,p(this._editGeometryOperations).data.spatialReference)).next(oe()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(e)).next(this._showEdgeOffsetTooltip(i)).next((e=>{"end"===e.action&&r()})),n.next((e=>(r(),e))).next((e=>(this._tooltip.clear(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=Q(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),s=J(this.view,e.manipulator.elevationAlignedLocation,a);a.requiresSplitEdgeLeft&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge),1),a.requiresSplitEdgeRight&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge),0);const d=()=>new I({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),c=new te({view:this.view,isDraped:this._graphicState.isDraped,geometry:d(),elevationInfo:e.elevationInfo,width:Z.visualElements.lineGraphics.outline.width,color:Z.colorToVec4(X.main),attached:!0});let m;const g=()=>{this._cleanEdgeOffsetCollapsedEdges(e),m=h(m)},_=this.on("undo",g);return m=n([o(c),u((()=>this._graphicState.isDraped),(e=>c.isDraped=e)),this._graphicState.on("changed",(()=>c.geometry=d())),r,_]),{step:e=>l(a)||l(s)?(g(),null):{...e,operation:a,plane:s},cleanup:g}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(Oe.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=t;return(i||a||n)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_applyComputeEdgeOffsetDistanceStep(){return e=>{const{operation:t,mapEnd:i}=e;if(l(t)||l(i))return e;const a=t.signedDistanceToPoint(i);return{...e,signedDistance:a}}}_showEdgeOffsetTooltip(e){return t=>{const{mapEnd:i,signedDistance:a}=t,n=this._tooltip;if(!this._tooltipEnabled||l(a))return n.clear(),t;const o=_(i.spatialReference),r=d(-a*o,"meters");return l(n.info)||"reshape-edge-offset"!==n.info.type?n.info=new ge({distance:r}):n.info.distance=r,n.screenPoint=g(...e.screenLocation.screenPointArray),t}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,n=e.handle.rightVertex,o=p(this._editGeometryOperations).data.coordinateHelper,r=1e-6,s=[];t&&o.distance(t.pos,i.pos)<r&&s.push(this._getManipulatorInfoFromHandle(i)),(o.distance(i.pos,n.pos)<r||a&&o.distance(a.pos,n.pos)<r)&&s.push(this._getManipulatorInfoFromHandle(n)),s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=w(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(Z.reshapeManipulators.vertex);this._vertexManipulatorGeometry=ae.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=ae.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(Z.reshapeManipulators.edge);this._edgeManipulatorGeometry=ae.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=ae.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:xe.Vertex|pe.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:xe.Vertex|pe.Unfocused|pe.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:xe.Vertex|pe.Focused|pe.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:pe.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:pe.Selected|pe.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:pe.Selected|pe.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:xe.Edge|pe.Focused|pe.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:xe.Edge|pe.Focused|pe.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:xe.Edge|pe.Unfocused|pe.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:xe.Edge|pe.Unfocused|pe.Unselected});const a=new A({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const o="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(o),this.manipulators.add(a),this._updateManipulatorPosition(o),"edge"===o.type){const e=this._getManipulatorInfoFromHandle(o.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(o))),t=this._getManipulatorInfoFromHandle(o.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(o)));o.locationUpdateHandle=n([e,t]),this._manipulatorHandles.add(o.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const r=re(a,((e,i,a,n)=>{let r=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(r=p(this._editGeometryOperations).createUndoGroup()),"edge"===o.type){const t=this._splitEdgeManipulator(o);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:o,snapOrigin:o.handle.pos}})).next(se(this.view,e.elevationAlignedLocation)).next(C(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new ce({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:n,excludeFeature:this.graphic,visualizer:new N}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(oe()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r))})),a.next(this._cancelDragOperation((()=>r=h(r))))}));return this._manipulatorHandles.add([r,a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,o))),a.events.on("select-changed",(()=>{o.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),a.events.on("focus-changed",(()=>this._updateSegmentLabelsVisibility()))],a),this.emit("manipulators-changed"),o}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_updateSegmentLabelsVisibility(){l(this._segmentLabels)||(this._segmentLabels.visible=this._segmentLabelsEnabled&&!this._manipulatorInfos.some((e=>"edge"===e.type&&e.manipulator.focused)))}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._reshapeEventState){case Oe.NONE:break;case Oe.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Oe.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Oe.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=xe.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=Z.reshapeManipulators.vertex.size/2+Z.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=xe.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=Z.reshapeManipulators.edge.size/2+Z.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||L(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{if("start"===i.action)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Oe.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==i.pointerType||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>e.interactive=!this._numGrabbing)))}))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){e&&(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(!e)return;const t=p(this._editGeometryOperations);if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Me),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator,a=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const n=i.location,o=a.location,r=.5,s=n.x+r*(o.x-n.x),l=n.y+r*(o.y-n.y),p=n.hasZ&&o.hasZ?0:void 0;e.manipulator.location=H(s,l,p,t.data.spatialReference)}else O(ye,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=ye}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const n=w(this.graphic);let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),this._updateSegmentLabelsVisibility(),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(o),this._updateSelection(e.manipulator);const r=this._updateEventState(Oe.RESHAPING),s=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),r&&this._updateEventState(Oe.NONE),o}_updateMoveManipulationPosition(){const e=b(ye,0,0,0);let t=0,i=!1,a=null,n=null;for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected?(t++,E(e,e,o.manipulator.renderLocation),l(a)||o.selectedIndex>a.selectedIndex?(n=a,a=o):(l(n)||o.selectedIndex>n.selectedIndex)&&(n=o)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&z(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&z(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(n)?n.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=l(n)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&o?this._moveManipulation.xyAxisManipulation.available=!1:i?e=ve(i,t):o&&(e=ve(t,o))}this._moveManipulation.angle=e,this._moveManipulation.radius=q}else this._moveManipulation.angleDeferred=()=>K(p(this.graphic.geometry)),this._moveManipulation.radius=W.radiusForSymbol(this.graphic.symbol);0!==t&&i?(G(e,e,1/t),Me.spatialReference=p(this._editGeometryOperations).data.spatialReference,Me.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Me),this._moveManipulation.elevationAlignedLocation=Me):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:j(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Oe.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Oe.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?ue.NEW_STEP:ue.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const n of e)this._updateManipulatorPosition(n)}_offsetEdge(e,t){if(l(t.operation)||l(t.signedDistance))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.signedDistance,i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,e.button===ne.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===ne.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}get test(){return{segmentLabels:this._segmentLabels,tooltip:this._tooltip}}};function ve(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}e([f({constructOnly:!0})],fe.prototype,"tool",void 0),e([f()],fe.prototype,"_tooltip",void 0),e([f()],fe.prototype,"inputGeometry",null),e([f()],fe.prototype,"outputGeometry",void 0),e([f({readOnly:!0})],fe.prototype,"updating",null),e([f()],fe.prototype,"_segmentLabelsEnabled",null),e([f()],fe.prototype,"_tooltipEnabled",null),fe=e([v("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],fe);const Me=H(0,0,null,null),ye=V();var xe,Oe,be;!function(e){e.Vertex=he.Custom1,e.Edge=he.Custom2}(xe||(xe={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Oe||(Oe={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(be||(be={}));export{fe as ReshapeOperation};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as o,destroyHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,isSome as s,isNone as l,unwrap as p,removeMaybe as h}from"../../../../../core/maybe.js";import{createLength as d}from"../../../../../core/quantityUtils.js";import{watch as u,when as c,initial as m}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as g}from"../../../../../core/unitUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as v}from"../../../../../chunks/mat4f64.js";import{l as M,b as y,h as O,s as x,a as b,g as E}from"../../../../../chunks/vec3.js";import{f as G,c as S}from"../../../../../chunks/vec3f64.js";import I from"../../../../../geometry/Polyline.js";import{makeDehydratedPoint as V}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as H}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as w}from"../../../../../symbols/support/utils.js";import{Manipulator3D as A}from"../../Manipulator3D.js";import{createManipulatorMaterial as L,createManipulatorOutlineMaterial as D,placeAtGraphic as P}from"../../manipulatorUtils.js";import{SegmentLabels3D as T}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as j}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as N,convertToMapCoordinates as U,screenToMapXYAtLocation as k,screenToMapXYForGraphicAtLocation as R}from"../dragEventPipeline3D.js";import{ManipulatorType as C}from"../ManipulatorType.js";import{canMoveZ as F}from"../manipulatorUtils.js";import{settings as z,colors as Z}from"../settings.js";import{createVisualElements as X}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as Y}from"../manipulations/config.js";import{ManipulationType as q,MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{shapeOrientation as K}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as B}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as J,createEdgeOffsetOperation as Q,edgeOffsetRotationMatrix as $,screenEdgeLengthSquared as ee}from"./edgeOffsetUtils.js";import{OutlineVisualElement as te}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as ie}from"../../../layers/graphics/GraphicState.js";import ae from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as oe}from"../../../../input/IViewEvents.js";import{addMapDelta as ne,createManipulatorDragEventPipeline as re,dragAtLocation as se,addScreenDelta as le}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as pe,ManipulatorStateCustomFlags as he}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as de}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as ue}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as ce}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as me}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as ge}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as _e}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as fe,TranslateVertexZTooltipInfo as ve}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{euclideanHorizontalDistanceBetweenPoints as Me,verticalDistanceBetweenPoints as ye}from"../../../../support/lengthMeasurementUtils.js";let Oe=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=L(z.colorToVec4(z.reshapeManipulators.vertex.color),z.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=D(z.colorToVec4(z.reshapeManipulators.vertex.outlineColor),z.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=D(z.colorToVec4(z.reshapeManipulators.vertex.hoverOutlineColor),z.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=L(z.colorToVec4(z.reshapeManipulators.edge.color),z.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=D(z.colorToVec4(z.reshapeManipulators.edge.outlineColor),z.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=L(z.colorToVec4(z.reshapeManipulators.edgeOffset.color),z.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=L(z.colorToVec4(z.reshapeManipulators.edgeOffset.hoverColor),z.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=L(z.colorToVec4(z.reshapeManipulators.selected.color),z.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=D(z.colorToVec4(z.reshapeManipulators.selected.outlineColor),z.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=D(z.colorToVec4(z.reshapeManipulators.selected.hoverOutlineColor),z.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Se.NONE,this._outlineVisualElement=null,this._segmentLabels=null,this.outputGeometry=null,this._snappingPipeline=new me,this._snappingPipelineHandle=new me,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:e,view:t}=this,i=this._graphicState=new ie({graphic:e});this._tooltip=new _e({view:t}),this.own([u((()=>i.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),u((()=>this._labelOptions.enabled),(()=>this._updateSegmentLabelsVisibility()),m),c((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),m),this.view.trackGraphicState(i)])}destroy(){this._segmentLabels=r(this._segmentLabels),this._tooltip=r(this._tooltip),this._editGeometryOperations=r(this._editGeometryOperations),this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles=r(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _labelOptions(){return this.tool.labelOptions}get _tooltipOptions(){return this.tool.tooltipOptions}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=H(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),l(e)||(r(this._editGeometryOperations),this._editGeometryOperations=de.fromGeometry(e,this.view.state.viewingMode),this._createManipulators(),r(this._segmentLabels),this._segmentLabels=new T({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:H(this.graphic)}}),this._updateSegmentLabelsVisibility())}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],o=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),n=e===Ie.SELECTED_OR_ALL&&o;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.grabbing||n&&!r.manipulator.selected||a.push(r),i++);if(0===a.length)return t;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Se.MOVING),this.destroyed)return t;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Se.RESHAPING),this.destroyed)return t;this.emit("reshape",{type:"reshape",mover:this.graphic})}return t}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)"vertex"===t.type&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Se.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const o=[];for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected&&!n.manipulator.grabbing||n===e.info)&&o.push(n);this._moveVertices(o,e,ue.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Se.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Se.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Se.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Se.MOVING:switch(this._reshapeEventState){case Se.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Se.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case Se.RESHAPING:switch(this._reshapeEventState){case Se.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Se.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){const{graphic:t,handles:i,tool:a,view:o}=this,n=this._graphicState;if(this._graphicMoveManipulation=new B({tool:a,view:o,graphicState:n}),this.enableMoveGraphic){let e=null;this._graphicMoveManipulation.forEachManipulator((e=>{this._manipulatorHandles.add(e.events.on("grab-changed",(({action:e})=>{const t=this._tooltipOptions;"start"===e&&t.enabled?this._tooltip.info=new fe({tooltipOptions:t}):this._tooltip.clear()})))})),this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((e=>this._perGraphicManipulatorDragAction(Ie.ALL,e))).next((e=>this._updateMoveTooltip(e,q.XY))).next((t=>{"end"===t.action&&(e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new W({tool:a,view:o,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&F(t),snapToScene:!1,radius:W.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator(((e,a)=>{i.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(i=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()}))]),a===C.TRANSLATE_XY&&i.add(e.events.on("focus-changed",(({action:e})=>{const t=this._tooltipOptions;"focus"===e&&t.enabled?this._tooltip.info=new fe({tooltipOptions:t}):this._tooltip.clear()}))),a===C.TRANSLATE_Z&&i.add(e.events.on("focus-changed",(({action:e})=>{const t=this._tooltipOptions;"focus"===e&&t.enabled?this._tooltip.info=new ve({tooltipOptions:t}):this._tooltip.clear()})))})),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const r=p(t.geometry).spatialReference;i.add([this._moveManipulation.createDragPipeline(((i,o,n,r,s)=>{const l=n.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===C.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:r,snappingManager:a.snappingManager,snappingContext:new ce({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:s,excludeFeature:t,visualizer:new j}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(ne()).next((e=>this._perGraphicManipulatorDragAction(Ie.SELECTED_OR_ALL,e))).next((e=>this._updateMoveTooltip(e,i)));return r.next(this._cancelDragOperation()),l}),e,r,t),u((()=>n?.displaying),(()=>{this._updateMoveManipulationPosition()}),m),n.on("changed",(()=>this._updateMoveManipulationPosition())),u((()=>n?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),m)]),this._updateMoveManipulationPosition();const l=X({view:o,graphic:t,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,C.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(l)&&(this._outlineVisualElement=l.visualElement instanceof te?l.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{n.isDraped||this._updateMoveManipulationPosition()})),u((()=>n.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(l)}_createEdgeOffsetManipulator(e,t=H(this.graphic)){const i=z.reshapeManipulators.edgeOffset,a=i.size/2,n=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/n,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=ae.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=ae.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const r=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:pe.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:pe.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:pe.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:pe.Focused}],p=new A({view:this.view,renderObjects:r,elevationInfo:"on-the-ground"!==t.mode||w(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:n,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:G(0,0,1)},collisionPriority:1}),h=new A({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=this._getManipulatorInfoFromHandle(d.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))),c=this._getManipulatorInfoFromHandle(d.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d)));d.locationUpdateHandle=o([u,c]),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(re(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(re(h,((e,i,a,o)=>{if("touch"===o){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const o=this.graphic,n=s(o.geometry)?o.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(se(this.view,e.elevationAlignedLocation)).next(k(this.view,e.elevationAlignedLocation,t,n,o)).next(le()).next(ne()).next((e=>this._perGraphicManipulatorDragAction(Ie.ALL,e))),a.next(this._cancelDragOperation())}})),p);const m=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m),p.events.on("focus-changed",(({action:e})=>{const t=this._tooltipOptions;"focus"===e&&t.enabled?this._tooltip.info=new ge({tooltipOptions:t}):this._tooltip.clear()}))],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{h(e.visibilityHandle);const n=ee(this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||n)&&(i.grabbable=!n,a.grabbable=!n,e.visibilityHandle=o([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),n()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=J(this.view,e.manipulator.elevationAlignedLocation,Q(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,o=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,n=s(i)?$(i,a,o):v;e.manipulator.modelTransform=n,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=n;const r=M(y(Ee,a,o))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-r,0,0],[r,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,o)=>{this._clearSelection();const{step:n,cleanup:r}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(se(this.view,i.elevationAlignedLocation)).next(n).next(N(this.view)).next(U(this.view,p(this._editGeometryOperations).data.spatialReference)).next(ne()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(e)).next(this._showEdgeOffsetTooltip()).next((e=>{"end"===e.action&&r()})),o.next((e=>(r(),e))).next((e=>(this._tooltip.clear(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=Q(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),s=J(this.view,e.manipulator.elevationAlignedLocation,a);a.requiresSplitEdgeLeft&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge),1),a.requiresSplitEdgeRight&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge),0);const d=()=>new I({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),c=new te({view:this.view,isDraped:this._graphicState.isDraped,geometry:d(),elevationInfo:e.elevationInfo,width:z.visualElements.lineGraphics.outline.width,color:z.colorToVec4(Z.main),attached:!0});let m;const g=()=>{this._cleanEdgeOffsetCollapsedEdges(e),m=h(m)},_=this.on("undo",g);return m=o([n(c),u((()=>this._graphicState.isDraped),(e=>c.isDraped=e)),this._graphicState.on("changed",(()=>c.geometry=d())),r,_]),{step:e=>l(a)||l(s)?(g(),null):{...e,operation:a,plane:s},cleanup:g}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(Se.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:o}=t;return(i||a||o)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_applyComputeEdgeOffsetDistanceStep(){return e=>{const{operation:t,mapEnd:i}=e;if(l(t)||l(i))return e;const a=t.signedDistanceToPoint(i);return{...e,signedDistance:a}}}_showEdgeOffsetTooltip(){return e=>{const{mapEnd:t,signedDistance:i}=e,a=this._tooltip,o=this._tooltipOptions;if(!o.enabled||l(i))return a.clear(),e;const n=g(t.spatialReference),r=d(-i*n,"meters");return l(a.info)||"reshape-edge-offset"!==a.info.type?a.info=new ge({tooltipOptions:o,distance:r}):a.info.distance=r,e}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,n=p(this._editGeometryOperations).data.coordinateHelper,r=1e-6,s=[];t&&n.distance(t.pos,i.pos)<r&&s.push(this._getManipulatorInfoFromHandle(i)),(n.distance(i.pos,o.pos)<r||a&&n.distance(a.pos,o.pos)<r)&&s.push(this._getManipulatorInfoFromHandle(o)),s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=H(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(z.reshapeManipulators.vertex);this._vertexManipulatorGeometry=ae.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=ae.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(z.reshapeManipulators.edge);this._edgeManipulatorGeometry=ae.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=ae.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Ge.Vertex|pe.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:Ge.Vertex|pe.Unfocused|pe.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Ge.Vertex|pe.Focused|pe.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:pe.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:pe.Selected|pe.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:pe.Selected|pe.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Ge.Edge|pe.Focused|pe.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Ge.Edge|pe.Focused|pe.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:Ge.Edge|pe.Unfocused|pe.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:Ge.Edge|pe.Unfocused|pe.Unselected});const a=new A({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const n="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(n),this.manipulators.add(a),this._updateManipulatorPosition(n),"edge"===n.type){const e=this._getManipulatorInfoFromHandle(n.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(n))),t=this._getManipulatorInfoFromHandle(n.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(n)));n.locationUpdateHandle=o([e,t]),this._manipulatorHandles.add(n.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const r=re(a,((e,i,a,o)=>{let r=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(r=p(this._editGeometryOperations).createUndoGroup()),"edge"===n.type){const t=this._splitEdgeManipulator(n);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:n,snapOrigin:n.handle.pos}})).next(se(this.view,e.elevationAlignedLocation)).next(R(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new ce({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:o,excludeFeature:this.graphic,visualizer:new j}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(ne()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r))})),a.next(this._cancelDragOperation((()=>r=h(r))))}));return this._manipulatorHandles.add([r,a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,n))),a.events.on("select-changed",(()=>{n.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),a.events.on("focus-changed",(()=>this._updateSegmentLabelsVisibility()))],a),this.emit("manipulators-changed"),n}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_updateSegmentLabelsVisibility(){l(this._segmentLabels)||(this._segmentLabels.visible=this._labelOptions.enabled&&!this._manipulatorInfos.some((e=>"edge"===e.type&&e.manipulator.focused)))}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._reshapeEventState){case Se.NONE:break;case Se.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Se.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Se.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=Ge.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=z.reshapeManipulators.vertex.size/2+z.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=Ge.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=z.reshapeManipulators.edge.size/2+z.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||w(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{if("start"===i.action)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Se.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==i.pointerType||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>e.interactive=!this._numGrabbing)))}))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){e&&(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(!e)return;const t=p(this._editGeometryOperations);if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,be),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator,a=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const o=i.location,n=a.location,r=.5,s=o.x+r*(n.x-o.x),l=o.y+r*(n.y-o.y),p=o.hasZ&&n.hasZ?0:void 0;e.manipulator.location=V(s,l,p,t.data.spatialReference)}else O(Ee,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Ee}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const o=H(this.graphic);let n;this.enableEdgeOffset?(this._removeManipulator(e),n=this._createVertexOrEdgeManipulator(a)):(n=e,n.handle=a,n.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,o)),this._updateSegmentLabelsVisibility(),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(n),this._updateSelection(e.manipulator);const r=this._updateEventState(Se.RESHAPING),s=i.data.coordinateHelper.vectorToArray(n.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),r&&this._updateEventState(Se.NONE),n}_updateMoveManipulationPosition(){const e=x(Ee,0,0,0);let t=0,i=!1,a=null,o=null;for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected?(t++,b(e,e,n.manipulator.renderLocation),l(a)||n.selectedIndex>a.selectedIndex?(o=a,a=n):(l(o)||n.selectedIndex>o.selectedIndex)&&(o=n)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&F(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&F(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(o)?o.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,n=l(o)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&n?this._moveManipulation.xyAxisManipulation.available=!1:i?e=xe(i,t):n&&(e=xe(t,n))}this._moveManipulation.angle=e,this._moveManipulation.radius=Y}else this._moveManipulation.angleDeferred=()=>K(p(this.graphic.geometry)),this._moveManipulation.radius=W.radiusForSymbol(this.graphic.symbol);0!==t&&i?(E(e,e,1/t),be.spatialReference=p(this._editGeometryOperations).data.spatialReference,be.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,be),this._moveManipulation.elevationAlignedLocation=be):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:P(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Se.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Se.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?ue.NEW_STEP:ue.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const o of e)this._updateManipulatorPosition(o)}_offsetEdge(e,t){if(l(t.operation)||l(t.signedDistance))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.signedDistance,i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,e.button===oe.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===oe.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateMoveTooltip(e,t){const i=this._tooltipOptions;if(!i.enabled)return e;if(t===q.XY||t===q.XY_AXIS){const t=Me(e.mapStart,e.mapEnd);s(t)&&(this._tooltip.info=new fe({tooltipOptions:i,distance:t}))}if(t===q.Z){const t=ye(e.mapStart,e.mapEnd);s(t)&&(this._tooltip.info=new ve({tooltipOptions:i,distance:t}))}return e}get test(){return{segmentLabels:this._segmentLabels,tooltip:this._tooltip}}};function xe(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}e([_({constructOnly:!0})],Oe.prototype,"tool",void 0),e([_()],Oe.prototype,"_tooltip",void 0),e([_()],Oe.prototype,"inputGeometry",null),e([_()],Oe.prototype,"outputGeometry",void 0),e([_({readOnly:!0})],Oe.prototype,"updating",null),e([_()],Oe.prototype,"_labelOptions",null),e([_()],Oe.prototype,"_tooltipOptions",null),Oe=e([f("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],Oe);const be=V(0,0,null,null),Ee=S();var Ge,Se,Ie;!function(e){e.Vertex=he.Custom1,e.Edge=he.Custom2}(Ge||(Ge={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Se||(Se={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ie||(Ie={}));export{Oe as ReshapeOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as r,unwrapOr as o,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as h}from"../../../../../core/quantityUtils.js";import{watch as l,initial as c}from"../../../../../core/reactiveUtils.js";import{createScreenPoint as d,screenPointObjectToArray as u}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as m,getMetersPerUnitForSR as g}from"../../../../../core/unitUtils.js";import{property as y}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{g as f}from"../../../../../chunks/mat4.js";import{a as _,g as S,i as M}from"../../../../../chunks/vec2.js";import{a as b}from"../../../../../chunks/vec2f64.js";import{l as B,c as E,F as A,b as x,n as T,e as D}from"../../../../../chunks/vec3.js";import{c as R,a as G}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{c as O,a as w}from"../../../../../chunks/boundedPlane.js";import{intersectRay as P,create as U,normal as z}from"../../../../../geometry/support/plane.js";import{create as Z}from"../../../../../geometry/support/ray.js";import{sv2d as C,sv3d as k,sm4d as I}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as L}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as V,OffsetMode as N,IsShiftEdgeOnScreenFlag as H,createResizeManipulator as X,createRotateManipulator as Y,resizeNormal as F,resizeOutlineOnly as q,isDiagonalResizeHandle as W,calculateDiagonalResizeHandleScale as J,createRotatePlane as K,RotationAxis as Q,calculateBoundedPlaneTranslateRotate as $,updateRotateHeadingHandle as tt,updateResizeHandle as et}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as it}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as at}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as st,calculateInputRotationTransform as rt}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as nt}from"../dragEventPipeline3D.js";import{ManipulatorType as pt}from"../ManipulatorType.js";import{canMoveZ as ht}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as gt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as yt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as vt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as ft,addMapDelta as _t,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Bt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Et}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as At,mapPlaneToRenderPlane as xt,apply as Tt,unapply as Dt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{ExtentMoveXYTooltipInfo as Rt,ExtentMoveZTooltipInfo as Gt,ExtentRotateTooltipInfo as jt,ExtentScaleTooltipInfo as Ot}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import wt from"../../../../interactive/tooltip/NumericalFeedbackOptions.js";import{Tooltip as Pt}from"../../../../interactive/tooltip/Tooltip.js";let Ut=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.feedbackOptions=new wt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=O(),this.mapBoundsStart=O(),this.displayBounds=O(),this.displayBoundsStart=O(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=new Rt,this._moveZTooltipInfo=new Gt,this._rotateTooltipInfo=new jt,this._scaleTooltipInfo=new Ot,this._startAngle=0,this._endAngle=0,this._startScale=b(),this._endScale=b()}initialize(){const{view:t,graphic:e,manipulators:i,handles:s}=this,o=this.graphicState=new yt({graphic:e}),n=e.geometry;this.editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this.graphicMoveManipulation=new ct({tool:this,view:t,graphicState:o}),this.moveZManipulator=V(t,N.CENTER_ON_CALLOUT),this.moveZManipulator.state|=H,s.add([this._createMoveXYGraphicDragPipeline(),l((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this.moveZManipulator,pt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((e=>{const i=X(t,e);return s.add([l((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,pt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this.resizeManipulators),this.rotateManipulatorTexture=it(t.toolViewManager.textures),this.rotateManipulator=Y(t,this.rotateManipulatorTexture.texture),s.add([l((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this.rotateManipulator,pt.ROTATE))),this.rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this.rotateManipulator)]),i.add(this.rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});r(p)&&(this.outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),r(this.outlineVisualElement)&&s.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([o.on("changed",(()=>this._onGeometryChanged())),l((()=>o.displaying),(()=>this._updateAllManipulatorAvailability())),l((()=>o.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(o)]);const h=t.pointsOfInterest;h&&s.add(l((()=>h.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===pt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this.mapBounds=null,this.displayBounds=null,this.rotateManipulatorTexture.release(),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}onInputEvent(t){if("pointer-move"===t.type)this._tooltip.screenPoint=d(t.x,t.y)}_initializeTooltip(){const{handles:t,view:e}=this,i=this._tooltip=new Pt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",a),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{_(this._startScale,t.xScale,t.yScale),_(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{_(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{_(this._startScale,0,0),_(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",a)])}))}_getUpdatedTooltipInfo(){if(!this.feedbackOptions.tooltipEnabled)return null;if(this.graphicMoveManipulation.grabbing||this.graphicMoveManipulation.dragging){const t=this._moveXYTooltipInfo,e=this._moveUnit;if(this.graphicMoveManipulation.dragging){const[i,a]=S(It,this.mapBounds.origin,this.mapBoundsStart.origin);t.xDistance=h(i,e),t.yDistance=h(a,e)}else t.xDistance=h(0,e),t.yDistance=h(0,e);return t}if(this.moveZManipulator.focused){const t=this._moveZTooltipInfo,e=this._moveUnit;if(this.moveZManipulator.dragging){const i=this.mapBoundsStart.origin,a=this.mapBounds.origin;t.zDistance=h(a[2]-i[2],e)}else t.zDistance=h(0,e);return t}if(this.rotateManipulator.focused){const t=this._rotateTooltipInfo;return t.angle=this._startAngle-this._endAngle,t}if(this.resizeManipulators.some((t=>t.focused))){const t=this._scaleTooltipInfo,e=this._moveUnit,[i,a]=S(It,this._endScale,this._startScale);t.xScale=1+i,t.yScale=1+a;const s=this.mapBounds;return t.xSize=h(B(s.basis1),e),t.ySize=h(B(s.basis2),e),t}return null}_graphicDrapedChanged(){this.handles.remove(zt),this._updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{r(this.attachmentOrigin)&&j(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this._updateDisplayBounds()})),zt)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof at){const a=this.graphicState.displaying,s=this.enableZ&&ht(this.graphic);switch(e){case pt.ROTATE:t.available=a&&this.enableRotation;break;case pt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?F:q;break;case pt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,pt.SCALE))),t(this.rotateManipulator,pt.ROTATE),t(this.moveZManipulator,pt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return o(m(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=S(C.get(),i.leftVertex.pos,i.rightVertex.pos);M(a,a);const s=o(st(this.view,this.graphic),t.extent.center);let r=Ct*this.view.pixelSizeAt(s);const n=this.view.spatialReference;n!==t.spatialReference&&(r*=g(n)/g(t.spatialReference)),At(a,e,r,this.mapBounds)}_updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=r(this.outlineVisualElement)&&!this.graphicState.isDraped&&r(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:st(this.view,this.graphic);this.attachmentOrigin=o(e,t.extent.center);const i=r(e)?e.z:mt(this.mapBounds.origin,this.view.elevationProvider,gt.fromElevationInfo(L(this.graphic)),this.view.renderCoordsHelper),a=w(this.mapBounds);a.origin[2]=i,xt(a,this.view.renderCoordsHelper,t.spatialReference,this.displayBoundsMargin,this.displayBounds),this._updateManipulators()}get displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return Zt*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i)))}_createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return ft(this.moveZManipulator,((i,a,s)=>{const r=G(i.renderLocation),o=a.next(ot(t,r,e)).next(St());this._applyGraphicMoveSteps(o,s)}))}_applyGraphicMoveSteps(t,e){const i=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},w(this.mapBounds,this.mapBoundsStart),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(_t()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t}));return e.next((()=>{r(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),i}_moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Tt(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);P(this.displayBounds.plane,e,k.get())&&(w(this.displayBounds,this.displayBoundsStart),w(this.mapBounds,this.mapBoundsStart),this.displayBoundsMarginStart=this.displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return ft(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(nt(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{r(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this.displayBoundsMargin,s=this.displayBoundsMarginStart,r=E(k.get(),e.origin);A(r,r,e.basis1,-i[0]),A(r,r,e.basis2,-i[1]);const o=x(k.get(),t.renderEnd,r),n=x(k.get(),t.renderStart,r),p=W(t.handle),h=J(e),l=J(this.displayBounds)/h,c=(t,e)=>{if(0===t)return 1;let i=B(e),r=.5*t*D(e,o)/i;const h=r<0?-1:1;if(p){r+=(i-.5*t*D(e,n)/i)*h*l}const c=i<1.5*s?1:kt;return i=Math.max(i-s,kt),h>0&&(r-=a),h*Math.max(h*(r/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=E(R(),this.mapBoundsStart.origin);A(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),A(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=_(b(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);M(i,i);const a=[];for(const o of this.editGeometryOperations.data.components)a.push(...o.vertices);const s="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,r=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Et.REPLACE);return w(this.mapBoundsStart,this.mapBounds),Tt(r,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=K(this.displayBounds,this.view.renderCoordsHelper,Q.HEADING,U()),i=this._calculatePickRay(t.screenPoint);P(e,i,k.get())&&(w(this.displayBounds,this.displayBoundsStart),w(this.mapBounds,this.mapBoundsStart),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(nt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{r(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=z(t.rotatePlane),a=rt(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=E(R(),this.mapBoundsStart.origin),i=[];for(const r of this.editGeometryOperations.data.components)i.push(...r.vertices);const a="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Et.REPLACE);return w(this.mapBoundsStart,this.mapBounds),Tt(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=Z(),i=u(t);return vt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=$(this.displayBounds,I.get());tt(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{et(e,this.resizeHandles[i],t,this.displayBounds)}))}_updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:x(k.get(),i.origin,i.basis1),edge:2},s=I.get();f(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this.editGeometryOperations.lastOperation;n(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,Dt(t,this.mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(r(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Dt(p(t),this.mapBounds),this._updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Tt(p(t),this.mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator}}};t([y({constructOnly:!0,nonNullable:!0})],Ut.prototype,"view",void 0),t([y({constructOnly:!0,nonNullable:!0})],Ut.prototype,"graphic",void 0),t([y({constructOnly:!0,nonNullable:!0})],Ut.prototype,"enableZ",void 0),t([y()],Ut.prototype,"enableRotation",void 0),t([y()],Ut.prototype,"enableScaling",void 0),t([y({type:wt})],Ut.prototype,"feedbackOptions",void 0),t([y()],Ut.prototype,"preserveAspectRatio",null),t([y()],Ut.prototype,"grabbing",void 0),t([y()],Ut.prototype,"inputState",void 0),t([y({readOnly:!0})],Ut.prototype,"type",void 0),t([y()],Ut.prototype,"_moveUnit",null),Ut=t([v("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Ut);const zt="draped-elevation-changes",Zt=10,Ct=80,kt=1e-6,It=b();export{kt as EPSILON,Ut as ExtentTransformTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as o,isNone as r,unwrapOr as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as l}from"../../../../../core/quantityUtils.js";import{watch as h,initial as c}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as d}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as u,getMetersPerUnitForSR as m}from"../../../../../core/unitUtils.js";import{property as g}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../../../core/accessorSupport/decorators/subclass.js";import{g as v}from"../../../../../chunks/mat4.js";import{a as f,g as _,i as S}from"../../../../../chunks/vec2.js";import{a as M}from"../../../../../chunks/vec2f64.js";import{l as b,c as B,F as T,b as E,n as A,e as x}from"../../../../../chunks/vec3.js";import{c as O,a as j}from"../../../../../chunks/vec3f64.js";import{containsXY as R}from"../../../../../geometry/support/aaBoundingRect.js";import{c as G,a as D}from"../../../../../chunks/boundedPlane.js";import{intersectRay as w,create as P,normal as U}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv2d as Z,sv3d as I,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as k}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as L,OffsetMode as X,IsShiftEdgeOnScreenFlag as V,createResizeManipulator as Y,createRotateManipulator as N,resizeNormal as H,resizeOutlineOnly as F,isDiagonalResizeHandle as q,calculateDiagonalResizeHandleScale as W,createRotatePlane as J,RotationAxis as K,calculateBoundedPlaneTranslateRotate as Q,updateRotateHeadingHandle as $,updateResizeHandle as tt}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as et}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as it}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as at,calculateInputRotationTransform as st}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as rt}from"../dragEventPipeline3D.js";import{ManipulatorType as nt}from"../ManipulatorType.js";import{canMoveZ as pt}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{ManipulationType as ht}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as gt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as yt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as vt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as ft,addMapDelta as _t,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Bt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Tt}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as Et,mapPlaneToRenderPlane as At,apply as xt,unapply as Ot}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import jt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Rt,ExtentScaleTooltipInfo as Gt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as Dt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as wt,TranslateVertexZTooltipInfo as Pt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{euclideanHorizontalDistanceBetweenPoints as Ut}from"../../../../support/lengthMeasurementUtils.js";let zt=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new jt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=G(),this.mapBoundsStart=G(),this.displayBounds=G(),this.displayBoundsStart=G(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=M(),this._endScale=M()}initialize(){const{view:t,graphic:e,manipulators:i,handles:s}=this,r=this.graphicState=new yt({graphic:e}),n=e.geometry;this.editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this.graphicMoveManipulation=new ct({tool:this,view:t,graphicState:r}),this.moveZManipulator=L(t,X.CENTER_ON_CALLOUT),this.moveZManipulator.state|=V,s.add([this._createMoveXYGraphicDragPipeline(),h((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this.moveZManipulator,nt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((e=>{const i=Y(t,e);return s.add([h((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,nt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this.resizeManipulators),this.rotateManipulatorTexture=et(t.toolViewManager.textures),this.rotateManipulator=N(t,this.rotateManipulatorTexture.texture),s.add([h((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this.rotateManipulator,nt.ROTATE))),this.rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this.rotateManipulator)]),i.add(this.rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});o(p)&&(this.outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),o(this.outlineVisualElement)&&s.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([r.on("changed",(()=>this._onGeometryChanged())),h((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),h((()=>r.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(r)]);const l=t.pointsOfInterest;l&&s.add(h((()=>l.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===nt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this.mapBounds=null,this.displayBounds=null,this.rotateManipulatorTexture.release(),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{handles:t,view:e}=this,i=this._tooltip=new Dt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",a),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{f(this._startScale,t.xScale,t.yScale),f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{f(this._startScale,0,0),f(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",a)])}))}_getUpdatedTooltipInfo(){const{tooltipOptions:t}=this;if(!t.enabled)return null;if(this.graphicMoveManipulation.grabbing||this.graphicMoveManipulation.dragging){let e=this._moveXYTooltipInfo;return r(e)&&(e=this._moveXYTooltipInfo=new wt({tooltipOptions:t})),e}if(this.moveZManipulator.focused){let e=this._moveZTooltipInfo;r(e)&&(e=this._moveZTooltipInfo=new Pt({tooltipOptions:t}));const i=this._moveUnit;if(this.moveZManipulator.dragging){const t=this.mapBoundsStart.origin,a=this.mapBounds.origin;e.distance=l(a[2]-t[2],i)}else e.distance=l(0,i);return e}if(this.rotateManipulator.focused){let e=this._rotateTooltipInfo;return r(e)&&(e=this._rotateTooltipInfo=new Rt({tooltipOptions:t})),e.angle=this._startAngle-this._endAngle,e}if(this.resizeManipulators.some((t=>t.focused))){let e=this._scaleTooltipInfo;r(e)&&(e=this._scaleTooltipInfo=new Gt({tooltipOptions:t}));const i=this._moveUnit,[a,s]=_(Lt,this._endScale,this._startScale);e.xScale=1+a,e.yScale=1+s;const o=this.mapBounds;return e.xSize=l(b(o.basis1),i),e.ySize=l(b(o.basis2),i),e}return null}_graphicDrapedChanged(){this.handles.remove(Zt),this._updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{o(this.attachmentOrigin)&&R(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this._updateDisplayBounds()})),Zt)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof it){const a=this.graphicState.displaying,s=this.enableZ&&pt(this.graphic);switch(e){case nt.ROTATE:t.available=a&&this.enableRotation;break;case nt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?H:F;break;case nt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,nt.SCALE))),t(this.rotateManipulator,nt.ROTATE),t(this.moveZManipulator,nt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return n(u(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=_(Z.get(),i.leftVertex.pos,i.rightVertex.pos);S(a,a);const s=n(at(this.view,this.graphic),t.extent.center);let o=Ct*this.view.pixelSizeAt(s);const r=this.view.spatialReference;r!==t.spatialReference&&(o*=m(r)/m(t.spatialReference)),Et(a,e,o,this.mapBounds)}_updateDisplayBounds(){const t=this.graphic.geometry;if(r(t))return;const e=o(this.outlineVisualElement)&&!this.graphicState.isDraped&&o(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:at(this.view,this.graphic);this.attachmentOrigin=n(e,t.extent.center);const i=o(e)?e.z:mt(this.mapBounds.origin,this.view.elevationProvider,gt.fromElevationInfo(k(this.graphic)),this.view.renderCoordsHelper),a=D(this.mapBounds);a.origin[2]=i,At(a,this.view.renderCoordsHelper,t.spatialReference,this.displayBoundsMargin,this.displayBounds),this._updateManipulators()}get displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return It*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,ht.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return ft(this.moveZManipulator,((i,a,s)=>{const o=j(i.renderLocation),r=a.next(ot(t,o,e)).next(St());this._applyGraphicMoveSteps(r,s,ht.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},D(this.mapBounds,this.mapBoundsStart),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(_t()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{o(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_moveDragUpdateGeometry(){return t=>{if(r(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return xt(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===ht.XY||e===ht.XY_AXIS){const e=Ut(t.mapStart,t.mapEnd);o(e)&&o(this._moveXYTooltipInfo)&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);w(this.displayBounds.plane,e,I.get())&&(D(this.displayBounds,this.displayBoundsStart),D(this.mapBounds,this.mapBoundsStart),this.displayBoundsMarginStart=this.displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return ft(t,((t,i,a)=>{r(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(rt(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{o(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this.displayBoundsMargin,s=this.displayBoundsMarginStart,o=B(I.get(),e.origin);T(o,o,e.basis1,-i[0]),T(o,o,e.basis2,-i[1]);const r=E(I.get(),t.renderEnd,o),n=E(I.get(),t.renderStart,o),p=q(t.handle),l=W(e),h=W(this.displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=b(e),o=.5*t*x(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*x(e,n)/i)*l*h}const c=i<1.5*s?1:kt;return i=Math.max(i-s,kt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=B(O(),this.mapBoundsStart.origin);T(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),T(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=f(M(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);S(i,i);const a=[];for(const r of this.editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,o=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Tt.REPLACE);return D(this.mapBoundsStart,this.mapBounds),xt(o,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=J(this.displayBounds,this.view.renderCoordsHelper,K.HEADING,P()),i=this._calculatePickRay(t.screenPoint);w(e,i,I.get())&&(D(this.displayBounds,this.displayBoundsStart),D(this.mapBounds,this.mapBoundsStart),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;r(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(rt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{o(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=U(t.rotatePlane),a=st(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=B(O(),this.mapBoundsStart.origin),i=[];for(const o of this.editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?Bt.NEW_STEP:Bt.ACCUMULATE_STEPS,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Tt.REPLACE);return D(this.mapBoundsStart,this.mapBounds),xt(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=z(),i=d(t);return vt(this.view.state.camera,i,e),A(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=Q(this.displayBounds,C.get());$(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{tt(e,this.resizeHandles[i],t,this.displayBounds)}))}_updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:E(I.get(),i.origin,i.basis1),edge:2},s=C.get();v(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this.editGeometryOperations.lastOperation;r(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,Ot(t,this.mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(o(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Ot(p(t),this.mapBounds),this._updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,xt(p(t),this.mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator}}};t([g({constructOnly:!0,nonNullable:!0})],zt.prototype,"view",void 0),t([g({constructOnly:!0,nonNullable:!0})],zt.prototype,"graphic",void 0),t([g({constructOnly:!0,nonNullable:!0})],zt.prototype,"enableZ",void 0),t([g()],zt.prototype,"enableRotation",void 0),t([g()],zt.prototype,"enableScaling",void 0),t([g({constructOnly:!0,type:jt})],zt.prototype,"tooltipOptions",void 0),t([g()],zt.prototype,"preserveAspectRatio",null),t([g()],zt.prototype,"grabbing",void 0),t([g()],zt.prototype,"inputState",void 0),t([g({readOnly:!0})],zt.prototype,"type",void 0),t([g()],zt.prototype,"_moveUnit",null),zt=t([y("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],zt);const Zt="draped-elevation-changes",It=10,Ct=80,kt=1e-6,Lt=M();export{kt as EPSILON,zt as ExtentTransformTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as r,destroyMaybe as s,unwrapOr as n}from"../../../../../core/maybe.js";import{watch as l,initial as c}from"../../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../../core/scheduling.js";import{createScreenPoint as p,createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{d as g,u,m,h as f,e as _}from"../../../../../chunks/mat4.js";import{c as M}from"../../../../../chunks/mat4f64.js";import{s as D,b as S,l as v,d as b,f as y,a as k}from"../../../../../chunks/vec3.js";import{a as R,f as j}from"../../../../../chunks/vec3f64.js";import{b as w}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as E,create as T,normal as A}from"../../../../../geometry/support/plane.js";import{wrap as I,distance2 as O}from"../../../../../geometry/support/ray.js";import{sv3d as P,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as F}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as U}from"../../Manipulator3D.js";import{calculateInputRotationTransform as x}from"../../manipulatorUtils.js";import{screenToRenderPlane as L}from"../dragEventPipeline3D.js";import{ManipulatorType as N}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as z,SCALE_INDICATOR_DIRECTION_BUFFER as G,RING_HEIGHT as H,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as B,ROTATE_INDICATOR_ARROW_TIP_LENGTH as q,ROTATE_INDICATOR_ARROW_TIP_RADIUS as J,RING_THICKNESS as K,HANDLE_COLOR as Q,DRAG_THRESHOLD_PX as V,RING_INDICATOR_DELAY_MS as W,RING_RADIUS as X,INNER_INDICATOR_RADIUS as Y,INDICATOR_THICKNESS as Z,OUTER_INDICATOR_RADIUS as $,SCALE_INDICATOR_OFFSET1 as tt,SCALE_INDICATOR_OFFSET2 as et,RING_RESET_ANIMATION_SPEED_FACTOR as at,GEOMETRY_SEGMENTS as it,ROTATE_INDICATOR_ARC_LENGTH as ot,SCALE_INDICATOR_ARC_LENGTH as rt}from"../manipulations/config.js";import{CullFaceOptions as st}from"../../../webgl-engine/lib/basicInterfaces.js";import nt from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as lt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as ct}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as ht}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as pt,ManipulatorStateFlags as dt}from"../../../../interactive/interfaces.js";import{Tooltip as gt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as ut,TransformScaleTooltipInfo as mt,TransformAbsoluteTooltipInfo as ft}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var _t;!function(t){t.ScaleIn=pt.Custom2,t.ScaleOut=pt.Custom3,t.RotateLeft=pt.Custom4,t.RotateRight=pt.Custom5,t.Unlocked=pt.Custom7,t.DelayedFocused=pt.Custom8,t.TouchInput=pt.Custom12}(_t||(_t={}));const Mt="pointer-tracking";class Dt{constructor(t){this.mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this.ringManipulator.focused,this.getScale=()=>r(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this.adapter.scale:1,this.tool=t.tool,this.mode=t.mode,this.adapter=t.adapter,this._feedbackOptions=t.feedbackOptions,this._tooltip=new gt({view:this.tool.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(l((()=>this._tooltipEnabled),(t=>{this._handles.remove(Mt),t?this._handles.add(this.tool.view.on("pointer-move",(t=>{const{hovering:e,grabbing:a}=this.ringManipulator;(e||a)&&(this._tooltip.screenPoint=p(t.x,t.y))})),Mt):this._tooltip.clear()}),c))}get _tooltipEnabled(){return this._feedbackOptions.tooltipEnabled}get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this.ringManipulator.location=t}set elevationAlignedLocation(t){this.ringManipulator.elevationAlignedLocation=t}get grabbing(){return this.ringManipulator.grabbing}set interactive(t){this.ringManipulator.interactive=t}destroy(){r(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=s(this._handles),this.tool.manipulators.remove(this.ringManipulator),this.ringManipulator=null,this._tooltip=s(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=h({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){r(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=s(this._activeAnimation))}forEachManipulator(t){t(this.ringManipulator,N.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this.ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,s=ht(e,((e,s,l)=>{this._scaleRotateDragData=null,this.adapter.restart();const c={mode:"none",origin:R(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=P.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),s.next(L(this.tool.view,E(e.renderLocation,h,T()))).next((e=>{const s=A(e.plane),n=x(e.renderStart,e.renderEnd,c.origin,s),l=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+l,-z,z),c.angle=n;const h=St(c,e),p=h-this.adapter.scale;if(c.scaleDir=i(c.scaleDir+p,-G,G),this._onScaleChanged(),"none"===c.mode){const t=this.mode||vt(e,e.plane,c.origin,this.tool.view.state.camera);if(r(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":this.adapter.angle=c.initialAngle+n;break;case"scale":this.adapter.scale=h,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:h,yScale:h})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:h,yScale:h})}}return"end"===e.action&&(this.startAnimation(kt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()),e})).next((t=>{if(!this._tooltipEnabled)return t;const e=this._tooltip;switch(c.mode){case"none":e.clear();break;case"scale":e.info=new mt({scale:{value:this.adapter.scale},size:{value:n(this.adapter.size,-1),unit:"meters",type:"length"}});break;case"rotate":e.info=new ut({angle:{value:n(this.adapter.relativeAngle,0),unit:"radians",type:"angle"},orientation:{value:this.adapter.angle,unit:"radians",type:"angle"}})}return t})),l.next((()=>{if(this.adapter.cancel(),this._tooltip.clear(),r(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(kt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}}))}));this._handles.add([s,e.events.on("focus-changed",(t=>{"focus"===t.action?(this.startAnimation(Rt(this,(()=>this._updateDelayedFocusedState()))),this._tooltip.info=new ft({orientation:{value:this.adapter.angle,unit:"radians",type:"angle"},size:{value:n(this.adapter.size,-1),unit:"meters",type:"length"}})):(this._updateDelayedFocusedState(),this._tooltip.clear())})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),l((()=>this.tool.graphicState?.displaying),(t=>this.ringManipulator.available=t),c)])}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this.ringManipulator.updateStateEnabled(_t.DelayedFocused,this.getFocused())}_updateDragState(){if(this.ringManipulator.updateStateEnabled(_t.Unlocked,!(r(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),r(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this.ringManipulator.updateStateEnabled(_t.ScaleIn|_t.ScaleOut,!1),this.ringManipulator.updateStateEnabled(_t.RotateLeft,this._scaleRotateDragData.angleDir<0),this.ringManipulator.updateStateEnabled(_t.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this.ringManipulator.updateStateEnabled(_t.RotateLeft|_t.RotateRight,!1),this.ringManipulator.updateStateEnabled(_t.ScaleIn,this._scaleRotateDragData.scaleDir<0),this.ringManipulator.updateStateEnabled(_t.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this.ringManipulator.updateStateEnabled(_t.ScaleIn|_t.ScaleOut|_t.RotateLeft|_t.RotateRight,!1)}_updateManipulatorTransform(){const t=g(C.get(),this.adapter.angle,j(0,0,1)),e=this.getScale(),a=u(C.get(),D(P.get(),e,e,e));this.ringManipulator.modelTransform=m(C.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(it*(e-t)/(2*Math.PI));for(let r=0;r<o+1;r++){const s=t+r*(e-t)/o;i.push(j(a*Math.cos(s),a*Math.sin(s),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,H/2],[-t/2,H/2]],i=(t,e)=>nt.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e(X),r=i(o,K),s={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-ot,o=e+a,r=e+Math.PI/2-a,l=t(o,r,Y),c=i(l,Z);n.push(l),n.push(t(o,r,$-K/2)),s.left.push(c),s.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=M();if(e){f(a,a,[1,-1,1]),_(a,a,-o,[0,0,1]);const t=Math.round(B*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{_(a,a,r,[0,0,1]);const t=Math.round((1-B)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=nt.createExtrudedTriangle(q,0,J,H);nt.transformInPlace(i,a),(e?s.left:s.right).push(i)}}const l=[];for(let f=0;f<2;f++){const e=f*Math.PI-Math.PI/4,a=Math.PI/2-rt,o=e+a,r=e+Math.PI/2-a,s=t(o,r,$);l.push(i(s,Z))}const c=e(X+tt),h=e(X+et),p=i(c,Z),d=i(h,Z),g=e(X-tt),u=e(X-et),m=i(g,Z),D=i(u,Z),S=this._createMaterial(),v=this._createMaterial(.66),b=this._createMaterial(.5),y=this._createMaterial(.33);let k=[{geometry:r,material:S,stateMask:_t.DelayedFocused},{geometry:r,material:b,stateMask:dt.None}];this.mode&&"scale"!==this.mode||(k=k.concat([{geometry:l,material:S,stateMask:_t.DelayedFocused|_t.Unlocked},{geometry:p,material:v,stateMask:_t.DelayedFocused|_t.ScaleIn},{geometry:d,material:y,stateMask:_t.DelayedFocused|_t.ScaleIn},{geometry:m,material:v,stateMask:_t.DelayedFocused|_t.ScaleOut},{geometry:D,material:y,stateMask:_t.DelayedFocused|_t.ScaleOut}])),this.mode&&"rotate"!==this.mode||(k=k.concat([{geometry:s.right,material:S,stateMask:_t.DelayedFocused|_t.Unlocked},{geometry:s.left,material:S,stateMask:_t.DelayedFocused|_t.RotateLeft},{geometry:s.right,material:S,stateMask:_t.DelayedFocused|_t.RotateRight}]));const R=[o,...n];return new U({view:this.tool.view,renderObjects:k,autoScaleRenderObjects:!1,worldOriented:!0,radius:K,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:F(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:j(0,0,1)}})}_createMaterial(t=1){const e=w([...Q,t]);return new ct({color:e,transparent:1!==t,cullFace:st.Back,renderOccluded:lt.Transparent})}get test(){return{ringManipulator:this.ringManipulator,tooltip:this._tooltip}}}function St(t,e){const a=S(P.get(),e.renderStart,t.origin),i=S(P.get(),e.renderEnd,t.origin),o=v(a),r=v(i);return 0===o?0:r/o}function vt(t,e,a,i){const{renderStart:o,renderEnd:r}=t,s=bt(o,i,P.get()),n=bt(r,i,P.get());if(b(s,n)<V*V)return null;const l=S(P.get(),o,a),c=y(P.get(),l,A(e)),h=o,p=k(P.get(),h,c),d=bt(a,i,P.get()),g=s,u=bt(p,i,P.get()),m=S(P.get(),u,g),f=S(P.get(),s,d),_=I(g,m),M=I(d,f);return O(_,n)<O(M,n)?"rotate":"scale"}function bt(t,e,a){return e.projectToScreen(t,jt),D(a,jt[0],jt[1],0)}var yt;function kt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*at,1),e(),Math.abs(i-1)<.01?yt.STOP:yt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function Rt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>W?yt.STOP:yt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(yt||(yt={}));const jt=d();export{Dt as GraphicScaleRotateTransform};
5
+ import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n}from"../../../../../core/maybe.js";import{when as l,initial as c,watch as h}from"../../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../../core/scheduling.js";import{createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{d as g,u,m,h as _,e as f}from"../../../../../chunks/mat4.js";import{c as M}from"../../../../../chunks/mat4f64.js";import{s as D,b as S,l as v,d as y,f as b,a as R}from"../../../../../chunks/vec3.js";import{a as k,f as j}from"../../../../../chunks/vec3f64.js";import{b as w}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as T,create as A,normal as O}from"../../../../../geometry/support/plane.js";import{wrap as I,distance2 as E}from"../../../../../geometry/support/ray.js";import{sv3d as C,sm4d as F}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as P}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as U}from"../../Manipulator3D.js";import{calculateInputRotationTransform as x}from"../../manipulatorUtils.js";import{screenToRenderPlane as L}from"../dragEventPipeline3D.js";import{ManipulatorType as N}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as z,SCALE_INDICATOR_DIRECTION_BUFFER as G,RING_HEIGHT as H,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as B,ROTATE_INDICATOR_ARROW_TIP_LENGTH as q,ROTATE_INDICATOR_ARROW_TIP_RADIUS as J,RING_THICKNESS as K,HANDLE_COLOR as Q,DRAG_THRESHOLD_PX as V,RING_INDICATOR_DELAY_MS as W,RING_RADIUS as X,INNER_INDICATOR_RADIUS as Y,INDICATOR_THICKNESS as Z,OUTER_INDICATOR_RADIUS as $,SCALE_INDICATOR_OFFSET1 as tt,SCALE_INDICATOR_OFFSET2 as et,RING_RESET_ANIMATION_SPEED_FACTOR as at,GEOMETRY_SEGMENTS as it,ROTATE_INDICATOR_ARC_LENGTH as ot,SCALE_INDICATOR_ARC_LENGTH as st}from"../manipulations/config.js";import{CullFaceOptions as rt}from"../../../webgl-engine/lib/basicInterfaces.js";import nt from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as lt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as ct}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as ht}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as pt,ManipulatorStateFlags as dt}from"../../../../interactive/interfaces.js";import{Tooltip as gt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as ut,TransformScaleTooltipInfo as mt,TransformAbsoluteTooltipInfo as _t}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var ft,Mt;!function(t){t.ScaleIn=pt.Custom2,t.ScaleOut=pt.Custom3,t.RotateLeft=pt.Custom4,t.RotateRight=pt.Custom5,t.Unlocked=pt.Custom7,t.DelayedFocused=pt.Custom8,t.TouchInput=pt.Custom12}(ft||(ft={}));class Dt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this.mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this.adapter.scale:1,this.tool=r,this.mode=o,this.adapter=t,this._tooltipOptions=i,this._tooltip=new gt({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(l((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),c))}get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=p({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,N.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=ht(e,((e,r,l)=>{this._scaleRotateDragData=null,this.adapter.restart();const c={mode:"none",origin:k(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=C.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(L(this.tool.view,T(e.renderLocation,h,A()))).next((e=>{const r=O(e.plane),n=x(e.renderStart,e.renderEnd,c.origin,r),l=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+l,-z,z),c.angle=n;const h=St(c,e),p=h-this.adapter.scale;if(c.scaleDir=i(c.scaleDir+p,-G,G),this._onScaleChanged(),"none"===c.mode){const t=this.mode||vt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":this.adapter.angle=c.initialAngle+n;break;case"scale":this.adapter.scale=h,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:h,yScale:h})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:h,yScale:h})}}return"end"===e.action&&(this.startAnimation(bt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()),e})).next((t=>{const e=this._tooltipOptions;if(!e.enabled)return t;const a=this._tooltip;switch(c.mode){case"none":a.clear();break;case"scale":a.info=new mt({tooltipOptions:e,scale:{value:this.adapter.scale},size:{value:n(this.adapter.size,-1),unit:"meters",type:"length"}});break;case"rotate":a.info=new ut({tooltipOptions:e,angle:{value:n(this.adapter.relativeAngle,0),unit:"radians",type:"angle"},orientation:{value:this.adapter.angle,unit:"radians",type:"angle"}})}return t})),l.next((()=>{if(this.adapter.cancel(),this._tooltip.clear(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(bt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?(this.startAnimation(Rt(this,(()=>this._updateDelayedFocusedState()))),this._tooltip.info=new _t({tooltipOptions:this._tooltipOptions,orientation:{value:this.adapter.angle,unit:"radians",type:"angle"},size:{value:n(this.adapter.size,-1),unit:"meters",type:"length"}})):(this._updateDelayedFocusedState(),this._tooltip.clear())})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),h((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),c)])}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(ft.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(ft.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(ft.ScaleIn|ft.ScaleOut,!1),this._ringManipulator.updateStateEnabled(ft.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(ft.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(ft.RotateLeft|ft.RotateRight,!1),this._ringManipulator.updateStateEnabled(ft.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(ft.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(ft.ScaleIn|ft.ScaleOut|ft.RotateLeft|ft.RotateRight,!1)}_updateManipulatorTransform(){const t=g(F.get(),this.adapter.angle,j(0,0,1)),e=this.getScale(),a=u(F.get(),D(C.get(),e,e,e));this._ringManipulator.modelTransform=m(F.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(it*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(j(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,H/2],[-t/2,H/2]],i=(t,e)=>nt.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e(X),s=i(o,K),r={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-ot,o=e+a,s=e+Math.PI/2-a,l=t(o,s,Y),c=i(l,Z);n.push(l),n.push(t(o,s,$-K/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=M();if(e){_(a,a,[1,-1,1]),f(a,a,-o,[0,0,1]);const t=Math.round(B*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{f(a,a,s,[0,0,1]);const t=Math.round((1-B)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=nt.createExtrudedTriangle(q,0,J,H);nt.transformInPlace(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let _=0;_<2;_++){const e=_*Math.PI-Math.PI/4,a=Math.PI/2-st,o=e+a,s=e+Math.PI/2-a,r=t(o,s,$);l.push(i(r,Z))}const c=e(X+tt),h=e(X+et),p=i(c,Z),d=i(h,Z),g=e(X-tt),u=e(X-et),m=i(g,Z),D=i(u,Z),S=this._createMaterial(),v=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let R=[{geometry:s,material:S,stateMask:ft.DelayedFocused},{geometry:s,material:y,stateMask:dt.None}];this.mode&&"scale"!==this.mode||(R=R.concat([{geometry:l,material:S,stateMask:ft.DelayedFocused|ft.Unlocked},{geometry:p,material:v,stateMask:ft.DelayedFocused|ft.ScaleIn},{geometry:d,material:b,stateMask:ft.DelayedFocused|ft.ScaleIn},{geometry:m,material:v,stateMask:ft.DelayedFocused|ft.ScaleOut},{geometry:D,material:b,stateMask:ft.DelayedFocused|ft.ScaleOut}])),this.mode&&"rotate"!==this.mode||(R=R.concat([{geometry:r.right,material:S,stateMask:ft.DelayedFocused|ft.Unlocked},{geometry:r.left,material:S,stateMask:ft.DelayedFocused|ft.RotateLeft},{geometry:r.right,material:S,stateMask:ft.DelayedFocused|ft.RotateRight}]));const k=[o,...n];return new U({view:this.tool.view,renderObjects:R,autoScaleRenderObjects:!1,worldOriented:!0,radius:K,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:P(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:k,direction:j(0,0,1)}})}_createMaterial(t=1){const e=w([...Q,t]);return new ct({color:e,transparent:1!==t,cullFace:rt.Back,renderOccluded:lt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function St(t,e){const a=S(C.get(),e.renderStart,t.origin),i=S(C.get(),e.renderEnd,t.origin),o=v(a),s=v(i);return 0===o?0:s/o}function vt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=yt(o,i,C.get()),n=yt(s,i,C.get());if(y(r,n)<V*V)return null;const l=S(C.get(),o,a),c=b(C.get(),l,O(e)),h=o,p=R(C.get(),h,c),d=yt(a,i,C.get()),g=r,u=yt(p,i,C.get()),m=S(C.get(),u,g),_=S(C.get(),r,d),f=I(g,m),M=I(d,_);return E(f,n)<E(M,n)?"rotate":"scale"}function yt(t,e,a){return e.projectToScreen(t,kt),D(a,kt[0],kt[1],0)}function bt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*at,1),e(),Math.abs(i-1)<.01?Mt.STOP:Mt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function Rt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>W?Mt.STOP:Mt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(Mt||(Mt={}));const kt=d();export{Dt as GraphicScaleRotateTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isSome as o,destroyMaybe as s,isNone as n}from"../../../../../core/maybe.js";import{watch as r}from"../../../../../core/reactiveUtils.js";import{property as p}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as h}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{placeAtGraphic as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as u}from"../../SnappingVisualizer3D.js";import{canMoveZ as v}from"../manipulatorUtils.js";import{createVisualElements as M}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as f}from"../manipulations/config.js";import{MoveManipulation as y,ManipulationType as S}from"../manipulations/MoveManipulation.js";import{GraphicScaleRotateTransform as R}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as b}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as w}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as j}from"./undoRecords.js";import{GraphicState as A}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as _}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as x}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as G}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as O}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import T from"../../../../interactive/tooltip/NumericalFeedbackOptions.js";let E=class extends(i(e.EventedMixin(_))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.feedbackOptions=new T,this.type="transform-3d",this.scaleRotate=null,this.snappingPipeline=new O}initialize(){this.graphicState=new A({graphic:this.graphic}),this.moveManipulation=new y({tool:this,view:this.view,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(this.graphic),radius:y.radiusForSymbol(this.graphic.symbol)}),this.moveManipulation.forEachManipulator((t=>this.handles.add(t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:this.graphicState.graphic}),t.stopPropagation()}))))),this.moveManipulation.elevationInfo=h(this.graphic);const t=this.graphic.geometry;if(this.moveManipulation.createGraphicDragPipeline(((e,i,a,s,n)=>(o(t)&&e===S.XY&&(a=a.next(this.snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new G({elevationInfo:h(this.graphic),pointer:n,editGeometryOperations:x.fromGeometry(new c({spatialReference:t.spatialReference}),this.view.state.viewingMode),visualizer:new u,excludeFeature:this.graphic}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:s}),this.snappingPipeline.next)),a)),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,s={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",s),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",s);break;case"end":this.emit("graphic-translate-stop",s)}})),this.moveManipulation.angle=o(this.scaleRotate)?this.scaleRotate.angle:0,this.scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this.scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this.scaleRotate=new R({tool:this,mode:t,adapter:this.scaleRotateAdapter,feedbackOptions:this.feedbackOptions}),this.handles.add(this.scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([M({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>this.view.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof d&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this.moveManipulation.destroy(),this.scaleRotate=s(this.scaleRotate),this.scaleRotateAdapter=s(this.scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){n(this.scaleRotate)||(this.scaleRotate.interactive=!this.moveManipulation.grabbing,this.moveManipulation.interactive=!this.scaleRotate.grabbing)}_createScaleRotateAdapter(){return o(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new b({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new w({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer))})}_forEachManipulator(t){this.moveManipulation.forEachManipulator(t),o(this.scaleRotate)&&this.scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this.moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.graphic)}))}_createGeometryUndoRecord(){return j(this.graphic)}set snapToScene(t){this.moveManipulation&&(this.moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this.moveManipulation.location=t,o(this.scaleRotate)&&(this.scaleRotate.location=t)}set elevationAlignedLocation(t){this.moveManipulation.elevationAlignedLocation=t,o(this.scaleRotate)&&(this.scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){o(this.scaleRotate)&&this.scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(n(this.scaleRotate))return;const t=this.scaleRotate.getScale();this.moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===m.Local||this.view.scale<f?this.moveManipulation.angle=this.scaleRotateAdapter.angle:this.moveManipulation.angle=0}_onGeometryChanged(){g(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this.moveManipulation.renderLocation)}get test(){return{discManipulator:this.moveManipulation.xyManipulation.test.discManipulator,zManipulator:this.moveManipulation.zManipulation.test.manipulator,ringManipulator:o(this.scaleRotate)?this.scaleRotate.test.ringManipulator:null,arrowManipulators:this.moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this.scaleRotateAdapter,scaleRotateTransform:this.scaleRotate}}};t([p({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),t([p({constructOnly:!0,nonNullable:!0})],E.prototype,"graphic",void 0),t([p({constructOnly:!0,nonNullable:!0})],E.prototype,"enableZ",void 0),t([p()],E.prototype,"enableRotation",void 0),t([p()],E.prototype,"enableScaling",void 0),t([p({type:T})],E.prototype,"feedbackOptions",void 0),t([p({value:!1})],E.prototype,"snapToScene",null),t([p({constructOnly:!0})],E.prototype,"snappingManager",void 0),t([p({readOnly:!0})],E.prototype,"type",void 0),t([p({readOnly:!0})],E.prototype,"updating",null),E=t([l("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],E);export{E as GraphicTransformTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isSome as o,destroyMaybe as n,isNone as s}from"../../../../../core/maybe.js";import{watch as r}from"../../../../../core/reactiveUtils.js";import{property as p}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as h}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{placeAtGraphic as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as u}from"../../SnappingVisualizer3D.js";import{canMoveZ as v}from"../manipulatorUtils.js";import{createVisualElements as _}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as M}from"../manipulations/config.js";import{MoveManipulation as f,ManipulationType as y}from"../manipulations/MoveManipulation.js";import{GraphicScaleRotateTransform as S}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as R}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as w}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as b}from"./undoRecords.js";import{GraphicState as j}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as O}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import T from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as x}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as G}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as E}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as z}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{euclideanHorizontalDistanceBetweenPoints as U}from"../../../../support/lengthMeasurementUtils.js";let C=class extends(i(e.EventedMixin(A))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new T,this.type="transform-3d",this._scaleRotate=null,this._snappingPipeline=new G}initialize(){const{graphic:t,view:e}=this;this.graphicState=new j({graphic:t}),this._tooltip=new E({view:e}),this._moveManipulation=new f({tool:this,view:e,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(t),radius:f.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((e=>this.handles.add(e.events.on("immediate-click",(e=>{this.emit("immediate-click",{...e,graphic:t}),e.stopPropagation()})),e.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:e}=this;"start"===t&&e.enabled?this._tooltip.info=new z({tooltipOptions:e}):this._tooltip.clear()}))))),this._moveManipulation.elevationInfo=h(t);const i=t.geometry;if(this._moveManipulation.createGraphicDragPipeline(((a,n,s,r,p)=>(o(i)&&a===y.XY&&(s=s.next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new x({elevationInfo:h(t),pointer:p,editGeometryOperations:O.fromGeometry(new c({spatialReference:i.spatialReference}),e.state.viewingMode),visualizer:new u,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:r}),this._snappingPipeline.next).next((t=>{const e=U(t.mapStart,t.mapEnd),{tooltipOptions:i}=this;return o(e)&&i.enabled?this._tooltip.info=new z({tooltipOptions:i,distance:e}):this._tooltip.clear(),t}))),s)),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,n={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=o(this._scaleRotate)?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new S({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([_({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>e.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof d&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=n(this._scaleRotate),this._scaleRotateAdapter=n(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){s(this._scaleRotate)||(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return o(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new R({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new w({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer))})}_forEachManipulator(t){this._moveManipulation.forEachManipulator(t),o(this._scaleRotate)&&this._scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.graphic)}))}_createGeometryUndoRecord(){return b(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,o(this._scaleRotate)&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,o(this._scaleRotate)&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){o(this._scaleRotate)&&this._scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(s(this._scaleRotate))return;const t=this._scaleRotate.getScale();this._moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===m.Local||this.view.scale<M?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){g(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:o(this._scaleRotate)?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate}}};t([p({constructOnly:!0,nonNullable:!0})],C.prototype,"view",void 0),t([p({constructOnly:!0,nonNullable:!0})],C.prototype,"graphic",void 0),t([p({constructOnly:!0,nonNullable:!0})],C.prototype,"enableZ",void 0),t([p()],C.prototype,"enableRotation",void 0),t([p()],C.prototype,"enableScaling",void 0),t([p({constructOnly:!0,type:T})],C.prototype,"tooltipOptions",void 0),t([p()],C.prototype,"graphicState",void 0),t([p({value:!1})],C.prototype,"snapToScene",null),t([p({constructOnly:!0})],C.prototype,"snappingManager",void 0),t([p({readOnly:!0})],C.prototype,"type",void 0),t([p({readOnly:!0})],C.prototype,"updating",null),C=t([l("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],C);export{C as GraphicTransformTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as t,handlesGroup as r}from"../../../core/handleUtils.js";import{isNone as i,isSome as s}from"../../../core/maybe.js";import{debounce as a,isPromiseLike as n}from"../../../core/promiseUtils.js";import{on as o}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{toExtent as l}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as p}from"./interfaces.js";import{LayerView3D as h}from"./LayerView3D.js";import{DRAPED_Z as c}from"../terrain/OverlayRenderer.js";import{UpdatePolicy as u,PowerOfTwoResizeMode as y}from"../webgl-engine/lib/basicInterfaces.js";import{Geometry as _}from"../webgl-engine/lib/Geometry.js";import{ModelDirty as g}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as f}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as E}from"../webgl-engine/lib/Texture.js";import{VertexAttribute as D}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as w}from"../webgl-engine/materials/ImageMaterial.js";import R from"../../layers/LayerView.js";import{TextureWrapMode as v}from"../../webgl/enums.js";let T=class extends(h(R)){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=p.RasterImage,this.updatePolicy=u.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=a((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.handles.add([t((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),o((()=>this.layer.source),"refresh",(()=>this._updateWithLastDrapingExtent()))]),this.updatingHandles.add((()=>this.suspended),(()=>this._updateWithLastDrapingExtent()))}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(i(this._lastDrapingExtent)||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this.updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const s=this.layer.source;return i(s)?new Set:new Set((await Promise.all(e.map((e=>s.queryElements(l(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach(((i,a)=>{e.has(a)||(t.add(a),s(i.renderData)&&r.push(i.renderData.renderGeometry),this._removeElement(a,i))})),this._renderer.removeGeometries(r,g.Geometry.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t={renderData:null,handle:r([this.updatingHandles.add((()=>e.opacity),(e=>{s(t.renderData)&&t.renderData.material.setParameters({opacity:e})})),this.updatingHandles.add((()=>s(e.georeference)?e.georeference.coords:null),(r=>{s(t.renderData)?this._updateGeometry(t,t.renderData,r):this._initializeRenderData(e,t)})),this.updatingHandles.add((()=>e.loadedImage),(()=>this._initializeRenderData(e,t)))])};this._renderedElements.set(e,t),this._uidToElement.set(e.uid,e),this.updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(e,t)}_initializeRenderData(e,t){const{georeference:r,loadedImage:a}=e;if(i(r)||i(r.coords)||i(a))return void(t.renderData=this._destroyRenderData(t.renderData));if(s(t.renderData))return;const o=this._createTexture(a);this.view._stage.add(o);const d=this.view._stage.loadImmediate(o);n(d)&&this.updatingHandles.addPromise(d);const m=new w({initTextureTransparent:!0,textureId:o.id,opacity:e.opacity,transparent:!0}),l=this._positionVertexBufferFromCoordinates(r.coords),p=[0,0,0,1,1,1,1,0],h=new Uint16Array([0,1,2,0,2,3]),c=new _([[D.POSITION,{data:l,size:3,exclusive:!0}],[D.UV0,{data:p,size:2,exclusive:!0}]],[[D.POSITION,h],[D.UV0,h]]),u=new f(c,m,{layerUid:this.layer.uid,graphicUid:e.uid});this._renderer.addGeometries([u],g.Geometry.ADD),t.renderData={renderGeometry:u,texture:o,material:m}}_updateGeometry(e,t,r){if(i(r))return void(e.renderData=this._destroyRenderData(e.renderData));const s=this._positionVertexBufferFromCoordinates(r);t.renderGeometry.vertexAttributes.get(D.POSITION).data=s,this._renderer.modifyGeometries([t.renderGeometry],g.State.VERTEXATTRS)}_positionVertexBufferFromCoordinates(e){const[t,r,i,s]=e;return new Float64Array([t[0],t[1],c,r[0],r[1],c,i[0],i[1],c,s[0],s[1],c])}_destroyRenderData(e){return i(e)||(this.view._stage.remove(e.texture),this._renderer.removeGeometries([e.renderGeometry],g.Geometry.REMOVE),e.material.dispose()),null}_createTexture(e){const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,r=e instanceof HTMLImageElement?e.naturalHeight:e.height;return new E(e,{wrap:{s:v.CLAMP_TO_EDGE,t:v.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:t,height:r,mipmap:!0,powerOfTwoResizeMode:y.STRETCH})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};e([d({readOnly:!0})],T.prototype,"type",void 0),e([d()],T.prototype,"layer",void 0),T=e([m("esri.views.3d.layers.MediaLayerView3D")],T);const x=T;export{x as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as t,handlesGroup as r}from"../../../core/handleUtils.js";import{isNone as i,isSome as s}from"../../../core/maybe.js";import{debounce as a,isPromiseLike as n}from"../../../core/promiseUtils.js";import{on as o}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{toExtent as m}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as p}from"./interfaces.js";import{LayerView3D as h}from"./LayerView3D.js";import{DRAPED_Z as c}from"../terrain/OverlayRenderer.js";import{UpdatePolicy as u,PowerOfTwoResizeMode as y}from"../webgl-engine/lib/basicInterfaces.js";import{Geometry as _}from"../webgl-engine/lib/Geometry.js";import{ModelDirty as g}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as f}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as E}from"../webgl-engine/lib/Texture.js";import{VertexAttribute as D}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as w}from"../webgl-engine/materials/ImageMaterial.js";import R from"../../layers/LayerView.js";import{TextureWrapMode as v}from"../../webgl/enums.js";let T=class extends(h(R)){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=p.RasterImage,this.updatePolicy=u.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=a((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.handles.add([t((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),o((()=>this.layer.source),"refresh",(()=>this._updateWithLastDrapingExtent()))]),this.updatingHandles.add((()=>this.suspended),(()=>this._updateWithLastDrapingExtent()))}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(i(this._lastDrapingExtent)||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this.updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const s=this.layer.source;return i(s)?new Set:new Set((await Promise.all(e.map((e=>s.queryElements(m(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach(((i,a)=>{e.has(a)||(t.add(a),s(i.renderData)&&r.push(i.renderData.renderGeometry),this._removeElement(a,i))})),this._renderer.removeGeometries(r,g.Geometry.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t={renderData:null,handle:r([this.updatingHandles.add((()=>e.opacity),(e=>{s(t.renderData)&&t.renderData.material.setParameters({opacity:e})})),this.updatingHandles.add((()=>s(e.georeference)?e.georeference.coords:null),(r=>{s(t.renderData)?this._updateGeometry(t,t.renderData,r):this._initializeRenderData(e,t)})),this.updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(e,t)))])};this._renderedElements.set(e,t),this._uidToElement.set(e.uid,e),this.updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(e,t)}_initializeRenderData(e,t){const{georeference:r,content:a}=e;if(i(r)||i(r.coords)||i(a))return void(t.renderData=this._destroyRenderData(t.renderData));if(s(t.renderData))return;const o=this._createTexture(a);this.view._stage.add(o);const d=this.view._stage.loadImmediate(o);n(d)&&this.updatingHandles.addPromise(d);const l=new w({initTextureTransparent:!0,textureId:o.id,opacity:e.opacity,transparent:!0}),m=this._positionVertexBufferFromCoordinates(r.coords),p=[0,0,0,1,1,1,1,0],h=new Uint16Array([0,1,2,0,2,3]),c=new _([[D.POSITION,{data:m,size:3,exclusive:!0}],[D.UV0,{data:p,size:2,exclusive:!0}]],[[D.POSITION,h],[D.UV0,h]]),u=new f(c,l,{layerUid:this.layer.uid,graphicUid:e.uid});this._renderer.addGeometries([u],g.Geometry.ADD),t.renderData={renderGeometry:u,texture:o,material:l}}_updateGeometry(e,t,r){if(i(r))return void(e.renderData=this._destroyRenderData(e.renderData));const s=this._positionVertexBufferFromCoordinates(r);t.renderGeometry.vertexAttributes.get(D.POSITION).data=s,this._renderer.modifyGeometries([t.renderGeometry],g.State.VERTEXATTRS)}_positionVertexBufferFromCoordinates(e){const[t,r,i,s]=e;return new Float64Array([t[0],t[1],c,r[0],r[1],c,i[0],i[1],c,s[0],s[1],c])}_destroyRenderData(e){return i(e)||(this.view._stage.remove(e.texture),this._renderer.removeGeometries([e.renderGeometry],g.Geometry.REMOVE),e.material.dispose()),null}_createTexture(e){const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,r=e instanceof HTMLImageElement?e.naturalHeight:e.height;return new E(e,{wrap:{s:v.CLAMP_TO_EDGE,t:v.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:t,height:r,mipmap:!0,powerOfTwoResizeMode:y.STRETCH,updateCallback:()=>this.view.basemapTerrain.overlayManager.setDrawTexturesDirty()})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};e([d({readOnly:!0})],T.prototype,"type",void 0),e([d()],T.prototype,"layer",void 0),T=e([l("esri.views.3d.layers.MediaLayerView3D")],T);const x=T;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{equalsShallow as i}from"../../../core/lang.js";import{isNone as r,isSome as l,disposeMaybe as s,destroyMaybe as o}from"../../../core/maybe.js";import{isAborted as a}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as p}from"../../2d/engine/vectorTiles/SchemaHelper.js";import m from"../../2d/engine/vectorTiles/TileHandler3D.js";import d from"../../2d/engine/vectorTiles/VTLPainter3D.js";import f from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as y}from"./LayerView3D.js";import{TiledLayerView3D as g}from"./TiledLayerView3D.js";import{vtlAssumes256PixelSizeAsDefault as u,test as _}from"../terrain/terrainUtils.js";import C from"../../layers/LayerView.js";let v=class extends(g(y(C))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(r(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:e,spatialReference:s,state:o,viewingMode:h}=this.view,{pixelRatio:c}=o,y="local"===h&&!u(s)||_.force512VTL,g=this.layer.tileInfo.spatialReference.isGeographic,C=y?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,g?1:2),v=this._getTileInfoSupportError(C,this.layer.fullExtent);if(l(v))return this.addResolvingPromise(Promise.reject(v));const H=n((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const t=e.tilingScheme,i=t.pixelSize;let r;if(this.schemaHelper=new p(i,e.spatialReference.isGeographic),256===i){const e=this.layer.tileInfo.spatialReference.isGeographic;r=this.layer.tileInfo.getOrCreateCompatible(256,e?1:2)}else r=this.view.spatialReference.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const l=this._getTileInfoCompatibilityError(r,t);if(l)throw l;this.tileInfo=r}));this._tileHandlerController=new AbortController;const w=this.view.resourceController;this._memCache=w.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:j}=this.layer.currentStyleInfo,R=new f(j),T=e.mapTileRequester;this._tileHandler=new m(this.layer,R,c,this._memCache,T);const I=this._tileHandlerController.signal,b=e=>w.schedule(e),S=this._tileHandler.start({signal:I,schedule:b}),x=this._tileHandler.spriteMosaic;x.then((e=>{!a(I)&&this._tileHandler&&(this.painter=new d(e,this._tileHandler.glyphMosaic))})),S.then((()=>this._tileHandlerController=null)),this.updatingHandles.add((()=>({style:this.layer.currentStyleInfo,pixelRatio:this.view.state?.pixelRatio})),(({style:e,pixelRatio:t})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const i=new f(e),r=new m(this.layer,i,t,this._memCache,T),l=r.start({signal:this._tileHandlerController.signal,schedule:b}),s=r.spriteMosaic;l.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([l,s]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new d(e,r.glyphMosaic),this._tileHandler=r,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))}),{equals:i});const L=Promise.all([H,S,x]);this.addResolvingPromise(L)}destroy(){this.painter=s(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),o(this._tileHandler),this._memCache=o(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,i=e[e.length-1].scale,r=this.levelRangeFromScaleRange(t,i);return 1===r.minLevel&&256===this.tileInfo.size[0]&&(r.minLevel=0),r}async fetchTile(e,t,i,r){return this._tileHandler.getVectorTile(e,t,i,r)}};e([h()],v.prototype,"layer",void 0),e([h()],v.prototype,"dataLevelRange",null),e([h()],v.prototype,"updatingProgressValue",void 0),v=e([c("esri.views.3d.layers.VectorTileLayerView3D")],v);const H=v;export{H as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as i,isSome as r,disposeMaybe as l,destroyMaybe as s}from"../../../core/maybe.js";import{isAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as c}from"../../2d/engine/vectorTiles/SchemaHelper.js";import p from"../../2d/engine/vectorTiles/TileHandler3D.js";import m from"../../2d/engine/vectorTiles/VTLPainter3D.js";import d from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as f}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{vtlAssumes256PixelSizeAsDefault as g,test as u}from"../terrain/terrainUtils.js";import _ from"../../layers/LayerView.js";let C=class extends(y(f(_))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(i(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:e,spatialReference:l,state:s,viewingMode:n}=this.view,{pixelRatio:h}=s,f="local"===n&&!g(l)||u.force512VTL,y=this.layer.tileInfo.spatialReference.isGeographic,_=f?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,y?1:2),C=this._getTileInfoSupportError(_,this.layer.fullExtent);if(r(C))return this.addResolvingPromise(Promise.reject(C));const v=a((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const t=e.tilingScheme,i=t.pixelSize;let r;if(this.schemaHelper=new c(i,e.spatialReference.isGeographic),256===i){const e=this.layer.tileInfo.spatialReference.isGeographic;r=this.layer.tileInfo.getOrCreateCompatible(256,e?1:2)}else r=this.view.spatialReference.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const l=this._getTileInfoCompatibilityError(r,t);if(l)throw l;this.tileInfo=r}));this._tileHandlerController=new AbortController;const H=this.view.resourceController;this._memCache=H.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:w}=this.layer.currentStyleInfo,j=new d(w),R=e.mapTileRequester;this._tileHandler=new p(this.layer,j,h,this._memCache,R);const T=this._tileHandlerController.signal,I=e=>H.schedule(e),b=this._tileHandler.start({signal:T,schedule:I}),S=this._tileHandler.spriteMosaic;S.then((e=>{!o(T)&&this._tileHandler&&(this.painter=new m(e,this._tileHandler.glyphMosaic))})),b.then((()=>this._tileHandlerController=null)),this.updatingHandles.add((()=>({style:this.layer.currentStyleInfo,pixelRatio:this.view.state?.pixelRatio})),(({style:e,pixelRatio:t})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const i=new d(e),r=new p(this.layer,i,t,this._memCache,R),l=r.start({signal:this._tileHandlerController.signal,schedule:I}),s=r.spriteMosaic;l.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([l,s]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new m(e,r.glyphMosaic),this._tileHandler=r,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))}));const x=Promise.all([v,b,S]);this.addResolvingPromise(x)}destroy(){this.painter=l(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),s(this._tileHandler),this._memCache=s(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,i=e[e.length-1].scale,r=this.levelRangeFromScaleRange(t,i);return 1===r.minLevel&&256===this.tileInfo.size[0]&&(r.minLevel=0),r}async fetchTile(e,t,i,r){return this._tileHandler.getVectorTile(e,t,i,r)}};e([n()],C.prototype,"layer",void 0),e([n()],C.prototype,"dataLevelRange",null),e([n()],C.prototype,"updatingProgressValue",void 0),C=e([h("esri.views.3d.layers.VectorTileLayerView3D")],C);const v=C;export{v as default};