@arcgis/coding-components 4.34.0-next.46 → 4.34.0-next.48

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 (81) hide show
  1. package/dist/addons.js +1 -1
  2. package/dist/cdn/{4ZVVSDCC.js → 27EP5EED.js} +2 -2
  3. package/dist/cdn/{QHPCR3B3.js → 2ARBPWZC.js} +4 -4
  4. package/dist/cdn/{OVMD4WRV.js → 2QK7HEBV.js} +1 -1
  5. package/dist/cdn/3N7KI3KA.js +4 -0
  6. package/dist/cdn/{DF2O3G3P.js → 5QOS4R7V.js} +2 -2
  7. package/dist/cdn/{EQSGM54I.js → 6VQ22SOV.js} +2 -2
  8. package/dist/cdn/{L6XTZ7KR.js → 7J4FLJLN.js} +2 -2
  9. package/dist/cdn/{UQTNER3J.js → A3JAK3CF.js} +2 -2
  10. package/dist/cdn/{IF3U7JRZ.js → ABSHG7D5.js} +2 -2
  11. package/dist/cdn/{EASJM363.js → AEGZ3QJJ.js} +2 -2
  12. package/dist/cdn/{TMVWVGSM.js → BH25Y6S2.js} +2 -2
  13. package/dist/cdn/{CANOO6KC.js → BQAOHFWU.js} +2 -2
  14. package/dist/cdn/{STC2RORA.js → CHCKVDIM.js} +2 -2
  15. package/dist/cdn/{C7NPXZT7.js → DT4TMY4I.js} +2 -2
  16. package/dist/cdn/{5WRQ5U32.js → EJKHTLLU.js} +2 -2
  17. package/dist/cdn/{5OHTNBB4.js → F6AXCLOB.js} +2 -2
  18. package/dist/cdn/{GC3VVQVY.js → FIDXVGT5.js} +2 -2
  19. package/dist/cdn/{KRTTGEOH.js → FWHP4CLZ.js} +2 -2
  20. package/dist/cdn/GOXOOVQ7.js +4 -0
  21. package/dist/cdn/{N3XAV7G4.js → H6WD7KAL.js} +2 -2
  22. package/dist/cdn/{6GPX3GVA.js → HJU72VM7.js} +2 -2
  23. package/dist/cdn/JN5USILT.js +6 -0
  24. package/dist/cdn/{PDFZ6NDY.js → LG7WX4PN.js} +2 -2
  25. package/dist/cdn/{ZGH4FFQ4.js → M7L7AKUK.js} +2 -2
  26. package/dist/cdn/MMHKM3LE.js +4 -0
  27. package/dist/cdn/{XL57XC6Q.js → MR5DQBOC.js} +2 -2
  28. package/dist/cdn/{U5FKT7V2.js → MWFDT2AD.js} +2 -2
  29. package/dist/cdn/{FYWV4NZT.js → PKMW2RCH.js} +2 -2
  30. package/dist/cdn/{YBCKVEDH.js → PR5N253S.js} +1 -1
  31. package/dist/cdn/{3P7RAI4N.js → Q3CF5UKE.js} +2 -2
  32. package/dist/cdn/Q7UEAVNT.js +6 -0
  33. package/dist/cdn/{OM4V7KEC.js → QPKVQI5Y.js} +1 -1
  34. package/dist/cdn/{JRSIIKWL.js → QZUXBNJT.js} +2 -2
  35. package/dist/cdn/RCPEVZ5V.js +4 -0
  36. package/dist/cdn/{K4IWIEMY.js → RQMF73R6.js} +2 -2
  37. package/dist/cdn/{YGIQ45LJ.js → RWJJO3FP.js} +2 -2
  38. package/dist/cdn/T2KDBYWG.js +3 -0
  39. package/dist/cdn/{CATGF374.js → TJTK3YW2.js} +2 -2
  40. package/dist/cdn/{IKLWYLLD.js → TPCN2VVJ.js} +2 -2
  41. package/dist/cdn/{VPXGNPZS.js → VSFJ35ZU.js} +1 -1
  42. package/dist/cdn/{DFSPZPKB.js → W5ZYK3R4.js} +1 -1
  43. package/dist/cdn/{TCQ57P4R.js → XYK5GYVJ.js} +2 -2
  44. package/dist/cdn/assets/code-editor/sql-expr.worker.js +31832 -31787
  45. package/dist/cdn/index.js +2 -2
  46. package/dist/chunks/arcade-defaults.js +1 -1
  47. package/dist/chunks/arcade-executor.js +1 -1
  48. package/dist/chunks/arcade-mode.js +1 -1
  49. package/dist/chunks/arcade-service-accessors.js +1 -1
  50. package/dist/chunks/editor.js +2 -2
  51. package/dist/chunks/fields.js +1 -1
  52. package/dist/chunks/language-defaults-base.js +1 -1
  53. package/dist/chunks/markdown.js +1 -1
  54. package/dist/chunks/monaco-importer.js +1 -1
  55. package/dist/chunks/runtime.js +1 -1
  56. package/dist/chunks/setup-monaco.js +1 -1
  57. package/dist/chunks/sql-expr-contribution.js +1 -1
  58. package/dist/chunks/sql-expr-defaults.js +1 -1
  59. package/dist/chunks/sql-expr-mode.js +1 -1
  60. package/dist/chunks/useT9n.js +1 -1
  61. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +113 -115
  62. package/dist/components/arcgis-arcade-editor/customElement.js +18 -19
  63. package/dist/components/arcgis-arcade-results/customElement.js +11 -12
  64. package/dist/components/arcgis-arcade-suggestions/customElement.js +16 -17
  65. package/dist/components/arcgis-code-editor/customElement.js +2 -2
  66. package/dist/components/arcgis-editor-variables/customElement.js +11 -12
  67. package/dist/components/arcgis-language-api-panel/customElement.js +18 -19
  68. package/dist/components/arcgis-sql-expression-editor/customElement.js +13 -14
  69. package/dist/components/arcgis-sql-expression-fields/customElement.js +10 -11
  70. package/dist/docs/api.json +2 -2
  71. package/dist/docs/docs.json +2 -2
  72. package/dist/docs/web-types.json +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/loader.js +1 -1
  75. package/package.json +5 -5
  76. package/dist/cdn/2C7K4H7E.js +0 -6
  77. package/dist/cdn/7OBQWCNR.js +0 -4
  78. package/dist/cdn/BBVNCNMP.js +0 -4
  79. package/dist/cdn/ER6HLB34.js +0 -4
  80. package/dist/cdn/RJOTL5C2.js +0 -4
  81. package/dist/cdn/VSJ5NNQO.js +0 -6
@@ -1,36 +1,34 @@
1
- import { c as V } from "../../chunks/runtime.js";
2
- import { nothing as C, LitElement as L } from "@arcgis/lumina";
3
- import { ref as B, createRef as j } from "lit/directives/ref.js";
4
- import W from "@arcgis/core/identity/IdentityManager.js";
5
- import { u as Q } from "../../chunks/useT9n.js";
6
- import { b as E } from "../../chunks/arcade-defaults.js";
7
- import { css as G } from "@lit/reactive-element/css-tag.js";
8
- import { html as w } from "lit";
9
- import T from "@arcgis/core/request.js";
10
- import { e as J, a as Y } from "../../chunks/monaco-importer.js";
11
- import { html as n } from "lit-html";
12
- import { repeat as F } from "lit-html/directives/repeat.js";
13
- import { generateGuid as K } from "@arcgis/components-utils";
1
+ import { c as H } from "../../chunks/runtime.js";
2
+ import { nothing as A, LitElement as V } from "@arcgis/lumina";
3
+ import { ref as L, createRef as B } from "lit/directives/ref.js";
4
+ import j from "@arcgis/core/identity/IdentityManager.js";
5
+ import { u as W } from "../../chunks/useT9n.js";
6
+ import { b as I } from "../../chunks/arcade-defaults.js";
7
+ import { css as Q, html as r } from "lit";
8
+ import E from "@arcgis/core/request.js";
9
+ import { e as G, a as J } from "../../chunks/monaco-importer.js";
10
+ import { repeat as N } from "lit/directives/repeat.js";
11
+ import { generateGuid as Y } from "@arcgis/components-utils";
14
12
  import { unsafeHTML as k } from "lit/directives/unsafe-html.js";
15
- import X from "@arcgis/core/layers/FeatureLayer.js";
16
- import Z from "@arcgis/core/Graphic.js";
17
- import { b as ee } from "../../chunks/language-defaults-base.js";
13
+ import K from "@arcgis/core/layers/FeatureLayer.js";
14
+ import X from "@arcgis/core/Graphic.js";
15
+ import { b as Z } from "../../chunks/language-defaults-base.js";
18
16
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
19
17
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
20
- v4.34.0-next.46 */
21
- const te = G`:host(:not([closed])){--calcite-block-border-color: var(--calcite-color-transparent);flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem;max-height:30vh;overflow-y:auto}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-button{font-weight:var(--calcite-font-weight-medium)}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}}:host([closed]){display:none}`;
18
+ v4.34.0-next.48 */
19
+ const ee = Q`:host(:not([closed])){--calcite-block-border-color: var(--calcite-color-transparent);flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem;max-height:30vh;overflow-y:auto}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-button{font-weight:var(--calcite-font-weight-medium)}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}}:host([closed]){display:none}`;
22
20
  class $ extends Error {
23
21
  constructor({
24
22
  message: e,
25
23
  code: t,
26
24
  subCode: o,
27
- details: r,
28
- source: c
25
+ details: c,
26
+ source: n
29
27
  }) {
30
- super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = r, this.source = c;
28
+ super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = c, this.source = n;
31
29
  }
32
30
  }
33
- function P(i) {
31
+ function T(i) {
34
32
  if (!i)
35
33
  return;
36
34
  const e = i.indexOf('{"error":');
@@ -43,51 +41,51 @@ function P(i) {
43
41
  return;
44
42
  }
45
43
  }
46
- async function ie(i) {
47
- const { baseUrl: e, skillId: t, message: o, authToken: r, previousConversationId: c, context: h } = i, d = t ? `${e}/skills/${t}/chat` : `${e}/chat`, s = [], m = {
44
+ async function te(i) {
45
+ const { baseUrl: e, skillId: t, message: o, authToken: c, previousConversationId: n, context: h } = i, d = t ? `${e}/skills/${t}/chat` : `${e}/chat`, s = [], m = {
48
46
  message: o,
49
47
  context: h
50
48
  };
51
- c && (m.conversation_id = c);
49
+ n && (m.conversation_id = n);
52
50
  let a;
53
51
  try {
54
- a = await T(d, {
52
+ a = await E(d, {
55
53
  method: "post",
56
54
  headers: {
57
55
  "Content-Type": "application/json",
58
- token: r
56
+ token: c
59
57
  },
60
58
  body: JSON.stringify(m),
61
59
  responseType: "json"
62
60
  });
63
61
  } catch (b) {
64
- const g = b, x = g.details?.rawResponse || g.message || String(b), y = P(x);
62
+ const g = b, x = g.details?.rawResponse || g.message || String(b), y = T(x);
65
63
  throw y ? new $(y) : b;
66
64
  }
67
65
  const l = a.data;
68
66
  s.push(l);
69
- const p = l.conversationId, _ = l.inquiryId;
70
- let S = l.sequenceNumber;
71
- async function z() {
67
+ const p = l.conversationId, D = l.inquiryId;
68
+ let C = l.sequenceNumber;
69
+ async function _() {
72
70
  let b = 0;
73
71
  const g = 25;
74
72
  for (; b < g; ) {
75
73
  await new Promise((v) => setTimeout(v, 1e3));
76
- const x = oe(p, S, _);
74
+ const x = ie(p, C, D);
77
75
  let y;
78
76
  try {
79
- y = await T(d, {
77
+ y = await E(d, {
80
78
  method: "post",
81
79
  headers: {
82
80
  "Content-Type": "application/json",
83
- token: r
81
+ token: c
84
82
  },
85
83
  body: JSON.stringify(x),
86
84
  responseType: "json"
87
85
  });
88
86
  } catch (v) {
89
- const R = v, H = R.details?.rawResponse || R.message || String(v), I = P(H);
90
- throw I ? new $(I) : v;
87
+ const S = v, O = S.details?.rawResponse || S.message || String(v), R = T(O);
88
+ throw R ? new $(R) : v;
91
89
  }
92
90
  const f = y.data;
93
91
  if (f.context && f.context.kind === "ArcgisErrorAsContext" && f.context.error)
@@ -98,7 +96,7 @@ async function ie(i) {
98
96
  details: f.context.error.details,
99
97
  source: "polling-response"
100
98
  });
101
- if (s.push(f), S = f.sequenceNumber, b++, !f.hasMore)
99
+ if (s.push(f), C = f.sequenceNumber, b++, !f.hasMore)
102
100
  break;
103
101
  }
104
102
  if (b === g)
@@ -108,9 +106,9 @@ async function ie(i) {
108
106
  source: "polling"
109
107
  });
110
108
  }
111
- const O = 2 * 60 * 1e3;
109
+ const z = 2 * 60 * 1e3;
112
110
  return await Promise.race([
113
- z(),
111
+ _(),
114
112
  new Promise(
115
113
  (b, g) => setTimeout(
116
114
  () => g(
@@ -120,75 +118,75 @@ async function ie(i) {
120
118
  source: "hard-timeout"
121
119
  })
122
120
  ),
123
- O
121
+ z
124
122
  )
125
123
  )
126
124
  ]), s;
127
125
  }
128
- function oe(i, e, t) {
126
+ function ie(i, e, t) {
129
127
  return {
130
128
  conversationId: i,
131
129
  inquiryId: t,
132
130
  ackSequenceNumber: e
133
131
  };
134
132
  }
135
- function ae(i) {
133
+ function oe(i) {
136
134
  return i.message.match(/Error in prompt shield/u) ? "I'm having trouble with this request. Try again by rephrasing the question." : i.code === "TIMEOUT" ? "I'm having trouble with this request. Try again by re-asking the same question or rephrasing it." : i.message;
137
135
  }
138
- const se = (i) => {
139
- const e = i.value.length, t = 72, o = 180, r = i.offsetWidth, h = Math.max(1, Math.floor(r / 8)), d = Math.ceil(e / h), s = t + (d - 2) * 24;
136
+ const ae = (i) => {
137
+ const e = i.value.length, t = 72, o = 180, c = i.offsetWidth, h = Math.max(1, Math.floor(c / 8)), d = Math.ceil(e / h), s = t + (d - 2) * 24;
140
138
  i.style.setProperty("--calcite-text-area-min-height", `${Math.min(s, o)}px`);
141
139
  };
142
- function re({ messages: i }) {
143
- return n`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
140
+ function se({ messages: i }) {
141
+ return r`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
144
142
  }
145
- function ce({ popoverContent: i }) {
146
- return n`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
143
+ function re({ popoverContent: i }) {
144
+ return r`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
147
145
  }
148
- function D({ errorMessage: i, slot: e }) {
149
- return n`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? C}>${i}</calcite-input-message></div>`;
146
+ function F({ errorMessage: i, slot: e }) {
147
+ return r`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? A}>${i}</calcite-input-message></div>`;
150
148
  }
151
- function ne({ active: i, setActive: e, messages: t }) {
152
- return n`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${t.expressionapplied ?? "Expression applied"}><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
149
+ function ce({ active: i, setActive: e, messages: t }) {
150
+ return r`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${t.expressionapplied ?? "Expression applied"}><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
153
151
  }
154
- function le({ context: i, messages: e }) {
155
- return i ? n`<div class="gaps">${i.profileName && n`<calcite-popover auto-close placement=top .label=${e.profilecontextlabel.replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover"><p>${e.profilecontextlabel.replace("{profileName}", i.profileName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>` || ""}${i.layerName && n`<calcite-popover auto-close placement=top .label=${e.layercontextlabel.replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover"><p>${e.layercontextlabel.replace("{layerName}", i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>` || ""}</div>` : null;
152
+ function ne({ context: i, messages: e }) {
153
+ return i ? r`<div class="gaps">${i.profileName && r`<calcite-popover auto-close placement=top .label=${e.profilecontextlabel.replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover"><p>${e.profilecontextlabel.replace("{profileName}", i.profileName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>` || ""}${i.layerName && r`<calcite-popover auto-close placement=top .label=${e.layercontextlabel.replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover"><p>${e.layercontextlabel.replace("{layerName}", i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>` || ""}</div>` : null;
156
154
  }
157
- function de({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: r, question: c, errorMessage: h, setErrorMessage: d, submitQuestion: s, messages: m, mode: a, context: l }) {
158
- return n`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${m.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${c} @calciteTextAreaInput=${(p) => {
159
- se(p.target), t(p.target.value);
160
- }} ${B(r)}><div class="submission-actions-wrapper" slot=footer-start>${h && D({ errorMessage: h, slot: "footer-start" }) || ""}<div class="submission-actions">${le({ context: l, messages: m })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${a !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
155
+ function le({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: c, question: n, errorMessage: h, setErrorMessage: d, submitQuestion: s, messages: m, mode: a, context: l }) {
156
+ return r`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${m.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${(p) => {
157
+ ae(p.target), t(p.target.value);
158
+ }} ${L(c)}><div class="submission-actions-wrapper" slot=footer-start>${h && F({ errorMessage: h, slot: "footer-start" }) || ""}<div class="submission-actions">${ne({ context: l, messages: m })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${a !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
161
159
  o(!1), t("");
162
160
  }}>${m.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
163
- d(c ? "" : m.enteraprompt ?? "Please enter a prompt"), await s();
161
+ d(n ? "" : m.enteraprompt ?? "Please enter a prompt"), await s();
164
162
  }}>${a === "prompt" ? m.ask ?? "Generate" : m.refine ?? "Refine"}</calcite-button></div></div></div></calcite-text-area></div>`;
165
163
  }
166
- const pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", ue = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
167
- function he({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: r }) {
168
- return t.active ? n`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${() => i(!1)}><calcite-panel .heading=${e.providefeedback ?? "Provide feedback"} .description=${e.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value === "good"} @click=${() => o({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => o({ ...t, value: "bad" })}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${(c) => o({ ...t, text: c.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(c) => {
169
- o({ ...t, termsAccepted: c.target.checked });
170
- }}></calcite-checkbox><span>${k(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${pe} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${ue} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${r} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>` : null;
164
+ const de = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
165
+ function ue({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: c }) {
166
+ return t.active ? r`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${() => i(!1)}><calcite-panel .heading=${e.providefeedback ?? "Provide feedback"} .description=${e.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value === "good"} @click=${() => o({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => o({ ...t, value: "bad" })}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${(n) => o({ ...t, text: n.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(n) => {
167
+ o({ ...t, termsAccepted: n.target.checked });
168
+ }}></calcite-checkbox><span>${k(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${de} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${pe} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${c} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>` : null;
171
169
  }
172
- function q({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: r }) {
173
- return n`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? C} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? n`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${k((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${r} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : n`<p>${k(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
170
+ function P({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: c }) {
171
+ return r`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? A} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? r`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${k((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${c} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : r`<p>${k(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
174
172
  }
175
- function me({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
176
- return n`<calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted}</h3><ul><li>${i.maybeincorrect}</li><li>${k(i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
173
+ function he({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
174
+ return r`<calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted}</h3><ul><li>${i.maybeincorrect}</li><li>${k(i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
177
175
  }
178
- function fe({ messages: i, suggestions: e, onSuggestionClick: t }) {
179
- return n`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions ?? "Prompt Suggestions"}>${F(e, (o) => o, (o) => n`<calcite-button round appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${() => t?.(o)}>${o}</calcite-button>`)}</calcite-chip-group></calcite-block>`;
176
+ function me({ messages: i, suggestions: e, onSuggestionClick: t }) {
177
+ return r`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions ?? "Prompt Suggestions"}>${N(e, (o) => o, (o) => r`<calcite-button round appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${() => t?.(o)}>${o}</calcite-button>`)}</calcite-chip-group></calcite-block>`;
180
178
  }
181
- function M({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: r, collapsible: c = !1, showEffectsIcon: h = !1, onCopyCode: d, standalone: s }) {
179
+ function q({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: c, collapsible: n = !1, showEffectsIcon: h = !1, onCopyCode: d, standalone: s }) {
182
180
  const m = t.addtoeditor ?? "Add to editor";
183
- return n`<calcite-block .hidden=${i} id=result-block .heading=${r ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${c}>${h && n`<calcite-chip .label=${t.assistantresponses} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${F(o, (a) => a.conversationId, (a) => n`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} @click=${(l) => {
181
+ return r`<calcite-block .hidden=${i} id=result-block .heading=${c ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${h && r`<calcite-chip .label=${t.assistantresponses} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${N(o, (a) => a.conversationId, (a) => r`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} @click=${(l) => {
184
182
  const p = l.currentTarget;
185
183
  navigator.clipboard.writeText(a.priorPrompt).then(() => {
186
184
  p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
187
185
  });
188
- }}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard}</calcite-tooltip></div>${a.message && s && n`<div class="response-error-container">${D({ errorMessage: a.message })}</div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext ?? "Response Context"} scale=s>${a.message && !s && n`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start overlay-positioning=fixed>${a.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${a.conversationId}-error`} .label=${t.error ?? "Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>` || ""}${a.chips?.map((l) => {
189
- const p = K();
190
- return n`${l.tooltip && n`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${p}`} placement=top-start overlay-positioning=fixed>${l.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon} .id=${`response-chip-${l.conversationId}-${p}`}>${l.label}</calcite-chip>`;
191
- })}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><code>${a.code}</code></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button primary-text=${m ?? C} class="add-to-editor-button" @click=${() => a.onAddToEditor("add")} overlay-positioning=fixed scale=s icon-start=plus round>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${() => a.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.replaceineditor ?? "Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${(l) => {
186
+ }}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard}</calcite-tooltip></div>${a.message && s && r`<div class="response-error-container">${F({ errorMessage: a.message })}</div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext ?? "Response Context"} scale=s>${a.message && !s && r`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start overlay-positioning=fixed>${a.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${a.conversationId}-error`} .label=${t.error ?? "Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>` || ""}${a.chips?.map((l) => {
187
+ const p = Y();
188
+ return r`${l.tooltip && r`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${p}`} placement=top-start overlay-positioning=fixed>${l.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon} .id=${`response-chip-${l.conversationId}-${p}`}>${l.label}</calcite-chip>`;
189
+ })}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><code>${a.code}</code></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button primary-text=${m ?? A} class="add-to-editor-button" @click=${() => a.onAddToEditor("add")} overlay-positioning=fixed scale=s icon-start=plus round>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${() => a.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.replaceineditor ?? "Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${(l) => {
192
190
  const p = l.currentTarget;
193
191
  d(a.code).then(() => {
194
192
  p.setAttribute("data-copied", "true"), setTimeout(() => p.removeAttribute("data-copied"), 1500);
@@ -236,7 +234,7 @@ const u = {
236
234
  copiedsuccessfully: "Copied successfully",
237
235
  helpful: "Helpful",
238
236
  unhelpful: "Unhelpful"
239
- }, be = "arcade_generation", ge = "ArcadeCodeRequest", A = "visualization", ye = "ArcadeAssistant", ve = [
237
+ }, fe = "arcade_generation", be = "ArcadeCodeRequest", w = "visualization", ge = "ArcadeAssistant", ye = [
240
238
  "your_comments",
241
239
  "user_evaluation",
242
240
  "question",
@@ -247,10 +245,10 @@ const u = {
247
245
  "context",
248
246
  "extras"
249
247
  ];
250
- let U = [], N = !0;
251
- class $e extends L {
248
+ let M = [], U = !0;
249
+ class ve extends V {
252
250
  constructor() {
253
- super(...arguments), this.textAreaRef = j(), this.messages = Q(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
251
+ super(...arguments), this.textAreaRef = B(), this.messages = W(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
254
252
  this.feedback = { active: !0, value: e, item: t, termsAccepted: !1, text: "", submitting: !1 };
255
253
  }, this.handleFeedbackSheetClose = () => {
256
254
  this.feedback = {
@@ -265,7 +263,7 @@ class $e extends L {
265
263
  this.handleFeedbackSheetClose();
266
264
  return;
267
265
  }
268
- const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0, r = {
266
+ const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0, c = {
269
267
  user_evaluation: this.feedback.value,
270
268
  your_comments: this.feedback.text || void 0,
271
269
  question: this.feedback.item?.question ?? "",
@@ -277,7 +275,7 @@ class $e extends L {
277
275
  */
278
276
  answer: encodeURIComponent(this.feedback.item?.formattedScript ?? ""),
279
277
  useragent: navigator.userAgent,
280
- _source: ye,
278
+ _source: ge,
281
279
  version: this.appVersion ?? "",
282
280
  context: o ? JSON.stringify(o) : "",
283
281
  extras: o?.profileName ?? "",
@@ -285,9 +283,9 @@ class $e extends L {
285
283
  privacy_statement: this.feedback.termsAccepted ? "I_agree" : ""
286
284
  };
287
285
  try {
288
- await e.applyEdits({ addFeatures: [new Z({ attributes: r })] });
289
- } catch (c) {
290
- console.error("Error submitting feedback:", c);
286
+ await e.applyEdits({ addFeatures: [new X({ attributes: c })] });
287
+ } catch (n) {
288
+ console.error("Error submitting feedback:", n);
291
289
  }
292
290
  this.handleFeedbackSheetClose();
293
291
  }, this.handleClose = (e) => {
@@ -304,7 +302,7 @@ class $e extends L {
304
302
  this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, splashActive: 16, context: 16, historyCards: 16, closePanel: 0, insertText: 0, helpBase: 1, assistantsEnabled: 5, layer: [1, { type: Object }], portalUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
305
303
  }
306
304
  static {
307
- this.styles = te;
305
+ this.styles = ee;
308
306
  }
309
307
  get disclaimerComment() {
310
308
  return `// ${this.messages.disclaimercomment}
@@ -333,7 +331,7 @@ class $e extends L {
333
331
  };
334
332
  e().catch((t) => {
335
333
  console.error("Error setting initial context in Arcade Assistant:", t);
336
- }), this.manager.onLifecycle(() => ({ remove: E.onModelContextDidChange(async () => {
334
+ }), this.manager.onLifecycle(() => ({ remove: I.onModelContextDidChange(async () => {
337
335
  e().catch((o) => {
338
336
  console.error("Error setting context in Arcade Assistant:", o);
339
337
  });
@@ -343,10 +341,10 @@ class $e extends L {
343
341
  e.has("history") && (this.historyCards = this.getHistoryCards());
344
342
  }
345
343
  connectedCallback() {
346
- super.connectedCallback(), this.history = U, this.splashActive = N;
344
+ super.connectedCallback(), this.history = M, this.splashActive = U;
347
345
  }
348
346
  disconnectedCallback() {
349
- super.disconnectedCallback(), U = this.history, N = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
347
+ super.disconnectedCallback(), M = this.history, U = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
350
348
  }
351
349
  getHistoryCards() {
352
350
  return this.history.reduce((e, t) => (!t.script || (e.push({
@@ -354,12 +352,12 @@ class $e extends L {
354
352
  code: t.formattedScript || t.error || "",
355
353
  chips: [
356
354
  {
357
- label: t.profile ?? A,
355
+ label: t.profile ?? w,
358
356
  icon: "map-information",
359
357
  appearance: "outline",
360
358
  scale: "s",
361
359
  conversationId: t.conversationId ?? "",
362
- tooltip: u.profilecontextlabel.replace("{profileName}", t.profile ?? A)
360
+ tooltip: u.profilecontextlabel.replace("{profileName}", t.profile ?? w)
363
361
  },
364
362
  ...t.layerName ? [
365
363
  {
@@ -373,7 +371,7 @@ class $e extends L {
373
371
  ] : []
374
372
  ],
375
373
  onAddToEditor: (o) => {
376
- J(this.editorRef.editorInstance, t.formattedScript ?? "", o, this.disclaimerComment);
374
+ G(this.editorRef.editorInstance, t.formattedScript ?? "", o, this.disclaimerComment);
377
375
  },
378
376
  onThumbsUp: () => this.handleFeedbackButton("good", t),
379
377
  onThumbsDown: () => this.handleFeedbackButton("bad", t),
@@ -389,9 +387,9 @@ class $e extends L {
389
387
  return this._feedbackService;
390
388
  if (!this.feedbackServiceUrl)
391
389
  return;
392
- const e = new X({ url: this.feedbackServiceUrl });
390
+ const e = new K({ url: this.feedbackServiceUrl });
393
391
  await e.load();
394
- const t = ve.filter((o) => !e.fields.some((r) => r.name === o));
392
+ const t = ye.filter((o) => !e.fields.some((c) => c.name === o));
395
393
  if (t.length > 0) {
396
394
  console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
397
395
  return;
@@ -408,16 +406,16 @@ class $e extends L {
408
406
  const e = await this.getToken(), t = this.getModel();
409
407
  if (!t)
410
408
  return;
411
- const { profileName: o, metadata: r, layerName: c } = await this.getProfileAndMetadata(t.uri), d = (await ie({
409
+ const { profileName: o, metadata: c, layerName: n } = await this.getProfileAndMetadata(t.uri), d = (await te({
412
410
  baseUrl: this.serviceUrl,
413
- skillId: be,
411
+ skillId: fe,
414
412
  message: this.question,
415
413
  authToken: e,
416
414
  context: {
417
- kind: ge,
415
+ kind: be,
418
416
  context: {
419
417
  profile_name: o,
420
- metadata: r
418
+ metadata: c
421
419
  }
422
420
  }
423
421
  })).find((s) => s.context?.kind === "ArcadeCodeResponse");
@@ -426,40 +424,40 @@ class $e extends L {
426
424
  d.context?.kind === "ArcadeCodeResponse" && (this.history = [
427
425
  {
428
426
  script: d?.context?.arcadeCode?.code,
429
- formattedScript: Y(d?.context?.arcadeCode?.code ?? ""),
427
+ formattedScript: J(d?.context?.arcadeCode?.code ?? ""),
430
428
  error: void 0,
431
429
  question: this.question,
432
430
  profile: o,
433
431
  conversationId: d.conversationId,
434
- layerName: c ?? void 0,
432
+ layerName: n ?? void 0,
435
433
  ...d.message ? { message: d.message } : {}
436
434
  },
437
435
  ...this.history
438
436
  ], this.isViewingResult = !0, this.errorMessage = void 0);
439
437
  } catch (e) {
440
- e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = ae(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
438
+ e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = oe(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
441
439
  } finally {
442
440
  this.isSubmitting = !1;
443
441
  }
444
442
  }
445
443
  }
446
444
  async getToken() {
447
- const { token: e } = await W.getCredential(this.portalUrl);
445
+ const { token: e } = await j.getCredential(this.portalUrl);
448
446
  return e;
449
447
  }
450
448
  async getProfileAndMetadata(e) {
451
- let t = A;
452
- const o = E.getEditorProfileForModel(e);
449
+ let t = w;
450
+ const o = I.getEditorProfileForModel(e);
453
451
  o?.loaded || await o?.loadSource();
454
- const r = this.editorRef.profile;
455
- r && "id" in r && (t = r.id);
456
- const c = o?.definition?.variables?.find((s) => s.type === "feature");
452
+ const c = this.editorRef.profile;
453
+ c && "id" in c && (t = c.id);
454
+ const n = o?.definition?.variables?.find((s) => s.type === "feature");
457
455
  let h = [], d;
458
- return c?.definition && "fields" in c.definition && (h = c.definition.fields.map((s) => ({
456
+ return n?.definition && "fields" in n.definition && (h = n.definition.fields.map((s) => ({
459
457
  name: s.name,
460
458
  type: s.type,
461
459
  alias: s.alias
462
- })), ee(c?.definition) && (d = c.definition.title)), { profileName: t, metadata: h, layerName: d };
460
+ })), Z(n?.definition) && (d = n.definition.title)), { profileName: t, metadata: h, layerName: d };
463
461
  }
464
462
  onCopyCode(e) {
465
463
  const t = e ? `${this.disclaimerComment}
@@ -467,9 +465,9 @@ ${e}` : "";
467
465
  return navigator.clipboard.writeText(t);
468
466
  }
469
467
  render() {
470
- return this.closed ? null : this.assistantsEnabled ? w`<calcite-flow><calcite-flow-item closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && w`<calcite-scrim></calcite-scrim>` || ""}${re({ messages: this.messages })}${ce({ popoverContent: q({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...u }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && me({ messages: { ...u, ...this.messages }, onProceed: () => {
468
+ return this.closed ? null : this.assistantsEnabled ? r`<calcite-flow><calcite-flow-item closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && r`<calcite-scrim></calcite-scrim>` || ""}${se({ messages: this.messages })}${re({ popoverContent: P({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...u }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && he({ messages: { ...u, ...this.messages }, onProceed: () => {
471
469
  this.splashActive = !1;
472
- }, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ne({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${de({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...u, ...this.messages }, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && fe({ messages: { ...this.messages, ...u }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${M({
470
+ }, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ce({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${le({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...u, ...this.messages }, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && me({ messages: { ...this.messages, ...u }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${q({
473
471
  expanded: this.isViewingResult,
474
472
  messages: { ...this.messages, ...u },
475
473
  collapsible: !0,
@@ -480,7 +478,7 @@ ${e}` : "";
480
478
  hidden: this.isSubmitting || !this.isViewingResult,
481
479
  onCopyCode: this.onCopyCode.bind(this),
482
480
  standalone: !0
483
- })}${M({
481
+ })}${q({
484
482
  expanded: !this.isViewingResult,
485
483
  messages: { ...this.messages, ...u },
486
484
  collapsible: !0,
@@ -494,10 +492,10 @@ ${e}` : "";
494
492
  heading: this.messages.recentprompts ?? "Recent prompts",
495
493
  hidden: this.isSubmitting || this.history.length === 0,
496
494
  onCopyCode: this.onCopyCode.bind(this)
497
- })}</calcite-block-group>${this.feedback.active ? he({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...u }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : w`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${q({ slot: "content-top", messages: { ...this.messages, ...u }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
495
+ })}</calcite-block-group>${this.feedback.active ? ue({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...u }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : r`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${P({ slot: "content-top", messages: { ...this.messages, ...u }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
498
496
  }
499
497
  }
500
- V("arcgis-arcade-coding-assistant", $e);
498
+ H("arcgis-arcade-coding-assistant", ve);
501
499
  export {
502
- $e as ArcgisArcadeCodingAssistant
500
+ ve as ArcgisArcadeCodingAssistant
503
501
  };