@esri/solutions-components 5.1.0-next.142 → 5.1.0-next.143
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.
- package/dist/cdn/{D4MZYBH7.js → 4JGB6WLL.js} +1 -1
- package/dist/cdn/{7NAC32PQ.js → 4MAZNAHZ.js} +1 -1
- package/dist/cdn/{Z6UCVV4K.js → 4RLG6MXK.js} +1 -1
- package/dist/cdn/56A5UMZG.js +9 -0
- package/dist/cdn/{WCOEPRRK.js → 56XVVIG7.js} +1 -1
- package/dist/cdn/{W5FWW67G.js → 5LIR6BQY.js} +1 -1
- package/dist/cdn/{UVOAWVML.js → 5MPYPIR2.js} +1 -1
- package/dist/cdn/{HO4GBQJG.js → 6Z3DXRF6.js} +1 -1
- package/dist/cdn/{HT2HC33W.js → 7FJTZ7VA.js} +1 -1
- package/dist/cdn/{GPL6FNKN.js → 7GXMCAWQ.js} +1 -1
- package/dist/cdn/{E5EU4SVV.js → 7WD3GNG4.js} +1 -1
- package/dist/cdn/{3UJAJDSF.js → AGB374BK.js} +1 -1
- package/dist/cdn/{2KSXH2TC.js → AHB7W7RI.js} +1 -1
- package/dist/cdn/{6ID6N5BF.js → BGLTC5SO.js} +1 -1
- package/dist/cdn/{SSH4MSHE.js → BVSSQNES.js} +1 -1
- package/dist/cdn/{CEWRVOKP.js → C4OXBZJK.js} +1 -1
- package/dist/cdn/{SXVCHOTK.js → DFZZNKPK.js} +3 -6
- package/dist/cdn/{B33EUN4X.js → DKEYOEI7.js} +1 -1
- package/dist/cdn/{5UIJ4Z3C.js → DNPN62O5.js} +1 -1
- package/dist/cdn/{LLPT3R4B.js → E5E6J57F.js} +22 -22
- package/dist/cdn/{KEOBSFBN.js → EPOIEXNS.js} +1 -1
- package/dist/cdn/{JMCZPJDW.js → FVOCVCEE.js} +1 -1
- package/dist/cdn/{FV4F6RW3.js → FYT4Q5GJ.js} +1 -1
- package/dist/cdn/H2UL463J.js +2 -0
- package/dist/cdn/{FMTXVLZB.js → I22C4HE4.js} +1 -1
- package/dist/cdn/{SRT2KXZG.js → IEOFEUZI.js} +1 -1
- package/dist/cdn/ILLTWR2W.js +2 -0
- package/dist/cdn/{P2TNN5UL.js → J3HJC4SO.js} +1 -1
- package/dist/cdn/K4TDKKPB.js +18 -0
- package/dist/cdn/{23LRX7AS.js → KSQHSNTW.js} +1 -1
- package/dist/cdn/{CB7QDBRG.js → KUGXNF5Y.js} +1 -1
- package/dist/cdn/{52QHFDTC.js → LEK4P4OY.js} +1 -1
- package/dist/cdn/LKZFKOG4.js +2 -0
- package/dist/cdn/{RYEEEMFO.js → LYAXTCCM.js} +1 -1
- package/dist/cdn/{TFTW5B3R.js → MC5ARLKZ.js} +1 -1
- package/dist/cdn/{DNZ5U52C.js → MT5J66WR.js} +1 -1
- package/dist/cdn/{IFI66PVI.js → MVF7I3RU.js} +1 -1
- package/dist/cdn/{F3NG6RFP.js → NIHPHDXG.js} +31 -18
- package/dist/cdn/{UFPB7JD3.js → P67K4TAX.js} +1 -1
- package/dist/cdn/{ZIX74MNU.js → PPRV6EZZ.js} +1 -1
- package/dist/cdn/{PZW6JMSM.js → PUCDO65D.js} +1 -1
- package/dist/cdn/Q5TICZRX.js +15 -0
- package/dist/cdn/{GSD6O5J7.js → QHDEVLC3.js} +1 -1
- package/dist/cdn/{HNWINTTY.js → QQEYWBVV.js} +1 -1
- package/dist/cdn/{CUJ3M6UT.js → RRD4QUQS.js} +1 -1
- package/dist/cdn/{GWWU6HWB.js → RSCBZIAN.js} +17 -19
- package/dist/cdn/RUF6QBY7.js +2 -0
- package/dist/cdn/{UY5JVVRO.js → S5AQVTR2.js} +1 -1
- package/dist/cdn/{H7J2FXMS.js → SGQBWAPU.js} +1 -1
- package/dist/cdn/{MEDCFXMB.js → SOLCNPHW.js} +1 -1
- package/dist/cdn/{BQE2XAKC.js → SSIUWTQX.js} +1 -1
- package/dist/cdn/{34JROLRM.js → SYZEWVHU.js} +1 -1
- package/dist/cdn/{KGSB4I6Y.js → TWJSFINX.js} +1 -1
- package/dist/cdn/{VEDAG7UO.js → TX3LBQ6V.js} +1 -1
- package/dist/cdn/{ATHNXWV4.js → U3CNAJQZ.js} +115 -115
- package/dist/cdn/{TIRNZIMX.js → U4RHWD57.js} +1 -1
- package/dist/cdn/{UM3P3Q52.js → U6JZYJ4D.js} +1 -1
- package/dist/cdn/{PQNFWMST.js → ULFPP7PF.js} +1 -1
- package/dist/cdn/{N5D5ABJ6.js → UOGZGAJD.js} +1 -1
- package/dist/cdn/{NWCKV677.js → VBJSVR6T.js} +1 -1
- package/dist/cdn/WGS5W6W5.js +2 -0
- package/dist/cdn/{RPEQD2MH.js → WLM4HMMF.js} +1 -1
- package/dist/cdn/{MOH6GREK.js → X6JL6SAH.js} +1 -1
- package/dist/cdn/{DGNAMFJN.js → XBFG3KX6.js} +6 -2
- package/dist/cdn/{TIF36KTA.js → XXGM7HGO.js} +1 -1
- package/dist/cdn/{BLCW2CZO.js → Y77RX7KL.js} +1 -1
- package/dist/cdn/{ICSHJV2N.js → ZCSF2MJ5.js} +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/Auth.js +1 -1
- package/dist/chunks/CardsFetcher.js +2 -2
- package/dist/chunks/assistantResponse.js +17 -19
- package/dist/chunks/cardsHelpers.js +12 -12
- package/dist/chunks/classifyIntent.js +31 -18
- package/dist/chunks/description.js +7 -3
- package/dist/chunks/designSolution.js +1 -1
- package/dist/chunks/downloadUtils.js +5 -5
- package/dist/chunks/getRelatedInfos.js +1 -1
- package/dist/chunks/helpers.js +75 -55
- package/dist/chunks/initialAssessment.js +3 -6
- package/dist/chunks/interfaces.js +45 -41
- package/dist/chunks/mapViewUtils.js +9 -9
- package/dist/chunks/popupUtils.js +1 -1
- package/dist/chunks/queryUtils.js +3 -3
- package/dist/chunks/responseOptionsBuilderExclusion.js +12 -0
- package/dist/chunks/responseOptionsDefault.js +18 -0
- package/dist/chunks/solution-builder-assistant.js +7 -6
- package/dist/chunks/solution-deploy-dialog.js +157 -153
- package/dist/chunks/solutions-deploy-app-nav.js +3 -4
- package/dist/chunks/templates.js +6 -6
- package/dist/chunks/updateDesign.js +1 -1
- package/dist/chunks/validators.js +6 -6
- package/dist/components/arcgis-solutions-assistant/customElement.d.ts +8 -0
- package/dist/components/arcgis-solutions-assistant/customElement.js +355 -292
- package/dist/components/arcgis-solutions-assistant/index.js +1 -0
- package/dist/components/card-manager/customElement.js +6 -6
- package/dist/components/create-feature/customElement.js +1 -1
- package/dist/components/crowdsource-manager/customElement.js +1 -1
- package/dist/components/crowdsource-reporter/customElement.js +2 -2
- package/dist/components/edit-card/customElement.js +1 -1
- package/dist/components/feature-details/customElement.js +1 -1
- package/dist/components/feature-list/customElement.js +1 -1
- package/dist/components/layer-list/customElement.js +1 -1
- package/dist/components/layer-table/customElement.js +2 -2
- package/dist/components/map-card/customElement.js +2 -2
- package/dist/components/map-layer-picker/customElement.js +1 -1
- package/dist/components/map-select-tools/customElement.js +2 -2
- package/dist/components/pdf-download/customElement.js +1 -1
- package/dist/components/public-notification/customElement.js +2 -2
- package/dist/components/refine-selection/customElement.js +2 -2
- package/dist/components/selection-tool/customElement.js +1 -1
- package/dist/components/solution-builder-assistant/customElement.d.ts +6 -2
- package/dist/components/solution-configure-titles/customElement.js +6 -6
- package/dist/components/solution-delete-dialog/customElement.js +2 -2
- package/dist/components/solution-deployed-card/customElement.js +2 -2
- package/dist/components/solution-deployed-card-panel/customElement.js +3 -3
- package/dist/components/solution-details-card/customElement.js +2 -2
- package/dist/components/solution-details-panel/customElement.js +2 -2
- package/dist/components/solution-resource-card/customElement.js +1 -1
- package/dist/components/solution-snapshot-gallery/customElement.js +2 -2
- package/dist/components/solution-social-share/customElement.js +1 -1
- package/dist/components/solution-user-avatar/customElement.js +1 -1
- package/dist/components/solutions-all-panel/customElement.js +1 -1
- package/dist/components/solutions-deploy-app/customElement.js +160 -32
- package/dist/components/solutions-deploy-app/index.js +1 -1
- package/dist/components/solutions-deployed-list/customElement.js +1 -1
- package/dist/components/solutions-deployed-panel/customElement.js +1 -1
- package/dist/components/solutions-deployed-shell/customElement.js +1 -1
- package/dist/components/solutions-filter-panel/customElement.js +1 -1
- package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/utils/interfaces.d.ts +1 -6
- package/package.json +1 -1
- package/dist/cdn/4WJ2UJWQ.js +0 -2
- package/dist/cdn/EXC566PM.js +0 -2
- package/dist/cdn/PUQBEN7F.js +0 -18
- package/dist/cdn/SFFLZSAY.js +0 -2
- package/dist/cdn/XC3IZAIH.js +0 -2
- package/dist/cdn/YM3CRTWP.js +0 -2
|
@@ -5,23 +5,23 @@ import { LitElement as ke, createEvent as X, nothing as ee } from "@arcgis/lumin
|
|
|
5
5
|
import { css as Te, html as T } from "lit";
|
|
6
6
|
import { unsafeHTML as Ee } from "lit/directives/unsafe-html.js";
|
|
7
7
|
import { useContextConsumer as te } from "@arcgis/lumina/context";
|
|
8
|
-
import { c as Ae, b as
|
|
9
|
-
import { T as
|
|
10
|
-
import {
|
|
8
|
+
import { c as Ae, b as De } from "../../chunks/deployAppContexts.js";
|
|
9
|
+
import { T as Le } from "../../chunks/interfaces.js";
|
|
10
|
+
import { l as Re } from "../../chunks/helpers.js";
|
|
11
11
|
import se from "@arcgis/core/config.js";
|
|
12
|
-
import { createRef as $e, ref as
|
|
13
|
-
import {
|
|
14
|
-
import { createAgentRuntimeState as
|
|
15
|
-
import r, { z as
|
|
16
|
-
import * as
|
|
17
|
-
import { applyPatch as
|
|
12
|
+
import { createRef as $e, ref as Me } from "lit-html/directives/ref.js";
|
|
13
|
+
import { Annotation as b, StateGraph as z, START as j, END as v, NodeInterrupt as ie } from "@langchain/langgraph/web";
|
|
14
|
+
import { createAgentRuntimeState as J, sendTraceMessage as w, invokeStructuredPrompt as D, getEmbeddings as Pe, cosineSimilarity as Fe, invokeTextPrompt as Be } from "@arcgis/ai-orchestrator";
|
|
15
|
+
import r, { z as E } from "zod";
|
|
16
|
+
import * as G from "@esri/arcgis-rest-portal";
|
|
17
|
+
import { applyPatch as Ne } from "fast-json-patch";
|
|
18
18
|
import "@langchain/core/messages";
|
|
19
19
|
import { C as oe } from "../../chunks/converter.js";
|
|
20
|
-
import { g as
|
|
20
|
+
import { g as F, t as ae, r as re, c as qe, d as A } from "../../chunks/templates.js";
|
|
21
21
|
import Ue from "@arcgis/core/portal/Portal.js";
|
|
22
|
-
import
|
|
23
|
-
const
|
|
24
|
-
async function
|
|
22
|
+
import Oe from "@arcgis/core/portal/PortalItem.js";
|
|
23
|
+
const ze = Te`:host{display:block;height:100%}.margin-lg{margin:var(--calcite-spacing-lg)}.display-flex-row{display:flex;flex-direction:row}.assistant-split-container{display:flex;width:100%;height:calc(100vh - 78px);overflow:hidden;border-radius:10px}.assistant-panel{display:flex;flex-direction:column;height:100%;border:1px solid var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-2);overflow:hidden}.chat-panel{min-width:320px}.builder-panel{min-width:320px;max-width:100%;border-left:1px solid var(--calcite-color-surface-3)}.panel-actions{display:flex;gap:8px;padding:6px;align-items:center}.builder-header,.builder-footer{padding:10px;background:var(--calcite-color-surface-1);border-bottom:1px solid var(--calcite-color-surface-3)}.builder-content{flex:1;overflow:auto;padding:12px}.builder-content pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;overflow:auto}.builder-actions{display:flex;gap:6px;align-items:center}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-surface-4);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-surface-1);border-radius:10px;padding:10px}.chat-panel{--calcite-color-focus: var(--calcite-color-brand);--calcite-panel-border-color: var(--calcite-color-border-2);--calcite-internal-panel-header-vertical-padding: 0px;--calcite-panel-header-content-space: 0px;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);height:100%}.header-content{display:flex;align-items:center;gap:var(--calcite-spacing-sm);height:65px;box-sizing:border-box;padding-inline-start:var(--calcite-space-2xl)}.header-title{font-size:var(--calcite-font-size-md);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.beta-chip{--calcite-chip-corner-radius: var(--calcite-corner-radius-half)}.chat-panel calcite-card,.chat-panel calcite-text-area,.chat-panel calcite-button,.chat-panel .chat-messages,.chat-panel .chat-input{--calcite-color-focus: var(--calcite-color-brand)}.assistant-followup-chip:focus{outline:2px solid var(--calcite-color-brand)}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-surface-1, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-surface-3);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-surface-4);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-surface-4)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.solution-card:focus{outline:2px solid var(--calcite-color-brand)}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-surface-1)}#closeAssistantButton{--calcite-action-text-color: var(--calcite-color-text-1)}.icon-color-background:focus{--calcite-color-focus: var(--calcite-color-surface-1)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;
|
|
24
|
+
async function y(t, e) {
|
|
25
25
|
const s = Object.entries(t).find(
|
|
26
26
|
([n]) => n.endsWith(`/${e}.md`)
|
|
27
27
|
);
|
|
@@ -77,16 +77,16 @@ function Je(t) {
|
|
|
77
77
|
}
|
|
78
78
|
function Ge(t, e) {
|
|
79
79
|
const s = [];
|
|
80
|
-
return (e?.configurable?.context?.configContext.allCards ?? []).forEach((
|
|
81
|
-
const
|
|
82
|
-
if (t.toLowerCase().includes(
|
|
83
|
-
const a = `<a href="" target="solutionId:${
|
|
80
|
+
return (e?.configurable?.context?.configContext.allCards ?? []).forEach((i) => {
|
|
81
|
+
const o = i.title;
|
|
82
|
+
if (t.toLowerCase().includes(o.toLowerCase())) {
|
|
83
|
+
const a = `<a href="" target="solutionId:${i.deployCommonId}">${o}</a>`, l = new RegExp(o, "gi");
|
|
84
84
|
t = t.replace(l, a), s.push({
|
|
85
85
|
solution: {
|
|
86
|
-
title:
|
|
87
|
-
id:
|
|
88
|
-
snippet:
|
|
89
|
-
description:
|
|
86
|
+
title: i.title,
|
|
87
|
+
id: i.deployCommonId,
|
|
88
|
+
snippet: i.snippet,
|
|
89
|
+
description: i.description
|
|
90
90
|
},
|
|
91
91
|
score: 100
|
|
92
92
|
});
|
|
@@ -99,7 +99,7 @@ function He(t) {
|
|
|
99
99
|
function de(t) {
|
|
100
100
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
102
|
+
async function O(t, e, s) {
|
|
103
103
|
const n = await fetch(e, {
|
|
104
104
|
method: "POST",
|
|
105
105
|
headers: {
|
|
@@ -112,47 +112,50 @@ async function U(t, e, s) {
|
|
|
112
112
|
throw new Error(`HTTP ${n.status} calling ${e}`);
|
|
113
113
|
return n.json();
|
|
114
114
|
}
|
|
115
|
-
const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe =
|
|
115
|
+
const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
116
116
|
// Provides agentExecutionContext, outputMessage, summary, and status
|
|
117
117
|
// channels with the orchestrator's standard reducers/defaults so the
|
|
118
118
|
// sub-agent reports back through the same shape the orchestrator
|
|
119
119
|
// persists into priorSteps.
|
|
120
|
-
...
|
|
121
|
-
solutionResponse:
|
|
120
|
+
...J(),
|
|
121
|
+
solutionResponse: b({
|
|
122
122
|
reducer: (t, e) => e ?? null,
|
|
123
123
|
default: () => null
|
|
124
124
|
}),
|
|
125
|
-
documentSkillUrl:
|
|
125
|
+
documentSkillUrl: b({
|
|
126
126
|
reducer: (t, e) => e ?? null,
|
|
127
127
|
default: () => null
|
|
128
128
|
}),
|
|
129
129
|
// Persisted across turns via the graph checkpointer so follow-up questions
|
|
130
130
|
// continue the same service conversation. Null on the very first interaction
|
|
131
131
|
// or after messages are cleared.
|
|
132
|
-
conversationId:
|
|
132
|
+
conversationId: b({
|
|
133
133
|
reducer: (t, e) => e ?? t,
|
|
134
134
|
default: () => null
|
|
135
135
|
})
|
|
136
|
-
}),
|
|
136
|
+
}), We = () => new z(Qe).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Ke).addEdge(j, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", v), ue = async (t, e, s, n) => {
|
|
137
137
|
if (!t) return;
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
140
|
-
const
|
|
138
|
+
const i = de(t);
|
|
139
|
+
if (!i) return;
|
|
140
|
+
const a = { context: {
|
|
141
141
|
kind: "DocAIAssistantRequest",
|
|
142
142
|
filters: {
|
|
143
143
|
products: "ArcGIS Solutions",
|
|
144
|
-
persona: { persona: "apps-solutions" }
|
|
144
|
+
persona: { persona: "apps-solutions" },
|
|
145
|
+
pipeline: {
|
|
146
|
+
translation: { allow: !0, language: s, use_llm: !1 }
|
|
147
|
+
}
|
|
145
148
|
}
|
|
146
149
|
} };
|
|
147
|
-
|
|
148
|
-
},
|
|
150
|
+
n && (a.conversationId = n), O(a, i, e ?? "");
|
|
151
|
+
}, Ke = async (t, e) => {
|
|
149
152
|
const s = N(e), n = t.documentSkillUrl;
|
|
150
|
-
let
|
|
151
|
-
await
|
|
153
|
+
let i = [];
|
|
154
|
+
await w(
|
|
152
155
|
{ text: s.agentProgress.explorerAgentSearching },
|
|
153
156
|
e
|
|
154
157
|
);
|
|
155
|
-
let
|
|
158
|
+
let o = await O(
|
|
156
159
|
{
|
|
157
160
|
message: t.agentExecutionContext.userRequest,
|
|
158
161
|
conversationId: e?.configurable?.context?.convoId ?? void 0,
|
|
@@ -160,41 +163,44 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
160
163
|
kind: "DocAIAssistantRequest",
|
|
161
164
|
filters: {
|
|
162
165
|
products: "ArcGIS Solutions",
|
|
163
|
-
persona: { persona: "apps-solutions" }
|
|
166
|
+
persona: { persona: "apps-solutions" },
|
|
167
|
+
pipeline: {
|
|
168
|
+
translation: { allow: !0, language: e?.configurable?.context?.configContext.locale ?? "en", use_llm: !1 }
|
|
169
|
+
}
|
|
164
170
|
}
|
|
165
171
|
}
|
|
166
172
|
},
|
|
167
173
|
n,
|
|
168
174
|
e?.configurable?.context?.token ?? ""
|
|
169
175
|
);
|
|
170
|
-
|
|
176
|
+
o.conversationId && e?.configurable?.context?.setConversationId && e.configurable.context.setConversationId(o.conversationId);
|
|
171
177
|
let a = {
|
|
172
|
-
message:
|
|
173
|
-
conversationId:
|
|
174
|
-
hasMore:
|
|
175
|
-
ackSequenceNumber:
|
|
176
|
-
inquiryId:
|
|
178
|
+
message: o.message,
|
|
179
|
+
conversationId: o.conversationId,
|
|
180
|
+
hasMore: o.hasMore,
|
|
181
|
+
ackSequenceNumber: o.sequenceNumber,
|
|
182
|
+
inquiryId: o.inquiryId
|
|
177
183
|
}, l = "", d = null;
|
|
178
184
|
const u = async (m) => {
|
|
179
185
|
const c = m.context?.results?.[0]?.reply ?? "";
|
|
180
186
|
if (c !== "") {
|
|
181
|
-
const
|
|
182
|
-
l =
|
|
183
|
-
...
|
|
184
|
-
...
|
|
185
|
-
(k) => !
|
|
187
|
+
const x = Je(c), S = Ge(x, e);
|
|
188
|
+
l = S.source, i = [
|
|
189
|
+
...i,
|
|
190
|
+
...S.allMatches.filter(
|
|
191
|
+
(k) => !i.some((q) => q.solution.id === k.solution.id)
|
|
186
192
|
)
|
|
187
193
|
];
|
|
188
194
|
}
|
|
189
195
|
c !== "" && m.context?.results?.[0]?.followupQuestions && (d = m.context.results[0].followupQuestions);
|
|
190
196
|
const g = m.context?.results?.[0]?.status?.currentStatusStep;
|
|
191
197
|
if (g) {
|
|
192
|
-
let
|
|
193
|
-
g === 1 ?
|
|
198
|
+
let x = "";
|
|
199
|
+
g === 1 ? x = s.agentProgress.explorerAgentReading : g === 2 ? x = s.agentProgress.explorerAgentReviewing : g === 3 && (x = s.agentProgress.explorerAgentPreparing), await w({ text: x }, e);
|
|
194
200
|
}
|
|
195
201
|
};
|
|
196
|
-
for (await u(
|
|
197
|
-
await Ve(500),
|
|
202
|
+
for (await u(o); a.hasMore; )
|
|
203
|
+
await Ve(500), o = await O(
|
|
198
204
|
{
|
|
199
205
|
conversationId: a.conversationId,
|
|
200
206
|
ackSequenceNumber: a.ackSequenceNumber,
|
|
@@ -203,17 +209,22 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
203
209
|
n,
|
|
204
210
|
e?.configurable?.context?.token ?? ""
|
|
205
211
|
), a = {
|
|
206
|
-
message:
|
|
207
|
-
conversationId:
|
|
208
|
-
hasMore:
|
|
209
|
-
ackSequenceNumber:
|
|
210
|
-
inquiryId:
|
|
211
|
-
}, await u(
|
|
212
|
+
message: o.message,
|
|
213
|
+
conversationId: o.conversationId,
|
|
214
|
+
hasMore: o.hasMore,
|
|
215
|
+
ackSequenceNumber: o.sequenceNumber,
|
|
216
|
+
inquiryId: o.inquiryId
|
|
217
|
+
}, await u(o);
|
|
212
218
|
if (d && e?.configurable?.context?.updateSuggestedPrompts) {
|
|
213
219
|
const m = e.configurable.context.updateSuggestedPrompts, c = d;
|
|
214
220
|
setTimeout(() => m(c), 0);
|
|
215
221
|
}
|
|
216
|
-
return de(e?.configurable?.context.portal) && ue(
|
|
222
|
+
return de(e?.configurable?.context.portal) && ue(
|
|
223
|
+
e?.configurable?.context.portal,
|
|
224
|
+
e?.configurable?.context.token ?? "",
|
|
225
|
+
e?.configurable?.context.configContext.locale ?? "en",
|
|
226
|
+
a.conversationId
|
|
227
|
+
), i.length && (i.length === 1 ? ce(i[0].solution.id) : le(i)), {
|
|
217
228
|
outputMessage: l,
|
|
218
229
|
summary: l,
|
|
219
230
|
status: "success",
|
|
@@ -226,7 +237,7 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
226
237
|
documentSkillUrl: s
|
|
227
238
|
};
|
|
228
239
|
};
|
|
229
|
-
await
|
|
240
|
+
await y(je, "solutions_explorer_description");
|
|
230
241
|
const pe = (t) => {
|
|
231
242
|
if (t && Array.isArray(t.id) && t.id.length > 0)
|
|
232
243
|
return t.id[t.id.length - 1].replace("Message", "").toLowerCase();
|
|
@@ -253,7 +264,7 @@ const pe = (t) => {
|
|
|
253
264
|
return t.id && (s.id = t.id), t.name && (s.name = t.name), t.additional_kwargs && (s.additional_kwargs = t.additional_kwargs), t.response_metadata && (s.response_metadata = t.response_metadata), s;
|
|
254
265
|
}
|
|
255
266
|
return { role: "human", content: String(t) };
|
|
256
|
-
}, Xe = (t) => pe(t) === "human", et = (t, e = 3) => t.filter((s) => Xe(s)).slice(-e).map(Ze), tt = (t, e = " ") => et(t).map((
|
|
267
|
+
}, Xe = (t) => pe(t) === "human", et = (t, e = 3) => t.filter((s) => Xe(s)).slice(-e).map(Ze), tt = (t, e = " ") => et(t).map((i) => i.content).join(e).trim(), st = { understandingRequest: "Understanding your request...", selectTemplatePrompt: "This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.", searchingExistingSolutions: "Searching for existing solutions...", existingSolutionMatch: "I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?", continueBuildingYes: "Yes, I want to build a new solution", continueBuildingNo: "No, I’ll review existing solutions", continueBuildingDeclined: "Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.", creatingDesign: "Generating solution design...", updatingDesign: "Updating solution design...", applyChangeFailed: "I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.", createDesignFailed: "I wasn't able to create a solution design from that request. Please try rephrasing and try again.", discardMessage: "Are you sure you want to discard your solution?", discardForNewSolution: "I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?" }, nt = {
|
|
257
268
|
builderMessages: st
|
|
258
269
|
}, it = /* @__PURE__ */ new Set([
|
|
259
270
|
"add",
|
|
@@ -345,14 +356,14 @@ class me {
|
|
|
345
356
|
return;
|
|
346
357
|
}
|
|
347
358
|
if (!e.addLayers) {
|
|
348
|
-
const n = new Set(e.layers.map((
|
|
349
|
-
if (!(n.size ===
|
|
359
|
+
const n = new Set(e.layers.map((o) => o.id)), i = new Set(s.layers.map((o) => o.id));
|
|
360
|
+
if (!(n.size === i.size && [...n].every((o) => i.has(o))))
|
|
350
361
|
this.logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);
|
|
351
362
|
else
|
|
352
|
-
for (const
|
|
353
|
-
if (
|
|
354
|
-
const a = s.layers.find((l) => l.id ===
|
|
355
|
-
a && a.type !==
|
|
363
|
+
for (const o of e.layers)
|
|
364
|
+
if (o.type) {
|
|
365
|
+
const a = s.layers.find((l) => l.id === o.id);
|
|
366
|
+
a && a.type !== o.type && this.logIssue(`Layer '${o.id}' type '${a.type}' does not match template type '${o.type}'. This layer type is immutable.`);
|
|
356
367
|
}
|
|
357
368
|
}
|
|
358
369
|
}
|
|
@@ -363,14 +374,14 @@ class me {
|
|
|
363
374
|
s.length !== new Set(s).size && this.logIssue("Layer names must be unique (case-insensitive).");
|
|
364
375
|
for (const n of this.response.featureLayer.layers) {
|
|
365
376
|
this.validateLayer(n);
|
|
366
|
-
const
|
|
367
|
-
|
|
377
|
+
const i = e.find((o) => o.id === n.id);
|
|
378
|
+
i && this.validateRequiredFields(n, i);
|
|
368
379
|
}
|
|
369
380
|
}
|
|
370
381
|
validateRequiredFields(e, s) {
|
|
371
|
-
const n = new Set(e.requiredFields.map((
|
|
372
|
-
for (const
|
|
373
|
-
n.has(
|
|
382
|
+
const n = new Set(e.requiredFields.map((i) => i.name));
|
|
383
|
+
for (const i of s.requiredFields)
|
|
384
|
+
n.has(i.name) || this.logIssue(`Layer '${e.name}' is missing required field '${i.name}'.`);
|
|
374
385
|
}
|
|
375
386
|
validateLayer(e) {
|
|
376
387
|
const s = /* @__PURE__ */ new Set([
|
|
@@ -382,19 +393,19 @@ class me {
|
|
|
382
393
|
"last_edited_user"
|
|
383
394
|
]), n = e.systemFields ?? [];
|
|
384
395
|
if (n.length) {
|
|
385
|
-
const
|
|
386
|
-
(
|
|
387
|
-
`Layer '${e.name}' has invalid system fields: ${JSON.stringify([...
|
|
396
|
+
const o = new Set(n.map((l) => l.name));
|
|
397
|
+
(o.size !== s.size || [...s].some((l) => !o.has(l))) && this.logIssue(
|
|
398
|
+
`Layer '${e.name}' has invalid system fields: ${JSON.stringify([...o])}.`
|
|
388
399
|
);
|
|
389
400
|
}
|
|
390
|
-
const
|
|
401
|
+
const i = [
|
|
391
402
|
...e.customFields,
|
|
392
403
|
...e.requiredFields,
|
|
393
404
|
...n
|
|
394
|
-
].map((
|
|
395
|
-
|
|
396
|
-
for (const
|
|
397
|
-
this.validateField(
|
|
405
|
+
].map((o) => o.name);
|
|
406
|
+
i.length !== new Set(i).size && this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(i)}.`);
|
|
407
|
+
for (const o of [...e.customFields, ...e.requiredFields, ...n])
|
|
408
|
+
this.validateField(o);
|
|
398
409
|
}
|
|
399
410
|
validateField(e) {
|
|
400
411
|
if (e.alias || this.logIssue(`Field '${e.name}' has no display name (alias).`), /^[A-Za-z]/u.test(e.name) || this.logIssue(`Field '${e.name}' does not start with a letter.`), /^[A-Za-z][A-Za-z0-9_]*$/u.test(e.name) || this.logIssue(`Field '${e.name}' contains invalid characters (only letters, numbers, and underscores allowed).`), e.name.length > 31 && this.logIssue(`Field '${e.name}' exceeds 31 characters.`), it.has(e.name.toLowerCase()) && this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`), e.choiceList && (e.choiceList.some((s) => !s) && this.logIssue(`Field '${e.name}' has empty domain values.`), e.choiceList.length !== new Set(e.choiceList).size && this.logIssue(`Field '${e.name}' has duplicate domain values.`), e.length != null)) {
|
|
@@ -454,7 +465,7 @@ const ot = r.object({
|
|
|
454
465
|
itemId: r.string().describe("ArcGIS item id for the feature layer."),
|
|
455
466
|
addLayers: r.boolean().describe("Indicates whether new layers can be added during solution design."),
|
|
456
467
|
layers: r.array(rt)
|
|
457
|
-
}),
|
|
468
|
+
}), H = r.object({
|
|
458
469
|
response: r.string().describe("Conversational response to the user's query."),
|
|
459
470
|
solution: r.object({
|
|
460
471
|
itemId: r.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),
|
|
@@ -483,29 +494,22 @@ const ot = r.object({
|
|
|
483
494
|
assistantResponse: r.string().describe("Natural-language response for the user."),
|
|
484
495
|
isValidUseCase: r.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
|
|
485
496
|
matchedTemplates: r.array(pt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")
|
|
486
|
-
}),
|
|
487
|
-
let $ = null,
|
|
488
|
-
const
|
|
497
|
+
}), V = (t) => t in A, gt = 5, ht = 0.8, ft = 0.15, bt = "Web Mapping Application", yt = "Embeddings";
|
|
498
|
+
let $ = null, U = null, M = null, P = null;
|
|
499
|
+
const xt = "Build", L = /* @__PURE__ */ Object.assign({
|
|
489
500
|
"./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
|
|
490
501
|
"./prompts/designSolution.md": () => import("../../chunks/designSolution.js").then((t) => t.default),
|
|
491
502
|
"./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
|
|
492
503
|
"./prompts/initialAssessment.md": () => import("../../chunks/initialAssessment.js").then((t) => t.default),
|
|
493
504
|
"./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
|
|
494
|
-
}),
|
|
495
|
-
let o = N(e)?.builderMessages?.[t] ?? xt[t];
|
|
496
|
-
if (!s)
|
|
497
|
-
return o;
|
|
498
|
-
for (const [i, a] of Object.entries(s))
|
|
499
|
-
o = o.replaceAll(`{{${i}}}`, a);
|
|
500
|
-
return o;
|
|
501
|
-
}, ge = (t) => {
|
|
505
|
+
}), vt = nt.builderMessages, f = (t, e, s) => N(e)?.builderMessages?.[t] ?? vt[t], ge = (t) => {
|
|
502
506
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
|
|
503
507
|
detail: t
|
|
504
508
|
}));
|
|
505
509
|
}, wt = async (t, e, s) => {
|
|
506
510
|
if (!t) return null;
|
|
507
511
|
const n = `type:"${bt}" AND typekeywords:${yt} AND group:${t}`;
|
|
508
|
-
return (await
|
|
512
|
+
return (await G.searchItems({
|
|
509
513
|
q: n,
|
|
510
514
|
params: e ? { token: e } : void 0,
|
|
511
515
|
portal: s,
|
|
@@ -516,16 +520,16 @@ async function St(t, e, s) {
|
|
|
516
520
|
try {
|
|
517
521
|
const n = await wt(t, e, s);
|
|
518
522
|
if (!n) return null;
|
|
519
|
-
const
|
|
520
|
-
return await
|
|
523
|
+
const i = new Oe({ id: n.id });
|
|
524
|
+
return await i.load(), await i.fetchData("json");
|
|
521
525
|
} catch {
|
|
522
526
|
return null;
|
|
523
527
|
}
|
|
524
528
|
}
|
|
525
529
|
const It = async (t, e, s) => {
|
|
526
530
|
if (!t) return [];
|
|
527
|
-
const n = `type:Solution AND typekeywords:${
|
|
528
|
-
return (await
|
|
531
|
+
const n = `type:Solution AND typekeywords:${xt} AND group:${t}`;
|
|
532
|
+
return (await G.searchItems({
|
|
529
533
|
q: n,
|
|
530
534
|
params: e ? { token: e } : void 0,
|
|
531
535
|
portal: s,
|
|
@@ -533,13 +537,13 @@ const It = async (t, e, s) => {
|
|
|
533
537
|
}))?.results ?? [];
|
|
534
538
|
}, Ct = async (t, e, s) => {
|
|
535
539
|
try {
|
|
536
|
-
const n = await
|
|
540
|
+
const n = await G.getItemData(t, {
|
|
537
541
|
params: e ? { token: e } : void 0,
|
|
538
542
|
portal: s
|
|
539
|
-
}),
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
return { buildSolution:
|
|
543
|
+
}), i = n?.buildSolution;
|
|
544
|
+
if (!i) return null;
|
|
545
|
+
const o = n?.params, a = o && typeof o == "object" && !Array.isArray(o) ? o : null;
|
|
546
|
+
return { buildSolution: i, params: a };
|
|
543
547
|
} catch {
|
|
544
548
|
return null;
|
|
545
549
|
}
|
|
@@ -573,10 +577,10 @@ const It = async (t, e, s) => {
|
|
|
573
577
|
error: s instanceof Error ? s.stack ?? s.message : String(s)
|
|
574
578
|
};
|
|
575
579
|
}
|
|
576
|
-
},
|
|
577
|
-
if (
|
|
578
|
-
Object.entries(
|
|
579
|
-
|
|
580
|
+
}, Q = async (t) => {
|
|
581
|
+
if (U) {
|
|
582
|
+
Object.entries(U).forEach(([a, l]) => {
|
|
583
|
+
A[a] && (A[a].initialTemplate = l);
|
|
580
584
|
});
|
|
581
585
|
return;
|
|
582
586
|
}
|
|
@@ -585,12 +589,12 @@ const It = async (t, e, s) => {
|
|
|
585
589
|
console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
|
|
586
590
|
return;
|
|
587
591
|
}
|
|
588
|
-
const
|
|
589
|
-
await Promise.all(
|
|
592
|
+
const i = await It(s, e, n), o = {};
|
|
593
|
+
await Promise.all(i.map(async (a) => {
|
|
590
594
|
const l = a.properties?.templateInfo;
|
|
591
595
|
if (!l || typeof l != "object") return;
|
|
592
596
|
const d = l.id;
|
|
593
|
-
if (typeof d != "string" ||
|
|
597
|
+
if (typeof d != "string" || o[d]) return;
|
|
594
598
|
const u = await Ct(a.id, e, n);
|
|
595
599
|
if (!u) return;
|
|
596
600
|
const { buildSolution: h, params: m } = u;
|
|
@@ -602,18 +606,18 @@ const It = async (t, e, s) => {
|
|
|
602
606
|
...l,
|
|
603
607
|
buildSolution: h
|
|
604
608
|
};
|
|
605
|
-
|
|
609
|
+
o[d] = _(
|
|
606
610
|
new oe(c).dumpToLlmTemplate(),
|
|
607
611
|
{
|
|
608
612
|
itemId: a.id,
|
|
609
613
|
sourceBuildSolution: structuredClone(h),
|
|
610
614
|
params: m ? structuredClone(m) : null
|
|
611
615
|
}
|
|
612
|
-
),
|
|
616
|
+
), A[d] = {
|
|
613
617
|
...l,
|
|
614
|
-
initialTemplate:
|
|
618
|
+
initialTemplate: o[d]
|
|
615
619
|
};
|
|
616
|
-
})),
|
|
620
|
+
})), U = o;
|
|
617
621
|
}, fe = (t) => {
|
|
618
622
|
const e = t?.configurable?.context?.token;
|
|
619
623
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
@@ -626,26 +630,26 @@ const It = async (t, e, s) => {
|
|
|
626
630
|
return `${e.replace(/\/+$/, "")}/sharing/rest`;
|
|
627
631
|
}, _t = async (t) => {
|
|
628
632
|
await Promise.all([
|
|
629
|
-
|
|
630
|
-
|
|
633
|
+
ve(t),
|
|
634
|
+
Q(t)
|
|
631
635
|
]);
|
|
632
|
-
},
|
|
636
|
+
}, xe = async (t) => {
|
|
633
637
|
const e = fe(t);
|
|
634
|
-
(!
|
|
635
|
-
throw
|
|
636
|
-
})), await
|
|
638
|
+
(!M || e && e !== P) && (P = e ?? P, M = _t(t).catch((n) => {
|
|
639
|
+
throw M = null, P = null, n;
|
|
640
|
+
})), await M;
|
|
637
641
|
};
|
|
638
|
-
async function
|
|
642
|
+
async function ve(t) {
|
|
639
643
|
if ($) return $;
|
|
640
644
|
const e = be(t);
|
|
641
645
|
if (!e)
|
|
642
646
|
return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
|
|
643
647
|
const s = ye(t), n = t?.configurable?.context?.configContext?.portalURL;
|
|
644
648
|
await new Ue(n ? { url: n } : void 0).load();
|
|
645
|
-
const
|
|
649
|
+
const o = fe(t) ?? void 0, a = await St(e, o, s);
|
|
646
650
|
return a ? ($ = a.items, $) : null;
|
|
647
651
|
}
|
|
648
|
-
const kt = () => Object.entries(
|
|
652
|
+
const kt = () => Object.entries(A).map(([t, e]) => `ID: ${t}
|
|
649
653
|
Label: ${e.label}
|
|
650
654
|
Description: ${e.description}`).join(`
|
|
651
655
|
|
|
@@ -657,10 +661,10 @@ Description: ${e.description}`).join(`
|
|
|
657
661
|
const s = JSON.parse(e), n = _(
|
|
658
662
|
{ response: "", ...s },
|
|
659
663
|
{ itemId: s?.solution?.itemId ?? null }
|
|
660
|
-
),
|
|
661
|
-
if (!
|
|
664
|
+
), i = H.safeParse(n);
|
|
665
|
+
if (!i.success)
|
|
662
666
|
return null;
|
|
663
|
-
const { response:
|
|
667
|
+
const { response: o, ...a } = i.data, l = s.templateId, d = typeof l == "string" && V(l) ? l : null;
|
|
664
668
|
return _(
|
|
665
669
|
a,
|
|
666
670
|
{
|
|
@@ -672,91 +676,97 @@ Description: ${e.description}`).join(`
|
|
|
672
676
|
} catch {
|
|
673
677
|
return null;
|
|
674
678
|
}
|
|
675
|
-
}, Et =
|
|
676
|
-
...
|
|
679
|
+
}, Et = b.Root({
|
|
680
|
+
...J(),
|
|
677
681
|
/** Optional human-readable template description retained for UI use. */
|
|
678
|
-
templateDescription:
|
|
682
|
+
templateDescription: b({
|
|
679
683
|
reducer: (t, e) => typeof e == "string" || e === null ? e : t ?? null,
|
|
680
684
|
default: () => null
|
|
681
685
|
}),
|
|
682
686
|
/** Current editable design payload being refined across turns. */
|
|
683
|
-
currentDesign:
|
|
687
|
+
currentDesign: b({
|
|
684
688
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
685
689
|
default: () => null
|
|
686
690
|
}),
|
|
687
691
|
/** Initial request assessment produced by the intake prompt. */
|
|
688
|
-
assessment:
|
|
692
|
+
assessment: b({
|
|
689
693
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
690
694
|
default: () => null
|
|
691
695
|
}),
|
|
692
696
|
/** Template selected automatically or by human-in-the-loop choice. */
|
|
693
|
-
selectedTemplate:
|
|
697
|
+
selectedTemplate: b({
|
|
694
698
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
695
699
|
default: () => null
|
|
696
700
|
}),
|
|
697
701
|
/** Existing solution matches surfaced before building a new solution. */
|
|
698
|
-
existingMatches:
|
|
702
|
+
existingMatches: b({
|
|
699
703
|
reducer: (t = [], e) => e === void 0 ? t : e ?? [],
|
|
700
704
|
default: () => []
|
|
705
|
+
}),
|
|
706
|
+
/** User decision for whether to continue building after existing matches are shown. */
|
|
707
|
+
continueBuilding: b({
|
|
708
|
+
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
709
|
+
default: () => null
|
|
701
710
|
})
|
|
702
711
|
}), At = (t, e) => {
|
|
703
|
-
const s = Tt(e), n = s?.templateId ?? null,
|
|
704
|
-
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (
|
|
705
|
-
},
|
|
706
|
-
await
|
|
707
|
-
const s = t.agentExecutionContext.userRequest, n = kt(),
|
|
708
|
-
promptText: await
|
|
712
|
+
const s = Tt(e), n = s?.templateId ?? null, i = {};
|
|
713
|
+
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
|
|
714
|
+
}, Dt = async (t, e) => {
|
|
715
|
+
await w({ text: f("understandingRequest", e) }, e), await xe(e);
|
|
716
|
+
const s = t.agentExecutionContext.userRequest, n = kt(), i = t.agentExecutionContext.messages.slice(-11), o = await D({
|
|
717
|
+
promptText: await y(L, "initialAssessment"),
|
|
709
718
|
modelTier: "advanced",
|
|
710
719
|
temperature: 0,
|
|
711
720
|
schema: mt,
|
|
712
|
-
messages:
|
|
721
|
+
messages: i,
|
|
713
722
|
inputVariables: { query: s, availableTemplates: n }
|
|
714
|
-
}), a =
|
|
715
|
-
(c) =>
|
|
723
|
+
}), a = o.matchedTemplates.filter(
|
|
724
|
+
(c) => V(c.templateId)
|
|
716
725
|
), l = {
|
|
717
|
-
...
|
|
726
|
+
...o,
|
|
718
727
|
matchedTemplates: a
|
|
719
728
|
}, [d, u] = a, m = !!d && d.confidence >= ht && (u === void 0 || d.confidence - u.confidence >= ft) ? d.templateId : null;
|
|
720
729
|
return {
|
|
721
730
|
assessment: l,
|
|
722
731
|
selectedTemplate: m,
|
|
723
|
-
existingMatches: []
|
|
732
|
+
existingMatches: [],
|
|
733
|
+
continueBuilding: null
|
|
724
734
|
};
|
|
725
|
-
},
|
|
735
|
+
}, Lt = (t) => {
|
|
726
736
|
const e = t.assessment?.assistantResponse ?? "";
|
|
727
737
|
return {
|
|
728
738
|
outputMessage: e,
|
|
729
739
|
summary: e,
|
|
730
740
|
status: "success"
|
|
731
741
|
};
|
|
732
|
-
},
|
|
733
|
-
const { hitlResponse: s } = e.configurable, n = "selectTemplate",
|
|
734
|
-
(u) =>
|
|
735
|
-
) ?? [],
|
|
742
|
+
}, Rt = (t, e) => {
|
|
743
|
+
const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
|
|
744
|
+
(u) => V(u.templateId)
|
|
745
|
+
) ?? [], o = i.map((u) => `${u.templateDescription}`);
|
|
736
746
|
if (s?.agentId !== "solutionBuilder" || s.id !== n) {
|
|
737
747
|
const u = {
|
|
738
748
|
agentId: "solutionBuilder",
|
|
739
749
|
id: n,
|
|
740
750
|
kind: "singleSelection",
|
|
741
|
-
message:
|
|
742
|
-
metadata: [...
|
|
751
|
+
message: f("selectTemplatePrompt", e),
|
|
752
|
+
metadata: [...o]
|
|
743
753
|
};
|
|
744
754
|
throw new ie(u);
|
|
745
755
|
}
|
|
746
|
-
const a = String(s.payload ?? ""), l =
|
|
756
|
+
const a = String(s.payload ?? ""), l = o.findIndex((u) => u === a);
|
|
747
757
|
return {
|
|
748
|
-
selectedTemplate: (l >= 0 ?
|
|
758
|
+
selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
|
|
749
759
|
};
|
|
750
760
|
}, $t = async (t, e) => {
|
|
751
|
-
await
|
|
752
|
-
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s,
|
|
753
|
-
if (!
|
|
761
|
+
await w({ text: f("searchingExistingSolutions", e) }, e);
|
|
762
|
+
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await ve(e);
|
|
763
|
+
if (!i)
|
|
754
764
|
return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
|
|
755
|
-
if (!
|
|
765
|
+
if (!i.length)
|
|
756
766
|
return { existingMatches: [] };
|
|
757
|
-
const [
|
|
767
|
+
const [o] = await Pe([n]), a = i.map((c) => ({
|
|
758
768
|
solution: c,
|
|
759
|
-
score:
|
|
769
|
+
score: Fe(o, c.embedding)
|
|
760
770
|
}));
|
|
761
771
|
a.sort((c, g) => g.score - c.score);
|
|
762
772
|
const l = a.slice(0, gt);
|
|
@@ -767,79 +777,90 @@ Snippet: ${c.snippet}
|
|
|
767
777
|
Description: ${c.description}`).join(`
|
|
768
778
|
|
|
769
779
|
`), u = t.agentExecutionContext.messages.slice(-11);
|
|
770
|
-
return { existingMatches: (await
|
|
771
|
-
promptText: await
|
|
780
|
+
return { existingMatches: (await D({
|
|
781
|
+
promptText: await y(L, "findExistingSolution"),
|
|
772
782
|
modelTier: "fast",
|
|
773
783
|
temperature: 0,
|
|
774
784
|
schema: ut,
|
|
775
785
|
messages: u,
|
|
776
786
|
inputVariables: { query: s, candidates: d }
|
|
777
787
|
})).matchedTitles.map((c) => l.find(({ solution: g }) => g.title === c)).filter((c) => c !== void 0) };
|
|
778
|
-
},
|
|
779
|
-
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable,
|
|
780
|
-
if (n?.agentId !== "solutionBuilder" || n.id !==
|
|
788
|
+
}, Mt = (t, e) => {
|
|
789
|
+
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${s[0].solution.id}`;
|
|
790
|
+
if (n?.agentId !== "solutionBuilder" || n.id !== i) {
|
|
781
791
|
s.length === 1 ? ce(s[0].solution.id) : le(s);
|
|
782
|
-
const
|
|
792
|
+
const d = f("existingSolutionMatch", e), u = [
|
|
793
|
+
f("continueBuildingYes", e),
|
|
794
|
+
f("continueBuildingNo", e)
|
|
795
|
+
], h = {
|
|
783
796
|
agentId: "solutionBuilder",
|
|
784
|
-
id:
|
|
785
|
-
kind: "
|
|
786
|
-
message:
|
|
787
|
-
metadata:
|
|
797
|
+
id: i,
|
|
798
|
+
kind: "singleSelection",
|
|
799
|
+
message: d,
|
|
800
|
+
metadata: u
|
|
788
801
|
};
|
|
789
|
-
throw new ie(
|
|
802
|
+
throw new ie(h);
|
|
790
803
|
}
|
|
791
|
-
|
|
804
|
+
const o = String(n.payload ?? "").trim(), a = f("continueBuildingNo", e);
|
|
805
|
+
return { continueBuilding: o !== a };
|
|
806
|
+
}, Pt = (t, e) => {
|
|
807
|
+
const s = f("continueBuildingDeclined", e);
|
|
808
|
+
return {
|
|
809
|
+
outputMessage: s,
|
|
810
|
+
summary: s,
|
|
811
|
+
status: "success"
|
|
812
|
+
};
|
|
792
813
|
}, we = async (t, e) => {
|
|
793
|
-
await
|
|
814
|
+
await xe(e);
|
|
794
815
|
const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
|
|
795
|
-
await
|
|
796
|
-
let
|
|
797
|
-
if (
|
|
816
|
+
await w({ text: f("creatingDesign", e) }, e);
|
|
817
|
+
let i = F(t.selectedTemplate);
|
|
818
|
+
if (i?.initialTemplate || (await Q(e), i = F(t.selectedTemplate)), !i?.initialTemplate)
|
|
798
819
|
throw new Error("No hydrated templates are available for solution design.");
|
|
799
|
-
const
|
|
800
|
-
s ??
|
|
820
|
+
const o = _(
|
|
821
|
+
s ?? i.initialTemplate,
|
|
801
822
|
{
|
|
802
|
-
itemId: (s ??
|
|
803
|
-
sourceBuildSolution: s?.sourceBuildSolution ??
|
|
804
|
-
params: s?.params ??
|
|
823
|
+
itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
|
|
824
|
+
sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
|
|
825
|
+
params: s?.params ?? i.initialTemplate.params ?? null
|
|
805
826
|
}
|
|
806
|
-
), a = t.agentExecutionContext.messages.slice(-11), l = await
|
|
807
|
-
promptText: await
|
|
827
|
+
), a = t.agentExecutionContext.messages.slice(-11), l = await D({
|
|
828
|
+
promptText: await y(L, "designSolution"),
|
|
808
829
|
modelTier: "advanced",
|
|
809
830
|
temperature: 0,
|
|
810
|
-
schema:
|
|
831
|
+
schema: H,
|
|
811
832
|
messages: a,
|
|
812
833
|
inputVariables: {
|
|
813
|
-
currentDesign: JSON.stringify(ae(
|
|
814
|
-
templateInstructions:
|
|
834
|
+
currentDesign: JSON.stringify(ae(o)),
|
|
835
|
+
templateInstructions: i.instructions,
|
|
815
836
|
query: n
|
|
816
837
|
}
|
|
817
838
|
}), { response: d, featureLayer: u, ...h } = l, m = re(
|
|
818
839
|
u,
|
|
819
|
-
|
|
840
|
+
o.featureLayer
|
|
820
841
|
), c = _(
|
|
821
842
|
{ ...h, featureLayer: m },
|
|
822
843
|
{
|
|
823
|
-
itemId:
|
|
824
|
-
sourceBuildSolution:
|
|
844
|
+
itemId: o?.solution?.itemId,
|
|
845
|
+
sourceBuildSolution: o.sourceBuildSolution,
|
|
825
846
|
templateId: t.selectedTemplate ?? null,
|
|
826
|
-
params:
|
|
847
|
+
params: o.params ?? null
|
|
827
848
|
}
|
|
828
|
-
), g = new me(c,
|
|
849
|
+
), g = new me(c, i.initialTemplate);
|
|
829
850
|
if (!g.isValid)
|
|
830
851
|
return console.warn(
|
|
831
852
|
"[SolutionBuilder] designSolution validation failed:",
|
|
832
853
|
{ issues: g.issues, llmResponse: l }
|
|
833
854
|
), {
|
|
834
|
-
outputMessage:
|
|
855
|
+
outputMessage: f("createDesignFailed", e)
|
|
835
856
|
};
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
857
|
+
const x = c.sourceBuildSolution, S = he(c, x);
|
|
858
|
+
if (!S.ok) {
|
|
838
859
|
console.warn(
|
|
839
860
|
"[SolutionBuilder] designSolution Esri JSON conversion failed:",
|
|
840
|
-
{ error:
|
|
861
|
+
{ error: S.error, llmResponse: l, design: c }
|
|
841
862
|
);
|
|
842
|
-
const k =
|
|
863
|
+
const k = f("createDesignFailed", e);
|
|
843
864
|
return {
|
|
844
865
|
outputMessage: k,
|
|
845
866
|
summary: k,
|
|
@@ -856,19 +877,19 @@ Description: ${c.description}`).join(`
|
|
|
856
877
|
const { currentDesign: s } = t;
|
|
857
878
|
if (!s)
|
|
858
879
|
return we(t, e);
|
|
859
|
-
const n = t.agentExecutionContext.userRequest,
|
|
860
|
-
await
|
|
861
|
-
const
|
|
862
|
-
promptText: await
|
|
880
|
+
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
|
|
881
|
+
await w({ text: f("updatingDesign", e) }, e);
|
|
882
|
+
const o = await D({
|
|
883
|
+
promptText: await y(L, "updateDesign"),
|
|
863
884
|
modelTier: "advanced",
|
|
864
885
|
temperature: 0,
|
|
865
886
|
schema: dt,
|
|
866
|
-
messages:
|
|
887
|
+
messages: i,
|
|
867
888
|
inputVariables: {
|
|
868
889
|
currentDesign: JSON.stringify(qe(s)),
|
|
869
890
|
query: n
|
|
870
891
|
}
|
|
871
|
-
}), { response: a, patches: l } =
|
|
892
|
+
}), { response: a, patches: l } = o;
|
|
872
893
|
if (!l || l.length === 0)
|
|
873
894
|
return {
|
|
874
895
|
outputMessage: a,
|
|
@@ -879,7 +900,7 @@ Description: ${c.description}`).join(`
|
|
|
879
900
|
try {
|
|
880
901
|
return JSON.parse(p);
|
|
881
902
|
} catch {
|
|
882
|
-
const
|
|
903
|
+
const C = p.replace(/[\u0000-\u001F]/g, (Z) => {
|
|
883
904
|
switch (Z) {
|
|
884
905
|
case "\b":
|
|
885
906
|
return "\\b";
|
|
@@ -897,7 +918,7 @@ Description: ${c.description}`).join(`
|
|
|
897
918
|
}
|
|
898
919
|
});
|
|
899
920
|
try {
|
|
900
|
-
return JSON.parse(
|
|
921
|
+
return JSON.parse(C);
|
|
901
922
|
} catch {
|
|
902
923
|
return p;
|
|
903
924
|
}
|
|
@@ -907,44 +928,44 @@ Description: ${c.description}`).join(`
|
|
|
907
928
|
path: p.path.replace(/\/+$/, ""),
|
|
908
929
|
...p.value != null && p.value !== "" ? { value: d(p.value) } : {},
|
|
909
930
|
...p.from != null && p.from !== "" ? { from: p.from } : {}
|
|
910
|
-
}))].sort((p,
|
|
931
|
+
}))].sort((p, C) => p.op !== "remove" || C.op !== "remove" ? 0 : C.path.localeCompare(p.path, void 0, { numeric: !0 })), m = structuredClone(
|
|
911
932
|
ae(s)
|
|
912
933
|
);
|
|
913
934
|
try {
|
|
914
|
-
|
|
935
|
+
Ne(m, h, !0);
|
|
915
936
|
} catch (p) {
|
|
916
937
|
console.warn(
|
|
917
938
|
"[SolutionBuilder] updateDesign JSON patch failed:",
|
|
918
|
-
{ error: p, llmResponse:
|
|
939
|
+
{ error: p, llmResponse: o, patches: h, patchTarget: m }
|
|
919
940
|
);
|
|
920
|
-
const
|
|
941
|
+
const C = f("applyChangeFailed", e);
|
|
921
942
|
return {
|
|
922
|
-
outputMessage:
|
|
923
|
-
summary:
|
|
943
|
+
outputMessage: C,
|
|
944
|
+
summary: C,
|
|
924
945
|
status: "success"
|
|
925
946
|
};
|
|
926
947
|
}
|
|
927
948
|
const c = _(
|
|
928
949
|
{ response: "", ...m },
|
|
929
950
|
{ itemId: s.solution?.itemId ?? null }
|
|
930
|
-
), g =
|
|
951
|
+
), g = H.safeParse(c);
|
|
931
952
|
if (!g.success) {
|
|
932
953
|
console.warn(
|
|
933
954
|
"[SolutionBuilder] updateDesign schema validation failed:",
|
|
934
|
-
{ errors: g.error.issues, llmResponse:
|
|
955
|
+
{ errors: g.error.issues, llmResponse: o, patchedDesign: c }
|
|
935
956
|
);
|
|
936
|
-
const p =
|
|
957
|
+
const p = f("applyChangeFailed", e);
|
|
937
958
|
return {
|
|
938
959
|
outputMessage: p,
|
|
939
960
|
summary: p,
|
|
940
961
|
status: "success"
|
|
941
962
|
};
|
|
942
963
|
}
|
|
943
|
-
const { response:
|
|
944
|
-
|
|
964
|
+
const { response: x, featureLayer: S, ...k } = g.data, q = re(
|
|
965
|
+
S,
|
|
945
966
|
s.featureLayer
|
|
946
|
-
),
|
|
947
|
-
{ ...k, featureLayer:
|
|
967
|
+
), I = _(
|
|
968
|
+
{ ...k, featureLayer: q },
|
|
948
969
|
{
|
|
949
970
|
itemId: s.solution?.itemId,
|
|
950
971
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -952,133 +973,147 @@ Description: ${c.description}`).join(`
|
|
|
952
973
|
params: s.params ?? null
|
|
953
974
|
}
|
|
954
975
|
);
|
|
955
|
-
let
|
|
956
|
-
if (
|
|
976
|
+
let R = F(t.selectedTemplate);
|
|
977
|
+
if (R?.initialTemplate || (await Q(e), R = F(t.selectedTemplate)), !R?.initialTemplate)
|
|
957
978
|
throw new Error("No hydrated templates are available for solution design.");
|
|
958
|
-
const
|
|
959
|
-
if (!
|
|
979
|
+
const K = new me(I, R.initialTemplate, !1);
|
|
980
|
+
if (!K.isValid)
|
|
960
981
|
return console.warn(
|
|
961
982
|
"[SolutionBuilder] updateDesign validation failed:",
|
|
962
|
-
{ issues:
|
|
983
|
+
{ issues: K.issues, llmResponse: o, patchedDesign: I }
|
|
963
984
|
), {
|
|
964
|
-
outputMessage:
|
|
985
|
+
outputMessage: f("applyChangeFailed", e)
|
|
965
986
|
};
|
|
966
|
-
const Ie =
|
|
987
|
+
const Ie = I.sourceBuildSolution, Y = he(I, Ie);
|
|
967
988
|
if (!Y.ok) {
|
|
968
989
|
console.warn(
|
|
969
990
|
"[SolutionBuilder] updateDesign Esri JSON conversion failed:",
|
|
970
|
-
{ error: Y.error, llmResponse:
|
|
991
|
+
{ error: Y.error, llmResponse: o, design: I }
|
|
971
992
|
);
|
|
972
|
-
const p =
|
|
993
|
+
const p = f("applyChangeFailed", e);
|
|
973
994
|
return {
|
|
974
995
|
outputMessage: p,
|
|
975
996
|
summary: p,
|
|
976
997
|
status: "success"
|
|
977
998
|
};
|
|
978
999
|
}
|
|
979
|
-
return ge(
|
|
1000
|
+
return ge(I), {
|
|
980
1001
|
outputMessage: a,
|
|
981
1002
|
summary: a,
|
|
982
1003
|
status: "success",
|
|
983
|
-
currentDesign:
|
|
1004
|
+
currentDesign: I
|
|
984
1005
|
};
|
|
985
|
-
},
|
|
1006
|
+
}, Bt = (t) => t.currentDesign !== null ? "updateDesign" : "assessInitialRequest", Nt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidUseCaseExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", qt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ut = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Ot = () => new z(Et).addNode("syncCurrentDesignFromContext", At).addNode("assessInitialRequest", Dt).addNode("invalidUseCaseExit", Lt).addNode("selectTemplateHIL", Rt).addNode("findExistingSolutions", $t).addNode("confirmContinueBuildingHIL", Mt).addNode("declineContinueBuildingExit", Pt).addNode("designSolution", we).addNode("updateDesign", Ft).addEdge(j, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Bt, {
|
|
986
1007
|
updateDesign: "updateDesign",
|
|
987
1008
|
assessInitialRequest: "assessInitialRequest"
|
|
988
1009
|
}).addConditionalEdges("assessInitialRequest", Nt, {
|
|
989
1010
|
invalidUseCaseExit: "invalidUseCaseExit",
|
|
990
1011
|
selectTemplateHIL: "selectTemplateHIL",
|
|
991
1012
|
findExistingSolutions: "findExistingSolutions"
|
|
992
|
-
}).addEdge("invalidUseCaseExit",
|
|
1013
|
+
}).addEdge("invalidUseCaseExit", v).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", qt, {
|
|
993
1014
|
confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
|
|
994
1015
|
designSolution: "designSolution"
|
|
995
|
-
}).
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1016
|
+
}).addConditionalEdges("confirmContinueBuildingHIL", Ut, {
|
|
1017
|
+
declineContinueBuildingExit: "declineContinueBuildingExit",
|
|
1018
|
+
designSolution: "designSolution"
|
|
1019
|
+
}).addEdge("declineContinueBuildingExit", v).addEdge("designSolution", v).addEdge("updateDesign", v);
|
|
1020
|
+
await y(L, "description");
|
|
1021
|
+
const zt = E.object({
|
|
1022
|
+
tool: E.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
|
|
1023
|
+
confidence: E.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
|
|
1024
|
+
rationale: E.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)"),
|
|
1025
|
+
builderExclusion: E.boolean().describe("True only when tool is other specifically due to Builder Exclusion Override.")
|
|
1026
|
+
}), B = /* @__PURE__ */ Object.assign({
|
|
1002
1027
|
"./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
|
|
1003
1028
|
"./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
|
|
1004
|
-
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
|
|
1005
|
-
|
|
1029
|
+
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default),
|
|
1030
|
+
"./prompts/responseOptionsBuilderExclusion.md": () => import("../../chunks/responseOptionsBuilderExclusion.js").then((t) => t.default),
|
|
1031
|
+
"./prompts/responseOptionsDefault.md": () => import("../../chunks/responseOptionsDefault.js").then((t) => t.default)
|
|
1032
|
+
}), W = () => {
|
|
1006
1033
|
const t = new CustomEvent("assistantProcessing", {
|
|
1007
1034
|
detail: !1
|
|
1008
1035
|
});
|
|
1009
1036
|
window.dispatchEvent(t);
|
|
1010
|
-
}, Se =
|
|
1011
|
-
...
|
|
1012
|
-
selectedTool:
|
|
1037
|
+
}, Se = b.Root({
|
|
1038
|
+
...J(),
|
|
1039
|
+
selectedTool: b({
|
|
1013
1040
|
reducer: (t, e) => e ?? null,
|
|
1014
1041
|
default: () => null
|
|
1015
1042
|
}),
|
|
1016
|
-
intentRationale:
|
|
1043
|
+
intentRationale: b({
|
|
1017
1044
|
reducer: (t, e) => e ?? null,
|
|
1018
1045
|
default: () => null
|
|
1046
|
+
}),
|
|
1047
|
+
builderExclusion: b({
|
|
1048
|
+
reducer: (t, e) => e ?? !1,
|
|
1049
|
+
default: () => !1
|
|
1019
1050
|
})
|
|
1020
|
-
}),
|
|
1051
|
+
}), jt = async (t, e) => {
|
|
1021
1052
|
const s = N(e);
|
|
1022
|
-
await
|
|
1053
|
+
await w(
|
|
1023
1054
|
{ text: s?.builderMessages.understandingRequest },
|
|
1024
1055
|
e
|
|
1025
1056
|
);
|
|
1026
|
-
const n = t.agentExecutionContext.userRequest,
|
|
1057
|
+
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11), o = e?.configurable?.context?.solutionDesignJson;
|
|
1027
1058
|
let a = !1;
|
|
1028
|
-
if (typeof
|
|
1059
|
+
if (typeof o == "string" && o.trim())
|
|
1029
1060
|
try {
|
|
1030
|
-
a = JSON.parse(
|
|
1061
|
+
a = JSON.parse(o).solution != null;
|
|
1031
1062
|
} catch {
|
|
1032
1063
|
a = !1;
|
|
1033
1064
|
}
|
|
1034
|
-
const l = await
|
|
1065
|
+
const l = await y(B, "classifyIntent"), d = await D({
|
|
1035
1066
|
promptText: l,
|
|
1036
1067
|
modelTier: "advanced",
|
|
1037
1068
|
temperature: 0,
|
|
1038
|
-
schema:
|
|
1039
|
-
messages:
|
|
1069
|
+
schema: zt,
|
|
1070
|
+
messages: i,
|
|
1040
1071
|
inputVariables: { query: n, activeSolutionDesign: a }
|
|
1041
1072
|
});
|
|
1042
1073
|
return {
|
|
1043
1074
|
selectedTool: d.tool,
|
|
1044
|
-
intentRationale: d.rationale
|
|
1075
|
+
intentRationale: d.rationale,
|
|
1076
|
+
builderExclusion: d.builderExclusion
|
|
1045
1077
|
};
|
|
1046
|
-
}, Ot = async (t, e) => {
|
|
1047
|
-
const n = await Ke().compile().invoke(t, e);
|
|
1048
|
-
return K(), n;
|
|
1049
|
-
}, jt = async (t, e) => {
|
|
1050
|
-
const n = await qt().compile().invoke(t, e);
|
|
1051
|
-
return K(), n;
|
|
1052
1078
|
}, Jt = async (t, e) => {
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1079
|
+
const n = await We().compile().invoke(t, e);
|
|
1080
|
+
return W(), n;
|
|
1081
|
+
}, Gt = async (t, e) => {
|
|
1082
|
+
const n = await Ot().compile().invoke(t, e);
|
|
1083
|
+
return W(), n;
|
|
1084
|
+
}, Ht = async (t, e) => {
|
|
1085
|
+
const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.", o = t.builderExclusion ? "responseOptionsBuilderExclusion" : "responseOptionsDefault";
|
|
1086
|
+
await w(
|
|
1055
1087
|
{ text: s?.executingSolutionsAssistantAgent },
|
|
1056
1088
|
e
|
|
1057
1089
|
);
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
|
|
1090
|
+
const a = await y(B, "assistantResponse"), l = await y(
|
|
1091
|
+
B,
|
|
1092
|
+
o
|
|
1093
|
+
), d = t.agentExecutionContext.messages.slice(-11), u = await Be({
|
|
1094
|
+
promptText: a,
|
|
1095
|
+
modelTier: "advanced",
|
|
1061
1096
|
temperature: 0,
|
|
1062
|
-
messages:
|
|
1063
|
-
inputVariables: { query: n, rationale:
|
|
1097
|
+
messages: d,
|
|
1098
|
+
inputVariables: { query: n, rationale: i, responseOptions: l }
|
|
1064
1099
|
});
|
|
1065
|
-
return
|
|
1066
|
-
outputMessage:
|
|
1067
|
-
summary:
|
|
1100
|
+
return W(), {
|
|
1101
|
+
outputMessage: u,
|
|
1102
|
+
summary: u,
|
|
1068
1103
|
status: "success"
|
|
1069
1104
|
};
|
|
1070
|
-
},
|
|
1105
|
+
}, Vt = (t) => t.selectedTool ?? "other", Qt = () => new z(Se).addNode("classifyIntent", jt).addNode("routeToExplorer", Jt).addNode("routeToBuilder", Gt).addNode("assistantResponse", Ht).addEdge(j, "classifyIntent").addConditionalEdges("classifyIntent", Vt, {
|
|
1071
1106
|
explorer: "routeToExplorer",
|
|
1072
1107
|
builder: "routeToBuilder",
|
|
1073
1108
|
other: "assistantResponse"
|
|
1074
|
-
}).addEdge("routeToExplorer",
|
|
1109
|
+
}).addEdge("routeToExplorer", v).addEdge("routeToBuilder", v).addEdge("assistantResponse", v), Wt = await y(B, "description"), Kt = {
|
|
1075
1110
|
id: "solutionsAssistant",
|
|
1076
1111
|
name: "Solutions Assistant Agent",
|
|
1077
|
-
description:
|
|
1078
|
-
createGraph:
|
|
1112
|
+
description: Wt,
|
|
1113
|
+
createGraph: Qt,
|
|
1079
1114
|
workspace: Se
|
|
1080
|
-
},
|
|
1081
|
-
class
|
|
1115
|
+
}, Yt = "https://links.esri.com/solutions/agol-organizational-account", Zt = "https://links.esri.com/solutions/configure-assistants";
|
|
1116
|
+
class Xt extends ke {
|
|
1082
1117
|
constructor() {
|
|
1083
1118
|
super(), this.open = !1, this.userFirstName = "", this.builderVisible = !1, this.hasActiveBuilderDesign = !1, this._conversationId = void 0, this._orgSettings = {
|
|
1084
1119
|
aiAssistantsEnabled: !1,
|
|
@@ -1091,7 +1126,7 @@ class Yt extends ke {
|
|
|
1091
1126
|
e?.portalURL && (se.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
|
|
1092
1127
|
}
|
|
1093
1128
|
}), this._builderDesignContextConsumer = te({
|
|
1094
|
-
context:
|
|
1129
|
+
context: De,
|
|
1095
1130
|
subscribe: !0,
|
|
1096
1131
|
callback: (e) => {
|
|
1097
1132
|
e?.design && (this._solutionDesignJson = JSON.stringify(e.design, null, 2));
|
|
@@ -1114,15 +1149,15 @@ class Yt extends ke {
|
|
|
1114
1149
|
}, this._checkURLOpenParameter = () => {
|
|
1115
1150
|
this.open = this._configContextConsumer.value?.authentication?.SignInParam === "aiOpen" || this.open;
|
|
1116
1151
|
}, this.listenOn(window, "arcgisFeedback", (e) => {
|
|
1117
|
-
const s = e.detail, { agentPicked: n, taskAssigned:
|
|
1118
|
-
this._sendFeedback(s.content,
|
|
1152
|
+
const s = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(s);
|
|
1153
|
+
this._sendFeedback(s.content, o ?? i ?? "", s.feedback?.positive ? "Good" : s.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
|
|
1119
1154
|
});
|
|
1120
1155
|
}
|
|
1121
1156
|
static {
|
|
1122
1157
|
this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16 };
|
|
1123
1158
|
}
|
|
1124
1159
|
static {
|
|
1125
|
-
this.styles =
|
|
1160
|
+
this.styles = ze;
|
|
1126
1161
|
}
|
|
1127
1162
|
get _telemetry() {
|
|
1128
1163
|
return this._configContextConsumer.value?.telemetrySession;
|
|
@@ -1143,32 +1178,38 @@ class Yt extends ke {
|
|
|
1143
1178
|
this._loadUserFirstName();
|
|
1144
1179
|
}
|
|
1145
1180
|
willUpdate(e) {
|
|
1146
|
-
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (ue(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
|
|
1181
|
+
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (ue(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token, this._configContextConsumer.value?.locale ?? "en"), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
|
|
1147
1182
|
}
|
|
1148
1183
|
_renderNoSign() {
|
|
1149
1184
|
return T`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? ee} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
|
|
1150
1185
|
}
|
|
1151
1186
|
_renderNoPermission() {
|
|
1152
|
-
return T`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ee(this._translations.noPermissionMessage.replace("{{orgUrl}}",
|
|
1187
|
+
return T`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ee(this._translations.noPermissionMessage.replace("{{orgUrl}}", Yt).replace("{{configAI}}", Zt))}</div></calcite-notice>`;
|
|
1153
1188
|
}
|
|
1154
1189
|
render() {
|
|
1155
1190
|
let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
|
|
1156
1191
|
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), T`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? T`${!this._isMobile && T`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
|
|
1157
1192
|
window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
|
|
1158
|
-
}} scale=m slot=header-actions-end></calcite-action>` || ""}
|
|
1159
|
-
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory();
|
|
1160
|
-
}} scale=m slot=header-actions-end></calcite-action><calcite-tooltip placement=bottom reference-element=newChatButton><span>${this._translations.tooltips.newConversation}</span></calcite-tooltip>${!this._isMobile && T`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.toggleSolutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? ee} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1193
|
+
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && T`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? ee} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1161
1194
|
console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
|
|
1162
|
-
const n = Date.now(),
|
|
1195
|
+
const n = Date.now(), i = Re(n), o = s.detail || "Unknown";
|
|
1163
1196
|
this._telemetry?.logEvent({
|
|
1164
|
-
category:
|
|
1197
|
+
category: Le.ASSISTANT,
|
|
1165
1198
|
action: "Chat",
|
|
1166
|
-
dimensions: [
|
|
1167
|
-
metrics: [
|
|
1199
|
+
dimensions: [o],
|
|
1200
|
+
metrics: [i]
|
|
1168
1201
|
}), this.assistantProcessing.emit(!0);
|
|
1169
1202
|
}} @arcgisFeedback=${(s) => {
|
|
1170
1203
|
s.detail;
|
|
1171
|
-
}}
|
|
1204
|
+
}} @arcgisInterrupt=${() => {
|
|
1205
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !0);
|
|
1206
|
+
}} @arcgisInterruptCancel=${() => {
|
|
1207
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1208
|
+
}} @arcgisInterruptSubmit=${() => {
|
|
1209
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1210
|
+
}} ${Me(this._assistantRef)}><calcite-label alignment=start slot=entry-actions-start layout=inline scale=s><calcite-action id=newChatButton icon=speech-bubble-plus .text=${this._translations.tooltips.newChat} @click=${() => {
|
|
1211
|
+
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1212
|
+
}} scale=s></calcite-action>${this._translations.tooltips.newChat}</calcite-label><arcgis-assistant-agent .agent=${Kt} .context=${{
|
|
1172
1213
|
token: this._configContextConsumer.value?.userSession?.token,
|
|
1173
1214
|
configContext: this._configContextConsumer.value,
|
|
1174
1215
|
convoId: this._conversationId,
|
|
@@ -1189,9 +1230,9 @@ class Yt extends ke {
|
|
|
1189
1230
|
this.closeAssistant.emit(!0);
|
|
1190
1231
|
}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`;
|
|
1191
1232
|
}
|
|
1192
|
-
_sendFeedback(e, s, n,
|
|
1193
|
-
const
|
|
1194
|
-
window.open(
|
|
1233
|
+
_sendFeedback(e, s, n, i) {
|
|
1234
|
+
const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(s)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: i }))}&field:version=${encodeURIComponent("v2")}`;
|
|
1235
|
+
window.open(o, "_blank");
|
|
1195
1236
|
}
|
|
1196
1237
|
async _loadUserFirstName() {
|
|
1197
1238
|
try {
|
|
@@ -1221,8 +1262,30 @@ class Yt extends ke {
|
|
|
1221
1262
|
});
|
|
1222
1263
|
window.dispatchEvent(s);
|
|
1223
1264
|
}
|
|
1265
|
+
_queryElementInShadowDom(e, s, n) {
|
|
1266
|
+
const i = e.shadowRoot;
|
|
1267
|
+
if (i) {
|
|
1268
|
+
const o = i.querySelector("arcgis-assistant");
|
|
1269
|
+
o && o.shadowRoot && this._findElementInShadowDom(o.shadowRoot, s, n);
|
|
1270
|
+
} else
|
|
1271
|
+
console.log("No shadowRoot found on this component.");
|
|
1272
|
+
}
|
|
1273
|
+
_findElementInShadowDom(e, s, n) {
|
|
1274
|
+
const i = e.querySelector(s);
|
|
1275
|
+
i && this._disableElementAndChildren(i, n);
|
|
1276
|
+
const o = e.children;
|
|
1277
|
+
for (const a of Array.from(o))
|
|
1278
|
+
a.classList.contains(s) && this._disableElementAndChildren(a, n), this._findElementInShadowDom(a, s, n);
|
|
1279
|
+
}
|
|
1280
|
+
_disableElementAndChildren(e, s) {
|
|
1281
|
+
"disabled" in e && (e.disabled = s), e.querySelectorAll("*").forEach((i) => {
|
|
1282
|
+
i.nodeName.toLowerCase() === "arcgis-assistant-chat-entry" && i.shadowRoot && i.shadowRoot.querySelectorAll("*").forEach((l) => {
|
|
1283
|
+
"disabled" in l && (l.disabled = s);
|
|
1284
|
+
}), "disabled" in i && (i.disabled = s);
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1224
1287
|
}
|
|
1225
|
-
Ce("arcgis-solutions-assistant",
|
|
1288
|
+
Ce("arcgis-solutions-assistant", Xt);
|
|
1226
1289
|
export {
|
|
1227
|
-
|
|
1290
|
+
Xt as ArcgisSolutionsAssistant
|
|
1228
1291
|
};
|