@arcgis/core 4.33.0-next.20250605 → 4.33.0-next.20250607

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 (533) hide show
  1. package/arcade/Dictionary.js +1 -1
  2. package/arcade/Feature.js +1 -1
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/containerUtils.js +1 -1
  7. package/arcade/deepClone.js +1 -1
  8. package/arcade/featureSetUtils.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  10. package/arcade/functions/convertdirection.js +1 -1
  11. package/arcade/functions/date.js +1 -1
  12. package/arcade/functions/feature.js +1 -1
  13. package/arcade/functions/featuresetbase.js +1 -1
  14. package/arcade/functions/featuresetgeom.js +1 -1
  15. package/arcade/functions/featuresetstats.js +1 -1
  16. package/arcade/functions/featuresetstring.js +1 -1
  17. package/arcade/functions/fieldStats.js +1 -1
  18. package/arcade/functions/geomasync.js +1 -1
  19. package/arcade/functions/geometry.js +1 -1
  20. package/arcade/functions/geomsync.js +1 -1
  21. package/arcade/functions/knowledgegraph.js +1 -1
  22. package/arcade/functions/maths.js +1 -1
  23. package/arcade/functions/stats.js +1 -1
  24. package/arcade/functions/string.js +1 -1
  25. package/arcade/geometry/constructors.js +1 -1
  26. package/arcade/geometry/functions.js +1 -1
  27. package/arcade/languageUtils.js +1 -1
  28. package/arcade.js +1 -1
  29. package/assets/esri/core/workers/RemoteClient.js +1 -1
  30. package/assets/esri/core/workers/chunks/0229c573fa8a2fff2d8b.js.LICENSE.txt +1 -1
  31. package/assets/esri/core/workers/chunks/{346781f07389074f6c12.js → 130c848bf6337649052c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{e385a27fd1ac2123a05f.js → 178260e8a263f2f1584f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{28b1819bf744ce957dfd.js → 17fcdaeb42e932712096.js} +2 -2
  34. package/assets/esri/core/workers/chunks/{28b1819bf744ce957dfd.js.LICENSE.txt → 17fcdaeb42e932712096.js.LICENSE.txt} +1 -1
  35. package/assets/esri/core/workers/chunks/183a7dec68c8ba6eb3d6.js +1 -0
  36. package/assets/esri/core/workers/chunks/29fb64826bb1351aca8d.js.LICENSE.txt +1 -1
  37. package/assets/esri/core/workers/chunks/2ddb776434a93b8d9e63.js +1 -0
  38. package/assets/esri/core/workers/chunks/3cbc498388fb1931a9f8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{d0372bac0c5f4fbed468.js → 3f59a73f9a758095976f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{3a74654fa539f78ceb86.js → 467cacb501b0417bb4df.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{a2e9141ff4efd13413a1.js → 4a805e7a57d25c4b595f.js} +2 -2
  42. package/assets/esri/core/workers/chunks/53ff5b7691ba1444358e.js +1 -0
  43. package/assets/esri/core/workers/chunks/54f981fe0f8851767be9.js.LICENSE.txt +1 -1
  44. package/assets/esri/core/workers/chunks/{a6fb75929e456f87f804.js → 58b2dc0ec977af7413b0.js} +1 -1
  45. package/assets/esri/core/workers/chunks/5cc5f32b474ee723e192.js +1 -0
  46. package/assets/esri/core/workers/chunks/658e82c9b722852e02d0.js +1 -0
  47. package/assets/esri/core/workers/chunks/73ddb356121add556994.js.LICENSE.txt +1 -1
  48. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  49. package/assets/esri/core/workers/chunks/9a87c367ee5ba44f3081.js +1 -0
  50. package/assets/esri/core/workers/chunks/a1a42b0d7cd47b647f8a.js +1 -0
  51. package/assets/esri/core/workers/chunks/{3025e420e13e2bc8c0a1.js → a622ed3f182648ab3ff6.js} +1 -1
  52. package/assets/esri/core/workers/chunks/aad9a693813b47a51530.js.LICENSE.txt +1 -1
  53. package/assets/esri/core/workers/chunks/b8c8acf75e09014d8346.js +1 -0
  54. package/assets/esri/core/workers/chunks/c6c86cbe65a58c3093ae.js +1 -0
  55. package/assets/esri/core/workers/chunks/e717832326d1b1f817d3.js +1 -0
  56. package/assets/esri/core/workers/chunks/ec922f876e1465d36045.js +1 -0
  57. package/assets/esri/core/workers/chunks/{5853b2af6ac8be2c69d8.js → ee3940679d794d78b4ea.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{bd2dcc55ac3418421ee5.js → f20ba89ac21f05b7020c.js} +1 -1
  59. package/assets/esri/core/workers/chunks/f3b51aa0a1a8fc3b231c.js.LICENSE.txt +1 -1
  60. package/assets/esri/themes/base/widgets/_TimeSlider.scss +1 -0
  61. package/assets/esri/themes/dark/main.css +1 -1
  62. package/assets/esri/themes/light/main.css +1 -1
  63. package/assets/esri/themes/light/view.css +1 -1
  64. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  65. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  66. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  67. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  68. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  69. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  70. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  71. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  72. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  73. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  74. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  75. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  78. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  79. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  80. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  81. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  82. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  83. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  84. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  103. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  104. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  105. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  106. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  107. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  134. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  135. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  136. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  137. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  138. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  139. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  140. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  141. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  181. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  182. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  183. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  184. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  185. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  186. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  187. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  188. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  189. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  190. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  191. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  192. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  193. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  194. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  195. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  196. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  197. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  198. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  199. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  200. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  201. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  202. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  203. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
  204. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  205. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  206. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  207. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  208. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  209. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  210. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  211. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  212. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  213. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  214. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  215. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  216. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  217. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  218. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  219. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  220. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  221. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  222. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  223. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  224. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  225. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  226. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  227. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  228. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  229. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  230. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  231. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  232. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  233. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  234. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  235. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  236. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  237. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  238. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  239. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  240. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  241. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  242. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  243. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  244. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  245. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  246. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  247. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  248. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  249. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  250. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  251. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  252. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  253. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  254. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  255. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  256. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  257. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  258. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  259. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  260. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  261. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  262. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  263. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  264. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  265. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  266. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  267. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  268. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  269. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  270. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  271. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  272. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  273. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  274. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  275. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  276. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  277. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  278. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  279. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  280. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  281. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  282. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  283. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  284. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  285. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  286. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  287. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  288. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  289. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  290. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  291. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  292. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  293. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  294. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  295. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  296. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  297. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  298. package/assets/esri/widgets/Search/t9n/Search_ar.json +1 -1
  299. package/assets/esri/widgets/Search/t9n/Search_bg.json +1 -1
  300. package/assets/esri/widgets/Search/t9n/Search_bs.json +1 -1
  301. package/assets/esri/widgets/Search/t9n/Search_ca.json +1 -1
  302. package/assets/esri/widgets/Search/t9n/Search_cs.json +1 -1
  303. package/assets/esri/widgets/Search/t9n/Search_da.json +1 -1
  304. package/assets/esri/widgets/Search/t9n/Search_de.json +1 -1
  305. package/assets/esri/widgets/Search/t9n/Search_el.json +1 -1
  306. package/assets/esri/widgets/Search/t9n/Search_es.json +1 -1
  307. package/assets/esri/widgets/Search/t9n/Search_et.json +1 -1
  308. package/assets/esri/widgets/Search/t9n/Search_fi.json +1 -1
  309. package/assets/esri/widgets/Search/t9n/Search_fr.json +1 -1
  310. package/assets/esri/widgets/Search/t9n/Search_he.json +1 -1
  311. package/assets/esri/widgets/Search/t9n/Search_hr.json +1 -1
  312. package/assets/esri/widgets/Search/t9n/Search_hu.json +1 -1
  313. package/assets/esri/widgets/Search/t9n/Search_id.json +1 -1
  314. package/assets/esri/widgets/Search/t9n/Search_it.json +1 -1
  315. package/assets/esri/widgets/Search/t9n/Search_ja.json +1 -1
  316. package/assets/esri/widgets/Search/t9n/Search_ko.json +1 -1
  317. package/assets/esri/widgets/Search/t9n/Search_lt.json +1 -1
  318. package/assets/esri/widgets/Search/t9n/Search_lv.json +1 -1
  319. package/assets/esri/widgets/Search/t9n/Search_nl.json +1 -1
  320. package/assets/esri/widgets/Search/t9n/Search_no.json +1 -1
  321. package/assets/esri/widgets/Search/t9n/Search_pl.json +1 -1
  322. package/assets/esri/widgets/Search/t9n/Search_pt-BR.json +1 -1
  323. package/assets/esri/widgets/Search/t9n/Search_pt-PT.json +1 -1
  324. package/assets/esri/widgets/Search/t9n/Search_ro.json +1 -1
  325. package/assets/esri/widgets/Search/t9n/Search_ru.json +1 -1
  326. package/assets/esri/widgets/Search/t9n/Search_sk.json +1 -1
  327. package/assets/esri/widgets/Search/t9n/Search_sl.json +1 -1
  328. package/assets/esri/widgets/Search/t9n/Search_sr.json +1 -1
  329. package/assets/esri/widgets/Search/t9n/Search_sv.json +1 -1
  330. package/assets/esri/widgets/Search/t9n/Search_th.json +1 -1
  331. package/assets/esri/widgets/Search/t9n/Search_tr.json +1 -1
  332. package/assets/esri/widgets/Search/t9n/Search_uk.json +1 -1
  333. package/assets/esri/widgets/Search/t9n/Search_vi.json +1 -1
  334. package/assets/esri/widgets/Search/t9n/Search_zh-CN.json +1 -1
  335. package/assets/esri/widgets/Search/t9n/Search_zh-HK.json +1 -1
  336. package/assets/esri/widgets/Search/t9n/Search_zh-TW.json +1 -1
  337. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
  338. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
  339. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
  340. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
  341. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
  342. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
  343. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
  344. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
  345. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
  346. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
  347. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
  348. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
  349. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
  350. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
  351. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
  352. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
  353. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
  354. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
  355. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
  356. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
  357. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
  358. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
  359. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
  360. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
  361. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
  362. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
  363. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
  364. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
  365. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
  366. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
  367. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
  368. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
  369. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
  370. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
  371. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
  372. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
  373. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
  374. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
  375. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
  376. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ar.json +1 -1
  377. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bg.json +1 -1
  378. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bs.json +1 -1
  379. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ca.json +1 -1
  380. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_cs.json +1 -1
  381. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_da.json +1 -1
  382. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_de.json +1 -1
  383. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_el.json +1 -1
  384. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_es.json +1 -1
  385. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_et.json +1 -1
  386. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fi.json +1 -1
  387. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fr.json +1 -1
  388. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_he.json +1 -1
  389. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hr.json +1 -1
  390. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hu.json +1 -1
  391. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_id.json +1 -1
  392. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_it.json +1 -1
  393. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ja.json +1 -1
  394. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ko.json +1 -1
  395. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lt.json +1 -1
  396. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lv.json +1 -1
  397. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_nl.json +1 -1
  398. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_no.json +1 -1
  399. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pl.json +1 -1
  400. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-BR.json +1 -1
  401. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-PT.json +1 -1
  402. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ro.json +1 -1
  403. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ru.json +1 -1
  404. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sk.json +1 -1
  405. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sl.json +1 -1
  406. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sr.json +1 -1
  407. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sv.json +1 -1
  408. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_th.json +1 -1
  409. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_tr.json +1 -1
  410. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_uk.json +1 -1
  411. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_vi.json +1 -1
  412. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-CN.json +1 -1
  413. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-HK.json +1 -1
  414. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-TW.json +1 -1
  415. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ar.json +1 -1
  416. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bg.json +1 -1
  417. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bs.json +1 -1
  418. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ca.json +1 -1
  419. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_cs.json +1 -1
  420. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_da.json +1 -1
  421. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_de.json +1 -1
  422. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_el.json +1 -1
  423. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_es.json +1 -1
  424. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_et.json +1 -1
  425. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fi.json +1 -1
  426. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fr.json +1 -1
  427. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_he.json +1 -1
  428. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hr.json +1 -1
  429. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hu.json +1 -1
  430. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_id.json +1 -1
  431. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_it.json +1 -1
  432. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ja.json +1 -1
  433. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ko.json +1 -1
  434. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lt.json +1 -1
  435. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lv.json +1 -1
  436. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_nl.json +1 -1
  437. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_no.json +1 -1
  438. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pl.json +1 -1
  439. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-BR.json +1 -1
  440. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-PT.json +1 -1
  441. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ro.json +1 -1
  442. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ru.json +1 -1
  443. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sk.json +1 -1
  444. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sl.json +1 -1
  445. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sr.json +1 -1
  446. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sv.json +1 -1
  447. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_th.json +1 -1
  448. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_tr.json +1 -1
  449. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_uk.json +1 -1
  450. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_vi.json +1 -1
  451. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-CN.json +1 -1
  452. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-HK.json +1 -1
  453. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-TW.json +1 -1
  454. package/chunks/aiServices.js +1 -1
  455. package/chunks/array.js +1 -1
  456. package/chunks/languageUtils.js +1 -1
  457. package/geometry/support/MeshTexture.js +1 -1
  458. package/interfaces.d.ts +163 -18
  459. package/intl/date.js +1 -1
  460. package/intl/number.js +1 -1
  461. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  462. package/layers/support/PlaybackInfo.d.ts +4 -0
  463. package/networks/CircuitManager.js +1 -1
  464. package/networks/UnitIdentifierManager.js +1 -1
  465. package/package.json +2 -2
  466. package/rest/networks/circuits/alterCircuit.js +1 -1
  467. package/rest/networks/circuits/createCircuit.js +1 -1
  468. package/rest/networks/circuits/deleteCircuits.js +1 -1
  469. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  470. package/rest/networks/circuits/support/EditCircuitsResult.js +5 -0
  471. package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
  472. package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
  473. package/rest/networks/support/utils.js +5 -0
  474. package/rest/networks/unitIdentifiers/insertGap.js +1 -1
  475. package/rest/networks/unitIdentifiers/reset.js +1 -1
  476. package/rest/networks/unitIdentifiers/resize.js +1 -1
  477. package/rest/networks/unitIdentifiers/support/EditUnitIdentifiersResult.js +5 -0
  478. package/support/arcadeUtils.js +1 -1
  479. package/support/revision.js +1 -1
  480. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  481. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  482. package/views/3d/FocusAreasView.js +1 -1
  483. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  484. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  485. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  486. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  487. package/views/3d/layers/RouteLayerView3D.js +1 -1
  488. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  489. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  490. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  491. package/views/3d/layers/graphics/Labeler.js +1 -1
  492. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  493. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  494. package/views/3d/state/controllers/RotateController.js +1 -1
  495. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  496. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  497. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  498. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  499. package/views/3d/state/utils/navigationUtils.js +1 -1
  500. package/views/3d/support/DisplayQualityProfile.js +1 -1
  501. package/views/3d/support/QualitySettings.js +1 -1
  502. package/views/3d/support/sunUtils.js +1 -1
  503. package/views/3d/terrain/OverlayManager.js +1 -1
  504. package/views/3d/terrain/TerrainSurface.js +1 -1
  505. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  506. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  507. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  508. package/views/ToolViewManager.js +1 -1
  509. package/views/support/layerViewUtils.js +1 -1
  510. package/views/webgl/FramebufferObject.js +1 -1
  511. package/views/webgl/Parameters.js +1 -1
  512. package/widgets/BasemapLayerList.js +1 -1
  513. package/widgets/Editor/EditorViewModel.js +1 -1
  514. package/widgets/Expand.js +1 -1
  515. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  516. package/widgets/FeatureForm/FieldInput.js +1 -1
  517. package/widgets/LayerList/LayerListItem.js +1 -1
  518. package/widgets/Print.js +1 -1
  519. package/widgets/Search.js +1 -1
  520. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  521. package/widgets/TimeSlider.js +1 -1
  522. package/assets/esri/core/workers/chunks/074498a4d685223ec058.js +0 -1
  523. package/assets/esri/core/workers/chunks/15b3eb60f86954783fab.js +0 -1
  524. package/assets/esri/core/workers/chunks/28677588ec75bc08ade9.js +0 -1
  525. package/assets/esri/core/workers/chunks/5d50a8d0427eab0a2514.js +0 -1
  526. package/assets/esri/core/workers/chunks/91d484960df25ec9554b.js +0 -1
  527. package/assets/esri/core/workers/chunks/9cd55043f3d789f41815.js +0 -1
  528. package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +0 -1
  529. package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +0 -1
  530. package/assets/esri/core/workers/chunks/c6fa79ce324122e08dbb.js +0 -1
  531. package/assets/esri/core/workers/chunks/cbbbaccc0d3683e1c0fe.js +0 -1
  532. package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +0 -1
  533. package/assets/esri/core/workers/chunks/e9993d4f2bfdc434fbcc.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e,v as t,A as r}from"../../chunks/languageUtils.js";import{isNumber as n,isString as s}from"../../support/guards.js";function a(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}function u(e){const t=a(e);let r=0;for(let n=0;n<e.length;n++)r+=(t-e[n])**2;return r/e.length}function c(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function o(e,a){const u=[],c={},o=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]&&e[i]!==t){const t=e[i];if(n(t)||s(t))void 0===c[t]&&(u.push(t),c[t]=1);else{let e=!1;for(let n=0;n<o.length;n++)!0===r(o[n],t)&&(e=!0);!1===e&&(o.push(t),u.push(t))}}if(u.length>=a&&-1!==a)return u}return u}function i(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function l(t,r,n=1e3){switch(t.toLowerCase()){case"distinct":return o(r,n);case"avg":case"mean":return a(e(r));case"min":return Math.min.apply(Math,e(r));case"sum":return c(e(r));case"max":return Math.max.apply(Math,e(r));case"stdev":case"stddev":return Math.sqrt(u(e(r)));case"var":case"variance":return u(e(r));case"count":return r.length}return 0}export{l as calculateStat,i as decodeStatType};
5
+ import{_ as e,v as t,y as r}from"../../chunks/languageUtils.js";import{isNumber as n,isString as s}from"../../support/guards.js";function a(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}function u(e){const t=a(e);let r=0;for(let n=0;n<e.length;n++)r+=(t-e[n])**2;return r/e.length}function c(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function o(e,a){const u=[],c={},o=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]&&e[i]!==t){const t=e[i];if(n(t)||s(t))void 0===c[t]&&(u.push(t),c[t]=1);else{let e=!1;for(let n=0;n<o.length;n++)!0===r(o[n],t)&&(e=!0);!1===e&&(o.push(t),u.push(t))}}if(u.length>=a&&-1!==a)return u}return u}function i(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function l(t,r,n=1e3){switch(t.toLowerCase()){case"distinct":return o(r,n);case"avg":case"mean":return a(e(r));case"min":return Math.min.apply(Math,e(r));case"sum":return c(e(r));case"max":return Math.max.apply(Math,e(r));case"stdev":case"stddev":return Math.sqrt(u(e(r)));case"var":case"variance":return u(e(r));case"count":return r.length}return 0}export{l as calculateStat,i as decodeStatType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import n from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as e,ExecutionErrorCodes as r}from"../executionError.js";import{cloneGeometry as a}from"../kernel.js";import{E as i,D as o,g as s,k as c,j as l,f as u,m as f,F as d,p as w,G as m,l as y,H as h,J as p,t as g,e as N,K as S,L as O}from"../../chunks/languageUtils.js";import{getPortal as v}from"../portalUtils.js";import{commonRelationsCheck as J,toCurveType as P,planarLength3D as A,toOffsetJoinType as I,toCentroidAlgorithm as F,measureToCoordinateFunc as j,pointToCoordinateFunc as b,distanceToCoordinateFunc as R}from"../geometry/functions.js";import{invokeRemoteGeometryOp as x}from"../geometry/operatorsWorkerConnection.js";import{equals as D}from"../../core/arrayUtils.js";import L from"../../geometry/Extent.js";import C from"../../geometry/Geometry.js";import U from"../../geometry/Multipoint.js";import E from"../../geometry/Point.js";import k from"../../geometry/Polygon.js";import M from"../../geometry/Polyline.js";import{fromJSON as T}from"../../geometry/support/jsonUtils.js";import Z from"../../portal/Portal.js";import{lookupUser as q}from"../../portal/support/utils.js";import{isArray as z}from"../../support/guards.js";function G(n){if(null==n)return n;switch(typeof n){case"string":case"number":return n;default:throw new e(null,r.InvalidParameter,null)}}function H(H){"async"===H.mode&&(H.functions.disjoint=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null===a[0]||null===a[1]||x("disjoint",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.intersects=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("intersects",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.touches=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("touches",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.crosses=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("crosses",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.within=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("within",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.contains=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("contains",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.overlaps=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("overlaps",[a[0].toJSON(),a[1].toJSON()]))))},H.functions.equals=function(n,t){return H.standardFunctionAsync(n,t,((e,r,a)=>(o(a,2,2,n,t),a[0]===a[1]||(a[0]instanceof C&&a[1]instanceof C?x("equals",[a[0].toJSON(),a[1].toJSON()]):(s(a[0])&&s(a[1])||!!(c(a[0])&&c(a[1])||l(a[0])&&l(a[1])))&&a[0].equals(a[1])))))},H.functions.relate=function(n,t){return H.standardFunctionAsync(n,t,((a,s,c)=>{if(c=i(c),o(c,3,3,n,t),c[0]instanceof C&&c[1]instanceof C)return x("relate",[c[0].toJSON(),c[1].toJSON(),u(c[2])]);if(c[0]instanceof C&&null===c[1])return!1;if(c[1]instanceof C&&null===c[0])return!1;if(null===c[0]&&null===c[1])return!1;throw new e(n,r.InvalidParameter,t)}))},H.functions.intersection=function(n,t){return H.standardFunctionAsync(n,t,(async(e,r,a)=>(a=i(a),J(a,n,t),null===a[0]||null===a[1]?null:T(await x("intersection",[a[0].toJSON(),a[1].toJSON()])))))},H.functions.union=function(n,t){return H.standardFunctionAsync(n,t,(async(o,s,c)=>{if(0===(c=i(c)).length)throw new e(n,r.WrongNumberOfParameters,t);const l=[];if(1===c.length)if(z(c[0])){for(const a of i(c[0]))if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}}else{if(!f(c[0])){if(c[0]instanceof C)return d(a(c[0]),n.spatialReference);if(null===c[0])return null;throw new e(n,r.InvalidParameter,t)}for(const a of i(c[0].toArray()))if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}}else for(const a of c)if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}return 0===l.length?null:T(await x("union",[l]))}))},H.functions.difference=function(n,t){return H.standardFunctionAsync(n,t,(async(e,r,o)=>(o=i(o),J(o,n,t),null===o[0]?null:null===o[1]?a(o[0]):T(await x("difference",[o[0].toJSON(),o[1].toJSON()])))))},H.functions.symmetricdifference=function(n,t){return H.standardFunctionAsync(n,t,(async(e,r,o)=>(o=i(o),J(o,n,t),null===o[0]&&null===o[1]?null:null===o[0]?a(o[1]):null===o[1]?a(o[0]):T(await x("symmetricDifference",[o[0].toJSON(),o[1].toJSON()])))))},H.functions.clip=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,2,n,t),!(c[1]instanceof L)&&null!==c[1])throw new e(n,r.InvalidParameter,t);if(null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return null===c[1]?null:T(await x("clip",[c[0].toJSON(),c[1].toJSON()]))}))},H.functions.cut=function(n,t){return H.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,t),!(l[1]instanceof M)&&null!==l[1])throw new e(n,r.InvalidParameter,t);if(null===l[0])return[];if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);return null===l[1]?[a(l[0])]:(await x("cut",[l[0].toJSON(),l[1].toJSON()])).map((n=>T(n)))}))},H.functions.area=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),c=i(c),w(c[0])){const a=await c[0].sumArea(G(c[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}let l=c[0];if((z(l)||f(l))&&(l=m(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);return x("area",[l.toJSON(),G(c[1])])}))},H.functions.areageodetic=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{o(c,1,3,n,t);let l=(c=i(c))[0];(z(l)||f(l))&&(l=m(l,n.spatialReference));const u=G(c[1]),d=P(c[2]);if(w(l)){const a=await l.sumArea(u,d,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}if(null==l)return 0;if(!y(l))throw new e(n,r.InvalidParameter,t);return x("geodeticArea",[l.toJSON(),u,d])}))},H.functions.length=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),c=i(c),w(c[0])){const a=await c[0].sumLength(G(c[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}let l=c[0];if((z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);return x("length",[l.toJSON(),G(c[1])])}))},H.functions.length3d=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),null===(c=i(c))[0])return 0;let l=c[0];if((z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);if(!0===l.hasZ){const{convertFromSpatialReferenceUnit:n,toLengthUnit:t}=await import("../geometry/unitConversion.js"),e=A(l);return n(l.spatialReference,t(c[1]),e)}return x("length",[l.toJSON(),G(c[1])])}))},H.functions.lengthgeodetic=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{o(c,1,3,n,t);let l=(c=i(c))[0];(z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference));const u=G(c[1]),d=P(c[2]);if(w(l)){const a=await l.sumLength(u,d,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}if(null===l)return 0;if(!y(l))throw new e(n,r.InvalidParameter,t);return x("geodeticLength",[l.toJSON(),u,d])}))},H.functions.distance=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,3,n,t);let l=c[0];if((z(c[0])||f(c[0]))&&(l=p(c[0],n.spatialReference)),!(l instanceof C))throw new e(n,r.InvalidParameter,t);let u=c[1];if((z(c[1])||f(c[1]))&&(u=p(c[1],n.spatialReference)),!(u instanceof C))throw new e(n,r.InvalidParameter,t);return x("distance",[l.toJSON(),u.toJSON(),G(c[2])])}))},H.functions.distancegeodetic=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,4,n,t);const l=c[0];if(!(l instanceof E))throw new e(n,r.InvalidParameter,t);const u=c[1];if(!(u instanceof E))throw new e(n,r.InvalidParameter,t);const f=new M({paths:[],spatialReference:l.spatialReference});return f.addPath([l,u]),x("geodeticLength",[f.toJSON(),G(c[2]),P(c[3])])}))},H.functions.densify=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,3,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);if(l<=0)throw new e(n,r.InvalidParameter,t);switch(c[0].type){case"polygon":case"polyline":case"extent":return T(await x("densify",[c[0].toJSON(),l,G(c[2])]));default:return c[0]}}))},H.functions.densifygeodetic=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,4,n,t);const l=c[0];if(null==l)return null;if(!y(l))throw new e(n,r.InvalidParameter,t);const u=g(c[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);if(u<=0)throw new e(n,r.InvalidParameter,t);const f=G(c[2]),d=P(c[3]);switch(l.type){case"polygon":case"polyline":case"extent":return T(await x("geodeticDensify",[l.toJSON(),u,f,d]));default:return l}}))},H.functions.generalize=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,4,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);const u=N(S(c[2],!0));return T(await x("generalize",[c[0].toJSON(),l,G(c[3]),{removeDegenerateParts:u}]))}))},H.functions.buffer=function(n,t){return H.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,2,3,n,t),null===l[0])return null;if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);const u=g(l[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);return 0===u?a(l[0]):T(await x("buffer",[l[0].toJSON(),u,G(l[2])]))}))},H.functions.buffergeodetic=function(n,t){return H.standardFunctionAsync(n,t,(async(s,c,l)=>{l=i(l),o(l,2,4,n,t);const u=l[0];if(null==u)return null;if(!y(u))throw new e(n,r.InvalidParameter,t);const f=g(l[1]);if(isNaN(f))throw new e(n,r.InvalidParameter,t);if(0===f)return a(u);const d=G(l[2]),w=P(l[3]);return T(await x("geodesicBuffer",[u.toJSON(),f,d,w]))}))},H.functions.offset=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,6,n,t),null===c[0])return null;if(!(c[0]instanceof k||c[0]instanceof M))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);const u=I(c[3]),f=g(S(c[4],10));if(isNaN(f))throw new e(n,r.InvalidParameter,t);const d=g(S(c[5],0));if(isNaN(d))throw new e(n,r.InvalidParameter,t);return T(await x("offset",[c[0].toJSON(),l,G(c[2]),{joins:u,miterLimit:f,flattenError:d}]))}))},H.functions.rotate=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,3,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=c[0]instanceof L?k.fromExtent(c[0]):c[0],u=g(c[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);const f=S(c[2],null);if(null===f){const n="point"===l.type?l:l.extent?.center;return T(await x("rotate",[l.toJSON(),u,n?.x,n?.y]))}if(f instanceof E)return T(await x("rotate",[l.toJSON(),u,f.x,f.y]));throw new e(n,r.InvalidParameter,t)}))},H.functions.centroid=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,2,n,t),null===c[0])return null;const l=F(c[1]);let u=c[0];if((z(c[0])||f(c[0]))&&(u="geometric"===l?p(c[0],n.spatialReference):m(c[0],n.spatialReference),null===u))return null;if(!(u instanceof C))throw new e(n,r.InvalidParameter,t);return T("geometric"===l?await x("centroid",[u.toJSON()]):await x("labelPoint",[u.toJSON()]))}))},H.functions.measuretocoordinate=function(n,t){return H.standardFunctionAsync(n,t,j)},H.functions.pointtocoordinate=function(n,t){return H.standardFunctionAsync(n,t,b)},H.functions.distancetocoordinate=function(n,t){return H.standardFunctionAsync(n,t,R)},H.functions.multiparttosinglepart=function(n,t){return H.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,1,1,n,t),null===l[0])return null;if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);if(l[0]instanceof E)return[d(a(l[0]),n.spatialReference)];if(l[0]instanceof L)return[d(a(l[0]),n.spatialReference)];const u=T(await x("simplify",[l[0].toJSON()]));if(u instanceof k){const n=[],t=[];for(let e=0;e<u.rings.length;e++)if(u.isClockwise(u.rings[e])){const t=T({rings:[u.rings[e]],hasZ:!0===u.hasZ,hasM:!0===u.hasM,spatialReference:u.spatialReference.toJSON()});n.push(t)}else t.push({ring:u.rings[e],pt:u.getPoint(e,0)});for(let e=0;e<t.length;e++)for(let r=0;r<n.length;r++)if(n[r].contains(t[e].pt)){n[r].addRing(t[e].ring);break}return n}if(u instanceof M){const n=[];for(let t=0;t<u.paths.length;t++){const e=T({paths:[u.paths[t]],hasZ:!0===u.hasZ,hasM:!0===u.hasM,spatialReference:u.spatialReference.toJSON()});n.push(e)}return n}if(l[0]instanceof U){const t=[],e=d(a(l[0]),n.spatialReference);for(let n=0;n<e.points.length;n++)t.push(e.getPoint(n));return t}return null}))},H.functions.isselfintersecting=function(n,t){return H.standardFunctionAsync(n,t,(async(n,t,e)=>{o(e,1,1,n,t);let r=(e=i(e))[0];if((z(e[0])||f(e[0]))&&(r=h(e[0],n.spatialReference)),r instanceof U){const n=r.points;for(let t=0;t<n.length;t++)for(let e=t+1;e<n.length;e++)if(D(n[t],n[e]))return!0;return!1}return(r instanceof M||r instanceof k)&&await x("isSelfIntersecting",[r.toJSON()])}))},H.functions.issimple=function(n,t){return H.standardFunctionAsync(n,t,((a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return!0;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return x("isSimple",[c[0].toJSON()])}))},H.functions.simplify=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return T(await x("simplify",[c[0].toJSON()]))}))},H.functions.convexhull=function(n,t){return H.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return T(await x("convexHull",[c[0].toJSON()]))}))},H.functions.getuser=function(a,i){return H.standardFunctionAsync(a,i,(async(s,c,l)=>{o(l,0,2,a,i);let f=S(l[1],""),d=!0===f;if(f=!0===f||!1===f?"":u(f),0===l.length||l[0]instanceof n){let n;n=a.services?.portal?a.services.portal:Z.getDefault(),l.length>0&&(n=v(l[0],n));const e=await q(n,f,d);if(e){const n=JSON.parse(JSON.stringify(e));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return t.convertObjectToArcadeDictionary(n,O(a))}return null}let m=null;if(w(l[0])&&(m=l[0]),m){if(d=!1,f)return null;await m.load();const e=await m.getOwningSystemUrl();if(!e){if(!f){const n=await m.getIdentityUser();return n?t.convertObjectToArcadeDictionary({username:n},O(a)):null}return null}let r;r=a.services?.portal?a.services.portal:Z.getDefault(),r=v(new n(e),r);const i=await q(r,f,d);if(i){const n=JSON.parse(JSON.stringify(i));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return t.convertObjectToArcadeDictionary(n,O(a))}return null}throw new e(a,r.InvalidParameter,i)}))},H.functions.nearestcoordinate=function(n,a){return H.standardFunctionAsync(n,a,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,a),!(l[0]instanceof C||null===l[0]))throw new e(n,r.InvalidParameter,a);if(!(l[1]instanceof E||null===l[1]))throw new e(n,r.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const u=l[0]instanceof L?k.fromExtent(l[0]):l[0],f=await x("getNearestCoordinate",[u.toJSON(),l[1].toJSON(),{calculateLeftRightSide:!0}]);return null===f?null:t.convertObjectToArcadeDictionary({coordinate:T(f.coordinate),distance:f.distance,sideOfLine:0===f.distance?"straddle":f.rightSide?"right":"left"},O(n),!1,!0)}))},H.functions.nearestvertex=function(n,a){return H.standardFunctionAsync(n,a,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,a),!(l[0]instanceof C||null===l[0]))throw new e(n,r.InvalidParameter,a);if(!(l[1]instanceof E||null===l[1]))throw new e(n,r.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const u=l[0]instanceof L?k.fromExtent(l[0]):l[0],f=await x("getNearestVertex",[u.toJSON(),l[1].toJSON()]);return null===f?null:t.convertObjectToArcadeDictionary({coordinate:T(f.coordinate),distance:f.distance,sideOfLine:0===f.distance?"straddle":f.rightSide?"right":"left"},O(n),!1,!0)}))})}export{H as registerFunctions};
5
+ import n from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as e,ExecutionErrorCodes as r}from"../executionError.js";import{cloneGeometry as a}from"../kernel.js";import{C as i,B as o,e as s,g as c,f as l,w as u,j as f,D as d,m as w,E as m,h as y,F as h,G as p,u as g,H as N,J as S,K as O}from"../../chunks/languageUtils.js";import{getPortal as v}from"../portalUtils.js";import{commonRelationsCheck as J,toCurveType as P,planarLength3D as A,toOffsetJoinType as I,toCentroidAlgorithm as F,measureToCoordinateFunc as j,pointToCoordinateFunc as R,distanceToCoordinateFunc as b}from"../geometry/functions.js";import{invokeRemoteGeometryOp as x}from"../geometry/operatorsWorkerConnection.js";import{equals as D}from"../../core/arrayUtils.js";import L from"../../geometry/Extent.js";import C from"../../geometry/Geometry.js";import U from"../../geometry/Multipoint.js";import E from"../../geometry/Point.js";import k from"../../geometry/Polygon.js";import M from"../../geometry/Polyline.js";import{fromJSON as T}from"../../geometry/support/jsonUtils.js";import Z from"../../portal/Portal.js";import{lookupUser as q}from"../../portal/support/utils.js";import{isArray as z}from"../../support/guards.js";function B(n){if(null==n)return n;switch(typeof n){case"string":case"number":return n;default:throw new e(null,r.InvalidParameter,null)}}function G(G){"async"===G.mode&&(G.functions.disjoint=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null===a[0]||null===a[1]||x("disjoint",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.intersects=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("intersects",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.touches=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("touches",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.crosses=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("crosses",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.within=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("within",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.contains=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("contains",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.overlaps=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(a=i(a),J(a,n,t),null!==a[0]&&null!==a[1]&&x("overlaps",[a[0].toJSON(),a[1].toJSON()]))))},G.functions.equals=function(n,t){return G.standardFunctionAsync(n,t,((e,r,a)=>(o(a,2,2,n,t),a[0]===a[1]||(a[0]instanceof C&&a[1]instanceof C?x("equals",[a[0].toJSON(),a[1].toJSON()]):(s(a[0])&&s(a[1])||!!(c(a[0])&&c(a[1])||l(a[0])&&l(a[1])))&&a[0].equals(a[1])))))},G.functions.relate=function(n,t){return G.standardFunctionAsync(n,t,((a,s,c)=>{if(c=i(c),o(c,3,3,n,t),c[0]instanceof C&&c[1]instanceof C)return x("relate",[c[0].toJSON(),c[1].toJSON(),u(c[2])]);if(c[0]instanceof C&&null===c[1])return!1;if(c[1]instanceof C&&null===c[0])return!1;if(null===c[0]&&null===c[1])return!1;throw new e(n,r.InvalidParameter,t)}))},G.functions.intersection=function(n,t){return G.standardFunctionAsync(n,t,(async(e,r,a)=>(a=i(a),J(a,n,t),null===a[0]||null===a[1]?null:T(await x("intersection",[a[0].toJSON(),a[1].toJSON()])))))},G.functions.union=function(n,t){return G.standardFunctionAsync(n,t,(async(o,s,c)=>{if(0===(c=i(c)).length)throw new e(n,r.WrongNumberOfParameters,t);const l=[];if(1===c.length)if(z(c[0])){for(const a of i(c[0]))if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}}else{if(!f(c[0])){if(c[0]instanceof C)return d(a(c[0]),n.spatialReference);if(null===c[0])return null;throw new e(n,r.InvalidParameter,t)}for(const a of i(c[0].toArray()))if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}}else for(const a of c)if(null!==a){if(!(a instanceof C))throw new e(n,r.InvalidParameter,t);l.push(a.toJSON())}return 0===l.length?null:T(await x("union",[l]))}))},G.functions.difference=function(n,t){return G.standardFunctionAsync(n,t,(async(e,r,o)=>(o=i(o),J(o,n,t),null===o[0]?null:null===o[1]?a(o[0]):T(await x("difference",[o[0].toJSON(),o[1].toJSON()])))))},G.functions.symmetricdifference=function(n,t){return G.standardFunctionAsync(n,t,(async(e,r,o)=>(o=i(o),J(o,n,t),null===o[0]&&null===o[1]?null:null===o[0]?a(o[1]):null===o[1]?a(o[0]):T(await x("symmetricDifference",[o[0].toJSON(),o[1].toJSON()])))))},G.functions.clip=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,2,n,t),!(c[1]instanceof L)&&null!==c[1])throw new e(n,r.InvalidParameter,t);if(null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return null===c[1]?null:T(await x("clip",[c[0].toJSON(),c[1].toJSON()]))}))},G.functions.cut=function(n,t){return G.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,t),!(l[1]instanceof M)&&null!==l[1])throw new e(n,r.InvalidParameter,t);if(null===l[0])return[];if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);return null===l[1]?[a(l[0])]:(await x("cut",[l[0].toJSON(),l[1].toJSON()])).map((n=>T(n)))}))},G.functions.area=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),c=i(c),w(c[0])){const a=await c[0].sumArea(B(c[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}let l=c[0];if((z(l)||f(l))&&(l=m(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);return x("area",[l.toJSON(),B(c[1])])}))},G.functions.areageodetic=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{o(c,1,3,n,t);let l=(c=i(c))[0];(z(l)||f(l))&&(l=m(l,n.spatialReference));const u=B(c[1]),d=P(c[2]);if(w(l)){const a=await l.sumArea(u,d,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}if(null==l)return 0;if(!y(l))throw new e(n,r.InvalidParameter,t);return x("geodeticArea",[l.toJSON(),u,d])}))},G.functions.length=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),c=i(c),w(c[0])){const a=await c[0].sumLength(B(c[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}let l=c[0];if((z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);return x("length",[l.toJSON(),B(c[1])])}))},G.functions.length3d=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(o(c,1,2,n,t),null===(c=i(c))[0])return 0;let l=c[0];if((z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference)),null===l)return 0;if(!(l instanceof C))throw new e(n,r.InvalidParameter,t);if(!0===l.hasZ){const{convertFromSpatialReferenceUnit:n,toLengthUnit:t}=await import("../geometry/unitConversion.js"),e=A(l);return n(l.spatialReference,t(c[1]),e)}return x("length",[l.toJSON(),B(c[1])])}))},G.functions.lengthgeodetic=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{o(c,1,3,n,t);let l=(c=i(c))[0];(z(c[0])||f(c[0]))&&(l=h(c[0],n.spatialReference));const u=B(c[1]),d=P(c[2]);if(w(l)){const a=await l.sumLength(u,d,n.abortSignal);if(n.abortSignal.aborted)throw new e(n,r.Cancelled,t);return a}if(null===l)return 0;if(!y(l))throw new e(n,r.InvalidParameter,t);return x("geodeticLength",[l.toJSON(),u,d])}))},G.functions.distance=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,3,n,t);let l=c[0];if((z(c[0])||f(c[0]))&&(l=p(c[0],n.spatialReference)),!(l instanceof C))throw new e(n,r.InvalidParameter,t);let u=c[1];if((z(c[1])||f(c[1]))&&(u=p(c[1],n.spatialReference)),!(u instanceof C))throw new e(n,r.InvalidParameter,t);return x("distance",[l.toJSON(),u.toJSON(),B(c[2])])}))},G.functions.distancegeodetic=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,4,n,t);const l=c[0];if(!(l instanceof E))throw new e(n,r.InvalidParameter,t);const u=c[1];if(!(u instanceof E))throw new e(n,r.InvalidParameter,t);const f=new M({paths:[],spatialReference:l.spatialReference});return f.addPath([l,u]),x("geodeticLength",[f.toJSON(),B(c[2]),P(c[3])])}))},G.functions.densify=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,3,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);if(l<=0)throw new e(n,r.InvalidParameter,t);switch(c[0].type){case"polygon":case"polyline":case"extent":return T(await x("densify",[c[0].toJSON(),l,B(c[2])]));default:return c[0]}}))},G.functions.densifygeodetic=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{c=i(c),o(c,2,4,n,t);const l=c[0];if(null==l)return null;if(!y(l))throw new e(n,r.InvalidParameter,t);const u=g(c[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);if(u<=0)throw new e(n,r.InvalidParameter,t);const f=B(c[2]),d=P(c[3]);switch(l.type){case"polygon":case"polyline":case"extent":return T(await x("geodeticDensify",[l.toJSON(),u,f,d]));default:return l}}))},G.functions.generalize=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,4,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);const u=N(S(c[2],!0));return T(await x("generalize",[c[0].toJSON(),l,B(c[3]),{removeDegenerateParts:u}]))}))},G.functions.buffer=function(n,t){return G.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,2,3,n,t),null===l[0])return null;if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);const u=g(l[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);return 0===u?a(l[0]):T(await x("buffer",[l[0].toJSON(),u,B(l[2])]))}))},G.functions.buffergeodetic=function(n,t){return G.standardFunctionAsync(n,t,(async(s,c,l)=>{l=i(l),o(l,2,4,n,t);const u=l[0];if(null==u)return null;if(!y(u))throw new e(n,r.InvalidParameter,t);const f=g(l[1]);if(isNaN(f))throw new e(n,r.InvalidParameter,t);if(0===f)return a(u);const d=B(l[2]),w=P(l[3]);return T(await x("geodesicBuffer",[u.toJSON(),f,d,w]))}))},G.functions.offset=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,6,n,t),null===c[0])return null;if(!(c[0]instanceof k||c[0]instanceof M))throw new e(n,r.InvalidParameter,t);const l=g(c[1]);if(isNaN(l))throw new e(n,r.InvalidParameter,t);const u=I(c[3]),f=g(S(c[4],10));if(isNaN(f))throw new e(n,r.InvalidParameter,t);const d=g(S(c[5],0));if(isNaN(d))throw new e(n,r.InvalidParameter,t);return T(await x("offset",[c[0].toJSON(),l,B(c[2]),{joins:u,miterLimit:f,flattenError:d}]))}))},G.functions.rotate=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,2,3,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);const l=c[0]instanceof L?k.fromExtent(c[0]):c[0],u=g(c[1]);if(isNaN(u))throw new e(n,r.InvalidParameter,t);const f=S(c[2],null);if(null===f){const n="point"===l.type?l:l.extent?.center;return T(await x("rotate",[l.toJSON(),u,n?.x,n?.y]))}if(f instanceof E)return T(await x("rotate",[l.toJSON(),u,f.x,f.y]));throw new e(n,r.InvalidParameter,t)}))},G.functions.centroid=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,2,n,t),null===c[0])return null;const l=F(c[1]);let u=c[0];if((z(c[0])||f(c[0]))&&(u="geometric"===l?p(c[0],n.spatialReference):m(c[0],n.spatialReference),null===u))return null;if(!(u instanceof C))throw new e(n,r.InvalidParameter,t);return T("geometric"===l?await x("centroid",[u.toJSON()]):await x("labelPoint",[u.toJSON()]))}))},G.functions.measuretocoordinate=function(n,t){return G.standardFunctionAsync(n,t,j)},G.functions.pointtocoordinate=function(n,t){return G.standardFunctionAsync(n,t,R)},G.functions.distancetocoordinate=function(n,t){return G.standardFunctionAsync(n,t,b)},G.functions.multiparttosinglepart=function(n,t){return G.standardFunctionAsync(n,t,(async(s,c,l)=>{if(l=i(l),o(l,1,1,n,t),null===l[0])return null;if(!(l[0]instanceof C))throw new e(n,r.InvalidParameter,t);if(l[0]instanceof E)return[d(a(l[0]),n.spatialReference)];if(l[0]instanceof L)return[d(a(l[0]),n.spatialReference)];const u=T(await x("simplify",[l[0].toJSON()]));if(u instanceof k){const n=[],t=[];for(let e=0;e<u.rings.length;e++)if(u.isClockwise(u.rings[e])){const t=T({rings:[u.rings[e]],hasZ:!0===u.hasZ,hasM:!0===u.hasM,spatialReference:u.spatialReference.toJSON()});n.push(t)}else t.push({ring:u.rings[e],pt:u.getPoint(e,0)});for(let e=0;e<t.length;e++)for(let r=0;r<n.length;r++)if(n[r].contains(t[e].pt)){n[r].addRing(t[e].ring);break}return n}if(u instanceof M){const n=[];for(let t=0;t<u.paths.length;t++){const e=T({paths:[u.paths[t]],hasZ:!0===u.hasZ,hasM:!0===u.hasM,spatialReference:u.spatialReference.toJSON()});n.push(e)}return n}if(l[0]instanceof U){const t=[],e=d(a(l[0]),n.spatialReference);for(let n=0;n<e.points.length;n++)t.push(e.getPoint(n));return t}return null}))},G.functions.isselfintersecting=function(n,t){return G.standardFunctionAsync(n,t,(async(n,t,e)=>{o(e,1,1,n,t);let r=(e=i(e))[0];if((z(e[0])||f(e[0]))&&(r=h(e[0],n.spatialReference)),r instanceof U){const n=r.points;for(let t=0;t<n.length;t++)for(let e=t+1;e<n.length;e++)if(D(n[t],n[e]))return!0;return!1}return(r instanceof M||r instanceof k)&&await x("isSelfIntersecting",[r.toJSON()])}))},G.functions.issimple=function(n,t){return G.standardFunctionAsync(n,t,((a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return!0;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return x("isSimple",[c[0].toJSON()])}))},G.functions.simplify=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return T(await x("simplify",[c[0].toJSON()]))}))},G.functions.convexhull=function(n,t){return G.standardFunctionAsync(n,t,(async(a,s,c)=>{if(c=i(c),o(c,1,1,n,t),null===c[0])return null;if(!(c[0]instanceof C))throw new e(n,r.InvalidParameter,t);return T(await x("convexHull",[c[0].toJSON()]))}))},G.functions.getuser=function(a,i){return G.standardFunctionAsync(a,i,(async(s,c,l)=>{o(l,0,2,a,i);let f=S(l[1],""),d=!0===f;if(f=!0===f||!1===f?"":u(f),0===l.length||l[0]instanceof n){let n;n=a.services?.portal?a.services.portal:Z.getDefault(),l.length>0&&(n=v(l[0],n));const e=await q(n,f,d);if(e){const n=JSON.parse(JSON.stringify(e));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return t.convertObjectToArcadeDictionary(n,O(a))}return null}let m=null;if(w(l[0])&&(m=l[0]),m){if(d=!1,f)return null;await m.load();const e=await m.getOwningSystemUrl();if(!e){if(!f){const n=await m.getIdentityUser();return n?t.convertObjectToArcadeDictionary({username:n},O(a)):null}return null}let r;r=a.services?.portal?a.services.portal:Z.getDefault(),r=v(new n(e),r);const i=await q(r,f,d);if(i){const n=JSON.parse(JSON.stringify(i));for(const t of["lastLogin","created","modified"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return t.convertObjectToArcadeDictionary(n,O(a))}return null}throw new e(a,r.InvalidParameter,i)}))},G.functions.nearestcoordinate=function(n,a){return G.standardFunctionAsync(n,a,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,a),!(l[0]instanceof C||null===l[0]))throw new e(n,r.InvalidParameter,a);if(!(l[1]instanceof E||null===l[1]))throw new e(n,r.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const u=l[0]instanceof L?k.fromExtent(l[0]):l[0],f=await x("getNearestCoordinate",[u.toJSON(),l[1].toJSON(),{calculateLeftRightSide:!0}]);return null===f?null:t.convertObjectToArcadeDictionary({coordinate:T(f.coordinate),distance:f.distance,sideOfLine:0===f.distance?"straddle":f.isRightSide?"right":"left"},O(n),!1,!0)}))},G.functions.nearestvertex=function(n,a){return G.standardFunctionAsync(n,a,(async(s,c,l)=>{if(l=i(l),o(l,2,2,n,a),!(l[0]instanceof C||null===l[0]))throw new e(n,r.InvalidParameter,a);if(!(l[1]instanceof E||null===l[1]))throw new e(n,r.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const u=l[0]instanceof L?k.fromExtent(l[0]):l[0],f=await x("getNearestVertex",[u.toJSON(),l[1].toJSON()]);return null===f?null:t.convertObjectToArcadeDictionary({coordinate:T(f.coordinate),distance:f.distance,sideOfLine:0===f.distance?"straddle":f.isRightSide?"right":"left"},O(n),!1,!0)}))})}export{G as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{geometryMember as e,getNestedOptionalValue as t}from"../containerUtils.js";import n from"../Dictionary.js";import{ArcadeExecutionError as r,ExecutionErrorCodes as a}from"../executionError.js";import i from"../Feature.js";import l from"../ImmutablePointArray.js";import{D as o,m as s,F as f,W as c,E as u,n as m,v as p,q as w,l as h,f as R,g,k as y,j as d,i as P,d as v,L as I,X as b,y as O,A as j}from"../../chunks/languageUtils.js";import{angle2D as N,angleBetween2D as S,bearing2D as x,bearingBetween2D as J}from"./centroid.js";import{constructGeometryFromDictionary as F}from"../geometry/constructors.js";import k from"../../geometry/Extent.js";import Z from"../../geometry/Geometry.js";import W from"../../geometry/Multipoint.js";import z from"../../geometry/Point.js";import A from"../../geometry/Polygon.js";import q from"../../geometry/Polyline.js";import{isClockwise as D}from"../../geometry/support/coordsUtils.js";import{fromJSON as M}from"../../geometry/support/jsonUtils.js";import{isArray as G,isString as L,isNumber as U,isBoolean as E}from"../../support/guards.js";function _(_,T){_.ringisclockwise=function(e,t){return T(e,t,((n,i,f)=>{o(f,1,1,e,t);let c=[];if(null===f[0])return!1;if(G(f[0]))for(const l of f[0]){if(!(l instanceof z))throw new r(e,a.InvalidParameter,t);c.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}else if(f[0]instanceof l)c=f[0]._elements;else{if(!s(f[0]))throw new r(e,a.InvalidParameter,t);for(const n of f[0].toArray()){if(!(n instanceof z))throw new r(e,a.InvalidParameter,t);c.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}}return!(c.length<3)&&D(c)}))},_.polygon=function(e,t){return T(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"polygon"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof A)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new A(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},_.polyline=function(e,t){return T(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"polyline"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof q)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new q(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},_.point=function(e,t){return T(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"point"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof z)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new z(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},_.multipoint=function(e,t){return T(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"multipoint"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof W)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new W(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},_.extent=function(e,t){return T(e,t,((i,l,s)=>{s=u(s),o(s,1,1,e,t);let m=null;if(s[0]instanceof n)m=f(F(s[0],e.spatialReference),e.spatialReference);else if(s[0]instanceof z){const e={xmin:s[0].x,ymin:s[0].y,xmax:s[0].x,ymax:s[0].y,spatialReference:s[0].spatialReference.toJSON()},t=s[0];t.hasZ&&(e.zmin=t.z,e.zmax=t.z),t.hasM&&(e.mmin=t.m,e.mmax=t.m),m=M(e)}else if(s[0]instanceof A)m=M(s[0].extent?.toJSON());else if(s[0]instanceof q)m=M(s[0].extent?.toJSON());else if(s[0]instanceof W)m=M(s[0].extent?.toJSON());else if(s[0]instanceof k)m=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),m=f(new k(t),e.spatialReference)}if(null!==m&&!1===m.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(m)}))},_.geometry=function(e,t){return T(e,t,((i,l,s)=>{o(s,1,1,e,t);let u=null;if(null===s[0])return null;if(m(s[0]))u=f(s[0].geometry(),e.spatialReference);else if(s[0]instanceof n)u=f(F(s[0],e.spatialReference),e.spatialReference);else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(M(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},_.setgeometry=function(e,t){return T(e,t,((n,i,l)=>{if(o(l,2,2,e,t),!m(l[0]))throw new r(e,a.InvalidParameter,t);if(!0===l[0].immutable)throw new r(e,a.Immutable,t);if(!(l[1]instanceof Z||null===l[1]))throw new r(e,a.InvalidParameter,t);return l[0]._geometry=l[1],p}))},_.feature=function(e,t){return T(e,t,((l,o,s)=>{if(0===s.length)throw new r(e,a.WrongNumberOfParameters,t);let c;if(1===s.length)if(L(s[0]))c=i.fromJson(JSON.parse(s[0]),e.timeZone);else if(m(s[0]))c=i.createFromArcadeFeature(s[0]);else if(s[0]instanceof Z)c=i.createFromGraphicLikeObject(s[0],null,null,e.timeZone);else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);{const n=s[0].hasField("geometry")?s[0].field("geometry"):null,l=s[0].hasField("attributes")?s[0].field("attributes"):null;let o,f;if(w(n))o=F(n,e.spatialReference);else{if(null!=n&&!h(n))throw new r(e,a.InvalidParameter,t);o=n}if(w(l))f=i.parseAttributesFromDictionary(l);else{if(null!=l)throw new r(e,a.InvalidParameter,t);f=null}c=i.createFromGraphicLikeObject(o,f,null,e.timeZone)}}else if(2===s.length){let l=null,o=null;if(null!==s[0])if(s[0]instanceof Z)l=s[0];else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);l=F(s[0],e.spatialReference)}if(null!==s[1]){if(!(s[1]instanceof n))throw new r(e,a.InvalidParameter,t);o=i.parseAttributesFromDictionary(s[1])}c=i.createFromGraphicLikeObject(l,o,null,e.timeZone)}else{let l=null;const o={};if(null!==s[0])if(s[0]instanceof Z)l=s[0];else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);l=F(s[0],e.spatialReference)}for(let n=1;n<s.length;n+=2){const i=R(s[n]),l=s[n+1];if(!(null==l||L(l)||isNaN(l)||g(l)||U(l)||y(l)||d(l)||E(l)))throw new r(e,a.InvalidParameter,t);if(P(l)||!1===v(l))throw new r(e,a.InvalidParameter,t);o[i]=l===p?null:l}c=i.createFromGraphicLikeObject(l,o,null,e.timeZone)}return c._geometry=f(c.geometry(),e.spatialReference),c.immutable=!1,c}))},_.dictionary=function(e,t){return T(e,t,((i,l,o)=>{if(0===o.length||1===o.length&&null===o[0]){const e=new n;return e.immutable=!1,e}if(1===o.length&&L(o[0]))try{const t=JSON.parse(o[0]),r=n.convertObjectToArcadeDictionary(t,I(e),!1);return r.immutable=!1,r}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&o[0]instanceof Z)try{const t=o[0].toJSON();t.hasZ=!0===o[0].hasZ,t.hasM=!0===o[0].hasM;const r=n.convertObjectToArcadeDictionary(t,I(e),!1);return r.immutable=!1,r}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&m(o[0]))try{const e=new n;e.immutable=!1,e.setField("geometry",o[0].geometry());const t=new n;t.immutable=!1,e.setField("attributes",t);for(const n of o[0].keys())t.setField(n,o[0].field(n));return e}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&(w(o[0])||b(o[0])))try{const e=new n;e.immutable=!1;for(const t of o[0].keys())e.setField(t,o[0].field(t));return e}catch(u){throw new r(e,a.InvalidParameter,t)}if(2===o.length&&o[0]instanceof n&&E(o[1]))try{if(!(!0===o[1])){const e=new n;e.immutable=!1;for(const t of o[0].keys())e.setField(t,o[0].field(t));return e}return o[0].deepClone()}catch(u){throw new r(e,a.InvalidParameter,t)}if(o.length%2!=0)throw new r(e,a.WrongNumberOfParameters,t);const f={};for(let n=0;n<o.length;n+=2){const i=R(o[n]),l=o[n+1];if(!(null==l||L(l)||isNaN(l)||g(l)||U(l)||E(l)||d(l)||y(l)||G(l)||s(l)))throw new r(e,a.InvalidParameter,t);if(P(l))throw new r(e,a.InvalidParameter,t);f[i]=l===p?null:l}const c=new n(f);return c.immutable=!1,c}))},_.haskey=function(t,i){return T(t,i,((l,s,f)=>{o(f,2,2,t,i);const c=R(f[1]);if(O(f[0])||f[0]instanceof n)return f[0].hasField(c);if(f[0]instanceof Z){const t=e(f[0],c,null,null,2);return!t||"notfound"!==t.keystate}throw new r(t,a.InvalidParameter,i)}))},_.hasvalue=function(e,n){return T(e,n,((r,a,i)=>(o(i,2,2,e,n),null!=t(i[0],i[1]))))},_.indexof=function(e,t){return T(e,t,((n,i,l)=>{o(l,2,2,e,t);const f=l[1];if(G(l[0])){for(let e=0;e<l[0].length;e++)if(j(f,l[0][e]))return e;return-1}if(s(l[0])){const e=l[0].length();for(let t=0;t<e;t++)if(j(f,l[0].get(t)))return t;return-1}throw new r(e,a.InvalidParameter,t)}))},_.angle=function(e,t){return T(e,t,((n,i,l)=>{if(l=u(l),o(l,2,3,e,t),!(l[0]instanceof z))throw new r(e,a.InvalidParameter,t);if(!(l[1]instanceof z))throw new r(e,a.InvalidParameter,t);if(l.length>2&&!(l[2]instanceof z))throw new r(e,a.InvalidParameter,t);return 2===l.length?N(l[0],l[1]):S(l[0],l[1],l[2])}))},_.bearing=function(e,t){return T(e,t,((n,i,l)=>{if(l=u(l),o(l,2,3,e,t),!(l[0]instanceof z))throw new r(e,a.InvalidParameter,t);if(!(l[1]instanceof z))throw new r(e,a.InvalidParameter,t);if(l.length>2&&!(l[2]instanceof z))throw new r(e,a.InvalidParameter,t);return 2===l.length?x(l[0],l[1]):J(l[0],l[1],l[2])}))}}export{_ as registerFunctions};
5
+ import{geometryMember as e,getNestedOptionalValue as t}from"../containerUtils.js";import n from"../Dictionary.js";import{ArcadeExecutionError as r,ExecutionErrorCodes as a}from"../executionError.js";import i from"../Feature.js";import l from"../ImmutablePointArray.js";import{B as o,j as s,D as f,W as c,C as u,k as m,v as p,n as w,h,w as R,e as g,g as y,f as d,i as P,d as v,K as I,X as b,s as O,y as j}from"../../chunks/languageUtils.js";import{angle2D as N,angleBetween2D as S,bearing2D as x,bearingBetween2D as J}from"./centroid.js";import{constructGeometryFromDictionary as F}from"../geometry/constructors.js";import k from"../../geometry/Extent.js";import Z from"../../geometry/Geometry.js";import W from"../../geometry/Multipoint.js";import z from"../../geometry/Point.js";import A from"../../geometry/Polygon.js";import q from"../../geometry/Polyline.js";import{isClockwise as D}from"../../geometry/support/coordsUtils.js";import{fromJSON as M}from"../../geometry/support/jsonUtils.js";import{isArray as G,isString as L,isNumber as U,isBoolean as _}from"../../support/guards.js";function C(C,E){C.ringisclockwise=function(e,t){return E(e,t,((n,i,f)=>{o(f,1,1,e,t);let c=[];if(null===f[0])return!1;if(G(f[0]))for(const l of f[0]){if(!(l instanceof z))throw new r(e,a.InvalidParameter,t);c.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}else if(f[0]instanceof l)c=f[0]._elements;else{if(!s(f[0]))throw new r(e,a.InvalidParameter,t);for(const n of f[0].toArray()){if(!(n instanceof z))throw new r(e,a.InvalidParameter,t);c.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}}return!(c.length<3)&&D(c)}))},C.polygon=function(e,t){return E(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"polygon"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof A)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new A(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},C.polyline=function(e,t){return E(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"polyline"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof q)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new q(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},C.point=function(e,t){return E(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"point"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof z)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new z(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},C.multipoint=function(e,t){return E(e,t,((i,l,s)=>{let u;if(o(s,1,1,e,t),s[0]instanceof n){const t=f(F(s[0],e.spatialReference,"multipoint"),e.spatialReference);if(null==t)return null;u=t}else if(s[0]instanceof W)u=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(new W(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},C.extent=function(e,t){return E(e,t,((i,l,s)=>{s=u(s),o(s,1,1,e,t);let m=null;if(s[0]instanceof n)m=f(F(s[0],e.spatialReference),e.spatialReference);else if(s[0]instanceof z){const e={xmin:s[0].x,ymin:s[0].y,xmax:s[0].x,ymax:s[0].y,spatialReference:s[0].spatialReference.toJSON()},t=s[0];t.hasZ&&(e.zmin=t.z,e.zmax=t.z),t.hasM&&(e.mmin=t.m,e.mmax=t.m),m=M(e)}else if(s[0]instanceof A)m=M(s[0].extent?.toJSON());else if(s[0]instanceof q)m=M(s[0].extent?.toJSON());else if(s[0]instanceof W)m=M(s[0].extent?.toJSON());else if(s[0]instanceof k)m=M(s[0].toJSON());else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),m=f(new k(t),e.spatialReference)}if(null!==m&&!1===m.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(m)}))},C.geometry=function(e,t){return E(e,t,((i,l,s)=>{o(s,1,1,e,t);let u=null;if(null===s[0])return null;if(m(s[0]))u=f(s[0].geometry(),e.spatialReference);else if(s[0]instanceof n)u=f(F(s[0],e.spatialReference),e.spatialReference);else{const t=JSON.parse(s[0]);t&&!t.spatialReference&&(t.spatialReference=e.spatialReference),u=f(M(t),e.spatialReference)}if(null!==u&&!1===u.spatialReference.equals(e.spatialReference))throw new r(e,a.WrongSpatialReference,t);return c(u)}))},C.setgeometry=function(e,t){return E(e,t,((n,i,l)=>{if(o(l,2,2,e,t),!m(l[0]))throw new r(e,a.InvalidParameter,t);if(!0===l[0].immutable)throw new r(e,a.Immutable,t);if(!(l[1]instanceof Z||null===l[1]))throw new r(e,a.InvalidParameter,t);return l[0]._geometry=l[1],p}))},C.feature=function(e,t){return E(e,t,((l,o,s)=>{if(0===s.length)throw new r(e,a.WrongNumberOfParameters,t);let c;if(1===s.length)if(L(s[0]))c=i.fromJson(JSON.parse(s[0]),e.timeZone);else if(m(s[0]))c=i.createFromArcadeFeature(s[0]);else if(s[0]instanceof Z)c=i.createFromGraphicLikeObject(s[0],null,null,e.timeZone);else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);{const n=s[0].hasField("geometry")?s[0].field("geometry"):null,l=s[0].hasField("attributes")?s[0].field("attributes"):null;let o,f;if(w(n))o=F(n,e.spatialReference);else{if(null!=n&&!h(n))throw new r(e,a.InvalidParameter,t);o=n}if(w(l))f=i.parseAttributesFromDictionary(l);else{if(null!=l)throw new r(e,a.InvalidParameter,t);f=null}c=i.createFromGraphicLikeObject(o,f,null,e.timeZone)}}else if(2===s.length){let l=null,o=null;if(null!==s[0])if(s[0]instanceof Z)l=s[0];else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);l=F(s[0],e.spatialReference)}if(null!==s[1]){if(!(s[1]instanceof n))throw new r(e,a.InvalidParameter,t);o=i.parseAttributesFromDictionary(s[1])}c=i.createFromGraphicLikeObject(l,o,null,e.timeZone)}else{let l=null;const o={};if(null!==s[0])if(s[0]instanceof Z)l=s[0];else{if(!(s[0]instanceof n))throw new r(e,a.InvalidParameter,t);l=F(s[0],e.spatialReference)}for(let n=1;n<s.length;n+=2){const i=R(s[n]),l=s[n+1];if(!(null==l||L(l)||isNaN(l)||g(l)||U(l)||y(l)||d(l)||_(l)))throw new r(e,a.InvalidParameter,t);if(P(l)||!1===v(l))throw new r(e,a.InvalidParameter,t);o[i]=l===p?null:l}c=i.createFromGraphicLikeObject(l,o,null,e.timeZone)}return c._geometry=f(c.geometry(),e.spatialReference),c.immutable=!1,c}))},C.dictionary=function(e,t){return E(e,t,((i,l,o)=>{if(0===o.length||1===o.length&&null===o[0]){const e=new n;return e.immutable=!1,e}if(1===o.length&&L(o[0]))try{const t=JSON.parse(o[0]),r=n.convertObjectToArcadeDictionary(t,I(e),!1);return r.immutable=!1,r}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&o[0]instanceof Z)try{const t=o[0].toJSON();t.hasZ=!0===o[0].hasZ,t.hasM=!0===o[0].hasM;const r=n.convertObjectToArcadeDictionary(t,I(e),!1);return r.immutable=!1,r}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&m(o[0]))try{const e=new n;e.immutable=!1,e.setField("geometry",o[0].geometry());const t=new n;t.immutable=!1,e.setField("attributes",t);for(const n of o[0].keys())t.setField(n,o[0].field(n));return e}catch(u){throw new r(e,a.InvalidParameter,t)}if(1===o.length&&(w(o[0])||b(o[0])))try{const e=new n;e.immutable=!1;for(const t of o[0].keys())e.setField(t,o[0].field(t));return e}catch(u){throw new r(e,a.InvalidParameter,t)}if(2===o.length&&o[0]instanceof n&&_(o[1]))try{if(!(!0===o[1])){const e=new n;e.immutable=!1;for(const t of o[0].keys())e.setField(t,o[0].field(t));return e}return o[0].deepClone()}catch(u){throw new r(e,a.InvalidParameter,t)}if(o.length%2!=0)throw new r(e,a.WrongNumberOfParameters,t);const f=Object.create(null);for(let n=0;n<o.length;n+=2){const i=R(o[n]),l=o[n+1];if(!(null==l||L(l)||isNaN(l)||g(l)||U(l)||_(l)||d(l)||y(l)||G(l)||s(l)))throw new r(e,a.InvalidParameter,t);if(P(l))throw new r(e,a.InvalidParameter,t);f[i]=l===p?null:l}const c=new n(f);return c.immutable=!1,c}))},C.haskey=function(t,i){return E(t,i,((l,s,f)=>{o(f,2,2,t,i);const c=R(f[1]);if(O(f[0])||f[0]instanceof n)return f[0].hasField(c);if(f[0]instanceof Z){const t=e(f[0],c,null,null,2);return!t||"notfound"!==t.keystate}throw new r(t,a.InvalidParameter,i)}))},C.hasvalue=function(e,n){return E(e,n,((r,a,i)=>(o(i,2,2,e,n),null!=t(i[0],i[1]))))},C.indexof=function(e,t){return E(e,t,((n,i,l)=>{o(l,2,2,e,t);const f=l[1];if(G(l[0])){for(let e=0;e<l[0].length;e++)if(j(f,l[0][e]))return e;return-1}if(s(l[0])){const e=l[0].length();for(let t=0;t<e;t++)if(j(f,l[0].get(t)))return t;return-1}throw new r(e,a.InvalidParameter,t)}))},C.angle=function(e,t){return E(e,t,((n,i,l)=>{if(l=u(l),o(l,2,3,e,t),!(l[0]instanceof z))throw new r(e,a.InvalidParameter,t);if(!(l[1]instanceof z))throw new r(e,a.InvalidParameter,t);if(l.length>2&&!(l[2]instanceof z))throw new r(e,a.InvalidParameter,t);return 2===l.length?N(l[0],l[1]):S(l[0],l[1],l[2])}))},C.bearing=function(e,t){return E(e,t,((n,i,l)=>{if(l=u(l),o(l,2,3,e,t),!(l[0]instanceof z))throw new r(e,a.InvalidParameter,t);if(!(l[1]instanceof z))throw new r(e,a.InvalidParameter,t);if(l.length>2&&!(l[2]instanceof z))throw new r(e,a.InvalidParameter,t);return 2===l.length?x(l[0],l[1]):J(l[0],l[1],l[2])}))}}export{C as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as t}from"../executionError.js";import{cloneGeometry as r}from"../kernel.js";import{E as i,D as a,g as l,k as o,j as u,f,m as s,F as c,G as m,l as d,H as w,J as h,t as p,e as g,K as v,L as P}from"../../chunks/languageUtils.js";import{commonRelationsCheck as x,toCurveType as y,planarLength3D as I,toOffsetJoinType as R,toCentroidAlgorithm as j,measureToCoordinateFunc as N,pointToCoordinateFunc as E,distanceToCoordinateFunc as b}from"../geometry/functions.js";import{convertFromSpatialReferenceUnit as D,toAreaUnit as L,convert as O,toLengthUnit as S,convertToSpatialReferenceUnit as T}from"../geometry/unitConversion.js";import{equals as M}from"../../core/arrayUtils.js";import k from"../../geometry/Extent.js";import A from"../../geometry/Geometry.js";import Z from"../../geometry/Multipoint.js";import U from"../../geometry/Point.js";import q from"../../geometry/Polygon.js";import C from"../../geometry/Polyline.js";import{fromJSON as J}from"../../geometry/support/jsonUtils.js";import{squareMeters as z,meters as G}from"../geometry/extendedUnitData.js";import{isArray as H}from"../../support/guards.js";let B;async function F(){null==B&&(B=await import("../geometry/operators.js"),await B.loadAll())}function K(F,K){F.disjoint=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null===a[0]||null===a[1]||B.disjoint.execute(a[0],a[1]))))},F.intersects=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.intersects.execute(a[0],a[1]))))},F.touches=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.touches.execute(a[0],a[1]))))},F.crosses=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.crosses.execute(a[0],a[1]))))},F.within=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.within.execute(a[0],a[1]))))},F.contains=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.contains.execute(a[0],a[1]))))},F.overlaps=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&B.overlaps.execute(a[0],a[1]))))},F.equals=function(e,n){return K(e,n,((t,r,i)=>(a(i,2,2,e,n),i[0]===i[1]||(i[0]instanceof A&&i[1]instanceof A?B.equals.execute(i[0],i[1]):(l(i[0])&&l(i[1])||o(i[0])&&o(i[1])||!(!u(i[0])||!u(i[1])))&&i[0].equals(i[1])))))},F.relate=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,3,3,e,r),u[0]instanceof A&&u[1]instanceof A)return B.relate.execute(u[0],u[1],f(u[2]));if(u[0]instanceof A&&null===u[1])return!1;if(u[1]instanceof A&&null===u[0])return!1;if(null===u[0]&&null===u[1])return!1;throw new n(e,t.InvalidParameter,r)}))},F.intersection=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null===a[0]||null===a[1]?null:B.intersection.execute(a[0],a[1]))))},F.union=function(e,a){return K(e,a,((l,o,u)=>{if(0===(u=i(u)).length)throw new n(e,t.WrongNumberOfParameters,a);const f=[];if(1===u.length)if(H(u[0])){for(const r of i(u[0]))if(null!==r){if(!(r instanceof A))throw new n(e,t.InvalidParameter,a);f.push(r)}}else{if(!s(u[0])){if(u[0]instanceof A)return c(r(u[0]),e.spatialReference);if(null===u[0])return null;throw new n(e,t.InvalidParameter,a)}for(const r of i(u[0].toArray()))if(null!==r){if(!(r instanceof A))throw new n(e,t.InvalidParameter,a);f.push(r)}}else for(const r of u)if(null!==r){if(!(r instanceof A))throw new n(e,t.InvalidParameter,a);f.push(r)}return 0===f.length?null:B.union.executeMany(f)}))},F.difference=function(e,n){return K(e,n,((t,a,l)=>(l=i(l),x(l,e,n),null===l[0]?null:null===l[1]?r(l[0]):B.difference.execute(l[0],l[1]))))},F.symmetricdifference=function(e,n){return K(e,n,((t,a,l)=>(l=i(l),x(l,e,n),null===l[0]&&null===l[1]?null:null===l[0]?r(l[1]):null===l[1]?r(l[0]):B.symmetricDifference.execute(l[0],l[1]))))},F.clip=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,2,e,r),!(u[1]instanceof k)&&null!==u[1])throw new n(e,t.InvalidParameter,r);if(null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);return null===u[1]?null:B.clip.execute(u[0],u[1])}))},F.cut=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,2,2,e,l),!(f[1]instanceof C)&&null!==f[1])throw new n(e,t.InvalidParameter,l);if(null===f[0])return[];if(!(f[0]instanceof A))throw new n(e,t.InvalidParameter,l);return null===f[1]?[r(f[0])]:B.cut.execute(f[0],f[1])}))},F.area=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((H(u[0])||s(u[0]))&&(f=m(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof A))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,L(u[1]),B.area.execute(f))}))},F.areageodetic=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,3,e,r);let f=(u=i(u))[0];(H(f)||s(f))&&(f=m(f,e.spatialReference));const c=L(u[1]),w=y(u[2]);if(null==f)return 0;if(!d(f))throw new n(e,t.InvalidParameter,r);return O(z,c,B.geodeticArea.execute(f,{curveType:w}))}))},F.length=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((H(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof A))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,S(u[1]),B.length.execute(f))}))},F.length3d=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((H(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof A))throw new n(e,t.InvalidParameter,r);return!0===f.hasZ?D(f.spatialReference,S(u[1]),I(f)):D(f.spatialReference,S(u[1]),B.length.execute(f))}))},F.lengthgeodetic=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,3,e,r);let f=(u=i(u))[0];(H(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference));const c=y(u[2]);if(null==f)return 0;if(null!=f&&!d(f))throw new n(e,t.InvalidParameter,r);const m=S(u[1]);return O(G,m,B.geodeticLength.execute(f,{curveType:c}))}))},F.distance=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,3,e,r);let f=u[0];if((H(u[0])||s(u[0]))&&(f=h(u[0],e.spatialReference)),!(f instanceof A))throw new n(e,t.InvalidParameter,r);let c=u[1];if((H(u[1])||s(u[1]))&&(c=h(u[1],e.spatialReference)),!(c instanceof A))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,S(u[2]),B.distance.execute(f,c))}))},F.distancegeodetic=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,4,e,r);const f=u[0];if(!(f instanceof U))throw new n(e,t.InvalidParameter,r);const s=u[1];if(!(s instanceof U))throw new n(e,t.InvalidParameter,r);const c=S(u[2]),m=y(u[3]),d=new C({paths:[],spatialReference:f.spatialReference});return d.addPath([f,s]),O(G,c,B.geodeticLength.execute(d,{curveType:m}))}))},F.densify=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,3,e,r),null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);if(f<=0)throw new n(e,t.InvalidParameter,r);const s=T(S(u[2]),u[0].spatialReference,f);switch(u[0].type){case"polygon":case"polyline":case"extent":return B.densify.execute(u[0],s);default:return u[0]}}))},F.densifygeodetic=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,4,e,r);const f=u[0];if(null==f)return null;if(!d(f))throw new n(e,t.InvalidParameter,r);const s=p(u[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,r);if(s<=0)throw new n(e,t.InvalidParameter,r);const c=S(u[2]),m=y(u[3]),w=O(c,G,s);switch(f.type){case"polygon":case"polyline":case"extent":return B.geodeticDensify.execute(f,w,{curveType:m});default:return f}}))},F.generalize=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,4,e,r),null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);const s=T(S(u[3]),u[0].spatialReference,f);return B.generalize.execute(u[0],s,{removeDegenerateParts:g(v(u[2],!0))})}))},F.buffer=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,2,3,e,l),null===f[0])return null;if(!(f[0]instanceof A))throw new n(e,t.InvalidParameter,l);const s=p(f[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,l);return 0===s?r(f[0]):B.buffer.execute(f[0],T(S(f[2]),f[0].spatialReference,s))}))},F.buffergeodetic=function(e,l){return K(e,l,((o,u,f)=>{f=i(f),a(f,2,4,e,l);const s=f[0];if(null==s)return null;if(!d(s))throw new n(e,t.InvalidParameter,l);const c=p(f[1]);if(isNaN(c))throw new n(e,t.InvalidParameter,l);if(0===c)return r(s);const m=S(f[2]),w=y(f[3]);return B.geodesicBuffer.execute(s,O(m,G,c),{curveType:w})}))},F.offset=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,6,e,r),null===u[0])return null;if(!(u[0]instanceof q||u[0]instanceof C))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);const s=T(S(u[2]),u[0].spatialReference,f),c=R(u[3]),m=p(v(u[4],10));if(isNaN(m))throw new n(e,t.InvalidParameter,r);const d=p(v(u[5],0));if(isNaN(d))throw new n(e,t.InvalidParameter,r);return B.offset.execute(u[0],s,{joins:c,miterLimit:m,flattenError:d})}))},F.rotate=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,3,e,r),null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);const f=u[0]instanceof k?q.fromExtent(u[0]):u[0],s=p(u[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,r);const c=v(u[2],null);if(null===c){const e="point"===f.type?f:f.extent?.center;return B.rotate(f,s,e?.x,e?.y)}if(c instanceof U)return B.rotate(f,s,c.x,c.y);throw new n(e,t.InvalidParameter,r)}))},F.centroid=function(e,r){return K(e,r,((e,r,l)=>{if(l=i(l),a(l,1,2,e,r),null===l[0])return null;const o=j(l[1]);let u=l[0];if((H(l[0])||s(l[0]))&&(u="geometric"===o?h(l[0],e.spatialReference):m(l[0],e.spatialReference),null===u))return null;if(!(u instanceof A))throw new n(e,t.InvalidParameter,r);return"geometric"===o?B.centroid.execute(u):B.labelPoint.execute(u)}))},F.measuretocoordinate=function(e,n){return K(e,n,N)},F.pointtocoordinate=function(e,n){return K(e,n,E)},F.distancetocoordinate=function(e,n){return K(e,n,b)},F.multiparttosinglepart=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,1,1,e,l),null===f[0])return null;if(!(f[0]instanceof A))throw new n(e,t.InvalidParameter,l);if(f[0]instanceof U)return[c(r(f[0]),e.spatialReference)];if(f[0]instanceof k)return[c(r(f[0]),e.spatialReference)];const s=B.simplify.execute(f[0]);if(s instanceof q){const e=[],n=[];for(let t=0;t<s.rings.length;t++)if(s.isClockwise(s.rings[t])){const n=J({rings:[s.rings[t]],hasZ:!0===s.hasZ,hasM:!0===s.hasM,spatialReference:s.spatialReference.toJSON()});e.push(n)}else n.push({ring:s.rings[t],pt:s.getPoint(t,0)});for(let t=0;t<n.length;t++)for(let r=0;r<e.length;r++)if(e[r].contains(n[t].pt)){e[r].addRing(n[t].ring);break}return e}if(s instanceof C){const e=[];for(let n=0;n<s.paths.length;n++){const t=J({paths:[s.paths[n]],hasZ:!0===s.hasZ,hasM:!0===s.hasM,spatialReference:s.spatialReference.toJSON()});e.push(t)}return e}if(f[0]instanceof Z){const n=[],t=c(r(f[0]),e.spatialReference);for(let e=0;e<t.points.length;e++)n.push(t.getPoint(e));return n}return null}))},F.isselfintersecting=function(e,n){return K(e,n,((e,n,t)=>{a(t,1,1,e,n);let r=(t=i(t))[0];if((H(t[0])||s(t[0]))&&(r=w(t[0],e.spatialReference)),r instanceof Z){const e=r.points;for(let n=0;n<e.length;n++)for(let t=n+1;t<e.length;t++)if(M(e[n],e[t]))return!0;return!1}return(r instanceof C||r instanceof q)&&B.isSelfIntersecting(r)}))},F.issimple=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return!0;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);return B.simplify.isSimple(u[0])}))},F.simplify=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);return B.simplify.execute(u[0])}))},F.convexhull=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return null;if(!(u[0]instanceof A))throw new n(e,t.InvalidParameter,r);return B.convexHull.execute(u[0])}))},F.nearestcoordinate=function(r,l){return K(r,l,((o,u,f)=>{if(f=i(f),a(f,2,2,r,l),!(f[0]instanceof A||null===f[0]))throw new n(r,t.InvalidParameter,l);if(!(f[1]instanceof U||null===f[1]))throw new n(r,t.InvalidParameter,l);if(null===f[0]||null===f[1])return null;const s=f[0]instanceof k?q.fromExtent(f[0]):f[0],c=B.proximity.getNearestCoordinate(s,f[1],{calculateLeftRightSide:!0});return null===c||c.isEmpty?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.rightSide?"right":"left"},P(r),!1,!0)}))},F.nearestvertex=function(r,l){return K(r,l,((o,u,f)=>{if(f=i(f),a(f,2,2,r,l),!(f[0]instanceof A||null===f[0]))throw new n(r,t.InvalidParameter,l);if(!(f[1]instanceof U||null===f[1]))throw new n(r,t.InvalidParameter,l);if(null===f[0]||null===f[1])return null;const s=f[0]instanceof k?q.fromExtent(f[0]):f[0],c=B.proximity.getNearestVertex(s,f[1]);return null===c||c.isEmpty?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.rightSide?"right":"left"},P(r),!1,!0)}))}}export{F as loadOperators,K as registerFunctions};
5
+ import e from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as t}from"../executionError.js";import{cloneGeometry as r}from"../kernel.js";import{C as i,B as a,e as l,g as o,f as u,w as f,j as s,D as c,E as m,h as d,F as w,G as h,u as p,H as g,J as v,K as P}from"../../chunks/languageUtils.js";import{commonRelationsCheck as x,toCurveType as y,planarLength3D as I,toOffsetJoinType as R,toCentroidAlgorithm as j,measureToCoordinateFunc as N,pointToCoordinateFunc as E,distanceToCoordinateFunc as b}from"../geometry/functions.js";import{convertFromSpatialReferenceUnit as D,toAreaUnit as O,convert as S,toLengthUnit as T,convertToSpatialReferenceUnit as L}from"../geometry/unitConversion.js";import{equals as M}from"../../core/arrayUtils.js";import A from"../../geometry/Extent.js";import Z from"../../geometry/Geometry.js";import k from"../../geometry/Multipoint.js";import C from"../../geometry/Point.js";import U from"../../geometry/Polygon.js";import q from"../../geometry/Polyline.js";import{fromJSON as J}from"../../geometry/support/jsonUtils.js";import{squareMeters as z,meters as B}from"../geometry/extendedUnitData.js";import{isArray as G}from"../../support/guards.js";let H;async function F(){null==H&&(H=await import("../geometry/operators.js"),await H.loadAll())}function K(F,K){F.disjoint=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null===a[0]||null===a[1]||H.disjoint.execute(a[0],a[1]))))},F.intersects=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.intersects.execute(a[0],a[1]))))},F.touches=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.touches.execute(a[0],a[1]))))},F.crosses=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.crosses.execute(a[0],a[1]))))},F.within=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.within.execute(a[0],a[1]))))},F.contains=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.contains.execute(a[0],a[1]))))},F.overlaps=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null!==a[0]&&null!==a[1]&&H.overlaps.execute(a[0],a[1]))))},F.equals=function(e,n){return K(e,n,((t,r,i)=>(a(i,2,2,e,n),i[0]===i[1]||(i[0]instanceof Z&&i[1]instanceof Z?H.equals.execute(i[0],i[1]):(l(i[0])&&l(i[1])||o(i[0])&&o(i[1])||!(!u(i[0])||!u(i[1])))&&i[0].equals(i[1])))))},F.relate=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,3,3,e,r),u[0]instanceof Z&&u[1]instanceof Z)return H.relate.execute(u[0],u[1],f(u[2]));if(u[0]instanceof Z&&null===u[1])return!1;if(u[1]instanceof Z&&null===u[0])return!1;if(null===u[0]&&null===u[1])return!1;throw new n(e,t.InvalidParameter,r)}))},F.intersection=function(e,n){return K(e,n,((t,r,a)=>(a=i(a),x(a,e,n),null===a[0]||null===a[1]?null:H.intersection.execute(a[0],a[1]))))},F.union=function(e,a){return K(e,a,((l,o,u)=>{if(0===(u=i(u)).length)throw new n(e,t.WrongNumberOfParameters,a);const f=[];if(1===u.length)if(G(u[0])){for(const r of i(u[0]))if(null!==r){if(!(r instanceof Z))throw new n(e,t.InvalidParameter,a);f.push(r)}}else{if(!s(u[0])){if(u[0]instanceof Z)return c(r(u[0]),e.spatialReference);if(null===u[0])return null;throw new n(e,t.InvalidParameter,a)}for(const r of i(u[0].toArray()))if(null!==r){if(!(r instanceof Z))throw new n(e,t.InvalidParameter,a);f.push(r)}}else for(const r of u)if(null!==r){if(!(r instanceof Z))throw new n(e,t.InvalidParameter,a);f.push(r)}return 0===f.length?null:H.union.executeMany(f)}))},F.difference=function(e,n){return K(e,n,((t,a,l)=>(l=i(l),x(l,e,n),null===l[0]?null:null===l[1]?r(l[0]):H.difference.execute(l[0],l[1]))))},F.symmetricdifference=function(e,n){return K(e,n,((t,a,l)=>(l=i(l),x(l,e,n),null===l[0]&&null===l[1]?null:null===l[0]?r(l[1]):null===l[1]?r(l[0]):H.symmetricDifference.execute(l[0],l[1]))))},F.clip=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,2,e,r),!(u[1]instanceof A)&&null!==u[1])throw new n(e,t.InvalidParameter,r);if(null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);return null===u[1]?null:H.clip.execute(u[0],u[1])}))},F.cut=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,2,2,e,l),!(f[1]instanceof q)&&null!==f[1])throw new n(e,t.InvalidParameter,l);if(null===f[0])return[];if(!(f[0]instanceof Z))throw new n(e,t.InvalidParameter,l);return null===f[1]?[r(f[0])]:H.cut.execute(f[0],f[1])}))},F.area=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((G(u[0])||s(u[0]))&&(f=m(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof Z))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,O(u[1]),H.area.execute(f))}))},F.areageodetic=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,3,e,r);let f=(u=i(u))[0];(G(f)||s(f))&&(f=m(f,e.spatialReference));const c=O(u[1]),w=y(u[2]);if(null==f)return 0;if(!d(f))throw new n(e,t.InvalidParameter,r);return S(z,c,H.geodeticArea.execute(f,{curveType:w}))}))},F.length=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((G(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof Z))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,T(u[1]),H.length.execute(f))}))},F.length3d=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,2,e,r);let f=(u=i(u))[0];if((G(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference)),null===f)return 0;if(!(f instanceof Z))throw new n(e,t.InvalidParameter,r);return!0===f.hasZ?D(f.spatialReference,T(u[1]),I(f)):D(f.spatialReference,T(u[1]),H.length.execute(f))}))},F.lengthgeodetic=function(e,r){return K(e,r,((l,o,u)=>{a(u,1,3,e,r);let f=(u=i(u))[0];(G(u[0])||s(u[0]))&&(f=w(u[0],e.spatialReference));const c=y(u[2]);if(null==f)return 0;if(null!=f&&!d(f))throw new n(e,t.InvalidParameter,r);const m=T(u[1]);return S(B,m,H.geodeticLength.execute(f,{curveType:c}))}))},F.distance=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,3,e,r);let f=u[0];if((G(u[0])||s(u[0]))&&(f=h(u[0],e.spatialReference)),!(f instanceof Z))throw new n(e,t.InvalidParameter,r);let c=u[1];if((G(u[1])||s(u[1]))&&(c=h(u[1],e.spatialReference)),!(c instanceof Z))throw new n(e,t.InvalidParameter,r);return D(f.spatialReference,T(u[2]),H.distance.execute(f,c))}))},F.distancegeodetic=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,4,e,r);const f=u[0];if(!(f instanceof C))throw new n(e,t.InvalidParameter,r);const s=u[1];if(!(s instanceof C))throw new n(e,t.InvalidParameter,r);const c=T(u[2]),m=y(u[3]),d=new q({paths:[],spatialReference:f.spatialReference});return d.addPath([f,s]),S(B,c,H.geodeticLength.execute(d,{curveType:m}))}))},F.densify=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,3,e,r),null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);if(f<=0)throw new n(e,t.InvalidParameter,r);const s=L(T(u[2]),u[0].spatialReference,f);switch(u[0].type){case"polygon":case"polyline":case"extent":return H.densify.execute(u[0],s);default:return u[0]}}))},F.densifygeodetic=function(e,r){return K(e,r,((l,o,u)=>{u=i(u),a(u,2,4,e,r);const f=u[0];if(null==f)return null;if(!d(f))throw new n(e,t.InvalidParameter,r);const s=p(u[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,r);if(s<=0)throw new n(e,t.InvalidParameter,r);const c=T(u[2]),m=y(u[3]),w=S(c,B,s);switch(f.type){case"polygon":case"polyline":case"extent":return H.geodeticDensify.execute(f,w,{curveType:m});default:return f}}))},F.generalize=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,4,e,r),null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);const s=L(T(u[3]),u[0].spatialReference,f);return H.generalize.execute(u[0],s,{removeDegenerateParts:g(v(u[2],!0))})}))},F.buffer=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,2,3,e,l),null===f[0])return null;if(!(f[0]instanceof Z))throw new n(e,t.InvalidParameter,l);const s=p(f[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,l);return 0===s?r(f[0]):H.buffer.execute(f[0],L(T(f[2]),f[0].spatialReference,s))}))},F.buffergeodetic=function(e,l){return K(e,l,((o,u,f)=>{f=i(f),a(f,2,4,e,l);const s=f[0];if(null==s)return null;if(!d(s))throw new n(e,t.InvalidParameter,l);const c=p(f[1]);if(isNaN(c))throw new n(e,t.InvalidParameter,l);if(0===c)return r(s);const m=T(f[2]),w=y(f[3]);return H.geodesicBuffer.execute(s,S(m,B,c),{curveType:w})}))},F.offset=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,6,e,r),null===u[0])return null;if(!(u[0]instanceof U||u[0]instanceof q))throw new n(e,t.InvalidParameter,r);const f=p(u[1]);if(isNaN(f))throw new n(e,t.InvalidParameter,r);const s=L(T(u[2]),u[0].spatialReference,f),c=R(u[3]),m=p(v(u[4],10));if(isNaN(m))throw new n(e,t.InvalidParameter,r);const d=p(v(u[5],0));if(isNaN(d))throw new n(e,t.InvalidParameter,r);return H.offset.execute(u[0],s,{joins:c,miterLimit:m,flattenError:d})}))},F.rotate=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,2,3,e,r),null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);const f=u[0]instanceof A?U.fromExtent(u[0]):u[0],s=p(u[1]);if(isNaN(s))throw new n(e,t.InvalidParameter,r);const c=v(u[2],null);if(null===c){const e="point"===f.type?f:f.extent?.center;return H.rotate(f,s,e?.x,e?.y)}if(c instanceof C)return H.rotate(f,s,c.x,c.y);throw new n(e,t.InvalidParameter,r)}))},F.centroid=function(e,r){return K(e,r,((e,r,l)=>{if(l=i(l),a(l,1,2,e,r),null===l[0])return null;const o=j(l[1]);let u=l[0];if((G(l[0])||s(l[0]))&&(u="geometric"===o?h(l[0],e.spatialReference):m(l[0],e.spatialReference),null===u))return null;if(!(u instanceof Z))throw new n(e,t.InvalidParameter,r);return"geometric"===o?H.centroid.execute(u):H.labelPoint.execute(u)}))},F.measuretocoordinate=function(e,n){return K(e,n,N)},F.pointtocoordinate=function(e,n){return K(e,n,E)},F.distancetocoordinate=function(e,n){return K(e,n,b)},F.multiparttosinglepart=function(e,l){return K(e,l,((o,u,f)=>{if(f=i(f),a(f,1,1,e,l),null===f[0])return null;if(!(f[0]instanceof Z))throw new n(e,t.InvalidParameter,l);if(f[0]instanceof C)return[c(r(f[0]),e.spatialReference)];if(f[0]instanceof A)return[c(r(f[0]),e.spatialReference)];const s=H.simplify.execute(f[0]);if(s instanceof U){const e=[],n=[];for(let t=0;t<s.rings.length;t++)if(s.isClockwise(s.rings[t])){const n=J({rings:[s.rings[t]],hasZ:!0===s.hasZ,hasM:!0===s.hasM,spatialReference:s.spatialReference.toJSON()});e.push(n)}else n.push({ring:s.rings[t],pt:s.getPoint(t,0)});for(let t=0;t<n.length;t++)for(let r=0;r<e.length;r++)if(e[r].contains(n[t].pt)){e[r].addRing(n[t].ring);break}return e}if(s instanceof q){const e=[];for(let n=0;n<s.paths.length;n++){const t=J({paths:[s.paths[n]],hasZ:!0===s.hasZ,hasM:!0===s.hasM,spatialReference:s.spatialReference.toJSON()});e.push(t)}return e}if(f[0]instanceof k){const n=[],t=c(r(f[0]),e.spatialReference);for(let e=0;e<t.points.length;e++)n.push(t.getPoint(e));return n}return null}))},F.isselfintersecting=function(e,n){return K(e,n,((e,n,t)=>{a(t,1,1,e,n);let r=(t=i(t))[0];if((G(t[0])||s(t[0]))&&(r=w(t[0],e.spatialReference)),r instanceof k){const e=r.points;for(let n=0;n<e.length;n++)for(let t=n+1;t<e.length;t++)if(M(e[n],e[t]))return!0;return!1}return(r instanceof q||r instanceof U)&&H.isSelfIntersecting(r)}))},F.issimple=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return!0;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);return H.simplify.isSimple(u[0])}))},F.simplify=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);return H.simplify.execute(u[0])}))},F.convexhull=function(e,r){return K(e,r,((l,o,u)=>{if(u=i(u),a(u,1,1,e,r),null===u[0])return null;if(!(u[0]instanceof Z))throw new n(e,t.InvalidParameter,r);return H.convexHull.execute(u[0])}))},F.nearestcoordinate=function(r,l){return K(r,l,((o,u,f)=>{if(f=i(f),a(f,2,2,r,l),!(f[0]instanceof Z||null===f[0]))throw new n(r,t.InvalidParameter,l);if(!(f[1]instanceof C||null===f[1]))throw new n(r,t.InvalidParameter,l);if(null===f[0]||null===f[1])return null;const s=f[0]instanceof A?U.fromExtent(f[0]):f[0],c=H.proximity.getNearestCoordinate(s,f[1],{calculateLeftRightSide:!0});return null===c||c.isEmpty?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"},P(r),!1,!0)}))},F.nearestvertex=function(r,l){return K(r,l,((o,u,f)=>{if(f=i(f),a(f,2,2,r,l),!(f[0]instanceof Z||null===f[0]))throw new n(r,t.InvalidParameter,l);if(!(f[1]instanceof C||null===f[1]))throw new n(r,t.InvalidParameter,l);if(null===f[0]||null===f[1])return null;const s=f[0]instanceof A?U.fromExtent(f[0]):f[0],c=H.proximity.getNearestVertex(s,f[1]);return null===c||c.isEmpty?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"},P(r),!1,!0)}))}}export{F as loadOperators,K as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../config.js";import r from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as o}from"../executionError.js";import{D as a,f as i,r as s,K as p,L as l,g as c,j as f,k as u,q as m,l as d}from"../../chunks/languageUtils.js";import{getPortal as g}from"../portalUtils.js";import h from"../../geometry/Geometry.js";import{load as w,project as y,isLoaded as j}from"../../geometry/projectionUtils.js";import S from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as v,geographicToWebMercator as R}from"../../geometry/support/webMercatorUtils.js";import G from"../../portal/Portal.js";import k from"../../portal/PortalItem.js";import{project as x}from"../../rest/geometryService/project.js";import P from"../../rest/knowledgeGraph/Entity.js";import b from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import I from"../../rest/knowledgeGraph/ObjectValue.js";import D from"../../rest/knowledgeGraph/Path.js";import W from"../../rest/knowledgeGraph/Relationship.js";import T from"../../rest/support/ProjectParameters.js";import{isString as q,isArray as U,isNumber as A,isDate as N}from"../../support/guards.js";let F=null;async function J(r){const t=e.geometryServiceUrl??"";if(!t){j()||await w();for(const e of r)e.container[e.indexer]=y(e.container[e.indexer],S.WGS84);return}const n=r.map((e=>e.container[e.indexer])),o=new T({geometries:n,outSpatialReference:S.WGS84}),a=await x(t,o);for(let e=0;e<a.length;e++){const t=r[e];t.container[t.indexer]=a[e]}}async function M(e,r){const t=new k({portal:e,id:r});return await t.load(),null===F&&(F=await import("../../rest/knowledgeGraphService.js")),await F.fetchKnowledgeGraph(t.url)}function Q(e,r,t,n,o){if(null===e)return null;if(q(e)||A(e))return e;if(c(e))return e.toJSDate();if(c(e))return e.toJSDate();if(f(e))return e.toStorageFormat();if(u(e))return e.toStorageString();if(m(e)){const a={};for(const i of e.keys())a[i]=Q(e.field(i),r,t,n,o),a[i]instanceof h&&o.push({container:a,indexer:i});return a}if(U(e)){const a=e.map((e=>Q(e,r,t,n,o)));for(let e=0;e<a.length;e++)a[e]instanceof h&&o.push({container:a,indexer:e});return a}return d(e)?e.spatialReference.isWGS84?e:e.spatialReference.isWebMercator&&r?v(e):e:void 0}function E(e,r){if(!e)return e;if(e.spatialReference.isWGS84&&r.spatialReference.isWebMercator)return R(e);if(e.spatialReference.equals(r.spatialReference))return e;throw new n(r,o.WrongSpatialReference,null)}function K(e,r){if(!e)return null;const t={};for(const n in e)t[n]=V(e[n],r);return t}function V(e,r){return null===e?null:U(e)?e.map((e=>V(e,r))):e instanceof P?{graphTypeName:e.typeName,id:e.id,graphType:"entity",properties:K(e.properties,r)}:e instanceof I?{graphType:"object",properties:K(e.properties,r)}:e instanceof W?{graphTypeName:e.typeName,id:e.id,graphType:"relationship",originId:e.originId??null,destinationId:e.destinationId??null,properties:K(e.properties,r)}:e instanceof D?{graphType:"path",path:e.path?e.path.map((e=>V(e,r))):null}:d(e)?E(e,r):q(e)||A(e)||N(e)?e:null}function B(e){"async"===e.mode&&(e.functions.knowledgegraphbyportalitem=function(t,s){return e.standardFunctionAsync(t,s,((e,p,l)=>{if(a(l,2,2,t,s),null===l[0])throw new n(t,o.PortalRequired,s);if(l[0]instanceof r){const e=i(l[1]);let r;r=t.services?.portal?t.services.portal:G.getDefault();return M(g(l[0],r),e)}if(!1===q(l[0]))throw new n(t,o.InvalidParameter,s);const c=i(l[0]);return M(t.services?.portal??G.getDefault(),c)}))},e.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),e.functions.querygraph=function(r,i){return e.standardFunctionAsync(r,i,(async(e,c,f)=>{a(f,2,4,r,i);const u=f[0];if(!s(u))throw new n(r,o.InvalidParameter,i);const m=f[1];if(!q(m))throw new n(r,o.InvalidParameter,i);null===F&&(F=await import("../../rest/knowledgeGraphService.js"));let d=null;const g=p(f[2],null);if(!(g instanceof t||null===g))throw new n(r,o.InvalidParameter,i);if(g){let e=[];d=Q(g,!0,!1,r,e),e=e.filter((e=>!e.container[e.indexer].spatialReference.isWGS84)),e.length>0&&await J(e)}const h=p(f[3],!1),w=new b({openCypherQuery:m,bindParameters:d,provenanceBehavior:h?"include":"exclude"});(u?.serviceDefinition?.currentVersion??11.3)>11.2&&(w.outputSpatialReference=r.spatialReference);const y=(await F.executeQueryStreaming(u,w)).resultRowsStream.getReader(),j=[];try{for(;;){const{done:e,value:t}=await y.read();if(e)break;if(U(t))for(const n of t)j.push(V(n,r));else{const e=[];for(const n of t)e.push(V(t[n],r));j.push(e)}}}catch(S){throw S}return t.convertJsonToArcade(j,l(r),!1,!0)}))},e.signatures.push({name:"querygraph",min:2,max:4}))}export{B as registerFunctions};
5
+ import e from"../../config.js";import r from"../ArcadePortal.js";import t from"../Dictionary.js";import{ArcadeExecutionError as n,ExecutionErrorCodes as o}from"../executionError.js";import{B as a,w as i,o as s,J as p,K as l,e as c,f,g as u,n as m,h as d}from"../../chunks/languageUtils.js";import{getPortal as h}from"../portalUtils.js";import g from"../../geometry/Geometry.js";import{load as w,project as y,isLoaded as j}from"../../geometry/projectionUtils.js";import S from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as v,geographicToWebMercator as R}from"../../geometry/support/webMercatorUtils.js";import G from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{project as k}from"../../rest/geometryService/project.js";import P from"../../rest/knowledgeGraph/Entity.js";import b from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import I from"../../rest/knowledgeGraph/ObjectValue.js";import W from"../../rest/knowledgeGraph/Path.js";import D from"../../rest/knowledgeGraph/Relationship.js";import T from"../../rest/support/ProjectParameters.js";import{isString as U,isArray as q,isNumber as A,isDate as J}from"../../support/guards.js";let N=null;async function F(r){const t=e.geometryServiceUrl??"";if(!t){j()||await w();for(const e of r)e.container[e.indexer]=y(e.container[e.indexer],S.WGS84);return}const n=r.map((e=>e.container[e.indexer])),o=new T({geometries:n,outSpatialReference:S.WGS84}),a=await k(t,o);for(let e=0;e<a.length;e++){const t=r[e];t.container[t.indexer]=a[e]}}async function M(e,r){const t=new x({portal:e,id:r});return await t.load(),null===N&&(N=await import("../../rest/knowledgeGraphService.js")),await N.fetchKnowledgeGraph(t.url)}function Q(e,r,t,n,o){if(null===e)return null;if(U(e)||A(e))return e;if(c(e))return e.toJSDate();if(c(e))return e.toJSDate();if(f(e))return e.toStorageFormat();if(u(e))return e.toStorageString();if(m(e)){const a={};for(const i of e.keys())a[i]=Q(e.field(i),r,t,n,o),a[i]instanceof g&&o.push({container:a,indexer:i});return a}if(q(e)){const a=e.map((e=>Q(e,r,t,n,o)));for(let e=0;e<a.length;e++)a[e]instanceof g&&o.push({container:a,indexer:e});return a}return d(e)?e.spatialReference.isWGS84?e:e.spatialReference.isWebMercator&&r?v(e):e:void 0}function B(e,r){if(!e)return e;if(e.spatialReference.isWGS84&&r.spatialReference.isWebMercator)return R(e);if(e.spatialReference.equals(r.spatialReference))return e;throw new n(r,o.WrongSpatialReference,null)}function E(e,r){if(!e)return null;const t={};for(const n in e)t[n]=K(e[n],r);return t}function K(e,r){return null===e?null:q(e)?e.map((e=>K(e,r))):e instanceof P?{graphTypeName:e.typeName,id:e.id,graphType:"entity",properties:E(e.properties,r)}:e instanceof I?{graphType:"object",properties:E(e.properties,r)}:e instanceof D?{graphTypeName:e.typeName,id:e.id,graphType:"relationship",originId:e.originId??null,destinationId:e.destinationId??null,properties:E(e.properties,r)}:e instanceof W?{graphType:"path",path:e.path?e.path.map((e=>K(e,r))):null}:d(e)?B(e,r):U(e)||A(e)||J(e)?e:null}function V(e){"async"===e.mode&&(e.functions.knowledgegraphbyportalitem=function(t,s){return e.standardFunctionAsync(t,s,((e,p,l)=>{if(a(l,2,2,t,s),null===l[0])throw new n(t,o.PortalRequired,s);if(l[0]instanceof r){const e=i(l[1]);let r;r=t.services?.portal?t.services.portal:G.getDefault();return M(h(l[0],r),e)}if(!1===U(l[0]))throw new n(t,o.InvalidParameter,s);const c=i(l[0]);return M(t.services?.portal??G.getDefault(),c)}))},e.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),e.functions.querygraph=function(r,i){return e.standardFunctionAsync(r,i,(async(e,c,f)=>{a(f,2,4,r,i);const u=f[0];if(!s(u))throw new n(r,o.InvalidParameter,i);const m=f[1];if(!U(m))throw new n(r,o.InvalidParameter,i);null===N&&(N=await import("../../rest/knowledgeGraphService.js"));let d=null;const h=p(f[2],null);if(!(h instanceof t||null===h))throw new n(r,o.InvalidParameter,i);if(h){let e=[];d=Q(h,!0,!1,r,e),e=e.filter((e=>!e.container[e.indexer].spatialReference.isWGS84)),e.length>0&&await F(e)}const g=p(f[3],!1),w=new b({openCypherQuery:m,bindParameters:d,provenanceBehavior:g?"include":"exclude"});(u?.serviceDefinition?.currentVersion??11.3)>11.2&&(w.outputSpatialReference=r.spatialReference);const y=(await N.executeQueryStreaming(u,w)).resultRowsStream.getReader(),j=[];try{for(;;){const{done:e,value:t}=await y.read();if(e)break;if(q(t))for(const n of t)j.push(K(n,r));else{const e=[];for(const n of t)e.push(K(t[n],r));j.push(e)}}}catch(S){throw S}return t.convertJsonToArcade(j,l(r),!1,!0)}))},e.signatures.push({name:"querygraph",min:2,max:4}))}export{V as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{D as n,g as t,k as r,j as u,Y as e,t as o,v as i,e as a,m as s}from"../../chunks/languageUtils.js";import{decimalAdjust as f}from"../../core/mathUtils.js";import{parse as c}from"../../core/number.js";import{isNumber as l,isBoolean as N,isArray as h,isString as m}from"../../support/guards.js";function p(p,M){function b(n,t,r){const u=o(n);return isNaN(u)?u:isNaN(t)||isNaN(r)||t>r?NaN:u<t?t:u>r?r:u}p.number=function(o,i){return M(o,i,((a,s,f)=>{n(f,1,2,o,i);const p=f[0];if(l(p))return p;if(null===p)return 0;if(t(p)||r(p)||u(p))return p.toNumber();if(N(p))return Number(p);if(h(p))return NaN;if(""===p)return Number(p);if(void 0===p)return Number(p);if(m(p)){if(void 0!==f[1]){let n=e(f[1],"‰","");return n=e(n,"¤",""),c(p,{pattern:n})}return Number(p.trim())}return Number(p)}))},p.abs=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.abs(o(i[0])))))},p.acos=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.acos(o(i[0])))))},p.asin=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.asin(o(i[0])))))},p.atan=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.atan(o(i[0])))))},p.atan2=function(t,r){return M(t,r,((u,e,i)=>(n(i,2,2,t,r),Math.atan2(o(i[0]),o(i[1])))))},p.ceil=function(t,r){return M(t,r,((u,e,i)=>{if(n(i,1,2,t,r),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),f("ceil",o(i[0]),-1*n)}return Math.ceil(o(i[0]))}))},p.round=function(t,r){return M(t,r,((u,e,i)=>{if(n(i,1,2,t,r),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),f("round",o(i[0]),-1*n)}return Math.round(o(i[0]))}))},p.floor=function(t,r){return M(t,r,((u,e,i)=>{if(n(i,1,2,t,r),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),f("floor",o(i[0]),-1*n)}return Math.floor(o(i[0]))}))},p.cos=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.cos(o(i[0])))))},p.isnan=function(t,r){return M(t,r,((u,e,o)=>(n(o,1,1,t,r),"number"==typeof o[0]&&isNaN(o[0]))))},p.exp=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.exp(o(i[0])))))},p.log=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.log(o(i[0])))))},p.pow=function(t,r){return M(t,r,((u,e,i)=>(n(i,2,2,t,r),o(i[0])**o(i[1]))))},p.random=function(t,r){return M(t,r,((u,e,o)=>(n(o,0,0,t,r),Math.random())))},p.sin=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.sin(o(i[0])))))},p.sqrt=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.sqrt(o(i[0])))))},p.tan=function(t,r){return M(t,r,((u,e,i)=>(n(i,1,1,t,r),Math.tan(o(i[0])))))},p.isempty=function(t,r){return M(t,r,((u,e,o)=>(n(o,1,1,t,r),null===o[0]||(""===o[0]||(void 0===o[0]||o[0]===i)))))},p.boolean=function(t,r){return M(t,r,((u,e,o)=>{n(o,1,1,t,r);const i=o[0];return a(i)}))},p.constrain=function(t,r){return M(t,r,((u,e,i)=>{n(i,3,3,t,r);const a=o(i[1]),f=o(i[2]);if(h(i[0])){const n=[];for(const t of i[0])n.push(b(t,a,f));return n}if(s(i[0])){const n=[];for(let t=0;t<i[0].length();t++)n.push(b(i[0].get(t),a,f));return n}return b(i[0],a,f)}))}}export{p as registerFunctions};
5
+ import{B as n,e as r,g as t,f as u,Y as e,u as o,v as i,H as a,j as f}from"../../chunks/languageUtils.js";import{decimalAdjust as s}from"../../core/mathUtils.js";import{parse as c}from"../../core/number.js";import{isNumber as l,isBoolean as N,isArray as h,isString as m}from"../../support/guards.js";function p(p,M){function b(n,r,t){const u=o(n);return isNaN(u)?u:isNaN(r)||isNaN(t)||r>t?NaN:u<r?r:u>t?t:u}p.number=function(o,i){return M(o,i,((a,f,s)=>{n(s,1,2,o,i);const p=s[0];if(l(p))return p;if(null===p)return 0;if(r(p)||t(p)||u(p))return p.toNumber();if(N(p))return Number(p);if(h(p))return NaN;if(""===p)return Number(p);if(void 0===p)return Number(p);if(m(p)){if(void 0!==s[1]){let n=e(s[1],"‰","");return n=e(n,"¤",""),c(p,{pattern:n})}return Number(p.trim())}return Number(p)}))},p.abs=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.abs(o(i[0])))))},p.acos=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.acos(o(i[0])))))},p.asin=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.asin(o(i[0])))))},p.atan=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.atan(o(i[0])))))},p.atan2=function(r,t){return M(r,t,((u,e,i)=>(n(i,2,2,r,t),Math.atan2(o(i[0]),o(i[1])))))},p.ceil=function(r,t){return M(r,t,((u,e,i)=>{if(n(i,1,2,r,t),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),s("ceil",o(i[0]),-1*n)}return Math.ceil(o(i[0]))}))},p.round=function(r,t){return M(r,t,((u,e,i)=>{if(n(i,1,2,r,t),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),s("round",o(i[0]),-1*n)}return Math.round(o(i[0]))}))},p.floor=function(r,t){return M(r,t,((u,e,i)=>{if(n(i,1,2,r,t),2===i.length){let n=o(i[1]);return isNaN(n)&&(n=0),s("floor",o(i[0]),-1*n)}return Math.floor(o(i[0]))}))},p.cos=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.cos(o(i[0])))))},p.isnan=function(r,t){return M(r,t,((u,e,o)=>(n(o,1,1,r,t),"number"==typeof o[0]&&isNaN(o[0]))))},p.exp=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.exp(o(i[0])))))},p.log=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.log(o(i[0])))))},p.pow=function(r,t){return M(r,t,((u,e,i)=>(n(i,2,2,r,t),o(i[0])**o(i[1]))))},p.random=function(r,t){return M(r,t,((u,e,o)=>(n(o,0,0,r,t),Math.random())))},p.sin=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.sin(o(i[0])))))},p.sqrt=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.sqrt(o(i[0])))))},p.tan=function(r,t){return M(r,t,((u,e,i)=>(n(i,1,1,r,t),Math.tan(o(i[0])))))},p.isempty=function(r,t){return M(r,t,((u,e,o)=>(n(o,1,1,r,t),null===o[0]||(""===o[0]||(void 0===o[0]||o[0]===i)))))},p.boolean=function(r,t){return M(r,t,((u,e,o)=>{n(o,1,1,r,t);const i=o[0];return a(i)}))},p.constrain=function(r,t){return M(r,t,((u,e,i)=>{n(i,3,3,r,t);const a=o(i[1]),s=o(i[2]);if(h(i[0])){const n=[];for(const r of i[0])n.push(b(r,a,s));return n}if(f(i[0])){const n=[];for(let r=0;r<i[0].length();r++)n.push(b(i[0].get(r),a,s));return n}return b(i[0],a,s)}))}}export{p as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeExecutionError as n,ExecutionErrorCodes as r}from"../executionError.js";import{D as t,m as e}from"../../chunks/languageUtils.js";import{calculateStat as u}from"./fieldStats.js";import{isArray as i,isString as o}from"../../support/guards.js";function a(n,r){if(1===r.length){if(i(r[0]))return u(n,r[0],-1);if(e(r[0]))return u(n,r[0].toArray(),-1)}return u(n,r,-1)}function f(u,f){u.stdev=function(n,r){return f(n,r,((n,r,t)=>a("stdev",t)))},u.variance=function(n,r){return f(n,r,((n,r,t)=>a("variance",t)))},u.average=function(n,r){return f(n,r,((n,r,t)=>a("mean",t)))},u.mean=function(n,r){return f(n,r,((n,r,t)=>a("mean",t)))},u.sum=function(n,r){return f(n,r,((n,r,t)=>a("sum",t)))},u.min=function(n,r){return f(n,r,((n,r,t)=>a("min",t)))},u.max=function(n,r){return f(n,r,((n,r,t)=>a("max",t)))},u.distinct=function(n,r){return f(n,r,((n,r,t)=>a("distinct",t)))},u.count=function(u,a){return f(u,a,((f,m,c)=>{if(t(c,1,1,u,a),i(c[0])||o(c[0]))return c[0].length;if(e(c[0]))return c[0].length();throw new n(u,r.InvalidParameter,a)}))}}export{f as registerFunctions};
5
+ import{ArcadeExecutionError as n,ExecutionErrorCodes as r}from"../executionError.js";import{B as t,j as e}from"../../chunks/languageUtils.js";import{calculateStat as u}from"./fieldStats.js";import{isArray as i,isString as o}from"../../support/guards.js";function a(n,r){if(1===r.length){if(i(r[0]))return u(n,r[0],-1);if(e(r[0]))return u(n,r[0].toArray(),-1)}return u(n,r,-1)}function f(u,f){u.stdev=function(n,r){return f(n,r,((n,r,t)=>a("stdev",t)))},u.variance=function(n,r){return f(n,r,((n,r,t)=>a("variance",t)))},u.average=function(n,r){return f(n,r,((n,r,t)=>a("mean",t)))},u.mean=function(n,r){return f(n,r,((n,r,t)=>a("mean",t)))},u.sum=function(n,r){return f(n,r,((n,r,t)=>a("sum",t)))},u.min=function(n,r){return f(n,r,((n,r,t)=>a("min",t)))},u.max=function(n,r){return f(n,r,((n,r,t)=>a("max",t)))},u.distinct=function(n,r){return f(n,r,((n,r,t)=>a("distinct",t)))},u.count=function(u,a){return f(u,a,((f,c,m)=>{if(t(m,1,1,u,a),i(m[0])||o(m[0]))return m[0].length;if(e(m[0]))return m[0].length();throw new n(u,r.InvalidParameter,a)}))}}export{f as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../ArcadePortal.js";import e from"../Attachment.js";import r from"../Dictionary.js";import{StringEnum as n}from"../enum.js";import{ArcadeExecutionError as a,ExecutionErrorCodes as o}from"../executionError.js";import{D as i,f as u,N as s,t as l,v as p,K as f,e as c,s as d,m as h,Y as y,L as g,Z as m,g as A,j as w,k as I,n as v,i as U,p as j,o as x}from"../../chunks/languageUtils.js";import{convertDirection as N}from"./convertdirection.js";import{XXH as k}from"./hash.js";import{hasSamePortal as C}from"../../core/urlUtils.js";import{generateUUID as P}from"../../core/uuid.js";import z from"../../geometry/Extent.js";import O from"../../geometry/Multipoint.js";import S from"../../geometry/Point.js";import F from"../../geometry/Polygon.js";import T from"../../geometry/Polyline.js";import L from"../../geometry/SpatialReference.js";import R from"../../portal/Portal.js";import{isArray as M,isString as b,isBoolean as D,isNumber as H}from"../../support/guards.js";function J(t){if("loaded"===t.loadStatus&&t.user?.sourceJSON){return t.user.sourceJSON}return null}function W(t,e){return!!t&&C(t,e?.restUrl||"")}function Z(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function B(n,i,u){if(null!==n)if(M(n)){if(i.updateUint8Array([61]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n)B(t,i,u);u.map.delete(n),u.currentLength--}i.updateUint8Array([199])}else if(h(n)){if(i.updateUint8Array([61]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n.toArray())B(t,i,u);u.map.delete(n),u.currentLength--}i.updateUint8Array([199])}else{if(A(n))return i.updateIntArray([n.toNumber()]),void i.updateUint8Array([241]);if(w(n))return i.updateIntArray([n.toNumber()]),void i.updateIntArray([257]);if(I(n))return i.updateIntArray([n.toNumber()]),void i.updateIntArray([263]);if(b(n))return i.updateIntArray([n.length]),i.updateWithString(n),void i.updateUint8Array([41]);if(D(n))i.updateUint8Array([!0===n?1:0,113]);else{if(H(n))return i.updateFloatArray([n]),void i.updateUint8Array([173]);if(n instanceof e)throw new a(u.context,o.UnsupportedHashType,u.node);if(n instanceof t)throw new a(u.context,o.UnsupportedHashType,u.node);if(!(n instanceof r)){if(v(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(n instanceof S)return i.updateIntArray([3833836621]),i.updateIntArray([0]),i.updateFloatArray([n.x]),i.updateIntArray([1]),i.updateFloatArray([n.y]),n.hasZ&&(i.updateIntArray([2]),i.updateFloatArray([n.z])),n.hasM&&(i.updateIntArray([3]),i.updateFloatArray([n.m])),i.updateIntArray([3765347959]),void B(n.spatialReference.wkid,i,u);if(n instanceof F){i.updateIntArray([1266616829]);for(let t=0;t<n.rings.length;t++){const e=n.rings[t],r=[];let a=null,o=null;for(let i=0;i<e.length;i++){const u=n.getPoint(t,i);if(0===i)a=u;else if(Z(o,u))continue;o=u,i===e.length-1&&Z(a,u)||r.push(u)}i.updateIntArray([1397116793,r.length]);for(let t=0;t<r.length;t++){const e=r[t];i.updateIntArray([3962308117,t]),B(e,i,u),i.updateIntArray([2716288009])}i.updateIntArray([2278822459])}return i.updateIntArray([3878477243]),void B(n.spatialReference.wkid,i,u)}if(n instanceof T){i.updateIntArray([4106883559]);for(let t=0;t<n.paths.length;t++){const e=n.paths[t];i.updateIntArray([1397116793,e.length]);for(let r=0;r<e.length;r++)i.updateIntArray([3962308117,r]),B(n.getPoint(t,r),i,u),i.updateIntArray([2716288009]);i.updateIntArray([2278822459])}return i.updateIntArray([2568784753]),void B(n.spatialReference.wkid,i,u)}if(n instanceof O){i.updateIntArray([588535921,n.points.length]);for(let t=0;t<n.points.length;t++){const e=n.getPoint(t);i.updateIntArray([t]),B(e,i,u)}return i.updateIntArray([1700171621]),void B(n.spatialReference.wkid,i,u)}if(n instanceof z)return i.updateIntArray([3483648373]),i.updateIntArray([0]),i.updateFloatArray([n.xmax]),i.updateIntArray([1]),i.updateFloatArray([n.xmin]),i.updateIntArray([2]),i.updateFloatArray([n.ymax]),i.updateIntArray([3]),i.updateFloatArray([n.ymin]),n.hasZ&&(i.updateIntArray([4]),i.updateFloatArray([n.zmax]),i.updateIntArray([5]),i.updateFloatArray([n.zmin])),n.hasM&&(i.updateIntArray([6]),i.updateFloatArray([n.mmax]),i.updateIntArray([7]),i.updateFloatArray([n.mmin])),i.updateIntArray([3622027469]),void B(n.spatialReference.wkid,i,u);if(n instanceof L)return i.updateIntArray([14]),void 0!==n.wkid&&null!==n.wkid&&i.updateIntArray([n.wkid]),n.wkt&&i.updateWithString(n.wkt),void(n.wkt2&&i.updateWithString(n.wkt2));if(U(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(j(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(x(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(n===p)throw new a(u.context,o.UnsupportedHashType,u.node);throw new a(u.context,o.UnsupportedHashType,u.node)}if(i.updateUint8Array([223]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n.keys()){i.updateIntArray([t.length]),i.updateWithString(t),i.updateUint8Array([251]);B(n.field(t),i,u),i.updateUint8Array([239])}u.map.delete(n),u.currentLength--}i.updateUint8Array([73])}}else i.updateUint8Array([0,139])}function E(e,A){e.portal=function(e,r){return A(e,r,((n,a,o)=>(i(o,1,1,e,r),new t(u(o[0])))))},e.typeof=function(t,e){return A(t,e,((r,n,u)=>{i(u,1,1,t,e);const l=s(u[0]);if("Unrecognized Type"===l)throw new a(t,o.UnrecognizedType,e);return l}))},e.trim=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).trim())))},e.tohex=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,1,t,e);const o=l(a[0]);return isNaN(o)?o:o.toString(16)}))},e.upper=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).toUpperCase())))};const w=new n(["every-word","first-word"]);e.proper=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,2,t,e);const o=(a.length>=2?w.lookup(u(a[1])):null)??"every-word",s=/\s/,l=u(a[0]);let p="",f=!0;for(let t=0;t<l.length;t++){let e=l[t];if(s.test(e))"every-word"===o&&(f=!0);else{e.toUpperCase()!==e.toLowerCase()&&(f?(e=e.toUpperCase(),f=!1):e=e.toLowerCase())}p+=e}return p}))},e.lower=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).toLowerCase())))};const I=new n(["digits","digits-hyphen","digits-hyphen-braces","digits-hyphen-parentheses"]);e.guid=function(t,e){return A(t,e,((r,n,a)=>{i(a,0,1,t,e);switch(a.length>0?I.lookup(u(a[0])):null){case"digits":return P().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return P();case"digits-hyphen-parentheses":return"("+P()+")";default:return"{"+P()+"}"}}))},e.standardizeguid=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);let o=u(a[0]);if(""===o||null===o)return"";const s=/^(\{|\()?(?<partA>[0-9a-z]{8})(-?)(?<partB>[0-9a-z]{4})(-?)(?<partC>[0-9a-z]{4})(-?)(?<partD>[0-9a-z]{4})(-?)(?<partE>[0-9a-z]{12})(\}|\))?$/gim.exec(o);if(!s)return"";const l=s.groups;switch(o=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,I.lookup(u(a[1]))){case"digits":return o.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return o;case"digits-hyphen-parentheses":return"("+o+")";default:return"{"+o+"}"}}))},e.console=function(t,e){return A(t,e,((e,r,n)=>(0===n.length||(1===n.length?t.console(u(n[0])):t.console(u(n))),p)))},e.mid=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,3,t,e);let o=l(a[1]);if(isNaN(o))return"";if(o=Math.max(0,o),2===a.length)return u(a[0]).slice(o);let s=l(a[2]);return isNaN(s)?"":(s<0&&(s=0),u(a[0]).slice(o,o+s))}))},e.find=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,3,t,e);let o=0;if(a.length>2){if(o=l(f(a[2],0)),isNaN(o))return-1;o<0&&(o=0)}return u(a[1]).indexOf(u(a[0]),o)}))},e.left=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);let o=l(a[1]);return isNaN(o)?"":(o<0&&(o=0),u(a[0]).slice(0,o))}))},e.right=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);const o=l(a[1]);if(isNaN(o)||o<=0)return"";return u(a[0]).slice(-o)}))},e.split=function(t,e){return A(t,e,((r,n,a)=>{let o;i(a,2,4,t,e);let s=l(f(a[2],-1));const p=c(f(a[3],!1));if(-1===s||null===s||!0===p?o=u(a[0]).split(u(a[1])):(isNaN(s)&&(s=-1),s<-1&&(s=-1),o=u(a[0]).split(u(a[1]),s)),!1===p)return o;const d=[];for(let t=0;t<o.length&&!(-1!==s&&d.length>=s);t++)""!==o[t]&&void 0!==o[t]&&d.push(o[t]);return d}))},e.text=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,2,t,e),d(a[0],a[1]))))},e.concatenate=function(t,e){return A(t,e,((t,e,r)=>{const n=[];if(r.length<1)return"";if(M(r[0])){const t=f(r[2],"");for(let e=0;e<r[0].length;e++)n[e]=d(r[0][e],t);return r.length>1?n.join(r[1]):n.join("")}if(h(r[0])){const t=f(r[2],"");for(let e=0;e<r[0].length();e++)n[e]=d(r[0].get(e),t);return r.length>1?n.join(r[1]):n.join("")}for(let a=0;a<r.length;a++)n[a]=d(r[a]);return n.join("")}))},e.reverse=function(t,e){return A(t,e,((r,n,u)=>{if(i(u,1,1,t,e),M(u[0])){const t=u[0].slice();return t.reverse(),t}if(h(u[0])){const t=u[0].toArray().slice();return t.reverse(),t}throw new a(t,o.InvalidParameter,e)}))},e.replace=function(t,e){return A(t,e,((r,n,a)=>{i(a,3,4,t,e);const o=u(a[0]),s=u(a[1]),l=u(a[2]);return 4!==a.length||c(a[3])?y(o,s,l):o.replace(s,l)}))},e.urlencode=function(t,e){return A(t,e,((n,a,o)=>{if(i(o,1,1,t,e),null===o[0])return"";if(o[0]instanceof r){let t="";for(const e of o[0].keys()){const r=o[0].field(e);""!==t&&(t+="&"),t+=null===r?encodeURIComponent(e)+"=":encodeURIComponent(e)+"="+encodeURIComponent(r)}return t}return encodeURIComponent(u(o[0]))}))},e.hash=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,1,t,e);const o=new k(0);return B(a[0],o,{context:t,node:e,map:new Map,currentLength:0}),o.digest()}))},e.convertdirection=function(t,e){return A(t,e,((r,n,a)=>(i(a,3,3,t,e),N(a[0],a[1],a[2]))))},e.fromjson=function(t,e){return A(t,e,((n,s,l)=>{if(i(l,1,1,t,e),!1===b(l[0]))throw new a(t,o.InvalidParameter,e);return r.convertJsonToArcade(JSON.parse(u(l[0])),g(t))}))},e.tocharcode=function(t,e){return A(t,e,((r,n,s)=>{i(s,1,2,t,e);const p=l(f(s[1],0)),c=u(s[0]);if(0===c.length&&1===s.length)return null;if(c.length<=p||p<0)throw new a(t,o.OutOfBounds,e);return c.charCodeAt(p)}))},e.tocodepoint=function(t,e){return A(t,e,((r,n,s)=>{i(s,1,2,t,e);const p=l(f(s[1],0)),c=u(s[0]);if(0===c.length&&1===s.length)return null;if(c.length<=p||p<0)throw new a(t,o.OutOfBounds,e);return c.codePointAt(p)}))},e.fromcharcode=function(t,e){return A(t,e,((r,n,i)=>{if(i.length<1)throw new a(t,o.WrongNumberOfParameters,e);const u=i.map((t=>Math.trunc(l(t)))).filter((t=>t>=0&&t<=65535));return 0===u.length?null:String.fromCharCode.apply(null,u)}))},e.fromcodepoint=function(t,e){return A(t,e,((r,n,i)=>{if(i.length<1)throw new a(t,o.WrongNumberOfParameters,e);let u;try{u=i.map((t=>Math.trunc(l(t)))).filter((t=>t<=1114111&&t>>>0===t))}catch(s){return null}return 0===u.length?null:String.fromCodePoint.apply(null,u)}))},e.getuser=function(e,n){return A(e,n,((s,l,p)=>{i(p,0,2,e,n);let c=f(p[1],"");if(c=!0===c||!1===c?"":u(c),null!==c&&""!==c)return null;if(0===p.length||p[0]instanceof t){let t=null;if(t=e.services?.portal?e.services.portal:R.getDefault(),p.length>0){if(!W(p[0].field("url"),t))return null}if(!t)return null;if(""===c){const n=J(t);if(n){const t=JSON.parse(JSON.stringify(n));for(const e of["lastLogin","created","modified"])void 0!==t[e]&&null!==t[e]&&(t[e]=new Date(t[e]));return r.convertObjectToArcadeDictionary(t,g(e))}}return null}throw new a(e,o.InvalidParameter,n)}))},e.getenvironment=function(t,e){return A(t,e,((n,a,o)=>(i(o,0,0,t,e),r.convertObjectToArcadeDictionary(m(g(t),t.spatialReference),g(t),!0))))},e.standardizefilename=function(t,e){return A(t,e,((t,e,r)=>{i(r,1,1,t,e);const[n]=r;if(null==n)return"";if(!b(n))throw new a(t,o.InvalidParameter,e);return n.replaceAll(/[<>"?*]/g,"_").replaceAll(/[/\\|]/g,"-").replaceAll(":",", ")}))}}export{E as registerFunctions};
5
+ import t from"../ArcadePortal.js";import e from"../Attachment.js";import r from"../Dictionary.js";import{StringEnum as n}from"../enum.js";import{ArcadeExecutionError as a,ExecutionErrorCodes as o}from"../executionError.js";import{B as i,w as u,M as s,u as l,v as p,J as f,H as c,t as d,j as h,Y as y,K as g,Z as m,e as A,f as w,g as I,k as v,i as U,m as j,l as x}from"../../chunks/languageUtils.js";import{convertDirection as N}from"./convertdirection.js";import{XXH as k}from"./hash.js";import{hasSamePortal as C}from"../../core/urlUtils.js";import{generateUUID as P}from"../../core/uuid.js";import z from"../../geometry/Extent.js";import O from"../../geometry/Multipoint.js";import S from"../../geometry/Point.js";import F from"../../geometry/Polygon.js";import T from"../../geometry/Polyline.js";import L from"../../geometry/SpatialReference.js";import R from"../../portal/Portal.js";import{isArray as M,isString as H,isBoolean as b,isNumber as D}from"../../support/guards.js";function J(t){if("loaded"===t.loadStatus&&t.user?.sourceJSON){return t.user.sourceJSON}return null}function W(t,e){return!!t&&C(t,e?.restUrl||"")}function B(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function Z(n,i,u){if(null!==n)if(M(n)){if(i.updateUint8Array([61]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n)Z(t,i,u);u.map.delete(n),u.currentLength--}i.updateUint8Array([199])}else if(h(n)){if(i.updateUint8Array([61]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n.toArray())Z(t,i,u);u.map.delete(n),u.currentLength--}i.updateUint8Array([199])}else{if(A(n))return i.updateIntArray([n.toNumber()]),void i.updateUint8Array([241]);if(w(n))return i.updateIntArray([n.toNumber()]),void i.updateIntArray([257]);if(I(n))return i.updateIntArray([n.toNumber()]),void i.updateIntArray([263]);if(H(n))return i.updateIntArray([n.length]),i.updateWithString(n),void i.updateUint8Array([41]);if(b(n))i.updateUint8Array([!0===n?1:0,113]);else{if(D(n))return i.updateFloatArray([n]),void i.updateUint8Array([173]);if(n instanceof e)throw new a(u.context,o.UnsupportedHashType,u.node);if(n instanceof t)throw new a(u.context,o.UnsupportedHashType,u.node);if(!(n instanceof r)){if(v(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(n instanceof S)return i.updateIntArray([3833836621]),i.updateIntArray([0]),i.updateFloatArray([n.x]),i.updateIntArray([1]),i.updateFloatArray([n.y]),n.hasZ&&(i.updateIntArray([2]),i.updateFloatArray([n.z])),n.hasM&&(i.updateIntArray([3]),i.updateFloatArray([n.m])),i.updateIntArray([3765347959]),void Z(n.spatialReference.wkid,i,u);if(n instanceof F){i.updateIntArray([1266616829]);for(let t=0;t<n.rings.length;t++){const e=n.rings[t],r=[];let a=null,o=null;for(let i=0;i<e.length;i++){const u=n.getPoint(t,i);if(0===i)a=u;else if(B(o,u))continue;o=u,i===e.length-1&&B(a,u)||r.push(u)}i.updateIntArray([1397116793,r.length]);for(let t=0;t<r.length;t++){const e=r[t];i.updateIntArray([3962308117,t]),Z(e,i,u),i.updateIntArray([2716288009])}i.updateIntArray([2278822459])}return i.updateIntArray([3878477243]),void Z(n.spatialReference.wkid,i,u)}if(n instanceof T){i.updateIntArray([4106883559]);for(let t=0;t<n.paths.length;t++){const e=n.paths[t];i.updateIntArray([1397116793,e.length]);for(let r=0;r<e.length;r++)i.updateIntArray([3962308117,r]),Z(n.getPoint(t,r),i,u),i.updateIntArray([2716288009]);i.updateIntArray([2278822459])}return i.updateIntArray([2568784753]),void Z(n.spatialReference.wkid,i,u)}if(n instanceof O){i.updateIntArray([588535921,n.points.length]);for(let t=0;t<n.points.length;t++){const e=n.getPoint(t);i.updateIntArray([t]),Z(e,i,u)}return i.updateIntArray([1700171621]),void Z(n.spatialReference.wkid,i,u)}if(n instanceof z)return i.updateIntArray([3483648373]),i.updateIntArray([0]),i.updateFloatArray([n.xmax]),i.updateIntArray([1]),i.updateFloatArray([n.xmin]),i.updateIntArray([2]),i.updateFloatArray([n.ymax]),i.updateIntArray([3]),i.updateFloatArray([n.ymin]),n.hasZ&&(i.updateIntArray([4]),i.updateFloatArray([n.zmax]),i.updateIntArray([5]),i.updateFloatArray([n.zmin])),n.hasM&&(i.updateIntArray([6]),i.updateFloatArray([n.mmax]),i.updateIntArray([7]),i.updateFloatArray([n.mmin])),i.updateIntArray([3622027469]),void Z(n.spatialReference.wkid,i,u);if(n instanceof L)return i.updateIntArray([14]),void 0!==n.wkid&&null!==n.wkid&&i.updateIntArray([n.wkid]),n.wkt&&i.updateWithString(n.wkt),void(n.wkt2&&i.updateWithString(n.wkt2));if(U(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(j(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(x(n))throw new a(u.context,o.UnsupportedHashType,u.node);if(n===p)throw new a(u.context,o.UnsupportedHashType,u.node);throw new a(u.context,o.UnsupportedHashType,u.node)}if(i.updateUint8Array([223]),u.map.has(n)){const t=u.map.get(n);i.updateIntArray([61237541^t])}else{u.map.set(n,u.currentLength++);for(const t of n.keys()){i.updateIntArray([t.length]),i.updateWithString(t),i.updateUint8Array([251]);Z(n.field(t),i,u),i.updateUint8Array([239])}u.map.delete(n),u.currentLength--}i.updateUint8Array([73])}}else i.updateUint8Array([0,139])}function E(e,A){e.portal=function(e,r){return A(e,r,((n,a,o)=>(i(o,1,1,e,r),new t(u(o[0])))))},e.typeof=function(t,e){return A(t,e,((r,n,u)=>{i(u,1,1,t,e);const l=s(u[0]);if("Unrecognized Type"===l)throw new a(t,o.UnrecognizedType,e);return l}))},e.trim=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).trim())))},e.tohex=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,1,t,e);const o=l(a[0]);return isNaN(o)?o:o.toString(16)}))},e.upper=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).toUpperCase())))};const w=new n(["every-word","first-word"]);e.proper=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,2,t,e);const o=(a.length>=2?w.lookup(u(a[1])):null)??"every-word",s=/\s/,l=u(a[0]);let p="",f=!0;for(let t=0;t<l.length;t++){let e=l[t];if(s.test(e))"every-word"===o&&(f=!0);else{e.toUpperCase()!==e.toLowerCase()&&(f?(e=e.toUpperCase(),f=!1):e=e.toLowerCase())}p+=e}return p}))},e.lower=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,1,t,e),u(a[0]).toLowerCase())))};const I=new n(["digits","digits-hyphen","digits-hyphen-braces","digits-hyphen-parentheses"]);e.guid=function(t,e){return A(t,e,((r,n,a)=>{i(a,0,1,t,e);switch(a.length>0?I.lookup(u(a[0])):null){case"digits":return P().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return P();case"digits-hyphen-parentheses":return"("+P()+")";default:return"{"+P()+"}"}}))},e.standardizeguid=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);let o=u(a[0]);if(""===o||null===o)return"";const s=/^(\{|\()?(?<partA>[0-9a-z]{8})(-?)(?<partB>[0-9a-z]{4})(-?)(?<partC>[0-9a-z]{4})(-?)(?<partD>[0-9a-z]{4})(-?)(?<partE>[0-9a-z]{12})(\}|\))?$/gim.exec(o);if(!s)return"";const l=s.groups;switch(o=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,I.lookup(u(a[1]))){case"digits":return o.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return o;case"digits-hyphen-parentheses":return"("+o+")";default:return"{"+o+"}"}}))},e.console=function(t,e){return A(t,e,((e,r,n)=>(0===n.length||(1===n.length?t.console(u(n[0])):t.console(u(n))),p)))},e.mid=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,3,t,e);let o=l(a[1]);if(isNaN(o))return"";if(o=Math.max(0,o),2===a.length)return u(a[0]).slice(o);let s=l(a[2]);return isNaN(s)?"":(s<0&&(s=0),u(a[0]).slice(o,o+s))}))},e.find=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,3,t,e);let o=0;if(a.length>2){if(o=l(f(a[2],0)),isNaN(o))return-1;o<0&&(o=0)}return u(a[1]).indexOf(u(a[0]),o)}))},e.left=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);let o=l(a[1]);return isNaN(o)?"":(o<0&&(o=0),u(a[0]).slice(0,o))}))},e.right=function(t,e){return A(t,e,((r,n,a)=>{i(a,2,2,t,e);const o=l(a[1]);if(isNaN(o)||o<=0)return"";return u(a[0]).slice(-o)}))},e.split=function(t,e){return A(t,e,((r,n,a)=>{let o;i(a,2,4,t,e);let s=l(f(a[2],-1));const p=c(f(a[3],!1));if(-1===s||null===s||!0===p?o=u(a[0]).split(u(a[1])):(isNaN(s)&&(s=-1),s<-1&&(s=-1),o=u(a[0]).split(u(a[1]),s)),!1===p)return o;const d=[];for(let t=0;t<o.length&&!(-1!==s&&d.length>=s);t++)""!==o[t]&&void 0!==o[t]&&d.push(o[t]);return d}))},e.text=function(t,e){return A(t,e,((r,n,a)=>(i(a,1,2,t,e),d(a[0],a[1]))))},e.concatenate=function(t,e){return A(t,e,((t,e,r)=>{const n=[];if(r.length<1)return"";if(M(r[0])){const t=f(r[2],"");for(let e=0;e<r[0].length;e++)n[e]=d(r[0][e],t);return r.length>1?n.join(r[1]):n.join("")}if(h(r[0])){const t=f(r[2],"");for(let e=0;e<r[0].length();e++)n[e]=d(r[0].get(e),t);return r.length>1?n.join(r[1]):n.join("")}for(let a=0;a<r.length;a++)n[a]=d(r[a]);return n.join("")}))},e.reverse=function(t,e){return A(t,e,((r,n,u)=>{if(i(u,1,1,t,e),M(u[0])){const t=u[0].slice();return t.reverse(),t}if(h(u[0])){const t=u[0].toArray().slice();return t.reverse(),t}throw new a(t,o.InvalidParameter,e)}))},e.replace=function(t,e){return A(t,e,((r,n,a)=>{i(a,3,4,t,e);const o=u(a[0]),s=u(a[1]),l=u(a[2]);return 4!==a.length||c(a[3])?y(o,s,l):o.replace(s,l)}))},e.urlencode=function(t,e){return A(t,e,((n,a,o)=>{if(i(o,1,1,t,e),null===o[0])return"";if(o[0]instanceof r){let t="";for(const e of o[0].keys()){const r=o[0].field(e);""!==t&&(t+="&"),t+=null===r?encodeURIComponent(e)+"=":encodeURIComponent(e)+"="+encodeURIComponent(r)}return t}return encodeURIComponent(u(o[0]))}))},e.hash=function(t,e){return A(t,e,((r,n,a)=>{i(a,1,1,t,e);const o=new k(0);return Z(a[0],o,{context:t,node:e,map:new Map,currentLength:0}),o.digest()}))},e.convertdirection=function(t,e){return A(t,e,((r,n,a)=>(i(a,3,3,t,e),N(a[0],a[1],a[2]))))},e.fromjson=function(t,e){return A(t,e,((n,s,l)=>{if(i(l,1,1,t,e),!1===H(l[0]))throw new a(t,o.InvalidParameter,e);return r.convertJsonToArcade(JSON.parse(u(l[0])),g(t))}))},e.tocharcode=function(t,e){return A(t,e,((r,n,s)=>{i(s,1,2,t,e);const p=l(f(s[1],0)),c=u(s[0]);if(0===c.length&&1===s.length)return null;if(c.length<=p||p<0)throw new a(t,o.OutOfBounds,e);return c.charCodeAt(p)}))},e.tocodepoint=function(t,e){return A(t,e,((r,n,s)=>{i(s,1,2,t,e);const p=l(f(s[1],0)),c=u(s[0]);if(0===c.length&&1===s.length)return null;if(c.length<=p||p<0)throw new a(t,o.OutOfBounds,e);return c.codePointAt(p)}))},e.fromcharcode=function(t,e){return A(t,e,((r,n,i)=>{if(i.length<1)throw new a(t,o.WrongNumberOfParameters,e);const u=i.map((t=>Math.trunc(l(t)))).filter((t=>t>=0&&t<=65535));return 0===u.length?null:String.fromCharCode.apply(null,u)}))},e.fromcodepoint=function(t,e){return A(t,e,((r,n,i)=>{if(i.length<1)throw new a(t,o.WrongNumberOfParameters,e);let u;try{u=i.map((t=>Math.trunc(l(t)))).filter((t=>t<=1114111&&t>>>0===t))}catch(s){return null}return 0===u.length?null:String.fromCodePoint.apply(null,u)}))},e.getuser=function(e,n){return A(e,n,((s,l,p)=>{i(p,0,2,e,n);let c=f(p[1],"");if(c=!0===c||!1===c?"":u(c),null!==c&&""!==c)return null;if(0===p.length||p[0]instanceof t){let t=null;if(t=e.services?.portal?e.services.portal:R.getDefault(),p.length>0){if(!W(p[0].field("url"),t))return null}if(!t)return null;if(""===c){const n=J(t);if(n){const t=JSON.parse(JSON.stringify(n));for(const e of["lastLogin","created","modified"])void 0!==t[e]&&null!==t[e]&&(t[e]=new Date(t[e]));return r.convertObjectToArcadeDictionary(t,g(e))}}return null}throw new a(e,o.InvalidParameter,n)}))},e.getenvironment=function(t,e){return A(t,e,((n,a,o)=>(i(o,0,0,t,e),r.convertObjectToArcadeDictionary(m(g(t),t.spatialReference),g(t),!0))))},e.standardizefilename=function(t,e){return A(t,e,((t,e,r)=>{i(r,1,1,t,e);const[n]=r;if(null==n)return"";if(!H(n))throw new a(t,o.InvalidParameter,e);return n.replaceAll(/[<>"?*]/g,"_").replaceAll(/[/\\|]/g,"-").replaceAll(":",", ")}))}}export{E as registerFunctions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeExecutionError as n,ExecutionErrorCodes as r}from"../executionError.js";import{q as e,m as t}from"../../chunks/languageUtils.js";import{ensureNumber as l}from"../../core/accessorSupport/ensureType.js";import s from"../../geometry/Point.js";import{fromJSON as a}from"../../geometry/support/jsonUtils.js";function u(e,t,l=null){const s=i(e,!0);if(void 0!==s.hasm&&(s.hasM=s.hasm,delete s.hasm),void 0!==s.hasz&&(s.hasZ=s.hasz,delete s.hasz),void 0!==s.spatialreference&&(s.spatialReference=s.spatialreference,delete s.spatialreference),s.spatialReference||(s.spatialReference=t),void 0!==s.curverings){const n=L(s.curverings,s.hasZ,s.hasM,S);if(null==n)return null;s.curveRings=n.arrays,delete s.curverings,delete s.rings,s.hasZ=n.hasZ,s.hasM=n.hasM}else if(void 0!==s.rings){const n=L(s.rings,s.hasZ,s.hasM,k);if(null==n)return null;s.rings=n.arrays,s.hasZ=n.hasZ,s.hasM=n.hasM}if(void 0!==s.curvepaths){const n=L(s.curvepaths,s.hasZ,s.hasM,S);if(null==n)return null;s.curvePaths=n.arrays,delete s.curvepaths,delete s.paths,s.hasZ=n.hasZ,s.hasM=n.hasM}else if(void 0!==s.paths){const n=L(s.paths,s.hasZ,s.hasM,k);if(null==n)return null;s.paths=n.arrays,s.hasZ=n.hasZ,s.hasM=n.hasM}if(void 0!==s.points){const n=E(s.points,s.hasZ,s.hasM);if(null==n)return null;s.points=n.array,s.hasZ=n.hasZ,s.hasM=n.hasM}const u=a(s);if(null!=l&&u?.type!==l)throw new n(null,r.InvalidParameter,null);return u}function i(n,r=!1){const t={};for(const l of n.keys()){const s=r?l.toLowerCase():l,a=n.attributes[l];t[s]=e(a)?i(a):a}return t}const o=Symbol("NoValue");function h(n){return Array.isArray(n)&&n.length>0?n[0]:t(n)&&n.length()>0?n.get(0):o}function f(n){const r=h(h(n));return r===o||Array.isArray(r)||t(r)||r instanceof s?n:[n]}const c=0;function y(n){return l(n,c)??c}function m(n){return"number"==typeof n&&!Number.isNaN(n)}const p=null;function d(n){return l(n,p)??p}function g(n){return"number"==typeof n&&!Number.isNaN(n)||null===n}function v(n){return!(n.length<2)&&("number"==typeof n[0]&&!Number.isNaN(n[0])&&("number"==typeof n[1]&&!Number.isNaN(n[1])))}function M(n){return v(n)?n.length>2?n.slice(0,2):n:null}function Z(n){return v(n)?m(n[2])?n.length>3?n.slice(0,3):n:[n[0],n[1],y(n[2])]:null}function A(n){return v(n)?n.length>=3&&!g(n[2])?[n[0],n[1],d(n[2])]:n.length>3?n.slice(0,3):n:null}function N(n){return v(n)?m(n[2])&&g(n[3])?n.length>4?n.slice(0,4):n:[n[0],n[1],y(n[2]),d(n[3])]:null}function b(n){return[n.x,n.y]}function w(n){return[n.x,n.y,n.z??c]}function P(n){return[n.x,n.y,n.m??p]}function I(n){return[n.x,n.y,n.z??c,n.m??p]}function j(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||2!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);return null==u?null:{c:[a,u]}}function x(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||4!==e.length&&7!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);if(null==u)return null;const i=e[2];if(0!==i&&1!==i)throw new n(null,r.InvalidParameter,null);const o=e[3];if(0!==o&&1!==o)throw new n(null,r.InvalidParameter,null);if(4===e.length)return{a:[a,u,i,o]};const h=e[4];if("number"!=typeof h)throw new n(null,r.InvalidParameter,null);if(Number.isNaN(h))return null;const f=e[5];if("number"!=typeof f)throw new n(null,r.InvalidParameter,null);if(Number.isNaN(f))return null;const c=e[6];if("number"!=typeof c)throw new n(null,r.InvalidParameter,null);return Number.isNaN(c)?null:{a:[a,u,i,o,h,f,c]}}function z(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||3!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);if(null==u)return null;const i=k(e[2],b,M);return null==i?null:{b:[a,u,i]}}function R(n,r){return n?r?N:Z:r?A:M}function F(n,r){return n?r?I:w:r?P:b}function k(n,r,e){return Array.isArray(n)?e(n):n instanceof s?r(n):t(n)?e(n.toArray()):null}function S(n,r,l){return Array.isArray(n)?l(n):e(n)?n.hasField("c")?j(n.field("c"),r,l):n.hasField("a")?x(n.field("a"),r,l):n.hasField("b")?z(n.field("b"),r,l):null:n instanceof s?r(n):t(n)?l(n.toArray()):null}function U(n,r,e,l){const s=[];if(Array.isArray(n))for(const t of n){const n=r(t,e,l);null!=n&&s.push(n)}else if(t(n))for(let t=0;t<n.length();t++){const a=r(n.get(t),e,l);null!=a&&s.push(a)}return s}function q(n,r,e){return Array.isArray(n)?n.length>=r:t(n)?n.length()>=r:n instanceof s&&n[e]}function C(n,r,e){return void 0===n&&void 0===r?{hasZ:q(e,3,"hasZ"),hasM:q(e,4,"hasM")}:void 0===n?!0===r?{hasZ:q(e,4,"hasZ"),hasM:!0}:{hasZ:q(e,3,"hasZ"),hasM:!1}:void 0===r?!0===n?{hasZ:!0,hasM:q(e,4,"hasM")}:{hasZ:!1,hasM:q(e,3,"hasM")}:{hasZ:!0===n,hasM:!0===r}}function E(n,r,e){const t=h(n);if(t===o)return null;const{hasZ:l,hasM:s}=C(r,e,t);return{array:U(n,k,F(l,s),R(l,s)),hasZ:l,hasM:s}}function L(n,r,e,l){const s=h(h(n=f(n)));if(s===o)return null;const{hasZ:a,hasM:u}=C(r,e,s),i=F(a,u),c=R(a,u),y=[];if(Array.isArray(n))for(let t=0;t<n.length;t++)y.push(U(n[t],l,i,c));else if(t(n))for(let t=0;t<n.length();t++)y.push(U(n.get(t),l,i,c));return{arrays:y,hasZ:a,hasM:u}}export{u as constructGeometryFromDictionary};
5
+ import{ArcadeExecutionError as n,ExecutionErrorCodes as r}from"../executionError.js";import{n as e,j as t}from"../../chunks/languageUtils.js";import{ensureNumber as l}from"../../core/accessorSupport/ensureType.js";import s from"../../geometry/Point.js";import{fromJSON as a}from"../../geometry/support/jsonUtils.js";function u(e,t,l=null){const s=i(e,!0);if(void 0!==s.hasm&&(s.hasM=s.hasm,delete s.hasm),void 0!==s.hasz&&(s.hasZ=s.hasz,delete s.hasz),void 0!==s.spatialreference&&(s.spatialReference=s.spatialreference,delete s.spatialreference),s.spatialReference||(s.spatialReference=t),void 0!==s.curverings){const n=T(s.curverings,s.hasZ,s.hasM,S);if(null==n)return null;s.curveRings=n.arrays,delete s.curverings,delete s.rings,s.hasZ=n.hasZ,s.hasM=n.hasM}else if(void 0!==s.rings){const n=T(s.rings,s.hasZ,s.hasM,k);if(null==n)return null;s.rings=n.arrays,s.hasZ=n.hasZ,s.hasM=n.hasM}if(void 0!==s.curvepaths){const n=T(s.curvepaths,s.hasZ,s.hasM,S);if(null==n)return null;s.curvePaths=n.arrays,delete s.curvepaths,delete s.paths,s.hasZ=n.hasZ,s.hasM=n.hasM}else if(void 0!==s.paths){const n=T(s.paths,s.hasZ,s.hasM,k);if(null==n)return null;s.paths=n.arrays,s.hasZ=n.hasZ,s.hasM=n.hasM}if(void 0!==s.points){const n=L(s.points,s.hasZ,s.hasM);if(null==n)return null;s.points=n.array,s.hasZ=n.hasZ,s.hasM=n.hasM}const u=a(s);if(null!=l&&u?.type!==l)throw new n(null,r.InvalidParameter,null);return u}function i(n,r=!1){const t={};for(const l of n.keys()){const s=r?l.toLowerCase():l,a=n.attributes[l];t[s]=e(a)?i(a):a}return t}const o=Symbol("NoValue");function h(n){return Array.isArray(n)&&n.length>0?n[0]:t(n)&&n.length()>0?n.get(0):o}function f(n){const r=h(h(n));return r===o||Array.isArray(r)||t(r)||r instanceof s?n:[n]}const c=0;function y(n){return l(n,c)??c}function m(n){return"number"==typeof n&&!Number.isNaN(n)}const p=null;function d(n){return l(n,p)??p}function g(n){return"number"==typeof n&&!Number.isNaN(n)||null===n}function v(n){return!(n.length<2)&&("number"==typeof n[0]&&!Number.isNaN(n[0])&&("number"==typeof n[1]&&!Number.isNaN(n[1])))}function M(n){return v(n)?n.length>2?n.slice(0,2):n:null}function Z(n){return v(n)?m(n[2])?n.length>3?n.slice(0,3):n:[n[0],n[1],y(n[2])]:null}function A(n){return v(n)?n.length>=3&&!g(n[2])?[n[0],n[1],d(n[2])]:n.length>3?n.slice(0,3):n:null}function N(n){return v(n)?m(n[2])&&g(n[3])?n.length>4?n.slice(0,4):n:[n[0],n[1],y(n[2]),d(n[3])]:null}function b(n){return[n.x,n.y]}function w(n){return[n.x,n.y,n.z??c]}function P(n){return[n.x,n.y,n.m??p]}function I(n){return[n.x,n.y,n.z??c,n.m??p]}function j(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||2!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);return null==u?null:{c:[a,u]}}function x(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||4!==e.length&&7!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);if(null==u)return null;const i=e[2];if(0!==i&&1!==i)throw new n(null,r.InvalidParameter,null);const o=e[3];if(0!==o&&1!==o)throw new n(null,r.InvalidParameter,null);if(4===e.length)return{a:[a,u,i,o]};const h=e[4];if("number"!=typeof h)throw new n(null,r.InvalidParameter,null);if(Number.isNaN(h))return null;const f=e[5];if("number"!=typeof f)throw new n(null,r.InvalidParameter,null);if(Number.isNaN(f))return null;const c=e[6];if("number"!=typeof c)throw new n(null,r.InvalidParameter,null);return Number.isNaN(c)?null:{a:[a,u,i,o,h,f,c]}}function z(e,l,s){if(t(e)&&(e=e.toArray()),!Array.isArray(e)||3!==e.length)throw new n(null,r.InvalidParameter,null);const a=k(e[0],l,s);if(null==a)return null;const u=k(e[1],b,M);if(null==u)return null;const i=k(e[2],b,M);return null==i?null:{b:[a,u,i]}}function R(n,r){return n?r?N:Z:r?A:M}function F(n,r){return n?r?I:w:r?P:b}function k(n,r,e){return Array.isArray(n)?e(n):n instanceof s?r(n):t(n)?e(n.toArray()):null}function S(n,r,l){return Array.isArray(n)?l(n):e(n)?n.hasField("c")?j(n.field("c"),r,l):n.hasField("a")?x(n.field("a"),r,l):n.hasField("b")?z(n.field("b"),r,l):null:n instanceof s?r(n):t(n)?l(n.toArray()):null}function U(n,r,e,l){const s=[];if(Array.isArray(n))for(const t of n){const n=r(t,e,l);null!=n&&s.push(n)}else if(t(n))for(let t=0;t<n.length();t++){const a=r(n.get(t),e,l);null!=a&&s.push(a)}return s}function C(n,r,e){return Array.isArray(n)?n.length>=r:t(n)?n.length()>=r:n instanceof s&&n[e]}function E(n,r,e){return void 0===n&&void 0===r?{hasZ:C(e,3,"hasZ"),hasM:C(e,4,"hasM")}:void 0===n?!0===r?{hasZ:C(e,4,"hasZ"),hasM:!0}:{hasZ:C(e,3,"hasZ"),hasM:!1}:void 0===r?!0===n?{hasZ:!0,hasM:C(e,4,"hasM")}:{hasZ:!1,hasM:C(e,3,"hasM")}:{hasZ:!0===n,hasM:!0===r}}function L(n,r,e){const t=h(n);if(t===o)return null;const{hasZ:l,hasM:s}=E(r,e,t);return{array:U(n,k,F(l,s),R(l,s)),hasZ:l,hasM:s}}function T(n,r,e,l){const s=h(h(n=f(n)));if(s===o)return null;const{hasZ:a,hasM:u}=E(r,e,s),i=F(a,u),c=R(a,u),y=[];if(Array.isArray(n))for(let t=0;t<n.length;t++)y.push(U(n[t],l,i,c));else if(t(n))for(let t=0;t<n.length();t++)y.push(U(n.get(t),l,i,c));return{arrays:y,hasZ:a,hasM:u}}export{u as constructGeometryFromDictionary};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Dictionary.js";import{StringEnum as n}from"../enum.js";import{ArcadeExecutionError as t,ExecutionErrorCodes as r}from"../executionError.js";import{D as o,f as i,K as l,E as a,m as s,H as f,L as c}from"../../chunks/languageUtils.js";import{getMetersPerVerticalUnitForSR as u,segmentLength3d as m}from"../functions/centroid.js";import{measureToCoordinate as p,pointToCoordinate as d,distanceToCoordinate as g}from"../functions/measures.js";import{getMetersPerUnitForSR as w}from"../../core/unitUtils.js";import y from"../../geometry/Geometry.js";import h from"../../geometry/Point.js";import v from"../../geometry/Polyline.js";import{isArray as j,isNumber as P}from"../../support/guards.js";function x(e,n,i){if(o(e,2,2,n,i),e[0]instanceof y&&e[1]instanceof y);else if(e[0]instanceof y&&null===e[1]);else if(e[1]instanceof y&&null===e[0]);else if(null!==e[0]||null!==e[1])throw new t(n,r.InvalidParameter,i)}function I(e){if("polygon"!==e.type&&"polyline"!==e.type&&"extent"!==e.type)return 0;let n=1;if(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid){n=u(e.spatialReference)/w(e.spatialReference)}let t=0;if("polyline"===e.type)for(const r of e.paths)for(let e=1;e<r.length;e++)t+=m(r[e],r[e-1],n);else if("polygon"===e.type)for(const r of e.rings){for(let e=1;e<r.length;e++)t+=m(r[e],r[e-1],n);(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||void 0!==r[0][2]&&r[0][2]!==r[r.length-1][2])&&(t+=m(r[0],r[r.length-1],n))}else"extent"===e.type&&(t+=2*m([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],n),t+=2*m([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],n),t*=2,t+=4*Math.abs(l(e.zmax,0)*n-l(e.zmin,0)*n));return t}const R=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);if(!P(l[1]))throw new t(n,r.InvalidParameter,i);const m=p(u,l[1]);return m?e.convertObjectToArcadeDictionary(m,c(n),!1,!0):null},b=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);const m=l[1];if(null===m)return null;if(!(m instanceof h))throw new t(n,r.InvalidParameter,i);const p=d(u,m);return p?e.convertObjectToArcadeDictionary(p,c(n),!1,!0):null},D=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);if(!P(l[1]))throw new t(n,r.InvalidParameter,i);const m=g(u,l[1]);return m?e.convertObjectToArcadeDictionary(m,c(n),!1,!0):null},k=new n(["geodesic","great-elliptic","loxodrome","normal-section","shape-preserving"]);function A(e){return null==e?"geodesic":k.get(i(e))}const O=new n(["geometric","labelPoint"]);function T(e){return null==e?"geometric":O.get(i(e))}const z=new n(["round","bevel","miter","square"]);function E(e){return null==e?"round":z.lookup(i(e))??"round"}export{x as commonRelationsCheck,D as distanceToCoordinateFunc,R as measureToCoordinateFunc,I as planarLength3D,b as pointToCoordinateFunc,T as toCentroidAlgorithm,A as toCurveType,E as toOffsetJoinType};
5
+ import e from"../Dictionary.js";import{StringEnum as n}from"../enum.js";import{ArcadeExecutionError as t,ExecutionErrorCodes as r}from"../executionError.js";import{B as o,w as i,J as l,C as a,j as s,F as f,K as c}from"../../chunks/languageUtils.js";import{getMetersPerVerticalUnitForSR as u,segmentLength3d as m}from"../functions/centroid.js";import{measureToCoordinate as p,pointToCoordinate as d,distanceToCoordinate as w}from"../functions/measures.js";import{getMetersPerUnitForSR as g}from"../../core/unitUtils.js";import y from"../../geometry/Geometry.js";import h from"../../geometry/Point.js";import v from"../../geometry/Polyline.js";import{isArray as j,isNumber as P}from"../../support/guards.js";function x(e,n,i){if(o(e,2,2,n,i),e[0]instanceof y&&e[1]instanceof y);else if(e[0]instanceof y&&null===e[1]);else if(e[1]instanceof y&&null===e[0]);else if(null!==e[0]||null!==e[1])throw new t(n,r.InvalidParameter,i)}function I(e){if("polygon"!==e.type&&"polyline"!==e.type&&"extent"!==e.type)return 0;let n=1;if(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid){n=u(e.spatialReference)/g(e.spatialReference)}let t=0;if("polyline"===e.type)for(const r of e.paths)for(let e=1;e<r.length;e++)t+=m(r[e],r[e-1],n);else if("polygon"===e.type)for(const r of e.rings){for(let e=1;e<r.length;e++)t+=m(r[e],r[e-1],n);(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||void 0!==r[0][2]&&r[0][2]!==r[r.length-1][2])&&(t+=m(r[0],r[r.length-1],n))}else"extent"===e.type&&(t+=2*m([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],n),t+=2*m([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],n),t*=2,t+=4*Math.abs(l(e.zmax,0)*n-l(e.zmin,0)*n));return t}const R=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);if(!P(l[1]))throw new t(n,r.InvalidParameter,i);const m=p(u,l[1]);return m?e.convertObjectToArcadeDictionary(m,c(n),!1,!0):null},b=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);const m=l[1];if(null===m)return null;if(!(m instanceof h))throw new t(n,r.InvalidParameter,i);const p=d(u,m);return p?e.convertObjectToArcadeDictionary(p,c(n),!1,!0):null},k=(n,i,l)=>{if(l=a(l),o(l,2,2,n,i),null===l[0])return null;let u=l[0];if((j(l[0])||s(l[0]))&&(u=f(l[0],n.spatialReference)),null===u)return null;if(!(u instanceof y))throw new t(n,r.InvalidParameter,i);if(!(u instanceof v))throw new t(n,r.InvalidParameter,i);if(!P(l[1]))throw new t(n,r.InvalidParameter,i);const m=w(u,l[1]);return m?e.convertObjectToArcadeDictionary(m,c(n),!1,!0):null},D=new n(["geodesic","great-elliptic","loxodrome","normal-section","shape-preserving"]);function A(e){return null==e?"geodesic":D.get(i(e))}const O=new n(["geometric","labelPoint"]);function T(e){return null==e?"geometric":O.get(i(e))}const z=new n(["round","bevel","miter","square"]);function U(e){return null==e?"round":z.lookup(i(e))??"round"}export{x as commonRelationsCheck,k as distanceToCoordinateFunc,R as measureToCoordinateFunc,I as planarLength3D,b as pointToCoordinateFunc,T as toCentroidAlgorithm,A as toCurveType,U as toOffsetJoinType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../config.js";import"../kernel.js";import"./ArcadeDate.js";import"./ArcadeModule.js";import"./executionError.js";import"./FunctionWrapper.js";import"./ImmutableArray.js";import"./ImmutablePathArray.js";import"./ImmutablePointArray.js";import"./featureset/support/shared.js";import"../core/number.js";import"../core/sql/DateOnly.js";import"../core/sql/TimeOnly.js";import"../geometry/Extent.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Point.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/SpatialReference.js";import"../geometry/support/coordsUtils.js";import"../geometry/support/jsonUtils.js";import"../intl/locale.js";export{isArray,isBoolean,isGraphic,isInteger,isDate as isJsDate,isNumber,isString}from"../support/guards.js";import"luxon";export{I as ImplicitResult,R as ReturnResult,P as absRound,ab as arcadeVersion,J as autoCastArrayOfPointsToMultiPoint,G as autoCastArrayOfPointsToPolygon,H as autoCastArrayOfPointsToPolyline,E as autoCastFeatureToGeometry,B as binaryOperator,w as breakResult,a as castAsJson,b as castAsJsonAsync,c as castRecordToText,x as continueResult,Z as defaultExecutingContext,L as defaultTimeZone,K as defaultUndefined,A as equalityTest,S as featureDomainCodeLookup,T as featureDomainValueLookup,Q as featureFullDomain,U as featureSchema,V as featureSubtypes,W as fixNullGeometry,F as fixSpatialReference,a7 as formatDate,a6 as formatNumber,a1 as getDomain,a3 as getDomainCode,a2 as getDomainValue,N as getType,z as greaterThanLessThan,g as isDate,j as isDateOnly,q as isDictionary,y as isDictionaryLike,n as isFeature,p as isFeatureSet,o as isFeatureSetCollection,i as isFunctionParameter,l as isGeometry,m as isImmutableArray,r as isKnowledgeGraph,a4 as isModule,a5 as isObject,d as isSimpleType,aa as isSubtypeGrouplayer,$ as isSubtypeSublayer,k as isTime,C as isVoid,X as isVoxel,Y as multiReplace,a8 as parseGeometryFromJson,D as pcCheck,a9 as stableStringify,O as standardiseDateFormat,a0 as tick,e as toBoolean,h as toDate,t as toNumber,_ as toNumberArray,f as toString,M as toStringArray,s as toStringExplicit,v as voidOperation}from"../chunks/languageUtils.js";
5
+ import"../config.js";import"../kernel.js";import"./ArcadeDate.js";import"./ArcadeModule.js";import"./executionError.js";import"./FunctionWrapper.js";import"./ImmutableArray.js";import"./ImmutablePathArray.js";import"./ImmutablePointArray.js";import"./featureset/support/shared.js";import"../core/number.js";import"../core/sql/DateOnly.js";import"../core/sql/TimeOnly.js";import"../geometry/Extent.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Point.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/SpatialReference.js";import"../geometry/support/coordsUtils.js";import"../geometry/support/jsonUtils.js";import"../intl/locale.js";export{isArray,isBoolean,isGraphic,isInteger,isDate as isJsDate,isNumber,isString}from"../support/guards.js";import"luxon";export{I as ImplicitResult,R as ReturnResult,P as absRound,ab as arcadeVersion,G as autoCastArrayOfPointsToMultiPoint,E as autoCastArrayOfPointsToPolygon,F as autoCastArrayOfPointsToPolyline,C as autoCastFeatureToGeometry,z as binaryOperator,q as breakResult,a as castAsJson,b as castAsJsonAsync,c as castRecordToText,r as continueResult,Z as defaultExecutingContext,K as defaultTimeZone,J as defaultUndefined,y as equalityTest,S as featureDomainCodeLookup,T as featureDomainValueLookup,Q as featureFullDomain,U as featureSchema,V as featureSubtypes,W as fixNullGeometry,D as fixSpatialReference,a7 as formatDate,a6 as formatNumber,a1 as getDomain,a3 as getDomainCode,a2 as getDomainValue,M as getType,x as greaterThanLessThan,e as isDate,f as isDateOnly,n as isDictionary,s as isDictionaryLike,k as isFeature,m as isFeatureSet,l as isFeatureSetCollection,i as isFunctionParameter,h as isGeometry,j as isImmutableArray,o as isKnowledgeGraph,a4 as isModule,a5 as isObject,d as isSimpleType,aa as isSubtypeGrouplayer,$ as isSubtypeSublayer,g as isTime,A as isVoid,X as isVoxel,Y as multiReplace,a8 as parseGeometryFromJson,B as pcCheck,a9 as stableStringify,O as standardiseDateFormat,a0 as tick,H as toBoolean,N as toDate,u as toNumber,_ as toNumberArray,w as toString,L as toStringArray,t as toStringExplicit,v as voidOperation}from"../chunks/languageUtils.js";
package/arcade.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"./Graphic.js";import{ArcadeDate as t}from"./arcade/ArcadeDate.js";import r from"./arcade/ImmutableArray.js";import"./core/has.js";import{deprecated as a}from"./core/deprecate.js";import n from"./core/Error.js";import{clone as o}from"./core/lang.js";import c from"./core/Logger.js";import{DateOnly as s}from"./core/sql/DateOnly.js";import{TimeOnly as i}from"./core/sql/TimeOnly.js";import p from"./layers/FeatureLayer.js";import u from"./portal/Portal.js";import l from"./rest/support/FeatureSet.js";import{loadArcade as m}from"./support/loadArcade.js";let y=null;function f(e,t,a,n={}){const o=t.elementType,c="value",s="array"===o.type?[{name:c,type:o.type,elementType:o.elementType}]:"dictionary"===o.type?[{name:c,type:o.type,properties:o.properties}]:[{name:c,type:o.type}];return new r(e.map((e=>{const t={};return g(t,s,{[c]:e},a,n),t[c]})))}function d(e,t,r={}){const a=e instanceof l?new p({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return t.constructFeatureSet(a,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function b(e,t,r={}){const{spatialReference:a,interceptor:n,lruCache:o}=r;return"string"==typeof e?t.createFeatureSetCollectionFromService(e,a,o,n):t.createFeatureSetCollectionFromMap(e,a,o,n)}function v(e,t,r,a={}){const n={};return g(n,t.properties,e,r,a),new y.Dictionary(n)}function g(e,r,a,n,o={}){const c={};for(const t of Object.keys(a))c[t.toLowerCase()]=a[t];for(const p of r){const r=p.name.toLowerCase();if(o.variablesPreProcessed)e[r]=c[r];else switch(p.type){case"array":{const t=c[r];e[r]=null==t?null:f(t,p,n,o);break}case"feature":{const t=c[r];e[r]=null==t?null:y.Feature.createFromGraphic(t,o?.timeZone);break}case"featureSet":{const t=c[r];e[r]=null==t?null:n?d(t,n,o):null;break}case"featureSetCollection":{const t=c[r];e[r]=null==t?null:n?b(t,n,o):null;break}case"dictionary":{const t=c[r];e[r]=null==t?null:v(t,p,n,o);break}case"date":{const a=c[r];e[r]=a?a instanceof t?a:o?.timeZone?t.dateJSAndZoneToArcadeDate(a,o?.timeZone):t.dateJSToArcadeDate(a):null;break}case"dateOnly":{const t=c[r];e[r]=t?t instanceof s?t:s.fromReader(t):null;break}case"time":{const t=c[r];e[r]=t?t instanceof i?t:i.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[r]=c[r];break;case"voxel":{const t=c[r];e[r]=null==t?null:new y.Voxel(t,o?.timeZone);break}}}}function w(e,t){for(const r of e)t.push(r),"dictionary"===r.type&&w(r.properties,t);return t}function S(e,t,r,a,n){const{spatialReference:o,interceptor:c,lruCache:s,console:i,abortSignal:p,timeZone:l,services:m={portal:u.getDefault()}}=r,y={vars:{},spatialReference:o,interceptor:c,timeZone:l,lrucache:s,useAsync:n,services:m,console:i,abortSignal:p};return t?(g(y.vars,e.variables,t,a,r),y):y}function h(t,r){switch(r.getArcadeType(t)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return t;case"date":return t.toJSDate();case"time":case"dateOnly":return t.toString();case"feature":{const r=(t.type,t),a="geometry"in r?r.geometry():null,n="readAttributes"in r?r.readAttributes():r.attributes;return new e({geometry:a,attributes:n})}case"dictionary":{const e=t,a=e.attributes,n={};for(const t of Object.keys(a))n[t]=h(e.field(t),r);return n}case"array":return("toArray"in t?t.toArray():t).map((e=>h(e,r)))}return t}const $={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]},x={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]},C={variables:[{name:"$voxel",type:"voxel"}]},A=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]}],["popup",$],["popup-element",$],["popup-feature-reduction",x],["popup-element-feature-reduction",x],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]}],["popup-voxel",C],["popup-element-voxel",C]]);function j(e){"feature-reduction-popup"===e?(a(c.getLogger("esri.arcade"),'profile name: "feature-reduction-popup"',{replacement:'"popup-feature-reduction"',version:"4.32",warnOnce:!0}),e="popup-feature-reduction"):"feature-reduction-popup-element"===e&&(a(c.getLogger("esri.arcade"),'profile name: "feature-reduction-popup-element"',{replacement:'"popup-element-feature-reduction"',version:"4.32",warnOnce:!0}),e="popup-element-feature-reduction");const t=A.get(e);if(!t){const t=Array.from(A.keys()).map((e=>`'${e}'`)).join(", ");throw new n("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${t}`)}return o(t)}async function k(e,t,r={}){y||(y=await m());const{arcade:a,arcadeUtils:o,batchExec:{createBatchExecutor:c},aiServices:{BatchTranslationServiceFactory:s,PortalTranslationService:i}}=y,{loadScriptDependencies:p,referencesMember:l,scriptIsAsync:f}=a,d=w(t.variables,[]),b=d.filter((e=>"featureSet"===e.type||"featureSetCollection"===e.type)).map((e=>e.name.toLowerCase())),v=a.parseScript(e,b);if(!v)throw new n("arcade:invalid-script","Unable to create SyntaxTree");const g=o.extractFieldNames(v),$=a.scriptTouchesGeometry(v),x=d.map((e=>e.name.toLowerCase())).filter((e=>l(v,e))),C=f(v,b);await p(v,C,b);const A={vars:{},useAsync:C};for(const n of x)A.vars[n]="any";const{lruCache:j,services:k}=r,T=a.compileScript(v,A),F=a.featureSetUtils();return{execute:(e,r={})=>{if(C)throw new n("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const a=T(S(t,e,{lruCache:j,...r},F,C));return r.rawOutput?a:h(a,o)},executeAsync:async(e,r={})=>{const a=await T(S(t,e,{lruCache:j,services:k,...r},F,C));return r.rawOutput?a:h(a,o)},executeAsyncBatch:async(e,r,a={})=>{const n=[],p=c(e,(async(e,c)=>{const s=r(e);try{const e=await T(S(t,s,{lruCache:j,...a,services:{...k,...a.services,translation:l.create(c)}},F,C)),r=a.rawOutput?e:h(e,o);n.push({id:c.id,result:{status:"fulfilled",value:r}})}catch(i){throw n.push({id:c.id,result:{status:"rejected",reason:i}}),i}}),a.maxConcurrency??64,a.abortSignal),l=new s(p,a.services?.translation??new i(a.services?.portal??u.getDefault(),a.console));return await p.run(),n.sort((({id:e},{id:t})=>e-t)).map((({result:e})=>e))},isAsync:C,variablesUsed:x,fieldsUsed:g,geometryUsed:$,syntaxTree:v}}export{k as createArcadeExecutor,j as createArcadeProfile};
5
+ import e from"./Graphic.js";import{ArcadeDate as t}from"./arcade/ArcadeDate.js";import r from"./arcade/ImmutableArray.js";import"./core/has.js";import{deprecated as a}from"./core/deprecate.js";import n from"./core/Error.js";import{clone as o}from"./core/lang.js";import c from"./core/Logger.js";import{DateOnly as s}from"./core/sql/DateOnly.js";import{TimeOnly as i}from"./core/sql/TimeOnly.js";import p from"./layers/FeatureLayer.js";import u from"./portal/Portal.js";import l from"./rest/support/FeatureSet.js";import{loadArcade as m}from"./support/loadArcade.js";let y=null;function f(e,t,a,n={}){const o=t.elementType,c="value",s="array"===o.type?[{name:c,type:o.type,elementType:o.elementType}]:"dictionary"===o.type?[{name:c,type:o.type,properties:o.properties}]:[{name:c,type:o.type}];return new r(e.map((e=>{const t={};return g(t,s,{[c]:e},a,n),t[c]})))}function d(e,t,r={}){const a=e instanceof l?new p({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return t.constructFeatureSet(a,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function b(e,t,r={}){const{spatialReference:a,interceptor:n,lruCache:o}=r;return"string"==typeof e?t.createFeatureSetCollectionFromService(e,a,o,n):t.createFeatureSetCollectionFromMap(e,a,o,n)}function v(e,t,r,a={}){const n=Object.create(null);return g(n,t.properties,e,r,a),new y.Dictionary(n)}function g(e,r,a,n,o={}){const c={};for(const t of Object.keys(a))c[t.toLowerCase()]=a[t];for(const p of r){const r=p.name.toLowerCase();if(o.variablesPreProcessed)e[r]=c[r];else switch(p.type){case"array":{const t=c[r];e[r]=null==t?null:f(t,p,n,o);break}case"feature":{const t=c[r];e[r]=null==t?null:y.Feature.createFromGraphic(t,o?.timeZone);break}case"featureSet":{const t=c[r];e[r]=null==t?null:n?d(t,n,o):null;break}case"featureSetCollection":{const t=c[r];e[r]=null==t?null:n?b(t,n,o):null;break}case"dictionary":{const t=c[r];e[r]=null==t?null:v(t,p,n,o);break}case"date":{const a=c[r];e[r]=a?a instanceof t?a:o?.timeZone?t.dateJSAndZoneToArcadeDate(a,o?.timeZone):t.dateJSToArcadeDate(a):null;break}case"dateOnly":{const t=c[r];e[r]=t?t instanceof s?t:s.fromReader(t):null;break}case"time":{const t=c[r];e[r]=t?t instanceof i?t:i.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[r]=c[r];break;case"voxel":{const t=c[r];e[r]=null==t?null:new y.Voxel(t,o?.timeZone);break}}}}function w(e,t){for(const r of e)t.push(r),"dictionary"===r.type&&w(r.properties,t);return t}function S(e,t,r,a,n){const{spatialReference:o,interceptor:c,lruCache:s,console:i,abortSignal:p,timeZone:l,services:m={portal:u.getDefault()}}=r,y={vars:{},spatialReference:o,interceptor:c,timeZone:l,lrucache:s,useAsync:n,services:m,console:i,abortSignal:p};return t?(g(y.vars,e.variables,t,a,r),y):y}function h(t,r){switch(r.getArcadeType(t)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return t;case"date":return t.toJSDate();case"time":case"dateOnly":return t.toString();case"feature":{const r=(t.type,t),a="geometry"in r?r.geometry():null,n="readAttributes"in r?r.readAttributes():r.attributes;return new e({geometry:a,attributes:n})}case"dictionary":{const e=t,a=e.attributes,n={};for(const t of Object.keys(a))n[t]=h(e.field(t),r);return n}case"array":return("toArray"in t?t.toArray():t).map((e=>h(e,r)))}return t}const $={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]},x={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]},C={variables:[{name:"$voxel",type:"voxel"}]},j=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]}],["popup",$],["popup-element",$],["popup-feature-reduction",x],["popup-element-feature-reduction",x],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"},{name:"timeProperties",type:"dictionary",properties:[{name:"currentStart",type:"date"},{name:"currentEnd",type:"date"},{name:"startIncluded",type:"boolean"},{name:"endIncluded",type:"boolean"}]}]}]}],["popup-voxel",C],["popup-element-voxel",C]]);function A(e){"feature-reduction-popup"===e?(a(c.getLogger("esri.arcade"),'profile name: "feature-reduction-popup"',{replacement:'"popup-feature-reduction"',version:"4.32",warnOnce:!0}),e="popup-feature-reduction"):"feature-reduction-popup-element"===e&&(a(c.getLogger("esri.arcade"),'profile name: "feature-reduction-popup-element"',{replacement:'"popup-element-feature-reduction"',version:"4.32",warnOnce:!0}),e="popup-element-feature-reduction");const t=j.get(e);if(!t){const t=Array.from(j.keys()).map((e=>`'${e}'`)).join(", ");throw new n("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${t}`)}return o(t)}async function k(e,t,r={}){y||(y=await m());const{arcade:a,arcadeUtils:o,batchExec:{createBatchExecutor:c},aiServices:{BatchTranslationServiceFactory:s,PortalTranslationService:i}}=y,{loadScriptDependencies:p,referencesMember:l,scriptIsAsync:f}=a,d=w(t.variables,[]),b=d.filter((e=>"featureSet"===e.type||"featureSetCollection"===e.type)).map((e=>e.name.toLowerCase())),v=a.parseScript(e,b);if(!v)throw new n("arcade:invalid-script","Unable to create SyntaxTree");const g=o.extractFieldNames(v),$=a.scriptTouchesGeometry(v),x=d.map((e=>e.name.toLowerCase())).filter((e=>l(v,e))),C=f(v,b);await p(v,C,b);const j={vars:{},useAsync:C};for(const n of x)j.vars[n]="any";const{lruCache:A,services:k}=r,T=a.compileScript(v,j),F=a.featureSetUtils();return{execute:(e,r={})=>{if(C)throw new n("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const a=T(S(t,e,{lruCache:A,...r},F,C));return r.rawOutput?a:h(a,o)},executeAsync:async(e,r={})=>{const a=await T(S(t,e,{lruCache:A,services:k,...r},F,C));return r.rawOutput?a:h(a,o)},executeAsyncBatch:async(e,r,a={})=>{const n=[],p=c(e,(async(e,c)=>{const s=r(e);try{const e=await T(S(t,s,{lruCache:A,...a,services:{...k,...a.services,translation:l.create(c)}},F,C)),r=a.rawOutput?e:h(e,o);n.push({id:c.id,result:{status:"fulfilled",value:r}})}catch(i){throw n.push({id:c.id,result:{status:"rejected",reason:i}}),i}}),a.maxConcurrency??64,a.abortSignal),l=new s(p,a.services?.translation??new i(a.services?.portal??u.getDefault(),a.console));return await p.run(),n.sort((({id:e},{id:t})=>e-t)).map((({result:e})=>e))},isAsync:C,variablesUsed:x,fieldsUsed:g,geometryUsed:$,syntaxTree:v}}export{k as createArcadeExecutor,A as createArcadeProfile};