@arcgis/lumina-compiler 5.2.0-next.7 → 5.2.0-next.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +2 -2
  2. package/dist/context/index.d.ts +158 -296
  3. package/dist/context/types.d.ts +18 -34
  4. package/dist/defaultAssetsUrl.d.ts +6 -6
  5. package/dist/dependencies/discover.d.ts +43 -35
  6. package/dist/dependencies/updateLumina.d.ts +10 -11
  7. package/dist/docs/vsCodeCustomData/types.d.ts +5 -42
  8. package/dist/docs/webTypes/types.d.ts +5 -76
  9. package/dist/index.d.ts +20 -20
  10. package/dist/index.js +1294 -1265
  11. package/dist/jsxToLitHtml/config.d.ts +93 -121
  12. package/dist/{logger-C9XakOcA.js → logger-edpIalAo.js} +1 -1
  13. package/dist/options.d.ts +675 -0
  14. package/dist/puppeteerTesting/index.d.ts +18 -11
  15. package/dist/puppeteerTesting/index.js +105 -8
  16. package/dist/puppeteerTesting/puppeteer/element.d.ts +250 -217
  17. package/dist/puppeteerTesting/puppeteer/events.d.ts +15 -21
  18. package/dist/puppeteerTesting/puppeteer/page.d.ts +8 -5
  19. package/dist/puppeteerTesting/puppeteer/types.d.ts +130 -132
  20. package/dist/puppeteerTesting/vitest/matchers/index.d.ts +33 -30
  21. package/dist/testing/index.d.ts +4 -11
  22. package/dist/testing/mount.d.ts +113 -93
  23. package/dist/testing/wrapController.d.ts +5 -11
  24. package/dist/useLumina.d.ts +5 -2
  25. package/package.json +22 -11
  26. package/dist/context/logger.d.ts +0 -8
  27. package/dist/context/typeScript.d.ts +0 -6
  28. package/dist/context/utils.d.ts +0 -4
  29. package/dist/dependencies/arcgisCore.d.ts +0 -30
  30. package/dist/dependencies/index.d.ts +0 -12
  31. package/dist/dependencies/loaders.d.ts +0 -5
  32. package/dist/dependencies/lumina.d.ts +0 -3
  33. package/dist/dependencies/stencil.d.ts +0 -17
  34. package/dist/dependencies/testSetupFiles.d.ts +0 -13
  35. package/dist/dependencies/utils.d.ts +0 -15
  36. package/dist/docs/config.d.ts +0 -9
  37. package/dist/docs/index.d.ts +0 -10
  38. package/dist/docs/stencilDocsJson.d.ts +0 -130
  39. package/dist/docs/types.d.ts +0 -1
  40. package/dist/docs/vsCodeCustomData/index.d.ts +0 -16
  41. package/dist/docs/vsCodeCustomData/utils.d.ts +0 -3
  42. package/dist/docs/webTypes/description.d.ts +0 -2
  43. package/dist/docs/webTypes/index.d.ts +0 -19
  44. package/dist/docs/webTypes/utils.d.ts +0 -6
  45. package/dist/entrypoints/addNonLazyImports.d.ts +0 -13
  46. package/dist/entrypoints/config.d.ts +0 -17
  47. package/dist/entrypoints/dtsUtils.d.ts +0 -19
  48. package/dist/entrypoints/findUtils.d.ts +0 -6
  49. package/dist/entrypoints/handleComponentImports.d.ts +0 -13
  50. package/dist/entrypoints/resolveTagName.d.ts +0 -18
  51. package/dist/jsxToLitHtml/autoAddNothing.d.ts +0 -8
  52. package/dist/jsxToLitHtml/comments.d.ts +0 -19
  53. package/dist/jsxToLitHtml/convertProps.d.ts +0 -10
  54. package/dist/jsxToLitHtml/imports.d.ts +0 -27
  55. package/dist/jsxToLitHtml/importsConfig.d.ts +0 -17
  56. package/dist/jsxToLitHtml/index.d.ts +0 -20
  57. package/dist/jsxToLitHtml/inferPropType.d.ts +0 -40
  58. package/dist/jsxToLitHtml/insertRepeatCall.d.ts +0 -51
  59. package/dist/jsxToLitHtml/jsxVisitor.d.ts +0 -15
  60. package/dist/jsxToLitHtml/templateParts.d.ts +0 -17
  61. package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +0 -10
  62. package/dist/jsxToLitHtml/types.d.ts +0 -74
  63. package/dist/jsxToLitHtml/utils.d.ts +0 -14
  64. package/dist/loader/css.d.ts +0 -20
  65. package/dist/loader/extractor.d.ts +0 -2
  66. package/dist/loader/index.d.ts +0 -21
  67. package/dist/loader/lazy.d.ts +0 -21
  68. package/dist/loader/storybookApiJson.d.ts +0 -6
  69. package/dist/plugins/buildCdn.d.ts +0 -73
  70. package/dist/plugins/buildWebApp.d.ts +0 -3
  71. package/dist/plugins/buildWrappers.d.ts +0 -4
  72. package/dist/plugins/configureVite.d.ts +0 -20
  73. package/dist/plugins/externalizeDependencies.d.ts +0 -30
  74. package/dist/plugins/handleDynamicAssets.d.ts +0 -8
  75. package/dist/plugins/handleStaticAssets.d.ts +0 -9
  76. package/dist/plugins/loadLitCss.d.ts +0 -127
  77. package/dist/plugins/printTotalBuildSize.d.ts +0 -7
  78. package/dist/plugins/provideAssets.d.ts +0 -35
  79. package/dist/plugins/setAssetsPath.d.ts +0 -10
  80. package/dist/plugins/updatePackageJson.d.ts +0 -14
  81. package/dist/publicTypes.d.ts +0 -653
  82. package/dist/puppeteerTesting/globalSetup.d.ts +0 -73
  83. package/dist/puppeteerTesting/injected.d.ts +0 -8
  84. package/dist/puppeteerTesting/puppeteer/browser.d.ts +0 -6
  85. package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +0 -4
  86. package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +0 -4
  87. package/dist/puppeteerTesting/vitest/matchers/events.d.ts +0 -7
  88. package/dist/puppeteerTesting/vitest/matchers/text.d.ts +0 -2
  89. package/dist/puppeteerTesting/vitest/matchers/utils.d.ts +0 -1
  90. package/dist/puppeteerTesting/vitest/runner.d.ts +0 -19
  91. package/dist/puppeteerTesting/vitest/setupFile.d.ts +0 -1
  92. package/dist/puppeteerTesting/vitest/types.d.ts +0 -6
  93. package/dist/testing/failOnConsole.d.ts +0 -6
  94. package/dist/testing/setupFile.d.ts +0 -1
  95. package/dist/testing/snapshotSerializer.d.ts +0 -12
  96. package/dist/tests/utils.d.ts +0 -4
  97. package/dist/transformers/customElementDeclaration.d.ts +0 -2
  98. package/dist/transformers/index.d.ts +0 -20
  99. package/dist/transformers/injectRuntimeOptions.d.ts +0 -18
  100. package/dist/transformers/liftDecorators.d.ts +0 -21
  101. package/dist/transformers/members.d.ts +0 -10
  102. package/dist/transformers/property.d.ts +0 -10
  103. package/dist/transformers/propertyOptions.d.ts +0 -110
  104. package/dist/transformers/utils.d.ts +0 -9
package/dist/index.js CHANGED
@@ -1,27 +1,30 @@
1
- import { externalizeDependencies as cs, path as m, retrievePackageJson as O, fetchPackageLocation as Gt, asyncRetrievePackageJson as Xt, existsAsync as _, toPosixPathSeparators as ce, isPosix as Yt, toSystemPathSeparators as xe, getCwd as Qt } from "@arcgis/components-build-utils";
2
- import { isNotUndefined as F } from "@arcgis/toolkit/predicate";
3
- import { f as b, l as E } from "./logger-C9XakOcA.js";
1
+ import { externalizeDependencies as cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
2
+ import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
3
+ import { f as b, l as $ } from "./logger-edpIalAo.js";
4
4
  import o from "typescript";
5
- import { camelToKebab as Zt, getPreamble as ds, uncapitalize as gt, capitalize as ps } from "@arcgis/toolkit/string";
6
- import { lazyMetaSubItemJoiner as us, lazyMetaItemJoiner as De, lazyMetaGroupJoiner as ms, propertyFlagAttribute as ht, propertyFlagReflect as fs, propertyFlagBoolean as gs, propertyFlagNumber as hs, propertyFlagState as ys, propertyFlagReadOnly as vs, propertyFlagNoAccessor as bs, propertyFlagUseDefault as ws } from "@arcgis/lumina/config";
7
- import { isApiMethodAsync as Ss, globalPackageIdentifier as Es, isApiMethod as Cs, isApiProperty as Ts } from "@arcgis/api-extractor/utils/apiHelpers";
8
- import { readFile as H, readdir as tt, rm as $s, mkdir as G, cp as Ps, writeFile as U, copyFile as Is } from "node:fs/promises";
5
+ import { camelToKebab as Vt, getPreamble as ds, uncapitalize as gt, capitalize as ps } from "@arcgis/toolkit/string";
6
+ import { lazyMetaSubItemJoiner as ms, lazyMetaItemJoiner as De, lazyMetaGroupJoiner as us, propertyFlagAttribute as ht, propertyFlagReflect as fs, propertyFlagBoolean as gs, propertyFlagNumber as hs, propertyFlagState as ys, propertyFlagReadOnly as vs, propertyFlagNoAccessor as bs, propertyFlagUseDefault as ws } from "@arcgis/lumina/config";
7
+ import { path as u, isPosix as Gt, toPosixPathSeparators as ce, toSystemPathSeparators as Ae, getCwd as Xt } from "@arcgis/node-toolkit/path";
8
+ import { isApiMethodAsync as Ss, globalPackageIdentifier as Cs, isApiMethod as Es, isApiProperty as Ts } from "@arcgis/api-extractor/utils/apiHelpers";
9
+ import { existsAsync as K } from "@arcgis/node-toolkit/file";
10
+ import { readFile as z, readdir as et, mkdir as V, writeFile as _, copyFile as $s, rm as Ps, cp as Is } from "node:fs/promises";
11
+ import { retrievePackageJson as R, fetchPackageLocation as tt, asyncRetrievePackageJson as Yt } from "@arcgis/node-toolkit/packageJson";
9
12
  import { build as ks } from "esbuild";
10
- import { glob as xs } from "tinyglobby";
13
+ import xs from "mime-types";
14
+ import { forEachWithConcurrency as As } from "@arcgis/toolkit/promise";
15
+ import { glob as Ls } from "tinyglobby";
11
16
  import { renameComponentFolder as We } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
12
- import { useApiExtractor as As } from "@arcgis/api-extractor/vite/plugin";
13
- import Ns from "mime-types";
14
- import { forEachWithConcurrency as Ls } from "@arcgis/toolkit/promise";
15
- import { writeFileSync as ei } from "node:fs";
17
+ import { useApiExtractor as Ns } from "@arcgis/api-extractor/vite/plugin";
18
+ import { writeFileSync as Qt } from "node:fs";
16
19
  import { styleText as js } from "node:util";
17
20
  import { unsafeGetUndocumentedPrinter as Fs, unsafeUndocumentedTs as yt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
18
- import { pathIsComponentEntrypoint as Ee } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
21
+ import { pathIsComponentEntrypoint as Ce } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
19
22
  import { loadApiExtractorConfig as Ds, mergeApiExtractorConfigs as vt } from "@arcgis/api-extractor/extractor/config";
20
23
  import { loadTypeScriptConfig as Rs } from "@arcgis/api-extractor/vite/typeScript";
21
24
  import { mappedFind as ze } from "@arcgis/toolkit/array";
22
- import { isPropertyEscapeNeeded as ti, maybeEscapePropertyName as Os } from "@arcgis/api-extractor/utils/partPrinter";
23
- import { getPackageNameFromExternalSpecifier as Ms, getMemberName as ii } from "@arcgis/api-extractor/utils/astHelpers";
24
- import { identity as si } from "@arcgis/toolkit/function";
25
+ import { isPropertyEscapeNeeded as Zt, maybeEscapePropertyName as Os } from "@arcgis/api-extractor/utils/partPrinter";
26
+ import { getPackageNameFromExternalSpecifier as Ms, getMemberName as ei } from "@arcgis/api-extractor/utils/astHelpers";
27
+ import { identity as ti } from "@arcgis/toolkit/function";
25
28
  function Js(e) {
26
29
  const t = e.options?.build?.dependencies ?? {}, i = cs({
27
30
  bundleIn: t.bundleIn,
@@ -39,7 +42,7 @@ function Js(e) {
39
42
  e.isInStorybook && (i.resolveId = void 0);
40
43
  }, i;
41
44
  }
42
- const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__PURE__ */ Symbol("dynamic html tag name"), He = /* @__PURE__ */ Symbol("dynamic svg tag name"), ri = /* @__PURE__ */ new Set([
45
+ const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ee = /* @__PURE__ */ Symbol("dynamic html tag name"), He = /* @__PURE__ */ Symbol("dynamic svg tag name"), ii = /* @__PURE__ */ new Set([
43
46
  /**
44
47
  * There is a "className" property. However, in JSX typings we use "class"
45
48
  * instead to keep name shorter and to match Stencil's name. Thus, it should
@@ -51,7 +54,7 @@ const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__P
51
54
  *
52
55
  * This is named itemid rather than itemId to avoid conflict with the itemfid
53
56
  * prop in arcgis-map, arcgis-scene, arcgis-embeddable-map, and dashboards.
54
- * See https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/6903
57
+ * See https://devtopia.esri.com/WebGIS/webgis-sdk/issues/6903
55
58
  *
56
59
  * The other microdata are lowercase for consistency and to avoid similar
57
60
  * conflicts.
@@ -71,7 +74,7 @@ const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__P
71
74
  "vocab",
72
75
  // These don't exist as a property, only as an attribute
73
76
  "exportParts"
74
- ]), ni = /* @__PURE__ */ new Set([
77
+ ]), si = /* @__PURE__ */ new Set([
75
78
  /*
76
79
  * From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
77
80
  * See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
@@ -97,7 +100,7 @@ const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__P
97
100
  meta: /* @__PURE__ */ new Set(["charset"]),
98
101
  math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
99
102
  menu: /* @__PURE__ */ new Set(["label", "type"])
100
- }, W = {
103
+ }, U = {
101
104
  common: {
102
105
  reflected: {
103
106
  hidden: "hidden",
@@ -910,9 +913,9 @@ const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__P
910
913
  }
911
914
  }
912
915
  };
913
- oi(W.common);
914
- Object.values(W.perElement).forEach(oi);
915
- function oi(e) {
916
+ ri(U.common);
917
+ Object.values(U.perElement).forEach(ri);
918
+ function ri(e) {
916
919
  e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
917
920
  /* @__PURE__ */ Object.create(null),
918
921
  e.stringifiedReflected
@@ -921,7 +924,7 @@ function oi(e) {
921
924
  e.stringifiedNonReflected
922
925
  ));
923
926
  }
924
- const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set([
927
+ const bt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set([
925
928
  "abort",
926
929
  "animationCancel",
927
930
  "animationEnd",
@@ -1144,9 +1147,9 @@ function Ws(e) {
1144
1147
  const t = e[0];
1145
1148
  if (e.includes(`
1146
1149
  `)) {
1147
- const r = t === `
1148
- `, n = e.lastIndexOf(`
1149
- `), c = e.slice(n + 1).trim().length === 0, d = r ? e.trimStart() : e;
1150
+ const n = t === `
1151
+ `, r = e.lastIndexOf(`
1152
+ `), c = e.slice(r + 1).trim().length === 0, d = n ? e.trimStart() : e;
1150
1153
  return c ? d.trimEnd() : d;
1151
1154
  }
1152
1155
  return e.trim().length === 0 ? t : e;
@@ -1155,7 +1158,7 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1155
1158
  "&": "&",
1156
1159
  "<": "&lt;",
1157
1160
  ">": "&gt;"
1158
- }, li = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], se = "staticHtml", X = "staticSvg", re = "html", ee = "svg", ci = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), di = "css", pi = "mathml", ui = [di, re, pi, se, X, ee], Qs = new Set(ui), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...ui, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => pe(t)), pe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1161
+ }, oi = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], se = "staticHtml", G = "staticSvg", re = "html", ee = "svg", ai = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), li = "css", ci = "mathml", di = [li, re, ci, se, G, ee], Qs = new Set(di), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...di, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1159
1162
  [re]: ["lit", "lit/html.js", "lit-html"],
1160
1163
  /**
1161
1164
  * Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
@@ -1165,9 +1168,9 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1165
1168
  */
1166
1169
  [se]: ["lit/static-html.js", "lit-html/static.js"],
1167
1170
  [ee]: ["lit", "lit-html", "lit/html.js"],
1168
- [X]: ["lit/static-html.js", "lit-html/static.js"],
1169
- [pi]: ["lit", "lit-html", "lit/html.js"],
1170
- [di]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1171
+ [G]: ["lit/static-html.js", "lit-html/static.js"],
1172
+ [ci]: ["lit", "lit-html", "lit/html.js"],
1173
+ [li]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1171
1174
  safeClassMap: ["@arcgis/lumina"],
1172
1175
  safeStyleMap: ["@arcgis/lumina"],
1173
1176
  deferLoad: ["@arcgis/lumina"],
@@ -1187,11 +1190,11 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1187
1190
  "bindProperty",
1188
1191
  "bindEvent",
1189
1192
  "bindAttribute"
1190
- ]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", Te = "?litCss", Y = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
1193
+ ]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", Te = "?litCss", X = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
1191
1194
  name: oe,
1192
1195
  enforce: "pre",
1193
1196
  configResolved(t) {
1194
- const i = t.plugins.find(({ name: n }) => n === "vite:css-post");
1197
+ const i = t.plugins.find(({ name: r }) => r === "vite:css-post");
1195
1198
  if (i === void 0)
1196
1199
  throw Error(
1197
1200
  b(
@@ -1207,32 +1210,32 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1207
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."
1208
1211
  )
1209
1212
  );
1210
- const r = Object.keys(s).filter((n) => n !== "filter");
1211
- if (r.length !== 1)
1213
+ const n = Object.keys(s).filter((r) => r !== "filter");
1214
+ if (n.length !== 1)
1212
1215
  throw Error(
1213
1216
  b(
1214
1217
  oe,
1215
- `Expected vite:css-post's transform handler to have only a single property: handler. Found: ${r.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.`
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.`
1216
1219
  )
1217
1220
  );
1218
1221
  i.transform = {
1219
1222
  ...s,
1220
1223
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1221
- async handler(n, a) {
1224
+ async handler(r, a) {
1222
1225
  const c = a.endsWith(Te);
1223
1226
  c && (a = a.slice(0, -Te.length));
1224
- const d = a.endsWith(Y);
1225
- d && (a = a.slice(0, -Y.length));
1227
+ const d = a.endsWith(X);
1228
+ d && (a = a.slice(0, -X.length));
1226
1229
  const l = a.endsWith(Ve);
1227
1230
  if (l && (a = a.slice(0, -Ve.length)), !c && !d && !l)
1228
- return await s.handler.call(this, n, a);
1229
- const p = `${a}?inline`, u = await s.handler.call(this, n, p), { code: f, ...g } = typeof u == "string" ? { code: u } : u ?? {};
1230
- return typeof f != "string" || !f.startsWith(mi) || !f.endsWith(or) ? (E.warn(
1231
+ return await s.handler.call(this, r, a);
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(pi) || !f.endsWith(or) ? ($.warn(
1231
1234
  oe,
1232
1235
  `Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
1233
1236
  f
1234
1237
  )}`
1235
- ), u) : l ? (e._globalCssString = fi(f), { code: "", map: { mappings: "" } }) : {
1238
+ ), m) : l ? (e._globalCssString = mi(f), { code: "", map: { mappings: "" } }) : {
1236
1239
  ...g,
1237
1240
  code: dr(f, e.hmrEnabled, e.shouldMinify, d),
1238
1241
  /**
@@ -1244,7 +1247,7 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1244
1247
  }
1245
1248
  };
1246
1249
  }
1247
- }), mi = 'export default "', or = '"', ar = `import { css } from '${te.css[0]}';
1250
+ }), pi = 'export default "', or = '"', ar = `import { css } from '${te.css[0]}';
1248
1251
  export const styles = css\``, lr = "`;\nexport default styles;", cr = `
1249
1252
 
1250
1253
  if(import.meta.hot) {
@@ -1256,19 +1259,19 @@ if(import.meta.hot) {
1256
1259
  }
1257
1260
  import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
1258
1261
  });
1259
- }`, fi = (e) => e.slice(mi.length - 1);
1262
+ }`, mi = (e) => e.slice(pi.length - 1);
1260
1263
  function dr(e, t, i, s) {
1261
- const r = fi(e), n = JSON.parse(r), a = zs(n), c = s ? `@layer{${i ? "" : `
1264
+ const n = mi(e), r = JSON.parse(n), a = zs(r), c = s ? `@layer{${i ? "" : `
1262
1265
  `}${a}${i ? "" : `
1263
1266
  `}}` : a;
1264
1267
  return `${ar}${c}${lr}${t ? cr : ""}`;
1265
1268
  }
1266
1269
  function pr(e) {
1267
- return `import("${ur}").then(({ setCustomElementsManifest }) => {
1268
- setCustomElementsManifest(${mr(e)});
1270
+ return `import("${mr}").then(({ setCustomElementsManifest }) => {
1271
+ setCustomElementsManifest(${ur(e)});
1269
1272
  });`;
1270
1273
  }
1271
- const ur = "@storybook/web-components-vite", mr = (e) => `JSON.parse(\`${fr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1274
+ const mr = "@storybook/web-components-vite", ur = (e) => `JSON.parse(\`${fr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1272
1275
  function fr(e) {
1273
1276
  return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
1274
1277
  }
@@ -1277,25 +1280,25 @@ function gr(e) {
1277
1280
  const t = e.options.css?.globalStylesPath;
1278
1281
  if (t === void 0)
1279
1282
  return "";
1280
- const i = m.join(e.dir.root, t);
1283
+ const i = u.join(e.dir.root, t);
1281
1284
  return e.viteCommand === "serve" || e.isInStorybook ? [
1282
- `import globalStyles from "${i}${Y}";`,
1285
+ `import globalStyles from "${i}${X}";`,
1283
1286
  "document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
1284
- hi("", e)
1287
+ fi("", e)
1285
1288
  ].join(`
1286
1289
  `) : `import "${i}${Ve}";`;
1287
1290
  }
1288
- const gi = "hydrated";
1291
+ const ui = "hydrated";
1289
1292
  function hr(e) {
1290
1293
  e._globalHydratedCssString = [
1291
1294
  ":not([",
1292
- e.options.css?.hydratedAttribute ?? gi,
1295
+ e.options.css?.hydratedAttribute ?? ui,
1293
1296
  "]):is(",
1294
1297
  e.apiJsonComponents.map((t) => t.tagName).join(","),
1295
1298
  "){visibility:hidden}"
1296
1299
  ].join("");
1297
1300
  }
1298
- function hi(e, t) {
1301
+ function fi(e, t) {
1299
1302
  return [
1300
1303
  "const globalCss = new CSSStyleSheet;",
1301
1304
  `globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
@@ -1311,8 +1314,8 @@ const yr = (e) => `@layer{${e.shouldMinify ? "" : `
1311
1314
  function vr(e) {
1312
1315
  const t = [], i = [];
1313
1316
  for (const s of e.privateApiJson.modules)
1314
- for (const r of s.declarations)
1315
- r.customElement === !0 && (i.push(br(r, e, s.sourcePath)), t.push(s.sourcePath));
1317
+ for (const n of s.declarations)
1318
+ n.customElement === !0 && (i.push(br(n, e, s.sourcePath)), t.push(s.sourcePath));
1316
1319
  return [
1317
1320
  'import { runtime } from "./runtime.ts";',
1318
1321
  'import { makeDefineCustomElements } from "@arcgis/lumina";',
@@ -1325,46 +1328,46 @@ function vr(e) {
1325
1328
  i.join(`,
1326
1329
  `),
1327
1330
  "});",
1328
- e.hmrEnabled ? Er(t) : ""
1331
+ e.hmrEnabled ? Cr(t) : ""
1329
1332
  ].join(`
1330
1333
  `);
1331
1334
  }
1332
1335
  const br = (e, t, i) => [
1333
1336
  ` "${e.tagName}": [`,
1334
- `()=>import("${m.join(t.dir.root, i)}"),`,
1337
+ `()=>import("${u.join(t.dir.root, i)}"),`,
1335
1338
  wr(e),
1336
1339
  "]"
1337
1340
  ].join("");
1338
1341
  function wr(e) {
1339
- const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: r } = yi(e), n = t.map((g) => g.join(us)).join(De), a = i.join(De), c = s.join(De), d = [n, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
1340
- return `${p.length > 0 || r ? `"${p.join(ms)}"` : ""}${r ? ",1" : ""}`;
1342
+ const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = gi(e), r = t.map((g) => g.join(ms)).join(De), a = i.join(De), c = s.join(De), 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(us)}"` : ""}${n ? ",1" : ""}`;
1341
1344
  }
1342
- function yi(e) {
1345
+ function gi(e) {
1343
1346
  const t = [], i = [], s = [];
1344
- for (let n = 0; n < e.members.length; ++n) {
1345
- const a = e.members[n];
1347
+ for (let r = 0; r < e.members.length; ++r) {
1348
+ const a = e.members[r];
1346
1349
  if (a.kind === "field") {
1347
- const c = typeof a.attribute == "string", d = c && a.attribute !== Zt(a.name);
1350
+ const c = typeof a.attribute == "string", d = c && a.attribute !== Vt(a.name);
1348
1351
  t.push(
1349
1352
  c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
1350
1353
  );
1351
1354
  } else a.kind === "method" && a.name !== "componentOnReady" && (Ss(a) ? i.push(a.name) : s.push(a.name));
1352
1355
  }
1353
- const r = e.formAssociated === !0;
1354
- return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: r };
1356
+ const n = e.formAssociated === !0;
1357
+ return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: n };
1355
1358
  }
1356
1359
  const Sr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
1357
- `, Er = (e) => `
1360
+ `, Cr = (e) => `
1358
1361
  if(import.meta.hot) {
1359
1362
  import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
1360
1363
  import.meta.hot.accept([
1361
1364
  ${e.map((t) => ` "/${t}",`).join(`
1362
1365
  `)}
1363
1366
  ], handleHmrUpdate);
1364
- }`, Cr = "@arcgis/lumina-compiler", vi = {
1365
- name: Cr
1367
+ }`, Er = "@arcgis/lumina-compiler", hi = {
1368
+ name: Er
1366
1369
  };
1367
- async function bi(e, t) {
1370
+ async function yi(e, t) {
1368
1371
  return ie ??= $r(e, t), await ie;
1369
1372
  }
1370
1373
  function Tr() {
@@ -1377,7 +1380,7 @@ function Tr() {
1377
1380
  );
1378
1381
  return $e;
1379
1382
  }
1380
- function wi() {
1383
+ function vi() {
1381
1384
  if (Ge === void 0)
1382
1385
  throw Error(
1383
1386
  b(
@@ -1388,9 +1391,9 @@ function wi() {
1388
1391
  return Ge;
1389
1392
  }
1390
1393
  async function $r(e, t) {
1391
- const i = O(e), s = i.dependencies ?? {}, r = i.peerDependencies ?? {}, a = (await Promise.all(
1392
- [...Object.keys(s), ...Object.keys(r)].filter((l) => !Pr.has(l)).flatMap(async (l) => await Si(l, e))
1393
- )).filter(F);
1394
+ const i = R(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
1395
+ [...Object.keys(s), ...Object.keys(n)].filter((l) => !Pr.has(l)).flatMap(async (l) => await bi(l, e))
1396
+ )).filter(j);
1394
1397
  $e ??= a, Ge = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
1395
1398
  const c = t?.serve?.extraDependencies?.map(
1396
1399
  (l) => typeof l == "string" ? l : l.name
@@ -1399,7 +1402,7 @@ async function $r(e, t) {
1399
1402
  }
1400
1403
  const Pr = /* @__PURE__ */ new Set([
1401
1404
  "@arcgis/arcade-languageservice",
1402
- "@arcgis/components-build-utils",
1405
+ "@arcgis/node-toolkit",
1403
1406
  "@arcgis/toolkit",
1404
1407
  "@arcgis/core",
1405
1408
  "@arcgis/languages-api-utils",
@@ -1409,6 +1412,7 @@ const Pr = /* @__PURE__ */ new Set([
1409
1412
  "@custom-elements-manifest/analyzer",
1410
1413
  "@esri/calcite-ui-icons",
1411
1414
  "@floating-ui/dom",
1415
+ "@floating-ui/utils",
1412
1416
  "@lit-labs/ssr",
1413
1417
  "@lit/context",
1414
1418
  "@lit-labs/ssr-client",
@@ -1419,6 +1423,7 @@ const Pr = /* @__PURE__ */ new Set([
1419
1423
  "composed-offset-position",
1420
1424
  "custom-elements-manifest",
1421
1425
  "dayjs",
1426
+ "es-toolkit",
1422
1427
  "focus-trap",
1423
1428
  "interactjs",
1424
1429
  "lit",
@@ -1426,6 +1431,7 @@ const Pr = /* @__PURE__ */ new Set([
1426
1431
  "monaco-editor",
1427
1432
  "sortablejs",
1428
1433
  "storybook",
1434
+ "tabbable",
1429
1435
  "timezone-groups",
1430
1436
  "type-fest",
1431
1437
  "tslib",
@@ -1434,39 +1440,39 @@ const Pr = /* @__PURE__ */ new Set([
1434
1440
  "vscode-languageserver-types"
1435
1441
  ]);
1436
1442
  let $e, Ge, ie;
1437
- async function Si(e, t) {
1438
- const i = await Gt(e, t), s = await Xt(i), r = "exports" in s, n = Or.bind(void 0, r), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = m.join(i, "dist/esm/loader.js");
1439
- if (a ? await _(c) : !1) {
1440
- const g = await H(c, "utf8"), h = Ir(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), C = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
1443
+ async function bi(e, t) {
1444
+ const i = await tt(e, t), s = await Yt(i), n = "exports" in s, r = Or.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
1445
+ if (a ? await K(c) : !1) {
1446
+ const g = await z(c, "utf8"), h = Ir(g, "bootstrapLazy("), v = g.indexOf(", options", h), y = g.slice(h, v), S = y.startsWith('JSON.parse("') ? y.slice(12, -2).replaceAll('\\"', '"') : y;
1441
1447
  try {
1442
- const S = JSON.parse(C), k = Dr(S, { packageName: e, getImportPath: n });
1443
- return { packageName: e, type: "stencil", components: k, packageLocation: i, packageJson: s };
1444
- } catch (S) {
1445
- E.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
1446
- Error: ${String(S)}`);
1448
+ const C = JSON.parse(S), E = Dr(C, { packageName: e, getImportPath: r });
1449
+ return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
1450
+ } catch (C) {
1451
+ $.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
1452
+ Error: ${String(C)}`);
1447
1453
  }
1448
1454
  }
1449
1455
  const l = wt(s.customElements);
1450
1456
  if (l != null) {
1451
- const g = m.join(i, l), h = JSON.parse(await H(g, "utf-8")), y = kr(h), v = Ei(h, {
1457
+ const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), v = kr(h), y = wi(h, {
1452
1458
  packageName: e,
1453
- getImportPath: n
1459
+ getImportPath: r
1454
1460
  });
1455
- return { type: y ? "@arcgis/lumina" : "unknown", packageName: e, components: v, packageLocation: i, packageJson: s };
1461
+ return { type: v ? "@arcgis/lumina" : "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
1456
1462
  }
1457
1463
  const p = wt(s["web-types"]);
1458
1464
  if (p != null) {
1459
- const g = m.join(i, p), h = JSON.parse(await H(g, "utf-8")), y = xr(h, {
1465
+ const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), v = xr(h, {
1460
1466
  packageName: e,
1461
- getImportPath: n
1467
+ getImportPath: r
1462
1468
  });
1463
- return { type: "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
1469
+ return { type: "unknown", packageName: e, components: v, packageLocation: i, packageJson: s };
1464
1470
  }
1465
- const u = m.join(i, "dist/components");
1466
- if (await _(u)) {
1467
- const g = await Rr(u, {
1471
+ const m = u.join(i, "dist/components");
1472
+ if (await K(m)) {
1473
+ const g = await Rr(m, {
1468
1474
  packageName: e,
1469
- getImportPath: n
1475
+ getImportPath: r
1470
1476
  });
1471
1477
  return { type: "unknown", packageName: e, components: g, packageLocation: i, packageJson: s };
1472
1478
  }
@@ -1476,24 +1482,24 @@ function Ir(e, t) {
1476
1482
  const i = e.indexOf(t);
1477
1483
  return i === -1 ? -1 : i + t.length;
1478
1484
  }
1479
- function Ei(e, t, i = !1) {
1485
+ function wi(e, t, i = !1) {
1480
1486
  const s = /* @__PURE__ */ Object.create(null);
1481
1487
  if (e.modules === void 0)
1482
1488
  return s;
1483
- for (let r = 0; r < e.modules.length; ++r) {
1484
- const n = e.modules[r];
1485
- if (n.declarations !== void 0)
1486
- for (let a = 0; a < n.declarations.length; ++a) {
1487
- const d = n.declarations[a];
1489
+ for (let n = 0; n < e.modules.length; ++n) {
1490
+ const r = e.modules[n];
1491
+ if (r.declarations !== void 0)
1492
+ for (let a = 0; a < r.declarations.length; ++a) {
1493
+ const d = r.declarations[a];
1488
1494
  if (d.customElement !== !0)
1489
1495
  continue;
1490
1496
  const l = (
1491
1497
  // New api.json
1492
- "sourcePath" in n ? n.path : (
1498
+ "sourcePath" in r ? r.path : (
1493
1499
  // Older api.json
1494
1500
  "importPath" in d && typeof d.importPath == "string" ? d.importPath : void 0
1495
1501
  )
1496
- ), p = d.tagName, u = {
1502
+ ), p = d.tagName, m = {
1497
1503
  packageName: t.packageName,
1498
1504
  modulePath: l ?? t.getImportPath(p),
1499
1505
  propToAttribute: Object.fromEntries(
@@ -1501,13 +1507,13 @@ function Ei(e, t, i = !1) {
1501
1507
  ),
1502
1508
  requiredProperties: void 0
1503
1509
  };
1504
- if (s[p] = u, i && d.members !== void 0) {
1510
+ if (s[p] = m, i && d.members !== void 0) {
1505
1511
  const f = /* @__PURE__ */ new Set();
1506
1512
  for (let g = 0; g < d.members.length; ++g) {
1507
1513
  const h = d.members[g];
1508
- h.kind === "field" && h.docsTags?.some((y) => y.name === "required") === !0 && f.add(h.name);
1514
+ h.kind === "field" && h.docsTags?.some((v) => v.name === "required") === !0 && f.add(h.name);
1509
1515
  }
1510
- f.size > 0 && (u.requiredProperties = f);
1516
+ f.size > 0 && (m.requiredProperties = f);
1511
1517
  }
1512
1518
  }
1513
1519
  }
@@ -1516,7 +1522,7 @@ function Ei(e, t, i = !1) {
1516
1522
  const kr = (e) => (
1517
1523
  // Since 5.0
1518
1524
  e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
1519
- e.compiler?.name === vi.name
1525
+ e.compiler?.name === hi.name
1520
1526
  ), xr = (e, t) => Object.fromEntries(
1521
1527
  (e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
1522
1528
  (i) => [
@@ -1528,14 +1534,14 @@ const kr = (e) => (
1528
1534
  }
1529
1535
  ]
1530
1536
  ) ?? []
1531
- ), Ar = 1, Nr = 2, Lr = 4, jr = 8, Fr = Ar | Nr | Lr | jr, Dr = (e, t) => Object.fromEntries(
1537
+ ), Ar = 1, Lr = 2, Nr = 4, jr = 8, Fr = Ar | Lr | Nr | jr, Dr = (e, t) => Object.fromEntries(
1532
1538
  e.flatMap(
1533
1539
  ([i, s]) => s.map(
1534
- ([r, n, a]) => [
1535
- n,
1540
+ ([n, r, a]) => [
1541
+ r,
1536
1542
  {
1537
1543
  packageName: t.packageName,
1538
- modulePath: t.getImportPath(n),
1544
+ modulePath: t.getImportPath(r),
1539
1545
  propToAttribute: Object.fromEntries(
1540
1546
  Object.entries(a ?? {}).filter(([c, [d]]) => d & Fr).map(([c, [d, l = c]]) => [c, l])
1541
1547
  )
@@ -1544,7 +1550,7 @@ const kr = (e) => (
1544
1550
  )
1545
1551
  )
1546
1552
  ), Rr = async (e, t) => Object.fromEntries(
1547
- (await tt(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
1553
+ (await et(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
1548
1554
  const s = i.slice(0, -5);
1549
1555
  return [
1550
1556
  s,
@@ -1556,18 +1562,124 @@ const kr = (e) => (
1556
1562
  ];
1557
1563
  })
1558
1564
  ), Or = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Mr = (e) => e.startsWith("/") ? e : `/${e}`, nt = (e, t) => `${e}@fs${Mr(t)}`;
1559
- function Ci(e) {
1565
+ function Si(e) {
1560
1566
  const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
1561
1567
  return i === "latest" ? "esnext" : i;
1562
1568
  }
1563
- const Xe = "@arcgis/core", Me = O(), Ae = Xe in (Me.dependencies ?? {}) || Xe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1569
+ const Xe = "@arcgis/lumina:provideAssets";
1570
+ function Z(e, t, i = ot) {
1571
+ if (e.viteCommand !== "serve")
1572
+ throw Error(b(Xe, "serveAssets() is only available when Vite is running in serve mode"));
1573
+ const s = e._serverConfigured, n = e.server.middlewares.stack.length;
1574
+ if (t.forEach((r) => {
1575
+ const a = Ei(r), c = $i(e.dir, Ti(a)), d = Br(e.viteConfig.base, c, e.dir.distCdn);
1576
+ e.server.middlewares.use(d, (l, p, m) => {
1577
+ const f = Kr(l.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), v = i.find((y) => y.match(h, e));
1578
+ return (typeof g == "function" ? Promise.resolve(g()) : z(g)).then((y) => {
1579
+ const S = (typeof g == "function" ? void 0 : v?.transform(y.toString("utf8"), h, e)) ?? y;
1580
+ p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", xs.lookup(f) || "application/octet-stream"), p.write(S), p.end();
1581
+ }).catch((y) => {
1582
+ (a.type !== "directory" || process.env.DEBUG) && $.warn(
1583
+ Xe,
1584
+ `Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? f}":${String(y)}`
1585
+ ), m();
1586
+ }), !0;
1587
+ });
1588
+ }), s) {
1589
+ const r = e.server.middlewares.stack.splice(n);
1590
+ e.server.middlewares.stack.splice(0, 0, ...r);
1591
+ }
1592
+ }
1593
+ async function Ci(e, t, i = ot) {
1594
+ await Promise.all(
1595
+ t.map(async (s) => {
1596
+ const n = Ei(s), r = $i(e.dir, Ti(n));
1597
+ if (n.type === "directory") {
1598
+ const a = u.resolve(n.source), d = (await et(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
1599
+ const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
1600
+ return [p, f];
1601
+ });
1602
+ await Ii(d.map(([l, p]) => p)), await As(
1603
+ d,
1604
+ 16,
1605
+ async ([l, p]) => await St(l, p, i, e)
1606
+ );
1607
+ } else if (n.type === "file")
1608
+ await V(u.dirname(r), { recursive: !0 }), await St(n.source, r, i, e);
1609
+ else if (n.type === "dynamic") {
1610
+ await V(u.dirname(r), { recursive: !0 });
1611
+ const a = await Promise.resolve(n.source());
1612
+ await _(r, a);
1613
+ }
1614
+ })
1615
+ );
1616
+ }
1617
+ const Ei = Gt ? (e) => e : (e) => e.type === "dynamic" ? {
1618
+ ...e,
1619
+ destination: ce(e.destination)
1620
+ } : {
1621
+ ...e,
1622
+ source: ce(e.source),
1623
+ destination: ce(e.destination)
1624
+ };
1625
+ async function St(e, t, i, s) {
1626
+ const n = i.find((r) => r.match(t, s));
1627
+ if (n === void 0)
1628
+ await $s(e, t);
1629
+ else {
1630
+ const r = await z(e, "utf8"), a = n.transform(r, t, s);
1631
+ await _(t, a);
1632
+ }
1633
+ }
1634
+ function Ti(e) {
1635
+ if (e.type === "dynamic")
1636
+ return e.destination;
1637
+ if (e.source.endsWith(u.sep)) {
1638
+ if (e.type === "file")
1639
+ throw Error(
1640
+ b(
1641
+ Xe,
1642
+ `Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${Ae(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
1643
+ )
1644
+ );
1645
+ return e.destination;
1646
+ }
1647
+ 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;
1648
+ }
1649
+ function $i({ dist: e, distCdnAssets: t }, i) {
1650
+ const s = Jr(i), n = u.join(
1651
+ t,
1652
+ s ? u.relative(t, i) : i
1653
+ ), r = u.relative(e, n), a = Pi(r);
1654
+ return u.join(e, a);
1655
+ }
1656
+ function Jr(e) {
1657
+ if (e.startsWith(u.sep)) {
1658
+ const t = Xt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
1659
+ return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
1660
+ } else
1661
+ return !!(!Gt && u.isAbsolute(e));
1662
+ }
1663
+ function Br(e, t, i) {
1664
+ const s = Pi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
1665
+ return `${e}${n}`;
1666
+ }
1667
+ const Pi = (e) => e.replaceAll("../", ""), Kr = (e = "") => e.split("?")[0].split("#")[0];
1668
+ async function Ii(e) {
1669
+ const t = new Set(e.map(u.dirname));
1670
+ await Promise.all(Array.from(t, async (i) => await V(i, { recursive: !0 })));
1671
+ }
1672
+ const _r = {
1673
+ match: (e, t) => t.environment === "production" && e.endsWith(".json"),
1674
+ transform: (e) => JSON.stringify(JSON.parse(e))
1675
+ }, ot = [_r], Pe = "@arcgis/core", ki = "@arcgis/core/assets", Me = R(), ue = Pe in (Me.dependencies ?? {}) || Pe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1564
1676
  Me.name === "@arcgis/lumina";
1565
- async function Jr(e, t, i) {
1566
- if (!Ae)
1677
+ async function Ur(e, t, i) {
1678
+ if (!ue)
1567
1679
  return [];
1568
- const s = await Gt(Xe);
1680
+ const s = await tt(Pe);
1569
1681
  if (t === "cdn") {
1570
- const r = await Xt(s), n = Ne({ name: "", version: r.version }, i);
1682
+ const n = await Yt(s), r = Le({ name: "", version: n.version }, i);
1571
1683
  return [
1572
1684
  // Use the ESM CDN
1573
1685
  // <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
@@ -1578,47 +1690,78 @@ async function Jr(e, t, i) {
1578
1690
  },
1579
1691
  children: JSON.stringify({
1580
1692
  imports: {
1581
- "@arcgis/core/": `${n}@arcgis/core/`
1693
+ "@arcgis/core/": `${r}@arcgis/core/`
1582
1694
  }
1583
1695
  })
1584
1696
  },
1585
1697
  // <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
1586
- St(n)
1698
+ xi(r)
1587
1699
  ];
1588
1700
  } else
1589
- return [St(nt(e, `${s}/assets/`))];
1701
+ return Wr(e, s);
1590
1702
  }
1591
- const St = (e) => ({
1703
+ function Wr(e, t) {
1704
+ const i = `${e}${ki}`;
1705
+ return [
1706
+ // Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
1707
+ // Core's prebuilt JavaScript assets use the untransformed route configured below.
1708
+ xi(nt(e, `${t}/assets/`)),
1709
+ {
1710
+ // This import is injected dynamically, so external consumers must tell Vite to optimize it. Within the monorepo,
1711
+ // configureVite excludes this exact import to keep the app and this assignment on the same core config instance.
1712
+ optimizableImports: ["@arcgis/core/config.js"],
1713
+ javascriptCode: [
1714
+ 'import esriConfig from "@arcgis/core/config.js";',
1715
+ `esriConfig.assetsPath = ${JSON.stringify(i)};`
1716
+ ]
1717
+ }
1718
+ ];
1719
+ }
1720
+ async function zr(e) {
1721
+ const t = await tt(Pe);
1722
+ Z(
1723
+ e,
1724
+ [
1725
+ {
1726
+ type: "directory",
1727
+ source: u.join(t, "assets", u.sep),
1728
+ destination: `../${ki}`
1729
+ }
1730
+ ],
1731
+ []
1732
+ );
1733
+ }
1734
+ const xi = (e) => ({
1592
1735
  // Not using join() because it would turn https:// into https:/
1593
1736
  cssHref: `${e}esri/themes/light/main.css`,
1594
1737
  // This is used be the theme switcher in `@arcgis/storybook-utils`
1595
1738
  id: "arcgisCoreStylesheet"
1596
- }), ot = "customElement.js";
1597
- function Br(e, t) {
1739
+ }), at = "customElement.js";
1740
+ function Hr(e, t) {
1598
1741
  if (!t.startsWith(e))
1599
1742
  return t;
1600
- const s = t.split(m.sep);
1601
- return s.at(Kr) !== s.at(_r) ? t : m.join(s.slice(0, -1).join(m.sep), ot);
1602
- }
1603
- const Kr = -1, _r = -2, Ur = /["']\.\.?\/[^'"]+/gu, Wr = (e, t, i, s) => e.replaceAll(Ur, (r) => {
1604
- const n = r.slice(1);
1605
- if (!n.startsWith("./") && !n.startsWith("../"))
1606
- return r;
1607
- const a = m.join(s, n), c = !n.endsWith(".js") && !n.split("/").at(-1).includes(".") ? Br(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
1743
+ const s = t.split(u.sep);
1744
+ return s.at(qr) !== s.at(Vr) ? t : u.join(s.slice(0, -1).join(u.sep), at);
1745
+ }
1746
+ const qr = -1, Vr = -2, Gr = /["']\.\.?\/[^'"]+/gu, Xr = (e, t, i, s) => e.replaceAll(Gr, (n) => {
1747
+ const r = n.slice(1);
1748
+ if (!r.startsWith("./") && !r.startsWith("../"))
1749
+ return n;
1750
+ const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Hr(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
1608
1751
  if (i === s && a === d)
1609
- return r;
1610
- const l = fe(i, d), p = r.endsWith("/") ? `${l}/` : l;
1611
- return `${r[0]}${p}`;
1752
+ return n;
1753
+ const l = fe(i, d), p = n.endsWith("/") ? `${l}/` : l;
1754
+ return `${n[0]}${p}`;
1612
1755
  }), fe = (e, t) => {
1613
- const i = m.relative(e, t);
1614
- return i.startsWith(".") ? i : `.${m.sep}${i}`;
1756
+ const i = u.relative(e, t);
1757
+ return i.startsWith(".") ? i : `.${u.sep}${i}`;
1615
1758
  };
1616
- async function zr(e, t, i) {
1617
- const s = m.resolve(e.dir.root, t);
1618
- e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await $s(s, { recursive: !0, force: !0 }), await G(s, { recursive: !0 }), await Ps(e.dir.distCdn, m.join(s, "build"), { recursive: !0 });
1619
- const r = [
1759
+ async function Yr(e, t, i) {
1760
+ const s = u.resolve(e.dir.root, t);
1761
+ e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Ps(s, { recursive: !0, force: !0 }), await V(s, { recursive: !0 }), await Is(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
1762
+ const n = [
1620
1763
  "index.html",
1621
- ...await xs("**/*.html", {
1764
+ ...await Ls("**/*.html", {
1622
1765
  cwd: e.dir.src,
1623
1766
  onlyFiles: !0,
1624
1767
  // The files we are looking for are unlikely to be symbolic links
@@ -1626,7 +1769,7 @@ async function zr(e, t, i) {
1626
1769
  // Not applicable for our glob pattern
1627
1770
  expandDirectories: !1
1628
1771
  })
1629
- ], n = m.relative(e.dir.root, e.dir.src), a = await ue(e), c = m.join(e.dir.src, "loader.ts"), d = a.map((l) => {
1772
+ ], r = u.relative(e.dir.root, e.dir.src), a = await pe(e), c = u.join(e.dir.src, "loader.ts"), d = a.map((l) => {
1630
1773
  if ("cssHref" in l)
1631
1774
  return `<link rel="stylesheet" href="${l.cssHref}">`;
1632
1775
  if ("javascriptCode" in l && l.javascriptCode.at(0)?.includes(c) === !0)
@@ -1634,29 +1777,29 @@ async function zr(e, t, i) {
1634
1777
  if ("tag" in l) {
1635
1778
  const p = l.children ?? "";
1636
1779
  if (typeof p == "string")
1637
- return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([u, f]) => `${u}="${f}"`).join(" ")}>${p}</${l.tag}>`;
1780
+ return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${l.tag}>`;
1638
1781
  }
1639
1782
  throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(l)}`));
1640
1783
  }).join(`
1641
1784
  `);
1642
1785
  await Promise.all(
1643
- r.map(async (l, p) => {
1644
- const f = p === 0 ? l : m.join(n, l), g = m.join(e.dir.root, f), h = m.join(s, f);
1645
- await G(m.dirname(h), { recursive: !0 });
1646
- const y = await H(g, "utf-8"), v = fe(m.dirname(f), `build/${i}`), C = `${d}<script type="module" src="${v}"><\/script>
1647
- `, S = Math.min(
1648
- ...[y.indexOf("<style>"), y.indexOf("<script"), y.indexOf("</head>")].filter(
1786
+ n.map(async (l, p) => {
1787
+ const f = p === 0 ? l : u.join(r, l), g = u.join(e.dir.root, f), h = u.join(s, f);
1788
+ await V(u.dirname(h), { recursive: !0 });
1789
+ const v = await z(g, "utf-8"), y = fe(u.dirname(f), `build/${i}`), S = `${d}<script type="module" src="${y}"><\/script>
1790
+ `, C = Math.min(
1791
+ ...[v.indexOf("<style>"), v.indexOf("<script"), v.indexOf("</head>")].filter(
1649
1792
  (x) => x !== -1
1650
1793
  )
1651
1794
  );
1652
- if (S === Number.POSITIVE_INFINITY)
1795
+ if (C === Number.POSITIVE_INFINITY)
1653
1796
  throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
1654
- const k = y.slice(0, S) + C + y.slice(S), T = e.options?.build?.webApp?.transformFile?.(k, h, e) ?? k;
1655
- await U(h, T, "utf-8");
1797
+ const E = v.slice(0, C) + S + v.slice(C), T = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
1798
+ await _(h, T, "utf-8");
1656
1799
  })
1657
1800
  ), await e.options.build?.webApp?.afterBuildEnd?.(e);
1658
1801
  }
1659
- const Ti = /* @__PURE__ */ new Set([
1802
+ const Ai = /* @__PURE__ */ new Set([
1660
1803
  "chunks",
1661
1804
  "components",
1662
1805
  "docs",
@@ -1669,13 +1812,13 @@ const Ti = /* @__PURE__ */ new Set([
1669
1812
  "collection",
1670
1813
  "extras",
1671
1814
  "support"
1672
- ]), R = "@arcgis/lumina:buildCdn", ne = "cdn", $i = "index", Q = "main";
1673
- function Hr(e) {
1674
- const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: r } = e.options.build?.cdn ?? {}, n = e.options.build?.webApp?.destination, a = i !== void 0;
1815
+ ]), D = "@arcgis/lumina:buildCdn", ne = "cdn", Li = "index", Y = "main";
1816
+ function Qr(e) {
1817
+ const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
1675
1818
  if (a) {
1676
1819
  if (i.toLowerCase() !== i)
1677
1820
  throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
1678
- if (Ti.has(i))
1821
+ if (Ai.has(i))
1679
1822
  throw new Error(
1680
1823
  `Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
1681
1824
  );
@@ -1683,59 +1826,59 @@ function Hr(e) {
1683
1826
  'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
1684
1827
  );
1685
1828
  }
1686
- const c = i ?? $i;
1829
+ const c = i ?? Li;
1687
1830
  if (e.provideAssets([
1688
1831
  {
1689
1832
  type: "dynamic",
1690
1833
  source: () => yr(e),
1691
- destination: `../${a ? c : Q}.css`
1834
+ destination: `../${a ? c : Y}.css`
1692
1835
  }
1693
1836
  ]), !t)
1694
1837
  return {
1695
- name: R,
1838
+ name: D,
1696
1839
  async writeBundle() {
1697
1840
  if (e.isInStorybook)
1698
1841
  return;
1699
1842
  if ((e.apiJsonComponents ?? []).length === 0) {
1700
- E.warn(
1701
- R,
1843
+ $.warn(
1844
+ D,
1702
1845
  "Skipping CDN build as no public custom elements were found in this package. Double check that your component files follow the required naming convention: https://webgis.esri.com/references/lumina/component."
1703
1846
  );
1704
1847
  return;
1705
1848
  }
1706
- const d = Ae && O().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 })) : [], u = await qr(
1849
+ const d = ue && R().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 Zr(
1707
1850
  e,
1708
1851
  c,
1709
1852
  s,
1710
1853
  p,
1711
- r,
1854
+ n,
1712
1855
  d
1713
1856
  );
1714
- await Vr(
1715
- u,
1857
+ await en(
1858
+ m,
1716
1859
  e,
1717
1860
  a ? `${c}.esm` : c,
1718
1861
  p,
1719
1862
  d
1720
1863
  );
1721
1864
  const f = Date.now();
1722
- E.info(R, `CDN was built in ${f - l}ms`), n && await zr(e, n, `${a ? `${c}.esm` : c}.js`);
1865
+ $.info(D, `CDN was built in ${f - l}ms`), r && await Yr(e, r, `${a ? `${c}.esm` : c}.js`);
1723
1866
  }
1724
1867
  };
1725
1868
  }
1726
- async function qr(e, t, i, s, r, n) {
1869
+ async function Zr(e, t, i, s, n, r) {
1727
1870
  const a = e.environment;
1728
- if (i.minify && n)
1871
+ if (i.minify && r)
1729
1872
  throw Error(
1730
1873
  b(
1731
- R,
1874
+ D,
1732
1875
  "Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
1733
1876
  )
1734
1877
  );
1735
- if (i.sourcemap && n)
1878
+ if (i.sourcemap && r)
1736
1879
  throw Error(
1737
1880
  b(
1738
- R,
1881
+ D,
1739
1882
  "Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
1740
1883
  )
1741
1884
  );
@@ -1746,12 +1889,12 @@ async function qr(e, t, i, s, r, n) {
1746
1889
  * The script's file name will be stripped inside defineCustomElements.
1747
1890
  **/
1748
1891
  defineCustomElements({resourcesUrl: import.meta.url});
1749
- ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
1892
+ ${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
1750
1893
  return await ks({
1751
1894
  bundle: !0,
1752
- minify: n ? !0 : a === "production",
1895
+ minify: r ? !0 : a === "production",
1753
1896
  treeShaking: !0,
1754
- sourcemap: n ? !1 : a === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ? "linked" : !1,
1897
+ sourcemap: r ? !1 : a === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ? "linked" : !1,
1755
1898
  format: "esm",
1756
1899
  splitting: !0,
1757
1900
  absWorkingDir: e.dir.dist,
@@ -1772,7 +1915,7 @@ ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
1772
1915
  chunkNames: "[hash]",
1773
1916
  resolveExtensions: [".js", ".json"],
1774
1917
  banner: { js: e.banner },
1775
- target: Ci(e),
1918
+ target: Si(e),
1776
1919
  ...i,
1777
1920
  write: !1,
1778
1921
  plugins: [
@@ -1799,13 +1942,13 @@ ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
1799
1942
  setup(l) {
1800
1943
  const p = e.options.build?.cdn?.namespace === void 0 ? (
1801
1944
  // eslint-disable-next-line require-unicode-regexp
1802
- new RegExp(`\\/${ne}\\/${Q}\\.css$`)
1945
+ new RegExp(`\\/${ne}\\/${Y}\\.css$`)
1803
1946
  ) : (
1804
1947
  // eslint-disable-next-line require-unicode-regexp
1805
1948
  new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
1806
1949
  );
1807
- l.onResolve({ filter: p }, ({ path: u }) => ({
1808
- path: u,
1950
+ l.onResolve({ filter: p }, ({ path: m }) => ({
1951
+ path: m,
1809
1952
  namespace: "build-cdn:global-css"
1810
1953
  })), l.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
1811
1954
  contents: "",
@@ -1816,7 +1959,7 @@ ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
1816
1959
  ...i?.plugins ?? []
1817
1960
  ],
1818
1961
  logOverride: {
1819
- // Workaround for a Rollup bug. https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/6527
1962
+ // Workaround for a Rollup bug. https://devtopia.esri.com/WebGIS/webgis-sdk/issues/6527
1820
1963
  // TODO: remove this after migration to Rolldown
1821
1964
  "ignored-bare-import": "silent",
1822
1965
  ...i.logOverride
@@ -1831,41 +1974,41 @@ ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
1831
1974
  }
1832
1975
  });
1833
1976
  }
1834
- const Et = "stdin.js";
1835
- async function Vr(e, t, i, s, r) {
1836
- const n = t.dir.distCdn, a = `${i}.js`;
1977
+ const Ct = "stdin.js";
1978
+ async function en(e, t, i, s, n) {
1979
+ const r = t.dir.distCdn, a = `${i}.js`;
1837
1980
  let c;
1838
- r && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
1981
+ n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
1839
1982
  const d = new Map(
1840
1983
  e.outputFiles.map((p) => {
1841
- const u = {
1984
+ const m = {
1842
1985
  code: p.text,
1843
1986
  isProcessing: !1,
1844
1987
  isAsync: void 0,
1845
1988
  oldSingleExportName: void 0
1846
- }, f = ce(p.path.slice(n.length));
1847
- if (f === Et) {
1848
- if (r) {
1849
- const h = p.text.match(Gr)?.[0];
1989
+ }, f = ce(p.path.slice(r.length));
1990
+ if (f === Ct) {
1991
+ if (n) {
1992
+ const h = p.text.match(tn)?.[0];
1850
1993
  if (h === void 0)
1851
1994
  throw Error(
1852
- `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Et} contents:
1995
+ `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Ct} contents:
1853
1996
  ${p.text}`
1854
1997
  );
1855
- u.code = `${u.code.trimEnd()}${Xr(h, s)}`, u.isAsync = !1;
1998
+ m.code = `${m.code.trimEnd()}${sn(h, s)}`, m.isAsync = !1;
1856
1999
  }
1857
- return [a, u];
2000
+ return [a, m];
1858
2001
  }
1859
- return [f, u];
2002
+ return [f, m];
1860
2003
  })
1861
2004
  );
1862
- r && d.forEach((p, u) => {
2005
+ n && d.forEach((p, m) => {
1863
2006
  if (p.isAsync === void 0)
1864
- if (u.endsWith(".js")) {
1865
- if (Pi(p, d), c?.has(u) === !0 && p.code.includes(Ii))
2007
+ if (m.endsWith(".js")) {
2008
+ if (Ni(p, d), c?.has(m) === !0 && p.code.includes(ji))
1866
2009
  throw Error(
1867
2010
  b(
1868
- R,
2011
+ D,
1869
2012
  "CDN entrypoints cannot directly or indirectly import from @arcgis/core at the top level. @arcgis/core, or modules that import @arcgis/core may only be imported dynamically using import(). This is necessary to be compatible with AMD CDN, ESM CDN, and Safari's lack of top-level await support."
1870
2013
  )
1871
2014
  );
@@ -1874,16 +2017,16 @@ ${p.text}`
1874
2017
  }), t.options.build?.cdn?.transformer?.(d, t);
1875
2018
  const l = /* @__PURE__ */ new Map();
1876
2019
  for (const p of d.keys()) {
1877
- const u = p.lastIndexOf("/");
1878
- if (u !== -1) {
1879
- const f = p.slice(0, u);
1880
- l.set(f, G(n + f, { recursive: !0 }));
2020
+ const m = p.lastIndexOf("/");
2021
+ if (m !== -1) {
2022
+ const f = p.slice(0, m);
2023
+ l.set(f, V(r + f, { recursive: !0 }));
1881
2024
  }
1882
2025
  }
1883
- await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: u }]) => await U(n + p, u)));
2026
+ await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await _(r + p, m)));
1884
2027
  }
1885
- const Gr = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
1886
- function Xr(e, t) {
2028
+ const tn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
2029
+ function sn(e, t) {
1887
2030
  let i = [
1888
2031
  "window.$arcgis",
1889
2032
  "||",
@@ -1892,17 +2035,17 @@ function Xr(e, t) {
1892
2035
  ].join("");
1893
2036
  const s = t.length > 0;
1894
2037
  if (i += "(a,r", s && (i += ",p,j,i=(a.importMap??={}).imports??={}"), i += ")=>{", s) {
1895
- const r = [];
1896
- for (const n of t) {
1897
- if (n.in.includes("*")) {
1898
- E.warn(R, `$arcgis.import does not support wildcard imports, so ${n.in} will be ignored.`);
2038
+ const n = [];
2039
+ for (const r of t) {
2040
+ if (r.in.includes("*")) {
2041
+ $.warn(D, `$arcgis.import does not support wildcard imports, so ${r.in} will be ignored.`);
1899
2042
  continue;
1900
2043
  }
1901
- if (n.out.startsWith(".") || n.out.startsWith("/"))
1902
- throw Error(b(R, `CDN entrypoint path must not start with '.' or '/'. Found: ${n.out}`));
1903
- r.push(n.out);
2044
+ if (r.out.startsWith(".") || r.out.startsWith("/"))
2045
+ throw Error(b(D, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
2046
+ n.push(r.out);
1904
2047
  }
1905
- i += `"${r.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
2048
+ i += `"${n.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
1906
2049
  }
1907
2050
  if (i += [
1908
2051
  "a.t=(c,...x)=>",
@@ -1919,52 +2062,52 @@ function Xr(e, t) {
1919
2062
  // minified to a variable name that is already used inside the closure).
1920
2063
  `)($arcgis,${e}`
1921
2064
  ].join(""), s) {
1922
- const n = O().name;
1923
- i += `,"${n}/",".js"`;
2065
+ const r = R().name;
2066
+ i += `,"${r}/",".js"`;
1924
2067
  }
1925
2068
  return i += ")", i;
1926
2069
  }
1927
- function Pi(e, t) {
2070
+ function Ni(e, t) {
1928
2071
  if (e.isProcessing) {
1929
- e.isAsync = !0, Ct(e);
2072
+ e.isAsync = !0, Et(e);
1930
2073
  return;
1931
2074
  }
1932
2075
  e.isProcessing = !0;
1933
- const i = [], s = [], r = [], n = /* @__PURE__ */ new Set(), a = [];
2076
+ const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
1934
2077
  let c = 0;
1935
- const d = e.code.matchAll(Yr);
2078
+ const d = e.code.matchAll(rn);
1936
2079
  for (const w of d) {
1937
- const [L, A, z, j, N] = w, K = N.startsWith(Pe);
2080
+ const [O, L, W, N, A] = w, B = A.startsWith(Ie);
1938
2081
  if (c !== 0 && c !== w.index) {
1939
- const D = e.code.slice(c, w.index);
1940
- r.push(D), a.push([c, D.length, 0, ""]);
2082
+ const F = e.code.slice(c, w.index);
2083
+ n.push(F), a.push([c, F.length, 0, ""]);
1941
2084
  }
1942
- if (c = w.index + L.length, K)
1943
- a.push([w.index, L.length, 0, ""]), s.push(`"${xi(N.slice(Pe.length))}"`), i.push(A?.replaceAll(" as ", ":") ?? z ?? j ?? "");
2085
+ if (c = w.index + O.length, B)
2086
+ a.push([w.index, O.length, 0, ""]), s.push(`"${Di(A.slice(Ie.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? W ?? N ?? "");
1944
2087
  else {
1945
- const D = ki(N, t), M = D?.isAsync === !0;
1946
- if (A !== void 0) {
2088
+ const F = Fi(A, t), M = F?.isAsync === !0;
2089
+ if (L !== void 0) {
1947
2090
  const ye = [];
1948
- for (const Fe of A.slice(1, -1).split(",")) {
1949
- const [mt, ft = mt] = Fe.split(" as ");
1950
- M || n.add(ft), ye.push(`${mt}:${ft}`);
2091
+ for (const Fe of L.slice(1, -1).split(",")) {
2092
+ const [ut, ft = ut] = Fe.split(" as ");
2093
+ M || r.add(ft), ye.push(`${ut}:${ft}`);
1951
2094
  }
1952
2095
  if (M) {
1953
- const Fe = D.oldSingleExportName === void 0 ? `{${ye.join(",")}}` : ye[0].split(":")[1];
1954
- a.push([w.index + 6, 0, A.length, Fe]);
2096
+ const Fe = F.oldSingleExportName === void 0 ? `{${ye.join(",")}}` : ye[0].split(":")[1];
2097
+ a.push([w.index + 6, 0, L.length, Fe]);
1955
2098
  }
1956
- } else if (z === void 0 && j === void 0)
2099
+ } else if (W === void 0 && N === void 0)
1957
2100
  M && a.push([w.index + 6, 0, 0, ""]);
1958
2101
  else {
1959
2102
  if (M)
1960
2103
  throw Error(
1961
2104
  b(
1962
- R,
1963
- `Expected local import specifiers to use only named or side-effect import syntax. Found ${L} in a chunk:
1964
- ${D.code}`
2105
+ D,
2106
+ `Expected local import specifiers to use only named or side-effect import syntax. Found ${O} in a chunk:
2107
+ ${F.code}`
1965
2108
  )
1966
2109
  );
1967
- n.add(j ?? z);
2110
+ r.add(N ?? W);
1968
2111
  }
1969
2112
  }
1970
2113
  }
@@ -1974,86 +2117,86 @@ ${D.code}`
1974
2117
  e.code = Tt(e.code, t);
1975
2118
  return;
1976
2119
  }
1977
- const p = en(n);
1978
- let u = e.code.slice(0, c);
2120
+ const p = an(r);
2121
+ let m = e.code.slice(0, c);
1979
2122
  for (let w = a.length - 1; w >= 0; w--) {
1980
- const [L, A, z, j] = a[w];
1981
- let N = A, K = "";
1982
- if (A === 0) {
2123
+ const [O, L, W, N] = a[w];
2124
+ let A = L, B = "";
2125
+ if (L === 0) {
1983
2126
  const M = p();
1984
- s.push(M), K = ` ${M} from`, j !== "" ? (N = z + 4, i.push(j)) : i.push("");
2127
+ s.push(M), B = ` ${M} from`, N !== "" ? (A = W + 4, i.push(N)) : i.push("");
1985
2128
  }
1986
- u = u.slice(0, L) + K + u.slice(L + N);
2129
+ m = m.slice(0, O) + B + m.slice(O + A);
1987
2130
  }
1988
- const [f, g] = Ct(e), h = i.findLastIndex((w) => w.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, C = `${Ii}${v}=>{`, S = s.join(","), k = `${g}},${S})`;
2131
+ const [f, g] = Et(e), h = i.findLastIndex((w) => w.length > 0), v = i.slice(0, h + 1).join(","), y = i.length === 0 ? "_" : `([${v}])`, S = `${ji}${y}=>{`, C = s.join(","), E = `${g}},${C})`;
1989
2132
  let T = e.code.slice(c, f);
1990
- T = `${r.join("")}${T}`, T = Tt(T, t);
1991
- const x = `${u}${C}${T}${k}`;
2133
+ T = `${n.join("")}${T}`, T = Tt(T, t);
2134
+ const x = `${m}${S}${T}${E}`;
1992
2135
  e.code = x;
1993
2136
  }
1994
- const Ii = "export default $arcgis.t(";
1995
- function Ct(e) {
1996
- const t = Qr.exec(e.code), i = t?.index ?? e.code.length;
2137
+ const ji = "export default $arcgis.t(";
2138
+ function Et(e) {
2139
+ const t = nn.exec(e.code), i = t?.index ?? e.code.length;
1997
2140
  let s = "";
1998
2141
  if (t !== null) {
1999
- const r = t[1].split(",");
2000
- if (r.length > 1)
2001
- s = `return{${r.map((n) => {
2002
- const [a, c = a] = n.split(" as ");
2142
+ const n = t[1].split(",");
2143
+ if (n.length > 1)
2144
+ s = `return{${n.map((r) => {
2145
+ const [a, c = a] = r.split(" as ");
2003
2146
  return `${c}:${a}`;
2004
2147
  }).join(",")}}`;
2005
2148
  else {
2006
- const [n, a = n] = r[0].split(" as ");
2007
- e.oldSingleExportName = a, s = `return ${n}`;
2149
+ const [r, a = r] = n[0].split(" as ");
2150
+ e.oldSingleExportName = a, s = `return ${r}`;
2008
2151
  }
2009
2152
  }
2010
2153
  return [i, s];
2011
2154
  }
2012
- const Yr = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Qr = /export\{([^}]+)\};\n$/u, Pe = "@arcgis/core/";
2013
- function ki(e, t) {
2155
+ const rn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, nn = /export\{([^}]+)\};\n$/u, Ie = "@arcgis/core/";
2156
+ function Fi(e, t) {
2014
2157
  if (!e.startsWith("./"))
2015
2158
  return;
2016
2159
  const i = e.slice(2), s = t.get(i);
2017
2160
  if (s === void 0)
2018
- throw Error(b(R, `Failed to find the ${e} module`));
2019
- if (s.isAsync === void 0 && Pi(s, t), s.isAsync === void 0)
2020
- throw Error(b(R, `Failed to infer whether the ${e} module has top-level await`));
2161
+ throw Error(b(D, `Failed to find the ${e} module`));
2162
+ if (s.isAsync === void 0 && Ni(s, t), s.isAsync === void 0)
2163
+ throw Error(b(D, `Failed to infer whether the ${e} module has top-level await`));
2021
2164
  return s;
2022
2165
  }
2023
2166
  function Tt(e, t) {
2024
- return e.replaceAll(Zr, (i, s) => {
2025
- if (s.startsWith(Pe))
2026
- return `$arcgis.t(m=>m[0],"${xi(s.slice(Pe.length))}")`;
2167
+ return e.replaceAll(on, (i, s) => {
2168
+ if (s.startsWith(Ie))
2169
+ return `$arcgis.t(m=>m[0],"${Di(s.slice(Ie.length))}")`;
2027
2170
  if (s.startsWith("./")) {
2028
- const r = ki(s, t);
2029
- if (r?.isAsync === !0)
2030
- return `${i}.then(m=>m.default${r.oldSingleExportName === void 0 ? "" : `.then(e=>({${r.oldSingleExportName}:e}))`})`;
2171
+ const n = Fi(s, t);
2172
+ if (n?.isAsync === !0)
2173
+ return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
2031
2174
  }
2032
2175
  return i;
2033
2176
  });
2034
2177
  }
2035
- const Zr = /(?<![.\w\d])import\("([^"]+)"\)/gu, xi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2036
- function en(e) {
2178
+ const on = /(?<![.\w\d])import\("([^"]+)"\)/gu, Di = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2179
+ function an(e) {
2037
2180
  const t = [Ye];
2038
2181
  return () => {
2039
2182
  for (; ; ) {
2040
- const i = rn(t);
2041
- if (nn(t), !e.has(i))
2183
+ const i = dn(t);
2184
+ if (pn(t), !e.has(i))
2042
2185
  return e.add(i), i;
2043
2186
  }
2044
2187
  };
2045
2188
  }
2046
- const Ye = 0, at = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ai = `${at}0123456789`, tn = at.length, sn = Ai.length;
2047
- function rn(e) {
2048
- let t = at[e[0]];
2189
+ const Ye = 0, lt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ri = `${lt}0123456789`, ln = lt.length, cn = Ri.length;
2190
+ function dn(e) {
2191
+ let t = lt[e[0]];
2049
2192
  for (let i = 1; i < e.length; ++i)
2050
- t += Ai[e[i]];
2193
+ t += Ri[e[i]];
2051
2194
  return t;
2052
2195
  }
2053
- function nn(e) {
2196
+ function pn(e) {
2054
2197
  let t = e.length - 1;
2055
2198
  for (; t >= 0; ) {
2056
- const i = t === 0 ? tn : sn;
2199
+ const i = t === 0 ? ln : cn;
2057
2200
  if (e[t] += 1, e[t] >= i)
2058
2201
  e[t] = Ye, t--;
2059
2202
  else
@@ -2061,11 +2204,11 @@ function nn(e) {
2061
2204
  }
2062
2205
  e.push(Ye);
2063
2206
  }
2064
- function Ne(e = O(), t = !1) {
2207
+ function Le(e = R(), t = !1) {
2065
2208
  const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
2066
2209
  if (s && i)
2067
2210
  return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ne}/`;
2068
- const r = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", n = on(e.name), a = an(e.version);
2211
+ const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r = mn(e.name), a = un(e.version);
2069
2212
  if (a === void 0)
2070
2213
  throw Error(
2071
2214
  b(
@@ -2073,27 +2216,27 @@ function Ne(e = O(), t = !1) {
2073
2216
  `Failed to parse a semver version: ${e.name}. Ensure the version follows D.D.D format. Package version: ${e.version}`
2074
2217
  )
2075
2218
  );
2076
- return n.length === 0 ? `https://${r}/${a}/` : s ? `https://${r}/${n}/${a}/` : `https://${r}/${a}/${n}/`;
2219
+ return r.length === 0 ? `https://${n}/${a}/` : s ? `https://${n}/${r}/${a}/` : `https://${n}/${a}/${r}/`;
2077
2220
  }
2078
- const on = (e) => e.split("/").pop() ?? e;
2079
- function an(e) {
2221
+ const mn = (e) => e.split("/").pop() ?? e;
2222
+ function un(e) {
2080
2223
  const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
2081
2224
  if (i?.groups === void 0)
2082
2225
  return;
2083
- const { major: s, minor: r, patch: n, prerelease: a } = i.groups, c = `${s}.${r}.${n}`;
2226
+ const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
2084
2227
  return a?.startsWith("-next") ? `${c}-next` : c;
2085
2228
  }
2086
- async function ln(e, t, i, s, r) {
2087
- const n = t.packageName, { hasCss: a, cdnName: c } = await Ni(t.packageLocation) ?? {};
2229
+ async function fn(e, t, i, s, n) {
2230
+ const r = t.packageName, { hasCss: a, cdnName: c } = await Oi(t.packageLocation) ?? {};
2088
2231
  if (i === "cdn") {
2089
- const u = t.cdnUrl ?? Ne(t.packageJson, r);
2232
+ const m = t.cdnUrl ?? Le(t.packageJson, n);
2090
2233
  return [
2091
2234
  ...a ? [
2092
2235
  {
2093
2236
  tag: "link",
2094
2237
  attrs: {
2095
2238
  rel: "stylesheet",
2096
- src: `${u}${c}.css`
2239
+ src: `${m}${c}.css`
2097
2240
  }
2098
2241
  }
2099
2242
  ] : [],
@@ -2101,15 +2244,15 @@ async function ln(e, t, i, s, r) {
2101
2244
  tag: "script",
2102
2245
  attrs: {
2103
2246
  type: "module",
2104
- src: `${u}${c}.esm.js`
2247
+ src: `${m}${c}.esm.js`
2105
2248
  }
2106
2249
  }
2107
2250
  ];
2108
2251
  }
2109
- const d = `${n}/dist/${c}/${c}.css${Y}`, l = a ? [
2252
+ const d = `${r}/dist/${c}/${c}.css${X}`, l = a ? [
2110
2253
  `import styles$${s} from "${d}";`,
2111
2254
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2112
- ] : [], p = `${n}/dist/esm/loader.js`;
2255
+ ] : [], p = `${r}/dist/esm/loader.js`;
2113
2256
  return [
2114
2257
  {
2115
2258
  /*
@@ -2127,39 +2270,39 @@ async function ln(e, t, i, s, r) {
2127
2270
  }
2128
2271
  ];
2129
2272
  }
2130
- async function Ni(e) {
2131
- const t = m.join(e, "dist"), i = m.basename(e), r = (await tt(t)).filter(
2132
- (a) => !Ti.has(a) && !a.includes(".")
2133
- ), n = r.find(
2273
+ async function Oi(e) {
2274
+ const t = u.join(e, "dist"), i = u.basename(e), n = (await et(t)).filter(
2275
+ (a) => !Ai.has(a) && !a.includes(".")
2276
+ ), r = n.find(
2134
2277
  (a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
2135
2278
  a === i
2136
2279
  );
2137
- return n === void 0 ? await Promise.all(
2138
- r.map(async (a) => await $t(t, a))
2139
- ).then((a) => a.find(F)) : await $t(t, n);
2280
+ return r === void 0 ? await Promise.all(
2281
+ n.map(async (a) => await $t(t, a))
2282
+ ).then((a) => a.find(j)) : await $t(t, r);
2140
2283
  }
2141
2284
  async function $t(e, t) {
2142
- const i = m.join(e, t, `${t}.css`), s = m.join(e, t, "assets"), r = m.join(e, t, `${t}.esm.js`), [n, a, c] = await Promise.all([
2143
- _(i),
2144
- _(s),
2145
- _(r)
2285
+ 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([
2286
+ K(i),
2287
+ K(s),
2288
+ K(n)
2146
2289
  ]);
2147
- return n || a || c ? {
2148
- hasCss: n,
2290
+ return r || a || c ? {
2291
+ hasCss: r,
2149
2292
  cdnName: t
2150
2293
  } : void 0;
2151
2294
  }
2152
- async function cn(e, t, i, s, r) {
2153
- const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Ni(t.packageLocation) : void 0, c = a?.cdnName ?? ne, d = a === void 0 ? `${$i}.js` : `${a.cdnName}.esm.js`;
2295
+ async function gn(e, t, i, s, n) {
2296
+ const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await Oi(t.packageLocation) : void 0, c = a?.cdnName ?? ne, d = a === void 0 ? `${Li}.js` : `${a.cdnName}.esm.js`;
2154
2297
  if (i === "cdn")
2155
2298
  return {
2156
2299
  tag: "script",
2157
2300
  attrs: {
2158
2301
  type: "module",
2159
- src: `${t.cdnUrl ?? Ne(t.packageJson, r)}${d}`
2302
+ src: `${t.cdnUrl ?? Le(t.packageJson, n)}${d}`
2160
2303
  }
2161
2304
  };
2162
- const l = dn(t.packageJson), p = `${t.packageName}/${m.normalize(l)}${Y}`, u = [
2305
+ const l = hn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${X}`, m = [
2163
2306
  `import styles$${s} from "${p}";`,
2164
2307
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2165
2308
  ], f = `${t.packageName}/loader`;
@@ -2170,7 +2313,7 @@ async function cn(e, t, i, s, r) {
2170
2313
  */
2171
2314
  optimizableImports: [f],
2172
2315
  javascriptCode: [
2173
- ...u,
2316
+ ...m,
2174
2317
  `import { defineCustomElements as defineCustomElements$${s} } from "${f}";`,
2175
2318
  `defineCustomElements$${s}({`,
2176
2319
  ` resourcesUrl: "${nt(e, t.packageLocation)}/dist/${c}/",`,
@@ -2178,32 +2321,32 @@ async function cn(e, t, i, s, r) {
2178
2321
  ]
2179
2322
  };
2180
2323
  }
2181
- function dn(e) {
2324
+ function hn(e) {
2182
2325
  const { exports: t } = e;
2183
2326
  if (t === void 0)
2184
2327
  throw new Error(
2185
2328
  `Package "${e.name}" does not have an "exports" field. All Lumina packages must include an "exports" field.`
2186
2329
  );
2187
- const i = Object.entries(t).filter(([r]) => m.extname(r) === ".css"), s = i.find(([, r]) => r === `./${Q}.css`);
2188
- return s ? s[0] : i.length > 0 ? i[0][0] : `./${Q}.css`;
2330
+ const i = Object.entries(t).filter(([n]) => u.extname(n) === ".css"), s = i.find(([, n]) => n === `./${Y}.css`);
2331
+ return s ? s[0] : i.length > 0 ? i[0][0] : `./${Y}.css`;
2189
2332
  }
2190
- async function ue(e) {
2191
- return e._loadersCache ??= pn(e), await e._loadersCache;
2333
+ async function pe(e) {
2334
+ return e._loadersCache ??= yn(e), await e._loadersCache;
2192
2335
  }
2193
- async function pn(e) {
2336
+ async function yn(e) {
2194
2337
  const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", s = e.viteConfig.base;
2195
- let r = 0;
2196
- const n = async (l) => (await Promise.all(
2338
+ let n = 0;
2339
+ const r = async (l) => (await Promise.all(
2197
2340
  l.map(async (p) => {
2198
- const u = r++;
2199
- return p.type === "stencil" ? await ln(s, p, t, u, i) : p.type === "@arcgis/lumina" ? await cn(s, p, t, u, i) : void 0;
2341
+ const m = n++;
2342
+ return p.type === "stencil" ? await fn(s, p, t, m, i) : p.type === "@arcgis/lumina" ? await gn(s, p, t, m, i) : void 0;
2200
2343
  })
2201
- )).filter(F).flat(), a = await Promise.all([
2344
+ )).filter(j).flat(), a = await Promise.all([
2202
2345
  // This may contain an import map so must be first
2203
- Jr(s, t, i),
2204
- ie.then(n),
2205
- Li(e).then(n)
2206
- ]), c = m.join(e.dir.src, "loader.ts");
2346
+ Ur(s, t, i),
2347
+ ie.then(r),
2348
+ Mi(e).then(r)
2349
+ ]), c = u.join(e.dir.src, "loader.ts");
2207
2350
  return [
2208
2351
  ...a.flat(),
2209
2352
  {
@@ -2221,27 +2364,27 @@ async function pn(e) {
2221
2364
  }
2222
2365
  ];
2223
2366
  }
2224
- async function Li(e) {
2367
+ async function Mi(e) {
2225
2368
  const t = e.options?.serve?.extraDependencies ?? [];
2226
2369
  return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
2227
2370
  t.map(async (i) => {
2228
- const s = typeof i == "string" ? void 0 : i, r = typeof i == "string" ? i : i.name, n = await Si(r);
2229
- if (n === void 0)
2371
+ const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await bi(n);
2372
+ if (r === void 0)
2230
2373
  throw Error(
2231
2374
  b(
2232
2375
  "@arcgis/lumina:computeServeOnlyDependencies",
2233
- `Unable to resolve extra dependency "${r}". Make sure it is a valid Stencil or Lumina package.`
2376
+ `Unable to resolve extra dependency "${n}". Make sure it is a valid Stencil or Lumina package.`
2234
2377
  )
2235
2378
  );
2236
2379
  return {
2237
- ...n,
2380
+ ...r,
2238
2381
  cdnUrl: s?.getCdnUrl(e)
2239
2382
  };
2240
2383
  })
2241
- ).then((i) => i.filter(F)), await e._serveOnlyDependencies);
2384
+ ).then((i) => i.filter(j)), await e._serveOnlyDependencies);
2242
2385
  }
2243
- const un = "/C:@arcgis/lumina-compiler/testSetupFile", mn = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, Je = [un];
2244
- async function fn(e) {
2386
+ const vn = "/C:@arcgis/lumina-compiler/testSetupFile", bn = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, Je = [vn];
2387
+ async function wn(e) {
2245
2388
  if (
2246
2389
  /**
2247
2390
  * Only import custom element dependencies if we are running in Vitest browser mode.
@@ -2254,7 +2397,7 @@ async function fn(e) {
2254
2397
  !e.apiJsonEnabled
2255
2398
  )
2256
2399
  return Pt(e);
2257
- const i = (await ue(e)).map((s, r) => {
2400
+ const i = (await pe(e)).map((s, n) => {
2258
2401
  if ("javascriptCode" in s)
2259
2402
  return s.javascriptCode.join(`
2260
2403
  `);
@@ -2264,8 +2407,8 @@ async function fn(e) {
2264
2407
  * The $index naming is already used by makeLoaders(), so we use the
2265
2408
  * $t prefix to avoid collisions.
2266
2409
  */
2267
- `import styles$t${r} from "${s.cssHref}${Y}";`,
2268
- `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${r}.styleSheet];`
2410
+ `import styles$t${n} from "${s.cssHref}${X}";`,
2411
+ `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${n}.styleSheet];`
2269
2412
  ].join(`
2270
2413
  `);
2271
2414
  throw Error(
@@ -2279,24 +2422,24 @@ async function fn(e) {
2279
2422
  `);
2280
2423
  return [Pt(e), i].join("");
2281
2424
  }
2282
- const Pt = (e) => [e.isInPuppeteerTestBackEnd ? gn : "", hn].join(""), gn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2425
+ const Pt = (e) => [e.isInPuppeteerTestBackEnd ? Sn : "", Cn].join(""), Sn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2283
2426
  setupPuppeteerTest();
2284
- `, hn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2427
+ `, Cn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2285
2428
  setupLuminaTest();
2286
- `, yn = "@arcgis/lumina:generateLoaderTs";
2287
- let Ie;
2288
- function vn(e) {
2429
+ `, En = "@arcgis/lumina:generateLoaderTs";
2430
+ let ke;
2431
+ function Tn(e) {
2289
2432
  const t = /[\\\/]src[\\\/]loader\.ts$/u;
2290
- return [As(e.apiExtractorPluginConfig), {
2291
- name: yn,
2433
+ return [Ns(e.apiExtractorPluginConfig), {
2434
+ name: En,
2292
2435
  configResolved() {
2293
- Ie = `${e.dir.root}src/loader.ts`;
2436
+ ke = `${e.dir.root}src/loader.ts`;
2294
2437
  },
2295
2438
  resolveId: {
2296
2439
  filter: {
2297
2440
  id: t
2298
2441
  },
2299
- handler: () => Ie
2442
+ handler: () => ke
2300
2443
  },
2301
2444
  load: {
2302
2445
  filter: {
@@ -2313,133 +2456,27 @@ function vn(e) {
2313
2456
  name: "@arcgis/lumina:generateTestSetupVirtualFile",
2314
2457
  load: {
2315
2458
  filter: {
2316
- id: mn
2459
+ id: bn
2317
2460
  },
2318
- handler: async () => await fn(e)
2461
+ handler: async () => await wn(e)
2319
2462
  }
2320
2463
  }];
2321
2464
  }
2322
2465
  function It(e) {
2323
- const t = e.server.moduleGraph.getModuleById(Ie);
2466
+ const t = e.server.moduleGraph.getModuleById(ke);
2324
2467
  t !== void 0 && e.server.moduleGraph.invalidateModule(t);
2325
2468
  }
2326
2469
  const kt = (e) => {
2327
2470
  e.server.ws.send({
2328
2471
  type: "full-reload",
2329
- path: m.join("/", m.relative(e.dir.root, Ie))
2472
+ path: u.join("/", u.relative(e.dir.root, ke))
2330
2473
  });
2331
- }, Qe = "@arcgis/lumina:provideAssets";
2332
- function de(e, t, i = lt) {
2333
- if (e.viteCommand !== "serve")
2334
- throw Error(b(Qe, "serveAssets() is only available when Vite is running in serve mode"));
2335
- const s = e._serverConfigured, r = e.server.middlewares.stack.length;
2336
- if (t.forEach((n) => {
2337
- const a = Fi(n), c = Ri(e.dir, Di(a)), d = wn(e.viteConfig.base, c, e.dir.distCdn);
2338
- e.server.middlewares.use(d, (l, p, u) => {
2339
- const f = Sn(l.url), g = a.type === "directory" ? m.resolve(a.source, f.slice(1)) : a.source, h = m.join(c, f), y = i.find((v) => v.match(h, e));
2340
- return (typeof g == "function" ? Promise.resolve(g()) : H(g)).then((v) => {
2341
- const C = (typeof g == "function" ? void 0 : y?.transform(v.toString("utf8"), h, e)) ?? v;
2342
- p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Ns.lookup(f) || "application/octet-stream"), p.write(C), p.end();
2343
- }).catch((v) => {
2344
- (a.type !== "directory" || process.env.DEBUG) && E.warn(
2345
- Qe,
2346
- `Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? f}":${String(v)}`
2347
- ), u();
2348
- }), !0;
2349
- });
2350
- }), s) {
2351
- const n = e.server.middlewares.stack.splice(r);
2352
- e.server.middlewares.stack.splice(0, 0, ...n);
2353
- }
2354
- }
2355
- async function ji(e, t, i = lt) {
2356
- await Promise.all(
2357
- t.map(async (s) => {
2358
- const r = Fi(s), n = Ri(e.dir, Di(r));
2359
- if (r.type === "directory") {
2360
- const a = m.resolve(r.source), d = (await tt(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
2361
- const p = m.resolve(l.parentPath, l.name), u = m.relative(a, p), f = m.join(n, u);
2362
- return [p, f];
2363
- });
2364
- await Mi(d.map(([l, p]) => p)), await Ls(
2365
- d,
2366
- 16,
2367
- async ([l, p]) => await xt(l, p, i, e)
2368
- );
2369
- } else if (r.type === "file")
2370
- await G(m.dirname(n), { recursive: !0 }), await xt(r.source, n, i, e);
2371
- else if (r.type === "dynamic") {
2372
- await G(m.dirname(n), { recursive: !0 });
2373
- const a = await Promise.resolve(r.source());
2374
- await U(n, a);
2375
- }
2376
- })
2377
- );
2378
- }
2379
- const Fi = Yt ? (e) => e : (e) => e.type === "dynamic" ? {
2380
- ...e,
2381
- destination: ce(e.destination)
2382
- } : {
2383
- ...e,
2384
- source: ce(e.source),
2385
- destination: ce(e.destination)
2386
2474
  };
2387
- async function xt(e, t, i, s) {
2388
- const r = i.find((n) => n.match(t, s));
2389
- if (r === void 0)
2390
- await Is(e, t);
2391
- else {
2392
- const n = await H(e, "utf8"), a = r.transform(n, t, s);
2393
- await U(t, a);
2394
- }
2395
- }
2396
- function Di(e) {
2397
- if (e.type === "dynamic")
2398
- return e.destination;
2399
- if (e.source.endsWith(m.sep)) {
2400
- if (e.type === "file")
2401
- throw Error(
2402
- b(
2403
- Qe,
2404
- `Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${xe(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
2405
- )
2406
- );
2407
- return e.destination;
2408
- }
2409
- return e.destination === "" ? m.basename(e.source) : e.destination.endsWith(m.sep) ? e.type === "directory" && e.destination === m.sep ? e.destination : m.join(e.destination, m.basename(e.source)) : e.destination;
2410
- }
2411
- function Ri({ dist: e, distCdnAssets: t }, i) {
2412
- const s = bn(i), r = m.join(
2413
- t,
2414
- s ? m.relative(t, i) : i
2415
- ), n = m.relative(e, r), a = Oi(n);
2416
- return m.join(e, a);
2417
- }
2418
- function bn(e) {
2419
- if (e.startsWith(m.sep)) {
2420
- const t = Qt(), i = t.startsWith(m.sep) ? t.split(m.sep)[1] ?? "" : "";
2421
- return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
2422
- } else
2423
- return !!(!Yt && m.isAbsolute(e));
2424
- }
2425
- function wn(e, t, i) {
2426
- const s = Oi(m.relative(i, t)), r = s.startsWith("/") ? s.slice(1) : s;
2427
- return `${e}${r}`;
2428
- }
2429
- const Oi = (e) => e.replaceAll("../", ""), Sn = (e = "") => e.split("?")[0].split("#")[0];
2430
- async function Mi(e) {
2431
- const t = new Set(e.map(m.dirname));
2432
- await Promise.all(Array.from(t, async (i) => await G(i, { recursive: !0 })));
2433
- }
2434
- const En = {
2435
- match: (e, t) => t.environment === "production" && e.endsWith(".json"),
2436
- transform: (e) => JSON.stringify(JSON.parse(e))
2437
- }, lt = [En];
2438
- function Cn(e) {
2475
+ function $n(e) {
2439
2476
  let t;
2440
2477
  const i = () => [
2441
2478
  ...e.options.assets?.transformers ?? [],
2442
- ...lt
2479
+ ...ot
2443
2480
  ];
2444
2481
  return {
2445
2482
  name: "@arcgis/lumina:handleStaticAssets",
@@ -2458,98 +2495,98 @@ function Cn(e) {
2458
2495
  * `configureServer`.
2459
2496
  */
2460
2497
  configResolved() {
2461
- e.viteCommand === "serve" && (t = At(e));
2498
+ e.viteCommand === "serve" && (t = xt(e));
2462
2499
  },
2463
2500
  options() {
2464
- e.viteCommand === "build" && (t = At(e));
2501
+ e.viteCommand === "build" && (t = xt(e));
2465
2502
  },
2466
2503
  async configureServer(s) {
2467
- e.server = s, de(e, await t, i()), s.watcher.on("addDir", (r) => {
2468
- if (r.endsWith("assets")) {
2469
- const n = m.dirname(r);
2470
- m.join(n, "/") === e.dir.root ? de(e, [Bi], i()) : r.startsWith(e.dir.srcComponents) && de(e, [Ji(r, n)], i());
2504
+ e.server = s, Z(e, await t, i()), s.watcher.on("addDir", (n) => {
2505
+ if (n.endsWith("assets")) {
2506
+ const r = u.dirname(n);
2507
+ u.join(r, "/") === e.dir.root ? Z(e, [Bi], i()) : n.startsWith(e.dir.srcComponents) && Z(e, [Ji(n, r)], i());
2471
2508
  }
2472
2509
  });
2473
2510
  },
2474
2511
  async writeBundle() {
2475
- await ji(e, await t, i());
2512
+ await Ci(e, await t, i());
2476
2513
  }
2477
2514
  };
2478
2515
  }
2479
- async function At(e) {
2480
- const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
2481
- i.map(async (r) => {
2482
- const n = m.dirname(r), a = m.join(n, "assets");
2483
- return await _(a) ? Ji(a, n) : void 0;
2516
+ async function xt(e) {
2517
+ const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
2518
+ i.map(async (n) => {
2519
+ const r = u.dirname(n), a = u.join(r, "assets");
2520
+ return await K(a) ? Ji(a, r) : void 0;
2484
2521
  })
2485
2522
  );
2486
- return await t && s.push(Bi), s.filter(F);
2523
+ return await t && s.push(Bi), s.filter(j);
2487
2524
  }
2488
2525
  const Ji = (e, t) => ({
2489
2526
  type: "directory",
2490
2527
  source: e,
2491
- destination: m.basename(t)
2492
- }), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", Tn = (e) => ({
2528
+ destination: u.basename(t)
2529
+ }), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", Pn = (e) => ({
2493
2530
  name: Be,
2494
2531
  apply: () => e.viteCommand === "build",
2495
2532
  configResolved(t) {
2496
- const i = t.plugins.find(({ name: r }) => r === "vite:reporter");
2533
+ const i = t.plugins.find(({ name: n }) => n === "vite:reporter");
2497
2534
  if (i === void 0) {
2498
2535
  if ("rolldownVersion" in this.meta)
2499
2536
  return;
2500
- E.warn(Be, "Unable to find the vite's built-in vite:reporter plugin");
2537
+ $.warn(Be, "Unable to find the vite's built-in vite:reporter plugin");
2501
2538
  return;
2502
2539
  }
2503
2540
  const s = i.writeBundle;
2504
2541
  if (typeof s != "function")
2505
2542
  throw Error(b(Be, "Expected vite:reporter to declare a writeBundle() function"));
2506
- i.writeBundle = async function(n, a) {
2543
+ i.writeBundle = async function(r, a) {
2507
2544
  let c = 0, d = 0, l = 0, p = 0;
2508
- const u = console.log;
2545
+ const m = console.log;
2509
2546
  console.log = function(...g) {
2510
- if (u.apply(console, g), g.length === 1 && typeof g[0] == "string") {
2511
- const [h, y] = g[0].match(Pn) ?? [];
2547
+ if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
2548
+ const [h, v] = g[0].match(kn) ?? [];
2512
2549
  if (!h)
2513
2550
  return;
2514
- p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(In, "").length);
2515
- const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
2516
- y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
2551
+ p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(xn, "").length);
2552
+ const y = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
2553
+ v ? (l += Number.parseFloat(v.replace(" kB", "").replaceAll(",", "")), d += y) : c += y;
2517
2554
  }
2518
2555
  };
2519
2556
  try {
2520
- await s.call(this, n, a);
2557
+ await s.call(this, r, a);
2521
2558
  } finally {
2522
- console.log = u;
2559
+ console.log = m;
2523
2560
  }
2524
2561
  if (d > 0) {
2525
- const g = l > 0 ? d : c, h = jt(g), y = e.dir.relativeDist;
2562
+ const g = l > 0 ? d : c, h = Nt(g), v = e.dir.relativeDist;
2526
2563
  console.log(
2527
2564
  [
2528
2565
  Lt,
2529
- y,
2530
- $n,
2566
+ v,
2567
+ In,
2531
2568
  "*",
2532
- " ".repeat(p - `${y}*`.length - h.length),
2569
+ " ".repeat(p - `${v}*`.length - h.length),
2533
2570
  h,
2534
- Nt,
2535
- l > 0 ? ` ${Lt}│ gzip: ${jt(l)}${Nt}` : ""
2571
+ At,
2572
+ l > 0 ? ` ${Lt}│ gzip: ${Nt(l)}${At}` : ""
2536
2573
  ].join("")
2537
2574
  );
2538
2575
  }
2539
2576
  };
2540
2577
  }
2541
- }), Nt = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m", $n = "\x1B[22m\x1B[36m", Pn = /\d+(?:,\d+)?\.\d{2} kB/gu, In = /\x1B\[\d+m/gu, kn = new Intl.NumberFormat("en", {
2578
+ }), At = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m", In = "\x1B[22m\x1B[36m", kn = /\d+(?:,\d+)?\.\d{2} kB/gu, xn = /\x1B\[\d+m/gu, An = new Intl.NumberFormat("en", {
2542
2579
  maximumFractionDigits: 2,
2543
2580
  minimumFractionDigits: 2
2544
- }), jt = (e) => `${kn.format(e)} kB`, xn = (e, t = m.resolve("src")) => m.relative(t, m.join(e, "..", ot.slice(0, -3))), Ft = "@arcgis/lumina:configureVite", An = (e) => ({
2545
- name: Ft,
2581
+ }), Nt = (e) => `${An.format(e)} kB`, Ln = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", at.slice(0, -3))), jt = "@arcgis/lumina:configureVite", Nn = (e) => ({
2582
+ name: jt,
2546
2583
  async config({
2547
2584
  server: t,
2548
2585
  publicDir: i,
2549
- build: { cssMinify: s, target: r, sourcemap: n, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
2586
+ build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
2550
2587
  test: p = {}
2551
2588
  }) {
2552
- const u = d != null, { include: f, browser: g, environment: h, forceRerunTriggers: y } = p, v = {
2589
+ const m = d != null, { include: f, browser: g, environment: h, forceRerunTriggers: v } = p, y = {
2553
2590
  // Public utilities exposed by the package
2554
2591
  index: "src/index.ts",
2555
2592
  /**
@@ -2557,7 +2594,7 @@ const Ji = (e, t) => ({
2557
2594
  * the CDN build
2558
2595
  */
2559
2596
  loader: "src/loader.ts"
2560
- }, { loader: C, ...S } = v, k = e.environment === "development" || e.isInTest ? {
2597
+ }, { loader: S, ...C } = y, E = e.environment === "development" || e.isInTest ? {
2561
2598
  "process.env.ESRI_INTERNAL": "true"
2562
2599
  } : void 0, T = !import.meta.url.includes("node_modules"), x = {
2563
2600
  /**
@@ -2572,7 +2609,7 @@ const Ji = (e, t) => ({
2572
2609
  * is not visible to dep-optimizer's ESBuild instance.
2573
2610
  */
2574
2611
  entries: [
2575
- ...Object.values(S),
2612
+ ...Object.values(C),
2576
2613
  ...await e.componentFilesPromise,
2577
2614
  // Vitest scans setup files, but misses Lumina's because we add it
2578
2615
  // dynamically. Include it because it imports js-beautify. Can't
@@ -2603,7 +2640,7 @@ const Ji = (e, t) => ({
2603
2640
  include: [
2604
2641
  // Used by controllers. Need to add manually because @arcgis/lumina is
2605
2642
  // excluded per comment below, so Vite will discover these usages too late.
2606
- ...Ae ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
2643
+ ...ue ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
2607
2644
  ],
2608
2645
  /**
2609
2646
  * Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
@@ -2653,7 +2690,7 @@ const Ji = (e, t) => ({
2653
2690
  if (typeof p.setupFiles == "string" ? p.setupFiles = [...Je, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...Je, ...p.setupFiles] : p.setupFiles = [...Je], e.isInPuppeteerTestBackEnd) {
2654
2691
  if (g?.enabled === !0)
2655
2692
  throw Error(
2656
- b(Ft, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2693
+ b(jt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2657
2694
  );
2658
2695
  return {
2659
2696
  test: {
@@ -2673,10 +2710,10 @@ const Ji = (e, t) => ({
2673
2710
  /**
2674
2711
  * Re-run all tests on any file change.
2675
2712
  */
2676
- forceRerunTriggers: y === void 0 ? ["**/*.{ts,tsx}"] : void 0
2713
+ forceRerunTriggers: v === void 0 ? ["**/*.{ts,tsx}"] : void 0
2677
2714
  },
2678
2715
  optimizeDeps: x,
2679
- define: k
2716
+ define: E
2680
2717
  };
2681
2718
  }
2682
2719
  return {
@@ -2687,10 +2724,10 @@ const Ji = (e, t) => ({
2687
2724
  publicDir: i ?? !1,
2688
2725
  build: {
2689
2726
  cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
2690
- target: r ?? Ci(e),
2691
- sourcemap: n ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
2727
+ target: n ?? Si(e),
2728
+ sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
2692
2729
  lib: {
2693
- entry: v,
2730
+ entry: y,
2694
2731
  formats: (a ? a.formats : void 0) ?? ["es"]
2695
2732
  },
2696
2733
  rollupOptions: {
@@ -2717,10 +2754,10 @@ const Ji = (e, t) => ({
2717
2754
  * - in API Extractor we can avoid writing unchanged files to disk if
2718
2755
  * the out dir is not emptied between watch rebuilds.
2719
2756
  */
2720
- emptyOutDir: l ?? !u
2757
+ emptyOutDir: l ?? !m
2721
2758
  },
2722
2759
  optimizeDeps: x,
2723
- define: k,
2760
+ define: E,
2724
2761
  test: {
2725
2762
  /*
2726
2763
  * If in browser, run all test files that include *.e2e.* in the name.
@@ -2751,23 +2788,23 @@ const Ji = (e, t) => ({
2751
2788
  const i = await e.componentFilesPromise;
2752
2789
  e._originalRollupInputOptions ??= t.input;
2753
2790
  const s = { ...e._originalRollupInputOptions };
2754
- i.forEach((r) => {
2755
- const n = xn(r);
2756
- s[n] = r;
2791
+ i.forEach((n) => {
2792
+ const r = Ln(n);
2793
+ s[r] = n;
2757
2794
  }), t.input = s;
2758
2795
  }
2759
- }), Nn = (e) => ({
2796
+ }), jn = (e) => ({
2760
2797
  name: "@arcgis/lumina:setAssetPath",
2761
2798
  apply: () => e.viteCommand === "build",
2762
2799
  config: (t) => ({
2763
- base: t.base ?? e.options.assets?.defaultPath ?? Ne()
2800
+ base: t.base ?? e.options.assets?.defaultPath ?? Le()
2764
2801
  })
2765
2802
  });
2766
- function Ln(e = O()) {
2803
+ function Fn(e = R()) {
2767
2804
  const t = e.version ?? "0.0.1";
2768
2805
  return ds(t);
2769
2806
  }
2770
- const jn = (e) => `/* ${e} */`, P = (e) => (t, i) => {
2807
+ const Dn = (e) => `/* ${e} */`, I = (e) => (t, i) => {
2771
2808
  Object.defineProperty(t, i, {
2772
2809
  get() {
2773
2810
  throw Error(
@@ -2790,7 +2827,7 @@ const jn = (e) => `/* ${e} */`, P = (e) => (t, i) => {
2790
2827
  });
2791
2828
  };
2792
2829
  function ae(e) {
2793
- if (m.isAbsolute(e))
2830
+ if (u.isAbsolute(e))
2794
2831
  throw Error(
2795
2832
  b(
2796
2833
  "@arcgis/lumina:context",
@@ -2805,12 +2842,12 @@ const le = {
2805
2842
  webTypes: "docs/web-types.json",
2806
2843
  apiJson: "docs/api.json",
2807
2844
  stencilLikeDocsJson: "docs/docs.json"
2808
- }, Ze = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
2809
- async function Ki(e, t, i, s, r = O()) {
2810
- const n = Fn(e, r), a = m.join(t, "lumina.ts"), d = await _(a) ? await H(a, "utf8") : "";
2811
- if (d.trim().replaceAll(`\r
2845
+ }, Qe = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
2846
+ async function Ki(e, t, i = R()) {
2847
+ const s = Rn(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await z(n, "utf8") : "";
2848
+ if (a.trim().replaceAll(`\r
2812
2849
  `, `
2813
- `) === n.trim())
2850
+ `) === s.trim())
2814
2851
  return !1;
2815
2852
  if (process.env.CI)
2816
2853
  throw Error(
@@ -2818,38 +2855,38 @@ async function Ki(e, t, i, s, r = O()) {
2818
2855
  "@arcgis/lumina:updateLuminaTs",
2819
2856
  `lumina.ts is out of date. Start the vite dev server or build locally at least once to update lumina.ts and commit the updated file. Tried to write the following content:
2820
2857
 
2821
- ${n}
2858
+ ${s}
2822
2859
 
2823
2860
  Current content:
2824
2861
 
2825
- ${d}`
2862
+ ${a}`
2826
2863
  )
2827
2864
  );
2828
- return ei(a, n), !0;
2865
+ return Qt(n, s), !0;
2829
2866
  }
2830
- function Fn(e, t = O()) {
2867
+ function Rn(e, t = R()) {
2831
2868
  const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
2832
- /// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), r = s.map(
2869
+ /// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
2833
2870
  (d, l) => `
2834
2871
  import type { JSX as JSX$${l} } from "${d.packageName}/dist/types/components";`
2835
- ), n = s.length === 0 ? "" : `
2872
+ ), r = s.length === 0 ? "" : `
2836
2873
 
2837
2874
  declare module "@arcgis/lumina" {
2838
2875
  interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
2839
2876
  }`, a = t.devDependencies ?? {};
2840
2877
  return [
2841
- Dn,
2878
+ On,
2842
2879
  a.vitest ? `
2843
2880
  /// <reference types="vitest/config" />
2844
2881
  /// <reference types="vitest/browser" />` : "",
2845
2882
  ...i,
2846
- ...r,
2847
- n,
2883
+ ...n,
2884
+ r,
2848
2885
  `
2849
2886
  `
2850
2887
  ].join("");
2851
2888
  }
2852
- const Dn = `/**
2889
+ const On = `/**
2853
2890
  * This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
2854
2891
  * Manual edits will be overwritten.
2855
2892
  *
@@ -2868,33 +2905,36 @@ const Dn = `/**
2868
2905
  * is doing:
2869
2906
  * https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
2870
2907
  */
2871
- e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Rn = (e) => ({
2908
+ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Mn = (e) => ({
2872
2909
  name: be,
2910
+ async configureServer(t) {
2911
+ ue && (e.server = t, await zr(e));
2912
+ },
2873
2913
  configResolved() {
2874
- !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = On(e).catch(
2875
- (t) => E.error(be, `Failed to update package's src/lumina.ts: ${String(t)}`)
2914
+ !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Jn(e).catch(
2915
+ (t) => $.error(be, `Failed to update package's src/lumina.ts: ${String(t)}`)
2876
2916
  ));
2877
2917
  },
2878
2918
  transformIndexHtml: {
2879
2919
  // Add imports to index.html before Vite starts resolving imports
2880
2920
  order: "pre",
2881
2921
  async handler(t, i) {
2882
- return _i(e, i) ? (await ue(e)).map(
2883
- (r) => "javascriptCode" in r ? {
2922
+ return _i(e, i) ? (await pe(e)).map(
2923
+ (n) => "javascriptCode" in n ? {
2884
2924
  tag: "script",
2885
2925
  attrs: {
2886
2926
  type: "module"
2887
2927
  },
2888
- children: r.javascriptCode.join(`
2928
+ children: n.javascriptCode.join(`
2889
2929
  `)
2890
- } : "cssHref" in r ? {
2930
+ } : "cssHref" in n ? {
2891
2931
  tag: "link",
2892
2932
  attrs: {
2893
2933
  rel: "stylesheet",
2894
- href: r.cssHref,
2895
- id: r.id
2934
+ href: n.cssHref,
2935
+ id: n.id
2896
2936
  }
2897
- } : r
2937
+ } : n
2898
2938
  ) : void 0;
2899
2939
  }
2900
2940
  },
@@ -2906,7 +2946,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2906
2946
  async buildStart() {
2907
2947
  if (e.viteCommand !== "serve")
2908
2948
  return;
2909
- const i = (await ue(e)).flatMap((s) => {
2949
+ const i = (await pe(e)).flatMap((s) => {
2910
2950
  if ("javascriptCode" in s)
2911
2951
  return s.optimizableImports;
2912
2952
  if ("cssHref" in s)
@@ -2921,40 +2961,38 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2921
2961
  await e._updateLuminaTsPromise;
2922
2962
  }
2923
2963
  });
2924
- async function On(e) {
2925
- const i = (await Promise.all([ie, Li(e)])).flat();
2964
+ async function Jn(e) {
2965
+ const i = (await Promise.all([ie, Mi(e)])).flat();
2926
2966
  if (!await Ki(i, e.dir.src))
2927
2967
  return;
2928
- let r = !1;
2929
- function n() {
2930
- r || E.warn(be, Mn), r = !0;
2968
+ let n = !1;
2969
+ function r() {
2970
+ n || $.warn(be, Bn), n = !0;
2931
2971
  }
2932
2972
  process.on("exit", () => {
2933
- n(), clearTimeout(c);
2973
+ r(), clearTimeout(c);
2934
2974
  });
2935
- const c = setTimeout(n, 2e3);
2975
+ const c = setTimeout(r, 2e3);
2936
2976
  }
2937
- const Mn = js(
2977
+ const Bn = js(
2938
2978
  "greenBright",
2939
2979
  `lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
2940
2980
  If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
2941
- ), Jn = { node: "^24.11" }, V = {
2942
- engines: Jn
2943
- };
2944
- async function Bn(e) {
2981
+ );
2982
+ async function Kn(e) {
2945
2983
  const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Ds(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
2946
2984
  e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? ae(e.options.documentation.apiJsonFileName) : le.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
2947
2985
  {
2948
2986
  type: "dynamic",
2949
- source: () => JSON.stringify(e.apiJson, null, Ze(e)),
2950
- destination: m.join("../..", e._documentationFileNames.apiJson)
2987
+ source: () => JSON.stringify(e.apiJson, null, Qe(e)),
2988
+ destination: u.join("../..", e._documentationFileNames.apiJson)
2951
2989
  }
2952
2990
  ]);
2953
2991
  const s = i?.types?.typeScriptConfig ?? Rs(
2954
2992
  process.cwd(),
2955
2993
  e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
2956
2994
  !0
2957
- ), r = {
2995
+ ), n = {
2958
2996
  ...s,
2959
2997
  config: {
2960
2998
  ...s.config,
@@ -2965,7 +3003,7 @@ async function Bn(e) {
2965
3003
  }
2966
3004
  }
2967
3005
  };
2968
- let n = !1;
3006
+ let r = !1;
2969
3007
  const a = {
2970
3008
  context: {
2971
3009
  apiJsonEmitPath: "",
@@ -2977,7 +3015,7 @@ async function Bn(e) {
2977
3015
  declarationTextTransformers: e.options.types?.declarationTextTransformers?.map(
2978
3016
  (l) => (p) => l(p, e)
2979
3017
  ),
2980
- typeScriptConfig: r,
3018
+ typeScriptConfig: n,
2981
3019
  // Already merged, so pass empty object to avoid merging again
2982
3020
  compilerOptions: {}
2983
3021
  },
@@ -2994,17 +3032,17 @@ async function Bn(e) {
2994
3032
  if (e.apiJsonDeferred.resolve(), e.apiJsonDeferred = void 0, p !== void 0) {
2995
3033
  if (e.viteCommand === "serve")
2996
3034
  if ([...p.addedModules, ...p.removedModules].some(
2997
- (f) => Ee(f.sourcePath, "src/components/")
3035
+ (f) => Ce(f.sourcePath, "src/components/")
2998
3036
  ))
2999
3037
  It(e), kt(e);
3000
3038
  else {
3001
3039
  for (const f of p.changedModules) {
3002
- if (!Ee(f.new.sourcePath, "src/components/"))
3040
+ if (!Ce(f.new.sourcePath, "src/components/"))
3003
3041
  continue;
3004
3042
  const g = f.old.declarations.find(
3005
- (v) => v.customElement === !0
3043
+ (y) => y.customElement === !0
3006
3044
  ), h = f.new.declarations.find(
3007
- (v) => v.customElement === !0
3045
+ (y) => y.customElement === !0
3008
3046
  );
3009
3047
  if (g === void 0 && h === void 0)
3010
3048
  continue;
@@ -3012,17 +3050,17 @@ async function Bn(e) {
3012
3050
  kt(e);
3013
3051
  break;
3014
3052
  }
3015
- const y = yi(h);
3016
- e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
3053
+ const v = gi(h);
3054
+ e.server.ws.send({ type: "custom", event: "component-meta-update", data: v });
3017
3055
  }
3018
3056
  It(e);
3019
3057
  }
3020
- Dt(e, p.apiJson);
3058
+ Ft(e, p.apiJson);
3021
3059
  }
3022
3060
  }
3023
3061
  },
3024
3062
  afterApiJsonCreate: (l) => {
3025
- e.options.apiJson?.afterCreate?.(l.apiJson, !n), n = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Dt(e, l.apiJson));
3063
+ e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Ft(e, l.apiJson));
3026
3064
  }
3027
3065
  }, c = i === void 0 ? a : vt(i, a);
3028
3066
  e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
@@ -3031,84 +3069,84 @@ async function Bn(e) {
3031
3069
  e.apiExtractor = l, d?.(l);
3032
3070
  };
3033
3071
  }
3034
- function Dt(e, t) {
3035
- const i = { ...t, modules: [] }, s = [], r = e.viteCommand === "build" ? [] : void 0;
3036
- for (const n of t.modules) {
3037
- const a = { ...n, declarations: [] };
3072
+ function Ft(e, t) {
3073
+ const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
3074
+ for (const r of t.modules) {
3075
+ const a = { ...r, declarations: [] };
3038
3076
  let c = !1;
3039
- for (const d of n.declarations) {
3077
+ for (const d of r.declarations) {
3040
3078
  if (d.customElement !== !0) {
3041
3079
  a.declarations.push(d);
3042
3080
  continue;
3043
3081
  }
3044
3082
  const l = d;
3045
- if (r?.push(n.sourcePath), l.privacy !== void 0) {
3083
+ if (n?.push(r.sourcePath), l.privacy !== void 0) {
3046
3084
  c = !0;
3047
3085
  continue;
3048
3086
  }
3049
3087
  const p = {
3050
3088
  ...l,
3051
- members: l.members.filter((u) => u.privacy === void 0)
3089
+ members: l.members.filter((m) => m.privacy === void 0)
3052
3090
  };
3053
3091
  a.declarations.push(p), s.push(p);
3054
3092
  }
3055
3093
  c || i.modules.push(a);
3056
3094
  }
3057
- e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, r !== void 0 && (e.componentFilesPromise = Promise.resolve(r));
3095
+ e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
3058
3096
  }
3059
- var Kn = Object.defineProperty, I = (e, t, i, s) => {
3060
- for (var r = void 0, n = e.length - 1, a; n >= 0; n--)
3061
- (a = e[n]) && (r = a(t, i, r) || r);
3062
- return r && Kn(t, i, r), r;
3097
+ var _n = Object.defineProperty, k = (e, t, i, s) => {
3098
+ for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
3099
+ (a = e[r]) && (n = a(t, i, n) || n);
3100
+ return n && _n(t, i, n), n;
3063
3101
  };
3064
- const J = "@arcgis/lumina:context";
3065
- class $ {
3102
+ const q = "@arcgis/lumina:context";
3103
+ class P {
3066
3104
  constructor(t) {
3067
3105
  this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._plugin = {
3068
- name: J,
3106
+ name: q,
3069
3107
  // Make sure these globals are available to all plugins as soon as possible
3070
3108
  enforce: "pre",
3071
- apply: (p, u) => (this._inferBuildSetup(u, p.define), !0),
3109
+ apply: (r, a) => (this._inferBuildSetup(a, r.define), !0),
3072
3110
  configResolved: {
3073
3111
  order: "pre",
3074
- handler: (p) => {
3075
- this.viteConfig = p;
3076
- const u = p.build.minify !== !1;
3077
- this.shouldMinify = u && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3078
- const f = m.join(p.root, m.sep), g = m.join(f, "src", m.sep), h = m.join(g, "components", m.sep), y = m.join(m.resolve(f, p.build.outDir), m.sep), v = m.join(m.relative(f, y), m.sep), C = m.join(y, "components", m.sep), S = m.join(y, this.options.build?.cdn?.namespace ?? ne, m.sep), k = m.join(S, "assets", m.sep);
3112
+ handler: (r) => {
3113
+ this.viteConfig = r;
3114
+ const a = r.build.minify !== !1;
3115
+ this.shouldMinify = a && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3116
+ 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 ?? ne, u.sep), h = u.join(g, "assets", u.sep);
3079
3117
  if (this.dir = {
3080
- root: f,
3081
- src: g,
3082
- srcComponents: h,
3083
- relativeDist: v,
3084
- dist: y,
3085
- distComponents: C,
3086
- distCdn: S,
3087
- distCdnAssets: k
3088
- }, E.initialize(p.logger, f), p.root !== Qt())
3118
+ root: c,
3119
+ src: d,
3120
+ srcComponents: l,
3121
+ relativeDist: m,
3122
+ dist: p,
3123
+ distComponents: f,
3124
+ distCdn: g,
3125
+ distCdnAssets: h
3126
+ }, $.initialize(r.logger, c), r.root !== Xt())
3089
3127
  throw Error(
3090
3128
  b(
3091
- J,
3092
- "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/arcgis-web-components/issues/2126 or contact Lumina maintainers."
3129
+ q,
3130
+ "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."
3093
3131
  )
3094
3132
  );
3095
- y === f ? E.warn(
3096
- J,
3133
+ p === c ? $.warn(
3134
+ q,
3097
3135
  "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/)"
3098
- ) : v.startsWith("..") && E.warn(
3099
- J,
3136
+ ) : m.startsWith("..") && $.warn(
3137
+ q,
3100
3138
  "Vite output directory is outside the root directory. This is not officially supported by Lumina and may lead to unexpected behavior. Contact Lumina maintainers if you need this to be supported."
3101
- ), this.isInStorybook = p.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(p.server?.hmr ?? !0), this.isInBuildWatch = p.command === "build" && p.build.watch != null;
3102
- const T = this.isInTest && p.test?.browser?.enabled === !0 && p.resolve.conditions.includes("node"), x = this.isInTest && p.test?.browser?.enabled !== !0 && p.resolve.conditions.includes("node"), w = this.viteCommand === "serve" && process.argv[1].includes("vite-node");
3103
- this.apiJsonEnabled = !T && !this.isInPuppeteerTestBackEnd && !x && !w, this.apiJsonEnabled ? (this.apiExtractorPluginConfig.serve = {
3139
+ ), this.isInStorybook = r.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(r.server?.hmr ?? !0), this.isInBuildWatch = r.command === "build" && r.build.watch != null;
3140
+ const v = this.isInTest && r.test?.browser?.enabled === !0 && r.resolve.conditions.includes("node"), y = this.isInTest && r.test?.browser?.enabled !== !0 && r.resolve.conditions.includes("node"), S = this.viteCommand === "serve" && process.argv[1].includes("vite-node");
3141
+ this.apiJsonEnabled = !v && !this.isInPuppeteerTestBackEnd && !y && !S, this.apiJsonEnabled ? (this.apiExtractorPluginConfig.serve = {
3104
3142
  extract: !0
3105
- }, (this.viteCommand === "build" ? p.build.watch : p.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);
3106
- const L = this.viteCommand === "serve" && !this.isInStorybook, A = this.apiExtractorPluginConfig.unsafeConfigOverride;
3107
- L && (A.context.isLuminaMinimalExtraction = !0, A.types.typeCheckedExtraction = !1, A.types.fullTypeCheck = !1), this.isInStorybook && (A.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
3143
+ }, (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);
3144
+ const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
3145
+ C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
3108
3146
  // Do not downlevel. ESBuild will do that if needed.
3109
3147
  target: o.ScriptTarget.ESNext,
3110
- sourceMap: p.build.sourcemap !== !1
3111
- }), _i(this) && ue(this);
3148
+ sourceMap: r.build.sourcemap !== !1
3149
+ }), _i(this) && pe(this);
3112
3150
  }
3113
3151
  },
3114
3152
  configureServer: {
@@ -3120,52 +3158,39 @@ class $ {
3120
3158
  /**
3121
3159
  * Workaround for a Vite bug.
3122
3160
  *
3123
- * @see https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/5414
3161
+ * @see https://devtopia.esri.com/WebGIS/webgis-sdk/issues/5414
3124
3162
  * @see https://github.com/vitejs/vite/issues/20053
3125
3163
  */
3126
- transformIndexHtml: (p) => {
3164
+ transformIndexHtml: (r) => {
3127
3165
  if (this.isInStorybook && this.viteCommand === "build")
3128
- return p.replaceAll(/<script type="module" crossorigin src="@arcgis\/core\/[^"]+"><\/script>/gu, "");
3166
+ return r.replaceAll(/<script type="module" crossorigin src="@arcgis\/core\/[^"]+"><\/script>/gu, "");
3129
3167
  }
3130
3168
  }, this.apiExtractor = void 0, this.apiJsonDeferred = void 0, this._localDefinedComponents = void 0, this.isInCi = !!process.env.CI, this._serverConfigured = !1, this.assetsToProvide = [], this._globalCssString = void 0, this._loadersCache = void 0, this._serveOnlyDependencies = void 0, this._customElementDependencies = /* @__PURE__ */ Object.create(null), this._silencedRules = void 0, this._updateLuminaTsPromise = void 0, this._originalRollupInputOptions = void 0, this.options = t;
3131
- const i = 3;
3132
- (!V.engines.node.startsWith("^") || V.engines.node[i] !== ".") && E.error(
3133
- J,
3134
- `Unsupported Node.js version syntax used in monorepo's package.json. Expected "^NN.NN", got "${V.engines.node}". Update @arcgis/lumina-compiler to support this syntax.`
3135
- );
3136
- const s = Number.parseInt(V.engines.node.slice(1, i)), r = Number.parseInt(V.engines.node.slice(i + 1)), n = Number.parseInt(process.version.slice(1, i)), a = Number.parseInt(process.version.slice(i + 1));
3137
- n < s || n === s && a < r ? E.warn(
3138
- J,
3139
- `Lumina requires Node.js version ${V.engines.node}. Current version is ${process.version}. Some features may not work as expected.`
3140
- ) : n > s && E.info(
3141
- J,
3142
- `Lumina was tested with Node.js version ${V.engines.node}. Current version is ${process.version}. Some features may not work as expected.`
3143
- );
3144
- const c = t.documentation ?? {};
3169
+ const i = t.documentation ?? {};
3145
3170
  this._documentationFileNames = {
3146
3171
  // Will be set once api-extractor.config.ts is loaded
3147
3172
  apiJson: void 0,
3148
- stencilLikeDocsJson: c.stencilLikeDocsJsonFileName === !1 ? void 0 : c.stencilLikeDocsJsonFileName ? ae(c.stencilLikeDocsJsonFileName) : le.stencilLikeDocsJson,
3149
- webTypes: c.jetBrains === !1 ? void 0 : c.jetBrains?.webTypesFileName ? ae(c.jetBrains.webTypesFileName) : le.webTypes,
3150
- vsCodeHtml: c.vsCode === !1 ? void 0 : c.vsCode?.htmlFileName ? ae(c.vsCode.htmlFileName) : le.vsCodeHtml,
3151
- vsCodeCss: c.vsCode === !1 ? void 0 : c.vsCode?.cssFileName ? ae(c.vsCode.cssFileName) : le.vsCodeCss
3152
- }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Bn(this);
3153
- const d = process.cwd().length + 1;
3173
+ stencilLikeDocsJson: i.stencilLikeDocsJsonFileName === !1 ? void 0 : i.stencilLikeDocsJsonFileName ? ae(i.stencilLikeDocsJsonFileName) : le.stencilLikeDocsJson,
3174
+ webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? ae(i.jetBrains.webTypesFileName) : le.webTypes,
3175
+ vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? ae(i.vsCode.htmlFileName) : le.vsCodeHtml,
3176
+ vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? ae(i.vsCode.cssFileName) : le.vsCodeCss
3177
+ }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Kn(this);
3178
+ const s = process.cwd().length + 1;
3154
3179
  this.componentFilesPromise = this.configsPromise.then(() => {
3155
- const p = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, u = [];
3156
- for (let f = 0; f < p.length; ++f) {
3157
- const h = p[f].slice(d);
3158
- Ee(h, "src/components") && u.push(h);
3180
+ const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
3181
+ for (let c = 0; c < r.length; ++c) {
3182
+ const l = r[c].slice(s);
3183
+ Ce(l, "src/components") && a.push(l);
3159
3184
  }
3160
- return u;
3161
- }), bi(void 0, t);
3162
- const l = t.build?.preamble ?? Ln();
3163
- this.banner = jn(l);
3185
+ return a;
3186
+ }), yi(void 0, t);
3187
+ const n = t.build?.preamble ?? Fn();
3188
+ this.banner = Dn(n);
3164
3189
  }
3165
3190
  _inferBuildSetup({ command: t, mode: i }, s) {
3166
- this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (E.warn(vi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3167
- const r = s?.__IS_IN_PUPPETEER__ === !0, n = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
3168
- this.isInPuppeteerTestBackEnd = n && !r, this.isInPuppeteerTestFrontEnd = n && r;
3191
+ this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : ($.warn(hi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3192
+ const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
3193
+ this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
3169
3194
  }
3170
3195
  /**
3171
3196
  * Get TypeScript ts.SourceFile based on file name and code. Reuses existing
@@ -3173,37 +3198,41 @@ class $ {
3173
3198
  * changed.
3174
3199
  */
3175
3200
  getSourceFile(t, i) {
3176
- const s = this.apiExtractor?.program, r = s?.getTypeChecker !== void 0;
3177
- let n;
3178
- if (s !== void 0 && (n = s.getSourceFile(t), n === void 0 && r))
3201
+ const s = this.apiExtractor?.program, n = s?.getTypeChecker !== void 0;
3202
+ let r;
3203
+ if (s !== void 0 && (r = s.getSourceFile(t), r === void 0 && n))
3179
3204
  throw Error(
3180
3205
  b(
3181
- J,
3206
+ q,
3182
3207
  t,
3183
3208
  "Unable to find the TypeScript source file. Expected all files that are part of Vite's transform to also be part of TypeScript program."
3184
3209
  )
3185
3210
  );
3186
- if (n === void 0 && !r) {
3211
+ if (r === void 0 && !n) {
3187
3212
  const c = this._typeScriptSourceFiles.get(t);
3188
3213
  if (c?.text === i)
3189
3214
  return c;
3190
3215
  }
3191
- return i !== n?.text && ((this.viteCommand !== "serve" || this.isInStorybook) && E.warn(
3192
- J,
3216
+ return i !== r?.text && ((this.viteCommand !== "serve" || this.isInStorybook) && $.warn(
3217
+ q,
3193
3218
  "The Vite's transform() content didn't match TypeScript's content. This may happen if some plugin transformed a file before Lumina or Vite got out of sync with TypeScript. This may lead to false errors. Debug your build configuration or report it as a bug",
3194
3219
  t
3195
- ), n = o.createSourceFile(
3220
+ ), r = o.createSourceFile(
3196
3221
  t,
3197
3222
  i,
3198
- n?.languageVersion ?? o.ScriptTarget.Latest,
3223
+ r?.languageVersion ?? o.ScriptTarget.Latest,
3199
3224
  !1,
3200
3225
  o.ScriptKind.TSX
3201
- ), r || this._typeScriptSourceFiles.set(t, n)), n;
3226
+ ), n || this._typeScriptSourceFiles.set(t, r)), r;
3202
3227
  }
3203
3228
  /**
3204
3229
  * A utility for making Vite copy assets to the output folder during build or
3205
3230
  * making Vite serve them when running in serve mode
3206
3231
  *
3232
+ * @public
3233
+ * @param assets
3234
+ * @param transformers
3235
+ * @param apply
3207
3236
  * @example
3208
3237
  * ```ts
3209
3238
  * // vite.config.ts
@@ -3231,102 +3260,102 @@ class $ {
3231
3260
  if (Array.isArray(this.assetsToProvide))
3232
3261
  this.assetsToProvide.push({ assets: t, transformers: i, apply: s });
3233
3262
  else if (this.viteCommand === "serve")
3234
- s === "serve" && de(this, t, i);
3263
+ s === "serve" && Z(this, t, i);
3235
3264
  else
3236
3265
  throw Error(
3237
3266
  b(
3238
- J,
3267
+ q,
3239
3268
  "It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
3240
3269
  )
3241
3270
  );
3242
3271
  }
3243
3272
  logLintWarning(t) {
3244
- E.warn("@arcgis/lumina:linting", t);
3273
+ $.warn("@arcgis/lumina:linting", t);
3245
3274
  }
3246
3275
  logLintError(t, i, s) {
3247
- this._silencedRules?.[t]?.includes(i.slice(this.dir.root.length)) !== !0 ? E.error("@arcgis/lumina:linting", s, i) : E.warn("@arcgis/lumina:linting", s, i);
3276
+ this._silencedRules?.[t]?.includes(i.slice(this.dir.root.length)) !== !0 ? $.error("@arcgis/lumina:linting", s, i) : $.warn("@arcgis/lumina:linting", s, i);
3248
3277
  }
3249
3278
  }
3250
- I([
3251
- P("configResolved()")
3252
- ], $.prototype, "shouldMinify");
3253
- I([
3254
- P("configResolved()")
3255
- ], $.prototype, "shouldMinifyJsx");
3256
- I([
3257
- P("configResolved()")
3258
- ], $.prototype, "dir");
3259
- I([
3260
- P("load()")
3261
- ], $.prototype, "apiJson");
3262
- I([
3263
- P("load()")
3264
- ], $.prototype, "apiJsonComponents");
3265
- I([
3266
- P("load()")
3267
- ], $.prototype, "privateApiJson");
3268
- I([
3269
- P("configResolved()")
3270
- ], $.prototype, "apiJsonEnabled");
3271
- I([
3272
- P("apply()")
3273
- ], $.prototype, "environment");
3274
- I([
3275
- P("apply()")
3276
- ], $.prototype, "isInTest");
3277
- I([
3278
- P("apply()")
3279
- ], $.prototype, "isInPuppeteerTestBackEnd");
3280
- I([
3281
- P("apply()")
3282
- ], $.prototype, "isInPuppeteerTestFrontEnd");
3283
- I([
3284
- P("configResolved()")
3285
- ], $.prototype, "isInBuildWatch");
3286
- I([
3287
- P("configResolved()")
3288
- ], $.prototype, "isInStorybook");
3289
- I([
3290
- P("configResolved()")
3291
- ], $.prototype, "hmrEnabled");
3292
- I([
3293
- P("apply()")
3294
- ], $.prototype, "viteCommand");
3295
- I([
3296
- P("configResolved()")
3297
- ], $.prototype, "isFullApiExtraction");
3298
- I([
3299
- P("configResolved()")
3300
- ], $.prototype, "viteConfig");
3301
- I([
3302
- P("configureServer()")
3303
- ], $.prototype, "server");
3304
- I([
3305
- P("transform()")
3306
- ], $.prototype, "_globalHydratedCssString");
3307
- I([
3308
- P("configResolved()")
3309
- ], $.prototype, "_typeScriptPrinter");
3310
- function _n(e, t, i) {
3311
- const s = wi()[t] ?? Ui(e)[t];
3279
+ k([
3280
+ I("configResolved()")
3281
+ ], P.prototype, "shouldMinify");
3282
+ k([
3283
+ I("configResolved()")
3284
+ ], P.prototype, "shouldMinifyJsx");
3285
+ k([
3286
+ I("configResolved()")
3287
+ ], P.prototype, "dir");
3288
+ k([
3289
+ I("load()")
3290
+ ], P.prototype, "apiJson");
3291
+ k([
3292
+ I("load()")
3293
+ ], P.prototype, "apiJsonComponents");
3294
+ k([
3295
+ I("load()")
3296
+ ], P.prototype, "privateApiJson");
3297
+ k([
3298
+ I("configResolved()")
3299
+ ], P.prototype, "apiJsonEnabled");
3300
+ k([
3301
+ I("apply()")
3302
+ ], P.prototype, "environment");
3303
+ k([
3304
+ I("apply()")
3305
+ ], P.prototype, "isInTest");
3306
+ k([
3307
+ I("apply()")
3308
+ ], P.prototype, "isInPuppeteerTestBackEnd");
3309
+ k([
3310
+ I("apply()")
3311
+ ], P.prototype, "isInPuppeteerTestFrontEnd");
3312
+ k([
3313
+ I("configResolved()")
3314
+ ], P.prototype, "isInBuildWatch");
3315
+ k([
3316
+ I("configResolved()")
3317
+ ], P.prototype, "isInStorybook");
3318
+ k([
3319
+ I("configResolved()")
3320
+ ], P.prototype, "hmrEnabled");
3321
+ k([
3322
+ I("apply()")
3323
+ ], P.prototype, "viteCommand");
3324
+ k([
3325
+ I("configResolved()")
3326
+ ], P.prototype, "isFullApiExtraction");
3327
+ k([
3328
+ I("configResolved()")
3329
+ ], P.prototype, "viteConfig");
3330
+ k([
3331
+ I("configureServer()")
3332
+ ], P.prototype, "server");
3333
+ k([
3334
+ I("transform()")
3335
+ ], P.prototype, "_globalHydratedCssString");
3336
+ k([
3337
+ I("configResolved()")
3338
+ ], P.prototype, "_typeScriptPrinter");
3339
+ function Un(e, t, i) {
3340
+ const s = vi()[t] ?? Ui(e)[t];
3312
3341
  if (s === void 0) {
3313
3342
  if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
3314
3343
  return;
3315
- const r = xe(i);
3344
+ const n = Ae(i);
3316
3345
  throw Error(
3317
3346
  b(
3318
3347
  "@arcgis/lumina:resolveTagName",
3319
- `Unable to resolve the definition of the "${t}" custom element. Used in ${r}. If this is coming from an external package, make sure that package is installed as a peerDependency or a dependency. If in development-only you wish to use a component package that is defined as a devDependency, then provide serve.extraDependencies option to useLumina()`
3348
+ `Unable to resolve the definition of the "${t}" custom element. Used in ${n}. If this is coming from an external package, make sure that package is installed as a peerDependency or a dependency. If in development-only you wish to use a component package that is defined as a devDependency, then provide serve.extraDependencies option to useLumina()`
3320
3349
  )
3321
3350
  );
3322
3351
  }
3323
3352
  return s;
3324
3353
  }
3325
- function Un(e, t) {
3326
- return e.packageName === void 0 ? fe(t, e.modulePath) : m.join(e.packageName, e.modulePath);
3354
+ function Wn(e, t) {
3355
+ return e.packageName === void 0 ? fe(t, e.modulePath) : u.join(e.packageName, e.modulePath);
3327
3356
  }
3328
3357
  function Ui(e) {
3329
- return e._localDefinedComponents ??= Ei(
3358
+ return e._localDefinedComponents ??= wi(
3330
3359
  e.privateApiJson,
3331
3360
  {
3332
3361
  packageName: void 0,
@@ -3337,35 +3366,35 @@ function Ui(e) {
3337
3366
  e.viteCommand === "build"
3338
3367
  ), e._localDefinedComponents;
3339
3368
  }
3340
- const Rt = "makeRuntime(", Wn = "@arcgis/core", zn = "@arcgis/lumina:injectRuntimeOptions", Hn = (e) => ({
3341
- name: zn,
3369
+ const Dt = "makeRuntime(", zn = "@arcgis/core", Hn = "@arcgis/lumina:injectRuntimeOptions", qn = (e) => ({
3370
+ name: Hn,
3342
3371
  transform: {
3343
3372
  filter: {
3344
3373
  id: /\/src\/runtime\.ts$/u
3345
3374
  },
3346
3375
  handler(t, i) {
3347
- const s = t.indexOf(Rt);
3376
+ const s = t.indexOf(Dt);
3348
3377
  if (s === -1)
3349
3378
  throw new Error(
3350
3379
  `Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
3351
3380
  );
3352
- const r = s + Rt.length, n = e.options.css?.commonStylesPath;
3381
+ const n = s + Dt.length, r = e.options.css?.commonStylesPath;
3353
3382
  return {
3354
3383
  code: [
3355
- n === void 0 ? "" : `import commonStyles from "${fe(e.dir.src, n)}${Te}";`,
3356
- t.slice(0, r),
3384
+ r === void 0 ? "" : `import commonStyles from "${fe(e.dir.src, r)}${Te}";`,
3385
+ t.slice(0, n),
3357
3386
  "{",
3358
3387
  "defaultAssetPath:import.meta.env.BASE_URL,",
3359
3388
  'hydratedAttribute:"',
3360
- e.options.css?.hydratedAttribute ?? gi,
3389
+ e.options.css?.hydratedAttribute ?? ui,
3361
3390
  '",',
3362
- n === void 0 ? "" : "commonStyles",
3391
+ r === void 0 ? "" : "commonStyles",
3363
3392
  "}",
3364
- t.slice(r),
3393
+ t.slice(n),
3365
3394
  // Dependency injection. Lumina cannot directly import these to avoid
3366
3395
  // a cyclical dependency.
3367
- Ae ? `
3368
- import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Wn}/applications/Components/reactiveUtils.js";
3396
+ ue ? `
3397
+ import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${zn}/applications/Components/reactiveUtils.js";
3369
3398
  createObservable,
3370
3399
  runtime.t = trackAccess;
3371
3400
  runtime.o = createObservable;
@@ -3377,41 +3406,41 @@ runtime.r = runTracked;` : ""
3377
3406
  }
3378
3407
  }
3379
3408
  });
3380
- function qn(e) {
3381
- return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Q}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3409
+ function Vn(e) {
3410
+ return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3382
3411
  `;
3383
3412
  }
3384
- const ve = "@arcgis/lumina:addNonLazyImports", Vn = (e) => ({
3413
+ const ve = "@arcgis/lumina:addNonLazyImports", Gn = (e) => ({
3385
3414
  name: ve,
3386
3415
  apply: () => e.viteCommand === "build",
3387
3416
  generateBundle(t, i) {
3388
- const r = e.viteConfig.build.sourcemap !== !1 ? " " : `
3417
+ const n = e.viteConfig.build.sourcemap !== !1 ? " " : `
3389
3418
  `;
3390
- let n = !1;
3419
+ let r = !1;
3391
3420
  if (Object.entries(i).forEach(([a, c]) => {
3392
3421
  const d = We(a, e.apiExtractor);
3393
3422
  if (d !== a && (c.fileName = d), c.type === "chunk") {
3394
- const l = m.dirname(m.join(e.dir.dist, a)), p = d === a ? l : m.dirname(m.join(e.dir.dist, d));
3395
- let u = c.code;
3396
- u = Wr(u, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (n = !0, u = qn(e) + u), u = `${e.banner}${r}${u}`, c.code = u;
3423
+ const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
3424
+ let m = c.code;
3425
+ m = Xr(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = Vn(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
3397
3426
  }
3398
- }), !n && !e.isInStorybook)
3427
+ }), !r && !e.isInStorybook)
3399
3428
  throw Error(b(ve, "Expected to find a chunks/runtime.js file in the Vite's build output."));
3400
3429
  },
3401
3430
  async writeBundle() {
3402
3431
  if (e.isInStorybook)
3403
3432
  return;
3404
3433
  const t = e._customElementDependencies, i = Object.entries(t), s = new Set(
3405
- i.map(([n]) => n).filter((n) => Ee(n, e.dir.srcComponents))
3434
+ i.map(([r]) => r).filter((r) => Ce(r, e.dir.srcComponents))
3406
3435
  );
3407
- i.forEach(([n, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
3408
- if (s.has(n) || a.length === 0 && c.length === 0)
3436
+ i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
3437
+ if (s.has(r) || a.length === 0 && c.length === 0)
3409
3438
  return;
3410
3439
  const l = Wi(t, d, s);
3411
3440
  if (l.forEach((p) => {
3412
3441
  t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
3413
3442
  }), (a.length > 0 || c.length > 0) && l.length === 0) {
3414
- const p = xe(n);
3443
+ const p = Ae(r);
3415
3444
  throw Error(
3416
3445
  b(
3417
3446
  ve,
@@ -3425,42 +3454,42 @@ Possible causes:
3425
3454
  );
3426
3455
  }
3427
3456
  });
3428
- const r = i.flatMap(async ([n, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
3429
- if (!s.has(n))
3457
+ const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
3458
+ if (!s.has(r))
3430
3459
  return [];
3431
- const d = m.dirname(n), l = e.dir.src + We(d.slice(e.dir.src.length), e.apiExtractor), p = m.relative(e.dir.src, l);
3432
- function u(T) {
3433
- const x = _n(e, T, n);
3460
+ const d = u.dirname(r), l = e.dir.src + We(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
3461
+ function m(T) {
3462
+ const x = Un(e, T, r);
3434
3463
  if (x === void 0)
3435
3464
  return;
3436
- const w = Un(x, p);
3465
+ const w = Wn(x, p);
3437
3466
  if (w !== `./${p}`)
3438
- return w.startsWith(".") ? `${w}/${Ot}` : w;
3467
+ return w.startsWith(".") ? `${w}/${Rt}` : w;
3439
3468
  }
3440
- const f = new Set(a), g = new Set(c), h = Array.from(f, u).filter(F), y = (T) => `import "${T}";
3441
- `, v = h.map(y).join(""), C = Array.from(g, (T) => {
3442
- const x = u(T);
3469
+ const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(j), v = (T) => `import "${T}";
3470
+ `, y = h.map(v).join(""), S = Array.from(g, (T) => {
3471
+ const x = m(T);
3443
3472
  if (x !== void 0) {
3444
3473
  if (f.has(T)) {
3445
- E.warn(
3474
+ $.warn(
3446
3475
  ve,
3447
- `"${T}" is used both with and without deferLoad in ${n} (either directly in ${n} or via a functional component). deferLoad will be ignored in this case.`
3476
+ `"${T}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
3448
3477
  );
3449
3478
  return;
3450
3479
  }
3451
3480
  return `.set("${T}", () => import("${x}"))
3452
3481
  `;
3453
3482
  }
3454
- }).filter(F), S = `${v}export * from "./${ot}";`, k = C.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3455
- ${S}
3456
- deferredLoaders${C.join("")};` : S;
3457
- return await U(m.join(e.dir.dist, p, Ot), k);
3483
+ }).filter(j), C = `${y}export * from "./${at}";`, E = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3484
+ ${C}
3485
+ deferredLoaders${S.join("")};` : C;
3486
+ return await _(u.join(e.dir.dist, p, Rt), E);
3458
3487
  });
3459
- await Promise.all(r);
3488
+ await Promise.all(n);
3460
3489
  }
3461
- }), Ot = "index.js", Wi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((r) => i.has(r) ? [r] : s.has(r) ? [] : (s.add(r), Wi(e, e[r].referencedBy, i, s)));
3462
- function Mt(e, t, i) {
3463
- if (Z(e))
3490
+ }), Rt = "index.js", Wi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), Wi(e, e[n].referencedBy, i, s)));
3491
+ function Ot(e, t, i) {
3492
+ if (Q(e))
3464
3493
  return e;
3465
3494
  {
3466
3495
  i === void 0 && t.neededImports.add("nothing");
@@ -3474,18 +3503,18 @@ function Mt(e, t, i) {
3474
3503
  );
3475
3504
  }
3476
3505
  }
3477
- function Z(e) {
3506
+ function Q(e) {
3478
3507
  return (
3479
3508
  // Inlined string literal
3480
3509
  typeof e == "string" || // Syntax kinds that are never undefined
3481
- Gn.has(e.kind) || // Ternary with both branches never undefined
3482
- o.isConditionalExpression(e) && Z(e.whenTrue) && Z(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
3483
- o.isBinaryExpression(e) && (Xn.has(e.operatorToken.kind) || Z(e.left) && Z(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3484
- (o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Z(e.expression) || // JSX that got converted to html`<p>Something</p>`
3510
+ Xn.has(e.kind) || // Ternary with both branches never undefined
3511
+ o.isConditionalExpression(e) && Q(e.whenTrue) && Q(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
3512
+ o.isBinaryExpression(e) && (Yn.has(e.operatorToken.kind) || Q(e.left) && Q(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3513
+ (o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Q(e.expression) || // JSX that got converted to html`<p>Something</p>`
3485
3514
  o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Qs.has(e.tag.text)
3486
3515
  );
3487
3516
  }
3488
- const Gn = /* @__PURE__ */ new Set([
3517
+ const Xn = /* @__PURE__ */ new Set([
3489
3518
  o.SyntaxKind.NumericLiteral,
3490
3519
  o.SyntaxKind.BigIntLiteral,
3491
3520
  o.SyntaxKind.StringLiteral,
@@ -3504,7 +3533,7 @@ const Gn = /* @__PURE__ */ new Set([
3504
3533
  o.SyntaxKind.ClassExpression,
3505
3534
  // Trust? Trust.
3506
3535
  o.SyntaxKind.NonNullExpression
3507
- ]), Xn = /* @__PURE__ */ new Set([
3536
+ ]), Yn = /* @__PURE__ */ new Set([
3508
3537
  o.SyntaxKind.PlusEqualsToken,
3509
3538
  o.SyntaxKind.MinusEqualsToken,
3510
3539
  o.SyntaxKind.AsteriskAsteriskEqualsToken,
@@ -3539,28 +3568,28 @@ const Gn = /* @__PURE__ */ new Set([
3539
3568
  o.SyntaxKind.SlashToken,
3540
3569
  o.SyntaxKind.PercentToken,
3541
3570
  o.SyntaxKind.AsteriskAsteriskToken
3542
- ]), Yn = {
3571
+ ]), Qn = {
3543
3572
  property(e, t, i, s) {
3544
- const r = Qn(s, i, e), n = r?.type === "stringifiedReflected", a = r?.type === "reflected" || n;
3573
+ const n = Zn(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
3545
3574
  if (a) {
3546
3575
  const f = _e(t);
3547
3576
  if (f === !0)
3548
- return [r.name];
3577
+ return [n.name];
3549
3578
  if (f === !1)
3550
3579
  return [];
3551
3580
  }
3552
3581
  const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : we(e, t, a), d = c[0] !== "=";
3553
3582
  if (a && d)
3554
- return [r.name, ...c];
3555
- const [l, p] = c, u = r?.type === "stringifiedNonReflected";
3556
- if (n || u) {
3557
- const f = Mt(
3583
+ return [n.name, ...c];
3584
+ const [l, p] = c, m = n?.type === "stringifiedNonReflected";
3585
+ if (r || m) {
3586
+ const f = Ot(
3558
3587
  p,
3559
3588
  e,
3560
- u ? "" : void 0
3561
- ), h = i === "value" && (s === "input" || s === "textarea" || s === Ce) ? eo(f, e) : f;
3589
+ m ? "" : void 0
3590
+ ), h = i === "value" && (s === "input" || s === "textarea" || s === Ee) ? to(f, e) : f;
3562
3591
  if (h !== p)
3563
- return [u ? `.${i}` : r.name, l, h];
3592
+ return [m ? `.${i}` : n.name, l, h];
3564
3593
  }
3565
3594
  return [`.${i}`, ...c];
3566
3595
  },
@@ -3570,7 +3599,7 @@ const Gn = /* @__PURE__ */ new Set([
3570
3599
  return [i];
3571
3600
  if (s === !1)
3572
3601
  return [];
3573
- const r = we(e, t, !0), a = r[0] !== "=" ? r : [r[0], Mt(r[1], e)];
3602
+ const n = we(e, t, !0), a = n[0] !== "=" ? n : [n[0], Ot(n[1], e)];
3574
3603
  return [i, ...a];
3575
3604
  },
3576
3605
  booleanAttribute(e, t, i) {
@@ -3582,8 +3611,8 @@ const Gn = /* @__PURE__ */ new Set([
3582
3611
  throw new Error(
3583
3612
  `Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3584
3613
  );
3585
- const s = i.slice(2), r = gt(s);
3586
- return [`@${ai.has(r) ? s.toLowerCase() : gt(s)}=`, ...pt(e, t, void 0)];
3614
+ const s = i.slice(2), n = gt(s);
3615
+ return [`@${ni.has(n) ? s.toLowerCase() : gt(s)}=`, ...pt(e, t, void 0)];
3587
3616
  },
3588
3617
  directives(e, t) {
3589
3618
  if (t === void 0 || !o.isJsxExpression(t))
@@ -3594,12 +3623,12 @@ const Gn = /* @__PURE__ */ new Set([
3594
3623
  throw new Error(
3595
3624
  `Directives prop must be an array rather than a variable or ternary expression. Still, the following are allowed: directives={[directiveA, condition ? a : b, c()]}. Found ${String(t.expression?.getText(e.sourceFile))}`
3596
3625
  );
3597
- return t.expression.elements.flatMap((r) => {
3598
- if (o.isSpreadElement(r))
3626
+ return t.expression.elements.flatMap((n) => {
3627
+ if (o.isSpreadElement(n))
3599
3628
  throw new Error(
3600
3629
  `Directives prop cannot contain a spread argument - it needs to be statically analyzable. Still, the following are allowed: directives={[directiveA, condition ? a : b, c()]}. Found ${String(t.expression?.getText(e.sourceFile))}`
3601
3630
  );
3602
- return q(e, void 0, r);
3631
+ return H(e, void 0, n);
3603
3632
  });
3604
3633
  },
3605
3634
  ref(e, t) {
@@ -3611,15 +3640,15 @@ const Gn = /* @__PURE__ */ new Set([
3611
3640
  (o.isArrowFunction(i) || // ref={this.a.bind(this, args)}
3612
3641
  o.isCallExpression(i) && o.isPropertyAccessExpression(i.expression) && i.expression.name.escapedText === "bind");
3613
3642
  e.neededImports.add(s ? "stabilizedRef" : "ref");
3614
- const r = s ? e.importRenames.stabilizedRef : e.importRenames.ref;
3643
+ const n = s ? e.importRenames.stabilizedRef : e.importRenames.ref;
3615
3644
  return [
3616
- o.factory.createCallExpression(o.factory.createIdentifier(r), void 0, [
3617
- q(e, void 0, t.expression)
3645
+ o.factory.createCallExpression(o.factory.createIdentifier(n), void 0, [
3646
+ H(e, void 0, t.expression)
3618
3647
  ])
3619
3648
  ];
3620
3649
  },
3621
- class: Bt,
3622
- style: Bt,
3650
+ class: Jt,
3651
+ style: Jt,
3623
3652
  key: (e, t) => [ct(t, e.sourceFile)],
3624
3653
  deferLoad(e, t, i, s) {
3625
3654
  if (typeof s != "string")
@@ -3627,29 +3656,29 @@ const Gn = /* @__PURE__ */ new Set([
3627
3656
  if (!rt(s))
3628
3657
  throw Error(`deferLoad prop is only supported on custom elements. Found ${String(s)}`);
3629
3658
  e.neededImports.add("deferLoad");
3630
- const r = e.importRenames.deferLoad;
3631
- return [o.factory.createIdentifier(r)];
3659
+ const n = e.importRenames.deferLoad;
3660
+ return [o.factory.createIdentifier(n)];
3632
3661
  }
3633
3662
  };
3634
- function Qn(e, t, i) {
3663
+ function Zn(e, t, i) {
3635
3664
  if (typeof e == "string") {
3636
- const n = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
3637
- if (n !== void 0)
3638
- return { name: n, type: "reflected" };
3665
+ const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
3666
+ if (r !== void 0)
3667
+ return { name: r, type: "reflected" };
3639
3668
  }
3640
- const s = Ke(W.common, t);
3669
+ const s = Ke(U.common, t);
3641
3670
  if (s !== void 0)
3642
3671
  return s;
3643
3672
  if (typeof e == "string") {
3644
- const r = Ke(W.perElement[e], t);
3645
- if (r !== void 0)
3646
- return r;
3647
- } else {
3648
- const r = Object.values(W.perElement).map(
3649
- (a) => Ke(a, t)
3650
- ), n = ze(r, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ze(r, (a) => a?.type === "stringifiedReflected" ? a : void 0);
3673
+ const n = Ke(U.perElement[e], t);
3651
3674
  if (n !== void 0)
3652
3675
  return n;
3676
+ } else {
3677
+ const n = Object.values(U.perElement).map(
3678
+ (a) => Ke(a, t)
3679
+ ), r = ze(n, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ze(n, (a) => a?.type === "stringifiedReflected" ? a : void 0);
3680
+ if (r !== void 0)
3681
+ return r;
3653
3682
  }
3654
3683
  }
3655
3684
  function Ke(e, t) {
@@ -3659,9 +3688,9 @@ function Ke(e, t) {
3659
3688
  const s = e?.stringifiedReflected?.[t];
3660
3689
  if (s !== void 0)
3661
3690
  return { name: s, type: "stringifiedReflected" };
3662
- const r = e?.stringifiedNonReflected?.[t];
3663
- if (r !== void 0)
3664
- return { name: r, type: "stringifiedNonReflected" };
3691
+ const n = e?.stringifiedNonReflected?.[t];
3692
+ if (n !== void 0)
3693
+ return { name: n, type: "stringifiedNonReflected" };
3665
3694
  }
3666
3695
  function ct(e, t) {
3667
3696
  if (e !== void 0 && o.isJsxExpression(e) && e.expression !== void 0)
@@ -3681,15 +3710,15 @@ function _e(e) {
3681
3710
  }
3682
3711
  }
3683
3712
  function we(e, t, i = !1) {
3684
- if (pe(t))
3713
+ if (de(t))
3685
3714
  throw new Error(
3686
3715
  `Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
3687
3716
  );
3688
3717
  if (o.isStringLiteral(t))
3689
- return Jt(t, i);
3718
+ return Mt(t, i);
3690
3719
  if (o.isJsxExpression(t) && t.expression) {
3691
3720
  if (o.isStringLiteral(t.expression))
3692
- return Jt(t.expression, i);
3721
+ return Mt(t.expression, i);
3693
3722
  if (i) {
3694
3723
  if (o.isNumericLiteral(t.expression))
3695
3724
  return [`=${t.expression.text}`];
@@ -3699,25 +3728,25 @@ function we(e, t, i = !1) {
3699
3728
  }
3700
3729
  return ["=", ...pt(e, t, void 0)];
3701
3730
  }
3702
- function Jt(e, t) {
3731
+ function Mt(e, t) {
3703
3732
  if (!t)
3704
3733
  return ["=", e];
3705
3734
  const i = e.text;
3706
3735
  if (i.length === 0)
3707
3736
  return [];
3708
- const s = li(i);
3737
+ const s = oi(i);
3709
3738
  if (qs(s)) {
3710
- const r = s.replaceAll('"', "&#34;");
3711
- if (r.length > s.length) {
3712
- const n = s.replaceAll("'", "&#39;");
3713
- if (n.length < r.length)
3714
- return [`='${n}'`];
3739
+ const n = s.replaceAll('"', "&#34;");
3740
+ if (n.length > s.length) {
3741
+ const r = s.replaceAll("'", "&#39;");
3742
+ if (r.length < n.length)
3743
+ return [`='${r}'`];
3715
3744
  }
3716
- return [`="${r}"`];
3745
+ return [`="${n}"`];
3717
3746
  } else
3718
3747
  return [`=${s}`];
3719
3748
  }
3720
- function Bt(e, t, i) {
3749
+ function Jt(e, t, i) {
3721
3750
  if (t !== void 0 && o.isStringLiteral(t))
3722
3751
  return [`${i}="${t.text}"`];
3723
3752
  if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
@@ -3725,28 +3754,28 @@ function Bt(e, t, i) {
3725
3754
  `${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3726
3755
  );
3727
3756
  const s = t.expression;
3728
- if (Zn(s)) {
3729
- const n = i === "class" ? "safeClassMap" : "safeStyleMap";
3730
- e.neededImports.add(n);
3731
- const a = e.importRenames[n], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
3732
- q(e, void 0, s)
3757
+ if (eo(s)) {
3758
+ const r = i === "class" ? "safeClassMap" : "safeStyleMap";
3759
+ e.neededImports.add(r);
3760
+ const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
3761
+ H(e, void 0, s)
3733
3762
  ]);
3734
3763
  return [`${i}=`, c];
3735
3764
  } else
3736
3765
  return [i, ...we(e, t, !0)];
3737
3766
  }
3738
- const Zn = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3739
- function eo(e, t) {
3767
+ const eo = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3768
+ function to(e, t) {
3740
3769
  t.neededImports.add("live");
3741
3770
  const i = t.importRenames.live;
3742
3771
  return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
3743
3772
  typeof e == "string" ? o.factory.createStringLiteral(e) : e
3744
3773
  ]);
3745
3774
  }
3746
- function to(e) {
3747
- if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Kt && e.expression.arguments.length <= 1)
3775
+ function io(e) {
3776
+ if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Bt && e.expression.arguments.length <= 1)
3748
3777
  return {
3749
- propType: Kt[e.expression.expression.text],
3778
+ propType: Bt[e.expression.expression.text],
3750
3779
  // To simplify checking logic in convertProps, wrap expression in JSX expression
3751
3780
  initializer: o.factory.createJsxExpression(
3752
3781
  void 0,
@@ -3755,34 +3784,34 @@ function to(e) {
3755
3784
  )
3756
3785
  };
3757
3786
  }
3758
- const Kt = {
3787
+ const Bt = {
3759
3788
  bindProperty: "property",
3760
3789
  bindAttribute: "attribute",
3761
3790
  bindBooleanAttribute: "booleanAttribute",
3762
3791
  bindEvent: "event"
3763
3792
  };
3764
- function io(e, t, i) {
3765
- return ro.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ri.has(e) || e.includes("-") ? "attribute" : !rt(i) && (ni.has(e) || (i === He ? !1 : i === Ce ? (
3793
+ function so(e, t, i) {
3794
+ return no.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ii.has(e) || e.includes("-") ? "attribute" : !rt(i) && (si.has(e) || (i === He ? !1 : i === Ee ? (
3766
3795
  // When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
3767
- Object.values(qe).some((n) => n.has(e))
3768
- ) : qe[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === He || i !== Ce && (it.has(i) || st.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
3796
+ Object.values(qe).some((r) => r.has(e))
3797
+ ) : qe[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === He || i !== Ee && (it.has(i) || st.has(i)) ? e in U.common.reflected || e in U.common.stringifiedReflected || e in U.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
3769
3798
  }
3770
- const so = ["class", "style", "ref", "directives", "key", "deferLoad"], ro = new Set(so), no = (e) => typeof e != "string" || e.trim().length > 0;
3771
- function Le({ key: e, parts: t, litTag: i }, s) {
3772
- const r = oo(t);
3773
- if (r.length % 2 === 0)
3799
+ const ro = ["class", "style", "ref", "directives", "key", "deferLoad"], no = new Set(ro), oo = (e) => typeof e != "string" || e.trim().length > 0;
3800
+ function Ne({ key: e, parts: t, litTag: i }, s) {
3801
+ const n = ao(t);
3802
+ if (n.length % 2 === 0)
3774
3803
  throw new Error("Normalized template parts array length must be odd");
3775
- const [n, ...a] = r;
3776
- if (typeof n != "string")
3804
+ const [r, ...a] = n;
3805
+ if (typeof r != "string")
3777
3806
  throw new Error("First normalized template part must be a string");
3778
3807
  if (i === void 0) {
3779
3808
  if (a.length === 0)
3780
- return Ue(s, e, o.factory.createStringLiteral(n));
3781
- if (n === "" && a.length === 2 && a[1] === "")
3809
+ return Ue(s, e, o.factory.createStringLiteral(r));
3810
+ if (r === "" && a.length === 2 && a[1] === "")
3782
3811
  return Ue(
3783
3812
  s,
3784
3813
  e,
3785
- typeof a[0] == "string" ? o.factory.createStringLiteral(n) : a[0]
3814
+ typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
3786
3815
  );
3787
3816
  }
3788
3817
  const c = typeof i == "string" ? i : re;
@@ -3790,32 +3819,32 @@ function Le({ key: e, parts: t, litTag: i }, s) {
3790
3819
  const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
3791
3820
  o.factory.createIdentifier(d),
3792
3821
  void 0,
3793
- a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n), ao(a))
3822
+ a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), lo(a))
3794
3823
  );
3795
3824
  return Ue(s, e, l);
3796
3825
  }
3797
- const oo = (e) => e.reduce(
3826
+ const ao = (e) => e.reduce(
3798
3827
  (t, i, s) => {
3799
- const r = t.at(-1), n = typeof r == "string", a = typeof i == "string";
3800
- if (n && a)
3801
- return [...t.slice(0, -1), `${r}${i}`];
3828
+ const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
3829
+ if (r && a)
3830
+ return [...t.slice(0, -1), `${n}${i}`];
3802
3831
  const d = s === e.length - 1;
3803
3832
  return !a && d ? [...t, i, ""] : !a && !d ? [...t, i, ""] : [...t, i];
3804
3833
  },
3805
3834
  [""]
3806
3835
  );
3807
- function ao(e) {
3836
+ function lo(e) {
3808
3837
  if (!(e.length % 2 === 0))
3809
3838
  throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
3810
3839
  const i = e.length / 2;
3811
- return Array.from({ length: i }, (s, r) => {
3812
- const n = r * 2, a = e[n];
3840
+ return Array.from({ length: i }, (s, n) => {
3841
+ const r = n * 2, a = e[r];
3813
3842
  if (typeof a == "string")
3814
3843
  throw new Error("Expected to receive a normalized array of parts");
3815
- const c = n + 1, d = e[c];
3844
+ const c = r + 1, d = e[c];
3816
3845
  if (typeof d != "string")
3817
3846
  throw new Error("Expected to receive a normalized array of parts");
3818
- const l = r === i - 1;
3847
+ const l = n === i - 1;
3819
3848
  return o.factory.createTemplateSpan(
3820
3849
  a,
3821
3850
  l ? o.factory.createTemplateTail(d) : o.factory.createTemplateMiddle(d)
@@ -3843,13 +3872,13 @@ function Hi(e, t) {
3843
3872
  );
3844
3873
  }
3845
3874
  const dt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
3846
- function lo(e) {
3875
+ function co(e) {
3847
3876
  const t = dt(e);
3848
3877
  if (t.length === 0)
3849
3878
  return [e || " "];
3850
3879
  const i = t.reduceRight(
3851
- ([r, ...n], a) => {
3852
- const c = co(r), d = qi(c.slice(a.pos, a.end));
3880
+ ([n, ...r], a) => {
3881
+ const c = po(n), d = qi(c.slice(a.pos, a.end));
3853
3882
  return [
3854
3883
  c.slice(0, a.pos),
3855
3884
  /**
@@ -3858,7 +3887,7 @@ function lo(e) {
3858
3887
  */
3859
3888
  o.factory.createNoSubstitutionTemplateLiteral(d),
3860
3889
  c.slice(a.end),
3861
- ...n
3890
+ ...r
3862
3891
  ];
3863
3892
  },
3864
3893
  [e]
@@ -3868,51 +3897,51 @@ function lo(e) {
3868
3897
  return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
3869
3898
  }
3870
3899
  const qi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
3871
- function co(e) {
3900
+ function po(e) {
3872
3901
  if (typeof e == "string")
3873
3902
  return e;
3874
3903
  throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
3875
3904
  }
3876
- function po(e, t) {
3905
+ function mo(e, t) {
3877
3906
  if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
3878
3907
  return t;
3879
3908
  const s = t.arguments[0];
3880
3909
  if (!(t.arguments.length === 1 && o.isArrowFunction(s)))
3881
3910
  return t;
3882
- const n = s.parameters.at(0);
3883
- if (!(typeof n == "object" && // If .map() callback has 3rd argument, it's not supported
3911
+ const r = s.parameters.at(0);
3912
+ if (!(typeof r == "object" && // If .map() callback has 3rd argument, it's not supported
3884
3913
  s.parameters.length <= 2))
3885
3914
  return t;
3886
3915
  const c = me(s.body);
3887
3916
  let d = !0, l;
3888
- if (_t(c))
3917
+ if (Kt(c))
3889
3918
  l = c;
3890
3919
  else {
3891
3920
  if (!o.isBlock(c))
3892
3921
  return t;
3893
- const v = c.statements.at(-1);
3894
- if (!(v && o.isReturnStatement(v) && v.expression))
3922
+ const y = c.statements.at(-1);
3923
+ if (!(y && o.isReturnStatement(y) && y.expression))
3895
3924
  return t;
3896
- const S = me(v.expression);
3897
- if (!_t(S))
3925
+ const C = me(y.expression);
3926
+ if (!Kt(C))
3898
3927
  return t;
3899
- const k = c.statements.slice(0, -1);
3900
- if (k.some(Vi))
3928
+ const E = c.statements.slice(0, -1);
3929
+ if (E.some(Vi))
3901
3930
  return t;
3902
- d = k.length === 0, l = S;
3931
+ d = E.length === 0, l = C;
3903
3932
  }
3904
- const p = o.isJsxElement(l) ? l.openingElement : l, u = Zi(p);
3905
- if (u === -1)
3933
+ const p = o.isJsxElement(l) ? l.openingElement : l, m = Zi(p);
3934
+ if (m === -1)
3906
3935
  return t;
3907
- const f = p.attributes.properties[u];
3936
+ const f = p.attributes.properties[m];
3908
3937
  if (f === void 0 || !o.isJsxAttribute(f))
3909
3938
  return t;
3910
- const g = ct(f.initializer, e.sourceFile), h = uo(n, s, g, d, e);
3939
+ const g = ct(f.initializer, e.sourceFile), h = uo(r, s, g, d, e);
3911
3940
  if (h === void 0)
3912
3941
  return t;
3913
3942
  e.liftedKeys.add(f.name), e.neededImports.add("repeat");
3914
- const y = e.importRenames.repeat;
3915
- return o.factory.updateCallExpression(t, o.factory.createIdentifier(y), t.typeArguments, [
3943
+ const v = e.importRenames.repeat;
3944
+ return o.factory.updateCallExpression(t, o.factory.createIdentifier(v), t.typeArguments, [
3916
3945
  // From `items.map()` get `items`
3917
3946
  t.expression.expression,
3918
3947
  // (item)=>item.key
@@ -3929,7 +3958,7 @@ function po(e, t) {
3929
3958
  )
3930
3959
  ]);
3931
3960
  }
3932
- const _t = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
3961
+ const Kt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
3933
3962
  function Vi(e) {
3934
3963
  if (o.isReturnStatement(e))
3935
3964
  return !0;
@@ -3940,23 +3969,23 @@ function Vi(e) {
3940
3969
  void 0
3941
3970
  ), t;
3942
3971
  }
3943
- function uo(e, t, i, s, r) {
3944
- const n = B(i);
3945
- if (n === void 0)
3972
+ function uo(e, t, i, s, n) {
3973
+ const r = J(i);
3974
+ if (r === void 0)
3946
3975
  return;
3947
- let a = Gi(e.name, n);
3976
+ let a = Gi(e.name, r);
3948
3977
  const c = t.parameters.at(1);
3949
3978
  if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
3950
- n.every(ke, c.name)) {
3951
- E.warn(
3979
+ r.every(xe, c.name)) {
3980
+ $.warn(
3952
3981
  "@arcgis/lumina:jsxToLitHtml",
3953
3982
  "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.",
3954
- r.sourceFile.fileName
3983
+ n.sourceFile.fileName
3955
3984
  );
3956
3985
  return;
3957
3986
  }
3958
3987
  if (!s) {
3959
- const d = fo(n, a, t);
3988
+ const d = go(r, a, t);
3960
3989
  if (d === void 0)
3961
3990
  return;
3962
3991
  a = d;
@@ -3972,38 +4001,38 @@ function uo(e, t, i, s, r) {
3972
4001
  e.initializer
3973
4002
  );
3974
4003
  }
3975
- function B(e) {
4004
+ function J(e) {
3976
4005
  if (o.isIdentifier(e))
3977
4006
  return [e.text];
3978
4007
  if (o.isPropertyAccessExpression(e))
3979
- return B(e.expression);
4008
+ return J(e.expression);
3980
4009
  if (o.isElementAccessExpression(e))
3981
- return B(e.argumentExpression);
4010
+ return J(e.argumentExpression);
3982
4011
  if (o.isConditionalExpression(e)) {
3983
- const t = B(e.condition), i = B(e.whenTrue), s = B(e.whenFalse);
4012
+ const t = J(e.condition), i = J(e.whenTrue), s = J(e.whenFalse);
3984
4013
  return t === void 0 || i === void 0 || s === void 0 ? void 0 : [...t, ...i, ...s];
3985
4014
  } else if (o.isBinaryExpression(e)) {
3986
- const t = B(e.left), i = B(e.right);
4015
+ const t = J(e.left), i = J(e.right);
3987
4016
  return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
3988
4017
  } else if (o.isTemplateExpression(e)) {
3989
4018
  const t = [];
3990
4019
  for (const i of e.templateSpans) {
3991
- const s = B(i.expression);
4020
+ const s = J(i.expression);
3992
4021
  if (s === void 0)
3993
4022
  return;
3994
4023
  t.push(...s);
3995
4024
  }
3996
4025
  return t;
3997
4026
  } else {
3998
- if (mo.has(e.kind))
4027
+ if (fo.has(e.kind))
3999
4028
  return [];
4000
4029
  {
4001
4030
  const t = me(e);
4002
- return t !== e ? B(t) : void 0;
4031
+ return t !== e ? J(t) : void 0;
4003
4032
  }
4004
4033
  }
4005
4034
  }
4006
- const mo = /* @__PURE__ */ new Set([
4035
+ const fo = /* @__PURE__ */ new Set([
4007
4036
  o.SyntaxKind.NumericLiteral,
4008
4037
  o.SyntaxKind.BigIntLiteral,
4009
4038
  o.SyntaxKind.StringLiteral,
@@ -4012,138 +4041,138 @@ const mo = /* @__PURE__ */ new Set([
4012
4041
  o.SyntaxKind.FalseKeyword,
4013
4042
  o.SyntaxKind.NullKeyword,
4014
4043
  o.SyntaxKind.TrueKeyword
4015
- ]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? yo(e, t) : e;
4016
- function fo(e, t, i) {
4017
- if (e.every(ke, t))
4044
+ ]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? vo(e, t) : e;
4045
+ function go(e, t, i) {
4046
+ if (e.every(xe, t))
4018
4047
  return t;
4019
4048
  if (o.isIdentifier(t)) {
4020
- const s = o.isBlock(i.body) ? ze(i.body.statements, (n) => go(n, t)) : void 0;
4049
+ const s = o.isBlock(i.body) ? ze(i.body.statements, (r) => ho(r, t)) : void 0;
4021
4050
  if (s === void 0)
4022
4051
  return;
4023
- const r = Gi(s, e);
4024
- if (e.every(ke, r))
4025
- return r;
4052
+ const n = Gi(s, e);
4053
+ if (e.every(xe, n))
4054
+ return n;
4026
4055
  }
4027
4056
  }
4028
- function go(e, t) {
4057
+ function ho(e, t) {
4029
4058
  if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
4030
4059
  return;
4031
4060
  const i = e.declarationList.declarations[0];
4032
4061
  return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
4033
4062
  }
4034
- function ke(e) {
4063
+ function xe(e) {
4035
4064
  const t = this;
4036
- return o.isIdentifier(t) ? t.text === e : t.elements.some(ho, e);
4065
+ return o.isIdentifier(t) ? t.text === e : t.elements.some(yo, e);
4037
4066
  }
4038
- function ho(e) {
4067
+ function yo(e) {
4039
4068
  const t = this;
4040
- return o.isOmittedExpression(e) ? !1 : ke.call(e.name, t);
4069
+ return o.isOmittedExpression(e) ? !1 : xe.call(e.name, t);
4041
4070
  }
4042
- function yo(e, t) {
4071
+ function vo(e, t) {
4043
4072
  let i = !1;
4044
- const s = e.elements.filter((r) => o.isIdentifier(r.name) ? t.includes(r.name.text) : (i = !0, !0));
4073
+ const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
4045
4074
  return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
4046
4075
  }
4047
4076
  const Xi = (e, t) => t.liftedKeys.has(e);
4048
- function q(e, t, i) {
4049
- if (pe(i))
4077
+ function H(e, t, i) {
4078
+ if (de(i))
4050
4079
  return Yi(e, i);
4051
- const s = o.isCallExpression(i) ? po(e, i) : i, r = o.visitEachChild(
4080
+ const s = o.isCallExpression(i) ? mo(e, i) : i, n = o.visitEachChild(
4052
4081
  s,
4053
4082
  // Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
4054
- q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4083
+ H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4055
4084
  e.transformationContext
4056
4085
  );
4057
- return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || pe(me(i.right)) || ir(i.right)) ? wo(r) : r;
4086
+ return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || ir(i.right)) ? So(n) : n;
4058
4087
  }
4059
4088
  function Yi(e, t) {
4060
4089
  const i = Qi(e, t);
4061
- return Le(i, e);
4090
+ return Ne(i, e);
4062
4091
  }
4063
4092
  function Qi(e, t) {
4064
4093
  const i = "children" in t ? t.children : [];
4065
4094
  if (o.isJsxFragment(t))
4066
4095
  return { key: void 0, ...Se(i, e) };
4067
- const r = o.isJsxElement(t) ? t.openingElement : t, n = r.tagName;
4068
- if (o.isJsxNamespacedName(n))
4069
- throw Error(`JSX namespaced elements are not supported. Found ${n.getText(e.sourceFile)} `);
4070
- if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !== Re && n.text !== Oe) {
4071
- const w = o.isIdentifier(n) && n.text === Bs ? Se(i, e) : {
4096
+ const n = o.isJsxElement(t) ? t.openingElement : t, r = n.tagName;
4097
+ if (o.isJsxNamespacedName(r))
4098
+ throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
4099
+ if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Re && r.text !== Oe) {
4100
+ const w = o.isIdentifier(r) && r.text === Bs ? Se(i, e) : {
4072
4101
  // No need to wrap the function call in a lit-html tag
4073
4102
  litTag: void 0,
4074
- parts: [bo(e, t, n, i)]
4103
+ parts: [wo(e, t, r, i)]
4075
4104
  };
4076
4105
  return {
4077
- key: vo(r, e),
4106
+ key: bo(n, e),
4078
4107
  ...w
4079
4108
  };
4080
4109
  }
4081
- const c = n.text === Re ? Ce : n.text === Oe ? He : n.text, d = n.text === Re ? se : n.text === Oe ? X : _s.has(c) ? ci : it.has(c) ? ee : re, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, u = p === void 0 ? void 0 : new Set(p);
4110
+ const c = r.text === Re ? Ee : r.text === Oe ? He : r.text, d = r.text === Re ? se : r.text === Oe ? G : _s.has(c) ? ai : it.has(c) ? ee : re, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
4082
4111
  let f;
4083
4112
  const g = [];
4084
4113
  let h = !1;
4085
- const y = r.attributes.properties.flatMap((x) => {
4114
+ const v = n.attributes.properties.flatMap((x) => {
4086
4115
  if (o.isJsxSpreadAttribute(x))
4087
4116
  throw Error(
4088
4117
  `JSX spread attribute syntax is not supported. See alternatives: https://webgis.esri.com/references/lumina/jsx#spread-attributes
4089
4118
  Found ${x.getText(e.sourceFile)}`
4090
4119
  );
4091
- const { name: w, initializer: L } = x;
4120
+ const { name: w, initializer: O } = x;
4092
4121
  if (o.isJsxNamespacedName(w))
4093
4122
  throw Error(`JSX namespaced attributes are not supported. Found ${w.getText(e.sourceFile)}`);
4094
- const A = w.text, z = to(L), j = z?.propType ?? io(A, L, c);
4095
- u?.delete(A);
4096
- const N = Yn[j](e, z?.initializer ?? L, A, c);
4097
- if (N.length === 0)
4123
+ const L = w.text, W = io(O), N = W?.propType ?? so(L, O, c);
4124
+ m?.delete(L);
4125
+ const A = Qn[N](e, W?.initializer ?? O, L, c);
4126
+ if (A.length === 0)
4098
4127
  return [];
4099
- const K = e.compiler.shouldMinifyJsx ? [" "] : lo(zi(w, e));
4100
- return j === "key" ? (f = typeof N[0] == "object" && !Xi(w, e) ? N[0] : void 0, K.some(no) ? K : []) : j === "directives" || j === "ref" || A === "deferLoad" ? (h ||= j === "deferLoad", g.push(
4101
- ...K,
4102
- ...N.flatMap(
4103
- (D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
4128
+ const B = e.compiler.shouldMinifyJsx ? [" "] : co(zi(w, e));
4129
+ return N === "key" ? (f = typeof A[0] == "object" && !Xi(w, e) ? A[0] : void 0, B.some(oo) ? B : []) : N === "directives" || N === "ref" || L === "deferLoad" ? (h ||= N === "deferLoad", g.push(
4130
+ ...B,
4131
+ ...A.flatMap(
4132
+ (F, M) => typeof F == "string" || M === 0 || typeof A[M - 1] == "string" ? F : [" ", F]
4104
4133
  )
4105
- ), []) : [...K, ...N];
4134
+ ), []) : [...B, ...A];
4106
4135
  });
4107
- if (u !== void 0 && u.size > 0 && e.compiler.logLintError(
4136
+ if (m !== void 0 && m.size > 0 && e.compiler.logLintError(
4108
4137
  "mustIncludeAllRequiredProperties",
4109
4138
  e.sourceFile.fileName,
4110
- `Missing required properties for <${c}> }: ${Array.from(u).join(", ")}`
4111
- ), g.length > 0 && y.push(...g), typeof c == "string" && st.has(c))
4139
+ `Missing required properties for <${c}> }: ${Array.from(m).join(", ")}`
4140
+ ), g.length > 0 && v.push(...g), typeof c == "string" && st.has(c))
4112
4141
  throw Error(
4113
4142
  `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`
4114
4143
  );
4115
4144
  l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
4116
- const v = typeof c == "string" && Ks.has(c), C = Se(i, e);
4117
- if (v && C.parts.length > 0)
4145
+ const y = typeof c == "string" && Ks.has(c), S = Se(i, e);
4146
+ if (y && S.parts.length > 0)
4118
4147
  throw Error(
4119
4148
  `Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
4120
4149
  );
4121
- const S = (d === ee || d === X) && C.parts.length === 0, k = [
4150
+ const C = (d === ee || d === G) && S.parts.length === 0, E = [
4122
4151
  "<",
4123
- typeof c == "string" ? c : n,
4124
- ...y,
4125
- S ? `${y.length === 0 ? "" : " "}/>` : ">"
4126
- ], T = v || S ? k : [
4127
- ...k,
4152
+ typeof c == "string" ? c : r,
4153
+ ...v,
4154
+ C ? `${v.length === 0 ? "" : " "}/>` : ">"
4155
+ ], T = y || C ? E : [
4156
+ ...E,
4128
4157
  /**
4129
4158
  * If parent was an HTML element (e.g. `<svg>`), but children are SVG
4130
4159
  * fragments (e.g. `<circle />`, then wrap the children in their own
4131
4160
  * tagged template literal (e.g. svg``)
4132
4161
  */
4133
- ...C.litTag !== void 0 && C.litTag !== d ? [Le({ key: void 0, ...C }, e)] : C.parts,
4162
+ ...S.litTag !== void 0 && S.litTag !== d ? [Ne({ key: void 0, ...S }, e)] : S.parts,
4134
4163
  "</",
4135
- typeof c == "string" ? c : n,
4164
+ typeof c == "string" ? c : r,
4136
4165
  ">"
4137
4166
  ];
4138
4167
  return { key: f, parts: T, litTag: d };
4139
4168
  }
4140
- function vo(e, t) {
4169
+ function bo(e, t) {
4141
4170
  const i = e.attributes.properties[Zi(e)];
4142
4171
  return i && o.isJsxAttribute(i) && !Xi(i.name, t) ? ct(i.initializer, t.sourceFile) : void 0;
4143
4172
  }
4144
4173
  const Zi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
4145
- function bo(e, t, i, s) {
4146
- const n = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
4174
+ function wo(e, t, i, s) {
4175
+ const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
4147
4176
  if (o.isJsxSpreadAttribute(d))
4148
4177
  return Hi(zi(d, e), o.factory.createSpreadAssignment(d.expression));
4149
4178
  const { name: l, initializer: p } = d;
@@ -4151,42 +4180,42 @@ function bo(e, t, i, s) {
4151
4180
  throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
4152
4181
  if (l.text === "key")
4153
4182
  return;
4154
- const u = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : pe(p) ? Yi(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = ti(l.text) ? o.factory.createStringLiteral(l.text) : l;
4155
- return o.factory.createPropertyAssignment(f, u);
4183
+ const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ? Yi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Zt(l.text) ? o.factory.createStringLiteral(l.text) : l;
4184
+ return o.factory.createPropertyAssignment(f, m);
4156
4185
  }), { parts: a, litTag: c } = Se(s, e);
4157
- return a.length > 0 && n.push(
4186
+ return a.length > 0 && r.push(
4158
4187
  o.factory.createPropertyAssignment(
4159
4188
  o.factory.createIdentifier("children"),
4160
- Le({ key: void 0, parts: a, litTag: c }, e)
4189
+ Ne({ key: void 0, parts: a, litTag: c }, e)
4161
4190
  )
4162
4191
  ), o.factory.createCallExpression(i, void 0, [
4163
- o.factory.createObjectLiteralExpression(n.filter(F))
4192
+ o.factory.createObjectLiteralExpression(r.filter(j))
4164
4193
  ]);
4165
4194
  }
4166
4195
  function Se(e, t) {
4167
4196
  let i;
4168
- const s = e.flatMap((r) => {
4169
- if (o.isJsxText(r))
4170
- return [t.compiler.shouldMinifyJsx ? Ws(r.text) : r.text];
4171
- if (o.isJsxExpression(r))
4172
- return pt(t, r, r);
4197
+ const s = e.flatMap((n) => {
4198
+ if (o.isJsxText(n))
4199
+ return [t.compiler.shouldMinifyJsx ? Ws(n.text) : n.text];
4200
+ if (o.isJsxExpression(n))
4201
+ return pt(t, n, n);
4173
4202
  {
4174
- const n = Qi(t, r);
4175
- if (n.key === void 0 && n.litTag !== se && n.litTag !== X) {
4176
- if (n.litTag === ci)
4177
- return n.parts;
4178
- if (i !== void 0 && n.litTag !== void 0 && i !== n.litTag)
4203
+ const r = Qi(t, n);
4204
+ if (r.key === void 0 && r.litTag !== se && r.litTag !== G) {
4205
+ if (r.litTag === ai)
4206
+ return r.parts;
4207
+ if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
4179
4208
  throw new Error(
4180
- `Unexpectedly found both ${i} and ${n.litTag} child elements inside the same element.`
4209
+ `Unexpectedly found both ${i} and ${r.litTag} child elements inside the same element.`
4181
4210
  );
4182
- return i = n.litTag, n.parts;
4211
+ return i = r.litTag, r.parts;
4183
4212
  } else
4184
- return [Le(n, t)];
4213
+ return [Ne(r, t)];
4185
4214
  }
4186
4215
  });
4187
4216
  return { litTag: i, parts: s };
4188
4217
  }
4189
- function wo(e) {
4218
+ function So(e) {
4190
4219
  return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
4191
4220
  e,
4192
4221
  o.factory.createToken(o.SyntaxKind.BarBarToken),
@@ -4200,7 +4229,7 @@ function pt(e, t, i) {
4200
4229
  const s = t.getText(e.sourceFile).slice(1, -1);
4201
4230
  return dt(s).length === 0 ? [] : [Hi(s, o.factory.createIdentifier("undefined"))];
4202
4231
  }
4203
- return o.isStringLiteral(t.expression) ? [li(t.expression.text)] : (
4232
+ return o.isStringLiteral(t.expression) ? [oi(t.expression.text)] : (
4204
4233
  /**
4205
4234
  * There is a bug in Chrome DevTools, where it won't let you set a
4206
4235
  * breakpoint inside a tagged template literal. It seems like they did
@@ -4221,7 +4250,7 @@ function pt(e, t, i) {
4221
4250
  * making this change useless.
4222
4251
  */
4223
4252
  e.compiler.viteCommand === "serve" && e.compiler.viteConfig.build.sourcemap !== !1 && !e.compiler.shouldMinifyJsx && o.isArrowFunction(t.expression) && !o.isBlock(t.expression.body) ? [
4224
- q(
4253
+ H(
4225
4254
  e,
4226
4255
  i,
4227
4256
  o.factory.updateArrowFunction(
@@ -4234,7 +4263,7 @@ function pt(e, t, i) {
4234
4263
  o.factory.createBlock([o.factory.createReturnStatement(t.expression.body)], !0)
4235
4264
  )
4236
4265
  )
4237
- ] : [q(e, i, t.expression)]
4266
+ ] : [H(e, i, t.expression)]
4238
4267
  );
4239
4268
  }
4240
4269
  const es = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), ts = es(
@@ -4242,21 +4271,21 @@ const es = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), t
4242
4271
  ([e, t]) => t.map((i) => [i, e])
4243
4272
  )
4244
4273
  ), is = new Set(Object.keys(ts));
4245
- function So(e, t) {
4246
- const i = t.importClause, s = i === void 0, r = t.moduleSpecifier;
4247
- if (!o.isStringLiteral(r))
4274
+ function Co(e, t) {
4275
+ const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
4276
+ if (!o.isStringLiteral(n))
4248
4277
  return t;
4249
- const n = Eo(e.sourceFile.fileName, r.text, ""), a = !i?.isTypeOnly;
4250
- if (a && e.existingImportedModules.add(n), rr.test(r.text) && // If id already includes ?, bypass our custom behavior
4251
- !r.text.includes("?")) {
4278
+ const r = Eo(e.sourceFile.fileName, n.text, ""), a = !i?.isTypeOnly;
4279
+ if (a && e.existingImportedModules.add(r), rr.test(n.text) && // If id already includes ?, bypass our custom behavior
4280
+ !n.text.includes("?")) {
4252
4281
  if (s) {
4253
4282
  if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
4254
4283
  return t;
4255
- const l = e.sourceFile.fileName, p = l.includes("/node_modules/") || l.includes("/dist/"), u = `import "${r.text}"`;
4284
+ const l = e.sourceFile.fileName, p = l.includes("/node_modules/") || l.includes("/dist/"), m = `import "${n.text}"`;
4256
4285
  throw Error(
4257
- 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 \`${u}\`. How should such CSS import be handled? Options:
4286
+ 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:
4258
4287
  1. (suggested) Externalize ${l}, which will make end-user's bundler treat this CSS import as global CSS.
4259
- 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 \`${u}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${r.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`
4288
+ 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`
4260
4289
  );
4261
4290
  }
4262
4291
  return o.factory.updateImportDeclaration(
@@ -4267,31 +4296,31 @@ function So(e, t) {
4267
4296
  // runs for .tsx files, so .css imports in .ts files won't work. However,
4268
4297
  // that is unlikely for web component libraries. A workaround is to
4269
4298
  // rename the file or explicitly add (undocumented) ?litCss flag
4270
- o.factory.createStringLiteral(r.text + (e.isInLightDomComponent ? Y : Te)),
4299
+ o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ? X : Te)),
4271
4300
  t.attributes
4272
4301
  );
4273
4302
  }
4274
4303
  if (s)
4275
4304
  return t;
4276
4305
  if (i.name !== void 0) {
4277
- const l = i.name.text, p = i.name.text.startsWith(l[0].toUpperCase()), u = m.isAbsolute(n);
4278
- a && !i.isTypeOnly && p && u && e.importedFunctionComponentsFromModules.add(n);
4306
+ const l = i.name.text, p = i.name.text.startsWith(l[0].toUpperCase()), m = u.isAbsolute(r);
4307
+ a && !i.isTypeOnly && p && m && e.importedFunctionComponentsFromModules.add(r);
4279
4308
  }
4280
4309
  const c = i.namedBindings;
4281
4310
  if (c === void 0 || !o.isNamedImports(c))
4282
4311
  return t;
4283
- const d = is.has(r.text);
4312
+ const d = is.has(n.text);
4284
4313
  if (c.elements.forEach((l) => {
4285
- const p = (l.propertyName ?? l.name).text, u = te[p];
4314
+ const p = (l.propertyName ?? l.name).text, m = te[p];
4286
4315
  if (d) {
4287
- if (u?.some((h) => h === r.text)) {
4288
- const h = ss(p, n);
4316
+ if (m?.some((h) => h === n.text)) {
4317
+ const h = ss(p, r);
4289
4318
  e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
4290
4319
  }
4291
- } else (l.name.text === "h" || l.name.text === "createElement") && O().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4292
- const f = p.startsWith(p[0].toUpperCase()), g = m.isAbsolute(n);
4293
- a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(n);
4294
- }), r.text === "@arcgis/lumina") {
4320
+ } else (l.name.text === "h" || l.name.text === "createElement") && R().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4321
+ const f = p.startsWith(p[0].toUpperCase()), g = u.isAbsolute(r);
4322
+ a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
4323
+ }), n.text === "@arcgis/lumina") {
4295
4324
  let l = !1;
4296
4325
  const p = c.elements.filter((f) => {
4297
4326
  const g = (f.propertyName ?? f.name).text;
@@ -4324,21 +4353,21 @@ function So(e, t) {
4324
4353
  }
4325
4354
  return t;
4326
4355
  }
4327
- const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? X : e, Eo = (e, t, i) => t.startsWith(".") ? m.resolve(e, "..", `${t}${i}`) : t;
4328
- function Co(e) {
4329
- return o.isImportDeclaration(e) ? To(this, e) : e;
4356
+ const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? G : e, Eo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4357
+ function To(e) {
4358
+ return o.isImportDeclaration(e) ? $o(this, e) : e;
4330
4359
  }
4331
- function To(e, t) {
4332
- const i = t.importClause, s = i?.namedBindings, r = t.moduleSpecifier;
4333
- if (!o.isStringLiteral(r) || !s || !o.isNamedImports(s) || !is.has(r.text))
4360
+ function $o(e, t) {
4361
+ const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
4362
+ if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !is.has(n.text))
4334
4363
  return t;
4335
- const n = i.isTypeOnly;
4364
+ const r = i.isTypeOnly;
4336
4365
  let a = !1;
4337
4366
  const c = s.elements.map((d) => {
4338
- const l = (d.propertyName ?? d.name).text, p = ss(l, r.text);
4339
- return e.existingLitImports.delete(p), e.neededImports.has(p) ? (e.neededImports.delete(p), a = !0, o.factory.updateImportSpecifier(d, !1, d.propertyName, d.name)) : n ? o.factory.updateImportSpecifier(d, !0, d.propertyName, d.name) : d;
4367
+ const l = (d.propertyName ?? d.name).text, p = ss(l, n.text);
4368
+ 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;
4340
4369
  });
4341
- return ts[r.text]?.forEach((d) => {
4370
+ return ts[n.text]?.forEach((d) => {
4342
4371
  !e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(rs(d, e)));
4343
4372
  }), a ? o.factory.updateImportDeclaration(
4344
4373
  t,
@@ -4353,7 +4382,7 @@ function To(e, t) {
4353
4382
  t.attributes
4354
4383
  ) : t;
4355
4384
  }
4356
- function $o(e) {
4385
+ function Po(e) {
4357
4386
  const t = es(
4358
4387
  Array.from(e.neededImports, (i) => [te[i][0], i])
4359
4388
  );
@@ -4364,7 +4393,7 @@ function $o(e) {
4364
4393
  !1,
4365
4394
  void 0,
4366
4395
  o.factory.createNamedImports(
4367
- s.map((r) => (e.neededImports.delete(r), rs(r, e)))
4396
+ s.map((n) => (e.neededImports.delete(n), rs(n, e)))
4368
4397
  )
4369
4398
  ),
4370
4399
  o.factory.createStringLiteral(i)
@@ -4372,28 +4401,28 @@ function $o(e) {
4372
4401
  );
4373
4402
  }
4374
4403
  function rs(e, t) {
4375
- const i = e === se ? re : e === X ? ee : e, s = t.importRenames[e];
4404
+ const i = e === se ? re : e === G ? ee : e, s = t.importRenames[e];
4376
4405
  return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
4377
4406
  !1,
4378
4407
  o.factory.createIdentifier(i),
4379
4408
  o.factory.createIdentifier(s)
4380
4409
  );
4381
4410
  }
4382
- function Po(e) {
4411
+ function Io(e) {
4383
4412
  const t = Tr().map(({ packageName: i }) => i);
4384
4413
  return e.existingImportedModules.forEach((i) => {
4385
- if (m.isAbsolute(i))
4414
+ if (u.isAbsolute(i))
4386
4415
  return;
4387
- const s = Ms(i), r = i.slice(s.length + 1);
4388
- if (t.includes(s ?? "") && (r.startsWith("dist/components") || r.startsWith("components"))) {
4389
- const n = xe(e.sourceFile.fileName);
4416
+ const s = Ms(i), n = i.slice(s.length + 1);
4417
+ if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
4418
+ const r = Ae(e.sourceFile.fileName);
4390
4419
  throw new Error(
4391
- `Did not expect to find any explicit imports for "${i}". Found import in ${n}. Imports for web components that your component consumes will be added automatically at build-time as appropriate for a given output target. Type-only imports are still allowed. If you believe this is an error, please notify Lumina maintainers.`
4420
+ `Did not expect to find any explicit imports for "${i}". Found import in ${r}. Imports for web components that your component consumes will be added automatically at build-time as appropriate for a given output target. Type-only imports are still allowed. If you believe this is an error, please notify Lumina maintainers.`
4392
4421
  );
4393
4422
  }
4394
4423
  }), [];
4395
4424
  }
4396
- function Io(e) {
4425
+ function ko(e) {
4397
4426
  if (e.compiler.viteCommand === "serve")
4398
4427
  return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
4399
4428
  const t = e.compiler._customElementDependencies;
@@ -4408,35 +4437,35 @@ function Io(e) {
4408
4437
  t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
4409
4438
  }), [];
4410
4439
  }
4411
- const ko = (e, t) => {
4440
+ const xo = (e, t) => {
4412
4441
  const i = e.pragmas;
4413
4442
  if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
4414
4443
  return e.statements;
4415
- let s = !1, r;
4444
+ let s = !1, n;
4416
4445
  if (t.apiModule !== void 0) {
4417
4446
  const d = t.apiModule.declarations;
4418
4447
  for (let l = 0; l < d.length; ++l) {
4419
4448
  const p = d[l];
4420
4449
  if (p.customElement === !0) {
4421
- const u = p;
4422
- s = u.encapsulation !== void 0;
4423
- const f = u.superclass;
4424
- f?.module !== void 0 && f.package === void 0 && (r = [f.module.split("/").at(-1)]);
4450
+ const m = p;
4451
+ s = m.encapsulation !== void 0;
4452
+ const f = m.superclass;
4453
+ f?.module !== void 0 && f.package === void 0 && (n = [f.module.split("/").at(-1)]);
4425
4454
  break;
4426
4455
  }
4427
4456
  }
4428
4457
  }
4429
- const n = {
4458
+ const r = {
4430
4459
  compiler: t.compiler,
4431
- externalComponents: wi(),
4460
+ externalComponents: vi(),
4432
4461
  localComponents: Ui(t.compiler),
4433
4462
  sourceFile: e,
4434
4463
  transformationContext: t.transformation,
4435
- importRenames: xo(e),
4464
+ importRenames: Ao(e),
4436
4465
  existingImportedModules: /* @__PURE__ */ new Set(),
4437
4466
  importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
4438
4467
  existingLitImports: /* @__PURE__ */ new Set(),
4439
- customElementsToImport: new Set(r),
4468
+ customElementsToImport: new Set(n),
4440
4469
  customElementsToImportDeferred: /* @__PURE__ */ new Set(),
4441
4470
  neededImports: /* @__PURE__ */ new Set(),
4442
4471
  liftedKeys: /* @__PURE__ */ new Set(),
@@ -4446,47 +4475,47 @@ const ko = (e, t) => {
4446
4475
  let a = [];
4447
4476
  if (e.statements.every((d) => {
4448
4477
  if (o.isImportDeclaration(d)) {
4449
- const l = So(n, d);
4478
+ const l = Co(r, d);
4450
4479
  if (l === void 0)
4451
4480
  return !0;
4452
- if (a.push(l), n.hasNonLuminaJsxImport)
4481
+ if (a.push(l), r.hasNonLuminaJsxImport)
4453
4482
  return !1;
4454
4483
  } else
4455
- a.push(q(n, void 0, d));
4484
+ a.push(H(r, void 0, d));
4456
4485
  return !0;
4457
- }), n.hasNonLuminaJsxImport)
4486
+ }), r.hasNonLuminaJsxImport)
4458
4487
  return e.statements;
4459
- if (n.neededImports.size > 0 && (a = a.map(Co, n), n.existingLitImports.size > 0))
4488
+ if (r.neededImports.size > 0 && (a = a.map(To, r), r.existingLitImports.size > 0))
4460
4489
  throw new Error(
4461
- `Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
4490
+ `Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
4462
4491
  );
4463
- const c = [$o, Po, Io].flatMap(
4464
- (d) => d(n)
4492
+ const c = [Po, Io, ko].flatMap(
4493
+ (d) => d(r)
4465
4494
  );
4466
- if (n.neededImports.size > 0)
4495
+ if (r.neededImports.size > 0)
4467
4496
  throw new Error(
4468
- `Expected context.neededLitImports to be empty by now. Found: ${Array.from(n.neededImports).join(", ")}`
4497
+ `Expected context.neededLitImports to be empty by now. Found: ${Array.from(r.neededImports).join(", ")}`
4469
4498
  );
4470
4499
  return [...c, ...a];
4471
4500
  };
4472
- function xo(e) {
4473
- return Ao(e), Object.fromEntries(
4501
+ function Ao(e) {
4502
+ return Lo(e), Object.fromEntries(
4474
4503
  tr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
4475
4504
  );
4476
4505
  }
4477
- function Ao(e) {
4506
+ function Lo(e) {
4478
4507
  if (!("identifiers" in e))
4479
4508
  throw new Error(
4480
4509
  "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."
4481
4510
  );
4482
4511
  }
4483
- const Ut = "customElement", No = (e, t) => {
4512
+ const _t = "customElement", No = (e, t) => {
4484
4513
  const i = [];
4485
- if (t.apiModule?.declarations.forEach((n) => {
4486
- const a = n;
4514
+ if (t.apiModule?.declarations.forEach((r) => {
4515
+ const a = r;
4487
4516
  a.customElement !== void 0 && i.push(
4488
4517
  o.factory.createExpressionStatement(
4489
- o.factory.createCallExpression(o.factory.createIdentifier(Ut), void 0, [
4518
+ o.factory.createCallExpression(o.factory.createIdentifier(_t), void 0, [
4490
4519
  o.factory.createStringLiteral(a.tagName ?? ""),
4491
4520
  o.factory.createIdentifier(a.name)
4492
4521
  ])
@@ -4494,9 +4523,9 @@ const Ut = "customElement", No = (e, t) => {
4494
4523
  );
4495
4524
  }), i.length === 0)
4496
4525
  return e.statements;
4497
- const s = m.relative(
4498
- m.dirname(e.fileName),
4499
- m.join(t.compiler.dir.src, "runtime")
4526
+ const s = u.relative(
4527
+ u.dirname(e.fileName),
4528
+ u.join(t.compiler.dir.src, "runtime")
4500
4529
  );
4501
4530
  return [o.factory.createImportDeclaration(
4502
4531
  void 0,
@@ -4504,13 +4533,13 @@ const Ut = "customElement", No = (e, t) => {
4504
4533
  !1,
4505
4534
  void 0,
4506
4535
  o.factory.createNamedImports([
4507
- o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Ut))
4536
+ o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(_t))
4508
4537
  ])
4509
4538
  ),
4510
4539
  o.factory.createStringLiteral(s)
4511
4540
  ), ...e.statements, ...i];
4512
4541
  };
4513
- function Lo(e, t, i) {
4542
+ function jo(e, t, i) {
4514
4543
  return t.size === 0 ? e : [
4515
4544
  o.factory.createPropertyDeclaration(
4516
4545
  [
@@ -4523,9 +4552,9 @@ function Lo(e, t, i) {
4523
4552
  o.factory.createObjectLiteralExpression(
4524
4553
  Array.from(
4525
4554
  t.entries(),
4526
- ([s, r]) => o.factory.createPropertyAssignment(
4527
- ti(s) ? o.factory.createStringLiteral(s) : s,
4528
- jo(r, i)
4555
+ ([s, n]) => o.factory.createPropertyAssignment(
4556
+ Zt(s) ? o.factory.createStringLiteral(s) : s,
4557
+ Fo(n, i)
4529
4558
  )
4530
4559
  )
4531
4560
  )
@@ -4533,19 +4562,19 @@ function Lo(e, t, i) {
4533
4562
  ...e
4534
4563
  ];
4535
4564
  }
4536
- function jo(e, t) {
4565
+ function Fo(e, t) {
4537
4566
  let i = 0, s = !0;
4538
- const r = [], n = [];
4567
+ const n = [], r = [];
4539
4568
  for (const d of e.properties)
4540
- a(d) ? r.push(d) : n.push(d);
4569
+ a(d) ? n.push(d) : r.push(d);
4541
4570
  function a(d) {
4542
4571
  if (!o.isPropertyAssignment(d) || !o.isIdentifier(d.name))
4543
4572
  return !0;
4544
- const l = d.name.text, p = d.initializer, u = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
4573
+ const l = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
4545
4574
  if (l === "attribute")
4546
- return s = !1, i |= u ? ht : 0, !u && !f;
4575
+ return s = !1, i |= m ? ht : 0, !m && !f;
4547
4576
  if (l === "reflect")
4548
- return i |= u ? fs : 0, !1;
4577
+ return i |= m ? fs : 0, !1;
4549
4578
  if (l === "type" && o.isIdentifier(p)) {
4550
4579
  if (p.text === "Boolean")
4551
4580
  return i |= gs, !1;
@@ -4553,21 +4582,21 @@ function jo(e, t) {
4553
4582
  return i |= hs, !1;
4554
4583
  } else {
4555
4584
  if (l === "state")
4556
- return s = !1, i |= u ? ys : 0, !1;
4585
+ return s = !1, i |= m ? ys : 0, !1;
4557
4586
  if (l === "readOnly")
4558
- return i |= u ? vs : 0, !1;
4587
+ return i |= m ? vs : 0, !1;
4559
4588
  if (l === "noAccessor")
4560
- return i |= u ? bs : 0, !1;
4589
+ return i |= m ? bs : 0, !1;
4561
4590
  if (l === "useDefault")
4562
- return i |= u ? ws : 0, !1;
4591
+ return i |= m ? ws : 0, !1;
4563
4592
  }
4564
4593
  return !0;
4565
4594
  }
4566
4595
  s && (i |= ht);
4567
4596
  const c = o.factory.createNumericLiteral(i);
4568
- return r.length === 0 && (t || n.length === 0) ? c : o.factory.createArrayLiteralExpression([
4597
+ return n.length === 0 && (t || r.length === 0) ? c : o.factory.createArrayLiteralExpression([
4569
4598
  c,
4570
- o.factory.createObjectLiteralExpression(r),
4599
+ o.factory.createObjectLiteralExpression(n),
4571
4600
  /**
4572
4601
  * In dev mode, to improve readability for non-source-map developers,
4573
4602
  * while we still insert the compact flags (to keep build vs dev code as
@@ -4575,41 +4604,41 @@ function jo(e, t) {
4575
4604
  * The subsumed options are in a third array item, which is not accessed
4576
4605
  * by the runtime, thus has no runtime impact.
4577
4606
  */
4578
- ...t ? [] : [o.factory.createObjectLiteralExpression(n)]
4607
+ ...t ? [] : [o.factory.createObjectLiteralExpression(r)]
4579
4608
  ]);
4580
4609
  }
4581
- function Fo(e, t, i) {
4582
- let s = -1, r = -1, n = -1;
4583
- e.options?.properties.forEach((p, u) => {
4610
+ function Do(e, t, i) {
4611
+ let s = -1, n = -1, r = -1;
4612
+ e.options?.properties.forEach((p, m) => {
4584
4613
  if (o.isSpreadAssignment(p))
4585
4614
  throw new Error(
4586
4615
  `Spread property assignment is not allowed in @property() as that is not statically analyzable. Found ${p.getText(t)}`
4587
4616
  );
4588
4617
  if (o.isIdentifier(p.name)) {
4589
4618
  const f = p.name.escapedText;
4590
- f === "type" ? s = u : f === "attribute" ? r = u : f === "readOnly" && (n = u);
4619
+ f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
4591
4620
  }
4592
4621
  });
4593
- const a = i.attribute === void 0 && r === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, d = Do(e, i, s), l = [
4622
+ const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = Ro(e, i, s), l = [
4594
4623
  ...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
4595
4624
  ...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
4596
4625
  ...d !== void 0 ? [d] : []
4597
4626
  ];
4598
4627
  return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
4599
4628
  }
4600
- function Do(e, t, i) {
4629
+ function Ro(e, t, i) {
4601
4630
  if (t.attribute === void 0)
4602
4631
  return;
4603
- const s = Ro(t.type.values);
4632
+ const s = Oo(t.type.values);
4604
4633
  return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
4605
4634
  o.factory.createIdentifier("type"),
4606
4635
  o.factory.createIdentifier(s)
4607
4636
  );
4608
4637
  }
4609
- function Ro(e) {
4638
+ function Oo(e) {
4610
4639
  let t = !1, i = !1, s = !1;
4611
- if (e?.forEach((r) => {
4612
- t ||= r.type === "number", i ||= r.type === "boolean", s ||= r.type === "string" || r.type === "any" || r.type === "unknown";
4640
+ if (e?.forEach((n) => {
4641
+ t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
4613
4642
  }), s ||= t && i, !s) {
4614
4643
  if (t)
4615
4644
  return "Number";
@@ -4618,7 +4647,7 @@ function Ro(e) {
4618
4647
  }
4619
4648
  return "Other";
4620
4649
  }
4621
- function Oo(e, t, i, s, r, n) {
4650
+ function Mo(e, t, i, s, n, r) {
4622
4651
  if (i.modifiers === void 0)
4623
4652
  return i;
4624
4653
  let a = -1, c = -1;
@@ -4628,50 +4657,50 @@ function Oo(e, t, i, s, r, n) {
4628
4657
  p === "property" && (a = l), p === "state" && (c = l);
4629
4658
  }
4630
4659
  }), a !== -1) {
4631
- const d = Mo(e, t, i, s, r), l = Wt(i, a, r), p = Fo(l, r, d);
4632
- return n.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, zt(i, a);
4660
+ const d = Jo(e, t, i, s, n), l = Ut(i, a, n), p = Do(l, n, d);
4661
+ return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Wt(i, a);
4633
4662
  } else if (c !== -1) {
4634
- const d = Wt(i, c, r), 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]), u = ii(i.name);
4635
- if (u === void 0)
4663
+ const d = Ut(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 = ei(i.name);
4664
+ if (m === void 0)
4636
4665
  throw new Error("Failed to statically determine the state property name");
4637
- return n.set(u, p), zt(i, c);
4666
+ return r.set(m, p), Wt(i, c);
4638
4667
  } else
4639
4668
  return i;
4640
4669
  }
4641
- function Mo(e, t, i, s, r) {
4642
- const n = t ?? (e.compiler.isInTest ? {
4670
+ function Jo(e, t, i, s, n) {
4671
+ const r = t ?? (e.compiler.isInTest ? {
4643
4672
  members: []
4644
4673
  } : void 0);
4645
- if (n === void 0)
4646
- throw Error(`Failed to find API component for ${s} in ${r.fileName}`);
4647
- const a = ii(i.name);
4674
+ if (r === void 0)
4675
+ throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
4676
+ const a = ei(i.name);
4648
4677
  let c;
4649
- for (let d = 0; d < n.members.length; ++d) {
4650
- const l = n.members[d];
4678
+ for (let d = 0; d < r.members.length; ++d) {
4679
+ const l = r.members[d];
4651
4680
  l.name === a && l.kind === "field" && (c = l);
4652
4681
  }
4653
4682
  if (c ??= e.compiler.isInTest ? { kind: "field", attribute: "", name: "", type: { text: "" } } : void 0, c === void 0)
4654
4683
  throw Error(
4655
- `Failed to find API property for ${i.getText(r)} in ${s} in ${r.fileName}`
4684
+ `Failed to find API property for ${i.getText(n)} in ${s} in ${n.fileName}`
4656
4685
  );
4657
4686
  if (c.name === "") {
4658
4687
  if (a === void 0)
4659
4688
  throw Error(
4660
- `Failed to statically determine the property name: ${i.getText(r)} in ${s} in ${r.fileName}`
4689
+ `Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
4661
4690
  );
4662
- c.name = a, c.attribute ??= Zt(a);
4691
+ c.name = a, c.attribute ??= Vt(a);
4663
4692
  }
4664
4693
  return c;
4665
4694
  }
4666
- function Wt(e, t, i) {
4667
- const s = e.modifiers[t], r = s.expression, n = r.arguments.at(0);
4668
- if (n && !o.isObjectLiteralExpression(n))
4695
+ function Ut(e, t, i) {
4696
+ const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
4697
+ if (r && !o.isObjectLiteralExpression(r))
4669
4698
  throw new Error(
4670
- `First argument to @property() or @state() decorator must be an object literal as otherwise it is not statically analyzable. Found ${n.getText(i)}`
4699
+ `First argument to @property() or @state() decorator must be an object literal as otherwise it is not statically analyzable. Found ${r.getText(i)}`
4671
4700
  );
4672
- return { decorator: s, callExpression: r, options: n };
4701
+ return { decorator: s, callExpression: n, options: r };
4673
4702
  }
4674
- function zt(e, t) {
4703
+ function Wt(e, t) {
4675
4704
  const i = [
4676
4705
  ...e.modifiers.slice(0, t),
4677
4706
  ...e.modifiers.slice(t + 1)
@@ -4698,32 +4727,32 @@ function zt(e, t) {
4698
4727
  e.initializer
4699
4728
  );
4700
4729
  }
4701
- function Jo(e, t, i, s) {
4702
- let r;
4730
+ function Bo(e, t, i, s) {
4731
+ let n;
4703
4732
  if (e.apiJsonEnabled)
4704
4733
  for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
4705
4734
  const l = e.privateApiJson.modules[d];
4706
4735
  if (l.sourcePath === i.fileName.slice(e.dir.root.length)) {
4707
- r = l;
4736
+ n = l;
4708
4737
  break;
4709
4738
  }
4710
4739
  }
4711
- const n = {
4740
+ const r = {
4712
4741
  compiler: e,
4713
- apiModule: r,
4742
+ apiModule: n,
4714
4743
  transformation: t
4715
4744
  }, a = i.statements;
4716
4745
  let c = a;
4717
4746
  try {
4718
4747
  s.forEach((d) => {
4719
- i.statements = d(i, n);
4748
+ i.statements = d(i, r);
4720
4749
  });
4721
4750
  } finally {
4722
4751
  c = i.statements, i.statements = a;
4723
4752
  }
4724
- return Bo(i, c);
4753
+ return Ko(i, c);
4725
4754
  }
4726
- const Bo = (e, t) => o.factory.updateSourceFile(
4755
+ const Ko = (e, t) => o.factory.updateSourceFile(
4727
4756
  e,
4728
4757
  t,
4729
4758
  /*
@@ -4738,10 +4767,10 @@ const Bo = (e, t) => o.factory.updateSourceFile(
4738
4767
  e.hasNoDefaultLib,
4739
4768
  e.libReferenceDirectives
4740
4769
  );
4741
- function Ko(e, t) {
4770
+ function _o(e, t) {
4742
4771
  t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
4743
4772
  }
4744
- const _o = (e, t) => {
4773
+ const Uo = (e, t) => {
4745
4774
  let i;
4746
4775
  if (t.apiModule !== void 0)
4747
4776
  for (let d = 0; d < t.apiModule.declarations.length; ++d) {
@@ -4754,31 +4783,31 @@ const _o = (e, t) => {
4754
4783
  if (!t.compiler.isInTest && i === void 0)
4755
4784
  return e.statements;
4756
4785
  let s;
4757
- function r() {
4786
+ function n() {
4758
4787
  s = /* @__PURE__ */ new Map();
4759
4788
  }
4760
- const n = (d) => Lo(d, s, t.compiler.shouldMinify);
4789
+ const r = (d) => jo(d, s, t.compiler.shouldMinify);
4761
4790
  function a(d, l) {
4762
- const p = Wo(t, i, d, l, e, s);
4763
- return Ko(p, t), p;
4791
+ const p = zo(t, i, d, l, e, s);
4792
+ return _o(p, t), p;
4764
4793
  }
4765
4794
  return e.statements.map(
4766
- (d) => ns(a, d, t, r, n)
4795
+ (d) => ns(a, d, t, n, r)
4767
4796
  );
4768
4797
  };
4769
- function ns(e, t, i, s, r = si) {
4798
+ function ns(e, t, i, s, n = ti) {
4770
4799
  if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
4771
- t.heritageClauses?.some((n) => n.token === o.SyntaxKind.ExtendsKeyword)) {
4772
- let n = !1;
4800
+ t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
4801
+ let r = !1;
4773
4802
  const a = t.name?.text;
4774
4803
  s?.();
4775
- const c = r(
4804
+ const c = n(
4776
4805
  t.members.map((l) => {
4777
4806
  const p = e(l, a);
4778
- return n ||= p !== l, p;
4807
+ return r ||= p !== l, p;
4779
4808
  })
4780
4809
  );
4781
- return n ? o.factory.updateClassDeclaration(
4810
+ return r ? o.factory.updateClassDeclaration(
4782
4811
  t,
4783
4812
  t.modifiers,
4784
4813
  t.name,
@@ -4789,15 +4818,15 @@ function ns(e, t, i, s, r = si) {
4789
4818
  } else
4790
4819
  return i.compiler.isInTest ? o.visitEachChild(
4791
4820
  t,
4792
- (a) => ns(e, a, i, s, r),
4821
+ (a) => ns(e, a, i, s, n),
4793
4822
  i.transformation
4794
4823
  ) : t;
4795
4824
  }
4796
- const Uo = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4797
- function Wo(e, t, i, s, r, n) {
4825
+ const Wo = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4826
+ function zo(e, t, i, s, n, r) {
4798
4827
  if (o.isMethodDeclaration(i)) {
4799
4828
  const a = i.modifiers?.filter(
4800
- (c) => !o.isDecorator(c) || !zo(c)
4829
+ (c) => !o.isDecorator(c) || !Ho(c)
4801
4830
  );
4802
4831
  if (a?.length !== i.modifiers?.length)
4803
4832
  return o.factory.updateMethodDeclaration(
@@ -4811,7 +4840,7 @@ function Wo(e, t, i, s, r, n) {
4811
4840
  i.type,
4812
4841
  i.body
4813
4842
  );
4814
- if ("text" in i.name && Uo.has(i.name.text) && i.body) {
4843
+ if ("text" in i.name && Wo.has(i.name.text) && i.body) {
4815
4844
  const c = i.name.text;
4816
4845
  return i.body.statements.some(
4817
4846
  (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
@@ -4837,14 +4866,14 @@ function Wo(e, t, i, s, r, n) {
4837
4866
  );
4838
4867
  }
4839
4868
  }
4840
- return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Oo(e, t, i, s, r, n) : i;
4869
+ return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Mo(e, t, i, s, n, r) : i;
4841
4870
  }
4842
- const zo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", Ho = [
4843
- ko,
4871
+ const Ho = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", qo = [
4872
+ xo,
4844
4873
  No,
4845
- _o
4846
- ], qo = "@arcgis/lumina:transformComponents", Vo = (e) => ({
4847
- name: qo,
4874
+ Uo
4875
+ ], Vo = "@arcgis/lumina:transformComponents", Go = (e) => ({
4876
+ name: Vo,
4848
4877
  transform: {
4849
4878
  // Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
4850
4879
  // Also, we need to run on the original fs file, before other transforms so
@@ -4860,14 +4889,14 @@ const zo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
4860
4889
  // eslint-disable-next-line @typescript-eslint/await-thenable
4861
4890
  e.apiJsonDeferred === void 0 ? [ie] : [ie, e.apiJsonDeferred.promise]
4862
4891
  );
4863
- const s = e.getSourceFile(i, t), n = o.transform(s, [
4864
- (u) => () => Jo(e, u, s, [
4892
+ const s = e.getSourceFile(i, t), r = o.transform(s, [
4893
+ (m) => () => Bo(e, m, s, [
4865
4894
  ...e.options.types?.sourceFileTransformers ?? [],
4866
- ...Ho
4895
+ ...qo
4867
4896
  ])
4868
- ]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(Go, m.basename(i), "", m.dirname(i), {}), d = yt.createTextWriter(`
4897
+ ]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(Xo, u.basename(i), "", u.dirname(i), {}), d = yt.createTextWriter(`
4869
4898
  `);
4870
- a.writeFile(n, d, c);
4899
+ a.writeFile(r, d, c);
4871
4900
  const l = d.getText(), p = c?.toJSON();
4872
4901
  return {
4873
4902
  code: l,
@@ -4875,70 +4904,70 @@ const zo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
4875
4904
  };
4876
4905
  }
4877
4906
  }
4878
- }), Go = {
4907
+ }), Xo = {
4879
4908
  getCurrentDirectory: o.sys.getCurrentDirectory,
4880
- getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? si : (e) => e.toLowerCase()
4881
- }, Xo = (e) => ({
4909
+ getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ti : (e) => e.toLowerCase()
4910
+ }, Yo = (e) => ({
4882
4911
  name: "@arcgis/lumina:handleDynamicAssets",
4883
4912
  configureServer(t) {
4884
- e.server = t, Ht(e).forEach(({ assets: i, transformers: s }) => de(e, i, s));
4913
+ e.server = t, zt(e).forEach(({ assets: i, transformers: s }) => Z(e, i, s));
4885
4914
  },
4886
4915
  async writeBundle() {
4887
4916
  await Promise.all(
4888
- Ht(e).map(
4889
- async ({ assets: t, transformers: i }) => await ji(e, t, i)
4917
+ zt(e).map(
4918
+ async ({ assets: t, transformers: i }) => await Ci(e, t, i)
4890
4919
  )
4891
4920
  );
4892
4921
  }
4893
4922
  });
4894
- function Ht(e) {
4923
+ function zt(e) {
4895
4924
  const t = [], i = e.assetsToProvide?.filter((s) => s.apply === void 0 || s.apply === e.viteCommand) ?? [];
4896
4925
  return e.options.assets?.extra?.forEach((s) => {
4897
4926
  "type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
4898
4927
  }), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
4899
4928
  }
4900
- const et = "@arcgis/lumina:updatePackageJson", Yo = (e) => ({
4901
- name: et,
4929
+ const Ze = "@arcgis/lumina:updatePackageJson", Qo = (e) => ({
4930
+ name: Ze,
4902
4931
  apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
4903
4932
  configResolved() {
4904
- Qo(e).catch(
4905
- (t) => E.error(et, `Failed to update package's package.json:${String(t)}`)
4933
+ Zo(e).catch(
4934
+ (t) => $.error(Ze, `Failed to update package's package.json:${String(t)}`)
4906
4935
  );
4907
4936
  }
4908
4937
  });
4909
- async function Qo(e) {
4910
- const t = m.join(e.dir.root, "package.json"), i = JSON.parse(await H(t, "utf-8")), s = Zo(i, e);
4911
- s && ei(t, JSON.stringify(s, null, 2));
4938
+ async function Zo(e) {
4939
+ const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = ea(i, e);
4940
+ s && Qt(t, JSON.stringify(s, null, 2));
4912
4941
  }
4913
- function Zo(e, t) {
4942
+ function ea(e, t) {
4914
4943
  const i = e?.devDependencies ?? {};
4915
4944
  Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
4916
- l in i || E.warn(
4917
- et,
4945
+ l in i || $.warn(
4946
+ Ze,
4918
4947
  `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`
4919
4948
  );
4920
4949
  });
4921
4950
  let s = !1;
4922
- const r = (l) => m.relative(t.dir.root, m.join(t.dir.dist, l)), n = t._documentationFileNames;
4923
- if (n.vsCodeCss !== void 0) {
4924
- const l = e["css.customData"] ?? [], p = r(n.vsCodeCss);
4951
+ const n = (l) => u.relative(t.dir.root, u.join(t.dir.dist, l)), r = t._documentationFileNames;
4952
+ if (r.vsCodeCss !== void 0) {
4953
+ const l = e["css.customData"] ?? [], p = n(r.vsCodeCss);
4925
4954
  l.includes(p) || (e["css.customData"] = [...l, p], s = !0);
4926
4955
  }
4927
- if (n.apiJson !== void 0) {
4928
- const l = r(n.apiJson);
4956
+ if (r.apiJson !== void 0) {
4957
+ const l = n(r.apiJson);
4929
4958
  e.customElements !== l && (e.customElements = l, s = !0);
4930
4959
  }
4931
- if (n.vsCodeHtml !== void 0) {
4932
- const l = e["html.customData"] ?? [], p = r(n.vsCodeHtml);
4960
+ if (r.vsCodeHtml !== void 0) {
4961
+ const l = e["html.customData"] ?? [], p = n(r.vsCodeHtml);
4933
4962
  l.includes(p) || (e["html.customData"] = [...l, p], s = !0);
4934
4963
  }
4935
- if (n.webTypes !== void 0) {
4936
- const l = r(n.webTypes);
4964
+ if (r.webTypes !== void 0) {
4965
+ const l = n(r.webTypes);
4937
4966
  e["web-types"] !== l && (s = !0, e["web-types"] = l);
4938
4967
  }
4939
- const a = `./${Q}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = fe(
4968
+ const a = `./${Y}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = fe(
4940
4969
  t.dir.root,
4941
- m.join(t.dir.distCdn, a)
4970
+ u.join(t.dir.distCdn, a)
4942
4971
  );
4943
4972
  if (!c) {
4944
4973
  e.exports?.[a] !== d && (e.exports ??= {}, e.exports[a] = d, s = !0);
@@ -4949,21 +4978,21 @@ function Zo(e, t) {
4949
4978
  if (s)
4950
4979
  return e;
4951
4980
  }
4952
- const ea = (e) => ({
4981
+ const ta = (e) => ({
4953
4982
  deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
4954
4983
  timestamp: e.apiJson.timestamp,
4955
4984
  compiler: e.apiJson.compiler,
4956
- components: ta(e),
4985
+ components: ia(e),
4957
4986
  typeLibrary: {}
4958
4987
  });
4959
- function ta(e) {
4988
+ function ia(e) {
4960
4989
  const t = [];
4961
4990
  for (const i of e.apiJson.modules)
4962
4991
  for (const s of i.declarations)
4963
- s.customElement === !0 && t.push(ia(s, i.sourcePath));
4992
+ s.customElement === !0 && t.push(sa(s, i.sourcePath));
4964
4993
  return t;
4965
4994
  }
4966
- function ia(e, t) {
4995
+ function sa(e, t) {
4967
4996
  const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
4968
4997
  return {
4969
4998
  filePath: t,
@@ -4978,31 +5007,31 @@ function ia(e, t) {
4978
5007
  dependencies: [],
4979
5008
  dependencyGraph: {},
4980
5009
  deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
4981
- props: e.members.map(sa).filter(F),
4982
- methods: e.members.map(ra).filter(F),
4983
- events: e.events?.map(na) ?? [],
5010
+ props: e.members.map(ra).filter(j),
5011
+ methods: e.members.map(na).filter(j),
5012
+ events: e.events?.map(oa) ?? [],
4984
5013
  styles: e.cssProperties?.map((s) => ({
4985
5014
  name: s.name,
4986
5015
  annotation: "prop",
4987
5016
  docs: s.description ?? "",
4988
5017
  mode: void 0
4989
5018
  })) ?? [],
4990
- slots: e.slots?.map(({ name: s, description: r = "" }) => ({ name: s, docs: r })) ?? [],
4991
- parts: e.cssParts?.map(({ name: s, description: r = "" }) => ({ name: s, docs: r })) ?? [],
5019
+ slots: e.slots?.map(({ name: s, description: n = "" }) => ({ name: s, docs: n })) ?? [],
5020
+ parts: e.cssParts?.map(({ name: s, description: n = "" }) => ({ name: s, docs: n })) ?? [],
4992
5021
  listeners: []
4993
5022
  };
4994
5023
  }
4995
- function sa(e) {
5024
+ function ra(e) {
4996
5025
  if (e.kind !== "field")
4997
5026
  return;
4998
- const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], r = t.docsTags?.some((n) => n.name === "required") ?? !1;
5027
+ 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;
4999
5028
  return {
5000
5029
  name: e.name,
5001
5030
  type: t.type?.text ?? "unknown",
5002
5031
  complexType: t.type === void 0 ? void 0 : {
5003
5032
  original: t.type.text,
5004
5033
  resolved: t.type.text,
5005
- references: ut(t.type.references)
5034
+ references: mt(t.type.references)
5006
5035
  },
5007
5036
  mutable: !0,
5008
5037
  attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
@@ -5017,44 +5046,44 @@ function sa(e) {
5017
5046
  * practice, all non-required properties are optional, so this is somewhat
5018
5047
  * redundant.
5019
5048
  */
5020
- optional: !r,
5021
- required: r
5049
+ optional: !n,
5050
+ required: n
5022
5051
  };
5023
5052
  }
5024
- const ut = (e) => Object.fromEntries(
5053
+ const mt = (e) => Object.fromEntries(
5025
5054
  e?.map(
5026
5055
  (t) => [
5027
5056
  t.name,
5028
5057
  {
5029
- location: t.package === Es ? "global" : t.package === void 0 ? "local" : "import",
5030
- path: typeof t.module == "string" && typeof t.package == "string" ? m.join(t.package, t.module) : t.module ?? t.package,
5058
+ location: t.package === Cs ? "global" : t.package === void 0 ? "local" : "import",
5059
+ path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
5031
5060
  id: "notImplemented"
5032
5061
  }
5033
5062
  ]
5034
5063
  ) ?? []
5035
5064
  );
5036
- function ra(e) {
5065
+ function na(e) {
5037
5066
  if (e.kind !== "method")
5038
5067
  return;
5039
- const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: r, type: n, description: a }) => ({
5040
- name: r,
5041
- type: n?.text ?? "unknown",
5068
+ const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
5069
+ name: n,
5070
+ type: r?.text ?? "unknown",
5042
5071
  docs: a ?? ""
5043
5072
  })) ?? [];
5044
5073
  return {
5045
5074
  name: e.name,
5046
5075
  returns: {
5047
5076
  type: t.return?.type?.text ?? "void",
5048
- docs: t.docsTags?.filter(({ name: r }) => r === "return" || r === "returns").map(({ text: r }) => r).join(`
5077
+ docs: t.docsTags?.filter(({ name: n }) => n === "return" || n === "returns").map(({ text: n }) => n).join(`
5049
5078
  `) ?? ""
5050
5079
  },
5051
5080
  complexType: {
5052
5081
  signature: t.signature ?? "()=>unknown",
5053
5082
  parameters: s,
5054
5083
  return: t.return?.type?.text ?? "void",
5055
- references: ut([
5084
+ references: mt([
5056
5085
  ...t.return?.type?.references ?? [],
5057
- ...t.parameters?.flatMap((r) => r.type.references ?? []) ?? []
5086
+ ...t.parameters?.flatMap((n) => n.type.references ?? []) ?? []
5058
5087
  ])
5059
5088
  },
5060
5089
  signature: `${t.name}${t.signature ?? "()=>unknown"}`,
@@ -5064,7 +5093,7 @@ function ra(e) {
5064
5093
  deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
5065
5094
  };
5066
5095
  }
5067
- function na(e) {
5096
+ function oa(e) {
5068
5097
  const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
5069
5098
  return {
5070
5099
  event: e.name,
@@ -5073,7 +5102,7 @@ function na(e) {
5073
5102
  complexType: {
5074
5103
  original: e.type.text,
5075
5104
  resolved: e.type.text,
5076
- references: ut(e.type.references)
5105
+ references: mt(e.type.references)
5077
5106
  },
5078
5107
  cancelable: e.cancelable ?? !0,
5079
5108
  composed: e.composed ?? !0,
@@ -5093,7 +5122,7 @@ const os = (e) => e.flatMap(
5093
5122
  description: i.description || void 0
5094
5123
  })) ?? []
5095
5124
  );
5096
- function oa(e) {
5125
+ function aa(e) {
5097
5126
  if (e.attributes === void 0)
5098
5127
  return [];
5099
5128
  const t = [];
@@ -5104,9 +5133,9 @@ function oa(e) {
5104
5133
  description: je(s.description, s.deprecated) || void 0,
5105
5134
  default: s.default,
5106
5135
  value: {
5107
- type: aa(
5136
+ type: la(
5108
5137
  s.type.values?.map(
5109
- (r) => r.type === "string" && r.value !== void 0 ? `"${r.value}"` : r.value ?? r.type
5138
+ (n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
5110
5139
  )
5111
5140
  )
5112
5141
  }
@@ -5114,7 +5143,7 @@ function oa(e) {
5114
5143
  }
5115
5144
  return t;
5116
5145
  }
5117
- const aa = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
5146
+ const la = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
5118
5147
  slots: "Slots",
5119
5148
  events: "Events",
5120
5149
  cssProperties: "CSS Properties",
@@ -5122,40 +5151,40 @@ const aa = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1
5122
5151
  methods: "Methods"
5123
5152
  };
5124
5153
  function ls(e) {
5125
- const t = la(e.slots), i = ca(e.events), s = da(e.cssProperties), r = pa(e.cssParts), n = ua(e.members), a = je(e.description, e.deprecated).trim();
5154
+ const t = ca(e.slots), i = da(e.events), s = pa(e.cssProperties), n = ma(e.cssParts), r = ua(e.members), a = je(e.description, e.deprecated).trim();
5126
5155
  return [...a ? [`${a}
5127
- --`] : [], i, n, t, s, r].filter(Boolean).join(`
5156
+ --`] : [], i, r, t, s, n].filter(Boolean).join(`
5128
5157
 
5129
5158
  `);
5130
5159
  }
5131
5160
  const he = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
5132
5161
  ${t.join(`
5133
- `)}`, la = (e) => he(
5162
+ `)}`, ca = (e) => he(
5134
5163
  ge.slots,
5135
5164
  e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
5136
- ), ca = (e) => he(
5165
+ ), da = (e) => he(
5137
5166
  ge.events,
5138
5167
  e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
5139
- ), da = (e = []) => he(
5168
+ ), pa = (e = []) => he(
5140
5169
  ge.cssProperties,
5141
5170
  e?.map(
5142
5171
  (t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
5143
5172
  )
5144
- ), pa = (e) => he(
5173
+ ), ma = (e) => he(
5145
5174
  ge.cssParts,
5146
5175
  e?.map((t) => `- **${t.name}** - ${t.description}`)
5147
5176
  ), ua = (e) => he(
5148
5177
  ge.methods,
5149
- e.filter(Cs).map(
5178
+ e.filter(Es).map(
5150
5179
  (t) => [`- \`${t.name}${t.signature}\``, je(t.description, t.deprecated)].filter(Boolean).join(" - ")
5151
5180
  )
5152
5181
  );
5153
- function ma(e, t) {
5154
- const i = fa(e), s = os(e), r = as(e), n = O();
5182
+ function fa(e, t) {
5183
+ const i = ga(e), s = os(e), n = as(e), r = R();
5155
5184
  return {
5156
5185
  $schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
5157
- name: n.name,
5158
- version: n.version,
5186
+ name: r.name,
5187
+ version: r.version,
5159
5188
  "description-markup": "markdown",
5160
5189
  "default-icon": t.defaultIcon,
5161
5190
  contributions: {
@@ -5164,122 +5193,122 @@ function ma(e, t) {
5164
5193
  },
5165
5194
  css: {
5166
5195
  properties: s,
5167
- "pseudo-elements": r
5196
+ "pseudo-elements": n
5168
5197
  }
5169
5198
  }
5170
5199
  };
5171
5200
  }
5172
- const fa = (e) => e.map((t) => ({
5201
+ const ga = (e) => e.map((t) => ({
5173
5202
  name: t.tagName,
5174
5203
  description: ls(t),
5175
5204
  "doc-url": t.demos?.[0]?.url,
5176
- attributes: oa(t),
5205
+ attributes: aa(t),
5177
5206
  slots: t.slots?.map((i) => ({
5178
5207
  name: i.name,
5179
5208
  description: i.description
5180
5209
  })),
5181
5210
  // REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
5182
- events: qt(t),
5211
+ events: Ht(t),
5183
5212
  js: {
5184
- properties: ga(t),
5185
- events: qt(t)
5213
+ properties: ha(t),
5214
+ events: Ht(t)
5186
5215
  }
5187
- })), ga = (e) => e.members.filter(Ts).map((t) => ({
5216
+ })), ha = (e) => e.members.filter(Ts).map((t) => ({
5188
5217
  name: t.name,
5189
5218
  description: t.description,
5190
5219
  type: t.type?.text
5191
- })) ?? [], qt = (e) => e.events?.map((t) => ({
5220
+ })) ?? [], Ht = (e) => e.events?.map((t) => ({
5192
5221
  name: t.name,
5193
5222
  type: t.type?.text,
5194
5223
  description: t.description
5195
- })) ?? [], ha = (e) => e.map((t) => ({
5224
+ })) ?? [], ya = (e) => e.map((t) => ({
5196
5225
  name: t.tagName,
5197
5226
  description: ls(t),
5198
- attributes: ya(t),
5227
+ attributes: va(t),
5199
5228
  references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
5200
- })), ya = (e) => e.attributes?.map((t) => ({
5229
+ })), va = (e) => e.attributes?.map((t) => ({
5201
5230
  name: t.name,
5202
5231
  description: je(t.description, t.deprecated) || void 0,
5203
- values: va(t)
5204
- })) ?? [], va = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], ba = (e) => ({
5232
+ values: ba(t)
5233
+ })) ?? [], ba = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], wa = (e) => ({
5205
5234
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
5206
5235
  version: 1.1,
5207
- tags: ha(e)
5208
- }), wa = (e) => ({
5236
+ tags: ya(e)
5237
+ }), Sa = (e) => ({
5209
5238
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
5210
5239
  version: 1.1,
5211
5240
  properties: os(e),
5212
5241
  pseudoElements: as(e)
5213
- }), Sa = "@arcgis/lumina:generateDocs";
5242
+ }), Ca = "@arcgis/lumina:generateDocs";
5214
5243
  function Ea(e) {
5215
5244
  return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
5216
5245
  {
5217
5246
  type: "dynamic",
5218
- source: () => JSON.stringify(ea(e), null, Ze(e)),
5219
- destination: m.join("../..", e._documentationFileNames.stencilLikeDocsJson)
5247
+ source: () => JSON.stringify(ta(e), null, Qe(e)),
5248
+ destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
5220
5249
  }
5221
5250
  ]), {
5222
- name: Sa,
5251
+ name: Ca,
5223
5252
  async writeBundle() {
5224
5253
  if (e.isInStorybook)
5225
5254
  return;
5226
- const t = Ze(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, r = s.vsCodeHtml === void 0 ? void 0 : m.join(e.dir.dist, s.vsCodeHtml), n = s.vsCodeCss === void 0 ? void 0 : m.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : m.join(e.dir.dist, s.webTypes), c = [r, n, a].filter(F);
5255
+ const t = Qe(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(j);
5227
5256
  if (c.length === 0)
5228
5257
  return;
5229
- await Mi(c);
5258
+ await Ii(c);
5230
5259
  const d = [];
5231
- if (r !== void 0) {
5232
- const l = JSON.stringify(ba(e.apiJsonComponents), null, t);
5233
- d.push(U(r, l));
5234
- }
5235
5260
  if (n !== void 0) {
5236
5261
  const l = JSON.stringify(wa(e.apiJsonComponents), null, t);
5237
- d.push(U(n, l));
5262
+ d.push(_(n, l));
5263
+ }
5264
+ if (r !== void 0) {
5265
+ const l = JSON.stringify(Sa(e.apiJsonComponents), null, t);
5266
+ d.push(_(r, l));
5238
5267
  }
5239
5268
  if (a !== void 0) {
5240
- const l = ma(e.apiJsonComponents, typeof i == "object" ? i : {});
5241
- d.push(U(a, JSON.stringify(l, null, t)));
5269
+ const l = fa(e.apiJsonComponents, typeof i == "object" ? i : {});
5270
+ d.push(_(a, JSON.stringify(l, null, t)));
5242
5271
  }
5243
5272
  await Promise.all(d);
5244
5273
  }
5245
5274
  };
5246
5275
  }
5247
- function Ca(e) {
5276
+ function Ta(e) {
5248
5277
  return {
5249
5278
  name: "@arcgis/lumina:buildWrappers",
5250
5279
  apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
5251
5280
  async writeBundle() {
5252
5281
  e.isInStorybook || await Promise.all(
5253
5282
  e.options.build?.wrappers?.map(async (t) => {
5254
- t.type === "react18" && await Pa(e, t);
5283
+ t.type === "react18" && await Ia(e, t);
5255
5284
  }) ?? []
5256
5285
  );
5257
5286
  }
5258
5287
  };
5259
5288
  }
5260
- const Ta = "react", Vt = "@lit/react", $a = `
5261
- import React from "${Ta}";
5262
- import { createComponent } from "${Vt}";
5263
- import type { EventName } from "${Vt}";
5289
+ const $a = "react", qt = "@lit/react", Pa = `
5290
+ import React from "${$a}";
5291
+ import { createComponent } from "${qt}";
5292
+ import type { EventName } from "${qt}";
5264
5293
  import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
5265
5294
 
5266
5295
  const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
5267
5296
  `;
5268
- async function Pa(e, t) {
5269
- const { name: i } = O(), s = [];
5297
+ async function Ia(e, t) {
5298
+ const { name: i } = R(), s = [];
5270
5299
  for (const a of e.apiJson.modules)
5271
5300
  for (const c of a.declarations)
5272
- c.customElement === !0 && s.push(Ia(c));
5273
- const r = [`/// <reference types="${i}" preserve="true" />`, $a, ...s].join(""), n = m.resolve(t.proxiesFile);
5274
- await G(m.dirname(n), { recursive: !0 }), await U(n, r);
5301
+ c.customElement === !0 && s.push(ka(c));
5302
+ const n = [`/// <reference types="${i}" preserve="true" />`, Pa, ...s].join(""), r = u.resolve(t.proxiesFile);
5303
+ await V(u.dirname(r), { recursive: !0 }), await _(r, n);
5275
5304
  }
5276
- function Ia(e) {
5305
+ function ka(e) {
5277
5306
  const t = e.events?.map(
5278
5307
  (i) => ` ${Os(`on${ps(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
5279
5308
  ).join(`
5280
5309
  `);
5281
5310
  return `
5282
- /** @deprecated since 5.0. React wrappers are not needed in React 19 or above. Use <${e.tagName} /> directly. */
5311
+ /** @deprecated since 5.0. React wrappers are not needed in React 19 or above. Use \`<${e.tagName} />\` directly. */
5283
5312
  export const ${e.pascalCaseName} = /*@__PURE__*/ createWrapper(
5284
5313
  getReactWrapperOptions(
5285
5314
  "${e.tagName}" as unknown as HTML${e.pascalCaseName}Element,
@@ -5290,41 +5319,41 @@ ${t}
5290
5319
  );
5291
5320
  `;
5292
5321
  }
5293
- function Qa(e = {}) {
5294
- const t = new $(e), s = [
5322
+ function il(e = {}) {
5323
+ const t = new P(e), s = [
5295
5324
  t._plugin,
5296
- An(t),
5297
5325
  Nn(t),
5298
- Yo(t),
5299
- vn(t),
5326
+ jn(t),
5327
+ Qo(t),
5328
+ Tn(t),
5300
5329
  Ea(t),
5301
- Vo(t),
5302
- Hn(t),
5330
+ Go(t),
5331
+ qn(t),
5303
5332
  nr(t),
5304
- Cn(t),
5305
- Xo(t),
5306
- Vn(t),
5307
- Rn(t),
5333
+ $n(t),
5334
+ Yo(t),
5335
+ Gn(t),
5336
+ Mn(t),
5308
5337
  Js(t),
5309
- Hr(t),
5310
- Ca(t),
5311
- Tn(t)
5312
- ].filter(F);
5338
+ Qr(t),
5339
+ Ta(t),
5340
+ Pn(t)
5341
+ ].filter(j);
5313
5342
  return s.context = t, s;
5314
5343
  }
5315
- const Za = {
5316
- initializeComponentDependencies: bi,
5344
+ const sl = {
5345
+ initializeComponentDependencies: yi,
5317
5346
  updateLuminaTs: Ki,
5318
- propertyToAttributeMappings: W,
5319
- nativeEvents: ai,
5347
+ propertyToAttributeMappings: U,
5348
+ nativeEvents: ni,
5320
5349
  svgElements: it,
5321
5350
  mathMlElements: st,
5322
- alwaysAttributes: ri,
5323
- nativeAlwaysAttributes: ni,
5351
+ alwaysAttributes: ii,
5352
+ nativeAlwaysAttributes: si,
5324
5353
  htmlAlwaysAttributes: qe
5325
5354
  };
5326
5355
  export {
5327
- Za as exportsForCodemod,
5328
- Ne as inferCdnUrl,
5329
- Qa as useLumina
5356
+ sl as exportsForCodemod,
5357
+ Le as inferCdnUrl,
5358
+ il as useLumina
5330
5359
  };