@esri/solutions-components 5.1.0-next.155 → 5.1.0-next.157

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 (44) hide show
  1. package/dist/cdn/{G4ADX65Y.js → 6RTL3IJQ.js} +1 -1
  2. package/dist/cdn/{5KWJUQRY.js → 7CZG6NDM.js} +1 -1
  3. package/dist/cdn/{CEPWTLDN.js → 7NKBQ4G6.js} +1 -1
  4. package/dist/cdn/{MDXI36JJ.js → BYGOJ5ML.js} +141 -138
  5. package/dist/cdn/{TM6TYAW2.js → CNGHMKQK.js} +24 -24
  6. package/dist/cdn/{CSAXBV46.js → DQ7I7HGP.js} +1 -1
  7. package/dist/cdn/E4BPYNC5.js +4 -0
  8. package/dist/cdn/EKRMEQQI.js +2 -0
  9. package/dist/cdn/EW4MNCWO.js +2 -0
  10. package/dist/cdn/EZ5PKNLU.js +2 -0
  11. package/dist/cdn/HDTRW7I6.js +4 -0
  12. package/dist/cdn/{M3NML7ZV.js → IMJTIIHG.js} +1 -1
  13. package/dist/cdn/{CPBEDBQJ.js → JAYARGS3.js} +1 -1
  14. package/dist/cdn/LZTAD4IE.js +2 -0
  15. package/dist/cdn/{QSGVCMF2.js → OL5LAOD5.js} +1 -1
  16. package/dist/cdn/{QCNGBMWJ.js → PBENK36A.js} +1 -1
  17. package/dist/cdn/{PJTHEJG4.js → QCXOGAWW.js} +1 -1
  18. package/dist/cdn/{2K4FSWCI.js → R7A62RZ4.js} +1 -1
  19. package/dist/cdn/{QU25YPPX.js → ZZJHOJM5.js} +1 -1
  20. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
  21. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
  22. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.en.json +1 -1
  23. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.json +1 -1
  24. package/dist/cdn/index.js +1 -1
  25. package/dist/chunks/solution-builder-assistant.js +3 -3
  26. package/dist/chunks/updateDesign.js +1 -1
  27. package/dist/components/arcgis-solutions-assistant/customElement.d.ts +6 -0
  28. package/dist/components/arcgis-solutions-assistant/customElement.js +81 -67
  29. package/dist/components/create-feature/customElement.js +101 -74
  30. package/dist/components/crowdsource-reporter/customElement.d.ts +6 -2
  31. package/dist/components/crowdsource-reporter/customElement.js +1 -1
  32. package/dist/components/solutions-deploy-app/customElement.d.ts +8 -0
  33. package/dist/components/solutions-deploy-app/customElement.js +19 -19
  34. package/dist/docs/api.json +1 -1
  35. package/dist/docs/docs.json +1 -1
  36. package/dist/docs/web-types.json +1 -1
  37. package/dist/solutions-components_commit.txt +6 -6
  38. package/package.json +1 -1
  39. package/dist/cdn/6Y47Z4QA.js +0 -4
  40. package/dist/cdn/GYTMAAVH.js +0 -2
  41. package/dist/cdn/ON244IGD.js +0 -2
  42. package/dist/cdn/OVKPT3QA.js +0 -2
  43. package/dist/cdn/WFWEWVGR.js +0 -2
  44. package/dist/cdn/WUKFT5AY.js +0 -4
@@ -1,23 +1,23 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as Ae } from "../../chunks/runtime.js";
3
3
  import { u as Le } from "../../chunks/useT9n.js";
4
- import { LitElement as $e, createEvent as se, nothing as ie } from "@arcgis/lumina";
4
+ import { LitElement as $e, createEvent as ie, nothing as ne } from "@arcgis/lumina";
5
5
  import { css as Fe, html as C } from "lit";
6
6
  import { unsafeHTML as Re } from "lit/directives/unsafe-html.js";
7
- import { useContextConsumer as ne } from "@arcgis/lumina/context";
7
+ import { useContextConsumer as ae } from "@arcgis/lumina/context";
8
8
  import { c as De, b as Ne } from "../../chunks/deployAppContexts.js";
9
9
  import { T as R } from "../../chunks/interfaces.js";
10
10
  import { m as Me } from "../../chunks/helpers.js";
11
- import ae from "@arcgis/core/config.js";
11
+ import O from "@arcgis/core/config.js";
12
12
  import { createRef as Be, ref as Pe } from "lit-html/directives/ref.js";
13
- import { Annotation as y, StateGraph as J, START as G, END as S, NodeInterrupt as re } from "@langchain/langgraph/web";
14
- import { createAgentRuntimeState as H, sendTraceMessage as w, invokeStructuredPrompt as k, getEmbeddings as qe, cosineSimilarity as Ue, invokeTextPrompt as Oe } from "@arcgis/ai-orchestrator";
13
+ import { Annotation as y, StateGraph as G, START as H, END as S, NodeInterrupt as re } from "@langchain/langgraph/web";
14
+ import { createAgentRuntimeState as W, sendTraceMessage as w, invokeStructuredPrompt as k, getEmbeddings as qe, cosineSimilarity as Ue, invokeTextPrompt as Oe } from "@arcgis/ai-orchestrator";
15
15
  import r, { z as D } from "zod";
16
- import * as W from "@esri/arcgis-rest-portal";
16
+ import * as Q from "@esri/arcgis-rest-portal";
17
17
  import { applyPatch as ze } from "fast-json-patch";
18
18
  import "@langchain/core/messages";
19
19
  import { C as le } from "../../chunks/converter.js";
20
- import { v as O, b as z, S as je, g as Ve } from "../../chunks/validators.js";
20
+ import { v as z, b as j, S as je, g as Ve } from "../../chunks/validators.js";
21
21
  import { t as ce, g as P, c as de, r as ue, d as $ } from "../../chunks/templates.js";
22
22
  import Je from "@arcgis/core/portal/Portal.js";
23
23
  import Ge from "@arcgis/core/portal/PortalItem.js";
@@ -101,7 +101,7 @@ function Ye(t) {
101
101
  function ge(t) {
102
102
  return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
103
103
  }
104
- async function V(t, e, s) {
104
+ async function J(t, e, s) {
105
105
  const i = await fetch(e, {
106
106
  method: "POST",
107
107
  headers: {
@@ -119,7 +119,7 @@ const Xe = (t) => new Promise((e) => setTimeout(e, t)), Ze = y.Root({
119
119
  // channels with the orchestrator's standard reducers/defaults so the
120
120
  // sub-agent reports back through the same shape the orchestrator
121
121
  // persists into priorSteps.
122
- ...H(),
122
+ ...W(),
123
123
  solutionResponse: y({
124
124
  reducer: (t, e) => e ?? null,
125
125
  default: () => null
@@ -135,7 +135,7 @@ const Xe = (t) => new Promise((e) => setTimeout(e, t)), Ze = y.Root({
135
135
  reducer: (t, e) => e ?? t,
136
136
  default: () => null
137
137
  })
138
- }), et = () => new J(Ze).addNode("initializeAgent", st).addNode("askSolutionsQuestions", tt).addEdge(G, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", S), he = async (t, e, s, i) => {
138
+ }), et = () => new G(Ze).addNode("initializeAgent", st).addNode("askSolutionsQuestions", tt).addEdge(H, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", S), he = async (t, e, s, i) => {
139
139
  if (!t) return;
140
140
  const n = ge(t);
141
141
  if (!n) return;
@@ -149,7 +149,7 @@ const Xe = (t) => new Promise((e) => setTimeout(e, t)), Ze = y.Root({
149
149
  }
150
150
  }
151
151
  } };
152
- i && (o.conversationId = i), V(o, n, e ?? "");
152
+ i && (o.conversationId = i), J(o, n, e ?? "");
153
153
  }, tt = async (t, e) => {
154
154
  if (e?.configurable?.abortSignal?.aborted)
155
155
  return {};
@@ -159,7 +159,7 @@ const Xe = (t) => new Promise((e) => setTimeout(e, t)), Ze = y.Root({
159
159
  { text: s.agentProgress.explorerAgentSearching },
160
160
  e
161
161
  );
162
- let a = await V(
162
+ let a = await J(
163
163
  {
164
164
  message: t.agentExecutionContext.userRequest,
165
165
  conversationId: e?.configurable?.context?.convoId ?? void 0,
@@ -205,7 +205,7 @@ const Xe = (t) => new Promise((e) => setTimeout(e, t)), Ze = y.Root({
205
205
  for (await u(a); o.hasMore; ) {
206
206
  if (e?.configurable?.abortSignal?.aborted)
207
207
  return {};
208
- await Xe(500), a = await V(
208
+ await Xe(500), a = await J(
209
209
  {
210
210
  conversationId: o.conversationId,
211
211
  ackSequenceNumber: o.ackSequenceNumber,
@@ -311,9 +311,9 @@ class be {
311
311
  }
312
312
  }
313
313
  validateSolutionProps() {
314
- const e = this.response.solution.title, s = this.response.solution.description, i = O(e ?? "");
314
+ const e = this.response.solution.title, s = this.response.solution.description, i = z(e ?? "");
315
315
  if (i.isValid || this.logIssue(`Solution title is invalid (${i.errorType}).`), s) {
316
- const n = z(s, 2048);
316
+ const n = j(s, 2048);
317
317
  n.isValid || this.logIssue(`Solution description is invalid (${n.errorType}).`);
318
318
  }
319
319
  }
@@ -324,9 +324,9 @@ class be {
324
324
  ]);
325
325
  for (const s of this.response.items) {
326
326
  e.has(s.type) && s.title.length > 100 && this.logIssue(`Service name '${s.title}' exceeds 100 characters.`);
327
- const i = O(s.title ?? "");
327
+ const i = z(s.title ?? "");
328
328
  if (i.isValid || this.logIssue(`Item '${s.id}' title is invalid (${i.errorType}).`), s.description) {
329
- const n = z(s.description, 2048);
329
+ const n = j(s.description, 2048);
330
330
  n.isValid || this.logIssue(`Item '${s.id}' description is invalid (${n.errorType}).`);
331
331
  }
332
332
  }
@@ -351,9 +351,9 @@ class be {
351
351
  !s && e.typeMutable === !0 && e.type === "Table" && this.logIssue(
352
352
  `Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`
353
353
  );
354
- const i = O(e.name ?? "");
354
+ const i = z(e.name ?? "");
355
355
  if (i.isValid || this.logIssue(`Layer '${e.name}' name is invalid (${i.errorType}).`), e.description) {
356
- const n = z(e.description, 2048);
356
+ const n = j(e.description, 2048);
357
357
  n.isValid || this.logIssue(`Layer '${e.name}' description is invalid (${n.errorType}).`);
358
358
  }
359
359
  this.validateLayerFields(e);
@@ -420,7 +420,7 @@ class be {
420
420
  e.name = `${n}_`, console.debug(`Field '${n}' is a SQL reserved keyword. Auto-fixing to '${e.name}'.`);
421
421
  } else
422
422
  this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`);
423
- if (e.type === "string" && (typeof e.length != "number" || Number.isNaN(e.length) ? this.logIssue(`Field '${e.name}' length is invalid (must be a number between 1 and 4000).`) : Ve(e.length).isValid || this.logIssue(`Field '${e.name}' length is invalid (must be a number between 1 and 4000).`)), Array.isArray(e.choiceList) && (e.type !== "string" && this.logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`), e.choiceList.length || this.logIssue(`Field '${e.name}' has an empty domain. At least one value is required.`), e.choiceList.some((n) => !n?.trim()) && this.logIssue(`A blank domain value was added to Field '${e.name}'.`), e.choiceList.length !== new Set(e.choiceList).size && this.logIssue(`Field '${e.name}' has duplicate domain values.`), e.length != null)) {
423
+ if (e.type === "string" && this.validateStringFieldLength(e), Array.isArray(e.choiceList) && (e.type !== "string" && this.logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`), e.choiceList.length || this.logIssue(`Field '${e.name}' has an empty domain. At least one value is required.`), e.choiceList.some((n) => !n?.trim()) && this.logIssue(`A blank domain value was added to Field '${e.name}'.`), e.choiceList.length !== new Set(e.choiceList).size && this.logIssue(`Field '${e.name}' has duplicate domain values.`), e.length != null)) {
424
424
  const n = Math.max(...e.choiceList.map((a) => a.length));
425
425
  n > e.length && (this.newDesign ? (console.debug(`The choice provided for field '${e.name}' is too long. It must fit within ${e.length} characters, but the choice requires ${n} characters. Auto-fixing to ${n}.`), e.length = n) : this.logIssue(`The choice provided for field '${e.name}' is too long. It must fit within ${e.length} characters, but the choice requires ${n} characters.`));
426
426
  }
@@ -428,6 +428,20 @@ class be {
428
428
  logIssue(e) {
429
429
  console.debug(e), this.issues.push(e), this.isValid = !1;
430
430
  }
431
+ validateStringFieldLength(e) {
432
+ if (this.newDesign && e.length === 255 && (e.length = 256), typeof e.length != "number" || Number.isNaN(e.length)) {
433
+ this.handleInvalidStringFieldLength(e, 256);
434
+ return;
435
+ }
436
+ const s = e.length;
437
+ if (!Ve(s).isValid) {
438
+ const n = s > 4e3 ? 4e3 : 256;
439
+ this.handleInvalidStringFieldLength(e, n);
440
+ }
441
+ }
442
+ handleInvalidStringFieldLength(e, s) {
443
+ this.newDesign ? (console.debug(`Field '${e.name}' has an invalid length. Auto-fixing to ${s}.`), e.length = s) : this.logIssue(`Field '${e.name}' length is invalid (must be a number between 1 and 4000).`);
444
+ }
431
445
  }
432
446
  const ct = r.object({
433
447
  key: r.string().describe("Stable key identifier for the string."),
@@ -477,7 +491,7 @@ const ct = r.object({
477
491
  itemId: r.string().describe("ArcGIS item id for the feature layer."),
478
492
  addLayers: r.boolean().describe("Indicates whether new layers can be added during solution design."),
479
493
  layers: r.array(ut)
480
- }), Q = r.object({
494
+ }), K = r.object({
481
495
  response: r.string().describe("Conversational response to the user's query."),
482
496
  solution: r.object({
483
497
  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."),
@@ -539,8 +553,8 @@ const ct = r.object({
539
553
  { error: o }
540
554
  ), n;
541
555
  }
542
- }, K = (t) => t in $, St = 5, It = 0.8, Ct = 0.15, _t = "Web Mapping Application", Tt = "Embeddings";
543
- let N = null, j = null, M = null, B = null;
556
+ }, Y = (t) => t in $, St = 5, It = 0.8, Ct = 0.15, _t = "Web Mapping Application", Tt = "Embeddings";
557
+ let N = null, V = null, M = null, B = null;
544
558
  const kt = "Build", _ = /* @__PURE__ */ Object.assign({
545
559
  "./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
546
560
  "./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((t) => t.default),
@@ -556,7 +570,7 @@ const kt = "Build", _ = /* @__PURE__ */ Object.assign({
556
570
  }, At = async (t, e, s) => {
557
571
  if (!t) return null;
558
572
  const i = `type:"${_t}" AND typekeywords:${Tt} AND group:${t}`;
559
- return (await W.searchItems({
573
+ return (await Q.searchItems({
560
574
  q: i,
561
575
  params: e ? { token: e } : void 0,
562
576
  portal: s,
@@ -577,7 +591,7 @@ async function Lt(t, e, s, i) {
577
591
  const $t = async (t, e, s) => {
578
592
  if (!t) return [];
579
593
  const i = `type:Solution AND typekeywords:${kt} AND group:${t}`;
580
- return (await W.searchItems({
594
+ return (await Q.searchItems({
581
595
  q: i,
582
596
  params: e ? { token: e } : void 0,
583
597
  portal: s,
@@ -585,7 +599,7 @@ const $t = async (t, e, s) => {
585
599
  }))?.results ?? [];
586
600
  }, Ft = async (t, e, s) => {
587
601
  try {
588
- const i = await W.getItemData(t, {
602
+ const i = await Q.getItemData(t, {
589
603
  params: e ? { token: e } : void 0,
590
604
  portal: s
591
605
  }), n = i?.buildSolution;
@@ -625,9 +639,9 @@ const $t = async (t, e, s) => {
625
639
  error: s instanceof Error ? s.stack ?? s.message : String(s)
626
640
  };
627
641
  }
628
- }, Y = async (t) => {
629
- if (j) {
630
- Object.entries(j).forEach(([o, l]) => {
642
+ }, X = async (t) => {
643
+ if (V) {
644
+ Object.entries(V).forEach(([o, l]) => {
631
645
  $[o] && ($[o].initialTemplate = l);
632
646
  });
633
647
  return;
@@ -666,7 +680,7 @@ const $t = async (t, e, s) => {
666
680
  ...l,
667
681
  initialTemplate: a[u]
668
682
  };
669
- })), j = a);
683
+ })), V = a);
670
684
  }, xe = (t) => {
671
685
  const e = t?.configurable?.context?.token;
672
686
  return typeof e != "string" || !e.trim() ? null : e;
@@ -680,7 +694,7 @@ const $t = async (t, e, s) => {
680
694
  }, Rt = async (t) => {
681
695
  await Promise.all([
682
696
  Ce(t),
683
- Y(t)
697
+ X(t)
684
698
  ]);
685
699
  }, Ie = async (t) => {
686
700
  const e = xe(t);
@@ -711,10 +725,10 @@ Description: ${e.description}`).join(`
711
725
  const s = JSON.parse(e), i = T(
712
726
  { response: "", ...s },
713
727
  { itemId: s?.solution?.itemId ?? null }
714
- ), n = Q.safeParse(i);
728
+ ), n = K.safeParse(i);
715
729
  if (!n.success)
716
730
  return null;
717
- const { response: a, ...o } = n.data, l = s.templateId, u = typeof l == "string" && K(l) ? l : null;
731
+ const { response: a, ...o } = n.data, l = s.templateId, u = typeof l == "string" && Y(l) ? l : null;
718
732
  return T(
719
733
  o,
720
734
  {
@@ -727,7 +741,7 @@ Description: ${e.description}`).join(`
727
741
  return null;
728
742
  }
729
743
  }, Mt = y.Root({
730
- ...H(),
744
+ ...W(),
731
745
  /** Optional human-readable template description retained for UI use. */
732
746
  templateDescription: y({
733
747
  reducer: (t, e) => typeof e == "string" || e === null ? e : t ?? null,
@@ -780,7 +794,7 @@ Description: ${e.description}`).join(`
780
794
  messages: n,
781
795
  inputVariables: { query: s, availableTemplates: i }
782
796
  }), o = a.matchedTemplates.filter(
783
- (d) => K(d.templateId)
797
+ (d) => Y(d.templateId)
784
798
  ), l = {
785
799
  ...a,
786
800
  matchedTemplates: o
@@ -835,7 +849,7 @@ Description: ${e.description}`).join(`
835
849
  if (h(e))
836
850
  return {};
837
851
  const { hitlResponse: s } = e.configurable, i = "selectTemplate", n = t.assessment?.matchedTemplates.filter(
838
- (c) => K(c.templateId)
852
+ (c) => Y(c.templateId)
839
853
  ) ?? [], a = n.map((c) => `${c.templateDescription}`);
840
854
  if (s?.agentId !== "solutionBuilder" || s.id !== i) {
841
855
  const c = {
@@ -921,7 +935,7 @@ Description: ${d.description}`).join(`
921
935
  const { currentDesign: s } = t, i = t.agentExecutionContext.userRequest;
922
936
  await w({ text: f("creatingDesign", e) }, e);
923
937
  let n = P(t.selectedTemplate);
924
- if (n?.initialTemplate || (await Y(e), n = P(t.selectedTemplate)), h(e))
938
+ if (n?.initialTemplate || (await X(e), n = P(t.selectedTemplate)), h(e))
925
939
  return {};
926
940
  if (!n?.initialTemplate)
927
941
  throw new Error("No hydrated templates are available for solution design.");
@@ -936,7 +950,7 @@ Description: ${d.description}`).join(`
936
950
  promptText: await v(_, "designSolution"),
937
951
  modelTier: "advanced",
938
952
  temperature: 0,
939
- schema: Q,
953
+ schema: K,
940
954
  messages: o,
941
955
  inputVariables: {
942
956
  currentDesign: JSON.stringify(de(a)),
@@ -1025,8 +1039,8 @@ Description: ${d.description}`).join(`
1025
1039
  try {
1026
1040
  return JSON.parse(p);
1027
1041
  } catch {
1028
- const x = p.replace(/[\u0000-\u001F]/g, (te) => {
1029
- switch (te) {
1042
+ const x = p.replace(/[\u0000-\u001F]/g, (se) => {
1043
+ switch (se) {
1030
1044
  case "\b":
1031
1045
  return "\\b";
1032
1046
  case "\f":
@@ -1039,7 +1053,7 @@ Description: ${d.description}`).join(`
1039
1053
  case " ":
1040
1054
  return "\\t";
1041
1055
  default:
1042
- return "\\u" + te.charCodeAt(0).toString(16).padStart(4, "0");
1056
+ return "\\u" + se.charCodeAt(0).toString(16).padStart(4, "0");
1043
1057
  }
1044
1058
  });
1045
1059
  try {
@@ -1073,7 +1087,7 @@ Description: ${d.description}`).join(`
1073
1087
  const d = T(
1074
1088
  { response: "", ...b },
1075
1089
  { itemId: s.solution?.itemId ?? null }
1076
- ), g = Q.safeParse(d);
1090
+ ), g = K.safeParse(d);
1077
1091
  if (!g.success) {
1078
1092
  console.warn(
1079
1093
  "[SolutionBuilder] updateDesign schema validation failed:",
@@ -1099,7 +1113,7 @@ Description: ${d.description}`).join(`
1099
1113
  }
1100
1114
  );
1101
1115
  let F = P(t.selectedTemplate);
1102
- if (F?.initialTemplate || (await Y(e), F = P(t.selectedTemplate)), h(e))
1116
+ if (F?.initialTemplate || (await X(e), F = P(t.selectedTemplate)), h(e))
1103
1117
  return {};
1104
1118
  if (!F?.initialTemplate)
1105
1119
  throw new Error("No hydrated templates are available for solution design.");
@@ -1122,11 +1136,11 @@ Description: ${d.description}`).join(`
1122
1136
  status: "success"
1123
1137
  };
1124
1138
  }
1125
- const Ee = I.sourceBuildSolution, ee = ve(I, Ee);
1126
- if (!ee.ok) {
1139
+ const Ee = I.sourceBuildSolution, te = ve(I, Ee);
1140
+ if (!te.ok) {
1127
1141
  console.warn(
1128
1142
  "[SolutionBuilder] updateDesign Esri JSON conversion failed:",
1129
- { error: ee.error, llmResponse: a, design: I }
1143
+ { error: te.error, llmResponse: a, design: I }
1130
1144
  );
1131
1145
  const p = f("applyChangeFailed", e);
1132
1146
  return {
@@ -1141,7 +1155,7 @@ Description: ${d.description}`).join(`
1141
1155
  status: "success",
1142
1156
  currentDesign: I
1143
1157
  });
1144
- }, Ht = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Wt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Qt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Kt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Yt = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Xt = () => new J(Mt).addNode("syncCurrentDesignFromContext", Bt).addNode("assessBuildRequest", Pt).addNode("assessUpdateRequest", Ut).addNode("invalidBuildExit", qt).addNode("invalidUpdateExit", Ot).addNode("selectTemplateHIL", zt).addNode("findExistingSolutions", jt).addNode("confirmContinueBuildingHIL", Vt).addNode("declineContinueBuildingExit", Jt).addNode("designSolution", _e).addNode("updateDesign", Gt).addEdge(G, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Ht, {
1158
+ }, Ht = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Wt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Qt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Kt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Yt = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Xt = () => new G(Mt).addNode("syncCurrentDesignFromContext", Bt).addNode("assessBuildRequest", Pt).addNode("assessUpdateRequest", Ut).addNode("invalidBuildExit", qt).addNode("invalidUpdateExit", Ot).addNode("selectTemplateHIL", zt).addNode("findExistingSolutions", jt).addNode("confirmContinueBuildingHIL", Vt).addNode("declineContinueBuildingExit", Jt).addNode("designSolution", _e).addNode("updateDesign", Gt).addEdge(H, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Ht, {
1145
1159
  assessUpdateRequest: "assessUpdateRequest",
1146
1160
  assessBuildRequest: "assessBuildRequest"
1147
1161
  }).addConditionalEdges("assessUpdateRequest", Wt, {
@@ -1163,17 +1177,17 @@ const Zt = D.object({
1163
1177
  tool: D.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
1164
1178
  confidence: D.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
1165
1179
  rationale: D.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)")
1166
- }), X = /* @__PURE__ */ Object.assign({
1180
+ }), Z = /* @__PURE__ */ Object.assign({
1167
1181
  "./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
1168
1182
  "./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
1169
1183
  "./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
1170
- }), Z = (t) => {
1184
+ }), ee = (t) => {
1171
1185
  const e = new CustomEvent("assistantProcessing", {
1172
1186
  detail: { finished: !0, agent: t }
1173
1187
  });
1174
1188
  window.dispatchEvent(e);
1175
1189
  }, Te = y.Root({
1176
- ...H(),
1190
+ ...W(),
1177
1191
  selectedTool: y({
1178
1192
  reducer: (t, e) => e ?? null,
1179
1193
  default: () => null
@@ -1198,7 +1212,7 @@ const Zt = D.object({
1198
1212
  } catch {
1199
1213
  o = !1;
1200
1214
  }
1201
- const l = await v(X, "classifyIntent"), u = await k({
1215
+ const l = await v(Z, "classifyIntent"), u = await k({
1202
1216
  promptText: l,
1203
1217
  modelTier: "advanced",
1204
1218
  temperature: 0,
@@ -1214,12 +1228,12 @@ const Zt = D.object({
1214
1228
  if (e?.configurable?.abortSignal?.aborted)
1215
1229
  return {};
1216
1230
  const i = await et().compile().invoke(t, e);
1217
- return Z("explorer"), i;
1231
+ return ee("explorer"), i;
1218
1232
  }, ss = async (t, e) => {
1219
1233
  if (e?.configurable?.abortSignal?.aborted)
1220
1234
  return {};
1221
1235
  const i = await Xt().compile().invoke(t, e);
1222
- return Z("builder"), i;
1236
+ return ee("builder"), i;
1223
1237
  }, is = async (t, e) => {
1224
1238
  if (e?.configurable?.abortSignal?.aborted)
1225
1239
  return {};
@@ -1228,23 +1242,23 @@ const Zt = D.object({
1228
1242
  { text: s?.executingSolutionsAssistantAgent },
1229
1243
  e
1230
1244
  );
1231
- const a = await v(X, "assistantResponse"), o = t.agentExecutionContext.messages.slice(-11), l = await Oe({
1245
+ const a = await v(Z, "assistantResponse"), o = t.agentExecutionContext.messages.slice(-11), l = await Oe({
1232
1246
  promptText: a,
1233
1247
  modelTier: "advanced",
1234
1248
  temperature: 0,
1235
1249
  messages: o,
1236
1250
  inputVariables: { query: i, rationale: n }
1237
1251
  });
1238
- return Z("assistant"), {
1252
+ return ee("assistant"), {
1239
1253
  outputMessage: l,
1240
1254
  summary: l,
1241
1255
  status: "success"
1242
1256
  };
1243
- }, ns = (t) => t.selectedTool ?? "other", as = () => new J(Te).addNode("classifyIntent", es).addNode("routeToExplorer", ts).addNode("routeToBuilder", ss).addNode("assistantResponse", is).addEdge(G, "classifyIntent").addConditionalEdges("classifyIntent", ns, {
1257
+ }, ns = (t) => t.selectedTool ?? "other", as = () => new G(Te).addNode("classifyIntent", es).addNode("routeToExplorer", ts).addNode("routeToBuilder", ss).addNode("assistantResponse", is).addEdge(H, "classifyIntent").addConditionalEdges("classifyIntent", ns, {
1244
1258
  explorer: "routeToExplorer",
1245
1259
  builder: "routeToBuilder",
1246
1260
  other: "assistantResponse"
1247
- }).addEdge("routeToExplorer", S).addEdge("routeToBuilder", S).addEdge("assistantResponse", S), os = await v(X, "description"), rs = {
1261
+ }).addEdge("routeToExplorer", S).addEdge("routeToBuilder", S).addEdge("assistantResponse", S), os = await v(Z, "description"), rs = {
1248
1262
  id: "solutionsAssistant",
1249
1263
  name: "Solutions Assistant Agent",
1250
1264
  description: os,
@@ -1257,13 +1271,13 @@ class ds extends $e {
1257
1271
  aiAssistantsEnabled: !1,
1258
1272
  blockBetaApps: !0,
1259
1273
  colocateCompute: !1
1260
- }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Le({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._showNewChatConfirm = !1, this._assistantRef = Be(), this._configContextConsumer = ne({
1274
+ }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Le({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._showNewChatConfirm = !1, this._assistantRef = Be(), this._configContextConsumer = ae({
1261
1275
  context: De,
1262
1276
  subscribe: !0,
1263
1277
  callback: (e) => {
1264
- e?.portalURL && (ae.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
1278
+ e?.portalURL && (O.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
1265
1279
  }
1266
- }), this._builderDesignContextConsumer = ne({
1280
+ }), this._builderDesignContextConsumer = ae({
1267
1281
  context: Ne,
1268
1282
  subscribe: !0,
1269
1283
  callback: (e) => {
@@ -1282,7 +1296,7 @@ class ds extends $e {
1282
1296
  metrics: [i]
1283
1297
  }), this._chatStartTime = null, this.assistantProcessing.emit(!1);
1284
1298
  }
1285
- }, this.closeAssistant = se(), this.assistantProcessing = se(), this._handleAssistantLinkClick = (e) => {
1299
+ }, this.closeAssistant = ie(), this.assistantProcessing = ie(), this._handleAssistantLinkClick = (e) => {
1286
1300
  const s = e.composedPath().find((i) => i instanceof HTMLAnchorElement);
1287
1301
  if (s?.href)
1288
1302
  if (e.preventDefault(), s.target.indexOf("solutionId:") > -1) {
@@ -1323,7 +1337,7 @@ class ds extends $e {
1323
1337
  this._checkURLOpenParameter();
1324
1338
  }
1325
1339
  load() {
1326
- this._configContextConsumer.value?.portalURL && (ae.portalUrl = this._configContextConsumer.value.portalURL);
1340
+ O.applicationName = "Solutions", this._configContextConsumer.value?.portalURL && (O.portalUrl = this._configContextConsumer.value.portalURL);
1327
1341
  }
1328
1342
  firstUpdated(e) {
1329
1343
  this._loadUserFirstName();
@@ -1332,7 +1346,7 @@ class ds extends $e {
1332
1346
  e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (he(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;
1333
1347
  }
1334
1348
  _renderNoSign() {
1335
- return C`<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 ?? ie} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1349
+ return C`<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 ?? ne} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1336
1350
  }
1337
1351
  _renderNoPermission() {
1338
1352
  return C`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Re(this._translations.noPermissionMessage.replace("{{orgUrl}}", ls).replace("{{configAI}}", cs))}</div></calcite-notice>`;
@@ -1345,7 +1359,7 @@ class ds extends $e {
1345
1359
  action: "Toggle Builder Panel",
1346
1360
  dimensions: [this.builderVisible ? "Close" : "Open"]
1347
1361
  }), window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
1348
- }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && C`<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 ?? ie} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1362
+ }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && C`<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 ?? ne} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1349
1363
  console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0, this._chatStartTime = Date.now(), this.assistantProcessing.emit(!0);
1350
1364
  }} @arcgisFeedback=${(s) => {
1351
1365
  s.detail;
@@ -1369,15 +1383,15 @@ class ds extends $e {
1369
1383
  clearSuggestedPrompts: () => {
1370
1384
  this._suggestedPrompts = [];
1371
1385
  }
1372
- }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}${this._showNewChatConfirm && C`<calcite-dialog close-disabled escape-disabled heading="Start new conversation" modal open>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${() => {
1386
+ }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}${this._showNewChatConfirm && C`<calcite-dialog close-disabled escape-disabled .heading=${this._translations.newConversationConfirmTitle} modal open outside-close-disabled>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${() => {
1373
1387
  this._showNewChatConfirm = !1;
1374
- }} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
1388
+ }} slot=footer-end>${this._translations.cancel}</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
1375
1389
  this._telemetry?.logEvent({
1376
1390
  category: R.ASSISTANT,
1377
1391
  action: "New Chat",
1378
1392
  dimensions: ["With Design Discard"]
1379
1393
  }), this._showNewChatConfirm = !1, window.dispatchEvent(new CustomEvent("requestBuilderDiscard"));
1380
- }} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>` || ""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1394
+ }} slot=footer-end>${this._translations.discard}</calcite-button></calcite-dialog>` || ""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1381
1395
  this.closeAssistant.emit(!0);
1382
1396
  }} 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>`;
1383
1397
  }