@esri/solutions-components 5.1.0-next.165 → 5.1.0-next.166

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 (85) hide show
  1. package/dist/cdn/{YW2WMW6B.js → 25QYS4LE.js} +1 -1
  2. package/dist/cdn/{CV4B2O7J.js → 2BI4S6V2.js} +1 -1
  3. package/dist/cdn/{UDPMO6YN.js → 2BRPSISV.js} +1 -1
  4. package/dist/cdn/{S37TPZAO.js → 2LCG2XWX.js} +1 -1
  5. package/dist/cdn/{ATEW4U4A.js → 2VG5GRFH.js} +1 -1
  6. package/dist/cdn/{26LDC3OX.js → 2YC25V3L.js} +1 -1
  7. package/dist/cdn/{OUMIC7G7.js → 3FKVBTJC.js} +1 -1
  8. package/dist/cdn/{3J5ZSELO.js → 46I7FRQJ.js} +1 -1
  9. package/dist/cdn/{HRQVJBRJ.js → 66N4ZZKC.js} +1 -1
  10. package/dist/cdn/{EUI6UDCN.js → 6WPQPRJ5.js} +8 -2
  11. package/dist/cdn/{GVMTSUDH.js → 7P57UVVG.js} +1 -1
  12. package/dist/cdn/{5W7G3TSG.js → 7X2SPNNK.js} +21 -19
  13. package/dist/cdn/{2D6HFQD5.js → AFLXI5U2.js} +1 -1
  14. package/dist/cdn/{4HRGPGDM.js → BT3FYIEX.js} +1 -1
  15. package/dist/cdn/{A2A3RFJ6.js → C47WRU5U.js} +1 -1
  16. package/dist/cdn/{HAMYUUYZ.js → CDT6E3VG.js} +1 -1
  17. package/dist/cdn/CKWEF3KW.js +2 -0
  18. package/dist/cdn/{MFFM74RG.js → CVHZAZLS.js} +1 -1
  19. package/dist/cdn/{I4PBOBUM.js → DKZ4FZKK.js} +1 -1
  20. package/dist/cdn/{C4F2OOUL.js → G2H3X6NS.js} +1 -1
  21. package/dist/cdn/{3UCDO65S.js → GDUCH242.js} +1 -1
  22. package/dist/cdn/{JFPR5QIQ.js → GI33DSVT.js} +1 -1
  23. package/dist/cdn/{354D2K6F.js → GJWHFH2F.js} +1 -1
  24. package/dist/cdn/{OZ4IYASP.js → HOCCKT72.js} +1 -1
  25. package/dist/cdn/{HDMAFAEM.js → IVKRYKER.js} +1 -1
  26. package/dist/cdn/{6PZSOVYB.js → JGL4WYTO.js} +1 -1
  27. package/dist/cdn/{7VY3RI7C.js → JS2MTHHP.js} +1 -1
  28. package/dist/cdn/{SHEDDVHQ.js → K4LZRLGL.js} +1 -1
  29. package/dist/cdn/{FMPY32BG.js → K5ZYDQR7.js} +1 -1
  30. package/dist/cdn/{QH6PUU3Q.js → KD4IHPH6.js} +1 -6
  31. package/dist/cdn/{ITCC5G26.js → KWAQEZ3T.js} +2 -2
  32. package/dist/cdn/{QYCERRRZ.js → LXNQ32NZ.js} +1 -1
  33. package/dist/cdn/{SNZRQPXI.js → MFVXFKKM.js} +1 -1
  34. package/dist/cdn/{25HVM373.js → MVDJOENC.js} +1 -1
  35. package/dist/cdn/P5RZHVDH.js +2 -0
  36. package/dist/cdn/{22BT2PBE.js → PVPKXQBE.js} +12 -10
  37. package/dist/cdn/{OBCXHY24.js → QVUBUYP6.js} +1 -1
  38. package/dist/cdn/{AAUM57XI.js → RHAHQ4DB.js} +1 -1
  39. package/dist/cdn/{AYHTQTVS.js → RSCCUNJ4.js} +1 -1
  40. package/dist/cdn/{W5TNQMAJ.js → RYJ556XB.js} +1 -1
  41. package/dist/cdn/{Y3GFBLXF.js → S5RB3GMN.js} +1 -1
  42. package/dist/cdn/SHQFXQEI.js +2 -0
  43. package/dist/cdn/{MOSQBUUZ.js → SJ2IGQMX.js} +1 -1
  44. package/dist/cdn/T26SIBKB.js +3 -0
  45. package/dist/cdn/{3SMHMC4L.js → TCRMAQDF.js} +1 -1
  46. package/dist/cdn/{JFMNVOWH.js → TFO2AK45.js} +1 -1
  47. package/dist/cdn/U76GHEKJ.js +71 -0
  48. package/dist/cdn/{6WVYNWVR.js → UEYON3AE.js} +1 -1
  49. package/dist/cdn/UIZL3C3H.js +2 -0
  50. package/dist/cdn/{ENXQ33P7.js → UTUOUV3E.js} +1 -1
  51. package/dist/cdn/{VN3AKGAY.js → VTFLDHVU.js} +1 -1
  52. package/dist/cdn/{WXDMML76.js → XLGAHCS7.js} +1 -1
  53. package/dist/cdn/{VBJJQPZT.js → XXCHYJ3I.js} +1 -1
  54. package/dist/cdn/{CU2JLCTZ.js → Y32IJPXS.js} +1 -1
  55. package/dist/cdn/{67CEWYTY.js → YPBSKBT2.js} +1 -1
  56. package/dist/cdn/YVWFYZTI.js +4 -0
  57. package/dist/cdn/{YLIWN2J2.js → YWX2U5OD.js} +1 -1
  58. package/dist/cdn/{ON4EBR25.js → Z7VXHUQA.js} +1 -1
  59. package/dist/cdn/{P666D4WT.js → ZOFZVFBV.js} +1 -1
  60. package/dist/cdn/ZSTC2DJY.js +2 -0
  61. package/dist/cdn/{DVPYGOBV.js → ZZOMKTFL.js} +1 -1
  62. package/dist/cdn/index.js +1 -1
  63. package/dist/chunks/assessBuildRequest.js +1 -6
  64. package/dist/chunks/assessUpdateRequest.js +21 -19
  65. package/dist/chunks/converter.js +75 -44
  66. package/dist/chunks/interfaces.js +26 -26
  67. package/dist/chunks/solution-builder-assistant.js +12 -14
  68. package/dist/chunks/transformQuery.js +1 -1
  69. package/dist/chunks/updateDesign.js +1 -1
  70. package/dist/components/arcgis-solutions-assistant/customElement.js +244 -224
  71. package/dist/components/solutions-deploy-app/customElement.js +1 -1
  72. package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
  73. package/dist/docs/api.json +1 -1
  74. package/dist/docs/docs.json +1 -1
  75. package/dist/docs/web-types.json +1 -1
  76. package/dist/solutions-components_commit.txt +8 -5
  77. package/package.json +1 -1
  78. package/dist/cdn/62GTPPV5.js +0 -2
  79. package/dist/cdn/OAUHQK3Y.js +0 -54
  80. package/dist/cdn/PGTLLFW6.js +0 -3
  81. package/dist/cdn/SIODWUWX.js +0 -2
  82. package/dist/cdn/SYISCXZY.js +0 -4
  83. package/dist/cdn/U27263JW.js +0 -2
  84. package/dist/cdn/U2FC3BET.js +0 -2
  85. package/dist/cdn/YEDC2OLI.js +0 -2
@@ -22,10 +22,10 @@ import { invokeStructuredPrompt as We } from "@arcgis/ai-orchestrator";
22
22
  import { t as me, g as q, c as he, r as ge, d as F } from "../../chunks/templates.js";
23
23
  import Xe from "@arcgis/core/portal/Portal.js";
24
24
  import Ye from "@arcgis/core/portal/PortalItem.js";
25
- const Ze = Me`: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)}`;
25
+ const Ze = Me`: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)}@media(resolution:1.25dppx),(resolution:1.75dppx){.chat-panel{margin-top:.5px}}.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)}`;
26
26
  async function v(s, e) {
27
27
  const t = Object.entries(s).find(
28
- ([n]) => n.endsWith(`/${e}.md`)
28
+ ([i]) => i.endsWith(`/${e}.md`)
29
29
  );
30
30
  if (!t)
31
31
  throw new Error(
@@ -42,7 +42,7 @@ function U(s) {
42
42
  function fe(s) {
43
43
  if (typeof window > "u" || s.length <= 1)
44
44
  return;
45
- const e = s.map((n) => n.solution.id), t = s.map((n) => n.solution.title);
45
+ const e = s.map((i) => i.solution.id), t = s.map((i) => i.solution.title);
46
46
  window.dispatchEvent(new CustomEvent("searchTermSet", {
47
47
  detail: {
48
48
  scope: "all-solutions",
@@ -82,25 +82,25 @@ function tt(s) {
82
82
  return s.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g, '<sup><a href="$2">&#91;$1&#93;</a></sup>');
83
83
  }
84
84
  function st(s) {
85
- return s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, (e, t, n) => `<img src="${n}" alt="${t}" style="width: 100%;">`);
85
+ return s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, (e, t, i) => `<img src="${i}" alt="${t}" style="width: 100%;">`);
86
86
  }
87
87
  function it(s, e) {
88
88
  const t = [];
89
- return (e?.configurable?.context?.configContext.allCards ?? []).forEach((i) => {
90
- const o = i.title;
89
+ return (e?.configurable?.context?.configContext.allCards ?? []).forEach((n) => {
90
+ const o = n.title;
91
91
  if (!o)
92
92
  return;
93
93
  const a = new RegExp(`(?<![\\p{L}\\p{N}])${o}(?![\\p{L}\\p{N}])`, "giu");
94
94
  let r = !1;
95
95
  s = s.replace(a, (c, d, h) => {
96
96
  const y = h.slice(0, d);
97
- return /<img[^>]*alt\s*=\s*["'][^"']*$/i.test(y) ? c : (r = !0, `<a href="" target="solutionId:${i.deployCommonId}">${o}</a>`);
97
+ return /<img[^>]*alt\s*=\s*["'][^"']*$/i.test(y) ? c : (r = !0, `<a href="" target="solutionId:${n.deployCommonId}">${o}</a>`);
98
98
  }), r && t.push({
99
99
  solution: {
100
- title: i.title,
101
- id: i.deployCommonId,
102
- snippet: i.snippet,
103
- description: i.description
100
+ title: n.title,
101
+ id: n.deployCommonId,
102
+ snippet: n.snippet,
103
+ description: n.description
104
104
  },
105
105
  score: 100
106
106
  });
@@ -113,7 +113,7 @@ function xe(s) {
113
113
  return s && s.helperServices.aiAssistantServices ? `${s.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
114
114
  }
115
115
  async function Q(s, e, t) {
116
- const n = await fetch(e, {
116
+ const i = await fetch(e, {
117
117
  method: "POST",
118
118
  headers: {
119
119
  "Content-Type": "application/json",
@@ -121,23 +121,23 @@ async function Q(s, e, t) {
121
121
  },
122
122
  body: JSON.stringify(s)
123
123
  });
124
- if (!n.ok)
125
- throw new Error(`HTTP ${n.status} calling ${e}`);
126
- return n.json();
124
+ if (!i.ok)
125
+ throw new Error(`HTTP ${i.status} calling ${e}`);
126
+ return i.json();
127
127
  }
128
128
  const ot = (s) => new Promise((e) => setTimeout(e, s));
129
129
  async function at(s, e) {
130
- const t = s.agentExecutionContext.userRequest, n = e?.configurable?.context?.lastTurnAgent, i = s.agentExecutionContext.messages ?? [];
131
- if (!n || i.length <= 1 || n === "explorer")
130
+ const t = s.agentExecutionContext.userRequest, i = e?.configurable?.context?.lastTurnAgent, n = s.agentExecutionContext.messages ?? [];
131
+ if (!i || n.length <= 1 || i === "explorer")
132
132
  return t;
133
133
  try {
134
134
  const o = await v(be, "transformQuery"), a = await k({
135
135
  promptText: o,
136
- modelTier: "fast",
136
+ modelTier: "advanced",
137
137
  temperature: 0,
138
138
  schema: et,
139
- messages: i.slice(-11),
140
- inputVariables: { query: t, lastTurnAgent: n }
139
+ messages: n.slice(-11),
140
+ inputVariables: { query: t, lastTurnAgent: i }
141
141
  });
142
142
  if (a.needsContext && a.rewrittenQuery.trim())
143
143
  return console.debug(`Rephrased query from "${t}" to "${a.rewrittenQuery.trim()}"`), a.rewrittenQuery.trim();
@@ -166,10 +166,10 @@ const rt = x.Root({
166
166
  reducer: (s, e) => e ?? s,
167
167
  default: () => null
168
168
  })
169
- }), lt = () => new K(rt).addNode("initializeAgent", ut).addNode("askSolutionsQuestions", ct).addEdge(W, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", A), ve = async (s, e, t, n) => {
169
+ }), lt = () => new K(rt).addNode("initializeAgent", ut).addNode("askSolutionsQuestions", ct).addEdge(W, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", A), ve = async (s, e, t, i) => {
170
170
  if (!s) return;
171
- const i = xe(s);
172
- if (!i) return;
171
+ const n = xe(s);
172
+ if (!n) return;
173
173
  const a = { context: {
174
174
  kind: "DocAIAssistantRequest",
175
175
  filters: {
@@ -180,12 +180,12 @@ const rt = x.Root({
180
180
  }
181
181
  }
182
182
  } };
183
- n && (a.conversationId = n), Q(a, i, e ?? "");
183
+ i && (a.conversationId = i), Q(a, n, e ?? "");
184
184
  }, ct = async (s, e) => {
185
185
  if (ce(e))
186
186
  return {};
187
- const t = U(e), n = s.documentSkillUrl;
188
- let i = [];
187
+ const t = U(e), i = s.documentSkillUrl;
188
+ let n = [];
189
189
  const o = await at(s, e);
190
190
  await _(
191
191
  { text: t.agentProgress.explorerAgentSearching },
@@ -206,7 +206,7 @@ const rt = x.Root({
206
206
  }
207
207
  }
208
208
  },
209
- n,
209
+ i,
210
210
  e?.configurable?.context?.token ?? ""
211
211
  );
212
212
  a.conversationId && e?.configurable?.context?.setConversationId && e.configurable.context.setConversationId(a.conversationId);
@@ -221,10 +221,10 @@ const rt = x.Root({
221
221
  const u = y.context?.results?.[0]?.reply ?? "";
222
222
  if (u !== "") {
223
223
  const S = tt(u), N = st(S), C = it(N, e);
224
- c = C.source, i = [
225
- ...i,
224
+ c = C.source, n = [
225
+ ...n,
226
226
  ...C.allMatches.filter(
227
- (z) => !i.some((I) => I.solution.id === z.solution.id)
227
+ (z) => !n.some((I) => I.solution.id === z.solution.id)
228
228
  )
229
229
  ];
230
230
  }
@@ -243,7 +243,7 @@ const rt = x.Root({
243
243
  ackSequenceNumber: r.ackSequenceNumber,
244
244
  inquiryId: r.inquiryId
245
245
  },
246
- n,
246
+ i,
247
247
  e?.configurable?.context?.token ?? ""
248
248
  ), r = {
249
249
  message: a.message,
@@ -258,7 +258,7 @@ const rt = x.Root({
258
258
  e?.configurable?.context.token ?? "",
259
259
  e?.configurable?.context.configContext.locale ?? "en",
260
260
  r.conversationId
261
- ), i.length && (i.length === 1 ? ye(i[0].solution.id) : fe(i)), {
261
+ ), n.length && (n.length === 1 ? ye(n[0].solution.id) : fe(n)), {
262
262
  outputMessage: c,
263
263
  summary: c,
264
264
  status: "success",
@@ -298,7 +298,7 @@ const we = (s) => {
298
298
  return s.id && (t.id = s.id), s.name && (t.name = s.name), s.additional_kwargs && (t.additional_kwargs = s.additional_kwargs), s.response_metadata && (t.response_metadata = s.response_metadata), t;
299
299
  }
300
300
  return { role: "human", content: String(s) };
301
- }, pt = (s) => we(s) === "human", mt = (s, e = 3) => s.filter((t) => pt(t)).slice(-e).map(dt), ht = (s, e = " ") => mt(s).map((i) => i.content).join(e).trim(), gt = { 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?" }, ft = {
301
+ }, pt = (s) => we(s) === "human", mt = (s, e = 3) => s.filter((t) => pt(t)).slice(-e).map(dt), ht = (s, e = " ") => mt(s).map((n) => n.content).join(e).trim(), gt = { 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?" }, ft = {
302
302
  builderMessages: gt
303
303
  };
304
304
  class b {
@@ -307,8 +307,8 @@ class b {
307
307
  // Public API
308
308
  //
309
309
  //--------------------------------------------------------------------------
310
- constructor(e, t, n = !0) {
311
- this.isValid = !0, this.issues = [], this.fieldNameRegistry = null, this.response = e, this.template = t, this.newDesign = n, this.validate();
310
+ constructor(e, t, i = !0) {
311
+ this.isValid = !0, this.issues = [], this.fieldNameRegistry = null, this.response = e, this.template = t, this.newDesign = i, this.validate();
312
312
  }
313
313
  static {
314
314
  this.INVALID_NAME_CHARS = /[><~`$^+=|]/gu;
@@ -357,13 +357,13 @@ class b {
357
357
  * downstream app discards them.
358
358
  */
359
359
  _compareStrings() {
360
- const e = new Set(this.response.solution.strings.map((i) => i.key)), t = new Map(this.template.solution.strings.map((i) => [i.key, i]));
361
- [...t.keys()].every((i) => e.has(i)) || (this.newDesign ? this._reconcileStringKeys() : this._logIssue("String keys in llm response do not match the template."));
362
- for (const i of this.response.solution.strings) {
363
- if (i.value)
360
+ const e = new Set(this.response.solution.strings.map((n) => n.key)), t = new Map(this.template.solution.strings.map((n) => [n.key, n]));
361
+ [...t.keys()].every((n) => e.has(n)) || (this.newDesign ? this._reconcileStringKeys() : this._logIssue("String keys in llm response do not match the template."));
362
+ for (const n of this.response.solution.strings) {
363
+ if (n.value)
364
364
  continue;
365
- const o = t.get(i.key)?.value;
366
- this.newDesign && o ? (i.value = o, this._logAutoFix(`String key '${i.key}' had no value. Auto-fixed by restoring the template value.`)) : this._logIssue(`String key '${i.key}' has no value in the design. It must be populated.`);
365
+ const o = t.get(n.key)?.value;
366
+ this.newDesign && o ? (n.value = o, this._logAutoFix(`String key '${n.key}' had no value. Auto-fixed by restoring the template value.`)) : this._logIssue(`String key '${n.key}' has no value in the design. It must be populated.`);
367
367
  }
368
368
  }
369
369
  /**
@@ -383,18 +383,36 @@ class b {
383
383
  * Otherwise, an issue is logged.
384
384
  */
385
385
  _compareItems() {
386
- const e = new Set(this.template.items.map((i) => i.id)), t = new Set(this.response.items.map((i) => i.id));
387
- e.size === t.size && [...e].every((i) => t.has(i)) || (this.newDesign ? this._reconcileItems() : this._logIssue("Item IDs in design do not match the template."));
386
+ const e = new Set(this.template.items.map((n) => n.id)), t = new Set(this.response.items.map((n) => n.id));
387
+ e.size === t.size && [...e].every((n) => t.has(n)) || (this.newDesign ? this._reconcileItems() : this._logIssue("Item IDs in design do not match the template."));
388
388
  }
389
389
  /**
390
390
  * Reconciles response items against the template (new-design only): removes
391
391
  * response items not present in the template and adds missing template items.
392
+ *
393
+ * Special case: when both sides have the same number of unique item ids and
394
+ * exactly one id differs, update that response item id in place to preserve
395
+ * any other user-edited properties on the item.
392
396
  */
393
397
  _reconcileItems() {
394
- const e = new Set(this.template.items.map((i) => i.id)), t = new Set(this.response.items.map((i) => i.id)), n = [...t].filter((i) => !e.has(i));
395
- n.length && (this.response.items = this.response.items.filter((i) => e.has(i.id)), this._logAutoFix(`Removed items not present in the template: ${n.join(", ")}.`));
396
- for (const i of this.template.items)
397
- t.has(i.id) || (this.response.items.push({ ...i }), this._logAutoFix(`Item '${i.id}' was missing from the design. Auto-fixed by adding it from the template.`));
398
+ const e = new Set(this.template.items.map((a) => a.id)), t = new Set(this.response.items.map((a) => a.id)), i = [...t].filter((a) => !e.has(a)), n = [...e].filter((a) => !t.has(a));
399
+ if (e.size === t.size && i.length === 1 && n.length === 1) {
400
+ const a = i[0], r = n[0], c = this.response.items.find((d) => d.id === a);
401
+ if (c) {
402
+ c.id = r, this._logAutoFix(`Item id '${a}' did not match the template id '${r}'. Auto-fixed in place.`);
403
+ return;
404
+ }
405
+ }
406
+ i.length && (this.response.items = this.response.items.filter((a) => e.has(a.id)), this._logAutoFix(`Removed items not present in the template: ${i.join(", ")}.`));
407
+ const o = this.template.items.filter((a) => !t.has(a.id));
408
+ if (o.length) {
409
+ this.response.items = [
410
+ ...o.map((a) => ({ ...a })),
411
+ ...this.response.items
412
+ ];
413
+ for (const a of o)
414
+ this._logAutoFix(`Item '${a.id}' was missing from the design. Auto-fixed by adding it from the template.`);
415
+ }
398
416
  }
399
417
  /**
400
418
  * Compares feature layer configuration between response and template.
@@ -402,12 +420,12 @@ class b {
402
420
  _compareFeatureLayers() {
403
421
  const e = this.template.featureLayer, t = this.response.featureLayer;
404
422
  if (e.itemId !== t.itemId) {
405
- const n = t.itemId;
406
- t.itemId = e.itemId, this._logAutoFix(`Feature Layer itemId '${n}' did not match the template. Auto-fixed to '${e.itemId}'.`);
423
+ const i = t.itemId;
424
+ t.itemId = e.itemId, this._logAutoFix(`Feature Layer itemId '${i}' did not match the template. Auto-fixed to '${e.itemId}'.`);
407
425
  }
408
426
  if (!e.addLayers) {
409
- const n = new Set(e.layers.map((o) => o.id)), i = new Set(t.layers.map((o) => o.id));
410
- if (!(n.size === i.size && [...n].every((o) => i.has(o))))
427
+ const i = new Set(e.layers.map((o) => o.id)), n = new Set(t.layers.map((o) => o.id));
428
+ if (!(i.size === n.size && [...i].every((o) => n.has(o))))
411
429
  this._logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);
412
430
  else
413
431
  for (const o of e.layers) {
@@ -434,16 +452,16 @@ class b {
434
452
  * properties are reverted to the template. Otherwise, issues are logged.
435
453
  */
436
454
  _validateRequiredFields(e, t) {
437
- const n = new Map(
438
- e.requiredFields.map((i) => [i.name.toLowerCase(), i])
455
+ const i = new Map(
456
+ e.requiredFields.map((n) => [n.name.toLowerCase(), n])
439
457
  );
440
- for (const i of t.requiredFields) {
441
- const o = n.get(i.name.toLowerCase());
458
+ for (const n of t.requiredFields) {
459
+ const o = i.get(n.name.toLowerCase());
442
460
  if (!o) {
443
- this.newDesign ? (e.requiredFields.push({ ...i }), this._logAutoFix(`Layer '${e.name}' was missing required field '${i.name}'. Auto-fixed by re-adding it from the template.`)) : this._logIssue(`Layer '${e.name}' is missing required field '${i.name}'.`);
461
+ this.newDesign ? (e.requiredFields.push({ ...n }), this._logAutoFix(`Layer '${e.name}' was missing required field '${n.name}'. Auto-fixed by re-adding it from the template.`)) : this._logIssue(`Layer '${e.name}' is missing required field '${n.name}'.`);
444
462
  continue;
445
463
  }
446
- this._enforceRequiredFieldImmutability(e, o, i);
464
+ this._enforceRequiredFieldImmutability(e, o, n);
447
465
  }
448
466
  }
449
467
  /**
@@ -451,24 +469,24 @@ class b {
451
469
  * (its `name` is the match key, so it is equal by construction). On new designs the
452
470
  * properties are reverted to the template; otherwise an issue is logged.
453
471
  */
454
- _enforceRequiredFieldImmutability(e, t, n) {
455
- const i = [];
456
- if (t.type !== n.type && i.push("type"), (t.length ?? null) !== (n.length ?? null) && i.push("length"), this._choiceListsEqual(t.choiceList, n.choiceList) || i.push("choiceList"), !i.length)
472
+ _enforceRequiredFieldImmutability(e, t, i) {
473
+ const n = [];
474
+ if (t.type !== i.type && n.push("type"), (t.length ?? null) !== (i.length ?? null) && n.push("length"), this._choiceListsEqual(t.choiceList, i.choiceList) || n.push("choiceList"), !n.length)
457
475
  return;
458
- const o = i.length === 1 ? "property" : "properties";
459
- this.newDesign ? (t.type = n.type, t.length = n.length, t.choiceList = Array.isArray(n.choiceList) ? [...n.choiceList] : n.choiceList ?? null, this._logAutoFix(`Layer '${e.name}' required field '${n.name}' changed immutable ${o} (${i.join(", ")}). Auto-fixed by reverting to the template.`)) : this._logIssue(`Layer '${e.name}' required field '${n.name}' changed immutable ${o} (${i.join(", ")}). These cannot be modified.`);
476
+ const o = n.length === 1 ? "property" : "properties";
477
+ this.newDesign ? (t.type = i.type, t.length = i.length, t.choiceList = Array.isArray(i.choiceList) ? [...i.choiceList] : i.choiceList ?? null, this._logAutoFix(`Layer '${e.name}' required field '${i.name}' changed immutable ${o} (${n.join(", ")}). Auto-fixed by reverting to the template.`)) : this._logIssue(`Layer '${e.name}' required field '${i.name}' changed immutable ${o} (${n.join(", ")}). These cannot be modified.`);
460
478
  }
461
479
  /**
462
480
  * Set-based equality check for two choiceList values (order-insensitive),
463
481
  * treating null/undefined/non-array as "no domain".
464
482
  */
465
483
  _choiceListsEqual(e, t) {
466
- const n = Array.isArray(e) ? e : null, i = Array.isArray(t) ? t : null;
467
- if (n === null && i === null)
484
+ const i = Array.isArray(e) ? e : null, n = Array.isArray(t) ? t : null;
485
+ if (i === null && n === null)
468
486
  return !0;
469
- if (n === null || i === null)
487
+ if (i === null || n === null)
470
488
  return !1;
471
- const o = new Set(n), a = new Set(i);
489
+ const o = new Set(i), a = new Set(n);
472
490
  return o.size === a.size && [...o].every((r) => a.has(r));
473
491
  }
474
492
  //--------------------------------------------------------------------------
@@ -480,10 +498,10 @@ class b {
480
498
  * Validates solution title and description.
481
499
  */
482
500
  _validateSolutionProps() {
483
- const e = this.response.solution.title ?? "", t = this.response.solution.description, n = /[/\\]/u.test(e), i = this.newDesign ? e.replace(/[/\\]/gu, "") : e;
484
- this.newDesign && i !== e ? (this.response.solution.title = i, this._logAutoFix("Solution title contained forward or back slashes. Auto-fixed by removing them.")) : !this.newDesign && n && this._logIssue("Solution title contains forbidden forward or back slashes.");
485
- const o = H(i);
486
- if (o.isValid || this._tryFixName(o.errorType, i, (a) => {
501
+ const e = this.response.solution.title ?? "", t = this.response.solution.description, i = /[/\\]/u.test(e), n = this.newDesign ? e.replace(/[/\\]/gu, "") : e;
502
+ this.newDesign && n !== e ? (this.response.solution.title = n, this._logAutoFix("Solution title contained forward or back slashes. Auto-fixed by removing them.")) : !this.newDesign && i && this._logIssue("Solution title contains forbidden forward or back slashes.");
503
+ const o = H(n);
504
+ if (o.isValid || this._tryFixName(o.errorType, n, (a) => {
487
505
  this.response.solution.title = a;
488
506
  }, "Solution title", "Solution Title") || this._logIssue(`Solution title is invalid (${o.errorType}).`), t) {
489
507
  const a = J(t, b.DESCRIPTION_MAX_LENGTH, !0);
@@ -503,18 +521,18 @@ class b {
503
521
  for (const t of this.response.items) {
504
522
  if (e.has(t.type) && t.title.length > b.SERVICE_NAME_MAX_LENGTH)
505
523
  if (this.newDesign) {
506
- const i = t.title;
507
- t.title = t.title.slice(0, b.SERVICE_NAME_MAX_LENGTH).trim(), this._logAutoFix(`Service name '${i}' exceeded ${b.SERVICE_NAME_MAX_LENGTH} characters. Auto-fixed to '${t.title}'.`);
524
+ const n = t.title;
525
+ t.title = t.title.slice(0, b.SERVICE_NAME_MAX_LENGTH).trim(), this._logAutoFix(`Service name '${n}' exceeded ${b.SERVICE_NAME_MAX_LENGTH} characters. Auto-fixed to '${t.title}'.`);
508
526
  } else
509
527
  this._logIssue(`Service name '${t.title}' exceeds 100 characters.`);
510
- const n = H(t.title ?? "");
511
- if (n.isValid || this._tryFixName(n.errorType, t.title ?? "", (i) => {
512
- t.title = i;
513
- }, `Item '${t.id}' title`, "Item Title") || this._logIssue(`Item '${t.id}' title is invalid (${n.errorType}).`), t.description) {
514
- const i = J(t.description, b.DESCRIPTION_MAX_LENGTH, !0);
515
- i.isValid || this._tryFixDescription(t.description, (o) => {
528
+ const i = H(t.title ?? "");
529
+ if (i.isValid || this._tryFixName(i.errorType, t.title ?? "", (n) => {
530
+ t.title = n;
531
+ }, `Item '${t.id}' title`, "Item Title") || this._logIssue(`Item '${t.id}' title is invalid (${i.errorType}).`), t.description) {
532
+ const n = J(t.description, b.DESCRIPTION_MAX_LENGTH, !0);
533
+ n.isValid || this._tryFixDescription(t.description, (o) => {
516
534
  t.description = o;
517
- }, `Item '${t.id}' description`) || this._logIssue(`Item '${t.id}' description is invalid (${i.errorType}).`);
535
+ }, `Item '${t.id}' description`) || this._logIssue(`Item '${t.id}' description is invalid (${n.errorType}).`);
518
536
  }
519
537
  }
520
538
  }
@@ -533,13 +551,13 @@ class b {
533
551
  */
534
552
  _dedupeLayerNames(e) {
535
553
  const t = /* @__PURE__ */ new Set();
536
- for (const n of e) {
537
- const i = (n.name ?? "").toLowerCase();
538
- if (t.has(i)) {
539
- const o = n.name;
540
- n.name = this._makeUniqueName(n.name ?? "Layer", t), this._logAutoFix(`Duplicate layer name '${o}'. Auto-fixed to '${n.name}'.`);
554
+ for (const i of e) {
555
+ const n = (i.name ?? "").toLowerCase();
556
+ if (t.has(n)) {
557
+ const o = i.name;
558
+ i.name = this._makeUniqueName(i.name ?? "Layer", t), this._logAutoFix(`Duplicate layer name '${o}'. Auto-fixed to '${i.name}'.`);
541
559
  }
542
- t.add(n.name.toLowerCase());
560
+ t.add(i.name.toLowerCase());
543
561
  }
544
562
  }
545
563
  /**
@@ -549,14 +567,14 @@ class b {
549
567
  !t && e.typeMutable === !0 && e.type === "Table" && (this.newDesign ? (e.type = "Point", this._logAutoFix(`Layer '${e.name}' cannot be a Table. Auto-fixed to 'Point'.`)) : this._logIssue(
550
568
  `Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`
551
569
  ));
552
- const n = H(e.name ?? "");
553
- if (n.isValid || this._tryFixName(n.errorType, e.name ?? "", (i) => {
554
- e.name = i;
555
- }, `Layer '${e.name}' name`, "Layer Title") || this._logIssue(`Layer '${e.name}' name is invalid (${n.errorType}).`), e.description) {
556
- const i = J(e.description, b.DESCRIPTION_MAX_LENGTH, !0);
557
- i.isValid || this._tryFixDescription(e.description, (o) => {
570
+ const i = H(e.name ?? "");
571
+ if (i.isValid || this._tryFixName(i.errorType, e.name ?? "", (n) => {
572
+ e.name = n;
573
+ }, `Layer '${e.name}' name`, "Layer Title") || this._logIssue(`Layer '${e.name}' name is invalid (${i.errorType}).`), e.description) {
574
+ const n = J(e.description, b.DESCRIPTION_MAX_LENGTH, !0);
575
+ n.isValid || this._tryFixDescription(e.description, (o) => {
558
576
  e.description = o;
559
- }, `Layer '${e.name}' description`) || this._logIssue(`Layer '${e.name}' description is invalid (${i.errorType}).`);
577
+ }, `Layer '${e.name}' description`) || this._logIssue(`Layer '${e.name}' description is invalid (${n.errorType}).`);
560
578
  }
561
579
  this._validateLayerFields(e);
562
580
  }
@@ -577,33 +595,33 @@ class b {
577
595
  for (const o of [...e.customFields, ...e.requiredFields])
578
596
  this._validateField(o);
579
597
  this.fieldNameRegistry = null;
580
- const n = new Set(e.requiredFields.map((o) => o.name.toLowerCase())), i = new Set(n);
598
+ const i = new Set(e.requiredFields.map((o) => o.name.toLowerCase())), n = new Set(i);
581
599
  for (const o of e.customFields) {
582
600
  const a = o.name.toLowerCase();
583
- if (i.has(a)) {
584
- const r = n.has(a) ? "a required field name" : "another field with the same name";
601
+ if (n.has(a)) {
602
+ const r = i.has(a) ? "a required field name" : "another field with the same name";
585
603
  if (this.newDesign) {
586
604
  const c = o.name;
587
- o.name = this._makeUniqueName(o.name, i), this._logAutoFix(`Layer '${e.name}' field '${c}' collided with ${r}. Auto-fixed to '${o.name}'.`);
605
+ o.name = this._makeUniqueName(o.name, n), this._logAutoFix(`Layer '${e.name}' field '${c}' collided with ${r}. Auto-fixed to '${o.name}'.`);
588
606
  } else
589
607
  this._logIssue(`Layer '${e.name}' field '${o.name}' collides with ${r}.`);
590
608
  }
591
- i.add(o.name.toLowerCase());
609
+ n.add(o.name.toLowerCase());
592
610
  }
593
611
  }
594
612
  /**
595
613
  * Validates a single field including name, type, length, and domain constraints.
596
614
  */
597
615
  _validateField(e) {
598
- const t = /^\p{L}/u, n = /^.[\p{L}\p{M}\p{N}_]*$/u;
616
+ const t = /^\p{L}/u, i = /^.[\p{L}\p{M}\p{N}_]*$/u;
599
617
  e.alias || (this.newDesign ? (e.alias = e.name, this._logAutoFix(`Field '${e.name}' had no display name (alias). Auto-fixed to '${e.alias}'.`)) : this._logIssue(`Field '${e.name}' has no display name (alias).`));
600
- const i = t.test(e.name), o = n.test(e.name);
601
- if (!i || !o)
618
+ const n = t.test(e.name), o = i.test(e.name);
619
+ if (!n || !o)
602
620
  if (this.newDesign) {
603
621
  const a = e.name;
604
622
  e.name = this._makeUniqueName(this._sanitizeFieldName(e.name), this.fieldNameRegistry), this.fieldNameRegistry.add(e.name.toLowerCase()), this._logAutoFix(`Field '${a}' had an invalid name. Auto-fixed to '${e.name}'.`);
605
623
  } else
606
- i || this._logIssue(`Field '${e.name}' does not start with a letter.`), o || this._logIssue(
624
+ n || this._logIssue(`Field '${e.name}' does not start with a letter.`), o || this._logIssue(
607
625
  `Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`
608
626
  );
609
627
  if (e.name.length > b.FIELD_NAME_MAX_LENGTH)
@@ -635,10 +653,10 @@ class b {
635
653
  */
636
654
  _autoFixChoiceList(e) {
637
655
  let t = e.choiceList;
638
- const n = t.filter((o) => o?.trim());
639
- n.length !== t.length && (this._logAutoFix(`Field '${e.name}' had blank domain values. Auto-fixed by removing them.`), t = n, e.choiceList = t);
640
- const i = [...new Set(t)];
641
- i.length !== t.length && (this._logAutoFix(`Field '${e.name}' had duplicate domain values. Auto-fixed by removing duplicates.`), t = i, e.choiceList = t), t.length || (this._logAutoFix(`Field '${e.name}' had an empty domain. Auto-fixed by removing the domain.`), e.choiceList = null);
656
+ const i = t.filter((o) => o?.trim());
657
+ i.length !== t.length && (this._logAutoFix(`Field '${e.name}' had blank domain values. Auto-fixed by removing them.`), t = i, e.choiceList = t);
658
+ const n = [...new Set(t)];
659
+ n.length !== t.length && (this._logAutoFix(`Field '${e.name}' had duplicate domain values. Auto-fixed by removing duplicates.`), t = n, e.choiceList = t), t.length || (this._logAutoFix(`Field '${e.name}' had an empty domain. Auto-fixed by removing the domain.`), e.choiceList = null);
642
660
  }
643
661
  /**
644
662
  * Legacy behavior: logs domain (choiceList) content issues as validation issues.
@@ -663,8 +681,8 @@ class b {
663
681
  }
664
682
  const t = e.length;
665
683
  if (!Ke(t).isValid) {
666
- const i = t > 4e3 ? 4e3 : 256;
667
- this._handleInvalidStringFieldLength(e, i);
684
+ const n = t > 4e3 ? 4e3 : 256;
685
+ this._handleInvalidStringFieldLength(e, n);
668
686
  }
669
687
  }
670
688
  /**
@@ -683,10 +701,10 @@ class b {
683
701
  * a numeric suffix when needed.
684
702
  */
685
703
  _makeUniqueName(e, t) {
686
- let n = e, i = 1;
687
- for (; t.has(n.toLowerCase()); )
688
- n = `${e}_${i}`, i += 1;
689
- return n;
704
+ let i = e, n = 1;
705
+ for (; t.has(i.toLowerCase()); )
706
+ i = `${e}_${n}`, n += 1;
707
+ return i;
690
708
  }
691
709
  /**
692
710
  * Returns a field name truncated to the 31-character limit that does not collide
@@ -694,11 +712,11 @@ class b {
694
712
  * appending a numeric suffix as needed.
695
713
  */
696
714
  _getUniqueTruncatedFieldName(e, t) {
697
- const n = b.FIELD_NAME_MAX_LENGTH, i = e.slice(0, n);
698
- let o = i, a = 1;
715
+ const i = b.FIELD_NAME_MAX_LENGTH, n = e.slice(0, i);
716
+ let o = n, a = 1;
699
717
  for (; t.has(o.toLowerCase()); ) {
700
- const r = `_${a}`, c = Math.max(1, n - r.length);
701
- o = `${i.slice(0, c)}${r}`, a += 1;
718
+ const r = `_${a}`, c = Math.max(1, i - r.length);
719
+ o = `${n.slice(0, c)}${r}`, a += 1;
702
720
  }
703
721
  return o;
704
722
  }
@@ -708,16 +726,16 @@ class b {
708
726
  * May return an empty string when no valid characters remain.
709
727
  */
710
728
  _sanitizeItemName(e, t = b.NAME_MAX_LENGTH) {
711
- let n = (e ?? "").replace(new RegExp(Qe.source, "gu"), "").replace(b.INVALID_NAME_CHARS, "").replace(/\s+/gu, " ").trim();
712
- return n.length > t && (n = n.slice(0, t).trim()), n;
729
+ let i = (e ?? "").replace(new RegExp(Qe.source, "gu"), "").replace(b.INVALID_NAME_CHARS, "").replace(/\s+/gu, " ").trim();
730
+ return i.length > t && (i = i.slice(0, t).trim()), i;
713
731
  }
714
732
  /**
715
733
  * Sanitizes a description by stripping the disallowed `<` and `>` characters
716
734
  * (forward slash is allowed) and truncating to the description length limit.
717
735
  */
718
736
  _sanitizeDescription(e, t = b.DESCRIPTION_MAX_LENGTH) {
719
- let n = (e ?? "").replace(/[<>]/gu, "");
720
- return n.length > t && (n = n.slice(0, t)), n;
737
+ let i = (e ?? "").replace(/[<>]/gu, "");
738
+ return i.length > t && (i = i.slice(0, t)), i;
721
739
  }
722
740
  /**
723
741
  * Sanitizes a field name so it starts with a letter and contains only
@@ -732,22 +750,22 @@ class b {
732
750
  * (or values that sanitize to empty) fall back to the supplied placeholder.
733
751
  * Returns true when fixed.
734
752
  */
735
- _tryFixName(e, t, n, i, o) {
753
+ _tryFixName(e, t, i, n, o) {
736
754
  if (!this.newDesign)
737
755
  return !1;
738
756
  if (e === "empty")
739
- return n(o), this._logAutoFix(`${i} was empty. Auto-fixed to '${o}'.`), !0;
757
+ return i(o), this._logAutoFix(`${n} was empty. Auto-fixed to '${o}'.`), !0;
740
758
  const r = this._sanitizeItemName(t) || o;
741
- return n(r), this._logAutoFix(`${i} was invalid (${e}). Auto-fixed to '${r}'.`), !0;
759
+ return i(r), this._logAutoFix(`${n} was invalid (${e}). Auto-fixed to '${r}'.`), !0;
742
760
  }
743
761
  /**
744
762
  * Attempts to auto-fix an invalid description on new designs. Returns true when fixed.
745
763
  */
746
- _tryFixDescription(e, t, n) {
764
+ _tryFixDescription(e, t, i) {
747
765
  if (!this.newDesign)
748
766
  return !1;
749
- const i = this._sanitizeDescription(e);
750
- return t(i), this._logAutoFix(`${n} was invalid. Auto-fixed to a sanitized value.`), !0;
767
+ const n = this._sanitizeDescription(e);
768
+ return t(n), this._logAutoFix(`${i} was invalid. Auto-fixed to a sanitized value.`), !0;
751
769
  }
752
770
  /**
753
771
  * Records an auto-fix that was applied (new-design only). Auto-fixes are
@@ -850,8 +868,8 @@ const yt = l.object({
850
868
  const {
851
869
  query: e,
852
870
  validationIssues: t,
853
- recentMessages: n,
854
- fallbackMessage: i,
871
+ recentMessages: i,
872
+ fallbackMessage: n,
855
873
  promptModules: o
856
874
  } = s;
857
875
  try {
@@ -860,18 +878,18 @@ const yt = l.object({
860
878
  modelTier: "fast",
861
879
  temperature: 0,
862
880
  schema: St,
863
- messages: n,
881
+ messages: i,
864
882
  inputVariables: {
865
883
  query: e,
866
884
  validationIssueCount: String(t.length),
867
885
  validationIssues: Et(t)
868
886
  }
869
- })).response?.trim() || i;
887
+ })).response?.trim() || n;
870
888
  } catch (a) {
871
889
  return console.warn(
872
890
  "Natural language response failed:",
873
891
  { error: a }
874
- ), i;
892
+ ), n;
875
893
  }
876
894
  }, ee = (s) => s in F, $t = 5, kt = 0.8, Nt = 0.5, Ft = "Web Mapping Application", Dt = "Embeddings";
877
895
  let R = null, V = null, B = null, P = null;
@@ -889,43 +907,43 @@ const Mt = "Build", L = /* @__PURE__ */ Object.assign({
889
907
  }));
890
908
  }, Bt = async (s, e, t) => {
891
909
  if (!s) return null;
892
- const n = `type:"${Ft}" AND typekeywords:${Dt} AND group:${s}`;
910
+ const i = `type:"${Ft}" AND typekeywords:${Dt} AND group:${s}`;
893
911
  return (await Y.searchItems({
894
- q: n,
912
+ q: i,
895
913
  params: e ? { token: e } : void 0,
896
914
  portal: t,
897
915
  num: 1
898
916
  }))?.results?.[0] ?? null;
899
917
  };
900
- async function Pt(s, e, t, n) {
918
+ async function Pt(s, e, t, i) {
901
919
  try {
902
- const i = await Bt(s, e, t);
903
- if (!i || m(n))
920
+ const n = await Bt(s, e, t);
921
+ if (!n || m(i))
904
922
  return null;
905
- const o = new Ye({ id: i.id });
906
- return await o.load(), m(n) ? null : await o.fetchData("json");
923
+ const o = new Ye({ id: n.id });
924
+ return await o.load(), m(i) ? null : await o.fetchData("json");
907
925
  } catch {
908
926
  return null;
909
927
  }
910
928
  }
911
929
  const qt = async (s, e, t) => {
912
930
  if (!s) return [];
913
- const n = `type:Solution AND typekeywords:${Mt} AND group:${s}`;
931
+ const i = `type:Solution AND typekeywords:${Mt} AND group:${s}`;
914
932
  return (await Y.searchItems({
915
- q: n,
933
+ q: i,
916
934
  params: e ? { token: e } : void 0,
917
935
  portal: t,
918
936
  num: 100
919
937
  }))?.results ?? [];
920
938
  }, Ut = async (s, e, t) => {
921
939
  try {
922
- const n = await Y.getItemData(s, {
940
+ const i = await Y.getItemData(s, {
923
941
  params: e ? { token: e } : void 0,
924
942
  portal: t
925
- }), i = n?.buildSolution;
926
- if (!i) return null;
927
- const o = n?.params, a = o && typeof o == "object" && !Array.isArray(o) ? o : null;
928
- return { buildSolution: i, params: a };
943
+ }), n = i?.buildSolution;
944
+ if (!n) return null;
945
+ const o = i?.params, a = o && typeof o == "object" && !Array.isArray(o) ? o : null;
946
+ return { buildSolution: n, params: a };
929
947
  } catch {
930
948
  return null;
931
949
  }
@@ -966,24 +984,24 @@ const qt = async (s, e, t) => {
966
984
  });
967
985
  return;
968
986
  }
969
- const e = s?.configurable?.context?.token, t = Ae(s), n = Ce(s);
987
+ const e = s?.configurable?.context?.token, t = Ae(s), i = Ce(s);
970
988
  if (!t) {
971
989
  console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
972
990
  return;
973
991
  }
974
- const i = await qt(t, e, n), o = {};
975
- m(s) || (await Promise.all(i.map(async (a) => {
992
+ const n = await qt(t, e, i), o = {};
993
+ m(s) || (await Promise.all(n.map(async (a) => {
976
994
  const r = a.properties?.templateInfo;
977
995
  if (!r || typeof r != "object") return;
978
996
  const c = r.id;
979
997
  if (typeof c != "string" || o[c]) return;
980
- const d = await Ut(a.id, e, n);
998
+ const d = await Ut(a.id, e, i);
981
999
  if (!d || m(s))
982
1000
  return;
983
1001
  const { buildSolution: h, params: y } = d;
984
1002
  if (typeof h == "object" && h !== null && "solution" in h) {
985
1003
  const g = h.solution;
986
- g.thumbnailUrl = a.thumbnail ? `${n ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, g.item = a;
1004
+ g.thumbnailUrl = a.thumbnail ? `${i ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, g.item = a;
987
1005
  }
988
1006
  const u = {
989
1007
  ...r,
@@ -1018,8 +1036,8 @@ const qt = async (s, e, t) => {
1018
1036
  ]);
1019
1037
  }, Te = async (s) => {
1020
1038
  const e = Ie(s);
1021
- (!B || e && e !== P) && (P = e ?? P, B = Ot(s).catch((n) => {
1022
- throw B = null, P = null, n;
1039
+ (!B || e && e !== P) && (P = e ?? P, B = Ot(s).catch((i) => {
1040
+ throw B = null, P = null, i;
1023
1041
  })), await B;
1024
1042
  };
1025
1043
  async function Ee(s) {
@@ -1027,8 +1045,8 @@ async function Ee(s) {
1027
1045
  const e = Ae(s);
1028
1046
  if (!e)
1029
1047
  return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
1030
- const t = Ce(s), n = s?.configurable?.context?.configContext?.portalURL;
1031
- if (await new Xe(n ? { url: n } : void 0).load(), m(s))
1048
+ const t = Ce(s), i = s?.configurable?.context?.configContext?.portalURL;
1049
+ if (await new Xe(i ? { url: i } : void 0).load(), m(s))
1032
1050
  return null;
1033
1051
  const o = Ie(s) ?? void 0, a = await Pt(e, o, t, s);
1034
1052
  return m(s) ? null : a ? (R = a.items, R) : null;
@@ -1042,13 +1060,13 @@ Description: ${e.description}`).join(`
1042
1060
  if (typeof e != "string" || !e.trim())
1043
1061
  return null;
1044
1062
  try {
1045
- const t = JSON.parse(e), n = $(
1063
+ const t = JSON.parse(e), i = $(
1046
1064
  { response: "", ...t },
1047
1065
  { itemId: t?.solution?.itemId ?? null }
1048
- ), i = Z.safeParse(n);
1049
- if (!i.success)
1066
+ ), n = Z.safeParse(i);
1067
+ if (!n.success)
1050
1068
  return null;
1051
- const { response: o, ...a } = i.data, r = t.templateId, c = typeof r == "string" && ee(r) ? r : null;
1069
+ const { response: o, ...a } = n.data, r = t.templateId, c = typeof r == "string" && ee(r) ? r : null;
1052
1070
  return $(
1053
1071
  a,
1054
1072
  {
@@ -1100,19 +1118,19 @@ Description: ${e.description}`).join(`
1100
1118
  }), Ht = (s, e) => {
1101
1119
  if (m(e))
1102
1120
  return {};
1103
- const t = jt(e), n = t?.templateId ?? null, i = {};
1104
- return JSON.stringify(s.currentDesign) !== JSON.stringify(t) && (i.currentDesign = t), n && s.selectedTemplate !== n && (i.selectedTemplate = n), i;
1121
+ const t = jt(e), i = t?.templateId ?? null, n = {};
1122
+ return JSON.stringify(s.currentDesign) !== JSON.stringify(t) && (n.currentDesign = t), i && s.selectedTemplate !== i && (n.selectedTemplate = i), n;
1105
1123
  }, Jt = async (s, e) => {
1106
1124
  if (m(e))
1107
1125
  return {};
1108
1126
  await _({ text: f("understandingRequest", e) }, e), await Te(e);
1109
- const t = s.agentExecutionContext.userRequest, n = zt(), i = s.agentExecutionContext.messages.slice(-11), o = await k({
1127
+ const t = s.agentExecutionContext.userRequest, i = zt(), n = s.agentExecutionContext.messages.slice(-11), o = await k({
1110
1128
  promptText: await v(L, "assessBuildRequest"),
1111
1129
  modelTier: "advanced",
1112
1130
  temperature: 0,
1113
1131
  schema: Tt,
1114
- messages: i,
1115
- inputVariables: { query: t, availableTemplates: n }
1132
+ messages: n,
1133
+ inputVariables: { query: t, availableTemplates: i }
1116
1134
  }), a = o.matchedTemplates.filter(
1117
1135
  (u) => ee(u.templateId)
1118
1136
  ), r = {
@@ -1144,17 +1162,17 @@ Description: ${e.description}`).join(`
1144
1162
  }
1145
1163
  };
1146
1164
  await _({ text: f("understandingRequest", e) }, e);
1147
- const n = s.agentExecutionContext.userRequest, i = s.agentExecutionContext.messages.slice(-11);
1165
+ const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11);
1148
1166
  return {
1149
1167
  updateAssessment: await k({
1150
1168
  promptText: await v(L, "assessUpdateRequest"),
1151
1169
  modelTier: "advanced",
1152
1170
  temperature: 0,
1153
1171
  schema: It,
1154
- messages: i,
1172
+ messages: n,
1155
1173
  inputVariables: {
1156
1174
  currentDesign: JSON.stringify(me(t)),
1157
- query: n
1175
+ query: i
1158
1176
  }
1159
1177
  })
1160
1178
  };
@@ -1168,13 +1186,13 @@ Description: ${e.description}`).join(`
1168
1186
  }, Wt = (s, e) => {
1169
1187
  if (m(e))
1170
1188
  return {};
1171
- const { hitlResponse: t } = e.configurable, n = "selectTemplate", i = s.assessment?.matchedTemplates.filter(
1189
+ const { hitlResponse: t } = e.configurable, i = "selectTemplate", n = s.assessment?.matchedTemplates.filter(
1172
1190
  (d) => ee(d.templateId)
1173
- ) ?? [], o = i.map((d) => `${d.templateDescription}`);
1174
- if (t?.agentId !== "solutionBuilder" || t.id !== n) {
1191
+ ) ?? [], o = n.map((d) => `${d.templateDescription}`);
1192
+ if (t?.agentId !== "solutionBuilder" || t.id !== i) {
1175
1193
  const d = {
1176
1194
  agentId: "solutionBuilder",
1177
- id: n,
1195
+ id: i,
1178
1196
  kind: "singleSelection",
1179
1197
  message: f("selectTemplatePrompt", e),
1180
1198
  metadata: [...o]
@@ -1183,23 +1201,23 @@ Description: ${e.description}`).join(`
1183
1201
  }
1184
1202
  const a = String(t.payload ?? ""), r = o.findIndex((d) => d === a);
1185
1203
  return {
1186
- selectedTemplate: (r >= 0 ? i[r] : void 0)?.templateId ?? i[0]?.templateId ?? null
1204
+ selectedTemplate: (r >= 0 ? n[r] : void 0)?.templateId ?? n[0]?.templateId ?? null
1187
1205
  };
1188
1206
  }, Xt = async (s, e) => {
1189
1207
  if (m(e))
1190
1208
  return {};
1191
1209
  await _({ text: f("searchingExistingSolutions", e) }, e);
1192
- const t = s.agentExecutionContext.userRequest, n = ht(s.agentExecutionContext.messages) || t, i = await Ee(e);
1210
+ const t = s.agentExecutionContext.userRequest, i = ht(s.agentExecutionContext.messages) || t, n = await Ee(e);
1193
1211
  if (m(e))
1194
1212
  return {};
1195
- if (!i)
1213
+ if (!n)
1196
1214
  return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
1197
- if (!i.length)
1215
+ if (!n.length)
1198
1216
  return { existingMatches: [] };
1199
- const [o] = await ze([n]);
1217
+ const [o] = await ze([i]);
1200
1218
  if (m(e))
1201
1219
  return {};
1202
- const a = i.map((u) => ({
1220
+ const a = n.map((u) => ({
1203
1221
  solution: u,
1204
1222
  score: je(o, u.embedding)
1205
1223
  }));
@@ -1223,22 +1241,22 @@ Description: ${u.description}`).join(`
1223
1241
  }, Yt = (s, e) => {
1224
1242
  if (m(e))
1225
1243
  return {};
1226
- const { existingMatches: t } = s, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${t[0].solution.id}`;
1227
- if (n?.agentId !== "solutionBuilder" || n.id !== i) {
1244
+ const { existingMatches: t } = s, { hitlResponse: i } = e.configurable, n = `confirmExistingSolution:${t[0].solution.id}`;
1245
+ if (i?.agentId !== "solutionBuilder" || i.id !== n) {
1228
1246
  t.length === 1 ? ye(t[0].solution.id) : fe(t);
1229
1247
  const c = f("existingSolutionMatch", e), d = [
1230
1248
  f("continueBuildingYes", e),
1231
1249
  f("continueBuildingNo", e)
1232
1250
  ], h = {
1233
1251
  agentId: "solutionBuilder",
1234
- id: i,
1252
+ id: n,
1235
1253
  kind: "singleSelection",
1236
1254
  message: c,
1237
1255
  metadata: d
1238
1256
  };
1239
1257
  throw new de(h);
1240
1258
  }
1241
- const o = String(n.payload ?? "").trim(), a = f("continueBuildingNo", e);
1259
+ const o = String(i.payload ?? "").trim(), a = f("continueBuildingNo", e);
1242
1260
  return { continueBuilding: o !== a };
1243
1261
  }, Zt = (s, e) => {
1244
1262
  const t = f("continueBuildingDeclined", e);
@@ -1252,19 +1270,19 @@ Description: ${u.description}`).join(`
1252
1270
  return {};
1253
1271
  if (await Te(e), m(e))
1254
1272
  return {};
1255
- const { currentDesign: t } = s, n = s.agentExecutionContext.userRequest;
1273
+ const { currentDesign: t } = s, i = s.agentExecutionContext.userRequest;
1256
1274
  await _({ text: f("creatingDesign", e) }, e);
1257
- let i = q(s.selectedTemplate);
1258
- if (i?.initialTemplate || (await te(e), i = q(s.selectedTemplate)), m(e))
1275
+ let n = q(s.selectedTemplate);
1276
+ if (n?.initialTemplate || (await te(e), n = q(s.selectedTemplate)), m(e))
1259
1277
  return {};
1260
- if (!i?.initialTemplate)
1278
+ if (!n?.initialTemplate)
1261
1279
  throw new Error("No hydrated templates are available for solution design.");
1262
1280
  const o = $(
1263
- t ?? i.initialTemplate,
1281
+ t ?? n.initialTemplate,
1264
1282
  {
1265
- itemId: (t ?? i.initialTemplate)?.solution?.itemId ?? null,
1266
- sourceBuildSolution: t?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
1267
- params: t?.params ?? i.initialTemplate.params ?? null
1283
+ itemId: (t ?? n.initialTemplate)?.solution?.itemId ?? null,
1284
+ sourceBuildSolution: t?.sourceBuildSolution ?? n.initialTemplate.sourceBuildSolution,
1285
+ params: t?.params ?? n.initialTemplate.params ?? null
1268
1286
  }
1269
1287
  ), a = s.agentExecutionContext.messages.slice(-11), r = await k({
1270
1288
  promptText: await v(L, "designSolution"),
@@ -1274,8 +1292,8 @@ Description: ${u.description}`).join(`
1274
1292
  messages: a,
1275
1293
  inputVariables: {
1276
1294
  currentDesign: JSON.stringify(he(o)),
1277
- templateInstructions: i.instructions,
1278
- query: n
1295
+ templateInstructions: n.instructions,
1296
+ query: i
1279
1297
  }
1280
1298
  });
1281
1299
  if (await _({ text: " of design solution 1" }, e), m(e))
@@ -1291,7 +1309,7 @@ Description: ${u.description}`).join(`
1291
1309
  templateId: s.selectedTemplate ?? null,
1292
1310
  params: o.params ?? null
1293
1311
  }
1294
- ), g = new b(u, i.initialTemplate);
1312
+ ), g = new b(u, n.initialTemplate);
1295
1313
  if (!g.isValid)
1296
1314
  return console.warn(
1297
1315
  "[SolutionBuilder] designSolution validation failed:",
@@ -1324,7 +1342,7 @@ Description: ${u.description}`).join(`
1324
1342
  const { currentDesign: t } = s;
1325
1343
  if (!t)
1326
1344
  return Le(s, e);
1327
- const n = s.agentExecutionContext.userRequest, i = s.agentExecutionContext.messages.slice(-11);
1345
+ const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11);
1328
1346
  await _({ text: f("updatingDesign", e) }, e);
1329
1347
  let o;
1330
1348
  try {
@@ -1333,10 +1351,10 @@ Description: ${u.description}`).join(`
1333
1351
  modelTier: "advanced",
1334
1352
  temperature: 0,
1335
1353
  schema: _t,
1336
- messages: i,
1354
+ messages: n,
1337
1355
  inputVariables: {
1338
1356
  currentDesign: JSON.stringify(me(t)),
1339
- query: n
1357
+ query: i
1340
1358
  }
1341
1359
  });
1342
1360
  } catch (p) {
@@ -1444,9 +1462,9 @@ Description: ${u.description}`).join(`
1444
1462
  { issues: j.issues, llmResponse: o, patchedDesign: I }
1445
1463
  );
1446
1464
  const p = await Lt({
1447
- query: n,
1465
+ query: i,
1448
1466
  validationIssues: j.issues,
1449
- recentMessages: i,
1467
+ recentMessages: n,
1450
1468
  fallbackMessage: f("applyChangeFailed", e),
1451
1469
  promptModules: L
1452
1470
  });
@@ -1502,22 +1520,22 @@ const rs = E.object({
1502
1520
  "./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((s) => s.default),
1503
1521
  "./prompts/description.md": () => import("../../chunks/description.js").then((s) => s.default)
1504
1522
  }), ls = (s) => {
1505
- const e = s?.configurable?.context?.solutionDesignJson, t = s?.configurable?.context?.lastTurnAgent, n = t === "assistant" ? "other" : t;
1506
- let i = !1;
1523
+ const e = s?.configurable?.context?.solutionDesignJson, t = s?.configurable?.context?.lastTurnAgent, i = t === "assistant" ? "other" : t;
1524
+ let n = !1;
1507
1525
  if (typeof e == "string" && e.trim())
1508
1526
  try {
1509
- i = JSON.parse(e).solution != null;
1527
+ n = JSON.parse(e).solution != null;
1510
1528
  } catch {
1511
- i = !1;
1529
+ n = !1;
1512
1530
  }
1513
- return { activeSolutionDesign: i, lastTool: n };
1531
+ return { activeSolutionDesign: n, lastTool: i };
1514
1532
  }, ie = (s, e) => {
1515
1533
  const t = s?.configurable?.context?.setLastTurnAgent;
1516
1534
  typeof t == "function" && t(e);
1517
- const n = new CustomEvent("assistantProcessing", {
1535
+ const i = new CustomEvent("assistantProcessing", {
1518
1536
  detail: { finished: !0, agent: e }
1519
1537
  });
1520
- window.dispatchEvent(n);
1538
+ window.dispatchEvent(i);
1521
1539
  }, $e = x.Root({
1522
1540
  ...X(),
1523
1541
  selectedTool: x({
@@ -1536,13 +1554,13 @@ const rs = E.object({
1536
1554
  { text: t?.builderMessages.understandingRequest },
1537
1555
  e
1538
1556
  );
1539
- const n = s.agentExecutionContext.userRequest, i = s.agentExecutionContext.messages.slice(-11), { activeSolutionDesign: o, lastTool: a } = ls(e), r = await v(se, "classifyIntent"), c = await k({
1557
+ const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11), { activeSolutionDesign: o, lastTool: a } = ls(e), r = await v(se, "classifyIntent"), c = await k({
1540
1558
  promptText: r,
1541
1559
  modelTier: "advanced",
1542
1560
  temperature: 0,
1543
1561
  schema: rs,
1544
- messages: i,
1545
- inputVariables: { query: n, activeSolutionDesign: o, lastTool: a }
1562
+ messages: n,
1563
+ inputVariables: { query: i, activeSolutionDesign: o, lastTool: a }
1546
1564
  });
1547
1565
  return {
1548
1566
  selectedTool: c.tool,
@@ -1551,17 +1569,17 @@ const rs = E.object({
1551
1569
  }, us = async (s, e) => {
1552
1570
  if (O(e))
1553
1571
  return {};
1554
- const n = await lt().compile().invoke(s, e);
1555
- return ie(e, "explorer"), n;
1572
+ const i = await lt().compile().invoke(s, e);
1573
+ return ie(e, "explorer"), i;
1556
1574
  }, ds = async (s, e) => {
1557
1575
  if (O(e))
1558
1576
  return {};
1559
- const n = await as().compile().invoke(s, e);
1560
- return ie(e, "builder"), n;
1577
+ const i = await as().compile().invoke(s, e);
1578
+ return ie(e, "builder"), i;
1561
1579
  }, ps = async (s, e) => {
1562
1580
  if (O(e))
1563
1581
  return {};
1564
- const t = U(e), n = s.agentExecutionContext.userRequest, i = s.intentRationale ?? "No rationale available.";
1582
+ const t = U(e), i = s.agentExecutionContext.userRequest, n = s.intentRationale ?? "No rationale available.";
1565
1583
  await _(
1566
1584
  { text: t?.executingSolutionsAssistantAgent },
1567
1585
  e
@@ -1571,7 +1589,7 @@ const rs = E.object({
1571
1589
  modelTier: "advanced",
1572
1590
  temperature: 0,
1573
1591
  messages: a,
1574
- inputVariables: { query: n, rationale: i }
1592
+ inputVariables: { query: i, rationale: n }
1575
1593
  });
1576
1594
  return ie(e, "assistant"), {
1577
1595
  outputMessage: r,
@@ -1612,32 +1630,32 @@ class xs extends De {
1612
1630
  }, this._chatStartTime = null, this._handleAssistantProcessingFinished = (e) => {
1613
1631
  const t = e;
1614
1632
  if (t.detail?.finished && this._chatStartTime !== null) {
1615
- const n = qe(this._chatStartTime);
1633
+ const i = qe(this._chatStartTime);
1616
1634
  this._telemetry?.logEvent({
1617
1635
  category: M.ASSISTANT,
1618
1636
  action: "Chat",
1619
1637
  dimensions: [t.detail.agent],
1620
- metrics: [n]
1621
- }), this._chatStartTime = null, this.assistantProcessing.emit(!1);
1638
+ metrics: [i]
1639
+ }), this._chatStartTime = null;
1622
1640
  }
1623
1641
  }, this.closeAssistant = ae(), this.assistantProcessing = ae(), this._handleAssistantLinkClick = (e) => {
1624
- const t = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
1642
+ const t = e.composedPath().find((i) => i instanceof HTMLAnchorElement);
1625
1643
  if (t?.href)
1626
1644
  if (e.preventDefault(), t.target.indexOf("solutionId:") > -1) {
1627
- const n = t.target.split("solutionId:")[1];
1628
- this._emitItemIdFromAI(n);
1645
+ const i = t.target.split("solutionId:")[1];
1646
+ this._emitItemIdFromAI(i);
1629
1647
  } else
1630
1648
  window.open(t.href, "_blank", "noopener,noreferrer");
1631
1649
  }, this._onSolutionDesignUpdate = (e) => {
1632
- const n = e.detail;
1633
- this._solutionDesignJson = n ? JSON.stringify(n, null, 2) : '{ "solution": null }';
1650
+ const i = e.detail;
1651
+ this._solutionDesignJson = i ? JSON.stringify(i, null, 2) : '{ "solution": null }';
1634
1652
  }, this._handleSignIn = () => {
1635
1653
  this._configContextConsumer.value?.authentication?.signIn("aiOpen");
1636
1654
  }, this._checkURLOpenParameter = () => {
1637
1655
  this.open = this._configContextConsumer.value?.authentication?.SignInParam === "aiOpen" || this.open;
1638
1656
  }, this.listenOn(window, "arcgisFeedback", (e) => {
1639
- const t = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(t);
1640
- this._sendFeedback(t.content, o ?? i ?? "", t.feedback?.positive ? "Good" : t.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
1657
+ const t = e.detail, { agentPicked: i, taskAssigned: n, userMessage: o } = this._parseAgentPickedAndTask(t);
1658
+ this._sendFeedback(t.content, o ?? n ?? "", t.feedback?.positive ? "Good" : t.feedback?.positive == "Bad" ? "Bad" : "N/A", i ?? "");
1641
1659
  }), this.listenOn(window, "clearAssistantConversation", () => {
1642
1660
  this._clearConversation();
1643
1661
  });
@@ -1687,6 +1705,8 @@ class xs extends De {
1687
1705
  console.log("arcgis submit: ", t.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0, this._chatStartTime = Date.now(), this.assistantProcessing.emit(!0);
1688
1706
  }} @arcgisFeedback=${(t) => {
1689
1707
  t.detail;
1708
+ }} @arcgisResponse=${() => {
1709
+ this.assistantProcessing.emit(!1);
1690
1710
  }} ${Oe(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
1691
1711
  this.hasActiveBuilderDesign ? this._showNewChatConfirm = !0 : (this._telemetry?.logEvent({
1692
1712
  category: M.ASSISTANT,
@@ -1726,8 +1746,8 @@ class xs extends De {
1726
1746
  _clearConversation() {
1727
1747
  this._conversationId = void 0, this._lastTurnAgent = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory();
1728
1748
  }
1729
- _sendFeedback(e, t, n, i) {
1730
- const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(t)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: i }))}&field:version=${encodeURIComponent("v2")}`;
1749
+ _sendFeedback(e, t, i, n) {
1750
+ const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(i)}&field:question=${encodeURIComponent(t)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: n }))}&field:version=${encodeURIComponent("v2")}`;
1731
1751
  window.open(o, "_blank");
1732
1752
  }
1733
1753
  async _loadUserFirstName() {
@@ -1741,7 +1761,7 @@ class xs extends De {
1741
1761
  }
1742
1762
  }
1743
1763
  _parseAgentPickedAndTask(e) {
1744
- const t = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...t].sort((u, g) => g.id - u.id).find((u) => u.role === "user" && u.id <= e.id)?.content || null, r = n.find((u) => typeof u == "string" && u.includes("Agent picked:")) ?? null;
1764
+ const t = Array.from(this._assistantRef.value?.messages || []), i = e.log || [], a = [...t].sort((u, g) => g.id - u.id).find((u) => u.role === "user" && u.id <= e.id)?.content || null, r = i.find((u) => typeof u == "string" && u.includes("Agent picked:")) ?? null;
1745
1765
  if (!r)
1746
1766
  return { agentPicked: null, taskAssigned: null, userMessage: a };
1747
1767
  const c = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, d = r.match(c);