@arcgis/portal-components 6.0.0-next.2 → 6.0.0-next.21

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 (308) hide show
  1. package/dist/cdn/{MKSFNVXL.js → 22TDAUX4.js} +1 -1
  2. package/dist/cdn/234TH32X.js +106 -0
  3. package/dist/cdn/2D3FQXJ4.js +2 -0
  4. package/dist/cdn/{BKD7JSV2.js → 2DXO6FVX.js} +1 -1
  5. package/dist/cdn/{TWCJJCPC.js → 2XJX2JUO.js} +1 -1
  6. package/dist/cdn/{SGDDFWCJ.js → 3EQGUCO4.js} +1 -1
  7. package/dist/cdn/{OR6T5SB3.js → 3J3ISO3E.js} +1 -1
  8. package/dist/cdn/3RTST3I6.js +2 -0
  9. package/dist/cdn/3XH3JHOI.js +2 -0
  10. package/dist/cdn/4ONCJSSP.js +2 -0
  11. package/dist/cdn/4QYVBXZT.js +2 -0
  12. package/dist/cdn/{K75JTQPW.js → 4VLEUN7I.js} +1 -1
  13. package/dist/cdn/4WQA7UAJ.js +2 -0
  14. package/dist/cdn/5OWIWCEQ.js +2 -0
  15. package/dist/cdn/{7ZWYUHGK.js → 5R4JJWGB.js} +1 -1
  16. package/dist/cdn/63HYFDRU.js +2 -0
  17. package/dist/cdn/6MATPHXT.js +79 -0
  18. package/dist/cdn/7IP3RVPH.js +2 -0
  19. package/dist/cdn/7ISSDO2T.js +2 -0
  20. package/dist/cdn/AKTIIRJQ.js +2 -0
  21. package/dist/cdn/ASID6YW7.js +135 -0
  22. package/dist/cdn/B3HV5JVN.js +2 -0
  23. package/dist/cdn/B6666VUQ.js +2 -0
  24. package/dist/cdn/BOO7GG5L.js +2 -0
  25. package/dist/cdn/CZ4FC4GM.js +2 -0
  26. package/dist/cdn/D3LZFIHV.js +2 -0
  27. package/dist/cdn/{NWVLGU2C.js → D3Q72PPN.js} +1 -1
  28. package/dist/cdn/DABNV2OO.js +2 -0
  29. package/dist/cdn/DELNTRCT.js +2 -0
  30. package/dist/cdn/DOCNBKQZ.js +2 -0
  31. package/dist/cdn/EP7NWEC5.js +2 -0
  32. package/dist/cdn/EQRBP6H6.js +66 -0
  33. package/dist/cdn/{ABORO35R.js → ESKKH4DE.js} +1 -1
  34. package/dist/cdn/EUQQZIRW.js +2 -0
  35. package/dist/cdn/F2HT5PVQ.js +2 -0
  36. package/dist/cdn/FE3O23SE.js +2 -0
  37. package/dist/cdn/FGRMURKX.js +2 -0
  38. package/dist/cdn/FN2QMDEW.js +2 -0
  39. package/dist/cdn/{I6IRHXWR.js → FYVATGMR.js} +1 -1
  40. package/dist/cdn/{RHCRPJWS.js → G3WDR53S.js} +1 -1
  41. package/dist/cdn/GAU6DNV5.js +2 -0
  42. package/dist/cdn/GPAIXN52.js +2 -0
  43. package/dist/cdn/GRSBU4PD.js +2 -0
  44. package/dist/cdn/{JWBUJT43.js → H7FA5HFE.js} +1 -1
  45. package/dist/cdn/HHGKNVCH.js +4 -0
  46. package/dist/cdn/HJLWIQDI.js +2 -0
  47. package/dist/cdn/I3EWDYTU.js +2 -0
  48. package/dist/cdn/{24QSQLRY.js → IKPVMXXW.js} +1 -1
  49. package/dist/cdn/{5HZNBMW6.js → IOFXDIWC.js} +1 -1
  50. package/dist/cdn/IPHBVKMY.js +2 -0
  51. package/dist/cdn/{GAF4YT5N.js → IUIFCQQU.js} +1 -1
  52. package/dist/cdn/{ZKZDKJ6D.js → IVDZGUNZ.js} +1 -1
  53. package/dist/cdn/J6SI4Z4F.js +2 -0
  54. package/dist/cdn/K3GAZFRI.js +63 -0
  55. package/dist/cdn/K7LYYLUF.js +2 -0
  56. package/dist/cdn/{74T6IXSN.js → KDORI7H4.js} +1 -1
  57. package/dist/cdn/KRORL7QC.js +2 -0
  58. package/dist/cdn/LGJWULAW.js +2 -0
  59. package/dist/cdn/LTMPXQTC.js +2 -0
  60. package/dist/cdn/M5STJJRX.js +2 -0
  61. package/dist/cdn/M7J7RAM4.js +2 -0
  62. package/dist/cdn/{AXOBMX3S.js → MLTZSPZQ.js} +1 -1
  63. package/dist/cdn/MSSJRDR7.js +2 -0
  64. package/dist/cdn/{L64UURQB.js → N4ZRMYZL.js} +1 -1
  65. package/dist/cdn/NBCYYUHP.js +2 -0
  66. package/dist/cdn/NHVPNSNH.js +2 -0
  67. package/dist/cdn/NQ2IAQKL.js +41 -0
  68. package/dist/cdn/NXGTEDK4.js +2 -0
  69. package/dist/cdn/{7LMZHJZG.js → NYOXMT6S.js} +1 -1
  70. package/dist/cdn/O3JP4FQ3.js +2 -0
  71. package/dist/cdn/O4YFPGD5.js +2 -0
  72. package/dist/cdn/{JIJO4CAS.js → ODSA6NNS.js} +1 -1
  73. package/dist/cdn/OHAQPQAP.js +2 -0
  74. package/dist/cdn/OOXTSCQT.js +2 -0
  75. package/dist/cdn/OQ2JULON.js +2 -0
  76. package/dist/cdn/OVH4YLTS.js +2 -0
  77. package/dist/cdn/QB5BGHLA.js +2 -0
  78. package/dist/cdn/QKCRNS75.js +2 -0
  79. package/dist/cdn/{2YZWRFCI.js → RKMW4FUN.js} +1 -1
  80. package/dist/cdn/RT26JZP5.js +2 -0
  81. package/dist/cdn/SKHFISBA.js +2 -0
  82. package/dist/cdn/SKIDJ4QI.js +2 -0
  83. package/dist/cdn/SRWFOV5W.js +2 -0
  84. package/dist/cdn/{IN4JPZTY.js → SSCKCDXD.js} +1 -1
  85. package/dist/cdn/T66G7GIR.js +2 -0
  86. package/dist/cdn/{RQYNPDN3.js → TIMYD2HM.js} +1 -1
  87. package/dist/cdn/{ROX3GKKA.js → TIPQ2ZWK.js} +1 -1
  88. package/dist/cdn/TJWJ3LTU.js +2 -0
  89. package/dist/cdn/{DHMNNIXZ.js → TMR4BRFI.js} +1 -1
  90. package/dist/cdn/{JN23JH3T.js → TTQGRN2V.js} +1 -1
  91. package/dist/cdn/{MLYQGIJU.js → U2HTYOBB.js} +13 -13
  92. package/dist/cdn/{YZTBAUIO.js → UHOW7Q65.js} +1 -1
  93. package/dist/cdn/ULGME5RT.js +2 -0
  94. package/dist/cdn/{Z6R3C4AK.js → US3N5L73.js} +1 -1
  95. package/dist/cdn/W5POIPYP.js +2 -0
  96. package/dist/cdn/{TLM457Z5.js → WJWWYBZ7.js} +1 -1
  97. package/dist/cdn/WNEPEEPZ.js +2 -0
  98. package/dist/cdn/WPAZDJHU.js +2 -0
  99. package/dist/cdn/WT72SOAU.js +2 -0
  100. package/dist/cdn/XJGKRAN5.js +2 -0
  101. package/dist/cdn/{JPUUMGX5.js → XS5EOWBK.js} +1 -1
  102. package/dist/cdn/Y5VUMGKH.js +3 -0
  103. package/dist/cdn/{EQDYQOOT.js → YCIFVZ4J.js} +1 -1
  104. package/dist/cdn/{3NSHGKZA.js → YDXJHNDI.js} +1 -1
  105. package/dist/cdn/{32BWFMTC.js → YIOJIA4Y.js} +1 -1
  106. package/dist/cdn/{K2XSYDAP.js → YK6FCXWU.js} +1 -1
  107. package/dist/cdn/YPDHSE2J.js +2 -0
  108. package/dist/cdn/{M5PPX4ZX.js → YQLFXHFG.js} +1 -1
  109. package/dist/cdn/YSVPB3BO.js +2 -0
  110. package/dist/cdn/YUOVGTP5.js +2 -0
  111. package/dist/cdn/Z5CA4C6H.js +2 -0
  112. package/dist/cdn/{TXC7YBGL.js → ZD6XJVGV.js} +1 -1
  113. package/dist/cdn/ZHQXYCPA.js +2 -0
  114. package/dist/cdn/{DLI4XKJ3.js → ZOX4RLS4.js} +1 -1
  115. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
  116. package/dist/cdn/assets/portal-entity-picker/t9n/messages.en.json +1 -1
  117. package/dist/cdn/assets/portal-item-card-sublayer-select/t9n/messages.en.json +1 -0
  118. package/dist/cdn/assets/portal-item-share-summary/t9n/messages.en.json +1 -0
  119. package/dist/cdn/index.js +1 -1
  120. package/dist/cdn/main.css +1 -1
  121. package/dist/chunks/fieldAddDelete.js +7 -7
  122. package/dist/chunks/functionalities.js +14 -9
  123. package/dist/chunks/groups.js +8 -61
  124. package/dist/chunks/groups2.js +23 -8
  125. package/dist/chunks/info.js +2 -2
  126. package/dist/chunks/item.js +58 -26
  127. package/dist/chunks/item2.js +34 -30
  128. package/dist/chunks/itemThumbnail.js +21 -21
  129. package/dist/chunks/loadClassificationData.js +26 -27
  130. package/dist/chunks/portal-delete-items-review.js +1 -1
  131. package/dist/chunks/portal-item-badge.js +1 -1
  132. package/dist/chunks/portal-related-items-list-item.js +1 -1
  133. package/dist/chunks/portal.js +6 -6
  134. package/dist/chunks/portal2.js +11 -11
  135. package/dist/chunks/portalEntitySelection.js +54 -0
  136. package/dist/chunks/query.js +13 -13
  137. package/dist/chunks/request.js +49 -41
  138. package/dist/chunks/requests.js +7 -7
  139. package/dist/chunks/selectedMentions.js +25 -0
  140. package/dist/chunks/services.js +1 -1
  141. package/dist/chunks/string.js +14 -10
  142. package/dist/chunks/ui.js +1 -0
  143. package/dist/chunks/url.js +2 -2
  144. package/dist/chunks/user.js +10 -10
  145. package/dist/chunks/utils.js +35 -22
  146. package/dist/chunks/utils2.js +4 -4
  147. package/dist/chunks/utils3.js +88 -657
  148. package/dist/chunks/utils4.js +664 -0
  149. package/dist/components/arcgis-portal-account-switcher/customElement.js +28 -26
  150. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +4 -4
  151. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +8 -8
  152. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +4 -4
  153. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +6 -6
  154. package/dist/components/arcgis-portal-account-switcher-signout/customElement.d.ts +5 -5
  155. package/dist/components/arcgis-portal-account-switcher-signout/customElement.js +3 -3
  156. package/dist/components/arcgis-portal-add-gps-metadata/customElement.d.ts +6 -0
  157. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +153 -130
  158. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +25 -15
  159. package/dist/components/arcgis-portal-ai-assistant/customElement.js +574 -2409
  160. package/dist/components/arcgis-portal-ai-assistant/index.js +4 -0
  161. package/dist/components/arcgis-portal-ai-assistant/tools/getItemTool.d.ts +11 -0
  162. package/dist/components/arcgis-portal-ai-assistant/types/assistantTools.d.ts +51 -0
  163. package/dist/components/arcgis-portal-ai-assistant/types/portalEntityTools.d.ts +14 -0
  164. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +39 -0
  165. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +63 -27
  166. package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +3 -1
  167. package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
  168. package/dist/components/arcgis-portal-classification-config/customElement.js +2 -2
  169. package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
  170. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  171. package/dist/components/arcgis-portal-delete-items/customElement.d.ts +69 -3
  172. package/dist/components/arcgis-portal-delete-items/customElement.js +446 -330
  173. package/dist/components/arcgis-portal-delete-items/index.js +1 -2
  174. package/dist/components/arcgis-portal-delete-items/types.d.ts +1 -0
  175. package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +36 -0
  176. package/dist/components/arcgis-portal-entity-picker/customElement.js +202 -120
  177. package/dist/components/arcgis-portal-entity-picker/index.js +2 -0
  178. package/dist/components/arcgis-portal-field-delete/customElement.js +33 -31
  179. package/dist/components/arcgis-portal-field-delete/index.js +1 -1
  180. package/dist/components/arcgis-portal-group-badges/customElement.js +5 -5
  181. package/dist/components/arcgis-portal-group-browser/customElement.js +93 -99
  182. package/dist/components/arcgis-portal-group-browser/types.d.ts +3 -7
  183. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +2 -2
  184. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +1 -1
  185. package/dist/components/arcgis-portal-group-card/customElement.js +18 -18
  186. package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
  187. package/dist/components/arcgis-portal-item-card/customElement.d.ts +26 -10
  188. package/dist/components/arcgis-portal-item-card/customElement.js +101 -91
  189. package/dist/components/arcgis-portal-item-card/index.js +2 -1
  190. package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.d.ts +102 -0
  191. package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.js +352 -0
  192. package/dist/components/arcgis-portal-item-card-sublayer-select/index.d.ts +1 -0
  193. package/dist/components/arcgis-portal-item-card-sublayer-select/index.js +8 -0
  194. package/dist/components/arcgis-portal-item-card-sublayer-select/types.d.ts +22 -0
  195. package/dist/components/arcgis-portal-item-share-summary/customElement.d.ts +113 -0
  196. package/dist/components/arcgis-portal-item-share-summary/customElement.js +172 -0
  197. package/dist/components/arcgis-portal-item-share-summary/index.d.ts +1 -0
  198. package/dist/components/arcgis-portal-item-share-summary/index.js +5 -0
  199. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.d.ts +33 -0
  200. package/dist/components/arcgis-portal-item-share-summary-editable/customElement.js +19 -0
  201. package/dist/components/arcgis-portal-item-share-summary-editable/index.d.ts +1 -0
  202. package/dist/components/arcgis-portal-item-share-summary-editable/index.js +2 -0
  203. package/dist/components/arcgis-portal-item-thumbnail/customElement.d.ts +1 -0
  204. package/dist/components/arcgis-portal-item-thumbnail/customElement.js +14 -14
  205. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  206. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +61 -57
  207. package/dist/components/arcgis-portal-navigation/customElement.js +7 -8
  208. package/dist/components/arcgis-portal-navigation/index.js +1 -1
  209. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +8 -8
  210. package/dist/components/arcgis-portal-review-related-items/customElement.d.ts +333 -0
  211. package/dist/components/arcgis-portal-review-related-items/customElement.js +45 -18
  212. package/dist/components/arcgis-portal-review-related-items/index.js +2 -0
  213. package/dist/components/arcgis-portal-sublayer-type/customElement.js +13 -103
  214. package/dist/components/arcgis-portal-user-popup/customElement.js +28 -28
  215. package/dist/components/portal-group-browser-filters/customElement.js +15 -15
  216. package/dist/components/portal-related-items-list-item/customElement.js +16 -14
  217. package/dist/components/portal-related-items-list-item/index.js +1 -1
  218. package/dist/docs/api.json +1 -1
  219. package/dist/docs/docs.json +1 -1
  220. package/dist/docs/vscode.html-custom-data.json +1 -1
  221. package/dist/docs/web-types.json +1 -1
  222. package/dist/index.d.ts +30 -0
  223. package/dist/index.js +155 -6
  224. package/dist/loader.js +15 -12
  225. package/dist/services/groups.d.ts +9 -0
  226. package/dist/services/item.d.ts +9 -0
  227. package/dist/types/item.d.ts +9 -9
  228. package/dist/types/lumina.d.ts +36 -17
  229. package/dist/types/preact.d.ts +39 -17
  230. package/dist/types/react.d.ts +42 -17
  231. package/dist/types/services.d.ts +27 -1
  232. package/dist/types/stencil.d.ts +36 -17
  233. package/dist/utils/generateEmbeddings.d.ts +7 -0
  234. package/dist/utils/semanticSearch.d.ts +60 -0
  235. package/dist/utils/types.d.ts +10 -0
  236. package/package.json +10 -10
  237. package/dist/cdn/23FS4XTG.js +0 -2
  238. package/dist/cdn/2MPQ5IWJ.js +0 -2
  239. package/dist/cdn/3CQKCUM5.js +0 -2
  240. package/dist/cdn/3EYB5GQX.js +0 -2
  241. package/dist/cdn/3LEQ37YT.js +0 -68
  242. package/dist/cdn/46BUEBWS.js +0 -2
  243. package/dist/cdn/4AI52H7C.js +0 -2
  244. package/dist/cdn/4MUB6TL6.js +0 -2
  245. package/dist/cdn/4PRXQFCV.js +0 -2
  246. package/dist/cdn/4QFTKB6T.js +0 -2
  247. package/dist/cdn/4TSXFX3M.js +0 -2
  248. package/dist/cdn/5C5GHX4D.js +0 -2
  249. package/dist/cdn/5PPZNVWG.js +0 -2
  250. package/dist/cdn/66XWNGQ2.js +0 -2
  251. package/dist/cdn/6F4SJDRR.js +0 -2
  252. package/dist/cdn/6RZEXOK3.js +0 -2
  253. package/dist/cdn/A2SQ4EMZ.js +0 -2
  254. package/dist/cdn/AICPYLWE.js +0 -4
  255. package/dist/cdn/AJQT7UXB.js +0 -2
  256. package/dist/cdn/APSYZEPP.js +0 -209
  257. package/dist/cdn/AZOJHVAO.js +0 -2
  258. package/dist/cdn/BSTA5KI5.js +0 -2
  259. package/dist/cdn/CD5UWSCP.js +0 -2
  260. package/dist/cdn/CXXV6WJT.js +0 -2
  261. package/dist/cdn/DDBXEXOV.js +0 -2
  262. package/dist/cdn/DYO5P3F2.js +0 -2
  263. package/dist/cdn/E66BDC6N.js +0 -2
  264. package/dist/cdn/EEAVX4PP.js +0 -2
  265. package/dist/cdn/EITRZQSC.js +0 -2
  266. package/dist/cdn/EMJQI4MA.js +0 -2
  267. package/dist/cdn/FIBQAMJ3.js +0 -2
  268. package/dist/cdn/FIQZPIIK.js +0 -2
  269. package/dist/cdn/FNLBJ4ZQ.js +0 -2
  270. package/dist/cdn/FRE56NBG.js +0 -2
  271. package/dist/cdn/GSOBDGLK.js +0 -2
  272. package/dist/cdn/GUO7HKSP.js +0 -463
  273. package/dist/cdn/GX7U3727.js +0 -2
  274. package/dist/cdn/GXM3XY3J.js +0 -2
  275. package/dist/cdn/I273CANO.js +0 -2
  276. package/dist/cdn/I6NVKNZJ.js +0 -2
  277. package/dist/cdn/J5FKIZAM.js +0 -2
  278. package/dist/cdn/JL52W3Z4.js +0 -2
  279. package/dist/cdn/JOUR2FB2.js +0 -3
  280. package/dist/cdn/LISDTBEX.js +0 -2
  281. package/dist/cdn/LWFACY3F.js +0 -2
  282. package/dist/cdn/LYLQCBVX.js +0 -2
  283. package/dist/cdn/N4VOTJ25.js +0 -2
  284. package/dist/cdn/N5QLV56W.js +0 -2
  285. package/dist/cdn/NRMQDCM3.js +0 -2
  286. package/dist/cdn/OD5WXP7J.js +0 -2
  287. package/dist/cdn/OXPXXIWL.js +0 -2
  288. package/dist/cdn/PMRFXB4F.js +0 -2
  289. package/dist/cdn/PNIFJ5DQ.js +0 -2
  290. package/dist/cdn/PZDI5ZDC.js +0 -2
  291. package/dist/cdn/RVYSVTPQ.js +0 -2
  292. package/dist/cdn/SVROAT3Z.js +0 -2
  293. package/dist/cdn/TBZXKKGP.js +0 -2
  294. package/dist/cdn/TNUCSWBN.js +0 -2
  295. package/dist/cdn/TOICLGFK.js +0 -2
  296. package/dist/cdn/TOTWYGB3.js +0 -2
  297. package/dist/cdn/TUUUK3VX.js +0 -2
  298. package/dist/cdn/U3KMGSVH.js +0 -2
  299. package/dist/cdn/WC3FPLYQ.js +0 -2
  300. package/dist/cdn/XYMBRPC7.js +0 -2
  301. package/dist/cdn/YTODQCOG.js +0 -2
  302. package/dist/cdn/YYTEJVBL.js +0 -2
  303. package/dist/cdn/ZDDN7UKS.js +0 -2
  304. package/dist/chunks/functional.js +0 -9
  305. package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +0 -45
  306. /package/dist/cdn/{OUMTV5H5.js → KHKREBVZ.js} +0 -0
  307. /package/dist/components/arcgis-portal-ai-assistant/{agents/types.d.ts → types/navigation.d.ts} +0 -0
  308. /package/dist/components/arcgis-portal-ai-assistant/{agents → types}/portalRouteKeys.d.ts +0 -0
@@ -1,52 +1,56 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as B } from "../../chunks/runtime.js";
3
- import { LitElement as x, createEvent as y, nothing as _ } from "@arcgis/lumina";
4
- import { css as T, html as d } from "lit";
5
- import b from "@arcgis/core/request.js";
6
- import { c as C } from "../../chunks/functional.js";
7
- import D from "@arcgis/core/portal/PortalItem.js";
2
+ import { c as H } from "../../chunks/runtime.js";
3
+ import b from "@arcgis/core/portal/PortalItem.js";
4
+ import { LitElement as q, createEvent as v, safeClassMap as S, nothing as N } from "@arcgis/lumina";
5
+ import { css as W, html as d } from "lit";
6
+ import { createRef as z, ref as B } from "lit/directives/ref.js";
7
+ import w from "@arcgis/core/request.js";
8
+ import { c as j } from "../../chunks/item.js";
8
9
  import { r as $ } from "../../chunks/request.js";
10
+ import { i as I } from "../../chunks/item2.js";
9
11
  import "../arcgis-portal-review-related-items/customElement.js";
10
- import { f as U } from "../../chunks/portal-delete-items-review.js";
11
- import { a as I } from "../../chunks/item2.js";
12
- import { u as A } from "../../chunks/useT9n.js";
13
- import { b as P } from "../../chunks/url.js";
14
- async function M(s, e, t = !1) {
12
+ import { f as x } from "../../chunks/portal-delete-items-review.js";
13
+ import { u as R } from "../../chunks/useT9n.js";
14
+ import { makeController as G } from "@arcgis/lumina/controllers";
15
+ import { g as V, a as C } from "../../chunks/portal.js";
16
+ import { g as K } from "../../chunks/items.js";
17
+ import { g as J } from "../../chunks/url.js";
18
+ async function _(n, t, e = !1) {
15
19
  try {
16
- const n = /* @__PURE__ */ new Map();
17
- for (const r of s) {
18
- const { id: l, owner: c } = r, o = n.get(c) ?? [];
19
- o.push(l), n.set(c, o);
20
+ const s = /* @__PURE__ */ new Map();
21
+ for (const l of n) {
22
+ const { id: c, owner: a } = l, o = s.get(a) ?? [];
23
+ o.push(c), s.set(a, o);
20
24
  }
21
25
  const i = [];
22
- for (const [r, l] of n) {
23
- const c = `${e.restUrl}/content/users/${encodeURIComponent(r)}/deleteItems`;
24
- for (const o of C(l, 100)) {
25
- const m = b(c, {
26
+ for (const [l, c] of s) {
27
+ const a = `${t.restUrl}/content/users/${encodeURIComponent(l)}/deleteItems`;
28
+ for (const o of j(c, 100)) {
29
+ const m = w(a, {
26
30
  method: "post",
27
31
  query: {
28
32
  f: "json",
29
33
  items: o.join(","),
30
- permanentDelete: t
34
+ permanentDelete: e
31
35
  }
32
36
  });
33
- i.push(m.then(({ data: f }) => f));
37
+ i.push(m.then(({ data: h }) => h));
34
38
  }
35
39
  }
36
- return { result: (await Promise.all(i)).flatMap(({ results: r }) => r) };
40
+ return { result: (await Promise.all(i)).flatMap(({ results: l }) => l) };
37
41
  } catch {
38
42
  return { error: { code: "unhandledError" } };
39
43
  }
40
44
  }
41
- async function w(s) {
42
- const { item: e, portal: t, permanentlyDelete: n } = s, { id: i, owner: a } = e;
43
- if (!i || !a)
45
+ async function T(n) {
46
+ const { item: t, portal: e, permanentlyDelete: s } = n, { id: i, owner: r } = t;
47
+ if (!i || !r)
44
48
  return { error: { code: "unhandledError" } };
45
- const r = t.recycleBinEnabled && !n ? "/canRecycle" : "/canDelete", l = `${t.restUrl}/content/users/${encodeURIComponent(a)}/items/${i}${r}`;
49
+ const l = e.recycleBinEnabled && !s ? "/canRecycle" : "/canDelete", c = `${e.restUrl}/content/users/${encodeURIComponent(r)}/items/${i}${l}`;
46
50
  try {
47
- return { result: (await b(l, { query: { f: "json" } })).data };
48
- } catch (c) {
49
- const o = c.details?.raw;
51
+ return { result: (await w(c, { query: { f: "json" } })).data };
52
+ } catch (a) {
53
+ const o = a.details?.raw;
50
54
  switch (o?.messageCode) {
51
55
  case "CONT_00481":
52
56
  case "CONT_00483":
@@ -54,391 +58,490 @@ async function w(s) {
54
58
  return { error: { code: "itemHasDependentItems" } };
55
59
  case "CONT_0048":
56
60
  return { error: { code: "itemDeleteProtected" } };
61
+ case "CONT_0298":
62
+ return { error: { code: "itemNotSupportedInRecycleBin" } };
57
63
  default:
58
64
  return { error: { code: "unhandledError", message: o?.message } };
59
65
  }
60
66
  }
61
67
  }
62
- function R(s, e) {
63
- return (s.relatedItems ?? []).map((t) => F(t, e));
68
+ async function Q(n, t) {
69
+ try {
70
+ const e = `${n.itemUrl}/setContentStatus`;
71
+ return { result: (await w(e, { query: { status: t ?? "", clearEmptyFields: !t, f: "json" }, method: "post" })).data };
72
+ } catch (e) {
73
+ return console.error(e), { error: { code: "unhandledError" } };
74
+ }
64
75
  }
65
- function F(s, e) {
66
- return s instanceof D ? s : new D({ ...s, portal: e });
76
+ function U(n, t) {
77
+ return (n.relatedItems ?? []).map((e) => X(e, t));
78
+ }
79
+ function X(n, t) {
80
+ return n instanceof b ? n : new b({ ...n, portal: t });
67
81
  }
68
82
  async function g({
69
- itemId: s,
70
- portal: e,
71
- relationship: t,
72
- includeRecycleBin: n,
83
+ itemId: n,
84
+ portal: t,
85
+ relationship: e,
86
+ includeRecycleBin: s,
73
87
  nextkey: i
74
88
  }) {
75
- const { relationshipType: a, direction: r } = t, l = `${e.restUrl}/content/items/${s}/relatedItems`;
89
+ const { relationshipType: r, direction: l } = e, c = `${t.restUrl}/content/items/${n}/relatedItems`;
76
90
  try {
77
- const c = await $({
78
- url: l,
79
- portal: e,
91
+ const a = await $({
92
+ url: c,
93
+ portal: t,
80
94
  params: {
81
- includeRecycleBin: n,
95
+ includeRecycleBin: s,
82
96
  f: "json",
83
- relationshipType: a ? Array.isArray(a) ? a.join(",") : a : void 0,
84
- direction: r,
97
+ relationshipType: r ? Array.isArray(r) ? r.join(",") : r : void 0,
98
+ direction: l,
85
99
  nextkey: i
86
100
  }
87
101
  });
88
102
  return {
89
103
  success: !0,
90
- result: { ...c, relatedItems: R(c, e) }
104
+ result: { ...a, relatedItems: U(a, t) }
91
105
  };
92
- } catch (c) {
93
- return { success: !1, error: c };
106
+ } catch (a) {
107
+ return { success: !1, error: a };
94
108
  }
95
109
  }
96
- async function L({
97
- itemId: s,
98
- portal: e,
99
- relationship: t,
100
- includeRecycleBin: n,
110
+ async function Y({
111
+ itemId: n,
112
+ portal: t,
113
+ relationship: e,
114
+ includeRecycleBin: s,
101
115
  num: i,
102
- nextkey: a
116
+ nextkey: r
103
117
  }) {
104
- const { relationshipRules: r, direction: l } = t, c = `${e.restUrl}/content/items/${s}/relatedItems`;
118
+ const { relationshipRules: l, direction: c } = e, a = `${t.restUrl}/content/items/${n}/relatedItems`;
105
119
  try {
106
120
  const o = await $({
107
- url: c,
108
- portal: e,
121
+ url: a,
122
+ portal: t,
109
123
  params: {
110
- includeRecycleBin: n,
124
+ includeRecycleBin: s,
111
125
  f: "json",
112
- ...r?.length ? { relationshipRules: r.join(",") } : {},
126
+ ...l?.length ? { relationshipRules: l.join(",") } : {},
113
127
  includeSystemManaged: "true",
114
128
  excludedFlags: "legacy,exclude",
115
129
  num: i,
116
- direction: l,
117
- nextkey: a
130
+ direction: c,
131
+ nextkey: r
118
132
  }
119
133
  });
120
134
  return {
121
135
  success: !0,
122
- result: { ...o, relatedItems: R(o, e) }
136
+ result: { ...o, relatedItems: U(o, t) }
123
137
  };
124
138
  } catch (o) {
125
139
  return { success: !1, error: o };
126
140
  }
127
141
  }
128
- async function E(s, e) {
129
- const { id: t, type: n, typeKeywords: i = [] } = s;
130
- if (!t)
142
+ async function Z(n, t) {
143
+ const { id: e, type: s, typeKeywords: i = [] } = n;
144
+ if (!e)
131
145
  return null;
132
- const a = [
146
+ const r = [
133
147
  "Scene Service",
134
148
  "Map Service",
135
149
  "WFS",
136
150
  "OGCFeatureServer",
137
151
  "Vector Tile Service",
138
152
  "3DTiles Service"
139
- ].includes(n), r = ["Map Service", "Vector Tile Service"].includes(n), l = (o) => o?.typeKeywords?.includes("View Service") ?? !1, c = () => a ? [
153
+ ].includes(s), l = ["Map Service", "Vector Tile Service"].includes(s), c = (o) => o?.typeKeywords?.includes("View Service") ?? !1, a = () => r ? [
140
154
  { relationshipType: ["Service2Service"], direction: "reverse" },
141
155
  { relationshipType: ["Service2Data"], direction: "forward" }
142
- ] : i.includes("Bulk Published Service") ? { relationshipType: ["DataStore2BPService"], direction: "reverse" } : n === "Geoprocessing Service" && i.includes("Notebook Web Tool") ? { relationshipType: ["Notebook2WebTool"], direction: "reverse" } : i.includes("Route Layer") ? { relationshipType: ["Service2Route"], direction: "reverse" } : n === "Mobile Application" ? { relationshipType: ["MobileApp2Code"], direction: "reverse" } : n === "Map Package" ? { relationshipType: ["Area2Package"], direction: "reverse" } : n === "Feature Service" ? { relationshipType: ["Service2Layer"], direction: "reverse" } : i.includes("Document") ? { relationshipType: ["Item2Attachment"], direction: "reverse" } : n === "Application Configuration" ? { relationshipType: ["Map2AppConfig"], direction: "reverse" } : { relationshipType: ["Service2Data"], direction: "forward" };
156
+ ] : i.includes("Bulk Published Service") ? { relationshipType: ["DataStore2BPService"], direction: "reverse" } : s === "Geoprocessing Service" && i.includes("Notebook Web Tool") ? { relationshipType: ["Notebook2WebTool"], direction: "reverse" } : i.includes("Route Layer") ? { relationshipType: ["Service2Route"], direction: "reverse" } : s === "Mobile Application" ? { relationshipType: ["MobileApp2Code"], direction: "reverse" } : s === "Map Package" ? { relationshipType: ["Area2Package"], direction: "reverse" } : s === "Feature Service" ? { relationshipType: ["Service2Layer"], direction: "reverse" } : i.includes("Document") ? { relationshipType: ["Item2Attachment"], direction: "reverse" } : s === "Application Configuration" ? { relationshipType: ["Map2AppConfig"], direction: "reverse" } : { relationshipType: ["Service2Data"], direction: "forward" };
143
157
  try {
144
- const o = c();
158
+ const o = a();
145
159
  if (!o)
146
160
  return null;
147
161
  if (!Array.isArray(o))
148
162
  return {
149
163
  sourceData: (await g({
150
- itemId: t,
151
- portal: e,
164
+ itemId: e,
165
+ portal: t,
152
166
  relationship: o
153
167
  })).result?.relatedItems?.[0] ?? null,
154
168
  relationship: o
155
169
  };
156
- if (a) {
170
+ if (r) {
157
171
  let m = { relationshipType: ["Service2Service"], direction: "reverse" };
158
- const f = await g({
159
- itemId: t,
160
- portal: e,
172
+ const h = await g({
173
+ itemId: e,
174
+ portal: t,
161
175
  relationship: m
162
- }), p = f.result?.total ? f.result.relatedItems.shift() ?? null : null;
163
- if (r && !l(p) || !p) {
176
+ }), u = h.result?.total ? h.result.relatedItems.shift() ?? null : null;
177
+ if (l && !c(u) || !u) {
164
178
  m = { relationshipType: ["Service2Data"], direction: "forward" };
165
- const v = await g({
166
- itemId: t,
167
- portal: e,
179
+ const y = await g({
180
+ itemId: e,
181
+ portal: t,
168
182
  relationship: m
169
183
  });
170
184
  return {
171
- sourceData: v.result?.total ? v.result.relatedItems.shift() ?? p : p,
185
+ sourceData: y.result?.total ? y.result.relatedItems.shift() ?? u : u,
172
186
  relationship: m
173
187
  };
174
188
  }
175
- return { sourceData: p, relationship: m };
189
+ return { sourceData: u, relationship: m };
176
190
  }
177
191
  return null;
178
192
  } catch (o) {
179
193
  return console.error(o), { sourceData: null, relationship: { direction: "forward" } };
180
194
  }
181
195
  }
182
- async function H(s, e) {
183
- const { id: t, type: n, typeKeywords: i = [] } = s;
196
+ async function ee(n, t) {
197
+ const { id: e, type: s, typeKeywords: i = [] } = n;
184
198
  try {
185
- const r = n === "Notebook" ? { relationshipType: ["Notebook2WebTool"], direction: "forward" } : i.includes("Has Related Route Layers") ? { relationshipType: ["Service2Route"], direction: "forward" } : i.includes("Hosted Service") || n === "Feature Service" ? { relationshipType: ["Service2Service"], direction: n === "Feed" ? "reverse" : "forward" } : n === "Data Store" || i.includes("ArcGIS Server") ? { relationshipType: ["DataStore2BPService"], direction: "forward" } : { relationshipType: ["Service2Data"], direction: "reverse" }, l = await g({
186
- itemId: t,
187
- portal: e,
188
- relationship: r
199
+ const l = s === "Notebook" ? { relationshipType: ["Notebook2WebTool"], direction: "forward" } : i.includes("Has Related Route Layers") ? { relationshipType: ["Service2Route"], direction: "forward" } : i.includes("Hosted Service") || s === "Feature Service" ? { relationshipType: ["Service2Service"], direction: s === "Feed" ? "reverse" : "forward" } : s === "Data Store" || i.includes("ArcGIS Server") ? { relationshipType: ["DataStore2BPService"], direction: "forward" } : { relationshipType: ["Service2Data"], direction: "reverse" }, c = await g({
200
+ itemId: e,
201
+ portal: t,
202
+ relationship: l,
203
+ includeRecycleBin: !0
189
204
  });
190
205
  return {
191
206
  resultData: {
192
- items: l.result?.total ? l.result.relatedItems : null,
193
- count: l.result?.total ?? 0
207
+ items: c.result?.total ? c.result.relatedItems : null,
208
+ count: c.result?.total ?? 0
194
209
  },
195
- relationship: r
210
+ relationship: l
196
211
  };
197
- } catch (a) {
198
- return console.error(a), {
212
+ } catch (r) {
213
+ return console.error(r), {
199
214
  resultData: { items: null, count: 0 },
200
215
  relationship: { direction: "forward" }
201
216
  };
202
217
  }
203
218
  }
204
- async function N(s, e) {
205
- const { id: t } = s;
219
+ async function te(n, t) {
220
+ const { id: e } = n;
206
221
  try {
207
222
  return (await g({
208
- itemId: t,
209
- portal: e,
223
+ itemId: e,
224
+ portal: t,
210
225
  relationship: { relationshipType: ["ReplacementItem2Item"], direction: "forward" }
211
226
  })).result?.relatedItems ?? [];
212
- } catch (n) {
213
- return console.error(n), [];
227
+ } catch (s) {
228
+ return console.error(s), [];
214
229
  }
215
230
  }
216
- function k(s) {
217
- return !!(s && "inRecycleBin" in s && s.inRecycleBin === !0);
231
+ function se({
232
+ recycleItems: n,
233
+ cannotDeleteItems: t,
234
+ permanentlyDeleteItems: e
235
+ }) {
236
+ return [...n, ...t, ...e];
237
+ }
238
+ function ne(n) {
239
+ return n.map(({ item: t, sourceData: e, resultData: s, replacementItemFor: i }) => ({
240
+ item: t,
241
+ sourceData: e,
242
+ resultData: s,
243
+ replacementItemFor: i
244
+ }));
245
+ }
246
+ function L(n, t, e) {
247
+ return !t && !!e?.length && !I(n);
248
+ }
249
+ function ie({ item: n, sourceData: t, resultData: e }) {
250
+ return !e?.some((s) => !s.inRecycleBin) || L(n, t, e) ? !1 : !O(n, e) && !F(n, e);
251
+ }
252
+ function re({
253
+ selectedItems: n
254
+ }) {
255
+ const t = [];
256
+ return t.push(
257
+ ...n.flatMap(({ item: e, sourceData: s, resultData: i, replacementItemFor: r }) => {
258
+ const l = L(e, s, i), c = !!(i?.some((a) => !a.inRecycleBin) && !O(e, i) && !F(e, i));
259
+ return l && c ? [{ item: e, reason: "dependent", offendingItems: i ?? void 0 }] : r && r?.length > 0 ? [{ item: e, reason: "replacement", offendingItems: r }] : [];
260
+ })
261
+ ), t;
262
+ }
263
+ function O(n, t) {
264
+ const e = t[0];
265
+ return n.type === "Feed" && I(n) && t.length === 1 && e?.type === "Feature Service" && I(e);
266
+ }
267
+ function F(n, t) {
268
+ const e = t[0];
269
+ return n.type === "Feature Service" && I(n) && t.length === 1 && e?.type === "Feed" && I(e);
270
+ }
271
+ const E = ["Code Attachment", "Map Area"];
272
+ function k(n) {
273
+ return n ? n.filter((t) => !E.includes(t.type ?? "")) : null;
218
274
  }
219
- function u(s) {
220
- return s.updatedStatus ?? s.kind;
275
+ function A(n) {
276
+ return !!(n && "inRecycleBin" in n && n.inRecycleBin === !0);
221
277
  }
222
- function h(s) {
223
- return { ...s, originalStatus: s.originalStatus ?? s.kind };
278
+ function p(n) {
279
+ return n.updatedStatus ?? n.kind;
224
280
  }
225
- function W(s, e) {
281
+ function D(n) {
282
+ return { ...n, originalStatus: n.originalStatus ?? n.kind };
283
+ }
284
+ function ae(n, t) {
226
285
  return {
227
- ...s,
228
- kind: e,
229
- originalStatus: s.originalStatus ?? s.kind
286
+ ...n,
287
+ kind: t,
288
+ originalStatus: n.originalStatus ?? n.kind
230
289
  };
231
290
  }
232
- async function q(s, e) {
233
- const t = await L({
234
- itemId: s.id,
235
- portal: e,
236
- relationship: { direction: "forward" }
237
- }), n = await E(s, e), i = await H(s, e), a = await N(s, e), r = {
238
- usedByItems: t.result?.relatedItems ?? [],
239
- sourceData: n?.sourceData ?? null,
240
- resultData: i.resultData.items,
241
- replacementItemFor: a.length ? a : null
242
- }, { result: l, error: c } = await w({
243
- item: s,
244
- portal: e,
245
- permanentlyDelete: !1
246
- });
247
- if (c)
248
- switch (c.code) {
249
- case "itemHasDependentItems":
250
- return h({
251
- item: s,
252
- ...r,
253
- kind: "cannotDelete",
254
- reason: "hasDependentItems"
255
- });
256
- case "itemDeleteProtected":
257
- return h({
258
- item: s,
259
- ...r,
260
- kind: "cannotDelete",
261
- reason: "deleteProtected"
262
- });
263
- default:
264
- return h({
265
- item: s,
266
- ...r,
267
- kind: "cannotDelete",
268
- reason: "uncaught"
269
- });
270
- }
271
- if (!l?.success) {
272
- const { result: o } = await w({
273
- item: s,
274
- portal: e,
275
- permanentlyDelete: !0
276
- });
277
- return o?.success ? h({
278
- item: s,
279
- ...r,
280
- kind: "permanentlyDelete",
281
- reason: "notSupported"
282
- }) : h({
283
- item: s,
284
- ...r,
285
- kind: "cannotDelete",
286
- reason: "uncaught"
287
- });
291
+ async function le(n, t) {
292
+ const e = await T({ item: n, portal: t, permanentlyDelete: !1 });
293
+ if (e.error && e.error.code !== "itemNotSupportedInRecycleBin")
294
+ return { kind: "cannotDelete", errorCode: e.error.code };
295
+ if (e.result?.success)
296
+ return { kind: "recycle" };
297
+ const s = await T({ item: n, portal: t, permanentlyDelete: !0 });
298
+ return s.result?.success ? { kind: "permanentlyDelete" } : { kind: "cannotDelete", errorCode: s.error?.code ?? "unhandledError" };
299
+ }
300
+ function ce(n) {
301
+ switch (n) {
302
+ case "itemHasDependentItems":
303
+ return "hasDependentItems";
304
+ case "itemDeleteProtected":
305
+ return "deleteProtected";
306
+ default:
307
+ return "uncaught";
288
308
  }
289
- return h({ item: s, ...r, kind: "recycle" });
290
309
  }
291
- async function O(s, e) {
292
- const t = await Promise.all(s.map(async (n) => await q(n, e)));
293
- return j(t);
310
+ async function oe(n, t) {
311
+ const e = await Y({
312
+ itemId: n.id,
313
+ portal: t,
314
+ relationship: { direction: "forward" }
315
+ }), s = await Z(n, t), i = await ee(n, t), r = await te(n, t), l = e.result?.relatedItems ?? [], c = k(l) ?? [], a = e.result?.aggregations?.total?.count, o = k(i.resultData.items), m = k(r), h = s?.sourceData, u = {
316
+ usedByItems: c,
317
+ usedByItemsCount: a == null ? c.length : Math.max(0, a - (l.length - c.length)),
318
+ sourceData: E.includes(h?.type ?? "") ? null : h ?? null,
319
+ resultData: o,
320
+ replacementItemFor: m?.length ? m : null
321
+ }, y = ie({ item: n, ...u }), f = await le(n, t);
322
+ return f.kind === "cannotDelete" ? D({
323
+ item: n,
324
+ ...u,
325
+ kind: "cannotDelete",
326
+ reason: ce(f.errorCode)
327
+ }) : y ? D({
328
+ item: n,
329
+ ...u,
330
+ kind: "cannotDelete",
331
+ reason: "hasDependentItems"
332
+ }) : f.kind === "permanentlyDelete" ? D({
333
+ item: n,
334
+ ...u,
335
+ kind: "permanentlyDelete",
336
+ reason: "notSupported"
337
+ }) : D({ item: n, ...u, kind: f.kind });
294
338
  }
295
- function j(s) {
296
- const e = /* @__PURE__ */ new Map();
297
- for (const t of s)
298
- t.item.id && e.set(t.item.id, t);
299
- return s.map((t) => {
300
- if (t.kind !== "cannotDelete" || t.reason !== "hasDependentItems" || !t.item.id)
301
- return t;
302
- const i = z(t.resultData, e);
339
+ async function de(n, t) {
340
+ const e = await Promise.all(n.map(async (s) => await oe(s, t)));
341
+ return me(e);
342
+ }
343
+ function me(n) {
344
+ const t = /* @__PURE__ */ new Map();
345
+ for (const e of n)
346
+ e.item.id && t.set(e.item.id, e);
347
+ return n.map((e) => {
348
+ if (e.kind !== "cannotDelete" || e.reason !== "hasDependentItems" || !e.item.id)
349
+ return e;
350
+ const i = ue(e.resultData, t);
303
351
  if (i.length === 0)
304
- return t;
305
- const a = i.every((l) => e.has(l)), r = i.every((l) => !e.get(l)?.item.protected);
306
- return a && r ? W(t, "recycle") : t;
352
+ return e;
353
+ const r = i.every((c) => t.has(c)), l = i.every((c) => !t.get(c)?.item.protected);
354
+ return r && l ? ae(e, "recycle") : e;
307
355
  });
308
356
  }
309
- function z(s, e, t = /* @__PURE__ */ new Set()) {
310
- if (!s?.length)
357
+ function ue(n, t, e = /* @__PURE__ */ new Set()) {
358
+ if (!n?.length)
311
359
  return [];
312
- const n = s.filter((a) => !k(a)), i = /* @__PURE__ */ new Set();
313
- for (; n.length > 0; ) {
314
- const r = n.shift().id;
315
- if (!r || t.has(r))
360
+ const s = n.filter((r) => !A(r)), i = /* @__PURE__ */ new Set();
361
+ for (; s.length > 0; ) {
362
+ const l = s.shift().id;
363
+ if (!l || e.has(l))
316
364
  continue;
317
- t.add(r), i.add(r);
318
- const c = e.get(r)?.resultData ?? [];
319
- n.push(...c.filter((o) => !k(o)));
365
+ e.add(l), i.add(l);
366
+ const a = t.get(l)?.resultData ?? [];
367
+ s.push(...a.filter((o) => !A(o)));
320
368
  }
321
369
  return [...i];
322
370
  }
323
- const G = T`:host{display:block}calcite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: var(--calcite-color-background)}calcite-panel{display:flex;flex-direction:column;gap:.75rem;>*{margin-inline:.75rem}}.panel__content{width:100%;box-sizing:border-box}.bucket__content{display:flex;align-items:flex-start;gap:.75rem;width:100%}.bucket__icon{flex-shrink:0}.bucket__details{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.bucket__header{font-weight:500}.bucket__label{margin-inline-end:.25rem}.bucket__description{line-height:1.35;font-size:var(--calcite-font-size--1)}.bucket__link{display:flex;align-items:center;min-height:1.5rem}.panel__checkbox{width:100%;padding-block:.75rem;padding-inline-start:.75rem;background-color:var(--calcite-color-foreground-1)}.panel__related-items{margin-top:1rem;border:1px solid var(--calcite-color-border-2)}.panel__related-items-icon{color:var(--calcite-color-status-warning)}.panel__related-items-notice{padding-bottom:.75rem}arcgis-portal-review-related-items{margin-bottom:.75rem}.discouraged-items-warning{margin-bottom:.75rem}.header-description{font-size:var(--calcite-font-size--1);font-weight:400}`;
324
- function V({
325
- recycleItems: s,
326
- cannotDeleteItems: e,
327
- permanentlyDeleteItems: t
328
- }) {
329
- return [...s, ...e, ...t];
330
- }
331
- function K(s) {
332
- return s.map(({ item: e, sourceData: t, resultData: n, replacementItemFor: i }) => ({
333
- item: e,
334
- sourceData: t,
335
- resultData: n,
336
- replacementItemFor: i
337
- }));
338
- }
339
- function J(s, e, t) {
340
- return !e && !!t?.length && !I(s);
341
- }
342
- function Q({
343
- selectedItems: s
344
- }) {
345
- const e = [];
346
- return e.push(
347
- ...s.flatMap(({ item: t, sourceData: n, resultData: i, replacementItemFor: a }) => {
348
- const r = J(t, n, i), l = !!(i?.some((c) => !c.inRecycleBin) && !X(t, i) && !Y(t, i));
349
- return r && l ? [{ item: t, reason: "dependent", offendingItems: i ?? void 0 }] : a && a?.length > 0 ? [{ item: t, reason: "replacement", offendingItems: a }] : [];
350
- })
351
- ), e;
352
- }
353
- function X(s, e) {
354
- const t = e[0];
355
- return s.type === "Feed" && I(s) && e.length === 1 && t?.type === "Feature Service" && I(t);
356
- }
357
- function Y(s, e) {
358
- const t = e[0];
359
- return s.type === "Feature Service" && I(s) && e.length === 1 && t?.type === "Feed" && I(t);
371
+ const he = W`:host{display:block}calcite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: var(--calcite-color-background)}calcite-panel{display:flex;flex-direction:column;gap:.75rem;>*{margin-inline:.75rem}}.panel__content{width:100%;box-sizing:border-box}.single-item-bucket{--calcite-block-background-color: transparent;--calcite-block-border-color: transparent}.bucket__content{display:flex;align-items:flex-start;gap:.75rem;width:100%}.bucket__icon{flex-shrink:0}.bucket__icon--danger{color:var(--calcite-color-status-danger)}.bucket__details{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.bucket__header{font-weight:500}.bucket__label{margin-inline-end:.25rem}.bucket__checkbox{align-self:flex-start;margin-top:.5rem}.bucket__description{line-height:1.35;font-size:var(--calcite-font-size--1)}.bucket__link{display:flex;align-items:center;min-height:1.5rem}.item-link-content{position:relative;>arcgis-portal-item-type{margin-inline-end:.25rem;vertical-align:middle}}.panel__checkbox-container{width:100%;box-sizing:border-box;background-color:var(--calcite-color-foreground-1)}.panel__checkbox{padding-block:.75rem;padding-inline-start:.75rem}.panel__related-items{margin-top:1rem;border:1px solid var(--calcite-color-border-2)}.panel__related-items-icon{color:var(--calcite-color-status-warning)}.panel__related-items-notice{padding-bottom:.75rem}arcgis-portal-review-related-items{margin-bottom:.75rem}calcite-list{overflow:auto;min-block-size:0;max-height:min(250px,75vh)}.discouraged-items-warning{margin-bottom:.75rem}.header-description{font-size:var(--calcite-font-size--1);font-weight:400}`, P = /* @__PURE__ */ new Map();
372
+ async function pe(n, t) {
373
+ const e = V(n), s = JSON.stringify([e, t]), i = P.get(s);
374
+ if (i)
375
+ return i;
376
+ try {
377
+ const l = (await $({
378
+ url: `${e}portals/helpmap`,
379
+ portal: n,
380
+ params: { culture: t }
381
+ }))?.helpMap?.m ?? {};
382
+ return P.set(s, l), l;
383
+ } catch {
384
+ return {};
385
+ }
360
386
  }
361
- function S({ id: s, linkText: e, label: t, placement: n, items: i, portal: a, user: r }) {
362
- return d`<calcite-link id=${s ?? _}>${e}</calcite-link><calcite-popover .label=${t} .referenceElement=${s} .placement=${n} auto-close><calcite-list .label=${t} selection-mode=none>${i.map((l) => d`<calcite-list-item .label=${l.title ?? ""} @calciteListItemSelect=${() => {
363
- const c = l.itemPageUrl;
364
- c && window.open(c.replace("sharing/rest/", ""), "_blank", "noopener,noreferrer");
365
- }}><span slot=content-start><arcgis-portal-item-type .item=${l} .portal=${a} .user=${r} hide-text></arcgis-portal-item-type></span><span slot=content>${l.title}</span></calcite-list-item>`)}</calcite-list></calcite-popover>`;
387
+ const ge = (n) => G((t, e) => {
388
+ let s, i;
389
+ return e.onUpdate(() => {
390
+ const r = n.portal(), l = n.language(), c = r?.restUrl;
391
+ c === s && l === i || (s = c, i = l, e.exports = {}, !(!r || !c || !l) && pe(r, l).then((a) => {
392
+ e.exports = a;
393
+ }));
394
+ }), {};
395
+ });
396
+ function M({ id: n, linkText: t, label: e, placement: s, items: i, portal: r, user: l }) {
397
+ return d`<calcite-link id=${n ?? N} @keydown=${(c) => {
398
+ if (c.key === " " || c.key === "Enter") {
399
+ const a = c.currentTarget.nextElementSibling;
400
+ a && (a.open = !a.open);
401
+ }
402
+ }}>${t}</calcite-link><calcite-popover .label=${e} .referenceElement=${n} .placement=${s} auto-close focus-trap-disabled @keydown=${(c) => {
403
+ if (c.key === "Tab") {
404
+ const a = c.currentTarget;
405
+ requestAnimationFrame(() => {
406
+ a.open = !1;
407
+ });
408
+ }
409
+ }} @calcitePopoverOpen=${(c) => {
410
+ c.currentTarget.querySelector("calcite-list-item")?.setFocus();
411
+ }}><calcite-list .label=${e} selection-mode=none>${i.map((c) => d`<calcite-list-item .label=${c.title ?? ""} @calciteListItemSelect=${() => {
412
+ const a = c.itemPageUrl;
413
+ a && window.open(a.replace("sharing/rest/", ""), "_blank", "noopener,noreferrer");
414
+ }}><span slot=content-start><arcgis-portal-item-type .item=${c} .portal=${r} .user=${l} hide-text></arcgis-portal-item-type></span><span slot=content>${c.title}</span></calcite-list-item>`)}</calcite-list></calcite-popover>`;
366
415
  }
367
- class Z extends x {
416
+ class Ie extends q {
368
417
  constructor() {
369
- super(...arguments), this.deleteStatusRequestId = 0, this.updatedCannotDeleteItemIds = /* @__PURE__ */ new Set(), this.messages = A({ blocking: !0 }), this.isLoading = !0, this.hasConfirmedReview = !1, this.hasReviewedSelectedItems = !1, this.cannotDeleteItems = [], this.recycleItems = [], this.permanentlyDeleteItems = [], this.deprecateItems = [], this.excludeItems = [], this.reviewingDirectlyUsedByItems = !1, this.reviewDecision = null, this.active = !0, this.items = [], this.user = null, this.disableLinks = !1, this.arcgisCancel = y(), this.arcgisConfirm = y(), this.arcgisError = y();
418
+ super(...arguments), this.deleteStatusRequestId = 0, this.updatedCannotDeleteItemIds = /* @__PURE__ */ new Set(), this.permanentlyDeleteCheckboxRef = z(), this.messages = R({ blocking: !0 }), this.fieldDeleteMessages = R({ name: "portal-field-delete" }), this.helpMap = ge({
419
+ portal: () => this.portal,
420
+ language: () => this.messages._t9nLocale
421
+ }), this.isLoading = !0, this.submittingAction = null, this.loadedItems = [], this.hasConfirmedReview = !1, this.cannotDeleteItems = [], this.recycleItems = [], this.permanentlyDeleteItems = [], this.deprecateItems = [], this.excludeItems = [], this.reviewingDirectlyUsedByItems = !1, this.reviewDecision = null, this.active = !0, this.items = [], this.itemIds = [], this.user = null, this.disableLinks = !1, this.arcgisClose = v(), this.arcgisConfirm = v(), this.arcgisError = v();
370
422
  }
371
423
  static {
372
- this.properties = { isLoading: 16, hasConfirmedReview: 16, hasReviewedSelectedItems: 16, cannotDeleteItems: 16, recycleItems: 16, permanentlyDeleteItems: 16, deprecateItems: 16, excludeItems: 16, reviewingDirectlyUsedByItems: 16, reviewDecision: 16, active: 5, items: 0, portal: 0, user: 0, disableLinks: 5 };
424
+ this.properties = { isLoading: 16, submittingAction: 16, loadedItems: 16, hasConfirmedReview: 16, cannotDeleteItems: 16, recycleItems: 16, permanentlyDeleteItems: 16, deprecateItems: 16, excludeItems: 16, reviewingDirectlyUsedByItems: 16, reviewDecision: 16, active: 5, items: 0, itemIds: 0, portal: 0, user: 0, disableLinks: 5 };
373
425
  }
374
426
  static {
375
- this.styles = G;
376
- }
377
- willUpdate(e) {
378
- const t = e.has("items") || e.has("portal") || e.has("user") || e.has("active");
379
- this.active && t && (this.user ??= this.portal?.user || null, this.resetState(), this.determineDeleteStatus(++this.deleteStatusRequestId));
380
- }
381
- async handleReviewDecision(e) {
382
- const t = this.itemsWithImpactedItems.map(({ item: r }) => r), n = e === "delete" ? "recycle" : e === "deprecate" ? "deprecate" : "exclude", i = [...this.recycleItems, ...this.deprecateItems, ...this.excludeItems], a = e === "delete" && i.some((r) => u(r) !== "recycle" && t.some(({ id: l }) => l === r.item.id));
383
- for (const r of i) {
384
- if (!t.some(({ id: o }) => o === r.item.id))
427
+ this.styles = he;
428
+ }
429
+ willUpdate(t) {
430
+ const e = t.has("items") || t.has("itemIds") || t.has("portal") || t.has("user") || t.has("active");
431
+ this.active && e && (this.user ??= this.portal?.user || null, this.resetState(), this.initializeItems(++this.deleteStatusRequestId));
432
+ }
433
+ async initializeItems(t) {
434
+ const { items: e, itemIds: s, portal: i } = this, r = e.length ? e : await Promise.all(s.map(async (l) => await new b({ id: l, portal: i }).load()));
435
+ t === this.deleteStatusRequestId && (this.loadedItems = r, await this.determineDeleteStatus(t));
436
+ }
437
+ async handleReviewDecision(t) {
438
+ const e = this.itemsWithImpactedItems.map(({ item: a }) => a), s = t === "delete" ? "recycle" : t === "deprecate" ? "deprecate" : "exclude", i = this.permanentlyDeleteItems.filter((a) => this.isPermanentlyDeleteOverrideActive(a)), r = this.permanentlyDeleteItems.filter((a) => !this.isPermanentlyDeleteOverrideActive(a)), l = [
439
+ ...this.recycleItems,
440
+ ...this.deprecateItems,
441
+ ...this.excludeItems,
442
+ ...i
443
+ ], c = t === "delete" && l.some((a) => p(a) !== "recycle" && e.some(({ id: o }) => o === a.item.id));
444
+ for (const a of l) {
445
+ if (!e.some(({ id: h }) => h === a.item.id))
385
446
  continue;
386
- const c = r.originalStatus ?? r.kind;
387
- r.originalStatus = c, r.updatedStatus = n;
447
+ const m = a.originalStatus ?? a.kind;
448
+ a.originalStatus = m, a.updatedStatus = s;
388
449
  }
389
450
  if (this.reviewDecision = {
390
- action: e,
391
- items: t
392
- }, this.hasConfirmedReview = !0, this.reviewingDirectlyUsedByItems = !1, this.recycleItems = i.filter((r) => u(r) === "recycle"), this.deprecateItems = i.filter((r) => u(r) === "deprecate"), this.excludeItems = i.filter((r) => u(r) === "exclude"), e !== "delete" || a) {
451
+ action: t,
452
+ items: e
453
+ }, this.hasConfirmedReview = !0, this.reviewingDirectlyUsedByItems = !1, this.recycleItems = l.filter((a) => p(a) === "recycle"), this.deprecateItems = l.filter((a) => p(a) === "deprecate"), this.excludeItems = l.filter((a) => p(a) === "exclude"), this.permanentlyDeleteItems = r, t !== "delete" || c) {
393
454
  this.isLoading = !0;
394
- const r = [...this.cannotDeleteItems, ...this.recycleItems, ...this.permanentlyDeleteItems].map(({ item: l }) => l);
395
- await this.determineDeleteStatus(++this.deleteStatusRequestId, r);
455
+ const a = [...this.cannotDeleteItems, ...this.recycleItems, ...this.permanentlyDeleteItems].map(({ item: o }) => o);
456
+ await this.determineDeleteStatus(++this.deleteStatusRequestId, a);
396
457
  }
397
458
  }
459
+ async updateAllContentStatus(t, e) {
460
+ return (await Promise.all(t.map(async (i) => await Q(i, e)))).flatMap(({ result: i }) => i ? [i] : []);
461
+ }
398
462
  async handleDelete() {
399
- const { result: e = [] } = await M(this.recycleItems.map(({ item: t }) => t), {
400
- restUrl: this.portal.restUrl
401
- });
402
- this.closeDialog(), this.arcgisConfirm.emit({
463
+ if (!this.active || this.submittingAction)
464
+ return;
465
+ this.submittingAction = "delete";
466
+ const t = { restUrl: this.portal.restUrl }, { result: e = [] } = this.recycleItems.length ? await _(this.recycleItems.map(({ item: r }) => r), t) : { result: [] }, { result: s = [] } = this.permanentlyDeleteItems.length ? await _(this.permanentlyDeleteItems.map(({ item: r }) => r), t, !0) : { result: [] }, i = this.deprecateItems.length ? await this.updateAllContentStatus(this.deprecateItems.map(({ item: r }) => r), "deprecated") : null;
467
+ this.arcgisConfirm.emit({
403
468
  deletedItems: e,
404
- permanentlyDeletedItems: [],
469
+ permanentlyDeletedItems: s,
405
470
  deletedItemsCount: e.length,
406
- permanentlyDeletedItemsCount: 0
407
- });
471
+ permanentlyDeletedItemsCount: s.length,
472
+ deprecatedItems: i
473
+ }), this.closeDialog();
474
+ }
475
+ async handleDeprecate() {
476
+ if (!this.active || this.submittingAction)
477
+ return;
478
+ this.submittingAction = "deprecate";
479
+ const t = [
480
+ ...this.deprecateItems,
481
+ ...this.recycleItems,
482
+ ...this.cannotDeleteItems,
483
+ ...this.permanentlyDeleteItems
484
+ ].filter(Boolean), e = t.length ? await this.updateAllContentStatus(t.map(({ item: s }) => s), "deprecated") : null;
485
+ this.arcgisConfirm.emit({
486
+ deletedItems: null,
487
+ permanentlyDeletedItems: null,
488
+ deletedItemsCount: 0,
489
+ permanentlyDeletedItemsCount: 0,
490
+ deprecatedItems: e
491
+ }), this.closeDialog();
408
492
  }
409
493
  handleDialogClose() {
410
- this.active && (this.closeDialog(), this.arcgisCancel.emit());
494
+ this.active && this.closeDialog();
411
495
  }
412
496
  closeDialog() {
413
- this.active = !1, this.resetState();
497
+ this.active = !1, this.resetState(), this.arcgisClose.emit();
414
498
  }
415
499
  resetState() {
416
- this.isLoading = !0, this.hasConfirmedReview = !1, this.hasReviewedSelectedItems = !1, this.cannotDeleteItems = [], this.recycleItems = [], this.permanentlyDeleteItems = [], this.deprecateItems = [], this.excludeItems = [], this.reviewingDirectlyUsedByItems = !1, this.reviewDecision = null, this.updatedCannotDeleteItemIds.clear(), ++this.deleteStatusRequestId;
417
- }
418
- async determineDeleteStatus(e, t = this.items) {
419
- const n = new Set(this.recycleItems.map(({ item: a }) => a.id).filter((a) => !!a)), i = await O(t, this.portal);
420
- if (e === this.deleteStatusRequestId) {
421
- this.cannotDeleteItems = i.filter((a) => u(a) === "cannotDelete");
422
- for (const a of this.cannotDeleteItems)
423
- a.item.id && n.has(a.item.id) && this.updatedCannotDeleteItemIds.add(a.item.id);
424
- this.recycleItems = i.filter((a) => u(a) === "recycle"), this.permanentlyDeleteItems = i.filter((a) => u(a) === "permanentlyDelete"), this.isLoading = !1;
500
+ this.isLoading = !0, this.submittingAction = null, this.loadedItems = [], this.hasConfirmedReview = !1, this.cannotDeleteItems = [], this.recycleItems = [], this.permanentlyDeleteItems = [], this.deprecateItems = [], this.excludeItems = [], this.reviewingDirectlyUsedByItems = !1, this.reviewDecision = null, this.updatedCannotDeleteItemIds.clear(), ++this.deleteStatusRequestId;
501
+ }
502
+ async determineDeleteStatus(t, e = this.loadedItems) {
503
+ const s = new Set(this.recycleItems.map(({ item: r }) => r.id).filter((r) => !!r)), i = await de(e, this.portal);
504
+ if (t === this.deleteStatusRequestId) {
505
+ this.cannotDeleteItems = i.filter((r) => p(r) === "cannotDelete");
506
+ for (const r of this.cannotDeleteItems)
507
+ r.item.id && s.has(r.item.id) && this.updatedCannotDeleteItemIds.add(r.item.id);
508
+ this.recycleItems = i.filter((r) => p(r) === "recycle"), this.permanentlyDeleteItems = i.filter((r) => p(r) === "permanentlyDelete"), this.isLoading = !1;
425
509
  }
426
510
  }
427
511
  get itemsWithImpactedItems() {
428
- const e = new Set(this.items.map(({ id: t }) => t));
429
- return [...this.recycleItems, ...this.deprecateItems, ...this.excludeItems].map((t) => ({
430
- ...t,
431
- usedByItems: t.usedByItems.filter(({ id: n }) => !e.has(n))
432
- })).filter(({ usedByItems: t }) => t.length > 0);
512
+ const t = new Set(this.loadedItems.map(({ id: e }) => e));
513
+ return [
514
+ ...this.recycleItems,
515
+ ...this.deprecateItems,
516
+ ...this.excludeItems,
517
+ ...this.permanentlyDeleteItems.filter((e) => this.isPermanentlyDeleteOverrideActive(e))
518
+ ].map((e) => ({
519
+ ...e,
520
+ usedByItems: e.usedByItems.filter(({ id: s }) => !t.has(s))
521
+ })).filter(({ usedByItems: e }) => e.length > 0);
433
522
  }
434
523
  get itemsHaveImpactedItems() {
435
524
  return this.itemsWithImpactedItems.length > 0;
436
525
  }
437
- get itemsNeedReview() {
438
- return this.itemsWithImpactedItems.some((e) => u(e) === "recycle");
439
- }
440
- get deleteButtonEnabled() {
441
- return !this.isLoading && (!this.itemsNeedReview || this.hasConfirmedReview);
526
+ isPermanentlyDeleteOverrideActive(t) {
527
+ return t.kind === "recycle" && t.updatedStatus === "permanentlyDelete";
528
+ }
529
+ async handlePermanentlyDeleteOverrideChange(t) {
530
+ if (t) {
531
+ const e = this.recycleItems.map((s) => ({
532
+ ...s,
533
+ originalStatus: s.originalStatus ?? s.kind,
534
+ updatedStatus: "permanentlyDelete"
535
+ }));
536
+ this.recycleItems = [], this.permanentlyDeleteItems = [...this.permanentlyDeleteItems, ...e];
537
+ } else {
538
+ const e = this.permanentlyDeleteItems.filter((s) => this.isPermanentlyDeleteOverrideActive(s));
539
+ this.permanentlyDeleteItems = this.permanentlyDeleteItems.filter((s) => !this.isPermanentlyDeleteOverrideActive(s)), this.recycleItems = [
540
+ ...this.recycleItems,
541
+ ...e.map((s) => ({ ...s, updatedStatus: "recycle" }))
542
+ ];
543
+ }
544
+ await this.updateComplete, await new Promise((e) => requestAnimationFrame(() => e())), await this.permanentlyDeleteCheckboxRef.value?.setFocus();
442
545
  }
443
546
  get markedForDeprecation() {
444
547
  return this.reviewDecision?.action === "deprecate" ? this.reviewDecision.items : [];
@@ -449,13 +552,13 @@ class Z extends x {
449
552
  this.deprecateItems,
450
553
  this.excludeItems,
451
554
  this.permanentlyDeleteItems
452
- ].filter((t) => t.length > 0).length > 1 ? "mixed" : this.markedForDeprecation.length > 0 ? "deprecate" : this.permanentlyDeleteItems.length > 0 ? "permanentlyDelete" : this.recycleItems.length > 0 ? "delete" : (this.cannotDeleteItems.length > 0, "none");
555
+ ].filter((e) => e.length > 0).length > 1 ? "mixed" : this.markedForDeprecation.length > 0 ? "deprecate" : this.permanentlyDeleteItems.length > 0 ? "permanentlyDelete" : this.recycleItems.length > 0 ? "delete" : (this.cannotDeleteItems.length > 0, "none");
453
556
  }
454
557
  getHeaderText() {
455
- return this.reviewingDirectlyUsedByItems ? this.messages.reviewItemsCount.replace("{count}", `${this.itemsWithImpactedItems.length}`) : this.items.length === 1 ? this.messages.deleteItem : this.messages.deleteItems;
558
+ return this.reviewingDirectlyUsedByItems ? this.messages.reviewItemsCount.replace("{count}", `${this.itemsWithImpactedItems.length}`) : this.isLoading ? "" : this.loadedItems.length > 0 && this.permanentlyDeleteItems.length === this.loadedItems.length ? this.messages.permanentlyDelete : (this.items.length ? this.items : this.itemIds).length === 1 ? this.messages.deleteItem : this.messages.deleteItems;
456
559
  }
457
560
  getHeaderDescription() {
458
- return this.items.length <= 1 ? "" : this.reviewingDirectlyUsedByItems ? this.messages.reviewItemsDescription : this.messages.selectedItems.replace("{count}", `${this.items.length}`);
561
+ return this.loadedItems.length <= 1 ? "" : this.reviewingDirectlyUsedByItems ? this.messages.reviewItemsDescription : this.messages.selectedItems.replace("{count}", `${this.loadedItems.length}`);
459
562
  }
460
563
  getConfirmButtonText() {
461
564
  switch (this.deleteMode) {
@@ -464,77 +567,81 @@ class Z extends x {
464
567
  case "deprecate":
465
568
  return this.messages.deprecate;
466
569
  case "permanentlyDelete":
467
- return this.messages.permanentlyDelete;
570
+ return this.portal.recycleBinEnabled ? this.messages.permanentlyDelete : this.messages.delete;
468
571
  case "delete":
469
572
  return this.messages.delete;
470
573
  default:
471
574
  return this.messages.delete;
472
575
  }
473
576
  }
474
- renderBucket({ icon: e, label: t, description: n, link: i, bucket: a, updated: r = !1 }) {
475
- return d`<calcite-block scale=l expanded><div class="bucket__content"><calcite-icon class="bucket__icon" scale=l .icon=${e}></calcite-icon><div class="bucket__details"><div class="bucket__header"><span class="bucket__label">${t}</span><span>${this.renderBucketItems(a)}</span></div><span class="bucket__description">${n}</span>${i && d`<div class="bucket__link"><calcite-link .href=${i.href} target=_blank icon-start=launch>${i.text ?? this.messages.moreInfo}</calcite-link></div>` || ""}</div>${r && d`<calcite-chip .label=${t}>Updated</calcite-chip>` || ""}</div></calcite-block>`;
577
+ renderBucket({ icon: t, label: e, description: s, link: i, additionalContent: r, dangerIcon: l = !1, bucket: c }) {
578
+ return d`<calcite-block class=${S({ "single-item-bucket": (this.items.length ? this.items : this.itemIds).length === 1 })} scale=l expanded><div class="bucket__content"><calcite-icon class=${S({ bucket__icon: !0, "bucket__icon--danger": l })} scale=l .icon=${t}></calcite-icon><div class="bucket__details"><div class="bucket__header"><span class="bucket__label">${e}</span><span>${this.renderBucketItems(c)}</span></div>${s && d`<span class="bucket__description">${s}</span>` || ""}${i && d`<div class="bucket__link"><calcite-link .href=${i.href} target=_blank icon-start=launch>${i.text ?? this.messages.moreInfo}</calcite-link></div>` || ""}${r}</div></div></calcite-block>`;
579
+ }
580
+ renderBucketItems(t = []) {
581
+ return this.renderItemLinks(t.map(({ item: e }) => e));
476
582
  }
477
- renderBucketItems(e = []) {
478
- if (e.length === 0)
583
+ renderItemLinks(t, e = `delete-items-bucket-${t.map(({ id: s }) => s).join("-")}`) {
584
+ if (t.length === 0)
479
585
  return null;
480
- if (e.length === 1) {
481
- const i = e[0].item, a = P({ portal: this.portal });
482
- return d`<calcite-link .href=${a} target=_blank><arcgis-portal-item-type .item=${i} .portal=${this.portal} .user=${this.user} hide-text></arcgis-portal-item-type>${i.title}</calcite-link>`;
586
+ if (t.length === 1) {
587
+ const s = t[0], i = `${J({ portal: this.portal })}/item.html?id=${s.id}`;
588
+ return d`<calcite-link .href=${i} target=_blank><span class="item-link-content"><arcgis-portal-item-type .item=${s} .portal=${this.portal} .user=${this.user} hide-text></arcgis-portal-item-type><span>${s.title}</span></span></calcite-link>`;
483
589
  }
484
- const t = `delete-items-bucket-${e.map(({ item: i }) => i.id).join("-")}`, n = e.map(({ item: i }) => i);
485
- return S({
486
- id: t,
487
- linkText: e.length,
488
- label: this.messages.bucketItems.replace("{count}", String(e.length)),
590
+ return M({
591
+ id: e,
592
+ linkText: t.length,
593
+ label: this.messages.bucketItems.replace("{count}", String(t.length)),
489
594
  placement: "bottom-start",
490
- items: n,
595
+ items: t,
491
596
  portal: this.portal,
492
597
  user: this.user
493
598
  });
494
599
  }
495
- renderRelatedItemsPopover(e) {
496
- const t = e.flatMap(({ usedByItems: i }) => i);
497
- return e.length > 1 || t.length === 0 ? null : S({
600
+ renderRelatedItemsPopover(t) {
601
+ const e = t.flatMap(({ usedByItems: i }) => i);
602
+ return t.length > 1 || e.length === 0 ? null : M({
498
603
  id: "delete-items-directly-used-by",
499
- linkText: U(this.messages._t9nLocale, this.messages.usedByOtherItems, t.length),
604
+ linkText: x(this.messages._t9nLocale, this.messages.usedByOtherItems, e.length),
500
605
  label: this.messages.usedByPopover,
501
606
  placement: "auto",
502
- items: t,
607
+ items: e,
503
608
  portal: this.portal,
504
609
  user: this.user
505
610
  });
506
611
  }
507
612
  renderDirectlyUsedByItems() {
508
- const e = V({
613
+ const t = se({
509
614
  recycleItems: this.recycleItems,
510
615
  cannotDeleteItems: this.cannotDeleteItems,
511
616
  permanentlyDeleteItems: this.permanentlyDeleteItems
512
- }), t = e.flatMap(({ usedByItems: i }) => i), n = Q({
513
- selectedItems: K(e)
514
- });
515
- return d`${this.items.length === 1 && this.deleteMode === "delete" && n.length > 0 ? d`<div class="discouraged-items-warning"><calcite-notice kind=warning open><div slot=message>${this.messages.deleteDiscouraged}</div><calcite-link icon-end=launch slot=link>${this.messages.learnMoreAboutDeletingSourceItems}</calcite-link></calcite-notice></div>` : null}<arcgis-portal-review-related-items .sourceItem=${this.items[0] ?? null} .relatedItems=${t} .portal=${this.portal} .user=${this.user}></arcgis-portal-review-related-items>`;
617
+ }), e = this.cannotDeleteItems.find(({ reason: o }) => o === "hasDependentItems"), s = e ? e.resultData ?? [] : t.flatMap(({ usedByItems: o }) => o), i = e ? s.length : t[0]?.usedByItemsCount, r = re({
618
+ selectedItems: ne(t)
619
+ }), l = r.find(({ reason: o }) => o === "replacement"), c = l?.offendingItems ?? [], a = x(this.messages._t9nLocale, this.messages.replacementItem.isReplacementFor, c.length, { itemLink: "{itemLink}" });
620
+ return d`${this.loadedItems.length === 1 && ["delete", "permanentlyDelete"].includes(this.deleteMode) && r.length > 0 ? d`<div class="discouraged-items-warning"><calcite-notice kind=warning open><div slot=message>${l ? a.split("{itemLink}").map((o, m) => d`${m > 0 && this.renderItemLinks(c, "delete-items-replacement-for") || ""}${o}`) : this.messages.deleteDiscouraged}</div>${!l && d`<calcite-link .href=${`${C(this.portal)}${this.helpMap[120001208] || ""}`} target=_blank icon-end=launch slot=link>${this.messages.learnMoreAboutDeletingSourceItems}</calcite-link>` || ""}</calcite-notice></div>` : null}${!this.cannotDeleteItems.some(({ reason: o }) => o === "deleteProtected") && d`<arcgis-portal-review-related-items .sourceItem=${this.loadedItems[0] ?? null} .relatedItems=${s} .relatedItemsCount=${i} .showDependentItems=${!!e} .portal=${this.portal} .user=${this.user}></arcgis-portal-review-related-items>` || ""}`;
516
621
  }
517
622
  renderDirectlyUsedByItemsNotice() {
518
- const e = new Set(this.itemsWithImpactedItems.flatMap(({ usedByItems: n }) => n.map(({ id: i }) => i))), t = this.messages.reviewRelatedItems.multiple.replace("{totalCount}", String(e.size));
519
- return d`<div class="panel__related-items-notice"><calcite-notice .kind=${this.reviewDecision ? "brand" : "warning"} icon open><div slot=message>${this.reviewDecision ? this.messages.relatedItemsReviewed : t}</div><calcite-button appearance=transparent slot=actions-end @click=${() => {
520
- this.hasReviewedSelectedItems = !0, this.reviewingDirectlyUsedByItems = !0;
623
+ const t = new Set(this.itemsWithImpactedItems.flatMap(({ usedByItems: s }) => s.map(({ id: i }) => i))), e = this.messages.reviewRelatedItems.multiple.replace("{totalCount}", String(t.size));
624
+ return d`<div class="panel__related-items-notice"><calcite-notice .kind=${this.reviewDecision ? "brand" : "warning"} icon open><div slot=message>${this.reviewDecision ? this.messages.relatedItemsReviewed : e}</div><calcite-button appearance=transparent slot=actions-end @click=${() => {
625
+ this.reviewingDirectlyUsedByItems = !0;
521
626
  }}>${this.messages.reviewItems}</calcite-button></calcite-notice></div>`;
522
627
  }
523
628
  renderDeleteSummary() {
524
- return d`<div class="panel__content">${this.isLoading ? d`<calcite-scrim loading></calcite-scrim>` : d`<calcite-panel>${this.renderRecycleBucket()}${this.renderDeprecateBucket()}${this.renderExcludeBucket()}${this.renderCannotDeleteBucket()}${this.renderPermanentlyDeleteBucket()}${this.items.length === 1 && this.renderDirectlyUsedByItems() || ""}${this.itemsHaveImpactedItems && d`<div>${this.items.length > 1 ? this.renderDirectlyUsedByItemsNotice() : null}</div>` || ""}</calcite-panel>`}</div>${this.itemsNeedReview && !this.hasReviewedSelectedItems && d`<calcite-checkbox slot=content-bottom class="panel__checkbox" .checked=${this.hasConfirmedReview} @calciteCheckboxChange=${(e) => {
525
- this.hasConfirmedReview = e.target.checked;
526
- }} .labelText=${this.messages.reviewImpactedItems}></calcite-checkbox>` || ""}<calcite-button slot=footer-end appearance=outline-fill @click=${this.handleDialogClose}>${this.messages.cancel}</calcite-button>${this.deleteMode !== "none" && d`<calcite-button .disabled=${!this.deleteButtonEnabled} kind=danger slot=footer-end @click=${async () => await this.handleDelete()}>${this.getConfirmButtonText()}</calcite-button>` || ""}`;
629
+ return d`<div class="panel__content">${this.isLoading ? d`<calcite-scrim loading></calcite-scrim>` : d`<calcite-panel>${this.renderRecycleBucket()}${this.renderDeprecateBucket()}${this.renderExcludeBucket()}${this.renderCannotDeleteBucket()}${this.renderPermanentlyDeleteBucket()}${this.loadedItems.length === 1 && this.renderDirectlyUsedByItems() || ""}${this.itemsHaveImpactedItems && d`<div>${this.loadedItems.length > 1 ? this.renderDirectlyUsedByItemsNotice() : null}</div>` || ""}</calcite-panel>`}</div>${!this.isLoading && d`${this.loadedItems.length === 1 && K(this.loadedItems[0]).contentStatus !== "deprecated" && d`<calcite-button slot=footer-start kind=danger appearance=outline-fill .disabled=${!!this.submittingAction} .loading=${this.submittingAction === "deprecate"} @click=${this.handleDeprecate}>${this.messages.deprecateInstead}</calcite-button>` || ""}<calcite-button slot=footer-end appearance=outline-fill @click=${this.handleDialogClose}>${this.messages.cancel}</calcite-button>${this.deleteMode !== "none" && d`<calcite-button .disabled=${!!this.submittingAction} .loading=${this.submittingAction === "delete"} kind=danger slot=footer-end @click=${async () => await this.handleDelete()}>${this.getConfirmButtonText()}</calcite-button>` || ""}` || ""}`;
527
630
  }
528
631
  renderReviewItems() {
529
632
  return d`<div class="panel__content"><calcite-panel><arcgis-portal-delete-items-review .items=${this.itemsWithImpactedItems} .portal=${this.portal} .user=${this.user}></arcgis-portal-delete-items-review></calcite-panel></div><calcite-button slot=footer-start appearance=solid kind=neutral @click=${async () => await this.handleReviewDecision("exclude")}>${this.messages.exclude}</calcite-button><calcite-button slot=footer-end appearance=outline-fill kind=danger @click=${async () => await this.handleReviewDecision("deprecate")}>${this.messages.deprecateInstead}</calcite-button><calcite-button slot=footer-end appearance=solid kind=danger @click=${async () => await this.handleReviewDecision("delete")}>${this.messages.proceedToDelete}</calcite-button>`;
530
633
  }
531
634
  renderRecycleBucket() {
532
- return !this.recycleItems || this.recycleItems.length === 0 ? null : this.renderBucket({
533
- icon: "recycle-bin",
534
- label: this.messages.summary.willBeRecycled,
535
- description: this.messages.summary.canBeRecovered.single.replace("{days}", "14"),
536
- updated: this.recycleItems.some(({ kind: e, updatedStatus: t }) => t === "recycle" && t !== e),
537
- bucket: this.recycleItems
635
+ if (!this.recycleItems || this.recycleItems.length === 0)
636
+ return null;
637
+ const t = !this.portal.recycleBinEnabled;
638
+ return this.renderBucket({
639
+ icon: t ? "trash" : "recycle-bin",
640
+ label: t ? this.messages.summary.permanentDelete.delete : this.messages.summary.willBeRecycled,
641
+ description: t ? this.messages.summary.permanentDelete.default.single : this.messages.summary.canBeRecovered.single.replace("{days}", "14"),
642
+ updated: this.recycleItems.some(({ kind: e, updatedStatus: s }) => s === "recycle" && s !== e),
643
+ bucket: this.recycleItems,
644
+ additionalContent: t ? void 0 : d`<calcite-checkbox class="bucket__checkbox" .label=${this.messages.permanentlyDeleteInstead} .labelText=${this.messages.permanentlyDeleteInstead} @calciteCheckboxChange=${async (e) => await this.handlePermanentlyDeleteOverrideChange(e.target.checked)} ${B(this.permanentlyDeleteCheckboxRef)}></calcite-checkbox>`
538
645
  });
539
646
  }
540
647
  renderDeprecateBucket() {
@@ -542,7 +649,7 @@ class Z extends x {
542
649
  icon: "circle-disallowed",
543
650
  label: this.messages.summary.deprecate.label,
544
651
  description: this.messages.summary.deprecate.message,
545
- updated: this.deprecateItems.some(({ kind: e, updatedStatus: t }) => t !== e && t === "deprecate"),
652
+ updated: this.deprecateItems.some(({ kind: t, updatedStatus: e }) => e !== t && e === "deprecate"),
546
653
  bucket: this.deprecateItems
547
654
  });
548
655
  }
@@ -551,36 +658,45 @@ class Z extends x {
551
658
  icon: "remove-from-list",
552
659
  label: this.messages.summary.exclude.label,
553
660
  description: this.messages.summary.exclude.message,
554
- updated: this.excludeItems.some(({ kind: e, updatedStatus: t }) => t !== e && t === "exclude"),
661
+ updated: this.excludeItems.some(({ kind: t, updatedStatus: e }) => e !== t && e === "exclude"),
555
662
  bucket: this.excludeItems
556
663
  });
557
664
  }
558
665
  renderCannotDeleteBucket() {
559
666
  if (!this.cannotDeleteItems || this.cannotDeleteItems.length === 0)
560
667
  return null;
561
- const e = this.cannotDeleteItems?.[0]?.reason;
668
+ const t = this.cannotDeleteItems?.[0]?.reason, e = this.cannotDeleteItems[0]?.resultData?.length ?? 0, s = this.messages.summary.protectedGroup.hasDependentItemsDescription;
562
669
  return this.renderBucket({
563
670
  icon: "security",
564
671
  label: this.messages.summary.cannotDelete,
565
- description: e === "hasDependentItems" ? this.messages.summary.protectedGroup.hasDependentItemsDescription.singleOneDependentItem : this.messages.summary.protectedGroup.deleteProtectedDescription,
672
+ description: t === "hasDependentItems" ? e > 1 ? s.singleMultipleDependentItems : s.singleOneDependentItem : this.messages.summary.protectedGroup.deleteProtectedDescription,
566
673
  bucket: this.cannotDeleteItems,
567
- updated: this.cannotDeleteItems.some(({ item: t }) => t.id && this.updatedCannotDeleteItemIds.has(t.id))
674
+ updated: this.cannotDeleteItems.some(({ item: i }) => i.id && this.updatedCannotDeleteItemIds.has(i.id))
568
675
  });
569
676
  }
570
677
  renderPermanentlyDeleteBucket() {
571
- return !this.permanentlyDeleteItems || this.permanentlyDeleteItems.length === 0 ? null : this.renderBucket({
678
+ if (!this.permanentlyDeleteItems || this.permanentlyDeleteItems.length === 0)
679
+ return null;
680
+ const t = !this.portal.recycleBinEnabled, e = this.permanentlyDeleteItems.some((s) => this.isPermanentlyDeleteOverrideActive(s));
681
+ return this.renderBucket({
572
682
  icon: "trash",
573
- label: this.messages.summary.permanentlyDelete,
574
- description: this.messages.summary.permanentDelete.notSupported.single,
575
- bucket: this.permanentlyDeleteItems
683
+ label: t ? this.messages.summary.permanentDelete.delete : this.messages.summary.permanentlyDelete,
684
+ description: t ? this.messages.summary.permanentDelete.default.single : e ? null : this.messages.summary.permanentDelete.notSupported.single,
685
+ link: e ? void 0 : {
686
+ href: `${C(this.portal)}${this.helpMap[120004692] || ""}`,
687
+ text: this.fieldDeleteMessages.learnMore ?? this.messages.moreInfo
688
+ },
689
+ bucket: this.permanentlyDeleteItems,
690
+ dangerIcon: !t,
691
+ additionalContent: !t && e ? d`<calcite-checkbox class="bucket__checkbox" checked .label=${this.messages.permanentlyDeleteInstead} .labelText=${this.messages.permanentlyDeleteInstead} @calciteCheckboxChange=${async (s) => await this.handlePermanentlyDeleteOverrideChange(s.target.checked)} ${B(this.permanentlyDeleteCheckboxRef)}></calcite-checkbox>` : void 0
576
692
  });
577
693
  }
578
694
  render() {
579
- const { items: e, portal: t } = this;
580
- return !e || !t ? null : d`<calcite-dialog modal .open=${this.active} width=s .heading=${this.getHeaderText()} heading-level=2 outside-close-disabled escape-disabled kind=danger @calciteDialogClose=${this.handleDialogClose}><div slot=heading><span>${this.getHeaderText()}</span><br><span class="header-description">${this.getHeaderDescription()}</span></div>${this.reviewingDirectlyUsedByItems ? this.renderReviewItems() : this.renderDeleteSummary()}</calcite-dialog>`;
695
+ const { loadedItems: t, portal: e } = this;
696
+ return !t || !e ? null : d`<calcite-dialog modal .open=${this.active} width=s .heading=${this.getHeaderText()} heading-level=2 outside-close-disabled escape-disabled kind=danger @calciteDialogClose=${this.handleDialogClose}>${!this.isLoading || this.reviewingDirectlyUsedByItems ? d`<div slot=heading><span>${this.getHeaderText()}</span><br><span class="header-description">${this.getHeaderDescription()}</span></div>` : void 0}${this.reviewingDirectlyUsedByItems ? this.renderReviewItems() : this.renderDeleteSummary()}</calcite-dialog>`;
581
697
  }
582
698
  }
583
- B("arcgis-portal-delete-items", Z);
699
+ H("arcgis-portal-delete-items", Ie);
584
700
  export {
585
- Z as ArcgisPortalDeleteItems
701
+ Ie as ArcgisPortalDeleteItems
586
702
  };