@arcgis/core 4.34.0-next.98 → 4.34.0

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 (645) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/analysis/ElevationProfileAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/00c77f03dd511c6dbff2.js +1 -0
  7. package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → 0461ac6ddd44f8da2eec.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  9. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  10. package/assets/esri/core/workers/chunks/{f5d89b48f62fba78fd10.js → 151defe707bceb3a56a4.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 1847e8ac559085949f6d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1ae3d331da5baa8e4b6a.js +1 -0
  13. package/assets/esri/core/workers/chunks/1d807057327ba90ab770.js +1 -0
  14. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  15. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{2c72e185b780bbbb1c9f.js → 21f1e12d4e703b59c31c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2248c3040e2f9a8b5cbc.js +1 -0
  18. package/assets/esri/core/workers/chunks/292403693cba4562a02d.js +1 -0
  19. package/assets/esri/core/workers/chunks/297b11752f9c251cd7be.js +1 -0
  20. package/assets/esri/core/workers/chunks/2d834d33b73a55a98ba8.js +1 -0
  21. package/assets/esri/core/workers/chunks/2dce02d199a9625abbd9.js +1 -0
  22. package/assets/esri/core/workers/chunks/37897186bfbfa1319ff5.js +1 -0
  23. package/assets/esri/core/workers/chunks/378bed624605fe8f62b1.js +1 -0
  24. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  25. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/4470a3fff217f2bfeec5.js +1 -0
  27. package/assets/esri/core/workers/chunks/44e40484acb577039c82.js +1 -0
  28. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 458e87902abc24b375da.js} +1 -1
  29. package/assets/esri/core/workers/chunks/4a38b1402cd48ced5d0f.js +1 -0
  30. package/assets/esri/core/workers/chunks/4b7c99f9a716a929178d.js +1 -0
  31. package/assets/esri/core/workers/chunks/524293f92791c55f6e2c.js +1 -0
  32. package/assets/esri/core/workers/chunks/594761a526629f9aa165.js +1 -0
  33. package/assets/esri/core/workers/chunks/5e60542f80bdacb6e7af.js +1 -0
  34. package/assets/esri/core/workers/chunks/616e3d1947eda575a25a.js +1 -0
  35. package/assets/esri/core/workers/chunks/{86b978a48b539e9fc5b8.js → 618ccc5d922f40fb6597.js} +1 -1
  36. package/assets/esri/core/workers/chunks/6c96997ca5ea1affa7af.js +1 -0
  37. package/assets/esri/core/workers/chunks/6d5f36fdd6ff081f30e8.js +1 -0
  38. package/assets/esri/core/workers/chunks/7010d1eb303a13c72f81.js +1 -0
  39. package/assets/esri/core/workers/chunks/740e6d2831dcb01ee96a.js +1 -0
  40. package/assets/esri/core/workers/chunks/75535e2e487ed2616acf.js +1 -0
  41. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  42. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  43. package/assets/esri/core/workers/chunks/{40b81d1c2d53cf598b8e.js → 7786fc1b3779df832e0a.js} +1 -1
  44. package/assets/esri/core/workers/chunks/7a5c276652e7edf42e73.js +1 -0
  45. package/assets/esri/core/workers/chunks/{c941d15190fc08523d0d.js → 7a9a0fcf78a1863c5dea.js} +1 -1
  46. package/assets/esri/core/workers/chunks/80d2182dac1a49cfd923.js +1 -0
  47. package/assets/esri/core/workers/chunks/81501abaabf10e9bef1b.js +1 -0
  48. package/assets/esri/core/workers/chunks/{e032f3d2ee19790f8c79.js → 881df4fd1dc594576457.js} +1 -1
  49. package/assets/esri/core/workers/chunks/8862e6ceabc990ca0031.js +1 -0
  50. package/assets/esri/core/workers/chunks/8cf2669900bb45cb094a.js +1 -0
  51. package/assets/esri/core/workers/chunks/8ec6ad6d76b4755a4cf6.js +1 -0
  52. package/assets/esri/core/workers/chunks/9786e854ae9f40975cee.js +1 -0
  53. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  54. package/assets/esri/core/workers/chunks/98ccd88bdb9cb96a7610.js +1 -0
  55. package/assets/esri/core/workers/chunks/9dc6eeaac94aff385cf9.js +1 -0
  56. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  57. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  58. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  59. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  60. package/assets/esri/core/workers/chunks/af0f82f7efa6e983eca5.js +1 -0
  61. package/assets/esri/core/workers/chunks/b113d4f6a014863aaf66.js +1 -0
  62. package/assets/esri/core/workers/chunks/{773d76253588bcf14eaa.js → bd02e9d6c7ba491dd35f.js} +1 -1
  63. package/assets/esri/core/workers/chunks/be1b8e5ff2b1be26845a.js +1 -0
  64. package/assets/esri/core/workers/chunks/{142c45ad68eecaf3fc7c.js → bf9b2949894cc2a1e6b3.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c91ce5fcdd4d0a6514d3.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ad3e18c4c65aa2cd1ceb.js → cd3b843ffd4010038c74.js} +1 -1
  67. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  68. package/assets/esri/core/workers/chunks/d0767001601412f17ada.js +1 -0
  69. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → d391bfbaf0e790cd10d6.js} +2 -2
  70. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  71. package/assets/esri/core/workers/chunks/d5fa879de92da4441771.js +1 -0
  72. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  73. package/assets/esri/core/workers/chunks/d9aee7ee4ab75b446ef1.js +1 -0
  74. package/assets/esri/core/workers/chunks/{9027f22a04ac2076ff0e.js → dd37db3f2d1072e250d9.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{dfc37c2ce51e6a34fd87.js → dec0ed841f9ff1ceff43.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  77. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  78. package/assets/esri/core/workers/chunks/e97bffa614ad89105f38.js +1 -0
  79. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  80. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  81. package/assets/esri/core/workers/chunks/f06d185e7defc4272ae7.js +1 -0
  82. package/assets/esri/core/workers/chunks/f18fdfcb3d5d7851e6fc.js +1 -0
  83. package/assets/esri/core/workers/chunks/f2f3ce7a0f3e394d27c4.js +1 -0
  84. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → f619ab4a3ff3036641a9.js} +1 -1
  85. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  86. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  87. package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fa6e59e72c6e1fa79cf8.js} +1 -1
  88. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  89. package/assets/esri/core/workers/chunks/{4a2bf3c8da24abd8b9e2.js → fd410a56286f9b8a5903.js} +1 -1
  90. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  91. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  92. package/assets/esri/themes/base/widgets/_Editor.scss +36 -2
  93. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  94. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  95. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  96. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  97. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  98. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  99. package/assets/esri/themes/dark/main.css +1 -1
  100. package/assets/esri/themes/light/main.css +1 -1
  101. package/assets/esri/themes/light/view.css +1 -1
  102. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -1
  103. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -1
  104. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -1
  105. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -1
  106. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -1
  107. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -1
  108. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -1
  109. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -1
  110. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -1
  111. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -1
  112. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -1
  113. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -1
  114. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -1
  115. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -1
  116. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -1
  117. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -1
  118. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -1
  119. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -1
  120. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -1
  121. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -1
  122. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -1
  123. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -1
  124. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -1
  125. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -1
  126. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -1
  127. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -1
  128. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -1
  129. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -1
  130. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -1
  131. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -1
  132. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -1
  133. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -1
  134. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -1
  135. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -1
  136. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -1
  137. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -1
  138. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -1
  139. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -1
  140. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  185. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  186. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  187. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  188. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  189. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  190. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  191. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  192. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  193. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  219. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  220. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  221. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  222. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  223. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  224. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  225. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  226. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  227. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  228. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  229. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  230. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  231. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  232. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  233. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  234. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  235. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  236. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  237. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  238. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  239. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  240. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  241. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  242. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  243. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  244. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  245. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  246. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  247. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  248. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  249. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  250. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  251. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  252. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  253. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  254. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  258. package/chunks/GlowComposition.glsl.js +46 -46
  259. package/chunks/MultiPathImpl.js +1 -1
  260. package/chunks/OITBlend.glsl.js +3 -3
  261. package/chunks/Point2D.js +1 -1
  262. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  263. package/chunks/UnitFactory.js +1 -1
  264. package/chunks/bundle.js +1 -1
  265. package/config.js +1 -1
  266. package/copyright.txt +0 -60
  267. package/core/has.js +1 -1
  268. package/core/sanitizerUtils.js +1 -1
  269. package/core/workers/utils.js +1 -1
  270. package/core/workers/workerFactory.js +1 -1
  271. package/editing/fieldUtils.js +5 -0
  272. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  273. package/editing/templateUtils.js +1 -1
  274. package/form/FormTemplate.js +1 -1
  275. package/form/elements/Element.js +1 -1
  276. package/form/elements/FieldElement.js +1 -1
  277. package/form/elements/GroupElement.js +1 -1
  278. package/geometry/operators/gx/operatorOffset.js +1 -1
  279. package/geometry/operators/support/jsonConverter.js +1 -1
  280. package/graphic/graphicOriginUtils.js +1 -1
  281. package/interfaces.d.ts +2069 -253
  282. package/intl/date.js +1 -1
  283. package/intl.d.ts +2 -0
  284. package/intl.js +1 -1
  285. package/kernel.js +1 -1
  286. package/layers/FeatureLayer.js +1 -1
  287. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  288. package/layers/OrientedImageryLayer.js +1 -1
  289. package/layers/ParquetLayer.js +1 -1
  290. package/layers/PointCloudLayer.js +1 -1
  291. package/layers/SceneLayer.js +1 -1
  292. package/layers/VideoLayer.js +1 -1
  293. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  294. package/layers/graphics/data/QueryEngineResult.js +1 -1
  295. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  296. package/layers/graphics/sources/ParquetSource.js +1 -1
  297. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  298. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  299. package/layers/knowledgeGraph/layerUtils.js +1 -1
  300. package/layers/mixins/ImageryTileMixin.js +1 -1
  301. package/layers/mixins/SceneService.js +1 -1
  302. package/layers/ogc/ogcFeatureUtils.js +1 -1
  303. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  304. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  305. package/layers/support/NumberFieldFormat.js +1 -1
  306. package/layers/support/TitleCreator.js +1 -1
  307. package/layers/support/fieldConfigUtils.js +1 -1
  308. package/layers/support/fieldFormatUtils.js +1 -1
  309. package/layers/support/fieldUtils.js +1 -1
  310. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  311. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  312. package/layers/support/rasterFieldUtils.js +1 -1
  313. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  314. package/layers/video/VideoController.js +1 -1
  315. package/libs/parquet/parquet.js +1 -1
  316. package/networks/CircuitManager.d.ts +4 -0
  317. package/networks/UnitIdentifierManager.d.ts +4 -0
  318. package/networks/support/Circuit.d.ts +4 -0
  319. package/networks/support/CircuitLocation.d.ts +4 -0
  320. package/networks/support/CircuitPath.d.ts +4 -0
  321. package/networks/support/CircuitPathConnectivityElement.d.ts +4 -0
  322. package/networks/support/CircuitSection.d.ts +4 -0
  323. package/networks/support/Subcircuit.d.ts +4 -0
  324. package/package.json +5 -5
  325. package/popup/FieldInfo.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/schemas/definitions.js +1 -1
  328. package/renderers/support/RasterSymbolizer.js +1 -1
  329. package/rest/knowledgeGraphService.d.ts +1 -0
  330. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +4 -0
  331. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +4 -0
  332. package/rest/networks/support/TelecomNetworkElement.d.ts +4 -0
  333. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +4 -0
  334. package/rest/print.js +1 -1
  335. package/rest/versionManagement/getVersionInfos.js +1 -1
  336. package/smartMapping/renderers/size.js +1 -1
  337. package/smartMapping/statistics/histogram.js +1 -1
  338. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  339. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  340. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  341. package/smartMapping/support/adapters/support/utils.js +1 -1
  342. package/smartMapping/support/utils.js +1 -1
  343. package/support/basemapDefinitions.js +1 -1
  344. package/support/elevationInfoUtils.js +1 -1
  345. package/support/popupUtils.js +1 -1
  346. package/support/revision.js +1 -1
  347. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  348. package/symbols/cim/cimAnalyzer.js +1 -1
  349. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  350. package/symbols/support/symbolUtils.js +1 -1
  351. package/symbols/support/utils.js +1 -1
  352. package/undoredo/support/ServiceVersionInfo.js +1 -1
  353. package/undoredo/support/Services.js +1 -1
  354. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  355. package/views/2d/engine/Bitmap.js +1 -1
  356. package/views/2d/engine/flow/dataUtils.js +1 -1
  357. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  358. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  359. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  361. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  362. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  363. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  364. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  365. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  366. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  367. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  368. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  369. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  370. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  371. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  372. package/views/2d/layers/features/Processor.js +1 -1
  373. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  374. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  375. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  376. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  377. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  378. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  379. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  380. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  381. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  382. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  383. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  384. package/views/2d/layers/features/schema/ExceedsLimitCache.js +5 -0
  385. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  386. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  387. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  388. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  389. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  390. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  391. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  392. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  393. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  394. package/views/2d/layers/features/sources/strategies/constants.js +5 -0
  395. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  396. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  397. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  398. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  399. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  400. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  401. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  402. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  403. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  404. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  405. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  406. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  407. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  408. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  409. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  410. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  411. package/views/3d/layers/FlowSubView3D.js +1 -1
  412. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  413. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  414. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  415. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  416. package/views/3d/layers/TiledLayerView3D.js +1 -1
  417. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  418. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  419. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  420. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  421. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  422. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  423. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  424. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  425. package/views/3d/layers/support/FeatureTile.js +1 -1
  426. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  427. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  428. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  429. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  430. package/views/3d/state/ViewStateManager.js +1 -1
  431. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  432. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  433. package/views/3d/state/controllers/RotateController.js +1 -1
  434. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  435. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  436. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  437. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  438. package/views/3d/state/utils/navigationUtils.js +1 -1
  439. package/views/3d/support/DisplayQualityProfile.js +1 -1
  440. package/views/3d/support/QualitySettings.js +1 -1
  441. package/views/3d/support/engineContent/line.js +1 -1
  442. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  443. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  444. package/views/3d/support/flow/FlowWorker.js +1 -1
  445. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  446. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  447. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  448. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  449. package/views/3d/support/flow/constants.js +1 -1
  450. package/views/3d/support/flow/geometryUtils.js +1 -1
  451. package/views/3d/support/flow/loadUtils.js +1 -1
  452. package/views/3d/support/hitTest.js +1 -1
  453. package/views/3d/support/popupHitTest.js +1 -1
  454. package/views/3d/terrain/OverlayRenderer.js +1 -1
  455. package/views/3d/terrain/TerrainSurface.js +1 -1
  456. package/views/3d/terrain/TileAgent.js +1 -1
  457. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  458. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  459. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  460. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  461. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  462. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  463. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  464. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  465. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  466. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  467. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +10 -4
  468. package/views/SceneView.js +1 -1
  469. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  470. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  471. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  472. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  473. package/views/analysis/ElevationProfile/constants.js +1 -1
  474. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  475. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  476. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  477. package/views/analysis/ElevationProfile/types.js +5 -0
  478. package/views/draw/support/Reshape.js +1 -1
  479. package/views/interactive/dragEventPipeline.js +1 -1
  480. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  481. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  482. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  483. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  484. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  485. package/views/layers/FeatureLayerView.js +1 -1
  486. package/views/support/PromiseQueue.js +1 -1
  487. package/views/support/Scheduler.js +1 -1
  488. package/views/support/TextureCompressionWorker.js +1 -1
  489. package/views/webgl/Texture.js +1 -1
  490. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  491. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  492. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  493. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  494. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  495. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  496. package/widgets/BatchAttributeForm.js +1 -1
  497. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  498. package/widgets/CoordinateConversion.js +1 -1
  499. package/widgets/Directions/css.js +1 -1
  500. package/widgets/Directions.js +1 -1
  501. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  502. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  503. package/widgets/Editor/EditorViewModel.js +1 -1
  504. package/widgets/Editor/Edits.js +1 -1
  505. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  506. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  507. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  508. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  509. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  510. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  511. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  512. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  513. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  514. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  515. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  516. package/widgets/Editor/UpdateWorkflow.js +1 -1
  517. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  518. package/widgets/Editor/VisibleElements.js +1 -1
  519. package/widgets/Editor/Workflow.js +1 -1
  520. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  521. package/widgets/Editor/components/FeatureList.js +1 -1
  522. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  523. package/widgets/Editor/components/Notices.js +1 -1
  524. package/widgets/Editor/components/PanelContent.js +1 -1
  525. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  526. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  527. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  528. package/widgets/Editor/css.js +1 -1
  529. package/widgets/Editor/support/EditorItem.js +1 -1
  530. package/widgets/Editor/support/SketchController.js +1 -1
  531. package/widgets/Editor/support/errors.js +5 -0
  532. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  533. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  534. package/widgets/Editor/workflowUtils.js +1 -1
  535. package/widgets/Editor.js +1 -1
  536. package/widgets/Feature/FeatureExpression.js +1 -1
  537. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  538. package/widgets/Feature/FeatureFields.js +1 -1
  539. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  540. package/widgets/Feature/FeatureMedia.js +1 -1
  541. package/widgets/Feature/FeatureViewModel.js +1 -1
  542. package/widgets/Feature/support/featureUtils.js +1 -1
  543. package/widgets/Feature.js +1 -1
  544. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  545. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  546. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  547. package/widgets/FeatureForm/FieldInput.js +1 -1
  548. package/widgets/FeatureForm/InputBase.js +1 -1
  549. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  550. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  551. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  552. package/widgets/FeatureTable/FieldColumn.js +1 -1
  553. package/widgets/FeatureTable/Grid/Column.js +1 -1
  554. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  555. package/widgets/Legend/LegendViewModel.js +1 -1
  556. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  557. package/widgets/Legend/support/utils.js +1 -1
  558. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  559. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  560. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  561. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  562. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  563. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  564. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  565. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  566. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  567. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  568. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  569. package/widgets/OrientedImageryViewer.js +1 -1
  570. package/widgets/PanoramicVideoViewer.js +1 -1
  571. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  572. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  573. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  574. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  575. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  576. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  577. package/widgets/Print.js +1 -1
  578. package/widgets/Search/LayerSearchSource.js +1 -1
  579. package/widgets/Sketch/SketchViewModel.js +1 -1
  580. package/widgets/Sketch.js +1 -1
  581. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  582. package/widgets/UtilityNetworkTrace.js +1 -1
  583. package/widgets/support/ColorPicker.js +1 -1
  584. package/widgets/support/FilterCondition.js +1 -1
  585. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  586. package/widgets/support/SelectionList/LayerItem.js +1 -1
  587. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  588. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  589. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  590. package/widgets/support/SelectionList.js +1 -1
  591. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  592. package/widgets/support/iconUtils.js +1 -1
  593. package/widgets/support/jsxWidgetSupport.js +1 -1
  594. package/assets/esri/core/workers/chunks/02bc183e30e3392bb76d.js +0 -1
  595. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  596. package/assets/esri/core/workers/chunks/14ace5dc4b8984212a57.js +0 -1
  597. package/assets/esri/core/workers/chunks/1762ff76350065750c75.js +0 -1
  598. package/assets/esri/core/workers/chunks/1b85967d1178956ee36b.js +0 -1
  599. package/assets/esri/core/workers/chunks/1fd459234917a51b6ae1.js +0 -1
  600. package/assets/esri/core/workers/chunks/22bb877b85ae250d7819.js +0 -1
  601. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  602. package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +0 -1
  603. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +0 -1
  604. package/assets/esri/core/workers/chunks/2795a2817ebe3298c350.js +0 -1
  605. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  606. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  607. package/assets/esri/core/workers/chunks/37d05d9796917c3d4b7a.js +0 -1
  608. package/assets/esri/core/workers/chunks/3b65d6a78fbffca37fbd.js +0 -1
  609. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  610. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  611. package/assets/esri/core/workers/chunks/48646f3d95a3f2b17e78.js +0 -1
  612. package/assets/esri/core/workers/chunks/50a5caa96c111dda5c60.js +0 -1
  613. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  614. package/assets/esri/core/workers/chunks/5a527a47285a5995cff9.js +0 -1
  615. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  616. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +0 -1
  617. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  618. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  619. package/assets/esri/core/workers/chunks/630efe10c871425b6a95.js +0 -1
  620. package/assets/esri/core/workers/chunks/65111858957f43eacd8c.js +0 -1
  621. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  622. package/assets/esri/core/workers/chunks/701a1835684cf815bcb7.js +0 -1
  623. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  624. package/assets/esri/core/workers/chunks/7633537dc0c65d655baf.js +0 -1
  625. package/assets/esri/core/workers/chunks/78b35a19332e58c8c279.js +0 -1
  626. package/assets/esri/core/workers/chunks/7fa324900c147ba51019.js +0 -1
  627. package/assets/esri/core/workers/chunks/83ab8c8bc9e6990114a8.js +0 -1
  628. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  629. package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +0 -1
  630. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  631. package/assets/esri/core/workers/chunks/ae8c387d59be87457567.js +0 -1
  632. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  633. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  634. package/assets/esri/core/workers/chunks/b54202dcab8df080e991.js +0 -1
  635. package/assets/esri/core/workers/chunks/ba212ba895ccf573eedf.js +0 -1
  636. package/assets/esri/core/workers/chunks/bcff6178e9d16b1b6191.js +0 -1
  637. package/assets/esri/core/workers/chunks/cf13625a033f9903655f.js +0 -1
  638. package/assets/esri/core/workers/chunks/deb2854bb7d082a26f52.js +0 -1
  639. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  640. package/assets/esri/core/workers/chunks/eb1a7bb8b14e651bc241.js +0 -1
  641. package/assets/esri/core/workers/chunks/f09242e97196ad177c10.js +0 -1
  642. package/assets/esri/core/workers/chunks/f154336b4af011cd0c56.js +0 -1
  643. package/assets/esri/core/workers/chunks/f1be3a177328a169128f.js +0 -1
  644. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  645. package/assets/esri/core/workers/chunks/f7a9d2da07196a0989ae.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{splitIntoChunks as e}from"../../../core/arrayUtils.js";import{lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as r,throwIfNotAbortError as n,after as o,isAbortError as s}from"../../../core/promiseUtils.js";import i from"../../../geometry/Multipoint.js";import{unnormalizedCoordinate as l}from"../../../geometry/support/coordsUtils.js";import{getInfo as a}from"../../../geometry/support/spatialReferenceUtils.js";import{getConfig as c,errorResult as u}from"./constants.js";import{InvalidGeometryError as p,TooComplexError as f,ElevationQueryError as m}from"./elevationProfileErrors.js";import{isValidInputPath as d,countPoints as h,densifyPath as y}from"./elevationProfileGeometryUtils.js";import{getStatistics as w}from"./elevationProfileStatisticsUtils.js";import{breadthFirstBinaryPartitioning as g}from"./elevationProfileTraversalUtils.js";import{ScheduledQueueProcessor as v}from"../../support/ScheduledQueueProcessor.js";import{TaskPriority as P}from"../../support/Scheduler.js";async function*j(e,t){const{view:n,geometry:s,elevationInfo:i,providers:l,options:a}=e,u=n.spatialReference;if(!u||null==s||!d(s))throw new p;const m=l.length;if(0===m)return null;const w=Math.round(a.maxTotalSamples/m);if(h(s)>w)throw new f;const g=await y(s,i,n,u,a,w,t);r(t);let v=0;const P=new Array(m),j=new Array(m);for(let r=0;r<m;r++){const n=M(g);P[r]=n,v+=n.samples.length;const o={...e,provider:l[r],result:n,densificationResult:g};j[r]=R(o,t)[Symbol.iterator]()}if(v>a.maxTotalSamples)throw new f;const Z=await Promise.all(j.map(e=>{const t=e.next();return!0===t.done?Promise.resolve(null):t.value}));r(t);for(let r=0;r<m;r++)P[r]=Z[r];yield P,await o(e.delayAfterPreview??c().delayAfterPreviewMillis,null,t.signal),r(t);const S=[];try{let e;do{e=!1;for(let t=0;t<m;t++){const r=j[t].next();!1===r.done&&(S.push({resultPromise:r.value,index:t}),e=!0)}}while(e)}finally{j.forEach(e=>e.return?.())}for(const{resultPromise:o,index:c}of S)P[c]=await o,r(t),yield P;for(const r of P)null!=r&&(r.progress=1);yield P}function*R(t,r){const{densificationResult:n}=t,o={...t,abortOptions:r,densificationResult:n},s=g(0,o.result.samples.length),i=s.slice(0,o.provider.numSamplesForPreview);yield Z(o,i,!0);const l=e(s,o.provider.numSamplesPerChunk);for(const e of l)yield Z(o,e,!1)}async function Z({densificationResult:e,result:t,provider:r,queue:n,abortOptions:o,cache:l},a,p){const{densifiedPath:f,pathLength:m}=e,d=t.spatialReference,{samples:h}=t,y=[];for(let s=0;s<a.length;s++){const e=h[a[s]];y[s]=[...e.coordinate]}try{return await n.push({geometry:new i({spatialReference:d,points:y,hasZ:f.hasZ}),provider:r,indices:a,preview:p,result:t,parameters:{...c().defaultQueryOptions(),minDemResolution:p?Math.round(m/r.numSamplesForPreview):Math.round(m/h.length),cache:l}},o),{...t}}catch(w){return s(w)?null:u}}function S(e){return new v({priority:P.ELEVATION_PROFILE,concurrency:1,scheduler:e,process:async e=>{r(e.parameters);try{await U(e)}catch(t){n(t)}}})}async function U({geometry:e,provider:t,indices:r,preview:n,result:o,parameters:s}){if(0===r.length)return;const i=(await b(t,e,s)).geometry,{hasZ:l,points:a}=i,c=s.noDataValue,{samples:u}=o;for(let p=0;p<r.length;p++){const e=u[r[p]];if(e.isHole)continue;const t=l?a[p][2]:null;null===t||t===c?e.sampledZ=null:(o.hasZ=!0,e.sampledZ=t),e.sampled=!0}x(u),o.progress=n?0:o.progress+r.length/u.length,o.statistics=w(o.samples,o.spatialReference)}function x(e){const t=e.length-1;let r=0;for(let n=1;n<=t;n++){(e[n].sampled||n===t)&&(E(e,r,n),r=n)}}function E(e,r,n){if(n-r===1)return;const o=e[r],s=o.sampledZ,i=e[n],l=i.sampledZ;if(null==s||null==l){for(let t=r+1;t<n;t++)e[t].sampledZ=null;return}const a=o.distance,c=i.distance-a;for(let u=r+1;u<n;u++){const r=e[u],n=(r.distance-a)/c;r.sampledZ=t(s,l,n)}}function M({densifiedPath:e,distances:t}){const r=e.spatialReference,n=a(r),o=e.paths,s=o.length,i=[];let c=null,u=0;for(let a=0;a<s;a++){const e=o[a],r=e.length,s=t[a];for(let t=0;t<r;t++){const r=e[t],o=s[t];n&&(r[0]=l(r[0],n.valid[0],n.valid[1])),c&&0===t&&A(i,c,r,u,o),i.push(O(r,o)),c=r,u=o}}return{progress:0,samples:i,hasZ:!1,statistics:null,spatialReference:r}}function A(e,t,r,n,o){e.push(T(t,n)),e.push(T(r,o))}function O(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!1,isHole:!1}}function T(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!0,isHole:!0}}async function b(e,t,r){try{return await e.queryElevation(t,r)}catch(n){throw new m}}function F(e,t,r){if(!e||0===e.length)return;const n=e.length-1,o=e[0];if(t<=r(o))return o;const s=e[n];if(t>=r(s))return s;let i=0,l=0,a=n;for(;i<a;){l=i+Math.floor((a-i)/2);const o=e[l],s=r(o);if(s===t)return o;if(t<s){if(l>0){const n=e[l-1],i=r(n);if(t>i)return t-i>=s-t?o:n}a=l}else{if(l<n){const n=e[l+1],i=r(n);if(t<i)return t-s>=i-t?n:o}i=l+1}}return e[l]}export{F as binaryFindClosest,S as createProfileQueue,R as generateProfile,j as generateProfiles,x as interpolateElevations};
5
+ import{splitIntoChunks as e}from"../../../core/arrayUtils.js";import{lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as r,throwIfNotAbortError as n,after as o,isAbortError as s}from"../../../core/promiseUtils.js";import i from"../../../geometry/Multipoint.js";import{unnormalizedCoordinate as l}from"../../../geometry/support/coordsUtils.js";import{getInfo as a}from"../../../geometry/support/spatialReferenceUtils.js";import{getConfig as c,errorResult as u}from"./constants.js";import{InvalidGeometryError as p,TooComplexError as f,ElevationQueryError as m}from"./elevationProfileErrors.js";import{isValidInputPath as d,countPoints as h,densifyPath as y}from"./elevationProfileGeometryUtils.js";import{getStatistics as w}from"./elevationProfileStatisticsUtils.js";import{breadthFirstBinaryPartitioning as g}from"./elevationProfileTraversalUtils.js";import{ScheduledQueueProcessor as v}from"../../support/ScheduledQueueProcessor.js";import{TaskPriority as P}from"../../support/Scheduler.js";async function*j(e,t){const{view:n,geometry:s,elevationInfo:i,providers:l,options:a}=e,u=n.spatialReference;if(!u||null==s||!d(s))throw new p;const m=l.length;if(0===m)return null;const w=Math.round(a.maxTotalSamples/m);if(h(s)>w)throw new f;const g=await y(s,i,n,u,a,w,t);r(t);let v=0;const P=new Array(m),j=new Array(m);for(let r=0;r<m;r++){const n=M(g);P[r]=n,v+=n.samples.length;const o={...e,provider:l[r],result:n,densificationResult:g};j[r]=R(o,t)[Symbol.iterator]()}if(v>a.maxTotalSamples)throw new f;const Z=await Promise.all(j.map(e=>{const t=e.next();return!0===t.done?Promise.resolve(null):t.value}));r(t);for(let r=0;r<m;r++)P[r]=Z[r];yield P,await o(e.delayAfterPreview??c().delayAfterPreviewMillis,null,t.signal),r(t);const S=[];try{let e;do{e=!1;for(let t=0;t<m;t++){const r=j[t].next();!1===r.done&&(S.push({resultPromise:r.value,index:t}),e=!0)}}while(e)}finally{j.forEach(e=>e.return?.())}for(const{resultPromise:o,index:c}of S)P[c]=await o,r(t),yield P;for(const r of P)null!=r&&(r.progress=1);yield P}function*R(t,r){const{densificationResult:n}=t,o={...t,abortOptions:r,densificationResult:n},s=g(0,o.result.samples.length),i=s.slice(0,o.provider.numSamplesForPreview);yield Z(o,i,!0);const l=e(s,o.provider.numSamplesPerChunk);for(const e of l)yield Z(o,e,!1)}async function Z({densificationResult:e,result:t,provider:r,queue:n,abortOptions:o,cache:l},a,p){const{densifiedPath:f,pathLength:m}=e,d=t.spatialReference,{samples:h}=t,y=[];for(let s=0;s<a.length;s++){const e=h[a[s]];y[s]=[...e.coordinate]}try{return await n.push({geometry:new i({spatialReference:d,points:y,hasZ:f.hasZ}),provider:r,indices:a,preview:p,result:t,parameters:{...c().defaultQueryOptions(),minDemResolution:p?Math.round(m/r.numSamplesForPreview):Math.round(m/h.length),cache:l}},o),{...t}}catch(w){return s(w)?null:u}}function S(e){return new v({priority:P.ELEVATION_PROFILE,concurrency:1,scheduler:e,process:async e=>{r(e.parameters);try{await U(e)}catch(t){n(t)}}})}async function U({geometry:e,provider:t,indices:r,preview:n,result:o,parameters:s}){if(0===r.length)return;const i=(await b(t,e,s)).geometry,{hasZ:l,points:a}=i,c=s.noDataValue,{samples:u}=o;for(let p=0;p<r.length;p++){const e=u[r[p]];if(e.isHole)continue;const t=l?a[p][2]:null;null===t||t===c?e.sampledZ=null:(o.hasZ=!0,e.sampledZ=t),e.sampled=!0}x(u),o.progress=n?0:o.progress+r.length/u.length,o.statistics=w(o.samples,o.spatialReference)}function x(e){const t=e.length-1;let r=0;for(let n=1;n<=t;n++){(e[n].sampled||n===t)&&(E(e,r,n),r=n)}}function E(e,r,n){if(n-r===1)return;const o=e[r],s=o.sampledZ,i=e[n],l=i.sampledZ;if(null==s||null==l){for(let t=r+1;t<n;t++)e[t].sampledZ=null;return}const a=o.distance,c=i.distance-a;for(let u=r+1;u<n;u++){const r=e[u],n=(r.distance-a)/c;r.sampledZ=t(s,l,n)}}function M({densifiedPath:e,distances:t}){const r=e.spatialReference,n=a(r),o=e.paths,s=o.length,i=[];let c=null,u=0;for(let a=0;a<s;a++){const e=o[a],r=e.length,s=t[a];for(let t=0;t<r;t++){const r=e[t],o=s[t];n&&(r[0]=l(r[0],n.valid[0],n.valid[1])),c&&0===t&&A(i,c,r,u,o),i.push(O(r,o)),c=r,u=o}}return{progress:0,samples:i,hasZ:!1,statistics:null,spatialReference:r}}function A(e,t,r,n,o){e.push(T(t,n)),e.push(T(r,o))}function O(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!1,isHole:!1}}function T(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!0,isHole:!0}}async function b(e,t,r){try{return await e.queryElevation(t,r)}catch(n){throw new m}}function F(e,t,r){if(!e||0===e.length)return;const n=e.length-1,o=e[0];if(t<=r(o))return o;const s=e[n];if(t>=r(s))return s;let i=0,l=0,a=n;for(;i<a;){l=i+Math.floor((a-i)/2);const o=e[l],s=r(o);if(s===t)return o;if(t<s){if(l>0){const n=e[l-1],i=r(n);if(t>i)return t-i>=s-t?o:n}a=l}else{if(l<n){const n=e[l+1],i=r(n);if(t<i)return t-s>=i-t?n:o}i=l+1}}return e[l]}function H(e){return e>.999999?1:e}export{F as binaryFindClosest,S as createProfileQueue,R as generateProfile,j as generateProfiles,x as interpolateElevations,H as sanitizeProgress};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{l as i}from"../../../chunks/vec32.js";import a from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projectionUtils.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as h,inverseGeodeticSolver as p,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function y(e,t,s,o,i,a,h){let p,m,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(h),v=t(e,{unit:"meters"}),n(h)}const P=1/r(o);if(j){await c([{source:y,dest:o},{source:y,dest:l.WGS84}],h);const n=O(e);p=f([n],"meters")[0];const r=w(p,i);if(B(e,p,r)>a)throw new g;const j=R(n,t,s);({densifiedPath:m,distances:d}=G(j,r,P)),m=u(m,o)}else{await c([{source:y,dest:o}],h),p=v;const r=w(p,i);if(B(e,p,r)>a)throw new g;const l=R(e,t,s);({densifiedPath:m,distances:d}=z(l,r,P)),n(h),m=u(m,o)}return{densifiedPath:m,pathLength:p*P,distances:d}}function w(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function R(e,t,n){if(null==t)return P(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let i=null;switch(n.type){case"2d":i=j(e,s,o);break;case"3d":i=v(e,s,o,n)}return null==i?P(e):new a({hasZ:!0,hasM:!1,spatialReference:r,paths:Z(e.paths,i)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function P(e){return e.hasZ?new a({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:Z(e.paths,([e,t])=>[e,t])}):e}function Z(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,i=new Array(n.length);r[s]=i;for(let e=0;e<o;++e)i[e]=t(n[e])}return r}function M(e){return U(e)&&e.paths.some(e=>e.length>1)}function x(e){return S(e)&&M(e.geometry)}function S(e){return b(e)&&U(e?.geometry)}function U(e){return!b(e)&&null!=e&&"polyline"===e.type}function b(e){return null!=e&&"geometry"in e}function A(t,n,s,o,i){const{spatialReference:c,hasZ:u}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:c,metersPerSR:r(c)},f=[],h=[];let p=0;for(let r=0;r<t.paths.length;++r){const a=t.paths[r],c=new Array,u=new Array;let m=0;for(let t=1;t<a.length;++t){const r=a[t-1],f=a[t],h=o(l,r,f);let d;for(d=m;d<h.distance&&!e(d,h.distance);d+=n)c.push(i(h,d)),u.push((p+d)*s);m=d-h.distance,p+=h.distance,c.push(f),u.push(p*s)}f[r]=c,h[r]=u}return{densifiedPath:new a({spatialReference:c,hasZ:u,paths:f}),distances:h}}function z(e,t,n){const{hasZ:r}=e;return A(e,t,n,k,r?L:I)}function G(e,t,n){const{hasZ:r}=e;return A(e,t,n,W,r?D:E)}function W(e,t,n){return e.distance=0,p(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function k(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function E({from:e,azimuth:t,spatialReference:n},r){return m([0,0],e,t,r,n)}function D({from:e,to:n,azimuth:r,distance:s,spatialReference:o},i){const a=i/s,c=[0,0,t(e[2],n[2],a)];return m(c,e,r,i,o),c}function I({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function L({from:e,to:t,distance:n},r){return i([0,0,0],e,t,r/n)}function O(e){return h(e.spatialReference)?e:u(e,l.WGS84)}function q(e){return e.paths.reduce((e,t)=>e+t.length,0)}function B(e,t,n){return q(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{q as countPoints,y as densifyPath,b as isGraphic,U as isPolyline,S as isPolylineGraphic,x as isValidInputGraphic,M as isValidInputPath,R as toAbsoluteHeightElevation};
5
+ import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{l as i}from"../../../chunks/vec32.js";import a from"../../../geometry/Polyline.js";import{initializeProjection as c,project as u}from"../../../geometry/projectionUtils.js";import l from"../../../geometry/SpatialReference.js";import{geodesicLengths as f,isSupported as h,inverseGeodeticSolver as p,directGeodeticSolver as m}from"../../../geometry/support/geodesicUtils.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function y(e,t,s,o,i,a,h){let p,m,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{execute:t}=await import("../../../geometry/operators/lengthOperator.js");n(h),v=t(e,{unit:"meters"}),n(h)}const P=1/r(o);if(j){await c([{source:y,dest:o},{source:y,dest:l.WGS84}],h);const n=q(e);p=f([n],"meters")[0];const r=w(p,i);if(C(e,p,r)>a)throw new g;const j=R(n,t,s);({densifiedPath:m,distances:d}=W(j,r,P)),m=u(m,o)}else{await c([{source:y,dest:o}],h),p=v;const r=w(p,i);if(C(e,p,r)>a)throw new g;const l=R(e,t,s);({densifiedPath:m,distances:d}=G(l,r,P)),n(h),m=u(m,o)}return{densifiedPath:m,pathLength:p*P,distances:d}}function w(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function R(e,t,n){if(null==t)return P(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let i=null;switch(n.type){case"2d":i=j(e,s,o);break;case"3d":i=v(e,s,o,n)}return null==i?P(e):new a({hasZ:!0,hasM:!1,spatialReference:r,paths:Z(e.paths,i)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function P(e){return e.hasZ?new a({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:Z(e.paths,([e,t])=>[e,t])}):e}function Z(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,i=new Array(n.length);r[s]=i;for(let e=0;e<o;++e)i[e]=t(n[e])}return r}function M(e){return U(e)&&e.paths.some(e=>e.length>1)}function x(e){return S(e)&&M(e.geometry)}function S(e){return b(e)&&U(e?.geometry)}function U(e){return!b(e)&&null!=e&&"polyline"===e.type}function b(e){return null!=e&&"geometry"in e}function A(e){const t=e?.layer;return null!=t&&"graphics"===t.type&&t.internal}function z(t,n,s,o,i){const{spatialReference:c,hasZ:u}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:c,metersPerSR:r(c)},f=[],h=[];let p=0;for(let r=0;r<t.paths.length;++r){const a=t.paths[r],c=new Array,u=new Array;let m=0;for(let t=1;t<a.length;++t){const r=a[t-1],f=a[t],h=o(l,r,f);let d;for(d=m;d<h.distance&&!e(d,h.distance);d+=n)c.push(i(h,d)),u.push((p+d)*s);m=d-h.distance,p+=h.distance,c.push(f),u.push(p*s)}f[r]=c,h[r]=u}return{densifiedPath:new a({spatialReference:c,hasZ:u,paths:f}),distances:h}}function G(e,t,n){const{hasZ:r}=e;return z(e,t,n,E,r?O:L)}function W(e,t,n){const{hasZ:r}=e;return z(e,t,n,k,r?I:D)}function k(e,t,n){return e.distance=0,p(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function E(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function D({from:e,azimuth:t,spatialReference:n},r){return m([0,0],e,t,r,n)}function I({from:e,to:n,azimuth:r,distance:s,spatialReference:o},i){const a=i/s,c=[0,0,t(e[2],n[2],a)];return m(c,e,r,i,o),c}function L({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function O({from:e,to:t,distance:n},r){return i([0,0,0],e,t,r/n)}function q(e){return h(e.spatialReference)?e:u(e,l.WGS84)}function B(e){return e.paths.reduce((e,t)=>e+t.length,0)}function C(e,t,n){return B(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{B as countPoints,y as densifyPath,b as isGraphic,A as isInternalGraphic,U as isPolyline,S as isPolylineGraphic,x as isValidInputGraphic,M as isValidInputPath,R as toAbsoluteHeightElevation};
@@ -0,0 +1,5 @@
1
+ import "../../../interfaces";
2
+
3
+ export type ElevationProfilePlacementResult = __esri.ElevationProfileTypes.ElevationProfilePlacementResult;
4
+ export type ElevationProfilePickResult = __esri.ElevationProfileTypes.ElevationProfilePickResult;
5
+ export type ElevationProfileEffectiveDisplayUnits = __esri.ElevationProfileTypes.ElevationProfileEffectiveDisplayUnits;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ function n(){}export{n as __exported__};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,assertIsSome as p,abortMaybe as c}from"../../../core/maybe.js";import{pausable as l,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import g from"../../../geometry/Point.js";import f from"../../../geometry/Polyline.js";import{fromGeometry as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as b}from"../../../geometry/support/coordsUtils.js";import{isPoint as C}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as S}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as E,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as O,isCircularArc as V,isEllipticArc4 as I,isBezierCurve as P,isCoordinate as k,isEllipticArc7 as H}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as j}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as L}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as U,cloneMove as F}from"./drawUtils.js";import D from"./GraphicMover.js";import z from"./HighlightHelper.js";import{addUniqueLayer as K,isConnectedReshapeSupportedLayer as N}from"./layerUtils.js";import{createTooltipInfos as q,connectTooltip as Z,updateTranslateTooltipInfo as $,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as W,createCurveControlPointGraphics as X,createCurveConstructionLineGraphics as Y,attributeKeys as tt,getMidpoint as et,controlPointKinds as it,saveUpdatedCurveOrCoordinate as st,toolIdAttribute as ot,splitCurve as rt,isSingleSegmentCircle as nt,isSingleSegmentEllipse as at}from"./reshapeUtils.js";import{ViewEventPriorities as ht}from"../../input/InputManager.js";import{createCoordinateHelper as pt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as lt}from"../../interactive/editGeometry/EditGeometryOperations.js";import dt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as mt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as ut}from"../../interactive/tooltip/tooltipCommonUtils.js";const yt=Symbol();let _t=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this.tooltip=null,this.activeTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.sketchOptions=new dt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new z({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=l(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(wt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(wt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).items;i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=q(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;K(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ht.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Z(this.tooltip,()=>this._tooltipsContext),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??pt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t);this._editGeometryOperations=h(this._editGeometryOperations)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;null!=t&&"mesh"!==t.type&&"extent"!==t.type?this._editGeometryOperations??=lt.fromGeometry(t,2,{allowCurves:!0}):this._logGeometryTypeError()}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;p(i),this._snappingContext=new mt({editGeometryOperations:i,elevationInfo:{mode:"on-the-ground",offset:0},pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover?.destroy(),this._mover=null,this.removeHandles(yt)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=c(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=gt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=Q(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=W(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=X(t,this.symbols,this._coordinateHelper),i=Y(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[tt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).items;t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new L({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Vt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,It(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=gt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=U(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(tt.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=et(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Et(s);null!=t&&null!=e&&s.getAttribute(tt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Et(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(V(r)||I(r)){const i=O(t[e][o-1]),n=V(r)?E(i,r):R(i,r),[a,h]=S(n,.25);s.geometry=new g({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(P(r)){const t=s.getAttribute(tt.controlPointKind),[e,i]=t===it.bezier.cp1?r.b[1]:r.b[2];s.geometry=new g({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(tt.controlPointKind),[o,r]=Et(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===it.bezier.line1?s.geometry=new f({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new f({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Et(t);s===e&&o>=i&&t.setAttribute(tt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(tt.pathIndex)!==e)continue;const t=o.getAttribute(tt.pointIndexStart);t>=i&&(o.setAttribute(tt.pointIndexStart,t+1),o.setAttribute(tt.pointIndexEnd,o.getAttribute(tt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Et(t);return p(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){c(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&C(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new g(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry;if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=Et(t);let p=ft(r);const c=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,c),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),st(r,p)}this._updateGraphicGeometry(r.clone()),this._editGeometryOperations=lt.fromGeometry(r,2,{allowCurves:!0}),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=Et(s);St(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Et(n),h=n.getAttribute(tt.relatedGraphicIndices),p=F(n.geometry,i,s,this.view),c=b(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,c,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Et(e);St(t,s,o,c,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?xt(e,i,s,[o[0],o[1]],t.getAttribute(tt.controlPointKind)):(St(e,i,s,o,r),n&&(0===s?St(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(yt),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[tt.pathIndex]:r,[tt.pointIndexStart]:n,[tt.pointIndexEnd]:a}=e.attributes,h=b(e.geometry),p=0===a?n+1:a;e.attributes={[tt.tool]:ot,[tt.pathIndex]:r,[tt.pointIndex]:p,[tt.relatedGraphicIndices]:[]};const c=ft(s),l=c[r][a];if(k(l)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(c[r][p]);c[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(tt.controlPointKind,it.circle.interior),e.setAttribute(tt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),st(s,c)}else c[r].splice(p,0,h),o.push({coordinates:c[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(c[r][n]),e=rt(t,l,.5,this._coordinateHelper);c[r].splice(a,1,...e),o.push({coordinates:O(c[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),o}_addToSelection(t){const e=Ot(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&ut(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&this._removeVertices(this.selectedManipulators)}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=ft(o);const n=[],a=Ot(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!k(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);st(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),yt)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,$(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function gt(t){const e=ft(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!k(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function ft(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Gt(t,e,i,s){const o=t[e][i];if(V(o))o.c[1]=s;else if(I(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function xt(t,e,i,s,o){switch(o){case it.circle.interior:Gt(t,e,i,s);break;case it.bezier.cp1:t[e][i].b[1]=s;break;case it.bezier.cp2:t[e][i].b[2]=s}}function Mt(t,e){return t<1e-8*e}function bt(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[c,l]=n,d=c-h,m=l-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],x=_*G-g*f,M=(d**2+m**2)/2;if(Mt(Math.abs(x),M))return[(h+c)/2,(p+l)/2];const[b,C]=[G/x*M,-f/x*M],S=b**2+C**2,[E,w]=[d/2-b,m/2-C];if(Mt(E**2+w**2,S)){const[t,e]=v?[-C,b]:[C,-b];return[t+b+h,e+C+p]}const O=Math.sqrt((b**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*O+b+h,w*O+C+p]}function Ct(t,e,i){const s=G(new f({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return H(r)?r:w(t,r)}function St(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(nt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(at(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,c]=[n-o,a-r],l=T(c,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,l,h,i.a[6]]})}const a=O(r);if(k(r))r.splice(0,r.length,...s);else if(P(r))r.b[0].splice(0,r.b[0].length,...s);else if(V(r)||I(r)){const o=O(t[e][i-1]),n=V(r)?E(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],bt(o,n,s,!0)]})}else if(H(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Ct(n,r,o).a}if(n&&!k(n)&&!P(r))if(V(n)||I(n)){const o=O(n),r=V(n)?E(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,bt(o,r,s,!1)]})}else if(H(n)){const t=O(r);n.a=Ct(t,n,o).a}}function Et({attributes:t}){return[t?.[tt.pathIndex]||0,t?.[tt.pointIndex]||0]}function wt({attributes:t}){return`${t?.[tt.pathIndex]}-${t?.[tt.pointIndex]}`}function Ot(t){return t instanceof e?[t]:[...t]}function Vt(t){const e=t.sourceLayer??t.layer;return N(e)?{graphic:t,layer:e}:null}function It(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[tt.pathIndex],vertexIndex:t[tt.pointIndex]}))}t([y()],_t.prototype,"_activeOperationInfo",void 0),t([y()],_t.prototype,"_connectedReshapeManager",void 0),t([y()],_t.prototype,"_coordinateHelper",null),t([y()],_t.prototype,"_editGeometryOperations",void 0),t([y()],_t.prototype,"tooltip",void 0),t([y()],_t.prototype,"tooltipInfos",void 0),t([y()],_t.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],_t.prototype,"_selectedManipulator",null),t([y()],_t.prototype,"_tooltipsContext",null),t([y()],_t.prototype,"callbacks",void 0),t([y()],_t.prototype,"connectedReshapeProviders",void 0),t([y()],_t.prototype,"enableMidpoints",void 0),t([y()],_t.prototype,"enableCurveOnMidpoint",void 0),t([y()],_t.prototype,"enableMovement",void 0),t([y()],_t.prototype,"enableVertices",void 0),t([y()],_t.prototype,"graphic",void 0),t([y()],_t.prototype,"highlightName",void 0),t([y()],_t.prototype,"highlightsEnabled",void 0),t([y()],_t.prototype,"layer",void 0),t([y()],_t.prototype,"snappingManager",void 0),t([y({readOnly:!0})],_t.prototype,"state",null),t([y()],_t.prototype,"symbols",void 0),t([y({type:dt})],_t.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],_t.prototype,"type",void 0),t([y({readOnly:!0})],_t.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"selectedManipulators",void 0),t([y()],_t.prototype,"view",void 0),_t=t([_("esri.views.draw.support.Reshape")],_t);const Pt=_t;export{Pt as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,assertIsSome as p,abortMaybe as c}from"../../../core/maybe.js";import{pausable as l,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import g from"../../../geometry/Point.js";import f from"../../../geometry/Polyline.js";import{fromGeometry as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as b}from"../../../geometry/support/coordsUtils.js";import{isPoint as C}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as S}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as E,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as O,isCircularArc as V,isEllipticArc4 as I,isBezierCurve as P,isCoordinate as k,isEllipticArc7 as H}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as j}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as L}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as U,cloneMove as F}from"./drawUtils.js";import D from"./GraphicMover.js";import z from"./HighlightHelper.js";import{addUniqueLayer as K,isConnectedReshapeSupportedLayer as N}from"./layerUtils.js";import{createTooltipInfos as q,connectTooltip as Z,updateTranslateTooltipInfo as $,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as W,createCurveControlPointGraphics as X,createCurveConstructionLineGraphics as Y,attributeKeys as tt,getMidpoint as et,controlPointKinds as it,saveUpdatedCurveOrCoordinate as st,toolIdAttribute as ot,splitCurve as rt,isSingleSegmentCircle as nt,isSingleSegmentEllipse as at}from"./reshapeUtils.js";import{ViewEventPriorities as ht}from"../../input/InputManager.js";import{createCoordinateHelper as pt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as lt}from"../../interactive/editGeometry/EditGeometryOperations.js";import dt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as mt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as ut}from"../../interactive/tooltip/tooltipCommonUtils.js";const yt=Symbol();let _t=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this.tooltip=null,this.activeTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.sketchOptions=new dt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new z({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=l(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(wt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(wt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).items;i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=q(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;K(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ht.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Z(this.tooltip,()=>this._tooltipsContext),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??pt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t);this._editGeometryOperations=h(this._editGeometryOperations)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;null!=t&&"mesh"!==t.type&&"extent"!==t.type?this._editGeometryOperations??=lt.fromGeometry(t,2,{allowCurves:!0}):this._logGeometryTypeError()}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;p(i),this._snappingContext=new mt({editGeometryOperations:i,elevationInfo:{mode:"on-the-ground",offset:0},pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover?.destroy(),this._mover=null,this.removeHandles(yt)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=c(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=gt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=Q(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=W(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=X(t,this.symbols,this._coordinateHelper),i=Y(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[tt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).items;t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new D({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new L({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Vt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,It(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=gt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=U(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(tt.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=et(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Et(s);null!=t&&null!=e&&s.getAttribute(tt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Et(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(V(r)||I(r)){const i=O(t[e][o-1]),n=V(r)?E(i,r):R(i,r),[a,h]=S(n,.25);s.geometry=new g({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(P(r)){const t=s.getAttribute(tt.controlPointKind),[e,i]=t===it.bezier.cp1?r.b[1]:r.b[2];s.geometry=new g({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(tt.controlPointKind),[o,r]=Et(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===it.bezier.line1?s.geometry=new f({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new f({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Et(t);s===e&&o>=i&&t.setAttribute(tt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(tt.pathIndex)!==e)continue;const t=o.getAttribute(tt.pointIndexStart);t>=i&&(o.setAttribute(tt.pointIndexStart,t+1),o.setAttribute(tt.pointIndexEnd,o.getAttribute(tt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Et(t);return p(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){c(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&C(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new g(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new g(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry;if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=Et(t);let p=ft(r);const c=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,c),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),st(r,p)}this._updateGraphicGeometry(r.clone()),this._editGeometryOperations=lt.fromGeometry(r,2,{allowCurves:!0}),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=Et(s);St(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Et(n),h=n.getAttribute(tt.relatedGraphicIndices),p=F(n.geometry,i,s,this.view),c=b(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,c,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Et(e);St(t,s,o,c,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?xt(e,i,s,[o[0],o[1]],t.getAttribute(tt.controlPointKind)):(St(e,i,s,o,r),n&&(0===s?St(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(yt),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[tt.pathIndex]:r,[tt.pointIndexStart]:n,[tt.pointIndexEnd]:a}=e.attributes,h=b(e.geometry),p=0===a?n+1:a;e.attributes={[tt.tool]:ot,[tt.pathIndex]:r,[tt.pointIndex]:p,[tt.relatedGraphicIndices]:[]};const c=ft(s),l=c[r][a];if(k(l)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(c[r][p]);c[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(tt.controlPointKind,it.circle.interior),e.setAttribute(tt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),st(s,c)}else c[r].splice(p,0,h),o.push({coordinates:c[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(c[r][n]),e=rt(t,l,.5,this._coordinateHelper);c[r].splice(a,1,...e),o.push({coordinates:O(c[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),o}_addToSelection(t){const e=Ot(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&ut(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&this._removeVertices(this.selectedManipulators)}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=ft(o);const n=[],a=Ot(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!k(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);st(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),yt)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,$(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function gt(t){const e=ft(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!k(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function ft(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Gt(t,e,i,s){const o=t[e][i];if(V(o))o.c[1]=s;else if(I(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function xt(t,e,i,s,o){switch(o){case it.circle.interior:Gt(t,e,i,s);break;case it.bezier.cp1:t[e][i].b[1]=s;break;case it.bezier.cp2:t[e][i].b[2]=s}}function Mt(t,e){return t<1e-8*e}function bt(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[c,l]=n,d=c-h,m=l-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],x=_*G-g*f,M=(d**2+m**2)/2;if(Mt(Math.abs(x),M))return[(h+c)/2,(p+l)/2];const[b,C]=[G/x*M,-f/x*M],S=b**2+C**2,[E,w]=[d/2-b,m/2-C];if(Mt(E**2+w**2,S)){const[t,e]=v?[-C,b]:[C,-b];return[t+b+h,e+C+p]}const O=Math.sqrt((b**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*O+b+h,w*O+C+p]}function Ct(t,e,i){const s=G(new f({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return H(r)?r:w(t,r)}function St(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(nt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(at(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,c]=[n-o,a-r],l=T(c,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,l,h,i.a[6]]})}const a=O(r);if(k(r))r.splice(0,r.length,...s);else if(P(r))r.b[0].splice(0,r.b[0].length,...s);else if(V(r)||I(r)){const o=O(t[e][i-1]),n=V(r)?E(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],bt(o,n,s,!0)]})}else if(H(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Ct(n,r,o).a}if(n&&!k(n)&&!P(r))if(V(n)||I(n)){const o=O(n),r=V(n)?E(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,bt(o,r,s,!1)]})}else if(H(n)){const t=O(r);n.a=Ct(t,n,o).a}}function Et({attributes:t}){return[t?.[tt.pathIndex]||0,t?.[tt.pointIndex]||0]}function wt({attributes:t}){return`${t?.[tt.pathIndex]}-${t?.[tt.pointIndex]}`}function Ot(t){return t instanceof e?[t]:[...t]}function Vt(t){const e=t.sourceLayer??t.layer;return N(e)?{graphic:t,layer:e}:null}function It(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[tt.pathIndex],vertexIndex:t[tt.pointIndex]}))}t([y()],_t.prototype,"_activeOperationInfo",void 0),t([y()],_t.prototype,"_connectedReshapeManager",void 0),t([y()],_t.prototype,"_coordinateHelper",null),t([y()],_t.prototype,"_editGeometryOperations",void 0),t([y()],_t.prototype,"tooltip",void 0),t([y()],_t.prototype,"tooltipInfos",void 0),t([y()],_t.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],_t.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],_t.prototype,"_selectedManipulator",null),t([y()],_t.prototype,"_tooltipsContext",null),t([y()],_t.prototype,"callbacks",void 0),t([y()],_t.prototype,"connectedReshapeProviders",void 0),t([y()],_t.prototype,"enableMidpoints",void 0),t([y()],_t.prototype,"enableCurveOnMidpoint",void 0),t([y()],_t.prototype,"enableMovement",void 0),t([y()],_t.prototype,"enableVertices",void 0),t([y()],_t.prototype,"graphic",void 0),t([y()],_t.prototype,"highlightName",void 0),t([y()],_t.prototype,"highlightsEnabled",void 0),t([y()],_t.prototype,"layer",void 0),t([y()],_t.prototype,"snappingManager",void 0),t([y({readOnly:!0})],_t.prototype,"state",null),t([y()],_t.prototype,"symbols",void 0),t([y({type:dt})],_t.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],_t.prototype,"type",void 0),t([y({readOnly:!0})],_t.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],_t.prototype,"selectedManipulators",void 0),t([y()],_t.prototype,"view",void 0),_t=t([_("esri.views.draw.support.Reshape")],_t);const Pt=_t;export{Pt 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as o}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as a}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return o=>{if("cancel"===o.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const a={action:o.action,screenStart:o.start,screenEnd:o.screenPoint};"start"===o.action&&null==e&&(e=new D,r=new D,n(t,e,r,o.pointerType,a)),null!=e&&e.execute(a),"end"===o.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,o=[Math.cos(r),Math.sin(r)],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);if(0===a)return null;o[0]/=a,o[1]/=a;const l=t=>{const n=(t.x-e[0])*o[0]+(t.y-e[1])*o[1];t.x=e[0]+n*o[0],t.y=e[1]+n*o[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:o})}function f(t){let n=null;const e=j();return r=>{if("start"===r.action&&(n=y(t,r.mapStart.spatialReference)),null==n)return null;const o=e(r);if(!o)return null;const{translationX:a,translationY:l,translationZ:c}=o;return n.move(a,l,c,r.action),o}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():o(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,()=>{});if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const a=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),()=>{const t=o(r,a);e.trySetGeometry(t)})}if(a(r)){const n=d(r.origin,l);if(!n)return null;const a=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,()=>{const t=o(c.data.geometry,a),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)})}return null}function x(t,n,e){let r=0,o=0,a=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,o=0,a=0);const i=l-r,p=c-o,m=s-a;n.move(i,p,m),r+=i,o+=p,a+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const a=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?o(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=a(t.toMap(n.screenStart,l))),null==r)return null;const e=a(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map(t=>f(t)).filter(t),r=j();return t=>{const n=r(t);return e.forEach(n=>n(t)),n}}function h(t,e){const r=new Map;for(const o of e)r.set(o,n(t[o]));return n=>(r.forEach((n,e)=>{t[e]=n}),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function v(t){const n=t.map(t=>g(t)).filter(t=>null!=t);return t=>(n.forEach(n=>n(t)),t)}function z(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const o=r.mapEnd.x-t,a=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:o,mapDeltaY:a,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const o=r.mapEnd.x-t,a=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return{...r,translationX:o,translationY:a,translationZ:l}}}function M(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,o=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:o}}}function R(t,n){let o=null,a=0,l=0;return c=>{if("start"===c.action&&(o=t.toScreen?.(n),null!=o&&(o.x<0||o.x>t.width||o.y<0||o.y>t.height?o=null:(a=c.screenStart.x-o.x,l=c.screenStart.y-o.y))),null==o)return null;const s=e(c.screenEnd.x-a,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=o,c.screenEnd=i,c}}const w=()=>{};class D{constructor(){this.execute=w}next(t,n=new D){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function U(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return o=>{"start"===o.action&&(r=t.toMap(o.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const a=t.toMap(o.screenEnd,{exclude:e});null!=a&&(a.z=s(a,t,n));const l=null!=r&&null!=a?{sceneStart:r,sceneEnd:a}:null;return{...o,scenePoints:l}}}function G(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,o=l(t);return o.z=r,o.hasZ=!0,o.z=s(o,n,e),o}function q(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=G(r.mapStart,t,n));const o=G(r.mapEnd,t,n),a=null!=e&&null!=o?{sceneStart:e,sceneEnd:o}:null;return{...r,scenePoints:a}}}export{D as EventPipeline,z as addMapDelta,j as addMapTranslation,M as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,R as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,v as resetManipulatedObjectMany,h as resetProperties,U as sceneSnappingAtLocation,q as sceneSnappingAtProjectedLocation,E as screenToMap};
5
+ import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as o}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return a=>{if("cancel"===a.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const o={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};"start"===a.action&&null==e&&(e=new D,r=new D,n(t,e,r,a.pointerType,o)),null!=e&&e.execute(o),"end"===a.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,a=[Math.cos(r),Math.sin(r)],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]);if(0===o)return null;a[0]/=o,a[1]/=o;const l=t=>{const n=(t.x-e[0])*a[0]+(t.y-e[1])*a[1];t.x=e[0]+n*a[0],t.y=e[1]+n*a[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:a})}function f(t){let n=null;const e=j();return r=>{if("start"===r.action&&(n=y(t,r.mapStart.spatialReference)),null==n)return null;const a=e(r);if(!a)return null;const{translationX:o,translationY:l,translationZ:c}=a;return n.move(o,l,c,r.action),a}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():a(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,()=>{});if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,c,()=>{const t=c.data.geometry,n=a(t,o);e.trySetGeometry(n)})}if(o(r)){const n=d(r.origin,l);if(!n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,()=>{const t=a(c.data.geometry,o),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)})}return null}function x(t,n,e){let r=0,a=0,o=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,a=0,o=0);const i=l-r,p=c-a,m=s-o;n.move(i,p,m),r+=i,a+=p,o+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const o=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?a(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=o(t.toMap(n.screenStart,l))),null==r)return null;const e=o(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map(t=>f(t)).filter(t),r=j();return t=>{const n=r(t);return e.forEach(n=>n(t)),n}}function h(t,e){const r=new Map;for(const a of e)r.set(a,n(t[a]));return n=>(r.forEach((n,e)=>{t[e]=n}),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function v(t){const n=t.map(t=>g(t)).filter(t=>null!=t);return t=>(n.forEach(n=>n(t)),t)}function z(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:a,mapDeltaY:o,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return{...r,translationX:a,translationY:o,translationZ:l}}}function M(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,a=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:a}}}function R(t,n){let a=null,o=0,l=0;return c=>{if("start"===c.action&&(a=t.toScreen?.(n),null!=a&&(a.x<0||a.x>t.width||a.y<0||a.y>t.height?a=null:(o=c.screenStart.x-a.x,l=c.screenStart.y-a.y))),null==a)return null;const s=e(c.screenEnd.x-o,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=a,c.screenEnd=i,c}}const w=()=>{};class D{constructor(){this.execute=w}next(t,n=new D){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function U(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return a=>{"start"===a.action&&(r=t.toMap(a.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const o=t.toMap(a.screenEnd,{exclude:e});null!=o&&(o.z=s(o,t,n));const l=null!=r&&null!=o?{sceneStart:r,sceneEnd:o}:null;return{...a,scenePoints:l}}}function G(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,a=l(t);return a.z=r,a.hasZ=!0,a.z=s(a,n,e),a}function q(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=G(r.mapStart,t,n));const a=G(r.mapEnd,t,n),o=null!=e&&null!=a?{sceneStart:e,sceneEnd:a}:null;return{...r,scenePoints:o}}}export{D as EventPipeline,z as addMapDelta,j as addMapTranslation,M as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,R as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,v as resetManipulatedObjectMany,h as resetProperties,U as sceneSnappingAtLocation,q as sceneSnappingAtProjectedLocation,E as screenToMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(i))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:i.hasZ&&(i.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())}),n(()=>i.elevationInfo,()=>a(e.notifyElevationSourceChange()),d),n(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),d),n(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),d),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),d),this.addHandles([n(()=>this.configuration,t=>a(e.configure(t,null)),u),n(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),p),n(()=>this._outFields,t=>a(e.updateOutFields(t)),d),n(()=>this._isSuspended,t=>a(e.setSuspended(t)),p)]),null!=t&&this.addHandles(n(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")},d)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>b(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{initial as n,on as l,watch as d,sync as p,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as H}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as b}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return this._snappingComplexityExceeded||!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get _snappingComplexityExceeded(){return!(!this._layerView||!("snappingComplexityExceeded"in this._layerView))&&this._layerView.snappingComplexityExceeded}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating||this._tilesOfInterest.updating}get _outFields(){const{view:e,_layerView:t,layerSource:i}=this,{layer:r}=i,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=r,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,i=s.get(e)?.name??e,r=s.get(t)?.name??t;i&&d.push(i),r&&d.push(r)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(r))){const e=r.fieldsIndex.get("assetGroup")?.name,t=r.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(r&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:i}=this._layer,r=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...i,token:t}:i,viewType:r}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new b;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new b;break;case"3d":{const{resourceController:i}=t,r=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new b({schedule:e=>i.immediate.schedule(e),hasZ:r.hasZ&&(r.returnZ??!0),elevationAlignPointsInFeatures:async(e,i)=>{const s=await t.whenLayerView(r);return o(i),s.elevationAlignPointsInFeatures(e,i)},queryForSymbologySnapping:async(e,i)=>{const s=await t.whenLayerView(r);return o(i),s.queryForSymbologySnapping(e,i)}}),this._updatingHandles.add(()=>r.elevationInfo,()=>a(e.notifyElevationSourceChange()),n),this._updatingHandles.add(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),n),this._updatingHandles.add(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),n),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:i}=r;_(t,i)&&a(e.notifyElevationSourceChange())}),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([r(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),n),this.addHandles([d(()=>this.configuration,t=>a(e.configure(t,null)),p),d(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),u),d(()=>this._isSuspended,t=>a(e.setSuspended(t)),u)]),this._updatingHandles.add(()=>this._outFields,t=>a(e.updateOutFields(t)),n),null!=t&&this.addHandles(d(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,i=>{i&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(r(this._debug),"debug")):!i&&this._debug&&this.removeHandles("debug")},n)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){if(this._isSuspended)return[];const{coordinateHelper:i,point:r}=e;this._tilesOfInterest.pointOfInterest=i.arrayToPoint(r);const s=this._memoizedMakeGetGroundElevation(this.view,i.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>H(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:r}=this;if(!this._loadWhereModuleTask&&!r){const e=i(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!r)return[];try{return r.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c()],O.prototype,"_snappingComplexityExceeded",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new y(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles.map(e=>e.toJSON()),tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class y extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new g(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles.map(e=>e.toJSON()),tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal))}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class g extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as a}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new a,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new y(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.key.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=h(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.key.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);const r=this.getAttributesForTile(e.id);if(i(s,r))return new v(e);const o=this._createTileTree(e,this.tileInfo);return this._simplify(o,t,null,0,1),this._collectMissingTiles(e,o,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new g(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.key;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new g(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,r){const o=this.getAttributesForTile(e.id),n=o&&!i(r,o);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const l=s/2;for(let i=0;i<e.children.length;i++){const s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),l):this._collectMissingTilesRecurse(s,t,l,r)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class y{constructor(e,t,s){this.key=e,this.objectIds=t,this.attributeKeys=s}}class g extends d{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(e,t,s);this._tileInfo.updateTileInfo(r,1)&&(null==this._extent||l(this._extent,r.extent))&&(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as a}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new a,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}_hasAttributesForTile(e,t){if(e){const s=this._tiles.get(e);if(s)return!s.objectIds.size||i(t,s.attributeKeys)}return!1}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new y(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.key.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=h(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.key.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);if(this._hasAttributesForTile(e.id,s))return new v(e);const i=this._createTileTree(e,this.tileInfo);return this._simplify(i,t,null,0,1),this._collectMissingTiles(e,i,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new g(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.key;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new g(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,i){const r=this._tiles.has(e.id)&&!this._hasAttributesForTile(e.id,i);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let n=0;n<e.children.length;n++){const s=e.children[n];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&n)>>1),(e.col<<1)+(1&n),o):this._collectMissingTilesRecurse(s,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class y{constructor(e,t,s){this.key=e,this.objectIds=t,this.attributeKeys=s}}class g extends d{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(e,t,s);this._tileInfo.updateTileInfo(r,1)&&(null==this._extent||l(this._extent,r.extent))&&(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,w=6e5,x=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as c}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as d}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import F from"../../../../../layers/graphics/OptimizedFeatureSet.js";import{isHostedAgolService as b}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as T}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as P,executeQueryPBF as v,executeQuery as I}from"../../../../../rest/query/operations/query.js";import O from"../../../../../rest/support/Query.js";import{PendingFeatureTile as S}from"./PendingFeatureTile.js";let j=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!b(this.url))return;const e=s(async e=>{try{const t=await P(this.url,new O({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<C}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(q/(i*i))<M}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new S(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:x,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:c}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!c||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?d(e):e;if(this.store.featureStore.forEach(e=>{r===d(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}async _queryFeatures(e,t){return 0===e.num?new F:this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,new T({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:x,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await I(this.url,e,i,{query:this._configuration.customParameters,timeout:x,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(c(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new O({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?O.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||w);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],j.prototype,"url",void 0),e([h({constructOnly:!0})],j.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],j.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],j.prototype,"capabilities",void 0),e([h({constructOnly:!0})],j.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],j.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],j.prototype,"store",void 0),e([h({readOnly:!0})],j.prototype,"_minimumVerticesPerFeature",null),e([h()],j.prototype,"_mandatoryOutFields",null),e([h()],j.prototype,"outFields",null),e([h()],j.prototype,"suspended",void 0),e([h()],j.prototype,"_historicMoment",void 0),e([h()],j.prototype,"filter",null),e([h()],j.prototype,"customParameters",null),e([h({readOnly:!0})],j.prototype,"_configuration",null),e([h()],j.prototype,"tileInfo",null),e([h()],j.prototype,"tileSize",null),e([h()],j.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],j.prototype,"updating",null),e([h({readOnly:!0})],j.prototype,"availability",void 0),e([h()],j.prototype,"hasZ",null),j=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],j);const w=2e3,x=6e5,C=1e6,q=25,M=1;export{j as FeatureServiceTiledFetcher};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null,this.updating=!1}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),e([t()],a.prototype,"updating",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getPopupProvider as p}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as w,unpackFieldNames as b,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as U}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as S}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getFetchPopupTemplate as T,getRequiredFields as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&U(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?w(t,[...b(t,e.outFields),...i]):w(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,P(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=new Set;for(const s of e){const e=p(s.origin);e&&i.add(e)}const r=Array.from(i,e=>T(e,{...t,checkPopupEnabled:!0})).filter(e=>null!=e),l=await this._createPopupQuery(r,t);return await g(this.layer,e,l,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&s?R(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y);const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(S(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s="point"===this.layer.geometryType;for(const o of e){if(!s){const e=await I(o);i(t),s=(e&&e.arcadeUtils.hasGeometryOperations(o))??!1}const e=await D(this.layer,o);i(t);for(const t of e)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,P(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as default};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as s,syncAndInitial as l}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getPopupProvider as p}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as w,unpackFieldNames as b,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as U}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as S}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getFetchPopupTemplate as T,getRequiredFields as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&U(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),l),s(()=>this.view?.floors,"change",()=>this._handleChange()),s(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),s(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?w(t,[...b(t,e.outFields),...i]):w(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,P(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=[],r=new Set;for(const l of e){const e=p(l.origin),s=T(e,{...t,checkPopupEnabled:!0});s&&(i.push(l),r.add(s))}if(0===i.length||0===r.size)return[];const s=await this._createPopupQuery(r,t);return await g(this.layer,i,s,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[s?s.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&l?R(n,i,l):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y);const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(S(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),s=new Set;let l="point"===this.layer.geometryType;for(const o of e){if(!l){const e=await I(o);i(t),l=(e&&e.arcadeUtils.hasGeometryOperations(o))??!1}const e=await D(this.layer,o);i(t);for(const t of e)s.add(t)}return r.returnGeometry=l,r.returnZ=l,r.returnM=l,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,P(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../core/compilerUtils.js";import e from"../../core/Logger.js";import{isAborted as s,createAbortError as r,isPromiseLike as o}from"../../core/promiseUtils.js";import{signal as a}from"../../core/signal.js";import{Yield as n}from"./Yield.js";class i{constructor(){this._tasks=new Array,this._numPendingTasks=a(0),this._readyToRun=a(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}runTask(t){if(0===this.length)return n;for(;!t.done&&this._process(t);)t.madeProgress()}push(t,e,s){return this._addTask((r,o)=>new u(r,o,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,o)=>new u(r,o,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,o)=>new p(r,o,t,e,s),Array.prototype.push)}_process(e){if(0===this._tasks.length)return!1;const o=this._tasks.shift();this._updateReadyToRun();try{if(s(o.signal))this._cancelTask(o,r());else switch(o.type){case 0:this._processSimple(o,e);break;case 1:this._processGenerator(o,e);break;case 2:this._processIterator(o,e);break;default:t(o)}}catch(a){o.reject(a)}return!0}cancelAll(){const t=r();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&c(t.iterator.return()),o(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&c(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);o(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new d(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);o(s)?s.then(e=>this._onIteratorResult(t,e),t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const o=t(s,r);e.call(this._tasks,o),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>--this._numPendingTasks.value)}}function c(t){o(t)?t.then(h):h(t)}function h(t){t.done||e.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class l{constructor(t,e,s=void 0,r=void 0){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class u extends l{constructor(t,e,s,r,o){super(t,e,r,o),this.callback=s,this.type=0}}class p extends l{constructor(t,e,s,r,o){super(t,e,r,o),this.generatorFunction=s,this.type=1}}class d extends l{constructor(t,e,s,r,o){super(t,e,r,o),this.iterator=s,this.type=2}}export{i as PromiseQueue};
5
+ import{neverReached as t}from"../../core/compilerUtils.js";import e from"../../core/Error.js";import s from"../../core/Logger.js";import{isAborted as r,createAbortError as o,isPromiseLike as a,isAbortError as n}from"../../core/promiseUtils.js";import{signal as i}from"../../core/signal.js";import{Yield as c}from"./Yield.js";class l{constructor(){this._tasks=new Array,this._numPendingTasks=i(0),this._readyToRun=i(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}runTask(t){if(0===this.length)return c;for(;!t.done&&this._process(t);)t.madeProgress()}push(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,o)=>new _(r,o,t,e,s),Array.prototype.push)}_process(e){if(0===this._tasks.length)return!1;const s=this._tasks.shift();this._updateReadyToRun();try{if(r(s.signal))this._cancelTask(s,o());else switch(s.type){case 0:this._processSimple(s,e);break;case 1:this._processGenerator(s,e);break;case 2:this._processIterator(s,e);break;default:t(s)}}catch(a){s.reject(a)}return!0}cancelAll(){const t=o();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&h(t.iterator.return()),a(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&h(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);a(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new k(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);a(s)?s.then(e=>this._onIteratorResult(t,e),t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const o=t(s,r);e.call(this._tasks,o),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>--this._numPendingTasks.value)}}function h(t){a(t)?t.then(u,u):u(t)}function u(t){n(t)||t instanceof Error||t instanceof e||null!=t&&"object"==typeof t&&"done"in t&&t.done||s.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class p{constructor(t,e,s=void 0,r=void 0){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class d extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.callback=s,this.type=0}}class _ extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.generatorFunction=s,this.type=1}}class k extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.iterator=s,this.type=2}}export{l as PromiseQueue};