@arcgis/coding-components 5.1.0-next.55 → 5.1.0-next.57

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 (87) hide show
  1. package/dist/cdn/2XTHR2WZ.js +2 -0
  2. package/dist/cdn/3QKEF7NL.js +2 -0
  3. package/dist/cdn/{RJRCBNNO.js → 57WNN7NN.js} +1 -1
  4. package/dist/cdn/6E4U2MLJ.js +7 -0
  5. package/dist/cdn/{PKG2K3V2.js → A2OAI373.js} +1 -1
  6. package/dist/cdn/AAMHIVYL.js +2 -0
  7. package/dist/cdn/AHDVGYFC.js +2 -0
  8. package/dist/cdn/CZ2DJPO4.js +2 -0
  9. package/dist/cdn/D6BJOZGQ.js +2 -0
  10. package/dist/cdn/DGFH2WPL.js +2 -0
  11. package/dist/cdn/FLNLMLTL.js +2 -0
  12. package/dist/cdn/{UZJHWA6T.js → FUBRHCFC.js} +1 -1
  13. package/dist/cdn/{PVL67WGX.js → FYW5NKEJ.js} +1 -1
  14. package/dist/cdn/LSBKL6MO.js +6 -0
  15. package/dist/cdn/MVAB75O7.js +2 -0
  16. package/dist/cdn/QGCNEBN6.js +4 -0
  17. package/dist/cdn/SV4IPD4A.js +2 -0
  18. package/dist/cdn/T6RFLFX3.js +2 -0
  19. package/dist/cdn/TBTVVU6V.js +2 -0
  20. package/dist/cdn/V63C7RKJ.js +2 -0
  21. package/dist/cdn/{6YD47X7H.js → VILW5AVK.js} +1 -1
  22. package/dist/cdn/VPP77CFW.js +2 -0
  23. package/dist/cdn/W2PBO44R.js +12 -0
  24. package/dist/cdn/{4A2CLADY.js → WNKEPEXN.js} +1 -1
  25. package/dist/cdn/{54ZOADNQ.js → XU4GWM7C.js} +1 -1
  26. package/dist/cdn/YPMKBMXS.js +2 -0
  27. package/dist/cdn/ZCXZTSQU.js +2 -0
  28. package/dist/cdn/ZHZFKZA7.js +2 -0
  29. package/dist/cdn/assets/arcade-editor/t9n/messages.en.json +1 -1
  30. package/dist/cdn/assets/code-editor/sql-expr.worker.js +119 -116
  31. package/dist/cdn/assets/code-editor/sql-layer.worker.js +10087 -0
  32. package/dist/cdn/assets/editor-variables/t9n/messages.en.json +1 -1
  33. package/dist/cdn/assets/sql-expression-editor/t9n/messages.en.json +1 -1
  34. package/dist/cdn/assets/sql-layer-editor/t9n/messages.en.json +1 -0
  35. package/dist/cdn/index.js +1 -1
  36. package/dist/cdn/main.css +1 -1
  37. package/dist/chunks/arcade-defaults.js +98 -96
  38. package/dist/chunks/arcade-service-accessors.js +40 -28
  39. package/dist/chunks/bigquery.js +186 -0
  40. package/dist/chunks/colorize.js +1 -1
  41. package/dist/chunks/fields.js +2 -2
  42. package/dist/chunks/language-defaults-base.js +733 -464
  43. package/dist/chunks/postgres.js +209 -0
  44. package/dist/chunks/setup-monaco-theme.js +28 -20
  45. package/dist/chunks/sql-expr-defaults.js +11 -10
  46. package/dist/chunks/sql-layer-defaults.js +231 -0
  47. package/dist/chunks/sql-layer-mode.js +301 -0
  48. package/dist/chunks/sqlServer.js +288 -0
  49. package/dist/chunks/utils.js +184 -0
  50. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +134 -123
  51. package/dist/components/arcgis-arcade-editor/customElement.d.ts +17 -0
  52. package/dist/components/arcgis-arcade-editor/customElement.js +22 -22
  53. package/dist/components/arcgis-code-editor/customElement.d.ts +2 -1
  54. package/dist/components/arcgis-code-editor/customElement.js +91 -71
  55. package/dist/components/arcgis-editor-variables/customElement.js +50 -47
  56. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +12 -0
  57. package/dist/components/arcgis-sql-expression-editor/customElement.js +17 -17
  58. package/dist/components/arcgis-sql-layer-editor/customElement.d.ts +50 -0
  59. package/dist/components/arcgis-sql-layer-editor/customElement.js +92 -0
  60. package/dist/components/arcgis-sql-layer-editor/index.d.ts +1 -0
  61. package/dist/components/arcgis-sql-layer-editor/index.js +7 -0
  62. package/dist/components/types.d.ts +79 -2
  63. package/dist/docs/api.json +1 -1
  64. package/dist/docs/docs.json +1 -1
  65. package/dist/docs/vscode.html-custom-data.json +1 -1
  66. package/dist/docs/web-types.json +1 -1
  67. package/dist/index.d.ts +10 -0
  68. package/dist/loader.js +6 -5
  69. package/dist/types/lumina.d.ts +9 -2
  70. package/dist/types/preact.d.ts +10 -2
  71. package/dist/types/react.d.ts +11 -2
  72. package/dist/types/stencil.d.ts +9 -2
  73. package/dist/utils/data-catalog-datastore.d.ts +170 -0
  74. package/package.json +5 -5
  75. package/dist/cdn/5CO7XWOT.js +0 -2
  76. package/dist/cdn/5FXY5U3T.js +0 -2
  77. package/dist/cdn/CYC4AWZE.js +0 -2
  78. package/dist/cdn/GVO3LEFV.js +0 -2
  79. package/dist/cdn/J5X2KSYD.js +0 -2
  80. package/dist/cdn/QHJAF7L3.js +0 -6
  81. package/dist/cdn/T7GEIGWF.js +0 -2
  82. package/dist/cdn/TAXRVBJC.js +0 -2
  83. package/dist/cdn/VR5CATAW.js +0 -2
  84. package/dist/cdn/WTNM2NCZ.js +0 -2
  85. package/dist/cdn/XEUG3X2W.js +0 -2
  86. package/dist/cdn/ZJCI6LP6.js +0 -12
  87. package/dist/cdn/ZSVJAJND.js +0 -4
@@ -1,269 +1,382 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import g from "@arcgis/core/layers/FeatureLayer.js";
3
- import te from "@arcgis/core/request.js";
4
- import { p as ie } from "./utilities.js";
5
- import re from "@arcgis/core/portal/PortalItem.js";
6
- import se from "@arcgis/core/WebMap.js";
7
- import ne from "@arcgis/core/WebScene.js";
8
- import { getDeclaredVoxelMembers as oe, getDeclaredPixelMembers as ae } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
9
- import { isNotNull as v, isNotUndefined as k } from "@arcgis/toolkit/predicate";
10
- import { addLtrMark as le, setValuesInString as G } from "@arcgis/toolkit/string";
11
- import { s as w, f as ue, a as m, m as pe, b as ce } from "./fields.js";
12
- import { CompletionItemKind as F, InsertTextFormat as x, InsertTextMode as I } from "vscode-languageserver-types";
2
+ import { l as D, j as ie, o as re, p as se, q as ae, r as oe, s as ne, t as Q, u as d, v as j, w as le, x as ue, y as G, z as ce, A as pe, B as he, C as w, D as U, E as T, F as de, G as v, H as O, I as fe, n as _e } from "./utils.js";
3
+ import { p as me } from "./utilities.js";
4
+ import ye from "@arcgis/core/portal/PortalItem.js";
5
+ import be from "@arcgis/core/WebMap.js";
6
+ import ge from "@arcgis/core/WebScene.js";
7
+ import P from "@arcgis/core/layers/FeatureLayer.js";
8
+ import { getDeclaredVoxelMembers as De, getDeclaredPixelMembers as we } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
9
+ import { isNotNull as m, isNotUndefined as I } from "@arcgis/toolkit/predicate";
10
+ import { addLtrMark as Se, setValuesInString as R } from "@arcgis/toolkit/string";
11
+ import { s as C, f as J, a as Z, b as S, m as Ie } from "./fields.js";
12
+ import { CompletionItemKind as x, InsertTextFormat as V, InsertTextMode as M } from "vscode-languageserver-types";
13
13
  import { log as h } from "@arcgis/toolkit/log";
14
- import { i as he } from "./monaco-importer.js";
15
- import { g as fe } from "./runtime.js";
16
- import { normalizeLocale as de } from "@arcgis/toolkit/intl";
17
- import { filterApiLibraryForContext as ye } from "@arcgis/languages-api-utils";
18
- import { Emitter as E, Uri as j } from "monaco-editor";
19
- function q(t) {
20
- return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && t.declaredClass.startsWith("esri.layers.") && D(t) && "queryFeatures" in t && typeof t.queryFeatures == "function";
21
- }
22
- function K(t) {
23
- return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && (t.declaredClass === "esri.Map" || t.declaredClass === "esri.WebMap" || t.declaredClass === "esri.WebScene");
24
- }
25
- function _e(t) {
26
- return !!t && typeof t == "object" && "loadAll" in t && typeof t.loadAll == "function";
27
- }
28
- function z(t) {
29
- return !!t && typeof t == "object" && "portalItem" in t && t.portalItem != null;
30
- }
31
- function H(t) {
32
- return !!t && typeof t == "object" && "portalItem" in t && t.portalItem != null;
33
- }
34
- function D(t) {
35
- return !!t && typeof t == "object" && "fields" in t && Array.isArray(t.fields);
36
- }
37
- function C(t) {
38
- return !!t && typeof t == "object" && "url" in t && typeof t.url == "string";
39
- }
40
- function be(t) {
41
- return C(t) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url ?? "");
42
- }
43
- function J(t) {
44
- return C(t) || D(t) || H(t);
45
- }
46
- function et(t) {
47
- return J(t) && "type" in t && t.type === "voxel";
48
- }
49
- function tt(t) {
50
- return J(t) && "type" in t && (t.type === "imagery" || t.type === "imagery-tile");
51
- }
52
- function it(t) {
53
- return C(t) || D(t) || H(t);
54
- }
55
- function rt(t) {
56
- return z(t) || K(t) || be(t);
57
- }
58
- function N(t) {
59
- return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.Subtype";
60
- }
61
- function S(t) {
62
- return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.CodedValueDomain";
63
- }
64
- function me(t) {
65
- return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.InheritedDomain";
66
- }
67
- function st(t) {
68
- return !!t && typeof t == "object" && "id" in t && typeof t.id == "string" && "definitions" in t && typeof t.definitions == "object" && !Array.isArray(t.definitions);
69
- }
70
- function f(t) {
71
- return !!t && typeof t == "object" && "title" in t && typeof t.title == "string";
72
- }
73
- function ge(t) {
74
- return !!t && typeof t == "object" && "url" in t && typeof t.url == "string";
75
- }
76
- function Q(t) {
77
- return !!t && typeof t == "object" && "layerId" in t && typeof t.layerId == "number";
14
+ import Ce from "@arcgis/core/core/Error.js";
15
+ import ve from "@arcgis/core/portal/Portal.js";
16
+ import { i as Fe } from "./monaco-importer.js";
17
+ import { g as Te } from "./runtime.js";
18
+ import { normalizeLocale as Pe } from "@arcgis/toolkit/intl";
19
+ import { filterApiLibraryForContext as xe } from "@arcgis/languages-api-utils";
20
+ import { Emitter as N, Uri as B } from "monaco-editor";
21
+ function Ve(s) {
22
+ switch (s) {
23
+ case "esriFieldTypeOID":
24
+ return "oid";
25
+ case "esriFieldTypeSmallInteger":
26
+ return "small-integer";
27
+ case "esriFieldTypeInteger":
28
+ return "integer";
29
+ case "esriFieldTypeBigInteger":
30
+ return "big-integer";
31
+ case "esriFieldTypeSingle":
32
+ return "single";
33
+ case "esriFieldTypeDouble":
34
+ return "double";
35
+ case "esriFieldTypeDate":
36
+ return "date";
37
+ case "esriFieldTypeDateOnly":
38
+ return "date-only";
39
+ case "esriFieldTypeTimeOnly":
40
+ return "time-only";
41
+ case "esriFieldTypeTimestampOffset":
42
+ return "timestamp-offset";
43
+ case "esriFieldTypeGUID":
44
+ return "guid";
45
+ case "esriFieldTypeGlobalID":
46
+ return "global-id";
47
+ case "esriFieldTypeString":
48
+ return "string";
49
+ case "esriFieldTypeGeometry":
50
+ return "geometry";
51
+ case "esriFieldTypeBlob":
52
+ return "blob";
53
+ case "esriFieldTypeRaster":
54
+ return "raster";
55
+ case "esriFieldTypeXML":
56
+ return "xml";
57
+ default:
58
+ return "string";
59
+ }
78
60
  }
79
- function P(t) {
80
- return !!t && typeof t == "object" && "typeIdField" in t && "types" in t;
61
+ function Me(s) {
62
+ return {
63
+ fields: s.fields.map((e) => ({
64
+ name: e.name,
65
+ type: Ve(e.type),
66
+ serverType: e.type,
67
+ nullable: e.nullable
68
+ }))
69
+ };
81
70
  }
82
- function U(t) {
83
- return !!t && typeof t == "object" && "getFieldDomain" in t && typeof t.getFieldDomain == "function";
71
+ function k(s) {
72
+ return typeof s?.query == "object" && s.query ? s.query : {};
84
73
  }
85
- function y(t) {
86
- return !!t && typeof t == "object" && "subtypeField" in t;
74
+ class Le {
75
+ constructor(e) {
76
+ this.itemId = e.itemId, this.portal = e.portal, this.serviceUrl = e.serviceUrl, this._requestOptions = e.requestOptions;
77
+ }
78
+ /**
79
+ * Fetches information about the datastore.
80
+ *
81
+ * @public
82
+ * @since 5.1
83
+ * @param options - Additional options used for the request.
84
+ * @returns Resolves to datastore information.
85
+ */
86
+ fetchInfo(e) {
87
+ return this.portal.request(this._datastoreUrl, this._createRequestOptions(e));
88
+ }
89
+ /**
90
+ * Fetches datasets for the datastore.
91
+ *
92
+ * @public
93
+ * @since 5.1
94
+ * @param options - Additional options used for the request.
95
+ * @returns Resolves to an array of dataset information.
96
+ */
97
+ async fetchDatasets(e) {
98
+ return (await this.portal.request(
99
+ F(this._datastoreUrl, "datasets"),
100
+ this._createRequestOptions(e)
101
+ )).datasets;
102
+ }
103
+ /**
104
+ * Fetches the table description for the provided table name.
105
+ *
106
+ * @public
107
+ * @since 5.1
108
+ * @param tableName - The table name.
109
+ * @param options - Additional options used for the request.
110
+ * @returns Resolves to the table description.
111
+ */
112
+ async fetchTableDescription(e, t) {
113
+ if (!e)
114
+ throw new Ce("portal:invalid-parameter", 'The "tableName" parameter must be provided.');
115
+ const i = await this.portal.request(
116
+ F(this._datastoreUrl, "tableDescription"),
117
+ {
118
+ ...this._createRequestOptions(t),
119
+ query: {
120
+ ...k(this._requestOptions),
121
+ ...k(t),
122
+ tableName: e
123
+ }
124
+ }
125
+ );
126
+ return Me(i);
127
+ }
128
+ get _datastoreUrl() {
129
+ return F(this.serviceUrl, "datastores", encodeURIComponent(this.itemId));
130
+ }
131
+ _createRequestOptions(e) {
132
+ return {
133
+ ...this._requestOptions,
134
+ ...e
135
+ };
136
+ }
87
137
  }
88
- function we(t) {
89
- return y(t) && "subtypes" in t;
138
+ function F(s, ...e) {
139
+ const t = s.replaceAll(/\/+$/gu, ""), i = e.filter((r) => !!r).map((r) => r.replaceAll(/^\/+|\/+$/gu, ""));
140
+ return [t, ...i].join("/");
90
141
  }
91
- function De(t) {
92
- return !!t && typeof t == "object" && "portalItem" in t;
142
+ const $e = {
143
+ id: "ansi",
144
+ keywords: [],
145
+ functions: [],
146
+ operators: [],
147
+ specialChars: {
148
+ likeWildcardAny: "%",
149
+ likeWildcardOne: "_",
150
+ identifierQuote: { start: '"', end: '"' },
151
+ escapeKey: { start: null, end: null },
152
+ escapeClause: { keyword: "ESCAPE", suffix: null }
153
+ }
154
+ }, z = /* @__PURE__ */ new Map(), Ee = {
155
+ ansi: async () => await Promise.resolve($e),
156
+ bigquery: async () => (await import("./bigquery.js")).bigqueryDialect,
157
+ postgres: async () => (await import("./postgres.js")).postgresDialect,
158
+ sqlServer: async () => (await import("./sqlServer.js")).sqlServerDialect
159
+ };
160
+ async function Ae(s) {
161
+ const e = z.get(s);
162
+ if (e)
163
+ return await e;
164
+ const t = Ee[s]();
165
+ return z.set(s, t), await t;
93
166
  }
94
- function Ce(t) {
95
- return Q(t) && "relationships" in t && "url" in t && Array.isArray(t.relationships) && typeof t.url == "string";
167
+ const qe = [
168
+ "SELECT",
169
+ "FROM",
170
+ "WHERE",
171
+ "GROUP",
172
+ "BY",
173
+ "HAVING",
174
+ "ORDER",
175
+ "LIMIT",
176
+ "DISTINCT",
177
+ "AS",
178
+ "JOIN",
179
+ "LEFT",
180
+ "RIGHT",
181
+ "FULL",
182
+ "INNER",
183
+ "OUTER",
184
+ "CROSS",
185
+ "ON",
186
+ "USING",
187
+ "AND",
188
+ "OR",
189
+ "NOT",
190
+ "IN",
191
+ "IS",
192
+ "LIKE",
193
+ "BETWEEN",
194
+ "NULL",
195
+ "TRUE",
196
+ "FALSE",
197
+ "ASC",
198
+ "DESC"
199
+ ], Ge = ["<=", ">=", "<>", "!=", "=", "<", ">", "+", "-", "*", "/", "%", "||"], Ue = (s, e = {}) => {
200
+ const t = new Set(e.baseKeywords ?? qe);
201
+ for (const r of s.keywords)
202
+ t.add(r.toUpperCase());
203
+ const i = new Set(e.baseOperators ?? Ge);
204
+ for (const r of s.operators)
205
+ i.add(r);
206
+ return {
207
+ keywords: Array.from(t),
208
+ functions: s.functions,
209
+ operators: Array.from(i),
210
+ specialChars: s.specialChars
211
+ };
212
+ }, _ = {
213
+ sqlServer: "sql-layer-sql-server",
214
+ postgres: "sql-layer-postgres",
215
+ bigquery: "sql-layer-bigquery"
216
+ }, W = _.postgres, Oe = {
217
+ [_.sqlServer]: "sqlServer",
218
+ [_.postgres]: "postgres",
219
+ [_.bigquery]: "bigquery"
220
+ // snowflake and oracle should be prioritized next
221
+ };
222
+ function Re(s) {
223
+ return Oe[s];
96
224
  }
97
- function Se(t) {
98
- return !!t && typeof t == "object" && "isTable" in t && typeof t.isTable == "boolean";
225
+ async function Ne(s) {
226
+ return Ue(await Ae(Re(s)));
99
227
  }
100
- function ve(t) {
101
- if (t && typeof t == "object") {
102
- if (Se(t))
103
- return t.isTable || "type" in t && t.type === "table";
104
- if ("geometryType" in t)
105
- return t.geometryType === "" || t.geometryType === "esriGeometryNull" || t.geometryType === null;
106
- }
107
- return !1;
228
+ const Be = /^[A-Za-z_][A-Za-z0-9_$]*$/u;
229
+ function ke(s) {
230
+ return s === "esriDBMS_PostgreSQL" ? W : s === "esriDBMS_SQLServer" ? _.sqlServer : W;
108
231
  }
109
- function Fe(t) {
110
- return !ve(t);
232
+ function It(s) {
233
+ return s.trim().toLowerCase();
111
234
  }
112
- function xe(t) {
113
- return !!t && typeof t == "object" && "load" in t && typeof t.load == "function";
235
+ function ze(s) {
236
+ return s.specialChars.identifierQuote;
114
237
  }
115
- function Ie(t) {
116
- return !!t && typeof t == "object" && "type" in t && t.type === "voxel";
238
+ function We(s, e) {
239
+ const t = s.trim();
240
+ return t ? Be.test(t) ? e.keywords.includes(t.toUpperCase()) : !0 : !1;
117
241
  }
118
- function B(t) {
119
- return !!t && typeof t == "object" && "type" in t && typeof t.type == "string" && ["imagery", "imagery-tile"].includes(t.type);
242
+ function X(s, e) {
243
+ const t = s.trim();
244
+ if (!t || !We(t, e))
245
+ return t;
246
+ const i = ze(e), r = t.replaceAll(i.end, `${i.end}${i.end}`);
247
+ return `${i.start}${r}${i.end}`;
120
248
  }
121
- async function X(t) {
122
- if (!t)
123
- return null;
124
- let e;
125
- return D(t) ? e = t : e = new g(t), xe(e) && await e.load(), e;
249
+ function He(s, e) {
250
+ return s.split(".").map((t) => X(t, e)).join(".");
126
251
  }
127
- async function Pe(t) {
128
- t += "/layers";
129
- const e = await te(t, { responseType: "json", query: { f: "json" } }), i = t.endsWith("MapServer/layers") ? "data" : "query", r = W(e.data?.layers, i), s = W(e.data?.tables, i);
130
- return { layers: r, tables: s };
252
+ function Ct(s) {
253
+ return s.split(".").at(-1) ?? s;
131
254
  }
132
- function W(t, e) {
133
- return t ? t.filter((i) => {
134
- switch (i.type) {
135
- case "Feature Layer":
136
- case "Oriented Imagery Layer":
137
- case "Catalog Layer":
138
- case "Table":
139
- return (i.capabilities ? i.capabilities.toLowerCase().split(",").map((s) => s.trim()) : []).includes(e);
140
- default:
141
- return !1;
142
- }
143
- }) : [];
255
+ function Ke(s) {
256
+ return Ne(ke(s));
144
257
  }
145
- async function Ve(t, e) {
146
- const i = new g({ url: `${t.url}/${e.relatedTableId}` });
147
- return await i.load(), i;
258
+ async function Qe(s, e) {
259
+ const t = new P({ url: `${s.url}/${e.relatedTableId}` });
260
+ return await t.load(), t;
148
261
  }
149
- function V(t) {
150
- return (e, i) => {
262
+ function L(s) {
263
+ return (e, t) => {
151
264
  if (e.type === "oid")
152
265
  return -1;
153
- if (i.type === "oid")
266
+ if (t.type === "oid")
154
267
  return 1;
155
- if (y(t)) {
156
- if (e.name === t.subtypeField)
268
+ if (w(s)) {
269
+ if (e.name === s.subtypeField)
157
270
  return -1;
158
- if (i.name === t.subtypeField)
271
+ if (t.name === s.subtypeField)
159
272
  return 1;
160
273
  }
161
- if (P(t)) {
162
- if (e.name === t.typeIdField)
274
+ if (T(s)) {
275
+ if (e.name === s.typeIdField)
163
276
  return -1;
164
- if (i.name === t.typeIdField)
277
+ if (t.name === s.typeIdField)
165
278
  return 1;
166
279
  }
167
- return e.name.localeCompare(i.name, "en", { sensitivity: "base" });
280
+ return e.name.localeCompare(t.name, "en", { sensitivity: "base" });
168
281
  };
169
282
  }
170
- function R(t, e) {
171
- return t?.every((i) => i.domains?.[e.name]?.type === "inherited") ?? !1;
283
+ function H(s, e) {
284
+ return s?.every((t) => t.domains?.[e.name]?.type === "inherited") ?? !1;
172
285
  }
173
- const Te = /^[a-z_$][a-z0-9_$]*$/giu;
174
- function T(t, e = !0) {
175
- return t.match(Te) ? `${e ? "." : ""}${t}` : `["${t}"]`;
286
+ const je = /^[a-z_$][a-z0-9_$]*$/giu;
287
+ function $(s, e = !0) {
288
+ return s.match(je) ? `${e ? "." : ""}${s}` : `["${s}"]`;
176
289
  }
177
- function Y(t, e) {
178
- return t ? `${t}${T(e)}` : e;
290
+ function Y(s, e) {
291
+ return s ? `${s}${$(e)}` : e;
179
292
  }
180
- function O(t) {
181
- return De(t) ? t.portalItem : null;
293
+ function K(s) {
294
+ return ce(s) ? s.portalItem : null;
182
295
  }
183
- function nt(t, e, i = !1) {
184
- let r = e;
185
- const s = [], n = [];
186
- return w(t).forEach((o) => {
187
- r && (r += `
296
+ function vt(s, e, t = !1) {
297
+ let i = e;
298
+ const r = [], a = [];
299
+ return C(s).forEach((o) => {
300
+ i && (i += `
188
301
 
189
- `), r += `**${o.name}** (${o.alias})
190
- ${o.type}`, o.description && (r += `
302
+ `), i += `**${o.name}** (${o.alias})
303
+ ${o.type}`, o.description && (i += `
191
304
  '${o.description}`);
192
- const c = ce(o), p = T(o.name, !1), b = m(o);
193
- if (s.push({
305
+ const p = Z(o), c = $(o.name, !1), g = S(o);
306
+ if (r.push({
194
307
  name: o.name,
195
- description: b,
196
- type: c,
308
+ description: g,
309
+ type: p,
197
310
  completion: {
198
311
  label: o.name,
199
- detail: b,
200
- insertText: p,
201
- insertTextMode: I.asIs,
202
- insertTextFormat: x.PlainText,
203
- kind: F.Field
312
+ detail: g,
313
+ insertText: c,
314
+ insertTextMode: M.asIs,
315
+ insertTextFormat: V.PlainText,
316
+ kind: x.Field
204
317
  }
205
- }), i) {
318
+ }), t) {
206
319
  if (!o.alias || o.alias.toLowerCase() === o.name.toLowerCase())
207
320
  return;
208
- let d = `**${o.alias}**
321
+ let f = `**${o.alias}**
209
322
  ${o.type}`;
210
- o.description && (d += `
211
- '${o.description}`), n.push({
323
+ o.description && (f += `
324
+ '${o.description}`), a.push({
212
325
  name: o.alias,
213
326
  description: o.name,
214
- type: c,
327
+ type: p,
215
328
  completion: {
216
329
  label: o.alias,
217
330
  detail: o.name,
218
- insertText: p,
219
- insertTextMode: I.asIs,
220
- insertTextFormat: x.PlainText,
221
- kind: F.Field,
222
- documentation: { kind: "markdown", value: d }
331
+ insertText: c,
332
+ insertTextMode: M.asIs,
333
+ insertTextFormat: V.PlainText,
334
+ kind: x.Field,
335
+ documentation: { kind: "markdown", value: f }
223
336
  }
224
337
  });
225
338
  }
226
- }), [[...s, ...n], r];
339
+ }), [[...r, ...a], i];
227
340
  }
228
- function ot(t, e) {
229
- let i = e;
230
- const r = [];
231
- return t.forEach((s) => {
232
- i && (i += `
341
+ function Ft(s, e) {
342
+ let t = e;
343
+ const i = [];
344
+ return s.forEach((r) => {
345
+ t && (t += `
233
346
 
234
- `), i += `**${s.name}**
235
- ${s.type}`, s.name && (i += `
236
- '${s.name}`), r.push({
237
- name: s.name,
238
- description: s.name,
347
+ `), t += `**${r.name}**
348
+ ${r.type}`, r.name && (t += `
349
+ '${r.name}`), i.push({
350
+ name: r.name,
351
+ description: r.name,
239
352
  // pixel members are always arrays
240
353
  type: "array",
241
354
  completion: {
242
- label: s.name,
243
- detail: s.name,
244
- insertText: T(s.name, !1),
245
- insertTextMode: I.asIs,
246
- insertTextFormat: x.PlainText,
247
- kind: F.Field
355
+ label: r.name,
356
+ detail: r.name,
357
+ insertText: $(r.name, !1),
358
+ insertTextMode: M.asIs,
359
+ insertTextFormat: V.PlainText,
360
+ kind: x.Field
248
361
  }
249
362
  });
250
- }), [r, i];
363
+ }), [i, t];
251
364
  }
252
- class Z {
253
- constructor(e, i, r) {
254
- this._profile = e, this._label = i, this.description = r, this.filterDescription = !1;
365
+ class ee {
366
+ constructor(e, t, i) {
367
+ this._profile = e, this._label = t, this.description = i, this.filterDescription = !1;
255
368
  }
256
369
  /**
257
370
  * Returns the label string.
258
371
  */
259
372
  getLabel() {
260
- return this._label == null ? "" : typeof this._label == "string" ? le(this._label) : G(this._profile?.intlStrings[this._label.code], this._label.formatValues);
373
+ return this._label == null ? "" : typeof this._label == "string" ? Se(this._label) : R(this._profile?.intlStrings[this._label.code], this._label.formatValues);
261
374
  }
262
375
  /**
263
376
  * Returns the description string.
264
377
  */
265
378
  getDescription() {
266
- return this.description == null ? "" : typeof this.description == "string" ? this.description : G(this._profile?.intlStrings[this.description.code], this.description.formatValues);
379
+ return this.description == null ? "" : typeof this.description == "string" ? this.description : R(this._profile?.intlStrings[this.description.code], this.description.formatValues);
267
380
  }
268
381
  /**
269
382
  * Returns true if the item pass the filter test
@@ -272,12 +385,12 @@ class Z {
272
385
  return !e || e.test(this.getLabel()) ? !0 : this.filterDescription && e.test(this.getDescription());
273
386
  }
274
387
  }
275
- class M extends Z {
388
+ class E extends ee {
276
389
  constructor(e) {
277
390
  super(e.profile, e.label, e.description ?? e.declaration?.description), this.declaration = e.declaration ?? {}, this.name = e.declaration?.name ?? "", this.snippet = e.snippet ?? "", this.nonInteractive = e.nonInteractive ?? !1, this.filterDescription = e.filterDescription ?? !1, this.icon = e.icon;
278
391
  }
279
392
  }
280
- class l extends M {
393
+ class l extends E {
281
394
  constructor(e) {
282
395
  super(e), this.type = "text", this.isCollection = !1, this.type = e.declaration?.type ?? "text";
283
396
  }
@@ -288,7 +401,7 @@ class l extends M {
288
401
  return { type: this.type, name: "", ...this.declaration };
289
402
  }
290
403
  }
291
- class Me extends M {
404
+ class Je extends E {
292
405
  constructor(e) {
293
406
  super(e), this.type = "array", this.isCollection = !1, this.elementType = e.declaration?.elementType ?? { type: "number", name: "number" };
294
407
  }
@@ -299,9 +412,9 @@ class Me extends M {
299
412
  return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
300
413
  }
301
414
  }
302
- class $ extends M {
303
- constructor(e, i) {
304
- super(i), this.owner = e, this.isCollection = !0, this._loaded = !0, this.variables = [];
415
+ class b extends E {
416
+ constructor(e, t) {
417
+ super(t), this.owner = e, this.isCollection = !0, this._loaded = !0, this.variables = [];
305
418
  }
306
419
  get breadcrumb() {
307
420
  if (this.owner) {
@@ -326,17 +439,17 @@ class $ extends M {
326
439
  return "";
327
440
  }
328
441
  }
329
- class u extends Z {
330
- constructor(e, i, r = [], s = !1) {
331
- super(e, i), this.variables = r, this.isHeader = s, this.type = "group", this.isCollection = !0;
442
+ class u extends ee {
443
+ constructor(e, t, i = [], r = !1) {
444
+ super(e, t), this.variables = i, this.isHeader = r, this.type = "group", this.isCollection = !0;
332
445
  }
333
446
  passFilter() {
334
447
  return !0;
335
448
  }
336
449
  }
337
- class _ extends $ {
338
- constructor(e, i) {
339
- super(e, i), this.type = "dictionary", this.dictionaryVariables = [], this.loadPropertyDeclarations(i.declaration?.properties), this.snippet && this.dictionaryVariables.length && (this.variables = [new u(this._profile, this.snippet, this.dictionaryVariables)]);
450
+ class y extends b {
451
+ constructor(e, t) {
452
+ super(e, t), this.type = "dictionary", this.dictionaryVariables = [], this.loadPropertyDeclarations(t.declaration?.properties), this.snippet && this.dictionaryVariables.length && (this.variables = [new u(this._profile, this.snippet, this.dictionaryVariables)]);
340
453
  }
341
454
  async loadSource() {
342
455
  }
@@ -346,14 +459,14 @@ class _ extends $ {
346
459
  createVariableInstances(e) {
347
460
  if (!Array.isArray(e))
348
461
  return [];
349
- const i = [];
350
- return e.forEach((r) => {
351
- const s = this.createVariableInstance(r);
352
- s && i.push(s);
353
- }), i;
462
+ const t = [];
463
+ return e.forEach((i) => {
464
+ const r = this.createVariableInstance(i);
465
+ r && t.push(r);
466
+ }), t;
354
467
  }
355
468
  createVariableInstance(e) {
356
- const i = Y(this.snippet, e.name);
469
+ const t = Y(this.snippet, e.name);
357
470
  switch (e.type) {
358
471
  case "number":
359
472
  case "text":
@@ -363,38 +476,40 @@ class _ extends $ {
363
476
  case "time":
364
477
  case "geometry":
365
478
  case "knowledgeGraph":
366
- return new l({ profile: this._profile, declaration: e, label: i, snippet: i });
479
+ return new l({ profile: this._profile, declaration: e, label: t, snippet: t });
367
480
  case "pixel":
368
- return new Ae(this, { profile: this._profile, declaration: e, label: i, snippet: i });
481
+ return new Ye(this, { profile: this._profile, declaration: e, label: t, snippet: t });
369
482
  case "voxel":
370
- return new Le(this, { profile: this._profile, declaration: e, label: i, snippet: i });
483
+ return new Xe(this, { profile: this._profile, declaration: e, label: t, snippet: t });
371
484
  case "feature":
372
- return new $e(this, { profile: this._profile, declaration: e, label: i, snippet: i });
485
+ return new Ze(this, { profile: this._profile, declaration: e, label: t, snippet: t });
373
486
  case "featureSet":
374
- return new A(this, { profile: this._profile, declaration: e, label: i, snippet: i }, [
375
- new l({ profile: this._profile, label: i, description: "", snippet: i })
487
+ return new q(this, { profile: this._profile, declaration: e, label: t, snippet: t }, [
488
+ new l({ profile: this._profile, label: t, description: "", snippet: t })
376
489
  ]);
377
490
  case "featureSetCollection":
378
- return new Ge(this, {
491
+ return new et(this, {
379
492
  profile: this._profile,
380
493
  declaration: e,
381
- label: i,
382
- snippet: i
494
+ label: t,
495
+ snippet: t
383
496
  });
384
497
  case "dictionary":
385
- return new _(this, {
498
+ return new y(this, {
386
499
  profile: this._profile,
387
500
  declaration: e,
388
- label: i,
389
- snippet: i
501
+ label: t,
502
+ snippet: t
390
503
  });
391
504
  case "array":
392
- return new Me({
505
+ return new Je({
393
506
  profile: this._profile,
394
507
  declaration: e,
395
- label: i,
396
- snippet: i
508
+ label: t,
509
+ snippet: t
397
510
  });
511
+ case "dataCatalogDatastore":
512
+ return new tt(this, { profile: this._profile, declaration: e, label: t, snippet: t });
398
513
  default:
399
514
  return h("error", "Editor profile", "Invalid profile variable", { detail: { declaration: e } }), null;
400
515
  }
@@ -408,228 +523,228 @@ class _ extends $ {
408
523
  };
409
524
  }
410
525
  }
411
- class ee extends $ {
412
- constructor(e, i, r) {
413
- super(e, i), this.relationshipsProperties = r, this._source = null, this._loaded = !1, this._definition = i.declaration?.definition;
526
+ class te extends b {
527
+ constructor(e, t, i) {
528
+ super(e, t), this.relationshipsProperties = i, this._source = null, this._loaded = !1, this._definition = t.declaration?.definition;
414
529
  }
415
530
  get title() {
416
- return f(this._source) ? this._source.title ?? "" : "";
531
+ return d(this._source) ? this._source.title ?? "" : "";
417
532
  }
418
533
  get url() {
419
- return ge(this._source) ? this._source.url ?? "" : "";
534
+ return pe(this._source) ? this._source.url ?? "" : "";
420
535
  }
421
536
  get informationUrl() {
422
- return !this.loaded || !this.url ? null : Q(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
537
+ return !this.loaded || !this.url ? null : he(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
423
538
  }
424
539
  get informationType() {
425
540
  return this._profile?.intlStrings.layer ?? "layer";
426
541
  }
427
542
  async loadSource() {
428
- return v(this._loadPromise) && k(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
543
+ return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
429
544
  }
430
545
  _getValueSnippet(e) {
431
546
  return ["feature", "voxel", "pixel"].includes(this.type) ? Y(this.snippet, e.name) : e.name;
432
547
  }
433
548
  _getSubtypeOrDomainNameSnippet(e) {
434
- return this.type !== "feature" ? null : y(this._source) && e.name === this._source.subtypeField ? `SubtypeName(${this.snippet})` : `DomainName(${this.snippet}, "${e.name}")`;
549
+ return this.type !== "feature" ? null : w(this._source) && e.name === this._source.subtypeField ? `SubtypeName(${this.snippet})` : `DomainName(${this.snippet}, "${e.name}")`;
435
550
  }
436
- _getFieldProperty(e, i) {
437
- const r = this._getDomainDictionary(e);
438
- if (r)
439
- return r;
440
- const s = this._getValueSnippet(e);
551
+ _getFieldProperty(e, t) {
552
+ const i = this._getDomainDictionary(e);
553
+ if (i)
554
+ return i;
555
+ const r = this._getValueSnippet(e);
441
556
  return new l({
442
557
  profile: this._profile,
443
- label: s,
444
- description: m(e),
445
- snippet: s,
446
- icon: ue(e, i),
558
+ label: r,
559
+ description: S(e),
560
+ snippet: r,
561
+ icon: J(e, t),
447
562
  filterDescription: !0
448
563
  });
449
564
  }
450
565
  _getMemberProperty(e) {
451
- const i = this._getValueSnippet(e);
566
+ const t = this._getValueSnippet(e);
452
567
  return new l({
453
568
  profile: this._profile,
454
- label: i,
569
+ label: t,
455
570
  description: e.name,
456
- snippet: i,
457
- icon: pe(e),
571
+ snippet: t,
572
+ icon: Ie(e),
458
573
  filterDescription: !0
459
574
  });
460
575
  }
461
576
  _getDomainDictionary(e) {
462
- return U(this._source) ? y(this._source) && this._source.subtypeField ? this._getSubtypeDomainDictionary(e) : P(this._source) && this._source.typeIdField ? this._getFeatureTypeDomainDictionary(e) : this._getFieldDomainDictionary(e) : null;
577
+ return U(this._source) ? w(this._source) && this._source.subtypeField ? this._getSubtypeDomainDictionary(e) : T(this._source) && this._source.typeIdField ? this._getFeatureTypeDomainDictionary(e) : this._getFieldDomainDictionary(e) : null;
463
578
  }
464
579
  _getSubtypeDomainDictionary(e) {
465
- if (!y(this._source))
580
+ if (!w(this._source))
466
581
  return null;
467
- if (!we(this._source))
582
+ if (!de(this._source))
468
583
  return e.name === this._source.subtypeField ? null : this._getFieldDomainDictionary(e);
469
584
  if (e.name === this._source.subtypeField) {
470
- const s = this._createDomainDictionary(e);
471
- return s.icon = "subtype", s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, e)), s;
585
+ const r = this._createDomainDictionary(e);
586
+ return r.icon = "subtype", r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, e)), r;
472
587
  }
473
- if (R(this._source.subtypes, e))
588
+ if (H(this._source.subtypes, e))
474
589
  return this._getFieldDomainDictionary(e);
475
- const i = this._getDomainValuesGroup(this._source.subtypes, e);
476
- if (!i)
590
+ const t = this._getDomainValuesGroup(this._source.subtypes, e);
591
+ if (!t)
477
592
  return null;
478
- const r = this._createDomainDictionary(e);
479
- return r.variables.push(i), r;
593
+ const i = this._createDomainDictionary(e);
594
+ return i.variables.push(t), i;
480
595
  }
481
596
  _getFeatureTypeDomainDictionary(e) {
482
- if (!P(this._source))
597
+ if (!T(this._source))
483
598
  return null;
484
599
  if (e.name === this._source.typeIdField) {
485
- const s = this._createDomainDictionary(e);
486
- return s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, e)), s;
600
+ const r = this._createDomainDictionary(e);
601
+ return r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, e)), r;
487
602
  }
488
- if (R(this._source.types, e))
603
+ if (H(this._source.types, e))
489
604
  return this._getFieldDomainDictionary(e);
490
- const i = this._getDomainValuesGroup(this._source.types, e);
491
- if (!i)
605
+ const t = this._getDomainValuesGroup(this._source.types, e);
606
+ if (!t)
492
607
  return null;
493
- const r = this._createDomainDictionary(e);
494
- return r.variables.push(i), r;
608
+ const i = this._createDomainDictionary(e);
609
+ return i.variables.push(t), i;
495
610
  }
496
611
  _getFieldDomainDictionary(e) {
497
612
  if (!U(this._source))
498
613
  return null;
499
- const i = this._source.getFieldDomain(e.name);
500
- if (!S(i))
614
+ const t = this._source.getFieldDomain(e.name);
615
+ if (!v(t))
501
616
  return null;
502
- const r = this._getCodedValueDomainGroup(i, {
617
+ const i = this._getCodedValueDomainGroup(t, {
503
618
  code: "domainvalues"
504
- }), s = this._createDomainDictionary(e);
505
- return s.variables.push(r), s;
506
- }
507
- _getTypeOrSubtypeDomainGroup(e, i) {
508
- if (S(i.domain))
509
- return this._getCodedValueDomainGroup(i.domain, { code: "subtypes" });
510
- const r = e?.map((s) => {
511
- const n = N(s) ? s.code : s.id;
619
+ }), r = this._createDomainDictionary(e);
620
+ return r.variables.push(i), r;
621
+ }
622
+ _getTypeOrSubtypeDomainGroup(e, t) {
623
+ if (v(t.domain))
624
+ return this._getCodedValueDomainGroup(t.domain, { code: "subtypes" });
625
+ const i = e?.map((r) => {
626
+ const a = O(r) ? r.code : r.id;
512
627
  return new l({
513
628
  profile: this._profile,
514
- label: `${n}`,
515
- description: s.name,
516
- snippet: `"${n}"`
629
+ label: `${a}`,
630
+ description: r.name,
631
+ snippet: `"${a}"`
517
632
  });
518
633
  }) ?? [];
519
- return new u(this._profile, { code: "subtypes" }, r);
634
+ return new u(this._profile, { code: "subtypes" }, i);
520
635
  }
521
- _getCodedValueDomainGroup(e, i) {
522
- const r = e.codedValues.map(
523
- (s) => new l({
636
+ _getCodedValueDomainGroup(e, t) {
637
+ const i = e.codedValues.map(
638
+ (r) => new l({
524
639
  profile: this._profile,
525
- label: `${s.code}`,
526
- description: s.name,
527
- snippet: `"${s.code}"`,
640
+ label: `${r.code}`,
641
+ description: r.name,
642
+ snippet: `"${r.code}"`,
528
643
  filterDescription: !0
529
644
  })
530
645
  );
531
- return new u(this._profile, i, r);
646
+ return new u(this._profile, t, i);
532
647
  }
533
- _getDomainValuesGroup(e, i) {
534
- const r = [];
535
- return !e || e.length === 0 || (e.forEach((s) => {
536
- const n = s.domains?.[i.name];
537
- if (!n || me(n) || !S(n))
648
+ _getDomainValuesGroup(e, t) {
649
+ const i = [];
650
+ return !e || e.length === 0 || (e.forEach((r) => {
651
+ const a = r.domains?.[t.name];
652
+ if (!a || fe(a) || !v(a))
538
653
  return;
539
- const a = m(i), o = this._getCodedValueDomainGroup(n, {
654
+ const n = S(t), o = this._getCodedValueDomainGroup(a, {
540
655
  code: "domainvaluesfortypeformat",
541
656
  formatValues: {
542
- fieldName: a,
543
- typeName: s.name
657
+ fieldName: n,
658
+ typeName: r.name
544
659
  }
545
- }), c = N(s) ? s.code : s.id, p = `${c}`, b = `"${c}""`, d = new _(this, {
660
+ }), p = O(r) ? r.code : r.id, c = `${p}`, g = `"${p}""`, f = new y(this, {
546
661
  profile: this._profile,
547
- label: p,
548
- snippet: b,
549
- description: s.name,
550
- declaration: { name: a }
662
+ label: c,
663
+ snippet: g,
664
+ description: r.name,
665
+ declaration: { name: n }
551
666
  });
552
- d.variables = [o], r.push(d);
553
- }), !r.length) ? null : new u(this._profile, { code: "domainvaluesbysubtypes" }, r);
667
+ f.variables = [o], i.push(f);
668
+ }), !i.length) ? null : new u(this._profile, { code: "domainvaluesbysubtypes" }, i);
554
669
  }
555
670
  _createDomainDictionary(e) {
556
- const i = this._getValueSnippet(e), r = m(e), s = new _(this, {
671
+ const t = this._getValueSnippet(e), i = S(e), r = new y(this, {
557
672
  profile: this._profile,
558
- label: i,
559
- description: r,
560
- snippet: i,
673
+ label: t,
674
+ description: i,
675
+ snippet: t,
561
676
  icon: "form-dropdown",
562
677
  declaration: { name: e.name }
563
- }), n = new u(this._profile, r, [
678
+ }), a = new u(this._profile, i, [
564
679
  new l({
565
680
  profile: this._profile,
566
- label: i,
681
+ label: t,
567
682
  description: "",
568
- snippet: i
683
+ snippet: t
569
684
  })
570
685
  ]);
571
- s.variables = [n];
572
- const a = this._getSubtypeOrDomainNameSnippet(e);
573
- return a && n.variables.push(
686
+ r.variables = [a];
687
+ const n = this._getSubtypeOrDomainNameSnippet(e);
688
+ return n && a.variables.push(
574
689
  new l({
575
690
  profile: this._profile,
576
- label: a,
691
+ label: n,
577
692
  description: "",
578
- snippet: a
693
+ snippet: n
579
694
  })
580
- ), s;
695
+ ), r;
581
696
  }
582
697
  async _getRelationshipsProperty() {
583
698
  if (!this.relationshipsProperties?.exposeRelationships || !this._profile?.supportFeatureSetFunctions)
584
699
  return null;
585
700
  const e = this._source;
586
- if (!Ce(e))
701
+ if (!_e(e))
587
702
  return null;
588
- const i = new u(this._profile, { code: "relationships" }), r = await Promise.all(
589
- e.relationships?.map(async (s) => {
590
- const n = await Ve(e, s);
591
- if (!q(n) || s.relatedTableId === this.relationshipsProperties?.sourceTableId)
703
+ const t = new u(this._profile, { code: "relationships" }), i = await Promise.all(
704
+ e.relationships?.map(async (r) => {
705
+ const a = await Qe(e, r);
706
+ if (!Q(a) || r.relatedTableId === this.relationshipsProperties?.sourceTableId)
592
707
  return null;
593
- const a = `FeatureSetByRelationshipName(${this.snippet}, "${s.name}")`;
594
- return new A(
708
+ const n = `FeatureSetByRelationshipName(${this.snippet}, "${r.name}")`;
709
+ return new q(
595
710
  this,
596
711
  {
597
712
  profile: this._profile,
598
- declaration: { definition: n },
599
- label: n.title,
713
+ declaration: { definition: a },
714
+ label: a.title,
600
715
  description: "",
601
716
  nonInteractive: !0
602
717
  },
603
- [new l({ profile: this._profile, label: a, description: "", snippet: a })],
718
+ [new l({ profile: this._profile, label: n, description: "", snippet: n })],
604
719
  { exposeRelationships: !0, sourceTableId: e.layerId }
605
720
  );
606
721
  }) ?? []
607
722
  );
608
- return i.variables = r.filter(v), i.variables.length ? i : null;
723
+ return t.variables = i.filter(m), t.variables.length ? t : null;
609
724
  }
610
725
  }
611
- class L extends ee {
612
- constructor(e, i, r, s = { exposeRelationships: !0 }) {
613
- super(e, i, s), this.type = r;
726
+ class A extends te {
727
+ constructor(e, t, i, r = { exposeRelationships: !0 }) {
728
+ super(e, t, r), this.type = i;
614
729
  }
615
730
  get title() {
616
- return f(this._source) ? this._source.title ?? "" : { code: this.type };
731
+ return d(this._source) ? this._source.title ?? "" : { code: this.type };
617
732
  }
618
733
  toProfileVariableDefinition() {
619
734
  return { type: this.type, name: "", ...this.declaration };
620
735
  }
621
736
  }
622
- class $e extends L {
623
- constructor(e, i) {
624
- super(e, i, "feature", { exposeRelationships: !0 }), this.type = "feature";
737
+ class Ze extends A {
738
+ constructor(e, t) {
739
+ super(e, t, "feature", { exposeRelationships: !0 }), this.type = "feature";
625
740
  }
626
741
  async _loadSource() {
627
742
  if (this.loaded)
628
743
  return this._source;
629
744
  try {
630
- if (this._source = await X(this._definition), !this._source)
745
+ if (this._source = await j(this._definition), !this._source)
631
746
  throw new Error("Invalid definition");
632
- const e = f(this._source) ? this._source.title ?? "" : "";
747
+ const e = d(this._source) ? this._source.title ?? "" : "";
633
748
  this.variables.push(
634
749
  new u(this._profile, e, [
635
750
  new l({
@@ -640,25 +755,25 @@ class $e extends L {
640
755
  })
641
756
  ])
642
757
  );
643
- const i = new u(this._profile, { code: "values" });
644
- if (this.variables.push(i), Fe(this._source)) {
645
- const n = `Geometry(${this.snippet})`, a = new l({
758
+ const t = new u(this._profile, { code: "values" });
759
+ if (this.variables.push(t), le(this._source)) {
760
+ const a = `Geometry(${this.snippet})`, n = new l({
646
761
  profile: this._profile,
647
- declaration: { name: n },
648
- label: n,
762
+ declaration: { name: a },
763
+ label: a,
649
764
  description: "Geometry",
650
- snippet: n,
765
+ snippet: a,
651
766
  icon: "shapes",
652
767
  filterDescription: !0
653
768
  });
654
- i.variables.push(a);
769
+ t.variables.push(n);
655
770
  }
656
- const r = this._source;
657
- w(this._source.fields).map((n) => r.fields.find((a) => a.name === n.name)).sort(V(r)).forEach((n) => {
658
- i.variables.push(this._getFieldProperty(n));
771
+ const i = this._source;
772
+ C(this._source.fields).map((a) => i.fields.find((n) => n.name === a.name)).sort(L(i)).forEach((a) => {
773
+ t.variables.push(this._getFieldProperty(a));
659
774
  });
660
- const s = await this._getRelationshipsProperty();
661
- s && this.variables.push(s);
775
+ const r = await this._getRelationshipsProperty();
776
+ r && this.variables.push(r);
662
777
  } catch (e) {
663
778
  h("error", "FeatureVariable", "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
664
779
  } finally {
@@ -667,19 +782,19 @@ class $e extends L {
667
782
  return this._source;
668
783
  }
669
784
  }
670
- class Le extends L {
671
- constructor(e, i) {
672
- super(e, i, "voxel", { exposeRelationships: !1 }), this.type = "voxel", this._source = null;
785
+ class Xe extends A {
786
+ constructor(e, t) {
787
+ super(e, t, "voxel", { exposeRelationships: !1 }), this.type = "voxel", this._source = null;
673
788
  }
674
789
  async _loadSource() {
675
790
  if (this.loaded)
676
791
  return this._source;
677
792
  try {
678
- if (!Ie(this._definition))
793
+ if (!ue(this._definition))
679
794
  throw new Error("Invalid definition - not a VoxelLayer");
680
795
  if (await this._definition.load(), this._source = this._definition, !this._source)
681
796
  throw new Error("Invalid definition");
682
- const e = f(this._source) ? this._source.title ?? "" : "";
797
+ const e = d(this._source) ? this._source.title ?? "" : "";
683
798
  this.variables.push(
684
799
  new u(this._profile, e, [
685
800
  new l({
@@ -690,11 +805,11 @@ class Le extends L {
690
805
  })
691
806
  ])
692
807
  );
693
- const i = new u(this._profile, { code: "values" });
694
- this.variables.push(i);
695
- const r = await oe(this._source), s = this._source;
696
- w(this._source.fields).map((n) => s.fields.find((a) => a.name === n.name)).sort(V(s)).forEach((n) => {
697
- i.variables.push(this._getFieldProperty(n, r));
808
+ const t = new u(this._profile, { code: "values" });
809
+ this.variables.push(t);
810
+ const i = await De(this._source), r = this._source;
811
+ C(this._source.fields).map((a) => r.fields.find((n) => n.name === a.name)).sort(L(r)).forEach((a) => {
812
+ t.variables.push(this._getFieldProperty(a, i));
698
813
  });
699
814
  } catch (e) {
700
815
  h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
@@ -704,19 +819,19 @@ class Le extends L {
704
819
  return this._source;
705
820
  }
706
821
  }
707
- class Ae extends L {
708
- constructor(e, i) {
709
- super(e, i, "pixel", { exposeRelationships: !1 }), this.type = "pixel", this._source = null;
822
+ class Ye extends A {
823
+ constructor(e, t) {
824
+ super(e, t, "pixel", { exposeRelationships: !1 }), this.type = "pixel", this._source = null;
710
825
  }
711
826
  async _loadSource() {
712
827
  if (this.loaded)
713
828
  return this._source;
714
829
  try {
715
- if (!B(this._definition))
830
+ if (!G(this._definition))
716
831
  throw new Error("Invalid definition - not an ImageryLayer");
717
832
  if (await this._definition.load(), this._source = this._definition, !this._source)
718
833
  throw new Error("Invalid definition");
719
- const e = f(this._source) ? this._source.title ?? "" : "";
834
+ const e = d(this._source) ? this._source.title ?? "" : "";
720
835
  this.variables.push(
721
836
  new u(this._profile, e, [
722
837
  new l({
@@ -727,11 +842,11 @@ class Ae extends L {
727
842
  })
728
843
  ])
729
844
  );
730
- const i = new u(this._profile, { code: "values" });
731
- if (this.variables.push(i), !B(this._source))
845
+ const t = new u(this._profile, { code: "values" });
846
+ if (this.variables.push(t), !G(this._source))
732
847
  throw new Error("Invalid definition - not an ImageryLayer");
733
- (await ae(this._source)).forEach((s) => {
734
- i.variables.push(this._getMemberProperty(s));
848
+ (await we(this._source)).forEach((r) => {
849
+ t.variables.push(this._getMemberProperty(r));
735
850
  });
736
851
  } catch (e) {
737
852
  h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
@@ -741,24 +856,24 @@ class Ae extends L {
741
856
  return this._source;
742
857
  }
743
858
  }
744
- class A extends ee {
745
- constructor(e, i, r = [], s) {
746
- super(e, i, s), this.featureSetSnippets = r, this.type = "featureSet";
859
+ class q extends te {
860
+ constructor(e, t, i = [], r) {
861
+ super(e, t, r), this.featureSetSnippets = i, this.type = "featureSet";
747
862
  }
748
863
  get title() {
749
- return f(this._source) ? this._source.title ?? "" : { code: "featureset" };
864
+ return d(this._source) ? this._source.title ?? "" : { code: "featureset" };
750
865
  }
751
866
  async _loadSource() {
752
867
  if (this.loaded)
753
868
  return this._source;
754
869
  try {
755
- if (this._source = await X(this._definition), !this._source)
870
+ if (this._source = await j(this._definition), !this._source)
756
871
  throw new Error("Invalid definition");
757
872
  this.variables.push(new u(this._profile, this.title, this.featureSetSnippets, !0));
758
873
  const e = new u(this._profile, { code: "fields" });
759
- this.variables.push(e), e.variables = w(this._source.fields).sort(V(this._source)).map((r) => this._getFieldProperty(r));
760
- const i = await this._getRelationshipsProperty();
761
- i && this.variables.push(i);
874
+ this.variables.push(e), e.variables = C(this._source.fields).sort(L(this._source)).map((i) => this._getFieldProperty(i));
875
+ const t = await this._getRelationshipsProperty();
876
+ t && this.variables.push(t);
762
877
  } catch (e) {
763
878
  h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
764
879
  } finally {
@@ -770,12 +885,12 @@ class A extends ee {
770
885
  return { type: this.type, name: "", ...this.declaration, definition: this._definition };
771
886
  }
772
887
  }
773
- class Ge extends $ {
774
- constructor(e, i) {
775
- super(e, i), this.type = "featureSetCollection", this._featureSetCollections = null, this._loaded = !1, this._definition = i.declaration?.definition;
888
+ class et extends b {
889
+ constructor(e, t) {
890
+ super(e, t), this.type = "featureSetCollection", this._featureSetCollections = null, this._loaded = !1, this._definition = t.declaration?.definition;
776
891
  }
777
892
  get informationUrl() {
778
- return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ? ie(O(this._featureSetCollections.source)) : null;
893
+ return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ? me(K(this._featureSetCollections.source)) : null;
779
894
  }
780
895
  get informationType() {
781
896
  if (!this.loaded || !this._featureSetCollections)
@@ -792,7 +907,7 @@ class Ge extends $ {
792
907
  }
793
908
  }
794
909
  async loadSource() {
795
- return v(this._loadPromise) && k(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
910
+ return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
796
911
  }
797
912
  async _loadSource() {
798
913
  if (this.loaded)
@@ -803,17 +918,17 @@ class Ge extends $ {
803
918
  const e = typeof this._featureSetCollections.source == "string" ? { code: this._featureSetCollections.source.endsWith("FeatureServer") ? "featureservice" : "mapservice" } : {
804
919
  code: "webmapformat",
805
920
  formatValues: {
806
- webMapTitle: O(this._featureSetCollections.source)?.title || "Untitled map"
921
+ webMapTitle: K(this._featureSetCollections.source)?.title || "Untitled map"
807
922
  }
808
- }, i = new u(this._profile, e, [
923
+ }, t = new u(this._profile, e, [
809
924
  new l({
810
925
  profile: this._profile,
811
926
  label: this.snippet,
812
927
  description: "",
813
928
  snippet: this.snippet
814
929
  })
815
- ]), r = new u(this._profile, { code: "layers" }, this._featureSetCollections.layers), s = new u(this._profile, { code: "tables" }, this._featureSetCollections.tables);
816
- this.variables.push(i, r, s);
930
+ ]), i = new u(this._profile, { code: "layers" }, this._featureSetCollections.layers), r = new u(this._profile, { code: "tables" }, this._featureSetCollections.tables);
931
+ this.variables.push(t, i, r);
817
932
  } catch (e) {
818
933
  h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._featureSetCollections = null;
819
934
  } finally {
@@ -822,97 +937,236 @@ class Ge extends $ {
822
937
  return this._featureSetCollections;
823
938
  }
824
939
  async _featureSetCollectionsFromDefinition() {
825
- return this._definition ? K(this._definition) ? await this._featureSetCollectionFromMap(this._definition) : C(this._definition) ? await this._featureSetCollectionFromUrl(this._definition.url) : z(this._definition) ? await this._featureSetCollectionFromPortalItem(this._definition.portalItem) : null : null;
940
+ return this._definition ? re(this._definition) ? await this._featureSetCollectionFromMap(this._definition) : se(this._definition) ? await this._featureSetCollectionFromUrl(this._definition.url) : ae(this._definition) ? await this._featureSetCollectionFromPortalItem(this._definition.portalItem) : null : null;
826
941
  }
827
942
  async _featureSetCollectionFromMap(e) {
828
- _e(e) && await e.loadAll(), await Promise.all(e.allTables.map(async (r) => await r.load()));
829
- const i = this._profile?.policy?.filterFsCollectionLayersFromMap ?? (() => !0);
943
+ oe(e) && await e.loadAll(), await Promise.all(e.allTables.map(async (i) => await i.load()));
944
+ const t = this._profile?.policy?.filterFsCollectionLayersFromMap ?? (() => !0);
830
945
  return {
831
- layers: this._convertWebMapLayersToVariables(e.allLayers.filter(i)),
946
+ layers: this._convertWebMapLayersToVariables(e.allLayers.filter(t)),
832
947
  tables: this._convertWebMapLayersToVariables(e.allTables),
833
948
  source: e
834
949
  };
835
950
  }
836
951
  async _featureSetCollectionFromPortalItem(e) {
837
- const i = new re(e);
838
- switch (await i.load(), i.type) {
952
+ const t = new ye(e);
953
+ switch (await t.load(), t.type) {
839
954
  case "Web Map": {
840
- const r = new se({ portalItem: i });
841
- return await this._featureSetCollectionFromMap(r);
955
+ const i = new be({ portalItem: t });
956
+ return await this._featureSetCollectionFromMap(i);
842
957
  }
843
958
  case "Web Scene": {
844
- const r = new ne({ portalItem: i });
845
- return await this._featureSetCollectionFromMap(r);
959
+ const i = new ge({ portalItem: t });
960
+ return await this._featureSetCollectionFromMap(i);
846
961
  }
847
962
  case "Feature Service":
848
- return await this._featureSetCollectionFromUrl(i.url);
963
+ return await this._featureSetCollectionFromUrl(t.url);
849
964
  default:
850
965
  return h("error", this.type, "Unsupported portal item", { detail: { definition: e } }), null;
851
966
  }
852
967
  }
853
968
  async _featureSetCollectionFromUrl(e) {
854
- let i = e?.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
855
- if (i = i?.replace(/\/mapserver\/[0-9]*/iu, "/MapServer"), i = i?.split("?")[0], !i)
969
+ let t = e?.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
970
+ if (t = t?.replace(/\/mapserver\/[0-9]*/iu, "/MapServer"), t = t?.split("?")[0], !t)
856
971
  return null;
857
- const r = await Pe(i), s = Promise.all(
858
- r.layers.map(async (c) => {
859
- const p = new g({ url: `${i}/${c.id}` });
860
- return await p.load(), this._createFeatureSetVariable(p);
972
+ const i = await ne(t), r = Promise.all(
973
+ i.layers.map(async (p) => {
974
+ const c = new P({ url: `${t}/${p.id}` });
975
+ return await c.load(), this._createFeatureSetVariable(c);
861
976
  })
862
- ), n = Promise.all(
863
- r.tables.map(async (c) => {
864
- const p = new g({ url: `${i}/${c.id}` });
865
- return await p.load(), this._createFeatureSetVariable(p);
977
+ ), a = Promise.all(
978
+ i.tables.map(async (p) => {
979
+ const c = new P({ url: `${t}/${p.id}` });
980
+ return await c.load(), this._createFeatureSetVariable(c);
866
981
  })
867
- ), [a, o] = await Promise.all([s, n]);
868
- return { layers: a, tables: o, source: i };
982
+ ), [n, o] = await Promise.all([r, a]);
983
+ return { layers: n, tables: o, source: t };
869
984
  }
870
985
  _convertWebMapLayersToVariables(e) {
871
- const i = [];
872
- return e.toArray().reverse().forEach((r) => {
873
- if (q(r)) {
874
- i.push(this._createFeatureSetVariable(r, !0));
986
+ const t = [];
987
+ return e.toArray().reverse().forEach((i) => {
988
+ if (Q(i)) {
989
+ t.push(this._createFeatureSetVariable(i, !0));
875
990
  return;
876
991
  }
877
- }), i;
992
+ }), t;
878
993
  }
879
- _createFeatureSetVariable(e, i = !1) {
880
- return new A(
994
+ _createFeatureSetVariable(e, t = !1) {
995
+ return new q(
881
996
  this,
882
997
  {
883
998
  profile: this._profile,
884
999
  declaration: { name: e.title ?? "", definition: e },
885
- label: i ? e.title : e.sourceJSON.name ?? e.title,
1000
+ label: t ? e.title : e.sourceJSON.name ?? e.title,
886
1001
  description: "",
887
1002
  nonInteractive: !0
888
1003
  },
889
- this._makeFeatureSetSnippets(e, i)
1004
+ this._makeFeatureSetSnippets(e, t)
890
1005
  );
891
1006
  }
892
- _makeFeatureSetSnippets(e, i = !1) {
1007
+ _makeFeatureSetSnippets(e, t = !1) {
893
1008
  if (!this._profile?.supportFeatureSetFunctions)
894
1009
  return [];
895
- if (i) {
896
- const r = `FeatureSetById(${this.snippet}, "${e.id}")`, s = `FeatureSetByName(${this.snippet}, "${e.title}")`;
1010
+ if (t) {
1011
+ const i = `FeatureSetById(${this.snippet}, "${e.id}")`, r = `FeatureSetByName(${this.snippet}, "${e.title}")`;
897
1012
  return [
898
- new l({ profile: this._profile, label: r, description: "", snippet: r }),
899
- new l({ profile: this._profile, label: s, description: "", snippet: s })
1013
+ new l({ profile: this._profile, label: i, description: "", snippet: i }),
1014
+ new l({ profile: this._profile, label: r, description: "", snippet: r })
900
1015
  ];
901
1016
  } else {
902
- const r = `FeatureSetById(${this.snippet}, "${e.layerId}")`;
903
- return [new l({ profile: this._profile, label: r, description: "", snippet: r })];
1017
+ const i = `FeatureSetById(${this.snippet}, "${e.layerId}")`;
1018
+ return [new l({ profile: this._profile, label: i, description: "", snippet: i })];
904
1019
  }
905
1020
  }
906
1021
  toProfileVariableDefinition() {
907
1022
  return { type: this.type, name: "", ...this.declaration, definition: this._definition };
908
1023
  }
909
1024
  }
910
- class at extends _ {
911
- constructor(e, i, r = "en", s = {}) {
1025
+ class tt extends b {
1026
+ constructor(e, t) {
1027
+ super(e, t), this.type = "dataCatalogDatastore", this._catalogDatastore = null, this._datastore = null, this._loaded = !1, this._definition = t.declaration?.definition;
1028
+ }
1029
+ _serializeDefinitionFromInstance(e) {
1030
+ return {
1031
+ id: e.itemId ?? "",
1032
+ serviceUrl: e.serviceUrl ?? "",
1033
+ portal: { url: e.portal?.url ?? "" }
1034
+ };
1035
+ }
1036
+ _getSerializedDefinition() {
1037
+ const e = this.declaration.definition;
1038
+ if (e)
1039
+ return D(e) ? e : this._serializeDefinitionFromInstance(e);
1040
+ if (D(this._definition))
1041
+ return this._definition;
1042
+ if (this._catalogDatastore)
1043
+ return this._serializeDefinitionFromInstance(this._catalogDatastore);
1044
+ if (this._definition)
1045
+ return this._serializeDefinitionFromInstance(this._definition);
1046
+ }
1047
+ async loadSource() {
1048
+ return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
1049
+ }
1050
+ async _loadSource() {
1051
+ if (this.loaded)
1052
+ return this._datastore;
1053
+ try {
1054
+ if (!this._definition)
1055
+ throw new Error("No definition provided");
1056
+ D(this._definition) ? this._catalogDatastore = await this._dataCatalogDatastoreFromDefinition(this._definition) : this._catalogDatastore = this._definition;
1057
+ const e = this._catalogDatastore;
1058
+ if (!e)
1059
+ throw new Error("Invalid definition");
1060
+ const t = await e.fetchInfo();
1061
+ this._datastoreInfo = t;
1062
+ const i = await e.fetchDatasets(), r = await Ke(t.databasePlatform), a = i.map(
1063
+ (n) => new it(
1064
+ this,
1065
+ {
1066
+ profile: this._profile,
1067
+ declaration: { name: n.name },
1068
+ label: n.name,
1069
+ description: n.type,
1070
+ snippet: He(n.name, r)
1071
+ },
1072
+ e,
1073
+ n,
1074
+ r
1075
+ )
1076
+ );
1077
+ this.variables = a, this._datastore = {
1078
+ tables: a,
1079
+ source: D(this._definition) ? this._definition : e,
1080
+ info: t
1081
+ };
1082
+ } catch (e) {
1083
+ h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._datastore = null;
1084
+ } finally {
1085
+ this._loaded = !0;
1086
+ }
1087
+ return this._datastore;
1088
+ }
1089
+ get datastoreInfo() {
1090
+ return this._datastoreInfo;
1091
+ }
1092
+ get tableVariables() {
1093
+ return this.variables.filter(ie);
1094
+ }
1095
+ async _dataCatalogDatastoreFromDefinition(e) {
1096
+ const t = new ve({ url: e.portal.url });
1097
+ return await t.load(), new Le({
1098
+ itemId: e.id,
1099
+ serviceUrl: e.serviceUrl,
1100
+ portal: t
1101
+ });
1102
+ }
1103
+ toProfileVariableDefinition() {
1104
+ const e = this.declaration, t = this._getSerializedDefinition();
1105
+ return {
1106
+ type: this.type,
1107
+ name: "",
1108
+ ...e,
1109
+ ...t ? { definition: t } : {}
1110
+ };
1111
+ }
1112
+ }
1113
+ class it extends b {
1114
+ constructor(e, t, i, r, a) {
1115
+ super(e, t), this._catalogDatastore = i, this.datasetInfo = r, this._dialectSpec = a, this.type = "dictionary", this._fieldInfos = [], this._loaded = !1;
1116
+ }
1117
+ get fieldInfos() {
1118
+ return this._fieldInfos;
1119
+ }
1120
+ async loadSource() {
1121
+ return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadFields(), await this._loadPromise);
1122
+ }
1123
+ async _loadFields() {
1124
+ if (this.loaded)
1125
+ return this._fieldInfos;
1126
+ try {
1127
+ const e = await this._catalogDatastore.fetchTableDescription(this.datasetInfo.name);
1128
+ this._fieldInfos = e.fields, this.variables = this._fieldInfos.map((t) => {
1129
+ const i = {
1130
+ name: t.name,
1131
+ alias: t.name,
1132
+ type: t.type
1133
+ };
1134
+ return new l({
1135
+ profile: this._profile,
1136
+ declaration: { type: Z(i) },
1137
+ label: t.name,
1138
+ // TODO: review with QL team / designer
1139
+ description: [t.serverType, t.nullable ? "nullable" : "not null"].filter(Boolean).join(" | "),
1140
+ snippet: X(t.name, this._dialectSpec),
1141
+ icon: J(i),
1142
+ filterDescription: !0
1143
+ });
1144
+ });
1145
+ } catch (e) {
1146
+ h("error", "DataCatalogDatastoreTableVariable", "Error loading dataset", {
1147
+ detail: { error: e, dataset: this.datasetInfo }
1148
+ }), this._fieldInfos = [];
1149
+ } finally {
1150
+ this._loaded = !0;
1151
+ }
1152
+ return this._fieldInfos;
1153
+ }
1154
+ toProfileVariableDefinition() {
1155
+ return {
1156
+ // TODO(editor-profile): this is a type dictionary for now, but should get its own type after
1157
+ // https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/1473
1158
+ type: "dictionary",
1159
+ name: this.datasetInfo.name,
1160
+ description: this.datasetInfo.type
1161
+ };
1162
+ }
1163
+ }
1164
+ class Tt extends y {
1165
+ constructor(e, t, i = "en", r = {}) {
912
1166
  super(void 0, {
913
1167
  profile: null,
914
1168
  declaration: { properties: [] }
915
- }), this.definition = e, this.intlStrings = i, this.locale = r, this.policy = s, this.variables = [], this._profile = this, this.loadPropertyDeclarations(e?.variables);
1169
+ }), this.definition = e, this.intlStrings = t, this.locale = i, this.policy = r, this.variables = [], this._profile = this, this.loadPropertyDeclarations(e?.variables);
916
1170
  }
917
1171
  /**
918
1172
  * Returns true if the profile supports feature set functions for snippets.
@@ -931,18 +1185,15 @@ class at extends _ {
931
1185
  };
932
1186
  }
933
1187
  }
934
- const Ee = {
1188
+ const rt = {
935
1189
  locale: "en"
936
1190
  };
937
- class lt {
1191
+ class Pt {
938
1192
  // #endregion
939
- constructor(e, i) {
940
- this.languageId = e, this._apiConfig = i, this._onDidChange = new E(), this._modelToProfileMap = /* @__PURE__ */ new Map(), this._modelToApiContextMap = /* @__PURE__ */ new Map(), this._localeToApiLibraryPromiseMap = /* @__PURE__ */ new Map(), this._onModelContextDidChange = new E(), this._onDidModelContextChangeTimeout = -1, this.workerHost = {
941
- getApiLibrary: async (r) => await this.getApiLibrary(r),
942
- getLanguageId: () => this.languageId
943
- }, he().then((r) => {
944
- r.onWillDisposeModel((s) => {
945
- this.disposeForModel(s.uri);
1193
+ constructor(e, t) {
1194
+ this.languageId = e, this._apiConfig = t, this._onDidChange = new N(), this._modelToProfileMap = /* @__PURE__ */ new Map(), this._modelToApiContextMap = /* @__PURE__ */ new Map(), this._localeToApiLibraryPromiseMap = /* @__PURE__ */ new Map(), this._onModelContextDidChange = new N(), this._onDidModelContextChangeTimeout = -1, Fe().then((i) => {
1195
+ i.onWillDisposeModel((r) => {
1196
+ this.disposeForModel(r.uri);
946
1197
  });
947
1198
  });
948
1199
  }
@@ -953,7 +1204,9 @@ class lt {
953
1204
  }, 0));
954
1205
  }
955
1206
  _getApiKey(e) {
956
- return j.isUri(e) || (e = j.parse(e)), e.toString();
1207
+ return B.isUri(e) || (e = B.parse(e)), e.toString();
1208
+ }
1209
+ getWorkerHostExtension() {
957
1210
  }
958
1211
  // #endregion
959
1212
  // #region Public methods
@@ -964,8 +1217,8 @@ class lt {
964
1217
  * Dispose any cached resources for the model
965
1218
  */
966
1219
  disposeForModel(e) {
967
- const i = this._getApiKey(e);
968
- this._modelToProfileMap.delete(i), this._modelToApiContextMap.delete(i) && this._fireModelContextDidChange(i);
1220
+ const t = this._getApiKey(e);
1221
+ this._modelToProfileMap.delete(t), this._modelToApiContextMap.delete(t) && this._fireModelContextDidChange(t);
969
1222
  }
970
1223
  /**
971
1224
  * Returns the editor profile for the given model id.
@@ -982,16 +1235,16 @@ class lt {
982
1235
  * @returns The API context for the model.
983
1236
  */
984
1237
  getApiContextForModel(e) {
985
- return this._modelToApiContextMap.get(this._getApiKey(e)) ?? Ee;
1238
+ return this._modelToApiContextMap.get(this._getApiKey(e)) ?? rt;
986
1239
  }
987
1240
  /**
988
1241
  * Set or update api context for the given model id.
989
1242
  * @param modelId The model id for which to set the context.
990
1243
  * @param apiContext The api context to set.
991
1244
  */
992
- updateApiContextForModel(e, i) {
993
- const r = this._getApiKey(e), s = this._modelToApiContextMap.get(r) ?? {};
994
- this._modelToApiContextMap.set(r, { ...s, ...i }), this._fireModelContextDidChange(r);
1245
+ updateApiContextForModel(e, t) {
1246
+ const i = this._getApiKey(e), r = this._modelToApiContextMap.get(i) ?? {};
1247
+ this._modelToApiContextMap.set(i, { ...r, ...t }), this._fireModelContextDidChange(i);
995
1248
  }
996
1249
  get onModelContextDidChange() {
997
1250
  return this._onModelContextDidChange.event;
@@ -1002,37 +1255,53 @@ class lt {
1002
1255
  * @returns The API library for the model.
1003
1256
  */
1004
1257
  async getApiLibraryForModel(e) {
1005
- const i = this.getApiContextForModel(e), r = this.getApiLibrary(i.locale ?? "en");
1006
- return (await ye(r, i)).categories;
1258
+ const t = this.getApiContextForModel(e), i = this.getApiLibrary(t.locale ?? "en");
1259
+ return (await xe(i, t)).categories;
1260
+ }
1261
+ /**
1262
+ * The worker host is used by the worker to invoke methods on the main thread.
1263
+ */
1264
+ get workerHost() {
1265
+ if (!this._workerHost) {
1266
+ const t = Object.assign({
1267
+ getApiLibrary: async (i) => await this.getApiLibrary(i),
1268
+ getLanguageId: () => this.languageId
1269
+ }, this.getWorkerHostExtension());
1270
+ this._workerHost = t;
1271
+ }
1272
+ return this._workerHost;
1007
1273
  }
1008
1274
  // #endregion
1009
1275
  //#region Private methods
1010
1276
  async fetchApiLibrary(e) {
1011
1277
  try {
1012
- const { apiPath: i, apiPrefix: r } = this._apiConfig, s = fe(`${i}/${r}${e}.json`), n = await fetch(s);
1013
- return n.ok ? await n.json() : [];
1278
+ const { apiPath: t, apiPrefix: i } = this._apiConfig, r = Te(`${t}/${i}${e}.json`), a = await fetch(r);
1279
+ return a.ok ? await a.json() : [];
1014
1280
  } catch {
1015
1281
  return [];
1016
1282
  }
1017
1283
  }
1018
1284
  async getApiLibrary(e) {
1019
- const i = de(e);
1020
- return this._localeToApiLibraryPromiseMap.has(i) || this._localeToApiLibraryPromiseMap.set(i, this.fetchApiLibrary(i)), await this._localeToApiLibraryPromiseMap.get(i) ?? [];
1285
+ const t = Pe(e);
1286
+ return this._localeToApiLibraryPromiseMap.has(t) || this._localeToApiLibraryPromiseMap.set(t, this.fetchApiLibrary(t)), await this._localeToApiLibraryPromiseMap.get(t) ?? [];
1021
1287
  }
1022
1288
  // #endregion
1023
1289
  }
1024
1290
  export {
1025
- at as E,
1026
- lt as L,
1027
- rt as a,
1028
- it as b,
1029
- et as c,
1030
- tt as d,
1031
- J as e,
1032
- nt as f,
1033
- T as g,
1034
- Se as h,
1035
- st as i,
1036
- Ce as j,
1037
- ot as m
1291
+ Le as D,
1292
+ Tt as E,
1293
+ Pt as L,
1294
+ ke as a,
1295
+ tt as b,
1296
+ He as c,
1297
+ W as d,
1298
+ Ct as e,
1299
+ vt as f,
1300
+ $ as g,
1301
+ Ne as h,
1302
+ Re as i,
1303
+ Ft as m,
1304
+ It as n,
1305
+ X as q,
1306
+ _ as s
1038
1307
  };