@stencil/core 5.0.0-beta.10 → 5.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import { n as Env, r as NAMESPACE, t as BUILD } from "../index-BXAcVN2j.js";
1
+ import { n as Env, r as NAMESPACE, t as BUILD } from "../index-BHciXst1.js";
2
2
  export { BUILD, Env, NAMESPACE };
@@ -1,5 +1,5 @@
1
1
  import { B as HOST_FLAGS, C as CMP_FLAGS, G as NODE_TYPES, Z as SVG_NS, o as isComplexType, s as isDef, x as queryNonceMetaTagContent } from "./helpers-Cpp3qc3u.mjs";
2
- import { effect } from "@preact/signals-core";
2
+ import * as SignalsCore from "@preact/signals-core";
3
3
  //#region src/app-data/index.ts
4
4
  /**
5
5
  * A collection of default build flags for a Stencil project.
@@ -722,6 +722,10 @@ const attachStyles = (hostRef) => {
722
722
  */
723
723
  const getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & CMP_FLAGS.hasMode ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
724
724
  //#endregion
725
+ //#region src/runtime/signals-core.ts
726
+ const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
727
+ const effect = (fn, options) => getCore().effect(fn, options);
728
+ //#endregion
725
729
  //#region src/runtime/event-emitter.ts
726
730
  /**
727
731
  * Helper function to create & dispatch a custom Event on a provided target
@@ -1312,7 +1316,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1312
1316
  }
1313
1317
  if (BUILD.vdomKey && idxInOld >= 0) {
1314
1318
  elmToMove = oldCh[idxInOld];
1315
- if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
1319
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
1316
1320
  else {
1317
1321
  patch(elmToMove, newStartVnode, isInitialRender);
1318
1322
  oldCh[idxInOld] = void 0;
@@ -1693,6 +1693,18 @@ const createJsVarName = (fileName) => {
1693
1693
  }
1694
1694
  return fileName;
1695
1695
  };
1696
+ /**
1697
+ * Create a function that lowercases the first string parameter before passing it to the provided function
1698
+ * @param fn the function to pass the lowercased path to
1699
+ * @returns the result of the provided function
1700
+ */
1701
+ const lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
1702
+ /**
1703
+ * Determine if a stringified file path is a TypeScript declaration file based on the extension at the end of the path.
1704
+ * @param p the path to evaluate
1705
+ * @returns `true` if the path ends in `.d.ts` (case-sensitive), `false` otherwise.
1706
+ */
1707
+ const isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
1696
1708
  function getTextDocs(docs) {
1697
1709
  if (docs == null) return "";
1698
1710
  return [escapeWithPattern(docs.text.replace(LINE_BREAK_REGEX, " "), /\*\//, "*\\/", true), ...docs.tags.filter((tag) => tag.name !== "internal").map((tag) => {
@@ -1832,7 +1844,7 @@ const validateComponentTag = (tag) => {
1832
1844
  };
1833
1845
  //#endregion
1834
1846
  //#region src/version.ts
1835
- const version = "5.0.0-beta.10";
1847
+ const version = "5.0.0-beta.12";
1836
1848
  //#endregion
1837
1849
  //#region src/compiler/events.ts
1838
1850
  const buildEvents = () => {
@@ -1895,6 +1907,7 @@ const resolve = (id, _opts, cb) => {
1895
1907
  };
1896
1908
  //#endregion
1897
1909
  //#region src/compiler/sys/resolve/resolve-utils.ts
1910
+ const isLocalModule = (p) => p.startsWith(".") || p.startsWith("/");
1898
1911
  const isNodeModulePath = (p) => normalizePath(p).split("/").includes("node_modules");
1899
1912
  const getModuleId = (orgImport) => {
1900
1913
  if (orgImport.startsWith("~")) orgImport = orgImport.substring(1);
@@ -4047,6 +4060,39 @@ const DEFAULT_BROWSER_TARGETS = [
4047
4060
  //#endregion
4048
4061
  //#region src/compiler/style/css-parser/parse-css.ts
4049
4062
  /**
4063
+ * Splits a selector list on top-level commas in a single pass: a comma only
4064
+ * splits when it's outside a quoted string and at paren depth 0, so commas in
4065
+ * `:is(:a,:has(:b))` or `[title="a,b"]` aren't treated as separators.
4066
+ * Backslash escapes (inside or outside a string) are skipped so they can't shift state,
4067
+ * so e.g. `[title="a\,b"]` is treated as a single selector.
4068
+ * @param selectors The selector list to split
4069
+ * @returns An array of selectors, with whitespace trimmed from each selector
4070
+ */
4071
+ const splitSelectorList = (selectors) => {
4072
+ const parts = [];
4073
+ let depth = 0;
4074
+ let quote = null;
4075
+ let start = 0;
4076
+ for (let i = 0; i < selectors.length; i++) {
4077
+ const ch = selectors[i];
4078
+ if (quote) {
4079
+ if (ch === "\\") i++;
4080
+ else if (ch === quote) quote = null;
4081
+ continue;
4082
+ }
4083
+ if (ch === "\"" || ch === "'") quote = ch;
4084
+ else if (ch === "\\") i++;
4085
+ else if (ch === "(") depth++;
4086
+ else if (ch === ")") depth = Math.max(0, depth - 1);
4087
+ else if (ch === "," && depth === 0) {
4088
+ parts.push(selectors.slice(start, i));
4089
+ start = i + 1;
4090
+ }
4091
+ }
4092
+ parts.push(selectors.slice(start));
4093
+ return parts.map((s) => s.trim());
4094
+ };
4095
+ /**
4050
4096
  * Parses CSS string input into an AST representation.
4051
4097
  * Used for minification, finding & resolving URLs and during SSR / prerendering, removing unused selectors.
4052
4098
  *
@@ -4171,11 +4217,8 @@ const parseCss = (css, filePath) => {
4171
4217
  const selector = () => {
4172
4218
  const m = match(/^([^{]+)/);
4173
4219
  if (!m) return null;
4174
- return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(str) {
4175
- return str.replace(/,/g, "‌");
4176
- }).split(/\s*(?![^(]*\)),\s*/).map(function(s) {
4177
- return s.replace(/\u200C/g, ",");
4178
- });
4220
+ const cleaned = trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "");
4221
+ return splitSelectorList(cleaned);
4179
4222
  };
4180
4223
  const declaration = () => {
4181
4224
  const pos = position();
@@ -13956,25 +13999,161 @@ function matchesNamedDeclaration(name) {
13956
13999
  };
13957
14000
  }
13958
14001
  /**
13959
- * Finds a re-export of `className` in `sourceFile` - `export { X } from './y'` or
13960
- * `export { X as Y } from './y'` - as used by barrel entry points (e.g. `@stencil/core`'s own
13961
- * public `index.d.mts`, which re-exports its runtime API from `./declarations/stencil-public-runtime`
13962
- * rather than declaring it directly).
14002
+ * Finds a re-export of `className` in `sourceFile`: `export { X } from './y'`, or the
14003
+ * bundler-split shape `import { X as name } from './y'; export { name };` (no `from` clause).
13963
14004
  * @param sourceFile the (barrel) source file to scan
13964
14005
  * @param className the exported name to look for
13965
- * @returns the module specifier and the name to look for in that module (the local name, before
13966
- * any `as` aliasing), or `undefined` if no matching re-export is found
14006
+ * @returns the module specifier and name to look for there (before any `as` aliasing), or
14007
+ * `undefined` if not found
13967
14008
  */
13968
14009
  function findReExport(sourceFile, className) {
13969
14010
  for (const stmt of sourceFile.statements) {
13970
- if (!ts$1.isExportDeclaration(stmt) || !stmt.moduleSpecifier || !ts$1.isStringLiteral(stmt.moduleSpecifier) || !stmt.exportClause || !ts$1.isNamedExports(stmt.exportClause)) continue;
13971
- for (const element of stmt.exportClause.elements) if (element.name.text === className) return {
14011
+ if (!ts$1.isExportDeclaration(stmt) || !stmt.exportClause || !ts$1.isNamedExports(stmt.exportClause)) continue;
14012
+ const element = stmt.exportClause.elements.find((el) => el.name.text === className);
14013
+ if (!element) continue;
14014
+ if (stmt.moduleSpecifier && ts$1.isStringLiteral(stmt.moduleSpecifier)) return {
13972
14015
  moduleSpecifier: stmt.moduleSpecifier.text,
13973
14016
  localName: element.propertyName?.text ?? element.name.text
13974
14017
  };
14018
+ const importOrigin = findImportOrigin(sourceFile, element.propertyName?.text ?? element.name.text);
14019
+ if (importOrigin) return importOrigin;
14020
+ }
14021
+ }
14022
+ /**
14023
+ * Finds `name`'s import in `sourceFile` and returns its module and origin name (before any `as`
14024
+ * aliasing; `'default'` for a default import).
14025
+ * @param sourceFile the source file to scan for a matching import
14026
+ * @param name the local (post-aliasing) name an import bound
14027
+ * @returns the import's module specifier and origin name, or `undefined` if `name` isn't imported
14028
+ */
14029
+ function findImportOrigin(sourceFile, name) {
14030
+ for (const stmt of sourceFile.statements) {
14031
+ if (!ts$1.isImportDeclaration(stmt) || !stmt.importClause || !ts$1.isStringLiteral(stmt.moduleSpecifier)) continue;
14032
+ const moduleSpecifier = stmt.moduleSpecifier.text;
14033
+ if (stmt.importClause.name?.text === name) return {
14034
+ moduleSpecifier,
14035
+ localName: "default"
14036
+ };
14037
+ const bindings = stmt.importClause.namedBindings;
14038
+ if (!bindings || !ts$1.isNamedImports(bindings)) continue;
14039
+ const element = bindings.elements.find((el) => el.name.text === name);
14040
+ if (element) return {
14041
+ moduleSpecifier,
14042
+ localName: element.propertyName?.text ?? element.name.text
14043
+ };
13975
14044
  }
13976
14045
  }
13977
14046
  /**
14047
+ * Finds `name` as a top-level declaration in `sf` (see `matchesNamedDeclaration`), following a
14048
+ * same-file export alias if `name` is only ever the public side of a local rename
14049
+ * (`export { RealName as name }`, no `from` clause).
14050
+ * @param sf the source file to search
14051
+ * @param name the declaration name to look for, which may only exist as an export alias
14052
+ * @returns the matched statement, or `undefined`
14053
+ */
14054
+ function findStatementByName(sf, name) {
14055
+ const direct = sf.statements.find(matchesNamedDeclaration(name));
14056
+ if (direct) return direct;
14057
+ for (const stmt of sf.statements) {
14058
+ if (!ts$1.isExportDeclaration(stmt) || stmt.moduleSpecifier || !stmt.exportClause || !ts$1.isNamedExports(stmt.exportClause)) continue;
14059
+ const aliasedName = stmt.exportClause.elements.find((el) => el.name.text === name)?.propertyName?.text;
14060
+ if (aliasedName && aliasedName !== name) return sf.statements.find(matchesNamedDeclaration(aliasedName));
14061
+ }
14062
+ }
14063
+ /**
14064
+ * Picks the runtime target out of a `package.json` `exports` condition entry - prefers `import`
14065
+ * over `require`/`node`/`default`, recursing into nested condition objects.
14066
+ * @param entry an `exports` map value: a path string, or nested conditions
14067
+ * @returns the resolved relative path, or `undefined` if no usable condition was found
14068
+ */
14069
+ function pickJsCondition(entry) {
14070
+ if (typeof entry === "string") return entry;
14071
+ if (typeof entry !== "object" || entry === null) return;
14072
+ const conditions = entry;
14073
+ for (const key of [
14074
+ "import",
14075
+ "require",
14076
+ "node",
14077
+ "default"
14078
+ ]) if (key in conditions) {
14079
+ const picked = pickJsCondition(conditions[key]);
14080
+ if (picked) return picked;
14081
+ }
14082
+ }
14083
+ /**
14084
+ * Reads and parses `filePath` as JS, with parent nodes set - unlike `tsGetSourceFile`, which
14085
+ * never triggers binding, so `.parent` stays unset and `node.getSourceFile()` returns `undefined`.
14086
+ * @param config the current Stencil validated config
14087
+ * @param filePath the absolute path of the JS file to read and parse
14088
+ * @returns the parsed source file, or `undefined` if it couldn't be read
14089
+ */
14090
+ function readJsSourceFile(config, filePath) {
14091
+ try {
14092
+ const text = config.sys.readFileSync(filePath);
14093
+ if (typeof text !== "string") return;
14094
+ return ts$1.createSourceFile(filePath, text, ts$1.ScriptTarget.ESNext, true, ts$1.ScriptKind.JS);
14095
+ } catch {
14096
+ return;
14097
+ }
14098
+ }
14099
+ /**
14100
+ * Resolves the runtime JS entry for a bare (non-relative) module specifier by reading its
14101
+ * package's own `package.json` `exports` map, instead of `tsResolveModuleName` - which always
14102
+ * resolves to the package's `types` entry, an ambient signature with no body a mixin factory's
14103
+ * class can never be found inside.
14104
+ * @param config the current Stencil validated config
14105
+ * @param compilerCtx the current compiler context
14106
+ * @param moduleSpecifier the bare package specifier to resolve
14107
+ * @param containingFile the file the specifier was imported from
14108
+ * @returns the resolved JS source file, or `undefined` if it couldn't be resolved this way
14109
+ */
14110
+ function resolveModuleJsEntry(config, compilerCtx, moduleSpecifier, containingFile) {
14111
+ if (isLocalModule(moduleSpecifier)) return;
14112
+ const pkgJsonPath = tsResolveModuleNamePackageJsonPath(config, compilerCtx, moduleSpecifier, containingFile);
14113
+ if (!pkgJsonPath) return;
14114
+ let pkgJson;
14115
+ try {
14116
+ pkgJson = JSON.parse(config.sys.readFileSync(pkgJsonPath));
14117
+ } catch {
14118
+ return;
14119
+ }
14120
+ const pkgName = pkgJson.name;
14121
+ if (!pkgName || !moduleSpecifier.startsWith(pkgName) || !pkgJson.exports) return;
14122
+ const subpath = moduleSpecifier === pkgName ? "." : `.${moduleSpecifier.slice(pkgName.length)}`;
14123
+ const exportsMap = pkgJson.exports;
14124
+ const conditionEntry = typeof exportsMap === "string" ? subpath === "." ? exportsMap : void 0 : exportsMap[subpath] ?? (subpath === "." ? exportsMap : void 0);
14125
+ const target = conditionEntry && pickJsCondition(conditionEntry);
14126
+ if (!target) return;
14127
+ return readJsSourceFile(config, normalizePath(join$1(dirname(pkgJsonPath), target)));
14128
+ }
14129
+ /**
14130
+ * Finds `className`'s class inside a resolved JS entry (see `resolveModuleJsEntry`), following
14131
+ * re-export hops the same way `resolveAndProcessExtendedClass` walks a `.d.ts`/`.ts` source.
14132
+ * @param config the current Stencil validated config
14133
+ * @param compilerCtx the current compiler context
14134
+ * @param source the JS source file to search
14135
+ * @param className the class (or mixin factory) name to look for
14136
+ * @param hopsRemaining re-export hops still allowed before giving up
14137
+ * @returns the found class and the source file it's declared in, or `undefined`
14138
+ */
14139
+ function findClassInJsModule(config, compilerCtx, source, className, hopsRemaining = 3) {
14140
+ const matchedStatement = findStatementByName(source, className);
14141
+ if (matchedStatement) {
14142
+ const classNode = ts$1.isClassDeclaration(matchedStatement) ? matchedStatement : findClassWalk(matchedStatement);
14143
+ return classNode && {
14144
+ classNode,
14145
+ sourceFile: source
14146
+ };
14147
+ }
14148
+ if (hopsRemaining <= 0) return;
14149
+ const reExport = findReExport(source, className);
14150
+ if (!reExport) return;
14151
+ const resolvedFileName = tsResolveModuleName(config, compilerCtx, reExport.moduleSpecifier, source.fileName)?.resolvedModule?.resolvedFileName;
14152
+ const nextSource = resolvedFileName && readJsSourceFile(config, resolvedFileName);
14153
+ if (!nextSource) return;
14154
+ return findClassInJsModule(config, compilerCtx, nextSource, reExport.localName, hopsRemaining - 1);
14155
+ }
14156
+ /**
13978
14157
  * Filters `dedupeMembers` down to entries not already present in `staticMembers`
13979
14158
  * (by name, or `methodName` for change handlers) - used so an extending
13980
14159
  * class's own members win over inherited ones.
@@ -14080,9 +14259,11 @@ function convertDiskSourceFileDecorators(sourceFile, config, target = ts$1.Scrip
14080
14259
  * @param ogModule the original module file of the class declaration
14081
14260
  * @param targetScriptTarget the script target to convert decorators with, if needed
14082
14261
  * @param barrelHopsRemaining re-export hops still allowed before giving up
14262
+ * @param originalModuleSpecifier the specifier this lookup started from, before any barrel hops
14263
+ * @param originalContainingFile the file `originalModuleSpecifier` was imported from
14083
14264
  * @returns the found class declaration, or `undefined`
14084
14265
  */
14085
- function resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration, currentSource, moduleSpecifier, className, dependentClasses, typeChecker, ogModule, targetScriptTarget = ts$1.ScriptTarget.ESNext, barrelHopsRemaining = 1) {
14266
+ function resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration, currentSource, moduleSpecifier, className, dependentClasses, typeChecker, ogModule, targetScriptTarget = ts$1.ScriptTarget.ESNext, barrelHopsRemaining = 1, originalModuleSpecifier = moduleSpecifier, originalContainingFile = currentSource.fileName) {
14086
14267
  let keepLooking = true;
14087
14268
  const foundFile = tsResolveModuleName(buildCtx.config, compilerCtx, moduleSpecifier, currentSource.fileName);
14088
14269
  if (!foundFile?.resolvedModule || !className) return;
@@ -14098,10 +14279,10 @@ function resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration,
14098
14279
  }
14099
14280
  foundSource = convertDiskSourceFileDecorators(foundSource, buildCtx.config, targetScriptTarget);
14100
14281
  }
14101
- const matchedStatement = foundSource.statements.find(matchesNamedDeclaration(className));
14282
+ const matchedStatement = findStatementByName(foundSource, className);
14102
14283
  if (!matchedStatement) {
14103
14284
  const reExport = barrelHopsRemaining > 0 ? findReExport(foundSource, className) : void 0;
14104
- if (reExport) return resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration, foundSource, reExport.moduleSpecifier, reExport.localName, dependentClasses, typeChecker, ogModule, targetScriptTarget, barrelHopsRemaining - 1);
14285
+ if (reExport) return resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration, foundSource, reExport.moduleSpecifier, reExport.localName, dependentClasses, typeChecker, ogModule, targetScriptTarget, barrelHopsRemaining - 1, originalModuleSpecifier, originalContainingFile);
14105
14286
  const err = buildWarn(buildCtx.diagnostics);
14106
14287
  err.messageText = `Unable to find "${className}" in the imported module "${moduleSpecifier}".
14107
14288
  Please import class / mixin-factory declarations directly and not via barrel files.`;
@@ -14109,16 +14290,25 @@ function resolveAndProcessExtendedClass(compilerCtx, buildCtx, classDeclaration,
14109
14290
  return;
14110
14291
  }
14111
14292
  let foundClassDeclaration = matchedStatement ? ts$1.isClassDeclaration(matchedStatement) ? matchedStatement : void 0 : void 0;
14293
+ let foundClassSource = foundSource;
14112
14294
  if (!foundClassDeclaration && matchedStatement) {
14113
14295
  foundClassDeclaration = findClassWalk(matchedStatement);
14114
14296
  keepLooking = false;
14297
+ if (!foundClassDeclaration && isDtsFile(foundSource.fileName) && !isLocalModule(originalModuleSpecifier)) {
14298
+ const jsSource = resolveModuleJsEntry(buildCtx.config, compilerCtx, originalModuleSpecifier, originalContainingFile);
14299
+ const foundInJs = jsSource && findClassInJsModule(buildCtx.config, compilerCtx, jsSource, className);
14300
+ if (foundInJs) {
14301
+ foundClassDeclaration = foundInJs.classNode;
14302
+ foundClassSource = foundInJs.sourceFile;
14303
+ }
14304
+ }
14115
14305
  if (!foundClassDeclaration) warnMixinFactoryClassNotFound(buildCtx, className, classDeclaration);
14116
14306
  }
14117
14307
  if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
14118
14308
  dependentClasses.push({
14119
14309
  classNode: foundClassDeclaration,
14120
- sourceFile: foundSource,
14121
- fileName: foundFile.resolvedModule.resolvedFileName
14310
+ sourceFile: foundClassSource,
14311
+ fileName: foundClassSource.fileName
14122
14312
  });
14123
14313
  if (keepLooking) buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx, ogModule);
14124
14314
  }
@@ -14525,19 +14715,6 @@ function getExtendsClassNames(node) {
14525
14715
  if (ts$1.isCallExpression(expr) && expr.expression.getText() === "Mixin") return expr.arguments.filter(ts$1.isIdentifier).map((id) => id.text);
14526
14716
  return [];
14527
14717
  }
14528
- function findImportSpecifier(sf, localName) {
14529
- for (const stmt of sf.statements) {
14530
- if (!ts$1.isImportDeclaration(stmt) || !ts$1.isStringLiteral(stmt.moduleSpecifier)) continue;
14531
- const clause = stmt.importClause;
14532
- if (!clause) continue;
14533
- if (clause.name?.text === localName) return stmt.moduleSpecifier.text;
14534
- const bindings = clause.namedBindings;
14535
- if (bindings && ts$1.isNamedImports(bindings)) {
14536
- for (const el of bindings.elements) if (el.name.text === localName) return stmt.moduleSpecifier.text;
14537
- }
14538
- }
14539
- return null;
14540
- }
14541
14718
  /**
14542
14719
  * A single-file mini-program (see `convertInMemorySourceDecorators`) can
14543
14720
  * never load an imported module's own `SourceFile`, so a type that's
@@ -14561,7 +14738,7 @@ function reclassifyGlobalTypeReferences(members, declaringSf, declaringPath, res
14561
14738
  if (!references) return;
14562
14739
  Object.entries(references).forEach(([typeName, reference]) => {
14563
14740
  if (reference.location !== "global") return;
14564
- const specifier = findImportSpecifier(declaringSf, typeName);
14741
+ const specifier = findImportOrigin(declaringSf, typeName)?.moduleSpecifier;
14565
14742
  if (!specifier) return;
14566
14743
  const resolved = resolveImport(specifier, declaringPath);
14567
14744
  reference.location = "import";
@@ -14584,7 +14761,7 @@ function reclassifyGlobalTypeReferences(members, declaringSf, declaringPath, res
14584
14761
  * differ from `sf`/`path` if resolved through a re-export), or `undefined`
14585
14762
  */
14586
14763
  function findDeclarationOrReExport(sf, path, name, resolveImport) {
14587
- const direct = sf.statements.find(matchesNamedDeclaration(name));
14764
+ const direct = findStatementByName(sf, name);
14588
14765
  if (direct) return {
14589
14766
  statement: direct,
14590
14767
  sourceFile: sf,
@@ -14597,7 +14774,7 @@ function findDeclarationOrReExport(sf, path, name, resolveImport) {
14597
14774
  const { code, path: resolvedPath } = resolved;
14598
14775
  const isTs = resolvedPath.endsWith(".tsx") || resolvedPath.endsWith(".ts");
14599
14776
  const reExportSf = ts$1.createSourceFile(resolvedPath, code, ts$1.ScriptTarget.ESNext, true, isTs ? ts$1.ScriptKind.TSX : ts$1.ScriptKind.JS);
14600
- const statement = reExportSf.statements.find(matchesNamedDeclaration(reExport.localName));
14777
+ const statement = findStatementByName(reExportSf, reExport.localName);
14601
14778
  if (!statement) return void 0;
14602
14779
  return {
14603
14780
  statement,
@@ -14634,7 +14811,7 @@ function resolveAncestors(classNode, sf, path, resolveImport, visited, ancestors
14634
14811
  let foundSf = sf;
14635
14812
  let foundPath = path;
14636
14813
  let keepLooking = true;
14637
- const sameFileStatement = sf.statements.find(matchesNamedDeclaration(parentName));
14814
+ const sameFileStatement = findStatementByName(sf, parentName);
14638
14815
  if (sameFileStatement) {
14639
14816
  if (ts$1.isClassDeclaration(sameFileStatement)) foundClass = sameFileStatement;
14640
14817
  else {
@@ -14643,7 +14820,7 @@ function resolveAncestors(classNode, sf, path, resolveImport, visited, ancestors
14643
14820
  if (!foundClass) warnMixinFactoryClassNotFound(buildCtx, parentName, rootClassDeclaration);
14644
14821
  }
14645
14822
  } else {
14646
- const specifier = findImportSpecifier(sf, parentName);
14823
+ const specifier = findImportOrigin(sf, parentName)?.moduleSpecifier;
14647
14824
  if (!specifier) continue;
14648
14825
  const resolved = resolveImport(specifier, path);
14649
14826
  if (!resolved) continue;
@@ -1,4 +1,4 @@
1
- import { $ as CompilerSystemRemoveDirectoryResults, $n as JsonDocMethodParameter, $t as OutputTargetDocsReadme, A as CompilerDependency, An as StencilDevServerConfig, At as LogLevel, B as CompilerEventFsChange, Bn as WatcherCloseResults, Bt as OutputTarget, C as CacheStorage, Cn as SerializeDocumentOptions, Ct as HydrateFactoryOptions, D as Compiler, Dn as SsrDocumentOptions, Dt as LightDomPatches, E as CompileTarget, En as SitemapXmpResults, Et as LazyRequire, F as CompilerEventDirAdd, Fn as TranspileOptions, Ft as NodeResolveConfig, G as CompilerFsStats, Gt as OutputTargetCollection, H as CompilerFileWatcher, Hn as WorkerOptions, Ht as OutputTargetBase, I as CompilerEventDirDelete, In as TranspileResults, It as OptimizeCssInput, J as CompilerSystem, Jt as OutputTargetDistLazy, K as CompilerRequest, Kt as OutputTargetCopy, L as CompilerEventFileAdd, Ln as UnvalidatedConfig, Lt as OptimizeCssOutput, M as CompilerEventBuildLog, Mn as SystemDetails, Mt as LoggerLineUpdater, N as CompilerEventBuildNoChange, Nn as TransformOptions, Nt as LoggerTimeSpan, O as CompilerBuildResults, On as SsrFactoryOptions, Ot as LoadConfigInit, P as CompilerEventBuildStart, Pn as TranspileOnlyResults, Pt as ModeConfig, Q as CompilerSystemRemoveDirectoryOptions, Qt as OutputTargetDocsJson, R as CompilerEventFileDelete, Rn as ValidatedConfig, Rt as OptimizeJsInput, S as BuildResultsComponentGraph, Sn as RolldownConfig, St as HydrateDocumentOptions, T as CompileScriptMinifyOptions, Tn as SitemapXmpOpts, Tt as LOG_LEVELS, U as CompilerFileWatcherCallback, Ut as OutputTargetBaseNext, V as CompilerEventName, Vn as WorkerMainController, Vt as OutputTargetAssets, W as CompilerFileWatcherEvent, Wt as OutputTargetBuild, X as CompilerSystemCreateDirectoryResults, Xt as OutputTargetDocsCustom, Y as CompilerSystemCreateDirectoryOptions, Yt as OutputTargetDocsAgentSkill, Z as CompilerSystemRealpathResults, Zt as OutputTargetDocsCustomElementsManifest, _ as BuildNoChangeResults, _n as ResolveModuleIdOptions, _r as FsWriteResults, _t as DocsReadmeCustomColumn, an as OutputTargetStandalone, ar as JsonDocsListener, at as Config, b as BuildOutput, bn as RobotsTxtOpts, bt as HmrStyleUpdate, c as PrintLine, cn as OutputTargetWww, cr as JsonDocsPart, ct as CopyResults, d as SsrResults, dn as PlatformPath, dr as JsonDocsStyle, dt as CustomElementsExportBehavior, en as OutputTargetDocsVscode, er as JsonDocs, et as CompilerSystemRemoveFileResults, f as WorkerMsgHandler, fn as PrerenderConfig, fr as JsonDocsTag, ft as CustomElementsExportBehaviorOptions, g as BuildLog, gn as PrerenderStartOptions, gr as StyleDoc, gt as Diagnostic, h as BuildEvents, hn as PrerenderResults, hr as JsonDocsValue, ht as DevServerEditor, i as ComponentCompilerTypeReferences, in as OutputTargetSsrWasm, ir as JsonDocsEvent, it as CompilerWatcher, j as CompilerEventBuildFinish, jn as StencilDocsConfig, jt as Logger, k as CompilerBuildStart, kn as StencilConfig, kt as LoadConfigResults, ln as PageReloadStrategy, lr as JsonDocsProp, lt as CopyTask, m as BuildEmitEvents, mn as PrerenderOptions, mr as JsonDocsUsage, mt as DevServerConfig, n as CompilerWorkerContext, nn as OutputTargetLoaderBundle, nr as JsonDocsCustomState, nt as CompilerSystemRenamedPath, o as LazyBundlesRuntimeData, on as OutputTargetStats, or as JsonDocsMethod, ot as ConfigBundle, p as AutoprefixerOptions, pn as PrerenderHydrateOptions, pr as JsonDocsTypeLibrary, pt as DevServer, q as CompilerRequestResponse, qt as OutputTargetCustom, r as ComponentCompilerMeta, rn as OutputTargetSsr, rr as JsonDocsDependencyGraph, rt as CompilerSystemWriteFileResults, s as PackageJsonData, sn as OutputTargetTypes, sr as JsonDocsMethodReturn, st as ConfigCompat, tn as OutputTargetGlobalStyle, tr as JsonDocsComponent, tt as CompilerSystemRenameResults, un as ParsedPath, ur as JsonDocsSlot, ut as Credentials, v as BuildOnEventRemove, vn as ResolveModuleIdResults, vt as FsWatchResults, w as CliInitOptions, wn as ServiceWorkerConfig, wt as HydratedFlag, x as BuildOverrides, xn as RobotsTxtResults, xt as HotModuleReplacement, y as BuildOnEvents, yn as ResolveModuleOptions, yt as HistoryApiFallback, z as CompilerEventFileUpdate, zn as ValidatedOutputTargetWww, zt as OptimizeJsOutput } from "../index-BvF31nqP.mjs";
1
+ import { $ as CompilerSystemRemoveDirectoryResults, $n as JsonDocMethodParameter, $t as OutputTargetDocsReadme, A as CompilerDependency, An as StencilDevServerConfig, At as LogLevel, B as CompilerEventFsChange, Bn as WatcherCloseResults, Bt as OutputTarget, C as CacheStorage, Cn as SerializeDocumentOptions, Ct as HydrateFactoryOptions, D as Compiler, Dn as SsrDocumentOptions, Dt as LightDomPatches, E as CompileTarget, En as SitemapXmpResults, Et as LazyRequire, F as CompilerEventDirAdd, Fn as TranspileOptions, Ft as NodeResolveConfig, G as CompilerFsStats, Gt as OutputTargetCollection, H as CompilerFileWatcher, Hn as WorkerOptions, Ht as OutputTargetBase, I as CompilerEventDirDelete, In as TranspileResults, It as OptimizeCssInput, J as CompilerSystem, Jt as OutputTargetDistLazy, K as CompilerRequest, Kt as OutputTargetCopy, L as CompilerEventFileAdd, Ln as UnvalidatedConfig, Lt as OptimizeCssOutput, M as CompilerEventBuildLog, Mn as SystemDetails, Mt as LoggerLineUpdater, N as CompilerEventBuildNoChange, Nn as TransformOptions, Nt as LoggerTimeSpan, O as CompilerBuildResults, On as SsrFactoryOptions, Ot as LoadConfigInit, P as CompilerEventBuildStart, Pn as TranspileOnlyResults, Pt as ModeConfig, Q as CompilerSystemRemoveDirectoryOptions, Qt as OutputTargetDocsJson, R as CompilerEventFileDelete, Rn as ValidatedConfig, Rt as OptimizeJsInput, S as BuildResultsComponentGraph, Sn as RolldownConfig, St as HydrateDocumentOptions, T as CompileScriptMinifyOptions, Tn as SitemapXmpOpts, Tt as LOG_LEVELS, U as CompilerFileWatcherCallback, Ut as OutputTargetBaseNext, V as CompilerEventName, Vn as WorkerMainController, Vt as OutputTargetAssets, W as CompilerFileWatcherEvent, Wt as OutputTargetBuild, X as CompilerSystemCreateDirectoryResults, Xt as OutputTargetDocsCustom, Y as CompilerSystemCreateDirectoryOptions, Yt as OutputTargetDocsAgentSkill, Z as CompilerSystemRealpathResults, Zt as OutputTargetDocsCustomElementsManifest, _ as BuildNoChangeResults, _n as ResolveModuleIdOptions, _r as FsWriteResults, _t as DocsReadmeCustomColumn, an as OutputTargetStandalone, ar as JsonDocsListener, at as Config, b as BuildOutput, bn as RobotsTxtOpts, bt as HmrStyleUpdate, c as PrintLine, cn as OutputTargetWww, cr as JsonDocsPart, ct as CopyResults, d as SsrResults, dn as PlatformPath, dr as JsonDocsStyle, dt as CustomElementsExportBehavior, en as OutputTargetDocsVscode, er as JsonDocs, et as CompilerSystemRemoveFileResults, f as WorkerMsgHandler, fn as PrerenderConfig, fr as JsonDocsTag, ft as CustomElementsExportBehaviorOptions, g as BuildLog, gn as PrerenderStartOptions, gr as StyleDoc, gt as Diagnostic, h as BuildEvents, hn as PrerenderResults, hr as JsonDocsValue, ht as DevServerEditor, i as ComponentCompilerTypeReferences, in as OutputTargetSsrWasm, ir as JsonDocsEvent, it as CompilerWatcher, j as CompilerEventBuildFinish, jn as StencilDocsConfig, jt as Logger, k as CompilerBuildStart, kn as StencilConfig, kt as LoadConfigResults, ln as PageReloadStrategy, lr as JsonDocsProp, lt as CopyTask, m as BuildEmitEvents, mn as PrerenderOptions, mr as JsonDocsUsage, mt as DevServerConfig, n as CompilerWorkerContext, nn as OutputTargetLoaderBundle, nr as JsonDocsCustomState, nt as CompilerSystemRenamedPath, o as LazyBundlesRuntimeData, on as OutputTargetStats, or as JsonDocsMethod, ot as ConfigBundle, p as AutoprefixerOptions, pn as PrerenderHydrateOptions, pr as JsonDocsTypeLibrary, pt as DevServer, q as CompilerRequestResponse, qt as OutputTargetCustom, r as ComponentCompilerMeta, rn as OutputTargetSsr, rr as JsonDocsDependencyGraph, rt as CompilerSystemWriteFileResults, s as PackageJsonData, sn as OutputTargetTypes, sr as JsonDocsMethodReturn, st as ConfigCompat, tn as OutputTargetGlobalStyle, tr as JsonDocsComponent, tt as CompilerSystemRenameResults, un as ParsedPath, ur as JsonDocsSlot, ut as Credentials, v as BuildOnEventRemove, vn as ResolveModuleIdResults, vt as FsWatchResults, w as CliInitOptions, wn as ServiceWorkerConfig, wt as HydratedFlag, x as BuildOverrides, xn as RobotsTxtResults, xt as HotModuleReplacement, y as BuildOnEvents, yn as ResolveModuleOptions, yt as HistoryApiFallback, z as CompilerEventFileUpdate, zn as ValidatedOutputTargetWww, zt as OptimizeJsOutput } from "../index-Cw1NW9FW.mjs";
2
2
  import ts from "typescript";
3
3
  //#region src/version.d.ts
4
4
  declare const version: string;
@@ -1,3 +1,3 @@
1
- import { _ as buildId, a as createPrerenderer, b as versions, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as getScopeId, h as cmpMetaToDocsComponent, i as createSystem, l as createWorkerMessageHandler, m as generateManifest, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as vermoji, x as scopeCss, y as version } from "../compiler-PoywOlbq.mjs";
2
- import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-BKtLn2R9.mjs";
1
+ import { _ as buildId, a as createPrerenderer, b as versions, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as getScopeId, h as cmpMetaToDocsComponent, i as createSystem, l as createWorkerMessageHandler, m as generateManifest, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as vermoji, x as scopeCss, y as version } from "../compiler-BjKDj129.mjs";
2
+ import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-HKfDhPR3.mjs";
3
3
  export { CustomElementsExportBehaviorOptions, LOG_LEVELS, buildId, cmpMetaToDocsComponent, createCompiler, createPrerenderer, createSystem, createWorkerContext, createWorkerMessageHandler, generateManifest, getScopeId, loadConfig, nodeRequire, optimizeCss, optimizeJs, scopeCss, transpile, transpileSync, ts, validateConfig, vermoji, version, versions };
@@ -1,4 +1,4 @@
1
- import { $i as HOST_FLAGS, $r as isOutputTargetDocsCustom, Ai as isRolldownError, Ar as isTsFile, Bi as COPY, Br as FilterComponentsResult, Ci as escapeHtml, Cr as createJsVarName, Di as loadTypeScriptDiagnostic, Dr as isDtsFile, Ei as augmentDiagnosticWithNode, Er as hasDependency, Fi as ASSETS, Fr as getInlineSourceMappingUrlLinker, Gi as DOCS_CUSTOM, Gr as getComponentsFromModules, Hi as DEFAULT_STYLE_MODE, Hr as filterExcludedComponents, Ii as CMP_FLAGS, Ir as getSourceMappingUrlForEndOfFile, Ji as DOCS_README, Jr as isOutputTargetCopy, Ki as DOCS_CUSTOM_ELEMENTS_MANIFEST, Kr as isOutputTargetAssets, Li as COLLECTION, Lr as getSourceMappingUrlLinker, Mi as formatComponentRuntimeMeta, Mr as parsePackageJson, Ni as formatLazyBundleRuntimeMeta, Nr as readOnlyArrayHasStringMember, Oi as loadTypeScriptDiagnostics, Or as isJsFile, Pi as stringifyRuntimeData, Pr as readPackageJson, Qi as GLOBAL_STYLE, Qr as isOutputTargetDocsAgentSkill, Ri as COLLECTION_APP_DATA_FILE_NAME, Rr as rolldownToStencilSourceMap, Si as shouldIgnoreError, Sr as addDocBlock, Ti as splitLineBreaks, Tr as getTextDocs, Ui as DIST_LAZY, Ur as getComponentsDtsSrcFilePath, Vi as CUSTOM, Vr as filterActiveTargets, Wi as DOCS_AGENT_SKILL, Wr as getComponentsDtsTypesFilePath, Xi as EVENT_FLAGS, Xr as isOutputTargetDistLazy, Yi as DOCS_VSCODE, Yr as isOutputTargetCustom, Zi as GENERATED_DTS, Zr as isOutputTargetDocs, _i as buildJsonFileError, aa as SSR, ai as isOutputTargetLoaderBundle, bi as hasError, br as validateComponentTag, ca as STATS, ci as isOutputTargetStandalone, da as TYPES, di as isOutputTargetWww, ea as HTML_NS, ei as isOutputTargetDocsCustomElementsManifest, fa as VALID_CONFIG_OUTPUT_TARGETS, fi as isValidConfigOutputTarget, gi as buildError, ha as XLINK_NS, hi as TASK_CANCELED_MSG, ia as NODE_TYPES, ii as isOutputTargetGlobalStyle, ji as loadRolldownDiagnostics, jr as isTsxFile, ki as createOnWarnFn, kr as isJsxFile, la as STYLE_EXT, li as isOutputTargetStats, ma as WWW, mi as shouldExcludeComponent, na as LOADER_BUNDLE, ni as isOutputTargetDocsReadme, oa as SSR_WASM, oi as isOutputTargetSsr, pa as WATCH_FLAGS, pi as relativeImport, qi as DOCS_JSON, qr as isOutputTargetCollection, ra as MEMBER_FLAGS, ri as isOutputTargetDocsVscode, sa as STANDALONE, si as isOutputTargetSsrWasm, ta as LISTENER_FLAGS, ti as isOutputTargetDocsJson, ua as SVG_NS, ui as isOutputTargetTypes, vi as buildWarn, vr as ModeValidationError, wi as normalizeDiagnostics, wr as generatePreamble, xi as hasWarning, xr as ParsePackageJsonResult, yi as catchError, yr as validateComponentModes, zi as COLLECTION_MANIFEST_FILE_NAME, zr as result_d_exports } from "../../index-BvF31nqP.mjs";
1
+ import { $i as HOST_FLAGS, $r as isOutputTargetDocsCustom, Ai as isRolldownError, Ar as isTsFile, Bi as COPY, Br as FilterComponentsResult, Ci as escapeHtml, Cr as createJsVarName, Di as loadTypeScriptDiagnostic, Dr as isDtsFile, Ei as augmentDiagnosticWithNode, Er as hasDependency, Fi as ASSETS, Fr as getInlineSourceMappingUrlLinker, Gi as DOCS_CUSTOM, Gr as getComponentsFromModules, Hi as DEFAULT_STYLE_MODE, Hr as filterExcludedComponents, Ii as CMP_FLAGS, Ir as getSourceMappingUrlForEndOfFile, Ji as DOCS_README, Jr as isOutputTargetCopy, Ki as DOCS_CUSTOM_ELEMENTS_MANIFEST, Kr as isOutputTargetAssets, Li as COLLECTION, Lr as getSourceMappingUrlLinker, Mi as formatComponentRuntimeMeta, Mr as parsePackageJson, Ni as formatLazyBundleRuntimeMeta, Nr as readOnlyArrayHasStringMember, Oi as loadTypeScriptDiagnostics, Or as isJsFile, Pi as stringifyRuntimeData, Pr as readPackageJson, Qi as GLOBAL_STYLE, Qr as isOutputTargetDocsAgentSkill, Ri as COLLECTION_APP_DATA_FILE_NAME, Rr as rolldownToStencilSourceMap, Si as shouldIgnoreError, Sr as addDocBlock, Ti as splitLineBreaks, Tr as getTextDocs, Ui as DIST_LAZY, Ur as getComponentsDtsSrcFilePath, Vi as CUSTOM, Vr as filterActiveTargets, Wi as DOCS_AGENT_SKILL, Wr as getComponentsDtsTypesFilePath, Xi as EVENT_FLAGS, Xr as isOutputTargetDistLazy, Yi as DOCS_VSCODE, Yr as isOutputTargetCustom, Zi as GENERATED_DTS, Zr as isOutputTargetDocs, _i as buildJsonFileError, aa as SSR, ai as isOutputTargetLoaderBundle, bi as hasError, br as validateComponentTag, ca as STATS, ci as isOutputTargetStandalone, da as TYPES, di as isOutputTargetWww, ea as HTML_NS, ei as isOutputTargetDocsCustomElementsManifest, fa as VALID_CONFIG_OUTPUT_TARGETS, fi as isValidConfigOutputTarget, gi as buildError, ha as XLINK_NS, hi as TASK_CANCELED_MSG, ia as NODE_TYPES, ii as isOutputTargetGlobalStyle, ji as loadRolldownDiagnostics, jr as isTsxFile, ki as createOnWarnFn, kr as isJsxFile, la as STYLE_EXT, li as isOutputTargetStats, ma as WWW, mi as shouldExcludeComponent, na as LOADER_BUNDLE, ni as isOutputTargetDocsReadme, oa as SSR_WASM, oi as isOutputTargetSsr, pa as WATCH_FLAGS, pi as relativeImport, qi as DOCS_JSON, qr as isOutputTargetCollection, ra as MEMBER_FLAGS, ri as isOutputTargetDocsVscode, sa as STANDALONE, si as isOutputTargetSsrWasm, ta as LISTENER_FLAGS, ti as isOutputTargetDocsJson, ua as SVG_NS, ui as isOutputTargetTypes, vi as buildWarn, vr as ModeValidationError, wi as normalizeDiagnostics, wr as generatePreamble, xi as hasWarning, xr as ParsePackageJsonResult, yi as catchError, yr as validateComponentModes, zi as COLLECTION_MANIFEST_FILE_NAME, zr as result_d_exports } from "../../index-Cw1NW9FW.mjs";
2
2
  //#region src/utils/byte-size.d.ts
3
3
  /**
4
4
  * Used to learn the size of a string in bytes.