@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.111

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 (334) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/LLMAgent.d.ts +9 -7
  4. package/dist/agent-utils/LLMAgent.js +63 -60
  5. package/dist/agent-utils/WorkflowAgent.js +14 -15
  6. package/dist/agent-utils/index.d.ts +78 -0
  7. package/dist/agent-utils/index.js +116 -97
  8. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  9. package/dist/agent-utils/middlewares/trace.js +5 -5
  10. package/dist/agent-utils/types.d.ts +13 -13
  11. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  12. package/dist/agentic-workflow/Edge.d.ts +16 -0
  13. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  14. package/dist/agentic-workflow/jsonTypes.d.ts +229 -0
  15. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  16. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  17. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  18. package/dist/agentic-workflow/nodes/HumanInTheLoopNode.d.ts +37 -0
  19. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  20. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  21. package/dist/agentic-workflow/types.d.ts +29 -0
  22. package/dist/agents/runtime/skill/createSkillAgent.d.ts +30 -0
  23. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  24. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  25. package/dist/agents/runtime/skill/types.d.ts +20 -0
  26. package/dist/{cdn/WNS5ZUF5.js → agents/runtime/skill/types.js} +1 -1
  27. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  28. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  29. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  30. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  31. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  32. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  33. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  34. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  35. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  36. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  37. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  38. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  39. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  40. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  41. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  42. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  43. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  44. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  45. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  46. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  47. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  48. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  49. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  50. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  51. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  52. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  53. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  54. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  55. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  56. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  57. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  58. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  59. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  60. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  61. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  62. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  63. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  64. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  65. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  66. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  67. package/dist/agents/tools/shared/types.d.ts +22 -0
  68. package/dist/agents/tools/shared/types.js +6 -0
  69. package/dist/cdn/2BNQ6A6J.js +2 -0
  70. package/dist/cdn/2MWUBKWI.js +2 -0
  71. package/dist/cdn/{F6QHMKF5.js → 2O4DON37.js} +1 -1
  72. package/dist/cdn/2W7LK4HA.js +2 -0
  73. package/dist/cdn/33PB7ALY.js +2 -0
  74. package/dist/cdn/{5CV7R5IS.js → 33SFAZQG.js} +5 -5
  75. package/dist/cdn/34O57OGV.js +2 -0
  76. package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
  77. package/dist/cdn/4IU63OWQ.js +2 -0
  78. package/dist/cdn/5A355PGH.js +14 -0
  79. package/dist/cdn/5HBAJ57P.js +2 -0
  80. package/dist/cdn/5MK44FNO.js +2 -0
  81. package/dist/cdn/5Q2XRQS6.js +2 -0
  82. package/dist/cdn/6ECRQVHY.js +2 -0
  83. package/dist/cdn/6OOZSZRJ.js +2 -0
  84. package/dist/cdn/6OUIUXAJ.js +2 -0
  85. package/dist/cdn/{UPEEHMSY.js → 6P44KOKX.js} +1 -1
  86. package/dist/cdn/73TMZQI5.js +2 -0
  87. package/dist/cdn/74CVYM72.js +19 -0
  88. package/dist/cdn/7EHOFQ2P.js +3 -0
  89. package/dist/cdn/7KSFIRXB.js +2 -0
  90. package/dist/cdn/AHCXG7XF.js +2 -0
  91. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  92. package/dist/cdn/{Q7TL5Q5N.js → APFZY4PI.js} +1 -1
  93. package/dist/cdn/AVRS6UCQ.js +2 -0
  94. package/dist/cdn/AVZ5Y6BK.js +11 -0
  95. package/dist/cdn/AXTQU5YL.js +56 -0
  96. package/dist/cdn/BBPD2AS7.js +2 -0
  97. package/dist/cdn/BFZ5S7NF.js +2 -0
  98. package/dist/cdn/{6ZW7Z36F.js → BL273EGZ.js} +3 -3
  99. package/dist/cdn/C7JPWFZE.js +2 -0
  100. package/dist/cdn/CCC6LBMY.js +2 -0
  101. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  102. package/dist/cdn/CFAC4FN3.js +2 -0
  103. package/dist/cdn/COH3QXWG.js +4 -0
  104. package/dist/cdn/DB2TFPIO.js +2 -0
  105. package/dist/cdn/DE26DAW5.js +2 -0
  106. package/dist/cdn/DG27JEYG.js +50 -0
  107. package/dist/cdn/DKA6PSYN.js +2 -0
  108. package/dist/cdn/DQ2Z65UO.js +3 -0
  109. package/dist/cdn/DWH23NJN.js +2 -0
  110. package/dist/cdn/EDXTPEEU.js +2 -0
  111. package/dist/cdn/ENM3L4AC.js +2 -0
  112. package/dist/cdn/EVMIYZWD.js +2 -0
  113. package/dist/cdn/EYOWRGDP.js +2 -0
  114. package/dist/cdn/EYY367WR.js +2 -0
  115. package/dist/cdn/F5NIRETW.js +2 -0
  116. package/dist/cdn/FCI6M62J.js +2 -0
  117. package/dist/cdn/FDOMMK2M.js +2 -0
  118. package/dist/cdn/FS7GXTTQ.js +6 -0
  119. package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
  120. package/dist/cdn/H6P3WP5D.js +14 -0
  121. package/dist/cdn/HHP5YLUI.js +2 -0
  122. package/dist/cdn/HIAQARIQ.js +2 -0
  123. package/dist/cdn/HMIDFTEI.js +2 -0
  124. package/dist/cdn/HMNBUGH2.js +2 -0
  125. package/dist/cdn/HR6GWPKX.js +2 -0
  126. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  127. package/dist/cdn/IH26MIYY.js +2 -0
  128. package/dist/cdn/IHP25JWI.js +99 -0
  129. package/dist/cdn/IYLFJCJ2.js +181 -0
  130. package/dist/cdn/J6A4AS7E.js +22 -0
  131. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  132. package/dist/cdn/JICNSK6Y.js +6 -0
  133. package/dist/cdn/JQYLMTDP.js +2 -0
  134. package/dist/cdn/K5JVB6FU.js +2 -0
  135. package/dist/cdn/K7XWGSLN.js +2 -0
  136. package/dist/cdn/K7YQIJFT.js +2 -0
  137. package/dist/cdn/KH4V4I3W.js +2 -0
  138. package/dist/cdn/KMLJS2VW.js +2 -0
  139. package/dist/cdn/LAVFUDUG.js +2 -0
  140. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  141. package/dist/cdn/LOQ2PKV5.js +208 -0
  142. package/dist/cdn/LXPGQNXQ.js +5 -0
  143. package/dist/cdn/MJSIYEWN.js +2 -0
  144. package/dist/cdn/{ZEYIBYSF.js → MWYBF3F3.js} +1 -1
  145. package/dist/cdn/{24QNMEFG.js → MXTXJKFE.js} +1 -1
  146. package/dist/cdn/NEV6OZN3.js +71 -0
  147. package/dist/cdn/O4NVW75A.js +2 -0
  148. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  149. package/dist/cdn/OMF6ITSG.js +2 -0
  150. package/dist/cdn/ONQ6JSBJ.js +2 -0
  151. package/dist/cdn/OZAZ277H.js +2 -0
  152. package/dist/cdn/P4GFYBBO.js +3 -0
  153. package/dist/cdn/P4XZMBU5.js +2 -0
  154. package/dist/cdn/POL6HKCG.js +72 -0
  155. package/dist/cdn/POZYDAU2.js +2 -0
  156. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  157. package/dist/cdn/PYGX4HN7.js +2 -0
  158. package/dist/cdn/QNXI3WOF.js +179 -0
  159. package/dist/cdn/{DXVU45KM.js → QRMRID2M.js} +1 -1
  160. package/dist/cdn/R74ZHFA6.js +2 -0
  161. package/dist/cdn/RFVZ7KCG.js +66 -0
  162. package/dist/cdn/RHYNE5OE.js +2 -0
  163. package/dist/cdn/RLEHNAIA.js +2 -0
  164. package/dist/cdn/ROQGPAR5.js +9 -0
  165. package/dist/cdn/RXF2NUOL.js +2 -0
  166. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  167. package/dist/cdn/SHI76XUV.js +2 -0
  168. package/dist/cdn/SITY6L4S.js +2 -0
  169. package/dist/cdn/STHBRTTD.js +2 -0
  170. package/dist/cdn/{WAIFKDR3.js → SXM4NUT5.js} +1 -1
  171. package/dist/cdn/SZRJTQ54.js +2 -0
  172. package/dist/cdn/TO2NY7EA.js +2 -0
  173. package/dist/cdn/TPULIO6I.js +34 -0
  174. package/dist/cdn/TVEEQSMF.js +2 -0
  175. package/dist/cdn/TWU3QXAS.js +2 -0
  176. package/dist/cdn/TYATJUNF.js +2 -0
  177. package/dist/cdn/UCTC4JN4.js +3 -0
  178. package/dist/cdn/UDRKUVZP.js +2 -0
  179. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  180. package/dist/cdn/UHICISBZ.js +2 -0
  181. package/dist/cdn/UO5PBOQR.js +2 -0
  182. package/dist/cdn/UZLQALHY.js +2 -0
  183. package/dist/cdn/V6HOUZPZ.js +2 -0
  184. package/dist/cdn/{P7DG5T3Z.js → V7Y22FRP.js} +1 -1
  185. package/dist/cdn/VAXH6RUQ.js +134 -0
  186. package/dist/cdn/VNLSYVPE.js +2 -0
  187. package/dist/cdn/VR3CF3ZY.js +2 -0
  188. package/dist/cdn/VWP2B4LB.js +2 -0
  189. package/dist/cdn/VXFQANGJ.js +2 -0
  190. package/dist/cdn/WKZHFSH3.js +2 -0
  191. package/dist/cdn/{AZGGTNA3.js → WSWB3B7B.js} +1 -1
  192. package/dist/cdn/WVP73XWD.js +2 -0
  193. package/dist/cdn/WXQ26G5Q.js +2 -0
  194. package/dist/cdn/XQ3NBBQ3.js +2 -0
  195. package/dist/cdn/{7CYGX4F4.js → YHWYTHID.js} +1 -1
  196. package/dist/cdn/YIZ7PR2G.js +2 -0
  197. package/dist/cdn/Z5XQLSYH.js +2 -0
  198. package/dist/cdn/ZFOG3KXV.js +2 -0
  199. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  200. package/dist/cdn/agent-utils/index.js +1 -1
  201. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -2
  202. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  203. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  204. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  205. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  206. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  207. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  208. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  209. package/dist/cdn/index.js +1 -1
  210. package/dist/chunks/SKILL.js +5 -0
  211. package/dist/chunks/SKILL2.js +5 -0
  212. package/dist/chunks/SKILL3.js +22 -0
  213. package/dist/chunks/SKILL4.js +5 -0
  214. package/dist/chunks/adapter.js +1126 -2010
  215. package/dist/chunks/aiFactory.js +100 -0
  216. package/dist/chunks/arcgisKnowledgeGraph.js +96 -76
  217. package/dist/chunks/arcgisToolRegistry.js +88 -0
  218. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  219. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  220. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  221. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  222. package/dist/chunks/baseAgentState.js +58 -0
  223. package/dist/chunks/converterUtils.js +66 -41
  224. package/dist/chunks/dataExplorationAgent.js +19 -0
  225. package/dist/chunks/data_explore_query_prompt.js +9 -4
  226. package/dist/chunks/fetchAgentContext.js +13 -0
  227. package/dist/chunks/fetchService.js +10 -0
  228. package/dist/chunks/fieldStatistics.js +79 -0
  229. package/dist/chunks/formatFeatureAttributes.js +132 -0
  230. package/dist/chunks/generateLayerDescriptions.js +183 -307
  231. package/dist/chunks/helpAgent.js +34 -0
  232. package/dist/chunks/help_prompt.js +34 -17
  233. package/dist/chunks/intent_prompt.js +2 -2
  234. package/dist/chunks/layerStylingGraph.js +101 -83
  235. package/dist/chunks/mergeWhereClauses.js +15 -0
  236. package/dist/chunks/navigationAgent.js +27 -0
  237. package/dist/chunks/navigation_intent_prompt.js +8 -2
  238. package/dist/chunks/orchestrator.js +445 -234
  239. package/dist/chunks/requireAgentServices.js +11 -0
  240. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  241. package/dist/chunks/state.js +39 -45
  242. package/dist/chunks/utils2.js +11 -11
  243. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  244. package/dist/components/arcgis-assistant/customElement.js +331 -183
  245. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  246. package/dist/components/arcgis-assistant-agent/customElement.js +674 -10
  247. package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
  248. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +34 -8
  249. package/dist/components/arcgis-assistant-help-agent/customElement.js +31 -8
  250. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  251. package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
  252. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  253. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  254. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  255. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  256. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  257. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  258. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  259. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  260. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  261. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  262. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  263. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +33 -9
  264. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  265. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  266. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  267. package/dist/docs/api.json +1 -1
  268. package/dist/docs/docs.json +1 -1
  269. package/dist/docs/vscode.html-custom-data.json +1 -1
  270. package/dist/docs/web-types.json +1 -1
  271. package/dist/loader.js +6 -6
  272. package/dist/oauth-callback.html +1 -1
  273. package/dist/orchestrator/models/types.d.ts +1 -0
  274. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  275. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  276. package/dist/orchestrator/types/types.d.ts +17 -0
  277. package/dist/types/lumina.d.ts +5 -4
  278. package/dist/types/preact.d.ts +5 -4
  279. package/dist/types/react.d.ts +5 -4
  280. package/dist/types/stencil.d.ts +7 -6
  281. package/dist/utils/index.d.ts +75 -39
  282. package/dist/utils/index.js +707 -83
  283. package/package.json +35 -12
  284. package/dist/cdn/34SG44C3.js +0 -72
  285. package/dist/cdn/3JGWGKT6.js +0 -2
  286. package/dist/cdn/3NBDVZ2I.js +0 -2
  287. package/dist/cdn/3VOQD2MR.js +0 -2
  288. package/dist/cdn/53NTYC4I.js +0 -2
  289. package/dist/cdn/5QAHYX7Y.js +0 -5
  290. package/dist/cdn/AXDZBBNL.js +0 -45
  291. package/dist/cdn/B7WJFBOZ.js +0 -2
  292. package/dist/cdn/BX7FSMUU.js +0 -56
  293. package/dist/cdn/CHPQM77M.js +0 -181
  294. package/dist/cdn/DHKUXLU3.js +0 -179
  295. package/dist/cdn/DQSEBKOX.js +0 -2
  296. package/dist/cdn/DZ2QWNUA.js +0 -3
  297. package/dist/cdn/EBISDZ5H.js +0 -2
  298. package/dist/cdn/ERL2CB2Y.js +0 -14
  299. package/dist/cdn/F2AHA4GB.js +0 -54
  300. package/dist/cdn/FUIGPHBH.js +0 -2
  301. package/dist/cdn/H2CHHGGH.js +0 -2
  302. package/dist/cdn/HWKDNS4K.js +0 -4
  303. package/dist/cdn/IMQ4TVHF.js +0 -16
  304. package/dist/cdn/IOD3GDA7.js +0 -2
  305. package/dist/cdn/IR7PTESF.js +0 -2
  306. package/dist/cdn/IRZDTYO2.js +0 -2
  307. package/dist/cdn/JIWK6QK6.js +0 -2
  308. package/dist/cdn/JLKGS6Y5.js +0 -36
  309. package/dist/cdn/K3JCH4XW.js +0 -2
  310. package/dist/cdn/KHXUWZHB.js +0 -2
  311. package/dist/cdn/KMQ3SP4I.js +0 -5
  312. package/dist/cdn/LIFK3QSD.js +0 -2
  313. package/dist/cdn/NXKKG5TK.js +0 -2
  314. package/dist/cdn/O3EN27N5.js +0 -2
  315. package/dist/cdn/O3RFFPU3.js +0 -6
  316. package/dist/cdn/PBO6FZN6.js +0 -2
  317. package/dist/cdn/Q3ZW4FYA.js +0 -3
  318. package/dist/cdn/Q6LRANX6.js +0 -2
  319. package/dist/cdn/QCSN44H4.js +0 -2
  320. package/dist/cdn/R56X6ZKR.js +0 -161
  321. package/dist/cdn/RUURNLTP.js +0 -2
  322. package/dist/cdn/T43LEBBE.js +0 -47
  323. package/dist/cdn/TR4GFL7X.js +0 -2
  324. package/dist/cdn/X4XY5HIE.js +0 -2
  325. package/dist/cdn/XOH56EQ2.js +0 -2
  326. package/dist/cdn/XON27U6U.js +0 -2
  327. package/dist/cdn/YIMNOUTF.js +0 -2
  328. package/dist/cdn/YLN2BZ5J.js +0 -2
  329. package/dist/cdn/YUKR4AZW.js +0 -2
  330. package/dist/cdn/Z2G7MP5L.js +0 -22
  331. package/dist/chunks/dataExplorationGraph.js +0 -310
  332. package/dist/chunks/helpGraph.js +0 -126
  333. package/dist/chunks/navigationGraph.js +0 -270
  334. package/dist/chunks/toolCallResponse.js +0 -31
@@ -0,0 +1,131 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { tool as v } from "@langchain/core/tools";
3
+ import { a as C } from "../../../../chunks/formatFeatureAttributes.js";
4
+ import { g as R, i as F, a as I, s as G, r as O } from "../../../../chunks/resolvePointGeometryFilter.js";
5
+ import { c as j, m as x } from "../../../../chunks/mergeWhereClauses.js";
6
+ import t from "zod";
7
+ import { f as N } from "../../../../chunks/fetchAgentContext.js";
8
+ import { distanceUnitsSchema as q } from "../../shared/types.js";
9
+ const p = 25, W = (i) => i.flatMap((r) => r.split(",")).map((r) => r.trim()).map((r) => r.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((r) => !!r), B = async (i, r, e, l) => {
10
+ const a = r.map?.allLayers.find((u) => u.id === i.layerId), d = await r.whenLayerView(a), f = a.title ?? i.layerId;
11
+ let h;
12
+ if (e) {
13
+ const u = await R(e, r);
14
+ if ("error" in u) {
15
+ const s = { error: u.error };
16
+ if (F(e)) {
17
+ const c = r.map?.allLayers.find((y) => y.id === e.layerId);
18
+ s.geometryLayerName = c?.title ?? c?.id, s.geometryLayerId = e.layerId, s.geometryWhere = e.where;
19
+ } else I(e) && (s.point = e.point);
20
+ return {
21
+ tool: "queryFeatures",
22
+ layerName: f,
23
+ summary: "Geometry lookup failed",
24
+ details: s
25
+ };
26
+ }
27
+ if (!u.geometry) {
28
+ const s = {};
29
+ if (F(e)) {
30
+ const c = r.map?.allLayers.find((y) => y.id === e.layerId);
31
+ s.error = `No features found matching: ${e.where}`, s.geometryLayerName = c?.title ?? c?.id, s.geometryLayerId = e.layerId, s.geometryWhere = e.where;
32
+ } else I(e) && (s.error = "Failed to create point geometry", s.point = e.point);
33
+ return {
34
+ tool: "queryFeatures",
35
+ layerName: f,
36
+ summary: "No features found for geometry filter",
37
+ details: s
38
+ };
39
+ }
40
+ h = u.geometry;
41
+ } else l && (h = r.extent.clone());
42
+ const T = [
43
+ .../* @__PURE__ */ new Set([...i.outFields, ...W(i.orderByFields)])
44
+ ], b = j(d, T, l ?? !1), w = a.objectIdField, o = a.createQuery();
45
+ o.where = x(a.definitionExpression, i.where || "1=1"), o.outFields = i.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...i.outFields, w])], o.orderByFields = i.orderByFields, h && (o.geometry = h, o.spatialRelationship = "intersects"), e?.distance && (o.distance = e.distance), e?.units && (o.units = e.units), o.outSpatialReference = r.spatialReference;
46
+ let n, m;
47
+ try {
48
+ n = b ? await d.queryFeatureCount(o) : await a.queryFeatureCount(o), n > 0 && n <= p && (m = b ? await d.queryFeatures(o) : await a.queryFeatures(o));
49
+ } catch (u) {
50
+ console.warn("Client-side query failed, falling back to server:", u), n = await a.queryFeatureCount(o), n > 0 && n <= p && (m = await a.queryFeatures(o));
51
+ }
52
+ const { objectIds: g, attributes: S } = m ? C(a, m, r.timeZone) : { objectIds: void 0, attributes: void 0 };
53
+ return {
54
+ tool: "queryFeatures",
55
+ layerName: f,
56
+ summary: `${n} features found`,
57
+ details: {
58
+ totalCount: n,
59
+ where: i.where,
60
+ orderByFields: i.orderByFields,
61
+ outFields: i.outFields,
62
+ ...g && { objectIds: g, objectIdField: w },
63
+ ...S && { attributes: S },
64
+ ...n > p && {
65
+ note: `${n} features found.`
66
+ }
67
+ }
68
+ };
69
+ };
70
+ async function k({
71
+ targetLayer: i,
72
+ geometryFilter: r,
73
+ useCurrentExtent: e
74
+ }, l) {
75
+ const { mapView: a } = N(l, ["mapView"]), d = O(
76
+ r,
77
+ l.state?.agentExecutionContext?.sharedResources
78
+ ), f = await B(i, a, d, e);
79
+ return JSON.stringify(f, null, 2);
80
+ }
81
+ const D = t.object({
82
+ layerId: t.string().describe("The layerId of the layer containing the geometry by which to filter."),
83
+ where: t.string().describe("The SQL-92 where clause representing the features from which to filter."),
84
+ distance: t.number().optional().describe("The buffer distance around the geometry."),
85
+ units: q.optional().describe("The units for the distance buffer.")
86
+ }), L = t.object({
87
+ point: t.object({
88
+ x: t.number().describe("X coordinate (longitude) from navigation result"),
89
+ y: t.number().describe("Y coordinate (latitude) from navigation result"),
90
+ spatialReference: t.object({
91
+ wkid: t.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")
92
+ }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
93
+ }).describe("Point coordinates from a previous navigation/geocoding result"),
94
+ distance: t.number().optional().describe("Optional buffer distance around the point."),
95
+ units: q.optional().describe("The units for the distance buffer.")
96
+ }), U = t.object({
97
+ targetLayer: t.object({
98
+ layerId: t.string().describe("The layerId of the layer containing the field from which to get a value."),
99
+ where: t.string().describe(
100
+ "SQL-92 where clause. IMPORTANT: When using geometryFilter.point or geometryFilter.sharedResourceId for point-in-polygon queries, set this to '1=1' to return all features that intersect the point. Only add attribute filters if the user specifically requests them in addition to the spatial query."
101
+ ),
102
+ orderByFields: t.array(t.string().describe("The field(s) and order for which to sort the resulting features.")),
103
+ outFields: t.array(
104
+ t.string().describe(
105
+ 'The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").'
106
+ ).default("*")
107
+ )
108
+ }),
109
+ geometryFilter: t.union([D, L, G]).optional().describe(
110
+ "Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."
111
+ ),
112
+ useCurrentExtent: t.boolean().optional().describe(
113
+ "Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer)."
114
+ )
115
+ }), X = v(k, {
116
+ name: "queryFeatures",
117
+ description: `Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if ≤25 features match.
118
+
119
+ USE THIS TOOL FOR:
120
+ - "Show / display / list features where..." — finding and listing features
121
+ - "How many X are Y?" — counting features that match a condition
122
+ - "Which features..." / "Find features..." — identifying specific features
123
+ - Spatial queries — finding features near/within/intersecting other features
124
+ - Any question where the user wants to SEE or COUNT matching features
125
+
126
+ This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
127
+ schema: U
128
+ });
129
+ export {
130
+ X as queryFeaturesTool
131
+ };
@@ -0,0 +1,8 @@
1
+ import type { StructuredToolInterface } from "@langchain/core/tools";
2
+
3
+ /**
4
+ * Finds and enriches fields that are semantically relevant to a task.
5
+ *
6
+ * @internal
7
+ */
8
+ export const findRelevantFieldsTool: StructuredToolInterface;
@@ -0,0 +1,57 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { tool as y } from "@langchain/core/tools";
3
+ import t from "zod";
4
+ import { f as h } from "../../../../chunks/fetchAgentContext.js";
5
+ import { f as r } from "../../../../chunks/fetchService.js";
6
+ import { b as p } from "../../../../chunks/fieldStatistics.js";
7
+ const v = 0.7, S = 10;
8
+ async function R(a) {
9
+ const {
10
+ query: e,
11
+ layerIds: i,
12
+ includeSummaryStatistics: s = !1,
13
+ fieldSearch: l,
14
+ layersAndFieldsRegistry: d,
15
+ embeddingCache: o,
16
+ mapView: c,
17
+ minScore: m = v,
18
+ topResults: f = S
19
+ } = a, n = await l.searchFields({
20
+ text: e,
21
+ layerIds: i,
22
+ minScore: m,
23
+ topResults: f,
24
+ embeddingCache: o
25
+ }), u = await p(
26
+ n,
27
+ d,
28
+ c,
29
+ s
30
+ );
31
+ return { matches: n, ...u };
32
+ }
33
+ const b = t.object({
34
+ query: t.string().describe("A concise semantic description of the fields relevant to the user's task."),
35
+ layerIds: t.array(t.string()).min(1).describe("Layer IDs returned by findRelevantLayers, restricted to layers relevant to the current task."),
36
+ includeSummaryStatistics: t.boolean().optional().default(!1).describe(
37
+ "Set to true only when the task directly asks for numeric summaries such as average, minimum, maximum, total, variance, or range."
38
+ )
39
+ });
40
+ async function F(a, e) {
41
+ const { mapView: i } = h(e, ["mapView"]), s = await R({
42
+ ...a,
43
+ fieldSearch: r(e, "fieldSearch"),
44
+ layersAndFieldsRegistry: r(e, "layersAndFieldsRegistry"),
45
+ embeddingCache: r(e, "embeddingCache"),
46
+ mapView: i
47
+ });
48
+ return JSON.stringify(s, null, 2);
49
+ }
50
+ const C = y(F, {
51
+ name: "findRelevantFields",
52
+ description: "Finds relevant fields within candidate layers. Returns ranked matches, field metadata, categorical values, and optional numeric summary statistics. Call findRelevantLayers first when layer IDs are not already known.",
53
+ schema: b
54
+ });
55
+ export {
56
+ C as findRelevantFieldsTool
57
+ };
@@ -0,0 +1,8 @@
1
+ import type { StructuredToolInterface } from "@langchain/core/tools";
2
+
3
+ /**
4
+ * Finds map layers that are semantically relevant to a task.
5
+ *
6
+ * @internal
7
+ */
8
+ export const findRelevantLayersTool: StructuredToolInterface;
@@ -0,0 +1,38 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { tool as y } from "@langchain/core/tools";
3
+ import i from "zod";
4
+ import { f as n } from "../../../../chunks/fetchService.js";
5
+ const m = 0.7;
6
+ async function h(r) {
7
+ const { query: e, layerSearch: a, layersAndFieldsRegistry: l, embeddingCache: o, minScore: c = m } = r;
8
+ return (await a.searchLayers({ text: e, minScore: c, embeddingCache: o })).map(({ id: s, score: d }) => {
9
+ const t = l.get(s)?.layerItem;
10
+ return {
11
+ layerId: s,
12
+ score: d,
13
+ name: t?.name ?? void 0,
14
+ title: t?.title,
15
+ description: t?.description
16
+ };
17
+ });
18
+ }
19
+ const f = i.object({
20
+ query: i.string().describe("A concise semantic description of the layers relevant to the user's task.")
21
+ });
22
+ async function p({ query: r }, e) {
23
+ const a = await h({
24
+ query: r,
25
+ layerSearch: n(e, "layerSearch"),
26
+ layersAndFieldsRegistry: n(e, "layersAndFieldsRegistry"),
27
+ embeddingCache: n(e, "embeddingCache")
28
+ });
29
+ return JSON.stringify({ layers: a }, null, 2);
30
+ }
31
+ const S = y(p, {
32
+ name: "findRelevantLayers",
33
+ description: "Finds map layers relevant to a task and returns their layer IDs, similarity scores, names, titles, and descriptions. Call this before finding fields or querying data when layer IDs are not already known.",
34
+ schema: f
35
+ });
36
+ export {
37
+ S as findRelevantLayersTool
38
+ };
@@ -0,0 +1,22 @@
1
+ import type { BaseMessage } from "@langchain/core/messages";
2
+
3
+ /**
4
+ * Resolves the artifact from the most recent retained tool message with the requested tool name.
5
+ *
6
+ * @param parameter0
7
+ * @returns The validated artifact.
8
+ * @typeParam T - The validated artifact type.
9
+ * @throws If the matching message has no artifact, its artifact is invalid, or no matching message is available.
10
+ * @internal
11
+ */
12
+ export function resolveLatestToolArtifact<T>(parameter0: ResolveToolArtifactOptions<T>): T;
13
+
14
+ export type ResolveToolArtifactOptions<T> = {
15
+ messages: readonly BaseMessage[];
16
+ schema: ArtifactSchema<T>;
17
+ toolName: string;
18
+ };
19
+
20
+ export type ArtifactSchema<T> = {
21
+ parse: (value: unknown) => T;
22
+ };
@@ -0,0 +1,20 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { ToolMessage as a } from "@langchain/core/messages";
3
+ const i = (r) => typeof r == "object" && r !== null && "value" in r, c = ({ messages: r, schema: n, toolName: t }) => {
4
+ for (let o = r.length - 1; o >= 0; o--) {
5
+ const e = r[o];
6
+ if (!(!a.isInstance(e) || e.name !== t)) {
7
+ if (!i(e.artifact))
8
+ throw new Error(`Tool "${t}" did not return an artifact.`);
9
+ try {
10
+ return n.parse(e.artifact.value);
11
+ } catch {
12
+ throw new Error(`Tool "${t}" returned an invalid artifact.`);
13
+ }
14
+ }
15
+ }
16
+ throw new Error(`No result from tool "${t}" is available.`);
17
+ };
18
+ export {
19
+ c as resolveLatestToolArtifact
20
+ };
@@ -0,0 +1,22 @@
1
+ import type { SharedResourceInput, SharedStatePatch } from "../../../orchestrator/types/types.js";
2
+
3
+ /**
4
+ * Artifact returned by an agent tool, including optional shared-context effects.
5
+ *
6
+ * @internal
7
+ */
8
+ export type AgentToolArtifact<TValue, TSharedState extends Record<string, unknown> = Record<string, unknown>> = Readonly<{
9
+ value: TValue;
10
+ sharedStatePatch?: SharedStatePatch<TSharedState>;
11
+ sharedResourceAdditions?: readonly SharedResourceInput[];
12
+ }>;
13
+
14
+ /**
15
+ * Content and artifact returned by an agent tool.
16
+ *
17
+ * @internal
18
+ */
19
+ export type AgentToolResponse<TValue, TSharedState extends Record<string, unknown> = Record<string, unknown>> = [
20
+ content: string,
21
+ artifact: AgentToolArtifact<TValue, TSharedState>
22
+ ];
@@ -0,0 +1,6 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import e from "zod";
3
+ const t = ["feet", "kilometers", "meters", "miles", "nautical-miles", "us-nautical-miles"], i = e.enum(t);
4
+ export {
5
+ i as distanceUnitsSchema
6
+ };
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./WVP73XWD.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([a])=>{return a},a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./EVMIYZWD.js";import"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:p},{c:d,d:u}])=>{var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,n,o)=>{for(var t=o>1?void 0:o?w(r,n):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,n,t):a(t))||t);return o&&t&&f(r,n,t),t},s=class extends u{constructor(e){super(e)}getAgents(){return this.agents}buildNodes(e){let r=super.buildNodes(e);return r[l]=()=>({}),r}buildEdges(e){let r=this.condition;if(!r)throw new Error("ConditionalWorkflow requires a condition.");let n=d(e[0],0),o=d(e[1],1);return[{from:l,decide:async(t,i)=>await Promise.resolve(r(t,i))?n:o}]}getEntryNode(){return l}isTerminalAgent(){return!0}validateAgents(e){if(super.validateAgents(e),e.length!==2)throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`)}};c([g()],s.prototype,"condition",2);c([g()],s.prototype,"agents",2);s=c([p("ConditionalWorkflow")],s);var l="__conditional_decide";return s},"core/accessorSupport/decorators",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as y}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import{a as v}from"./NXKKG5TK.js";import{g as p,h as r,n as o,t as n,u as c,v as g,w as m,z as f}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([b])=>{var w=p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`,l=class extends g{constructor(){super(...arguments),this.#s=n(),this.#a=n(),this.#t=-1,this.#e="",this.#i=t=>{t.stopPropagation();let s=t.detail;this._setDraftValue(s.value),s.focusInput&&this.#s.value&&this.#s.value.setFocus()},this.#r=t=>{let s=t.target.value??"";this.inputValue=s,this.#e=s},this._messages=y({blocking:!0}),this._inFocus=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.inputValue="",this.voiceInputEnabled=!1,this.messages=new b([]),this.disabled=!1,this.arcgisCancel=o(),this.arcgisSubmit=o()}static{this.properties={_inFocus:16,_userMessages:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5}}static{this.styles=w}#s;#a;#t;#e;#i;#r;get _userMessages(){return this.messages.toArray().filter(t=>t.role==="user").map(({content:t})=>t)}async submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.inputValue.trim();t&&(this.arcgisSubmit.emit(t),this.inputValue="",this.#t=-1,this.#e="",this.#a.value?.clearDraftSession(),this.#s.value&&await this.#s.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#i),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#i)}}))}async _navigateHistory(t,s){let i=this.#s.value;if(!i)return;let e=this._userMessages;if(e.length===0)return;let u=i.value??"",h=i.shadowRoot?.querySelector("textarea"),a=h?.selectionStart,d=h?.selectionEnd;if(!(a==null||d==null)&&!(a!==d||t==="up"&&a!==0||t==="down"&&a!==u.length)){if(t==="up"){this.#t===-1?(this.#e=u,this.#t=e.length-1):this.#t=Math.max(0,this.#t-1),this.inputValue=e[this.#t]??"",s.preventDefault();return}this.#t!==-1&&(this.#t<e.length-1?(this.#t+=1,this.inputValue=e[this.#t]??""):(this.#t=-1,this.inputValue=this.#e),s.preventDefault())}}_setDraftValue(t){this.inputValue=t,this.#t=-1,this.#e=t}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}render(){return r`<div class="input-container"><calcite-text-area class=${m(v({focused:this._inFocus}))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async t=>{t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled||(t.key==="Enter"?(t.preventDefault(),await this.submitMessage()):t.key==="ArrowUp"?await this._navigateHistory("up",t):t.key==="ArrowDown"&&await this._navigateHistory("down",t))}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${c(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?r`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${c(this.#a)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`}};f("arcgis-assistant-chat-entry",l);return l},"core/Collection")
2
+ import{b as y}from"./6OOZSZRJ.js";import{a as v}from"./RLEHNAIA.js";import{g as p,h as r,n as o,t as n,u as c,v as g,w as m,z as f}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([b])=>{var w=p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`,l=class extends g{constructor(){super(...arguments),this.#s=n(),this.#a=n(),this.#t=-1,this.#e="",this.#i=t=>{t.stopPropagation();let s=t.detail;this._setDraftValue(s.value),s.focusInput&&this.#s.value&&this.#s.value.setFocus()},this.#r=t=>{let s=t.target.value??"";this.inputValue=s,this.#e=s},this._messages=y({blocking:!0}),this._inFocus=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.inputValue="",this.voiceInputEnabled=!1,this.messages=new b([]),this.disabled=!1,this.arcgisCancel=o(),this.arcgisSubmit=o()}static{this.properties={_inFocus:16,_userMessages:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5}}static{this.styles=w}#s;#a;#t;#e;#i;#r;get _userMessages(){return this.messages.toArray().filter(t=>t.role==="user").map(({content:t})=>t)}async submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.inputValue.trim();t&&(this.arcgisSubmit.emit(t),this.inputValue="",this.#t=-1,this.#e="",this.#a.value?.clearDraftSession(),this.#s.value&&await this.#s.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#i),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#i)}}))}async _navigateHistory(t,s){let i=this.#s.value;if(!i)return;let e=this._userMessages;if(e.length===0)return;let u=i.value??"",h=i.shadowRoot?.querySelector("textarea"),a=h?.selectionStart,d=h?.selectionEnd;if(!(a==null||d==null)&&!(a!==d||t==="up"&&a!==0||t==="down"&&a!==u.length)){if(t==="up"){this.#t===-1?(this.#e=u,this.#t=e.length-1):this.#t=Math.max(0,this.#t-1),this.inputValue=e[this.#t]??"",s.preventDefault();return}this.#t!==-1&&(this.#t<e.length-1?(this.#t+=1,this.inputValue=e[this.#t]??""):(this.#t=-1,this.inputValue=this.#e),s.preventDefault())}}_setDraftValue(t){this.inputValue=t,this.#t=-1,this.#e=t}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}render(){return r`<div class="input-container"><calcite-text-area class=${m(v({focused:this._inFocus}))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async t=>{t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled||(t.key==="Enter"?(t.preventDefault(),await this.submitMessage()):t.key==="ArrowUp"?await this._navigateHistory("up",t):t.key==="ArrowDown"&&await this._navigateHistory("down",t))}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${c(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?r`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${c(this.#a)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`}};f("arcgis-assistant-chat-entry",l);return l},"core/Collection")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a,b as s,c as o}from"./ROQGPAR5.js";import"./RFVZ7KCG.js";import{g as r,h as t,v as i,z as c}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var l=r`.container{color:var(--calcite-color-text-1);min-width:0}.content{min-width:0;overflow-wrap:anywhere}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.part{animation:part-reveal calc(3 * var(--calcite-animation-timing)) ease-out}@keyframes part-reveal{0%{opacity:0;transform:translateY(var(--calcite-size-fixed-xxs))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}`,e=class extends i{static{this.properties={content:1,parts:0}}static{this.styles=l}render(){return t`<div class="container"><div class="content">${this.parts?.map(n=>t`<span class="part">${a(o(n))}</span>`)??a(s(this.content))}</div></div>`}};c("arcgis-assistant-message-text",e);export{e as ArcgisAssistantMessageText};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{b as L,c as M}from"./V6HOUZPZ.js";import{a as B}from"./TWU3QXAS.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import d from"./SHI76XUV.js";import"./P4XZMBU5.js";import b from"./TYATJUNF.js";import{a as V,b as F,e as H}from"./JQYLMTDP.js";import a from"./DG27JEYG.js";import{e as $}from"./FS7GXTTQ.js";import{v as D,z as q}from"./COH3QXWG.js";import"./R74ZHFA6.js";import{c as U}from"./UCTC4JN4.js";import"./V7Y22FRP.js";import"./QRMRID2M.js";import"./AXTQU5YL.js";import{J as W,_ as E,ka as J}from"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import{Dd as c}from"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([Q,ie,{property:a,subclass:h},_,C,,,,,,,G,z])=>{var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,y=(e,t,r,s)=>{for(var o=s>1?void 0:s?ce(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ae(t,r,o),o},p=class extends C{constructor(e){super(e)}static fromJSON(e){return new p({id:e.id,sourceAnchorId:e.source_anchor_id,sourceNodeId:e.source_node_id,targetAnchorId:e.target_anchor_id,targetNodeId:e.target_node_id})}};y([a()],p.prototype,"id",2);y([a()],p.prototype,"sourceAnchorId",2);y([a()],p.prototype,"sourceNodeId",2);y([a()],p.prototype,"targetAnchorId",2);y([a()],p.prototype,"targetNodeId",2);p=y([h("Edge")],p);var pe=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(e,t,r,s)=>{for(var o=s>1?void 0:s?de(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&pe(t,r,o),o},d=class extends C{constructor(e){super(e)}async load(){return await Promise.resolve(this)}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:e.outgoingEdges.map(t=>({from:this.id,to:t.targetNodeId}))}}static fromJSON(e){throw new Error("BaseNode is abstract and cannot be instantiated directly.")}};I([a()],d.prototype,"id",2);I([a()],d.prototype,"label",2);I([a()],d.prototype,"type",2);d=I([h("BaseNode")],d);function X(e){let t=new Set(e.required),r=Object.fromEntries(Object.entries(e.properties).map(([s,o])=>{let n=Y(o);return[s,t.has(s)?n:n.optional()]}));return c.object(r)}function Y(e){let t;switch(e.type){case"array":t=c.array(e.items?Y(e.items):c.unknown());break;case"boolean":t=c.boolean();break;case"number":t=c.number();break;case"object":t=X({properties:e.properties??{},required:e.required});break;case"string":t=e.enum?.length?c.enum(e.enum):c.string();break}return e.description?t.describe(e.description):t}var ue=Object.defineProperty,me=Object.getOwnPropertyDescriptor,j=(e,t,r,s)=>{for(var o=s>1?void 0:s?me(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ue(t,r,o),o},he=e=>e.replace(/_([a-z])/gu,(t,r)=>r.toUpperCase()),l=class extends C{constructor(e){super(e),this.type="arcgis-tool"}async createRuntimeTools(){if(!this.name)throw new Error("ArcgisTool name is required");return[await B(he(this.name))]}static fromJSON(e){return new l({name:e.name,requireApproval:e.require_approval})}};j([a()],l.prototype,"name",2);j([a()],l.prototype,"requireApproval",2);j([a()],l.prototype,"type",2);l=j([h("ArcgisTool")],l);var le=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Z=e=>{throw TypeError(e)},w=(e,t,r,s)=>{for(var o=s>1?void 0:s?ge(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&le(t,r,o),o},fe=(e,t,r)=>t.has(e)||Z("Cannot "+r),ye=(e,t,r)=>t.has(e)?Z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r)=>(fe(e,t,"access private method"),r),k,ee,u=class extends d{constructor(e){super(e),ye(this,k),this.type="agent-node"}createRuntimeNode(){let e;return async(t,r)=>{e??=we(this,k,ee).call(this);let s=await(await e).run(t,r),o=this.outputSchema?.safeParse(s);if(o&&!o.success)throw o.error;let n=o?.data,i=n??s.outputMessage;return{agentExecutionContext:s.agentExecutionContext,...n?{}:{outputMessage:s.outputMessage},status:s.status,summary:s.summary,nodes:{[this.id]:{output:i}}}}}compile(e){let t=e.outgoingEdges[0]?.targetNodeId;return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:r=>r.status==="failed"?void 0:t}],schemas:[c.object({output:this.outputSchema??c.string()})]}}static fromJSON(e){let t=new u({id:e.id,label:e.label,prompt:e.prompt?.content,type:"agent-node",modelTier:e.llm_model?.model_tier});return e.structured_output&&(t.outputSchema=X(e.structured_output)),t.tools=e.tools?.filter(r=>r.type==="arcgis_tool").map(r=>l.fromJSON(r)),t}};k=new WeakSet;ee=async function(){let e=this.prompt;if(!e?.trim())throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);let t=[];if(this.tools)for(let r of this.tools){let s=await r.createRuntimeTools();t.push(...s)}return new z({name:this.id,outputSchema:this.outputSchema,modelTier:this.modelTier,prompt:e,tools:t})};w([a()],u.prototype,"type",2);w([a()],u.prototype,"prompt",2);w([a()],u.prototype,"outputSchema",2);w([a()],u.prototype,"tools",2);w([a()],u.prototype,"modelTier",2);u=w([h("AgentNode")],u);var be=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,T=(e,t,r,s)=>{for(var o=s>1?void 0:s?Ne(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&be(t,r,o),o},g=class extends d{constructor(e){super(e),this.type="end-message-node"}createRuntimeNode(){return async e=>{let t=await E.fromTemplate(this.message,{templateFormat:"mustache"}).format(e);return{outputMessage:t,status:"success",summary:t}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[]}}static fromJSON(e){let t=new g({id:e.id,label:e.label,type:"end-message-node"});return t.message=e.message,t}};T([a()],g.prototype,"type",2);T([a()],g.prototype,"message",2);g=T([h("EndMessageNode")],g);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,te=e=>{throw TypeError(e)},O=(e,t,r,s)=>{for(var o=s>1?void 0:s?Se(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Oe(t,r,o),o},_e=(e,t,r)=>t.has(e)||te("Cannot "+r),ve=(e,t,r)=>t.has(e)?te("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),K=(e,t,r)=>(_e(e,t,"access private method"),r),v,re,oe,m=class extends d{constructor(e){super(e),ve(this,v),this.type="human-in-the-loop-node",this.conditions=[]}createRuntimeNode(){return async(e,t)=>{let r=Ie(t,this.id),s=`${r}:${this.id}`,o=U(t);if(o===void 0||!Ae(o,this.response?.type))throw new W({agentId:r,id:s,kind:je(this.response?.type),message:await K(this,v,re).call(this,e),metadata:K(this,v,oe).call(this,e)});return{nodes:{[this.id]:{output:o}}}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:t=>{if(!this.conditions.length)return e.outgoingEdges[0]?.targetNodeId;let r=t.nodes?.[this.id]?.output,s=this.conditions.find(o=>Ee(o.optionValue,r));if(s)return e.outgoingEdges.find(o=>o.sourceAnchorId===s.sourceAnchorId)?.targetNodeId}}]}}static fromJSON(e){let t=new m({id:e.id,label:e.label,type:"human-in-the-loop-node"});return t.message=e.message,t.response=e.response,t.conditions=(e.conditions??[]).map(({optionValue:r,source_anchor_id:s})=>({optionValue:r,sourceAnchorId:s})),t}};v=new WeakSet;re=async function(e){if(this.message?.source==="generated")throw new Error(`Human-in-the-loop node "${this.id}" does not support generated messages yet.`);let t=this.message?.content;if(!t)throw new Error(`Human-in-the-loop node "${this.id}" requires a message content.`);return await E.fromTemplate(t,{templateFormat:"mustache"}).format(e)};oe=function(e){let t=this.response;if(!t||t.type==="confirmation"||t.type==="textInput")return;let r=t.choices;return r?.source==="fixed"?r.items?.map(s=>s.value??s.label??""):r?.source==="reference"?Je(e,r.reference)?.map(String):void 0};O([a()],m.prototype,"type",2);O([a()],m.prototype,"message",2);O([a()],m.prototype,"response",2);O([a()],m.prototype,"conditions",2);m=O([h("HumanInTheLoopNode")],m);function Ie(e,t){let r=e?.configurable?.agentId;return typeof r=="string"&&r?r:t}function je(e){switch(e){case"singleSelect":return"singleSelection";case"multipleSelect":return"multipleSelection";case"textInput":return"textInput";default:return"booleanChoice"}}function Ae(e,t){switch(t){case"confirmation":return typeof e=="boolean";case"singleSelect":return typeof e=="string"||Array.isArray(e)&&e.length===1&&typeof e[0]=="string";case"multipleSelect":return Array.isArray(e)&&e.every(r=>typeof r=="string");case"textInput":return typeof e=="string";default:return!0}}function Ee(e,t){return Array.isArray(t)?t.some(r=>r===e):t===e}function Je(e,t){if(!t)return;let r=t.split(".").reduce((s,o)=>{if(s&&typeof s=="object"&&o in s)return s[o]},e);return Array.isArray(r)?r:typeof r=="string"?[r]:void 0}var ke=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,se=(e,t,r,s)=>{for(var o=s>1?void 0:s?xe(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ke(t,r,o),o},N=class extends d{constructor(e){super(e),this.type="start-node"}createRuntimeNode(){return e=>({question:e.agentExecutionContext.userRequest})}static fromJSON(e){return new N({id:e.id,label:e.label,type:"start-node"})}};se([a()],N.prototype,"type",2);N=se([h("StartNode")],N);function Pe(e){switch(e.type){case"agent_node":return u.fromJSON(e);case"end_message_node":return g.fromJSON(e);case"human_in_the_loop_node":return m.fromJSON(e);case"start_node":return N.fromJSON(e);default:throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`)}}function Ce(e={}){let t=Object.keys(e);if(V(t),t.includes("nodes"))throw new Error("node state cannot define reserved field: nodes.");let r=F(e);return J.Root({...r,nodes:J({reducer:(s,o)=>({...s,...o}),default:()=>({})}),...$()})}function ne(e,t={}){let r=new Set;for(let o of e)for(let n of Object.keys(o.shape??{}))n!=="nodes"&&r.add(n);let s=Object.fromEntries([...r].map(o=>[o,t[o]]));for(let[o,n]of Object.entries(t))s[o]=n;return Ce(s)}var x=class e{constructor(t,r,s){this.sourceJSON=t,this.edges=r,this.nodes=s,this._loaded=!1}static fromJSON(t){return new e(t,t.graph.edges.map(r=>p.fromJSON(r)),t.graph.nodes.map(r=>Pe(r)))}async load(){return this._loadPromise??=Promise.all(this.nodes.map(async t=>await t.load())).then(()=>{this._loaded=!0}),await this._loadPromise,this}getSchemas(){let t=Object.fromEntries(this._getNodeCompilations().flatMap((r,s)=>{let o=this.nodes[s];return r.schemas?.map(n=>[o.id,n])??[]}));return[c.object({loopCounts:c.record(c.string(),c.number()).optional(),nodes:c.object(t).partial().optional(),question:c.string().optional(),variables:this._getVariablesSchema()})]}generate(){this._assertLoaded(),this._nodeCompilations=void 0;let t=this._getNodeCompilations(),r=Object.fromEntries(this.sourceJSON.variables.map(({key:b,value:A})=>[b,A])),s=ne(this.getSchemas(),{variables:r}),o=this.nodes.find(b=>b.type==="start-node")?.id,n={},i=[];for(let[b,A]of this.nodes.entries()){let S=t[b];S&&(S.runtimeNode&&(n[A.id]=S.runtimeNode),i.push(...S.edges))}return{createGraph:()=>H(n,i,s,{entryNode:o}),workspace:s}}_assertLoaded(){if(!this._loaded)throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.")}_getNodeCompilations(){return this._assertLoaded(),this._nodeCompilations??=this.nodes.map(t=>t.compile({outgoingEdges:this.edges.filter(r=>r.sourceNodeId===t.id)}))}_getVariablesSchema(){return c.object(Object.fromEntries(this.sourceJSON.variables.map(({key:t})=>[t,c.unknown()])))}},Te=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,R=(e,t,r,s)=>{for(var o=s>1?void 0:s?Re(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Te(t,r,o),o},De=()=>{throw new Error("WebAgent must be loaded before it can run.")},f=class extends G{constructor(e){super(e)}async load(){if(this.portalItem){try{await this.portalItem.load()}catch(r){throw new _("web-agent:load-portal-item","Failed to load portal item",{error:r})}let t=await this.portalItem.fetchData();if(this.sourceJSON=t,!this.portalItem.title)throw new _("web-agent:missing-title","The portal item is missing a title")}if(!this.sourceJSON)throw new _("web-agent:missing-source-json","The source JSON is missing");if(!this.sourceJSON.description)throw new _("web-agent:missing-description","The source JSON is missing a description");let e=x.fromJSON(this.sourceJSON);return await e.load(),this._runtime=e,this.description=this.sourceJSON.description,this.name=this.portalItem?.title??`web-agent-${Date.now()}`,this.generate(),this}getSchemas(){return this._runtime?.getSchemas()??[]}generate(){if(!this._runtime){this._set("workspace",ne([])),this._set("createGraph",De);return}let{createGraph:e,workspace:t}=this._runtime.generate();this._set("workspace",t),this._set("createGraph",e)}};R([a({type:Q})],f.prototype,"portalItem",2);R([a()],f.prototype,"sourceJSON",2);f=R([h("WebAgent")],f);var P=class extends D{static{this.properties={agent:0,context:0,itemId:1,workflow:0}}#e;async getContext(){return L(this.context)?await this.context():this.context}async load(){let t;if(this.itemId){let r=ie.getDefault();t=new f({portalItem:new Q({id:this.itemId,portal:r})})}else this.workflow&&(t=new f({sourceJSON:this.workflow}));if(t&&(await t.load(),this.agent=t.registration),!this.agent)throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");this.#e=M(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};q("arcgis-assistant-agent",P);return P},"portal/PortalItem","portal/Portal","core/accessorSupport/decorators","core/Error","core/Accessor","identity/IdentityManager","request","config","core/reactiveUtils","layers/FeatureLayer",a,b,d)
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{c as K,d as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as y,z as f}from"./HWKDNS4K.js";import{a as c,b}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as x,b as d,j as k,ta as _}from"./DHKUXLU3.js";import{Z as v}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{fetchKnowledgeGraph:B},{j:A,l:q},{K:u,L:C,M:G,N:T,O:N,P:R,Q:L,R:$,S:z,T:F,U:D,a:S,m:g,n:h,p:M}])=>{var I=[R,L,F,$,N,D,z];async function O(e,a){let r=await g("arcgis_knowledge_tool_prompt"),o=C(a),s={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},n=await q({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:s,tools:I}),i=(n.tool_calls?.length??0)>0,t=typeof n.text=="string"?n.text.trim():"",l=t.length>0,p=n.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function V(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,a){let r=new S(I,{handleToolErrors:!1});try{let o=await r.invoke({messages:e.arcgisKnowledgeMessages},a),s=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
2
+ import{a as R}from"./XQ3NBBQ3.js";import b from"./QNXI3WOF.js";import a from"./DG27JEYG.js";import{a as c,b as k}from"./V7Y22FRP.js";import{A as f,Ya as x,r as w,s as d}from"./LOQ2PKV5.js";import{ta as u}from"./IYLFJCJ2.js";export default $arcgis.t(([,,,,,,{n:_,p:b},{A:S,B:M,C:T,D:E,E:C,F:G,G:N,b:v,d:m,e:h,w:y,x:A,y:K,z:q}])=>{var z=[M,T,G,E,S,N,C];async function $(e,a){let o=await m("arcgis_knowledge_tool_prompt"),s=A(a),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:s},r=await b({promptText:o,messages:e.arcgisKnowledgeMessages,inputVariables:n,tools:z,config:a}),i=(r.tool_calls?.length??0)>0,t=typeof r.text=="string"?r.text.trim():"",l=t.length>0,p=r.text;return!i&&(s==="map"||s==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:s==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var L={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function I(e){return!!e&&e.status==="success"&&!!L[e.toolName]}function D(e){return{type:L[e.toolName],data:e.details}}async function F(e,a){let o=new v(z,{handleToolErrors:!1});try{let s=await o.invoke({messages:e.arcgisKnowledgeMessages},a),n=[];for(let t of s.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
3
3
 
4
- Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);s.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${o.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let n=s.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=s[0];return i&&V(i)&&await b(J(i),a),{...e,outputMessage:n.join(`
5
- `),summary:n.length?h(n.join(`
6
- `)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...o.messages],arcgisKnowledgeToolResult:s}}catch(o){let s=o instanceof Error?o.message:String(o);return await c({text:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`},a),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`,status:"failed",summary:h(`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var H=(e,a)=>M([],"ArcgisKnowledge Agent")(e,a);async function Q(e,a){let r=(e.arcgisKnowledgeToolResult??[]).map(l=>({...l,details:void 0})),{knowledgeGraph:o}=await G(a),s=T.getDataModelTypesSummary(o.dataModel),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:r,dataModelSummary:s},i=await A({promptText:await g("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:n}),t=typeof i=="string"?i:i.content;return{...e,outputMessage:t,status:"success",summary:h(t),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new v(t)]}}function m(e){return async(a,r)=>r?.configurable?.abortSignal?.aborted?(await c({text:"Knowledge Agent execution cancelled"},r),new k({goto:d,update:{outputMessage:"Knowledge Agent execution cancelled",summary:"Knowledge Agent execution cancelled",status:"failed"}})):await e(a,r)}var X=()=>new _(u).addNode("requireArcgisKnowledgeServices",H).addNode("agent",m(O)).addNode("tools",m(P)).addNode("summarizationLLM",m(Q)).addEdge(x,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":d).addConditionalEdges("tools",e=>e.status==="failed"?d:"summarizationLLM").addEdge("summarizationLLM",d),Y=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
4
+ Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);n.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${s.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let r=n.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=n[0];return i&&I(i)&&await k(D(i),a),{...e,outputMessage:r.join(`
5
+ `),summary:r.length?h(r.join(`
6
+ `)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...s.messages],arcgisKnowledgeToolResult:n}}catch(s){let n=s instanceof Error?s.message:String(s);return await c({text:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`},a),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`,status:"failed",summary:h(`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var V=(e,a)=>R([],"ArcgisKnowledge Agent")(e,a);async function O(e,a){let o=(e.arcgisKnowledgeToolResult??[]).map(l=>({...l,details:void 0})),{knowledgeGraph:s}=await K(a),n=q.getDataModelTypesSummary(s.dataModel),r={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:o,dataModelSummary:n},i=await _({promptText:await m("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:r,config:a}),t=typeof i=="string"?i:i.content;return{...e,outputMessage:t,status:"success",summary:h(t),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new u(t)]}}async function j(e){let a=e.arcgisKnowledgeToolResult?.[0],o=a?.status==="success"?a.summary:"ArcGIS Knowledge Agent tool execution failed.";return{...e,outputMessage:o,status:"success",summary:h(o),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new u(o)]}}function g(e){return async(a,o)=>o?.signal?.aborted?(await c({text:"Knowledge Agent execution cancelled"},o),new f({goto:d,update:{outputMessage:"Knowledge Agent execution cancelled",summary:"Knowledge Agent execution cancelled",status:"failed"}})):await e(a,o)}var J=()=>new x(y).addNode("requireArcgisKnowledgeServices",V).addNode("agent",g($)).addNode("tools",g(F)).addNode("summarizationLLM",g(O)).addNode("finalizeToolSummary",g(j)).addEdge(w,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":d).addConditionalEdges("tools",e=>{if(e.status==="failed")return d;let a=e.arcgisKnowledgeToolResult?.[0];return a?.status==="success"&&["applyLayout","changeNonspatialVisibility"].includes(a.toolName)?"finalizeToolSummary":"summarizationLLM"}).addEdge("summarizationLLM",d).addEdge("finalizeToolSummary",d),P=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
7
7
  This agent has two categories of skills: those that work with an active link chart visualization of a subset of the data in the knowledge graph, and those that work with the knowledge graph data more generally against the entire dataset in the service and database.
8
8
  For link charts, the agent enables users to interact with a link chart by adding new entities (also called nodes) or relationships (also called edges), removing existing entities or relationships,
9
9
  expanding the graph from particular entities, finding relationships between specified entities on the link chart and adding them to the link chart, finding all relationships
@@ -41,4 +41,4 @@ _example: "Discover and add all the relationships originating at 'Entity E' to t
41
41
  _example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
42
42
  _example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
43
43
  _example: "Find John Smith and all people he has made phone calls to in the last year"_
44
- _example: "What is the average age of all people who work for Esri?"_`,j={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:Y,createGraph:X,workspace:u};var w=class extends y{constructor(){super(...arguments),this.agent=j}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#a;#e;get serviceUrl(){return this.#a}set serviceUrl(a){this.#a=a}async getContext(){let a=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...a,view:this.#t};if(this.#e)try{let r=await this.#e;return{...a,knowledgeGraph:r}}catch(r){console.error("Failed to load knowledge graph via service URL:",r)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(a){a.has("serviceUrl")&&this.serviceUrl?this.#e=B(this.serviceUrl):this.#e=void 0}load(){this.#t=E(this)??void 0,K(this)}};f("arcgis-assistant-knowledge-agent",w);return w},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","rest/knowledgeGraphService",a,e)
44
+ _example: "What is the average age of all people who work for Esri?"_`,de={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:P,createGraph:J,workspace:y};return de},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ var n=(r,e,a)=>{if(!(a?r.hasAllFeaturesInView:r.hasAllFeatures))return!1;let l=new Set((r.availableFields??[]).map(t=>t.toLowerCase()));return l.has("*")?!0:e.every(t=>l.has(t.toLowerCase()))};function s(r,e){let a=r??"";return e!=null&&e&&(a=a?`(${a}) AND (${e})`:e),a||null}export{n as a,s as b};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{c as r}from"./NXKKG5TK.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
2
+ import{c as r}from"./RLEHNAIA.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./QNXI3WOF.js";export default $arcgis.t(([{a:e}])=>{var t=[async()=>(await import("./OMF6ITSG.js")).default,async()=>(await import("./ZFOG3KXV.js")).default],r=e({id:"dataExploration",name:"Data Exploration Agent",description:"Explores feature-layer data and applies data-driven map filters using on-demand query and filter skills.",skillLoaders:t,modelTier:"default",systemPrompt:"You are an ArcGIS data exploration agent.",instructions:"A request can require both query and filter skills. Treat show, display, highlight, map, filter, reveal, emphasize, include, or exclude as visual map intent when the request targets matching features. For visual map intent, do not stop after query. First use query to identify/count the matching features, then load the filter skill and call setFeatureEffect with the same layer, where clause, geometry filter, extent setting, or object IDs. Use only tool results to describe data or map changes.",fallbackMessage:"Data exploration request completed.",failureMessage:"I couldn't complete the data exploration request."});return r},a)
@@ -0,0 +1,14 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as A}from"./XQ3NBBQ3.js";import b from"./QNXI3WOF.js";import{a as y}from"./FDOMMK2M.js";import a from"./DG27JEYG.js";import{a as i}from"./V7Y22FRP.js";import{J as f,Ya as S,r as u,s as p}from"./LOQ2PKV5.js";export default $arcgis.t(([,,,,,,{p:x},{b:w,d:E,j:I,k:L,l:v,m:F,n:$,o:C,p:N,q:R,r:T,s:_,t:b,u:h}])=>{var M=async(t,a)=>{let e=t.tool_calls??[];if(e.length===0){await i({text:`LLM did not request any tool calls: ${String(t?.content)}`},a);return}await Promise.all(e.map(async r=>await i({text:`LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args,null,2)}`},a)))},k=.7,P=10,z=async(t,a)=>{try{await i({text:"Similarity search to find fields"},a);let e=y(a,"fieldSearch"),r=y(a,"layersAndFieldsRegistry"),n=y(a,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:k,topResults:P,embeddingCache:n}),m=o.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
3
+ `);return`${r.get(c)?.layerItem.name??c}:
4
+ ${g}`}).join(`
5
+ `),l;return o.length>0?l=`Vector search completed. Matching layers and fields with scores:
6
+ ${m}`:l=`No vector search results found for score over ${k}.`,await i({text:l},a),{...t,vectorSearchFieldResults:o}}catch(e){throw await i({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},a),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},D=.7,G=async(t,a)=>{try{await i({text:`Similarity search to find layers: ${t.agentExecutionContext.assignedTask}`},a);let e=y(a,"layerSearch"),r=y(a,"layersAndFieldsRegistry"),n=await e.searchLayers({text:t.agentExecutionContext.assignedTask,minScore:D}),o=n.map(c=>c.id),m=n.map(({id:c,score:d})=>`${r.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
7
+ `),l;return o.length>0?l=`Vector search completed. Matching layers with scores:
8
+ ${m}`:l="Vector search completed. No matching layers found.",await i({text:l},a),{...t,vectorSearchLayerIds:o}}catch(e){throw await i({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},a),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},j=[I,L,v,F,$,C,N,R,T,_,b],V=(t,a=3)=>{let e=t.map((n,o)=>n.type==="human"?o:-1).filter(n=>n!==-1);if(e.length===0)return[];let r=e.length>a?e[e.length-a]:e[0];return t.slice(r)},H=async(t,a)=>{await i({text:"Requesting LLM for layer query results"},a);let e=await E("navigation_intent_prompt");if(!a?.configurable)throw new Error("config.configurable is required for layer query tools");let r={layerFieldInfo:t.layerFieldInfo},n=await x({promptText:e,modelTier:"advanced",config:a,messages:V(t.agentExecutionContext.messages),inputVariables:r,tools:j});return await M(n,a),{...t,agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,n]}}};async function B(t,a){let e=await new w(j,{handleToolErrors:!1}).invoke({messages:V(t.agentExecutionContext.messages)},a),r=e.messages.map(o=>o.text).join(`
9
+ `);await i({text:`Finished executing layer filter tool: ${r}`},a);let n=e.messages.map(o=>o.text).join(`
10
+ `);return{...t,outputMessage:n}}var J=async(t,a)=>(await i({text:"Exiting Layer Styling agent"},a),t),O=async(t,a)=>{try{await i({text:"Populating layer and field info"},a);let e=[];for(let r of t.vectorSearchFieldResults){let n=function(g){let s=l.get(g)?.layerItem;return s?[s.name&&`Name: ${s.name}`,s.title&&`Title: ${s.title}`,s.description&&`Description: ${s.description}`].filter(Boolean).join(" | "):g},{layerId:o,results:m}=r,l=y(a,"layersAndFieldsRegistry"),c=l.get(o)?.fieldRegistry;if(!c)continue;let d=e.find(g=>g.layerId===o);d||(d={layerId:o,layerSummary:n(o),fieldInfos:[]},e.push(d));for(let g of m){let s=c.get(g.name);s&&d.fieldInfos.push(s)}}return await i({text:"Populated layerFieldInfo"},a),{...t,layerFieldInfo:e}}catch(e){throw await i({text:"Error populating layerFieldInfo"},a),new Error(`Error populating layerFieldInfo: ${e instanceof Error?e.message:String(e)}`)}},U=(t,a)=>{let e=t.vectorSearchLayerIds??[];if(e.length<=1)return{...t,selectedLayerId:t.vectorSearchLayerIds[0]};let{hitlResponse:r}=a.configurable;if(r?.agentId!==q.id||r.id!=="reviewLayerSelection"){let o={agentId:q.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...e]};throw new f(o)}let n=null;return Array.isArray(r.payload)&&r.payload.length>0&&(n=r.payload[0]),{...t,selectedLayerId:n??t.vectorSearchLayerIds[0]}},K=(t,a)=>A(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(t,a),Q=()=>new S(h).addNode("requireLayerStylingServices",K).addNode("vectorSearchLayers",G).addNode("layerSelectionHITL",U).addNode("vectorSearchFields",z).addNode("populateLayerFieldInfo",O).addNode("agent",H).addNode("tools",B).addNode("earlyExit",J).addEdge(u,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",t=>t.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",t=>t.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",p).addEdge("earlyExit",p),W=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
11
+ _Example: “Color points by sales amount”_
12
+ _Example: “Show population density with a color gradient”_
13
+ _Example: “Create a relationship map between height and depth”_
14
+ _Example: “Vary circle sizes according to population”_`,q={id:"layerStyling",name:"Layer Styling Agent",description:W,createGraph:Q,workspace:h};return{a:M,b:q}},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as i,h as s,v as n,z as o}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var c=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=c}_renderSuggestedPrompts(t){if(t.type!=="suggested-prompts")return null;let r=t.data?.prompts,a=Array.isArray(r)?r.filter(p=>typeof p=="string"):[];return a.length?s`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(t){switch(t.type){case"suggested-prompts":return this._renderSuggestedPrompts(t);case"text":return s`<arcgis-assistant-message-text .content=${t.data?.content} .parts=${t.data?.parts}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as C,h as S,n as c,v as R,x as m,z as y}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:u},{property:d,subclass:f},w])=>{var I=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,T=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends w{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=Object.defineProperty,M=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?M(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&O(t,s,r),r},l=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":T.find(e=>window.MediaRecorder.isTypeSupported(e))??""}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("state","error"),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("state","error"),this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!l.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?(this._set("state","error"),this._set("errorCode","not-allowed")):(this._set("state","error"),this._set("errorCode","recording-failed")))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],l.prototype,"_mimeType",1);g([d()],l.prototype,"handleRecording",2);g([d()],l.prototype,"chunkTimeSlice",2);l=g([f("MediaRecorderController")],l);var D=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function k(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=k();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("state","error"),this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("state","error"),this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!k()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=c(),this.arcgisVoiceInputError=c(),this.arcgisVoiceInputInterimTranscription=c(),this.arcgisVoiceInputStart=c(),this.arcgisVoiceInputStop=c(),this.arcgisVoiceInputTranscription=c(),this.arcgisVoiceInputTranscriptionStreamChunk=c()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=I}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new l({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":l.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/accessorSupport/decorators","core/Accessor")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as m}from"./ONQ6JSBJ.js";import{Dc as i}from"./IYLFJCJ2.js";import{a as t}from"./VXFQANGJ.js";async function r(o,e){return await e.goTo({zoom:o}),{text:`Successfully zoomed to: ${o}`}}async function a({zoom:o},e){let{mapView:n}=m(e,["mapView"]);return await r(o,n)}var c=t.object({zoom:t.number().min(1).max(20).describe("The zoom level of the view to go to.")}),p=i(a,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:c});export{p as a};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{g as t,h as e,t as i,u as a,v as n,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([l,{when:o,watch:c}])=>{var h=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}.end-ref{margin-top:var(--calcite-spacing-lg)}`,s=class extends n{constructor(){super(...arguments),this.#t=i(),this.#s=!1,this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=h}#t;#s;firstUpdated(){this.#e()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.#e()}),o(()=>!this.loading,()=>{this.#s=!1}),c(()=>[this.loading,this.interrupt],()=>this.#e())])}#e(){requestAnimationFrame(()=>{this.#s||this.#t.value?.scrollIntoView({behavior:"smooth",block:"end"})})}#i(){this.#s=!0}render(){return e`<div class="messages-container" @wheel=${this.#i}><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div class="end-ref" ${a(this.#t)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{b as A,d as N}from"./RLEHNAIA.js";import{A as $,a as x,b as C,c as f,d as m,e as L,f as P,k as g,m as v,n as O,o as w}from"./COH3QXWG.js";var _=t=>(...s)=>{let e=m(),o=new t(...s),r=o.exports;f(e.at(-1));let n=o.component.manager;n.W(o,r),o.watchExports(n.W.bind(n,o)),L(o);let a=[o.component,...e].reverse();return v(a,i=>i===void 0?void 0:F(o,i,r),r)},F=(t,{host:s,key:e,isReactive:o},r)=>{let n=s,a=n[e]!==t.exports,i=n[e]!==r,l=r!==t.exports;if(a&&!i&&l&&(n[e]=t.exports),s===t.component){if(o){let p=t.component.manager;i&&p.W(t,n[e]),t.onUpdate(u=>{if(u.has(e)){let y=n[e];y!==t.exports&&p.W(t,y)}})}t.O=o?void 0:e}let c=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(c?P(()=>{n[e]=t.exports}):n[e]=t.exports)})};var b=t=>{let s=N(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:V(s)}},D=(t,s,e,o)=>{let r,n=()=>W(t,s(),o).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&e(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),A(t,["lang"],n)},W=async(t,s,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:r}=b(t),n=`${s}/${e}/t9n`,i=e===null?{}:await I(r,n,"messages.");return{lang:o,t9nLocale:r,t9nStrings:i}};var K="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),q=new Set(K),h="en",R={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},I=async(t,s,e="")=>{let o=`${s}/${e}`,r=`${o}${t}.json`;return j[r]??=k(t,o),await j[r]},j={},k=async(t,s)=>{let e=`${s}${t}.json`;try{let o=await fetch(e);if(o.ok)return await o.json()}catch(o){return g("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:o}}),{}}return t===h?{}:await k(h,s)},V=t=>{let[s,e]=t.split("-"),o=s.toLowerCase(),r=o;return e&&(r=`${o}-${e.toUpperCase()}`),r=R[r]??r,q.has(r)?r:e?V(o):h};var z=t=>B(void 0,t);var E=class extends w{constructor(s,e){super(s);let o=this.exports;try{C(this.component);let r=e(this.component,this),n=this.exports!==o;if(x(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},B=_(E);var it=(t,s,e)=>z((o,r)=>{let n=s,a=O({bubbles:!1,composed:!1});return r.onUpdated(i=>{if(!n.some(c=>i.has(c)))return;let l=e(T(t,n,i)),d=e(T(t,n));l.forEach((c,p)=>{d.has(p)||a.emit({...c,data:void 0})}),d.forEach((c,p)=>{let u=l.get(p);(!u||!M(u,c))&&a.emit(c)})}),a});function T(t,s,e){let o={};return s.forEach(r=>{o[r]=e?.has(r)?e.get(r):t[r]}),o}function M(t,s){if(t===s)return!0;if(!t||!s||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return!1;let e=Object.entries(t),o=Object.entries(s);return e.length!==o.length?!1:e.every(([r,n])=>M(n,s[r]))}var S=t=>(s={})=>z((e,o)=>{let r=b(e.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=e;o.onLifecycle(()=>D(e.el,()=>t("./assets"),({t9nLocale:l,t9nStrings:d,lang:c})=>{let p={...d,_lang:c,_t9nLocale:l,_loading:!1};o.exports=p;let u=d.componentLabel;typeof u=="string"&&"label"in e&&e.label==null&&(e.label??=u),i(a.messageOverrides)},s.name));let i=l=>{let d=o.exports,c=d._original??d,p=U(c,l);l&&(p._original=c),o.exports=p};return"messageOverrides"in a&&o.onUpdate(l=>{l.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),U=(t,s)=>{if(!s)return t;let e={...t};return Object.entries(s).forEach(([o,r])=>{t[o]!==void 0&&(typeof r=="object"?e[o]=U(t[o],r):e[o]=r??t[o])}),e};var dt=S($);export{it as a,dt as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a}from"./BFZ5S7NF.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export{a as goToScaleTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as l}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as a,h as e,k as o,t as i,u as n,v as r,z as c}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([{watch:d}])=>{var g=a`.container{display:flex;align-items:center;width:100%;justify-content:space-between;gap:var(--calcite-spacing-xs)}.start,.end{display:flex;align-items:center;gap:var(--calcite-spacing-xs)}`,t=class extends r{constructor(){super(...arguments),this._messages=l({blocking:!0}),this._endRef=i(),this._showLog=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1}static{this.properties={_showLog:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,message:0}}static{this.styles=g}loaded(){this.manager.onLifecycle(()=>[d(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_renderCopyButton(){return!this.message?.error&&this.copyEnabled?e`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{let s=this.message?.content?.trim();s&&await navigator.clipboard.writeText(s)}catch(s){o("warn","assistant-message-footer","Failed to copy text to clipboard",{once:!0,detail:{error:s}})}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this.message?.log?.length&&this.logEnabled?e`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderReadAloudButton(){return e`<arcgis-assistant-message-read-aloud .message=${this.message} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-read-aloud>`}_renderLog(){return e`<arcgis-assistant-message-log .log=${this.message?.log} .showLog=${this._showLog} .logEnabled=${this.logEnabled}></arcgis-assistant-message-log>`}_renderFeedback(){return e`<arcgis-assistant-message-feedback .message=${this.message} .feedbackEnabled=${this.feedbackEnabled}></arcgis-assistant-message-feedback>`}render(){return e`${this._renderLog()}<div class="container"><div class="start">${this._renderCopyButton()}${this._renderLogButton()}${this._renderReadAloudButton()}<slot name=footer-actions-start></slot></div><div class="end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div><div ${n(this._endRef)}></div>`}};c("arcgis-assistant-message-footer",t);return t},"core/reactiveUtils")
2
+ import{b as l}from"./6OOZSZRJ.js";import"./RLEHNAIA.js";import{g as a,h as e,k as o,t as i,u as n,v as r,z as c}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:d}])=>{var g=a`.container{display:flex;align-items:center;width:100%;justify-content:space-between;gap:var(--calcite-spacing-xs)}.start,.end{display:flex;align-items:center;gap:var(--calcite-spacing-xs)}`,t=class extends r{constructor(){super(...arguments),this._messages=l({blocking:!0}),this._endRef=i(),this._showLog=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1}static{this.properties={_showLog:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,message:0}}static{this.styles=g}loaded(){this.manager.onLifecycle(()=>[d(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_renderCopyButton(){return!this.message?.error&&this.copyEnabled?e`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{let s=this.message?.content?.trim();s&&await navigator.clipboard.writeText(s)}catch(s){o("warn","assistant-message-footer","Failed to copy text to clipboard",{once:!0,detail:{error:s}})}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this.message?.log?.length&&this.logEnabled?e`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderReadAloudButton(){return e`<arcgis-assistant-message-read-aloud .message=${this.message} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-read-aloud>`}_renderLog(){return e`<arcgis-assistant-message-log .log=${this.message?.log} .showLog=${this._showLog} .logEnabled=${this.logEnabled}></arcgis-assistant-message-log>`}_renderFeedback(){return e`<arcgis-assistant-message-feedback .message=${this.message} .feedbackEnabled=${this.feedbackEnabled}></arcgis-assistant-message-feedback>`}render(){return e`${this._renderLog()}<div class="container"><div class="start">${this._renderCopyButton()}${this._renderLogButton()}${this._renderReadAloudButton()}<slot name=footer-actions-start></slot></div><div class="end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div><div ${n(this._endRef)}></div>`}};c("arcgis-assistant-message-footer",t);return t},"core/reactiveUtils")