@arcgis/portal-components 5.2.0-next.9 → 5.2.0-next.91

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 (528) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/cdn/2GBRZSEC.js +2 -0
  4. package/dist/cdn/2T33E2DS.js +2 -0
  5. package/dist/cdn/2VGYRITT.js +2 -0
  6. package/dist/cdn/3HAZNYCD.js +2 -0
  7. package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
  8. package/dist/cdn/3YCG5UCH.js +2 -0
  9. package/dist/cdn/433M2GP4.js +2 -0
  10. package/dist/cdn/47ZPCFHE.js +2 -0
  11. package/dist/cdn/4QA4AYHJ.js +3 -0
  12. package/dist/cdn/546M6SVH.js +2 -0
  13. package/dist/cdn/5Q7A62C3.js +660 -0
  14. package/dist/cdn/5YCQRL4K.js +2 -0
  15. package/dist/cdn/{7WZHZP6U.js → 63THOLAY.js} +9 -3
  16. package/dist/cdn/6KVA4AKM.js +2 -0
  17. package/dist/cdn/6TO2BYXU.js +2 -0
  18. package/dist/cdn/6XLTWENT.js +2 -0
  19. package/dist/cdn/7FVPT4SA.js +2 -0
  20. package/dist/cdn/{LAFNDBTQ.js → 7HHPKD5C.js} +1 -1
  21. package/dist/cdn/7OR2HKBV.js +2 -0
  22. package/dist/cdn/7SB7JHBR.js +2 -0
  23. package/dist/cdn/{QNUYUNEY.js → 7XD6KSXV.js} +1 -1
  24. package/dist/cdn/AMBLICID.js +2 -0
  25. package/dist/cdn/BMZFIENS.js +66 -0
  26. package/dist/cdn/{DHHSKOUY.js → BTSXQQKZ.js} +2 -2
  27. package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
  28. package/dist/cdn/CBXQFKN5.js +2 -0
  29. package/dist/cdn/CFBSBZSS.js +2 -0
  30. package/dist/cdn/CNDTRZJT.js +2 -0
  31. package/dist/cdn/CVOWIH4J.js +2 -0
  32. package/dist/cdn/DCIRWNQL.js +2 -0
  33. package/dist/cdn/DN2QW5FV.js +2 -0
  34. package/dist/cdn/E7MAKHJ5.js +2 -0
  35. package/dist/cdn/EUWBMLIT.js +2 -0
  36. package/dist/cdn/EZNTXOKK.js +2 -0
  37. package/dist/cdn/F3ODJVJC.js +2 -0
  38. package/dist/cdn/GJ7GKO7I.js +2 -0
  39. package/dist/cdn/H4L2DX4R.js +2 -0
  40. package/dist/cdn/H76EB2WF.js +2 -0
  41. package/dist/cdn/HNWQS7DU.js +2 -0
  42. package/dist/cdn/I2KQQXOO.js +2 -0
  43. package/dist/cdn/IJ3CLFAU.js +22 -0
  44. package/dist/cdn/ILDTKRON.js +2 -0
  45. package/dist/cdn/JCYCRSPL.js +451 -0
  46. package/dist/cdn/K42KPAN7.js +2 -0
  47. package/dist/cdn/KA4XSW6O.js +2 -0
  48. package/dist/cdn/KIKZIZGV.js +2 -0
  49. package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
  50. package/dist/cdn/KQCTBRGJ.js +2 -0
  51. package/dist/cdn/KYNL256E.js +2 -0
  52. package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
  53. package/dist/cdn/LTHZ2TRG.js +2 -0
  54. package/dist/cdn/{WOZDQW3S.js → MRHDSM6U.js} +1 -1
  55. package/dist/cdn/NQQLTGIK.js +2 -0
  56. package/dist/cdn/NVGQFC2K.js +2 -0
  57. package/dist/cdn/O3JIWIMI.js +2 -0
  58. package/dist/cdn/O6ZQ4BRU.js +2 -0
  59. package/dist/cdn/O7KHFGHS.js +2 -0
  60. package/dist/cdn/OBBYT2AV.js +2 -0
  61. package/dist/cdn/OEMNHYK6.js +2 -0
  62. package/dist/cdn/OHEUIODH.js +2 -0
  63. package/dist/cdn/OOH5B3WJ.js +2 -0
  64. package/dist/cdn/{53MSUMA3.js → OT4PZJNB.js} +17 -1
  65. package/dist/cdn/OUFIJDIW.js +2 -0
  66. package/dist/cdn/P4ELMYQQ.js +2 -0
  67. package/dist/cdn/P6DWFLYH.js +2 -0
  68. package/dist/cdn/{ZTHTFEYA.js → PF3TB3QZ.js} +1 -1
  69. package/dist/cdn/PJLV3EQS.js +2 -0
  70. package/dist/cdn/Q54ZD7WJ.js +2 -0
  71. package/dist/cdn/QE4CNVDQ.js +34 -0
  72. package/dist/cdn/QH47GJCC.js +2 -0
  73. package/dist/cdn/{AQWTJKUH.js → QKCV7CY2.js} +10 -8
  74. package/dist/cdn/{LQ3DMZ3K.js → QLHCXOVQ.js} +1 -1
  75. package/dist/cdn/QNCSWTTL.js +2 -0
  76. package/dist/cdn/QS3GXAIH.js +2 -0
  77. package/dist/cdn/R5BQIF6P.js +2 -0
  78. package/dist/cdn/RBGARTND.js +2 -0
  79. package/dist/cdn/RBQG66FL.js +2 -0
  80. package/dist/cdn/RDAUPHB6.js +2 -0
  81. package/dist/cdn/RVWAHK4A.js +2 -0
  82. package/dist/cdn/SFD33DHG.js +2 -0
  83. package/dist/cdn/SKRCLDPZ.js +2 -0
  84. package/dist/cdn/SLTFLCVR.js +99 -0
  85. package/dist/cdn/SXBAVMP3.js +2 -0
  86. package/dist/cdn/{GT26WGJS.js → T3LU5V74.js} +1 -1
  87. package/dist/cdn/T7FVQDHN.js +2 -0
  88. package/dist/cdn/TB4YQUMO.js +2 -0
  89. package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
  90. package/dist/cdn/UZLQALHY.js +2 -0
  91. package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
  92. package/dist/cdn/VMQIDO4Z.js +2 -0
  93. package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
  94. package/dist/cdn/W2SYL7IJ.js +71 -0
  95. package/dist/cdn/{W6PSG4GX.js → W4FGRGLV.js} +10 -5
  96. package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
  97. package/dist/cdn/W7O7ZYZ4.js +2 -0
  98. package/dist/cdn/WBZLQZYR.js +134 -0
  99. package/dist/cdn/WNYL4EZA.js +2 -0
  100. package/dist/cdn/WYLEYSM3.js +2 -0
  101. package/dist/cdn/XEK22IDA.js +2 -0
  102. package/dist/cdn/YMLZCVEI.js +2 -0
  103. package/dist/cdn/YS2SZ3DL.js +2 -0
  104. package/dist/cdn/YVKSTDL6.js +2 -0
  105. package/dist/cdn/YWNUWLOL.js +2 -0
  106. package/dist/cdn/YZNRN2K5.js +2 -0
  107. package/dist/cdn/ZGNXS6U5.js +2 -0
  108. package/dist/cdn/ZTGGJIVB.js +2 -0
  109. package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -0
  110. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.en.json +1 -0
  111. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
  112. package/dist/cdn/assets/portal-browser/t9n/messages.en.json +1 -0
  113. package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
  114. package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -1
  115. package/dist/cdn/assets/portal-item-badges/t9n/messages.en.json +1 -0
  116. package/dist/cdn/assets/portal-item-card/t9n/messages.en.json +1 -0
  117. package/dist/cdn/assets/portal-item-favorite/t9n/messages.en.json +1 -0
  118. package/dist/cdn/assets/portal-item-type/icons/applicationtheme16.svg +1 -0
  119. package/dist/cdn/assets/portal-item-type/icons/applicationtheme32.svg +1 -0
  120. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration16.svg +1 -0
  121. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration32.svg +1 -0
  122. package/dist/cdn/assets/portal-item-type/icons/layout16.svg +1 -0
  123. package/dist/cdn/assets/portal-item-type/icons/layout32.svg +1 -0
  124. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer16.svg +1 -0
  125. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer32.svg +1 -0
  126. package/dist/cdn/assets/portal-item-type/icons/storymapframe16.svg +1 -0
  127. package/dist/cdn/assets/portal-item-type/icons/storymapframe32.svg +1 -0
  128. package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
  129. package/dist/cdn/assets/portal-navigation/apps/api-for-python.avif +0 -0
  130. package/dist/cdn/assets/portal-navigation/apps/appstudio.avif +0 -0
  131. package/dist/cdn/assets/portal-navigation/apps/arcade.avif +0 -0
  132. package/dist/cdn/assets/portal-navigation/apps/arcgis-360-vr.avif +0 -0
  133. package/dist/cdn/assets/portal-navigation/apps/arcgis-earth.avif +0 -0
  134. package/dist/cdn/assets/portal-navigation/apps/arcgis-enterprise.avif +0 -0
  135. package/dist/cdn/assets/portal-navigation/apps/arcgis-experience-builder.avif +0 -0
  136. package/dist/cdn/assets/portal-navigation/apps/arcgis-geoanalytics.avif +0 -0
  137. package/dist/cdn/assets/portal-navigation/apps/arcgis-hub.avif +0 -0
  138. package/dist/cdn/assets/portal-navigation/apps/arcgis-online.avif +0 -0
  139. package/dist/cdn/assets/portal-navigation/apps/arcgis-pro.avif +0 -0
  140. package/dist/cdn/assets/portal-navigation/apps/arcgis-reality-studio.avif +0 -0
  141. package/dist/cdn/assets/portal-navigation/apps/arcgis-urban.avif +0 -0
  142. package/dist/cdn/assets/portal-navigation/apps/blank.avif +0 -0
  143. package/dist/cdn/assets/portal-navigation/apps/business-analyst.avif +0 -0
  144. package/dist/cdn/assets/portal-navigation/apps/city-engine.avif +0 -0
  145. package/dist/cdn/assets/portal-navigation/apps/collector.avif +0 -0
  146. package/dist/cdn/assets/portal-navigation/apps/community-analyst.avif +0 -0
  147. package/dist/cdn/assets/portal-navigation/apps/configurable-apps.avif +0 -0
  148. package/dist/cdn/assets/portal-navigation/apps/dashboards-beta.avif +0 -0
  149. package/dist/cdn/assets/portal-navigation/apps/dashboards-classic.avif +0 -0
  150. package/dist/cdn/assets/portal-navigation/apps/data-pipelines.avif +0 -0
  151. package/dist/cdn/assets/portal-navigation/apps/deeplearningstudio.avif +0 -0
  152. package/dist/cdn/assets/portal-navigation/apps/demographics.avif +0 -0
  153. package/dist/cdn/assets/portal-navigation/apps/drone2map.avif +0 -0
  154. package/dist/cdn/assets/portal-navigation/apps/esri-events.avif +0 -0
  155. package/dist/cdn/assets/portal-navigation/apps/essential-apps.avif +0 -0
  156. package/dist/cdn/assets/portal-navigation/apps/excalibur.avif +0 -0
  157. package/dist/cdn/assets/portal-navigation/apps/explorer.avif +0 -0
  158. package/dist/cdn/assets/portal-navigation/apps/field-apps.avif +0 -0
  159. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-beta.avif +0 -0
  160. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-ea.avif +0 -0
  161. package/dist/cdn/assets/portal-navigation/apps/fieldmaps.avif +0 -0
  162. package/dist/cdn/assets/portal-navigation/apps/generic-app.avif +0 -0
  163. package/dist/cdn/assets/portal-navigation/apps/geobim.avif +0 -0
  164. package/dist/cdn/assets/portal-navigation/apps/geoplanner.avif +0 -0
  165. package/dist/cdn/assets/portal-navigation/apps/grid-view-9.avif +0 -0
  166. package/dist/cdn/assets/portal-navigation/apps/indoor.avif +0 -0
  167. package/dist/cdn/assets/portal-navigation/apps/indoors.avif +0 -0
  168. package/dist/cdn/assets/portal-navigation/apps/insights.avif +0 -0
  169. package/dist/cdn/assets/portal-navigation/apps/instant-apps.avif +0 -0
  170. package/dist/cdn/assets/portal-navigation/apps/ips.avif +0 -0
  171. package/dist/cdn/assets/portal-navigation/apps/knowledge-studio.avif +0 -0
  172. package/dist/cdn/assets/portal-navigation/apps/living-atlas.avif +0 -0
  173. package/dist/cdn/assets/portal-navigation/apps/location-platform.avif +0 -0
  174. package/dist/cdn/assets/portal-navigation/apps/map-maker.avif +0 -0
  175. package/dist/cdn/assets/portal-navigation/apps/map-viewer-beta.avif +0 -0
  176. package/dist/cdn/assets/portal-navigation/apps/map-viewer-classic.avif +0 -0
  177. package/dist/cdn/assets/portal-navigation/apps/map-viewer.avif +0 -0
  178. package/dist/cdn/assets/portal-navigation/apps/maps-adobe-cloud.avif +0 -0
  179. package/dist/cdn/assets/portal-navigation/apps/maps-for-office.avif +0 -0
  180. package/dist/cdn/assets/portal-navigation/apps/maps-for-power-bi.avif +0 -0
  181. package/dist/cdn/assets/portal-navigation/apps/maps-for-sharepoint.avif +0 -0
  182. package/dist/cdn/assets/portal-navigation/apps/marketplace.avif +0 -0
  183. package/dist/cdn/assets/portal-navigation/apps/mission.avif +0 -0
  184. package/dist/cdn/assets/portal-navigation/apps/monitor.avif +0 -0
  185. package/dist/cdn/assets/portal-navigation/apps/navigator.avif +0 -0
  186. package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
  187. package/dist/cdn/assets/portal-navigation/apps/office-apps.avif +0 -0
  188. package/dist/cdn/assets/portal-navigation/apps/open-data.avif +0 -0
  189. package/dist/cdn/assets/portal-navigation/apps/operations-dashboard.avif +0 -0
  190. package/dist/cdn/assets/portal-navigation/apps/ortho-maker.avif +0 -0
  191. package/dist/cdn/assets/portal-navigation/apps/pro-extension.avif +0 -0
  192. package/dist/cdn/assets/portal-navigation/apps/quick-capture.avif +0 -0
  193. package/dist/cdn/assets/portal-navigation/apps/redistricting.avif +0 -0
  194. package/dist/cdn/assets/portal-navigation/apps/runtime.avif +0 -0
  195. package/dist/cdn/assets/portal-navigation/apps/scene-viewer.avif +0 -0
  196. package/dist/cdn/assets/portal-navigation/apps/sites.avif +0 -0
  197. package/dist/cdn/assets/portal-navigation/apps/solutions.avif +0 -0
  198. package/dist/cdn/assets/portal-navigation/apps/story-maps.avif +0 -0
  199. package/dist/cdn/assets/portal-navigation/apps/streetmap-premium.avif +0 -0
  200. package/dist/cdn/assets/portal-navigation/apps/survey123.avif +0 -0
  201. package/dist/cdn/assets/portal-navigation/apps/svg-app-circle.svg +1 -0
  202. package/dist/cdn/assets/portal-navigation/apps/svg-app-icon.svg +1 -0
  203. package/dist/cdn/assets/portal-navigation/apps/track-viewer.avif +0 -0
  204. package/dist/cdn/assets/portal-navigation/apps/user-type-extension-online.avif +0 -0
  205. package/dist/cdn/assets/portal-navigation/apps/user-type-extension.avif +0 -0
  206. package/dist/cdn/assets/portal-navigation/apps/vector-tile-style-editor.avif +0 -0
  207. package/dist/cdn/assets/portal-navigation/apps/velocity.avif +0 -0
  208. package/dist/cdn/assets/portal-navigation/apps/web-app-builder.avif +0 -0
  209. package/dist/cdn/assets/portal-navigation/apps/web-editor.avif +0 -0
  210. package/dist/cdn/assets/portal-navigation/apps/web-mapping.avif +0 -0
  211. package/dist/cdn/assets/portal-navigation/apps/workflow-manager-beta.avif +0 -0
  212. package/dist/cdn/assets/portal-navigation/apps/workflow-manager.avif +0 -0
  213. package/dist/cdn/assets/portal-navigation/apps/workforce.avif +0 -0
  214. package/dist/cdn/assets/portal-navigation/product-logos/advanced-editing-user-type-extension-glyph-32.svg +1 -0
  215. package/dist/cdn/assets/portal-navigation/product-logos/arc-hydro-glyph-32.svg +1 -0
  216. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-360-vr-glyph-32.svg +1 -0
  217. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-api-for-python-glyph-32.svg +1 -0
  218. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-appstudio-glyph-32.svg +1 -0
  219. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-arcade-expression-language-glyph-32.svg +1 -0
  220. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-business-analyst-glyph-32.svg +1 -0
  221. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-cityengine-glyph-32.svg +1 -0
  222. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-collector-glyph-32.svg +1 -0
  223. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-community-analyst-glyph-32.svg +1 -0
  224. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-connectors-for-power-automate-glyph-32.svg +1 -0
  225. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-dashboards-glyph-32.svg +1 -0
  226. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-interoperability-glyph-32.svg +1 -0
  227. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-pipelines-glyph-32.svg +1 -0
  228. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-reviewer-glyph-32.svg +1 -0
  229. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-deep-learning-studio-glyph-32.svg +1 -0
  230. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-drone2map-glyph-32.svg +1 -0
  231. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-earth-glyph-32.svg +1 -0
  232. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-enterprise-glyph-32.svg +1 -0
  233. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-glyph-32.svg +1 -0
  234. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-gray-glyph-32.svg +1 -0
  235. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-experience-builder-glyph-32.svg +1 -0
  236. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-explorer-glyph-32.svg +1 -0
  237. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-designer-ea-glyph-32.svg +1 -0
  238. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-glyph-32.svg +1 -0
  239. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-flight-glyph-32.svg +1 -0
  240. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autocad-glyph-32.svg +1 -0
  241. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autodesk-forma-glyph-32.svg +1 -0
  242. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-developers-glyph-32.svg +1 -0
  243. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-excel-glyph-32.svg +1 -0
  244. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-microsoft-365-glyph-32.svg +1 -0
  245. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-power-apps-glyph-32.svg +1 -0
  246. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-teams-glyph-32.svg +1 -0
  247. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoanalytics-engine-glyph-32.svg +1 -0
  248. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geobim-glyph-32.svg +1 -0
  249. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoplanner-glyph-32.svg +1 -0
  250. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-hub-glyph-32.svg +1 -0
  251. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-image-glyph-32.svg +1 -0
  252. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-indoors-glyph-32.svg +1 -0
  253. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-insights-glyph-32.svg +1 -0
  254. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-instant-apps-glyph-32.svg +1 -0
  255. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-knowledge-glyph-32.svg +1 -0
  256. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-living-atlas-of-the-world-glyph-32.svg +1 -0
  257. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-location-platform-glyph-32.svg +1 -0
  258. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-logo-glyph-32.svg +76 -0
  259. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-adobe-creative-cloud-glyph-32.svg +1 -0
  260. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-power-bi-glyph-32.svg +1 -0
  261. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-sharepoint-glyph-32.svg +1 -0
  262. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdk-for-javascript-glyph-32.svg +1 -0
  263. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-game-engines-glyph-32.svg +1 -0
  264. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-native-apps-glyph-32.svg +1 -0
  265. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maritime-glyph-32.svg +1 -0
  266. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-marketplace-glyph-32.svg +1 -0
  267. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-mission-glyph-32.svg +1 -0
  268. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-glyph-32.svg +1 -0
  269. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-white-glyph-32.svg +1 -0
  270. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-navigator-glyph-32.svg +1 -0
  271. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-notebooks-glyph-32.svg +1 -0
  272. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-online-glyph-32.svg +1 -0
  273. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-data-glyph-32.svg +1 -0
  274. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-source-apps-glyph-32.svg +1 -0
  275. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-ortho-maker-glyph-32.svg +1 -0
  276. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-parcel-fabric-glyph-32.svg +1 -0
  277. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pipeline-referencing-glyph-32.svg +1 -0
  278. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-for-intelligence-glyph-32.svg +1 -0
  279. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-glyph-32.svg +1 -0
  280. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-quickcapture-glyph-32.svg +1 -0
  281. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-reality-studio-glyph-32.svg +1 -0
  282. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-roads-and-highways-glyph-32.svg +1 -0
  283. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-sites-glyph-32.svg +1 -0
  284. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-solutions-glyph-32.svg +1 -0
  285. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-storymaps-glyph-32.svg +1 -0
  286. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-streetmap-premium-glyph-32.svg +1 -0
  287. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-connect-glyph-32.svg +1 -0
  288. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-glyph-32.svg +1 -0
  289. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-tracker-glyph-32.svg +1 -0
  290. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-urban-glyph-32.svg +1 -0
  291. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-utility-network-management-glyph-32.svg +1 -0
  292. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-velocity-glyph-32.svg +6 -0
  293. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-appbuilder-glyph-32.svg +1 -0
  294. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-editor-glyph-32.svg +1 -0
  295. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workflow-manager-glyph-32.svg +1 -0
  296. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workforce-glyph-32.svg +1 -0
  297. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-world-geocoder-glyph-32.svg +1 -0
  298. package/dist/cdn/assets/portal-navigation/product-logos/calcite-design-system-glyph-32.svg +1 -0
  299. package/dist/cdn/assets/portal-navigation/product-logos/esri-community-glyph-32.svg +1 -0
  300. package/dist/cdn/assets/portal-navigation/product-logos/esri-demographics-glyph-32.svg +1 -0
  301. package/dist/cdn/assets/portal-navigation/product-logos/esri-events-glyph-32.svg +1 -0
  302. package/dist/cdn/assets/portal-navigation/product-logos/esri-offline-documentation-center--glyph-32.svg +1 -0
  303. package/dist/cdn/assets/portal-navigation/product-logos/esri-redistricting-glyph-32.svg +1 -0
  304. package/dist/cdn/assets/portal-navigation/product-logos/esri-reports-glyph-32.svg +1 -0
  305. package/dist/cdn/assets/portal-navigation/product-logos/esri-support-glyph-32.svg +1 -0
  306. package/dist/cdn/assets/portal-navigation/product-logos/map-viewer-glyph-32.svg +1 -0
  307. package/dist/cdn/assets/portal-navigation/product-logos/sceneviewer-glyph-32.svg +1 -0
  308. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-glyph-32.svg +1 -0
  309. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-le-glyph-32.svg +1 -0
  310. package/dist/cdn/assets/portal-navigation/product-logos/vector-tile-style-editor-glyph-32.svg +1 -0
  311. package/dist/cdn/assets/portal-navigation/product-logos/xr-viewer-glyph-32.svg +1 -0
  312. package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -0
  313. package/dist/cdn/index.js +1 -1
  314. package/dist/cdn/main.css +1 -1
  315. package/dist/chunks/dom.js +41 -0
  316. package/dist/chunks/fieldAddDelete.js +2 -2
  317. package/dist/chunks/functionalities.js +6 -4
  318. package/dist/chunks/groups.js +8 -83
  319. package/dist/chunks/groups2.js +64 -0
  320. package/dist/chunks/icons.js +11 -0
  321. package/dist/chunks/info.js +179 -0
  322. package/dist/chunks/item.js +29 -123
  323. package/dist/chunks/item2.js +128 -0
  324. package/dist/chunks/items.js +16 -0
  325. package/dist/chunks/loadClassificationData.js +19 -19
  326. package/dist/chunks/portal-account-switcher.js +6 -0
  327. package/dist/chunks/portal-browser-filter-date.js +63 -0
  328. package/dist/chunks/portal-browser.js +220 -0
  329. package/dist/chunks/portal-item-badge.js +349 -0
  330. package/dist/chunks/portal.js +91 -8
  331. package/dist/chunks/portal2.js +59 -0
  332. package/dist/chunks/query.js +159 -0
  333. package/dist/chunks/request.js +87 -0
  334. package/dist/chunks/requests.js +92 -44
  335. package/dist/chunks/services.js +17 -0
  336. package/dist/chunks/store.js +14 -0
  337. package/dist/chunks/string.js +36 -0
  338. package/dist/chunks/thumbnail.js +189 -0
  339. package/dist/chunks/ui.js +9 -0
  340. package/dist/chunks/url.js +17 -0
  341. package/dist/chunks/user.js +99 -4
  342. package/dist/chunks/user2.js +13 -107
  343. package/dist/chunks/users.js +7 -0
  344. package/dist/chunks/utils.js +88 -0
  345. package/dist/chunks/utils2.js +656 -0
  346. package/dist/chunks/verified.js +40 -0
  347. package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +119 -0
  348. package/dist/components/arcgis-portal-account-switcher/customElement.js +369 -0
  349. package/dist/components/arcgis-portal-account-switcher/index.d.ts +1 -0
  350. package/dist/components/arcgis-portal-account-switcher/index.js +9 -0
  351. package/dist/components/arcgis-portal-account-switcher/types.d.ts +6 -0
  352. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +118 -0
  353. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +31 -0
  354. package/dist/components/arcgis-portal-account-switcher-accounts/index.d.ts +1 -0
  355. package/dist/components/arcgis-portal-account-switcher-accounts/index.js +5 -0
  356. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +122 -0
  357. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +72 -0
  358. package/dist/components/arcgis-portal-account-switcher-list/index.d.ts +1 -0
  359. package/dist/components/arcgis-portal-account-switcher-list/index.js +6 -0
  360. package/dist/components/arcgis-portal-add-gps-metadata/customElement.d.ts +55 -0
  361. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +1242 -0
  362. package/dist/components/arcgis-portal-add-gps-metadata/index.d.ts +1 -0
  363. package/dist/components/arcgis-portal-add-gps-metadata/index.js +8 -0
  364. package/dist/components/arcgis-portal-ai-assistant/agents/portalRouteKeys.d.ts +35 -0
  365. package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +77 -3
  366. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +65 -3
  367. package/dist/components/arcgis-portal-ai-assistant/customElement.js +1963 -613
  368. package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +34 -0
  369. package/dist/components/arcgis-portal-browser/customElement.d.ts +243 -0
  370. package/dist/components/arcgis-portal-browser/customElement.js +16 -0
  371. package/dist/components/arcgis-portal-browser/index.d.ts +1 -0
  372. package/dist/components/arcgis-portal-browser/index.js +6 -0
  373. package/dist/components/arcgis-portal-browser/utils/store.d.ts +35 -0
  374. package/dist/components/arcgis-portal-browser/utils/types.d.ts +24 -0
  375. package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +185 -0
  376. package/dist/components/arcgis-portal-browser-actions/customElement.js +73 -0
  377. package/dist/components/arcgis-portal-browser-actions/index.d.ts +1 -0
  378. package/dist/components/arcgis-portal-browser-actions/index.js +6 -0
  379. package/dist/components/arcgis-portal-browser-actions/types.d.ts +9 -0
  380. package/dist/components/arcgis-portal-browser-filter-status/customElement.d.ts +193 -0
  381. package/dist/components/arcgis-portal-browser-filter-status/customElement.js +56 -0
  382. package/dist/components/arcgis-portal-browser-filter-status/index.d.ts +1 -0
  383. package/dist/components/arcgis-portal-browser-filter-status/index.js +5 -0
  384. package/dist/components/arcgis-portal-browser-pagination/customElement.d.ts +194 -0
  385. package/dist/components/arcgis-portal-browser-pagination/customElement.js +49 -0
  386. package/dist/components/arcgis-portal-browser-pagination/index.d.ts +1 -0
  387. package/dist/components/arcgis-portal-browser-pagination/index.js +2 -0
  388. package/dist/components/arcgis-portal-browser-search/customElement.d.ts +195 -0
  389. package/dist/components/arcgis-portal-browser-search/customElement.js +62 -0
  390. package/dist/components/arcgis-portal-browser-search/index.d.ts +1 -0
  391. package/dist/components/arcgis-portal-browser-search/index.js +3 -0
  392. package/dist/components/arcgis-portal-browser-sort/customElement.d.ts +196 -0
  393. package/dist/components/arcgis-portal-browser-sort/customElement.js +93 -0
  394. package/dist/components/arcgis-portal-browser-sort/index.d.ts +1 -0
  395. package/dist/components/arcgis-portal-browser-sort/index.js +9 -0
  396. package/dist/components/arcgis-portal-browser-sort/utils.d.ts +3 -0
  397. package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +190 -0
  398. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +50 -0
  399. package/dist/components/arcgis-portal-browser-top-bar/index.d.ts +1 -0
  400. package/dist/components/arcgis-portal-browser-top-bar/index.js +3 -0
  401. package/dist/components/arcgis-portal-browser-view/customElement.d.ts +21 -0
  402. package/dist/components/arcgis-portal-browser-view/customElement.js +30 -0
  403. package/dist/components/arcgis-portal-browser-view/index.d.ts +1 -0
  404. package/dist/components/arcgis-portal-browser-view/index.js +5 -0
  405. package/dist/components/arcgis-portal-classification-config/customElement.js +7 -7
  406. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  407. package/dist/components/arcgis-portal-field-delete/customElement.js +3 -2
  408. package/dist/components/arcgis-portal-group-badges/customElement.d.ts +0 -1
  409. package/dist/components/arcgis-portal-group-badges/customElement.js +26 -33
  410. package/dist/components/arcgis-portal-group-browser/customElement.d.ts +481 -0
  411. package/dist/components/arcgis-portal-group-browser/customElement.js +762 -0
  412. package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
  413. package/dist/components/arcgis-portal-group-browser/index.js +6 -0
  414. package/dist/components/arcgis-portal-group-browser/types.d.ts +244 -0
  415. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
  416. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
  417. package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
  418. package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
  419. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
  420. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +93 -0
  421. package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
  422. package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
  423. package/dist/components/arcgis-portal-group-card/customElement.d.ts +30 -26
  424. package/dist/components/arcgis-portal-group-card/customElement.js +71 -95
  425. package/dist/components/arcgis-portal-group-card/index.js +3 -3
  426. package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
  427. package/dist/components/arcgis-portal-info-banner/customElement.d.ts +14 -0
  428. package/dist/components/arcgis-portal-info-banner/customElement.js +31 -0
  429. package/dist/components/arcgis-portal-info-banner/index.d.ts +1 -0
  430. package/dist/components/arcgis-portal-info-banner/index.js +1 -0
  431. package/dist/components/arcgis-portal-item-actions/customElement.d.ts +74 -0
  432. package/dist/components/arcgis-portal-item-actions/customElement.js +89 -0
  433. package/dist/components/arcgis-portal-item-actions/index.d.ts +1 -0
  434. package/dist/components/arcgis-portal-item-actions/index.js +5 -0
  435. package/dist/components/arcgis-portal-item-badge/customElement.d.ts +260 -0
  436. package/dist/components/arcgis-portal-item-badge/customElement.js +9 -0
  437. package/dist/components/arcgis-portal-item-badge/index.d.ts +1 -0
  438. package/dist/components/arcgis-portal-item-badge/index.js +5 -0
  439. package/dist/components/arcgis-portal-item-badges/customElement.d.ts +48 -0
  440. package/dist/components/arcgis-portal-item-badges/customElement.js +35 -0
  441. package/dist/components/arcgis-portal-item-badges/index.d.ts +1 -0
  442. package/dist/components/arcgis-portal-item-badges/index.js +2 -0
  443. package/dist/components/arcgis-portal-item-badges/types.d.ts +1 -0
  444. package/dist/components/arcgis-portal-item-card/customElement.d.ts +215 -0
  445. package/dist/components/arcgis-portal-item-card/customElement.js +190 -0
  446. package/dist/components/arcgis-portal-item-card/index.d.ts +1 -0
  447. package/dist/components/arcgis-portal-item-card/index.js +10 -0
  448. package/dist/components/arcgis-portal-item-favorite/customElement.d.ts +36 -0
  449. package/dist/components/arcgis-portal-item-favorite/customElement.js +66 -0
  450. package/dist/components/arcgis-portal-item-favorite/index.d.ts +1 -0
  451. package/dist/components/arcgis-portal-item-favorite/index.js +3 -0
  452. package/dist/components/arcgis-portal-item-favorite/utils.d.ts +4 -0
  453. package/dist/components/arcgis-portal-item-type/customElement.d.ts +3 -1
  454. package/dist/components/arcgis-portal-item-type/customElement.js +22 -651
  455. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -38
  456. package/dist/components/arcgis-portal-navigation/customElement.d.ts +560 -0
  457. package/dist/components/arcgis-portal-navigation/customElement.js +1897 -0
  458. package/dist/components/arcgis-portal-navigation/index.d.ts +1 -0
  459. package/dist/components/arcgis-portal-navigation/index.js +30 -0
  460. package/dist/components/arcgis-portal-navigation/types.d.ts +44 -0
  461. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +53 -410
  462. package/dist/components/arcgis-portal-user-avatar/customElement.d.ts +9 -0
  463. package/dist/components/arcgis-portal-user-avatar/customElement.js +26 -37
  464. package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
  465. package/dist/components/arcgis-portal-user-popup/customElement.js +82 -141
  466. package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
  467. package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +14 -0
  468. package/dist/components/portal-browser/components/portal-browser-filter/index.js +3 -0
  469. package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +9 -0
  470. package/dist/components/portal-browser/components/portal-browser-filter-date/index.js +4 -0
  471. package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +11 -0
  472. package/dist/components/portal-browser/components/portal-browser-filters/index.js +2 -0
  473. package/dist/components/portal-group-browser-filters/customElement.js +129 -0
  474. package/dist/components/portal-group-browser-filters/index.js +5 -0
  475. package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
  476. package/dist/components/portal-group-browser-pagination/index.js +2 -0
  477. package/dist/components/portal-group-browser-sort/customElement.js +16 -0
  478. package/dist/components/portal-group-browser-sort/index.js +2 -0
  479. package/dist/docs/api.json +1 -1
  480. package/dist/docs/docs.json +1 -1
  481. package/dist/docs/vscode.css-custom-data.json +1 -1
  482. package/dist/docs/vscode.html-custom-data.json +1 -1
  483. package/dist/docs/web-types.json +1 -1
  484. package/dist/index.d.ts +196 -0
  485. package/dist/loader.js +27 -5
  486. package/dist/types/app-switcher.d.ts +71 -0
  487. package/dist/types/group.d.ts +14 -16
  488. package/dist/types/item.d.ts +80 -1
  489. package/dist/types/lumina.d.ts +160 -2
  490. package/dist/types/portal.d.ts +6 -0
  491. package/dist/types/preact.d.ts +182 -2
  492. package/dist/types/react.d.ts +204 -2
  493. package/dist/types/search.d.ts +30 -0
  494. package/dist/types/stencil.d.ts +162 -4
  495. package/dist/types/user.d.ts +16 -3
  496. package/package.json +10 -11
  497. package/dist/cdn/35SKVD6F.js +0 -2
  498. package/dist/cdn/5VSDGPHH.js +0 -2
  499. package/dist/cdn/72N3KAXN.js +0 -2
  500. package/dist/cdn/ANPXRYLV.js +0 -5
  501. package/dist/cdn/B7633S2A.js +0 -422
  502. package/dist/cdn/BEHLBKKM.js +0 -2
  503. package/dist/cdn/EVDOPN3G.js +0 -54
  504. package/dist/cdn/F2AM2M4H.js +0 -2
  505. package/dist/cdn/G47ZZQYL.js +0 -2
  506. package/dist/cdn/GAHILDQF.js +0 -45
  507. package/dist/cdn/GHQ3ZW4U.js +0 -2
  508. package/dist/cdn/IWJIVHBS.js +0 -65
  509. package/dist/cdn/JNRN6DTV.js +0 -2
  510. package/dist/cdn/JUN4NQAO.js +0 -2
  511. package/dist/cdn/K3HS2LQ7.js +0 -2
  512. package/dist/cdn/KEKBRUUC.js +0 -2
  513. package/dist/cdn/MX3F5ZCL.js +0 -2
  514. package/dist/cdn/O3KBWLGU.js +0 -2
  515. package/dist/cdn/OQDPULPD.js +0 -2
  516. package/dist/cdn/QB34ACZ2.js +0 -2
  517. package/dist/cdn/RBC6VGDJ.js +0 -516
  518. package/dist/cdn/RNLVNDGG.js +0 -2
  519. package/dist/cdn/TMYTUOSS.js +0 -2
  520. package/dist/cdn/UPEVTVNZ.js +0 -2
  521. package/dist/cdn/V2EOXGK2.js +0 -2
  522. package/dist/cdn/WZC4LHVH.js +0 -2
  523. package/dist/cdn/X5NBQPTM.js +0 -2
  524. package/dist/cdn/YG5YYL6X.js +0 -2
  525. package/dist/cdn/YIMNOUTF.js +0 -2
  526. package/dist/cdn/YL7PGYWC.js +0 -5
  527. package/dist/cdn/YMPTDKT6.js +0 -2
  528. package/dist/cdn/YVJRXWM3.js +0 -3
@@ -1,292 +1,111 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as Z } from "../../chunks/runtime.js";
3
- import { LitElement as tt, createEvent as et } from "@arcgis/lumina";
4
- import { css as st, render as at, html as w } from "lit";
5
- import { createRef as M, ref as T } from "lit/directives/ref.js";
6
- import { u as rt } from "../../chunks/useT9n.js";
7
- import { a as P, t as ot } from "../../chunks/functionalities.js";
8
- import { Annotation as h, StateGraph as $, START as G, END as y, NodeInterrupt as V } from "@langchain/langgraph/web";
9
- import { sendTraceMessage as g, invokeStructuredPrompt as b, createChatModel as F, sendUXSuggestion as B, createAgentRuntimeStateWithSharedState as E } from "@arcgis/ai-components/utils/index.js";
10
- import n from "zod";
11
- import { ChatPromptTemplate as L } from "@langchain/core/prompts";
12
- import { createAgent as Q } from "langchain";
13
- import { tool as K } from "@langchain/core/tools";
14
- import { s as nt, g as it, a as lt, c as ct, q as ut } from "../../chunks/groups.js";
15
- import mt from "@arcgis/core/identity/IdentityManager.js";
16
- import k from "@arcgis/core/request.js";
17
- import { Annotation as dt } from "@langchain/langgraph";
18
- const x = (s) => {
19
- for (let t = s.length - 1; t >= 0; t -= 1) {
20
- const e = s[t];
21
- if (e.type !== "human")
22
- continue;
23
- const a = e.content;
24
- if (typeof a == "string")
25
- return a;
26
- if (Array.isArray(a))
27
- return a.map(
28
- (r) => typeof r == "string" ? r : "text" in r && typeof r.text == "string" ? r.text : ""
29
- ).join(" ").trim();
30
- }
31
- return "";
32
- }, pt = () => ({ latestItemId: null, memory: {} }), N = (s) => {
33
- const t = s?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
34
- return t ? { latestItemId: t.latestItemId, memory: t.memory } : pt();
35
- }, gt = n.object({
36
- intent: n.enum(["summarize", "followUp", "clarify"]),
37
- itemId: n.string().default(""),
38
- question: n.string().default("")
39
- }), ht = n.object({ summary: n.string(), followUpQuestions: n.array(n.string()).default([]) }), ft = n.object({ answer: n.string(), isRelevant: n.boolean() }), yt = async (s, t) => {
40
- await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
41
- const e = N(s), a = s.analyticsItemId ?? e.latestItemId, r = a ? e.memory[a] : void 0, l = s.analyticsQuestion || x(s.agentExecutionContext.messages);
42
- return r ? {
43
- status: "success",
44
- outputMessage: (await b({
45
- promptText: bt,
46
- schema: ft,
47
- modelTier: "default",
48
- inputVariables: {
49
- summary: r.summary,
50
- question: l,
51
- fullContext: JSON.stringify(r.fullContext)
52
- }
53
- })).answer
54
- } : {
55
- status: "success",
56
- outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
57
- };
58
- }, bt = `
59
- You answer follow-up questions about an ArcGIS item.
60
-
61
- Ground your answer in the provided item context.
62
- If the answer is not available from the provided context, state that clearly and suggest what to check next.
63
-
64
- Response rules:
65
- - Reply in concise markdown.
66
- - Keep the answer focused on the follow-up question.
67
- - Do not include internal identifiers.
68
- - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
69
-
70
- Item summary:
71
- {summary}
72
-
73
- Item full context
74
- {fullContext}
75
-
76
- Question:
77
- {question}
78
- `;
79
- function I(s) {
80
- const { portal: t, user: e } = s ?? {};
81
- if (!s || !t || !e)
2
+ import { c as Fe } from "../../chunks/runtime.js";
3
+ import { LitElement as Oe, createEvent as Le } from "@arcgis/lumina";
4
+ import { css as je, render as Ve, html as v } from "lit";
5
+ import { createRef as E, ref as k } from "lit/directives/ref.js";
6
+ import { u as Be } from "../../chunks/useT9n.js";
7
+ import { NodeInterrupt as be, Annotation as h, StateGraph as N, START as P, END as w } from "@langchain/langgraph/web";
8
+ import { sendTraceMessage as g, invokeStructuredPrompt as b, sendUXSuggestion as J, createAgentRuntimeStateWithSharedState as G, createChatModel as _, getEmbeddings as Ke } from "@arcgis/ai-components/utils/index.js";
9
+ import s from "zod";
10
+ import { a as Qe, c as We, q as Je } from "../../chunks/groups2.js";
11
+ import Z from "@arcgis/core/identity/IdentityManager.js";
12
+ import ee from "@arcgis/core/request.js";
13
+ import { a as U, t as _e, b as Q } from "../../chunks/functionalities.js";
14
+ import { ChatPromptTemplate as Y } from "@langchain/core/prompts";
15
+ import { tool as Ie } from "@langchain/core/tools";
16
+ import { s as Ye, a as He } from "../../chunks/item.js";
17
+ import { g as Xe, e as Ze, i as et, c as tt, a as at } from "../../chunks/groups.js";
18
+ import nt from "@arcgis/core/portal/Portal.js";
19
+ const Se = (e) => {
20
+ const { portal: t, user: a } = e ?? {};
21
+ return !!e && !!t && !!a;
22
+ };
23
+ function x(e) {
24
+ if (!Se(e))
82
25
  throw new Error("Invalid context: PortalAssistantContext with portal and user is required.");
83
26
  }
84
- const W = K(
85
- async ({ itemTitle: s }, t) => {
86
- const e = s.trim();
87
- if (!e)
88
- return null;
89
- const a = t?.configurable?.context;
90
- I(a);
91
- const { result: r, error: l } = await nt(a.portal, e, { num: 1 });
92
- return l && console.error("Error searching for portal item by title:", l), r?.results[0]?.id || null;
93
- },
94
- {
95
- name: "resolvePortalItemIdByTitle",
96
- description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
97
- schema: n.object({
98
- itemTitle: n.string().describe("The portal item title to resolve to an item id.")
99
- })
100
- }
101
- ), It = async (s, t) => {
102
- await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
103
- const e = x(s.agentExecutionContext.messages), a = !!N(s).latestItemId, r = await L.fromTemplate(wt).format({
104
- userMessage: e,
105
- hasSummaryContext: String(a)
106
- }), c = await Q({
107
- model: await F({ modelTier: "fast" }),
108
- tools: [W],
109
- systemPrompt: r,
110
- responseFormat: gt,
111
- checkpointer: !0
112
- }).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: i, itemId: o, question: u } = c.structuredResponse, m = i === "clarify" || i === "summarize" && !o || i === "followUp" && !u;
113
- return {
114
- agentExecutionContext: { ...s.agentExecutionContext },
115
- analyticsIntent: m ? "clarify" : i,
116
- analyticsItemId: o || null,
117
- analyticsQuestion: u || "",
118
- status: "success",
119
- outputMessage: m ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
120
- };
121
- }, wt = `
122
- Classify the user analytics request.
27
+ const ot = `
28
+ Write a concise, friendly success message for adding members to a group.
123
29
 
124
30
  Rules:
125
- - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
126
- - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
127
- - intent="clarify" when neither summarize nor follow-up intent is clear.
128
- - itemId must be the final resolved item id.
129
- - If request has explicit item id, set itemId directly.
130
- - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
131
- - Never return item titles in output fields.
132
- - If intent is "followUp", set question to the user's full question/request text.
133
- - If intent is "summarize", set question="".
134
- - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
135
- - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
136
-
137
- Examples:
138
- - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
139
- - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
140
- - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
141
- - "Show the layer's available fields" => followUp
142
- - "List attributes and explain what status means" => followUp
143
- - "What fields are available?" with hasSummaryContext=true => followUp
144
- - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
31
+ - Keep it to 1-2 short sentences.
32
+ - Use plain text only.
33
+ - If there is no notAddedMembers, confirm that all requested members were added successfully.
34
+ - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
35
+ - Make sure to bold the usernames
145
36
 
146
- hasSummaryContext:
147
- {hasSummaryContext}
37
+ Added members:
38
+ {addedMembers}
148
39
 
149
- User message:
150
- {userMessage}
151
- `, xt = async (s, t) => {
152
- const e = s.analyticsItemId;
153
- if (!e)
154
- return {
155
- status: "success",
156
- outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
157
- };
158
- await g({ text: `Summarizing item ${e}...`, agentName: "analytics" }, t);
159
- const a = t?.configurable?.context;
160
- I(a);
161
- const { portal: r, user: l } = a, { result: c, error: i } = await it(l, r, e);
162
- if (i || !c)
163
- return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
164
- status: "success",
165
- outputMessage: "Unable to retrieve item context for summarization."
166
- };
167
- const { context: o } = c, u = await b({
168
- promptText: vt,
169
- schema: ht,
170
- modelTier: "default",
171
- inputVariables: { context: JSON.stringify(o) }
172
- }), { followUpQuestions: d, summary: p } = u, m = N(s), f = {
173
- latestItemId: e,
174
- memory: {
175
- ...m.memory,
176
- [e]: { summary: p, followUpQuestions: d, fullContext: o }
177
- }
178
- };
179
- return d.length && await B({ type: "suggested-prompts", data: { prompts: d } }, t), {
180
- status: "success",
181
- outputMessage: p,
182
- sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
183
- };
184
- }, vt = `
185
- You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
186
- Summary rules:
187
- - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
188
- - Target length: 80-150 words.
189
- - Provide one short descriptive paragraph.
190
- - Also propose 3 concise follow-up questions grounded in the item summary.
191
- - Keep follow-up questions specific and actionable.
192
- Follow-up questions rules:
193
- - These questions should be in the format of a prompt that the user can click on.
194
- - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
195
- Do not include internal identifiers.
196
- If the user asks for a detailed summary, you may expand the response up to 300 words.
197
- Item context:
198
- {context}
199
- `, C = (s, t) => t ?? s, O = h.Root({
200
- ...E(),
201
- // States shared only across nodes in the graph, not between invocations
202
- analyticsIntent: h({
203
- reducer: C,
204
- default: () => "clarify"
205
- }),
206
- analyticsItemId: h({
207
- reducer: C,
208
- default: () => null
209
- }),
210
- analyticsQuestion: h({
211
- reducer: C,
212
- default: () => ""
213
- })
214
- }), St = () => new $(O).addNode("detectAnalyticsIntent", It).addNode("summarizePortalItem", xt).addNode("answerAnalyticsFollowUp", yt).addEdge(G, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : y).addEdge("summarizePortalItem", y).addEdge("answerAnalyticsFollowUp", y), Mt = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
215
- - summarizes ArcGIS portal items from item context
216
- - suggests follow-up prompts grounded in the item
217
- `, Tt = {
218
- id: "portal-item-analytics",
219
- name: "Portal Item Analytics",
220
- description: Mt,
221
- createGraph: St,
222
- workspace: O
223
- }, Pt = (s) => s.map((t) => `"${t}"`).join(", "), At = n.object({
224
- successMessage: n.string().default("")
225
- }), q = "portal-group-creation", D = "approveAddMembers", Ct = async (s, t) => {
226
- if (s.intentParams.intent !== "addMembers")
40
+ Not added members:
41
+ {notAddedMembers}
42
+ `, rt = (e) => e.map((t) => `"${t}"`).join(", "), st = s.object({
43
+ successMessage: s.string().default("")
44
+ }), te = "portal-group-creation", ae = "approveAddMembers", it = async (e, t) => {
45
+ if (e.intentParams.intent !== "addMembers")
227
46
  return {
228
47
  status: "success",
229
48
  outputMessage: "Use @mention usernames for the members you want to add."
230
49
  };
231
- const e = s.agentExecutionContext.sharedState.createdGroupId?.value;
232
- if (!e)
50
+ const a = e.agentExecutionContext.sharedState.createdGroupId?.value;
51
+ if (!a)
233
52
  return {
234
53
  status: "success",
235
54
  outputMessage: "Create a group first, then add members using @mention usernames."
236
55
  };
237
- const a = s.intentParams.memberInfo.memberIdentifiers.map((m) => m.trim()).filter(Boolean);
238
- if (!a.length)
56
+ const n = e.intentParams.memberInfo.memberIdentifiers.map((m) => m.trim()).filter(Boolean);
57
+ if (!n.length)
239
58
  return {
240
59
  status: "success",
241
60
  outputMessage: "Use @mention usernames for the members you want to add."
242
61
  };
243
- const l = `The following member(s) will be added to the newly created group:
62
+ const r = `The following member(s) will be added to the newly created group:
244
63
 
245
- ${a.map((m) => `- **@${m}**`).join(`
64
+ ${n.map((m) => `- **@${m}**`).join(`
246
65
  `)}
247
66
 
248
- Do you want to continue?`, { hitlResponse: c } = t?.configurable ?? {};
249
- if (c?.agentId !== q || c.id !== D) {
67
+ Do you want to continue?`, { hitlResponse: i } = t?.configurable ?? {};
68
+ if (i?.agentId !== te || i.id !== ae) {
250
69
  const m = {
251
- agentId: q,
252
- id: D,
70
+ agentId: te,
71
+ id: ae,
253
72
  kind: "booleanChoice",
254
- message: l,
73
+ message: r,
255
74
  metadata: {
256
75
  action: "addMembers",
257
- groupId: e,
258
- members: [...a]
76
+ groupId: a,
77
+ members: [...n]
259
78
  }
260
79
  };
261
- throw new V(m);
80
+ throw new be(m);
262
81
  }
263
- if (c.payload !== !0)
82
+ if (i.payload !== !0)
264
83
  return {
265
84
  status: "success",
266
85
  outputMessage: "Okay, I cancelled adding members to the group."
267
86
  };
268
87
  await g(
269
- { text: `Adding members ${Pt(a)}...`, agentName: "group-creation" },
88
+ { text: `Adding members ${rt(n)}...`, agentName: "group-creation" },
270
89
  t
271
90
  );
272
- const i = t?.configurable?.context;
273
- I(i);
274
- const { result: o, error: u } = await lt(i.portal, e, a);
275
- if (u || !o)
91
+ const u = t?.configurable?.context;
92
+ x(u);
93
+ const { result: c, error: d } = await Qe(u.portal, a, n);
94
+ if (d || !c)
276
95
  return {
277
96
  status: "success",
278
97
  outputMessage: "I could not add members to that group. Please confirm group access and user accounts, then try again."
279
98
  };
280
- const { addedUsernames: d, notAddedUsers: p } = o;
99
+ const { addedUsernames: l, notAddedUsers: p } = c;
281
100
  try {
282
101
  const f = (await b({
283
- promptText: $t,
284
- schema: At,
102
+ promptText: ot,
103
+ schema: st,
285
104
  modelTier: "fast",
286
105
  inputVariables: {
287
- addedMembers: d.join(", "),
106
+ addedMembers: l.join(", "),
288
107
  notAddedMembers: JSON.stringify(
289
- p.map((v) => ({ username: v.username, reason: v.error.message }))
108
+ p.map((y) => ({ username: y.username, reason: y.error.message }))
290
109
  )
291
110
  }
292
111
  })).successMessage;
@@ -296,74 +115,85 @@ Do you want to continue?`, { hitlResponse: c } = t?.configurable ?? {};
296
115
  console.error("Error generating add-members success message:", m);
297
116
  }
298
117
  return {};
299
- }, $t = `
300
- Write a concise, friendly success message for adding members to a group.
118
+ }, ct = `
119
+ Write a concise, friendly success message after creating a portal group.
120
+
121
+ Rules:
122
+ - Mention that the group was created successfully.
123
+ - Mention that the user can add members by using @mention usernames.
124
+ - Keep it to 1-2 short sentences.
125
+ - Make sure to bold the group title in the message.
126
+
127
+ Group title:
128
+ {groupTitle}
129
+ `, ut = `
130
+ Write a concise, friendly failure message after an attempt to create a portal group.
301
131
 
302
132
  Rules:
303
133
  - Keep it to 1-2 short sentences.
304
134
  - Use plain text only.
305
- - If there is no notAddedMembers, confirm that all requested members were added successfully.
306
- - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
307
- - Make sure to bold the usernames
135
+ - Mention that group creation failed.
136
+ - Include the failure reason in user-friendly language.
137
+ - End with a clear next step the user can try.
308
138
 
309
- Added members:
310
- {addedMembers}
139
+ Group title:
140
+ {groupTitle}
311
141
 
312
- Not added members:
313
- {notAddedMembers}
314
- `, R = "portal-group-creation", U = "approveCreateGroup", Gt = n.object({
315
- successMessage: n.string().default("")
316
- }), Et = n.object({
317
- failureMessage: n.string().default("")
318
- }), Nt = async (s, t) => {
319
- if (s.intentParams.intent !== "create")
142
+ Failure reason:
143
+ {failureReason}
144
+ `, ne = "portal-group-creation", oe = "approveCreateGroup", lt = s.object({
145
+ successMessage: s.string().default("")
146
+ }), dt = s.object({
147
+ failureMessage: s.string().default("")
148
+ }), pt = async (e, t) => {
149
+ if (e.intentParams.intent !== "create")
320
150
  return {
321
151
  status: "success",
322
152
  outputMessage: "Tell me the group title you want to use."
323
153
  };
324
- const e = s.intentParams.title.trim();
325
- if (!e)
154
+ const a = e.intentParams.title.trim();
155
+ if (!a)
326
156
  return {
327
157
  status: "success",
328
158
  outputMessage: "What title would you like for the new group?"
329
159
  };
330
- const a = `A group with the title **${e}** will be created. Do you want to continue?`, { hitlResponse: r } = t?.configurable;
331
- if (r?.agentId !== R || r.id !== U) {
332
- const u = {
333
- agentId: R,
334
- id: U,
160
+ const n = `A group with the title **${a}** will be created. Do you want to continue?`, { hitlResponse: o } = t?.configurable;
161
+ if (o?.agentId !== ne || o.id !== oe) {
162
+ const d = {
163
+ agentId: ne,
164
+ id: oe,
335
165
  kind: "booleanChoice",
336
- message: a,
166
+ message: n,
337
167
  metadata: {
338
168
  action: "createGroup",
339
- title: e,
169
+ title: a,
340
170
  access: "private"
341
171
  }
342
172
  };
343
- throw new V(u);
173
+ throw new be(d);
344
174
  }
345
- if (r.payload !== !0)
175
+ if (o.payload !== !0)
346
176
  return {
347
177
  status: "success",
348
- outputMessage: `Okay, I cancelled creating **${e}**.`
178
+ outputMessage: `Okay, I cancelled creating **${a}**.`
349
179
  };
350
- await g({ text: `Creating group "${e}"...`, agentName: "group-creation" }, t);
351
- const l = t?.configurable?.context;
352
- I(l);
353
- const { result: c, error: i } = await ct(l.portal, {
354
- title: e,
180
+ await g({ text: `Creating group "${a}"...`, agentName: "group-creation" }, t);
181
+ const r = t?.configurable?.context;
182
+ x(r);
183
+ const { result: i, error: u } = await We(r.portal, {
184
+ title: a,
355
185
  access: "private"
356
186
  });
357
- if (i || !c) {
358
- const u = i?.message?.trim() || "No additional details were provided.";
187
+ if (u || !i) {
188
+ const d = u?.message?.trim() || "No additional details were provided.";
359
189
  try {
360
190
  const p = (await b({
361
- promptText: qt,
362
- schema: Et,
191
+ promptText: ut,
192
+ schema: dt,
363
193
  modelTier: "fast",
364
194
  inputVariables: {
365
- groupTitle: e,
366
- failureReason: u
195
+ groupTitle: a,
196
+ failureReason: d
367
197
  }
368
198
  })).failureMessage.trim();
369
199
  if (p)
@@ -371,80 +201,50 @@ Not added members:
371
201
  status: "success",
372
202
  outputMessage: p
373
203
  };
374
- } catch (d) {
375
- console.error("Error generating create-group failure message:", d);
204
+ } catch (l) {
205
+ console.error("Error generating create-group failure message:", l);
376
206
  }
377
207
  return {
378
208
  status: "success",
379
209
  outputMessage: "I could not create that group. Please confirm your permissions and try again with the group title."
380
210
  };
381
211
  }
382
- const o = c.id;
212
+ const c = i.id;
383
213
  try {
384
- const d = (await b({
385
- promptText: kt,
386
- schema: Gt,
214
+ const l = (await b({
215
+ promptText: ct,
216
+ schema: lt,
387
217
  modelTier: "fast",
388
218
  inputVariables: {
389
- groupTitle: e
219
+ groupTitle: a
390
220
  }
391
221
  })).successMessage.trim();
392
- if (d)
222
+ if (l)
393
223
  return {
394
224
  status: "success",
395
- outputMessage: d,
396
- sharedStatePatch: { createdGroupId: { value: o } },
397
- createdGroupId: o
225
+ outputMessage: l,
226
+ sharedStatePatch: { createdGroupId: { value: c } },
227
+ createdGroupId: c
398
228
  };
399
- } catch (u) {
400
- console.error("Error generating create-group success message:", u);
229
+ } catch (d) {
230
+ console.error("Error generating create-group success message:", d);
401
231
  }
402
232
  return {};
403
- }, kt = `
404
- Write a concise, friendly success message after creating a portal group.
405
-
406
- Rules:
407
- - Mention that the group was created successfully.
408
- - Mention that the user can add members by using @mention usernames.
409
- - Keep it to 1-2 short sentences.
410
- - Make sure to bold the group title in the message.
411
-
412
- Group title:
413
- {groupTitle}
414
- `, qt = `
415
- Write a concise, friendly failure message after an attempt to create a portal group.
416
-
417
- Rules:
418
- - Keep it to 1-2 short sentences.
419
- - Use plain text only.
420
- - Mention that group creation failed.
421
- - Include the failure reason in user-friendly language.
422
- - End with a clear next step the user can try.
423
-
424
- Group title:
425
- {groupTitle}
426
-
427
- Failure reason:
428
- {failureReason}
429
- `, Dt = n.object({
430
- intent: n.enum(["clarify", "create", "addMembers"]).default("clarify"),
431
- title: n.string().default(""),
432
- memberIdentifiers: n.array(n.string()).default([]),
433
- clarifyMessage: n.string().default("")
434
- }), Rt = async (s, t) => {
435
- await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
436
- const e = x(s.agentExecutionContext.messages).trim(), a = await b({
437
- promptText: Ut,
438
- schema: Dt,
439
- modelTier: "default",
440
- inputVariables: { userMessage: e }
441
- }), r = a.title.trim(), l = a.memberIdentifiers.filter(Boolean), c = a.clarifyMessage.trim(), i = a.intent === "create" && !!r, o = a.intent === "addMembers" && l.length > 0;
442
- return {
443
- intentParams: i ? { intent: "create", title: r } : o ? { intent: "addMembers", memberInfo: { memberIdentifiers: l } } : { intent: "clarify" },
444
- status: "success",
445
- outputMessage: !i && !o ? c : ""
446
- };
447
- }, Ut = `
233
+ }, I = (e) => {
234
+ for (let t = e.length - 1; t >= 0; t -= 1) {
235
+ const a = e[t];
236
+ if (a.type !== "human")
237
+ continue;
238
+ const n = a.content;
239
+ if (typeof n == "string")
240
+ return n;
241
+ if (Array.isArray(n))
242
+ return n.map(
243
+ (o) => typeof o == "string" ? o : "text" in o && typeof o.text == "string" ? o.text : ""
244
+ ).join(" ").trim();
245
+ }
246
+ return "";
247
+ }, mt = `
448
248
  You classify whether a user is asking to create a new ArcGIS Portal group or add members to an existing group.
449
249
 
450
250
  Rules:
@@ -470,385 +270,1935 @@ Examples:
470
270
 
471
271
  User message:
472
272
  {userMessage}
473
- `, zt = n.discriminatedUnion("destinationType", [
474
- n.object({
475
- destinationType: n.literal("portal-content")
476
- }),
477
- n.object({
478
- destinationType: n.literal("portal-groups")
479
- }),
480
- n.object({
481
- destinationType: n.literal("portal-item"),
482
- itemId: n.string().trim().min(1)
483
- }),
484
- n.object({
485
- destinationType: n.literal("portal-group"),
486
- groupId: n.string().trim().min(1)
487
- })
488
- ]);
489
- function jt(s) {
490
- const t = zt.safeParse(s);
491
- return t.success ? t.data : void 0;
492
- }
493
- const _ = "portal-navigation", J = async (s, t) => {
494
- await B({ type: _, data: { ...s } }, t);
495
- }, Vt = async (s, t) => {
496
- const e = s.createdGroupId ?? s.agentExecutionContext.sharedState.createdGroupId?.value;
497
- return e ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await J({ destinationType: "portal-group", groupId: e }, t), {}) : {};
498
- }, z = (s, t) => t ?? s, Y = h.Root({
499
- ...E(),
273
+ `, gt = s.object({
274
+ intent: s.enum(["clarify", "create", "addMembers"]).default("clarify"),
275
+ title: s.string().default(""),
276
+ memberIdentifiers: s.array(s.string()).default([]),
277
+ clarifyMessage: s.string().default("")
278
+ }), ht = async (e, t) => {
279
+ await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
280
+ const a = I(e.agentExecutionContext.messages).trim(), n = await b({
281
+ promptText: mt,
282
+ schema: gt,
283
+ modelTier: "default",
284
+ inputVariables: { userMessage: a }
285
+ }), o = n.title.trim(), r = n.memberIdentifiers.filter(Boolean), i = n.clarifyMessage.trim(), u = n.intent === "create" && !!o, c = n.intent === "addMembers" && r.length > 0;
286
+ return {
287
+ intentParams: u ? { intent: "create", title: o } : c ? { intent: "addMembers", memberInfo: { memberIdentifiers: r } } : { intent: "clarify" },
288
+ status: "success",
289
+ outputMessage: !u && !c ? i : ""
290
+ };
291
+ }, ft = [
292
+ "general",
293
+ "about",
294
+ "homePage",
295
+ "gallery",
296
+ "aiAssistants",
297
+ "map",
298
+ "items",
299
+ "groups",
300
+ "webhooks",
301
+ "utilityServices",
302
+ "agol",
303
+ "esriContent",
304
+ "livingAtlas",
305
+ "servers",
306
+ "memberRoles",
307
+ "newMemberDefaults",
308
+ "marketplace",
309
+ "collaborations",
310
+ "credits",
311
+ "security",
312
+ "openData",
313
+ "hub",
314
+ "orgExtensions"
315
+ ], yt = ["newItem", "createLayer", "developerCredentials"], wt = ["favorites", "group", "living-atlas", "org"], vt = ["featured", "my", "organization"], bt = ["licenses", "members", "overview", "reports", "settings", "status"], It = s.object({
316
+ destinationType: s.literal("portal-content"),
317
+ hash: s.enum(wt).optional(),
318
+ queryParams: s.object({
319
+ newItem: s.enum(yt).optional()
320
+ }).optional()
321
+ }), St = s.object({
322
+ destinationType: s.literal("portal-groups"),
323
+ hash: s.enum(vt).optional()
324
+ }), xt = s.object({
325
+ destinationType: s.literal("portal-org"),
326
+ hash: s.enum(bt).optional(),
327
+ queryParams: s.object({
328
+ tab: s.enum(ft).optional(),
329
+ section: s.string().optional(),
330
+ subsection: s.string().optional(),
331
+ period: s.string().optional(),
332
+ startTime: s.string().optional(),
333
+ endTime: s.string().optional()
334
+ }).optional()
335
+ }), Tt = s.object({
336
+ destinationType: s.literal("portal-item"),
337
+ itemId: s.string().trim().min(1)
338
+ }), Mt = s.object({
339
+ destinationType: s.literal("portal-group"),
340
+ groupId: s.string().trim().min(1)
341
+ }), Ct = s.object({
342
+ destinationType: s.union([
343
+ s.literal("portal-gallery"),
344
+ s.literal("portal-map-viewer"),
345
+ s.literal("portal-notebooks"),
346
+ s.literal("portal-scene-viewer")
347
+ ])
348
+ }), At = s.union([
349
+ It,
350
+ St,
351
+ xt,
352
+ Tt,
353
+ Mt,
354
+ Ct
355
+ ]), xe = "portal-navigation", F = async (e, t) => {
356
+ const a = t?.configurable?.context;
357
+ !Se(a) || !a.navigationTargetMap?.[e.destinationType] || await J({ type: xe, data: { ...e } }, t);
358
+ }, Nt = async (e, t) => {
359
+ const a = e.createdGroupId ?? e.agentExecutionContext.sharedState.createdGroupId?.value;
360
+ return a ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await F({ destinationType: "portal-group", groupId: a }, t), {}) : {};
361
+ }, re = (e, t) => t ?? e, Te = h.Root({
362
+ ...G(),
500
363
  // * Shared state between nodes (but not persisted to the agent execution context)
501
364
  /** Parameters related to the user's intent for group creation actions */
502
- intentParams: h({ reducer: z, default: () => ({ intent: "clarify" }) }),
365
+ intentParams: h({ reducer: re, default: () => ({ intent: "clarify" }) }),
503
366
  /** The ID of the group that was created
504
367
  * even though we already have this in the shared state
505
368
  * we still need it here to also share between nodes
506
369
  */
507
- createdGroupId: h({ reducer: z, default: () => "" })
508
- }), Ft = () => new $(Y).addNode("detectGroupCreationIntent", Rt).addNode("createPortalGroup", Nt).addNode("addMembersToPortalGroup", Ct).addNode("suggestCreatedGroupNavigation", Vt).addEdge(G, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
370
+ createdGroupId: h({ reducer: re, default: () => "" })
371
+ }), Pt = () => new N(Te).addNode("detectGroupCreationIntent", ht).addNode("createPortalGroup", pt).addNode("addMembersToPortalGroup", it).addNode("suggestCreatedGroupNavigation", Nt).addEdge(P, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
509
372
  switch (t.intentParams.intent) {
510
373
  case "create":
511
374
  return "createPortalGroup";
512
375
  case "addMembers":
513
376
  return "addMembersToPortalGroup";
514
377
  default:
515
- return y;
378
+ return w;
516
379
  }
517
- }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", y), Bt = String.raw`- **portal-group-creation** - Portal group creation assistant:
380
+ }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", w), Gt = String.raw`- **portal-group-creation** - Portal group creation assistant:
518
381
  - creates a new ArcGIS Portal group for the signed-in user
519
382
  - adds users to the newly created group using @mention usernames
520
- `, Lt = {
383
+ `, qt = {
521
384
  id: "portal-group-creation",
522
385
  name: "Portal Group Creation",
523
- description: Bt,
524
- createGraph: Ft,
525
- workspace: Y
526
- }, H = "portalDocAssistantMemory", Qt = () => ({ conversationId: "" }), Kt = (s) => {
527
- const t = s?.[H]?.value;
386
+ description: Gt,
387
+ createGraph: Pt,
388
+ workspace: Te
389
+ }, Me = "portalDocAssistantMemory", Et = () => ({ conversationId: "" }), kt = (e) => {
390
+ const t = e?.[Me]?.value;
528
391
  if (!t || typeof t != "object")
529
- return Qt();
530
- const e = t;
392
+ return Et();
393
+ const a = t;
531
394
  return {
532
- conversationId: typeof e.conversationId == "string" ? e.conversationId : ""
395
+ conversationId: typeof a.conversationId == "string" ? a.conversationId : ""
533
396
  };
534
- }, Wt = (s) => ({
535
- [H]: { value: s }
536
- });
537
- async function Ot({
538
- portal: s,
397
+ }, zt = (e) => ({
398
+ [Me]: { value: e }
399
+ }), $t = {
400
+ pipeline: {
401
+ follow_up: { allow: !1 }
402
+ }
403
+ };
404
+ function Dt(e) {
405
+ return {
406
+ kind: "DocAIAssistantRequest",
407
+ filters: {
408
+ ...$t,
409
+ persona: { persona: e }
410
+ }
411
+ };
412
+ }
413
+ const Rt = "https://www.arcgis.com/sharing/rest";
414
+ async function Ut({
415
+ portal: e,
539
416
  question: t,
540
- persona: e,
541
- previousConversationId: a,
417
+ persona: a,
418
+ previousConversationId: n,
419
+ useProdDocAssistant: o,
542
420
  signal: r,
543
- skillId: l
421
+ skillId: i
544
422
  }) {
545
- l ??= "doc_ai_assistant";
546
- const i = await _t({
547
- portal: s,
548
- skillId: l,
423
+ i ??= "doc_ai_assistant";
424
+ const u = Dt(a), c = await Ft({
425
+ portal: e,
426
+ skillId: i,
549
427
  message: t,
550
- options: { context: {
551
- kind: "DocAIAssistantRequest",
552
- filters: { persona: { persona: e } }
553
- }, previousConversationId: a, signal: r }
428
+ options: { context: u, previousConversationId: n, useProdDocAssistant: o, signal: r }
554
429
  });
555
430
  return {
556
- reply: Jt(i, l),
557
- conversationId: i[0]?.conversationId ?? ""
431
+ reply: Ot(c, i),
432
+ conversationId: c[0]?.conversationId ?? ""
558
433
  };
559
434
  }
560
- async function _t({
561
- portal: s,
435
+ async function Ft({
436
+ portal: e,
562
437
  skillId: t,
563
- message: e,
564
- options: a
438
+ message: a,
439
+ options: n
565
440
  }) {
566
- const l = `${s.helperServices.aiAssistantServices.url}/skills/${t}/chat`, c = {
441
+ const o = e.helperServices.aiAssistantServices.url, i = `${n.useProdDocAssistant ? "https://aiservices-beta.arcgis.com" : o}/skills/${t}/chat`, c = {
567
442
  "Content-Type": "application/json",
568
- token: mt.findCredential(s.url)?.token ?? ""
569
- }, i = await k(l, {
443
+ token: n.useProdDocAssistant ? (await Z.getCredential(Rt, { oAuthPopupConfirmation: !1 })).token : Z.findCredential(e.url)?.token ?? ""
444
+ }, d = await ee(i, {
570
445
  method: "post",
571
446
  body: JSON.stringify({
572
- message: e,
573
- context: a.context,
574
- conversationId: a.previousConversationId
447
+ message: a,
448
+ context: n.context,
449
+ conversationId: n.previousConversationId
575
450
  }),
576
451
  headers: c,
577
- signal: a.signal
452
+ signal: n.signal
578
453
  });
579
- if (i.httpStatus !== 200)
580
- throw new Error(`Doc assistant chat failed (${i.httpStatus})`, {
581
- cause: i.data
454
+ if (d.httpStatus !== 200)
455
+ throw new Error(`Doc assistant chat failed (${d.httpStatus})`, {
456
+ cause: d.data
582
457
  });
583
- const o = i.data, u = [o], { conversationId: d, inquiryId: p } = o, m = async (f, v) => {
584
- if (!v)
458
+ const l = d.data, p = [l], { conversationId: m, inquiryId: f } = l, y = async (M, q) => {
459
+ if (!q)
585
460
  return;
586
- await ot(1e3);
587
- const S = await k(l, {
461
+ await _e(500);
462
+ const T = await ee(i, {
588
463
  method: "post",
589
- body: JSON.stringify({ conversationId: d, inquiryId: p, ackSequenceNumber: f }),
464
+ body: JSON.stringify({ conversationId: m, inquiryId: f, ackSequenceNumber: M }),
590
465
  headers: c,
591
- signal: a.signal
466
+ signal: n.signal
592
467
  });
593
- if (S.httpStatus !== 200)
594
- throw new Error(`Doc assistant poll failed (${S.httpStatus})`, {
595
- cause: S.data
468
+ if (T.httpStatus !== 200)
469
+ throw new Error(`Doc assistant poll failed (${T.httpStatus})`, {
470
+ cause: T.data
596
471
  });
597
- const A = S.data;
598
- u.push(A), await m(A.sequenceNumber, A.hasMore);
472
+ const C = T.data;
473
+ p.push(C), await y(C.sequenceNumber, C.hasMore);
599
474
  };
600
- return o.hasMore && await m(o.sequenceNumber, o.hasMore), u;
475
+ return l.hasMore && await y(l.sequenceNumber, l.hasMore), p;
601
476
  }
602
- function Jt(s, t) {
477
+ function Ot(e, t) {
603
478
  switch (t) {
604
479
  case "doc_chat":
605
- return s.find((e) => e.message != null)?.message ?? "";
480
+ return e.find((a) => a.message != null)?.message ?? "";
606
481
  case "doc_ai_assistant":
607
- for (let e = s.length - 1; e >= 0; e -= 1) {
608
- const a = s[e];
609
- if (a.context?.kind === "DocAIAssistantContext") {
610
- const r = a.context.results?.[0]?.reply;
611
- if (r)
612
- return r;
482
+ for (let a = e.length - 1; a >= 0; a -= 1) {
483
+ const n = e[a];
484
+ if (n.context?.kind === "DocAIAssistantContext") {
485
+ const o = n.context.results?.[0]?.reply;
486
+ if (o)
487
+ return o;
613
488
  }
614
489
  }
615
490
  return "";
616
491
  default:
617
- return P(t);
492
+ return U(t);
618
493
  }
619
494
  }
620
- const Yt = async (s, t) => {
621
- await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
622
- const e = x(s.agentExecutionContext.messages).trim();
623
- if (!e)
495
+ const Lt = async (e, t) => {
496
+ const a = performance.now();
497
+ try {
498
+ await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
499
+ const n = I(e.agentExecutionContext.messages).trim();
500
+ if (!n)
501
+ return {
502
+ status: "success",
503
+ outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
504
+ };
505
+ const o = t?.configurable?.context;
506
+ x(o);
507
+ const r = kt(e.agentExecutionContext.sharedState), { reply: i, conversationId: u } = await Ut({
508
+ portal: o.portal,
509
+ question: n,
510
+ previousConversationId: r.conversationId || void 0,
511
+ skillId: "doc_ai_assistant",
512
+ persona: "doc-online",
513
+ useProdDocAssistant: o.useProdDocAssistant
514
+ });
624
515
  return {
625
516
  status: "success",
626
- outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
517
+ outputMessage: i.trim() || "I could not retrieve a response from the documentation assistant.",
518
+ sharedStatePatch: zt({
519
+ conversationId: u || r.conversationId
520
+ })
627
521
  };
628
- const a = t?.configurable?.context;
629
- I(a);
630
- const r = Kt(s.agentExecutionContext.sharedState), { reply: l, conversationId: c } = await Ot({
631
- portal: a.portal,
632
- question: e,
633
- previousConversationId: r.conversationId || void 0,
634
- skillId: "doc_ai_assistant",
635
- persona: "developers"
636
- });
637
- return {
638
- status: "success",
639
- outputMessage: l.trim() || "I could not retrieve a response from the documentation assistant.",
640
- sharedStatePatch: Wt({
641
- conversationId: c || r.conversationId
642
- })
643
- };
644
- }, Ht = K(
645
- async ({ groupTitle: s }, t) => {
646
- const e = s.trim();
647
- if (!e)
522
+ } finally {
523
+ console.info("[arcgis-portal-ai-assistant] node timing", {
524
+ agent: "portal-doc-assistant",
525
+ node: "answerDocQuestion",
526
+ durationMs: Number((performance.now() - a).toFixed(1))
527
+ });
528
+ }
529
+ }, Ce = Ie(
530
+ async ({ groupTitle: e }, t) => {
531
+ const a = e.trim();
532
+ if (!a)
648
533
  return null;
649
- const a = t?.configurable?.context;
650
- I(a);
534
+ const n = t?.configurable?.context;
535
+ x(n);
651
536
  try {
652
- return (await ut(a.portal, { query: `title:${e}`, num: 1 }))?.results[0]?.id || null;
653
- } catch (r) {
654
- return console.error("Error searching for portal group by title:", r), null;
537
+ return (await Je(n.portal, { query: `title:${a}`, num: 1 }))?.results[0]?.id || null;
538
+ } catch (o) {
539
+ return console.error("Error searching for portal group by title:", o), null;
655
540
  }
656
541
  },
657
542
  {
658
543
  name: "resolvePortalGroupIdByTitle",
659
544
  description: "Resolves an ArcGIS Portal group title to the best-match group id. Use this when a user references a group by title instead of an explicit group id.",
660
- schema: n.object({
661
- groupTitle: n.string().describe("The portal group title to resolve to a group id.")
545
+ schema: s.object({
546
+ groupTitle: s.string().describe("The portal group title to resolve to a group id.")
662
547
  })
663
548
  }
664
- ), j = n.object({
665
- shouldSuggestNavigation: n.boolean().default(!1),
666
- destinationType: n.enum(["none", "portal-content", "portal-item", "portal-groups", "portal-group"]).default("none"),
667
- itemId: n.string().default(""),
668
- groupId: n.string().default("")
669
- }), Xt = async (s, t) => {
670
- await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
671
- const e = s.outputMessage.trim();
672
- if (!e)
673
- return {};
674
- const a = x(s.agentExecutionContext.messages).trim(), r = await L.fromTemplate(te).format({
675
- question: a,
676
- response: e
677
- }), c = await Q({
678
- model: await F({ modelTier: "default" }),
679
- tools: [W, Ht],
680
- systemPrompt: r,
681
- responseFormat: j,
682
- checkpointer: !0
683
- }).invoke({ messages: s.agentExecutionContext.messages }, t), i = j.parse(c.structuredResponse ?? {});
684
- if (!i.shouldSuggestNavigation || i.destinationType === "none")
685
- return {};
686
- const o = Zt(i);
687
- return o ? (await J(o, t), {}) : {};
688
- };
689
- function Zt({
690
- destinationType: s,
691
- itemId: t,
692
- groupId: e
693
- }) {
694
- switch (s) {
695
- case "portal-content":
696
- return { destinationType: "portal-content" };
697
- case "portal-groups":
698
- return { destinationType: "portal-groups" };
699
- case "portal-item":
700
- return t ? { destinationType: "portal-item", itemId: t } : null;
701
- case "portal-group":
702
- return e ? { destinationType: "portal-group", groupId: e } : null;
703
- case "none":
549
+ ), Ae = Ie(
550
+ async ({ itemTitle: e }, t) => {
551
+ const a = e.trim();
552
+ if (!a)
704
553
  return null;
705
- default:
706
- return P(s);
554
+ const n = t?.configurable?.context;
555
+ x(n);
556
+ const { result: o, error: r } = await Ye(n.portal, a, { num: 1 });
557
+ return r && console.error("Error searching for portal item by title:", r), o?.results[0]?.id || null;
558
+ },
559
+ {
560
+ name: "resolvePortalItemIdByTitle",
561
+ description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
562
+ schema: s.object({
563
+ itemTitle: s.string().describe("The portal item title to resolve to an item id.")
564
+ })
707
565
  }
566
+ );
567
+ function A(e, t = "#") {
568
+ const a = e.match(new RegExp(`\\${t}"([^"]+)"`, "u"));
569
+ if (a?.[1])
570
+ return a[1].trim();
571
+ const n = e.match(new RegExp(`\\${t}([^\\s"']+)`, "u"));
572
+ return n?.[1] ? n[1].trim() : null;
708
573
  }
709
- const te = `
710
- You decide whether the assistant response should include a navigation action to ArcGIS Portal.
711
-
712
- Given the user question and assistant response:
713
- - Decide if a navigation action would help the user complete the task.
714
- - If yes, choose one destination type:
715
- - portal-content: portal content page
716
- - portal-groups: groups listing page
717
- - portal-item: specific item page (requires itemId)
718
- - portal-group: specific group page (requires groupId)
719
-
720
- Rules:
721
- - If no navigation is useful, set shouldSuggestNavigation=false and destinationType=none.
722
- - If destinationType is portal-item and user references an item by title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId from the tool result.
723
- - If destinationType is portal-group and user references a group by title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId from the tool result.
724
- - Do not invent itemId.
725
- - Do not invent groupId.
726
- - Prefer destinationType=portal-content for generic "go to content" guidance.
727
-
728
- User question:
729
- {question}
730
-
731
- Assistant response:
732
- {response}
733
- `, X = dt.Root({
734
- ...E()
735
- }), ee = () => new $(X).addNode("answerDocQuestion", Yt).addNode("extractNavigationIntent", Xt).addEdge(G, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", y), se = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
736
- - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
574
+ function jt(e) {
575
+ const t = Q(e).flatMap((a) => {
576
+ const n = a, o = e[a], r = [
577
+ n,
578
+ {
579
+ description: o.description,
580
+ hints: o.hints
581
+ }
582
+ ], i = o.sections ? Q(o.sections).map((u) => {
583
+ const c = o.sections?.[u];
584
+ return [`${n}-${u}`, c];
585
+ }) : [];
586
+ return [r, ...i];
587
+ });
588
+ return Object.fromEntries(t);
589
+ }
590
+ function Vt(e) {
591
+ return Object.entries(e).map(([t, { description: a, hints: n }]) => ` - ${t}: ${a} (hints: ${n.join(", ")})`).join(`
592
+ `);
593
+ }
594
+ const Bt = {
595
+ // Example prompt: "Take me to my content"
596
+ "portal-content": {
597
+ description: "The main content page of the portal.",
598
+ hints: ["My content", "Content"]
599
+ },
600
+ // Example prompt: "Show my content favorites"
601
+ "portal-content-favorites": {
602
+ description: "The Favorites view under Content in the portal.",
603
+ hints: ["My favorites", "Favorites", "Content favorites"]
604
+ },
605
+ // Example prompt: "Open group content"
606
+ "portal-content-group": {
607
+ description: "The Groups view under Content in the portal.",
608
+ hints: ["Content groups", "Group content", "My groups content"]
609
+ },
610
+ // Example prompt: "Browse Living Atlas content"
611
+ "portal-content-living-atlas": {
612
+ description: "The Living Atlas view under Content in the portal.",
613
+ hints: ["Living Atlas", "Content living atlas"]
614
+ },
615
+ // Example prompt: "Show my organization's content"
616
+ "portal-content-organization": {
617
+ description: "The Organization view under Content in the portal.",
618
+ hints: ["Organization content", "Content organization", "My organization content"]
619
+ },
620
+ // Example prompt: "Open the gallery"
621
+ "portal-gallery": {
622
+ description: "The gallery page of the portal.",
623
+ hints: ["Gallery", "Featured content", "Maps and apps"]
624
+ },
625
+ // Example prompt: "Go to the group called #Urban Planning"
626
+ "portal-group": {
627
+ description: "A specific group page in the portal.",
628
+ hints: ["Group", "group page"]
629
+ },
630
+ // Example prompt: "Browse groups"
631
+ "portal-groups": {
632
+ description: "The groups listing page of the portal.",
633
+ hints: ["Groups", "Browse groups"]
634
+ },
635
+ // Example prompt: "Show featured groups"
636
+ "portal-groups-featured": {
637
+ description: "The Featured groups view under Groups in the portal.",
638
+ hints: ["Featured groups", "Groups featured"]
639
+ },
640
+ // Example prompt: "Show my groups"
641
+ "portal-groups-my": {
642
+ description: "The My groups view under Groups in the portal.",
643
+ hints: ["My groups", "Groups my"]
644
+ },
645
+ // Example prompt: "Show organization groups"
646
+ "portal-groups-organization": {
647
+ description: "The Organization groups view under Groups in the portal.",
648
+ hints: ["Organization groups", "Groups organization", "My organization groups"]
649
+ },
650
+ // Example prompt: "Open item #Road Closures Map"
651
+ "portal-item": {
652
+ description: "A specific item page in the portal.",
653
+ hints: ["Item", "item page"]
654
+ },
655
+ // Example prompt: "Open Map Viewer"
656
+ "portal-map-viewer": {
657
+ description: "The Map Viewer app of the portal.",
658
+ hints: ["Map Viewer", "Map", "Open map"]
659
+ },
660
+ // Example prompt: "Take me to notebooks"
661
+ "portal-notebooks": {
662
+ description: "The Notebooks home page of the portal.",
663
+ hints: ["Notebooks", "Notebook home", "My notebooks"]
664
+ },
665
+ // Example prompt: "Open Scene Viewer"
666
+ "portal-scene-viewer": {
667
+ description: "The Scene Viewer app of the portal.",
668
+ hints: ["Scene Viewer", "Scene", "3D scene"]
669
+ },
670
+ // Example prompt: "Open organization security settings"
671
+ "portal-org-security": {
672
+ description: "The Organization > Settings > Security page of the portal.",
673
+ hints: ["Organization settings", "Security", "Organization > Settings > Security"],
674
+ sections: {
675
+ // Example prompt: "How do I set up custom sign in?"
676
+ "custom-sign-in": {
677
+ description: "The Organization > Settings > Security > Custom Sign In section of the portal.",
678
+ hints: ["Custom Sign In", "Organization > Settings > Security > Custom Sign In"]
679
+ },
680
+ // Example prompt: "How do I configure login options?"
681
+ logins: {
682
+ description: "The Organization > Settings > Security > Logins section of the portal.",
683
+ hints: ["Logins", "Organization > Settings > Security > Logins"]
684
+ },
685
+ // Example prompt: "How do I change our login provider?"
686
+ "change-login-provider": {
687
+ description: "The Organization > Settings > Security > Change Login Provider section of the portal.",
688
+ hints: ["Change Login Provider", "Organization > Settings > Security > Change Login Provider"]
689
+ },
690
+ // Example prompt: "How do I configure MFA?"
691
+ "multifactor-auth": {
692
+ description: "The Organization > Settings > Security > Multifactor Authentication section of the portal.",
693
+ hints: ["MFA", "Multifactor Authentication", "Organization > Settings > Security > MFA"]
694
+ },
695
+ // Example prompt: "How do I configure Enforce MFA?"
696
+ "multifactor-enforcement": {
697
+ description: "The Organization > Settings > Security > Enforce MFA section of the portal.",
698
+ hints: ["Enforce MFA", "MFA enforcement", "Organization > Settings > Security > Enforce MFA"]
699
+ },
700
+ // Example prompt: "How do I set designated admins for MFA?"
701
+ "multifactor-designated-admins": {
702
+ description: "The Organization > Settings > Security > Designated Admins section of the portal.",
703
+ hints: ["Designated admins", "MFA designated admins", "Organization > Settings > Security > Designated Admins"]
704
+ }
705
+ }
706
+ },
707
+ // Example prompt: "I want to add a new item"
708
+ "portal-content-new-item": {
709
+ description: "The Content page with the New Item flow opened.",
710
+ hints: ["New item", "Create new item", "Content > My Content > New Item"],
711
+ sections: {
712
+ // Example prompt: "Create a new feature layer"
713
+ "feature-layer": {
714
+ description: "The Content page with New Item flow set to Feature Layer as the starting step.",
715
+ hints: ["Feature Layer", "New Feature Layer", "Content > My Content > New Item > Feature Layer"]
716
+ },
717
+ // Example prompt: "Create developer credentials"
718
+ "developer-credentials": {
719
+ description: "The Content page with New Item flow set to Developer Credentials as the starting step.",
720
+ hints: [
721
+ "Developer Credentials",
722
+ "New developer credentials",
723
+ "Content > My Content > New Item > Developer Credentials"
724
+ ]
725
+ }
726
+ }
727
+ }
728
+ }, Ne = jt(Bt), Kt = Q(Ne), Qt = Vt(Ne), Wt = `
729
+ You decide whether the assistant response should include a navigation action to ArcGIS Portal.
730
+
731
+ Given the user question and assistant response:
732
+ - Decide if a navigation action would help the user complete the task.
733
+ - If yes, choose one destinationType:
734
+ ${Qt}
735
+
736
+ Rules:
737
+ - Only suggest navigation when you are highly confident the destination will help complete the user's task.
738
+ - If confidence is below 0.85, set shouldSuggestNavigation=false and destinationType=none.
739
+ - If there is no clear destination from the allowed types, set shouldSuggestNavigation=false and destinationType=none.
740
+ - If no navigation is useful, set shouldSuggestNavigation=false and destinationType=none.
741
+ - Prefer the most specific destination that is clearly supported by the question and response.
742
+ - Use entity-level destinations over collection/root destinations when both could apply and the entity target is explicit.
743
+ - Use collection/root destinations only for generic browsing intent with no specific entity target.
744
+ - If a chosen destination requires parameters, include all required parameters.
745
+ - If required parameters are missing or uncertain, set shouldSuggestNavigation=false and destinationType=none.
746
+ - Do not invent required parameters.
747
+ - Always include a confidence score from 0 to 1 in the output.
748
+ - Confidence means confidence that a navigation suggestion should be shown to the user.
749
+ - If shouldSuggestNavigation=false or destinationType=none, confidence must be <= 0.5.
750
+ - Use confidence >= 0.85 only when shouldSuggestNavigation=true and destinationType is not none.
751
+
752
+ User question:
753
+ {question}
754
+
755
+ Assistant response:
756
+ {response}
757
+ `, se = s.object({
758
+ shouldSuggestNavigation: s.boolean().default(!1),
759
+ destinationType: s.enum(["none", ...Kt]).default("none"),
760
+ itemId: s.string().default(""),
761
+ groupId: s.string().default(""),
762
+ confidence: s.number().min(0).max(1).default(0)
763
+ });
764
+ let ie;
765
+ async function Jt() {
766
+ return ie ??= _({ modelTier: "fast" }), await ie;
767
+ }
768
+ const _t = async (e, t) => {
769
+ const a = performance.now();
770
+ try {
771
+ await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
772
+ const n = e.outputMessage.trim();
773
+ if (!n)
774
+ return {};
775
+ const o = I(e.agentExecutionContext.messages).trim(), r = await Y.fromTemplate(Wt).format({
776
+ question: o,
777
+ response: n
778
+ }), u = (await Jt()).withStructuredOutput(se), c = se.parse(await u.invoke(r));
779
+ if (!c.shouldSuggestNavigation || c.destinationType === "none")
780
+ return {};
781
+ if (c.destinationType === "portal-item" && !c.itemId) {
782
+ const l = A(o, "#");
783
+ l && (c.itemId = await Ae.invoke({ itemTitle: l }, t) ?? "");
784
+ }
785
+ if (c.destinationType === "portal-group" && !c.groupId) {
786
+ const l = A(o, "$") ?? A(o, "#");
787
+ l && (c.groupId = await Ce.invoke({ groupTitle: l }, t) ?? "");
788
+ }
789
+ const d = Yt(c);
790
+ return d ? (await F(d, t), {}) : {};
791
+ } finally {
792
+ console.info("[arcgis-portal-ai-assistant] node timing", {
793
+ agent: "portal-doc-assistant",
794
+ node: "extractNavigationIntent",
795
+ durationMs: Number((performance.now() - a).toFixed(1))
796
+ });
797
+ }
798
+ };
799
+ function Yt({
800
+ destinationType: e,
801
+ itemId: t,
802
+ groupId: a
803
+ }) {
804
+ switch (e) {
805
+ case "portal-content":
806
+ case "portal-gallery":
807
+ case "portal-groups":
808
+ case "portal-map-viewer":
809
+ case "portal-notebooks":
810
+ case "portal-scene-viewer":
811
+ return { destinationType: e };
812
+ case "portal-org-security":
813
+ return {
814
+ destinationType: "portal-org",
815
+ hash: "settings",
816
+ queryParams: {
817
+ tab: "security"
818
+ }
819
+ };
820
+ case "portal-content-new-item":
821
+ case "portal-content-new-item-feature-layer":
822
+ case "portal-content-new-item-developer-credentials":
823
+ return {
824
+ queryParams: {
825
+ newItem: Ht[e]
826
+ },
827
+ destinationType: "portal-content"
828
+ };
829
+ case "portal-content-favorites":
830
+ case "portal-content-group":
831
+ case "portal-content-living-atlas":
832
+ case "portal-content-organization":
833
+ return { destinationType: "portal-content", hash: Xt[e] };
834
+ case "portal-groups-featured":
835
+ case "portal-groups-my":
836
+ case "portal-groups-organization":
837
+ return { destinationType: "portal-groups", hash: Zt[e] };
838
+ case "portal-org-security-custom-sign-in":
839
+ case "portal-org-security-logins":
840
+ case "portal-org-security-change-login-provider":
841
+ case "portal-org-security-multifactor-auth":
842
+ case "portal-org-security-multifactor-enforcement":
843
+ case "portal-org-security-multifactor-designated-admins":
844
+ return {
845
+ destinationType: "portal-org",
846
+ hash: "settings",
847
+ queryParams: {
848
+ tab: "security",
849
+ subsection: ea[e]
850
+ }
851
+ };
852
+ case "portal-item":
853
+ return t ? { destinationType: e, itemId: t } : null;
854
+ case "portal-group":
855
+ return a ? { destinationType: e, groupId: a } : null;
856
+ case "none":
857
+ return null;
858
+ default:
859
+ return U(e);
860
+ }
861
+ }
862
+ const Ht = {
863
+ "portal-content-new-item": "newItem",
864
+ "portal-content-new-item-feature-layer": "createLayer",
865
+ "portal-content-new-item-developer-credentials": "developerCredentials"
866
+ }, Xt = {
867
+ "portal-content-favorites": "favorites",
868
+ "portal-content-group": "group",
869
+ "portal-content-living-atlas": "living-atlas",
870
+ "portal-content-organization": "org"
871
+ }, Zt = {
872
+ "portal-groups-featured": "featured",
873
+ "portal-groups-my": "my",
874
+ "portal-groups-organization": "organization"
875
+ }, ea = {
876
+ "portal-org-security-custom-sign-in": "customSignInSection",
877
+ "portal-org-security-logins": "loginsSection",
878
+ "portal-org-security-change-login-provider": "changeLoginProviderSection",
879
+ "portal-org-security-multifactor-auth": "multiFactorAuthSection",
880
+ "portal-org-security-multifactor-enforcement": "multifactorEnforcementSection",
881
+ "portal-org-security-multifactor-designated-admins": "multifactorDesignatedAdminsSection"
882
+ }, Pe = h.Root({
883
+ ...G()
884
+ }), ta = () => new N(Pe).addNode("answerDocQuestion", Lt).addNode("extractNavigationIntent", _t).addEdge(P, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", w), aa = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
885
+ - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
737
886
  - acts as a fallback when specialized agents are not applicable
738
- `, ae = {
887
+ `, na = {
739
888
  id: "portal-doc-assistant",
740
889
  name: "Portal Doc Assistant",
741
- description: se,
742
- createGraph: ee,
743
- workspace: X
744
- }, re = st`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`, oe = (s, t) => {
745
- const { destinationType: e } = s, a = `${t.url}/home`;
746
- switch (e) {
890
+ description: aa,
891
+ createGraph: ta,
892
+ workspace: Pe
893
+ }, oa = () => ({ latestGroupId: null, memory: {} }), O = (e) => {
894
+ const t = e?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
895
+ return t ? { latestGroupId: t.latestGroupId, memory: t.memory } : oa();
896
+ }, Ge = `
897
+ Shared markdown formatting rules:
898
+ - Use clear markdown headings (##) to separate sections.
899
+ - Use concise bullet points for lists of facts, counts, or signals.
900
+ - Emphasize key metrics with bold labels (for example: **Recent items:** 4).
901
+ - Keep wording direct and analytical; avoid filler language but make sure the language is friendly.
902
+ - Do not include raw internal IDs unless explicitly requested.
903
+ `, ra = `
904
+ You answer follow-up questions about ArcGIS group analytics.
905
+
906
+ ${Ge}
907
+
908
+ Ground your answer in the provided group analytics summary and context.
909
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
910
+
911
+ Response rules:
912
+ - Reply in concise markdown with this section structure:
913
+ 1) ## Answer
914
+ 2) ## Evidence
915
+ 3) ## Gaps (only when data is missing)
916
+ - Keep the answer focused on the follow-up question.
917
+ - Do not include internal identifiers.
918
+ - Mark isRelevant=false when the question is not about this group or cannot be grounded in this group context.
919
+
920
+ Group analytics summary:
921
+ {summary}
922
+
923
+ Group full context:
924
+ {fullContext}
925
+
926
+ Question:
927
+ {question}
928
+ `, sa = async (e, t) => {
929
+ await g({ text: "Answering group follow-up...", agentName: "group-analytics" }, t);
930
+ const a = O(e), n = e.groupSummaryGroupId ?? a.latestGroupId, o = n ? a.memory[n] : void 0, r = e.groupSummaryQuestion || I(e.agentExecutionContext.messages);
931
+ return o ? {
932
+ status: "success",
933
+ outputMessage: (await b({
934
+ promptText: ra,
935
+ schema: ia,
936
+ modelTier: "default",
937
+ inputVariables: {
938
+ summary: o.summary,
939
+ question: r,
940
+ fullContext: JSON.stringify(o.fullContext)
941
+ }
942
+ })).answer
943
+ } : {
944
+ status: "success",
945
+ outputMessage: "I do not have group analytics context yet. Ask me to analyze a group first with analyze group <group id>."
946
+ };
947
+ }, ia = s.object({
948
+ answer: s.string(),
949
+ isRelevant: s.boolean()
950
+ }), ca = `
951
+ Classify the user's request for ArcGIS Portal group analytics.
952
+
953
+ Rules:
954
+ - intent="summarize" only when the user explicitly asks to summarize, analyze, overview, or recap a group.
955
+ - intent="followUp" for follow-up questions about a previously analyzed group.
956
+ - intent="navigation" when the user asks to open, go to, navigate to, or view the group page.
957
+ - intent="clarify" when intent or required group target is missing.
958
+ - groupId must be the final resolved group id.
959
+ - If request has explicit group id, set groupId directly.
960
+ - If request references group title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId to the tool result.
961
+ - Never return group titles in output fields.
962
+ - If intent is "followUp", set question to the user's full question/request text.
963
+ - If intent is "navigation", set question="".
964
+ - If intent is "summarize", set question="".
965
+ - If intent is "navigation" and no group is specified, leave groupId empty so the system can navigate to the groups listing page.
966
+ - If hasAnalyticsContext is true and the user asks about the same group context without an explicit summarize/analyze command, prefer "followUp".
967
+
968
+ Examples:
969
+ - "Analyze group 0123456789abcdef0123456789abcdef" => summarize, groupId="0123456789abcdef0123456789abcdef"
970
+ - "Analyze group $living atlas" => summarize, call resolvePortalGroupIdByTitle("living atlas") and set groupId to tool result
971
+ - "Analyze group $"living atlas basemaps"" => summarize, call resolvePortalGroupIdByTitle("living atlas basemaps") and set groupId to tool result
972
+ - "Is this group active?" with hasAnalyticsContext=true => followUp
973
+
974
+ hasAnalyticsContext:
975
+ {hasAnalyticsContext}
976
+
977
+ User message:
978
+ {userMessage}
979
+ `, ua = async (e, t) => {
980
+ await g({ text: "Analyzing group-analytics intent...", agentName: "group-analytics" }, t);
981
+ const a = I(e.agentExecutionContext.messages), n = !!O(e).latestGroupId, o = await Y.fromTemplate(ca).format({
982
+ userMessage: a,
983
+ hasAnalyticsContext: String(n)
984
+ }), i = (await _({ modelTier: "fast" })).withStructuredOutput(ce), u = ce.parse(await i.invoke(o));
985
+ let c = u.groupId;
986
+ if ((u.intent === "summarize" || u.intent === "navigation") && !c) {
987
+ const y = A(a, "$");
988
+ y && (c = await Ce.invoke({ groupTitle: y }, t) ?? "");
989
+ }
990
+ const { intent: d, question: l } = u, p = d === "summarize" && !c, m = d === "followUp" && !(l ?? "").trim(), f = d === "clarify" || p || m;
991
+ return {
992
+ groupSummaryIntent: f ? "clarify" : d,
993
+ groupSummaryGroupId: c || null,
994
+ groupSummaryQuestion: l || "",
995
+ status: "success",
996
+ outputMessage: f ? "Please clarify with a group id or title" : ""
997
+ };
998
+ }, ce = s.object({
999
+ intent: s.enum(["summarize", "followUp", "navigation", "clarify"]),
1000
+ groupId: s.string().default(""),
1001
+ question: s.string().default("")
1002
+ }), la = async (e, t) => {
1003
+ const a = O(e), n = e.groupSummaryGroupId ?? a.latestGroupId;
1004
+ return await g({ text: "Preparing navigation...", agentName: "group-analytics" }, t), await F(
1005
+ n ? { destinationType: "portal-group", groupId: n } : { destinationType: "portal-groups" },
1006
+ t
1007
+ ), { status: "success" };
1008
+ };
1009
+ function qe({ timestamp: e, now: t, windowMs: a }) {
1010
+ return e ? t - e <= a : !1;
1011
+ }
1012
+ const da = 720 * 60 * 60 * 1e3;
1013
+ function pa(e) {
1014
+ const t = Xe(e);
1015
+ return {
1016
+ id: e.id ?? "",
1017
+ title: e.title ?? "",
1018
+ description: e.description ?? "",
1019
+ snippet: e.snippet ?? "",
1020
+ access: e.access ?? null,
1021
+ owner: e.owner ?? "",
1022
+ tags: e.tags ?? [],
1023
+ created: e.created?.getTime(),
1024
+ modified: e.modified?.getTime(),
1025
+ isInvitationOnly: e.isInvitationOnly,
1026
+ sourceSignals: {
1027
+ capabilities: at(e),
1028
+ membershipAccess: tt(e),
1029
+ isOpenData: et(e),
1030
+ isDistributedCollaborationGroup: Ze(e),
1031
+ orgId: t.orgId,
1032
+ hiddenMembers: t.hiddenMembers,
1033
+ isViewOnly: t.isViewOnly,
1034
+ isReadOnly: t.isReadOnly,
1035
+ leavingDisallowed: t.leavingDisallowed
1036
+ }
1037
+ };
1038
+ }
1039
+ async function ma(e) {
1040
+ const t = { owner: e.owner ?? "", admins: [], users: [] };
1041
+ try {
1042
+ return await e.fetchMembers();
1043
+ } catch (a) {
1044
+ return console.warn("Unable to fetch group members for analytics context", a), t;
1045
+ }
1046
+ }
1047
+ function ga(e) {
1048
+ return e.map((t) => ({
1049
+ id: t.id ?? "",
1050
+ title: t.title ?? "Untitled",
1051
+ type: t.type ?? "Unknown",
1052
+ owner: t.owner ?? "",
1053
+ created: t.created?.getTime(),
1054
+ modified: t.modified?.getTime()
1055
+ }));
1056
+ }
1057
+ function ha(e, t) {
1058
+ return e.filter(
1059
+ (a) => a.modified ? qe({ timestamp: a.modified, now: t, windowMs: da }) : !1
1060
+ );
1061
+ }
1062
+ function fa(e) {
1063
+ const t = /* @__PURE__ */ new Map();
1064
+ for (const a of e)
1065
+ t.set(a.type, (t.get(a.type) ?? 0) + 1);
1066
+ return [...t.entries()].sort((a, n) => n[1] - a[1] || a[0].localeCompare(n[0])).slice(0, 6).map(([a, n]) => ({ type: a, count: n }));
1067
+ }
1068
+ async function ya(e) {
1069
+ const t = await e.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), a = ga(t.results), n = Date.now();
1070
+ return {
1071
+ total: t.total,
1072
+ topItems: a,
1073
+ recentlyModifiedItems: ha(a, n),
1074
+ topItemTypes: fa(a)
1075
+ };
1076
+ }
1077
+ async function wa(e, t) {
1078
+ if (!t)
1079
+ return { error: { code: "missingGroupId", message: "Group id is required." } };
1080
+ try {
1081
+ const n = (await e.queryGroups({ query: `id:${t}`, num: 1 })).results[0];
1082
+ if (!n)
1083
+ return { error: { code: "groupNotFound", message: `No group found for id: ${t}` } };
1084
+ const o = pa(n), r = await ma(n), i = await ya(n);
1085
+ return { result: { group: o, members: r, items: i } };
1086
+ } catch (a) {
1087
+ return console.error("Error fetching portal group analytics context:", a), { error: { code: "unhandledError" } };
1088
+ }
1089
+ }
1090
+ const va = `
1091
+ You summarize ArcGIS Portal groups based on structured context and deterministic activity signals.
1092
+
1093
+ ${Ge}
1094
+
1095
+ Output format requirements:
1096
+ - Return concise markdown with clear sections in this order:
1097
+ 1) Overview
1098
+ 2) Activity
1099
+ 3) Members
1100
+ 4) Content Theme
1101
+ 5) Contribution Model
1102
+ 6) Unknowns / Data Gaps
1103
+ - Keep total response about 180-280 words unless the user asked for extra detail.
1104
+ - Avoid internal-only implementation details and do not expose raw IDs unless user explicitly asks.
1105
+
1106
+ Reasoning rules:
1107
+ - Use deterministicSignals as the source of truth for active/recent status.
1108
+ - If group description/snippet are empty, infer purpose from tags, item title patterns, and item type distribution.
1109
+ - For members, report owner/admin/user counts when available; if unavailable due to permission scope, explicitly say so.
1110
+ - For contribution model, use membershipAccess, capabilities, and sourceJSON flags to characterize collaboration vs distribution behavior.
1111
+ - Be explicit when signals are heuristic or unavailable.
1112
+
1113
+ Follow-up prompt rules:
1114
+ - Generate exactly 3 follow-up prompts.
1115
+ - Write them as direct first-person user chat prompts that can be clicked and sent as-is.
1116
+ - Do not write meta-questions such as "Would you like..." or "Do you want me to...".
1117
+ - Keep each prompt short, specific, and actionable.
1118
+ - Every prompt must be answerable using only the provided group context and deterministic signals.
1119
+ - Do not require external data, navigation, or additional fetches.
1120
+ - Tailor each prompt to this specific group's available signals (content mix, activity, members, and contribution model).
1121
+ - Avoid repeating phrasing from prior prompts or using generic template wording.
1122
+ - If a signal is unavailable (for example members), do not ask follow-ups that depend on that missing signal.
1123
+
1124
+ Group context:
1125
+ {context}
1126
+
1127
+ Deterministic signals:
1128
+ {deterministicSignals}
1129
+ `, ba = 2160 * 60 * 60 * 1e3, Ia = async (e, t) => {
1130
+ const a = e.groupSummaryGroupId;
1131
+ if (!a)
1132
+ return {
1133
+ status: "success",
1134
+ outputMessage: 'Please clarify with analyze group <group id>, analyze group $<title>, or analyze group $"<title with spaces>".'
1135
+ };
1136
+ await g({ text: `Analyzing group ${a}...`, agentName: "group-analytics" }, t);
1137
+ const n = t?.configurable?.context;
1138
+ x(n);
1139
+ const { result: o, error: r } = await wa(n.portal, a);
1140
+ if (r || !o)
1141
+ return await g({ text: "Failed to fetch group context", agentName: "group-analytics" }, t), {
1142
+ status: "success",
1143
+ outputMessage: "Unable to retrieve group context for analytics."
1144
+ };
1145
+ const { group: i, items: u } = o, c = Date.now(), d = i.modified, l = d ? qe({ timestamp: d, now: c, windowMs: ba }) : !1, p = u.recentlyModifiedItems.length, m = p > 0, f = l || m, y = await b({
1146
+ promptText: va,
1147
+ schema: Sa,
1148
+ modelTier: "default",
1149
+ inputVariables: {
1150
+ context: JSON.stringify(o),
1151
+ deterministicSignals: JSON.stringify({
1152
+ isGroupActive: f,
1153
+ isGroupRecentlyModified: l,
1154
+ hasRecentlyAddedOrUpdatedContent: m,
1155
+ recentItemCount: p
1156
+ })
1157
+ }
1158
+ }), { followUpQuestions: M, summary: q } = y, T = O(e), C = {
1159
+ latestGroupId: a,
1160
+ memory: {
1161
+ ...T.memory,
1162
+ [a]: { summary: q, followUpQuestions: M, fullContext: o }
1163
+ }
1164
+ };
1165
+ return M.length && await J({ type: "suggested-prompts", data: { prompts: M } }, t), {
1166
+ status: "success",
1167
+ outputMessage: q,
1168
+ sharedStatePatch: { portalGroupSummaryMemory: { value: C } }
1169
+ };
1170
+ }, Sa = s.object({
1171
+ summary: s.string(),
1172
+ followUpQuestions: s.array(s.string()).default([])
1173
+ }), L = (e, t) => t ?? e, Ee = h.Root({
1174
+ ...G(),
1175
+ groupSummaryIntent: h({
1176
+ reducer: L,
1177
+ default: () => "clarify"
1178
+ }),
1179
+ groupSummaryGroupId: h({
1180
+ reducer: L,
1181
+ default: () => null
1182
+ }),
1183
+ groupSummaryQuestion: h({
1184
+ reducer: L,
1185
+ default: () => ""
1186
+ })
1187
+ }), xa = () => new N(Ee).addNode("detectGroupSummaryIntent", ua).addNode("summarizePortalGroup", Ia).addNode("answerGroupSummaryFollowUp", sa).addNode("suggestGroupSummaryNavigation", la).addEdge(P, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (t) => t.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : t.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : t.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : w).addEdge("summarizePortalGroup", w).addEdge("answerGroupSummaryFollowUp", w).addEdge("suggestGroupSummaryNavigation", w), Ta = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
1188
+ - summarizes ArcGIS portal groups from group context and sourceJSON details
1189
+ - answers follow-up questions grounded in the summarized group
1190
+ - suggests navigation to groups when relevant
1191
+ `, Ma = {
1192
+ id: "portal-group-analytics",
1193
+ name: "Portal Group Analytics",
1194
+ description: Ta,
1195
+ createGraph: xa,
1196
+ workspace: Ee
1197
+ }, Ca = () => ({ latestItemId: null, memory: {} }), H = (e) => {
1198
+ const t = e?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
1199
+ return t ? { latestItemId: t.latestItemId, memory: t.memory } : Ca();
1200
+ }, ue = s.object({
1201
+ intent: s.enum(["summarize", "followUp", "clarify"]),
1202
+ itemId: s.string().default(""),
1203
+ question: s.string().default("")
1204
+ }), Aa = s.object({ summary: s.string(), followUpQuestions: s.array(s.string()).default([]) }), Na = s.object({ answer: s.string(), isRelevant: s.boolean() }), Pa = `
1205
+ You answer follow-up questions about an ArcGIS item.
1206
+
1207
+ Ground your answer in the provided item context.
1208
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
1209
+
1210
+ Response rules:
1211
+ - Reply in concise markdown.
1212
+ - Keep the answer focused on the follow-up question.
1213
+ - Do not include internal identifiers.
1214
+ - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
1215
+
1216
+ Item summary:
1217
+ {summary}
1218
+
1219
+ Item full context
1220
+ {fullContext}
1221
+
1222
+ Question:
1223
+ {question}
1224
+ `, Ga = async (e, t) => {
1225
+ await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
1226
+ const a = H(e), n = e.analyticsItemId ?? a.latestItemId, o = n ? a.memory[n] : void 0, r = e.analyticsQuestion || I(e.agentExecutionContext.messages);
1227
+ return o ? {
1228
+ status: "success",
1229
+ outputMessage: (await b({
1230
+ promptText: Pa,
1231
+ schema: Na,
1232
+ modelTier: "default",
1233
+ inputVariables: {
1234
+ summary: o.summary,
1235
+ question: r,
1236
+ fullContext: JSON.stringify(o.fullContext)
1237
+ }
1238
+ })).answer
1239
+ } : {
1240
+ status: "success",
1241
+ outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
1242
+ };
1243
+ }, qa = `
1244
+ Classify the user analytics request.
1245
+
1246
+ Rules:
1247
+ - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
1248
+ - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
1249
+ - intent="clarify" when neither summarize nor follow-up intent is clear.
1250
+ - itemId must be the final resolved item id.
1251
+ - If request has explicit item id, set itemId directly.
1252
+ - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
1253
+ - Never return item titles in output fields.
1254
+ - If intent is "followUp", set question to the user's full question/request text.
1255
+ - If intent is "summarize", set question="".
1256
+ - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
1257
+ - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
1258
+
1259
+ Examples:
1260
+ - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
1261
+ - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
1262
+ - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
1263
+ - "Show the layer's available fields" => followUp
1264
+ - "List attributes and explain what status means" => followUp
1265
+ - "What fields are available?" with hasSummaryContext=true => followUp
1266
+ - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
1267
+
1268
+ hasSummaryContext:
1269
+ {hasSummaryContext}
1270
+
1271
+ User message:
1272
+ {userMessage}
1273
+ `, Ea = async (e, t) => {
1274
+ await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
1275
+ const a = I(e.agentExecutionContext.messages), n = !!H(e).latestItemId, o = await Y.fromTemplate(qa).format({
1276
+ userMessage: a,
1277
+ hasSummaryContext: String(n)
1278
+ }), i = (await _({ modelTier: "fast" })).withStructuredOutput(ue), u = ue.parse(await i.invoke(o));
1279
+ let c = u.itemId;
1280
+ if (u.intent === "summarize" && !c) {
1281
+ const y = A(a, "#");
1282
+ y && (c = await Ae.invoke({ itemTitle: y }, t) ?? "");
1283
+ }
1284
+ const { intent: d, question: l } = u, f = d === "clarify" || d === "summarize" && !c || d === "followUp" && !l;
1285
+ return {
1286
+ agentExecutionContext: { ...e.agentExecutionContext },
1287
+ analyticsIntent: f ? "clarify" : d,
1288
+ analyticsItemId: c || null,
1289
+ analyticsQuestion: l || "",
1290
+ status: "success",
1291
+ outputMessage: f ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
1292
+ };
1293
+ }, ka = `
1294
+ You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
1295
+ Summary rules:
1296
+ - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
1297
+ - Target length: 80-150 words.
1298
+ - Provide one short descriptive paragraph.
1299
+ - Also propose 3 concise follow-up questions grounded in the item summary.
1300
+ - Keep follow-up questions specific and actionable.
1301
+ Follow-up questions rules:
1302
+ - These questions should be in the format of a prompt that the user can click on.
1303
+ - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
1304
+ Do not include internal identifiers.
1305
+ If the user asks for a detailed summary, you may expand the response up to 300 words.
1306
+ Item context:
1307
+ {context}
1308
+ `, za = async (e, t) => {
1309
+ const a = e.analyticsItemId;
1310
+ if (!a)
1311
+ return {
1312
+ status: "success",
1313
+ outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
1314
+ };
1315
+ await g({ text: `Summarizing item ${a}...`, agentName: "analytics" }, t);
1316
+ const n = t?.configurable?.context;
1317
+ x(n);
1318
+ const { portal: o, user: r } = n, { result: i, error: u } = await He(r, o, a);
1319
+ if (u || !i)
1320
+ return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
1321
+ status: "success",
1322
+ outputMessage: "Unable to retrieve item context for summarization."
1323
+ };
1324
+ const { context: c } = i, d = await b({
1325
+ promptText: ka,
1326
+ schema: Aa,
1327
+ modelTier: "default",
1328
+ inputVariables: { context: JSON.stringify(c) }
1329
+ }), { followUpQuestions: l, summary: p } = d, m = H(e), f = {
1330
+ latestItemId: a,
1331
+ memory: {
1332
+ ...m.memory,
1333
+ [a]: { summary: p, followUpQuestions: l, fullContext: c }
1334
+ }
1335
+ };
1336
+ return l.length && await J({ type: "suggested-prompts", data: { prompts: l } }, t), {
1337
+ status: "success",
1338
+ outputMessage: p,
1339
+ sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
1340
+ };
1341
+ }, j = (e, t) => t ?? e, ke = h.Root({
1342
+ ...G(),
1343
+ // States shared only across nodes in the graph, not between invocations
1344
+ analyticsIntent: h({
1345
+ reducer: j,
1346
+ default: () => "clarify"
1347
+ }),
1348
+ analyticsItemId: h({
1349
+ reducer: j,
1350
+ default: () => null
1351
+ }),
1352
+ analyticsQuestion: h({
1353
+ reducer: j,
1354
+ default: () => ""
1355
+ })
1356
+ }), $a = () => new N(ke).addNode("detectAnalyticsIntent", Ea).addNode("summarizePortalItem", za).addNode("answerAnalyticsFollowUp", Ga).addEdge(P, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : w).addEdge("summarizePortalItem", w).addEdge("answerAnalyticsFollowUp", w), Da = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
1357
+ - answers questions about one specific ArcGIS portal item when item context is present
1358
+ - summarizes item details, metadata, and context grounded in that item
1359
+ - suggests follow-up prompts grounded in the same item
1360
+ - use for item-specific requests, not for gallery browsing, featured content, or opening Map Viewer
1361
+ `, Ra = {
1362
+ id: "portal-item-analytics",
1363
+ name: "Portal Item Analytics",
1364
+ description: Da,
1365
+ createGraph: $a,
1366
+ workspace: ke
1367
+ }, Ua = {
1368
+ schemaVersion: "1.0",
1369
+ capabilities: [
1370
+ {
1371
+ id: "my-content",
1372
+ title: "My content",
1373
+ description: "Browse, discover, search, and filter ArcGIS content—including maps, apps, datasets, and other items—that you own or can access.",
1374
+ hints: ["view my content", "show my content", "my content"],
1375
+ platforms: ["online", "enterprise"],
1376
+ resolutions: {
1377
+ navigate: {
1378
+ routeKey: "content"
1379
+ }
1380
+ }
1381
+ },
1382
+ {
1383
+ id: "create-feature-layer",
1384
+ title: "Create feature layer",
1385
+ description: "Generate an editable feature layer by copying fields from templates or existing layers.",
1386
+ hints: ["add a feature layer", "make a feature layer", "generate a feature layer"],
1387
+ platforms: ["online", "enterprise"],
1388
+ resolutions: {
1389
+ navigate: {
1390
+ routeKey: "content"
1391
+ }
1392
+ }
1393
+ },
1394
+ {
1395
+ id: "create-folder",
1396
+ title: "Create folder",
1397
+ description: "Create a new folder in your ArcGIS content to organize your items.",
1398
+ hints: ["create a folder", "make a folder", "set up a folder", "new folder"],
1399
+ platforms: ["online", "enterprise"],
1400
+ resolutions: {
1401
+ navigate: {
1402
+ routeKey: "content"
1403
+ }
1404
+ }
1405
+ }
1406
+ ]
1407
+ }, Fa = {
1408
+ schemaVersion: "1.0",
1409
+ capabilities: [
1410
+ {
1411
+ id: "my groups",
1412
+ title: "My groups",
1413
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that you own, belong to, or can access.",
1414
+ hints: ["view my groups", "show my groups", "my groups"],
1415
+ platforms: ["online", "enterprise"],
1416
+ resolutions: {
1417
+ navigate: {
1418
+ routeKey: "groups"
1419
+ }
1420
+ }
1421
+ },
1422
+ {
1423
+ id: "create-group",
1424
+ title: "Create group",
1425
+ description: "Create a new ArcGIS Portal group owned by the signed-in user.",
1426
+ hints: ["create a group", "make a group", "set up a group", "new group"],
1427
+ platforms: ["online", "enterprise"],
1428
+ resolutions: {
1429
+ navigate: {
1430
+ routeKey: "groups"
1431
+ }
1432
+ }
1433
+ },
1434
+ {
1435
+ id: "featured-groups",
1436
+ title: "Featured groups",
1437
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that organization administrators choose to highlight in ArcGIS.",
1438
+ hints: ["view featured groups", "show featured groups", "highlighted groups", "top groups"],
1439
+ platforms: ["online", "enterprise"],
1440
+ resolutions: {
1441
+ navigate: {
1442
+ routeKey: "groups",
1443
+ hash: "featured"
1444
+ }
1445
+ }
1446
+ },
1447
+ {
1448
+ id: "organization-groups",
1449
+ title: "Organization groups",
1450
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that are specific to your organization in ArcGIS.",
1451
+ hints: ["view organization groups", "show organization groups"],
1452
+ platforms: ["online", "enterprise"],
1453
+ resolutions: {
1454
+ navigate: {
1455
+ routeKey: "groups",
1456
+ hash: "organization"
1457
+ }
1458
+ }
1459
+ }
1460
+ ]
1461
+ }, Oa = {
1462
+ schemaVersion: "1.0",
1463
+ capabilities: [
1464
+ {
1465
+ id: "org-config-mfa",
1466
+ title: "Multifactor Authentication (MFA)",
1467
+ description: "Configure organization-level multifactor authentication (MFA) settings. Administrators can enable MFA for ArcGIS logins, allow recovery codes for members, view MFA adoption status, enforce MFA requirements for all members, manage the MFA exemption list, and designate administrators who can troubleshoot MFA issues.",
1468
+ hints: ["config MFA", "set up MFA"],
1469
+ platforms: ["online", "enterprise"],
1470
+ resolutions: {
1471
+ navigate: {
1472
+ routeKey: "organization",
1473
+ queryParams: {
1474
+ tab: "security"
1475
+ },
1476
+ hash: "settings"
1477
+ }
1478
+ }
1479
+ }
1480
+ ]
1481
+ }, La = {
1482
+ "contentRouteRegistry.ts": Ua,
1483
+ "groupsRouteRegistry.ts": Fa,
1484
+ "orgSettingsRouteRegistry.ts": Oa
1485
+ };
1486
+ function le(e) {
1487
+ const t = [], a = /* @__PURE__ */ new Set();
1488
+ for (const [n, o] of Object.entries(e))
1489
+ for (const r of o.capabilities) {
1490
+ if (a.has(r.id))
1491
+ throw new Error(`${n}: duplicate capability id "${r.id}" across registries`);
1492
+ a.add(r.id), t.push(r);
1493
+ }
1494
+ return t;
1495
+ }
1496
+ let z;
1497
+ function S(e) {
1498
+ return e ? z = le({ customCapabilities: e }) : z || (z = le(La)), z;
1499
+ }
1500
+ const ja = /^(?:take me to|navigate to|go to|show me|open)\s+(?:the\s+)?/u;
1501
+ function R(e) {
1502
+ return e.toLowerCase().replace(/[^a-z0-9]+/gu, " ").trim().replace(ja, "").trim();
1503
+ }
1504
+ const Va = s.object({
1505
+ capabilityIds: s.array(s.string()).default([]),
1506
+ confidence: s.number().min(0).max(1).default(0),
1507
+ reason: s.string().default("")
1508
+ }), de = 0.8, Ba = String.raw`You select Portal navigation capabilities for a user's request.
1509
+
1510
+ Select only capability IDs from the supplied candidates. Return an empty array when none fit.
1511
+ A named surface is required: do not select a capability on another Portal surface.
1512
+ Retrieval scores are hints only, not ground truth.
1513
+
1514
+ User request:
1515
+ {userRequest}
1516
+
1517
+ Candidates:
1518
+ {candidates}`, Ka = async (e, t) => {
1519
+ if (e.outputMessage || e.targets.length === 0)
1520
+ return {};
1521
+ const a = I(e.agentExecutionContext.messages).trim(), n = Qa(a, e);
1522
+ if (n.length === 1)
1523
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1524
+ method: "exact-match",
1525
+ request: a,
1526
+ selectedCapabilityIds: n
1527
+ }), { chosenCapabilityIds: n };
1528
+ await g({ text: "Choosing a navigation destination...", agentName: "navigation" }, t);
1529
+ const o = JSON.stringify(
1530
+ e.targets.map(({ capability: r, keywordScore: i, semanticScore: u }) => ({
1531
+ id: r.id,
1532
+ title: r.title,
1533
+ description: r.description,
1534
+ route: r.resolutions.navigate,
1535
+ keywordScore: i,
1536
+ semanticScore: u
1537
+ }))
1538
+ );
1539
+ try {
1540
+ const r = await b({
1541
+ promptText: Ba,
1542
+ schema: Va,
1543
+ modelTier: "fast",
1544
+ inputVariables: { candidates: o, userRequest: a }
1545
+ }), i = new Set(e.targets.map(({ capability: c }) => c.id)), u = r.capabilityIds.filter((c) => i.has(c));
1546
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1547
+ confidence: r.confidence,
1548
+ method: "structured-model",
1549
+ reason: r.reason,
1550
+ request: a,
1551
+ selectedCapabilityIds: u
1552
+ }), r.confidence < de ? {
1553
+ chosenCapabilityIds: [],
1554
+ status: "failed",
1555
+ summary: `Navigation selection confidence ${r.confidence} is below the required ${de}; defer to the Portal Doc Assistant.`
1556
+ } : { chosenCapabilityIds: u };
1557
+ } catch {
1558
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1559
+ method: "structured-model-unavailable",
1560
+ request: a,
1561
+ selectedCapabilityIds: []
1562
+ }), { chosenCapabilityIds: [] };
1563
+ }
1564
+ };
1565
+ function Qa(e, t) {
1566
+ const a = R(e);
1567
+ return t.targets.filter(
1568
+ ({ capability: n }) => [n.title, ...n.hints].some(
1569
+ (o) => R(o) === a
1570
+ )
1571
+ ).map(({ capability: n }) => n.id);
1572
+ }
1573
+ const ze = /* @__PURE__ */ new Set(["1d", "7d", "14d", "30d", "3m", "6m"]), Wa = s.object({
1574
+ period: s.string(),
1575
+ startTime: s.string(),
1576
+ endTime: s.string()
1577
+ }), Ja = String.raw`Extract temporal filters for an ArcGIS storage-credits query.
1578
+
1579
+ Return JSON only with these optional string fields:
1580
+ - period
1581
+ - startTime
1582
+ - endTime
1583
+
1584
+ Rules:
1585
+ - period must use <integer><unit> with unit in d,w,m (examples: 7d, 2w, 3m).
1586
+ - If the request is a relative range and period can be determined, always include period.
1587
+ - For "last quarter" or "previous quarter", use calendar-quarter boundaries and include period as 3m with both startTime and endTime.
1588
+ - For "last quarter" or "previous quarter", endTime must be the UTC end of the previous quarter, not "now".
1589
+ - If period matches one of these supported periods and the range ends today, period alone is sufficient:
1590
+ 1d, 7d, 14d, 30d, 3m, 6m.
1591
+ - If the request implies a range not supported as period (for example 2m or 10d), include startTime and endTime.
1592
+ - For custom date ranges (for example "last december"), provide startTime and endTime.
1593
+ - startTime and endTime must be epoch milliseconds as strings.
1594
+ - If the end of range is "now", set endTime to {nowEpochMs}.
1595
+ - If temporal intent is unclear, return empty strings for all fields.
1596
+
1597
+ Now UTC:
1598
+ - ISO: {nowIso}
1599
+ - Epoch ms: {nowEpochMs}
1600
+
1601
+ User request:
1602
+ {userRequest}`;
1603
+ async function _a(e, t = /* @__PURE__ */ new Date()) {
1604
+ const a = e.trim();
1605
+ if (!a)
1606
+ return {};
1607
+ try {
1608
+ const n = await b({
1609
+ promptText: Ja,
1610
+ schema: Wa,
1611
+ modelTier: "fast",
1612
+ inputVariables: {
1613
+ nowEpochMs: String(t.getTime()),
1614
+ nowIso: t.toISOString(),
1615
+ userRequest: a
1616
+ }
1617
+ });
1618
+ return Ya(n, t);
1619
+ } catch (n) {
1620
+ return console.error(n), {};
1621
+ }
1622
+ }
1623
+ function Ya(e, t = /* @__PURE__ */ new Date()) {
1624
+ const a = pe(e.startTime), n = pe(e.endTime), o = Ha(e.period);
1625
+ if (o) {
1626
+ if (a !== void 0 && n !== void 0 && a < n)
1627
+ return { period: o, startTime: String(a), endTime: String(n) };
1628
+ const r = ze.has(o);
1629
+ if (!r || n !== void 0 && !Za(n, t.getTime())) {
1630
+ const u = n ?? t.getTime(), c = Xa(o, new Date(u));
1631
+ if (c !== void 0)
1632
+ return {
1633
+ period: o,
1634
+ startTime: String(c),
1635
+ endTime: String(u)
1636
+ };
1637
+ }
1638
+ return r ? {
1639
+ period: o,
1640
+ ...a !== void 0 ? { startTime: String(a) } : {},
1641
+ ...n !== void 0 ? { endTime: String(n) } : {}
1642
+ } : { period: o };
1643
+ }
1644
+ return a !== void 0 && n !== void 0 && a < n ? { startTime: String(a), endTime: String(n) } : a !== void 0 ? { startTime: String(a), endTime: String(t.getTime()) } : {};
1645
+ }
1646
+ function Ha(e) {
1647
+ const t = e?.trim().match(/^(\d+)\s*([dwm])$/iu);
1648
+ if (!t)
1649
+ return;
1650
+ const a = Number.parseInt(t[1], 10);
1651
+ if (!Number.isFinite(a) || a <= 0)
1652
+ return;
1653
+ const n = t[2].toLowerCase();
1654
+ if (n === "w") {
1655
+ const o = a * 7;
1656
+ if (ze.has(`${o}d`))
1657
+ return `${o}d`;
1658
+ }
1659
+ return `${a}${n}`;
1660
+ }
1661
+ function Xa(e, t) {
1662
+ const a = e.match(/^(\d+)([dwm])$/u);
1663
+ if (!a)
1664
+ return;
1665
+ const n = Number.parseInt(a[1], 10);
1666
+ if (!Number.isFinite(n) || n <= 0)
1667
+ return;
1668
+ const o = a[2];
1669
+ if (o === "d")
1670
+ return t.getTime() - n * 24 * 60 * 60 * 1e3;
1671
+ if (o === "w")
1672
+ return t.getTime() - n * 7 * 24 * 60 * 60 * 1e3;
1673
+ const r = new Date(t.getTime());
1674
+ return r.setUTCMonth(r.getUTCMonth() - n), r.getTime();
1675
+ }
1676
+ function pe(e) {
1677
+ if (!e)
1678
+ return;
1679
+ const t = Number.parseInt(e, 10);
1680
+ if (!(!Number.isFinite(t) || t <= 0))
1681
+ return t;
1682
+ }
1683
+ function Za(e, t) {
1684
+ const a = new Date(e), n = new Date(t);
1685
+ return a.getUTCFullYear() === n.getUTCFullYear() && a.getUTCMonth() === n.getUTCMonth() && a.getUTCDate() === n.getUTCDate();
1686
+ }
1687
+ async function en(e, t, a) {
1688
+ const n = S().find((r) => r.id === e);
1689
+ if (!n)
1690
+ return;
1691
+ const o = await an(tn(n), a);
1692
+ return o && on(o, t) ? { capability: n, target: o } : void 0;
1693
+ }
1694
+ function tn(e) {
1695
+ const { hash: t, queryParams: a, routeKey: n } = e.resolutions.navigate;
1696
+ switch (n) {
1697
+ case "content":
1698
+ switch (e.id) {
1699
+ case "my-content":
1700
+ return { destinationType: "portal-content" };
1701
+ case "create-feature-layer":
1702
+ return { destinationType: "portal-content" };
1703
+ case "create-folder":
1704
+ return { destinationType: "portal-content" };
1705
+ default:
1706
+ return { destinationType: "portal-content" };
1707
+ }
1708
+ case "groups":
1709
+ if (t === "featured")
1710
+ return { destinationType: "portal-groups", hash: "featured" };
1711
+ if (t === "organization")
1712
+ return { destinationType: "portal-groups", hash: "organization" };
1713
+ switch (e.id) {
1714
+ case "my groups":
1715
+ return { destinationType: "portal-groups", hash: "my" };
1716
+ case "create-group":
1717
+ return { destinationType: "portal-groups" };
1718
+ default:
1719
+ return { destinationType: "portal-groups" };
1720
+ }
1721
+ case "organization":
1722
+ return {
1723
+ destinationType: "portal-org",
1724
+ hash: t,
1725
+ queryParams: a,
1726
+ buttonLabel: e.buttonLabel
1727
+ };
1728
+ default:
1729
+ return;
1730
+ }
1731
+ }
1732
+ async function an(e, t) {
1733
+ if (!e || !t || !nn(e))
1734
+ return e;
1735
+ const a = await _a(t);
1736
+ if (!a.period && !a.startTime && !a.endTime)
1737
+ return e;
1738
+ const n = {
1739
+ ...e.queryParams ?? {},
1740
+ ...a.period ? { period: a.period } : {},
1741
+ ...a.startTime ? { startTime: a.startTime } : {},
1742
+ ...a.endTime ? { endTime: a.endTime } : {}
1743
+ };
1744
+ return { ...e, queryParams: n };
1745
+ }
1746
+ function nn(e) {
1747
+ return e.destinationType === "portal-org" && e.hash === "status";
1748
+ }
1749
+ function on(e, t) {
1750
+ return !t || !!t[e.destinationType];
1751
+ }
1752
+ const rn = async (e, t) => {
1753
+ if (e.outputMessage || e.status === "failed")
1754
+ return {};
1755
+ const a = e.targets.find(({ capability: r }) => e.chosenCapabilityIds.includes(r.id)) ?? e.targets[0];
1756
+ if (!a)
1757
+ return {
1758
+ outputMessage: "I couldn't find a matching Portal page. Try asking to open your content, groups, or organization settings.",
1759
+ sharedStatePatch: { navLastAnsweredRequest: { value: me(e) } },
1760
+ status: "success",
1761
+ summary: "Navigation could not find a matching capability; route another agent if appropriate."
1762
+ };
1763
+ const n = me(e), o = await en(a.capability.id, void 0, n);
1764
+ return o ? (await g({ text: "Preparing navigation...", agentName: "navigation" }, t), await F(o.target, t), {
1765
+ outputMessage: e.chosenCapabilityIds.length ? a.capability.description : `The closest place to start is ${a.capability.title}. Click the button below to open it.`,
1766
+ status: "success",
1767
+ summary: `Navigation suggested ${a.capability.id}${e.retrievalDegraded ? " using keyword-only retrieval" : ""}.`,
1768
+ sharedStatePatch: { navLastAnsweredRequest: { value: n } }
1769
+ }) : (console.warn(`Navigation capability ${a.capability.id} was not found in the resolver.`), {
1770
+ outputMessage: "I found a possible destination, but couldn't resolve a valid Portal navigation target. Try asking to open your content, groups, or organization settings.",
1771
+ status: "success",
1772
+ summary: `Navigation resolver could not map ${a.capability.id}.`,
1773
+ sharedStatePatch: { navLastAnsweredRequest: { value: n } }
1774
+ });
1775
+ };
1776
+ function me(e) {
1777
+ return I(e.agentExecutionContext.messages) || e.agentExecutionContext.userRequest;
1778
+ }
1779
+ async function $e(e) {
1780
+ return e.length === 0 ? [] : (await nt.getDefault().load(), await Ke(e));
1781
+ }
1782
+ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1783
+ __proto__: null,
1784
+ generateEmbeddings: $e
1785
+ }, Symbol.toStringTag, { value: "Module" }));
1786
+ function cn(e) {
1787
+ const t = [], a = `${e.title}. ${e.description}`;
1788
+ a.trim().length > 0 && t.push({ field: "summary", text: a });
1789
+ const n = e.hints;
1790
+ if (Array.isArray(n))
1791
+ for (const o of n)
1792
+ typeof o == "string" && o.trim().length > 0 && t.push({ field: "hint", text: o });
1793
+ return t;
1794
+ }
1795
+ let $, X, D = 0;
1796
+ async function un(e = {}) {
1797
+ const t = D;
1798
+ return $ ??= dn(e.embed ?? pn).then((a) => (t === D && (X = a), a)).catch((a) => {
1799
+ throw t === D && ($ = void 0), a;
1800
+ }), await $;
1801
+ }
1802
+ function ln() {
1803
+ return X;
1804
+ }
1805
+ function ge() {
1806
+ D += 1, X = void 0, $ = void 0;
1807
+ }
1808
+ async function dn(e) {
1809
+ const t = mn(), a = await e(t.map((n) => n.text));
1810
+ if (a.length !== t.length)
1811
+ throw new Error(`Expected ${t.length} vectors, got ${a.length}`);
1812
+ return t.map((n, o) => ({
1813
+ ...n,
1814
+ vector: a[o]
1815
+ }));
1816
+ }
1817
+ async function pn(e) {
1818
+ const { generateEmbeddings: t } = await Promise.resolve().then(() => sn);
1819
+ return await t(e);
1820
+ }
1821
+ function mn() {
1822
+ return S().flatMap(
1823
+ (e) => cn(e).map(({ field: t, text: a }) => ({
1824
+ capabilityId: e.id,
1825
+ field: t,
1826
+ text: a
1827
+ }))
1828
+ );
1829
+ }
1830
+ const he = 1.2, fe = 0.75, gn = 60, hn = 0.65, V = {
1831
+ description: 1,
1832
+ hint: 2,
1833
+ title: 3
1834
+ };
1835
+ let W;
1836
+ function fn() {
1837
+ W = void 0;
1838
+ }
1839
+ async function yn(e, t = {}) {
1840
+ const a = In(De(e));
1841
+ let n = [], o = !1, r;
1842
+ if (e.trim()) {
1843
+ const i = t.loadEmbeddings, u = ln();
1844
+ if (!i && !u)
1845
+ o = !0, r = "Capability embeddings are still loading.";
1846
+ else
1847
+ try {
1848
+ if (i) {
1849
+ const [c, d] = await Promise.all([
1850
+ (t.embedQuery ?? we)(e),
1851
+ i()
1852
+ ]);
1853
+ n = ye(c, d);
1854
+ } else if (u) {
1855
+ const c = await (t.embedQuery ?? we)(e);
1856
+ n = ye(c, u);
1857
+ }
1858
+ } catch {
1859
+ o = !0, r = "Semantic search is unavailable.";
1860
+ }
1861
+ }
1862
+ return {
1863
+ degraded: o,
1864
+ ...r ? { degradedReason: r } : {},
1865
+ // RRF combines ranks rather than raw scores because BM25 and cosine
1866
+ // similarity are on different scales.
1867
+ matches: xn(a, n, t.topN ?? 5)
1868
+ };
1869
+ }
1870
+ function wn() {
1871
+ return W ??= vn(S()), W;
1872
+ }
1873
+ function vn(e) {
1874
+ const t = /* @__PURE__ */ new Map(), a = e.map((n) => {
1875
+ const o = /* @__PURE__ */ new Map();
1876
+ B(o, n.title, V.title), B(o, n.description, V.description);
1877
+ for (const r of n.hints)
1878
+ B(o, r, V.hint);
1879
+ for (const r of o.keys())
1880
+ t.set(r, (t.get(r) ?? 0) + 1);
1881
+ return {
1882
+ capability: n,
1883
+ length: bn(o),
1884
+ termFrequencies: o
1885
+ };
1886
+ });
1887
+ return {
1888
+ averageDocumentLength: a.length ? a.reduce((n, o) => n + o.length, 0) / a.length : 0,
1889
+ documentFrequency: t,
1890
+ documents: a
1891
+ };
1892
+ }
1893
+ function B(e, t, a) {
1894
+ for (const n of De(t))
1895
+ e.set(n, (e.get(n) ?? 0) + a);
1896
+ }
1897
+ function bn(e) {
1898
+ return [...e.values()].reduce((t, a) => t + a, 0);
1899
+ }
1900
+ function De(e) {
1901
+ return e.toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean);
1902
+ }
1903
+ function In(e) {
1904
+ const t = wn(), a = new Set(e), n = t.documents.length;
1905
+ return t.documents.map(({ capability: o, length: r, termFrequencies: i }) => {
1906
+ let u = 0;
1907
+ for (const c of a) {
1908
+ const d = i.get(c), l = t.documentFrequency.get(c);
1909
+ if (!d || !l)
1910
+ continue;
1911
+ const p = Math.log(1 + (n - l + 0.5) / (l + 0.5)), m = he * (1 - fe + fe * (r / t.averageDocumentLength));
1912
+ u += p * (d * (he + 1) / (d + m));
1913
+ }
1914
+ return { capability: o, score: u };
1915
+ }).filter(({ score: o }) => o > 0).sort(Re);
1916
+ }
1917
+ function ye(e, t) {
1918
+ const a = /* @__PURE__ */ new Map();
1919
+ for (const o of t) {
1920
+ const r = Sn(e, o.vector);
1921
+ if (r === void 0)
1922
+ continue;
1923
+ const i = a.get(o.capabilityId);
1924
+ (i === void 0 || r > i) && a.set(o.capabilityId, r);
1925
+ }
1926
+ const n = new Map(S().map((o) => [o.id, o]));
1927
+ return [...a.entries()].flatMap(([o, r]) => {
1928
+ const i = n.get(o);
1929
+ return i && r >= hn ? [{ capability: i, score: r }] : [];
1930
+ }).sort(Re);
1931
+ }
1932
+ function Sn(e, t) {
1933
+ if (e.length === 0 || e.length !== t.length)
1934
+ return;
1935
+ let a = 0, n = 0, o = 0;
1936
+ for (let i = 0; i < e.length; i += 1)
1937
+ a += e[i] * t[i], n += e[i] ** 2, o += t[i] ** 2;
1938
+ const r = Math.sqrt(n) * Math.sqrt(o);
1939
+ return r === 0 ? void 0 : a / r;
1940
+ }
1941
+ async function we(e) {
1942
+ const [t] = await $e([e]);
1943
+ if (!t)
1944
+ throw new Error("Expected one query embedding.");
1945
+ return t;
1946
+ }
1947
+ function xn(e, t, a) {
1948
+ const n = /* @__PURE__ */ new Map();
1949
+ return ve(n, e, "keyword"), ve(n, t, "semantic"), [...n.values()].sort((o, r) => r.score !== o.score ? r.score - o.score : (r.semanticScore ?? 0) !== (o.semanticScore ?? 0) ? (r.semanticScore ?? 0) - (o.semanticScore ?? 0) : (r.keywordScore ?? 0) !== (o.keywordScore ?? 0) ? (r.keywordScore ?? 0) - (o.keywordScore ?? 0) : o.capability.id.localeCompare(r.capability.id)).slice(0, Math.max(0, a));
1950
+ }
1951
+ function ve(e, t, a) {
1952
+ for (const [n, { capability: o, score: r }] of t.entries()) {
1953
+ const i = n + 1, u = e.get(o.id) ?? { capability: o, score: 0 };
1954
+ u.score += 1 / (gn + i), a === "keyword" ? (u.keywordRank = i, u.keywordScore = r) : (u.semanticRank = i, u.semanticScore = r), e.set(o.id, u);
1955
+ }
1956
+ }
1957
+ function Re(e, t) {
1958
+ return t.score - e.score || e.capability.id.localeCompare(t.capability.id);
1959
+ }
1960
+ const Tn = async (e, t) => {
1961
+ await g({ text: "Finding a place to navigate...", agentName: "navigation" }, t);
1962
+ const a = I(e.agentExecutionContext.messages).trim();
1963
+ try {
1964
+ const n = await yn(a, { topN: 5 });
1965
+ return console.table(
1966
+ n.matches.map(({ capability: o, keywordRank: r, keywordScore: i, semanticRank: u, semanticScore: c, score: d }) => ({
1967
+ capability: o.title,
1968
+ fusedScore: d,
1969
+ keywordRank: r,
1970
+ keywordScore: i,
1971
+ semanticRank: u,
1972
+ semanticScore: c
1973
+ }))
1974
+ ), n.degradedReason && console.info("[arcgis-portal-ai-assistant] navigation semantic search:", n.degradedReason), {
1975
+ chosenCapabilityIds: [],
1976
+ retrievalDegraded: n.degradedReason ?? "",
1977
+ targets: Mn(a, n.matches)
1978
+ };
1979
+ } catch {
1980
+ return {
1981
+ chosenCapabilityIds: [],
1982
+ outputMessage: "I couldn't look up a Portal page right now. Please try again.",
1983
+ status: "failed",
1984
+ targets: []
1985
+ };
1986
+ }
1987
+ };
1988
+ function Mn(e, t) {
1989
+ const a = R(e), n = t.filter(
1990
+ ({ capability: r }) => [r.title, ...r.hints].some(
1991
+ (i) => R(i) === a
1992
+ )
1993
+ );
1994
+ if (n.length !== 1)
1995
+ return t;
1996
+ const [o] = n;
1997
+ return [o, ...t.filter((r) => r !== o)];
1998
+ }
1999
+ const K = (e, t) => t ?? e, Ue = h.Root({
2000
+ ...G(),
2001
+ chosenCapabilityIds: h({ reducer: K, default: () => [] }),
2002
+ // Empty when hybrid keyword-and-semantic retrieval succeeds; otherwise
2003
+ // contains the semantic-search failure reason for response diagnostics.
2004
+ retrievalDegraded: h({ reducer: K, default: () => "" }),
2005
+ targets: h({ reducer: K, default: () => [] })
2006
+ }), Cn = () => new N(Ue).addNode("retrieveNavigationTargets", Tn).addNode("chooseNavigationTargets", Ka).addNode("respondWithNavigation", rn).addEdge(P, "retrieveNavigationTargets").addEdge("retrieveNavigationTargets", "chooseNavigationTargets").addEdge("chooseNavigationTargets", "respondWithNavigation").addEdge("respondWithNavigation", w);
2007
+ function An() {
2008
+ const e = S().map(({ hints: t, title: a }) => t[0] ?? a).join(", ");
2009
+ return String.raw`- **portal-navigation** - Portal page navigation assistant:
2010
+ - routes requests to open, show, or navigate to a Portal page, including creation-flow pages
2011
+ - falls back to the closest Portal page where a workflow starts when another agent cannot perform the action
2012
+ - handles short navigation follow-ups after asking the user to open a page
2013
+ - capability examples: ${e}
2014
+ - do not use for general "how do I" questions unless the user explicitly asks to reach a page
2015
+ `;
2016
+ }
2017
+ const Nn = {
2018
+ id: "navigation",
2019
+ name: "Portal Navigation",
2020
+ get description() {
2021
+ return An();
2022
+ },
2023
+ createGraph: Cn,
2024
+ workspace: Ue
2025
+ }, Pn = je`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
2026
+ function Gn(e, t) {
2027
+ if (!t)
2028
+ return;
2029
+ const { destinationType: a } = e;
2030
+ switch (a) {
747
2031
  case "portal-content":
748
- return `${a}/content.html`;
2032
+ return t[a]?.(e.hash, e.queryParams);
749
2033
  case "portal-groups":
750
- return `${a}/groups.html`;
2034
+ return t[a]?.(e.hash);
2035
+ case "portal-org":
2036
+ return t[a]?.(e.hash, e.queryParams);
2037
+ case "portal-gallery":
2038
+ return t[a];
2039
+ case "portal-map-viewer":
2040
+ case "portal-notebooks":
2041
+ case "portal-scene-viewer":
2042
+ return t[a];
751
2043
  case "portal-item":
752
- return `${a}/item.html?id=${s.itemId}`;
2044
+ return t[a]?.(e.itemId);
753
2045
  case "portal-group":
754
- return `${a}/group.html?id=${s.groupId}`;
2046
+ return t[a]?.(e.groupId);
755
2047
  default:
756
- return P(e);
2048
+ return U(a);
757
2049
  }
758
- };
759
- class ne extends tt {
2050
+ }
2051
+ function qn(e) {
2052
+ const t = At.safeParse(e);
2053
+ return t.success ? t.data : void 0;
2054
+ }
2055
+ function En(e, t) {
2056
+ const a = t.navigation;
2057
+ switch (e.destinationType) {
2058
+ case "portal-content":
2059
+ switch (e.hash) {
2060
+ case "favorites":
2061
+ return a.openContentFavorites;
2062
+ case "group":
2063
+ return a.openContentGroup;
2064
+ case "living-atlas":
2065
+ return a.openContentLivingAtlas;
2066
+ case "org":
2067
+ return a.openContentOrganization;
2068
+ default:
2069
+ return a.openContent;
2070
+ }
2071
+ case "portal-gallery":
2072
+ return a.openGallery;
2073
+ case "portal-groups":
2074
+ switch (e.hash) {
2075
+ case "featured":
2076
+ return a.openGroupsFeatured;
2077
+ case "my":
2078
+ return a.openGroupsMy;
2079
+ case "organization":
2080
+ return a.openGroupsOrganization;
2081
+ default:
2082
+ return a.openGroups;
2083
+ }
2084
+ case "portal-map-viewer":
2085
+ return a.openMapViewer;
2086
+ case "portal-notebooks":
2087
+ return a.openNotebooks;
2088
+ case "portal-scene-viewer":
2089
+ return a.openSceneViewer;
2090
+ case "portal-org":
2091
+ return a.openOrgSettings;
2092
+ case "portal-item":
2093
+ return a.openItem;
2094
+ case "portal-group":
2095
+ return a.openGroup;
2096
+ default:
2097
+ return U(e);
2098
+ }
2099
+ }
2100
+ class kn extends Oe {
760
2101
  constructor() {
761
- super(...arguments), this.t9n = rt({ blocking: !0 }), this.assistantEl = M(), this.formEl = M(), this.voiceInputEl = M(), this.inputEl = M(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
762
- const e = t.detail, a = e.data?.block;
763
- if (!a)
2102
+ super(), this.t9n = Be({ blocking: !0 }), this.assistantEl = E(), this.formEl = E(), this.voiceInputEl = E(), this.inputEl = E(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
2103
+ const a = t.detail, n = a.data?.block;
2104
+ if (!n)
764
2105
  return;
765
- const r = this.getNavigationAction(a);
766
- r && this.upsertNavigationSlotElement(e.slotName, r);
767
- }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = et();
2106
+ const o = this.getNavigationAction(n);
2107
+ o && this.upsertNavigationSlotElement(a.slotName, o);
2108
+ }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.useProdDocAssistant = !1, this.arcgisPortalNavigationRequest = Le(), S();
768
2109
  }
769
2110
  static {
770
- this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, defaultClosed: 5 };
2111
+ this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, navigationTargetMap: 0, disabledAgents: 0, defaultClosed: 5, navigationCapabilities: 0, useProdDocAssistant: 5 };
771
2112
  }
772
2113
  static {
773
- this.styles = re;
2114
+ this.styles = Pn;
2115
+ }
2116
+ async load() {
2117
+ await this.refreshCapabilityEmbeddings();
2118
+ }
2119
+ willUpdate(t) {
2120
+ !this.hasUpdated || !t.has("navigationCapabilities") || this.refreshCapabilityEmbeddings();
2121
+ }
2122
+ async clearEmbeddingsCache() {
2123
+ ge();
2124
+ }
2125
+ isAgentEnabled(t) {
2126
+ return !this.disabledAgents?.[t];
2127
+ }
2128
+ async refreshCapabilityEmbeddings() {
2129
+ try {
2130
+ S(this.navigationCapabilities), fn(), ge(), await un();
2131
+ } catch (t) {
2132
+ console.warn("[arcgis-portal-ai-assistant] embeddings warm-up failed:", t);
2133
+ }
774
2134
  }
775
2135
  getNavigationAction(t) {
776
- if (t?.type !== _)
2136
+ if (t?.type !== xe)
777
2137
  return;
778
- const e = jt(t.data);
779
- if (!e)
2138
+ const a = t.data, n = qn(a);
2139
+ if (!n)
780
2140
  return;
781
- const a = oe(e, this.portal);
782
- if (a)
783
- return { href: a, targetDetail: e, label: this.getNavigationText(e.destinationType) };
2141
+ const o = Gn(a, this.navigationTargetMap);
2142
+ if (o)
2143
+ return {
2144
+ href: o,
2145
+ targetDetail: a,
2146
+ label: a?.buttonLabel || En(n, this.t9n)
2147
+ };
784
2148
  }
785
- upsertNavigationSlotElement(t, e) {
786
- const a = this.assistantEl.value;
787
- if (!a)
2149
+ upsertNavigationSlotElement(t, a) {
2150
+ const n = this.assistantEl.value;
2151
+ if (!n)
788
2152
  return;
789
- let r = this.navigationSlotElements.get(t);
790
- r || (r = document.createElement("div"), r.slot = t, this.navigationSlotElements.set(t, r), a.append(r)), at(w`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${e.href} icon-end=launch @click=${(l) => {
791
- l.preventDefault(), this.arcgisPortalNavigationRequest.emit({
792
- href: e.href,
793
- targetDetail: e.targetDetail
2153
+ const o = `navigation:${t}`;
2154
+ let r = this.navigationSlotElements.get(o);
2155
+ r || (r = document.createElement("div"), r.slot = t, this.navigationSlotElements.set(o, r), n.append(r)), Ve(v`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${a.href} icon-end=launch @click=${(i) => {
2156
+ i.preventDefault(), this.arcgisPortalNavigationRequest.emit({
2157
+ href: a.href,
2158
+ targetDetail: a.targetDetail
794
2159
  });
795
- }}>${e.label}</calcite-button>${e.description ? w`<div class="navigation-block-description">${e.description}</div>` : null}</div>`, r);
796
- }
797
- getNavigationText(t) {
798
- const e = this.t9n.navigation;
799
- switch (t) {
800
- case "portal-content":
801
- return e.openContent;
802
- case "portal-groups":
803
- return e.openGroups;
804
- case "portal-item":
805
- return e.openItem;
806
- case "portal-group":
807
- return e.openGroup;
808
- default:
809
- return P(t);
810
- }
2160
+ }}>${a.label}</calcite-button>${a.description ? v`<div class="navigation-block-description">${a.description}</div>` : null}</div>`, r);
811
2161
  }
812
2162
  render() {
813
- const { t9n: t, inputText: e, portal: a, user: r, showVoiceInput: l, isListening: c, isVoiceInputDisabled: i } = this;
814
- return w`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: o }) => {
815
- this.interrupt = o;
2163
+ const { t9n: t, inputText: a, portal: n, user: o, navigationTargetMap: r, showVoiceInput: i, isListening: u, isVoiceInputDisabled: c, useProdDocAssistant: d } = this;
2164
+ return v`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: l }) => {
2165
+ this.interrupt = l;
816
2166
  }} @arcgisInterruptCancel=${() => {
817
2167
  this.interrupt = null;
818
2168
  }} @arcgisInterruptSubmit=${() => {
819
2169
  this.interrupt = null;
820
- }} @arcgisPromptSelect=${({ detail: o }) => {
821
- this.inputText = o.prompt, requestAnimationFrame(() => {
2170
+ }} @arcgisPromptSelect=${({ detail: l }) => {
2171
+ this.inputText = l.prompt, requestAnimationFrame(() => {
822
2172
  this.inputEl.value?.focusTextArea();
823
2173
  });
824
- }} ${T(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(o) => {
825
- o.preventDefault();
826
- const u = e.trim();
827
- u && (this.assistantEl.value?.submitMessage(u), this.inputText = "");
828
- }} ${T(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${a} .user=${r} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${e} @arcgisUserMentionableTextAreaKeyDown=${({ detail: o }) => {
829
- o.key === "Enter" && !o.shiftKey && (o.preventDefault(), this.formEl.value?.requestSubmit());
830
- }} @arcgisUserMentionableTextAreaChange=${({ detail: o }) => {
831
- this.inputText = o ?? "";
832
- }} ${T(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
2174
+ }} ${k(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(l) => {
2175
+ l.preventDefault();
2176
+ const p = a.trim();
2177
+ p && (this.assistantEl.value?.submitMessage(p), this.inputText = "");
2178
+ }} ${k(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${n} .user=${o} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${a} @arcgisUserMentionableTextAreaKeyDown=${({ detail: l }) => {
2179
+ l.key === "Enter" && !l.shiftKey && (l.preventDefault(), this.formEl.value?.requestSubmit());
2180
+ }} @arcgisUserMentionableTextAreaChange=${({ detail: l }) => {
2181
+ this.inputText = l ?? "";
2182
+ }} ${k(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
833
2183
  this.isListening = !0, this.isVoiceInputDisabled = !1;
834
2184
  }} @arcgisVoiceInputStop=${() => {
835
2185
  this.isListening = !1, this.isVoiceInputDisabled = !1;
836
- }} @arcgisVoiceInputError=${(o) => {
837
- o.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
838
- }} @arcgisVoiceInputInterimTranscription=${(o) => {
839
- this.inputText = o.detail.text;
840
- }} ${T(this.voiceInputEl)}></arcgis-portal-voice-input>${l && w`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${i} .appearance=${c ? "solid" : "outline-fill"} @click=${async () => {
2186
+ }} @arcgisVoiceInputError=${(l) => {
2187
+ l.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
2188
+ }} @arcgisVoiceInputInterimTranscription=${(l) => {
2189
+ this.inputText = l.detail.text;
2190
+ }} ${k(this.voiceInputEl)}></arcgis-portal-voice-input>${i && v`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${c} .appearance=${u ? "solid" : "outline-fill"} @click=${async () => {
841
2191
  this.isVoiceInputDisabled = !0;
842
- const o = this.voiceInputEl.value;
843
- c ? await o?.stopListening() : await o?.startListening();
844
- }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!e.trim()} .label=${t.send}>${t.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${Tt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Lt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${ae} .context=${{ portal: a, user: r }}></arcgis-assistant-agent>${this.interrupt && w`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: o }) => {
845
- this.assistantEl.value?.submitInterrupt(o);
2192
+ const l = this.voiceInputEl.value;
2193
+ u ? await l?.stopListening() : await l?.startListening();
2194
+ }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!a.trim()} .label=${t.send}>${t.send}</calcite-button></div></form>${this.isAgentEnabled("itemAnalytics") && v`<arcgis-assistant-agent .agent=${Ra} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupCreation") && v`<arcgis-assistant-agent .agent=${qt} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("docAssistant") && v`<arcgis-assistant-agent .agent=${na} .context=${{ portal: n, user: o, navigationTargetMap: r, useProdDocAssistant: d }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupAnalytics") && v`<arcgis-assistant-agent .agent=${Ma} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("navigation") && v`<arcgis-assistant-agent .agent=${Nn} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.interrupt && v`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: l }) => {
2195
+ this.assistantEl.value?.submitInterrupt(l);
846
2196
  }} @arcgisCancel=${() => {
847
2197
  this.assistantEl.value?.cancelInterrupt();
848
2198
  }}></arcgis-portal-ai-assistant-interrupt>` || ""}</arcgis-assistant>`;
849
2199
  }
850
2200
  }
851
- Z("arcgis-portal-ai-assistant", ne);
2201
+ Fe("arcgis-portal-ai-assistant", kn);
852
2202
  export {
853
- ne as ArcgisPortalAiAssistant
2203
+ kn as ArcgisPortalAiAssistant
854
2204
  };