@arcgis/coding-components 5.1.0-next.96 → 5.1.0-next.98

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.
@@ -1,28 +1,28 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as h } from "../../chunks/runtime.js";
2
+ import { c as v } from "../../chunks/runtime.js";
3
3
  import { css as u, html as r } from "lit";
4
- import { repeat as p } from "lit/directives/repeat.js";
5
- import { LitElement as f, safeClassMap as w, nothing as g } from "@arcgis/lumina";
4
+ import { repeat as g } from "lit/directives/repeat.js";
5
+ import { LitElement as f, safeClassMap as w, nothing as b } from "@arcgis/lumina";
6
6
  import { u as x } from "../../chunks/useT9n.js";
7
- import { load as k } from "@arcgis/lumina/controllers";
8
- import { i as S } from "../../chunks/monaco-importer.js";
7
+ import { load as S } from "@arcgis/lumina/controllers";
8
+ import { i as $ } from "../../chunks/monaco-importer.js";
9
9
  import { t as l } from "../../chunks/functional.js";
10
- import { d as $, g as y, c as b } from "../../chunks/debugger-value-styles.js";
11
- import { i as v, a as T, p as P, b as L, c as E, d as C, S as B, D as z, e as M } from "../../chunks/debugger-value-components.js";
12
- import { observeAncestorsMutation as I, unsafeGetCalciteModeName as V } from "@arcgis/toolkit/dom";
13
- import { generateGuid as D } from "@arcgis/toolkit/string";
14
- import { d as c } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
15
- import { Uri as A } from "monaco-editor";
16
- const N = u`:host{--calcite-block-padding: var(--calcite-spacing-sm);--breakpoints-popover-max-height: min(14rem, 20vh);display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);overflow:hidden;height:100%;.console-shell,.tabs-container,calcite-tabs{height:100%}.tabs-container{flex:1 1 auto;min-height:0;overflow:hidden}.console-shell,calcite-tabs{display:flex;flex-direction:column;min-height:0}.console-shell{container-type:size;container-name:debugger-console}calcite-tab-nav{--calcite-size-2xl: var(--calcite-space-md);justify-content:flex-start;padding-inline:var(--calcite-spacing-sm)}calcite-tab-title{font-size:var(--calcite-font-size-sm)}calcite-tab{--calcite-tab-content-block-padding: 0;--calcite-tab-content-space-y: 0;display:flex;flex-direction:column;min-height:0}calcite-tab:not([selected]){display:none}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;text-align:center;display:block;padding:var(--calcite-spacing-md)}.breakpoint-header{display:flex;align-items:flex-start;gap:var(--calcite-spacing-sm);padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.load-action{--calcite-action-background-color: var(--calcite-color-foreground-2);--calcite-internal-action-height: 1.25rem;--calcite-internal-action-padding-block: 0;--calcite-internal-action-padding-inline: var(--calcite-spacing-xs);margin-block:var(--calcite-spacing-xxs)}.breakpoint-code-viewer{margin-block:0;width:100%}.tab-panel{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}.tab-panel>*{flex:1 1 auto;min-height:0}.tab-panel>calcite-tree{margin-inline-end:var(--calcite-space-sm)}.preview-panel{display:flex;flex:1 1 auto;min-height:0}.preview-empty-state{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:var(--calcite-spacing-md)}.preview-table-shell{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0;overflow:hidden}.preview-table-summary{padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-2);font-family:var(--calcite-code-family);background-color:var(--calcite-color-foreground-1)}.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-sm)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}.breakpoints-popover{--calcite-popover-max-size-x: min(22rem, 68vw)}.breakpoints-popover-content{max-block-size:var(--breakpoints-popover-max-height);overflow:hidden}.breakpoints-list{display:flex;flex-direction:column;gap:var(--calcite-spacing-xs);padding:var(--calcite-spacing-xs);min-width:min(18rem,58vw);max-block-size:var(--breakpoints-popover-max-height);overflow:auto}.breakpoints-popover .breakpoint-code-viewer{--calcite-font-size--2: var(--calcite-font-size--3);--calcite-spacing-md: var(--calcite-spacing-sm);--calcite-spacing-sm: var(--calcite-spacing-xs);--calcite-spacing-xs: var(--calcite-spacing-xxs)}.breakpoint-list-item{border:1px solid var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sharp);background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-xxs)}.breakpoint-list-item--current{border-color:var(--calcite-color-brand)}.breakpoint-list-item-meta{color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-xs);margin-bottom:var(--calcite-spacing-xxs)}}`;
17
- class F extends f {
10
+ import { d as k, g as y, c as m } from "../../chunks/debugger-value-styles.js";
11
+ import { i as h, a as P, p as T, b as E, c as L, d as C, S as M, D as B, e as V } from "../../chunks/debugger-value-components.js";
12
+ import { observeAncestorsMutation as z, unsafeGetCalciteModeName as I } from "@arcgis/toolkit/dom";
13
+ import { generateGuid as A } from "@arcgis/toolkit/string";
14
+ import { d as p } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
15
+ import { Uri as D } from "monaco-editor";
16
+ const F = u`:host{--calcite-block-padding: var(--calcite-spacing-sm);--breakpoints-popover-max-height: min(14rem, 20vh);display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);overflow:hidden;height:100%;.console-shell,.tabs-container,calcite-tabs{height:100%}.tabs-container{flex:1 1 auto;min-height:0;overflow:hidden}.console-shell,calcite-tabs{display:flex;flex-direction:column;min-height:0}.console-shell{container-type:size;container-name:debugger-console}calcite-tab-nav{--calcite-size-2xl: var(--calcite-space-md);justify-content:flex-start;padding-inline:var(--calcite-spacing-sm)}calcite-tab-title{font-size:var(--calcite-font-size-sm)}calcite-tab{--calcite-tab-content-block-padding: 0;--calcite-tab-content-space-y: 0;display:flex;flex-direction:column;min-height:0}calcite-tab:not([selected]){display:none}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;text-align:center;display:block;padding:var(--calcite-spacing-md)}.breakpoint-header{display:flex;align-items:flex-start;gap:var(--calcite-spacing-sm);padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.load-action{--calcite-action-background-color: var(--calcite-color-foreground-2);--calcite-internal-action-height: 1.25rem;--calcite-internal-action-padding-block: 0;--calcite-internal-action-padding-inline: var(--calcite-spacing-xs);margin-block:var(--calcite-spacing-xxs)}.breakpoint-code-viewer{margin-block:0;width:100%}.tab-panel{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}.tab-panel>*{flex:1 1 auto;min-height:0}.tab-panel>calcite-tree{margin-inline-end:var(--calcite-space-sm)}.preview-panel{display:flex;flex:1 1 auto;min-height:0}.preview-empty-state{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:var(--calcite-spacing-md)}.preview-table-shell{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0;overflow:hidden}.preview-table-summary{padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-2);font-family:var(--calcite-code-family);background-color:var(--calcite-color-foreground-1)}.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-sm)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}.breakpoints-popover{--calcite-popover-max-size-x: min(22rem, 68vw)}.breakpoints-popover-content{max-block-size:var(--breakpoints-popover-max-height);overflow:hidden}.breakpoints-list{display:flex;flex-direction:column;gap:var(--calcite-spacing-xs);padding:var(--calcite-spacing-xs);min-width:min(18rem,58vw);max-block-size:var(--breakpoints-popover-max-height);overflow:auto}.breakpoints-popover .breakpoint-code-viewer{--calcite-font-size--2: var(--calcite-font-size--3);--calcite-spacing-md: var(--calcite-spacing-sm);--calcite-spacing-sm: var(--calcite-spacing-xs);--calcite-spacing-xs: var(--calcite-spacing-xxs)}.breakpoint-list-item{border:1px solid var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sharp);background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-xxs)}.breakpoint-list-item--current{border-color:var(--calcite-color-brand)}.breakpoint-list-item-meta{color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-xs);margin-bottom:var(--calcite-spacing-xxs)}}`;
17
+ class N extends f {
18
18
  constructor() {
19
- super(...arguments), this.messages = x(), this._monacoEditor = k(S), this._breakpointPopoverId = `arcade-debugger-console-breakpoints-${D()}`, this.modelId = "";
19
+ super(...arguments), this.messages = x(), this._monacoEditor = S($), this._breakpointPopoverId = `arcade-debugger-console-breakpoints-${A()}`, this.modelId = "";
20
20
  }
21
21
  static {
22
22
  this.properties = { debuggerStore: 0, modelId: 1 };
23
23
  }
24
24
  static {
25
- this.styles = [N, $, y()];
25
+ this.styles = [F, k, y()];
26
26
  }
27
27
  get breakpoints() {
28
28
  return this.debuggerStore?.debuggerBreakpoints ?? [];
@@ -33,20 +33,23 @@ class F extends f {
33
33
  get lazyTreeState() {
34
34
  return this.debuggerStore?.lazyTreeState;
35
35
  }
36
+ get executionProgramState() {
37
+ return this.debuggerStore?.executionState?.result;
38
+ }
36
39
  load() {
37
40
  this.manager.onLifecycle(() => {
38
- const e = I(this.el, ["class"], this.updateTheme.bind(this));
41
+ const e = z(this.el, ["class"], this.updateTheme.bind(this));
39
42
  return this.updateTheme(), () => e();
40
43
  });
41
44
  }
42
45
  getContentAtLine(e) {
43
46
  if (!this.modelId)
44
47
  return "";
45
- const t = this._monacoEditor.getModel(A.parse(this.modelId));
48
+ const t = this._monacoEditor.getModel(D.parse(this.modelId));
46
49
  return t ? t.getLineContent(e) : "";
47
50
  }
48
51
  updateTheme() {
49
- V(this.el) === "dark" ? this.elementInternals.states.add(b) : this.elementInternals.states.delete(b);
52
+ I(this.el) === "dark" ? this.elementInternals.states.add(m) : this.elementInternals.states.delete(m);
50
53
  }
51
54
  getBreakpointCode(e) {
52
55
  return e == null ? this.messages.nocontent ?? "No content" : this.getContentAtLine(e) || (this.messages.nocontent ?? "No content");
@@ -59,84 +62,94 @@ class F extends f {
59
62
  }
60
63
  findCollectionItemByPreviewSegment(e, t) {
61
64
  if (t.startsWith("name:")) {
62
- const i = t.slice(5);
63
- return e.find((a) => a.name === i)?.featureSet;
65
+ const a = t.slice(5);
66
+ return e.find((i) => i.name === a)?.featureSet;
64
67
  }
65
68
  if (t.startsWith("id:")) {
66
- const i = t.slice(3);
67
- return e.find((a) => String(a.id) === i)?.featureSet;
69
+ const a = t.slice(3);
70
+ return e.find((i) => String(i.id) === a)?.featureSet;
68
71
  }
69
72
  }
70
73
  getExpandedDebuggerMap(e) {
71
- if (e == null || !v(e))
74
+ if (e == null || !h(e))
72
75
  return null;
73
76
  const t = e.expand();
74
77
  return Array.isArray(t) ? null : t;
75
78
  }
76
79
  getPreviewRows(e) {
77
80
  return e.map((t) => {
78
- const i = this.getExpandedDebuggerMap(t);
79
- return i || /* @__PURE__ */ new Map();
81
+ const a = this.getExpandedDebuggerMap(t);
82
+ return a || /* @__PURE__ */ new Map();
80
83
  });
81
84
  }
82
85
  getExpandedDebuggerChild(e, t) {
83
- if (!e || !v(e))
86
+ if (!e || !h(e))
84
87
  return;
85
- const i = e.expand();
86
- if (Array.isArray(i)) {
87
- const a = Number(t);
88
- return !Number.isInteger(a) || String(a) !== t ? void 0 : i[a];
88
+ const a = e.expand();
89
+ if (Array.isArray(a)) {
90
+ const i = Number(t);
91
+ return !Number.isInteger(i) || String(i) !== t ? void 0 : a[i];
89
92
  }
90
- return i.get(t);
93
+ return a.get(t);
91
94
  }
92
95
  async resolvePreviewValueFromSegments(e, t) {
93
96
  if (!t.length)
94
97
  return e;
95
98
  if (!e)
96
99
  return;
97
- const [i, ...a] = t;
98
- let s;
99
- if (T(e)) {
100
- const o = await e.load();
101
- s = this.findCollectionItemByPreviewSegment(o, i);
100
+ const [a, ...i] = t;
101
+ let o;
102
+ if (P(e)) {
103
+ const s = await e.load();
104
+ o = this.findCollectionItemByPreviewSegment(s, a);
102
105
  } else
103
- s = this.getExpandedDebuggerChild(e, i);
104
- return await this.resolvePreviewValueFromSegments(s, a);
106
+ o = this.getExpandedDebuggerChild(e, a);
107
+ return await this.resolvePreviewValueFromSegments(o, i);
108
+ }
109
+ getScope(e, t) {
110
+ switch (t) {
111
+ case "profile":
112
+ return e.profile;
113
+ case "globals":
114
+ return e.globals;
115
+ case "locals":
116
+ return e.locals;
117
+ }
105
118
  }
106
119
  async resolvePreviewValue(e) {
107
- const t = this.debuggerStore?.executionState?.result;
120
+ const t = this.executionProgramState;
108
121
  if (!t)
109
122
  return;
110
- const i = P(e);
111
- if (!i)
123
+ const a = T(e);
124
+ if (!a)
112
125
  return;
113
- const { scopeName: a, rootName: s, pathSegments: o } = i, n = a === "globals" ? t.globals : a === "locals" ? t.locals : null;
126
+ const { scopeName: i, rootName: o, pathSegments: s } = a, n = this.getScope(t, i);
114
127
  if (n)
115
- return await this.resolvePreviewValueFromSegments(n.get(s), o);
128
+ return await this.resolvePreviewValueFromSegments(n.get(o), s);
116
129
  }
117
- async loadPreview({ label: e, sourcePath: t, value: i }) {
118
- const a = this.previewTabsState, { snapshot: s } = a.startLoad(e, t);
119
- let o = i;
120
- if (o == null)
130
+ async loadPreview({ label: e, sourcePath: t, value: a }) {
131
+ const i = this.previewTabsState, { snapshot: o } = i.startLoad(e, t);
132
+ let s = a;
133
+ if (s == null)
121
134
  try {
122
- o = await this.resolvePreviewValue(t);
135
+ s = await this.resolvePreviewValue(t);
123
136
  } catch {
124
- a.setError(s, this.getPreviewLoadErrorMessage());
137
+ i.setError(o, this.getPreviewLoadErrorMessage());
125
138
  return;
126
139
  }
127
- if (o == null || !L(o) || typeof o.querySample != "function" || typeof o.schema != "function") {
128
- a.setUnavailable(s, this.messages.previewunavailable ?? "This preview is no longer available in the current paused state.");
140
+ if (s == null || !E(s) || typeof s.querySample != "function" || typeof s.schema != "function") {
141
+ i.setUnavailable(o, this.messages.previewunavailable ?? "This preview is no longer available in the current paused state.");
129
142
  return;
130
143
  }
131
144
  try {
132
- const { fields: n, features: d } = await o.querySample(), m = this.getPreviewRows(d);
133
- a.setLoaded(s, n, m);
145
+ const { fields: n, features: d } = await s.querySample(), c = this.getPreviewRows(d);
146
+ i.setLoaded(o, n, c);
134
147
  } catch {
135
- a.setError(s, this.getPreviewLoadErrorMessage());
148
+ i.setError(o, this.getPreviewLoadErrorMessage());
136
149
  }
137
150
  }
138
151
  activateTab(e) {
139
- if (e === c) {
152
+ if (e === p) {
140
153
  this.previewTabsState.selectScope();
141
154
  return;
142
155
  }
@@ -153,24 +166,27 @@ class F extends f {
153
166
  t?.querySelector(".breakpoint-list-item--current")?.scrollIntoView({ block: "center" });
154
167
  });
155
168
  }
169
+ sortScopeEntries(e) {
170
+ return e.sort(([t], [a]) => t.localeCompare(a));
171
+ }
156
172
  renderPreviewLabel(e) {
157
173
  return r`<bdi>${e}</bdi>`;
158
174
  }
159
175
  renderPreviewCell(e) {
160
- return e ? E(e) || C(e) ? B({ value: e }) : r`<span class="xs"></span>` : r`<span class="xs"></span>`;
176
+ return e ? L(e) || C(e) ? M({ value: e }) : r`<span class="xs"></span>` : r`<span class="xs"></span>`;
161
177
  }
162
- renderScopeEntryForScope(e, t, i) {
163
- const [a, s] = i, o = `${t}.${a}`, n = this.lazyTreeState;
164
- return n ? z({ name: a, value: s, messages: this.messages, path: `${e}.${a}`, lazyTreeState: n, previewLabel: o, previewSourcePath: M(e, a), previewLoading: this.previewTabsState.isTabLoading(o), onLoadPreview: (d) => {
178
+ renderScopeEntryForScope(e, t, a) {
179
+ const [i, o] = a, s = `${t}.${i}`, n = this.lazyTreeState;
180
+ return n ? B({ name: i, value: o, messages: this.messages, path: `${e}.${i}`, lazyTreeState: n, previewLabel: s, previewSourcePath: V(e, i), previewLoading: this.previewTabsState.isTabLoading(s), onLoadPreview: (d) => {
165
181
  this.loadPreview(d);
166
182
  } }) : null;
167
183
  }
168
184
  renderBreakpointPopover(e) {
169
- return this.breakpoints.length ? r`<calcite-popover .referenceElement=${this._breakpointPopoverId} placement=bottom-end scale=s auto-close focus-trap-disabled @calcitePopoverOpen=${(t) => this.scrollToSelectedBreakpoint(t)} .label=${this.messages.breakpoints ?? "Breakpoints"} class="breakpoints-popover" .heading=${this.messages.breakpoints ?? "Breakpoints"} heading-level=2><div class="breakpoints-popover-content"><div class="breakpoints-list">${this.breakpoints.map((t, i) => r`<div class=${w(t.line === e ? "breakpoint-list-item breakpoint-list-item--current" : "breakpoint-list-item")}><div class="breakpoint-list-item-meta"><bdi>${this.getBreakpointPositionText(i + 1)}</bdi></div><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(a) => String(a + t.line - 1)}>${this.getBreakpointCode(t.line)}</arcgis-code-viewer></div>`)}</div></div></calcite-popover>` : null;
185
+ return this.breakpoints.length ? r`<calcite-popover .referenceElement=${this._breakpointPopoverId} placement=bottom-end scale=s auto-close focus-trap-disabled @calcitePopoverOpen=${(t) => this.scrollToSelectedBreakpoint(t)} .label=${this.messages.breakpoints ?? "Breakpoints"} class="breakpoints-popover" .heading=${this.messages.breakpoints ?? "Breakpoints"} heading-level=2><div class="breakpoints-popover-content"><div class="breakpoints-list">${this.breakpoints.map((t, a) => r`<div class=${w(t.line === e ? "breakpoint-list-item breakpoint-list-item--current" : "breakpoint-list-item")}><div class="breakpoint-list-item-meta"><bdi>${this.getBreakpointPositionText(a + 1)}</bdi></div><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(i) => String(i + t.line - 1)}>${this.getBreakpointCode(t.line)}</arcgis-code-viewer></div>`)}</div></div></calcite-popover>` : null;
170
186
  }
171
187
  renderScopePanel() {
172
- const e = this.debuggerStore?.executionState?.result, t = !!(e?.locals && e.locals.size > 0), i = Array.from(e?.globals ?? []), a = Array.from(e?.locals ?? []);
173
- return e ? r`<calcite-tree .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect} .lines=${l.lines} .selectionMode=${l.selectionMode}><calcite-tree-item expanded>${this.messages.global ?? "Global"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${i.map((s) => this.renderScopeEntryForScope("globals", this.messages.global ?? "Global", s))}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!t}>${this.messages.local ?? "Local"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${t ? a.map((s) => this.renderScopeEntryForScope("locals", this.messages.local ?? "Local", s)) : r`<span><i>${this.messages.nolocalscope ?? "No local scope"}</i></span>`}</calcite-tree></calcite-tree-item></calcite-tree>` : this.debuggerStore?.isExecuting ? r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"} .text=${this.messages.loading ?? "Loading"}></calcite-loader></div>` : r`<span class="disabled-state-text">${this.messages.notpaused ?? "Not paused"}</span>`;
188
+ const e = this.executionProgramState, t = this.sortScopeEntries(Array.from(e?.profile ?? [])), a = this.sortScopeEntries(Array.from(e?.globals ?? [])), i = e?.locals ? this.sortScopeEntries(Array.from(e?.locals ?? [])) : void 0, o = !!e?.locals, s = i && i.length > 0, n = t.length > 0, d = a.length > 0;
189
+ return e ? r`<calcite-tree .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect} .lines=${l.lines} .selectionMode=${l.selectionMode}><calcite-tree-item expanded .disabled=${!s}>${this.messages.local ?? "Local"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${o ? s ? i.map((c) => this.renderScopeEntryForScope("locals", this.messages.local ?? "Local", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>` : r`<span><i>${this.messages.nolocalscope ?? "No local scope"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!d}>${this.messages.global ?? "Global"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${d ? a.map((c) => this.renderScopeEntryForScope("globals", this.messages.global ?? "Global", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!n}>${this.messages.profile ?? "Profile"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${n ? t.map((c) => this.renderScopeEntryForScope("profile", this.messages.profile ?? "Profile", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>`}</calcite-tree></calcite-tree-item></calcite-tree>` : this.debuggerStore?.isExecuting ? r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"} .text=${this.messages.loading ?? "Loading"}></calcite-loader></div>` : r`<span class="disabled-state-text">${this.messages.notpaused ?? "Not paused"}</span>`;
174
190
  }
175
191
  renderPreviewPanel(e) {
176
192
  switch (e.status) {
@@ -180,22 +196,22 @@ class F extends f {
180
196
  case "error":
181
197
  return r`<span class="disabled-state-text">${e.message}</span>`;
182
198
  case "loaded":
183
- const { fields: t, label: i, rows: a } = e;
184
- return !a.length || !t.length ? r`<span class="disabled-state-text">${this.messages.nopreviewrows ?? "No preview rows available."}</span>` : r`<div class="preview-table-shell"><div class="preview-table-summary">${this.renderPreviewLabel(i)}</div><div class="table-scroll"><table><thead><tr>${t.map((s) => r`<th><bdi>${s}</bdi></th>`)}</tr></thead><tbody>${a.map((s) => r`<tr>${t.map((o) => r`<td>${this.renderPreviewCell(s.get(o))}</td>`)}</tr>`)}</tbody></table></div></div>`;
199
+ const { fields: t, label: a, rows: i } = e;
200
+ return !i.length || !t.length ? r`<span class="disabled-state-text">${this.messages.nopreviewrows ?? "No preview rows available."}</span>` : r`<div class="preview-table-shell"><div class="preview-table-summary">${this.renderPreviewLabel(a)}</div><div class="table-scroll"><table><thead><tr>${t.map((o) => r`<th><bdi>${o}</bdi></th>`)}</tr></thead><tbody>${i.map((o) => r`<tr>${t.map((s) => r`<td>${this.renderPreviewCell(o.get(s))}</td>`)}</tr>`)}</tbody></table></div></div>`;
185
201
  default:
186
202
  return r`<span class="disabled-state-text">${this.messages.nopreviewloaded ?? "Select a FeatureSet variable and load a preview."}</span>`;
187
203
  }
188
204
  }
189
205
  renderTabs() {
190
206
  const e = this.previewTabsState.activeTabId;
191
- return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${c} .selected=${e === c} @calciteTabsActivate=${(t) => this.activateTab(t.target.tab)}>${this.messages.scope ?? "Scope"}</calcite-tab-title>${p(this.previewTabsState.tabs, (t) => `title-${t.id}`, (t) => r`<calcite-tab-title .tab=${t.id} title=${t.label ?? g} closable .selected=${e === t.id} @calciteTabsActivate=${(i) => this.activateTab(i.target.tab)} @calciteTabsClose=${(i) => this.closePreviewTab(i.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${c} .selected=${e === c}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${p(this.previewTabsState.tabs, (t) => `panel-${t.id}`, (t) => r`<calcite-tab .tab=${t.id} .selected=${e === t.id}><div class="tab-panel preview-panel">${this.renderPreviewPanel(t)}</div></calcite-tab>`)}</calcite-tabs>`;
207
+ return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${p} .selected=${e === p} @calciteTabsActivate=${(t) => this.activateTab(t.target.tab)}>${this.messages.scope ?? "Scope"}</calcite-tab-title>${g(this.previewTabsState.tabs, (t) => `title-${t.id}`, (t) => r`<calcite-tab-title .tab=${t.id} title=${t.label ?? b} closable .selected=${e === t.id} @calciteTabsActivate=${(a) => this.activateTab(a.target.tab)} @calciteTabsClose=${(a) => this.closePreviewTab(a.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${p} .selected=${e === p}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${g(this.previewTabsState.tabs, (t) => `panel-${t.id}`, (t) => r`<calcite-tab .tab=${t.id} .selected=${e === t.id}><div class="tab-panel preview-panel">${this.renderPreviewPanel(t)}</div></calcite-tab>`)}</calcite-tabs>`;
192
208
  }
193
209
  render() {
194
- const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((a) => a.line === e), i = this.breakpoints.findIndex((a) => a.line === e);
195
- return r`<div class="console-shell"><div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(a) => String(a + (t?.line ?? e ?? 1) - 1)}>${this.getBreakpointCode(t?.line ?? this.breakpoints[0]?.line ?? e ?? 1)}</arcgis-code-viewer>${this.breakpoints.length ? r`<calcite-action id=${this._breakpointPopoverId ?? g} scale=s .text=${this.getBreakpointPositionText(i >= 0 ? i + 1 : 1)} text-enabled icon=chevron-down></calcite-action>` : null}${this.renderBreakpointPopover(t?.line ?? e)}</div><div class="tabs-container">${this.renderTabs()}</div></div>`;
210
+ const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((i) => i.line === e), a = this.breakpoints.findIndex((i) => i.line === e);
211
+ return r`<div class="console-shell"><div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(i) => String(i + (t?.line ?? e ?? 1) - 1)}>${this.getBreakpointCode(t?.line ?? this.breakpoints[0]?.line ?? e ?? 1)}</arcgis-code-viewer>${this.breakpoints.length ? r`<calcite-action id=${this._breakpointPopoverId ?? b} scale=s .text=${this.getBreakpointPositionText(a >= 0 ? a + 1 : 1)} text-enabled icon=chevron-down></calcite-action>` : null}${this.renderBreakpointPopover(t?.line ?? e)}</div><div class="tabs-container">${this.renderTabs()}</div></div>`;
196
212
  }
197
213
  }
198
- h("arcgis-arcade-debugger-console", F);
214
+ v("arcgis-arcade-debugger-console", N);
199
215
  export {
200
- F as ArcgisArcadeDebuggerConsole
216
+ N as ArcgisArcadeDebuggerConsole
201
217
  };