@arcgis/lumina-compiler 5.2.0-next.98 → 6.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,32 +1,32 @@
1
- import { externalizeDependencies as vs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
1
+ import { externalizeDependencies as Cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
2
2
  import { isNotUndefined as R } from "@arcgis/toolkit/predicate";
3
- import { f as b, l as T } from "./logger-edpIalAo.js";
3
+ import { f as b, l as T } from "./chunks/logger.js";
4
4
  import o from "typescript";
5
- import { camelToKebab as ei, getPreamble as bs, uncapitalize as wt, capitalize as ws } from "@arcgis/toolkit/string";
6
- import { lazyMetaSubItemJoiner as Ss, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as Cs, propertyFlagAttribute as St, propertyFlagReflect as Es, propertyFlagBoolean as Ts, propertyFlagNumber as $s, propertyFlagState as Ps, propertyFlagReadOnly as ks, propertyFlagNoAccessor as Is, propertyFlagUseDefault as xs } from "@arcgis/lumina/config";
7
- import { path as u, isPosix as ti, toPosixPathSeparators as G, toSystemPathSeparators as Re, getCwd as ii } from "@arcgis/node-toolkit/path";
8
- import { isApiMethodAsync as As, globalPackageIdentifier as Ls, isApiMethod as Ns, isApiProperty as js } from "@arcgis/api-extractor/utils/apiHelpers";
9
- import { existsAsync as _, findPath as si } from "@arcgis/node-toolkit/file";
10
- import { readFile as z, readdir as ot, mkdir as X, writeFile as K, copyFile as Fs, rm as Rs, cp as Ds } from "node:fs/promises";
11
- import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as ri } from "@arcgis/node-toolkit/packageJson";
12
- import { build as Os } from "esbuild";
13
- import Ms from "mime-types";
14
- import { forEachWithConcurrency as Js } from "@arcgis/toolkit/promise";
15
- import { glob as Bs } from "tinyglobby";
5
+ import { camelToKebab as si, getPreamble as Es, uncapitalize as Ct, capitalize as Ts } from "@arcgis/toolkit/string";
6
+ import { lazyMetaSubItemJoiner as $s, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as Ps, propertyFlagAttribute as Et, propertyFlagReflect as ks, propertyFlagBoolean as Is, propertyFlagNumber as xs, propertyFlagState as As, propertyFlagReadOnly as Ls, propertyFlagNoAccessor as Ns, propertyFlagUseDefault as js } from "@arcgis/lumina/config";
7
+ import { path as u, isPosix as ri, toPosixPathSeparators as G, toSystemPathSeparators as Re, getCwd as ni } from "@arcgis/node-toolkit/path";
8
+ import { isApiMethodAsync as Fs, globalPackageIdentifier as Rs, isApiMethod as Ds, isApiProperty as Os } from "@arcgis/api-extractor/utils/apiHelpers";
9
+ import { existsAsync as K, findPath as oi } from "@arcgis/node-toolkit/file";
10
+ import { readFile as z, readdir as at, mkdir as X, writeFile as _, copyFile as Ms, rm as Js, cp as Bs } from "node:fs/promises";
11
+ import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as ai } from "@arcgis/node-toolkit/packageJson";
12
+ import { build as Ks } from "esbuild";
13
+ import _s from "mime-types";
14
+ import { forEachWithConcurrency as Ws } from "@arcgis/toolkit/promise";
15
+ import { glob as Us } from "tinyglobby";
16
16
  import { renameComponentFolder as Ge } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
17
- import { useApiExtractor as _s } from "@arcgis/api-extractor/vite/plugin";
18
- import { writeFileSync as ni } from "node:fs";
19
- import { styleText as Ks } from "node:util";
20
- import { unsafeGetUndocumentedPrinter as Ws, unsafeUndocumentedTs as Ct } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
17
+ import { useApiExtractor as zs } from "@arcgis/api-extractor/vite/plugin";
18
+ import { writeFileSync as ci } from "node:fs";
19
+ import { styleText as Hs } from "node:util";
20
+ import { unsafeGetUndocumentedPrinter as qs, unsafeUndocumentedTs as Tt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
21
21
  import { pathIsComponentEntrypoint as Pe } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
22
- import { loadApiExtractorConfig as Us, mergeApiExtractorConfigs as Et } from "@arcgis/api-extractor/extractor/config";
23
- import { loadTypeScriptConfig as zs } from "@arcgis/node-toolkit/vite/typeScript";
22
+ import { loadApiExtractorConfig as Vs, mergeApiExtractorConfigs as $t } from "@arcgis/api-extractor/extractor/config";
23
+ import { loadTypeScriptConfig as Gs } from "@arcgis/node-toolkit/vite/typeScript";
24
24
  import { mappedFind as Xe } from "@arcgis/toolkit/array";
25
- import { isPropertyEscapeNeeded as oi, maybeEscapePropertyName as Hs } from "@arcgis/api-extractor/utils/partPrinter";
26
- import { getPackageNameFromExternalSpecifier as qs, getMemberName as ai } from "@arcgis/api-extractor/utils/astHelpers";
27
- import { identity as ci } from "@arcgis/toolkit/function";
28
- function Vs(e) {
29
- const t = e.options?.build?.dependencies ?? {}, i = vs({
25
+ import { isPropertyEscapeNeeded as li, maybeEscapePropertyName as Xs } from "@arcgis/api-extractor/utils/partPrinter";
26
+ import { getPackageNameFromExternalSpecifier as Ys, getMemberName as di } from "@arcgis/api-extractor/utils/astHelpers";
27
+ import { identity as pi } from "@arcgis/toolkit/function";
28
+ function Qs(e) {
29
+ const t = e.options?.build?.dependencies ?? {}, i = Cs({
30
30
  bundleIn: t.bundleIn,
31
31
  externalize: [
32
32
  // TODO: remove these once Lit is declared as a peer dependency
@@ -42,7 +42,7 @@ function Vs(e) {
42
42
  e.isInStorybook && (i.resolveId = void 0);
43
43
  }, i;
44
44
  }
45
- const Gs = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), li = /* @__PURE__ */ new Set([
45
+ const Zs = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), ui = /* @__PURE__ */ new Set([
46
46
  /**
47
47
  * There is a "className" property. However, in JSX typings we use "class"
48
48
  * instead to keep name shorter and to match Stencil's name. Thus, it should
@@ -74,7 +74,7 @@ const Gs = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__P
74
74
  "vocab",
75
75
  // These don't exist as a property, only as an attribute
76
76
  "exportParts"
77
- ]), di = /* @__PURE__ */ new Set([
77
+ ]), mi = /* @__PURE__ */ new Set([
78
78
  /*
79
79
  * From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
80
80
  * See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
@@ -913,9 +913,9 @@ const Gs = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__P
913
913
  }
914
914
  }
915
915
  };
916
- pi(W.common);
917
- Object.values(W.perElement).forEach(pi);
918
- function pi(e) {
916
+ fi(W.common);
917
+ Object.values(W.perElement).forEach(fi);
918
+ function fi(e) {
919
919
  e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
920
920
  /* @__PURE__ */ Object.create(null),
921
921
  e.stringifiedReflected
@@ -924,7 +924,7 @@ function pi(e) {
924
924
  e.stringifiedNonReflected
925
925
  ));
926
926
  }
927
- const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set([
927
+ const Pt = /* @__PURE__ */ new Set(["itemScope"]), gi = /* @__PURE__ */ new Set([
928
928
  "abort",
929
929
  "animationCancel",
930
930
  "animationEnd",
@@ -1023,7 +1023,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
1023
1023
  "volumeChange",
1024
1024
  "waiting",
1025
1025
  "wheel"
1026
- ]), Xs = /* @__PURE__ */ new Set([
1026
+ ]), er = /* @__PURE__ */ new Set([
1027
1027
  "area",
1028
1028
  "base",
1029
1029
  "br",
@@ -1040,7 +1040,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
1040
1040
  "source",
1041
1041
  "track",
1042
1042
  "wbr"
1043
- ]), at = /* @__PURE__ */ new Set([
1043
+ ]), ct = /* @__PURE__ */ new Set([
1044
1044
  "animate",
1045
1045
  "animateMotion",
1046
1046
  "animateTransform",
@@ -1099,7 +1099,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
1099
1099
  "tspan",
1100
1100
  "use",
1101
1101
  "view"
1102
- ]), Ys = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), ct = /* @__PURE__ */ new Set([
1102
+ ]), tr = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), lt = /* @__PURE__ */ new Set([
1103
1103
  "annotation-xml",
1104
1104
  "annotation",
1105
1105
  "maction",
@@ -1131,7 +1131,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
1131
1131
  "munder",
1132
1132
  "munderover",
1133
1133
  "semantics"
1134
- ]), Qs = /* @__PURE__ */ new Set([
1134
+ ]), ir = /* @__PURE__ */ new Set([
1135
1135
  "annotation-xml",
1136
1136
  "color-profile",
1137
1137
  "font-face",
@@ -1141,7 +1141,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
1141
1141
  "font-face-name",
1142
1142
  "missing-glyph"
1143
1143
  ]);
1144
- function Zs(e) {
1144
+ function sr(e) {
1145
1145
  if (e.length === 0)
1146
1146
  return "";
1147
1147
  const t = e[0];
@@ -1149,28 +1149,28 @@ function Zs(e) {
1149
1149
  `)) {
1150
1150
  const n = t === `
1151
1151
  `, r = e.lastIndexOf(`
1152
- `), l = e.slice(r + 1).trim().length === 0, d = n ? e.trimStart() : e;
1153
- return l ? d.trimEnd() : d;
1152
+ `), c = e.slice(r + 1).trim().length === 0, d = n ? e.trimStart() : e;
1153
+ return c ? d.trimEnd() : d;
1154
1154
  }
1155
1155
  return e.trim().length === 0 ? t : e;
1156
1156
  }
1157
- const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`", "\\`"), tr = /\$\{/gu, ir = (e) => !sr.test(e), sr = /^[^\s"'=<>`]+$/u, rr = /[&<>]/gu, nr = {
1157
+ const rr = (e) => e.replaceAll("\\", "\\\\").replace(nr, "\\${").replaceAll("`", "\\`"), nr = /\$\{/gu, or = (e) => !ar.test(e), ar = /^[^\s"'=<>`]+$/u, cr = /[&<>]/gu, lr = {
1158
1158
  "&": "&amp;",
1159
1159
  "<": "&lt;",
1160
1160
  ">": "&gt;"
1161
- }, mi = (e) => e.replace(rr, (t) => nr[t]), lt = (e) => typeof e == "string" && e.includes("-") && !Qs.has(e), or = ["keyed", "ref", "repeat", "live"], oe = "staticHtml", Y = "staticSvg", ae = "html", ie = "svg", fi = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), gi = "css", hi = "mathml", yi = [gi, ae, hi, oe, Y, ie], ar = new Set(yi), cr = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], lr = "nothing", dr = [...or, ...yi, ...cr, lr], pr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => fe(t)), fe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), se = {
1162
- [ae]: ["lit", "lit/html.js", "lit-html"],
1161
+ }, hi = (e) => e.replace(cr, (t) => lr[t]), dt = (e) => typeof e == "string" && e.includes("-") && !ir.has(e), dr = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Y = "staticSvg", ce = "html", se = "svg", yi = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), vi = "css", bi = "mathml", wi = [vi, ce, bi, ae, Y, se], pr = new Set(wi), ur = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], mr = "nothing", fr = [...dr, ...wi, ...ur, mr], gr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => fe(t)), fe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), re = {
1162
+ [ce]: ["lit", "lit/html.js", "lit-html"],
1163
1163
  /**
1164
1164
  * Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
1165
1165
  * "staticSvg", leading to collision. We have to import them "as", as well as
1166
1166
  * check for existing "html" and "svg" imports from these locations to prevent
1167
1167
  * collisions.
1168
1168
  */
1169
- [oe]: ["lit/static-html.js", "lit-html/static.js"],
1170
- [ie]: ["lit", "lit-html", "lit/html.js"],
1169
+ [ae]: ["lit/static-html.js", "lit-html/static.js"],
1170
+ [se]: ["lit", "lit-html", "lit/html.js"],
1171
1171
  [Y]: ["lit/static-html.js", "lit-html/static.js"],
1172
- [hi]: ["lit", "lit-html", "lit/html.js"],
1173
- [gi]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1172
+ [bi]: ["lit", "lit-html", "lit/html.js"],
1173
+ [vi]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1174
1174
  safeClassMap: ["@arcgis/lumina"],
1175
1175
  safeStyleMap: ["@arcgis/lumina"],
1176
1176
  deferLoad: ["@arcgis/lumina"],
@@ -1180,7 +1180,7 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1180
1180
  repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
1181
1181
  ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
1182
1182
  nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
1183
- }, ur = /* @__PURE__ */ new Set([
1183
+ }, hr = /* @__PURE__ */ new Set([
1184
1184
  "h",
1185
1185
  "Fragment",
1186
1186
  "state",
@@ -1190,15 +1190,15 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1190
1190
  "bindProperty",
1191
1191
  "bindEvent",
1192
1192
  "bindAttribute"
1193
- ]), mr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, le = "@arcgis/lumina:loadLitCss", Ie = "?litCss", Q = "?layeredLitCss", Ze = "?globalFileLitCss", fr = (e) => ({
1194
- name: le,
1193
+ ]), yr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, de = "@arcgis/lumina:loadLitCss", Ie = "?litCss", Q = "?layeredLitCss", Ze = "?globalFileLitCss", vr = (e) => ({
1194
+ name: de,
1195
1195
  enforce: "pre",
1196
1196
  configResolved(t) {
1197
1197
  const i = t.plugins.find(({ name: r }) => r === "vite:css-post");
1198
1198
  if (i === void 0)
1199
1199
  throw Error(
1200
1200
  b(
1201
- le,
1201
+ de,
1202
1202
  "Unable to find the vite's built-in vite:css-post plugin. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
1203
1203
  )
1204
1204
  );
@@ -1206,7 +1206,7 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1206
1206
  if (typeof s != "object" || typeof s.handler != "function")
1207
1207
  throw Error(
1208
1208
  b(
1209
- le,
1209
+ de,
1210
1210
  "Expected vite:css-post to declare a transform:{handler()} property. This may indicate you are trying to use Vite 6 with Lumina version that is designed for Vite 7. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
1211
1211
  )
1212
1212
  );
@@ -1214,7 +1214,7 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1214
1214
  if (n.length !== 1)
1215
1215
  throw Error(
1216
1216
  b(
1217
- le,
1217
+ de,
1218
1218
  `Expected vite:css-post's transform handler to have only a single property: handler. Found: ${n.join(",")}. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use \`[p]npm list vite\`/\`yarn why vite\` to check the Vite version you are using.`
1219
1219
  )
1220
1220
  );
@@ -1222,22 +1222,22 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1222
1222
  ...s,
1223
1223
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1224
1224
  async handler(r, a) {
1225
- const l = a.endsWith(Ie);
1226
- l && (a = a.slice(0, -Ie.length));
1225
+ const c = a.endsWith(Ie);
1226
+ c && (a = a.slice(0, -Ie.length));
1227
1227
  const d = a.endsWith(Q);
1228
1228
  d && (a = a.slice(0, -Q.length));
1229
- const c = a.endsWith(Ze);
1230
- if (c && (a = a.slice(0, -Ze.length)), !l && !d && !c)
1229
+ const l = a.endsWith(Ze);
1230
+ if (l && (a = a.slice(0, -Ze.length)), !c && !d && !l)
1231
1231
  return await s.handler.call(this, r, a);
1232
1232
  const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
1233
- return typeof f != "string" || !f.startsWith(vi) || !f.endsWith(gr) ? (T.warn(
1234
- le,
1233
+ return typeof f != "string" || !f.startsWith(Si) || !f.endsWith(br) ? (T.warn(
1234
+ de,
1235
1235
  `Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
1236
1236
  f
1237
1237
  )}`
1238
- ), m) : c ? (e._globalCssString = bi(f), { code: "", map: { mappings: "" } }) : {
1238
+ ), m) : l ? (e._globalCssString = Ci(f), { code: "", map: { mappings: "" } }) : {
1239
1239
  ...g,
1240
- code: br(f, e.hmrEnabled, e.shouldMinify, d),
1240
+ code: Er(f, e.hmrEnabled, e.shouldMinify, d),
1241
1241
  /**
1242
1242
  * Vite's original transform does not generate source maps for inlined
1243
1243
  * css, thus we can't either
@@ -1247,8 +1247,8 @@ const er = (e) => e.replaceAll("\\", "\\\\").replace(tr, "\\${").replaceAll("`",
1247
1247
  }
1248
1248
  };
1249
1249
  }
1250
- }), vi = 'export default "', gr = '"', hr = `import { css } from '${se.css[0]}';
1251
- export const styles = css\``, yr = "`;\nexport default styles;", vr = `
1250
+ }), Si = 'export default "', br = '"', wr = `import { css } from '${re.css[0]}';
1251
+ export const styles = css\``, Sr = "`;\nexport default styles;", Cr = `
1252
1252
 
1253
1253
  if(import.meta.hot) {
1254
1254
  import.meta.hot.data.styles ??= styles;
@@ -1259,24 +1259,24 @@ if(import.meta.hot) {
1259
1259
  }
1260
1260
  import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
1261
1261
  });
1262
- }`, bi = (e) => e.slice(vi.length - 1);
1263
- function br(e, t, i, s) {
1264
- const n = bi(e), r = JSON.parse(n), a = er(r), l = s ? `@layer{${i ? "" : `
1262
+ }`, Ci = (e) => e.slice(Si.length - 1);
1263
+ function Er(e, t, i, s) {
1264
+ const n = Ci(e), r = JSON.parse(n), a = rr(r), c = s ? `@layer{${i ? "" : `
1265
1265
  `}${a}${i ? "" : `
1266
1266
  `}}` : a;
1267
- return `${hr}${l}${yr}${t ? vr : ""}`;
1267
+ return `${wr}${c}${Sr}${t ? Cr : ""}`;
1268
1268
  }
1269
- function wr(e) {
1270
- return `import("${Sr}").then(({ setCustomElementsManifest }) => {
1271
- setCustomElementsManifest(${Cr(e)});
1269
+ function Tr(e) {
1270
+ return `import("${$r}").then(({ setCustomElementsManifest }) => {
1271
+ setCustomElementsManifest(${Pr(e)});
1272
1272
  });`;
1273
1273
  }
1274
- const Sr = "@storybook/web-components-vite", Cr = (e) => `JSON.parse(\`${Er(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1275
- function Er(e) {
1274
+ const $r = "@storybook/web-components-vite", Pr = (e) => `JSON.parse(\`${kr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1275
+ function kr(e) {
1276
1276
  return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
1277
1277
  }
1278
- function Tr(e) {
1279
- $r(e);
1278
+ function Ir(e) {
1279
+ xr(e);
1280
1280
  const t = e.options.css?.globalStylesPath;
1281
1281
  if (t === void 0)
1282
1282
  return "";
@@ -1284,21 +1284,21 @@ function Tr(e) {
1284
1284
  return e.viteCommand === "serve" || e.isInStorybook ? [
1285
1285
  `import globalStyles from "${i}${Q}";`,
1286
1286
  "document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
1287
- Si("", e)
1287
+ Ti("", e)
1288
1288
  ].join(`
1289
1289
  `) : `import "${i}${Ze}";`;
1290
1290
  }
1291
- const wi = "hydrated";
1292
- function $r(e) {
1291
+ const Ei = "hydrated";
1292
+ function xr(e) {
1293
1293
  e._globalHydratedCssString = [
1294
1294
  ":not([",
1295
- e.options.css?.hydratedAttribute ?? wi,
1295
+ e.options.css?.hydratedAttribute ?? Ei,
1296
1296
  "]):is(",
1297
1297
  e.apiJsonComponents.map((t) => t.tagName).join(","),
1298
1298
  "){visibility:hidden}"
1299
1299
  ].join("");
1300
1300
  }
1301
- function Si(e, t) {
1301
+ function Ti(e, t) {
1302
1302
  return [
1303
1303
  "const globalCss = new CSSStyleSheet;",
1304
1304
  `globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
@@ -1306,71 +1306,72 @@ function Si(e, t) {
1306
1306
  ].join(`
1307
1307
  `);
1308
1308
  }
1309
- const Pr = (e) => `@layer{${e.shouldMinify ? "" : `
1309
+ const Ar = (e) => `@layer{${e.shouldMinify ? "" : `
1310
1310
  `}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
1311
1311
 
1312
1312
  `}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
1313
1313
  `}}`;
1314
- function kr(e) {
1314
+ function Lr(e) {
1315
1315
  const t = [], i = [];
1316
1316
  for (const s of e.privateApiJson.modules)
1317
1317
  for (const n of s.declarations)
1318
- n.customElement === !0 && (i.push(Ir(n, e, s.sourcePath)), t.push(s.sourcePath));
1318
+ n.customElement === !0 && (i.push(Nr(n, e, s.sourcePath)), t.push(s.sourcePath));
1319
1319
  return [
1320
1320
  'import { runtime } from "./runtime.ts";',
1321
1321
  'import { makeDefineCustomElements } from "@arcgis/lumina";',
1322
- Tr(e),
1323
- e.hmrEnabled ? Ar : "",
1322
+ Ir(e),
1323
+ e.hmrEnabled ? Fr : "",
1324
1324
  "",
1325
- e.isInStorybook ? wr(e.apiJson) : "",
1325
+ e.isInStorybook ? Tr(e.apiJson) : "",
1326
1326
  "",
1327
1327
  "export const defineCustomElements = makeDefineCustomElements(runtime, {",
1328
1328
  i.join(`,
1329
1329
  `),
1330
1330
  "});",
1331
- e.hmrEnabled ? Lr(t) : ""
1331
+ e.hmrEnabled ? Rr(t) : ""
1332
1332
  ].join(`
1333
1333
  `);
1334
1334
  }
1335
- const Ir = (e, t, i) => [
1335
+ const Nr = (e, t, i) => [
1336
1336
  ` "${e.tagName}": [`,
1337
1337
  `()=>import("${u.join(t.dir.root, i)}"),`,
1338
- xr(e),
1338
+ jr(e),
1339
1339
  "]"
1340
1340
  ].join("");
1341
- function xr(e) {
1342
- const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = Ci(e), r = t.map((g) => g.join(Ss)).join(Je), a = i.join(Je), l = s.join(Je), d = [r, a, l], c = d.findLastIndex((g) => g.length > 0), p = d.slice(0, c + 1);
1343
- return `${p.length > 0 || n ? `"${p.join(Cs)}"` : ""}${n ? ",1" : ""}`;
1341
+ function jr(e) {
1342
+ const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = $i(e), r = t.map((g) => g.join($s)).join(Je), a = i.join(Je), c = s.join(Je), d = [r, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
1343
+ return `${p.length > 0 || n ? `"${p.join(Ps)}"` : ""}${n ? ",1" : ""}`;
1344
1344
  }
1345
- function Ci(e) {
1345
+ function $i(e) {
1346
1346
  const t = [], i = [], s = [];
1347
1347
  for (let r = 0; r < e.members.length; ++r) {
1348
1348
  const a = e.members[r];
1349
1349
  if (a.kind === "field") {
1350
- const l = typeof a.attribute == "string", d = l && a.attribute !== ei(a.name);
1350
+ const c = typeof a.attribute == "string", d = c && a.attribute !== si(a.name);
1351
1351
  t.push(
1352
- l && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
1352
+ c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
1353
1353
  );
1354
- } else a.kind === "method" && a.name !== "componentOnReady" && (As(a) ? i.push(a.name) : s.push(a.name));
1354
+ } else a.kind === "method" && a.name !== "componentOnReady" && (Fs(a) ? i.push(a.name) : s.push(a.name));
1355
1355
  }
1356
1356
  const n = e.formAssociated === !0;
1357
1357
  return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: n };
1358
1358
  }
1359
- const Ar = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
1360
- `, Lr = (e) => `
1359
+ const Fr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
1360
+ `, Rr = (e) => `
1361
1361
  if(import.meta.hot) {
1362
1362
  import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
1363
1363
  import.meta.hot.accept([
1364
1364
  ${e.map((t) => ` "/${t}",`).join(`
1365
1365
  `)}
1366
1366
  ], handleHmrUpdate);
1367
- }`, Nr = "@arcgis/lumina-compiler", Ei = {
1368
- name: Nr
1367
+ }`, Dr = "@arcgis/lumina-compiler", Pi = {
1368
+ name: Dr
1369
1369
  };
1370
- async function Ti(e, t) {
1371
- return re ??= Fr(e, t), await re;
1370
+ var Or = ["@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/core", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-compiler", "@arcgis/lumina-toolkit", "@arcgis/node-toolkit", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
1371
+ async function ki(e, t) {
1372
+ return ne ??= Jr(e, t), await ne;
1372
1373
  }
1373
- function jr() {
1374
+ function Mr() {
1374
1375
  if (xe === void 0)
1375
1376
  throw Error(
1376
1377
  b(
@@ -1380,7 +1381,7 @@ function jr() {
1380
1381
  );
1381
1382
  return xe;
1382
1383
  }
1383
- function $i() {
1384
+ function Ii() {
1384
1385
  if (et === void 0)
1385
1386
  throw Error(
1386
1387
  b(
@@ -1390,24 +1391,19 @@ function $i() {
1390
1391
  );
1391
1392
  return et;
1392
1393
  }
1393
- async function Fr(e, t) {
1394
+ async function Jr(e, t) {
1394
1395
  const i = j(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
1395
- [...Object.keys(s), ...Object.keys(n)].filter((c) => !Rr.has(c)).flatMap(async (c) => await Pi(c, e))
1396
+ [...Object.keys(s), ...Object.keys(n)].filter((l) => !Br.has(l)).flatMap(async (l) => await xi(l, e))
1396
1397
  )).filter(R);
1397
- xe ??= a, et = Object.fromEntries(a.flatMap((c) => Object.entries(c.components)));
1398
- const l = t?.serve?.extraDependencies?.map(
1399
- (c) => typeof c == "string" ? c : c.name
1400
- ), d = l === void 0 ? a : a.filter((c) => !l.includes(c.packageName));
1398
+ xe ??= a, et = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
1399
+ const c = t?.serve?.extraDependencies?.map(
1400
+ (l) => typeof l == "string" ? l : l.name
1401
+ ), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
1401
1402
  return xe ??= d, d;
1402
1403
  }
1403
- const Rr = /* @__PURE__ */ new Set([
1404
- "@arcgis/arcade-languageservice",
1405
- "@arcgis/node-toolkit",
1406
- "@arcgis/toolkit",
1407
- "@arcgis/core",
1408
- "@arcgis/languages-api-utils",
1404
+ const Br = /* @__PURE__ */ new Set([
1405
+ ...Or,
1409
1406
  "@arcgis/languages-sdk-specs",
1410
- "@arcgis/lumina",
1411
1407
  "@commander-js/extra-typings",
1412
1408
  "@custom-elements-manifest/analyzer",
1413
1409
  "@esri/calcite-ui-icons",
@@ -1439,50 +1435,50 @@ const Rr = /* @__PURE__ */ new Set([
1439
1435
  "vscode-languageserver-textdocument",
1440
1436
  "vscode-languageserver-types"
1441
1437
  ]);
1442
- let xe, et, re;
1443
- async function Pi(e, t) {
1444
- const i = await $e(e, t), s = await ri(i), n = "exports" in s, r = Hr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), l = u.join(i, "dist/esm/loader.js");
1445
- if (a ? await _(l) : !1) {
1446
- const g = await z(l, "utf8"), h = Dr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
1438
+ let xe, et, ne;
1439
+ async function xi(e, t) {
1440
+ const i = await $e(e, t), s = await ai(i), n = "exports" in s, r = Yr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
1441
+ if (a ? await K(c) : !1) {
1442
+ const g = await z(c, "utf8"), h = Kr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
1447
1443
  try {
1448
- const C = JSON.parse(w), E = Ur(C, { packageName: e, getImportPath: r });
1444
+ const C = JSON.parse(w), E = Gr(C, { packageName: e, getImportPath: r });
1449
1445
  return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
1450
1446
  } catch (C) {
1451
1447
  T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
1452
1448
  Error: ${String(C)}`);
1453
1449
  }
1454
1450
  }
1455
- const c = $t(s.customElements);
1456
- if (c != null) {
1457
- const g = u.join(i, c), h = JSON.parse(await z(g, "utf-8")), y = Or(h), v = ki(h, {
1451
+ const l = kt(s.customElements);
1452
+ if (l != null) {
1453
+ const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), y = _r(h), v = Ai(h, {
1458
1454
  packageName: e,
1459
1455
  getImportPath: r
1460
1456
  });
1461
1457
  return { type: y ? "@arcgis/lumina" : "unknown", packageName: e, components: v, packageLocation: i, packageJson: s };
1462
1458
  }
1463
- const p = $t(s["web-types"]);
1459
+ const p = kt(s["web-types"]);
1464
1460
  if (p != null) {
1465
- const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y = Mr(h, {
1461
+ const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y = Wr(h, {
1466
1462
  packageName: e,
1467
1463
  getImportPath: r
1468
1464
  });
1469
1465
  return { type: "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
1470
1466
  }
1471
1467
  const m = u.join(i, "dist/components");
1472
- if (await _(m)) {
1473
- const g = await zr(m, {
1468
+ if (await K(m)) {
1469
+ const g = await Xr(m, {
1474
1470
  packageName: e,
1475
1471
  getImportPath: r
1476
1472
  });
1477
1473
  return { type: "unknown", packageName: e, components: g, packageLocation: i, packageJson: s };
1478
1474
  }
1479
1475
  }
1480
- const $t = (e) => Array.isArray(e) ? e[0] : e;
1481
- function Dr(e, t) {
1476
+ const kt = (e) => Array.isArray(e) ? e[0] : e;
1477
+ function Kr(e, t) {
1482
1478
  const i = e.indexOf(t);
1483
1479
  return i === -1 ? -1 : i + t.length;
1484
1480
  }
1485
- function ki(e, t, i = !1) {
1481
+ function Ai(e, t, i = !1) {
1486
1482
  const s = /* @__PURE__ */ Object.create(null);
1487
1483
  if (e.modules === void 0)
1488
1484
  return s;
@@ -1493,7 +1489,7 @@ function ki(e, t, i = !1) {
1493
1489
  const d = r.declarations[a];
1494
1490
  if (d.customElement !== !0)
1495
1491
  continue;
1496
- const c = (
1492
+ const l = (
1497
1493
  // New api.json
1498
1494
  "sourcePath" in r ? r.path : (
1499
1495
  // Older api.json
@@ -1501,7 +1497,7 @@ function ki(e, t, i = !1) {
1501
1497
  )
1502
1498
  ), p = d.tagName, m = {
1503
1499
  packageName: t.packageName,
1504
- modulePath: c ?? t.getImportPath(p),
1500
+ modulePath: l ?? t.getImportPath(p),
1505
1501
  propToAttribute: Object.fromEntries(
1506
1502
  (d.attributes ?? []).map((f) => [f.fieldName ?? f.name, f.name])
1507
1503
  ),
@@ -1519,11 +1515,11 @@ function ki(e, t, i = !1) {
1519
1515
  }
1520
1516
  return s;
1521
1517
  }
1522
- const Or = (e) => (
1518
+ const _r = (e) => (
1523
1519
  // Since 5.0
1524
1520
  e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
1525
- e.compiler?.name === Ei.name
1526
- ), Mr = (e, t) => Object.fromEntries(
1521
+ e.compiler?.name === Pi.name
1522
+ ), Wr = (e, t) => Object.fromEntries(
1527
1523
  (e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
1528
1524
  (i) => [
1529
1525
  i.name,
@@ -1534,7 +1530,7 @@ const Or = (e) => (
1534
1530
  }
1535
1531
  ]
1536
1532
  ) ?? []
1537
- ), Jr = 1, Br = 2, _r = 4, Kr = 8, Wr = Jr | Br | _r | Kr, Ur = (e, t) => Object.fromEntries(
1533
+ ), Ur = 1, zr = 2, Hr = 4, qr = 8, Vr = Ur | zr | Hr | qr, Gr = (e, t) => Object.fromEntries(
1538
1534
  e.flatMap(
1539
1535
  ([i, s]) => s.map(
1540
1536
  ([n, r, a]) => [
@@ -1543,14 +1539,14 @@ const Or = (e) => (
1543
1539
  packageName: t.packageName,
1544
1540
  modulePath: t.getImportPath(r),
1545
1541
  propToAttribute: Object.fromEntries(
1546
- Object.entries(a ?? {}).filter(([l, [d]]) => d & Wr).map(([l, [d, c = l]]) => [l, c])
1542
+ Object.entries(a ?? {}).filter(([c, [d]]) => d & Vr).map(([c, [d, l = c]]) => [c, l])
1547
1543
  )
1548
1544
  }
1549
1545
  ]
1550
1546
  )
1551
1547
  )
1552
- ), zr = async (e, t) => Object.fromEntries(
1553
- (await ot(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
1548
+ ), Xr = async (e, t) => Object.fromEntries(
1549
+ (await at(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
1554
1550
  const s = i.slice(0, -5);
1555
1551
  return [
1556
1552
  s,
@@ -1561,29 +1557,36 @@ const Or = (e) => (
1561
1557
  }
1562
1558
  ];
1563
1559
  })
1564
- ), Hr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, qr = (e) => e.startsWith("/") ? e : `/${e}`, dt = (e, t) => `${e}@fs${qr(t)}`;
1565
- function Vr(e, t) {
1560
+ ), Yr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Qr = (e) => e.startsWith("/") ? e : `/${e}`, pt = (e, t) => `${e}@fs${Qr(t)}`;
1561
+ function Zr(e, t) {
1566
1562
  const i = u.resolve(e), s = u.resolve(i, t.split(/[?#]/u)[0].replace(/^[/\\]+/u, "")), n = u.relative(i, s);
1567
1563
  return n === ".." || n.startsWith(`..${u.sep}`) || u.isAbsolute(n) ? void 0 : s;
1568
1564
  }
1569
- function Ii(e) {
1565
+ const Li = "packages/core-packages/core/src", en = "packages/core-packages/core/output/npm/esm", te = !import.meta.url.includes("node_modules");
1566
+ function ut(e) {
1567
+ return te && e.name !== "@esri/calcite-components" ? "5.2.0-next.135" : e.version;
1568
+ }
1569
+ function Ni({ command: e }) {
1570
+ return e === "serve" && process.argv.includes("--local-core");
1571
+ }
1572
+ function ji(e) {
1570
1573
  const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
1571
1574
  return i === "latest" ? "esnext" : i;
1572
1575
  }
1573
1576
  const tt = "@arcgis/lumina:provideAssets";
1574
- function te(e, t, i = pt, s = "max-age=31536000, immutable") {
1577
+ function ie(e, t, i = mt, s = "max-age=31536000, immutable") {
1575
1578
  if (e.viteCommand !== "serve")
1576
1579
  throw Error(b(tt, "serveAssets() is only available when Vite is running in serve mode"));
1577
1580
  const n = e._serverConfigured, r = e.server.middlewares.stack.length;
1578
1581
  if (t.forEach((a) => {
1579
- const l = Ai(a), d = Ni(e.dir, Li(l)), c = Xr(e.viteConfig.base, d, e.dir.distCdn);
1580
- e.server.middlewares.use(c, (p, m, f) => {
1581
- const g = Yr(p.url), h = l.type === "directory" ? Vr(l.source, g) : l.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
1582
+ const c = Ri(a), d = Oi(e.dir, Di(c)), l = sn(e.viteConfig.base, d, e.dir.distCdn);
1583
+ e.server.middlewares.use(l, (p, m, f) => {
1584
+ const g = rn(p.url), h = c.type === "directory" ? Zr(c.source, g) : c.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
1582
1585
  return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) : z(h)).then((w) => {
1583
1586
  const C = (typeof h == "function" ? void 0 : v?.transform(w.toString("utf8"), y, e)) ?? w;
1584
- m.setHeader("Cache-Control", s), m.setHeader("Content-Type", Ms.lookup(g) || "application/octet-stream"), m.write(C), m.end();
1587
+ m.setHeader("Cache-Control", s), m.setHeader("Content-Type", _s.lookup(g) || "application/octet-stream"), m.write(C), m.end();
1585
1588
  }).catch((w) => {
1586
- (l.type !== "directory" || process.env.DEBUG) && T.warn(
1589
+ (c.type !== "directory" || process.env.DEBUG) && T.warn(
1587
1590
  tt,
1588
1591
  `Error occurred when trying to serve a file in response to request for "${p.originalUrl ?? g}":${String(w)}`
1589
1592
  ), f();
@@ -1594,31 +1597,31 @@ function te(e, t, i = pt, s = "max-age=31536000, immutable") {
1594
1597
  e.server.middlewares.stack.splice(0, 0, ...a);
1595
1598
  }
1596
1599
  }
1597
- async function xi(e, t, i = pt) {
1600
+ async function Fi(e, t, i = mt) {
1598
1601
  await Promise.all(
1599
1602
  t.map(async (s) => {
1600
- const n = Ai(s), r = Ni(e.dir, Li(n));
1603
+ const n = Ri(s), r = Oi(e.dir, Di(n));
1601
1604
  if (n.type === "directory") {
1602
- const a = u.resolve(n.source), d = (await ot(a, { recursive: !0, withFileTypes: !0 })).filter((c) => c.isFile()).map((c) => {
1603
- const p = u.resolve(c.parentPath, c.name), m = u.relative(a, p), f = u.join(r, m);
1605
+ const a = u.resolve(n.source), d = (await at(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
1606
+ const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
1604
1607
  return [p, f];
1605
1608
  });
1606
- await Fi(d.map(([c, p]) => p)), await Js(
1609
+ await Ji(d.map(([l, p]) => p)), await Ws(
1607
1610
  d,
1608
1611
  16,
1609
- async ([c, p]) => await Pt(c, p, i, e)
1612
+ async ([l, p]) => await It(l, p, i, e)
1610
1613
  );
1611
1614
  } else if (n.type === "file")
1612
- await X(u.dirname(r), { recursive: !0 }), await Pt(n.source, r, i, e);
1615
+ await X(u.dirname(r), { recursive: !0 }), await It(n.source, r, i, e);
1613
1616
  else if (n.type === "dynamic") {
1614
1617
  await X(u.dirname(r), { recursive: !0 });
1615
1618
  const a = await Promise.resolve(n.source());
1616
- await K(r, a);
1619
+ await _(r, a);
1617
1620
  }
1618
1621
  })
1619
1622
  );
1620
1623
  }
1621
- const Ai = ti ? (e) => e : (e) => e.type === "dynamic" ? {
1624
+ const Ri = ri ? (e) => e : (e) => e.type === "dynamic" ? {
1622
1625
  ...e,
1623
1626
  destination: G(e.destination)
1624
1627
  } : {
@@ -1626,16 +1629,16 @@ const Ai = ti ? (e) => e : (e) => e.type === "dynamic" ? {
1626
1629
  source: G(e.source),
1627
1630
  destination: G(e.destination)
1628
1631
  };
1629
- async function Pt(e, t, i, s) {
1632
+ async function It(e, t, i, s) {
1630
1633
  const n = i.find((r) => r.match(t, s));
1631
1634
  if (n === void 0)
1632
- await Fs(e, t);
1635
+ await Ms(e, t);
1633
1636
  else {
1634
1637
  const r = await z(e, "utf8"), a = n.transform(r, t, s);
1635
- await K(t, a);
1638
+ await _(t, a);
1636
1639
  }
1637
1640
  }
1638
- function Li(e) {
1641
+ function Di(e) {
1639
1642
  if (e.type === "dynamic")
1640
1643
  return e.destination;
1641
1644
  if (e.source.endsWith(u.sep)) {
@@ -1650,40 +1653,40 @@ function Li(e) {
1650
1653
  }
1651
1654
  return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
1652
1655
  }
1653
- function Ni({ dist: e, distCdnAssets: t }, i) {
1654
- const s = Gr(i), n = u.join(
1656
+ function Oi({ dist: e, distCdnAssets: t }, i) {
1657
+ const s = tn(i), n = u.join(
1655
1658
  t,
1656
1659
  s ? u.relative(t, i) : i
1657
- ), r = u.relative(e, n), a = ji(r);
1660
+ ), r = u.relative(e, n), a = Mi(r);
1658
1661
  return u.join(e, a);
1659
1662
  }
1660
- function Gr(e) {
1663
+ function tn(e) {
1661
1664
  if (e.startsWith(u.sep)) {
1662
- const t = ii(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
1665
+ const t = ni(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
1663
1666
  return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
1664
1667
  } else
1665
- return !!(!ti && u.isAbsolute(e));
1668
+ return !!(!ri && u.isAbsolute(e));
1666
1669
  }
1667
- function Xr(e, t, i) {
1668
- const s = ji(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
1670
+ function sn(e, t, i) {
1671
+ const s = Mi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
1669
1672
  return `${e}${n}`;
1670
1673
  }
1671
- const ji = (e) => e.replaceAll("../", ""), Yr = (e = "") => e.split("?")[0].split("#")[0];
1672
- async function Fi(e) {
1674
+ const Mi = (e) => e.replaceAll("../", ""), rn = (e = "") => e.split("?")[0].split("#")[0];
1675
+ async function Ji(e) {
1673
1676
  const t = new Set(e.map(u.dirname));
1674
1677
  await Promise.all(Array.from(t, async (i) => await X(i, { recursive: !0 })));
1675
1678
  }
1676
- const Qr = {
1679
+ const nn = {
1677
1680
  match: (e, t) => t.environment === "production" && e.endsWith(".json"),
1678
1681
  transform: (e) => JSON.stringify(JSON.parse(e))
1679
- }, pt = [Qr], Ae = "@arcgis/core", me = "@arcgis/core/assets", Ke = j(), H = Ae in (Ke.dependencies ?? {}) || Ae in (Ke.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1680
- Ke.name === "@arcgis/lumina";
1681
- async function Zr(e, t, i, s) {
1682
+ }, mt = [nn], Ae = "@arcgis/core", me = "@arcgis/core/assets", _e = j(), H = Ae in (_e.dependencies ?? {}) || Ae in (_e.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1683
+ _e.name === "@arcgis/lumina";
1684
+ async function on(e, t, i, s) {
1682
1685
  if (!H)
1683
1686
  return [];
1684
1687
  const n = e._localCdnCore, r = n?.packageLocation ?? await $e(Ae);
1685
1688
  if (i === "cdn") {
1686
- const a = await ri(r), l = De({ name: "", version: a.version }, s);
1689
+ const a = await ai(r), c = De(a, s);
1687
1690
  return [
1688
1691
  // Use the ESM CDN
1689
1692
  // <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
@@ -1694,23 +1697,23 @@ async function Zr(e, t, i, s) {
1694
1697
  },
1695
1698
  children: JSON.stringify({
1696
1699
  imports: {
1697
- "@arcgis/core/": `${l}@arcgis/core/`
1700
+ "@arcgis/core/": `${c}@arcgis/core/`
1698
1701
  }
1699
1702
  })
1700
1703
  },
1701
1704
  // <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
1702
- Ri(l)
1705
+ Bi(c)
1703
1706
  ];
1704
1707
  } else
1705
- return en(t, r, n?.sourceLocation !== void 0);
1708
+ return an(t, r, n?.sourceLocation !== void 0);
1706
1709
  }
1707
- function en(e, t, i) {
1710
+ function an(e, t, i) {
1708
1711
  const s = `${e}${me}`;
1709
1712
  return [
1710
1713
  // Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
1711
1714
  // Core's prebuilt JavaScript assets use the untransformed route configured below.
1712
- Ri(
1713
- i ? `${e}${me}/` : dt(e, `${t}/assets/`)
1715
+ Bi(
1716
+ i ? `${e}${me}/` : pt(e, `${t}/assets/`)
1714
1717
  ),
1715
1718
  {
1716
1719
  // This import is injected dynamically, so external consumers must tell Vite to optimize it. Within the monorepo,
@@ -1723,7 +1726,7 @@ function en(e, t, i) {
1723
1726
  }
1724
1727
  ];
1725
1728
  }
1726
- async function tn(e) {
1729
+ async function cn(e) {
1727
1730
  const t = e._localCdnCore, i = t?.packageLocation ?? await $e(Ae), s = t?.sourceLocation !== void 0 ? [
1728
1731
  {
1729
1732
  type: "directory",
@@ -1764,40 +1767,42 @@ async function tn(e) {
1764
1767
  }
1765
1768
  ];
1766
1769
  e.server.middlewares.use("/builddate.txt", (n, r) => {
1767
- r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain"), r.end(JSON.stringify({ version: j(i).version }));
1768
- }), te(e, s, [], "no-cache");
1770
+ r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain");
1771
+ const a = t?.sourceLocation ? "5.2.0-next.135" : j(i).version;
1772
+ r.end(JSON.stringify({ version: a }));
1773
+ }), ie(e, s, [], "no-cache");
1769
1774
  }
1770
- const Ri = (e) => ({
1775
+ const Bi = (e) => ({
1771
1776
  // Not using join() because it would turn https:// into https:/
1772
1777
  cssHref: `${e}esri/themes/light/main.css`,
1773
1778
  // This is used be the theme switcher in `@arcgis/storybook-utils`
1774
1779
  id: "arcgisCoreStylesheet"
1775
- }), ut = "customElement.js";
1776
- function sn(e, t) {
1780
+ }), ft = "customElement.js";
1781
+ function ln(e, t) {
1777
1782
  if (!t.startsWith(e))
1778
1783
  return t;
1779
1784
  const s = t.split(u.sep);
1780
- return s.at(rn) !== s.at(nn) ? t : u.join(s.slice(0, -1).join(u.sep), ut);
1785
+ return s.at(dn) !== s.at(pn) ? t : u.join(s.slice(0, -1).join(u.sep), ft);
1781
1786
  }
1782
- const rn = -1, nn = -2, on = /["']\.\.?\/[^'"]+/gu, an = (e, t, i, s) => e.replaceAll(on, (n) => {
1787
+ const dn = -1, pn = -2, un = /["']\.\.?\/[^'"]+/gu, mn = (e, t, i, s) => e.replaceAll(un, (n) => {
1783
1788
  const r = n.slice(1);
1784
1789
  if (!r.startsWith("./") && !r.startsWith("../"))
1785
1790
  return n;
1786
- const a = u.join(s, r), l = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? sn(t.dir.distComponents, a) : a, d = l.startsWith(t.dir.distComponents) ? t.dir.dist + Ge(l.slice(t.dir.dist.length), t.apiExtractor) : l;
1791
+ const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? ln(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + Ge(c.slice(t.dir.dist.length), t.apiExtractor) : c;
1787
1792
  if (i === s && a === d)
1788
1793
  return n;
1789
- const c = he(i, d), p = n.endsWith("/") ? `${c}/` : c;
1794
+ const l = he(i, d), p = n.endsWith("/") ? `${l}/` : l;
1790
1795
  return `${n[0]}${p}`;
1791
1796
  }), he = (e, t) => {
1792
1797
  const i = u.relative(e, t);
1793
1798
  return i.startsWith(".") ? i : `.${u.sep}${i}`;
1794
1799
  };
1795
- async function cn(e, t, i) {
1800
+ async function fn(e, t, i) {
1796
1801
  const s = u.resolve(e.dir.root, t);
1797
- e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Rs(s, { recursive: !0, force: !0 }), await X(s, { recursive: !0 }), await Ds(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
1802
+ e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Js(s, { recursive: !0, force: !0 }), await X(s, { recursive: !0 }), await Bs(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
1798
1803
  const n = [
1799
1804
  "index.html",
1800
- ...await Bs("**/*.html", {
1805
+ ...await Us("**/*.html", {
1801
1806
  cwd: e.dir.src,
1802
1807
  onlyFiles: !0,
1803
1808
  // The files we are looking for are unlikely to be symbolic links
@@ -1805,22 +1810,22 @@ async function cn(e, t, i) {
1805
1810
  // Not applicable for our glob pattern
1806
1811
  expandDirectories: !1
1807
1812
  })
1808
- ], r = u.relative(e.dir.root, e.dir.src), a = await ne(e), l = u.join(e.dir.src, "loader.ts"), d = a.map((c) => {
1809
- if ("cssHref" in c)
1810
- return `<link rel="stylesheet" href="${c.cssHref}">`;
1811
- if ("javascriptCode" in c && c.javascriptCode.at(0)?.includes(l) === !0)
1813
+ ], r = u.relative(e.dir.root, e.dir.src), a = await oe(e), c = u.join(e.dir.src, "loader.ts"), d = a.map((l) => {
1814
+ if ("cssHref" in l)
1815
+ return `<link rel="stylesheet" href="${l.cssHref}">`;
1816
+ if ("javascriptCode" in l && l.javascriptCode.at(0)?.includes(c) === !0)
1812
1817
  return "";
1813
- if ("tag" in c) {
1814
- const p = c.children ?? "";
1818
+ if ("tag" in l) {
1819
+ const p = l.children ?? "";
1815
1820
  if (typeof p == "string")
1816
- return `<${c.tag} ${Object.entries(c.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${c.tag}>`;
1821
+ return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${l.tag}>`;
1817
1822
  }
1818
- throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(c)}`));
1823
+ throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(l)}`));
1819
1824
  }).join(`
1820
1825
  `);
1821
1826
  await Promise.all(
1822
- n.map(async (c, p) => {
1823
- const f = p === 0 ? c : u.join(r, c), g = u.join(e.dir.root, f), h = u.join(s, f);
1827
+ n.map(async (l, p) => {
1828
+ const f = p === 0 ? l : u.join(r, l), g = u.join(e.dir.root, f), h = u.join(s, f);
1824
1829
  await X(u.dirname(h), { recursive: !0 });
1825
1830
  const y = await z(g, "utf-8"), v = he(u.dirname(f), `build/${i}`), w = `${d}<script type="module" src="${v}"><\/script>
1826
1831
  `, C = Math.min(
@@ -1831,11 +1836,11 @@ async function cn(e, t, i) {
1831
1836
  if (C === Number.POSITIVE_INFINITY)
1832
1837
  throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
1833
1838
  const E = y.slice(0, C) + w + y.slice(C), P = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
1834
- await K(h, P, "utf-8");
1839
+ await _(h, P, "utf-8");
1835
1840
  })
1836
1841
  ), await e.options.build?.webApp?.afterBuildEnd?.(e);
1837
1842
  }
1838
- const Di = /* @__PURE__ */ new Set([
1843
+ const Ki = /* @__PURE__ */ new Set([
1839
1844
  "chunks",
1840
1845
  "components",
1841
1846
  "docs",
@@ -1848,13 +1853,13 @@ const Di = /* @__PURE__ */ new Set([
1848
1853
  "collection",
1849
1854
  "extras",
1850
1855
  "support"
1851
- ]), O = "@arcgis/lumina:buildCdn", ce = "cdn", Oi = "index", Z = "main";
1852
- function ln(e) {
1856
+ ]), O = "@arcgis/lumina:buildCdn", le = "cdn", _i = "index", Z = "main";
1857
+ function gn(e) {
1853
1858
  const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
1854
1859
  if (a) {
1855
1860
  if (i.toLowerCase() !== i)
1856
1861
  throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
1857
- if (Di.has(i))
1862
+ if (Ki.has(i))
1858
1863
  throw new Error(
1859
1864
  `Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
1860
1865
  );
@@ -1862,12 +1867,12 @@ function ln(e) {
1862
1867
  'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
1863
1868
  );
1864
1869
  }
1865
- const l = i ?? Oi;
1870
+ const c = i ?? _i;
1866
1871
  if (e.provideAssets([
1867
1872
  {
1868
1873
  type: "dynamic",
1869
- source: () => Pr(e),
1870
- destination: `../${a ? l : Z}.css`
1874
+ source: () => Ar(e),
1875
+ destination: `../${a ? c : Z}.css`
1871
1876
  }
1872
1877
  ]), !t)
1873
1878
  return {
@@ -1882,27 +1887,27 @@ function ln(e) {
1882
1887
  );
1883
1888
  return;
1884
1889
  }
1885
- const d = H && j().name !== "@arcgis/embeddable-components", c = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await dn(
1890
+ const d = H && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await hn(
1886
1891
  e,
1887
- l,
1892
+ c,
1888
1893
  s,
1889
1894
  p,
1890
1895
  n,
1891
1896
  d
1892
1897
  );
1893
- await pn(
1898
+ await yn(
1894
1899
  m,
1895
1900
  e,
1896
- a ? `${l}.esm` : l,
1901
+ a ? `${c}.esm` : c,
1897
1902
  p,
1898
1903
  d
1899
1904
  );
1900
1905
  const f = Date.now();
1901
- T.info(O, `CDN was built in ${f - c}ms`), r && await cn(e, r, `${a ? `${l}.esm` : l}.js`);
1906
+ T.info(O, `CDN was built in ${f - l}ms`), r && await fn(e, r, `${a ? `${c}.esm` : c}.js`);
1902
1907
  }
1903
1908
  };
1904
1909
  }
1905
- async function dn(e, t, i, s, n, r) {
1910
+ async function hn(e, t, i, s, n, r) {
1906
1911
  const a = e.environment;
1907
1912
  if (i.minify && r)
1908
1913
  throw Error(
@@ -1918,15 +1923,15 @@ async function dn(e, t, i, s, n, r) {
1918
1923
  "Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
1919
1924
  )
1920
1925
  );
1921
- const l = `import { defineCustomElements } from "./loader";
1926
+ const c = `import { defineCustomElements } from "./loader";
1922
1927
  /**
1923
1928
  * We use import.meta.url to get the path to the current file
1924
1929
  * and pass it to defineCustomElements to set the resources url.
1925
1930
  * The script's file name will be stripped inside defineCustomElements.
1926
1931
  **/
1927
1932
  defineCustomElements({resourcesUrl: import.meta.url});
1928
- ${Si(e._globalCssString, e)}`, d = n?.(l, e) ?? l;
1929
- return await Os({
1933
+ ${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
1934
+ return await Ks({
1930
1935
  bundle: !0,
1931
1936
  minify: r ? !0 : a === "production",
1932
1937
  treeShaking: !0,
@@ -1951,20 +1956,20 @@ ${Si(e._globalCssString, e)}`, d = n?.(l, e) ?? l;
1951
1956
  chunkNames: "[hash]",
1952
1957
  resolveExtensions: [".js", ".json"],
1953
1958
  banner: { js: e.banner },
1954
- target: Ii(e),
1959
+ target: ji(e),
1955
1960
  ...i,
1956
1961
  write: !1,
1957
1962
  plugins: [
1958
1963
  {
1959
1964
  name: "@arcgis/lumina:accessorSupport",
1960
- setup(c) {
1961
- c.onResolve(
1965
+ setup(l) {
1966
+ l.onResolve(
1962
1967
  { filter: /^@arcgis\/core\/applications\/Components\/reactiveUtils.js$/ },
1963
1968
  (p) => p.importer.endsWith("runtime.js") ? {
1964
1969
  path: p.path,
1965
1970
  namespace: "@arcgis/lumina:accessorSupport"
1966
1971
  } : void 0
1967
- ), c.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
1972
+ ), l.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
1968
1973
  contents: "export const createObservable=undefined, trackAccess=undefined, createTrackingTarget=undefined, runTracked = undefined;",
1969
1974
  loader: "js"
1970
1975
  }));
@@ -1975,18 +1980,18 @@ ${Si(e._globalCssString, e)}`, d = n?.(l, e) ?? l;
1975
1980
  // manual injection further below. Thus drop the CSS import from the
1976
1981
  // chunks/runtime.js file.
1977
1982
  name: "@arcgis/lumina:customGlobalCssInjection",
1978
- setup(c) {
1983
+ setup(l) {
1979
1984
  const p = e.options.build?.cdn?.namespace === void 0 ? (
1980
1985
  // eslint-disable-next-line require-unicode-regexp
1981
- new RegExp(`\\/${ce}\\/${Z}\\.css$`)
1986
+ new RegExp(`\\/${le}\\/${Z}\\.css$`)
1982
1987
  ) : (
1983
1988
  // eslint-disable-next-line require-unicode-regexp
1984
1989
  new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
1985
1990
  );
1986
- c.onResolve({ filter: p }, ({ path: m }) => ({
1991
+ l.onResolve({ filter: p }, ({ path: m }) => ({
1987
1992
  path: m,
1988
1993
  namespace: "build-cdn:global-css"
1989
- })), c.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
1994
+ })), l.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
1990
1995
  contents: "",
1991
1996
  loader: "js"
1992
1997
  }));
@@ -2010,11 +2015,11 @@ ${Si(e._globalCssString, e)}`, d = n?.(l, e) ?? l;
2010
2015
  }
2011
2016
  });
2012
2017
  }
2013
- const kt = "stdin.js";
2014
- async function pn(e, t, i, s, n) {
2018
+ const xt = "stdin.js";
2019
+ async function yn(e, t, i, s, n) {
2015
2020
  const r = t.dir.distCdn, a = `${i}.js`;
2016
- let l;
2017
- n && (l = new Set(s.map((p) => `${p.out}.js`)), l.add(a));
2021
+ let c;
2022
+ n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
2018
2023
  const d = new Map(
2019
2024
  e.outputFiles.map((p) => {
2020
2025
  const m = {
@@ -2023,15 +2028,15 @@ async function pn(e, t, i, s, n) {
2023
2028
  isAsync: void 0,
2024
2029
  oldSingleExportName: void 0
2025
2030
  }, f = G(p.path.slice(r.length));
2026
- if (f === kt) {
2031
+ if (f === xt) {
2027
2032
  if (n) {
2028
- const h = p.text.match(un)?.[0];
2033
+ const h = p.text.match(vn)?.[0];
2029
2034
  if (h === void 0)
2030
2035
  throw Error(
2031
- `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${kt} contents:
2036
+ `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${xt} contents:
2032
2037
  ${p.text}`
2033
2038
  );
2034
- m.code = `${m.code.trimEnd()}${mn(h, s)}`, m.isAsync = !1;
2039
+ m.code = `${m.code.trimEnd()}${bn(h, s)}`, m.isAsync = !1;
2035
2040
  }
2036
2041
  return [a, m];
2037
2042
  }
@@ -2041,7 +2046,7 @@ ${p.text}`
2041
2046
  n && d.forEach((p, m) => {
2042
2047
  if (p.isAsync === void 0)
2043
2048
  if (m.endsWith(".js")) {
2044
- if (Mi(p, d), l?.has(m) === !0 && p.code.includes(Ji))
2049
+ if (Wi(p, d), c?.has(m) === !0 && p.code.includes(Ui))
2045
2050
  throw Error(
2046
2051
  b(
2047
2052
  O,
@@ -2051,18 +2056,18 @@ ${p.text}`
2051
2056
  } else
2052
2057
  p.isAsync = !1;
2053
2058
  }), t.options.build?.cdn?.transformer?.(d, t);
2054
- const c = /* @__PURE__ */ new Map();
2059
+ const l = /* @__PURE__ */ new Map();
2055
2060
  for (const p of d.keys()) {
2056
2061
  const m = p.lastIndexOf("/");
2057
2062
  if (m !== -1) {
2058
2063
  const f = p.slice(0, m);
2059
- c.set(f, X(r + f, { recursive: !0 }));
2064
+ l.set(f, X(r + f, { recursive: !0 }));
2060
2065
  }
2061
2066
  }
2062
- await Promise.all(c.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await K(r + p, m)));
2067
+ await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await _(r + p, m)));
2063
2068
  }
2064
- const un = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
2065
- function mn(e, t) {
2069
+ const vn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
2070
+ function bn(e, t) {
2066
2071
  let i = [
2067
2072
  "window.$arcgis",
2068
2073
  "||",
@@ -2103,30 +2108,30 @@ function mn(e, t) {
2103
2108
  }
2104
2109
  return i += ")", i;
2105
2110
  }
2106
- function Mi(e, t) {
2111
+ function Wi(e, t) {
2107
2112
  if (e.isProcessing) {
2108
- e.isAsync = !0, It(e);
2113
+ e.isAsync = !0, At(e);
2109
2114
  return;
2110
2115
  }
2111
2116
  e.isProcessing = !0;
2112
2117
  const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
2113
- let l = 0;
2114
- const d = e.code.matchAll(fn);
2118
+ let c = 0;
2119
+ const d = e.code.matchAll(wn);
2115
2120
  for (const S of d) {
2116
2121
  const [A, L, U, F, N] = S, B = N.startsWith(Le);
2117
- if (l !== 0 && l !== S.index) {
2118
- const D = e.code.slice(l, S.index);
2119
- n.push(D), a.push([l, D.length, 0, ""]);
2122
+ if (c !== 0 && c !== S.index) {
2123
+ const D = e.code.slice(c, S.index);
2124
+ n.push(D), a.push([c, D.length, 0, ""]);
2120
2125
  }
2121
- if (l = S.index + A.length, B)
2122
- a.push([S.index, A.length, 0, ""]), s.push(`"${_i(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? F ?? "");
2126
+ if (c = S.index + A.length, B)
2127
+ a.push([S.index, A.length, 0, ""]), s.push(`"${Hi(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? F ?? "");
2123
2128
  else {
2124
- const D = Bi(N, t), M = D?.isAsync === !0;
2129
+ const D = zi(N, t), M = D?.isAsync === !0;
2125
2130
  if (L !== void 0) {
2126
2131
  const be = [];
2127
2132
  for (const Me of L.slice(1, -1).split(",")) {
2128
- const [vt, bt = vt] = Me.split(" as ");
2129
- M || r.add(bt), be.push(`${vt}:${bt}`);
2133
+ const [wt, St = wt] = Me.split(" as ");
2134
+ M || r.add(St), be.push(`${wt}:${St}`);
2130
2135
  }
2131
2136
  if (M) {
2132
2137
  const Me = D.oldSingleExportName === void 0 ? `{${be.join(",")}}` : be[0].split(":")[1];
@@ -2148,13 +2153,13 @@ ${D.code}`
2148
2153
  }
2149
2154
  }
2150
2155
  e.isProcessing = !1;
2151
- const c = e.isAsync === !0;
2152
- if (e.isAsync = c || a.length > 0, !e.isAsync) {
2153
- e.code = xt(e.code, t);
2156
+ const l = e.isAsync === !0;
2157
+ if (e.isAsync = l || a.length > 0, !e.isAsync) {
2158
+ e.code = Lt(e.code, t);
2154
2159
  return;
2155
2160
  }
2156
- const p = yn(r);
2157
- let m = e.code.slice(0, l);
2161
+ const p = En(r);
2162
+ let m = e.code.slice(0, c);
2158
2163
  for (let S = a.length - 1; S >= 0; S--) {
2159
2164
  const [A, L, U, F] = a[S];
2160
2165
  let N = L, B = "";
@@ -2164,22 +2169,22 @@ ${D.code}`
2164
2169
  }
2165
2170
  m = m.slice(0, A) + B + m.slice(A + N);
2166
2171
  }
2167
- const [f, g] = It(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${Ji}${v}=>{`, C = s.join(","), E = `${g}},${C})`;
2168
- let P = e.code.slice(l, f);
2169
- P = `${n.join("")}${P}`, P = xt(P, t);
2172
+ const [f, g] = At(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${Ui}${v}=>{`, C = s.join(","), E = `${g}},${C})`;
2173
+ let P = e.code.slice(c, f);
2174
+ P = `${n.join("")}${P}`, P = Lt(P, t);
2170
2175
  const x = `${m}${w}${P}${E}`;
2171
2176
  e.code = x;
2172
2177
  }
2173
- const Ji = "export default $arcgis.t(";
2174
- function It(e) {
2175
- const t = gn.exec(e.code), i = t?.index ?? e.code.length;
2178
+ const Ui = "export default $arcgis.t(";
2179
+ function At(e) {
2180
+ const t = Sn.exec(e.code), i = t?.index ?? e.code.length;
2176
2181
  let s = "";
2177
2182
  if (t !== null) {
2178
2183
  const n = t[1].split(",");
2179
2184
  if (n.length > 1)
2180
2185
  s = `return{${n.map((r) => {
2181
- const [a, l = a] = r.split(" as ");
2182
- return `${l}:${a}`;
2186
+ const [a, c = a] = r.split(" as ");
2187
+ return `${c}:${a}`;
2183
2188
  }).join(",")}}`;
2184
2189
  else {
2185
2190
  const [r, a = r] = n[0].split(" as ");
@@ -2188,51 +2193,51 @@ function It(e) {
2188
2193
  }
2189
2194
  return [i, s];
2190
2195
  }
2191
- const fn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, gn = /export\{([^}]+)\};\n$/u, Le = "@arcgis/core/";
2192
- function Bi(e, t) {
2196
+ const wn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Sn = /export\{([^}]+)\};\n$/u, Le = "@arcgis/core/";
2197
+ function zi(e, t) {
2193
2198
  if (!e.startsWith("./"))
2194
2199
  return;
2195
2200
  const i = e.slice(2), s = t.get(i);
2196
2201
  if (s === void 0)
2197
2202
  throw Error(b(O, `Failed to find the ${e} module`));
2198
- if (s.isAsync === void 0 && Mi(s, t), s.isAsync === void 0)
2203
+ if (s.isAsync === void 0 && Wi(s, t), s.isAsync === void 0)
2199
2204
  throw Error(b(O, `Failed to infer whether the ${e} module has top-level await`));
2200
2205
  return s;
2201
2206
  }
2202
- function xt(e, t) {
2203
- return e.replaceAll(hn, (i, s) => {
2207
+ function Lt(e, t) {
2208
+ return e.replaceAll(Cn, (i, s) => {
2204
2209
  if (s.startsWith(Le))
2205
- return `$arcgis.t(m=>m[0],"${_i(s.slice(Le.length))}")`;
2210
+ return `$arcgis.t(m=>m[0],"${Hi(s.slice(Le.length))}")`;
2206
2211
  if (s.startsWith("./")) {
2207
- const n = Bi(s, t);
2212
+ const n = zi(s, t);
2208
2213
  if (n?.isAsync === !0)
2209
2214
  return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
2210
2215
  }
2211
2216
  return i;
2212
2217
  });
2213
2218
  }
2214
- const hn = /(?<![.\w\d])import\("([^"]+)"\)/gu, _i = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2215
- function yn(e) {
2219
+ const Cn = /(?<![.\w\d])import\("([^"]+)"\)/gu, Hi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2220
+ function En(e) {
2216
2221
  const t = [it];
2217
2222
  return () => {
2218
2223
  for (; ; ) {
2219
- const i = wn(t);
2220
- if (Sn(t), !e.has(i))
2224
+ const i = Pn(t);
2225
+ if (kn(t), !e.has(i))
2221
2226
  return e.add(i), i;
2222
2227
  }
2223
2228
  };
2224
2229
  }
2225
- const it = 0, mt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ki = `${mt}0123456789`, vn = mt.length, bn = Ki.length;
2226
- function wn(e) {
2227
- let t = mt[e[0]];
2230
+ const it = 0, gt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", qi = `${gt}0123456789`, Tn = gt.length, $n = qi.length;
2231
+ function Pn(e) {
2232
+ let t = gt[e[0]];
2228
2233
  for (let i = 1; i < e.length; ++i)
2229
- t += Ki[e[i]];
2234
+ t += qi[e[i]];
2230
2235
  return t;
2231
2236
  }
2232
- function Sn(e) {
2237
+ function kn(e) {
2233
2238
  let t = e.length - 1;
2234
2239
  for (; t >= 0; ) {
2235
- const i = t === 0 ? vn : bn;
2240
+ const i = t === 0 ? Tn : $n;
2236
2241
  if (e[t] += 1, e[t] >= i)
2237
2242
  e[t] = it, t--;
2238
2243
  else
@@ -2241,29 +2246,29 @@ function Sn(e) {
2241
2246
  e.push(it);
2242
2247
  }
2243
2248
  function De(e = j(), t = !1) {
2244
- const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
2245
- if (s && i)
2246
- return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ce}/`;
2247
- const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r = Cn(e.name), a = En(e.version);
2248
- if (a === void 0)
2249
+ const i = e.name === "@esri/calcite-components", s = ut(e) ?? e.version, n = s.includes("next");
2250
+ if (i && n)
2251
+ return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${s}/dist/${le}/`;
2252
+ const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = In(e.name), c = xn(s);
2253
+ if (c === void 0)
2249
2254
  throw Error(
2250
2255
  b(
2251
2256
  "@arcgis/lumina:dependencies",
2252
2257
  `Failed to parse a semver version: ${e.name}. Ensure the version follows D.D.D format. Package version: ${e.version}`
2253
2258
  )
2254
2259
  );
2255
- return r.length === 0 ? `https://${n}/${a}/` : s ? `https://${n}/${r}/${a}/` : `https://${n}/${a}/${r}/`;
2260
+ return a === "core" ? `https://${r}/${c}/` : i ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
2256
2261
  }
2257
- const Cn = (e) => e.split("/").pop() ?? e;
2258
- function En(e) {
2262
+ const In = (e) => e.split("/").pop() ?? e;
2263
+ function xn(e) {
2259
2264
  const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
2260
2265
  if (i?.groups === void 0)
2261
2266
  return;
2262
- const { major: s, minor: n, patch: r, prerelease: a } = i.groups, l = `${s}.${n}.${r}`;
2263
- return a?.startsWith("-next") ? `${l}-next` : l;
2267
+ const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
2268
+ return a?.startsWith("-next") ? `${c}-next` : c;
2264
2269
  }
2265
- async function Tn(e, t, i, s, n) {
2266
- const r = t.packageName, { hasCss: a, cdnName: l } = await Wi(t.packageLocation) ?? {};
2270
+ async function An(e, t, i, s, n) {
2271
+ const r = t.packageName, { hasCss: a, cdnName: c } = await Vi(t.packageLocation) ?? {};
2267
2272
  if (i === "cdn") {
2268
2273
  const m = t.cdnUrl ?? De(t.packageJson, n);
2269
2274
  return [
@@ -2272,7 +2277,7 @@ async function Tn(e, t, i, s, n) {
2272
2277
  tag: "link",
2273
2278
  attrs: {
2274
2279
  rel: "stylesheet",
2275
- src: `${m}${l}.css`
2280
+ src: `${m}${c}.css`
2276
2281
  }
2277
2282
  }
2278
2283
  ] : [],
@@ -2280,12 +2285,12 @@ async function Tn(e, t, i, s, n) {
2280
2285
  tag: "script",
2281
2286
  attrs: {
2282
2287
  type: "module",
2283
- src: `${m}${l}.esm.js`
2288
+ src: `${m}${c}.esm.js`
2284
2289
  }
2285
2290
  }
2286
2291
  ];
2287
2292
  }
2288
- const d = `${r}/dist/${l}/${l}.css${Q}`, c = a ? [
2293
+ const d = `${r}/dist/${c}/${c}.css${Q}`, l = a ? [
2289
2294
  `import styles$${s} from "${d}";`,
2290
2295
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2291
2296
  ] : [], p = `${r}/dist/esm/loader.js`;
@@ -2297,39 +2302,39 @@ async function Tn(e, t, i, s, n) {
2297
2302
  */
2298
2303
  optimizableImports: [p],
2299
2304
  javascriptCode: [
2300
- ...c,
2305
+ ...l,
2301
2306
  `import { defineCustomElements as defineCustomElements$${s} } from "${p}";`,
2302
2307
  `defineCustomElements$${s}(globalThis.window, {`,
2303
- ` resourcesUrl: "${dt(e, t.packageLocation)}/dist/${l}/",`,
2308
+ ` resourcesUrl: "${pt(e, t.packageLocation)}/dist/${c}/",`,
2304
2309
  "});"
2305
2310
  ]
2306
2311
  }
2307
2312
  ];
2308
2313
  }
2309
- async function Wi(e) {
2310
- const t = u.join(e, "dist"), i = u.basename(e), n = (await ot(t)).filter(
2311
- (a) => !Di.has(a) && !a.includes(".")
2314
+ async function Vi(e) {
2315
+ const t = u.join(e, "dist"), i = u.basename(e), n = (await at(t)).filter(
2316
+ (a) => !Ki.has(a) && !a.includes(".")
2312
2317
  ), r = n.find(
2313
2318
  (a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
2314
2319
  a === i
2315
2320
  );
2316
2321
  return r === void 0 ? await Promise.all(
2317
- n.map(async (a) => await At(t, a))
2318
- ).then((a) => a.find(R)) : await At(t, r);
2319
- }
2320
- async function At(e, t) {
2321
- const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, l] = await Promise.all([
2322
- _(i),
2323
- _(s),
2324
- _(n)
2322
+ n.map(async (a) => await Nt(t, a))
2323
+ ).then((a) => a.find(R)) : await Nt(t, r);
2324
+ }
2325
+ async function Nt(e, t) {
2326
+ const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
2327
+ K(i),
2328
+ K(s),
2329
+ K(n)
2325
2330
  ]);
2326
- return r || a || l ? {
2331
+ return r || a || c ? {
2327
2332
  hasCss: r,
2328
2333
  cdnName: t
2329
2334
  } : void 0;
2330
2335
  }
2331
- async function $n(e, t, i, s, n) {
2332
- const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await Wi(t.packageLocation) : void 0, l = a?.cdnName ?? ce, d = a === void 0 ? `${Oi}.js` : `${a.cdnName}.esm.js`;
2336
+ async function Ln(e, t, i, s, n) {
2337
+ const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await Vi(t.packageLocation) : void 0, c = a?.cdnName ?? le, d = a === void 0 ? `${_i}.js` : `${a.cdnName}.esm.js`;
2333
2338
  if (i === "cdn")
2334
2339
  return {
2335
2340
  tag: "script",
@@ -2338,7 +2343,7 @@ async function $n(e, t, i, s, n) {
2338
2343
  src: `${t.cdnUrl ?? De(t.packageJson, n)}${d}`
2339
2344
  }
2340
2345
  };
2341
- const c = Pn(t.packageJson), p = `${t.packageName}/${u.normalize(c)}${Q}`, m = [
2346
+ const l = Nn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${Q}`, m = [
2342
2347
  `import styles$${s} from "${p}";`,
2343
2348
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2344
2349
  ], f = `${t.packageName}/loader`;
@@ -2352,12 +2357,12 @@ async function $n(e, t, i, s, n) {
2352
2357
  ...m,
2353
2358
  `import { defineCustomElements as defineCustomElements$${s} } from "${f}";`,
2354
2359
  `defineCustomElements$${s}({`,
2355
- ` resourcesUrl: "${dt(e, t.packageLocation)}/dist/${l}/",`,
2360
+ ` resourcesUrl: "${pt(e, t.packageLocation)}/dist/${c}/",`,
2356
2361
  "});"
2357
2362
  ]
2358
2363
  };
2359
2364
  }
2360
- function Pn(e) {
2365
+ function Nn(e) {
2361
2366
  const { exports: t } = e;
2362
2367
  if (t === void 0)
2363
2368
  throw new Error(
@@ -2366,25 +2371,25 @@ function Pn(e) {
2366
2371
  const i = Object.entries(t).filter(([n]) => u.extname(n) === ".css"), s = i.find(([, n]) => n === `./${Z}.css`);
2367
2372
  return s ? s[0] : i.length > 0 ? i[0][0] : `./${Z}.css`;
2368
2373
  }
2369
- async function ne(e, t) {
2370
- return t !== void 0 ? await Lt(e, t) : (e._loadersCache ??= Lt(e), await e._loadersCache);
2374
+ async function oe(e, t) {
2375
+ return t !== void 0 ? await jt(e, t) : (e._loadersCache ??= jt(e), await e._loadersCache);
2371
2376
  }
2372
- async function Lt(e, t) {
2377
+ async function jt(e, t) {
2373
2378
  const i = e.viteCommand === "build" ? "cdn" : "lazyNpm", s = e.environment === "development", n = t ?? e.viteConfig.base;
2374
2379
  let r = 0;
2375
2380
  const a = async (m) => (await Promise.all(
2376
2381
  m.map(async (f) => {
2377
2382
  const g = r++;
2378
- return f.type === "stencil" ? await Tn(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await $n(n, f, i, g, s) : void 0;
2383
+ return f.type === "stencil" ? await An(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await Ln(n, f, i, g, s) : void 0;
2379
2384
  })
2380
- )).filter(R).flat(), l = await Promise.all([
2385
+ )).filter(R).flat(), c = await Promise.all([
2381
2386
  // This may contain an import map so must be first
2382
- Zr(e, n, i, s),
2383
- re.then(a),
2384
- Ui(e).then(a)
2385
- ]), d = u.join(e.dir.src, "loader.ts"), c = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? ce}/` : void 0);
2387
+ on(e, n, i, s),
2388
+ ne.then(a),
2389
+ Gi(e).then(a)
2390
+ ]), d = u.join(e.dir.src, "loader.ts"), l = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? le}/` : void 0);
2386
2391
  return [
2387
- ...l.flat(),
2392
+ ...c.flat(),
2388
2393
  {
2389
2394
  optimizableImports: [
2390
2395
  /**
@@ -2395,16 +2400,16 @@ async function Lt(e, t) {
2395
2400
  javascriptCode: [
2396
2401
  `import { defineCustomElements } from "${d}";`,
2397
2402
  "globalThis.devOnly$ownTagNames = new Set();",
2398
- `defineCustomElements(${c === void 0 ? "" : `{resourcesUrl:${JSON.stringify(c)}}`});`
2403
+ `defineCustomElements(${l === void 0 ? "" : `{resourcesUrl:${JSON.stringify(l)}}`});`
2399
2404
  ]
2400
2405
  }
2401
2406
  ];
2402
2407
  }
2403
- async function Ui(e) {
2408
+ async function Gi(e) {
2404
2409
  const t = e.options?.serve?.extraDependencies ?? [];
2405
2410
  return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
2406
2411
  t.map(async (i) => {
2407
- const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await Pi(n);
2412
+ const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await xi(n);
2408
2413
  if (r === void 0)
2409
2414
  throw Error(
2410
2415
  b(
@@ -2419,55 +2424,46 @@ async function Ui(e) {
2419
2424
  })
2420
2425
  ).then((i) => i.filter(R)), await e._serveOnlyDependencies);
2421
2426
  }
2422
- const kn = "/C:@arcgis/lumina-compiler/testSetupFile", In = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, We = [kn];
2423
- async function xn(e) {
2424
- if (
2425
- /**
2426
- * Only import custom element dependencies if we are running in Vitest browser mode.
2427
- * This keeps node tests lightweight for unit tests that don't deal with web
2428
- * components.
2429
- *
2430
- * For puppeteer front-end, we run Vite rather than Vitest, so setup-file
2431
- * does not apply (instead we use transformIndexHtml() for dependency loading).
2432
- */
2433
- !e.apiJsonEnabled
2434
- )
2435
- return Nt(e);
2436
- const i = (await ne(e)).map((s, n) => {
2437
- if ("javascriptCode" in s)
2438
- return s.javascriptCode.join(`
2427
+ const Xi = "/C:@arcgis/lumina-compiler/testSetupFile", st = `${Xi}/dependencies`, Ft = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, We = [Xi];
2428
+ function jn(e) {
2429
+ return e.apiJsonEnabled ? `${Rt(e)}
2430
+ import "${st}";` : Rt(e);
2431
+ }
2432
+ async function Fn(e) {
2433
+ return (await oe(e)).map((i, s) => {
2434
+ if ("javascriptCode" in i)
2435
+ return i.javascriptCode.join(`
2439
2436
  `);
2440
- if ("cssHref" in s)
2437
+ if ("cssHref" in i)
2441
2438
  return [
2442
2439
  /*
2443
2440
  * The $index naming is already used by makeLoaders(), so we use the
2444
2441
  * $t prefix to avoid collisions.
2445
2442
  */
2446
- `import styles$t${n} from "${s.cssHref}${Q}";`,
2447
- `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${n}.styleSheet];`
2443
+ `import styles$t${s} from "${i.cssHref}${Q}";`,
2444
+ `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${s}.styleSheet];`
2448
2445
  ].join(`
2449
2446
  `);
2450
2447
  throw Error(
2451
2448
  b(
2452
2449
  "@arcgis/lumina:buildTestSetupFile",
2453
- `Unexpected loader type for the browser test environment: ${JSON.stringify(s)}`
2450
+ `Unexpected loader type for the browser test environment: ${JSON.stringify(i)}`
2454
2451
  )
2455
2452
  );
2456
2453
  }).join(`
2457
2454
 
2458
2455
  `);
2459
- return [Nt(e), i].join("");
2460
2456
  }
2461
- const Nt = (e) => [e.isInPuppeteerTestBackEnd ? An : "", Ln].join(""), An = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2457
+ const Rt = (e) => [e.isInPuppeteerTestBackEnd ? Rn : "", Dn].join(""), Rn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2462
2458
  setupPuppeteerTest();
2463
- `, Ln = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2459
+ `, Dn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2464
2460
  setupLuminaTest();
2465
- `, Nn = "@arcgis/lumina:generateLoaderTs";
2461
+ `, On = "@arcgis/lumina:generateLoaderTs";
2466
2462
  let Ne;
2467
- function jn(e) {
2463
+ function Mn(e) {
2468
2464
  const t = /[\\\/]src[\\\/]loader\.ts$/u;
2469
- return [_s(e.apiExtractorPluginConfig), {
2470
- name: Nn,
2465
+ return [zs(e.apiExtractorPluginConfig), {
2466
+ name: On,
2471
2467
  configResolved() {
2472
2468
  Ne = `${e.dir.root}src/loader.ts`;
2473
2469
  },
@@ -2482,7 +2478,7 @@ function jn(e) {
2482
2478
  id: t
2483
2479
  },
2484
2480
  async handler() {
2485
- return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, kr(e);
2481
+ return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, Lr(e);
2486
2482
  }
2487
2483
  },
2488
2484
  async handleHotUpdate() {
@@ -2490,29 +2486,39 @@ function jn(e) {
2490
2486
  }
2491
2487
  }, {
2492
2488
  name: "@arcgis/lumina:generateTestSetupVirtualFile",
2489
+ resolveId: {
2490
+ filter: {
2491
+ id: Ft
2492
+ },
2493
+ // Vitest treats the configured setup-file ID as a filesystem path and
2494
+ // loads it without resolving it through Vite. The dependency module is
2495
+ // imported by that setup file, so it goes through Vite's module graph and
2496
+ // must be explicitly resolved to its virtual ID here.
2497
+ handler: (r) => r === st ? r : void 0
2498
+ },
2493
2499
  load: {
2494
2500
  filter: {
2495
- id: In
2501
+ id: Ft
2496
2502
  },
2497
- handler: async () => await xn(e)
2503
+ handler: async (r) => r.startsWith(st) ? await Fn(e) : jn(e)
2498
2504
  }
2499
2505
  }];
2500
2506
  }
2501
- function jt(e) {
2507
+ function Dt(e) {
2502
2508
  const t = e.server.moduleGraph.getModuleById(Ne);
2503
2509
  t !== void 0 && e.server.moduleGraph.invalidateModule(t);
2504
2510
  }
2505
- const Ft = (e) => {
2511
+ const Ot = (e) => {
2506
2512
  e.server.ws.send({
2507
2513
  type: "full-reload",
2508
2514
  path: u.join("/", u.relative(e.dir.root, Ne))
2509
2515
  });
2510
2516
  };
2511
- function Fn(e) {
2517
+ function Jn(e) {
2512
2518
  let t;
2513
2519
  const i = () => [
2514
2520
  ...e.options.assets?.transformers ?? [],
2515
- ...pt
2521
+ ...mt
2516
2522
  ];
2517
2523
  return {
2518
2524
  name: "@arcgis/lumina:handleStaticAssets",
@@ -2531,38 +2537,38 @@ function Fn(e) {
2531
2537
  * `configureServer`.
2532
2538
  */
2533
2539
  configResolved() {
2534
- e.viteCommand === "serve" && (t = Rt(e));
2540
+ e.viteCommand === "serve" && (t = Mt(e));
2535
2541
  },
2536
2542
  options() {
2537
- e.viteCommand === "build" && (t = Rt(e));
2543
+ e.viteCommand === "build" && (t = Mt(e));
2538
2544
  },
2539
2545
  async configureServer(s) {
2540
- e.server = s, te(e, await t, i()), s.watcher.on("addDir", (n) => {
2546
+ e.server = s, ie(e, await t, i()), s.watcher.on("addDir", (n) => {
2541
2547
  if (n.endsWith("assets")) {
2542
2548
  const r = u.dirname(n);
2543
- u.join(r, "/") === e.dir.root ? te(e, [Hi], i()) : n.startsWith(e.dir.srcComponents) && te(e, [zi(n, r)], i());
2549
+ u.join(r, "/") === e.dir.root ? ie(e, [Qi], i()) : n.startsWith(e.dir.srcComponents) && ie(e, [Yi(n, r)], i());
2544
2550
  }
2545
2551
  });
2546
2552
  },
2547
2553
  async writeBundle() {
2548
- await xi(e, await t, i());
2554
+ await Fi(e, await t, i());
2549
2555
  }
2550
2556
  };
2551
2557
  }
2552
- async function Rt(e) {
2553
- const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
2558
+ async function Mt(e) {
2559
+ const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
2554
2560
  i.map(async (n) => {
2555
2561
  const r = u.dirname(n), a = u.join(r, "assets");
2556
- return await _(a) ? zi(a, r) : void 0;
2562
+ return await K(a) ? Yi(a, r) : void 0;
2557
2563
  })
2558
2564
  );
2559
- return await t && s.push(Hi), s.filter(R);
2565
+ return await t && s.push(Qi), s.filter(R);
2560
2566
  }
2561
- const zi = (e, t) => ({
2567
+ const Yi = (e, t) => ({
2562
2568
  type: "directory",
2563
2569
  source: e,
2564
2570
  destination: u.basename(t)
2565
- }), Hi = { type: "directory", source: "assets/", destination: "" }, Ue = "@arcgis/lumina:printTotalBuildSize", Rn = (e) => ({
2571
+ }), Qi = { type: "directory", source: "assets/", destination: "" }, Ue = "@arcgis/lumina:printTotalBuildSize", Bn = (e) => ({
2566
2572
  name: Ue,
2567
2573
  apply: () => e.viteCommand === "build",
2568
2574
  configResolved(t) {
@@ -2577,16 +2583,16 @@ const zi = (e, t) => ({
2577
2583
  if (typeof s != "function")
2578
2584
  throw Error(b(Ue, "Expected vite:reporter to declare a writeBundle() function"));
2579
2585
  i.writeBundle = async function(r, a) {
2580
- let l = 0, d = 0, c = 0, p = 0;
2586
+ let c = 0, d = 0, l = 0, p = 0;
2581
2587
  const m = console.log;
2582
2588
  console.log = function(...g) {
2583
2589
  if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
2584
- const [h, y] = g[0].match(On) ?? [];
2590
+ const [h, y] = g[0].match(_n) ?? [];
2585
2591
  if (!h)
2586
2592
  return;
2587
- p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Mn, "").length);
2593
+ p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Wn, "").length);
2588
2594
  const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
2589
- y ? (c += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : l += v;
2595
+ y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
2590
2596
  }
2591
2597
  };
2592
2598
  try {
@@ -2595,38 +2601,36 @@ const zi = (e, t) => ({
2595
2601
  console.log = m;
2596
2602
  }
2597
2603
  if (d > 0) {
2598
- const g = c > 0 ? d : l, h = Mt(g), y = e.dir.relativeDist;
2604
+ const g = l > 0 ? d : c, h = Kt(g), y = e.dir.relativeDist;
2599
2605
  console.log(
2600
2606
  [
2601
- Ot,
2607
+ Bt,
2602
2608
  y,
2603
- Dn,
2609
+ Kn,
2604
2610
  "*",
2605
2611
  " ".repeat(p - `${y}*`.length - h.length),
2606
2612
  h,
2607
- Dt,
2608
- c > 0 ? ` ${Ot}│ gzip: ${Mt(c)}${Dt}` : ""
2613
+ Jt,
2614
+ l > 0 ? ` ${Bt}│ gzip: ${Kt(l)}${Jt}` : ""
2609
2615
  ].join("")
2610
2616
  );
2611
2617
  }
2612
2618
  };
2613
2619
  }
2614
- }), Dt = "\x1B[22m\x1B[1m\x1B[22m", Ot = "\x1B[2m", Dn = "\x1B[22m\x1B[36m", On = /\d+(?:,\d+)?\.\d{2} kB/gu, Mn = /\x1B\[\d+m/gu, Jn = new Intl.NumberFormat("en", {
2620
+ }), Jt = "\x1B[22m\x1B[1m\x1B[22m", Bt = "\x1B[2m", Kn = "\x1B[22m\x1B[36m", _n = /\d+(?:,\d+)?\.\d{2} kB/gu, Wn = /\x1B\[\d+m/gu, Un = new Intl.NumberFormat("en", {
2615
2621
  maximumFractionDigits: 2,
2616
2622
  minimumFractionDigits: 2
2617
- }), Mt = (e) => `${Jn.format(e)} kB`, Bn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ut.slice(0, -3))), qi = "packages/core-packages/core/src", _n = "packages/core-packages/core/output/npm/esm", de = !import.meta.url.includes("node_modules");
2618
- function Vi({ command: e }) {
2619
- return e === "serve" && process.argv.includes("--local-core");
2620
- }
2621
- const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2622
- name: Jt,
2623
+ }), Kt = (e) => `${Un.format(e)} kB`, zn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ft.slice(0, -3)));
2624
+ var Hn = ["@arcgis-test/lit-components/loader", "@arcgis/ai-components/loader", "@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/charts-components/loader", "@arcgis/coding-components/loader", "@arcgis/common-components/loader", "@arcgis/core", "@arcgis/embeddable-components/loader", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-toolkit", "@arcgis/map-components/loader", "@arcgis/node-toolkit", "@arcgis/portal-components/loader", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
2625
+ const _t = "@arcgis/lumina:configureVite", qn = (e) => ({
2626
+ name: _t,
2623
2627
  async config({
2624
2628
  server: t,
2625
2629
  publicDir: i,
2626
- build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: l = [] } = {}, watch: d, emptyOutDir: c } = {},
2630
+ build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
2627
2631
  test: p = {}
2628
2632
  }, m) {
2629
- const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && de && Vi(m) ? si(qi, import.meta.dirname) : void 0, C = w === void 0 ? [] : [
2633
+ const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && te && Ni(m) ? oi(Li, import.meta.dirname) : void 0, C = w === void 0 ? [] : [
2630
2634
  G(u.join(w, "**/*.{ts,tsx,mjs}")),
2631
2635
  `!${G(u.join(w, "**/*.d.ts"))}`
2632
2636
  ], E = {
@@ -2684,9 +2688,9 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2684
2688
  include: [
2685
2689
  // Used by controllers. Need to add manually because @arcgis/lumina is
2686
2690
  // excluded per comment below, so Vite will discover these usages too late.
2687
- ...H && !de ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : [],
2691
+ ...H && !te ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : [],
2688
2692
  // Used by core. Because we exclude core from scanning, these are discovered late, causing errors
2689
- ...H && de ? [
2693
+ ...H && te ? [
2690
2694
  "tslib",
2691
2695
  "@arcgis/core > luxon",
2692
2696
  "@arcgis/core > @esri/arcgis-html-sanitizer",
@@ -2708,22 +2712,8 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2708
2712
  * inside the package, and by Calcite outside the package).
2709
2713
  */
2710
2714
  exclude: [
2711
- ...de ? [
2712
- "@arcgis/lumina",
2713
- "@arcgis/core",
2714
- "@arcgis/toolkit",
2715
- "@arcgis-ba/data-browser/loader",
2716
- "@arcgis-ba/report-player/loader",
2717
- "@arcgis/ai-components/loader",
2718
- "@arcgis/ai-playground/loader",
2719
- "@arcgis/charts-components/loader",
2720
- "@arcgis/coding-components/loader",
2721
- "@arcgis/common-components/loader",
2722
- "@arcgis/imagery-components/loader",
2723
- "@arcgis/map-config-components/loader",
2724
- "@arcgis/embeddable-components/loader",
2725
- "@arcgis/map-components/loader",
2726
- "@arcgis/portal-components/loader",
2715
+ ...te ? [
2716
+ ...Hn,
2727
2717
  // This exact import is also supplied through optimizableImports in `dependencies/arcgisCore.ts`
2728
2718
  // Optimizing it in the monorepo creates a separate core config instance, so the app does not receive the
2729
2719
  // configured assetsPath.
@@ -2756,7 +2746,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2756
2746
  if (typeof p.setupFiles == "string" ? p.setupFiles = [...We, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...We, ...p.setupFiles] : p.setupFiles = [...We], e.isInPuppeteerTestBackEnd) {
2757
2747
  if (h?.enabled === !0)
2758
2748
  throw Error(
2759
- b(Jt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2749
+ b(_t, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2760
2750
  );
2761
2751
  return {
2762
2752
  test: {
@@ -2764,7 +2754,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2764
2754
  puppeteerWaitForChangesDelay: e.options.puppeteerTesting?.waitForChangesDelay,
2765
2755
  globalSetup: ["@arcgis/lumina-compiler/puppeteerTesting/globalSetup"],
2766
2756
  runner: "@arcgis/lumina-compiler/puppeteerTesting/runner",
2767
- // Run all test files that include *.e2e.* in the name.
2757
+ // Run all test files that include *.e2e.* or *.spec.* in the name.
2768
2758
  include: g ? void 0 : ["**/*.{e2e,spec}.?(c|m)[jt]s?(x)"],
2769
2759
  /**
2770
2760
  * Using happy-dom because:
@@ -2790,7 +2780,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2790
2780
  publicDir: i ?? !1,
2791
2781
  build: {
2792
2782
  cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
2793
- target: n ?? Ii(e),
2783
+ target: n ?? ji(e),
2794
2784
  sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
2795
2785
  lib: {
2796
2786
  entry: E,
@@ -2798,7 +2788,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2798
2788
  },
2799
2789
  rollupOptions: {
2800
2790
  output: {
2801
- chunkFileNames: (Array.isArray(l) ? void 0 : l.chunkFileNames) || "chunks/[name].js",
2791
+ chunkFileNames: (Array.isArray(c) ? void 0 : c.chunkFileNames) || "chunks/[name].js",
2802
2792
  ...// Does not exist in Rolldown, and probably not needed
2803
2793
  // https://github.com/rolldown/rolldown/issues/206
2804
2794
  "rolldownVersion" in this.meta ? void 0 : {
@@ -2806,7 +2796,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2806
2796
  * 2015 is the newest option. Rollup's generated code does not use
2807
2797
  * newer features at the moment.
2808
2798
  */
2809
- generatedCode: (Array.isArray(l) ? void 0 : l.generatedCode) ?? "es2015"
2799
+ generatedCode: (Array.isArray(c) ? void 0 : c.generatedCode) ?? "es2015"
2810
2800
  }
2811
2801
  }
2812
2802
  },
@@ -2820,7 +2810,7 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2820
2810
  * - in API Extractor we can avoid writing unchanged files to disk if
2821
2811
  * the out dir is not emptied between watch rebuilds.
2822
2812
  */
2823
- emptyOutDir: c ?? !f
2813
+ emptyOutDir: l ?? !f
2824
2814
  },
2825
2815
  optimizeDeps: A,
2826
2816
  define: S,
@@ -2855,65 +2845,65 @@ const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
2855
2845
  e._originalRollupInputOptions ??= t.input;
2856
2846
  const s = { ...e._originalRollupInputOptions };
2857
2847
  i.forEach((n) => {
2858
- const r = Bn(n);
2848
+ const r = zn(n);
2859
2849
  s[r] = n;
2860
2850
  }), t.input = s;
2861
2851
  }
2862
- }), Se = "@arcgis/lumina:serveLocalCdn", Wn = /^\/?@arcgis\/core(?=\/|$)/u, Gi = "/index.js", Un = je(Gi), st = `\0${Se}:index`, zn = je(st), Hn = 3e3, qn = [
2852
+ }), Se = "@arcgis/lumina:serveLocalCdn", Vn = /^\/?@arcgis\/core(?=\/|$)/u, Zi = "/index.js", Gn = je(Zi), rt = `\0${Se}:index`, Xn = je(rt), Yn = 3e3, Qn = [
2863
2853
  /^https?:\/\/localhost(?::[0-9]+)?$/u,
2864
2854
  /^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
2865
2855
  ];
2866
- function Vn(e) {
2856
+ function Zn(e) {
2867
2857
  if (!H)
2868
2858
  return;
2869
2859
  const t = j().name, i = t.split("/").pop() ?? t, s = `/${i}/index.js`, n = je(s), r = `\0${Se}:${i}`, a = je(r);
2870
2860
  return {
2871
2861
  name: Se,
2872
2862
  enforce: "pre",
2873
- apply(l) {
2874
- const d = Yn(e, l);
2863
+ apply(c) {
2864
+ const d = io(e, c);
2875
2865
  return d || (e._localCdnCore = void 0), d;
2876
2866
  },
2877
2867
  config: {
2878
2868
  order: "post",
2879
- handler(l, d) {
2880
- const c = l.server, p = Vi(d), m = p ? qi : _n, f = si(m, import.meta.dirname);
2869
+ handler(c, d) {
2870
+ const l = c.server, p = Ni(d), m = p ? Li : en, f = oi(m, import.meta.dirname);
2881
2871
  if (f === void 0)
2882
2872
  throw Error(b(Se, `Unable to find ${m}.`));
2883
2873
  return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
2884
2874
  server: {
2885
- port: c?.port ?? Hn,
2886
- cors: c?.cors ?? { origin: qn }
2875
+ port: l?.port ?? Yn,
2876
+ cors: l?.cors ?? { origin: Qn }
2887
2877
  },
2888
2878
  resolve: {
2889
2879
  // The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
2890
2880
  // to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
2891
- alias: [{ find: Wn, replacement: f }]
2881
+ alias: [{ find: Vn, replacement: f }]
2892
2882
  }
2893
2883
  };
2894
2884
  }
2895
2885
  },
2896
2886
  resolveId: {
2897
- filter: { id: [Un, n] },
2898
- handler(l) {
2899
- if (l === Gi)
2900
- return st;
2901
- if (l === s)
2887
+ filter: { id: [Gn, n] },
2888
+ handler(c) {
2889
+ if (c === Zi)
2890
+ return rt;
2891
+ if (c === s)
2902
2892
  return r;
2903
2893
  }
2904
2894
  },
2905
2895
  load: {
2906
- filter: { id: [zn, a] },
2907
- async handler(l) {
2908
- if (l === st)
2896
+ filter: { id: [Xn, a] },
2897
+ async handler(c) {
2898
+ if (c === rt)
2909
2899
  return `import ${JSON.stringify(s)};
2910
2900
  `;
2911
- if (l === r)
2912
- return await Xn(e);
2901
+ if (c === r)
2902
+ return await to(e);
2913
2903
  }
2914
2904
  },
2915
- handleHotUpdate({ file: l, server: d }) {
2916
- if (Gn(l, e._localCdnCore?.sourceLocation))
2905
+ handleHotUpdate({ file: c, server: d }) {
2906
+ if (eo(c, e._localCdnCore?.sourceLocation))
2917
2907
  return d.ws.send({ type: "full-reload" }), [];
2918
2908
  }
2919
2909
  };
@@ -2921,30 +2911,30 @@ function Vn(e) {
2921
2911
  function je(e) {
2922
2912
  return new RegExp(`^${RegExp.escape(e)}$`, "u");
2923
2913
  }
2924
- function Gn(e, t) {
2914
+ function eo(e, t) {
2925
2915
  return t !== void 0 && e.startsWith(u.join(t, u.sep));
2926
2916
  }
2927
- async function Xn(e) {
2917
+ async function to(e) {
2928
2918
  const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
2929
- return `${(await ne(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
2919
+ return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
2930
2920
  `)}
2931
2921
  `;
2932
2922
  }
2933
- function Yn(e, t) {
2934
- return de && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
2923
+ function io(e, t) {
2924
+ return te && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
2935
2925
  }
2936
- const Qn = (e) => ({
2926
+ const so = (e) => ({
2937
2927
  name: "@arcgis/lumina:setAssetPath",
2938
2928
  apply: () => e.viteCommand === "build",
2939
2929
  config: (t) => ({
2940
2930
  base: t.base ?? e.options.assets?.defaultPath ?? De()
2941
2931
  })
2942
2932
  });
2943
- function Zn(e = j()) {
2944
- const t = e.version ?? "0.0.1";
2945
- return bs(t);
2933
+ function ro(e = j()) {
2934
+ const t = ut(e) ?? "0.0.1";
2935
+ return Es(t);
2946
2936
  }
2947
- const eo = (e) => `/* ${e} */`, k = (e) => (t, i) => {
2937
+ const no = (e) => `/* ${e} */`, k = (e) => (t, i) => {
2948
2938
  Object.defineProperty(t, i, {
2949
2939
  get() {
2950
2940
  throw Error(
@@ -2982,9 +2972,9 @@ const ue = {
2982
2972
  webTypes: "docs/web-types.json",
2983
2973
  apiJson: "docs/api.json",
2984
2974
  stencilLikeDocsJson: "docs/docs.json"
2985
- }, rt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
2986
- async function Xi(e, t, i = j()) {
2987
- const s = to(e, i), n = u.join(t, "lumina.ts"), a = await _(n) ? await z(n, "utf8") : "";
2975
+ }, nt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
2976
+ async function es(e, t, i = j()) {
2977
+ const s = oo(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await z(n, "utf8") : "";
2988
2978
  if (a.trim().replaceAll(`\r
2989
2979
  `, `
2990
2980
  `) === s.trim())
@@ -3002,20 +2992,20 @@ Current content:
3002
2992
  ${a}`
3003
2993
  )
3004
2994
  );
3005
- return ni(n, s), !0;
2995
+ return ci(n, s), !0;
3006
2996
  }
3007
- function to(e, t = j()) {
2997
+ function oo(e, t = j()) {
3008
2998
  const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
3009
2999
  /// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
3010
- (d, c) => `
3011
- import type { JSX as JSX$${c} } from "${d.packageName}/dist/types/components";`
3000
+ (d, l) => `
3001
+ import type { JSX as JSX$${l} } from "${d.packageName}/dist/types/components";`
3012
3002
  ), r = s.length === 0 ? "" : `
3013
3003
 
3014
3004
  declare module "@arcgis/lumina" {
3015
- interface ImportStencilElements extends ${s.map((d, c) => `JSX$${c}.IntrinsicElements`).join(", ")} {}
3005
+ interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
3016
3006
  }`, a = t.devDependencies ?? {};
3017
3007
  return [
3018
- io,
3008
+ ao,
3019
3009
  a.vitest ? `
3020
3010
  /// <reference types="vitest/config" />
3021
3011
  /// <reference types="vitest/browser" />` : "",
@@ -3026,7 +3016,7 @@ declare module "@arcgis/lumina" {
3026
3016
  `
3027
3017
  ].join("");
3028
3018
  }
3029
- const io = `/**
3019
+ const ao = `/**
3030
3020
  * This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
3031
3021
  * Manual edits will be overwritten.
3032
3022
  *
@@ -3034,7 +3024,7 @@ const io = `/**
3034
3024
  *
3035
3025
  * If you need to provide additional types, create a separate file.
3036
3026
  */
3037
- /// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport", Yi = (e, t) => e.viteCommand === "serve" && /**
3027
+ /// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport", ts = (e, t) => e.viteCommand === "serve" && /**
3038
3028
  * Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
3039
3029
  * However, it is a bit buggy (see
3040
3030
  * https://github.com/vitejs/vite/issues/19213). Instead, we are using test
@@ -3045,13 +3035,13 @@ const io = `/**
3045
3035
  * is doing:
3046
3036
  * https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
3047
3037
  */
3048
- e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, so = (e) => ({
3038
+ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, co = (e) => ({
3049
3039
  name: Ce,
3050
3040
  async configureServer(t) {
3051
- H && (e.server = t, await tn(e));
3041
+ H && (e.server = t, await cn(e));
3052
3042
  },
3053
3043
  configResolved() {
3054
- !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = ro(e).catch(
3044
+ !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = lo(e).catch(
3055
3045
  (t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
3056
3046
  ));
3057
3047
  },
@@ -3059,7 +3049,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
3059
3049
  // Add imports to index.html before Vite starts resolving imports
3060
3050
  order: "pre",
3061
3051
  async handler(t, i) {
3062
- return Yi(e, i) ? (await ne(e)).map(
3052
+ return ts(e, i) ? (await oe(e)).map(
3063
3053
  (n) => "javascriptCode" in n ? {
3064
3054
  tag: "script",
3065
3055
  attrs: {
@@ -3086,7 +3076,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
3086
3076
  async buildStart() {
3087
3077
  if (e.viteCommand !== "serve")
3088
3078
  return;
3089
- const i = (await ne(e)).flatMap((s) => {
3079
+ const i = (await oe(e)).flatMap((s) => {
3090
3080
  if ("javascriptCode" in s)
3091
3081
  return s.optimizableImports;
3092
3082
  if ("cssHref" in s)
@@ -3101,34 +3091,34 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
3101
3091
  await e._updateLuminaTsPromise;
3102
3092
  }
3103
3093
  });
3104
- async function ro(e) {
3105
- const i = (await Promise.all([re, Ui(e)])).flat();
3106
- if (!await Xi(i, e.dir.src))
3094
+ async function lo(e) {
3095
+ const i = (await Promise.all([ne, Gi(e)])).flat();
3096
+ if (!await es(i, e.dir.src))
3107
3097
  return;
3108
3098
  let n = !1;
3109
3099
  function r() {
3110
- n || T.warn(Ce, no), n = !0;
3100
+ n || T.warn(Ce, po), n = !0;
3111
3101
  }
3112
3102
  process.on("exit", () => {
3113
- r(), clearTimeout(l);
3103
+ r(), clearTimeout(c);
3114
3104
  });
3115
- const l = setTimeout(r, 2e3);
3105
+ const c = setTimeout(r, 2e3);
3116
3106
  }
3117
- const no = Ks(
3107
+ const po = Hs(
3118
3108
  "greenBright",
3119
3109
  `lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
3120
3110
  If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
3121
3111
  );
3122
- async function oo(e) {
3123
- const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Us(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : Et(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
3112
+ async function uo(e) {
3113
+ const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Vs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : $t(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
3124
3114
  e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? pe(e.options.documentation.apiJsonFileName) : ue.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
3125
3115
  {
3126
3116
  type: "dynamic",
3127
- source: () => JSON.stringify(e.apiJson, null, rt(e)),
3117
+ source: () => JSON.stringify(e.apiJson, null, nt(e)),
3128
3118
  destination: u.join("../..", e._documentationFileNames.apiJson)
3129
3119
  }
3130
3120
  ]);
3131
- const s = i?.types?.typeScriptConfig ?? zs(
3121
+ const s = i?.types?.typeScriptConfig ?? Gs(
3132
3122
  process.cwd(),
3133
3123
  e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
3134
3124
  !0
@@ -3153,7 +3143,7 @@ async function oo(e) {
3153
3143
  afterDiagnostic: e.options.types?.afterDiagnostic,
3154
3144
  typeScriptInstanceCreated: e.options.types?.typeScriptInstanceCreated,
3155
3145
  declarationTextTransformers: e.options.types?.declarationTextTransformers?.map(
3156
- (c) => (p) => c(p, e)
3146
+ (l) => (p) => l(p, e)
3157
3147
  ),
3158
3148
  typeScriptConfig: n,
3159
3149
  // Already merged, so pass empty object to avoid merging again
@@ -3166,15 +3156,15 @@ async function oo(e) {
3166
3156
  getComponentDemoUrl: e.options.documentation?.getComponentDemoUrl
3167
3157
  },
3168
3158
  watch: {
3169
- onUpdate: async (c) => {
3159
+ onUpdate: async (l) => {
3170
3160
  e.apiJsonDeferred = Promise.withResolvers();
3171
- const p = await c;
3161
+ const p = await l;
3172
3162
  if (e.apiJsonDeferred.resolve(), e.apiJsonDeferred = void 0, p !== void 0) {
3173
3163
  if (e.viteCommand === "serve")
3174
3164
  if ([...p.addedModules, ...p.removedModules].some(
3175
3165
  (f) => Pe(f.sourcePath, "src/components/")
3176
3166
  ))
3177
- jt(e), Ft(e);
3167
+ Dt(e), Ot(e);
3178
3168
  else {
3179
3169
  for (const f of p.changedModules) {
3180
3170
  if (!Pe(f.new.sourcePath, "src/components/"))
@@ -3187,57 +3177,57 @@ async function oo(e) {
3187
3177
  if (g === void 0 && h === void 0)
3188
3178
  continue;
3189
3179
  if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName || g.formAssociated !== h.formAssociated) {
3190
- Ft(e);
3180
+ Ot(e);
3191
3181
  break;
3192
3182
  }
3193
- const y = Ci(h);
3183
+ const y = $i(h);
3194
3184
  e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
3195
3185
  }
3196
- jt(e);
3186
+ Dt(e);
3197
3187
  }
3198
- Bt(e, p.apiJson);
3188
+ Wt(e, p.apiJson);
3199
3189
  }
3200
3190
  }
3201
3191
  },
3202
- afterApiJsonCreate: (c) => {
3203
- e.options.apiJson?.afterCreate?.(c.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Bt(e, c.apiJson));
3192
+ afterApiJsonCreate: (l) => {
3193
+ e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Wt(e, l.apiJson));
3204
3194
  }
3205
- }, l = i === void 0 ? a : Et(i, a);
3206
- e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = l;
3195
+ }, c = i === void 0 ? a : $t(i, a);
3196
+ e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
3207
3197
  const d = e.apiExtractorPluginConfig.afterExtractorCreated;
3208
- e.apiExtractorPluginConfig.afterExtractorCreated = (c) => {
3209
- e.apiExtractor = c, d?.(c);
3198
+ e.apiExtractorPluginConfig.afterExtractorCreated = (l) => {
3199
+ e.apiExtractor = l, d?.(l);
3210
3200
  };
3211
3201
  }
3212
- function Bt(e, t) {
3202
+ function Wt(e, t) {
3213
3203
  const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
3214
3204
  for (const r of t.modules) {
3215
3205
  const a = { ...r, declarations: [] };
3216
- let l = !1;
3206
+ let c = !1;
3217
3207
  for (const d of r.declarations) {
3218
3208
  if (d.customElement !== !0) {
3219
3209
  a.declarations.push(d);
3220
3210
  continue;
3221
3211
  }
3222
- const c = d;
3223
- if (n?.push(r.sourcePath), c.privacy !== void 0) {
3224
- l = !0;
3212
+ const l = d;
3213
+ if (n?.push(r.sourcePath), l.privacy !== void 0) {
3214
+ c = !0;
3225
3215
  continue;
3226
3216
  }
3227
3217
  const p = {
3228
- ...c,
3229
- members: c.members.filter((m) => m.privacy === void 0)
3218
+ ...l,
3219
+ members: l.members.filter((m) => m.privacy === void 0)
3230
3220
  };
3231
3221
  a.declarations.push(p), s.push(p);
3232
3222
  }
3233
- l || i.modules.push(a);
3223
+ c || i.modules.push(a);
3234
3224
  }
3235
3225
  e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
3236
3226
  }
3237
- var ao = Object.defineProperty, I = (e, t, i, s) => {
3227
+ var mo = Object.defineProperty, I = (e, t, i, s) => {
3238
3228
  for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
3239
3229
  (a = e[r]) && (n = a(t, i, n) || n);
3240
- return n && ao(t, i, n), n;
3230
+ return n && mo(t, i, n), n;
3241
3231
  };
3242
3232
  const V = "@arcgis/lumina:context";
3243
3233
  class $ {
@@ -3253,24 +3243,24 @@ class $ {
3253
3243
  this.viteConfig = r;
3254
3244
  const a = r.build.minify !== !1;
3255
3245
  this.shouldMinify = a && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3256
- const l = u.join(r.root, u.sep), d = u.join(l, "src", u.sep), c = u.join(d, "components", u.sep), p = u.join(u.resolve(l, r.build.outDir), u.sep), m = u.join(u.relative(l, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? ce, u.sep), h = u.join(g, "assets", u.sep);
3246
+ const c = u.join(r.root, u.sep), d = u.join(c, "src", u.sep), l = u.join(d, "components", u.sep), p = u.join(u.resolve(c, r.build.outDir), u.sep), m = u.join(u.relative(c, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? le, u.sep), h = u.join(g, "assets", u.sep);
3257
3247
  if (this.dir = {
3258
- root: l,
3248
+ root: c,
3259
3249
  src: d,
3260
- srcComponents: c,
3250
+ srcComponents: l,
3261
3251
  relativeDist: m,
3262
3252
  dist: p,
3263
3253
  distComponents: f,
3264
3254
  distCdn: g,
3265
3255
  distCdnAssets: h
3266
- }, T.initialize(r.logger, l), r.root !== ii())
3256
+ }, T.initialize(r.logger, c), r.root !== ni())
3267
3257
  throw Error(
3268
3258
  b(
3269
3259
  V,
3270
3260
  "Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/webgis-sdk/issues/2126 or contact Lumina maintainers."
3271
3261
  )
3272
3262
  );
3273
- p === l ? T.warn(
3263
+ p === c ? T.warn(
3274
3264
  V,
3275
3265
  "Vite output directory is set to the root directory. This can produce unexpected behavior. Please set the output directory to a subdirectory of the root directory (i.e dist/)"
3276
3266
  ) : m.startsWith("..") && T.warn(
@@ -3282,11 +3272,11 @@ class $ {
3282
3272
  extract: !0
3283
3273
  }, (this.viteCommand === "build" ? r.build.watch : r.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
3284
3274
  const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
3285
- C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = Ws({
3275
+ C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = qs({
3286
3276
  // Do not downlevel. ESBuild will do that if needed.
3287
3277
  target: o.ScriptTarget.ESNext,
3288
3278
  sourceMap: r.build.sourcemap !== !1
3289
- }), Yi(this) && ne(this);
3279
+ }), ts(this) && oe(this);
3290
3280
  }
3291
3281
  },
3292
3282
  configureServer: {
@@ -3314,21 +3304,21 @@ class $ {
3314
3304
  webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
3315
3305
  vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
3316
3306
  vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
3317
- }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = oo(this);
3307
+ }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = uo(this);
3318
3308
  const s = process.cwd().length + 1;
3319
3309
  this.componentFilesPromise = this.configsPromise.then(() => {
3320
3310
  const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
3321
- for (let l = 0; l < r.length; ++l) {
3322
- const c = r[l].slice(s);
3323
- Pe(c, "src/components") && a.push(c);
3311
+ for (let c = 0; c < r.length; ++c) {
3312
+ const l = r[c].slice(s);
3313
+ Pe(l, "src/components") && a.push(l);
3324
3314
  }
3325
3315
  return a;
3326
- }), Ti(void 0, t);
3327
- const n = t.build?.preamble ?? Zn();
3328
- this.banner = eo(n);
3316
+ }), ki(void 0, t);
3317
+ const n = t.build?.preamble ?? ro();
3318
+ this.banner = no(n);
3329
3319
  }
3330
3320
  _inferBuildSetup({ command: t, mode: i }, s) {
3331
- this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(Ei.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3321
+ this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(Pi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3332
3322
  const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
3333
3323
  this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
3334
3324
  }
@@ -3349,9 +3339,9 @@ class $ {
3349
3339
  )
3350
3340
  );
3351
3341
  if (r === void 0 && !n) {
3352
- const l = this._typeScriptSourceFiles.get(t);
3353
- if (l?.text === i)
3354
- return l;
3342
+ const c = this._typeScriptSourceFiles.get(t);
3343
+ if (c?.text === i)
3344
+ return c;
3355
3345
  }
3356
3346
  return i !== r?.text && ((this.viteCommand !== "serve" || this.isInStorybook) && T.warn(
3357
3347
  V,
@@ -3400,7 +3390,7 @@ class $ {
3400
3390
  if (Array.isArray(this.assetsToProvide))
3401
3391
  this.assetsToProvide.push({ assets: t, transformers: i, apply: s });
3402
3392
  else if (this.viteCommand === "serve")
3403
- s === "serve" && te(this, t, i);
3393
+ s === "serve" && ie(this, t, i);
3404
3394
  else
3405
3395
  throw Error(
3406
3396
  b(
@@ -3476,8 +3466,8 @@ I([
3476
3466
  I([
3477
3467
  k("configResolved()")
3478
3468
  ], $.prototype, "_typeScriptPrinter");
3479
- function co(e, t, i) {
3480
- const s = $i()[t] ?? Qi(e)[t];
3469
+ function fo(e, t, i) {
3470
+ const s = Ii()[t] ?? is(e)[t];
3481
3471
  if (s === void 0) {
3482
3472
  if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
3483
3473
  return;
@@ -3491,11 +3481,11 @@ function co(e, t, i) {
3491
3481
  }
3492
3482
  return s;
3493
3483
  }
3494
- function lo(e, t) {
3484
+ function go(e, t) {
3495
3485
  return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
3496
3486
  }
3497
- function Qi(e) {
3498
- return e._localDefinedComponents ??= ki(
3487
+ function is(e) {
3488
+ return e._localDefinedComponents ??= Ai(
3499
3489
  e.privateApiJson,
3500
3490
  {
3501
3491
  packageName: void 0,
@@ -3506,19 +3496,19 @@ function Qi(e) {
3506
3496
  e.viteCommand === "build"
3507
3497
  ), e._localDefinedComponents;
3508
3498
  }
3509
- const _t = "makeRuntime(", po = "@arcgis/core", uo = "@arcgis/lumina:injectRuntimeOptions", mo = (e) => ({
3510
- name: uo,
3499
+ const Ut = "makeRuntime(", ho = "@arcgis/core", yo = "@arcgis/lumina:injectRuntimeOptions", vo = (e) => ({
3500
+ name: yo,
3511
3501
  transform: {
3512
3502
  filter: {
3513
3503
  id: /\/src\/runtime\.ts$/u
3514
3504
  },
3515
3505
  handler(t, i) {
3516
- const s = t.indexOf(_t);
3506
+ const s = t.indexOf(Ut);
3517
3507
  if (s === -1)
3518
3508
  throw new Error(
3519
3509
  `Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
3520
3510
  );
3521
- const n = s + _t.length, r = e.options.css?.commonStylesPath;
3511
+ const n = s + Ut.length, r = e.options.css?.commonStylesPath;
3522
3512
  return {
3523
3513
  code: [
3524
3514
  r === void 0 ? "" : `import commonStyles from "${he(e.dir.src, r)}${Ie}";`,
@@ -3526,7 +3516,7 @@ const _t = "makeRuntime(", po = "@arcgis/core", uo = "@arcgis/lumina:injectRunti
3526
3516
  "{",
3527
3517
  "defaultAssetPath:import.meta.env.BASE_URL,",
3528
3518
  'hydratedAttribute:"',
3529
- e.options.css?.hydratedAttribute ?? wi,
3519
+ e.options.css?.hydratedAttribute ?? Ei,
3530
3520
  '",',
3531
3521
  r === void 0 ? "" : "commonStyles",
3532
3522
  "}",
@@ -3534,7 +3524,7 @@ const _t = "makeRuntime(", po = "@arcgis/core", uo = "@arcgis/lumina:injectRunti
3534
3524
  // Dependency injection. Lumina cannot directly import these to avoid
3535
3525
  // a cyclical dependency.
3536
3526
  H ? `
3537
- import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${po}/applications/Components/reactiveUtils.js";
3527
+ import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${ho}/applications/Components/reactiveUtils.js";
3538
3528
  createObservable,
3539
3529
  runtime.t = trackAccess;
3540
3530
  runtime.o = createObservable;
@@ -3546,23 +3536,23 @@ runtime.r = runTracked;` : ""
3546
3536
  }
3547
3537
  }
3548
3538
  });
3549
- function fo(e) {
3550
- return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ce}/${Z}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3539
+ function bo(e) {
3540
+ return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${Z}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3551
3541
  `;
3552
3542
  }
3553
- const we = "@arcgis/lumina:addNonLazyImports", go = (e) => ({
3543
+ const we = "@arcgis/lumina:addNonLazyImports", wo = (e) => ({
3554
3544
  name: we,
3555
3545
  apply: () => e.viteCommand === "build",
3556
3546
  generateBundle(t, i) {
3557
3547
  const n = e.viteConfig.build.sourcemap !== !1 ? " " : `
3558
3548
  `;
3559
3549
  let r = !1;
3560
- if (Object.entries(i).forEach(([a, l]) => {
3550
+ if (Object.entries(i).forEach(([a, c]) => {
3561
3551
  const d = Ge(a, e.apiExtractor);
3562
- if (d !== a && (l.fileName = d), l.type === "chunk") {
3563
- const c = u.dirname(u.join(e.dir.dist, a)), p = d === a ? c : u.dirname(u.join(e.dir.dist, d));
3564
- let m = l.code;
3565
- m = an(m, e, p, c), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = fo(e) + m), m = `${e.banner}${n}${m}`, l.code = m;
3552
+ if (d !== a && (c.fileName = d), c.type === "chunk") {
3553
+ const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
3554
+ let m = c.code;
3555
+ m = mn(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = bo(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
3566
3556
  }
3567
3557
  }), !r && !e.isInStorybook)
3568
3558
  throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
@@ -3573,18 +3563,18 @@ const we = "@arcgis/lumina:addNonLazyImports", go = (e) => ({
3573
3563
  const t = e._customElementDependencies, i = Object.entries(t), s = new Set(
3574
3564
  i.map(([r]) => r).filter((r) => Pe(r, e.dir.srcComponents))
3575
3565
  );
3576
- i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: l, referencedBy: d }]) => {
3577
- if (s.has(r) || a.length === 0 && l.length === 0)
3566
+ i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
3567
+ if (s.has(r) || a.length === 0 && c.length === 0)
3578
3568
  return;
3579
- const c = Zi(t, d, s);
3580
- if (c.forEach((p) => {
3581
- t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...l);
3582
- }), (a.length > 0 || l.length > 0) && c.length === 0) {
3569
+ const l = ss(t, d, s);
3570
+ if (l.forEach((p) => {
3571
+ t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
3572
+ }), (a.length > 0 || c.length > 0) && l.length === 0) {
3583
3573
  const p = Re(r);
3584
3574
  throw Error(
3585
3575
  b(
3586
3576
  we,
3587
- `Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...l].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.
3577
+ `Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...c].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.
3588
3578
 
3589
3579
  Possible causes:
3590
3580
  - You are re-exporting a functional component from a barrel file. Refactor such cases to import the functional component directly from the file that declares it.
@@ -3594,19 +3584,19 @@ Possible causes:
3594
3584
  );
3595
3585
  }
3596
3586
  });
3597
- const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames: l }]) => {
3587
+ const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
3598
3588
  if (!s.has(r))
3599
3589
  return [];
3600
- const d = u.dirname(r), c = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, c);
3590
+ const d = u.dirname(r), l = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
3601
3591
  function m(P) {
3602
- const x = co(e, P, r);
3592
+ const x = fo(e, P, r);
3603
3593
  if (x === void 0)
3604
3594
  return;
3605
- const S = lo(x, p);
3595
+ const S = go(x, p);
3606
3596
  if (S !== `./${p}`)
3607
- return S.startsWith(".") ? `${S}/${Kt}` : S;
3597
+ return S.startsWith(".") ? `${S}/${zt}` : S;
3608
3598
  }
3609
- const f = new Set(a), g = new Set(l), h = Array.from(f, m).filter(R), y = (P) => `import "${P}";
3599
+ const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(R), y = (P) => `import "${P}";
3610
3600
  `, v = h.map(y).join(""), w = Array.from(g, (P) => {
3611
3601
  const x = m(P);
3612
3602
  if (x !== void 0) {
@@ -3620,15 +3610,15 @@ Possible causes:
3620
3610
  return `.set("${P}", () => import("${x}"))
3621
3611
  `;
3622
3612
  }
3623
- }).filter(R), C = `${v}export * from "./${ut}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3613
+ }).filter(R), C = `${v}export * from "./${ft}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3624
3614
  ${C}
3625
3615
  deferredLoaders${w.join("")};` : C;
3626
- return await K(u.join(e.dir.dist, p, Kt), E);
3616
+ return await _(u.join(e.dir.dist, p, zt), E);
3627
3617
  });
3628
3618
  await Promise.all(n);
3629
3619
  }
3630
- }), Kt = "index.js", Zi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), Zi(e, e[n].referencedBy, i, s)));
3631
- function Wt(e, t, i) {
3620
+ }), zt = "index.js", ss = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), ss(e, e[n].referencedBy, i, s)));
3621
+ function Ht(e, t, i) {
3632
3622
  if (ee(e))
3633
3623
  return e;
3634
3624
  {
@@ -3647,14 +3637,14 @@ function ee(e) {
3647
3637
  return (
3648
3638
  // Inlined string literal
3649
3639
  typeof e == "string" || // Syntax kinds that are never undefined
3650
- ho.has(e.kind) || // Ternary with both branches never undefined
3640
+ So.has(e.kind) || // Ternary with both branches never undefined
3651
3641
  o.isConditionalExpression(e) && ee(e.whenTrue) && ee(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
3652
- o.isBinaryExpression(e) && (yo.has(e.operatorToken.kind) || ee(e.left) && ee(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3642
+ o.isBinaryExpression(e) && (Co.has(e.operatorToken.kind) || ee(e.left) && ee(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3653
3643
  (o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ee(e.expression) || // JSX that got converted to html`<p>Something</p>`
3654
- o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && ar.has(e.tag.text)
3644
+ o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && pr.has(e.tag.text)
3655
3645
  );
3656
3646
  }
3657
- const ho = /* @__PURE__ */ new Set([
3647
+ const So = /* @__PURE__ */ new Set([
3658
3648
  o.SyntaxKind.NumericLiteral,
3659
3649
  o.SyntaxKind.BigIntLiteral,
3660
3650
  o.SyntaxKind.StringLiteral,
@@ -3673,7 +3663,7 @@ const ho = /* @__PURE__ */ new Set([
3673
3663
  o.SyntaxKind.ClassExpression,
3674
3664
  // Trust? Trust.
3675
3665
  o.SyntaxKind.NonNullExpression
3676
- ]), yo = /* @__PURE__ */ new Set([
3666
+ ]), Co = /* @__PURE__ */ new Set([
3677
3667
  o.SyntaxKind.PlusEqualsToken,
3678
3668
  o.SyntaxKind.MinusEqualsToken,
3679
3669
  o.SyntaxKind.AsteriskAsteriskEqualsToken,
@@ -3708,9 +3698,9 @@ const ho = /* @__PURE__ */ new Set([
3708
3698
  o.SyntaxKind.SlashToken,
3709
3699
  o.SyntaxKind.PercentToken,
3710
3700
  o.SyntaxKind.AsteriskAsteriskToken
3711
- ]), vo = {
3701
+ ]), Eo = {
3712
3702
  property(e, t, i, s) {
3713
- const n = bo(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
3703
+ const n = To(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
3714
3704
  if (a) {
3715
3705
  const f = He(t);
3716
3706
  if (f === !0)
@@ -3718,20 +3708,20 @@ const ho = /* @__PURE__ */ new Set([
3718
3708
  if (f === !1)
3719
3709
  return [];
3720
3710
  }
3721
- const l = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Ee(e, t, a), d = l[0] !== "=";
3711
+ const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Ee(e, t, a), d = c[0] !== "=";
3722
3712
  if (a && d)
3723
- return [n.name, ...l];
3724
- const [c, p] = l, m = n?.type === "stringifiedNonReflected";
3713
+ return [n.name, ...c];
3714
+ const [l, p] = c, m = n?.type === "stringifiedNonReflected";
3725
3715
  if (r || m) {
3726
- const f = Wt(
3716
+ const f = Ht(
3727
3717
  p,
3728
3718
  e,
3729
3719
  m ? "" : void 0
3730
- ), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? So(f, e) : f;
3720
+ ), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? Po(f, e) : f;
3731
3721
  if (h !== p)
3732
- return [m ? `.${i}` : n.name, c, h];
3722
+ return [m ? `.${i}` : n.name, l, h];
3733
3723
  }
3734
- return [`.${i}`, ...l];
3724
+ return [`.${i}`, ...c];
3735
3725
  },
3736
3726
  attribute(e, t, i) {
3737
3727
  const s = t === void 0 || He(t);
@@ -3739,7 +3729,7 @@ const ho = /* @__PURE__ */ new Set([
3739
3729
  return [i];
3740
3730
  if (s === !1)
3741
3731
  return [];
3742
- const n = Ee(e, t, !0), a = n[0] !== "=" ? n : [n[0], Wt(n[1], e)];
3732
+ const n = Ee(e, t, !0), a = n[0] !== "=" ? n : [n[0], Ht(n[1], e)];
3743
3733
  return [i, ...a];
3744
3734
  },
3745
3735
  booleanAttribute(e, t, i) {
@@ -3751,8 +3741,8 @@ const ho = /* @__PURE__ */ new Set([
3751
3741
  throw new Error(
3752
3742
  `Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3753
3743
  );
3754
- const s = i.slice(2), n = wt(s);
3755
- return [`@${ui.has(n) ? s.toLowerCase() : wt(s)}=`, ...ht(e, t, void 0)];
3744
+ const s = i.slice(2), n = Ct(s);
3745
+ return [`@${gi.has(n) ? s.toLowerCase() : Ct(s)}=`, ...vt(e, t, void 0)];
3756
3746
  },
3757
3747
  directives(e, t) {
3758
3748
  if (t === void 0 || !o.isJsxExpression(t))
@@ -3787,20 +3777,20 @@ const ho = /* @__PURE__ */ new Set([
3787
3777
  ])
3788
3778
  ];
3789
3779
  },
3790
- class: zt,
3791
- style: zt,
3792
- key: (e, t) => [ft(t, e.sourceFile)],
3780
+ class: Vt,
3781
+ style: Vt,
3782
+ key: (e, t) => [ht(t, e.sourceFile)],
3793
3783
  deferLoad(e, t, i, s) {
3794
3784
  if (typeof s != "string")
3795
3785
  throw Error("deferLoad prop is not currently supported on dynamic tag names.");
3796
- if (!lt(s))
3786
+ if (!dt(s))
3797
3787
  throw Error(`deferLoad prop is only supported on custom elements. Found ${String(s)}`);
3798
3788
  e.neededImports.add("deferLoad");
3799
3789
  const n = e.importRenames.deferLoad;
3800
3790
  return [o.factory.createIdentifier(n)];
3801
3791
  }
3802
3792
  };
3803
- function bo(e, t, i) {
3793
+ function To(e, t, i) {
3804
3794
  if (typeof e == "string") {
3805
3795
  const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
3806
3796
  if (r !== void 0)
@@ -3832,7 +3822,7 @@ function ze(e, t) {
3832
3822
  if (n !== void 0)
3833
3823
  return { name: n, type: "stringifiedNonReflected" };
3834
3824
  }
3835
- function ft(e, t) {
3825
+ function ht(e, t) {
3836
3826
  if (e !== void 0 && o.isJsxExpression(e) && e.expression !== void 0)
3837
3827
  return e.expression;
3838
3828
  if (e !== void 0 && o.isStringLiteral(e))
@@ -3855,10 +3845,10 @@ function Ee(e, t, i = !1) {
3855
3845
  `Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
3856
3846
  );
3857
3847
  if (o.isStringLiteral(t))
3858
- return Ut(t, i);
3848
+ return qt(t, i);
3859
3849
  if (o.isJsxExpression(t) && t.expression) {
3860
3850
  if (o.isStringLiteral(t.expression))
3861
- return Ut(t.expression, i);
3851
+ return qt(t.expression, i);
3862
3852
  if (i) {
3863
3853
  if (o.isNumericLiteral(t.expression))
3864
3854
  return [`=${t.expression.text}`];
@@ -3866,16 +3856,16 @@ function Ee(e, t, i = !1) {
3866
3856
  return [`=${t.expression.getText(e.sourceFile)}`];
3867
3857
  }
3868
3858
  }
3869
- return ["=", ...ht(e, t, void 0)];
3859
+ return ["=", ...vt(e, t, void 0)];
3870
3860
  }
3871
- function Ut(e, t) {
3861
+ function qt(e, t) {
3872
3862
  if (!t)
3873
3863
  return ["=", e];
3874
3864
  const i = e.text;
3875
3865
  if (i.length === 0)
3876
3866
  return [];
3877
- const s = mi(i);
3878
- if (ir(s)) {
3867
+ const s = hi(i);
3868
+ if (or(s)) {
3879
3869
  const n = s.replaceAll('"', "&#34;");
3880
3870
  if (n.length > s.length) {
3881
3871
  const r = s.replaceAll("'", "&#39;");
@@ -3886,7 +3876,7 @@ function Ut(e, t) {
3886
3876
  } else
3887
3877
  return [`=${s}`];
3888
3878
  }
3889
- function zt(e, t, i) {
3879
+ function Vt(e, t, i) {
3890
3880
  if (t !== void 0 && o.isStringLiteral(t))
3891
3881
  return [`${i}="${t.text}"`];
3892
3882
  if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
@@ -3894,28 +3884,28 @@ function zt(e, t, i) {
3894
3884
  `${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3895
3885
  );
3896
3886
  const s = t.expression;
3897
- if (wo(s)) {
3887
+ if ($o(s)) {
3898
3888
  const r = i === "class" ? "safeClassMap" : "safeStyleMap";
3899
3889
  e.neededImports.add(r);
3900
- const a = e.importRenames[r], l = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
3890
+ const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
3901
3891
  q(e, void 0, s)
3902
3892
  ]);
3903
- return [`${i}=`, l];
3893
+ return [`${i}=`, c];
3904
3894
  } else
3905
3895
  return [i, ...Ee(e, t, !0)];
3906
3896
  }
3907
- const wo = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3908
- function So(e, t) {
3897
+ const $o = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3898
+ function Po(e, t) {
3909
3899
  t.neededImports.add("live");
3910
3900
  const i = t.importRenames.live;
3911
3901
  return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
3912
3902
  typeof e == "string" ? o.factory.createStringLiteral(e) : e
3913
3903
  ]);
3914
3904
  }
3915
- function Co(e) {
3916
- if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Ht && e.expression.arguments.length <= 1)
3905
+ function ko(e) {
3906
+ if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Gt && e.expression.arguments.length <= 1)
3917
3907
  return {
3918
- propType: Ht[e.expression.expression.text],
3908
+ propType: Gt[e.expression.expression.text],
3919
3909
  // To simplify checking logic in convertProps, wrap expression in JSX expression
3920
3910
  initializer: o.factory.createJsxExpression(
3921
3911
  void 0,
@@ -3924,21 +3914,21 @@ function Co(e) {
3924
3914
  )
3925
3915
  };
3926
3916
  }
3927
- const Ht = {
3917
+ const Gt = {
3928
3918
  bindProperty: "property",
3929
3919
  bindAttribute: "attribute",
3930
3920
  bindBooleanAttribute: "booleanAttribute",
3931
3921
  bindEvent: "event"
3932
3922
  };
3933
- function Eo(e, t, i) {
3934
- return $o.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : li.has(e) || e.includes("-") ? "attribute" : !lt(i) && (di.has(e) || (i === Ye ? !1 : i === ke ? (
3923
+ function Io(e, t, i) {
3924
+ return Ao.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ui.has(e) || e.includes("-") ? "attribute" : !dt(i) && (mi.has(e) || (i === Ye ? !1 : i === ke ? (
3935
3925
  // When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
3936
3926
  Object.values(Qe).some((r) => r.has(e))
3937
- ) : Qe[i]?.has(e) === !0)) ? Tt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (at.has(i) || ct.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : Tt.has(e) ? "booleanAttribute" : "attribute" : "property";
3927
+ ) : Qe[i]?.has(e) === !0)) ? Pt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (ct.has(i) || lt.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : Pt.has(e) ? "booleanAttribute" : "attribute" : "property";
3938
3928
  }
3939
- const To = ["class", "style", "ref", "directives", "key", "deferLoad"], $o = new Set(To), Po = (e) => typeof e != "string" || e.trim().length > 0;
3929
+ const xo = ["class", "style", "ref", "directives", "key", "deferLoad"], Ao = new Set(xo), Lo = (e) => typeof e != "string" || e.trim().length > 0;
3940
3930
  function Oe({ key: e, parts: t, litTag: i }, s) {
3941
- const n = ko(t);
3931
+ const n = No(t);
3942
3932
  if (n.length % 2 === 0)
3943
3933
  throw new Error("Normalized template parts array length must be odd");
3944
3934
  const [r, ...a] = n;
@@ -3954,16 +3944,16 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
3954
3944
  typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
3955
3945
  );
3956
3946
  }
3957
- const l = typeof i == "string" ? i : ae;
3958
- s.neededImports.add(l);
3959
- const d = s.importRenames[l], c = o.factory.createTaggedTemplateExpression(
3947
+ const c = typeof i == "string" ? i : ce;
3948
+ s.neededImports.add(c);
3949
+ const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
3960
3950
  o.factory.createIdentifier(d),
3961
3951
  void 0,
3962
- a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Io(a))
3952
+ a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), jo(a))
3963
3953
  );
3964
- return qe(s, e, c);
3954
+ return qe(s, e, l);
3965
3955
  }
3966
- const ko = (e) => e.reduce(
3956
+ const No = (e) => e.reduce(
3967
3957
  (t, i, s) => {
3968
3958
  const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
3969
3959
  if (r && a)
@@ -3973,7 +3963,7 @@ const ko = (e) => e.reduce(
3973
3963
  },
3974
3964
  [""]
3975
3965
  );
3976
- function Io(e) {
3966
+ function jo(e) {
3977
3967
  if (!(e.length % 2 === 0))
3978
3968
  throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
3979
3969
  const i = e.length / 2;
@@ -3981,13 +3971,13 @@ function Io(e) {
3981
3971
  const r = n * 2, a = e[r];
3982
3972
  if (typeof a == "string")
3983
3973
  throw new Error("Expected to receive a normalized array of parts");
3984
- const l = r + 1, d = e[l];
3974
+ const c = r + 1, d = e[c];
3985
3975
  if (typeof d != "string")
3986
3976
  throw new Error("Expected to receive a normalized array of parts");
3987
- const c = n === i - 1;
3977
+ const l = n === i - 1;
3988
3978
  return o.factory.createTemplateSpan(
3989
3979
  a,
3990
- c ? o.factory.createTemplateTail(d) : o.factory.createTemplateMiddle(d)
3980
+ l ? o.factory.createTemplateTail(d) : o.factory.createTemplateMiddle(d)
3991
3981
  );
3992
3982
  });
3993
3983
  }
@@ -3998,35 +3988,35 @@ function qe(e, t, i) {
3998
3988
  const s = e.importRenames.keyed;
3999
3989
  return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
4000
3990
  }
4001
- const es = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
4002
- function ts(e, t) {
4003
- const i = gt(e);
3991
+ const rs = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
3992
+ function ns(e, t) {
3993
+ const i = yt(e);
4004
3994
  return i.length === 0 ? t : o.setSyntheticLeadingComments(
4005
3995
  t,
4006
3996
  i.map((s) => ({
4007
3997
  ...s,
4008
3998
  pos: -1,
4009
3999
  end: -1,
4010
- text: is(e.slice(s.pos, s.end))
4000
+ text: os(e.slice(s.pos, s.end))
4011
4001
  }))
4012
4002
  );
4013
4003
  }
4014
- const gt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
4015
- function xo(e) {
4016
- const t = gt(e);
4004
+ const yt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
4005
+ function Fo(e) {
4006
+ const t = yt(e);
4017
4007
  if (t.length === 0)
4018
4008
  return [e || " "];
4019
4009
  const i = t.reduceRight(
4020
4010
  ([n, ...r], a) => {
4021
- const l = Ao(n), d = is(l.slice(a.pos, a.end));
4011
+ const c = Ro(n), d = os(c.slice(a.pos, a.end));
4022
4012
  return [
4023
- l.slice(0, a.pos),
4013
+ c.slice(0, a.pos),
4024
4014
  /**
4025
4015
  * Literal values (like this) in place of directives are ignored by Lit:
4026
4016
  * https://github.com/lit/lit/blob/56cb2ca4a86f2c7f6af757c612f05e50d1966615/packages/lit-html/src/lit-html.ts#L1111
4027
4017
  */
4028
4018
  o.factory.createNoSubstitutionTemplateLiteral(d),
4029
- l.slice(a.end),
4019
+ c.slice(a.end),
4030
4020
  ...r
4031
4021
  ];
4032
4022
  },
@@ -4036,13 +4026,13 @@ function xo(e) {
4036
4026
  const s = i.at(-1);
4037
4027
  return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
4038
4028
  }
4039
- const is = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
4040
- function Ao(e) {
4029
+ const os = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
4030
+ function Ro(e) {
4041
4031
  if (typeof e == "string")
4042
4032
  return e;
4043
4033
  throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
4044
4034
  }
4045
- function Lo(e, t) {
4035
+ function Do(e, t) {
4046
4036
  if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
4047
4037
  return t;
4048
4038
  const s = t.arguments[0];
@@ -4052,31 +4042,31 @@ function Lo(e, t) {
4052
4042
  if (!(typeof r == "object" && // If .map() callback has 3rd argument, it's not supported
4053
4043
  s.parameters.length <= 2))
4054
4044
  return t;
4055
- const l = ge(s.body);
4056
- let d = !0, c;
4057
- if (qt(l))
4058
- c = l;
4045
+ const c = ge(s.body);
4046
+ let d = !0, l;
4047
+ if (Xt(c))
4048
+ l = c;
4059
4049
  else {
4060
- if (!o.isBlock(l))
4050
+ if (!o.isBlock(c))
4061
4051
  return t;
4062
- const v = l.statements.at(-1);
4052
+ const v = c.statements.at(-1);
4063
4053
  if (!(v && o.isReturnStatement(v) && v.expression))
4064
4054
  return t;
4065
4055
  const C = ge(v.expression);
4066
- if (!qt(C))
4056
+ if (!Xt(C))
4067
4057
  return t;
4068
- const E = l.statements.slice(0, -1);
4069
- if (E.some(ss))
4058
+ const E = c.statements.slice(0, -1);
4059
+ if (E.some(as))
4070
4060
  return t;
4071
- d = E.length === 0, c = C;
4061
+ d = E.length === 0, l = C;
4072
4062
  }
4073
- const p = o.isJsxElement(c) ? c.openingElement : c, m = cs(p);
4063
+ const p = o.isJsxElement(l) ? l.openingElement : l, m = us(p);
4074
4064
  if (m === -1)
4075
4065
  return t;
4076
4066
  const f = p.attributes.properties[m];
4077
4067
  if (f === void 0 || !o.isJsxAttribute(f))
4078
4068
  return t;
4079
- const g = ft(f.initializer, e.sourceFile), h = No(r, s, g, d, e);
4069
+ const g = ht(f.initializer, e.sourceFile), h = Oo(r, s, g, d, e);
4080
4070
  if (h === void 0)
4081
4071
  return t;
4082
4072
  e.liftedKeys.add(f.name), e.neededImports.add("repeat");
@@ -4094,29 +4084,29 @@ function Lo(e, t) {
4094
4084
  s.parameters,
4095
4085
  s.type,
4096
4086
  s.equalsGreaterThanToken,
4097
- l
4087
+ c
4098
4088
  )
4099
4089
  ]);
4100
4090
  }
4101
- const qt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
4102
- function ss(e) {
4091
+ const Xt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
4092
+ function as(e) {
4103
4093
  if (o.isReturnStatement(e))
4104
4094
  return !0;
4105
4095
  let t = !1;
4106
4096
  return o.visitEachChild(
4107
4097
  e,
4108
- (i) => (t ||= ss(i), i),
4098
+ (i) => (t ||= as(i), i),
4109
4099
  void 0
4110
4100
  ), t;
4111
4101
  }
4112
- function No(e, t, i, s, n) {
4102
+ function Oo(e, t, i, s, n) {
4113
4103
  const r = J(i);
4114
4104
  if (r === void 0)
4115
4105
  return;
4116
- let a = rs(e.name, r);
4117
- const l = t.parameters.at(1);
4118
- if (l !== void 0 && o.isIdentifier(l.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
4119
- r.every(Fe, l.name)) {
4106
+ let a = cs(e.name, r);
4107
+ const c = t.parameters.at(1);
4108
+ if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
4109
+ r.every(Fe, c.name)) {
4120
4110
  T.warn(
4121
4111
  "@arcgis/lumina:jsxToLitHtml",
4122
4112
  "It looks like you are trying to use .map() index as a key={} prop value. Doing so is potentially pointless and may cause performance degradation. In Lit it is safe to omit the key={} prop. If you really mean to use index as the key, then use the keyed() Lit directive directly, rather than the JSX key={} prop.",
@@ -4125,7 +4115,7 @@ function No(e, t, i, s, n) {
4125
4115
  return;
4126
4116
  }
4127
4117
  if (!s) {
4128
- const d = Fo(r, a, t);
4118
+ const d = Jo(r, a, t);
4129
4119
  if (d === void 0)
4130
4120
  return;
4131
4121
  a = d;
@@ -4164,7 +4154,7 @@ function J(e) {
4164
4154
  }
4165
4155
  return t;
4166
4156
  } else {
4167
- if (jo.has(e.kind))
4157
+ if (Mo.has(e.kind))
4168
4158
  return [];
4169
4159
  {
4170
4160
  const t = ge(e);
@@ -4172,7 +4162,7 @@ function J(e) {
4172
4162
  }
4173
4163
  }
4174
4164
  }
4175
- const jo = /* @__PURE__ */ new Set([
4165
+ const Mo = /* @__PURE__ */ new Set([
4176
4166
  o.SyntaxKind.NumericLiteral,
4177
4167
  o.SyntaxKind.BigIntLiteral,
4178
4168
  o.SyntaxKind.StringLiteral,
@@ -4181,20 +4171,20 @@ const jo = /* @__PURE__ */ new Set([
4181
4171
  o.SyntaxKind.FalseKeyword,
4182
4172
  o.SyntaxKind.NullKeyword,
4183
4173
  o.SyntaxKind.TrueKeyword
4184
- ]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, rs = (e, t) => o.isObjectBindingPattern(e) ? Oo(e, t) : e;
4185
- function Fo(e, t, i) {
4174
+ ]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, cs = (e, t) => o.isObjectBindingPattern(e) ? _o(e, t) : e;
4175
+ function Jo(e, t, i) {
4186
4176
  if (e.every(Fe, t))
4187
4177
  return t;
4188
4178
  if (o.isIdentifier(t)) {
4189
- const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => Ro(r, t)) : void 0;
4179
+ const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => Bo(r, t)) : void 0;
4190
4180
  if (s === void 0)
4191
4181
  return;
4192
- const n = rs(s, e);
4182
+ const n = cs(s, e);
4193
4183
  if (e.every(Fe, n))
4194
4184
  return n;
4195
4185
  }
4196
4186
  }
4197
- function Ro(e, t) {
4187
+ function Bo(e, t) {
4198
4188
  if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
4199
4189
  return;
4200
4190
  const i = e.declarationList.declarations[0];
@@ -4202,52 +4192,52 @@ function Ro(e, t) {
4202
4192
  }
4203
4193
  function Fe(e) {
4204
4194
  const t = this;
4205
- return o.isIdentifier(t) ? t.text === e : t.elements.some(Do, e);
4195
+ return o.isIdentifier(t) ? t.text === e : t.elements.some(Ko, e);
4206
4196
  }
4207
- function Do(e) {
4197
+ function Ko(e) {
4208
4198
  const t = this;
4209
4199
  return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
4210
4200
  }
4211
- function Oo(e, t) {
4201
+ function _o(e, t) {
4212
4202
  let i = !1;
4213
4203
  const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
4214
4204
  return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
4215
4205
  }
4216
- const ns = (e, t) => t.liftedKeys.has(e);
4206
+ const ls = (e, t) => t.liftedKeys.has(e);
4217
4207
  function q(e, t, i) {
4218
4208
  if (fe(i))
4219
- return os(e, i);
4220
- const s = o.isCallExpression(i) ? Lo(e, i) : i, n = o.visitEachChild(
4209
+ return ds(e, i);
4210
+ const s = o.isCallExpression(i) ? Do(e, i) : i, n = o.visitEachChild(
4221
4211
  s,
4222
4212
  // Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
4223
4213
  q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4224
4214
  e.transformationContext
4225
4215
  );
4226
- return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || pr(i.right)) ? Bo(n) : n;
4216
+ return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || gr(i.right)) ? zo(n) : n;
4227
4217
  }
4228
- function os(e, t) {
4229
- const i = as(e, t);
4218
+ function ds(e, t) {
4219
+ const i = ps(e, t);
4230
4220
  return Oe(i, e);
4231
4221
  }
4232
- function as(e, t) {
4222
+ function ps(e, t) {
4233
4223
  const i = "children" in t ? t.children : [];
4234
4224
  if (o.isJsxFragment(t))
4235
4225
  return { key: void 0, ...Te(i, e) };
4236
4226
  const n = o.isJsxElement(t) ? t.openingElement : t, r = n.tagName;
4237
4227
  if (o.isJsxNamespacedName(r))
4238
4228
  throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
4239
- if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== _e) {
4240
- const S = o.isIdentifier(r) && r.text === Gs ? Te(i, e) : {
4229
+ if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== Ke) {
4230
+ const S = o.isIdentifier(r) && r.text === Zs ? Te(i, e) : {
4241
4231
  // No need to wrap the function call in a lit-html tag
4242
4232
  litTag: void 0,
4243
- parts: [Jo(e, t, r, i)]
4233
+ parts: [Uo(e, t, r, i)]
4244
4234
  };
4245
4235
  return {
4246
- key: Mo(n, e),
4236
+ key: Wo(n, e),
4247
4237
  ...S
4248
4238
  };
4249
4239
  }
4250
- const l = r.text === Be ? ke : r.text === _e ? Ye : r.text, d = r.text === Be ? oe : r.text === _e ? Y : Ys.has(l) ? fi : at.has(l) ? ie : ae, c = lt(l), p = c ? e.localComponents[l]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
4240
+ const c = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ? Y : tr.has(c) ? yi : ct.has(c) ? se : ce, l = dt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
4251
4241
  let f;
4252
4242
  const g = [];
4253
4243
  let h = !1;
@@ -4260,13 +4250,13 @@ Found ${x.getText(e.sourceFile)}`
4260
4250
  const { name: S, initializer: A } = x;
4261
4251
  if (o.isJsxNamespacedName(S))
4262
4252
  throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
4263
- const L = S.text, U = Co(A), F = U?.propType ?? Eo(L, A, l);
4253
+ const L = S.text, U = ko(A), F = U?.propType ?? Io(L, A, c);
4264
4254
  m?.delete(L);
4265
- const N = vo[F](e, U?.initializer ?? A, L, l);
4255
+ const N = Eo[F](e, U?.initializer ?? A, L, c);
4266
4256
  if (N.length === 0)
4267
4257
  return [];
4268
- const B = e.compiler.shouldMinifyJsx ? [" "] : xo(es(S, e));
4269
- return F === "key" ? (f = typeof N[0] == "object" && !ns(S, e) ? N[0] : void 0, B.some(Po) ? B : []) : F === "directives" || F === "ref" || L === "deferLoad" ? (h ||= F === "deferLoad", g.push(
4258
+ const B = e.compiler.shouldMinifyJsx ? [" "] : Fo(rs(S, e));
4259
+ return F === "key" ? (f = typeof N[0] == "object" && !ls(S, e) ? N[0] : void 0, B.some(Lo) ? B : []) : F === "directives" || F === "ref" || L === "deferLoad" ? (h ||= F === "deferLoad", g.push(
4270
4260
  ...B,
4271
4261
  ...N.flatMap(
4272
4262
  (D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
@@ -4276,20 +4266,20 @@ Found ${x.getText(e.sourceFile)}`
4276
4266
  if (m !== void 0 && m.size > 0 && e.compiler.logLintError(
4277
4267
  "mustIncludeAllRequiredProperties",
4278
4268
  e.sourceFile.fileName,
4279
- `Missing required properties for <${l}> }: ${Array.from(m).join(", ")}`
4280
- ), g.length > 0 && y.push(...g), typeof l == "string" && ct.has(l))
4269
+ `Missing required properties for <${c}> }: ${Array.from(m).join(", ")}`
4270
+ ), g.length > 0 && y.push(...g), typeof c == "string" && lt.has(c))
4281
4271
  throw Error(
4282
- `JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${l}" element`
4272
+ `JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
4283
4273
  );
4284
- c && (h ? e.customElementsToImportDeferred.add(l) : e.customElementsToImport.add(l));
4285
- const v = typeof l == "string" && Xs.has(l), w = Te(i, e);
4274
+ l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
4275
+ const v = typeof c == "string" && er.has(c), w = Te(i, e);
4286
4276
  if (v && w.parts.length > 0)
4287
4277
  throw Error(
4288
- `Void HTML elements like <${l}> cannot have children. Found ${t.getText(e.sourceFile)}`
4278
+ `Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
4289
4279
  );
4290
- const C = (d === ie || d === Y) && w.parts.length === 0, E = [
4280
+ const C = (d === se || d === Y) && w.parts.length === 0, E = [
4291
4281
  "<",
4292
- typeof l == "string" ? l : r,
4282
+ typeof c == "string" ? c : r,
4293
4283
  ...y,
4294
4284
  C ? `${y.length === 0 ? "" : " "}/>` : ">"
4295
4285
  ], P = v || C ? E : [
@@ -4301,32 +4291,32 @@ Found ${x.getText(e.sourceFile)}`
4301
4291
  */
4302
4292
  ...w.litTag !== void 0 && w.litTag !== d ? [Oe({ key: void 0, ...w }, e)] : w.parts,
4303
4293
  "</",
4304
- typeof l == "string" ? l : r,
4294
+ typeof c == "string" ? c : r,
4305
4295
  ">"
4306
4296
  ];
4307
4297
  return { key: f, parts: P, litTag: d };
4308
4298
  }
4309
- function Mo(e, t) {
4310
- const i = e.attributes.properties[cs(e)];
4311
- return i && o.isJsxAttribute(i) && !ns(i.name, t) ? ft(i.initializer, t.sourceFile) : void 0;
4299
+ function Wo(e, t) {
4300
+ const i = e.attributes.properties[us(e)];
4301
+ return i && o.isJsxAttribute(i) && !ls(i.name, t) ? ht(i.initializer, t.sourceFile) : void 0;
4312
4302
  }
4313
- const cs = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
4314
- function Jo(e, t, i, s) {
4303
+ const us = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
4304
+ function Uo(e, t, i, s) {
4315
4305
  const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
4316
4306
  if (o.isJsxSpreadAttribute(d))
4317
- return ts(es(d, e), o.factory.createSpreadAssignment(d.expression));
4318
- const { name: c, initializer: p } = d;
4319
- if (o.isJsxNamespacedName(c))
4320
- throw Error(`JSX namespaced attributes are not supported. Found ${c.getText(e.sourceFile)}`);
4321
- if (c.text === "key")
4307
+ return ns(rs(d, e), o.factory.createSpreadAssignment(d.expression));
4308
+ const { name: l, initializer: p } = d;
4309
+ if (o.isJsxNamespacedName(l))
4310
+ throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
4311
+ if (l.text === "key")
4322
4312
  return;
4323
- const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? os(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = oi(c.text) ? o.factory.createStringLiteral(c.text) : c;
4313
+ const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? ds(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = li(l.text) ? o.factory.createStringLiteral(l.text) : l;
4324
4314
  return o.factory.createPropertyAssignment(f, m);
4325
- }), { parts: a, litTag: l } = Te(s, e);
4315
+ }), { parts: a, litTag: c } = Te(s, e);
4326
4316
  return a.length > 0 && r.push(
4327
4317
  o.factory.createPropertyAssignment(
4328
4318
  o.factory.createIdentifier("children"),
4329
- Oe({ key: void 0, parts: a, litTag: l }, e)
4319
+ Oe({ key: void 0, parts: a, litTag: c }, e)
4330
4320
  )
4331
4321
  ), o.factory.createCallExpression(i, void 0, [
4332
4322
  o.factory.createObjectLiteralExpression(r.filter(R))
@@ -4336,13 +4326,13 @@ function Te(e, t) {
4336
4326
  let i;
4337
4327
  const s = e.flatMap((n) => {
4338
4328
  if (o.isJsxText(n))
4339
- return [t.compiler.shouldMinifyJsx ? Zs(n.text) : n.text];
4329
+ return [t.compiler.shouldMinifyJsx ? sr(n.text) : n.text];
4340
4330
  if (o.isJsxExpression(n))
4341
- return ht(t, n, n);
4331
+ return vt(t, n, n);
4342
4332
  {
4343
- const r = as(t, n);
4344
- if (r.key === void 0 && r.litTag !== oe && r.litTag !== Y) {
4345
- if (r.litTag === fi)
4333
+ const r = ps(t, n);
4334
+ if (r.key === void 0 && r.litTag !== ae && r.litTag !== Y) {
4335
+ if (r.litTag === yi)
4346
4336
  return r.parts;
4347
4337
  if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
4348
4338
  throw new Error(
@@ -4355,21 +4345,21 @@ function Te(e, t) {
4355
4345
  });
4356
4346
  return { litTag: i, parts: s };
4357
4347
  }
4358
- function Bo(e) {
4348
+ function zo(e) {
4359
4349
  return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
4360
4350
  e,
4361
4351
  o.factory.createToken(o.SyntaxKind.BarBarToken),
4362
4352
  o.factory.createStringLiteral("")
4363
4353
  ) : e;
4364
4354
  }
4365
- function ht(e, t, i) {
4355
+ function vt(e, t, i) {
4366
4356
  if (t.expression === void 0) {
4367
4357
  if (e.compiler.shouldMinifyJsx)
4368
4358
  return [];
4369
4359
  const s = t.getText(e.sourceFile).slice(1, -1);
4370
- return gt(s).length === 0 ? [] : [ts(s, o.factory.createIdentifier("undefined"))];
4360
+ return yt(s).length === 0 ? [] : [ns(s, o.factory.createIdentifier("undefined"))];
4371
4361
  }
4372
- return o.isStringLiteral(t.expression) ? [mi(t.expression.text)] : (
4362
+ return o.isStringLiteral(t.expression) ? [hi(t.expression.text)] : (
4373
4363
  /**
4374
4364
  * There is a bug in Chrome DevTools, where it won't let you set a
4375
4365
  * breakpoint inside a tagged template literal. It seems like they did
@@ -4406,26 +4396,26 @@ function ht(e, t, i) {
4406
4396
  ] : [q(e, i, t.expression)]
4407
4397
  );
4408
4398
  }
4409
- const ls = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), ds = ls(
4410
- Object.entries(se).flatMap(
4399
+ const ms = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), fs = ms(
4400
+ Object.entries(re).flatMap(
4411
4401
  ([e, t]) => t.map((i) => [i, e])
4412
4402
  )
4413
- ), ps = new Set(Object.keys(ds));
4414
- function _o(e, t) {
4403
+ ), gs = new Set(Object.keys(fs));
4404
+ function Ho(e, t) {
4415
4405
  const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
4416
4406
  if (!o.isStringLiteral(n))
4417
4407
  return t;
4418
- const r = Ko(e.sourceFile.fileName, n.text, ""), a = !i?.isTypeOnly;
4419
- if (a && e.existingImportedModules.add(r), mr.test(n.text) && // If id already includes ?, bypass our custom behavior
4408
+ const r = qo(e.sourceFile.fileName, n.text, ""), a = i?.phaseModifier !== o.SyntaxKind.TypeKeyword;
4409
+ if (a && e.existingImportedModules.add(r), yr.test(n.text) && // If id already includes ?, bypass our custom behavior
4420
4410
  !n.text.includes("?")) {
4421
4411
  if (s) {
4422
4412
  if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
4423
4413
  return t;
4424
- const c = e.sourceFile.fileName, p = c.includes("/node_modules/") || c.includes("/dist/"), m = `import "${n.text}"`;
4414
+ const l = e.sourceFile.fileName, p = l.includes("/node_modules/") || l.includes("/dist/"), m = `import "${n.text}"`;
4425
4415
  throw Error(
4426
- p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${c} is not externalized, and it contains a side-effect CSS import \`${m}\`. How should such CSS import be handled? Options:
4427
- 1. (suggested) Externalize ${c}, which will make end-user's bundler treat this CSS import as global CSS.
4428
- 2. Write a transform() plugin to drop the CSS import from ${c}, and then manually import the CSS as needed inside your shadow root or your library's global CSS file.` : `${c}: Found a side-effect CSS import \`${m}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${n.text}";\` instead and then add \`static override styles = styles;\` to your component. If this needs to be global CSS, @import it inside your global CSS file`
4416
+ p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${l} is not externalized, and it contains a side-effect CSS import \`${m}\`. How should such CSS import be handled? Options:
4417
+ 1. (suggested) Externalize ${l}, which will make end-user's bundler treat this CSS import as global CSS.
4418
+ 2. Write a transform() plugin to drop the CSS import from ${l}, and then manually import the CSS as needed inside your shadow root or your library's global CSS file.` : `${l}: Found a side-effect CSS import \`${m}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${n.text}";\` instead and then add \`static override styles = styles;\` to your component. If this needs to be global CSS, @import it inside your global CSS file`
4429
4419
  );
4430
4420
  }
4431
4421
  return o.factory.updateImportDeclaration(
@@ -4443,33 +4433,33 @@ function _o(e, t) {
4443
4433
  if (s)
4444
4434
  return t;
4445
4435
  if (i.name !== void 0) {
4446
- const c = i.name.text, p = i.name.text.startsWith(c[0].toUpperCase()), m = u.isAbsolute(r);
4447
- a && !i.isTypeOnly && p && m && e.importedFunctionComponentsFromModules.add(r);
4436
+ const l = i.name.text, p = i.name.text.startsWith(l[0].toUpperCase()), m = u.isAbsolute(r);
4437
+ a && p && m && e.importedFunctionComponentsFromModules.add(r);
4448
4438
  }
4449
- const l = i.namedBindings;
4450
- if (l === void 0 || !o.isNamedImports(l))
4439
+ const c = i.namedBindings;
4440
+ if (c === void 0 || !o.isNamedImports(c))
4451
4441
  return t;
4452
- const d = ps.has(n.text);
4453
- if (l.elements.forEach((c) => {
4454
- const p = (c.propertyName ?? c.name).text, m = se[p];
4442
+ const d = gs.has(n.text);
4443
+ if (c.elements.forEach((l) => {
4444
+ const p = (l.propertyName ?? l.name).text, m = re[p];
4455
4445
  if (d) {
4456
4446
  if (m?.some((h) => h === n.text)) {
4457
- const h = us(p, r);
4458
- e.existingLitImports.add(h), e.importRenames[h] = c.name?.text ?? h;
4447
+ const h = hs(p, r);
4448
+ e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
4459
4449
  }
4460
- } else (c.name.text === "h" || c.name.text === "createElement") && j().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4450
+ } else (l.name.text === "h" || l.name.text === "createElement") && j().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4461
4451
  const f = p.startsWith(p[0].toUpperCase()), g = u.isAbsolute(r);
4462
- a && !c.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
4452
+ a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
4463
4453
  }), n.text === "@arcgis/lumina") {
4464
- let c = !1;
4465
- const p = l.elements.filter((f) => {
4454
+ let l = !1;
4455
+ const p = c.elements.filter((f) => {
4466
4456
  const g = (f.propertyName ?? f.name).text;
4467
- return ur.has(g) ? !1 : (c ||= !f.isTypeOnly, !0);
4457
+ return hr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
4468
4458
  });
4469
4459
  if (p.length === 0)
4470
4460
  return;
4471
- if (p.length !== l.elements.length) {
4472
- const f = i.isTypeOnly || !c, g = c ? p : p.map(
4461
+ if (p.length !== c.elements.length) {
4462
+ const f = i.phaseModifier === o.SyntaxKind.TypeKeyword || !l, g = l ? p : p.map(
4473
4463
  (h) => o.factory.updateImportSpecifier(
4474
4464
  h,
4475
4465
  !1,
@@ -4482,9 +4472,9 @@ function _o(e, t) {
4482
4472
  t.modifiers,
4483
4473
  o.factory.updateImportClause(
4484
4474
  i,
4485
- f,
4475
+ f ? o.SyntaxKind.TypeKeyword : void 0,
4486
4476
  i.name,
4487
- o.factory.updateNamedImports(l, g)
4477
+ o.factory.updateNamedImports(c, g)
4488
4478
  ),
4489
4479
  t.moduleSpecifier,
4490
4480
  t.attributes
@@ -4493,67 +4483,67 @@ function _o(e, t) {
4493
4483
  }
4494
4484
  return t;
4495
4485
  }
4496
- const us = (e, t) => e === ae && se.staticHtml.includes(t) ? oe : e === ie && se.staticSvg.includes(t) ? Y : e, Ko = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4497
- function Wo(e) {
4498
- return o.isImportDeclaration(e) ? Uo(this, e) : e;
4486
+ const hs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? Y : e, qo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4487
+ function Vo(e) {
4488
+ return o.isImportDeclaration(e) ? Go(this, e) : e;
4499
4489
  }
4500
- function Uo(e, t) {
4490
+ function Go(e, t) {
4501
4491
  const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
4502
- if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !ps.has(n.text))
4492
+ if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !gs.has(n.text))
4503
4493
  return t;
4504
- const r = i.isTypeOnly;
4494
+ const r = i.phaseModifier === o.SyntaxKind.TypeKeyword;
4505
4495
  let a = !1;
4506
- const l = s.elements.map((d) => {
4507
- const c = (d.propertyName ?? d.name).text, p = us(c, n.text);
4496
+ const c = s.elements.map((d) => {
4497
+ const l = (d.propertyName ?? d.name).text, p = hs(l, n.text);
4508
4498
  return e.existingLitImports.delete(p), e.neededImports.has(p) ? (e.neededImports.delete(p), a = !0, o.factory.updateImportSpecifier(d, !1, d.propertyName, d.name)) : r ? o.factory.updateImportSpecifier(d, !0, d.propertyName, d.name) : d;
4509
4499
  });
4510
- return ds[n.text]?.forEach((d) => {
4511
- !e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, l.push(ms(d, e)));
4500
+ return fs[n.text]?.forEach((d) => {
4501
+ !e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(ys(d, e)));
4512
4502
  }), a ? o.factory.updateImportDeclaration(
4513
4503
  t,
4514
4504
  t.modifiers,
4515
4505
  o.factory.updateImportClause(
4516
4506
  i,
4517
- !1,
4507
+ void 0,
4518
4508
  i.name,
4519
- o.factory.updateNamedImports(s, l)
4509
+ o.factory.updateNamedImports(s, c)
4520
4510
  ),
4521
4511
  t.moduleSpecifier,
4522
4512
  t.attributes
4523
4513
  ) : t;
4524
4514
  }
4525
- function zo(e) {
4526
- const t = ls(
4527
- Array.from(e.neededImports, (i) => [se[i][0], i])
4515
+ function Xo(e) {
4516
+ const t = ms(
4517
+ Array.from(e.neededImports, (i) => [re[i][0], i])
4528
4518
  );
4529
4519
  return Object.entries(t).map(
4530
4520
  ([i, s]) => o.factory.createImportDeclaration(
4531
4521
  void 0,
4532
4522
  o.factory.createImportClause(
4533
- !1,
4523
+ void 0,
4534
4524
  void 0,
4535
4525
  o.factory.createNamedImports(
4536
- s.map((n) => (e.neededImports.delete(n), ms(n, e)))
4526
+ s.map((n) => (e.neededImports.delete(n), ys(n, e)))
4537
4527
  )
4538
4528
  ),
4539
4529
  o.factory.createStringLiteral(i)
4540
4530
  )
4541
4531
  );
4542
4532
  }
4543
- function ms(e, t) {
4544
- const i = e === oe ? ae : e === Y ? ie : e, s = t.importRenames[e];
4533
+ function ys(e, t) {
4534
+ const i = e === ae ? ce : e === Y ? se : e, s = t.importRenames[e];
4545
4535
  return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
4546
4536
  !1,
4547
4537
  o.factory.createIdentifier(i),
4548
4538
  o.factory.createIdentifier(s)
4549
4539
  );
4550
4540
  }
4551
- function Ho(e) {
4552
- const t = jr().map(({ packageName: i }) => i);
4541
+ function Yo(e) {
4542
+ const t = Mr().map(({ packageName: i }) => i);
4553
4543
  return e.existingImportedModules.forEach((i) => {
4554
4544
  if (u.isAbsolute(i))
4555
4545
  return;
4556
- const s = qs(i), n = i.slice(s.length + 1);
4546
+ const s = Ys(i), n = i.slice(s.length + 1);
4557
4547
  if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
4558
4548
  const r = Re(e.sourceFile.fileName);
4559
4549
  throw new Error(
@@ -4562,7 +4552,7 @@ function Ho(e) {
4562
4552
  }
4563
4553
  }), [];
4564
4554
  }
4565
- function qo(e) {
4555
+ function Qo(e) {
4566
4556
  if (e.compiler.viteCommand === "serve")
4567
4557
  return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
4568
4558
  const t = e.compiler._customElementDependencies;
@@ -4577,15 +4567,15 @@ function qo(e) {
4577
4567
  t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
4578
4568
  }), [];
4579
4569
  }
4580
- const Vo = (e, t) => {
4570
+ const Zo = (e, t) => {
4581
4571
  const i = e.pragmas;
4582
4572
  if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
4583
4573
  return e.statements;
4584
4574
  let s = !1, n;
4585
4575
  if (t.apiModule !== void 0) {
4586
4576
  const d = t.apiModule.declarations;
4587
- for (let c = 0; c < d.length; ++c) {
4588
- const p = d[c];
4577
+ for (let l = 0; l < d.length; ++l) {
4578
+ const p = d[l];
4589
4579
  if (p.customElement === !0) {
4590
4580
  const m = p;
4591
4581
  s = m.encapsulation !== void 0;
@@ -4597,11 +4587,11 @@ const Vo = (e, t) => {
4597
4587
  }
4598
4588
  const r = {
4599
4589
  compiler: t.compiler,
4600
- externalComponents: $i(),
4601
- localComponents: Qi(t.compiler),
4590
+ externalComponents: Ii(),
4591
+ localComponents: is(t.compiler),
4602
4592
  sourceFile: e,
4603
4593
  transformationContext: t.transformation,
4604
- importRenames: Go(e),
4594
+ importRenames: ea(e),
4605
4595
  existingImportedModules: /* @__PURE__ */ new Set(),
4606
4596
  importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
4607
4597
  existingLitImports: /* @__PURE__ */ new Set(),
@@ -4615,47 +4605,47 @@ const Vo = (e, t) => {
4615
4605
  let a = [];
4616
4606
  if (e.statements.every((d) => {
4617
4607
  if (o.isImportDeclaration(d)) {
4618
- const c = _o(r, d);
4619
- if (c === void 0)
4608
+ const l = Ho(r, d);
4609
+ if (l === void 0)
4620
4610
  return !0;
4621
- if (a.push(c), r.hasNonLuminaJsxImport)
4611
+ if (a.push(l), r.hasNonLuminaJsxImport)
4622
4612
  return !1;
4623
4613
  } else
4624
4614
  a.push(q(r, void 0, d));
4625
4615
  return !0;
4626
4616
  }), r.hasNonLuminaJsxImport)
4627
4617
  return e.statements;
4628
- if (r.neededImports.size > 0 && (a = a.map(Wo, r), r.existingLitImports.size > 0))
4618
+ if (r.neededImports.size > 0 && (a = a.map(Vo, r), r.existingLitImports.size > 0))
4629
4619
  throw new Error(
4630
4620
  `Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
4631
4621
  );
4632
- const l = [zo, Ho, qo].flatMap(
4622
+ const c = [Xo, Yo, Qo].flatMap(
4633
4623
  (d) => d(r)
4634
4624
  );
4635
4625
  if (r.neededImports.size > 0)
4636
4626
  throw new Error(
4637
4627
  `Expected context.neededLitImports to be empty by now. Found: ${Array.from(r.neededImports).join(", ")}`
4638
4628
  );
4639
- return [...l, ...a];
4629
+ return [...c, ...a];
4640
4630
  };
4641
- function Go(e) {
4642
- return Xo(e), Object.fromEntries(
4643
- dr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
4631
+ function ea(e) {
4632
+ return ta(e), Object.fromEntries(
4633
+ fr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
4644
4634
  );
4645
4635
  }
4646
- function Xo(e) {
4636
+ function ta(e) {
4647
4637
  if (!("identifiers" in e))
4648
4638
  throw new Error(
4649
4639
  "Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
4650
4640
  );
4651
4641
  }
4652
- const Vt = "customElement", Yo = (e, t) => {
4642
+ const Yt = "customElement", ia = (e, t) => {
4653
4643
  const i = [];
4654
4644
  if (t.apiModule?.declarations.forEach((r) => {
4655
4645
  const a = r;
4656
4646
  a.customElement !== void 0 && i.push(
4657
4647
  o.factory.createExpressionStatement(
4658
- o.factory.createCallExpression(o.factory.createIdentifier(Vt), void 0, [
4648
+ o.factory.createCallExpression(o.factory.createIdentifier(Yt), void 0, [
4659
4649
  o.factory.createStringLiteral(a.tagName ?? ""),
4660
4650
  o.factory.createIdentifier(a.name)
4661
4651
  ])
@@ -4670,16 +4660,16 @@ const Vt = "customElement", Yo = (e, t) => {
4670
4660
  return [o.factory.createImportDeclaration(
4671
4661
  void 0,
4672
4662
  o.factory.createImportClause(
4673
- !1,
4663
+ void 0,
4674
4664
  void 0,
4675
4665
  o.factory.createNamedImports([
4676
- o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Vt))
4666
+ o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Yt))
4677
4667
  ])
4678
4668
  ),
4679
4669
  o.factory.createStringLiteral(s)
4680
4670
  ), ...e.statements, ...i];
4681
4671
  };
4682
- function Qo(e, t, i) {
4672
+ function sa(e, t, i) {
4683
4673
  return t.size === 0 ? e : [
4684
4674
  o.factory.createPropertyDeclaration(
4685
4675
  [
@@ -4693,8 +4683,8 @@ function Qo(e, t, i) {
4693
4683
  Array.from(
4694
4684
  t.entries(),
4695
4685
  ([s, n]) => o.factory.createPropertyAssignment(
4696
- oi(s) ? o.factory.createStringLiteral(s) : s,
4697
- Zo(n, i)
4686
+ li(s) ? o.factory.createStringLiteral(s) : s,
4687
+ ra(n, i)
4698
4688
  )
4699
4689
  )
4700
4690
  )
@@ -4702,7 +4692,7 @@ function Qo(e, t, i) {
4702
4692
  ...e
4703
4693
  ];
4704
4694
  }
4705
- function Zo(e, t) {
4695
+ function ra(e, t) {
4706
4696
  let i = 0, s = !0;
4707
4697
  const n = [], r = [];
4708
4698
  for (const d of e.properties)
@@ -4710,32 +4700,32 @@ function Zo(e, t) {
4710
4700
  function a(d) {
4711
4701
  if (!o.isPropertyAssignment(d) || !o.isIdentifier(d.name))
4712
4702
  return !0;
4713
- const c = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
4714
- if (c === "attribute")
4715
- return s = !1, i |= m ? St : 0, !m && !f;
4716
- if (c === "reflect")
4717
- return i |= m ? Es : 0, !1;
4718
- if (c === "type" && o.isIdentifier(p)) {
4703
+ const l = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
4704
+ if (l === "attribute")
4705
+ return s = !1, i |= m ? Et : 0, !m && !f;
4706
+ if (l === "reflect")
4707
+ return i |= m ? ks : 0, !1;
4708
+ if (l === "type" && o.isIdentifier(p)) {
4719
4709
  if (p.text === "Boolean")
4720
- return i |= Ts, !1;
4710
+ return i |= Is, !1;
4721
4711
  if (p.text === "Number")
4722
- return i |= $s, !1;
4712
+ return i |= xs, !1;
4723
4713
  } else {
4724
- if (c === "state")
4725
- return s = !1, i |= m ? Ps : 0, !1;
4726
- if (c === "readOnly")
4727
- return i |= m ? ks : 0, !1;
4728
- if (c === "noAccessor")
4729
- return i |= m ? Is : 0, !1;
4730
- if (c === "useDefault")
4731
- return i |= m ? xs : 0, !1;
4714
+ if (l === "state")
4715
+ return s = !1, i |= m ? As : 0, !1;
4716
+ if (l === "readOnly")
4717
+ return i |= m ? Ls : 0, !1;
4718
+ if (l === "noAccessor")
4719
+ return i |= m ? Ns : 0, !1;
4720
+ if (l === "useDefault")
4721
+ return i |= m ? js : 0, !1;
4732
4722
  }
4733
4723
  return !0;
4734
4724
  }
4735
- s && (i |= St);
4736
- const l = o.factory.createNumericLiteral(i);
4737
- return n.length === 0 && (t || r.length === 0) ? l : o.factory.createArrayLiteralExpression([
4738
- l,
4725
+ s && (i |= Et);
4726
+ const c = o.factory.createNumericLiteral(i);
4727
+ return n.length === 0 && (t || r.length === 0) ? c : o.factory.createArrayLiteralExpression([
4728
+ c,
4739
4729
  o.factory.createObjectLiteralExpression(n),
4740
4730
  /**
4741
4731
  * In dev mode, to improve readability for non-source-map developers,
@@ -4747,7 +4737,7 @@ function Zo(e, t) {
4747
4737
  ...t ? [] : [o.factory.createObjectLiteralExpression(r)]
4748
4738
  ]);
4749
4739
  }
4750
- function ea(e, t, i) {
4740
+ function na(e, t, i) {
4751
4741
  let s = -1, n = -1, r = -1;
4752
4742
  e.options?.properties.forEach((p, m) => {
4753
4743
  if (o.isSpreadAssignment(p))
@@ -4759,23 +4749,23 @@ function ea(e, t, i) {
4759
4749
  f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
4760
4750
  }
4761
4751
  });
4762
- const a = i.attribute === void 0 && n === -1, l = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = ta(e, i, s), c = [
4752
+ const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = oa(e, i, s), l = [
4763
4753
  ...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
4764
- ...l ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
4754
+ ...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
4765
4755
  ...d !== void 0 ? [d] : []
4766
4756
  ];
4767
- return c.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(c, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...c]) : e.options;
4757
+ return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
4768
4758
  }
4769
- function ta(e, t, i) {
4759
+ function oa(e, t, i) {
4770
4760
  if (t.attribute === void 0)
4771
4761
  return;
4772
- const s = ia(t.type.values);
4762
+ const s = aa(t.type.values);
4773
4763
  return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
4774
4764
  o.factory.createIdentifier("type"),
4775
4765
  o.factory.createIdentifier(s)
4776
4766
  );
4777
4767
  }
4778
- function ia(e) {
4768
+ function aa(e) {
4779
4769
  let t = !1, i = !1, s = !1;
4780
4770
  if (e?.forEach((n) => {
4781
4771
  t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
@@ -4787,52 +4777,52 @@ function ia(e) {
4787
4777
  }
4788
4778
  return "Other";
4789
4779
  }
4790
- function sa(e, t, i, s, n, r) {
4780
+ function ca(e, t, i, s, n, r) {
4791
4781
  if (i.modifiers === void 0)
4792
4782
  return i;
4793
- let a = -1, l = -1;
4794
- if (i.modifiers.forEach((d, c) => {
4783
+ let a = -1, c = -1;
4784
+ if (i.modifiers.forEach((d, l) => {
4795
4785
  if (o.isDecorator(d) && o.isCallExpression(d.expression) && o.isIdentifier(d.expression.expression)) {
4796
4786
  const p = d.expression.expression.text;
4797
- p === "property" && (a = c), p === "state" && (l = c);
4787
+ p === "property" && (a = l), p === "state" && (c = l);
4798
4788
  }
4799
4789
  }), a !== -1) {
4800
- const d = ra(e, t, i, s, n), c = Gt(i, a, n), p = ea(c, n, d);
4801
- return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), c.options = p, Xt(i, a);
4802
- } else if (l !== -1) {
4803
- const d = Gt(i, l, n), c = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([c]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, c]), m = ai(i.name);
4790
+ const d = la(e, t, i, s, n), l = Qt(i, a, n), p = na(l, n, d);
4791
+ return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Zt(i, a);
4792
+ } else if (c !== -1) {
4793
+ const d = Qt(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m = di(i.name);
4804
4794
  if (m === void 0)
4805
4795
  throw new Error("Failed to statically determine the state property name");
4806
- return r.set(m, p), Xt(i, l);
4796
+ return r.set(m, p), Zt(i, c);
4807
4797
  } else
4808
4798
  return i;
4809
4799
  }
4810
- function ra(e, t, i, s, n) {
4800
+ function la(e, t, i, s, n) {
4811
4801
  const r = t ?? (e.compiler.isInTest ? {
4812
4802
  members: []
4813
4803
  } : void 0);
4814
4804
  if (r === void 0)
4815
4805
  throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
4816
- const a = ai(i.name);
4817
- let l;
4806
+ const a = di(i.name);
4807
+ let c;
4818
4808
  for (let d = 0; d < r.members.length; ++d) {
4819
- const c = r.members[d];
4820
- c.name === a && c.kind === "field" && (l = c);
4809
+ const l = r.members[d];
4810
+ l.name === a && l.kind === "field" && (c = l);
4821
4811
  }
4822
- if (l ??= e.compiler.isInTest ? { kind: "field", attribute: "", name: "", type: { text: "" } } : void 0, l === void 0)
4812
+ if (c ??= e.compiler.isInTest ? { kind: "field", attribute: "", name: "", type: { text: "" } } : void 0, c === void 0)
4823
4813
  throw Error(
4824
4814
  `Failed to find API property for ${i.getText(n)} in ${s} in ${n.fileName}`
4825
4815
  );
4826
- if (l.name === "") {
4816
+ if (c.name === "") {
4827
4817
  if (a === void 0)
4828
4818
  throw Error(
4829
4819
  `Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
4830
4820
  );
4831
- l.name = a, l.attribute ??= ei(a);
4821
+ c.name = a, c.attribute ??= si(a);
4832
4822
  }
4833
- return l;
4823
+ return c;
4834
4824
  }
4835
- function Gt(e, t, i) {
4825
+ function Qt(e, t, i) {
4836
4826
  const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
4837
4827
  if (r && !o.isObjectLiteralExpression(r))
4838
4828
  throw new Error(
@@ -4840,7 +4830,7 @@ function Gt(e, t, i) {
4840
4830
  );
4841
4831
  return { decorator: s, callExpression: n, options: r };
4842
4832
  }
4843
- function Xt(e, t) {
4833
+ function Zt(e, t) {
4844
4834
  const i = [
4845
4835
  ...e.modifiers.slice(0, t),
4846
4836
  ...e.modifiers.slice(t + 1)
@@ -4867,13 +4857,13 @@ function Xt(e, t) {
4867
4857
  e.initializer
4868
4858
  );
4869
4859
  }
4870
- function na(e, t, i, s) {
4860
+ function da(e, t, i, s) {
4871
4861
  let n;
4872
4862
  if (e.apiJsonEnabled)
4873
4863
  for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
4874
- const c = e.privateApiJson.modules[d];
4875
- if (c.sourcePath === i.fileName.slice(e.dir.root.length)) {
4876
- n = c;
4864
+ const l = e.privateApiJson.modules[d];
4865
+ if (l.sourcePath === i.fileName.slice(e.dir.root.length)) {
4866
+ n = l;
4877
4867
  break;
4878
4868
  }
4879
4869
  }
@@ -4882,17 +4872,17 @@ function na(e, t, i, s) {
4882
4872
  apiModule: n,
4883
4873
  transformation: t
4884
4874
  }, a = i.statements;
4885
- let l = a;
4875
+ let c = a;
4886
4876
  try {
4887
4877
  s.forEach((d) => {
4888
4878
  i.statements = d(i, r);
4889
4879
  });
4890
4880
  } finally {
4891
- l = i.statements, i.statements = a;
4881
+ c = i.statements, i.statements = a;
4892
4882
  }
4893
- return oa(i, l);
4883
+ return pa(i, c);
4894
4884
  }
4895
- const oa = (e, t) => o.factory.updateSourceFile(
4885
+ const pa = (e, t) => o.factory.updateSourceFile(
4896
4886
  e,
4897
4887
  t,
4898
4888
  /*
@@ -4904,19 +4894,19 @@ const oa = (e, t) => o.factory.updateSourceFile(
4904
4894
  e.isDeclarationFile,
4905
4895
  e.referencedFiles,
4906
4896
  e.typeReferenceDirectives,
4907
- e.hasNoDefaultLib,
4897
+ !1,
4908
4898
  e.libReferenceDirectives
4909
4899
  );
4910
- function aa(e, t) {
4900
+ function ua(e, t) {
4911
4901
  t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
4912
4902
  }
4913
- const ca = (e, t) => {
4903
+ const ma = (e, t) => {
4914
4904
  let i;
4915
4905
  if (t.apiModule !== void 0)
4916
4906
  for (let d = 0; d < t.apiModule.declarations.length; ++d) {
4917
- const c = t.apiModule.declarations[d];
4918
- if (c.customElement === !0) {
4919
- i = c;
4907
+ const l = t.apiModule.declarations[d];
4908
+ if (l.customElement === !0) {
4909
+ i = l;
4920
4910
  break;
4921
4911
  }
4922
4912
  }
@@ -4926,25 +4916,25 @@ const ca = (e, t) => {
4926
4916
  function n() {
4927
4917
  s = /* @__PURE__ */ new Map();
4928
4918
  }
4929
- const r = (d) => Qo(d, s, t.compiler.shouldMinify);
4930
- function a(d, c) {
4931
- const p = da(t, i, d, c, e, s);
4932
- return aa(p, t), p;
4919
+ const r = (d) => sa(d, s, t.compiler.shouldMinify);
4920
+ function a(d, l) {
4921
+ const p = ga(t, i, d, l, e, s);
4922
+ return ua(p, t), p;
4933
4923
  }
4934
4924
  return e.statements.map(
4935
- (d) => fs(a, d, t, n, r)
4925
+ (d) => vs(a, d, t, n, r)
4936
4926
  );
4937
4927
  };
4938
- function fs(e, t, i, s, n = ci) {
4928
+ function vs(e, t, i, s, n = pi) {
4939
4929
  if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
4940
4930
  t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
4941
4931
  let r = !1;
4942
4932
  const a = t.name?.text;
4943
4933
  s?.();
4944
- const l = n(
4945
- t.members.map((c) => {
4946
- const p = e(c, a);
4947
- return r ||= p !== c, p;
4934
+ const c = n(
4935
+ t.members.map((l) => {
4936
+ const p = e(l, a);
4937
+ return r ||= p !== l, p;
4948
4938
  })
4949
4939
  );
4950
4940
  return r ? o.factory.updateClassDeclaration(
@@ -4953,20 +4943,20 @@ function fs(e, t, i, s, n = ci) {
4953
4943
  t.name,
4954
4944
  t.typeParameters,
4955
4945
  t.heritageClauses,
4956
- l
4946
+ c
4957
4947
  ) : t;
4958
4948
  } else
4959
4949
  return i.compiler.isInTest ? o.visitEachChild(
4960
4950
  t,
4961
- (a) => fs(e, a, i, s, n),
4951
+ (a) => vs(e, a, i, s, n),
4962
4952
  i.transformation
4963
4953
  ) : t;
4964
4954
  }
4965
- const la = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4966
- function da(e, t, i, s, n, r) {
4955
+ const fa = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4956
+ function ga(e, t, i, s, n, r) {
4967
4957
  if (o.isMethodDeclaration(i)) {
4968
4958
  const a = i.modifiers?.filter(
4969
- (l) => !o.isDecorator(l) || !pa(l)
4959
+ (c) => !o.isDecorator(c) || !ha(c)
4970
4960
  );
4971
4961
  if (a?.length !== i.modifiers?.length)
4972
4962
  return o.factory.updateMethodDeclaration(
@@ -4980,10 +4970,10 @@ function da(e, t, i, s, n, r) {
4980
4970
  i.type,
4981
4971
  i.body
4982
4972
  );
4983
- if ("text" in i.name && la.has(i.name.text) && i.body) {
4984
- const l = i.name.text;
4973
+ if ("text" in i.name && fa.has(i.name.text) && i.body) {
4974
+ const c = i.name.text;
4985
4975
  return i.body.statements.some(
4986
- (c) => o.isExpressionStatement(c) && o.isCallExpression(c.expression) && o.isPropertyAccessExpression(c.expression.expression) && c.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && c.expression.expression.name.text === l
4976
+ (l) => o.isExpressionStatement(l) && o.isCallExpression(l.expression) && o.isPropertyAccessExpression(l.expression.expression) && l.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && l.expression.expression.name.text === c
4987
4977
  ) ? i : o.factory.updateMethodDeclaration(
4988
4978
  i,
4989
4979
  i.modifiers,
@@ -4996,7 +4986,7 @@ function da(e, t, i, s, n, r) {
4996
4986
  o.factory.updateBlock(i.body, [
4997
4987
  o.factory.createExpressionStatement(
4998
4988
  o.factory.createCallExpression(
4999
- o.factory.createPropertyAccessExpression(o.factory.createSuper(), l),
4989
+ o.factory.createPropertyAccessExpression(o.factory.createSuper(), c),
5000
4990
  void 0,
5001
4991
  []
5002
4992
  )
@@ -5006,14 +4996,14 @@ function da(e, t, i, s, n, r) {
5006
4996
  );
5007
4997
  }
5008
4998
  }
5009
- return o.isPropertyDeclaration(i) || o.isAccessor(i) ? sa(e, t, i, s, n, r) : i;
5010
- }
5011
- const pa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", ua = [
5012
- Vo,
5013
- Yo,
5014
- ca
5015
- ], ma = "@arcgis/lumina:transformComponents", fa = (e) => ({
5016
- name: ma,
4999
+ return o.isPropertyDeclaration(i) || o.isAccessor(i) ? ca(e, t, i, s, n, r) : i;
5000
+ }
5001
+ const ha = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", ya = [
5002
+ Zo,
5003
+ ia,
5004
+ ma
5005
+ ], va = "@arcgis/lumina:transformComponents", ba = (e) => ({
5006
+ name: va,
5017
5007
  transform: {
5018
5008
  // Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
5019
5009
  // Also, we need to run on the original fs file, before other transforms so
@@ -5030,112 +5020,112 @@ const pa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
5030
5020
  await Promise.all(
5031
5021
  // False alarm because of |undefined.
5032
5022
  // eslint-disable-next-line @typescript-eslint/await-thenable
5033
- e.apiJsonDeferred === void 0 ? [re] : [re, e.apiJsonDeferred.promise]
5023
+ e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
5034
5024
  );
5035
5025
  const n = e.getSourceFile(i, t), a = o.transform(n, [
5036
- (f) => () => na(e, f, n, [
5026
+ (f) => () => da(e, f, n, [
5037
5027
  ...e.options.types?.sourceFileTransformers ?? [],
5038
- ...ua
5028
+ ...ya
5039
5029
  ])
5040
- ]).transformed[0], l = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Ct.createSourceMapGenerator(ga, u.basename(i), "", u.dirname(i), {}), c = Ct.createTextWriter(`
5030
+ ]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Tt.createSourceMapGenerator(wa, u.basename(i), "", u.dirname(i), {}), l = Tt.createTextWriter(`
5041
5031
  `);
5042
- l.writeFile(a, c, d);
5043
- const p = c.getText(), m = d?.toJSON();
5032
+ c.writeFile(a, l, d);
5033
+ const p = l.getText(), m = d?.toJSON();
5044
5034
  return {
5045
5035
  code: p,
5046
5036
  map: m ?? null
5047
5037
  };
5048
5038
  }
5049
5039
  }
5050
- }), ga = {
5040
+ }), wa = {
5051
5041
  getCurrentDirectory: o.sys.getCurrentDirectory,
5052
- getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ci : (e) => e.toLowerCase()
5053
- }, ha = (e) => ({
5042
+ getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? pi : (e) => e.toLowerCase()
5043
+ }, Sa = (e) => ({
5054
5044
  name: "@arcgis/lumina:handleDynamicAssets",
5055
5045
  configureServer(t) {
5056
- e.server = t, Yt(e).forEach(({ assets: i, transformers: s }) => te(e, i, s));
5046
+ e.server = t, ei(e).forEach(({ assets: i, transformers: s }) => ie(e, i, s));
5057
5047
  },
5058
5048
  async writeBundle() {
5059
5049
  await Promise.all(
5060
- Yt(e).map(
5061
- async ({ assets: t, transformers: i }) => await xi(e, t, i)
5050
+ ei(e).map(
5051
+ async ({ assets: t, transformers: i }) => await Fi(e, t, i)
5062
5052
  )
5063
5053
  );
5064
5054
  }
5065
5055
  });
5066
- function Yt(e) {
5056
+ function ei(e) {
5067
5057
  const t = [], i = e.assetsToProvide?.filter((s) => s.apply === void 0 || s.apply === e.viteCommand) ?? [];
5068
5058
  return e.options.assets?.extra?.forEach((s) => {
5069
5059
  "type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
5070
5060
  }), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
5071
5061
  }
5072
- const nt = "@arcgis/lumina:updatePackageJson", ya = (e) => ({
5073
- name: nt,
5062
+ const ot = "@arcgis/lumina:updatePackageJson", Ca = (e) => ({
5063
+ name: ot,
5074
5064
  apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
5075
5065
  configResolved() {
5076
- va(e).catch(
5077
- (t) => T.error(nt, `Failed to update package's package.json:${String(t)}`)
5066
+ Ea(e).catch(
5067
+ (t) => T.error(ot, `Failed to update package's package.json:${String(t)}`)
5078
5068
  );
5079
5069
  }
5080
5070
  });
5081
- async function va(e) {
5082
- const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = ba(i, e);
5083
- s && ni(t, JSON.stringify(s, null, 2));
5071
+ async function Ea(e) {
5072
+ const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = Ta(i, e);
5073
+ s && ci(t, JSON.stringify(s, null, 2));
5084
5074
  }
5085
- function ba(e, t) {
5075
+ function Ta(e, t) {
5086
5076
  const i = e?.devDependencies ?? {};
5087
- Object.keys(e?.peerDependencies ?? {}).forEach((c) => {
5088
- c in i || T.warn(
5089
- nt,
5090
- `Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${c}" that is not a devDependency. Please edit your package.json`
5077
+ Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
5078
+ l in i || T.warn(
5079
+ ot,
5080
+ `Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${l}" that is not a devDependency. Please edit your package.json`
5091
5081
  );
5092
5082
  });
5093
5083
  let s = !1;
5094
- const n = (c) => u.relative(t.dir.root, u.join(t.dir.dist, c)), r = t._documentationFileNames;
5084
+ const n = (l) => u.relative(t.dir.root, u.join(t.dir.dist, l)), r = t._documentationFileNames;
5095
5085
  if (r.vsCodeCss !== void 0) {
5096
- const c = e["css.customData"] ?? [], p = n(r.vsCodeCss);
5097
- c.includes(p) || (e["css.customData"] = [...c, p], s = !0);
5086
+ const l = e["css.customData"] ?? [], p = n(r.vsCodeCss);
5087
+ l.includes(p) || (e["css.customData"] = [...l, p], s = !0);
5098
5088
  }
5099
5089
  if (r.apiJson !== void 0) {
5100
- const c = n(r.apiJson);
5101
- e.customElements !== c && (e.customElements = c, s = !0);
5090
+ const l = n(r.apiJson);
5091
+ e.customElements !== l && (e.customElements = l, s = !0);
5102
5092
  }
5103
5093
  if (r.vsCodeHtml !== void 0) {
5104
- const c = e["html.customData"] ?? [], p = n(r.vsCodeHtml);
5105
- c.includes(p) || (e["html.customData"] = [...c, p], s = !0);
5094
+ const l = e["html.customData"] ?? [], p = n(r.vsCodeHtml);
5095
+ l.includes(p) || (e["html.customData"] = [...l, p], s = !0);
5106
5096
  }
5107
5097
  if (r.webTypes !== void 0) {
5108
- const c = n(r.webTypes);
5109
- e["web-types"] !== c && (s = !0, e["web-types"] = c);
5098
+ const l = n(r.webTypes);
5099
+ e["web-types"] !== l && (s = !0, e["web-types"] = l);
5110
5100
  }
5111
- const a = `./${Z}.css`, l = t.options.build?.cdn?.namespace !== void 0, d = he(
5101
+ const a = `./${Z}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = he(
5112
5102
  t.dir.root,
5113
5103
  u.join(t.dir.distCdn, a)
5114
5104
  );
5115
- if (!l) {
5105
+ if (!c) {
5116
5106
  e.exports?.[a] !== d && (e.exports ??= {}, e.exports[a] = d, s = !0);
5117
- const c = e.name.split("/").length > 1 ? e.name.split("/")[1] : e.name;
5107
+ const l = e.name.split("/").length > 1 ? e.name.split("/")[1] : e.name;
5118
5108
  for (const p of Object.keys(e.exports))
5119
- p.endsWith(`${c}.css`) && e.exports[p] !== d && (e.exports[p] = d, s = !0);
5109
+ p.endsWith(`${l}.css`) && e.exports[p] !== d && (e.exports[p] = d, s = !0);
5120
5110
  }
5121
5111
  if (s)
5122
5112
  return e;
5123
5113
  }
5124
- const wa = (e) => ({
5114
+ const $a = (e) => ({
5125
5115
  deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
5126
5116
  timestamp: e.apiJson.timestamp,
5127
5117
  compiler: e.apiJson.compiler,
5128
- components: Sa(e),
5118
+ components: Pa(e),
5129
5119
  typeLibrary: {}
5130
5120
  });
5131
- function Sa(e) {
5121
+ function Pa(e) {
5132
5122
  const t = [];
5133
5123
  for (const i of e.apiJson.modules)
5134
5124
  for (const s of i.declarations)
5135
- s.customElement === !0 && t.push(Ca(s, i.sourcePath));
5125
+ s.customElement === !0 && t.push(ka(s, i.sourcePath));
5136
5126
  return t;
5137
5127
  }
5138
- function Ca(e, t) {
5128
+ function ka(e, t) {
5139
5129
  const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
5140
5130
  return {
5141
5131
  filePath: t,
@@ -5150,9 +5140,9 @@ function Ca(e, t) {
5150
5140
  dependencies: [],
5151
5141
  dependencyGraph: {},
5152
5142
  deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
5153
- props: e.members.map(Ea).filter(R),
5154
- methods: e.members.map(Ta).filter(R),
5155
- events: e.events?.map($a) ?? [],
5143
+ props: e.members.map(Ia).filter(R),
5144
+ methods: e.members.map(xa).filter(R),
5145
+ events: e.events?.map(Aa) ?? [],
5156
5146
  styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
5157
5147
  name: s,
5158
5148
  annotation: "prop",
@@ -5177,7 +5167,7 @@ function Ve(e, t = "") {
5177
5167
  }
5178
5168
  return t;
5179
5169
  }
5180
- function Ea(e) {
5170
+ function Ia(e) {
5181
5171
  if (e.kind !== "field")
5182
5172
  return;
5183
5173
  const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], n = t.docsTags?.some((r) => r.name === "required") ?? !1;
@@ -5187,7 +5177,7 @@ function Ea(e) {
5187
5177
  complexType: t.type === void 0 ? void 0 : {
5188
5178
  original: t.type.text,
5189
5179
  resolved: t.type.text,
5190
- references: yt(t.type.references)
5180
+ references: bt(t.type.references)
5191
5181
  },
5192
5182
  mutable: !0,
5193
5183
  attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
@@ -5206,19 +5196,19 @@ function Ea(e) {
5206
5196
  required: n
5207
5197
  };
5208
5198
  }
5209
- const yt = (e) => Object.fromEntries(
5199
+ const bt = (e) => Object.fromEntries(
5210
5200
  e?.map(
5211
5201
  (t) => [
5212
5202
  t.name,
5213
5203
  {
5214
- location: t.package === Ls ? "global" : t.package === void 0 ? "local" : "import",
5204
+ location: t.package === Rs ? "global" : t.package === void 0 ? "local" : "import",
5215
5205
  path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
5216
5206
  id: "notImplemented"
5217
5207
  }
5218
5208
  ]
5219
5209
  ) ?? []
5220
5210
  );
5221
- function Ta(e) {
5211
+ function xa(e) {
5222
5212
  if (e.kind !== "method")
5223
5213
  return;
5224
5214
  const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
@@ -5237,7 +5227,7 @@ function Ta(e) {
5237
5227
  signature: t.signature ?? "()=>unknown",
5238
5228
  parameters: s,
5239
5229
  return: t.return?.type?.text ?? "void",
5240
- references: yt([
5230
+ references: bt([
5241
5231
  ...t.return?.type?.references ?? [],
5242
5232
  ...t.parameters?.flatMap((n) => n.type.references ?? []) ?? []
5243
5233
  ])
@@ -5249,7 +5239,7 @@ function Ta(e) {
5249
5239
  deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
5250
5240
  };
5251
5241
  }
5252
- function $a(e) {
5242
+ function Aa(e) {
5253
5243
  const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
5254
5244
  return {
5255
5245
  event: e.name,
@@ -5258,7 +5248,7 @@ function $a(e) {
5258
5248
  complexType: {
5259
5249
  original: e.type.text,
5260
5250
  resolved: e.type.text,
5261
- references: yt(e.type.references)
5251
+ references: bt(e.type.references)
5262
5252
  },
5263
5253
  cancelable: e.cancelable ?? !0,
5264
5254
  composed: e.composed ?? !0,
@@ -5274,8 +5264,8 @@ const ye = {
5274
5264
  cssParts: "CSS Parts",
5275
5265
  methods: "Methods"
5276
5266
  };
5277
- function gs(e) {
5278
- const t = Pa(e.slots), i = ka(e.events), s = Ia(e.cssProperties), n = xa(e.cssParts), r = Aa(e.members), a = e.description?.trim();
5267
+ function bs(e) {
5268
+ const t = La(e.slots), i = Na(e.events), s = ja(e.cssProperties), n = Fa(e.cssParts), r = Ra(e.members), a = e.description?.trim();
5279
5269
  return [...a ? [`${a}
5280
5270
  --`] : [], i, r, t, s, n].filter(Boolean).join(`
5281
5271
 
@@ -5283,28 +5273,28 @@ function gs(e) {
5283
5273
  }
5284
5274
  const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
5285
5275
  ${t.join(`
5286
- `)}`, Pa = (e) => ve(
5276
+ `)}`, La = (e) => ve(
5287
5277
  ye.slots,
5288
5278
  e?.filter((t) => t.deprecated === void 0).map(
5289
5279
  (t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
5290
5280
  )
5291
- ), ka = (e) => ve(
5281
+ ), Na = (e) => ve(
5292
5282
  ye.events,
5293
5283
  e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
5294
- ), Ia = (e = []) => ve(
5284
+ ), ja = (e = []) => ve(
5295
5285
  ye.cssProperties,
5296
5286
  e?.filter((t) => t.deprecated === void 0).map(
5297
5287
  (t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
5298
5288
  )
5299
- ), xa = (e) => ve(
5289
+ ), Fa = (e) => ve(
5300
5290
  ye.cssParts,
5301
5291
  e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
5302
- ), Aa = (e) => ve(
5292
+ ), Ra = (e) => ve(
5303
5293
  ye.methods,
5304
- e.filter(Ns).filter((t) => t.deprecated === void 0).map(
5294
+ e.filter(Ds).filter((t) => t.deprecated === void 0).map(
5305
5295
  (t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
5306
5296
  )
5307
- ), hs = (e) => {
5297
+ ), ws = (e) => {
5308
5298
  const t = [], i = /* @__PURE__ */ new Set();
5309
5299
  for (let s = 0; s < e.length; ++s) {
5310
5300
  const n = e[s].cssProperties;
@@ -5318,13 +5308,13 @@ ${t.join(`
5318
5308
  }
5319
5309
  }
5320
5310
  return t;
5321
- }, ys = (e) => e.flatMap(
5311
+ }, Ss = (e) => e.flatMap(
5322
5312
  (t) => t.cssParts?.filter((i) => i.deprecated === void 0).map((i) => ({
5323
5313
  name: `::part(${i.name})`,
5324
5314
  description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
5325
5315
  })) ?? []
5326
5316
  );
5327
- function La(e) {
5317
+ function Da(e) {
5328
5318
  if (e.attributes === void 0)
5329
5319
  return [];
5330
5320
  const t = [];
@@ -5335,7 +5325,7 @@ function La(e) {
5335
5325
  description: s.description || void 0,
5336
5326
  default: s.default,
5337
5327
  value: {
5338
- type: Na(
5328
+ type: Oa(
5339
5329
  s.type.values?.map(
5340
5330
  (n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
5341
5331
  )
@@ -5345,13 +5335,13 @@ function La(e) {
5345
5335
  }
5346
5336
  return t;
5347
5337
  }
5348
- const Na = (e) => e?.length === 1 ? e[0] : e;
5349
- function ja(e, t) {
5350
- const i = Fa(e), s = hs(e), n = ys(e), r = j();
5338
+ const Oa = (e) => e?.length === 1 ? e[0] : e;
5339
+ function Ma(e, t) {
5340
+ const i = Ja(e), s = ws(e), n = Ss(e), r = j();
5351
5341
  return {
5352
5342
  $schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
5353
5343
  name: r.name,
5354
- version: r.version,
5344
+ version: ut(r) ?? r.version,
5355
5345
  "description-markup": "markdown",
5356
5346
  "default-icon": t.defaultIcon,
5357
5347
  contributions: {
@@ -5365,113 +5355,116 @@ function ja(e, t) {
5365
5355
  }
5366
5356
  };
5367
5357
  }
5368
- const Fa = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
5358
+ const Ja = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
5369
5359
  name: t.tagName,
5370
- description: gs(t),
5360
+ description: bs(t),
5371
5361
  "doc-url": t.demos?.[0]?.url,
5372
- attributes: La(t),
5362
+ attributes: Da(t),
5373
5363
  slots: t.slots?.map((i) => ({
5374
5364
  name: i.name,
5375
5365
  description: i.description
5376
5366
  })),
5377
5367
  // REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
5378
- events: Qt(t),
5368
+ events: ti(t),
5379
5369
  js: {
5380
- properties: Ra(t),
5381
- events: Qt(t)
5370
+ properties: Ba(t),
5371
+ events: ti(t)
5382
5372
  }
5383
- })), Ra = (e) => e.members.filter(js).filter((t) => t.deprecated === void 0).map((t) => ({
5373
+ })), Ba = (e) => e.members.filter(Os).filter((t) => t.deprecated === void 0).map((t) => ({
5384
5374
  name: t.name,
5385
5375
  description: t.description,
5386
5376
  type: t.type?.text
5387
- })) ?? [], Qt = (e) => e.events?.filter((t) => t.deprecated === void 0).map((t) => ({
5377
+ })) ?? [], ti = (e) => e.events?.filter((t) => t.deprecated === void 0).map((t) => ({
5388
5378
  name: t.name,
5389
5379
  type: t.type?.text,
5390
5380
  description: t.description
5391
- })) ?? [], Da = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
5381
+ })) ?? [], Ka = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
5392
5382
  name: t.tagName,
5393
- description: gs(t),
5394
- attributes: Oa(t),
5383
+ description: bs(t),
5384
+ attributes: _a(t),
5395
5385
  references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
5396
- })), Oa = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
5386
+ })), _a = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
5397
5387
  name: t.name,
5398
5388
  description: t.description || void 0,
5399
- values: Ma(t)
5400
- })) ?? [], Ma = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Ja = (e) => ({
5389
+ values: Wa(t)
5390
+ })) ?? [], Wa = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Ua = (e) => ({
5401
5391
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
5402
5392
  version: 1.1,
5403
- tags: Da(e)
5404
- }), Ba = (e) => ({
5393
+ tags: Ka(e)
5394
+ }), za = (e) => ({
5405
5395
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
5406
5396
  version: 1.1,
5407
- properties: hs(e),
5408
- pseudoElements: ys(e)
5409
- }), _a = "@arcgis/lumina:generateDocs";
5410
- function Ka(e) {
5397
+ properties: ws(e),
5398
+ pseudoElements: Ss(e)
5399
+ }), Ha = "@arcgis/lumina:generateDocs";
5400
+ function qa(e) {
5411
5401
  return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
5412
5402
  {
5413
5403
  type: "dynamic",
5414
- source: () => JSON.stringify(wa(e), null, rt(e)),
5404
+ source: () => JSON.stringify($a(e), null, nt(e)),
5415
5405
  destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
5416
5406
  }
5417
5407
  ]), {
5418
- name: _a,
5408
+ name: Ha,
5419
5409
  async writeBundle() {
5420
5410
  if (e.isInStorybook)
5421
5411
  return;
5422
- const t = rt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), l = [n, r, a].filter(R);
5423
- if (l.length === 0)
5412
+ const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [n, r, a].filter(R);
5413
+ if (c.length === 0)
5424
5414
  return;
5425
- await Fi(l);
5415
+ await Ji(c);
5426
5416
  const d = [];
5427
5417
  if (n !== void 0) {
5428
- const c = JSON.stringify(Ja(e.apiJsonComponents), null, t);
5429
- d.push(K(n, c));
5418
+ const l = JSON.stringify(Ua(e.apiJsonComponents), null, t);
5419
+ d.push(_(n, l));
5430
5420
  }
5431
5421
  if (r !== void 0) {
5432
- const c = JSON.stringify(Ba(e.apiJsonComponents), null, t);
5433
- d.push(K(r, c));
5422
+ const l = JSON.stringify(za(e.apiJsonComponents), null, t);
5423
+ d.push(_(r, l));
5434
5424
  }
5435
5425
  if (a !== void 0) {
5436
- const c = ja(e.apiJsonComponents, typeof i == "object" ? i : {});
5437
- d.push(K(a, JSON.stringify(c, null, t)));
5426
+ const l = Ma(e.apiJsonComponents, typeof i == "object" ? i : {});
5427
+ d.push(_(a, JSON.stringify(l, null, t)));
5438
5428
  }
5439
5429
  await Promise.all(d);
5440
5430
  }
5441
5431
  };
5442
5432
  }
5443
- function Wa(e) {
5433
+ function Va(e) {
5444
5434
  return {
5445
5435
  name: "@arcgis/lumina:buildWrappers",
5446
5436
  apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
5447
5437
  async writeBundle() {
5448
5438
  e.isInStorybook || await Promise.all(
5449
5439
  e.options.build?.wrappers?.map(async (t) => {
5450
- t.type === "react18" && await Ha(e, t);
5440
+ t.type === "react18" && await Ya(e, t);
5451
5441
  }) ?? []
5452
5442
  );
5453
5443
  }
5454
5444
  };
5455
5445
  }
5456
- const Ua = "react", Zt = "@lit/react", za = `
5457
- import React from "${Ua}";
5458
- import { createComponent } from "${Zt}";
5459
- import type { EventName } from "${Zt}";
5446
+ const Ga = "react", ii = "@lit/react", Xa = `
5447
+ import React from "${Ga}";
5448
+ import { createComponent } from "${ii}";
5449
+ import type { EventName } from "${ii}";
5460
5450
  import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
5461
5451
 
5462
5452
  const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
5463
5453
  `;
5464
- async function Ha(e, t) {
5454
+ async function Ya(e, t) {
5465
5455
  const { name: i } = j(), s = [];
5466
5456
  for (const a of e.apiJson.modules)
5467
- for (const l of a.declarations)
5468
- l.customElement === !0 && s.push(qa(l));
5469
- const n = [`/// <reference types="${i}" preserve="true" />`, za, ...s].join(""), r = u.resolve(t.proxiesFile);
5470
- await X(u.dirname(r), { recursive: !0 }), await K(r, n);
5457
+ for (const c of a.declarations)
5458
+ Qa(c) && s.push(Za(c));
5459
+ const n = [`/// <reference types="${i}" preserve="true" />`, Xa, ...s].join(""), r = u.resolve(t.proxiesFile);
5460
+ await X(u.dirname(r), { recursive: !0 }), await _(r, n);
5471
5461
  }
5472
- function qa(e) {
5462
+ function Qa(e) {
5463
+ return e.customElement === !0 && e.abstract !== !0;
5464
+ }
5465
+ function Za(e) {
5473
5466
  const t = e.events?.map(
5474
- (i) => ` ${Hs(`on${ws(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
5467
+ (i) => ` ${Xs(`on${Ts(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
5475
5468
  ).join(`
5476
5469
  `);
5477
5470
  return `
@@ -5486,42 +5479,42 @@ ${t}
5486
5479
  );
5487
5480
  `;
5488
5481
  }
5489
- function Sc(e = {}) {
5482
+ function kc(e = {}) {
5490
5483
  const t = new $(e), s = [
5491
5484
  t._plugin,
5492
- Kn(t),
5493
- Vn(t),
5494
- Qn(t),
5495
- ya(t),
5496
- jn(t),
5497
- Ka(t),
5498
- fa(t),
5499
- mo(t),
5500
- fr(t),
5501
- Fn(t),
5502
- ha(t),
5503
- go(t),
5485
+ qn(t),
5486
+ Zn(t),
5504
5487
  so(t),
5505
- Vs(t),
5506
- ln(t),
5507
- Wa(t),
5508
- Rn(t)
5488
+ Ca(t),
5489
+ Mn(t),
5490
+ qa(t),
5491
+ ba(t),
5492
+ vo(t),
5493
+ vr(t),
5494
+ Jn(t),
5495
+ Sa(t),
5496
+ wo(t),
5497
+ co(t),
5498
+ Qs(t),
5499
+ gn(t),
5500
+ Va(t),
5501
+ Bn(t)
5509
5502
  ].filter(R);
5510
5503
  return s.context = t, s;
5511
5504
  }
5512
- const Cc = {
5513
- initializeComponentDependencies: Ti,
5514
- updateLuminaTs: Xi,
5505
+ const Ic = {
5506
+ initializeComponentDependencies: ki,
5507
+ updateLuminaTs: es,
5515
5508
  propertyToAttributeMappings: W,
5516
- nativeEvents: ui,
5517
- svgElements: at,
5518
- mathMlElements: ct,
5519
- alwaysAttributes: li,
5520
- nativeAlwaysAttributes: di,
5509
+ nativeEvents: gi,
5510
+ svgElements: ct,
5511
+ mathMlElements: lt,
5512
+ alwaysAttributes: ui,
5513
+ nativeAlwaysAttributes: mi,
5521
5514
  htmlAlwaysAttributes: Qe
5522
5515
  };
5523
5516
  export {
5524
- Cc as exportsForCodemod,
5517
+ Ic as exportsForCodemod,
5525
5518
  De as inferCdnUrl,
5526
- Sc as useLumina
5519
+ kc as useLumina
5527
5520
  };