@bamboocss/extractor 1.49.0 → 1.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _bamboocss_shared = require("@bamboocss/shared");
3
- let ts_morph = require("ts-morph");
3
+ let _bamboocss_ts_ast = require("@bamboocss/ts-ast");
4
4
  let ts_evaluator = require("ts-evaluator");
5
5
  //#region src/get-typeof-literal.ts
6
6
  const getTypeOfLiteral = (value) => {
@@ -25,15 +25,15 @@ const isPrimitiveType = (value) => {
25
25
  return type === "string" || type === "number" || type === "boolean" || value === null || value === void 0;
26
26
  };
27
27
  const unwrapExpression = (node) => {
28
- if (ts_morph.Node.isAsExpression(node)) return unwrapExpression(node.getExpression());
29
- if (ts_morph.Node.isParenthesizedExpression(node)) return unwrapExpression(node.getExpression());
30
- if (ts_morph.Node.isNonNullExpression(node)) return unwrapExpression(node.getExpression());
31
- if (ts_morph.Node.isTypeAssertion(node)) return unwrapExpression(node.getExpression());
32
- if (ts_morph.Node.isSatisfiesExpression(node)) return unwrapExpression(node.getExpression());
28
+ if (_bamboocss_ts_ast.Node.isAsExpression(node)) return unwrapExpression(node.expression);
29
+ if (_bamboocss_ts_ast.Node.isParenthesizedExpression(node)) return unwrapExpression(node.expression);
30
+ if (_bamboocss_ts_ast.Node.isNonNullExpression(node)) return unwrapExpression(node.expression);
31
+ if (_bamboocss_ts_ast.Node.isTypeAssertion(node)) return unwrapExpression(node.expression);
32
+ if (_bamboocss_ts_ast.Node.isSatisfiesExpression(node)) return unwrapExpression(node.expression);
33
33
  return node;
34
34
  };
35
35
  const getComponentName = (node) => {
36
- return node.getTagNameNode().getText();
36
+ return node.tagName.getText();
37
37
  };
38
38
  const whitespaceRegex = /\s+/g;
39
39
  const trimWhitespace = (str) => {
@@ -44,8 +44,8 @@ const trimWhitespace = (str) => {
44
44
  const getNodeRange = (node) => {
45
45
  const src = node.getSourceFile();
46
46
  const [startPosition, endPosition] = [node.getStart(), node.getEnd()];
47
- const startInfo = src.getLineAndColumnAtPos(startPosition);
48
- const endInfo = src.getLineAndColumnAtPos(endPosition);
47
+ const startInfo = (0, _bamboocss_ts_ast.getLineAndColumnAtPos)(src, startPosition);
48
+ const endInfo = (0, _bamboocss_ts_ast.getLineAndColumnAtPos)(src, endPosition);
49
49
  return {
50
50
  startPosition,
51
51
  startLineNumber: startInfo.line,
@@ -78,7 +78,7 @@ var BoxNodeType = class {
78
78
  return {
79
79
  type: this.type,
80
80
  value: this.value,
81
- node: this.node.getKindName(),
81
+ node: (0, _bamboocss_ts_ast.kindNameOf)(this.node.kind),
82
82
  line: range.startLineNumber,
83
83
  column: range.startColumn,
84
84
  endLineNumber: range.endLineNumber,
@@ -446,15 +446,15 @@ const clearImportedValueCache = () => {
446
446
  */
447
447
  const importBindingsFor = (sourceFile) => {
448
448
  const bindings = /* @__PURE__ */ new Map();
449
- for (const declaration of sourceFile.getImportDeclarations()) {
450
- for (const specifier of declaration.getNamedImports()) {
451
- const local = (specifier.getAliasNode() ?? specifier.getNameNode()).getText();
452
- bindings.set(local, {
449
+ for (const declaration of (0, _bamboocss_ts_ast.getImportDeclarations)(sourceFile)) {
450
+ for (const specifier of (0, _bamboocss_ts_ast.getNamedImports)(declaration)) {
451
+ const local = ((0, _bamboocss_ts_ast.getAliasNode)(specifier) ?? (0, _bamboocss_ts_ast.nameNodeOf)(specifier))?.getText();
452
+ bindings.set(local ?? "", {
453
453
  declaration,
454
- exportedName: specifier.getNameNode().getText()
454
+ exportedName: (0, _bamboocss_ts_ast.nameNodeOf)(specifier)?.getText() ?? ""
455
455
  });
456
456
  }
457
- const defaultImport = declaration.getDefaultImport();
457
+ const defaultImport = (0, _bamboocss_ts_ast.getDefaultImport)(declaration);
458
458
  if (defaultImport) bindings.set(defaultImport.getText(), {
459
459
  declaration,
460
460
  exportedName: "default"
@@ -466,7 +466,7 @@ const importBindingsFor = (sourceFile) => {
466
466
  const valueForBinding = (binding, ctx, stack, depth, evaluateExpression) => {
467
467
  const sourceFile = getModuleSpecifierSourceFile(binding.declaration, ctx);
468
468
  if (!sourceFile) return;
469
- if (sourceFile.isInNodeModules()) return;
469
+ if ((0, _bamboocss_ts_ast.isInNodeModules)(sourceFile)) return;
470
470
  const declaration = getExportedVarDeclarationWithName(binding.exportedName, sourceFile, stack, ctx);
471
471
  if (!declaration) return;
472
472
  const cached = evaluatedValues.get(declaration);
@@ -474,7 +474,7 @@ const valueForBinding = (binding, ctx, stack, depth, evaluateExpression) => {
474
474
  const replayed = replayDependencyCache(cached, ctx);
475
475
  if (replayed.hit) return { value: replayed.value };
476
476
  }
477
- const initializer = declaration.getInitializer();
477
+ const initializer = declaration.initializer;
478
478
  if (!initializer) return;
479
479
  const capture = beginDependencyCapture(ctx);
480
480
  let value;
@@ -500,8 +500,8 @@ const importedEnvironmentFor = (node, ctx, stack, depth, evaluateExpression) =>
500
500
  if (depth >= MAX_DEPTH) return;
501
501
  const bindings = importBindingsFor(node.getSourceFile());
502
502
  if (!bindings.size) return;
503
- const references = node.getDescendantsOfKind(ts_morph.SyntaxKind.Identifier);
504
- if (ts_morph.Node.isIdentifier(node)) references.unshift(node);
503
+ const references = (0, _bamboocss_ts_ast.getDescendantsOfKind)(node, _bamboocss_ts_ast.SyntaxKind.Identifier);
504
+ if (_bamboocss_ts_ast.Node.isIdentifier(node)) references.unshift(node);
505
505
  if (!references.length) return;
506
506
  let environment;
507
507
  for (const reference of references) {
@@ -572,8 +572,8 @@ const evaluateNodeUncached = (node, stack, ctx, depth, dependencyEntry) => {
572
572
  let options = {
573
573
  policy: { ...POLICY },
574
574
  ...ctx.getEvaluateOptions?.(node, stack),
575
- node: node.compilerNode,
576
- typescript: ts_morph.ts
575
+ node,
576
+ typescript: _bamboocss_ts_ast.ts
577
577
  };
578
578
  let imported = depth > 0 ? importedEnvironmentFor(node, ctx, stack, depth, safeEvaluateNode) : void 0;
579
579
  if (imported) {
@@ -630,22 +630,22 @@ const safeEvaluateNode = (node, stack, ctx, depth = 0) => {
630
630
  //#endregion
631
631
  //#region src/find-identifier-value-declaration.ts
632
632
  function isScope(node) {
633
- return ts_morph.Node.isFunctionDeclaration(node) || ts_morph.Node.isFunctionExpression(node) || ts_morph.Node.isArrowFunction(node) || ts_morph.Node.isSourceFile(node);
633
+ return _bamboocss_ts_ast.Node.isFunctionDeclaration(node) || _bamboocss_ts_ast.Node.isFunctionExpression(node) || _bamboocss_ts_ast.Node.isArrowFunction(node) || _bamboocss_ts_ast.Node.isSourceFile(node);
634
634
  }
635
635
  function getDeclarationFor(node, stack, ctx) {
636
- const parent = node.getParent();
636
+ const parent = node.parent;
637
637
  if (!parent) return;
638
638
  const declarationStack = [];
639
639
  let declaration;
640
- if ((ts_morph.Node.isVariableDeclaration(parent) || ts_morph.Node.isParameterDeclaration(parent) || ts_morph.Node.isFunctionDeclaration(parent) || ts_morph.Node.isEnumDeclaration(parent) || ts_morph.Node.isBindingElement(parent)) && parent.getNameNode() == node) {
640
+ if ((_bamboocss_ts_ast.Node.isVariableDeclaration(parent) || _bamboocss_ts_ast.Node.isParameterDeclaration(parent) || _bamboocss_ts_ast.Node.isFunctionDeclaration(parent) || _bamboocss_ts_ast.Node.isEnumDeclaration(parent) || _bamboocss_ts_ast.Node.isBindingElement(parent)) && parent.name == node) {
641
641
  declarationStack.push(parent);
642
642
  declaration = parent;
643
- } else if (ts_morph.Node.isImportSpecifier(parent) && (parent.getNameNode() == node || parent.getAliasNode() == node)) {
643
+ } else if (_bamboocss_ts_ast.Node.isImportSpecifier(parent) && ((0, _bamboocss_ts_ast.nameNodeOf)(parent) == node || (0, _bamboocss_ts_ast.getAliasNode)(parent) == node)) {
644
644
  if (ctx.flags?.skipTraverseFiles) return;
645
- const sourceFile = getModuleSpecifierSourceFile(parent.getImportDeclaration(), ctx);
645
+ const sourceFile = getModuleSpecifierSourceFile(parent.parent?.parent?.parent, ctx);
646
646
  if (sourceFile) {
647
647
  const exportStack = [parent, sourceFile];
648
- const maybeVar = getExportedVarDeclarationWithName(parent.getNameNode().getText(), sourceFile, exportStack, ctx);
648
+ const maybeVar = getExportedVarDeclarationWithName((0, _bamboocss_ts_ast.nameNodeOf)(parent)?.getText() ?? "", sourceFile, exportStack, ctx);
649
649
  if (maybeVar) {
650
650
  declarationStack.push(...exportStack.concat(maybeVar));
651
651
  declaration = maybeVar;
@@ -656,8 +656,8 @@ function getDeclarationFor(node, stack, ctx) {
656
656
  return declaration;
657
657
  }
658
658
  const getInnermostScope = (from) => {
659
- let scope = from.getParent();
660
- while (scope && !isScope(scope)) scope = scope.getParent();
659
+ let scope = from.parent;
660
+ while (scope && !isScope(scope)) scope = scope.parent;
661
661
  return scope;
662
662
  };
663
663
  /**
@@ -671,8 +671,8 @@ const getInnermostScope = (from) => {
671
671
  */
672
672
  const declarationIndexes = /* @__PURE__ */ new WeakMap();
673
673
  const isDeclarationName = (node, parent) => {
674
- if (ts_morph.Node.isVariableDeclaration(parent) || ts_morph.Node.isParameterDeclaration(parent) || ts_morph.Node.isFunctionDeclaration(parent) || ts_morph.Node.isEnumDeclaration(parent) || ts_morph.Node.isBindingElement(parent)) return parent.getNameNode() == node;
675
- return ts_morph.Node.isImportSpecifier(parent) && (parent.getNameNode() == node || parent.getAliasNode() == node);
674
+ if (_bamboocss_ts_ast.Node.isVariableDeclaration(parent) || _bamboocss_ts_ast.Node.isParameterDeclaration(parent) || _bamboocss_ts_ast.Node.isFunctionDeclaration(parent) || _bamboocss_ts_ast.Node.isEnumDeclaration(parent) || _bamboocss_ts_ast.Node.isBindingElement(parent)) return parent.name == node;
675
+ return _bamboocss_ts_ast.Node.isImportSpecifier(parent) && ((0, _bamboocss_ts_ast.nameNodeOf)(parent) == node || (0, _bamboocss_ts_ast.getAliasNode)(parent) == node);
676
676
  };
677
677
  /**
678
678
  * Walk a scope once, so that every later lookup inside it is a map read.
@@ -683,19 +683,19 @@ const isDeclarationName = (node, parent) => {
683
683
  * ts-morph charges for wrapping each node — it measured ~10% of extraction on its own.
684
684
  */
685
685
  const declarationIndexFor = (scope) => {
686
- const cached = declarationIndexes.get(scope.compilerNode);
686
+ const cached = declarationIndexes.get(scope);
687
687
  if (cached) return cached;
688
688
  const index = /* @__PURE__ */ new Map();
689
- scope.forEachDescendant((node) => {
690
- if (!ts_morph.Node.isIdentifier(node)) return;
691
- const parent = node.getParent();
689
+ (0, _bamboocss_ts_ast.forEachDescendant)(scope, (node) => {
690
+ if (!_bamboocss_ts_ast.Node.isIdentifier(node)) return;
691
+ const parent = node.parent;
692
692
  if (!parent || !isDeclarationName(node, parent)) return;
693
693
  const name = node.getText();
694
694
  const declared = index.get(name);
695
695
  if (declared) declared.push(node);
696
696
  else index.set(name, [node]);
697
697
  });
698
- declarationIndexes.set(scope.compilerNode, index);
698
+ declarationIndexes.set(scope, index);
699
699
  return index;
700
700
  };
701
701
  function findIdentifierValueDeclaration(identifier, stack, ctx, visitedsWithStack = /* @__PURE__ */ new Map()) {
@@ -714,11 +714,11 @@ function findIdentifierValueDeclaration(identifier, stack, ctx, visitedsWithStac
714
714
  const declarationStack = [candidate];
715
715
  const maybeDeclaration = getDeclarationFor(candidate, declarationStack, ctx);
716
716
  if (!maybeDeclaration) continue;
717
- if (ts_morph.Node.isParameterDeclaration(maybeDeclaration)) {
718
- const initializer = maybeDeclaration.getInitializer();
719
- const typeNode = maybeDeclaration.getTypeNode();
717
+ if (_bamboocss_ts_ast.Node.isParameterDeclaration(maybeDeclaration)) {
718
+ const initializer = maybeDeclaration.initializer;
719
+ const typeNode = maybeDeclaration.type;
720
720
  if (initializer) innerStack.push(...declarationStack.concat(initializer));
721
- else if (typeNode && ts_morph.Node.isTypeLiteral(typeNode)) innerStack.push(...declarationStack.concat(typeNode));
721
+ else if (typeNode && _bamboocss_ts_ast.Node.isTypeLiteralNode(typeNode)) innerStack.push(...declarationStack.concat(typeNode));
722
722
  else return;
723
723
  stack.push(...innerStack);
724
724
  return maybeDeclaration;
@@ -727,41 +727,41 @@ function findIdentifierValueDeclaration(identifier, stack, ctx, visitedsWithStac
727
727
  stack.push(...innerStack);
728
728
  return maybeDeclaration;
729
729
  }
730
- } while (scope && !ts_morph.Node.isSourceFile(scope) && count < 100);
730
+ } while (scope && !_bamboocss_ts_ast.Node.isSourceFile(scope) && count < 100);
731
731
  }
732
732
  //#endregion
733
733
  //#region src/get-property-name.ts
734
734
  const getPropertyName = (property, stack, ctx) => {
735
735
  if (!property) return;
736
- if (ts_morph.Node.isPropertyAssignment(property)) {
737
- const node = unwrapExpression(property.getNameNode());
738
- if (ts_morph.Node.isIdentifier(node)) return box.from(node.getText(), node, stack);
739
- if (ts_morph.Node.isComputedPropertyName(node)) {
740
- const expression = node.getExpression();
736
+ if (_bamboocss_ts_ast.Node.isPropertyAssignment(property)) {
737
+ const node = unwrapExpression(property.name);
738
+ if (_bamboocss_ts_ast.Node.isIdentifier(node)) return box.from(node.getText(), node, stack);
739
+ if (_bamboocss_ts_ast.Node.isComputedPropertyName(node)) {
740
+ const expression = node.expression;
741
741
  stack.push(expression);
742
742
  return maybePropName(expression, stack, ctx);
743
743
  }
744
- if (ts_morph.Node.isStringLiteral(node) || ts_morph.Node.isNumericLiteral(node)) return box.from(node.getLiteralText(), node, stack);
744
+ if (_bamboocss_ts_ast.Node.isStringLiteral(node) || _bamboocss_ts_ast.Node.isNumericLiteral(node)) return box.from((0, _bamboocss_ts_ast.getLiteralText)(node), node, stack);
745
745
  }
746
- if (ts_morph.Node.isShorthandPropertyAssignment(property)) {
747
- const name = property.getName();
746
+ if (_bamboocss_ts_ast.Node.isShorthandPropertyAssignment(property)) {
747
+ const name = (0, _bamboocss_ts_ast.getName)(property);
748
748
  if (name != null) return box.from(name, property, stack);
749
749
  }
750
- if (ts_morph.Node.isGetAccessorDeclaration(property)) {
751
- const node = unwrapExpression(property.getNameNode());
752
- if (ts_morph.Node.isIdentifier(node)) return box.from(node.getText(), node, stack);
753
- if (ts_morph.Node.isComputedPropertyName(node)) {
754
- const expression = node.getExpression();
750
+ if (_bamboocss_ts_ast.Node.isGetAccessorDeclaration(property)) {
751
+ const node = unwrapExpression(property.name);
752
+ if (_bamboocss_ts_ast.Node.isIdentifier(node)) return box.from(node.getText(), node, stack);
753
+ if (_bamboocss_ts_ast.Node.isComputedPropertyName(node)) {
754
+ const expression = node.expression;
755
755
  stack.push(expression);
756
756
  return maybePropName(expression, stack, ctx);
757
757
  }
758
- if (ts_morph.Node.isStringLiteral(node) || ts_morph.Node.isNumericLiteral(node)) return box.from(node.getLiteralText(), node, stack);
758
+ if (_bamboocss_ts_ast.Node.isStringLiteral(node) || _bamboocss_ts_ast.Node.isNumericLiteral(node)) return box.from((0, _bamboocss_ts_ast.getLiteralText)(node), node, stack);
759
759
  }
760
760
  };
761
761
  //#endregion
762
762
  //#region src/get-object-literal-expression-prop-pairs.ts
763
763
  const getObjectLiteralExpressionPropPairs = (expression, expressionStack, ctx, matchProp) => {
764
- const properties = expression.getProperties();
764
+ const properties = expression.properties;
765
765
  if (properties.length === 0) return box.emptyObject(expression, expressionStack);
766
766
  const extractedPropValues = [];
767
767
  const spreadConditions = [];
@@ -770,7 +770,7 @@ const getObjectLiteralExpressionPropPairs = (expression, expressionStack, ctx, m
770
770
  properties.forEach((property) => {
771
771
  const stack = [...expressionStack];
772
772
  stack.push(property);
773
- if (ts_morph.Node.isPropertyAssignment(property) || ts_morph.Node.isShorthandPropertyAssignment(property) || ts_morph.Node.isGetAccessorDeclaration(property)) {
773
+ if (_bamboocss_ts_ast.Node.isPropertyAssignment(property) || _bamboocss_ts_ast.Node.isShorthandPropertyAssignment(property) || _bamboocss_ts_ast.Node.isGetAccessorDeclaration(property)) {
774
774
  const propNameBox = getPropertyName(property, stack, ctx);
775
775
  if (!propNameBox) return;
776
776
  const propName = propNameBox.value;
@@ -779,8 +779,8 @@ const getObjectLiteralExpressionPropPairs = (expression, expressionStack, ctx, m
779
779
  propName,
780
780
  propNode: property
781
781
  })) return;
782
- if (ts_morph.Node.isShorthandPropertyAssignment(property)) {
783
- const initializer = property.getNameNode();
782
+ if (_bamboocss_ts_ast.Node.isShorthandPropertyAssignment(property)) {
783
+ const initializer = property.name;
784
784
  stack.push(initializer);
785
785
  const maybeValue = maybeBoxNode(initializer, stack, ctx);
786
786
  if (maybeValue) {
@@ -789,12 +789,12 @@ const getObjectLiteralExpressionPropPairs = (expression, expressionStack, ctx, m
789
789
  }
790
790
  }
791
791
  let init;
792
- if (ts_morph.Node.isGetAccessorDeclaration(property)) {
793
- const body = property.getBody();
794
- init = ts_morph.Node.isBlock(body) ? body.getStatements().at(-1) : void 0;
795
- } else init = property.getInitializer();
792
+ if (_bamboocss_ts_ast.Node.isGetAccessorDeclaration(property)) {
793
+ const body = property.body;
794
+ init = body !== void 0 && _bamboocss_ts_ast.Node.isBlock(body) ? body.statements.at(-1) : void 0;
795
+ } else init = (0, _bamboocss_ts_ast.childOf)(property, "initializer");
796
796
  if (!init) return;
797
- const initializer = unwrapExpression((ts_morph.Node.isReturnStatement(init) ? init.getExpression() : void 0) ?? init);
797
+ const initializer = unwrapExpression((_bamboocss_ts_ast.Node.isReturnStatement(init) ? init.expression : void 0) ?? init);
798
798
  stack.push(initializer);
799
799
  const maybeValue = maybeBoxNode(initializer, stack, ctx);
800
800
  if (maybeValue) {
@@ -802,8 +802,8 @@ const getObjectLiteralExpressionPropPairs = (expression, expressionStack, ctx, m
802
802
  return;
803
803
  }
804
804
  }
805
- if (ts_morph.Node.isSpreadAssignment(property)) {
806
- const initializer = unwrapExpression(property.getExpression());
805
+ if (_bamboocss_ts_ast.Node.isSpreadAssignment(property)) {
806
+ const initializer = unwrapExpression(property.expression);
807
807
  stack.push(initializer);
808
808
  const maybeObject = maybeBoxNode(initializer, stack, ctx, matchProp);
809
809
  if (!maybeObject) return;
@@ -858,11 +858,11 @@ const clearBoxNodeCache = () => {
858
858
  hasCachedEntries = false;
859
859
  };
860
860
  let hasCachedEntries = false;
861
- const isPlusSyntax = (op) => op === ts_morph.ts.SyntaxKind.PlusToken;
862
- const isLogicalSyntax = (op) => op === ts_morph.ts.SyntaxKind.BarBarToken || op === ts_morph.ts.SyntaxKind.QuestionQuestionToken || op === ts_morph.ts.SyntaxKind.AmpersandAmpersandToken || op === ts_morph.ts.SyntaxKind.EqualsEqualsEqualsToken || op === ts_morph.ts.SyntaxKind.EqualsEqualsToken || op === ts_morph.ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts_morph.ts.SyntaxKind.ExclamationEqualsToken || op === ts_morph.ts.SyntaxKind.GreaterThanEqualsToken || op === ts_morph.ts.SyntaxKind.GreaterThanToken || op === ts_morph.ts.SyntaxKind.LessThanEqualsToken || op === ts_morph.ts.SyntaxKind.LessThanToken || op === ts_morph.ts.SyntaxKind.InstanceOfKeyword || op === ts_morph.ts.SyntaxKind.InKeyword;
863
- const isOperationSyntax = (op) => op === ts_morph.ts.SyntaxKind.AsteriskToken || op === ts_morph.ts.SyntaxKind.SlashToken || op === ts_morph.ts.SyntaxKind.PercentToken || op === ts_morph.ts.SyntaxKind.AsteriskAsteriskToken || op === ts_morph.ts.SyntaxKind.MinusToken;
861
+ const isPlusSyntax = (op) => op === _bamboocss_ts_ast.ts.SyntaxKind.PlusToken;
862
+ const isLogicalSyntax = (op) => op === _bamboocss_ts_ast.ts.SyntaxKind.BarBarToken || op === _bamboocss_ts_ast.ts.SyntaxKind.QuestionQuestionToken || op === _bamboocss_ts_ast.ts.SyntaxKind.AmpersandAmpersandToken || op === _bamboocss_ts_ast.ts.SyntaxKind.EqualsEqualsEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.EqualsEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.ExclamationEqualsEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.ExclamationEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.GreaterThanEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.GreaterThanToken || op === _bamboocss_ts_ast.ts.SyntaxKind.LessThanEqualsToken || op === _bamboocss_ts_ast.ts.SyntaxKind.LessThanToken || op === _bamboocss_ts_ast.ts.SyntaxKind.InstanceOfKeyword || op === _bamboocss_ts_ast.ts.SyntaxKind.InKeyword;
863
+ const isOperationSyntax = (op) => op === _bamboocss_ts_ast.ts.SyntaxKind.AsteriskToken || op === _bamboocss_ts_ast.ts.SyntaxKind.SlashToken || op === _bamboocss_ts_ast.ts.SyntaxKind.PercentToken || op === _bamboocss_ts_ast.ts.SyntaxKind.AsteriskAsteriskToken || op === _bamboocss_ts_ast.ts.SyntaxKind.MinusToken;
864
864
  const canReturnWhenTrueInLogicalExpression = (op) => {
865
- return op === ts_morph.ts.SyntaxKind.BarBarToken || op === ts_morph.ts.SyntaxKind.QuestionQuestionToken;
865
+ return op === _bamboocss_ts_ast.ts.SyntaxKind.BarBarToken || op === _bamboocss_ts_ast.ts.SyntaxKind.QuestionQuestionToken;
866
866
  };
867
867
  function maybeBoxNode(node, stack, ctx, matchProp) {
868
868
  const cached = getCached(node);
@@ -883,76 +883,76 @@ function maybeBoxNodeUncached(node, stack, ctx, matchProp, dependencyEntry) {
883
883
  hasCachedEntries = true;
884
884
  return value;
885
885
  };
886
- if (ts_morph.Node.isStringLiteral(node) || ts_morph.Node.isNoSubstitutionTemplateLiteral(node)) {
887
- const value = trimWhitespace(node.getLiteralValue());
886
+ if (_bamboocss_ts_ast.Node.isStringLiteral(node) || _bamboocss_ts_ast.Node.isNoSubstitutionTemplateLiteral(node)) {
887
+ const value = trimWhitespace((0, _bamboocss_ts_ast.stringLiteralValue)(node));
888
888
  return cache(box.literal(value, node, stack));
889
889
  }
890
- if (ts_morph.Node.isObjectLiteralExpression(node)) return cache(getObjectLiteralExpressionPropPairs(node, stack, ctx, matchProp));
891
- if (ts_morph.Node.isTrueLiteral(node) || ts_morph.Node.isFalseLiteral(node)) {
892
- const value = node.getLiteralValue();
890
+ if (_bamboocss_ts_ast.Node.isObjectLiteralExpression(node)) return cache(getObjectLiteralExpressionPropPairs(node, stack, ctx, matchProp));
891
+ if (_bamboocss_ts_ast.Node.isTrueLiteral(node) || _bamboocss_ts_ast.Node.isFalseLiteral(node)) {
892
+ const value = (0, _bamboocss_ts_ast.literalValueOf)(node);
893
893
  return cache(box.literal(value, node, stack));
894
894
  }
895
- if (ts_morph.Node.isNumericLiteral(node)) {
896
- const value = node.getLiteralValue();
895
+ if (_bamboocss_ts_ast.Node.isNumericLiteral(node)) {
896
+ const value = (0, _bamboocss_ts_ast.literalValueOf)(node);
897
897
  return cache(box.literal(value, node, stack));
898
898
  }
899
- if (ts_morph.Node.isNullLiteral(node)) return cache(box.literal(null, node, stack));
900
- if (ts_morph.Node.isPrefixUnaryExpression(node)) {
901
- const operand = node.getOperand();
902
- const operator = node.getOperatorToken();
899
+ if (_bamboocss_ts_ast.Node.isNullLiteral(node)) return cache(box.literal(null, node, stack));
900
+ if (_bamboocss_ts_ast.Node.isPrefixUnaryExpression(node)) {
901
+ const operand = node.operand;
902
+ const operator = node.operator;
903
903
  const boxNode = maybeBoxNode(operand, stack, ctx);
904
904
  if (!box.isNumberLiteral(boxNode)) return;
905
- return cache(operator === ts_morph.ts.SyntaxKind.MinusToken ? box.literal(-Number(boxNode.value), node, stack) : boxNode);
905
+ return cache(operator === _bamboocss_ts_ast.ts.SyntaxKind.MinusToken ? box.literal(-Number(boxNode.value), node, stack) : boxNode);
906
906
  }
907
- if (ts_morph.Node.isArrayLiteralExpression(node)) {
908
- const boxNodes = node.getElements().map((element) => {
907
+ if (_bamboocss_ts_ast.Node.isArrayLiteralExpression(node)) {
908
+ const boxNodes = node.elements.map((element) => {
909
909
  return maybeBoxNode(element, stack, ctx) ?? cache(box.unresolvable(element, stack));
910
910
  });
911
911
  return cache(box.array(boxNodes, node, stack));
912
912
  }
913
- if (ts_morph.Node.isIdentifier(node)) {
913
+ if (_bamboocss_ts_ast.Node.isIdentifier(node)) {
914
914
  if (node.getText() === "undefined") return cache(box.literal(void 0, node, stack));
915
915
  return cache(maybeIdentifierValue(node, stack, ctx));
916
916
  }
917
- if (ts_morph.Node.isTemplateHead(node)) return cache(box.literal(node.getLiteralText(), node, stack));
918
- if (ts_morph.Node.isTemplateExpression(node)) {
917
+ if (_bamboocss_ts_ast.Node.isTemplateHead(node)) return cache(box.literal((0, _bamboocss_ts_ast.getLiteralText)(node), node, stack));
918
+ if (_bamboocss_ts_ast.Node.isTemplateExpression(node)) {
919
919
  const value = maybeTemplateStringValue(node, stack, ctx);
920
920
  return cache(box.literal(value, node, stack));
921
921
  }
922
- if (ts_morph.Node.isTaggedTemplateExpression(node)) return cache(maybeBoxNode(node.getTemplate(), stack, ctx));
923
- if (ts_morph.Node.isElementAccessExpression(node)) return cache(getElementAccessedExpressionValue(node, stack, ctx));
924
- if (ts_morph.Node.isPropertyAccessExpression(node)) return cache(getPropertyAccessedExpressionValue(node, [], stack, ctx));
925
- if (ts_morph.Node.isConditionalExpression(node)) {
922
+ if (_bamboocss_ts_ast.Node.isTaggedTemplateExpression(node)) return cache(maybeBoxNode(node.template, stack, ctx));
923
+ if (_bamboocss_ts_ast.Node.isElementAccessExpression(node)) return cache(getElementAccessedExpressionValue(node, stack, ctx));
924
+ if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(node)) return cache(getPropertyAccessedExpressionValue(node, [], stack, ctx));
925
+ if (_bamboocss_ts_ast.Node.isConditionalExpression(node)) {
926
926
  if (ctx.flags?.skipConditions) return cache(box.unresolvable(node, stack));
927
- const condExpr = unwrapExpression(node.getCondition());
928
- const condBoxNode = (ts_morph.Node.isIdentifier(condExpr) ? maybeBoxNode(condExpr, [], ctx) : safeEvaluateNode(condExpr, stack, ctx)) ?? box.unresolvable(condExpr, stack);
927
+ const condExpr = unwrapExpression(node.condition);
928
+ const condBoxNode = (_bamboocss_ts_ast.Node.isIdentifier(condExpr) ? maybeBoxNode(condExpr, [], ctx) : safeEvaluateNode(condExpr, stack, ctx)) ?? box.unresolvable(condExpr, stack);
929
929
  const condValue = isBoxNode(condBoxNode) ? condBoxNode : box.from(condBoxNode, node, stack);
930
930
  if (box.isEmptyInitializer(condValue)) return;
931
- const isFromDefaultBinding = condValue.getStack().some((node) => ts_morph.Node.isBindingElement(node));
931
+ const isFromDefaultBinding = condValue.getStack().some((node) => _bamboocss_ts_ast.Node.isBindingElement(node));
932
932
  if (box.isUnresolvable(condValue) || box.isConditional(condValue) || isFromDefaultBinding) return cache(maybeResolveConditionalExpression({
933
- whenTrueExpr: unwrapExpression(node.getWhenTrue()),
934
- whenFalseExpr: unwrapExpression(node.getWhenFalse()),
933
+ whenTrueExpr: unwrapExpression(node.whenTrue),
934
+ whenFalseExpr: unwrapExpression(node.whenFalse),
935
935
  node,
936
936
  stack
937
937
  }, ctx));
938
938
  if (condValue.value) {
939
- const whenTrueExpr = unwrapExpression(node.getWhenTrue());
939
+ const whenTrueExpr = unwrapExpression(node.whenTrue);
940
940
  return cache(maybeBoxNode(whenTrueExpr, [...stack], ctx) ?? box.unresolvable(whenTrueExpr, stack));
941
941
  }
942
- return cache(maybeBoxNode(unwrapExpression(node.getWhenFalse()), [...stack], ctx) ?? box.unresolvable(node, stack));
942
+ return cache(maybeBoxNode(unwrapExpression(node.whenFalse), [...stack], ctx) ?? box.unresolvable(node, stack));
943
943
  }
944
- if (ts_morph.Node.isCallExpression(node)) {
944
+ if (_bamboocss_ts_ast.Node.isCallExpression(node)) {
945
945
  if (ctx.tokens) {
946
- const expr = node.getExpression();
946
+ const expr = node.expression;
947
947
  let fnName = "";
948
948
  let isValueMethod = false;
949
- if (ts_morph.Node.isIdentifier(expr)) fnName = expr.getText();
950
- else if (ts_morph.Node.isPropertyAccessExpression(expr)) if (expr.getName() === "value") {
949
+ if (_bamboocss_ts_ast.Node.isIdentifier(expr)) fnName = expr.getText();
950
+ else if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(expr)) if ((0, _bamboocss_ts_ast.getName)(expr) === "value") {
951
951
  isValueMethod = true;
952
- fnName = expr.getExpression().getText();
952
+ fnName = expr.expression.getText();
953
953
  } else fnName = expr.getText();
954
954
  if (ctx.tokens.isTokenFn ? ctx.tokens.isTokenFn(fnName) : fnName === "token") {
955
- const tokenPathArg = node.getArguments()[0];
955
+ const tokenPathArg = node.arguments[0];
956
956
  const tokenPath = tokenPathArg ? literalStringOf(tokenPathArg, stack, ctx) : void 0;
957
957
  if (tokenPath !== void 0) {
958
958
  const resolvedValue = isValueMethod ? ctx.tokens.view.get(tokenPath) : ctx.tokens.view.getVar(tokenPath);
@@ -964,8 +964,8 @@ function maybeBoxNodeUncached(node, stack, ctx, matchProp, dependencyEntry) {
964
964
  if (!value) return;
965
965
  return cache(box.from(value, node, stack));
966
966
  }
967
- if (ts_morph.Node.isBinaryExpression(node)) {
968
- const operatorKind = node.getOperatorToken().getKind();
967
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(node)) {
968
+ const operatorKind = node.operatorToken.kind;
969
969
  if (isPlusSyntax(operatorKind)) {
970
970
  const value = tryComputingPlusTokenBinaryExpressionToString(node, stack, ctx) ?? safeEvaluateNode(node, stack, ctx);
971
971
  if (!value) return;
@@ -973,8 +973,8 @@ function maybeBoxNodeUncached(node, stack, ctx, matchProp, dependencyEntry) {
973
973
  return cache(box.from(value, node, stack));
974
974
  }
975
975
  if (isLogicalSyntax(operatorKind)) return cache(maybeResolveConditionalExpression({
976
- whenTrueExpr: unwrapExpression(node.getLeft()),
977
- whenFalseExpr: unwrapExpression(node.getRight()),
976
+ whenTrueExpr: unwrapExpression(node.left),
977
+ whenFalseExpr: unwrapExpression(node.right),
978
978
  node,
979
979
  stack,
980
980
  canReturnWhenTrue: canReturnWhenTrueInLogicalExpression(operatorKind)
@@ -991,7 +991,7 @@ function maybeBoxNodeUncached(node, stack, ctx, matchProp, dependencyEntry) {
991
991
  * Returning `undefined` leaves the call unresolved, exactly as before.
992
992
  */
993
993
  function literalStringOf(node, stack, ctx) {
994
- if (ts_morph.Node.isStringLiteral(node)) return node.getLiteralValue();
994
+ if (_bamboocss_ts_ast.Node.isStringLiteral(node)) return (0, _bamboocss_ts_ast.stringLiteralValue)(node);
995
995
  const resolved = onlyStringLiteral(maybeBoxNode(node, stack, ctx));
996
996
  return resolved && typeof resolved.value === "string" ? resolved.value : void 0;
997
997
  }
@@ -1015,7 +1015,7 @@ const maybeResolveConditionalExpression = ({ whenTrueExpr, whenFalseExpr, node,
1015
1015
  const whenTrueValue = maybeBoxNode(whenTrueExpr, stack, ctx);
1016
1016
  const whenFalseValue = maybeBoxNode(whenFalseExpr, stack, ctx);
1017
1017
  if (canReturnWhenTrue && whenTrueValue && !box.isUnresolvable(whenTrueValue)) return whenTrueValue;
1018
- if (ts_morph.Node.isBinaryExpression(node) && node.getOperatorToken().getKind() === ts_morph.ts.SyntaxKind.AmpersandAmpersandToken && whenTrueValue && whenFalseValue && box.isLiteral(whenTrueValue) && whenTrueValue.value === true) return whenFalseValue;
1018
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(node) && node.operatorToken.kind === _bamboocss_ts_ast.ts.SyntaxKind.AmpersandAmpersandToken && whenTrueValue && whenFalseValue && box.isLiteral(whenTrueValue) && whenTrueValue.value === true) return whenFalseValue;
1019
1019
  if (!whenTrueValue && !whenFalseValue) return;
1020
1020
  if (whenTrueValue && !whenFalseValue) return whenTrueValue;
1021
1021
  if (!whenTrueValue && whenFalseValue) return whenFalseValue;
@@ -1026,18 +1026,18 @@ const maybeResolveConditionalExpression = ({ whenTrueExpr, whenFalseExpr, node,
1026
1026
  };
1027
1027
  const findProperty = (node, propName, _stack, ctx) => {
1028
1028
  const stack = [..._stack];
1029
- if (ts_morph.Node.isPropertyAssignment(node)) {
1030
- const name = node.getNameNode();
1031
- if (ts_morph.Node.isIdentifier(name) && name.getText() === propName) {
1029
+ if (_bamboocss_ts_ast.Node.isPropertyAssignment(node)) {
1030
+ const name = node.name;
1031
+ if (_bamboocss_ts_ast.Node.isIdentifier(name) && name.getText() === propName) {
1032
1032
  stack.push(name);
1033
1033
  return node;
1034
1034
  }
1035
- if (ts_morph.Node.isStringLiteral(name) && name.getLiteralText() === propName) {
1035
+ if (_bamboocss_ts_ast.Node.isStringLiteral(name) && (0, _bamboocss_ts_ast.getLiteralText)(name) === propName) {
1036
1036
  stack.push(name);
1037
- return name.getLiteralText();
1037
+ return (0, _bamboocss_ts_ast.getLiteralText)(name);
1038
1038
  }
1039
- if (ts_morph.Node.isComputedPropertyName(name)) {
1040
- const expression = unwrapExpression(name.getExpression());
1039
+ if (_bamboocss_ts_ast.Node.isComputedPropertyName(name)) {
1040
+ const expression = unwrapExpression(name.expression);
1041
1041
  const computedPropNameBox = maybePropName(expression, stack, ctx);
1042
1042
  if (!computedPropNameBox) return;
1043
1043
  if (String(computedPropNameBox.value) === propName) {
@@ -1046,9 +1046,9 @@ const findProperty = (node, propName, _stack, ctx) => {
1046
1046
  }
1047
1047
  }
1048
1048
  }
1049
- if (ts_morph.Node.isShorthandPropertyAssignment(node)) {
1050
- const name = node.getNameNode();
1051
- if (ts_morph.Node.isIdentifier(name) && name.getText() === propName) {
1049
+ if (_bamboocss_ts_ast.Node.isShorthandPropertyAssignment(node)) {
1050
+ const name = node.name;
1051
+ if (_bamboocss_ts_ast.Node.isIdentifier(name) && name.getText() === propName) {
1052
1052
  stack.push(name);
1053
1053
  return node;
1054
1054
  }
@@ -1057,53 +1057,54 @@ const findProperty = (node, propName, _stack, ctx) => {
1057
1057
  const getObjectLiteralPropValue = (initializer, accessList, _stack, ctx) => {
1058
1058
  const stack = [..._stack];
1059
1059
  const propName = accessList.pop();
1060
- const property = initializer.getProperty(propName) ?? initializer.getProperties().find((p) => findProperty(p, propName, stack, ctx));
1060
+ const property = (0, _bamboocss_ts_ast.getProperty)(initializer, propName) ?? initializer.properties.find((p) => findProperty(p, propName, stack, ctx));
1061
1061
  if (!property) return;
1062
1062
  stack.push(property);
1063
- if (ts_morph.Node.isPropertyAssignment(property)) {
1064
- const propInit = property.getInitializer();
1063
+ if (_bamboocss_ts_ast.Node.isPropertyAssignment(property)) {
1064
+ const propInit = property.initializer;
1065
1065
  if (!propInit) return;
1066
- if (ts_morph.Node.isObjectLiteralExpression(propInit)) {
1066
+ if (_bamboocss_ts_ast.Node.isObjectLiteralExpression(propInit)) {
1067
1067
  if (accessList.length > 0) return getObjectLiteralPropValue(propInit, accessList, stack, ctx);
1068
1068
  return maybeBoxNode(propInit, stack, ctx);
1069
1069
  }
1070
1070
  const maybePropValue = maybeBoxNode(propInit, stack, ctx);
1071
1071
  if (maybePropValue) return maybePropValue;
1072
1072
  }
1073
- if (ts_morph.Node.isShorthandPropertyAssignment(property)) {
1074
- const identifier = property.getNameNode();
1073
+ if (_bamboocss_ts_ast.Node.isShorthandPropertyAssignment(property)) {
1074
+ const identifier = property.name;
1075
1075
  if (accessList.length > 0) return maybePropIdentifierValue(identifier, accessList, stack, ctx);
1076
1076
  const maybePropValue = maybeBoxNode(identifier, stack, ctx);
1077
1077
  if (maybePropValue) return maybePropValue;
1078
1078
  }
1079
1079
  };
1080
1080
  const maybeTemplateStringValue = (template, stack, ctx) => {
1081
- const head = template.getHead();
1082
- const tail = template.getTemplateSpans();
1081
+ const head = template.head;
1082
+ const tail = template.templateSpans;
1083
1083
  const headValue = maybeStringLiteral(head, stack, ctx);
1084
1084
  if (!headValue) return;
1085
1085
  const tailValues = tail.map((t) => {
1086
- const propBox = maybePropName(t.getExpression(), stack, ctx);
1086
+ const expression = t.expression;
1087
+ const propBox = maybePropName(expression, stack, ctx);
1087
1088
  if (!propBox) return;
1088
- const literal = t.getLiteral();
1089
- return propBox.value + literal.getLiteralText();
1089
+ const literal = t.literal;
1090
+ return propBox.value + (0, _bamboocss_ts_ast.getLiteralText)(literal);
1090
1091
  });
1091
1092
  if (tailValues.every(isNotNullish)) return headValue.value + tailValues.join("");
1092
1093
  };
1093
1094
  const maybeBindingElementValue = (def, stack, propName, ctx) => {
1094
- const parent = def.getParent();
1095
+ const parent = def.parent;
1095
1096
  if (!parent) return;
1096
- const grandParent = parent.getParent();
1097
+ const grandParent = parent.parent;
1097
1098
  if (!grandParent) return;
1098
- if (ts_morph.Node.isArrayBindingPattern(parent)) {
1099
- const index = parent.getChildIndex();
1099
+ if (_bamboocss_ts_ast.Node.isArrayBindingPattern(parent)) {
1100
+ const index = (0, _bamboocss_ts_ast.getChildIndex)(parent);
1100
1101
  if (Number.isNaN(index)) return;
1101
- if (ts_morph.Node.isVariableDeclaration(grandParent)) {
1102
- const init = grandParent.getInitializer();
1102
+ if (_bamboocss_ts_ast.Node.isVariableDeclaration(grandParent)) {
1103
+ const init = grandParent.initializer;
1103
1104
  if (!init) return;
1104
1105
  const initializer = unwrapExpression(init);
1105
- if (!ts_morph.Node.isArrayLiteralExpression(initializer)) return;
1106
- const element = initializer.getElements()[index + 1];
1106
+ if (!_bamboocss_ts_ast.Node.isArrayLiteralExpression(initializer)) return;
1107
+ const element = initializer.elements[index + 1];
1107
1108
  if (!element) return;
1108
1109
  const innerStack = [
1109
1110
  ...stack,
@@ -1122,27 +1123,27 @@ const maybeBindingElementValue = (def, stack, propName, ctx) => {
1122
1123
  return propValue;
1123
1124
  }
1124
1125
  }
1125
- if (ts_morph.Node.isObjectBindingPattern(parent)) {}
1126
+ if (_bamboocss_ts_ast.Node.isObjectBindingPattern(parent)) {}
1126
1127
  };
1127
1128
  function maybePropDefinitionValue(def, accessList, _stack, ctx) {
1128
1129
  const propName = accessList.at(-1);
1129
- if (ts_morph.Node.isVariableDeclaration(def)) {
1130
- const init = def.getInitializer();
1130
+ if (_bamboocss_ts_ast.Node.isVariableDeclaration(def)) {
1131
+ const init = def.initializer;
1131
1132
  if (!init) {
1132
- const type = def.getTypeNode();
1133
+ const type = def.type;
1133
1134
  if (!type) return;
1134
- if (ts_morph.Node.isTypeLiteral(type)) {
1135
+ if (_bamboocss_ts_ast.Node.isTypeLiteralNode(type)) {
1135
1136
  if (accessList.length > 0) {
1136
1137
  const stack = [..._stack];
1137
1138
  stack.push(type);
1138
1139
  let propName = accessList.pop();
1139
- let typeProp = type.getProperty(propName);
1140
- let typeLiteral = typeProp?.getTypeNode();
1141
- while (typeProp && accessList.length > 0 && typeLiteral && ts_morph.Node.isTypeLiteral(typeLiteral)) {
1140
+ let typeProp = (0, _bamboocss_ts_ast.getProperty)(type, propName);
1141
+ let typeLiteral = typeProp && (0, _bamboocss_ts_ast.childOf)(typeProp, "type");
1142
+ while (typeProp && accessList.length > 0 && typeLiteral && _bamboocss_ts_ast.Node.isTypeLiteralNode(typeLiteral)) {
1142
1143
  stack.push(typeProp, typeLiteral);
1143
1144
  propName = accessList.pop();
1144
- typeProp = typeLiteral.getProperty(propName);
1145
- typeLiteral = typeProp?.getTypeNode();
1145
+ typeProp = (0, _bamboocss_ts_ast.getProperty)(typeLiteral, propName);
1146
+ typeLiteral = typeProp && (0, _bamboocss_ts_ast.childOf)(typeProp, "type");
1146
1147
  }
1147
1148
  if (!typeLiteral) return;
1148
1149
  const typeValue = getTypeNodeValue(typeLiteral, stack, ctx);
@@ -1155,16 +1156,16 @@ function maybePropDefinitionValue(def, accessList, _stack, ctx) {
1155
1156
  return;
1156
1157
  }
1157
1158
  const initializer = unwrapExpression(init);
1158
- if (ts_morph.Node.isObjectLiteralExpression(initializer)) {
1159
+ if (_bamboocss_ts_ast.Node.isObjectLiteralExpression(initializer)) {
1159
1160
  const propValue = getObjectLiteralPropValue(initializer, accessList, _stack, ctx);
1160
1161
  if (!propValue) return;
1161
1162
  _stack.push(initializer);
1162
1163
  return propValue;
1163
1164
  }
1164
- if (ts_morph.Node.isArrayLiteralExpression(initializer)) {
1165
+ if (_bamboocss_ts_ast.Node.isArrayLiteralExpression(initializer)) {
1165
1166
  const index = Number(propName);
1166
1167
  if (Number.isNaN(index)) return;
1167
- const element = initializer.getElements()[index];
1168
+ const element = initializer.elements[index];
1168
1169
  if (!element) return;
1169
1170
  _stack.push(initializer);
1170
1171
  const boxed = maybeBoxNode(element, _stack, ctx);
@@ -1173,14 +1174,14 @@ function maybePropDefinitionValue(def, accessList, _stack, ctx) {
1173
1174
  const maybeValue = maybeBoxNode(initializer, [..._stack, initializer], ctx);
1174
1175
  if (maybeValue) return maybeValue;
1175
1176
  }
1176
- if (ts_morph.Node.isBindingElement(def)) {
1177
+ if (_bamboocss_ts_ast.Node.isBindingElement(def)) {
1177
1178
  const value = maybeBindingElementValue(def, _stack, propName, ctx);
1178
1179
  if (value) return value;
1179
1180
  }
1180
- if (ts_morph.Node.isEnumDeclaration(def)) {
1181
- const member = def.getMember(propName);
1181
+ if (_bamboocss_ts_ast.Node.isEnumDeclaration(def)) {
1182
+ const member = (0, _bamboocss_ts_ast.getMember)(def, propName);
1182
1183
  if (!member) return;
1183
- const initializer = member.getInitializer();
1184
+ const initializer = (0, _bamboocss_ts_ast.childOf)(member, "initializer");
1184
1185
  if (!initializer) return;
1185
1186
  const maybeValue = maybeBoxNode(initializer, [..._stack, initializer], ctx);
1186
1187
  if (maybeValue) return maybeValue;
@@ -1200,9 +1201,9 @@ const getTypeLiteralNodePropValue = (type, propName, stack, ctx) => {
1200
1201
  if (map === null) return;
1201
1202
  if (map?.has(propName)) return map.get(propName);
1202
1203
  }
1203
- const prop = type.getMembers().find((member) => ts_morph.Node.isPropertySignature(member) && member.getName() === propName);
1204
- if (ts_morph.Node.isPropertySignature(prop) && prop.isReadonly()) {
1205
- const propType = prop.getTypeNode();
1204
+ const prop = type.members.find((member) => _bamboocss_ts_ast.Node.isPropertySignatureDeclaration(member) && (0, _bamboocss_ts_ast.getName)(member) === propName);
1205
+ if (prop !== void 0 && _bamboocss_ts_ast.Node.isPropertySignatureDeclaration(prop) && (0, _bamboocss_ts_ast.isReadonly)(prop)) {
1206
+ const propType = prop.type;
1206
1207
  if (!propType) {
1207
1208
  typeLiteralCache.set(type, null);
1208
1209
  return;
@@ -1217,29 +1218,28 @@ const getTypeLiteralNodePropValue = (type, propName, stack, ctx) => {
1217
1218
  typeLiteralCache.set(type, null);
1218
1219
  };
1219
1220
  function getNameLiteral(wrapper) {
1220
- if (ts_morph.Node.isStringLiteral(wrapper)) return wrapper.getLiteralText();
1221
+ if (_bamboocss_ts_ast.Node.isStringLiteral(wrapper)) return (0, _bamboocss_ts_ast.getLiteralText)(wrapper);
1221
1222
  return wrapper.getText();
1222
1223
  }
1223
1224
  const typeNodeCache = /* @__PURE__ */ new WeakMap();
1224
1225
  const getTypeNodeValue = (type, stack, ctx) => {
1225
1226
  if (typeNodeCache.has(type)) return typeNodeCache.get(type);
1226
- if (ts_morph.Node.isLiteralTypeNode(type)) {
1227
- const literal = type.getLiteral();
1228
- if (ts_morph.Node.isStringLiteral(literal)) {
1229
- const result = literal.getLiteralText();
1227
+ if (_bamboocss_ts_ast.Node.isLiteralTypeNode(type)) {
1228
+ const literal = type.literal;
1229
+ if (_bamboocss_ts_ast.Node.isStringLiteral(literal)) {
1230
+ const result = (0, _bamboocss_ts_ast.getLiteralText)(literal);
1230
1231
  typeNodeCache.set(type, result);
1231
1232
  return result;
1232
1233
  }
1233
1234
  }
1234
- if (ts_morph.Node.isTypeLiteral(type)) {
1235
- const members = type.getMembers();
1236
- if (!members.some((member) => !ts_morph.Node.isPropertySignature(member) || !member.isReadonly())) {
1235
+ if (_bamboocss_ts_ast.Node.isTypeLiteralNode(type)) {
1236
+ const members = type.members;
1237
+ if (!members.some((member) => !_bamboocss_ts_ast.Node.isPropertySignatureDeclaration(member) || !(0, _bamboocss_ts_ast.isReadonly)(member))) {
1237
1238
  const entries = members.map((member) => {
1238
- const nameNode = member.getNameNode();
1239
- const nameText = nameNode.getText();
1239
+ const nameNode = member.name;
1240
1240
  const name = getNameLiteral(nameNode);
1241
1241
  if (!name) return;
1242
- return [name, getTypeLiteralNodePropValue(type, nameText, stack, ctx)];
1242
+ return [name, getTypeLiteralNodePropValue(type, name, stack, ctx)];
1243
1243
  }).filter(isNotNullish);
1244
1244
  const result = Object.fromEntries(entries);
1245
1245
  typeNodeCache.set(type, result);
@@ -1249,16 +1249,16 @@ const getTypeNodeValue = (type, stack, ctx) => {
1249
1249
  typeNodeCache.set(type, void 0);
1250
1250
  };
1251
1251
  const maybeDefinitionValue = (def, stack, ctx) => {
1252
- if (ts_morph.Node.isShorthandPropertyAssignment(def)) {
1253
- const propNameNode = def.getNameNode();
1252
+ if (_bamboocss_ts_ast.Node.isShorthandPropertyAssignment(def)) {
1253
+ const propNameNode = def.name;
1254
1254
  return maybePropIdentifierValue(propNameNode, [propNameNode.getText()], stack, ctx);
1255
1255
  }
1256
- if (ts_morph.Node.isVariableDeclaration(def)) {
1257
- const init = def.getInitializer();
1256
+ if (_bamboocss_ts_ast.Node.isVariableDeclaration(def)) {
1257
+ const init = def.initializer;
1258
1258
  if (!init) {
1259
- const type = def.getTypeNode();
1259
+ const type = def.type;
1260
1260
  if (!type) return;
1261
- if (ts_morph.Node.isTypeLiteral(type)) {
1261
+ if (_bamboocss_ts_ast.Node.isTypeLiteralNode(type)) {
1262
1262
  stack.push(type);
1263
1263
  const maybeTypeValue = getTypeNodeValue(type, stack, ctx);
1264
1264
  if (isNotNullish(maybeTypeValue)) return box.from(maybeTypeValue, def, stack);
@@ -1269,12 +1269,12 @@ const maybeDefinitionValue = (def, stack, ctx) => {
1269
1269
  const maybeValue = maybeBoxNode(initializer, [...stack, initializer], ctx);
1270
1270
  if (maybeValue) return maybeValue;
1271
1271
  }
1272
- if (ts_morph.Node.isBindingElement(def)) {
1273
- const init = def.getInitializer();
1272
+ if (_bamboocss_ts_ast.Node.isBindingElement(def)) {
1273
+ const init = def.initializer;
1274
1274
  if (!init) {
1275
- const nameNode = def.getPropertyNameNode() ?? def.getNameNode();
1276
- const propName = nameNode.getText();
1277
- const value = maybeBindingElementValue(def, [...stack, nameNode], propName, ctx);
1275
+ const nameNode = def.propertyName ?? def.name;
1276
+ const propName = nameNode?.getText() ?? "";
1277
+ const value = maybeBindingElementValue(def, [...stack, nameNode].filter(Boolean), propName, ctx);
1278
1278
  if (value) return value;
1279
1279
  return box.unresolvable(def, stack);
1280
1280
  }
@@ -1284,11 +1284,11 @@ const maybeDefinitionValue = (def, stack, ctx) => {
1284
1284
  }
1285
1285
  };
1286
1286
  const getExportedVarDeclarationWithName = (varName, sourceFile, stack, ctx, visited = /* @__PURE__ */ new Set()) => {
1287
- ctx.recordExportRead?.(sourceFile.getFilePath(), varName);
1288
- const key = `${sourceFile.getFilePath()}:${varName}`;
1287
+ ctx.recordExportRead?.((0, _bamboocss_ts_ast.pathOf)(sourceFile), varName);
1288
+ const key = `${(0, _bamboocss_ts_ast.pathOf)(sourceFile)}:${varName}`;
1289
1289
  if (visited.has(key)) return;
1290
1290
  visited.add(key);
1291
- const maybeVar = sourceFile.getVariableDeclaration(varName);
1291
+ const maybeVar = (0, _bamboocss_ts_ast.getVariableDeclaration)(sourceFile, varName);
1292
1292
  if (maybeVar) return maybeVar;
1293
1293
  const exportDeclaration = resolveVarDeclarationFromExportWithName(varName, sourceFile, stack, ctx, visited);
1294
1294
  if (!exportDeclaration) return;
@@ -1304,9 +1304,9 @@ const getExportedVarDeclarationWithName = (varName, sourceFile, stack, ctx, visi
1304
1304
  * module does export and resolves names it does not.
1305
1305
  */
1306
1306
  const resolveExportedName = (name, exportDeclaration) => {
1307
- const namedExports = exportDeclaration.getNamedExports();
1307
+ const namedExports = (0, _bamboocss_ts_ast.getNamedExports)(exportDeclaration);
1308
1308
  if (namedExports.length === 0) return name;
1309
- for (const namedExport of namedExports) if ((namedExport.getAliasNode() ?? namedExport.getNameNode()).getText() === name) return namedExport.getNameNode().getText();
1309
+ for (const namedExport of namedExports) if ((((0, _bamboocss_ts_ast.getAliasNode)(namedExport) ?? (0, _bamboocss_ts_ast.nameNodeOf)(namedExport))?.getText() ?? "") === name) return (0, _bamboocss_ts_ast.nameNodeOf)(namedExport)?.getText();
1310
1310
  };
1311
1311
  /**
1312
1312
  * Faster than declaration.getModuleSpecifierSourceFile()
@@ -1318,20 +1318,20 @@ const resolveExportedName = (name, exportDeclaration) => {
1318
1318
  * @see https://github.com/dsherret/ts-morph/blob/42d811ed9a5177fc678a5bfec4923a2048124fe0/packages/ts-morph/src/compiler/ast/module/ExportDeclaration.ts#L160
1319
1319
  */
1320
1320
  const getModuleSpecifierSourceFile = (declaration, ctx) => {
1321
- const moduleName = declaration.getModuleSpecifierValue();
1321
+ const moduleName = (0, _bamboocss_ts_ast.getModuleSpecifierValue)(declaration);
1322
1322
  if (!moduleName) return;
1323
1323
  const sourceFile = ctx.resolveModule?.(moduleName, declaration.getSourceFile());
1324
- if (sourceFile) recordModuleDependency(ctx, sourceFile.getFilePath());
1324
+ if (sourceFile) recordModuleDependency(ctx, (0, _bamboocss_ts_ast.pathOf)(sourceFile));
1325
1325
  return sourceFile;
1326
1326
  };
1327
1327
  function resolveVarDeclarationFromExportWithName(symbolName, sourceFile, stack, ctx, visited) {
1328
- for (const exportDeclaration of sourceFile.getExportDeclarations()) {
1328
+ for (const exportDeclaration of (0, _bamboocss_ts_ast.getExportDeclarations)(sourceFile)) {
1329
1329
  const exportStack = [exportDeclaration];
1330
1330
  const sourceName = resolveExportedName(symbolName, exportDeclaration);
1331
1331
  if (sourceName === void 0) continue;
1332
1332
  const maybeFile = getModuleSpecifierSourceFile(exportDeclaration, ctx);
1333
1333
  if (!maybeFile) {
1334
- const localVar = sourceFile.getVariableDeclaration(sourceName);
1334
+ const localVar = (0, _bamboocss_ts_ast.getVariableDeclaration)(sourceFile, sourceName);
1335
1335
  if (localVar) {
1336
1336
  stack.push(...exportStack.concat(localVar));
1337
1337
  return localVar;
@@ -1356,16 +1356,16 @@ const maybeIdentifierValue = (identifier, _stack, ctx) => {
1356
1356
  return box.unresolvable(identifier, stack);
1357
1357
  };
1358
1358
  const tryComputingPlusTokenBinaryExpressionToString = (node, stack, ctx) => {
1359
- const left = unwrapExpression(node.getLeft());
1360
- const right = unwrapExpression(node.getRight());
1359
+ const left = unwrapExpression(node.left);
1360
+ const right = unwrapExpression(node.right);
1361
1361
  const leftValue = maybePropName(left, stack, ctx);
1362
1362
  const rightValue = maybePropName(right, stack, ctx);
1363
1363
  if (!leftValue || !rightValue) return;
1364
1364
  if (isNotNullish(leftValue.value) && isNotNullish(rightValue.value)) return box.literal(String(leftValue.value) + String(rightValue.value), node, stack);
1365
1365
  };
1366
1366
  const getElementAccessedExpressionValue = (expression, _stack, ctx) => {
1367
- const elementAccessed = unwrapExpression(expression.getExpression());
1368
- const argExpr = expression.getArgumentExpression();
1367
+ const elementAccessed = unwrapExpression(expression.expression);
1368
+ const argExpr = expression.argumentExpression;
1369
1369
  if (!argExpr) return;
1370
1370
  const arg = unwrapExpression(argExpr);
1371
1371
  const stack = [
@@ -1374,28 +1374,28 @@ const getElementAccessedExpressionValue = (expression, _stack, ctx) => {
1374
1374
  arg
1375
1375
  ];
1376
1376
  const argLiteral = maybePropName(arg, stack, ctx);
1377
- if (ts_morph.Node.isIdentifier(elementAccessed) && argLiteral) {
1377
+ if (_bamboocss_ts_ast.Node.isIdentifier(elementAccessed) && argLiteral) {
1378
1378
  if (!isNotNullish(argLiteral.value)) return;
1379
1379
  return maybePropIdentifierValue(elementAccessed, [argLiteral.value.toString()], stack, ctx);
1380
1380
  }
1381
- if (ts_morph.Node.isBinaryExpression(arg)) {
1382
- if (arg.getOperatorToken().getKind() !== ts_morph.ts.SyntaxKind.PlusToken) return;
1381
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(arg)) {
1382
+ if (arg.operatorToken.kind !== _bamboocss_ts_ast.ts.SyntaxKind.PlusToken) return;
1383
1383
  const propName = tryComputingPlusTokenBinaryExpressionToString(arg, stack, ctx) ?? maybePropName(arg, stack, ctx);
1384
- if (propName && ts_morph.Node.isIdentifier(elementAccessed)) {
1384
+ if (propName && _bamboocss_ts_ast.Node.isIdentifier(elementAccessed)) {
1385
1385
  if (!isNotNullish(propName.value)) return;
1386
1386
  return maybePropIdentifierValue(elementAccessed, [propName.value.toString()], stack, ctx);
1387
1387
  }
1388
1388
  }
1389
- if (ts_morph.Node.isTemplateExpression(arg)) {
1389
+ if (_bamboocss_ts_ast.Node.isTemplateExpression(arg)) {
1390
1390
  const propName = maybeTemplateStringValue(arg, stack, ctx);
1391
- if (propName && ts_morph.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, [propName], stack, ctx);
1391
+ if (propName && _bamboocss_ts_ast.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, [propName], stack, ctx);
1392
1392
  }
1393
- if (ts_morph.Node.isObjectLiteralExpression(elementAccessed) && argLiteral) {
1393
+ if (_bamboocss_ts_ast.Node.isObjectLiteralExpression(elementAccessed) && argLiteral) {
1394
1394
  if (!isNotNullish(argLiteral.value)) return;
1395
1395
  return getObjectLiteralPropValue(elementAccessed, [argLiteral.value.toString()], stack, ctx);
1396
1396
  }
1397
- if (ts_morph.Node.isPropertyAccessExpression(arg)) return getPropertyAccessedExpressionValue(arg, [], stack, ctx);
1398
- if (ts_morph.Node.isPropertyAccessExpression(elementAccessed) && argLiteral && isNotNullish(argLiteral.value)) {
1397
+ if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(arg)) return getPropertyAccessedExpressionValue(arg, [], stack, ctx);
1398
+ if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(elementAccessed) && argLiteral && isNotNullish(argLiteral.value)) {
1399
1399
  const propRefValue = getPropertyAccessedExpressionValue(elementAccessed, [], stack, ctx);
1400
1400
  if (!propRefValue) return box.unresolvable(elementAccessed, stack);
1401
1401
  const propName = argLiteral.value.toString();
@@ -1413,11 +1413,11 @@ const getElementAccessedExpressionValue = (expression, _stack, ctx) => {
1413
1413
  }
1414
1414
  return box.unresolvable(elementAccessed, stack);
1415
1415
  }
1416
- if (ts_morph.Node.isIdentifier(elementAccessed) && ts_morph.Node.isElementAccessExpression(arg)) {
1416
+ if (_bamboocss_ts_ast.Node.isIdentifier(elementAccessed) && _bamboocss_ts_ast.Node.isElementAccessExpression(arg)) {
1417
1417
  const propName = getElementAccessedExpressionValue(arg, stack, ctx);
1418
1418
  if (typeof propName === "string" && isNotNullish(propName)) return maybePropIdentifierValue(elementAccessed, [propName], stack, ctx);
1419
1419
  }
1420
- if (ts_morph.Node.isElementAccessExpression(elementAccessed) && argLiteral && isNotNullish(argLiteral.value)) {
1420
+ if (_bamboocss_ts_ast.Node.isElementAccessExpression(elementAccessed) && argLiteral && isNotNullish(argLiteral.value)) {
1421
1421
  const identifier = getElementAccessedExpressionValue(elementAccessed, stack, ctx);
1422
1422
  if (isObject(identifier)) {
1423
1423
  const argValue = argLiteral.value.toString();
@@ -1429,18 +1429,18 @@ const getElementAccessedExpressionValue = (expression, _stack, ctx) => {
1429
1429
  }
1430
1430
  }
1431
1431
  }
1432
- if (ts_morph.Node.isArrayLiteralExpression(elementAccessed) && argLiteral) return getArrayElementValueAtIndex(elementAccessed, Number(argLiteral.value), stack, ctx);
1433
- if (ts_morph.Node.isConditionalExpression(arg)) {
1432
+ if (_bamboocss_ts_ast.Node.isArrayLiteralExpression(elementAccessed) && argLiteral) return getArrayElementValueAtIndex(elementAccessed, Number(argLiteral.value), stack, ctx);
1433
+ if (_bamboocss_ts_ast.Node.isConditionalExpression(arg)) {
1434
1434
  if (ctx.flags?.skipConditions) return box.unresolvable(arg, stack);
1435
1435
  const propName = maybePropName(arg, stack, ctx);
1436
1436
  if (isNotNullish(propName) && isNotNullish(propName.value)) {
1437
- if (ts_morph.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, [propName.value.toString()], stack, ctx);
1437
+ if (_bamboocss_ts_ast.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, [propName.value.toString()], stack, ctx);
1438
1438
  }
1439
- const whenTrueExpr = unwrapExpression(arg.getWhenTrue());
1440
- const whenFalseExpr = unwrapExpression(arg.getWhenFalse());
1439
+ const whenTrueExpr = unwrapExpression(arg.whenTrue);
1440
+ const whenFalseExpr = unwrapExpression(arg.whenFalse);
1441
1441
  const whenTrueValue = maybePropName(whenTrueExpr, stack, ctx);
1442
1442
  const whenFalseValue = maybePropName(whenFalseExpr, stack, ctx);
1443
- if (ts_morph.Node.isIdentifier(elementAccessed)) {
1443
+ if (_bamboocss_ts_ast.Node.isIdentifier(elementAccessed)) {
1444
1444
  const whenTrueResolved = whenTrueValue && isNotNullish(whenTrueValue.value) ? maybePropIdentifierValue(elementAccessed, [whenTrueValue.value.toString()], stack, ctx) : void 0;
1445
1445
  const whenFalseResolved = whenFalseValue && isNotNullish(whenFalseValue.value) ? maybePropIdentifierValue(elementAccessed, [whenFalseValue.value.toString()], stack, ctx) : void 0;
1446
1446
  if (!whenTrueResolved && !whenFalseResolved) return;
@@ -1451,27 +1451,27 @@ const getElementAccessedExpressionValue = (expression, _stack, ctx) => {
1451
1451
  }
1452
1452
  };
1453
1453
  const getArrayElementValueAtIndex = (array, index, stack, ctx) => {
1454
- const element = array.getElements()[index];
1454
+ const element = array.elements[index];
1455
1455
  if (!element) return;
1456
1456
  const value = maybeBoxNode(element, stack, ctx);
1457
1457
  if (isNotNullish(value)) return value;
1458
1458
  };
1459
1459
  const getPropertyAccessedExpressionValue = (expression, _accessList, stack, ctx) => {
1460
- const propName = expression.getName();
1461
- const elementAccessed = unwrapExpression(expression.getExpression());
1462
- const accessList = _accessList.concat(propName);
1460
+ const propName = (0, _bamboocss_ts_ast.getName)(expression);
1461
+ const elementAccessed = unwrapExpression(expression.expression);
1462
+ const accessList = _accessList.concat(String(propName));
1463
1463
  stack.push(elementAccessed);
1464
- if (ts_morph.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, accessList, stack, ctx);
1465
- if (ts_morph.Node.isPropertyAccessExpression(elementAccessed)) return getPropertyAccessedExpressionValue(elementAccessed, accessList, stack, ctx);
1466
- if (ts_morph.Node.isElementAccessExpression(elementAccessed)) {
1464
+ if (_bamboocss_ts_ast.Node.isIdentifier(elementAccessed)) return maybePropIdentifierValue(elementAccessed, accessList, stack, ctx);
1465
+ if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(elementAccessed)) return getPropertyAccessedExpressionValue(elementAccessed, accessList, stack, ctx);
1466
+ if (_bamboocss_ts_ast.Node.isElementAccessExpression(elementAccessed)) {
1467
1467
  const leftElementAccessed = getElementAccessedExpressionValue(elementAccessed, stack, ctx);
1468
1468
  if (!leftElementAccessed) return;
1469
1469
  if (box.isObject(leftElementAccessed)) {
1470
- const propValue = leftElementAccessed.value[propName];
1470
+ const propValue = leftElementAccessed.value[String(propName)];
1471
1471
  return box.from(propValue, expression, stack);
1472
1472
  }
1473
1473
  if (box.isMap(leftElementAccessed)) {
1474
- const propValue = leftElementAccessed.value.get(propName);
1474
+ const propValue = leftElementAccessed.value.get(propName ?? "");
1475
1475
  return box.from(propValue, expression, stack);
1476
1476
  }
1477
1477
  }
@@ -1480,8 +1480,8 @@ const getPropertyAccessedExpressionValue = (expression, _accessList, stack, ctx)
1480
1480
  //#region src/call-expression.ts
1481
1481
  const trueFn = () => true;
1482
1482
  const extractCallExpressionArguments = (node, ctx, matchProp = trueFn, matchArg = trueFn) => {
1483
- const fnArguments = node.getArguments();
1484
- const fnName = node.getExpression().getText();
1483
+ const fnArguments = node.arguments;
1484
+ const fnName = node.expression.getText();
1485
1485
  if (fnArguments.length === 0) return box.array([], node, []);
1486
1486
  return box.array(fnArguments.map((argument, index) => {
1487
1487
  const argNode = unwrapExpression(argument);
@@ -1578,9 +1578,9 @@ const collectImports = (sourceFile) => {
1578
1578
  const resolveBundledNamespaceMod = (node) => {
1579
1579
  if (!node) return;
1580
1580
  const expression = unwrapExpression(node);
1581
- if (ts_morph.Node.isCallExpression(expression)) {
1582
- const callee = unwrapExpression(expression.getExpression());
1583
- if (!ts_morph.Node.isIdentifier(callee)) return;
1581
+ if (_bamboocss_ts_ast.Node.isCallExpression(expression)) {
1582
+ const callee = unwrapExpression(expression.expression);
1583
+ if (!_bamboocss_ts_ast.Node.isIdentifier(callee)) return;
1584
1584
  const calleeName = callee.getText();
1585
1585
  if (/requirejsxdevruntime/i.test(calleeName)) return "react/jsx-dev-runtime";
1586
1586
  if (/requirejsxruntime/i.test(calleeName)) return "react/jsx-runtime";
@@ -1588,70 +1588,70 @@ const collectImports = (sourceFile) => {
1588
1588
  }
1589
1589
  };
1590
1590
  const bundledCandidates = mayHoldBundledOutput(sourceFile.getFullText());
1591
- (bundledCandidates ? sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.CallExpression) : []).forEach((callExpression) => {
1592
- const callee = unwrapExpression(callExpression.getExpression());
1593
- if (!ts_morph.Node.isIdentifier(callee) || callee.getText() !== "parcelRegister") return;
1594
- const [idArg, factoryArg] = callExpression.getArguments();
1595
- if (!ts_morph.Node.isStringLiteral(idArg)) return;
1596
- if (!ts_morph.Node.isArrowFunction(factoryArg) && !ts_morph.Node.isFunctionExpression(factoryArg)) return;
1597
- const factoryText = factoryArg.getBody().getText();
1598
- if (factoryText.includes("\"Fragment\"") && factoryText.includes("\"jsx\"") && factoryText.includes("\"jsxs\"") && factoryText.includes("module.exports")) parcelRuntimeModuleIds.set(idArg.getLiteralValue(), "react/jsx-runtime");
1591
+ (bundledCandidates ? (0, _bamboocss_ts_ast.getDescendantsOfKind)(sourceFile, _bamboocss_ts_ast.SyntaxKind.CallExpression) : []).forEach((callExpression) => {
1592
+ const callee = unwrapExpression((0, _bamboocss_ts_ast.childOf)(callExpression, "expression"));
1593
+ if (!_bamboocss_ts_ast.Node.isIdentifier(callee) || callee.getText() !== "parcelRegister") return;
1594
+ const [idArg, factoryArg] = (0, _bamboocss_ts_ast.childOf)(callExpression, "arguments") ?? [];
1595
+ if (!_bamboocss_ts_ast.Node.isStringLiteral(idArg)) return;
1596
+ if (!_bamboocss_ts_ast.Node.isArrowFunction(factoryArg) && !_bamboocss_ts_ast.Node.isFunctionExpression(factoryArg)) return;
1597
+ const factoryText = factoryArg.body.getText();
1598
+ if (factoryText.includes("\"Fragment\"") && factoryText.includes("\"jsx\"") && factoryText.includes("\"jsxs\"") && factoryText.includes("module.exports")) parcelRuntimeModuleIds.set((0, _bamboocss_ts_ast.stringLiteralValue)(idArg), "react/jsx-runtime");
1599
1599
  });
1600
- sourceFile.getImportDeclarations().forEach((declaration) => {
1601
- const mod = declaration.getModuleSpecifierValue();
1600
+ (0, _bamboocss_ts_ast.getImportDeclarations)(sourceFile).forEach((declaration) => {
1601
+ const mod = (0, _bamboocss_ts_ast.getModuleSpecifierValue)(declaration);
1602
1602
  if (!mod) return;
1603
- const defaultImport = declaration.getDefaultImport();
1603
+ const defaultImport = (0, _bamboocss_ts_ast.getDefaultImport)(declaration);
1604
1604
  if (defaultImport) defaultImports.set(defaultImport.getText(), mod);
1605
- const namespaceImport = declaration.getNamespaceImport();
1605
+ const namespaceImport = (0, _bamboocss_ts_ast.getNamespaceImport)(declaration);
1606
1606
  if (namespaceImport) namespace.set(namespaceImport.getText(), mod);
1607
- declaration.getNamedImports().forEach((specifier) => {
1608
- const importedName = specifier.getNameNode().getText();
1609
- const alias = specifier.getAliasNode()?.getText() || importedName;
1610
- named.set(alias, {
1611
- importedName,
1607
+ (0, _bamboocss_ts_ast.getNamedImports)(declaration).forEach((specifier) => {
1608
+ const importedName = (0, _bamboocss_ts_ast.nameNodeOf)(specifier)?.getText();
1609
+ const alias = (0, _bamboocss_ts_ast.getAliasNode)(specifier)?.getText() || importedName;
1610
+ named.set(alias ?? "", {
1611
+ importedName: importedName ?? "",
1612
1612
  mod
1613
1613
  });
1614
1614
  });
1615
1615
  });
1616
- sourceFile.getVariableDeclarations().forEach((declaration) => {
1617
- if (!ts_morph.Node.isIdentifier(declaration.getNameNode())) return;
1618
- const variableName = declaration.getName();
1619
- const initializer = declaration.getInitializer();
1620
- const bundledImport = resolveBundledHelperImport(variableName, initializer);
1621
- if (bundledImport) bundledNamed.set(variableName, bundledImport);
1622
- let mod = getBundledRuntimeModFromName(variableName) ?? resolveBundledNamespaceMod(initializer);
1623
- if (!mod && initializer && ts_morph.Node.isCallExpression(initializer)) {
1624
- const callee = unwrapExpression(initializer.getExpression());
1625
- const [firstArg] = initializer.getArguments();
1626
- if (ts_morph.Node.isIdentifier(callee) && callee.getText() === "parcelRequire" && ts_morph.Node.isStringLiteral(firstArg)) mod = parcelRuntimeModuleIds.get(firstArg.getLiteralValue());
1616
+ (0, _bamboocss_ts_ast.getVariableDeclarations)(sourceFile).forEach((declaration) => {
1617
+ if (!_bamboocss_ts_ast.Node.isIdentifier((0, _bamboocss_ts_ast.nameNodeOf)(declaration))) return;
1618
+ const variableName = (0, _bamboocss_ts_ast.getName)(declaration);
1619
+ const initializer = (0, _bamboocss_ts_ast.childOf)(declaration, "initializer");
1620
+ const bundledImport = resolveBundledHelperImport(variableName ?? "", initializer);
1621
+ if (bundledImport) bundledNamed.set(variableName ?? "", bundledImport);
1622
+ let mod = getBundledRuntimeModFromName(variableName ?? "") ?? resolveBundledNamespaceMod(initializer);
1623
+ if (!mod && initializer && _bamboocss_ts_ast.Node.isCallExpression(initializer)) {
1624
+ const callee = unwrapExpression(initializer.expression);
1625
+ const [firstArg] = initializer.arguments;
1626
+ if (_bamboocss_ts_ast.Node.isIdentifier(callee) && callee.getText() === "parcelRequire" && _bamboocss_ts_ast.Node.isStringLiteral(firstArg)) mod = parcelRuntimeModuleIds.get((0, _bamboocss_ts_ast.stringLiteralValue)(firstArg));
1627
1627
  }
1628
- if (!mod && initializer && ts_morph.Node.isObjectLiteralExpression(initializer)) {
1629
- const propertyNames = new Set(initializer.getProperties().map((property) => {
1630
- if (ts_morph.Node.isPropertyAssignment(property)) return property.getName();
1628
+ if (!mod && initializer && _bamboocss_ts_ast.Node.isObjectLiteralExpression(initializer)) {
1629
+ const propertyNames = new Set(initializer.properties.map((property) => {
1630
+ if (_bamboocss_ts_ast.Node.isPropertyAssignment(property)) return (0, _bamboocss_ts_ast.getName)(property);
1631
1631
  }).filter(Boolean));
1632
1632
  if (propertyNames.has("jsx") && propertyNames.has("Fragment")) mod = "preact/jsx-runtime";
1633
1633
  }
1634
1634
  if (!mod) return;
1635
- bundledNamespace.set(variableName, mod);
1635
+ bundledNamespace.set(variableName ?? "", mod);
1636
1636
  });
1637
- (bundledCandidates ? sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.FunctionDeclaration) : []).forEach((declaration) => {
1638
- const bundledImport = resolveBundledHelperImport(declaration.getName() ?? "", declaration);
1639
- if (!bundledImport || !declaration.getName()) return;
1640
- bundledNamed.set(declaration.getName(), bundledImport);
1637
+ (bundledCandidates ? (0, _bamboocss_ts_ast.getDescendantsOfKind)(sourceFile, _bamboocss_ts_ast.SyntaxKind.FunctionDeclaration) : []).forEach((declaration) => {
1638
+ const bundledImport = resolveBundledHelperImport((0, _bamboocss_ts_ast.getName)(declaration) ?? "", declaration);
1639
+ if (!bundledImport || !(0, _bamboocss_ts_ast.getName)(declaration)) return;
1640
+ bundledNamed.set((0, _bamboocss_ts_ast.getName)(declaration), bundledImport);
1641
1641
  });
1642
1642
  const resolveBundledAliasImport = (node) => {
1643
1643
  if (!node) return;
1644
1644
  const expression = unwrapExpression(node);
1645
- if (ts_morph.Node.isIdentifier(expression)) return bundledNamed.get(expression.getText());
1646
- if (ts_morph.Node.isConditionalExpression(expression)) return resolveBundledAliasImport(expression.getWhenTrue()) ?? resolveBundledAliasImport(expression.getWhenFalse());
1647
- if (ts_morph.Node.isBinaryExpression(expression) && expression.getOperatorToken().getKind() === ts_morph.SyntaxKind.CommaToken) return resolveBundledAliasImport(expression.getRight());
1645
+ if (_bamboocss_ts_ast.Node.isIdentifier(expression)) return bundledNamed.get(expression.getText());
1646
+ if (_bamboocss_ts_ast.Node.isConditionalExpression(expression)) return resolveBundledAliasImport(expression.whenTrue) ?? resolveBundledAliasImport(expression.whenFalse);
1647
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(expression) && expression.operatorToken.kind === _bamboocss_ts_ast.SyntaxKind.CommaToken) return resolveBundledAliasImport(expression.right);
1648
1648
  };
1649
- sourceFile.getVariableDeclarations().forEach((declaration) => {
1650
- if (!ts_morph.Node.isIdentifier(declaration.getNameNode())) return;
1651
- if (bundledNamed.has(declaration.getName())) return;
1652
- const bundledAlias = resolveBundledAliasImport(declaration.getInitializer());
1649
+ (0, _bamboocss_ts_ast.getVariableDeclarations)(sourceFile).forEach((declaration) => {
1650
+ if (!_bamboocss_ts_ast.Node.isIdentifier((0, _bamboocss_ts_ast.nameNodeOf)(declaration))) return;
1651
+ if (bundledNamed.has((0, _bamboocss_ts_ast.getName)(declaration) ?? "")) return;
1652
+ const bundledAlias = resolveBundledAliasImport((0, _bamboocss_ts_ast.childOf)(declaration, "initializer"));
1653
1653
  if (!bundledAlias) return;
1654
- bundledNamed.set(declaration.getName(), bundledAlias);
1654
+ bundledNamed.set((0, _bamboocss_ts_ast.getName)(declaration) ?? "", bundledAlias);
1655
1655
  });
1656
1656
  return {
1657
1657
  named,
@@ -1669,8 +1669,8 @@ const normalizeTagName = (text) => {
1669
1669
  const getTagName = (node) => {
1670
1670
  if (!node) return;
1671
1671
  const expression = unwrapExpression(node);
1672
- if (ts_morph.Node.isStringLiteral(expression) || ts_morph.Node.isNoSubstitutionTemplateLiteral(expression)) return expression.getLiteralValue();
1673
- if (ts_morph.Node.isIdentifier(expression) || ts_morph.Node.isPropertyAccessExpression(expression) || ts_morph.Node.isElementAccessExpression(expression)) return normalizeTagName(expression.getText());
1672
+ if (_bamboocss_ts_ast.Node.isStringLiteral(expression) || _bamboocss_ts_ast.Node.isNoSubstitutionTemplateLiteral(expression)) return (0, _bamboocss_ts_ast.literalValueOf)(expression);
1673
+ if (_bamboocss_ts_ast.Node.isIdentifier(expression) || _bamboocss_ts_ast.Node.isPropertyAccessExpression(expression) || _bamboocss_ts_ast.Node.isElementAccessExpression(expression)) return normalizeTagName(expression.getText());
1674
1674
  };
1675
1675
  const isQwikMod = (mod) => mod.includes("qwik");
1676
1676
  const getArgsAt = (...indices) => (args) => indices.map((index) => args[index]).filter(Boolean);
@@ -1749,11 +1749,11 @@ const runtimeProfiles = [
1749
1749
  */
1750
1750
  const findLocalDeclaration = (identifier) => {
1751
1751
  const name = identifier.getText();
1752
- for (let scope = identifier.getParent(); scope; scope = scope.getParent()) {
1753
- if (!ts_morph.Node.isStatemented(scope)) continue;
1754
- const variable = scope.getVariableDeclaration(name);
1752
+ for (let scope = identifier.parent; scope; scope = scope.parent) {
1753
+ if (!_bamboocss_ts_ast.Node.isStatement(scope)) continue;
1754
+ const variable = (0, _bamboocss_ts_ast.getVariableDeclaration)(scope, name);
1755
1755
  if (variable) return variable;
1756
- const fn = scope.getFunction(name);
1756
+ const fn = ((0, _bamboocss_ts_ast.childOf)(scope, "statements") ?? []).find((statement) => _bamboocss_ts_ast.is.isFunctionDeclaration(statement) && (0, _bamboocss_ts_ast.getName)(statement) === name);
1757
1757
  if (fn) return fn;
1758
1758
  }
1759
1759
  };
@@ -1761,7 +1761,7 @@ const createCompiledJsxContext = (sourceFile) => {
1761
1761
  const imports = collectImports(sourceFile);
1762
1762
  const normalizeCallee = (node) => {
1763
1763
  const expression = unwrapExpression(node);
1764
- if (ts_morph.Node.isBinaryExpression(expression) && expression.getOperatorToken().getKind() === ts_morph.SyntaxKind.CommaToken) return normalizeCallee(expression.getRight());
1764
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(expression) && expression.operatorToken.kind === _bamboocss_ts_ast.SyntaxKind.CommaToken) return normalizeCallee(expression.right);
1765
1765
  return expression;
1766
1766
  };
1767
1767
  const localDefinitionCache = /* @__PURE__ */ new Map();
@@ -1772,7 +1772,7 @@ const createCompiledJsxContext = (sourceFile) => {
1772
1772
  const resolveLocalAlias = (aliasNode) => {
1773
1773
  if (!aliasNode) return;
1774
1774
  const expression = unwrapExpression(aliasNode);
1775
- if (ts_morph.Node.isIdentifier(expression)) {
1775
+ if (_bamboocss_ts_ast.Node.isIdentifier(expression)) {
1776
1776
  const imported = imports.bundledNamed.get(expression.getText());
1777
1777
  if (imported) return {
1778
1778
  mod: imported.mod,
@@ -1780,13 +1780,13 @@ const createCompiledJsxContext = (sourceFile) => {
1780
1780
  };
1781
1781
  return resolveIdentifierDefinition(expression);
1782
1782
  }
1783
- if (ts_morph.Node.isConditionalExpression(expression)) return resolveLocalAlias(expression.getWhenTrue()) ?? resolveLocalAlias(expression.getWhenFalse());
1784
- if (ts_morph.Node.isBinaryExpression(expression) && expression.getOperatorToken().getKind() === ts_morph.SyntaxKind.CommaToken) return resolveLocalAlias(expression.getRight());
1783
+ if (_bamboocss_ts_ast.Node.isConditionalExpression(expression)) return resolveLocalAlias(expression.whenTrue) ?? resolveLocalAlias(expression.whenFalse);
1784
+ if (_bamboocss_ts_ast.Node.isBinaryExpression(expression) && expression.operatorToken.kind === _bamboocss_ts_ast.SyntaxKind.CommaToken) return resolveLocalAlias(expression.right);
1785
1785
  };
1786
1786
  const declaration = findLocalDeclaration(identifier);
1787
1787
  if (!declaration) return;
1788
- if (ts_morph.Node.isFunctionDeclaration(declaration)) {
1789
- const imported = resolveBundledHelperImport(declaration.getName() ?? name, declaration);
1788
+ if (_bamboocss_ts_ast.Node.isFunctionDeclaration(declaration)) {
1789
+ const imported = resolveBundledHelperImport((0, _bamboocss_ts_ast.getName)(declaration) ?? name, declaration);
1790
1790
  if (!imported) return;
1791
1791
  const resolved = {
1792
1792
  mod: imported.mod,
@@ -1795,18 +1795,18 @@ const createCompiledJsxContext = (sourceFile) => {
1795
1795
  localDefinitionCache.set(name, resolved);
1796
1796
  return resolved;
1797
1797
  }
1798
- const directImport = resolveBundledHelperImport(declaration.getName(), declaration.getInitializer());
1798
+ const directImport = resolveBundledHelperImport((0, _bamboocss_ts_ast.getName)(declaration) ?? "", (0, _bamboocss_ts_ast.childOf)(declaration, "initializer"));
1799
1799
  const aliasImport = directImport ? {
1800
1800
  mod: directImport.mod,
1801
1801
  importedName: directImport.importedName
1802
- } : resolveLocalAlias(declaration.getInitializer());
1802
+ } : resolveLocalAlias((0, _bamboocss_ts_ast.childOf)(declaration, "initializer"));
1803
1803
  if (!aliasImport) return;
1804
1804
  localDefinitionCache.set(name, aliasImport);
1805
1805
  return aliasImport;
1806
1806
  };
1807
1807
  const resolveCallee = (node) => {
1808
1808
  const expression = normalizeCallee(node);
1809
- if (ts_morph.Node.isIdentifier(expression)) {
1809
+ if (_bamboocss_ts_ast.Node.isIdentifier(expression)) {
1810
1810
  const imported = imports.named.get(expression.getText()) ?? imports.bundledNamed.get(expression.getText());
1811
1811
  if (imported) return {
1812
1812
  mod: imported.mod,
@@ -1814,37 +1814,41 @@ const createCompiledJsxContext = (sourceFile) => {
1814
1814
  };
1815
1815
  return resolveIdentifierDefinition(expression);
1816
1816
  }
1817
- if (ts_morph.Node.isPropertyAccessExpression(expression)) {
1818
- const target = normalizeCallee(expression.getExpression());
1819
- if (!ts_morph.Node.isIdentifier(target)) return;
1817
+ if (_bamboocss_ts_ast.Node.isPropertyAccessExpression(expression)) {
1818
+ const target = normalizeCallee(expression.expression);
1819
+ if (!_bamboocss_ts_ast.Node.isIdentifier(target)) return;
1820
1820
  const targetName = target.getText();
1821
1821
  const mod = imports.default.get(targetName) ?? imports.namespace.get(targetName) ?? imports.bundledNamespace.get(targetName);
1822
1822
  if (!mod) return;
1823
1823
  return {
1824
1824
  mod,
1825
- importedName: expression.getName()
1825
+ importedName: (0, _bamboocss_ts_ast.getName)(expression)
1826
1826
  };
1827
1827
  }
1828
1828
  };
1829
1829
  const isMergePropsCall = (node) => {
1830
- if (!ts_morph.Node.isCallExpression(node)) return false;
1831
- const resolved = resolveCallee(node.getExpression());
1830
+ if (!_bamboocss_ts_ast.Node.isCallExpression(node)) return false;
1831
+ const resolved = resolveCallee(node.expression);
1832
1832
  if (!resolved) return false;
1833
1833
  return resolved.importedName === "mergeProps" && (solidMods.has(resolved.mod) || vueMods.has(resolved.mod));
1834
1834
  };
1835
1835
  const getCallInfo = (node) => {
1836
- const resolved = resolveCallee(node.getExpression());
1836
+ const resolved = resolveCallee(node.expression);
1837
1837
  if (!resolved) return;
1838
- const args = node.getArguments().map((arg) => unwrapExpression(arg));
1838
+ const args = node.arguments.map((arg) => unwrapExpression(arg));
1839
1839
  const tagName = getTagName(args[0]);
1840
1840
  if (!tagName) return;
1841
1841
  const baseInfo = {
1842
1842
  tagName,
1843
- isFactory: tagName.includes(".")
1843
+ isFactory: String(tagName).includes(".")
1844
1844
  };
1845
- for (const profile of runtimeProfiles) if (profile.matches(resolved)) return {
1845
+ for (const profile of runtimeProfiles) if (profile.matches({
1846
+ ...resolved,
1847
+ importedName: resolved.importedName ?? ""
1848
+ })) return {
1846
1849
  framework: profile.framework,
1847
1850
  ...baseInfo,
1851
+ tagName: String(baseInfo.tagName),
1848
1852
  propNodes: profile.getPropNodes(args)
1849
1853
  };
1850
1854
  };
@@ -1856,18 +1860,18 @@ const createCompiledJsxContext = (sourceFile) => {
1856
1860
  //#endregion
1857
1861
  //#region src/jsx-attribute.ts
1858
1862
  const extractJsxAttribute = (jsxAttribute, ctx) => {
1859
- const initializer = jsxAttribute.getInitializer();
1863
+ const initializer = jsxAttribute.initializer;
1860
1864
  const stack = [jsxAttribute, initializer];
1861
1865
  if (!initializer) {
1862
- const nameNode = jsxAttribute.getNameNode();
1866
+ const nameNode = jsxAttribute.name;
1863
1867
  return box.emptyInitializer(nameNode, stack);
1864
1868
  }
1865
- if (ts_morph.Node.isStringLiteral(initializer)) {
1866
- const literalText = initializer.getLiteralText();
1869
+ if (_bamboocss_ts_ast.Node.isStringLiteral(initializer)) {
1870
+ const literalText = (0, _bamboocss_ts_ast.getLiteralText)(initializer);
1867
1871
  return box.literal(trimWhitespace(literalText), initializer, stack);
1868
1872
  }
1869
- if (ts_morph.Node.isJsxExpression(initializer)) {
1870
- const expr = initializer.getExpression();
1873
+ if (_bamboocss_ts_ast.Node.isJsxExpression(initializer)) {
1874
+ const expr = initializer.expression;
1871
1875
  if (!expr) return;
1872
1876
  const expression = unwrapExpression(expr);
1873
1877
  if (!expression) return;
@@ -1879,7 +1883,7 @@ const extractJsxAttribute = (jsxAttribute, ctx) => {
1879
1883
  //#endregion
1880
1884
  //#region src/jsx-spread-attribute.ts
1881
1885
  const extractJsxSpreadAttributeValues = (node, ctx, matchProp) => {
1882
- return maybeBoxNode(unwrapExpression(node.getExpression()), [], ctx, matchProp);
1886
+ return maybeBoxNode(unwrapExpression(node.expression), [], ctx, matchProp);
1883
1887
  };
1884
1888
  //#endregion
1885
1889
  //#region src/object-like-to-map.ts
@@ -1894,8 +1898,8 @@ const objectLikeToMap = (maybeObject, node) => {
1894
1898
  };
1895
1899
  //#endregion
1896
1900
  //#region src/extract.ts
1897
- const isImportOrExport = (node) => ts_morph.Node.isImportDeclaration(node) || ts_morph.Node.isExportDeclaration(node);
1898
- const isJsxElement = (node) => ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node);
1901
+ const isImportOrExport = (node) => _bamboocss_ts_ast.Node.isImportDeclaration(node) || _bamboocss_ts_ast.Node.isExportDeclaration(node);
1902
+ const isJsxElement = (node) => _bamboocss_ts_ast.Node.isJsxOpeningElement(node) || _bamboocss_ts_ast.Node.isJsxSelfClosingElement(node);
1899
1903
  const extract = ({ ast, ...ctx }) => {
1900
1904
  const { components, functions } = ctx;
1901
1905
  const compiledJsx = createCompiledJsxContext(ast);
@@ -1948,12 +1952,12 @@ const extract = ({ ast, ...ctx }) => {
1948
1952
  const processCompiledPropSource = (componentNode, component, boxByProp, propNode, matchProp) => {
1949
1953
  const expression = unwrapExpression(propNode);
1950
1954
  const stack = [componentNode, expression];
1951
- if (ts_morph.Node.isObjectLiteralExpression(expression)) {
1955
+ if (_bamboocss_ts_ast.Node.isObjectLiteralExpression(expression)) {
1952
1956
  processComponentBoxNode(component, boxByProp, expression, getObjectLiteralExpressionPropPairs(expression, stack, ctx, matchProp), matchProp, true);
1953
1957
  return;
1954
1958
  }
1955
- if (ts_morph.Node.isCallExpression(expression) && compiledJsx.isMergePropsCall(expression)) {
1956
- expression.getArguments().forEach((arg) => {
1959
+ if (_bamboocss_ts_ast.Node.isCallExpression(expression) && compiledJsx.isMergePropsCall(expression)) {
1960
+ expression.arguments.forEach((arg) => {
1957
1961
  processCompiledPropSource(componentNode, component, boxByProp, arg, matchProp);
1958
1962
  });
1959
1963
  return;
@@ -1962,13 +1966,10 @@ const extract = ({ ast, ...ctx }) => {
1962
1966
  if (!maybeValue) return;
1963
1967
  processComponentBoxNode(component, boxByProp, expression, maybeValue, matchProp, true);
1964
1968
  };
1965
- ast.forEachDescendant((node, traversal) => {
1966
- if (isImportOrExport(node)) {
1967
- traversal.skip();
1968
- return;
1969
- }
1969
+ (0, _bamboocss_ts_ast.forEachDescendant)(ast, (node) => {
1970
+ if (isImportOrExport(node)) return _bamboocss_ts_ast.SKIP;
1970
1971
  if (components) {
1971
- if (ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node)) {
1972
+ if (_bamboocss_ts_ast.Node.isJsxOpeningElement(node) || _bamboocss_ts_ast.Node.isJsxSelfClosingElement(node)) {
1972
1973
  const componentNode = node;
1973
1974
  const componentName = getComponentName(componentNode);
1974
1975
  const isFactory = componentName.includes(".");
@@ -1979,8 +1980,8 @@ const extract = ({ ast, ...ctx }) => {
1979
1980
  })) return;
1980
1981
  ensureComponent(componentNode, componentName);
1981
1982
  }
1982
- if (ts_morph.Node.isJsxSpreadAttribute(node)) {
1983
- const componentNode = node.getFirstAncestor(isJsxElement);
1983
+ if (_bamboocss_ts_ast.Node.isJsxSpreadAttribute(node)) {
1984
+ const componentNode = (0, _bamboocss_ts_ast.getFirstAncestor)(node, isJsxElement);
1984
1985
  const component = componentByNode.get(componentNode);
1985
1986
  if (!componentNode || !component) return;
1986
1987
  const componentName = getComponentName(componentNode);
@@ -1996,13 +1997,13 @@ const extract = ({ ast, ...ctx }) => {
1996
1997
  processComponentBoxNode(component, boxByProp, node, spreadNode, matchProp);
1997
1998
  return;
1998
1999
  }
1999
- if (ts_morph.Node.isJsxAttribute(node)) {
2000
- const componentNode = node.getFirstAncestor(isJsxElement);
2000
+ if (_bamboocss_ts_ast.Node.isJsxAttribute(node)) {
2001
+ const componentNode = (0, _bamboocss_ts_ast.getFirstAncestor)(node, isJsxElement);
2001
2002
  const component = componentByNode.get(componentNode);
2002
2003
  if (!componentNode || !component) return;
2003
2004
  const componentName = getComponentName(componentNode);
2004
2005
  const boxByProp = byName.get(componentName).nodesByProp;
2005
- const propName = node.getNameNode().getText();
2006
+ const propName = node.name.getText();
2006
2007
  if (!components.matchProp({
2007
2008
  tagNode: componentNode,
2008
2009
  tagName: componentName,
@@ -2013,7 +2014,7 @@ const extract = ({ ast, ...ctx }) => {
2013
2014
  if (!maybeBox) return;
2014
2015
  addComponentProp(component, boxByProp, propName, maybeBox);
2015
2016
  }
2016
- if (ts_morph.Node.isCallExpression(node)) {
2017
+ if (_bamboocss_ts_ast.Node.isCallExpression(node)) {
2017
2018
  const compiledCall = compiledJsx.getCallInfo(node);
2018
2019
  if (compiledCall) {
2019
2020
  const { tagName, isFactory, propNodes } = compiledCall;
@@ -2035,9 +2036,9 @@ const extract = ({ ast, ...ctx }) => {
2035
2036
  }
2036
2037
  }
2037
2038
  }
2038
- if (functions && ts_morph.Node.isCallExpression(node)) {
2039
- const expr = node.getExpression();
2040
- const fnName = ts_morph.Node.isCallExpression(expr) ? expr.getExpression().getText() : expr.getText();
2039
+ if (functions && _bamboocss_ts_ast.Node.isCallExpression(node)) {
2040
+ const expr = node.expression;
2041
+ const fnName = _bamboocss_ts_ast.Node.isCallExpression(expr) ? expr.expression.getText() : expr.getText();
2041
2042
  if (!functions.matchFn({
2042
2043
  fnNode: node,
2043
2044
  fnName
@@ -2083,7 +2084,7 @@ const extract = ({ ast, ...ctx }) => {
2083
2084
  componentByNode.forEach((parentRef, componentNode) => {
2084
2085
  const component = componentByNode.get(componentNode);
2085
2086
  if (!component) return;
2086
- if (ts_morph.Node.isCallExpression(componentNode) && component.props.size === 0 && component.conditionals.length === 0) return;
2087
+ if (_bamboocss_ts_ast.Node.isCallExpression(componentNode) && component.props.size === 0 && component.conditionals.length === 0) return;
2087
2088
  const query = {
2088
2089
  name: parentRef.name,
2089
2090
  box: box.map(component.props, componentNode, [])
@@ -2101,18 +2102,18 @@ const extract = ({ ast, ...ctx }) => {
2101
2102
  //#region src/jsx-element-props.ts
2102
2103
  const isObjectLike = (node) => box.isObject(node) || box.isMap(node);
2103
2104
  const extractJsxElementProps = (node, ctx) => {
2104
- const tagName = node.getTagNameNode().getText();
2105
- const jsxAttributes = node.getAttributes();
2105
+ const tagName = node.tagName.getText();
2106
+ const jsxAttributes = (0, _bamboocss_ts_ast.childOf)(node, "attributes")?.properties ?? [];
2106
2107
  const props = /* @__PURE__ */ new Map();
2107
2108
  jsxAttributes.forEach((attrNode) => {
2108
- if (ts_morph.Node.isJsxAttribute(attrNode)) {
2109
- const nameNode = attrNode.getNameNode();
2109
+ if (_bamboocss_ts_ast.Node.isJsxAttribute(attrNode)) {
2110
+ const nameNode = attrNode.name;
2110
2111
  const maybeValue = extractJsxAttribute(attrNode, ctx);
2111
2112
  if (!maybeValue) return;
2112
2113
  props.set(nameNode.getText(), maybeValue);
2113
2114
  return;
2114
2115
  }
2115
- if (ts_morph.Node.isJsxSpreadAttribute(attrNode)) {
2116
+ if (_bamboocss_ts_ast.Node.isJsxSpreadAttribute(attrNode)) {
2116
2117
  const maybeValue = extractJsxSpreadAttributeValues(attrNode, ctx, () => true);
2117
2118
  if (!isObjectLike(maybeValue)) return;
2118
2119
  if (box.isMap(maybeValue)) maybeValue.value.forEach((value, propName) => {
@@ -2160,7 +2161,7 @@ const getLiteralValue = (node, ctx) => {
2160
2161
  }));
2161
2162
  const last = node.getStack().at(-1);
2162
2163
  const maybeIndex = Number(path[path.length - 1]);
2163
- if (last && ts_morph.Node.isArrayLiteralExpression(last) && !Number.isNaN(maybeIndex)) {
2164
+ if (last && _bamboocss_ts_ast.Node.isArrayLiteralExpression(last) && !Number.isNaN(maybeIndex)) {
2164
2165
  const sliced = path.slice(0, -1);
2165
2166
  if (whenTrue) ctx.conditions.push(makeObjAt(sliced, makeArrayWithValueAt(maybeIndex, whenTrue)));
2166
2167
  if (whenFalse) ctx.conditions.push(makeObjAt(sliced, makeArrayWithValueAt(maybeIndex, whenFalse)));