@arcgis/coding-components 4.34.0-next.45 → 4.34.0-next.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addons.js +1 -1
- package/dist/cdn/3XLMLFOA.js +4 -0
- package/dist/cdn/{FLIBYULR.js → 5HCZZLVW.js} +2 -2
- package/dist/cdn/{G5ZJJ5HJ.js → 5QNSPDPZ.js} +2 -2
- package/dist/cdn/{UR656G6Q.js → 5ROKA75S.js} +2 -2
- package/dist/cdn/{OV7QCRJM.js → 6CKTEK6H.js} +2 -2
- package/dist/cdn/{VMFR2UM7.js → 7EMBMB7O.js} +2 -2
- package/dist/cdn/{RDINNFXG.js → 7LPK7GXX.js} +2 -2
- package/dist/cdn/{AC7CXSLG.js → AMKC3KCF.js} +2 -2
- package/dist/cdn/{WP35YULQ.js → B4IV3BPD.js} +2 -2
- package/dist/cdn/{TKB26H6G.js → CFCB3LAG.js} +1 -1
- package/dist/cdn/DN47ZLQ7.js +4 -0
- package/dist/cdn/E2UU2CSX.js +6 -0
- package/dist/cdn/{DLWMCS3I.js → F76JFZUC.js} +2 -2
- package/dist/cdn/{LFOJWKJS.js → FBFR4GH7.js} +2 -2
- package/dist/cdn/{YHVVQWGS.js → FKZCYMYX.js} +2 -2
- package/dist/cdn/{J626PAJC.js → FSO6AN5U.js} +2 -2
- package/dist/cdn/{OLOYINUO.js → FXNTMV4Q.js} +2 -2
- package/dist/cdn/{VP3BLC7O.js → FZW6DCZ2.js} +1 -1
- package/dist/cdn/{JXGM3JD6.js → GV5QCCFN.js} +2 -2
- package/dist/cdn/H72A7LBB.js +4 -0
- package/dist/cdn/{G5GNFSKG.js → JDLLCRU2.js} +2 -2
- package/dist/cdn/{CTE2KALO.js → K2DJMWVS.js} +2 -2
- package/dist/cdn/{OYHPMKU2.js → K6NZA5IZ.js} +2 -2
- package/dist/cdn/{KCZEGMLB.js → KNC4XW2C.js} +2 -2
- package/dist/cdn/{TXEBWUJB.js → L5URIWGX.js} +1 -1
- package/dist/cdn/{BYFGLAKM.js → LEJQLPNW.js} +2 -2
- package/dist/cdn/{GRJD3YSJ.js → LR4OGK7T.js} +4 -4
- package/dist/cdn/MTGKPNFZ.js +6 -0
- package/dist/cdn/{IP2NP65N.js → NL7H7DW7.js} +2 -2
- package/dist/cdn/{WDTMSDTN.js → RHAFOSNH.js} +2 -2
- package/dist/cdn/SJFMTHCW.js +4 -0
- package/dist/cdn/{Y24RGSPQ.js → T4YQRA3M.js} +2 -2
- package/dist/cdn/{F2RY2VBB.js → TO5QFM35.js} +1 -1
- package/dist/cdn/{L37TRTOT.js → UILSUACV.js} +2 -2
- package/dist/cdn/{WO45MG6K.js → VLYPIC5F.js} +2 -2
- package/dist/cdn/{ANIBK6R6.js → VT5FD66I.js} +1 -1
- package/dist/cdn/{SLSD32VB.js → WET4WXIG.js} +2 -2
- package/dist/cdn/{GKDDSRJD.js → WTZCOTVD.js} +2 -2
- package/dist/cdn/{HKCNMLZL.js → WUD7KHQF.js} +2 -2
- package/dist/cdn/{7HAX2DYJ.js → Y4VFZN7B.js} +2 -2
- package/dist/cdn/{MQFRXQA7.js → YINWQZ6P.js} +2 -2
- package/dist/cdn/ZU5UPJRZ.js +3 -0
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +61827 -60995
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/editor.js +2 -2
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/setup-monaco.js +1 -1
- package/dist/chunks/sql-expr-contribution.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +113 -115
- package/dist/components/arcgis-arcade-editor/customElement.js +18 -19
- package/dist/components/arcgis-arcade-results/customElement.js +12 -13
- package/dist/components/arcgis-arcade-suggestions/customElement.js +16 -17
- package/dist/components/arcgis-code-editor/customElement.js +2 -2
- package/dist/components/arcgis-editor-variables/customElement.js +11 -12
- package/dist/components/arcgis-language-api-panel/customElement.js +18 -19
- package/dist/components/arcgis-sql-expression-editor/customElement.js +13 -14
- package/dist/components/arcgis-sql-expression-fields/customElement.js +10 -11
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +6 -5
- package/dist/cdn/FJHYM2AU.js +0 -4
- package/dist/cdn/LMGUIARR.js +0 -4
- package/dist/cdn/M2KCTBHI.js +0 -6
- package/dist/cdn/MLVPFCHF.js +0 -4
- package/dist/cdn/ONYNCDWF.js +0 -4
- package/dist/cdn/TOKFJNMD.js +0 -6
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { nothing as
|
|
3
|
-
import { ref as
|
|
4
|
-
import
|
|
5
|
-
import { u as
|
|
6
|
-
import { b as
|
|
7
|
-
import { css as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
|
16
|
-
import
|
|
17
|
-
import { b as
|
|
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.
|
|
21
|
-
const
|
|
18
|
+
v4.34.0-next.47 */
|
|
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:
|
|
28
|
-
source:
|
|
25
|
+
details: c,
|
|
26
|
+
source: n
|
|
29
27
|
}) {
|
|
30
|
-
super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details =
|
|
28
|
+
super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = c, this.source = n;
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
function
|
|
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
|
|
47
|
-
const { baseUrl: e, skillId: t, message: o, authToken:
|
|
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
|
-
|
|
49
|
+
n && (m.conversation_id = n);
|
|
52
50
|
let a;
|
|
53
51
|
try {
|
|
54
|
-
a = await
|
|
52
|
+
a = await E(d, {
|
|
55
53
|
method: "post",
|
|
56
54
|
headers: {
|
|
57
55
|
"Content-Type": "application/json",
|
|
58
|
-
token:
|
|
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 =
|
|
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,
|
|
70
|
-
let
|
|
71
|
-
async function
|
|
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 =
|
|
74
|
+
const x = ie(p, C, D);
|
|
77
75
|
let y;
|
|
78
76
|
try {
|
|
79
|
-
y = await
|
|
77
|
+
y = await E(d, {
|
|
80
78
|
method: "post",
|
|
81
79
|
headers: {
|
|
82
80
|
"Content-Type": "application/json",
|
|
83
|
-
token:
|
|
81
|
+
token: c
|
|
84
82
|
},
|
|
85
83
|
body: JSON.stringify(x),
|
|
86
84
|
responseType: "json"
|
|
87
85
|
});
|
|
88
86
|
} catch (v) {
|
|
89
|
-
const
|
|
90
|
-
throw
|
|
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),
|
|
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
|
|
109
|
+
const z = 2 * 60 * 1e3;
|
|
112
110
|
return await Promise.race([
|
|
113
|
-
|
|
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
|
-
|
|
121
|
+
z
|
|
124
122
|
)
|
|
125
123
|
)
|
|
126
124
|
]), s;
|
|
127
125
|
}
|
|
128
|
-
function
|
|
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
|
|
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
|
|
139
|
-
const e = i.value.length, t = 72, o = 180,
|
|
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
|
|
143
|
-
return
|
|
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
|
|
146
|
-
return
|
|
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
|
|
149
|
-
return
|
|
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
|
|
152
|
-
return
|
|
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
|
|
155
|
-
return i ?
|
|
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
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
}} ${
|
|
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(
|
|
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
|
|
167
|
-
function
|
|
168
|
-
return t.active ?
|
|
169
|
-
o({ ...t, termsAccepted:
|
|
170
|
-
}}></calcite-checkbox><span>${k(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${
|
|
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
|
|
173
|
-
return
|
|
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
|
|
176
|
-
return
|
|
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
|
|
179
|
-
return
|
|
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
|
|
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
|
|
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 &&
|
|
189
|
-
const p =
|
|
190
|
-
return
|
|
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 ??
|
|
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
|
-
},
|
|
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
|
|
251
|
-
class
|
|
248
|
+
let M = [], U = !0;
|
|
249
|
+
class ve extends V {
|
|
252
250
|
constructor() {
|
|
253
|
-
super(...arguments), this.textAreaRef =
|
|
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,
|
|
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:
|
|
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
|
|
289
|
-
} catch (
|
|
290
|
-
console.error("Error submitting feedback:",
|
|
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 =
|
|
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:
|
|
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 =
|
|
344
|
+
super.connectedCallback(), this.history = M, this.splashActive = U;
|
|
347
345
|
}
|
|
348
346
|
disconnectedCallback() {
|
|
349
|
-
super.disconnectedCallback(),
|
|
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 ??
|
|
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 ??
|
|
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
|
-
|
|
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
|
|
390
|
+
const e = new K({ url: this.feedbackServiceUrl });
|
|
393
391
|
await e.load();
|
|
394
|
-
const t =
|
|
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:
|
|
409
|
+
const { profileName: o, metadata: c, layerName: n } = await this.getProfileAndMetadata(t.uri), d = (await te({
|
|
412
410
|
baseUrl: this.serviceUrl,
|
|
413
|
-
skillId:
|
|
411
|
+
skillId: fe,
|
|
414
412
|
message: this.question,
|
|
415
413
|
authToken: e,
|
|
416
414
|
context: {
|
|
417
|
-
kind:
|
|
415
|
+
kind: be,
|
|
418
416
|
context: {
|
|
419
417
|
profile_name: o,
|
|
420
|
-
metadata:
|
|
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:
|
|
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:
|
|
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 =
|
|
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
|
|
445
|
+
const { token: e } = await j.getCredential(this.portalUrl);
|
|
448
446
|
return e;
|
|
449
447
|
}
|
|
450
448
|
async getProfileAndMetadata(e) {
|
|
451
|
-
let t =
|
|
452
|
-
const o =
|
|
449
|
+
let t = w;
|
|
450
|
+
const o = I.getEditorProfileForModel(e);
|
|
453
451
|
o?.loaded || await o?.loadSource();
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
const
|
|
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
|
|
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
|
-
})),
|
|
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 ?
|
|
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) }) || ""}${
|
|
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
|
-
})}${
|
|
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 ?
|
|
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
|
-
|
|
498
|
+
H("arcgis-arcade-coding-assistant", ve);
|
|
501
499
|
export {
|
|
502
|
-
|
|
500
|
+
ve as ArcgisArcadeCodingAssistant
|
|
503
501
|
};
|