@arcgis/core 4.27.0-next.20230514 → 4.27.0-next.20230516

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 (419) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  4. package/arcade/functions/string.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +1 -0
  7. package/assets/esri/core/workers/chunks/415c326d268b1a8fd03f.js +1 -0
  8. package/assets/esri/core/workers/chunks/5c811527898eb1c04e67.js +1 -0
  9. package/assets/esri/core/workers/chunks/62d9d15f0d00a75da42c.js +1 -0
  10. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +1 -0
  11. package/assets/esri/core/workers/chunks/953407451813f406fdf1.js +1 -0
  12. package/assets/esri/core/workers/chunks/{27081162d73cdded68ff.js → 9e209c6a2aded37f90fb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/a507135977d83aea4421.js +1 -0
  14. package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +1 -0
  15. package/assets/esri/core/workers/chunks/b91c155de9a89e4e6971.js +1 -0
  16. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +1 -0
  17. package/assets/esri/core/workers/chunks/d265da47f6c752a40ac1.js +1 -0
  18. package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +1 -0
  19. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +1 -0
  20. package/assets/esri/core/workers/chunks/ef141014ed21a7fd1ff3.js.LICENSE.txt +1 -1
  21. package/assets/esri/t9n/common_ar.json +1 -1
  22. package/assets/esri/t9n/common_bg.json +1 -1
  23. package/assets/esri/t9n/common_bs.json +1 -1
  24. package/assets/esri/t9n/common_ca.json +1 -1
  25. package/assets/esri/t9n/common_cs.json +1 -1
  26. package/assets/esri/t9n/common_da.json +1 -1
  27. package/assets/esri/t9n/common_de.json +1 -1
  28. package/assets/esri/t9n/common_el.json +1 -1
  29. package/assets/esri/t9n/common_es.json +1 -1
  30. package/assets/esri/t9n/common_et.json +1 -1
  31. package/assets/esri/t9n/common_fi.json +1 -1
  32. package/assets/esri/t9n/common_fr.json +1 -1
  33. package/assets/esri/t9n/common_he.json +1 -1
  34. package/assets/esri/t9n/common_hr.json +1 -1
  35. package/assets/esri/t9n/common_hu.json +1 -1
  36. package/assets/esri/t9n/common_id.json +1 -1
  37. package/assets/esri/t9n/common_it.json +1 -1
  38. package/assets/esri/t9n/common_ja.json +1 -1
  39. package/assets/esri/t9n/common_ko.json +1 -1
  40. package/assets/esri/t9n/common_lt.json +1 -1
  41. package/assets/esri/t9n/common_lv.json +1 -1
  42. package/assets/esri/t9n/common_nb.json +1 -1
  43. package/assets/esri/t9n/common_nl.json +1 -1
  44. package/assets/esri/t9n/common_pl.json +1 -1
  45. package/assets/esri/t9n/common_pt-BR.json +1 -1
  46. package/assets/esri/t9n/common_pt-PT.json +1 -1
  47. package/assets/esri/t9n/common_ro.json +1 -1
  48. package/assets/esri/t9n/common_ru.json +1 -1
  49. package/assets/esri/t9n/common_sk.json +1 -1
  50. package/assets/esri/t9n/common_sl.json +1 -1
  51. package/assets/esri/t9n/common_sr.json +1 -1
  52. package/assets/esri/t9n/common_sv.json +1 -1
  53. package/assets/esri/t9n/common_th.json +1 -1
  54. package/assets/esri/t9n/common_tr.json +1 -1
  55. package/assets/esri/t9n/common_uk.json +1 -1
  56. package/assets/esri/t9n/common_vi.json +1 -1
  57. package/assets/esri/t9n/common_zh-CN.json +1 -1
  58. package/assets/esri/t9n/common_zh-HK.json +1 -1
  59. package/assets/esri/t9n/common_zh-TW.json +1 -1
  60. package/assets/esri/themes/base/_core.scss +2 -0
  61. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +198 -125
  62. package/assets/esri/themes/base/widgets/_Features.scss +57 -0
  63. package/assets/esri/themes/base/widgets/_Popup.scss +3 -0
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  68. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  72. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  73. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  74. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  75. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  76. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  77. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  78. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  79. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  80. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  81. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  82. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  83. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  84. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  98. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  99. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  100. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  101. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  102. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  103. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  104. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  105. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  106. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  107. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  134. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  135. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  136. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  137. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  138. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  139. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  140. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  141. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  142. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  143. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  144. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  145. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  146. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  147. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  148. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  149. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  150. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  151. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  152. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  153. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  154. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  155. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  156. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  157. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  158. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  159. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  160. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  161. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  162. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  163. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  164. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  165. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  166. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  167. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  168. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  169. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  170. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  171. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  172. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  173. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  174. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  175. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  176. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  177. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  178. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  179. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  180. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  181. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  182. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  183. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  184. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  185. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  186. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  187. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  188. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  189. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  190. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  191. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  192. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  193. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  194. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  195. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  196. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  197. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  198. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  199. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  200. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  201. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  202. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  203. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  204. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  205. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  206. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  207. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  208. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  209. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  210. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  211. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  212. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  213. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  214. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  215. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  216. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  217. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  218. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  219. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  220. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  221. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  222. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  223. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  224. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  225. package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
  226. package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
  227. package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
  228. package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
  229. package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
  230. package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
  231. package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
  232. package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
  233. package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
  234. package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
  235. package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
  236. package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
  237. package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
  238. package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
  239. package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
  240. package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
  241. package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
  242. package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
  243. package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
  244. package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
  245. package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
  246. package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
  247. package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
  248. package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
  249. package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
  250. package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
  251. package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
  252. package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
  253. package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
  254. package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
  255. package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
  256. package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
  257. package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
  258. package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
  259. package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
  260. package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
  261. package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
  262. package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
  263. package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
  264. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  265. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  266. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  267. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  268. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  269. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  270. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  271. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  272. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  273. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  274. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  275. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  276. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  277. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  278. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  279. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  280. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  281. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  282. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  283. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  284. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  285. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  286. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  287. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  288. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  289. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  290. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  291. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  292. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  293. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  294. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  295. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  296. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  297. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  298. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  299. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  300. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  301. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  302. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  303. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ar.json +1 -1
  304. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bg.json +1 -1
  305. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bs.json +1 -1
  306. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ca.json +1 -1
  307. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_cs.json +1 -1
  308. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_da.json +1 -1
  309. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_de.json +1 -1
  310. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_el.json +1 -1
  311. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_es.json +1 -1
  312. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_et.json +1 -1
  313. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fi.json +1 -1
  314. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fr.json +1 -1
  315. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_he.json +1 -1
  316. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hr.json +1 -1
  317. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hu.json +1 -1
  318. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_id.json +1 -1
  319. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_it.json +1 -1
  320. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ja.json +1 -1
  321. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ko.json +1 -1
  322. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lt.json +1 -1
  323. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lv.json +1 -1
  324. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nb.json +1 -1
  325. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nl.json +1 -1
  326. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pl.json +1 -1
  327. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-BR.json +1 -1
  328. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-PT.json +1 -1
  329. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ro.json +1 -1
  330. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ru.json +1 -1
  331. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sk.json +1 -1
  332. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sl.json +1 -1
  333. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sr.json +1 -1
  334. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sv.json +1 -1
  335. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_th.json +1 -1
  336. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_tr.json +1 -1
  337. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_uk.json +1 -1
  338. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_vi.json +1 -1
  339. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-CN.json +1 -1
  340. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-HK.json +1 -1
  341. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-TW.json +1 -1
  342. package/chunks/languageUtils.js +1 -1
  343. package/core/ReactiveMap.js +5 -0
  344. package/core/ReactiveSet.js +5 -0
  345. package/form/elements/RelationshipElement.js +1 -1
  346. package/geometry/Mesh.js +1 -1
  347. package/geometry/support/meshUtils/External.js +1 -1
  348. package/interfaces.d.ts +102 -54
  349. package/layers/BuildingSceneLayer.js +1 -1
  350. package/layers/KnowledgeGraphLayer.js +1 -1
  351. package/layers/LinkChartLayer.js +1 -1
  352. package/layers/SceneLayer.js +1 -1
  353. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  354. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  355. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  356. package/layers/video/VideoEngine.js +1 -1
  357. package/package.json +2 -2
  358. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  359. package/portal/schemas/definitions.js +1 -1
  360. package/support/basemapUtils.js +1 -1
  361. package/support/revision.js +1 -1
  362. package/symbols/cim/cimAnalyzer.js +1 -1
  363. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  364. package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
  365. package/views/2d/engine/webgl/definitions.js +1 -1
  366. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  367. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  368. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  369. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  370. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  371. package/views/2d/layers/MediaLayerView2D.js +1 -1
  372. package/views/2d/layers/TileLayerView2D.js +1 -1
  373. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  374. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  375. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  376. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  377. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  378. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  379. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  380. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  381. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  382. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  383. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  384. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  385. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  386. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  387. package/views/3d/webgl-engine/lib/textureUtils.js +5 -0
  388. package/views/PopupView.js +1 -1
  389. package/views/ToolViewManager.js +1 -1
  390. package/views/View.js +1 -1
  391. package/views/interactive/InteractiveToolBase.js +1 -1
  392. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  393. package/widgets/BasemapGallery/css.js +1 -1
  394. package/widgets/BasemapGallery.js +1 -1
  395. package/widgets/Editor/Edits.js +1 -1
  396. package/widgets/Editor/UpdateWorkflow.js +1 -1
  397. package/widgets/Editor/workflowUtils.js +1 -1
  398. package/widgets/Feature/FeatureRelationship.js +1 -1
  399. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  400. package/widgets/FeatureForm.js +1 -1
  401. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  402. package/widgets/Features/FeaturesViewModel.js +5 -0
  403. package/widgets/Features.js +5 -0
  404. package/widgets/Popup/actionUtils.js +1 -1
  405. package/widgets/Popup/actions.js +1 -1
  406. package/widgets/Popup.js +1 -1
  407. package/assets/esri/core/workers/chunks/08e1453cc3689a0094a6.js +0 -1
  408. package/assets/esri/core/workers/chunks/3a658eb0bc632ff0d01c.js +0 -1
  409. package/assets/esri/core/workers/chunks/43fcc9a3b5a46c3dfd0d.js +0 -1
  410. package/assets/esri/core/workers/chunks/47f721daa1652124c066.js +0 -1
  411. package/assets/esri/core/workers/chunks/544dce9710638d126763.js +0 -1
  412. package/assets/esri/core/workers/chunks/630b3fca46208caf4190.js +0 -1
  413. package/assets/esri/core/workers/chunks/6d2a448fe0dc6ebdbd6d.js +0 -1
  414. package/assets/esri/core/workers/chunks/7e9b173a71beeba8b263.js +0 -1
  415. package/assets/esri/core/workers/chunks/b1976202b918a64357ac.js +0 -1
  416. package/assets/esri/core/workers/chunks/b4d03661d1d8983fc13f.js +0 -1
  417. package/assets/esri/core/workers/chunks/b636581516f2e7342d29.js +0 -1
  418. package/assets/esri/core/workers/chunks/e7e7f6046cf1286365ca.js +0 -1
  419. package/assets/esri/core/workers/chunks/f17a7024dd49abeaa4f3.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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i,remove as a}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import n from"../../../core/Error.js";import{clone as h}from"../../../core/lang.js";import u from"../../../core/Logger.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as l}from"../../../layers/support/layerUtils.js";import d from"../../../rest/support/AttachmentQuery.js";const p="esri.widgets.FeatureTable.support.FeatureStore",m=u.getLogger(p);function _(e,t,r){m.error(new n(e,t,r))}let g=class extends r{constructor(e){super(e),this._loaded=!1,this._loadError=!1,this._loading=!1,this._editOperationQueue=[],this._queryOperationQueue=[],this._objectIdCache=new o,this._hasStaleCache=!1,this.count=0,this.failures=new o,this.itemCache=new o,this.relatedRecordsEnabled=!1}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy(),this._set("itemCache",null)}set attachmentsEnabled(e){this._reset(),this._set("attachmentsEnabled",e),this.notifyChange("state")}set filterGeometry(e){this._reset(),this._set("filterGeometry",e),this.notifyChange("state")}set layer(e){this._reset(),this._set("layer",e),this.notifyChange("state")}set objectIds(e){this._reset(),this._set("objectIds",e||null),this.notifyChange("state")}get orderByFields(){return this._get("orderByFields")||[]}set orderByFields(e){const t=this.orderByFields;s(e,t)||(this.itemCache.removeAll(),this._hasStaleCache=!0,this._set("orderByFields",e))}get querying(){return this._queryOperationQueue.length>0}set returnGeometry(e){this._reset(),this._set("returnGeometry",e),this.notifyChange("state")}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return r?"error":!e||this.get("layer.loadError")?"disabled":s?"loading":"loaded"===this.get("layer.loadStatus")&&t?"loaded":"ready"}get syncing(){return this._editOperationQueue.length>0}set timeExtent(e){this._reset(),this._set("timeExtent",e),this.notifyChange("state")}get where(){return this._get("where")||null}set where(e){this._reset(),this._set("where",e),this.notifyChange("state")}async load(){this._reset();const{layer:e}=this;if(e){this._loading=!0,this.notifyChange("state");try{await e.when(),await this._syncLayerInfo(),this._loading=!1,this._loaded=!0,this.notifyChange("state")}catch(t){throw this._reset(),this._loadError=!0,this.notifyChange("state"),_("store:load-error","An error ocurred.",{error:t}),t}}}async refreshLayerInfo(){return this._syncLayerInfo()}async addItems(e){}async fetchItems(e){const{page:t,pageSize:r}=e,s=t*r,i=s+r,{layer:a,state:o}=this;if(!a||"loaded"!==o)return[];this.notifyChange("querying");const n=await this._query({start:s,num:i,page:t,pageSize:r});return this.notifyChange("state"),n}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{features:s}=await this._verifyFeaturesByObjectId(e);return e.map((e=>s.some((t=>t?.getObjectId()===e))))}async query(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];this.notifyChange("querying");const s=await this._query(e);return this.notifyChange("state"),s}async removeItemAt(e){}async reset(){this._reset()}async updateItem(e){return this._update(e).then((()=>{}))}async deleteRowsByObjectId(e){return this._delete({objectIds:e})}getLocalItemByKey(e){return this.getItemByObjectId(e)}getItemByObjectId(e){const{itemCache:t,layer:{objectIdField:r}}=this;return t.find((t=>t.feature?.attributes[r]===e))}getLocalItemAt(e){return this.itemCache.getItemAt(e)}getItemAt(e){return Promise.resolve(this.itemCache.getItemAt(e))}getObjectIdIndex(e){const{itemCache:t,layer:{objectIdField:r}}=this;return t.findIndex((t=>t.feature?.attributes[r]===e))}_reset(){this.itemCache.removeAll(),this.failures.removeAll(),this._editOperationQueue=[],this._queryOperationQueue=[],this._hasStaleCache=!1,this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0),this._objectIdCache.removeAll(),this.notifyChange("querying"),this.notifyChange("syncing"),this.notifyChange("state")}_getIdsFromFeatures(e){return e.map((e=>e.attributes[this.layer.objectIdField]))}_toFeatureData(e,t){const{layer:{objectIdField:r}}=this;return e.map((e=>{const{attributes:s}=e,i=s[r];return{objectId:i,feature:e,attachments:t?t[i]:null,relatedRecords:null}}))}async _update(e){const{layer:r}=this,{operations:s}=l(r);if(!s.supportsUpdate||!("applyEdits"in r))throw new n("store:update-error","Update is not supported.");const{index:i,name:a,value:o}=e,u=await this.getItemAt(i);if(!u||!u.feature)throw new n("store:update-error","Feature with provided 'objectId' not found.");const{feature:y}=u,c=h(y.attributes);c[a]=o;const d=new t({attributes:c}),p=r.applyEdits({updateFeatures:[d]}).then((e=>{const{updateFeatureResults:t}=e,r=t.find((e=>!!e.error));if(r)throw r.error;return t.length&&(y.attributes=c),e}));return this._queueEditOperation((()=>p))}async _delete(e){const{layer:t}=this,{operations:r}=l(t);if(!r.supportsDelete||!("applyEdits"in t))throw new n("store:delete-error","Delete is not supported.");const{objectIds:s}=e,a=s.map((e=>this.getItemByObjectId(e)?.feature)).filter(i);return this._queueEditOperation((()=>t.applyEdits({deleteFeatures:a})))}async _query(e){const{refresh:t}=e;return!0===t?(this.itemCache.removeAll(),this._syncLayerInfo().then((()=>this._queryFeatureData(e)))):(this._hasStaleCache&&(await this._updateIds(),this._hasStaleCache=!1),this._queryFeatureData(e))}async _queryFeatureData(e){return this._queueQueryOperation((async()=>{const{features:t}=await this._queryFeatures(e),r=this._getIdsFromFeatures(t),s=await this._queryAttachments(r);return this._toFeatureData(t,s)||[]}))}async _syncLayerInfo(){await this._updateCount(),await this._updateIds()}async _updateCount(){await this._queryCount().then((e=>this._set("count",e)))}async _updateIds(){this.layer?.capabilities?.query?.supportsPagination||(this._objectIdCache.removeAll(),await this._queryForObjectIds().then((e=>this._objectIdCache.addMany(e))))}_queryCount(){const{filterGeometry:e,layer:t}=this,r=t.capabilities?.query?.supportsCacheHint,s=t.createQuery();return s.geometry=e,s.returnGeometry=!1,s.where=this._getWhere(),s.timeExtent=this._getTimeExtent(),s.objectIds=this.objectIds,r&&(s.cacheHint=!0),t.queryFeatureCount(s)}_queryForObjectIds(){const{filterGeometry:e,layer:t,orderByFields:r}=this,s=t.capabilities?.query,i=s?.supportsCacheHint,a=s?.supportsOrderBy,o=t.createQuery();return o.geometry=e,o.outFields=[t.objectIdField],o.returnGeometry=!1,o.where=this._getWhere(),o.timeExtent=this._getTimeExtent(),o.objectIds=this.objectIds,a&&(o.orderByFields=r),i&&(o.cacheHint=!0),t.queryObjectIds(o)}async _queryFeatures(e){const{layer:t}=this;if(!l(t)?.operations.supportsQuery)throw new n("store:query-error","Layer does not support query operation.");const{filterGeometry:r,orderByFields:s,returnGeometry:i}=this,a=this.layer?.capabilities?.query,{start:o,pageSize:h}=e,u=t.createQuery();return u.returnGeometry=i,a?.supportsPagination?(u.start=o,u.num=h,u.where=this._getWhere(),u.timeExtent=this._getTimeExtent(),u.objectIds=this.objectIds):u.objectIds=this.objectIds||this._getObjectIdsForPage(o,h??0),a?.supportsOrderBy&&(u.orderByFields=s),r&&(u.geometry=r),a?.supportsCacheHint&&(u.cacheHint=!0),t.queryFeatures(u)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!l(t)?.operations.supportsQuery)throw new n("store:query-error","Layer does not support query operation.");const{filterGeometry:r,orderByFields:s}=this,i=this.layer?.capabilities?.query,a=t.createQuery();return a.where=this._getWhere(),a.timeExtent=this._getTimeExtent(),a.returnGeometry=!1,a.objectIds=e,a.outFields=[t.objectIdField],i?.supportsOrderBy&&(a.orderByFields=s),r&&(a.geometry=r),i?.supportsCacheHint&&(a.cacheHint=!0),t.queryFeatures(a)}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_queryAttachments(e){const{attachmentsEnabled:t,layer:r}=this,{capabilities:s}=r,i=s?.data.supportsAttachment,a=s?.operations?.supportsQueryAttachments;return t&&i&&a&&"queryAttachments"in r?r.queryAttachments(new d({objectIds:e,where:this._getWhere()})):Promise.resolve(null)}_queueQueryOperation(e){return this._queryOperationQueue.push(e),this.notifyChange("querying"),e().then((t=>this._queryOperationQueue.includes(e)?(this.itemCache.addMany(t),t):[])).catch((t=>{_("store:query-error","An error ocurred.",{error:t});const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]})).then((t=>(a(this._queryOperationQueue,e),this.notifyChange("querying"),t)))}_queueEditOperation(e){return this._editOperationQueue.push(e),this.notifyChange("syncing"),e().then((t=>(a(this._editOperationQueue,e),this.notifyChange("syncing"),t))).catch((t=>{_("store:edit-error","An error ocurred.",{error:t});const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),a(this._editOperationQueue,e),this.notifyChange("syncing"),t}))}_getWhere(){return this.where||this.layer?.definitionExpression||"1=1"}_getTimeExtent(){const e=this.layer;return this.timeExtent||e&&"timeExtent"in e&&e.timeExtent||null}};e([y()],g.prototype,"attachmentsEnabled",null),e([y({readOnly:!0})],g.prototype,"count",void 0),e([y({readOnly:!0})],g.prototype,"failures",void 0),e([y()],g.prototype,"filterGeometry",null),e([y({readOnly:!0})],g.prototype,"itemCache",void 0),e([y({value:null})],g.prototype,"layer",null),e([y({value:null})],g.prototype,"objectIds",null),e([y()],g.prototype,"orderByFields",null),e([y({readOnly:!0})],g.prototype,"querying",null),e([y()],g.prototype,"relatedRecordsEnabled",void 0),e([y({value:!1})],g.prototype,"returnGeometry",null),e([y({readOnly:!0})],g.prototype,"state",null),e([y({readOnly:!0})],g.prototype,"syncing",null),e([y()],g.prototype,"timeExtent",null),e([y()],g.prototype,"where",null),g=e([c(p)],g);const f=g;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i,remove as a}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import n from"../../../core/Error.js";import{clone as h}from"../../../core/lang.js";import u from"../../../core/Logger.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as l}from"../../../layers/support/layerUtils.js";import d from"../../../rest/support/AttachmentQuery.js";const p="esri.widgets.FeatureTable.support.FeatureStore",m=u.getLogger(p);function _(e,t,r){m.error(new n(e,t,r))}let g=class extends r{constructor(e){super(e),this._loaded=!1,this._loadError=!1,this._loading=!1,this._editOperationQueue=[],this._queryOperationQueue=[],this._objectIdCache=new o,this._hasStaleCache=!1,this.count=0,this.failures=new o,this.itemCache=new o,this.relatedRecordsEnabled=!1}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy(),this._set("itemCache",null)}set attachmentsEnabled(e){this._reset(),this._set("attachmentsEnabled",e),this.notifyChange("state")}set filterGeometry(e){this._reset(),this._set("filterGeometry",e),this.notifyChange("state")}set layer(e){this._reset(),this._set("layer",e),this.notifyChange("state")}set objectIds(e){this._reset(),this._set("objectIds",e||null),this.notifyChange("state")}get orderByFields(){return this._get("orderByFields")||[]}set orderByFields(e){const t=this.orderByFields;s(e,t)||(this.itemCache.removeAll(),this._hasStaleCache=!0,this._set("orderByFields",e))}get querying(){return this._queryOperationQueue.length>0}set returnGeometry(e){this._reset(),this._set("returnGeometry",e),this.notifyChange("state")}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return r?"error":!e||this.get("layer.loadError")?"disabled":s?"loading":"loaded"===this.get("layer.loadStatus")&&t?"loaded":"ready"}get syncing(){return this._editOperationQueue.length>0}set timeExtent(e){this._reset(),this._set("timeExtent",e),this.notifyChange("state")}get where(){return this._get("where")||null}set where(e){this._reset(),this._set("where",e),this.notifyChange("state")}async load(){this._reset();const{layer:e}=this;if(e){this._loading=!0,this.notifyChange("state");try{await e.when(),await this._syncLayerInfo(),this._loading=!1,this._loaded=!0,this.notifyChange("state")}catch(t){throw this._reset(),this._loadError=!0,this.notifyChange("state"),_("store:load-error","An error ocurred.",{error:t}),t}}}async refreshLayerInfo(){return this._syncLayerInfo()}async addItems(e){}async fetchItems(e){const{page:t,pageSize:r}=e,s=t*r,i=s+r,{layer:a,state:o}=this;if(!a||"loaded"!==o)return[];this.notifyChange("querying");const n=await this._query({start:s,num:i,page:t,pageSize:r});return this.notifyChange("state"),n}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{features:s}=await this._verifyFeaturesByObjectId(e);return e.map((e=>s.some((t=>t?.getObjectId()===e))))}async query(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];this.notifyChange("querying");const s=await this._query(e);return this.notifyChange("state"),s}async removeItemAt(e){}async reset(){this._reset()}async updateItem(e){return this._update(e).then((()=>{}))}async deleteRowsByObjectId(e){return this._delete({objectIds:e})}getLocalItemByKey(e){return this.getItemByObjectId(e)}getItemByObjectId(e){const{itemCache:t,layer:{objectIdField:r}}=this;return t.find((t=>t.feature?.attributes[r]===e))}getLocalItemAt(e){return this.itemCache.getItemAt(e)}getItemAt(e){return Promise.resolve(this.itemCache.getItemAt(e))}getObjectIdIndex(e){const{itemCache:t,layer:{objectIdField:r}}=this;return t.findIndex((t=>t.feature?.attributes[r]===e))}_reset(){this.itemCache.removeAll(),this.failures.removeAll(),this._editOperationQueue=[],this._queryOperationQueue=[],this._hasStaleCache=!1,this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0),this._objectIdCache.removeAll(),this.notifyChange("querying"),this.notifyChange("syncing"),this.notifyChange("state")}_getIdsFromFeatures(e){return e.map((e=>e.attributes[this.layer.objectIdField]))}_toFeatureData(e,t){const{layer:{objectIdField:r}}=this;return e.map((e=>{const{attributes:s}=e,i=s[r];return{objectId:i,feature:e,attachments:t?t[i]:null,relatedRecords:null}}))}async _update(e){const{layer:r}=this,{operations:s}=l(r);if(!s.supportsUpdate||!("applyEdits"in r))throw new n("store:update-error","Update is not supported.");const{index:i,name:a,value:o}=e,u=await this.getItemAt(i);if(!u||!u.feature)throw new n("store:update-error","Feature with provided 'objectId' not found.");const{feature:c}=u,y=h(c.attributes);y[a]=o;const d=new t({attributes:y}),p=r.applyEdits({updateFeatures:[d]}).then((e=>{const{updateFeatureResults:t}=e,r=t.find((e=>!!e.error));if(r)throw r.error;return t.length&&(c.attributes=y),e}));return this._queueEditOperation((()=>p))}async _delete(e){const{layer:t}=this,{operations:r}=l(t);if(!r.supportsDelete||!("applyEdits"in t))throw new n("store:delete-error","Delete is not supported.");const{objectIds:s}=e,a=s.map((e=>this.getItemByObjectId(e)?.feature)).filter(i);return this._queueEditOperation((()=>t.applyEdits({deleteFeatures:a})))}async _query(e){const{refresh:t}=e;return!0===t?(this.itemCache.removeAll(),this._syncLayerInfo().then((()=>this._queryFeatureData(e)))):(this._hasStaleCache&&(await this._updateIds(),this._hasStaleCache=!1),this._queryFeatureData(e))}async _queryFeatureData(e){return this._queueQueryOperation((async()=>{const{features:t}=await this._queryFeatures(e),r=this._getIdsFromFeatures(t),s=await this._queryAttachments(r);return this._toFeatureData(t,s)||[]}))}async _syncLayerInfo(){await this._updateCount(),await this._updateIds()}async _updateCount(){await this._queryCount().then((e=>this._set("count",e)))}async _updateIds(){this.layer?.capabilities?.query?.supportsPagination||(this._objectIdCache.removeAll(),await this._queryForObjectIds().then((e=>this._objectIdCache.addMany(e))))}_queryCount(){const{filterGeometry:e,layer:t}=this,r=t.capabilities?.query?.supportsCacheHint,s=t.createQuery();return s.geometry=e,s.returnGeometry=!1,s.where=this._getWhere(),s.timeExtent=this._getTimeExtent(),s.objectIds=this.objectIds,r&&(s.cacheHint=!0),t.queryFeatureCount(s)}_queryForObjectIds(){const{filterGeometry:e,layer:t,orderByFields:r}=this,s=t.capabilities?.query,i=s?.supportsCacheHint,a=s?.supportsOrderBy,o=t.createQuery();return o.geometry=e,o.outFields=[t.objectIdField],o.returnGeometry=!1,o.where=this._getWhere(),o.timeExtent=this._getTimeExtent(),o.objectIds=this.objectIds,a&&(o.orderByFields=r),i&&(o.cacheHint=!0),t.queryObjectIds(o)}async _queryFeatures(e){const{layer:t}=this;if(!l(t)?.operations.supportsQuery)throw new n("store:query-error","Layer does not support query operation.");const{filterGeometry:r,orderByFields:s,returnGeometry:i}=this,a=this.layer?.capabilities?.query,{start:o,pageSize:h}=e,u=t.createQuery();return u.returnGeometry=i,a?.supportsPagination?(u.start=o,u.num=h,u.where=this._getWhere(),u.timeExtent=this._getTimeExtent(),u.objectIds=this.objectIds):u.objectIds=this.objectIds||this._getObjectIdsForPage(o,h??0),a?.supportsOrderBy&&(u.orderByFields=s),r&&(u.geometry=r),a?.supportsCacheHint&&(u.cacheHint=!0),t.queryFeatures(u)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!l(t)?.operations.supportsQuery)throw new n("store:query-error","Layer does not support query operation.");const{filterGeometry:r,orderByFields:s}=this,i=this.layer?.capabilities?.query,a=t.createQuery();return a.where=this._getWhere(),a.timeExtent=this._getTimeExtent(),a.returnGeometry=!1,a.objectIds=e,a.outFields=[t.objectIdField],i?.supportsOrderBy&&(a.orderByFields=s),r&&(a.geometry=r),i?.supportsCacheHint&&(a.cacheHint=!0),t.queryFeatures(a)}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_queryAttachments(e){const{attachmentsEnabled:t,layer:r}=this,{capabilities:s}=r,i=s?.data.supportsAttachment,a=s?.operations?.supportsQueryAttachments;return t&&i&&a&&"queryAttachments"in r?r.queryAttachments(new d({objectIds:e,where:this._getWhere()})):Promise.resolve(null)}_syncLocalCache(e){e.forEach((e=>{if(e.feature){const t=e.feature.getObjectId();if(null!=t){const r=this.getObjectIdIndex(t);-1===r?this.itemCache.add(e):this.itemCache.splice(r,1,e)}}}))}_queueQueryOperation(e){return this._queryOperationQueue.push(e),this.notifyChange("querying"),e().then((t=>this._queryOperationQueue.includes(e)?(this._syncLocalCache(t),t):[])).catch((t=>{_("store:query-error","An error ocurred.",{error:t});const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]})).then((t=>(a(this._queryOperationQueue,e),this.notifyChange("querying"),t)))}_queueEditOperation(e){return this._editOperationQueue.push(e),this.notifyChange("syncing"),e().then((t=>(a(this._editOperationQueue,e),this.notifyChange("syncing"),t))).catch((t=>{_("store:edit-error","An error ocurred.",{error:t});const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),a(this._editOperationQueue,e),this.notifyChange("syncing"),t}))}_getWhere(){return this.where||this.layer?.definitionExpression||"1=1"}_getTimeExtent(){const e=this.layer;return this.timeExtent||e&&"timeExtent"in e&&e.timeExtent||null}};e([c()],g.prototype,"attachmentsEnabled",null),e([c({readOnly:!0})],g.prototype,"count",void 0),e([c({readOnly:!0})],g.prototype,"failures",void 0),e([c()],g.prototype,"filterGeometry",null),e([c({readOnly:!0})],g.prototype,"itemCache",void 0),e([c({value:null})],g.prototype,"layer",null),e([c({value:null})],g.prototype,"objectIds",null),e([c()],g.prototype,"orderByFields",null),e([c({readOnly:!0})],g.prototype,"querying",null),e([c()],g.prototype,"relatedRecordsEnabled",void 0),e([c({value:!1})],g.prototype,"returnGeometry",null),e([c({readOnly:!0})],g.prototype,"state",null),e([c({readOnly:!0})],g.prototype,"syncing",null),e([c()],g.prototype,"timeExtent",null),e([c()],g.prototype,"where",null),g=e([y(p)],g);const f=g;export{f as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/Error.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Popup/PopupViewModel.js";let e=class extends o{};e=r([s("esri.widgets.Features.FeaturesViewModel")],e);const t=e;export{t as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Accessor.js";import i from"../core/Collection.js";import{eventKey as o}from"../core/events.js";import s from"../core/Logger.js";import{watch as r}from"../core/reactiveUtils.js";import{throttle as n}from"../core/throttle.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import c from"./Feature.js";import d from"./Spinner.js";import u from"./Widget.js";import{CSS as h}from"./Feature/resources.js";import{FeatureContentMixin as p}from"./Feature/support/FeatureContentMixin.js";import m from"./Features/FeaturesViewModel.js";import{getPointFromGeometry as v}from"./Popup/actionUtils.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as g}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{substitute as F}from"../intl/substitute.js";class M extends t{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}}e([l()],M.prototype,"actionBar",void 0),e([l()],M.prototype,"closeButton",void 0),e([l()],M.prototype,"featureNavigation",void 0),e([l()],M.prototype,"heading",void 0),e([l()],M.prototype,"spinner",void 0);const b="esri-features",y={calciteModeLight:"calcite-mode-light",calciteModeDark:"calcite-mode-dark",esriWidget:"esri-widget",esriWidgetPanel:"esri-widget--panel",base:`${b}`,container:`${b}__container`,actionBar:`${b}__action-bar`,footerActions:`${b}__footer-actions`,featureMenuObserver:`${b}__feature-menu-observer`,actionExit:`${b}__action--exit`},I="selected-index",R=0,x="features-spinner";let C=class extends(p(u)){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusFeatureMenuFlowItem=!1,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new i,this._focusRootFlowItem=!1,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this.icon=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new m,this.visibleElements=new M,this._renderAction=(e,t)=>{const i=this._getActionTitle(e);return f("calcite-action",{appearance:"solid",bind:this,icon:this._getActionIcon(e),onclick:this._triggerAction,"data-action-uid":e.uid,disabled:e.disabled,indicator:e.indicator,loading:e.active,active:"toggle"===e.type&&e.value,key:`action-${t}`,text:i},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:i,slot:"tooltip"},i))},this._openFeatureMenu=()=>{this.featureMenuOpen=!0},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this._focusRootFlowItem=!0,this.featureMenuOpen=!1,this.viewModel.browseClusterEnabled=!1},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._displaySpinnerThrottled=n((()=>this._displaySpinner()),R),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,r((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),r((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyRelatedRecordsFlowItemWidgets())),r((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),r((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get _hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _activeFlowItemWidget(){return this._relatedRecordsFlowItems.at(-1)??null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new c({flowItems:i,headingLevel:t+1,viewModel:o,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||s.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),this._rootFlowItemNode?.blur()}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{container:e}=this,{active:t}=this.viewModel;if(t||s.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),!e)return;const i=e.querySelectorAll("calcite-flow-item"),o=i[i?.length-1];this.scheduleRender(),requestAnimationFrame((()=>o?.setFocus()))}next(){return this.viewModel.next()}open(e){this.removeHandles(I),this.viewModel.open(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return f("div",{class:this.classes(y.base,y.esriWidget,y.esriWidgetPanel)},this._renderContentContainer())}_renderFooter(){return this._featureNavigationVisible?f("div",{slot:"footer",class:y.footerActions,key:"footer-actions"},this._renderPagination(),this._renderFeatureMenuButton()):null}_renderFeatureMenuButton(){const{messages:e,messagesCommon:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=this.viewModel;return f("calcite-action-group",{layout:"horizontal"},s>0?f("calcite-action",{appearance:"solid",key:"feature-menu-loading-action",loading:!0,scale:"s",text:t.loading||"",label:t.loading||""}):f("calcite-action",{appearance:"solid",key:"feature-menu-button",bind:this,scale:"s",textEnabled:!0,label:e.selectFeature||"",text:F(e.pageText||"",{total:i,index:(o+1).toLocaleString(void 0,{minimumIntegerDigits:i.toString().length,useGrouping:!1})}),onclick:this._openFeatureMenu,icon:"list"},f("calcite-tooltip",{overlayPositioning:"fixed",label:e.selectFeature,placement:"bottom",slot:"tooltip"},e.selectFeature)))}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return f("calcite-action-group",{layout:"horizontal"},f("calcite-action",{appearance:"solid",label:e,text:e,iconFlipRtl:!0,icon:"chevron-left",scale:"s",onclick:this._previousFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:e,slot:"tooltip"},e)),f("calcite-action",{appearance:"solid",label:t,text:t,iconFlipRtl:!0,icon:"chevron-right",scale:"s",onclick:this._nextFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:t,slot:"tooltip"},t)))}_renderFeatureMenuItem(e,t){const{selectedFeatureViewModel:i}=this.viewModel,o=e===i;return f("calcite-list-item",{bind:this,key:`feature-menu-item-${e.uid}`,selected:o,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature,"data-feature-index":t,onCalciteListItemSelect:this._selectFeature,label:e.title||this.messagesCommon.untitled})}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel;return e.length>1?f("calcite-list",{selectionMode:"single",selectionAppearance:"icon"},e.filter((e=>!!e.graphic)).map(((e,t)=>this._renderFeatureMenuItem(e,t)))):null}_renderContentFeature(){const{headingLevel:e,visibleElements:t}=this,{title:i,active:o}=this.viewModel,s=t.heading&&i?i:"";return f("calcite-flow-item",{bind:this,closed:!o,closable:t.closeButton,heading:s,headingLevel:e,afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,key:"root-flow-item",onkeydown:this._onMainKeydown},this._renderActionBar(),f("div",{class:y.container},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:s,featureViewModels:r}=e;return t?f("calcite-flow-item",{bind:this,closed:!s,afterCreate:this._focusFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,loading:e.isLoadingFeature,heading:i.selectFeature,description:F(i.total,{total:r.length}),key:"feature-menu",onCalciteFlowItemBack:this._handleFeatureMenuBack},f("div",{class:y.container},this._renderFeatureMenu()),f("div",{class:y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),f("calcite-button",{onclick:this._handleFeatureMenuBack,slot:"footer-actions",appearance:"transparent",width:"full"},o.back)):null}_renderContentContainer(){const{_hasContent:e,_relatedRecordsFlowItems:t}=this,{content:i}=this.viewModel,o=t.toArray();return e?f("calcite-flow",{key:i??"content"},this._renderContentFeature(),this._renderFeatureMenuContainer(),o.map((e=>this._renderRelatedRecordsFlowItem(e))),f("div",{key:"content-tooltips"},o.map((e=>this._renderRelatedRecordsFlowItemTooltips(e))))):null}_renderActionBar(){return this.visibleElements.actionBar&&this.viewModel.allActions?.length?f("calcite-action-bar",{key:"header-action-bar",class:y.actionBar,layout:"horizontal",expandDisabled:!0},f("calcite-action-group",{layout:"horizontal"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?f("div",{class:h.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}_renderRelatedRecordsFlowItem(e){const{messages:t}=this,{visibleElements:i}=this,{active:o}=this.viewModel,s="graphic"in e&&!e.isTable;return f("calcite-flow-item",{bind:this,closed:!o,closable:i.closeButton,heading:e.title??"",description:this._getRelatedRecordsFlowItemDescription(e),onCalciteFlowItemBack:this._handleRelatedRecordsBackClick,key:`flow-item-${e.viewModel.uid}`},f("calcite-action",{appearance:"transparent",class:y.actionExit,icon:"move-up",label:t.exitRelatedRecords,text:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyRelatedRecordsFlowItemWidgets}),s?f("calcite-action",{appearance:"transparent",icon:"zoom-to-object",label:t.selectFeature,text:t.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,f("div",{class:y.container},e.render()))}_renderRelatedRecordsFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,s=o.get(e);return[f("calcite-tooltip",{key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t.exitRelatedRecords),s?f("calcite-tooltip",{key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t.selectFeature):null]}_focusRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFeatureMenuFlowItem&&(this._focusFeatureMenuFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuFlowItem=!0}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon||"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,r=i?.attributes,n=e.title??"",l="zoom-to-feature"===s?F(n,{messages:t}):"remove-selected-feature"===s?F(n,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?F(n,{messages:t}):e.title;return l&&r?F(l,r):l??""}_onMainKeydown(e){const t=o(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}_handleRelatedRecordsBackClick(){const e=this._relatedRecordsFlowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=v(i);this.open({features:[t],location:null!=o?o:void 0})}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyRelatedRecordsFlowItemWidgets(),this.featureMenuOpen=!1,this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),r=o.getItemAt(s);r&&"toggle"===r.type&&(r.value=!r.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new d({view:e}),e.ui.add(this._spinner,{key:x,position:"manual"}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,x),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([l()],C.prototype,"_focusFeatureMenuFlowItem",void 0),e([l()],C.prototype,"_relatedRecordsFlowItems",void 0),e([l()],C.prototype,"_focusRootFlowItem",void 0),e([l()],C.prototype,"_hasContent",null),e([l()],C.prototype,"_featureNavigationVisible",null),e([l()],C.prototype,"_activeFlowItemWidget",null),e([l()],C.prototype,"icon",void 0),e([l()],C.prototype,"featureMenuOpen",null),e([l()],C.prototype,"features",null),e([l()],C.prototype,"headingLevel",void 0),e([l()],C.prototype,"location",null),e([l()],C.prototype,"label",null),e([l(),_("esri/widgets/Features/t9n/Features")],C.prototype,"messages",void 0),e([l(),_("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([l()],C.prototype,"promises",null),e([l({readOnly:!0})],C.prototype,"selectedFeature",null),e([l()],C.prototype,"selectedFeatureIndex",null),e([l({readOnly:!0})],C.prototype,"selectedFeatureWidget",null),e([l()],C.prototype,"title",null),e([l()],C.prototype,"updateLocationEnabled",null),e([l()],C.prototype,"view",null),e([l({type:m}),g(["triggerAction","trigger-action"])],C.prototype,"viewModel",void 0),e([l({type:M})],C.prototype,"visibleElements",void 0),e([l()],C.prototype,"visible",null),C=e([a("esri.widgets.Features")],C);const A=C;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const c="esri.widgets.Popup.PopupViewModel",s=t.getLogger(c),u=t=>{const{event:c,view:s,viewModel:u}=t,{action:l}=c;if(!l)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));const{disabled:d,id:g}=l;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(u).catch(r);if(g===o.id)return f(u);if(g===i.id)return u.featureMenuOpen=!u.featureMenuOpen,u.browseClusterEnabled=!u.browseClusterEnabled,Promise.resolve();if(u.browseClusterEnabled=!1,g===a.id){u.visible=!1;const{selectedFeature:t}=u;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):s?.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,c=l(t);if(!i||!c){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:c,view:i});throw s.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:c,scale:f?u:void 0}})}catch(m){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});s.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw s.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw s.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:c}=await i.queryExtent(a);await t.zoomTo({target:c}),o.active=!1,o.disabled=!1}async function m(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function p(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,e?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{p as browseAggregateFeatures,m as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};
5
+ import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const c="esri.widgets.Popup.PopupViewModel",s=t.getLogger(c),u=t=>{const{event:c,view:s,viewModel:u}=t,{action:l}=c;if(!l)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));const{disabled:d,id:g}=l;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(u).catch(r);if(g===o.id)return f(u);if(g===i.id)return u.browseClusterEnabled=!u.browseClusterEnabled,u.featureMenuOpen=u.browseClusterEnabled,Promise.resolve();if(g===a.id){u.visible=!1;const{selectedFeature:t}=u;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):s?.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,c=l(t);if(!i||!c){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:c,view:i});throw s.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:c,scale:f?u:void 0}})}catch(m){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});s.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw s.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw s.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:c}=await i.queryExtent(a);await t.zoomTo({target:c}),o.active=!1,o.disabled=!1}async function m(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function p(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,i.value=!0,e?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){i.value=!1;const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{p as browseAggregateFeatures,m as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../support/actions/ActionButton.js";const s={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},o=new e({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:s.iconZoom}),i=new e({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:s.iconTrash}),t=new e({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:s.iconZoom}),a=new e({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:s.iconBrowseClusteredFeatures}),n=[o,i,a,t];export{n as all,a as browseClusteredFeatures,i as removeSelectedFeature,t as zoomToClusteredFeatures,o as zoomToFeature};
5
+ import e from"../../support/actions/ActionButton.js";import s from"../../support/actions/ActionToggle.js";const o={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},t=new e({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:o.iconZoom}),i=new e({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:o.iconTrash}),a=new e({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:o.iconZoom}),r=new s({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:o.iconBrowseClusteredFeatures,value:!1}),n=[t,i,r,a];export{n as all,r as browseClusteredFeatures,i as removeSelectedFeature,a as zoomToClusteredFeatures,t as zoomToFeature};
package/widgets/Popup.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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import{eventKey as o}from"../core/events.js";import n from"../core/Handles.js";import s from"../core/Logger.js";import{watch as r,when as l,on as a,whenOnce as c,initial as u}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as p}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import m from"./Feature.js";import v from"./Spinner.js";import f from"./Widget.js";import{CSS as _}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{getPointFromGeometry as b}from"./Popup/actionUtils.js";import{CSS as M}from"./Popup/css.js";import y from"./Popup/PopupViewModel.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{Heading as k}from"./support/Heading.js";import{accessibleHandler as F}from"./support/decorators/accessibleHandler.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{vmEvent as I}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{storeNode as x,cssTransition as E,isRTL as N}from"./support/widgetUtils.js";import{isDarkTheme as B}from"../support/themeUtils.js";import{substitute as P}from"../intl/substitute.js";const D="selected-index",T=0,S="popup-spinner",L={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},R="esri-popup";function V(e,t){return void 0===t?`${R}__${e}`:`${R}__${e}-${t}`}const j={closeButton:!0,featureNavigation:!0};let U=class extends(w(f)){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new n,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),T),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new y,this.visibleElements={...j},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._addSelectedFeatureIndexHandle(),this.addHandles([r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),l((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),a((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),u),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),a((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),r((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return A({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}initialize(){this.addHandles(this._displaySpinnerThrottled)}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&null!=this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return i(s.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){i(s.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||L}set dockOptions(e){const t={...L},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;"object"==typeof r?n.breakpoint={...s,...r}:r&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new m({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...j,...e}}blur(){const{active:e}=this.viewModel;e||s.getLogger(this).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||s.getLogger(this).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(D);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:l}=o,a=r&&l.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,h=this.selectedFeature?.layer?.id,p={[M.alignTopCenter]:"top-center"===n,[M.alignBottomCenter]:"bottom-center"===n,[M.alignTopLeft]:"top-left"===n,[M.alignBottomLeft]:"bottom-left"===n,[M.alignTopRight]:"top-right"===n,[M.alignBottomRight]:"bottom-right"===n,[M.isDocked]:c,[M.shadow]:u,[M.isDockedTopLeft]:"top-left"===s,[M.isDockedTopCenter]:"top-center"===s,[M.isDockedTopRight]:"top-right"===s,[M.isDockedBottomLeft]:"bottom-left"===s,[M.isDockedBottomCenter]:"bottom-center"===s,[M.isDockedBottomRight]:"bottom-right"===s,[M.isFeatureMenuOpen]:i,[M.isActionsMenuOpen]:a};return O("div",{class:this.classes(M.base,p),role:"presentation","data-layer-title":d,"data-layer-id":h,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return O("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconLoading,M.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?O("div",{key:V("loading-container"),role:"presentation",class:M.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousButton(){const{messages:e}=this;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(M.button,M.paginationPrevious),"aria-label":e.previous,title:e.previous},O("calcite-icon",{icon:"chevron-left",scale:"s",class:M.paginationIcon}))}renderNextButton(){const{messages:e}=this;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(M.button,M.paginationNext),"aria-label":e.next,title:e.next},O("calcite-icon",{icon:"chevron-right",scale:"s",class:M.paginationIcon}))}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:M.featureMenuButton,"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},O("calcite-icon",{icon:"list-bullet",scale:"s",class:M.featureMenuButtonIcon}),this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNextButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[M.iconUndock]:e,[M.iconDock]:!e,[M.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[M.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[M.iconDockToTop]:!e&&"top-center"===t,[M.iconDockToBottom]:!e&&"bottom-center"===t};return O("span",{"aria-hidden":"true",class:this.classes(i,M.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?O("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(M.button,M.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[M.headerContainerButton]:i},r=O(k,{level:this.headingLevel,class:M.headerTitle,innerHTML:e??""}),l=i?O("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,O("calcite-icon",{class:M.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):O("div",{key:e??"title",id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,s)},r);return e?l:null}renderCloseIcon(){return O("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?O("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:M.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return O("header",{class:M.header},this.renderTitle(),O("div",{class:M.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o}=this,{content:n}=this.viewModel,s=o.toArray(),r={[M.contentHasFlows]:!!s.length};return t&&!i?O("div",{key:n??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(M.content,r)},O("calcite-flow",{bind:this},O("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:x,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),s.map((e=>this.renderFlowItem(e)))),s.map((e=>this.renderFlowItemTooltips(e)))):null}renderFlowItem(e){const{messages:t}=this,i=B(),o="graphic"in e&&!e.isTable;return O("calcite-flow-item",{bind:this,class:this.classes({[M.calciteThemeDark]:!i,[M.calciteThemeLight]:i}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},O("calcite-action",{class:M.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),o?O("calcite-action",{class:M.actionSelectFeature,icon:"zoom-to-object",label:t?.selectFeature,text:t?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,O("div",{class:this.classes(M.contentFlowItem,{[M.calciteThemeDark]:i,[M.calciteThemeLight]:!i})},e.render()))}renderFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,n=B(),s=o.get(e);return[O("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!n,[M.calciteThemeLight]:n}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t?.exitRelatedRecords),s?O("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!n,[M.calciteThemeLight]:n}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t?.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?O("div",{key:V("actions-menu-button"),class:this.classes(M.button,M.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},O("span",{"aria-hidden":"true",class:M.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?O("ul",{id:e,role:"menu","aria-labelledby":t,key:V("actions"),class:M.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map((e=>this.renderAction({action:e,type:"inline"}))):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?O("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:M.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?O("section",{key:V("navigation"),class:this.classes(M.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[M.footerHasPagination]:e,[M.footerHasActions]:n,[M.footerHasActionsMenu]:s};return e||n?O("div",{key:V("feature-buttons"),class:this.classes(M.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=P(e.selectedFeatures,{total:t.length});return O("section",{key:V("menu"),class:M.featureMenu},O("strong",{class:M.featureMenuHeader},o),O("nav",{bind:this,class:M.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:x},this.renderFeatureMenu(),O("div",{class:M.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?O("div",{class:M.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:O("div",{key:V("pointer"),class:M.pointer,role:"presentation"},O("div",{class:this.classes(M.pointerDirection,M.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:l,visibleElements:a}=this,{title:c}=this.viewModel,u="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,h={[M.shadow]:e,[M.isCollapsible]:s,[M.isCollapsed]:l};return O("div",{class:this.classes(M.main,M.widget,h),tabIndex:a.closeButton?void 0:-1,role:"dialog","aria-live":"polite","aria-labelledby":c?o:"","aria-describedby":r&&!l?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:_.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return O("span",{key:"text",class:M.actionText},e)}renderActionCalciteIcon(e,t){return O("calcite-icon",{scale:"s",key:`calcite-icon-${t}`,icon:e,class:M.icon})}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[M.iconLoading]:e.active,[M.rotating]:e.active,[M.icon]:!!t,[M.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),O("span",{key:"icon","aria-hidden":"true",class:this.classes(M.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[M.action]:"toggle"!==t.type,[M.actionToggle]:"toggle"===t.type,[M.actionToggleOn]:"toggle"===t.type&&t.value,[M.buttonDisabled]:t.disabled},s=[t.icon&&!t.active?this.renderActionCalciteIcon(t.icon,t.uid):this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?O("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(M.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):O("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(M.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,l={[M.featureMenuSelected]:r},a=r?O("span",{key:V(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:M.iconCheckMark}):null,c=O("span",{innerHTML:e.title||o.untitled});return O("li",{role:"menuitem",tabIndex:-1,key:V(`feature-menu-feature-${n}`),class:this.classes(l,M.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},O("span",{class:M.featureMenuTitle},c,a))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?O("ol",{class:M.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=b(i);this.open({features:[t],location:null!=o?o:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r=e.title??"",l="zoom-to-feature"===n?P(r,{messages:t}):"remove-selected-feature"===n?P(r,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?P(r,{messages:t}):e.title;return l&&s?P(l,s):l??""}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:M.iconDefaultAction;return s&&i?P(s,i):s??""}_getActionImage(e){if(e.active)return"";const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?P(o,i):o??""}_createFeatureUpdatedAnimation(){return E("enter",M.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===o(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===o(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=W(e.currentTarget);t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=o(e),{_featureMenuNode:i}=this,n=W(e.currentTarget);if(!i)return;const s=i.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=o(e),{_actionsMenuNode:i}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!i)return;const l=i.querySelectorAll("li"),a=l.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();l[l.length-1].focus()}else{e.stopPropagation();l[0].focus()}else{e.stopPropagation();l[(r+1+a)%a].focus()}else{e.stopPropagation();l[(r-1+a)%a].focus()}}_handleMainKeyup(e){const t=o(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await c((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,D)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:r}=n;if(null==s||!r||!i)return"top-center";if(!this._isScreenLocationWithinView(s,r))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replaceAll(/[^-\d\.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,c=a?l(a.getPropertyValue("max-height")):0,u=a?l(a.getPropertyValue("height")):0,{height:d,width:h}=i.getBoundingClientRect(),p=h+t,g=Math.max(d,c,u)+t,m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"right",view:r}),v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"left",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"top",view:r}),_=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"bottom",view:r});return v?f?"bottom-right":"top-right":m?f?"bottom-left":"top-left":f?_?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return N(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=N(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-t,c=i.width-e;return"bottom-center"===n?{top:t+s-r.top,left:e-l-r.left}:"top-left"===n?{bottom:a+s-r.bottom,right:c+s-r.right}:"bottom-left"===n?{top:t+s-r.top,right:c+s-r.right}:"top-right"===n?{bottom:a+s-r.bottom,left:e+s-r.left}:"bottom-right"===n?{top:t+s-r.top,left:e+s-r.left}:"top-center"===n?{bottom:a+s-r.bottom,left:e-l-r.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==e||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:void 0!==s.top?`${s.top}px`:"auto",left:void 0!==s.left?`${s.left}px`:"auto",bottom:void 0!==s.bottom?`${s.bottom}px`:"auto",right:void 0!==s.right?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:l=0,height:a=0}=i??{};return o<=l&&s>l||o>l&&s<=l||n<=a&&r>a||n>a&&r<=a}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(s,r,a)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;if(!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),r=t.hasOwnProperty("height")&&n<=(t.height??0);return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?P(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(e,S),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new v({view:e}),e.ui.add(this._spinner,{key:S,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=W(e.currentTarget);null==t||isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};function W(e){return e?.["data-feature-index"]}e([h({readOnly:!0})],U.prototype,"actionsMenuId",null),e([h({readOnly:!0})],U.prototype,"actionsMenuButtonId",null),e([h({readOnly:!0})],U.prototype,"featureMenuId",null),e([h({readOnly:!0})],U.prototype,"titleId",null),e([h({readOnly:!0})],U.prototype,"contentId",null),e([h({readOnly:!0})],U.prototype,"hasContent",null),e([h({readOnly:!0})],U.prototype,"featureNavigationVisible",null),e([h({readOnly:!0})],U.prototype,"collapsible",null),e([h({readOnly:!0})],U.prototype,"featureMenuVisible",null),e([h({readOnly:!0})],U.prototype,"contentCollapsed",null),e([h({readOnly:!0})],U.prototype,"dividedActions",null),e([h({readOnly:!0,dependsOn:["_flowItems.length"]})],U.prototype,"_activeFlowItemWidget",null),e([h()],U.prototype,"actions",null),e([h()],U.prototype,"actionsMenuOpen",null),e([h()],U.prototype,"alignment",void 0),e([h()],U.prototype,"autoCloseEnabled",null),e([h()],U.prototype,"autoOpenEnabled",null),e([h()],U.prototype,"defaultPopupTemplateEnabled",null),e([h()],U.prototype,"content",null),e([h()],U.prototype,"collapsed",void 0),e([h()],U.prototype,"collapseEnabled",void 0),e([h({readOnly:!0})],U.prototype,"currentAlignment",null),e([h({readOnly:!0})],U.prototype,"currentDockPosition",null),e([h()],U.prototype,"dockOptions",null),e([h()],U.prototype,"dockEnabled",void 0),e([h({readOnly:!0})],U.prototype,"featureCount",null),e([h()],U.prototype,"featureMenuOpen",null),e([h()],U.prototype,"features",null),e([h()],U.prototype,"goToOverride",null),e([h()],U.prototype,"headingLevel",void 0),e([h()],U.prototype,"highlightEnabled",null),e([h()],U.prototype,"location",null),e([h()],U.prototype,"label",null),e([h()],U.prototype,"maxInlineActions",void 0),e([h(),C("esri/widgets/Popup/t9n/Popup")],U.prototype,"messages",void 0),e([h(),C("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([h()],U.prototype,"promises",null),e([h({readOnly:!0})],U.prototype,"selectedFeature",null),e([h()],U.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],U.prototype,"selectedFeatureWidget",null),e([h()],U.prototype,"spinnerEnabled",void 0),e([h()],U.prototype,"title",null),e([h()],U.prototype,"updateLocationEnabled",null),e([h()],U.prototype,"view",null),e([h({type:y}),I(["triggerAction","trigger-action"])],U.prototype,"viewModel",void 0),e([h()],U.prototype,"visible",null),e([h()],U.prototype,"visibleElements",void 0),e([p("visibleElements")],U.prototype,"castVisibleElements",null),e([F()],U.prototype,"_close",null),e([F()],U.prototype,"_toggleDockEnabled",null),e([F()],U.prototype,"_toggleFeatureMenu",null),e([F()],U.prototype,"_toggleActionsMenu",null),e([F()],U.prototype,"_triggerAction",null),e([F()],U.prototype,"_selectFeature",null),e([F()],U.prototype,"_next",null),e([F()],U.prototype,"_previous",null),U=e([g("esri.widgets.Popup")],U);const H=U;export{H as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import{eventKey as o}from"../core/events.js";import n from"../core/Handles.js";import s from"../core/Logger.js";import{watch as r,when as l,on as a,whenOnce as c,initial as u}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as p}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import m from"./Feature.js";import v from"./Spinner.js";import f from"./Widget.js";import{CSS as _}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{getPointFromGeometry as b}from"./Popup/actionUtils.js";import{CSS as M}from"./Popup/css.js";import y from"./Popup/PopupViewModel.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{Heading as k}from"./support/Heading.js";import{accessibleHandler as F}from"./support/decorators/accessibleHandler.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{vmEvent as I}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{storeNode as x,cssTransition as E,isRTL as N}from"./support/widgetUtils.js";import{isDarkTheme as B}from"../support/themeUtils.js";import{substitute as P}from"../intl/substitute.js";const T="selected-index",D=0,S="popup-spinner",L={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},R="esri-popup";function V(e,t){return void 0===t?`${R}__${e}`:`${R}__${e}-${t}`}const j={closeButton:!0,featureNavigation:!0};let U=class extends(w(f)){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new n,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),D),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new y,this.visibleElements={...j},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),l((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),a((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),u),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),a((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),r((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return A({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}initialize(){this.addHandles(this._displaySpinnerThrottled)}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return i(s.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){i(s.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||L}set dockOptions(e){const t={...L},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;"object"==typeof r?n.breakpoint={...s,...r}:r&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new m({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...j,...e}}blur(){const{active:e}=this.viewModel;e||s.getLogger(this).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||s.getLogger(this).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(T);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:l}=o,a=r&&l.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,h=this.selectedFeature?.layer?.id,p={[M.alignTopCenter]:"top-center"===n,[M.alignBottomCenter]:"bottom-center"===n,[M.alignTopLeft]:"top-left"===n,[M.alignBottomLeft]:"bottom-left"===n,[M.alignTopRight]:"top-right"===n,[M.alignBottomRight]:"bottom-right"===n,[M.isDocked]:c,[M.shadow]:u,[M.isDockedTopLeft]:"top-left"===s,[M.isDockedTopCenter]:"top-center"===s,[M.isDockedTopRight]:"top-right"===s,[M.isDockedBottomLeft]:"bottom-left"===s,[M.isDockedBottomCenter]:"bottom-center"===s,[M.isDockedBottomRight]:"bottom-right"===s,[M.isFeatureMenuOpen]:i,[M.isActionsMenuOpen]:a};return O("div",{class:this.classes(M.base,p),role:"presentation","data-layer-title":d,"data-layer-id":h,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return O("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconLoading,M.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?O("div",{key:V("loading-container"),role:"presentation",class:M.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousButton(){const{messages:e}=this;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(M.button,M.paginationPrevious),"aria-label":e.previous,title:e.previous},O("calcite-icon",{icon:"chevron-left",scale:"s",class:M.paginationIcon}))}renderNextButton(){const{messages:e}=this;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(M.button,M.paginationNext),"aria-label":e.next,title:e.next},O("calcite-icon",{icon:"chevron-right",scale:"s",class:M.paginationIcon}))}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return O("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:M.featureMenuButton,"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},O("calcite-icon",{icon:"list-bullet",scale:"s",class:M.featureMenuButtonIcon}),this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNextButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[M.iconUndock]:e,[M.iconDock]:!e,[M.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[M.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[M.iconDockToTop]:!e&&"top-center"===t,[M.iconDockToBottom]:!e&&"bottom-center"===t};return O("span",{"aria-hidden":"true",class:this.classes(i,M.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?O("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(M.button,M.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[M.headerContainerButton]:i},r=O(k,{level:this.headingLevel,class:M.headerTitle,innerHTML:e??""}),l=i?O("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,O("calcite-icon",{class:M.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):O("div",{key:e??"title",id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,s)},r);return e?l:null}renderCloseIcon(){return O("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?O("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:M.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return O("header",{class:M.header},this.renderTitle(),O("div",{class:M.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o}=this,{content:n}=this.viewModel,s=o.toArray(),r={[M.contentHasFlows]:!!s.length};return t&&!i?O("div",{key:n??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(M.content,r)},O("calcite-flow",{bind:this},O("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:x,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),s.map((e=>this.renderFlowItem(e)))),s.map((e=>this.renderFlowItemTooltips(e)))):null}renderFlowItem(e){const{messages:t}=this,i=B(),o="graphic"in e&&!e.isTable;return O("calcite-flow-item",{bind:this,class:this.classes({[M.calciteThemeDark]:!i,[M.calciteThemeLight]:i}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},O("calcite-action",{class:M.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),o?O("calcite-action",{class:M.actionSelectFeature,icon:"zoom-to-object",label:t?.selectFeature,text:t?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,O("div",{class:this.classes(M.contentFlowItem,{[M.calciteThemeDark]:i,[M.calciteThemeLight]:!i})},e.render()))}renderFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,n=B(),s=o.get(e);return[O("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!n,[M.calciteThemeLight]:n}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t?.exitRelatedRecords),s?O("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!n,[M.calciteThemeLight]:n}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t?.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?O("div",{key:V("actions-menu-button"),class:this.classes(M.button,M.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},O("span",{"aria-hidden":"true",class:M.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?O("ul",{id:e,role:"menu","aria-labelledby":t,key:V("actions"),class:M.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map((e=>this.renderAction({action:e,type:"inline"}))):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?O("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:M.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?O("section",{key:V("navigation"),class:this.classes(M.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[M.footerHasPagination]:e,[M.footerHasActions]:n,[M.footerHasActionsMenu]:s};return e||n?O("div",{key:V("feature-buttons"),class:this.classes(M.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=P(e.selectedFeatures,{total:t.length});return O("section",{key:V("menu"),class:M.featureMenu},O("strong",{class:M.featureMenuHeader},o),O("nav",{bind:this,class:M.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:x},this.renderFeatureMenu(),O("div",{class:M.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?O("div",{class:M.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:O("div",{key:V("pointer"),class:M.pointer,role:"presentation"},O("div",{class:this.classes(M.pointerDirection,M.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:l,visibleElements:a}=this,{title:c}=this.viewModel,u="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,h={[M.shadow]:e,[M.isCollapsible]:s,[M.isCollapsed]:l};return O("div",{class:this.classes(M.main,M.widget,h),tabIndex:a.closeButton?void 0:-1,role:"dialog","aria-live":"polite","aria-labelledby":c?o:"","aria-describedby":r&&!l?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?O("div",{class:_.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return O("span",{key:"text",class:M.actionText},e)}renderActionCalciteIcon(e,t){return O("calcite-icon",{scale:"s",key:`calcite-icon-${t}`,icon:e,class:M.icon})}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[M.iconLoading]:e.active,[M.rotating]:e.active,[M.icon]:!!t,[M.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),O("span",{key:"icon","aria-hidden":"true",class:this.classes(M.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[M.action]:"toggle"!==t.type,[M.actionToggle]:"toggle"===t.type,[M.actionToggleOn]:"toggle"===t.type&&t.value,[M.buttonDisabled]:t.disabled},s=[t.icon&&!t.active?this.renderActionCalciteIcon(t.icon,t.uid):this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?O("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(M.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):O("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(M.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,l={[M.featureMenuSelected]:r},a=r?O("span",{key:V(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:M.iconCheckMark}):null,c=O("span",{innerHTML:e.title||o.untitled});return O("li",{role:"menuitem",tabIndex:-1,key:V(`feature-menu-feature-${n}`),class:this.classes(l,M.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},O("span",{class:M.featureMenuTitle},c,a))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?O("ol",{class:M.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=b(i);this.open({features:[t],location:null!=o?o:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r=e.title??"",l="zoom-to-feature"===n?P(r,{messages:t}):"remove-selected-feature"===n?P(r,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?P(r,{messages:t}):e.title;return l&&s?P(l,s):l??""}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:M.iconDefaultAction;return s&&i?P(s,i):s??""}_getActionImage(e){if(e.active)return"";const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?P(o,i):o??""}_createFeatureUpdatedAnimation(){return E("enter",M.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===o(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===o(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=W(e.currentTarget);t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=o(e),{_featureMenuNode:i}=this,n=W(e.currentTarget);if(!i)return;const s=i.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=o(e),{_actionsMenuNode:i}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!i)return;const l=i.querySelectorAll("li"),a=l.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();l[l.length-1].focus()}else{e.stopPropagation();l[0].focus()}else{e.stopPropagation();l[(r+1+a)%a].focus()}else{e.stopPropagation();l[(r-1+a)%a].focus()}}_handleMainKeyup(e){const t=o(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await c((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,T)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:r}=n;if(null==s||!r||!i)return"top-center";if(!this._isScreenLocationWithinView(s,r))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replaceAll(/[^-\d\.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,c=a?l(a.getPropertyValue("max-height")):0,u=a?l(a.getPropertyValue("height")):0,{height:d,width:h}=i.getBoundingClientRect(),p=h+t,g=Math.max(d,c,u)+t,m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"right",view:r}),v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"left",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"top",view:r}),_=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"bottom",view:r});return v?f?"bottom-right":"top-right":m?f?"bottom-left":"top-left":f?_?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return N(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=N(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-t,c=i.width-e;return"bottom-center"===n?{top:t+s-r.top,left:e-l-r.left}:"top-left"===n?{bottom:a+s-r.bottom,right:c+s-r.right}:"bottom-left"===n?{top:t+s-r.top,right:c+s-r.right}:"top-right"===n?{bottom:a+s-r.bottom,left:e+s-r.left}:"bottom-right"===n?{top:t+s-r.top,left:e+s-r.left}:"top-center"===n?{bottom:a+s-r.bottom,left:e-l-r.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==e||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:void 0!==s.top?`${s.top}px`:"auto",left:void 0!==s.left?`${s.left}px`:"auto",bottom:void 0!==s.bottom?`${s.bottom}px`:"auto",right:void 0!==s.right?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:l=0,height:a=0}=i??{};return o<=l&&s>l||o>l&&s<=l||n<=a&&r>a||n>a&&r<=a}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(s,r,a)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;if(!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),r=t.hasOwnProperty("height")&&n<=(t.height??0);return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?P(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(e,S),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new v({view:e}),e.ui.add(this._spinner,{key:S,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=W(e.currentTarget);null==t||isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};function W(e){return e?.["data-feature-index"]}e([h({readOnly:!0})],U.prototype,"actionsMenuId",null),e([h({readOnly:!0})],U.prototype,"actionsMenuButtonId",null),e([h({readOnly:!0})],U.prototype,"featureMenuId",null),e([h({readOnly:!0})],U.prototype,"titleId",null),e([h({readOnly:!0})],U.prototype,"contentId",null),e([h({readOnly:!0})],U.prototype,"hasContent",null),e([h({readOnly:!0})],U.prototype,"featureNavigationVisible",null),e([h({readOnly:!0})],U.prototype,"collapsible",null),e([h({readOnly:!0})],U.prototype,"featureMenuVisible",null),e([h({readOnly:!0})],U.prototype,"contentCollapsed",null),e([h({readOnly:!0})],U.prototype,"dividedActions",null),e([h({readOnly:!0,dependsOn:["_flowItems.length"]})],U.prototype,"_activeFlowItemWidget",null),e([h()],U.prototype,"actions",null),e([h()],U.prototype,"actionsMenuOpen",null),e([h()],U.prototype,"alignment",void 0),e([h()],U.prototype,"autoCloseEnabled",null),e([h()],U.prototype,"autoOpenEnabled",null),e([h()],U.prototype,"defaultPopupTemplateEnabled",null),e([h()],U.prototype,"content",null),e([h()],U.prototype,"collapsed",void 0),e([h()],U.prototype,"collapseEnabled",void 0),e([h({readOnly:!0})],U.prototype,"currentAlignment",null),e([h({readOnly:!0})],U.prototype,"currentDockPosition",null),e([h()],U.prototype,"dockOptions",null),e([h()],U.prototype,"dockEnabled",void 0),e([h({readOnly:!0})],U.prototype,"featureCount",null),e([h()],U.prototype,"featureMenuOpen",null),e([h()],U.prototype,"features",null),e([h()],U.prototype,"goToOverride",null),e([h()],U.prototype,"headingLevel",void 0),e([h()],U.prototype,"highlightEnabled",null),e([h()],U.prototype,"location",null),e([h()],U.prototype,"label",null),e([h()],U.prototype,"maxInlineActions",void 0),e([h(),C("esri/widgets/Popup/t9n/Popup")],U.prototype,"messages",void 0),e([h(),C("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([h()],U.prototype,"promises",null),e([h({readOnly:!0})],U.prototype,"selectedFeature",null),e([h()],U.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],U.prototype,"selectedFeatureWidget",null),e([h()],U.prototype,"spinnerEnabled",void 0),e([h()],U.prototype,"title",null),e([h()],U.prototype,"updateLocationEnabled",null),e([h()],U.prototype,"view",null),e([h({type:y}),I(["triggerAction","trigger-action"])],U.prototype,"viewModel",void 0),e([h()],U.prototype,"visible",null),e([h()],U.prototype,"visibleElements",void 0),e([p("visibleElements")],U.prototype,"castVisibleElements",null),e([F()],U.prototype,"_close",null),e([F()],U.prototype,"_toggleDockEnabled",null),e([F()],U.prototype,"_toggleFeatureMenu",null),e([F()],U.prototype,"_toggleActionsMenu",null),e([F()],U.prototype,"_triggerAction",null),e([F()],U.prototype,"_selectFeature",null),e([F()],U.prototype,"_next",null),e([F()],U.prototype,"_previous",null),U=e([g("esri.widgets.Popup")],U);const H=U;export{H as default};