weapp-tailwindcss 5.4.2 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +13 -1
  2. package/README.zh-CN.md +13 -1
  3. package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
  4. package/dist/bundlers/vite/capability-profile.d.ts +1 -0
  5. package/dist/bundlers/vite/css-finalizer/web-plugin.d.ts +3 -0
  6. package/dist/bundlers/vite/css-handler-options.d.ts +32 -0
  7. package/dist/bundlers/vite/{generate-bundle/css-output.d.ts → css-output.d.ts} +1 -1
  8. package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -0
  9. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +2 -32
  10. package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +1 -1
  11. package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -2
  12. package/dist/bundlers/vite/generate-bundle/runtime.d.ts +1 -1
  13. package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +1 -1
  14. package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
  15. package/dist/bundlers/vite/runtime-class-set.d.ts +1 -5
  16. package/dist/bundlers/vite/shared/create-css-only-plugins-runtime.d.ts +3 -0
  17. package/dist/cache-CBJFB1HN.cjs +223 -0
  18. package/dist/compiler/events.d.ts +32 -0
  19. package/dist/compiler/host.d.ts +13 -0
  20. package/dist/compiler/index.d.ts +3 -0
  21. package/dist/compiler/runtime-state.d.ts +17 -0
  22. package/dist/compiler-B0YSc0DY.js +4877 -0
  23. package/dist/{wxml-o-CUulAM.cjs → compiler-SwMb3lOX.cjs} +3649 -283
  24. package/dist/core.cjs +6 -3
  25. package/dist/core.d.ts +2 -0
  26. package/dist/core.js +4 -4
  27. package/dist/defaults-B5ep0ojb.js +120 -0
  28. package/dist/defaults-BI9j1znS.cjs +156 -0
  29. package/dist/defaults.cjs +5 -121
  30. package/dist/defaults.js +1 -116
  31. package/dist/final-css-cleanup-BMlUDzik.cjs +112 -0
  32. package/dist/final-css-cleanup-CmVYbXPr.js +282 -0
  33. package/dist/{generator-WlhrtNa3.cjs → generator-DsrQ9txU.cjs} +62 -5
  34. package/dist/{generator-BjK5PRR-.js → generator-DyXTBPmE.js} +47 -2
  35. package/dist/generator.cjs +1 -1
  36. package/dist/generator.js +1 -1
  37. package/dist/{gulp-D6LcfRz_.js → gulp-CVUiPXPy.js} +7 -7
  38. package/dist/{gulp-ChecVI6A.cjs → gulp-Dtc01FdI.cjs} +30 -28
  39. package/dist/gulp.cjs +1 -1
  40. package/dist/gulp.js +1 -1
  41. package/dist/{hmr-timing-afnWvy7u.cjs → hmr-timing-3SdRVfZx.cjs} +6 -229
  42. package/dist/{hmr-timing-CqDfjvqE.js → hmr-timing-DNxQm-bN.js} +6 -1258
  43. package/dist/index.cjs +4 -4
  44. package/dist/index.js +4 -4
  45. package/dist/{pipeline-helpers-DxPFMGxz.cjs → pipeline-helpers-DVrgv1HS.cjs} +6 -5
  46. package/dist/postcss.cjs +1 -1
  47. package/dist/postcss.js +1 -1
  48. package/dist/presets.cjs +4 -4
  49. package/dist/presets.js +2 -2
  50. package/dist/rspack.cjs +2 -2
  51. package/dist/rspack.js +2 -2
  52. package/dist/runtime-state-BBQcA0n5.cjs +54 -0
  53. package/dist/{source-candidate-scan-signature-FywFU3Rg.cjs → scoped-generator-B7thnzzm.cjs} +5 -123
  54. package/dist/{source-candidate-scan-signature-BVScymyM.js → scoped-generator-kRj_5Axx.js} +4 -92
  55. package/dist/source-candidate-scan-signature-B7cUxqqX.cjs +129 -0
  56. package/dist/source-candidate-scan-signature-CsP4BQNa.js +92 -0
  57. package/dist/style-injector/internal.d.ts +1 -1
  58. package/dist/style-injector/vite-web.d.ts +3 -0
  59. package/dist/{tailwindcss-9xmoCkaR.js → tailwindcss-BK9S7zuq.js} +1 -2
  60. package/dist/{tailwindcss-D3jltF7M.cjs → tailwindcss-C-jBBQfw.cjs} +8 -9
  61. package/dist/{transform-DQhgAarN.js → transform-C0rWZblB.js} +3 -3
  62. package/dist/{transform-C6k9zTQR.cjs → transform-C7QxW-fV.cjs} +27 -27
  63. package/dist/{v4-generation-core-CPKNwzjz.cjs → v4-generation-core-DuIVZvRz.cjs} +29 -1172
  64. package/dist/vite/web.cjs +27 -0
  65. package/dist/vite/web.d.ts +1 -0
  66. package/dist/vite/web.js +25 -0
  67. package/dist/{vite-D3aCtpmv.js → vite-0PsttwuR.js} +241 -3581
  68. package/dist/{vite-D-gmOkPN.cjs → vite-CJbO-7AQ.cjs} +494 -3794
  69. package/dist/vite-web.d.ts +4 -0
  70. package/dist/vite.cjs +1 -1
  71. package/dist/vite.js +1 -1
  72. package/dist/weapp-tw-css-generation-loader.cjs +1 -1
  73. package/dist/weapp-tw-css-import-rewrite-loader.cjs +5 -5
  74. package/dist/web-BFOkkJ-8.cjs +4357 -0
  75. package/dist/web-D8HSs56R.js +3792 -0
  76. package/dist/{webpack-yAne9ZYu.cjs → webpack-BWknqSDV.cjs} +51 -49
  77. package/dist/{webpack-B-6a8Z8F.js → webpack-DVtKeBq1.js} +13 -12
  78. package/dist/webpack.cjs +1 -1
  79. package/dist/webpack.js +1 -1
  80. package/package.json +12 -3
  81. package/dist/cache-options-DavPxrhC.cjs +0 -16
  82. package/dist/cache-options-DwBtLwQe.js +0 -5
  83. package/dist/compiler-B-m9VGqj.cjs +0 -2316
  84. package/dist/compiler-BgMj2E5l.js +0 -2051
  85. package/dist/local-style-matcher-DRpFEu1s.cjs +0 -34
  86. package/dist/local-style-matcher-DsiI2wIc.js +0 -17
  87. package/dist/object-B-8IHefx.js +0 -47
  88. package/dist/object-DbHtAXRk.cjs +0 -58
  89. package/dist/wxml-CvKyV69S.js +0 -1822
@@ -1,8 +1,18 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
2
- const require_object = require("./object-DbHtAXRk.cjs");
3
- const require_cache_options = require("./cache-options-DavPxrhC.cjs");
2
+ const require_framework = require("./framework.cjs");
3
+ const require_generator = require("./generator-DsrQ9txU.cjs");
4
+ const require_tailwindcss = require("./tailwindcss-C-jBBQfw.cjs");
5
+ require("./utils-CuKLf1Zv.cjs");
6
+ const require_defaults = require("./defaults-BI9j1znS.cjs");
7
+ let node_path = require("node:path");
8
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
9
+ let node_process = require("node:process");
10
+ node_process = require_rolldown_runtime.__toESM(node_process, 1);
4
11
  let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
12
+ let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
5
13
  let lru_cache = require("lru-cache");
14
+ let node_module = require("node:module");
15
+ let node_fs_promises = require("node:fs/promises");
6
16
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
7
17
  let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
8
18
  let node_tty = require("node:tty");
@@ -10,6 +20,8 @@ let node_util = require("node:util");
10
20
  let debug = require("debug");
11
21
  debug = require_rolldown_runtime.__toESM(debug, 1);
12
22
  let _weapp_core_escape = require("@weapp-core/escape");
23
+ let node_buffer = require("node:buffer");
24
+ let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
13
25
  //#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode-codepoint.js
14
26
  const decodeMap = /* @__PURE__ */ new Map([
15
27
  [0, 65533],
@@ -159,22 +171,22 @@ var DecodingMode;
159
171
  */
160
172
  var EntityDecoder = class {
161
173
  constructor(decodeTree, emitCodePoint, errors) {
162
- require_object._defineProperty(this, "decodeTree", void 0);
163
- require_object._defineProperty(this, "emitCodePoint", void 0);
164
- require_object._defineProperty(this, "errors", void 0);
165
- require_object._defineProperty(
174
+ require_generator._defineProperty(this, "decodeTree", void 0);
175
+ require_generator._defineProperty(this, "emitCodePoint", void 0);
176
+ require_generator._defineProperty(this, "errors", void 0);
177
+ require_generator._defineProperty(
166
178
  this,
167
179
  /** The current state of the decoder. */
168
180
  "state",
169
181
  EntityDecoderState.EntityStart
170
182
  );
171
- require_object._defineProperty(
183
+ require_generator._defineProperty(
172
184
  this,
173
185
  /** Characters that were consumed while parsing an entity. */
174
186
  "consumed",
175
187
  1
176
188
  );
177
- require_object._defineProperty(
189
+ require_generator._defineProperty(
178
190
  this,
179
191
  /**
180
192
  * The result of the entity.
@@ -185,25 +197,25 @@ var EntityDecoder = class {
185
197
  "result",
186
198
  0
187
199
  );
188
- require_object._defineProperty(
200
+ require_generator._defineProperty(
189
201
  this,
190
202
  /** The current index in the decode tree. */
191
203
  "treeIndex",
192
204
  0
193
205
  );
194
- require_object._defineProperty(
206
+ require_generator._defineProperty(
195
207
  this,
196
208
  /** The number of characters that were consumed in excess. */
197
209
  "excess",
198
210
  1
199
211
  );
200
- require_object._defineProperty(
212
+ require_generator._defineProperty(
201
213
  this,
202
214
  /** The mode in which the decoder is operating. */
203
215
  "decodeMode",
204
216
  DecodingMode.Strict
205
217
  );
206
- require_object._defineProperty(
218
+ require_generator._defineProperty(
207
219
  this,
208
220
  /** The number of characters that have been consumed in the current run. */
209
221
  "runConsumed",
@@ -696,67 +708,67 @@ const specialStartSequences = /* @__PURE__ */ new Map([
696
708
  */
697
709
  var Tokenizer$2 = class {
698
710
  constructor({ xmlMode = false, decodeEntities = true, recognizeSelfClosing = xmlMode }, cbs) {
699
- require_object._defineProperty(this, "cbs", void 0);
700
- require_object._defineProperty(
711
+ require_generator._defineProperty(this, "cbs", void 0);
712
+ require_generator._defineProperty(
701
713
  this,
702
714
  /** The current state the tokenizer is in. */
703
715
  "state",
704
716
  State$1.Text
705
717
  );
706
- require_object._defineProperty(
718
+ require_generator._defineProperty(
707
719
  this,
708
720
  /** The read buffer. */
709
721
  "buffer",
710
722
  ""
711
723
  );
712
- require_object._defineProperty(
724
+ require_generator._defineProperty(
713
725
  this,
714
726
  /** The beginning of the section that is currently being read. */
715
727
  "sectionStart",
716
728
  0
717
729
  );
718
- require_object._defineProperty(
730
+ require_generator._defineProperty(
719
731
  this,
720
732
  /** The index within the buffer that we are currently looking at. */
721
733
  "index",
722
734
  0
723
735
  );
724
- require_object._defineProperty(
736
+ require_generator._defineProperty(
725
737
  this,
726
738
  /** The start of the last entity. */
727
739
  "entityStart",
728
740
  0
729
741
  );
730
- require_object._defineProperty(
742
+ require_generator._defineProperty(
731
743
  this,
732
744
  /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
733
745
  "baseState",
734
746
  State$1.Text
735
747
  );
736
- require_object._defineProperty(
748
+ require_generator._defineProperty(
737
749
  this,
738
750
  /** For special parsing behavior inside of script and style tags. */
739
751
  "isSpecial",
740
752
  false
741
753
  );
742
- require_object._defineProperty(
754
+ require_generator._defineProperty(
743
755
  this,
744
756
  /** Indicates whether the tokenizer has been paused. */
745
757
  "running",
746
758
  true
747
759
  );
748
- require_object._defineProperty(
760
+ require_generator._defineProperty(
749
761
  this,
750
762
  /** The offset of the current buffer. */
751
763
  "offset",
752
764
  0
753
765
  );
754
- require_object._defineProperty(this, "xmlMode", void 0);
755
- require_object._defineProperty(this, "decodeEntities", void 0);
756
- require_object._defineProperty(this, "recognizeSelfClosing", void 0);
757
- require_object._defineProperty(this, "entityDecoder", void 0);
758
- require_object._defineProperty(this, "currentSequence", Sequences.Empty);
759
- require_object._defineProperty(this, "sequenceIndex", 0);
766
+ require_generator._defineProperty(this, "xmlMode", void 0);
767
+ require_generator._defineProperty(this, "decodeEntities", void 0);
768
+ require_generator._defineProperty(this, "recognizeSelfClosing", void 0);
769
+ require_generator._defineProperty(this, "entityDecoder", void 0);
770
+ require_generator._defineProperty(this, "currentSequence", Sequences.Empty);
771
+ require_generator._defineProperty(this, "sequenceIndex", 0);
760
772
  this.cbs = cbs;
761
773
  this.xmlMode = xmlMode;
762
774
  this.decodeEntities = decodeEntities;
@@ -1587,20 +1599,20 @@ const reNameEnd = /\s|\//;
1587
1599
  */
1588
1600
  var Parser$1 = class {
1589
1601
  constructor(cbs, options = {}) {
1590
- require_object._defineProperty(this, "options", void 0);
1591
- require_object._defineProperty(
1602
+ require_generator._defineProperty(this, "options", void 0);
1603
+ require_generator._defineProperty(
1592
1604
  this,
1593
1605
  /** The start index of the last event. */
1594
1606
  "startIndex",
1595
1607
  0
1596
1608
  );
1597
- require_object._defineProperty(
1609
+ require_generator._defineProperty(
1598
1610
  this,
1599
1611
  /** The end index of the last event. */
1600
1612
  "endIndex",
1601
1613
  0
1602
1614
  );
1603
- require_object._defineProperty(
1615
+ require_generator._defineProperty(
1604
1616
  this,
1605
1617
  /**
1606
1618
  * Store the start index of the current open tag,
@@ -1609,32 +1621,32 @@ var Parser$1 = class {
1609
1621
  "openTagStart",
1610
1622
  0
1611
1623
  );
1612
- require_object._defineProperty(this, "tagname", "");
1613
- require_object._defineProperty(this, "attribname", "");
1614
- require_object._defineProperty(this, "attribvalue", "");
1615
- require_object._defineProperty(this, "attribs", null);
1616
- require_object._defineProperty(this, "stack", []);
1617
- require_object._defineProperty(this, "foreignContext", void 0);
1618
- require_object._defineProperty(this, "cbs", void 0);
1619
- require_object._defineProperty(this, "lowerCaseTagNames", void 0);
1620
- require_object._defineProperty(this, "lowerCaseAttributeNames", void 0);
1621
- require_object._defineProperty(this, "recognizeSelfClosing", void 0);
1622
- require_object._defineProperty(
1624
+ require_generator._defineProperty(this, "tagname", "");
1625
+ require_generator._defineProperty(this, "attribname", "");
1626
+ require_generator._defineProperty(this, "attribvalue", "");
1627
+ require_generator._defineProperty(this, "attribs", null);
1628
+ require_generator._defineProperty(this, "stack", []);
1629
+ require_generator._defineProperty(this, "foreignContext", void 0);
1630
+ require_generator._defineProperty(this, "cbs", void 0);
1631
+ require_generator._defineProperty(this, "lowerCaseTagNames", void 0);
1632
+ require_generator._defineProperty(this, "lowerCaseAttributeNames", void 0);
1633
+ require_generator._defineProperty(this, "recognizeSelfClosing", void 0);
1634
+ require_generator._defineProperty(
1623
1635
  this,
1624
1636
  /** We are parsing HTML. Inverse of the `xmlMode` option. */
1625
1637
  "htmlMode",
1626
1638
  void 0
1627
1639
  );
1628
- require_object._defineProperty(this, "tokenizer", void 0);
1629
- require_object._defineProperty(this, "buffers", []);
1630
- require_object._defineProperty(this, "bufferOffset", 0);
1631
- require_object._defineProperty(
1640
+ require_generator._defineProperty(this, "tokenizer", void 0);
1641
+ require_generator._defineProperty(this, "buffers", []);
1642
+ require_generator._defineProperty(this, "bufferOffset", 0);
1643
+ require_generator._defineProperty(
1632
1644
  this,
1633
1645
  /** The index of the last written buffer. Used when resuming after a `pause()`. */
1634
1646
  "writeIndex",
1635
1647
  0
1636
1648
  );
1637
- require_object._defineProperty(
1649
+ require_generator._defineProperty(
1638
1650
  this,
1639
1651
  /** Indicates whether the parser has finished running / `.end` has been called. */
1640
1652
  "ended",
@@ -4190,7 +4202,7 @@ var lib_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
4190
4202
  isModuleExpression: () => isModuleExpression,
4191
4203
  isModuleSpecifier: () => isModuleSpecifier$1,
4192
4204
  isNewExpression: () => isNewExpression$2,
4193
- isNode: () => isNode,
4205
+ isNode: () => isNode$1,
4194
4206
  isNodesEquivalent: () => isNodesEquivalent,
4195
4207
  isNullLiteral: () => isNullLiteral$1,
4196
4208
  isNullLiteralTypeAnnotation: () => isNullLiteralTypeAnnotation,
@@ -13531,11 +13543,11 @@ function buildChildren(node) {
13531
13543
  }
13532
13544
  return elements;
13533
13545
  }
13534
- function isNode(node) {
13546
+ function isNode$1(node) {
13535
13547
  return !!(node && VISITOR_KEYS$6[node.type]);
13536
13548
  }
13537
13549
  function assertNode(node) {
13538
- if (!isNode(node)) {
13550
+ if (!isNode$1(node)) {
13539
13551
  const type = node?.type ?? JSON.stringify(node);
13540
13552
  throw new TypeError(`Not a valid node of type "${type}"`);
13541
13553
  }
@@ -15279,10 +15291,10 @@ var Position = class {
15279
15291
  };
15280
15292
  var SourceLocation = class {
15281
15293
  constructor(start, end) {
15282
- require_object._defineProperty(this, "start", void 0);
15283
- require_object._defineProperty(this, "end", void 0);
15284
- require_object._defineProperty(this, "filename", void 0);
15285
- require_object._defineProperty(this, "identifierName", void 0);
15294
+ require_generator._defineProperty(this, "start", void 0);
15295
+ require_generator._defineProperty(this, "end", void 0);
15296
+ require_generator._defineProperty(this, "filename", void 0);
15297
+ require_generator._defineProperty(this, "identifierName", void 0);
15286
15298
  this.start = start;
15287
15299
  this.end = end;
15288
15300
  }
@@ -15917,16 +15929,16 @@ const prefix = true;
15917
15929
  const postfix = true;
15918
15930
  var ExportedTokenType = class {
15919
15931
  constructor(label, conf = {}) {
15920
- require_object._defineProperty(this, "label", void 0);
15921
- require_object._defineProperty(this, "keyword", void 0);
15922
- require_object._defineProperty(this, "beforeExpr", void 0);
15923
- require_object._defineProperty(this, "startsExpr", void 0);
15924
- require_object._defineProperty(this, "rightAssociative", void 0);
15925
- require_object._defineProperty(this, "isLoop", void 0);
15926
- require_object._defineProperty(this, "isAssign", void 0);
15927
- require_object._defineProperty(this, "prefix", void 0);
15928
- require_object._defineProperty(this, "postfix", void 0);
15929
- require_object._defineProperty(this, "binop", void 0);
15932
+ require_generator._defineProperty(this, "label", void 0);
15933
+ require_generator._defineProperty(this, "keyword", void 0);
15934
+ require_generator._defineProperty(this, "beforeExpr", void 0);
15935
+ require_generator._defineProperty(this, "startsExpr", void 0);
15936
+ require_generator._defineProperty(this, "rightAssociative", void 0);
15937
+ require_generator._defineProperty(this, "isLoop", void 0);
15938
+ require_generator._defineProperty(this, "isAssign", void 0);
15939
+ require_generator._defineProperty(this, "prefix", void 0);
15940
+ require_generator._defineProperty(this, "postfix", void 0);
15941
+ require_generator._defineProperty(this, "binop", void 0);
15930
15942
  this.label = label;
15931
15943
  this.keyword = conf.keyword;
15932
15944
  this.beforeExpr = !!conf.beforeExpr;
@@ -16269,8 +16281,8 @@ function getExportedToken(token) {
16269
16281
  }
16270
16282
  var TokContext = class {
16271
16283
  constructor(token, preserveSpace) {
16272
- require_object._defineProperty(this, "token", void 0);
16273
- require_object._defineProperty(this, "preserveSpace", void 0);
16284
+ require_generator._defineProperty(this, "token", void 0);
16285
+ require_generator._defineProperty(this, "preserveSpace", void 0);
16274
16286
  this.token = token;
16275
16287
  this.preserveSpace = !!preserveSpace;
16276
16288
  }
@@ -16492,18 +16504,18 @@ function canBeReservedWord(word) {
16492
16504
  }
16493
16505
  var Scope$1 = class {
16494
16506
  constructor(flags) {
16495
- require_object._defineProperty(this, "flags", 0);
16496
- require_object._defineProperty(this, "names", /* @__PURE__ */ new Map());
16497
- require_object._defineProperty(this, "firstLexicalName", "");
16507
+ require_generator._defineProperty(this, "flags", 0);
16508
+ require_generator._defineProperty(this, "names", /* @__PURE__ */ new Map());
16509
+ require_generator._defineProperty(this, "firstLexicalName", "");
16498
16510
  this.flags = flags;
16499
16511
  }
16500
16512
  };
16501
16513
  var ScopeHandler = class {
16502
16514
  constructor(parser, inModule) {
16503
- require_object._defineProperty(this, "parser", void 0);
16504
- require_object._defineProperty(this, "scopeStack", []);
16505
- require_object._defineProperty(this, "inModule", void 0);
16506
- require_object._defineProperty(this, "undefinedExports", /* @__PURE__ */ new Map());
16515
+ require_generator._defineProperty(this, "parser", void 0);
16516
+ require_generator._defineProperty(this, "scopeStack", []);
16517
+ require_generator._defineProperty(this, "inModule", void 0);
16518
+ require_generator._defineProperty(this, "undefinedExports", /* @__PURE__ */ new Map());
16507
16519
  this.parser = parser;
16508
16520
  this.inModule = inModule;
16509
16521
  }
@@ -16614,7 +16626,7 @@ var ScopeHandler = class {
16614
16626
  var FlowScope = class extends Scope$1 {
16615
16627
  constructor(..._args) {
16616
16628
  super(..._args);
16617
- require_object._defineProperty(this, "declareFunctions", /* @__PURE__ */ new Set());
16629
+ require_generator._defineProperty(this, "declareFunctions", /* @__PURE__ */ new Set());
16618
16630
  }
16619
16631
  };
16620
16632
  var FlowScopeHandler = class extends ScopeHandler {
@@ -16732,7 +16744,7 @@ const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
16732
16744
  const flow = (superClass) => class FlowParserMixin extends superClass {
16733
16745
  constructor(..._args2) {
16734
16746
  super(..._args2);
16735
- require_object._defineProperty(this, "flowPragma", void 0);
16747
+ require_generator._defineProperty(this, "flowPragma", void 0);
16736
16748
  }
16737
16749
  getScopeHandler() {
16738
16750
  return FlowScopeHandler;
@@ -19192,13 +19204,13 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
19192
19204
  var TypeScriptScope = class extends Scope$1 {
19193
19205
  constructor(..._args3) {
19194
19206
  super(..._args3);
19195
- require_object._defineProperty(this, "tsNames", /* @__PURE__ */ new Map());
19207
+ require_generator._defineProperty(this, "tsNames", /* @__PURE__ */ new Map());
19196
19208
  }
19197
19209
  };
19198
19210
  var TypeScriptScopeHandler = class extends ScopeHandler {
19199
19211
  constructor(..._args4) {
19200
19212
  super(..._args4);
19201
- require_object._defineProperty(this, "importsStack", []);
19213
+ require_generator._defineProperty(this, "importsStack", []);
19202
19214
  }
19203
19215
  get inTSNamespace() {
19204
19216
  const scopeStack = this.scopeStack;
@@ -19277,8 +19289,8 @@ var TypeScriptScopeHandler = class extends ScopeHandler {
19277
19289
  };
19278
19290
  var BaseParser = class {
19279
19291
  constructor() {
19280
- require_object._defineProperty(this, "sawUnambiguousESM", false);
19281
- require_object._defineProperty(this, "ambiguousScriptDifferentAst", false);
19292
+ require_generator._defineProperty(this, "sawUnambiguousESM", false);
19293
+ require_generator._defineProperty(this, "ambiguousScriptDifferentAst", false);
19282
19294
  }
19283
19295
  sourceToOffsetPos(sourcePos) {
19284
19296
  return sourcePos + this.startIndex;
@@ -19428,29 +19440,29 @@ var CommentsParser = class extends BaseParser {
19428
19440
  };
19429
19441
  var State = class State {
19430
19442
  constructor() {
19431
- require_object._defineProperty(this, "flags", 2048);
19432
- require_object._defineProperty(this, "startIndex", void 0);
19433
- require_object._defineProperty(this, "curLine", void 0);
19434
- require_object._defineProperty(this, "lineStart", void 0);
19435
- require_object._defineProperty(this, "startLoc", void 0);
19436
- require_object._defineProperty(this, "endLoc", void 0);
19437
- require_object._defineProperty(this, "errors", []);
19438
- require_object._defineProperty(this, "noArrowAt", []);
19439
- require_object._defineProperty(this, "noArrowParamsConversionAt", []);
19440
- require_object._defineProperty(this, "labels", []);
19441
- require_object._defineProperty(this, "commentsLen", 0);
19442
- require_object._defineProperty(this, "commentStack", []);
19443
- require_object._defineProperty(this, "pos", 0);
19444
- require_object._defineProperty(this, "type", 135);
19445
- require_object._defineProperty(this, "value", null);
19446
- require_object._defineProperty(this, "start", 0);
19447
- require_object._defineProperty(this, "end", 0);
19448
- require_object._defineProperty(this, "lastTokEndLoc", null);
19449
- require_object._defineProperty(this, "lastTokStartLoc", null);
19450
- require_object._defineProperty(this, "context", [types.brace]);
19451
- require_object._defineProperty(this, "firstInvalidTemplateEscapePos", null);
19452
- require_object._defineProperty(this, "strictErrors", /* @__PURE__ */ new Map());
19453
- require_object._defineProperty(this, "tokensLength", 0);
19443
+ require_generator._defineProperty(this, "flags", 2048);
19444
+ require_generator._defineProperty(this, "startIndex", void 0);
19445
+ require_generator._defineProperty(this, "curLine", void 0);
19446
+ require_generator._defineProperty(this, "lineStart", void 0);
19447
+ require_generator._defineProperty(this, "startLoc", void 0);
19448
+ require_generator._defineProperty(this, "endLoc", void 0);
19449
+ require_generator._defineProperty(this, "errors", []);
19450
+ require_generator._defineProperty(this, "noArrowAt", []);
19451
+ require_generator._defineProperty(this, "noArrowParamsConversionAt", []);
19452
+ require_generator._defineProperty(this, "labels", []);
19453
+ require_generator._defineProperty(this, "commentsLen", 0);
19454
+ require_generator._defineProperty(this, "commentStack", []);
19455
+ require_generator._defineProperty(this, "pos", 0);
19456
+ require_generator._defineProperty(this, "type", 135);
19457
+ require_generator._defineProperty(this, "value", null);
19458
+ require_generator._defineProperty(this, "start", 0);
19459
+ require_generator._defineProperty(this, "end", 0);
19460
+ require_generator._defineProperty(this, "lastTokEndLoc", null);
19461
+ require_generator._defineProperty(this, "lastTokStartLoc", null);
19462
+ require_generator._defineProperty(this, "context", [types.brace]);
19463
+ require_generator._defineProperty(this, "firstInvalidTemplateEscapePos", null);
19464
+ require_generator._defineProperty(this, "strictErrors", /* @__PURE__ */ new Map());
19465
+ require_generator._defineProperty(this, "tokensLength", 0);
19454
19466
  }
19455
19467
  get strict() {
19456
19468
  return (this.flags & 1) > 0;
@@ -19842,9 +19854,9 @@ let locDataCache;
19842
19854
  var Tokenizer$1 = class extends CommentsParser {
19843
19855
  constructor(options, input) {
19844
19856
  super();
19845
- require_object._defineProperty(this, "isLookahead", void 0);
19846
- require_object._defineProperty(this, "tokens", []);
19847
- require_object._defineProperty(this, "errorHandlers_readInt", {
19857
+ require_generator._defineProperty(this, "isLookahead", void 0);
19858
+ require_generator._defineProperty(this, "tokens", []);
19859
+ require_generator._defineProperty(this, "errorHandlers_readInt", {
19848
19860
  invalidDigit: (pos, lineStart, curLine, radix) => {
19849
19861
  if (!(this.optionFlags & 4096)) return false;
19850
19862
  this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { radix });
@@ -19853,12 +19865,12 @@ var Tokenizer$1 = class extends CommentsParser {
19853
19865
  numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
19854
19866
  unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)
19855
19867
  });
19856
- require_object._defineProperty(this, "errorHandlers_readCodePoint", {
19868
+ require_generator._defineProperty(this, "errorHandlers_readCodePoint", {
19857
19869
  ...this.errorHandlers_readInt,
19858
19870
  invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
19859
19871
  invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)
19860
19872
  });
19861
- require_object._defineProperty(this, "errorHandlers_readStringContents_string", {
19873
+ require_generator._defineProperty(this, "errorHandlers_readStringContents_string", {
19862
19874
  ...this.errorHandlers_readCodePoint,
19863
19875
  strictNumericEscape: (pos, lineStart, curLine) => {
19864
19876
  this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
@@ -19867,7 +19879,7 @@ var Tokenizer$1 = class extends CommentsParser {
19867
19879
  throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
19868
19880
  }
19869
19881
  });
19870
- require_object._defineProperty(this, "errorHandlers_readStringContents_template", {
19882
+ require_generator._defineProperty(this, "errorHandlers_readStringContents_template", {
19871
19883
  ...this.errorHandlers_readCodePoint,
19872
19884
  strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
19873
19885
  unterminated: (pos, lineStart, curLine) => {
@@ -20638,15 +20650,15 @@ var Tokenizer$1 = class extends CommentsParser {
20638
20650
  };
20639
20651
  var ClassScope = class {
20640
20652
  constructor() {
20641
- require_object._defineProperty(this, "privateNames", /* @__PURE__ */ new Set());
20642
- require_object._defineProperty(this, "loneAccessors", /* @__PURE__ */ new Map());
20643
- require_object._defineProperty(this, "undefinedPrivateNames", /* @__PURE__ */ new Map());
20653
+ require_generator._defineProperty(this, "privateNames", /* @__PURE__ */ new Set());
20654
+ require_generator._defineProperty(this, "loneAccessors", /* @__PURE__ */ new Map());
20655
+ require_generator._defineProperty(this, "undefinedPrivateNames", /* @__PURE__ */ new Map());
20644
20656
  }
20645
20657
  };
20646
20658
  var ClassScopeHandler = class {
20647
20659
  constructor(parser) {
20648
- require_object._defineProperty(this, "parser", void 0);
20649
- require_object._defineProperty(this, "stack", []);
20660
+ require_generator._defineProperty(this, "parser", void 0);
20661
+ require_generator._defineProperty(this, "stack", []);
20650
20662
  this.parser = parser;
20651
20663
  }
20652
20664
  current() {
@@ -20699,7 +20711,7 @@ var ExpressionScope = class {
20699
20711
  var ArrowHeadParsingScope = class extends ExpressionScope {
20700
20712
  constructor(type) {
20701
20713
  super(type);
20702
- require_object._defineProperty(this, "declarationErrors", /* @__PURE__ */ new Map());
20714
+ require_generator._defineProperty(this, "declarationErrors", /* @__PURE__ */ new Map());
20703
20715
  }
20704
20716
  recordDeclarationError(ParsingErrorClass, index) {
20705
20717
  this.declarationErrors.set(index, ParsingErrorClass);
@@ -20713,8 +20725,8 @@ var ArrowHeadParsingScope = class extends ExpressionScope {
20713
20725
  };
20714
20726
  var ExpressionScopeHandler = class {
20715
20727
  constructor(parser) {
20716
- require_object._defineProperty(this, "parser", void 0);
20717
- require_object._defineProperty(this, "stack", [new ExpressionScope()]);
20728
+ require_generator._defineProperty(this, "parser", void 0);
20729
+ require_generator._defineProperty(this, "stack", [new ExpressionScope()]);
20718
20730
  this.parser = parser;
20719
20731
  }
20720
20732
  enter(scope) {
@@ -20780,7 +20792,7 @@ function newExpressionScope() {
20780
20792
  }
20781
20793
  var ProductionParameterHandler = class {
20782
20794
  constructor() {
20783
- require_object._defineProperty(this, "stacks", []);
20795
+ require_generator._defineProperty(this, "stacks", []);
20784
20796
  }
20785
20797
  enter(flags) {
20786
20798
  this.stacks.push(flags);
@@ -20990,16 +21002,16 @@ var UtilParser = class extends Tokenizer$1 {
20990
21002
  };
20991
21003
  var ExpressionErrors = class {
20992
21004
  constructor() {
20993
- require_object._defineProperty(this, "shorthandAssignLoc", null);
20994
- require_object._defineProperty(this, "doubleProtoLoc", null);
20995
- require_object._defineProperty(this, "privateKeyLoc", null);
20996
- require_object._defineProperty(this, "optionalParametersLoc", null);
20997
- require_object._defineProperty(this, "voidPatternLoc", null);
21005
+ require_generator._defineProperty(this, "shorthandAssignLoc", null);
21006
+ require_generator._defineProperty(this, "doubleProtoLoc", null);
21007
+ require_generator._defineProperty(this, "privateKeyLoc", null);
21008
+ require_generator._defineProperty(this, "optionalParametersLoc", null);
21009
+ require_generator._defineProperty(this, "voidPatternLoc", null);
20998
21010
  }
20999
21011
  };
21000
21012
  var Node = class {
21001
21013
  constructor(optionFlags, filename, pos, loc) {
21002
- require_object._defineProperty(this, "type", "");
21014
+ require_generator._defineProperty(this, "type", "");
21003
21015
  this.start = pos;
21004
21016
  this.end = 0;
21005
21017
  if (loc !== void 0) this.loc = new SourceLocation(loc);
@@ -24104,7 +24116,7 @@ function tsIsEntityName(node) {
24104
24116
  const typescript = (superClass) => class TypeScriptParserMixin extends superClass {
24105
24117
  constructor(..._args5) {
24106
24118
  super(..._args5);
24107
- require_object._defineProperty(this, "tsParseInOutModifiers", this.tsParseModifiers.bind(this, {
24119
+ require_generator._defineProperty(this, "tsParseInOutModifiers", this.tsParseModifiers.bind(this, {
24108
24120
  allowedModifiers: ["in", "out"],
24109
24121
  disallowedModifiers: [
24110
24122
  "const",
@@ -24118,12 +24130,12 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
24118
24130
  ],
24119
24131
  errorTemplate: TSErrors.InvalidModifierOnTypeParameter
24120
24132
  }));
24121
- require_object._defineProperty(this, "tsParseConstModifier", this.tsParseModifiers.bind(this, {
24133
+ require_generator._defineProperty(this, "tsParseConstModifier", this.tsParseModifiers.bind(this, {
24122
24134
  allowedModifiers: ["const"],
24123
24135
  disallowedModifiers: ["in", "out"],
24124
24136
  errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
24125
24137
  }));
24126
- require_object._defineProperty(this, "tsParseInOutConstModifiers", this.tsParseModifiers.bind(this, {
24138
+ require_generator._defineProperty(this, "tsParseInOutConstModifiers", this.tsParseModifiers.bind(this, {
24127
24139
  allowedModifiers: [
24128
24140
  "in",
24129
24141
  "out",
@@ -26769,7 +26781,7 @@ var builtin_upper_default = [
26769
26781
  "WeakSet"
26770
26782
  ];
26771
26783
  //#endregion
26772
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
26784
+ //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
26773
26785
  var comma = ",".charCodeAt(0);
26774
26786
  var semicolon = ";".charCodeAt(0);
26775
26787
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -26780,7 +26792,7 @@ for (let i = 0; i < chars.length; i++) {
26780
26792
  intToChar[i] = c;
26781
26793
  charToInt[c] = i;
26782
26794
  }
26783
- function decodeInteger(reader, relative) {
26795
+ function decodeInteger(reader) {
26784
26796
  let value = 0;
26785
26797
  let shift = 0;
26786
26798
  let integer = 0;
@@ -26789,21 +26801,21 @@ function decodeInteger(reader, relative) {
26789
26801
  value |= (integer & 31) << shift;
26790
26802
  shift += 5;
26791
26803
  } while (integer & 32);
26792
- const shouldNegate = value & 1;
26793
- value >>>= 1;
26794
- if (shouldNegate) value = -2147483648 | -value;
26795
- return relative + value;
26796
- }
26797
- function encodeInteger(builder, num, relative) {
26798
- let delta = num - relative;
26799
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
26804
+ return value;
26805
+ }
26806
+ function decodeSign(num) {
26807
+ return num & 1 ? -2147483648 | -(num >>> 1) : num >>> 1;
26808
+ }
26809
+ function encodeInteger(builder, num) {
26800
26810
  do {
26801
- let clamped = delta & 31;
26802
- delta >>>= 5;
26803
- if (delta > 0) clamped |= 32;
26811
+ let clamped = num & 31;
26812
+ num >>>= 5;
26813
+ if (num > 0) clamped |= 32;
26804
26814
  builder.write(intToChar[clamped]);
26805
- } while (delta > 0);
26806
- return num;
26815
+ } while (num > 0);
26816
+ }
26817
+ function encodeSign(num) {
26818
+ return num < 0 ? -num << 1 | 1 : num << 1;
26807
26819
  }
26808
26820
  function hasMoreVlq(reader, max) {
26809
26821
  if (reader.pos >= max) return false;
@@ -26870,15 +26882,15 @@ function decode(mappings) {
26870
26882
  genColumn = 0;
26871
26883
  while (reader.pos < semi) {
26872
26884
  let seg;
26873
- genColumn = decodeInteger(reader, genColumn);
26885
+ genColumn += decodeSign(decodeInteger(reader));
26874
26886
  if (genColumn < lastCol) sorted = false;
26875
26887
  lastCol = genColumn;
26876
26888
  if (hasMoreVlq(reader, semi)) {
26877
- sourcesIndex = decodeInteger(reader, sourcesIndex);
26878
- sourceLine = decodeInteger(reader, sourceLine);
26879
- sourceColumn = decodeInteger(reader, sourceColumn);
26889
+ sourcesIndex += decodeSign(decodeInteger(reader));
26890
+ sourceLine += decodeSign(decodeInteger(reader));
26891
+ sourceColumn += decodeSign(decodeInteger(reader));
26880
26892
  if (hasMoreVlq(reader, semi)) {
26881
- namesIndex = decodeInteger(reader, namesIndex);
26893
+ namesIndex += decodeSign(decodeInteger(reader));
26882
26894
  seg = [
26883
26895
  genColumn,
26884
26896
  sourcesIndex,
@@ -26922,13 +26934,18 @@ function encode(decoded) {
26922
26934
  for (let j = 0; j < line.length; j++) {
26923
26935
  const segment = line[j];
26924
26936
  if (j > 0) writer.write(comma);
26925
- genColumn = encodeInteger(writer, segment[0], genColumn);
26937
+ encodeInteger(writer, encodeSign(segment[0] - genColumn));
26938
+ genColumn = segment[0];
26926
26939
  if (segment.length === 1) continue;
26927
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
26928
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
26929
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
26940
+ encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));
26941
+ encodeInteger(writer, encodeSign(segment[2] - sourceLine));
26942
+ encodeInteger(writer, encodeSign(segment[3] - sourceColumn));
26943
+ sourcesIndex = segment[1];
26944
+ sourceLine = segment[2];
26945
+ sourceColumn = segment[3];
26930
26946
  if (segment.length === 4) continue;
26931
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
26947
+ encodeInteger(writer, encodeSign(segment[4] - namesIndex));
26948
+ namesIndex = segment[4];
26932
26949
  }
26933
26950
  }
26934
26951
  return writer.flush();
@@ -27621,13 +27638,13 @@ var require_jsesc = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exp
27621
27638
  var import_jsesc = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_jsesc(), 1);
27622
27639
  var SourceMap$1 = class {
27623
27640
  constructor(opts, code) {
27624
- require_object._defineProperty(this, "_map", void 0);
27625
- require_object._defineProperty(this, "_rawMappings", void 0);
27626
- require_object._defineProperty(this, "_sourceFileName", void 0);
27627
- require_object._defineProperty(this, "_lastGenLine", 0);
27628
- require_object._defineProperty(this, "_lastSourceLine", 0);
27629
- require_object._defineProperty(this, "_lastSourceColumn", 0);
27630
- require_object._defineProperty(this, "_inputMap", null);
27641
+ require_generator._defineProperty(this, "_map", void 0);
27642
+ require_generator._defineProperty(this, "_rawMappings", void 0);
27643
+ require_generator._defineProperty(this, "_sourceFileName", void 0);
27644
+ require_generator._defineProperty(this, "_lastGenLine", 0);
27645
+ require_generator._defineProperty(this, "_lastSourceLine", 0);
27646
+ require_generator._defineProperty(this, "_lastSourceColumn", 0);
27647
+ require_generator._defineProperty(this, "_inputMap", null);
27631
27648
  const map = this._map = new GenMapping({ sourceRoot: opts.sourceRoot });
27632
27649
  this._sourceFileName = opts.sourceFileName?.replace(/\\/g, "/");
27633
27650
  this._rawMappings = void 0;
@@ -27680,21 +27697,21 @@ var SourceMap$1 = class {
27680
27697
  };
27681
27698
  const spaceIndents = [];
27682
27699
  for (let i = 0; i < 32; i++) spaceIndents.push(" ".repeat(i * 2));
27683
- var Buffer$1 = class {
27700
+ var Buffer$3 = class {
27684
27701
  constructor(map, indentChar) {
27685
- require_object._defineProperty(this, "_map", null);
27686
- require_object._defineProperty(this, "_buf", "");
27687
- require_object._defineProperty(this, "_str", "");
27688
- require_object._defineProperty(this, "_appendCount", 0);
27689
- require_object._defineProperty(this, "_last", 0);
27690
- require_object._defineProperty(this, "_canMarkIdName", true);
27691
- require_object._defineProperty(this, "_indentChar", "");
27692
- require_object._defineProperty(this, "_queuedChar", 0);
27693
- require_object._defineProperty(this, "_position", {
27702
+ require_generator._defineProperty(this, "_map", null);
27703
+ require_generator._defineProperty(this, "_buf", "");
27704
+ require_generator._defineProperty(this, "_str", "");
27705
+ require_generator._defineProperty(this, "_appendCount", 0);
27706
+ require_generator._defineProperty(this, "_last", 0);
27707
+ require_generator._defineProperty(this, "_canMarkIdName", true);
27708
+ require_generator._defineProperty(this, "_indentChar", "");
27709
+ require_generator._defineProperty(this, "_queuedChar", 0);
27710
+ require_generator._defineProperty(this, "_position", {
27694
27711
  line: 1,
27695
27712
  column: 0
27696
27713
  });
27697
- require_object._defineProperty(this, "_sourcePosition", {
27714
+ require_generator._defineProperty(this, "_sourcePosition", {
27698
27715
  identifierName: void 0,
27699
27716
  identifierNamePos: void 0,
27700
27717
  line: void 0,
@@ -30868,11 +30885,11 @@ function isLastChild(parent, child) {
30868
30885
  const { traverseFast: traverseFast$1, VISITOR_KEYS: VISITOR_KEYS$5 } = lib_exports;
30869
30886
  var TokenMap = class {
30870
30887
  constructor(ast, tokens, source) {
30871
- require_object._defineProperty(this, "_tokens", void 0);
30872
- require_object._defineProperty(this, "_source", void 0);
30873
- require_object._defineProperty(this, "_nodesToTokenIndexes", /* @__PURE__ */ new Map());
30874
- require_object._defineProperty(this, "_nodesOccurrencesCountCache", /* @__PURE__ */ new Map());
30875
- require_object._defineProperty(this, "_tokensCache", /* @__PURE__ */ new Map());
30888
+ require_generator._defineProperty(this, "_tokens", void 0);
30889
+ require_generator._defineProperty(this, "_source", void 0);
30890
+ require_generator._defineProperty(this, "_nodesToTokenIndexes", /* @__PURE__ */ new Map());
30891
+ require_generator._defineProperty(this, "_nodesOccurrencesCountCache", /* @__PURE__ */ new Map());
30892
+ require_generator._defineProperty(this, "_tokensCache", /* @__PURE__ */ new Map());
30876
30893
  this._tokens = tokens;
30877
30894
  this._source = source;
30878
30895
  traverseFast$1(ast, (node) => {
@@ -31032,31 +31049,31 @@ function commentIsNewline(c) {
31032
31049
  }
31033
31050
  var Printer = class {
31034
31051
  constructor(format, map, tokens = null, originalCode = null) {
31035
- require_object._defineProperty(this, "tokenContext", 0);
31036
- require_object._defineProperty(this, "_tokens", null);
31037
- require_object._defineProperty(this, "_originalCode", null);
31038
- require_object._defineProperty(this, "_currentNode", null);
31039
- require_object._defineProperty(this, "_currentTypeId", null);
31040
- require_object._defineProperty(this, "_indent", 0);
31041
- require_object._defineProperty(this, "_indentRepeat", 0);
31042
- require_object._defineProperty(this, "_insideAux", false);
31043
- require_object._defineProperty(this, "_noLineTerminator", false);
31044
- require_object._defineProperty(this, "_noLineTerminatorAfterNode", null);
31045
- require_object._defineProperty(this, "_printAuxAfterOnNextUserNode", false);
31046
- require_object._defineProperty(this, "_printedComments", /* @__PURE__ */ new Set());
31047
- require_object._defineProperty(this, "_lastCommentLine", 0);
31048
- require_object._defineProperty(this, "_innerCommentsState", 0);
31049
- require_object._defineProperty(this, "_flags", 0);
31050
- require_object._defineProperty(this, "tokenMap", null);
31051
- require_object._defineProperty(this, "_boundGetRawIdentifier", null);
31052
- require_object._defineProperty(this, "_printSemicolonBeforeNextNode", -1);
31053
- require_object._defineProperty(this, "_printSemicolonBeforeNextToken", -1);
31052
+ require_generator._defineProperty(this, "tokenContext", 0);
31053
+ require_generator._defineProperty(this, "_tokens", null);
31054
+ require_generator._defineProperty(this, "_originalCode", null);
31055
+ require_generator._defineProperty(this, "_currentNode", null);
31056
+ require_generator._defineProperty(this, "_currentTypeId", null);
31057
+ require_generator._defineProperty(this, "_indent", 0);
31058
+ require_generator._defineProperty(this, "_indentRepeat", 0);
31059
+ require_generator._defineProperty(this, "_insideAux", false);
31060
+ require_generator._defineProperty(this, "_noLineTerminator", false);
31061
+ require_generator._defineProperty(this, "_noLineTerminatorAfterNode", null);
31062
+ require_generator._defineProperty(this, "_printAuxAfterOnNextUserNode", false);
31063
+ require_generator._defineProperty(this, "_printedComments", /* @__PURE__ */ new Set());
31064
+ require_generator._defineProperty(this, "_lastCommentLine", 0);
31065
+ require_generator._defineProperty(this, "_innerCommentsState", 0);
31066
+ require_generator._defineProperty(this, "_flags", 0);
31067
+ require_generator._defineProperty(this, "tokenMap", null);
31068
+ require_generator._defineProperty(this, "_boundGetRawIdentifier", null);
31069
+ require_generator._defineProperty(this, "_printSemicolonBeforeNextNode", -1);
31070
+ require_generator._defineProperty(this, "_printSemicolonBeforeNextToken", -1);
31054
31071
  this.format = format;
31055
31072
  this._tokens = tokens;
31056
31073
  this._originalCode = originalCode;
31057
31074
  this._indentRepeat = format.indent.style.length;
31058
31075
  this._inputMap = map?._inputMap || null;
31059
- this._buf = new Buffer$1(map, format.indent.style[0]);
31076
+ this._buf = new Buffer$3(map, format.indent.style[0]);
31060
31077
  const { preserveFormat, compact, concise, retainLines, retainFunctionParens } = format;
31061
31078
  if (preserveFormat) this._flags |= 1;
31062
31079
  if (compact) this._flags |= 2;
@@ -32049,8 +32066,8 @@ const virtualTypes = /*#__PURE__*/ Object.defineProperty({
32049
32066
  }, Symbol.toStringTag, { value: "Module" });
32050
32067
  var TraversalContext = class {
32051
32068
  constructor(opts, state) {
32052
- require_object._defineProperty(this, "queue", null);
32053
- require_object._defineProperty(this, "priorityQueue", null);
32069
+ require_generator._defineProperty(this, "queue", null);
32070
+ require_generator._defineProperty(this, "priorityQueue", null);
32054
32071
  this.state = state;
32055
32072
  this.opts = opts;
32056
32073
  }
@@ -32520,15 +32537,15 @@ function traverseForScope(path, visitors, state) {
32520
32537
  }
32521
32538
  var Binding = class {
32522
32539
  constructor({ identifier, scope, path, kind }) {
32523
- require_object._defineProperty(this, "identifier", void 0);
32524
- require_object._defineProperty(this, "scope", void 0);
32525
- require_object._defineProperty(this, "path", void 0);
32526
- require_object._defineProperty(this, "kind", void 0);
32527
- require_object._defineProperty(this, "constantViolations", []);
32528
- require_object._defineProperty(this, "constant", true);
32529
- require_object._defineProperty(this, "referencePaths", []);
32530
- require_object._defineProperty(this, "referenced", false);
32531
- require_object._defineProperty(this, "references", 0);
32540
+ require_generator._defineProperty(this, "identifier", void 0);
32541
+ require_generator._defineProperty(this, "scope", void 0);
32542
+ require_generator._defineProperty(this, "path", void 0);
32543
+ require_generator._defineProperty(this, "kind", void 0);
32544
+ require_generator._defineProperty(this, "constantViolations", []);
32545
+ require_generator._defineProperty(this, "constant", true);
32546
+ require_generator._defineProperty(this, "referencePaths", []);
32547
+ require_generator._defineProperty(this, "referenced", false);
32548
+ require_generator._defineProperty(this, "references", 0);
32532
32549
  this.identifier = identifier;
32533
32550
  this.scope = scope;
32534
32551
  this.path = path;
@@ -32810,17 +32827,17 @@ let scopeVisitor;
32810
32827
  let uid = 0;
32811
32828
  var Scope = class Scope {
32812
32829
  constructor(path) {
32813
- require_object._defineProperty(this, "uid", void 0);
32814
- require_object._defineProperty(this, "path", void 0);
32815
- require_object._defineProperty(this, "block", void 0);
32816
- require_object._defineProperty(this, "inited", void 0);
32817
- require_object._defineProperty(this, "labels", void 0);
32818
- require_object._defineProperty(this, "bindings", void 0);
32819
- require_object._defineProperty(this, "referencesSet", void 0);
32820
- require_object._defineProperty(this, "globals", void 0);
32821
- require_object._defineProperty(this, "uidsSet", void 0);
32822
- require_object._defineProperty(this, "data", void 0);
32823
- require_object._defineProperty(this, "crawling", void 0);
32830
+ require_generator._defineProperty(this, "uid", void 0);
32831
+ require_generator._defineProperty(this, "path", void 0);
32832
+ require_generator._defineProperty(this, "block", void 0);
32833
+ require_generator._defineProperty(this, "inited", void 0);
32834
+ require_generator._defineProperty(this, "labels", void 0);
32835
+ require_generator._defineProperty(this, "bindings", void 0);
32836
+ require_generator._defineProperty(this, "referencesSet", void 0);
32837
+ require_generator._defineProperty(this, "globals", void 0);
32838
+ require_generator._defineProperty(this, "uidsSet", void 0);
32839
+ require_generator._defineProperty(this, "data", void 0);
32840
+ require_generator._defineProperty(this, "crawling", void 0);
32824
32841
  const { node } = path;
32825
32842
  const cached = scope.get(node);
32826
32843
  if (cached?.path === path) return cached;
@@ -33271,8 +33288,8 @@ var Scope = class Scope {
33271
33288
  }
33272
33289
  }
33273
33290
  };
33274
- require_object._defineProperty(Scope, "globals", [...builtin_lower_default, ...builtin_upper_default]);
33275
- require_object._defineProperty(Scope, "contextVariables", [
33291
+ require_generator._defineProperty(Scope, "globals", [...builtin_lower_default, ...builtin_upper_default]);
33292
+ require_generator._defineProperty(Scope, "contextVariables", [
33276
33293
  "arguments",
33277
33294
  "undefined",
33278
33295
  "Infinity",
@@ -35286,22 +35303,22 @@ function addComments(type, comments) {
35286
35303
  _addComments(this.node, type, comments);
35287
35304
  }
35288
35305
  const { validate } = lib_exports;
35289
- const debug$2 = createDebug$1("babel");
35306
+ const debug$3 = createDebug$1("babel");
35290
35307
  const REMOVED = 1;
35291
35308
  const SHOULD_SKIP = 4;
35292
35309
  const NodePath_Final = class NodePath {
35293
35310
  constructor(hub, parent) {
35294
- require_object._defineProperty(this, "contexts", []);
35295
- require_object._defineProperty(this, "state", null);
35296
- require_object._defineProperty(this, "_traverseFlags", 0);
35297
- require_object._defineProperty(this, "skipKeys", null);
35298
- require_object._defineProperty(this, "parentPath", null);
35299
- require_object._defineProperty(this, "container", null);
35300
- require_object._defineProperty(this, "listKey", null);
35301
- require_object._defineProperty(this, "key", null);
35302
- require_object._defineProperty(this, "node", null);
35303
- require_object._defineProperty(this, "type", null);
35304
- require_object._defineProperty(this, "_store", null);
35311
+ require_generator._defineProperty(this, "contexts", []);
35312
+ require_generator._defineProperty(this, "state", null);
35313
+ require_generator._defineProperty(this, "_traverseFlags", 0);
35314
+ require_generator._defineProperty(this, "skipKeys", null);
35315
+ require_generator._defineProperty(this, "parentPath", null);
35316
+ require_generator._defineProperty(this, "container", null);
35317
+ require_generator._defineProperty(this, "listKey", null);
35318
+ require_generator._defineProperty(this, "key", null);
35319
+ require_generator._defineProperty(this, "node", null);
35320
+ require_generator._defineProperty(this, "type", null);
35321
+ require_generator._defineProperty(this, "_store", null);
35305
35322
  this.parent = parent;
35306
35323
  this.hub = hub;
35307
35324
  this.data = null;
@@ -35379,8 +35396,8 @@ const NodePath_Final = class NodePath {
35379
35396
  return parts.join(".");
35380
35397
  }
35381
35398
  debug(message) {
35382
- if (!debug$2.enabled) return;
35383
- debug$2(`${this.getPathLocation()} ${this.type}: ${message}`);
35399
+ if (!debug$3.enabled) return;
35400
+ debug$3(`${this.getPathLocation()} ${this.type}: ${message}`);
35384
35401
  }
35385
35402
  toString() {
35386
35403
  return generate(this.node).code;
@@ -35735,17 +35752,17 @@ function createNameMatcher(list, { exact = false } = {}) {
35735
35752
  }
35736
35753
  //#endregion
35737
35754
  //#region src/js/babel/parse.ts
35738
- const parseCache = new lru_cache.LRUCache({ max: require_cache_options.HARD_PARSE_CACHE_MAX_ENTRIES });
35755
+ const parseCache = new lru_cache.LRUCache({ max: require_defaults.HARD_PARSE_CACHE_MAX_ENTRIES });
35739
35756
  function genCacheKey(source, options) {
35740
35757
  if (typeof options === "string") return `${(0, _weapp_tailwindcss_shared_node.md5)(source)}:${options}`;
35741
35758
  return `${(0, _weapp_tailwindcss_shared_node.md5)(source)}:${JSON.stringify(options, (_, val) => typeof val === "function" ? val.toString() : val)}`;
35742
35759
  }
35743
35760
  function normalizeCacheMaxEntries(value) {
35744
35761
  if (typeof value !== "number" || !Number.isFinite(value)) return 128;
35745
- return Math.min(Math.max(Math.floor(value), 0), require_cache_options.HARD_PARSE_CACHE_MAX_ENTRIES);
35762
+ return Math.min(Math.max(Math.floor(value), 0), require_defaults.HARD_PARSE_CACHE_MAX_ENTRIES);
35746
35763
  }
35747
35764
  function normalizeCacheMaxSourceLength(value) {
35748
- if (typeof value !== "number" || !Number.isFinite(value)) return require_cache_options.DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH;
35765
+ if (typeof value !== "number" || !Number.isFinite(value)) return require_defaults.DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH;
35749
35766
  return Math.max(Math.floor(value), 0);
35750
35767
  }
35751
35768
  function trimParseCache(maxEntries) {
@@ -35920,7 +35937,7 @@ var Chunk = class Chunk {
35920
35937
  var MagicStringError = class extends Error {
35921
35938
  constructor(message, options) {
35922
35939
  super(`[MagicString] ${message}`, options);
35923
- require_object._defineProperty(this, "name", "MagicStringError");
35940
+ require_generator._defineProperty(this, "name", "MagicStringError");
35924
35941
  }
35925
35942
  };
35926
35943
  function getBtoa() {
@@ -36896,17 +36913,17 @@ var MagicString = class MagicString {
36896
36913
  //#region src/debug/index.ts
36897
36914
  const _debug = (0, debug.default)("weapp-tw");
36898
36915
  function createDebug(prefix) {
36899
- const debug$3 = ((formatter, ...args) => {
36916
+ const debug$4 = ((formatter, ...args) => {
36900
36917
  return _debug((prefix ?? "") + formatter, ...args);
36901
36918
  });
36902
- Object.defineProperty(debug$3, "enabled", {
36919
+ Object.defineProperty(debug$4, "enabled", {
36903
36920
  enumerable: false,
36904
36921
  configurable: false,
36905
36922
  get() {
36906
36923
  return _debug.enabled;
36907
36924
  }
36908
36925
  });
36909
- return debug$3;
36926
+ return debug$4;
36910
36927
  }
36911
36928
  //#endregion
36912
36929
  //#region src/wxml/shared.ts
@@ -36918,7 +36935,7 @@ function replaceWxml(original, options = {
36918
36935
  const { keepEOL, escapeMap, ignoreHead } = options;
36919
36936
  let res = original;
36920
36937
  if (!keepEOL) res = res.replaceAll(NEWLINE_RE, "");
36921
- res = (0, _weapp_core_escape.escape)(res, require_object.omitUndefined({
36938
+ res = (0, _weapp_core_escape.escape)(res, require_generator.omitUndefined({
36922
36939
  map: escapeMap,
36923
36940
  ignoreHead
36924
36941
  }));
@@ -37140,7 +37157,7 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
37140
37157
  }
37141
37158
  //#endregion
37142
37159
  //#region src/js/handlers.ts
37143
- const debug$1 = createDebug("[js:handlers] ");
37160
+ const debug$2 = createDebug("[js:handlers] ");
37144
37161
  const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
37145
37162
  const IGNORE_MARKER = "ignore";
37146
37163
  function hasIgnoreComment(node) {
@@ -37233,7 +37250,7 @@ function replaceHandleValue(path, options) {
37233
37250
  const { literal, original, offset } = extractLiteralValue(path, options);
37234
37251
  const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
37235
37252
  if (candidates.length === 0) return;
37236
- const debugEnabled = debug$1.enabled;
37253
+ const debugEnabled = debug$2.enabled;
37237
37254
  const classContext = options.wrapExpression || isClassContextLiteralPath(path);
37238
37255
  let transformed = literal;
37239
37256
  let mutated = false;
@@ -37267,7 +37284,7 @@ function replaceHandleValue(path, options) {
37267
37284
  }
37268
37285
  const node = path.node;
37269
37286
  if (!mutated || typeof node.start !== "number" || typeof node.end !== "number") return;
37270
- if (debugEnabled) debug$1("runtimeSet size=%d candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s", classNameSet?.size ?? 0, candidates.length, matchedCandidateCount, escapedDecisionCount, skippedSamples?.length ?? 0, options.filename ?? "unknown", escapedSamples?.join(",") || "-", skippedSamples?.join(",") || "-");
37287
+ if (debugEnabled) debug$2("runtimeSet size=%d candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s", classNameSet?.size ?? 0, candidates.length, matchedCandidateCount, escapedDecisionCount, skippedSamples?.length ?? 0, options.filename ?? "unknown", escapedSamples?.join(",") || "-", skippedSamples?.join(",") || "-");
37271
37288
  const start = node.start + offset;
37272
37289
  const end = node.end - offset;
37273
37290
  if (start >= end || transformed === original) return;
@@ -37479,7 +37496,7 @@ function walkEvalExpression(path, options, updater, handler) {
37479
37496
  */
37480
37497
  var JsTokenUpdater = class {
37481
37498
  constructor({ value } = {}) {
37482
- require_object._defineProperty(this, "tokens", void 0);
37499
+ require_generator._defineProperty(this, "tokens", void 0);
37483
37500
  this.tokens = value ? [...value] : [];
37484
37501
  }
37485
37502
  addToken(token) {
@@ -37513,7 +37530,7 @@ var JsTokenUpdater = class {
37513
37530
  var IgnoredExportsTracker = class {
37514
37531
  constructor(options) {
37515
37532
  this.options = options;
37516
- require_object._defineProperty(this, "ignoredExportNames", /* @__PURE__ */ new Map());
37533
+ require_generator._defineProperty(this, "ignoredExportNames", /* @__PURE__ */ new Map());
37517
37534
  }
37518
37535
  addIgnoredExport(filename, exportName) {
37519
37536
  if (!exportName) return;
@@ -37632,16 +37649,16 @@ var IgnoredExportsTracker = class {
37632
37649
  //#region src/js/ModuleGraph.ts
37633
37650
  var JsModuleGraph = class {
37634
37651
  constructor(entry, graphOptions) {
37635
- require_object._defineProperty(this, "modules", /* @__PURE__ */ new Map());
37636
- require_object._defineProperty(this, "queue", []);
37637
- require_object._defineProperty(this, "resolve", void 0);
37638
- require_object._defineProperty(this, "load", void 0);
37639
- require_object._defineProperty(this, "filter", void 0);
37640
- require_object._defineProperty(this, "maxDepth", void 0);
37641
- require_object._defineProperty(this, "baseOptions", void 0);
37642
- require_object._defineProperty(this, "parserOptions", void 0);
37643
- require_object._defineProperty(this, "rootFilename", void 0);
37644
- require_object._defineProperty(this, "ignoredExports", void 0);
37652
+ require_generator._defineProperty(this, "modules", /* @__PURE__ */ new Map());
37653
+ require_generator._defineProperty(this, "queue", []);
37654
+ require_generator._defineProperty(this, "resolve", void 0);
37655
+ require_generator._defineProperty(this, "load", void 0);
37656
+ require_generator._defineProperty(this, "filter", void 0);
37657
+ require_generator._defineProperty(this, "maxDepth", void 0);
37658
+ require_generator._defineProperty(this, "baseOptions", void 0);
37659
+ require_generator._defineProperty(this, "parserOptions", void 0);
37660
+ require_generator._defineProperty(this, "rootFilename", void 0);
37661
+ require_generator._defineProperty(this, "ignoredExports", void 0);
37645
37662
  this.resolve = graphOptions.resolve;
37646
37663
  this.load = graphOptions.load;
37647
37664
  this.filter = graphOptions.filter;
@@ -37813,12 +37830,12 @@ const NEVER_MATCH_NAME = () => false;
37813
37830
  */
37814
37831
  var NodePathWalker = class {
37815
37832
  constructor({ ignoreCallExpressionIdentifiers, callback } = {}) {
37816
- require_object._defineProperty(this, "ignoreCallExpressionIdentifiers", void 0);
37817
- require_object._defineProperty(this, "callback", void 0);
37818
- require_object._defineProperty(this, "isIgnoredCallIdentifier", void 0);
37819
- require_object._defineProperty(this, "hasIgnoredCallIdentifiers", void 0);
37820
- require_object._defineProperty(this, "importsStore", void 0);
37821
- require_object._defineProperty(this, "visitedStore", void 0);
37833
+ require_generator._defineProperty(this, "ignoreCallExpressionIdentifiers", void 0);
37834
+ require_generator._defineProperty(this, "callback", void 0);
37835
+ require_generator._defineProperty(this, "isIgnoredCallIdentifier", void 0);
37836
+ require_generator._defineProperty(this, "hasIgnoredCallIdentifiers", void 0);
37837
+ require_generator._defineProperty(this, "importsStore", void 0);
37838
+ require_generator._defineProperty(this, "visitedStore", void 0);
37822
37839
  this.hasIgnoredCallIdentifiers = Boolean(ignoreCallExpressionIdentifiers && ignoreCallExpressionIdentifiers.length > 0);
37823
37840
  this.ignoreCallExpressionIdentifiers = ignoreCallExpressionIdentifiers ?? EMPTY_IGNORE_CALL_EXPRESSION_IDENTIFIERS;
37824
37841
  this.callback = callback ?? NOOP_STRING_PATH_CALLBACK;
@@ -38250,6 +38267,2276 @@ function createAttributeMatcher(entities) {
38250
38267
  };
38251
38268
  }
38252
38269
  //#endregion
38270
+ //#region src/compiler/artifact.ts
38271
+ function createCssFragment(options) {
38272
+ return {
38273
+ id: options.id,
38274
+ kind: options.kind,
38275
+ root: _weapp_tailwindcss_postcss.postcss.parse(options.css, { from: options.sourceId }),
38276
+ sourceId: options.sourceId,
38277
+ scope: options.scope,
38278
+ order: options.order ?? 0,
38279
+ stage: options.stage ?? "raw"
38280
+ };
38281
+ }
38282
+ function cloneCssFragment(fragment) {
38283
+ return {
38284
+ ...fragment,
38285
+ root: fragment.root.clone(),
38286
+ scope: { ...fragment.scope }
38287
+ };
38288
+ }
38289
+ function cloneGenerationArtifact(artifact) {
38290
+ return {
38291
+ fragments: artifact.fragments.map(cloneCssFragment),
38292
+ classSet: new Set(artifact.classSet),
38293
+ rawCandidates: new Set(artifact.rawCandidates),
38294
+ dependencies: [...artifact.dependencies],
38295
+ sourceEntries: [...artifact.sourceEntries],
38296
+ ...artifact.revision === void 0 ? {} : { revision: artifact.revision }
38297
+ };
38298
+ }
38299
+ function createGenerationArtifact(fragments, options) {
38300
+ return cloneGenerationArtifact({
38301
+ fragments,
38302
+ ...options
38303
+ });
38304
+ }
38305
+ //#endregion
38306
+ //#region src/compiler/candidate-index.ts
38307
+ var CandidateIndex = class {
38308
+ constructor() {
38309
+ require_generator._defineProperty(this, "candidatesBySource", /* @__PURE__ */ new Map());
38310
+ }
38311
+ sync(sourceId, candidates) {
38312
+ const previous = this.candidatesBySource.get(sourceId) ?? /* @__PURE__ */ new Set();
38313
+ const next = new Set(candidates);
38314
+ const addedCandidates = new Set([...next].filter((candidate) => !previous.has(candidate)));
38315
+ const removedCandidates = new Set([...previous].filter((candidate) => !next.has(candidate)));
38316
+ this.candidatesBySource.set(sourceId, next);
38317
+ return {
38318
+ sourceId,
38319
+ addedCandidates,
38320
+ removedCandidates
38321
+ };
38322
+ }
38323
+ remove(sourceId) {
38324
+ const previous = this.candidatesBySource.get(sourceId) ?? /* @__PURE__ */ new Set();
38325
+ this.candidatesBySource.delete(sourceId);
38326
+ return {
38327
+ sourceId,
38328
+ addedCandidates: /* @__PURE__ */ new Set(),
38329
+ removedCandidates: new Set(previous)
38330
+ };
38331
+ }
38332
+ values() {
38333
+ const values = /* @__PURE__ */ new Set();
38334
+ for (const candidates of this.candidatesBySource.values()) for (const candidate of candidates) values.add(candidate);
38335
+ return values;
38336
+ }
38337
+ get(sourceId) {
38338
+ return new Set(this.candidatesBySource.get(sourceId) ?? []);
38339
+ }
38340
+ entries() {
38341
+ return new Map([...this.candidatesBySource].map(([sourceId, candidates]) => [sourceId, new Set(candidates)]));
38342
+ }
38343
+ clear() {
38344
+ this.candidatesBySource.clear();
38345
+ }
38346
+ };
38347
+ //#endregion
38348
+ //#region src/compiler/compilation-scope-graph.ts
38349
+ function sourceNodeId(sourceId) {
38350
+ return `source:${sourceId}`;
38351
+ }
38352
+ function dependencyNodeId(dependencyId) {
38353
+ return `dependency:${dependencyId}`;
38354
+ }
38355
+ function createCompilationDependencyChanges(dependencyIds, type = "dependency-changed") {
38356
+ return [...new Set(dependencyIds)].map((id) => ({
38357
+ id,
38358
+ type
38359
+ }));
38360
+ }
38361
+ function mergeCompilationDependencyChanges(...groups) {
38362
+ const changes = /* @__PURE__ */ new Map();
38363
+ for (const group of groups) for (const change of group ?? []) {
38364
+ const previous = changes.get(change.id);
38365
+ changes.set(change.id, {
38366
+ id: change.id,
38367
+ type: previous?.type === "config-changed" ? previous.type : change.type
38368
+ });
38369
+ }
38370
+ return [...changes.values()];
38371
+ }
38372
+ function mergeCompilationScopeDependencies(...groups) {
38373
+ const dependencies = /* @__PURE__ */ new Map();
38374
+ for (const group of groups) for (const dependency of group ?? []) {
38375
+ const previous = dependencies.get(dependency.id);
38376
+ if (previous && previous.kind !== dependency.kind) throw new Error(`同一个依赖不能对应不同类型:${dependency.id}`);
38377
+ dependencies.set(dependency.id, { ...dependency });
38378
+ }
38379
+ return [...dependencies.values()];
38380
+ }
38381
+ function dependencySignature(source) {
38382
+ return mergeCompilationScopeDependencies(source.dependencies).map((dependency) => `${dependency.kind}\0${dependency.id}`).sort().join("\0");
38383
+ }
38384
+ function createCompilationScopeGraph(scope, outputId, sources) {
38385
+ const normalizedSources = [...sources].map((source) => ({
38386
+ ...source,
38387
+ dependencies: mergeCompilationScopeDependencies(source.dependencies)
38388
+ }));
38389
+ const dependencies = mergeCompilationScopeDependencies(...normalizedSources.map((source) => source.dependencies));
38390
+ const outputNodeId = `asset:${outputId}`;
38391
+ return {
38392
+ nodes: [
38393
+ ...normalizedSources.map((source) => ({
38394
+ id: sourceNodeId(source.id),
38395
+ kind: source.kind,
38396
+ scope: { ...scope },
38397
+ ...source.content === void 0 ? {} : { content: source.content }
38398
+ })),
38399
+ ...dependencies.map((dependency) => ({
38400
+ id: dependencyNodeId(dependency.id),
38401
+ kind: dependency.kind,
38402
+ scope: { ...scope }
38403
+ })),
38404
+ {
38405
+ id: outputNodeId,
38406
+ kind: "asset",
38407
+ scope: { ...scope }
38408
+ }
38409
+ ],
38410
+ edges: normalizedSources.flatMap((source) => [{
38411
+ from: sourceNodeId(source.id),
38412
+ to: outputNodeId,
38413
+ kind: "emits-to"
38414
+ }, ...source.dependencies.map((dependency) => ({
38415
+ from: sourceNodeId(source.id),
38416
+ to: dependencyNodeId(dependency.id),
38417
+ kind: "depends-on"
38418
+ }))])
38419
+ };
38420
+ }
38421
+ function createCompilationScopeSnapshot(scope, outputId, sources, options = {}) {
38422
+ const normalizedSources = [...sources];
38423
+ return {
38424
+ ...createCompilationScopeGraph(scope, outputId, normalizedSources),
38425
+ candidatesBySource: normalizedSources.map((source) => [sourceNodeId(source.id), source.candidates]),
38426
+ ...options.changes === void 0 ? {} : { changes: options.changes },
38427
+ ...options.preserveDeletedCss === void 0 ? {} : { preserveDeletedCss: options.preserveDeletedCss },
38428
+ ...options.validatedClassSet === void 0 ? {} : { validatedClassSet: options.validatedClassSet }
38429
+ };
38430
+ }
38431
+ //#endregion
38432
+ //#region src/compiler/compilation-dependency-state.ts
38433
+ var CompilationDependencyState = class {
38434
+ constructor() {
38435
+ require_generator._defineProperty(this, "revisions", /* @__PURE__ */ new Map());
38436
+ }
38437
+ getAffectedScopes(entries, changes) {
38438
+ return new Set(this.getAffectedScopeChanges(entries, changes).keys());
38439
+ }
38440
+ getAffectedScopeChanges(entries, changes) {
38441
+ const changesByNodeId = new Map([...changes].map((change) => [dependencyNodeId(change.id), change]));
38442
+ const affectedScopeChanges = /* @__PURE__ */ new Map();
38443
+ for (const entry of entries) {
38444
+ const scopeChanges = entry.latest?.graphNodes.map((node) => changesByNodeId.get(node.id)).filter((change) => change !== void 0);
38445
+ if (scopeChanges && scopeChanges.length > 0) affectedScopeChanges.set(entry.scope.id, scopeChanges.map((change) => ({ ...change })));
38446
+ }
38447
+ return affectedScopeChanges;
38448
+ }
38449
+ record(entries, changes) {
38450
+ const affectedScopes = this.getAffectedScopes(entries, changes);
38451
+ this.recordScopes(affectedScopes);
38452
+ return affectedScopes;
38453
+ }
38454
+ recordScopes(scopeIds) {
38455
+ for (const scopeId of scopeIds) this.revisions.set(scopeId, (this.revisions.get(scopeId) ?? 0) + 1);
38456
+ }
38457
+ getRevision(scopeId) {
38458
+ return this.revisions.get(scopeId) ?? 0;
38459
+ }
38460
+ delete(scopeId) {
38461
+ this.revisions.delete(scopeId);
38462
+ }
38463
+ clear() {
38464
+ this.revisions.clear();
38465
+ }
38466
+ };
38467
+ //#endregion
38468
+ //#region src/compiler/compiler-owner-state.ts
38469
+ const compilerOwnerDisposals = /* @__PURE__ */ new WeakMap();
38470
+ const compilerOwnerActivities = /* @__PURE__ */ new WeakMap();
38471
+ function ensureCompilerOwnerActive(owner) {
38472
+ if (compilerOwnerDisposals.has(owner)) throw new Error("Compiler owner 正在释放,不能创建新的编译状态。");
38473
+ }
38474
+ function acquireCompilerOwnerActivity(owner) {
38475
+ const currentDisposal = compilerOwnerDisposals.get(owner);
38476
+ if (currentDisposal) return currentDisposal.then(() => acquireCompilerOwnerActivity(owner));
38477
+ let state = compilerOwnerActivities.get(owner);
38478
+ if (!state) {
38479
+ state = {
38480
+ active: 0,
38481
+ idleWaiters: /* @__PURE__ */ new Set()
38482
+ };
38483
+ compilerOwnerActivities.set(owner, state);
38484
+ }
38485
+ state.active += 1;
38486
+ let released = false;
38487
+ return () => {
38488
+ if (released) return;
38489
+ released = true;
38490
+ state.active -= 1;
38491
+ if (state.active > 0) return;
38492
+ compilerOwnerActivities.delete(owner);
38493
+ for (const resolve of state.idleWaiters) resolve();
38494
+ state.idleWaiters.clear();
38495
+ };
38496
+ }
38497
+ function waitForCompilerOwnerIdle(owner) {
38498
+ const state = compilerOwnerActivities.get(owner);
38499
+ if (!state || state.active === 0) return Promise.resolve();
38500
+ return new Promise((resolve) => {
38501
+ state.idleWaiters.add(resolve);
38502
+ });
38503
+ }
38504
+ function runCompilerOwnerActivity(owner, activity) {
38505
+ const acquired = acquireCompilerOwnerActivity(owner);
38506
+ if (typeof acquired !== "function") return acquired.then((release) => runCompilerOwnerActivityWithRelease(activity, release));
38507
+ return runCompilerOwnerActivityWithRelease(activity, acquired);
38508
+ }
38509
+ function runCompilerOwnerActivityWithRelease(activity, release) {
38510
+ try {
38511
+ return Promise.resolve(activity()).finally(release);
38512
+ } catch (error) {
38513
+ release();
38514
+ return Promise.reject(error);
38515
+ }
38516
+ }
38517
+ function runCompilerOwnerDisposal(owner, dispose) {
38518
+ const currentDisposal = compilerOwnerDisposals.get(owner);
38519
+ if (currentDisposal) return currentDisposal;
38520
+ const disposal = Promise.resolve().then(async () => {
38521
+ await waitForCompilerOwnerIdle(owner);
38522
+ await dispose();
38523
+ }).finally(() => {
38524
+ if (compilerOwnerDisposals.get(owner) === disposal) compilerOwnerDisposals.delete(owner);
38525
+ });
38526
+ compilerOwnerDisposals.set(owner, disposal);
38527
+ return disposal;
38528
+ }
38529
+ //#endregion
38530
+ //#region src/compiler/invalidation.ts
38531
+ function resolveInvalidatedScopes(graph, changes) {
38532
+ const invalidatedScopes = /* @__PURE__ */ new Set();
38533
+ const visit = (sourceId, visited) => {
38534
+ if (visited.has(sourceId)) return;
38535
+ visited.add(sourceId);
38536
+ const node = graph.getNode(sourceId);
38537
+ if (node) invalidatedScopes.add(node.scope.id);
38538
+ for (const dependent of graph.getDependents(sourceId)) visit(dependent, visited);
38539
+ };
38540
+ for (const change of changes) visit(change.sourceId, /* @__PURE__ */ new Set());
38541
+ return invalidatedScopes;
38542
+ }
38543
+ //#endregion
38544
+ //#region src/compiler/source-graph.ts
38545
+ var SourceGraph = class {
38546
+ constructor() {
38547
+ require_generator._defineProperty(this, "edges", /* @__PURE__ */ new Map());
38548
+ require_generator._defineProperty(this, "nodes", /* @__PURE__ */ new Map());
38549
+ }
38550
+ replace(nodes, edges) {
38551
+ this.clear();
38552
+ for (const node of nodes) this.nodes.set(node.id, {
38553
+ ...node,
38554
+ scope: { ...node.scope }
38555
+ });
38556
+ for (const edge of edges) {
38557
+ if (!this.nodes.has(edge.from) || !this.nodes.has(edge.to)) throw new Error(`编译图边引用了不存在的节点:${edge.from} -> ${edge.to}`);
38558
+ this.edges.set(this.edgeKey(edge), { ...edge });
38559
+ }
38560
+ }
38561
+ getNode(id) {
38562
+ const node = this.nodes.get(id);
38563
+ return node ? {
38564
+ ...node,
38565
+ scope: { ...node.scope }
38566
+ } : void 0;
38567
+ }
38568
+ getNodes() {
38569
+ return [...this.nodes.values()].map((node) => ({
38570
+ ...node,
38571
+ scope: { ...node.scope }
38572
+ }));
38573
+ }
38574
+ getEdges() {
38575
+ return [...this.edges.values()].map((edge) => ({ ...edge }));
38576
+ }
38577
+ getDependents(id) {
38578
+ return this.getEdges().filter((edge) => edge.to === id).map((edge) => edge.from);
38579
+ }
38580
+ clear() {
38581
+ this.edges.clear();
38582
+ this.nodes.clear();
38583
+ }
38584
+ edgeKey(edge) {
38585
+ return `${edge.kind}\0${edge.from}\0${edge.to}`;
38586
+ }
38587
+ };
38588
+ //#endregion
38589
+ //#region src/compiler/session.ts
38590
+ var DefaultCompilationSession = class {
38591
+ constructor() {
38592
+ require_generator._defineProperty(this, "candidateIndex", new CandidateIndex());
38593
+ require_generator._defineProperty(this, "graph", new SourceGraph());
38594
+ require_generator._defineProperty(this, "retainedCandidates", /* @__PURE__ */ new Set());
38595
+ require_generator._defineProperty(this, "validatedClassSet", /* @__PURE__ */ new Set());
38596
+ require_generator._defineProperty(this, "invalidatedScopes", /* @__PURE__ */ new Set());
38597
+ require_generator._defineProperty(this, "revision", 0);
38598
+ }
38599
+ update(snapshot) {
38600
+ const changes = [...snapshot.changes ?? []];
38601
+ const invalidatedScopes = resolveInvalidatedScopes(this.graph, changes);
38602
+ this.graph.replace(snapshot.nodes, snapshot.edges);
38603
+ for (const [sourceId, candidates] of snapshot.candidatesBySource ?? []) {
38604
+ const change = this.candidateIndex.sync(sourceId, candidates);
38605
+ if (change.addedCandidates.size > 0 || change.removedCandidates.size > 0) changes.push(change);
38606
+ }
38607
+ for (const change of changes) if ("type" in change && change.type === "source-removed") this.candidateIndex.remove(change.sourceId);
38608
+ const currentCandidates = this.candidateIndex.values();
38609
+ if (snapshot.preserveDeletedCss) for (const candidate of currentCandidates) this.retainedCandidates.add(candidate);
38610
+ else {
38611
+ this.retainedCandidates.clear();
38612
+ for (const candidate of currentCandidates) this.retainedCandidates.add(candidate);
38613
+ }
38614
+ if (snapshot.validatedClassSet !== void 0) this.validatedClassSet = new Set(snapshot.validatedClassSet);
38615
+ else if (!snapshot.preserveDeletedCss) this.validatedClassSet = new Set([...this.validatedClassSet].filter((candidate) => this.retainedCandidates.has(candidate)));
38616
+ this.revision += 1;
38617
+ for (const scopeId of resolveInvalidatedScopes(this.graph, changes)) invalidatedScopes.add(scopeId);
38618
+ this.invalidatedScopes = invalidatedScopes;
38619
+ return this.createResult();
38620
+ }
38621
+ commitValidation(revision, validatedClassSet, graph) {
38622
+ if (revision !== this.revision) throw new Error(`不能向编译 revision ${this.revision} 提交 revision ${revision} 的 classSet。`);
38623
+ if (graph) this.graph.replace(graph.nodes, graph.edges);
38624
+ this.validatedClassSet = new Set(validatedClassSet);
38625
+ return this.createResult();
38626
+ }
38627
+ createResult() {
38628
+ return {
38629
+ revision: this.revision,
38630
+ candidates: new Set(this.retainedCandidates),
38631
+ candidatesBySource: this.candidateIndex.entries(),
38632
+ validatedClassSet: new Set(this.validatedClassSet),
38633
+ invalidatedScopes: new Set(this.invalidatedScopes),
38634
+ graphEdges: this.graph.getEdges(),
38635
+ graphNodes: this.graph.getNodes()
38636
+ };
38637
+ }
38638
+ dispose() {
38639
+ this.candidateIndex.clear();
38640
+ this.graph.clear();
38641
+ this.retainedCandidates.clear();
38642
+ this.validatedClassSet.clear();
38643
+ this.invalidatedScopes.clear();
38644
+ this.revision = 0;
38645
+ }
38646
+ };
38647
+ //#endregion
38648
+ //#region src/compiler/compilation-session-pool.ts
38649
+ const COMPILATION_SCOPE_CACHE_MAX = 128;
38650
+ function cloneScopeSource(source) {
38651
+ return {
38652
+ ...source,
38653
+ candidates: new Set(source.candidates),
38654
+ dependencies: source.dependencies?.map((dependency) => ({ ...dependency }))
38655
+ };
38656
+ }
38657
+ var CompilationSessionPool = class {
38658
+ constructor() {
38659
+ require_generator._defineProperty(this, "dependencyState", new CompilationDependencyState());
38660
+ require_generator._defineProperty(this, "entries", /* @__PURE__ */ new Map());
38661
+ require_generator._defineProperty(this, "disposed", false);
38662
+ }
38663
+ run(request, compile) {
38664
+ const entry = this.getEntry(request.scope);
38665
+ const execution = this.runEntry(entry, request, compile);
38666
+ entry.executions.add(execution);
38667
+ execution.then(() => entry.executions.delete(execution), () => entry.executions.delete(execution));
38668
+ return execution;
38669
+ }
38670
+ invalidateScope(scopeId) {
38671
+ const entry = this.entries.get(scopeId);
38672
+ if (!entry) return;
38673
+ entry.active = false;
38674
+ this.disposeEntry(entry);
38675
+ this.entries.delete(scopeId);
38676
+ this.dependencyState.delete(scopeId);
38677
+ }
38678
+ dispose() {
38679
+ if (this.disposed) return Promise.resolve();
38680
+ this.disposed = true;
38681
+ const entries = [...this.entries.values()];
38682
+ for (const entry of entries) entry.active = false;
38683
+ this.entries.clear();
38684
+ this.dependencyState.clear();
38685
+ return Promise.all(entries.map((entry) => this.disposeEntry(entry))).then(() => void 0);
38686
+ }
38687
+ get size() {
38688
+ return this.entries.size;
38689
+ }
38690
+ getAffectedScopes(changes) {
38691
+ return this.dependencyState.getAffectedScopes(this.entries.values(), changes);
38692
+ }
38693
+ getAffectedScopeChanges(changes) {
38694
+ return this.dependencyState.getAffectedScopeChanges(this.entries.values(), changes);
38695
+ }
38696
+ recordDependencyChanges(changes) {
38697
+ return this.dependencyState.record(this.entries.values(), changes);
38698
+ }
38699
+ recordAffectedScopes(scopeIds) {
38700
+ this.dependencyState.recordScopes(scopeIds);
38701
+ }
38702
+ getScopeDependencyRevision(scopeId) {
38703
+ return this.dependencyState.getRevision(scopeId);
38704
+ }
38705
+ getEntry(scope) {
38706
+ if (this.disposed) throw new Error("CompilationSessionPool 已释放。");
38707
+ const cached = this.entries.get(scope.id);
38708
+ if (cached) {
38709
+ if (cached.scope.kind !== scope.kind) throw new Error(`同一个 scope id 不能对应不同类型:${scope.id}`);
38710
+ this.entries.delete(scope.id);
38711
+ this.entries.set(scope.id, cached);
38712
+ return cached;
38713
+ }
38714
+ const entry = {
38715
+ active: true,
38716
+ executions: /* @__PURE__ */ new Set(),
38717
+ pending: Promise.resolve(),
38718
+ scope: { ...scope },
38719
+ session: new DefaultCompilationSession(),
38720
+ generatedDependencies: /* @__PURE__ */ new Map(),
38721
+ sources: /* @__PURE__ */ new Map()
38722
+ };
38723
+ this.entries.set(scope.id, entry);
38724
+ while (this.entries.size > COMPILATION_SCOPE_CACHE_MAX) {
38725
+ const oldestScopeId = this.entries.keys().next().value;
38726
+ if (oldestScopeId === void 0 || oldestScopeId === scope.id) break;
38727
+ this.invalidateScope(oldestScopeId);
38728
+ }
38729
+ return entry;
38730
+ }
38731
+ async disposeEntry(entry) {
38732
+ await Promise.allSettled([...entry.executions]);
38733
+ await entry.pending;
38734
+ entry.session.dispose();
38735
+ }
38736
+ async runEntry(entry, request, compile) {
38737
+ const prepared = await this.enqueue(entry, () => this.prepareEntry(entry, request));
38738
+ const value = await compile(prepared.compilation);
38739
+ const validatedClassSet = request.preserveDeletedCss ? /* @__PURE__ */ new Set([...prepared.compilation.validatedClassSet, ...value?.classSet ?? []]) : new Set(value?.classSet ?? []);
38740
+ const generatedDependencies = value?.dependenciesBySource === void 0 ? void 0 : this.normalizeGeneratedDependencies(value.dependenciesBySource, prepared.sources);
38741
+ let committed = false;
38742
+ let committedCompilation;
38743
+ await this.enqueue(entry, () => {
38744
+ if (!entry.active || entry.latest?.revision !== prepared.compilation.revision) return;
38745
+ if (generatedDependencies) entry.generatedDependencies = generatedDependencies;
38746
+ entry.latest = entry.session.commitValidation(prepared.compilation.revision, validatedClassSet, createCompilationScopeGraph(request.scope, request.outputId, this.createGraphSources(prepared.sources, entry.generatedDependencies)));
38747
+ committedCompilation = this.toScopeState(entry.latest, prepared.sources);
38748
+ committed = true;
38749
+ });
38750
+ const compilation = committedCompilation ?? {
38751
+ ...prepared.compilation,
38752
+ validatedClassSet
38753
+ };
38754
+ return committed ? {
38755
+ committed,
38756
+ compilation,
38757
+ value
38758
+ } : {
38759
+ committed,
38760
+ compilation
38761
+ };
38762
+ }
38763
+ prepareEntry(entry, request) {
38764
+ const nextSources = new Map(request.sources.map((source) => [source.id, cloneScopeSource(source)]));
38765
+ const changes = [...request.changes ?? []].map((change) => ({
38766
+ sourceId: dependencyNodeId(change.id),
38767
+ type: change.type
38768
+ }));
38769
+ for (const sourceId of entry.sources.keys()) if (!nextSources.has(sourceId)) changes.push({
38770
+ sourceId: sourceNodeId(sourceId),
38771
+ type: "source-removed"
38772
+ });
38773
+ for (const [sourceId, source] of nextSources) {
38774
+ const previous = entry.sources.get(sourceId);
38775
+ if (previous && (previous.content !== source.content || dependencySignature(previous) !== dependencySignature(source))) changes.push({
38776
+ sourceId: sourceNodeId(sourceId),
38777
+ type: "dependency-changed"
38778
+ });
38779
+ }
38780
+ entry.sources = nextSources;
38781
+ entry.generatedDependencies = new Map([...entry.generatedDependencies].filter(([sourceId]) => nextSources.has(sourceId)));
38782
+ entry.latest = entry.session.update(createCompilationScopeSnapshot(request.scope, request.outputId, this.createGraphSources(nextSources, entry.generatedDependencies), {
38783
+ changes,
38784
+ preserveDeletedCss: request.preserveDeletedCss
38785
+ }));
38786
+ return {
38787
+ compilation: this.toScopeState(entry.latest, nextSources),
38788
+ sources: nextSources
38789
+ };
38790
+ }
38791
+ createGraphSources(sources, generatedDependencies) {
38792
+ return [...sources.values()].map((source) => ({
38793
+ ...source,
38794
+ dependencies: mergeCompilationScopeDependencies(source.dependencies, generatedDependencies.get(source.id))
38795
+ }));
38796
+ }
38797
+ normalizeGeneratedDependencies(dependenciesBySource, sources) {
38798
+ const normalized = /* @__PURE__ */ new Map();
38799
+ for (const [sourceId, dependencies] of dependenciesBySource) {
38800
+ if (!sources.has(sourceId)) throw new Error(`生成结果引用了未知 source:${sourceId}`);
38801
+ normalized.set(sourceId, mergeCompilationScopeDependencies(normalized.get(sourceId), dependencies));
38802
+ }
38803
+ return normalized;
38804
+ }
38805
+ enqueue(entry, task) {
38806
+ const execution = entry.pending.then(task);
38807
+ entry.pending = execution.then(() => void 0, () => void 0);
38808
+ return execution;
38809
+ }
38810
+ toScopeState(compilation, sources) {
38811
+ return {
38812
+ ...compilation,
38813
+ candidatesBySource: new Map([...sources.keys()].map((sourceId) => [sourceId, compilation.candidatesBySource.get(sourceNodeId(sourceId)) ?? /* @__PURE__ */ new Set()]))
38814
+ };
38815
+ }
38816
+ };
38817
+ const compilationSessionPools = /* @__PURE__ */ new WeakMap();
38818
+ function getCompilationSessionPool(owner) {
38819
+ ensureCompilerOwnerActive(owner);
38820
+ let pool = compilationSessionPools.get(owner);
38821
+ if (!pool) {
38822
+ pool = new CompilationSessionPool();
38823
+ compilationSessionPools.set(owner, pool);
38824
+ }
38825
+ return pool;
38826
+ }
38827
+ function disposeCompilationSessionPool(owner) {
38828
+ const pool = compilationSessionPools.get(owner);
38829
+ if (!pool) return Promise.resolve();
38830
+ compilationSessionPools.delete(owner);
38831
+ return pool.dispose();
38832
+ }
38833
+ //#endregion
38834
+ //#region src/compiler/tailwind-generation-session-pool.ts
38835
+ const SESSION_ENGINE_CACHE_MAX = 32;
38836
+ function createSourceKey(source) {
38837
+ return (0, _weapp_tailwindcss_shared_node.md5)([
38838
+ source.projectRoot,
38839
+ source.base,
38840
+ source.baseFallbacks.join("\0"),
38841
+ source.css,
38842
+ source.dependencies.join("\0")
38843
+ ].join("\0"));
38844
+ }
38845
+ function disposeGenerator$1(generator) {
38846
+ generator?.dispose?.();
38847
+ }
38848
+ var TailwindGenerationSessionPool = class {
38849
+ constructor() {
38850
+ require_generator._defineProperty(this, "generators", /* @__PURE__ */ new Map());
38851
+ require_generator._defineProperty(this, "disposed", false);
38852
+ }
38853
+ async generate(source, options) {
38854
+ return this.getGenerator(source).generate(options);
38855
+ }
38856
+ async validateCandidates(source, candidates) {
38857
+ return this.getGenerator(source).validateCandidates(candidates);
38858
+ }
38859
+ invalidate(change) {
38860
+ if (change.type === "all" || change.type === "dependencies") {
38861
+ for (const generator of this.generators.values()) disposeGenerator$1(generator);
38862
+ this.generators.clear();
38863
+ return;
38864
+ }
38865
+ const key = createSourceKey(change.source);
38866
+ disposeGenerator$1(this.generators.get(key));
38867
+ this.generators.delete(key);
38868
+ }
38869
+ dispose() {
38870
+ for (const generator of this.generators.values()) disposeGenerator$1(generator);
38871
+ this.generators.clear();
38872
+ this.disposed = true;
38873
+ }
38874
+ get size() {
38875
+ return this.generators.size;
38876
+ }
38877
+ getGenerator(source) {
38878
+ if (this.disposed) throw new Error("TailwindGenerationSessionPool 已释放。");
38879
+ const key = createSourceKey(source);
38880
+ const cached = this.generators.get(key);
38881
+ if (cached) {
38882
+ this.generators.delete(key);
38883
+ this.generators.set(key, cached);
38884
+ return cached;
38885
+ }
38886
+ const generator = require_generator.createWeappTailwindcssGenerator(source);
38887
+ this.generators.set(key, generator);
38888
+ while (this.generators.size > SESSION_ENGINE_CACHE_MAX) {
38889
+ const oldest = this.generators.keys().next().value;
38890
+ if (oldest === void 0) break;
38891
+ disposeGenerator$1(this.generators.get(oldest));
38892
+ this.generators.delete(oldest);
38893
+ }
38894
+ return generator;
38895
+ }
38896
+ };
38897
+ const sessionPools = /* @__PURE__ */ new WeakMap();
38898
+ function getTailwindGenerationSessionPool(owner) {
38899
+ ensureCompilerOwnerActive(owner);
38900
+ let pool = sessionPools.get(owner);
38901
+ if (!pool) {
38902
+ pool = new TailwindGenerationSessionPool();
38903
+ sessionPools.set(owner, pool);
38904
+ }
38905
+ return pool;
38906
+ }
38907
+ function disposeTailwindGenerationSessionPool(owner) {
38908
+ const pool = sessionPools.get(owner);
38909
+ if (!pool) return;
38910
+ sessionPools.delete(owner);
38911
+ pool.dispose();
38912
+ }
38913
+ //#endregion
38914
+ //#region src/compiler/compilation-change-coordinator.ts
38915
+ var CompilationChangeCoordinator = class {
38916
+ constructor(compilationPool, generationPool) {
38917
+ this.compilationPool = compilationPool;
38918
+ this.generationPool = generationPool;
38919
+ require_generator._defineProperty(this, "pendingChangesByScope", /* @__PURE__ */ new Map());
38920
+ require_generator._defineProperty(this, "disposed", false);
38921
+ }
38922
+ record(changes) {
38923
+ this.ensureActive();
38924
+ const normalizedChanges = mergeCompilationDependencyChanges(changes);
38925
+ if (normalizedChanges.length === 0) return /* @__PURE__ */ new Set();
38926
+ const affectedScopeChanges = this.compilationPool.getAffectedScopeChanges(normalizedChanges);
38927
+ const affectedScopes = new Set(affectedScopeChanges.keys());
38928
+ const newlyPendingScopes = /* @__PURE__ */ new Set();
38929
+ const invalidatedPaths = /* @__PURE__ */ new Set();
38930
+ for (const [scopeId, scopeChanges] of affectedScopeChanges) {
38931
+ let pendingChanges = this.pendingChangesByScope.get(scopeId);
38932
+ if (!pendingChanges) {
38933
+ pendingChanges = /* @__PURE__ */ new Map();
38934
+ this.pendingChangesByScope.set(scopeId, pendingChanges);
38935
+ newlyPendingScopes.add(scopeId);
38936
+ }
38937
+ for (const change of scopeChanges) {
38938
+ const previous = pendingChanges.get(change.id);
38939
+ const mergedChange = mergeCompilationDependencyChanges(previous ? [previous] : void 0, [change])[0];
38940
+ if (!previous || previous.type !== mergedChange.type) {
38941
+ pendingChanges.set(change.id, mergedChange);
38942
+ invalidatedPaths.add(change.id);
38943
+ }
38944
+ }
38945
+ }
38946
+ if (newlyPendingScopes.size > 0) this.compilationPool.recordAffectedScopes(newlyPendingScopes);
38947
+ if (invalidatedPaths.size > 0) this.generationPool.invalidate({
38948
+ type: "dependencies",
38949
+ paths: invalidatedPaths
38950
+ });
38951
+ return affectedScopes;
38952
+ }
38953
+ consume(scopeId) {
38954
+ this.ensureActive();
38955
+ const pendingChanges = this.pendingChangesByScope.get(scopeId);
38956
+ if (!pendingChanges) return;
38957
+ this.pendingChangesByScope.delete(scopeId);
38958
+ return [...pendingChanges.values()].map((change) => ({ ...change }));
38959
+ }
38960
+ invalidateScope(scopeId) {
38961
+ this.ensureActive();
38962
+ this.pendingChangesByScope.delete(scopeId);
38963
+ this.compilationPool.invalidateScope(scopeId);
38964
+ }
38965
+ getScopeDependencyRevision(scopeId) {
38966
+ this.ensureActive();
38967
+ return this.compilationPool.getScopeDependencyRevision(scopeId);
38968
+ }
38969
+ dispose() {
38970
+ this.pendingChangesByScope.clear();
38971
+ this.disposed = true;
38972
+ }
38973
+ ensureActive() {
38974
+ if (this.disposed) throw new Error("CompilationChangeCoordinator 已释放。");
38975
+ }
38976
+ };
38977
+ const compilationChangeCoordinators = /* @__PURE__ */ new WeakMap();
38978
+ function getCompilationChangeCoordinator(owner) {
38979
+ ensureCompilerOwnerActive(owner);
38980
+ let coordinator = compilationChangeCoordinators.get(owner);
38981
+ if (!coordinator) {
38982
+ coordinator = new CompilationChangeCoordinator(getCompilationSessionPool(owner), getTailwindGenerationSessionPool(owner));
38983
+ compilationChangeCoordinators.set(owner, coordinator);
38984
+ }
38985
+ return coordinator;
38986
+ }
38987
+ function recordCompilationDependencyChanges(owner, changes) {
38988
+ return getCompilationChangeCoordinator(owner).record(changes);
38989
+ }
38990
+ function consumeCompilationScopeChanges(owner, scopeId) {
38991
+ return getCompilationChangeCoordinator(owner).consume(scopeId);
38992
+ }
38993
+ function getCompilationScopeDependencyRevision(owner, scopeId) {
38994
+ return getCompilationChangeCoordinator(owner).getScopeDependencyRevision(scopeId);
38995
+ }
38996
+ function invalidateCompilationScope(owner, scopeId) {
38997
+ getCompilationChangeCoordinator(owner).invalidateScope(scopeId);
38998
+ }
38999
+ function disposeCompilationChangeCoordinator(owner) {
39000
+ const coordinator = compilationChangeCoordinators.get(owner);
39001
+ if (!coordinator) return;
39002
+ compilationChangeCoordinators.delete(owner);
39003
+ coordinator.dispose();
39004
+ }
39005
+ //#endregion
39006
+ //#region src/compiler/composition.ts
39007
+ function orderCssFragments(fragments) {
39008
+ return [...fragments].sort((left, right) => left.order - right.order || left.id.localeCompare(right.id));
39009
+ }
39010
+ function composeGenerationArtifact(artifact) {
39011
+ const cloned = cloneGenerationArtifact(artifact);
39012
+ const root = _weapp_tailwindcss_postcss.postcss.root();
39013
+ for (const fragment of orderCssFragments(cloned.fragments)) root.append(fragment.root.nodes.map((node) => node.clone()));
39014
+ return {
39015
+ artifact: cloned,
39016
+ root,
39017
+ css: root.toString()
39018
+ };
39019
+ }
39020
+ //#endregion
39021
+ //#region src/compiler/emission-plan.ts
39022
+ var AssetEmissionPlan = class {
39023
+ constructor() {
39024
+ require_generator._defineProperty(this, "emissions", /* @__PURE__ */ new Map());
39025
+ require_generator._defineProperty(this, "assetOperations", []);
39026
+ }
39027
+ upsert(assetId, artifact) {
39028
+ this.emissions.set(assetId, cloneGenerationArtifact(artifact));
39029
+ }
39030
+ get(assetId) {
39031
+ const artifact = this.emissions.get(assetId);
39032
+ return artifact ? cloneGenerationArtifact(artifact) : void 0;
39033
+ }
39034
+ entries() {
39035
+ return [...this.emissions].map(([assetId, artifact]) => ({
39036
+ assetId,
39037
+ artifact: cloneGenerationArtifact(artifact)
39038
+ }));
39039
+ }
39040
+ write(assetId, source) {
39041
+ this.assetOperations.push({
39042
+ assetId,
39043
+ kind: "write",
39044
+ source
39045
+ });
39046
+ }
39047
+ remove(assetId) {
39048
+ this.assetOperations.push({
39049
+ assetId,
39050
+ kind: "delete"
39051
+ });
39052
+ }
39053
+ operations() {
39054
+ return this.assetOperations.map((operation) => ({ ...operation }));
39055
+ }
39056
+ clear() {
39057
+ this.emissions.clear();
39058
+ this.assetOperations.length = 0;
39059
+ }
39060
+ };
39061
+ //#endregion
39062
+ //#region src/core/compiler/source-fingerprint.ts
39063
+ function stableSerialize(value, stack = /* @__PURE__ */ new WeakSet()) {
39064
+ if (value == null || typeof value === "number" || typeof value === "boolean" || typeof value === "string") return JSON.stringify(value);
39065
+ if (typeof value === "function") return `[Function:${value.name}]`;
39066
+ if (typeof value !== "object") return String(value);
39067
+ if (stack.has(value)) return "[Circular]";
39068
+ stack.add(value);
39069
+ const serialized = Array.isArray(value) ? `[${value.map((item) => stableSerialize(item, stack)).join(",")}]` : `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableSerialize(value[key], stack)}`).join(",")}}`;
39070
+ stack.delete(value);
39071
+ return serialized;
39072
+ }
39073
+ function createSourceFingerprint(source) {
39074
+ return createCompilerValueFingerprint(source);
39075
+ }
39076
+ function createCompilerValueFingerprint(value) {
39077
+ return (0, _weapp_tailwindcss_shared_node.md5)(stableSerialize(value));
39078
+ }
39079
+ //#endregion
39080
+ //#region src/core/compiler/generation-cache.ts
39081
+ function createCompilerGenerationCacheKey(request, candidates, target) {
39082
+ return {
39083
+ bareArbitraryValues: request.bareArbitraryValues,
39084
+ candidateSignature: [...candidates].sort().join("\0"),
39085
+ incrementalCache: request.incrementalCache,
39086
+ scanSources: request.scanSources,
39087
+ sourcesFingerprint: request.sources === void 0 ? void 0 : createCompilerValueFingerprint(request.sources),
39088
+ styleOptionsFingerprint: request.styleOptions === void 0 ? void 0 : createCompilerValueFingerprint(request.styleOptions),
39089
+ target
39090
+ };
39091
+ }
39092
+ function isSameCompilerGenerationCacheKey(left, right) {
39093
+ return left.bareArbitraryValues === right.bareArbitraryValues && left.candidateSignature === right.candidateSignature && left.incrementalCache === right.incrementalCache && left.scanSources === right.scanSources && left.sourcesFingerprint === right.sourcesFingerprint && left.styleOptionsFingerprint === right.styleOptionsFingerprint && left.target === right.target;
39094
+ }
39095
+ function reuseCompilerGenerationResult(result) {
39096
+ return {
39097
+ ...result,
39098
+ incrementalCss: "",
39099
+ incrementalRawCss: ""
39100
+ };
39101
+ }
39102
+ //#endregion
39103
+ //#region src/core/compiler/generation-state.ts
39104
+ function createGenerationGraph(rootId, source, dependencies) {
39105
+ const scope = {
39106
+ id: rootId,
39107
+ kind: "global"
39108
+ };
39109
+ const dependencyIds = [...new Set(dependencies)].filter((id) => id !== rootId).sort();
39110
+ const nodes = [{
39111
+ content: source.css,
39112
+ id: rootId,
39113
+ kind: "css",
39114
+ scope
39115
+ }, ...dependencyIds.map((id) => ({
39116
+ id,
39117
+ kind: "config",
39118
+ scope
39119
+ }))];
39120
+ return {
39121
+ edges: dependencyIds.map((id) => ({
39122
+ from: rootId,
39123
+ kind: "depends-on",
39124
+ to: id
39125
+ })),
39126
+ nodes
39127
+ };
39128
+ }
39129
+ function prepareCompilerGeneration(entry, request, source, sourceChanged) {
39130
+ const explicitCandidates = request.candidates !== void 0;
39131
+ const candidates = explicitCandidates ? [...request.candidates] : [];
39132
+ const candidateSignature = [...candidates].sort().join("\0");
39133
+ if (!sourceChanged && entry.compilationCache?.candidateSignature === candidateSignature && entry.compilationCache.compilation.revision === entry.compilationRevision) return {
39134
+ ...entry.compilationCache,
39135
+ explicitCandidates
39136
+ };
39137
+ const graph = createGenerationGraph(entry.id, source, source.dependencies);
39138
+ const compilation = entry.compilation.update({
39139
+ ...graph,
39140
+ candidatesBySource: [[entry.id, candidates]],
39141
+ changes: sourceChanged ? [{
39142
+ sourceId: entry.id,
39143
+ type: "dependency-changed"
39144
+ }] : void 0
39145
+ });
39146
+ entry.compilationRevision = compilation.revision;
39147
+ return {
39148
+ candidateSignature,
39149
+ compilation,
39150
+ explicitCandidates,
39151
+ graph
39152
+ };
39153
+ }
39154
+ function commitCompilerGeneration(entry, prepared, source, dependencies, classSet) {
39155
+ const graph = createGenerationGraph(entry.id, source, dependencies);
39156
+ const compilation = entry.compilation.commitValidation(prepared.compilation.revision, classSet, graph);
39157
+ entry.compilationCache = {
39158
+ candidateSignature: prepared.candidateSignature,
39159
+ compilation,
39160
+ graph
39161
+ };
39162
+ }
39163
+ //#endregion
39164
+ //#region src/core/compiler/root-store.ts
39165
+ function disposeGenerator(generator) {
39166
+ generator?.dispose?.();
39167
+ }
39168
+ var CompilerRootStore = class {
39169
+ constructor(maxRoots, onRootEvicted) {
39170
+ this.maxRoots = maxRoots;
39171
+ this.onRootEvicted = onRootEvicted;
39172
+ require_generator._defineProperty(this, "dependencyRoots", /* @__PURE__ */ new Map());
39173
+ require_generator._defineProperty(this, "releasing", /* @__PURE__ */ new Map());
39174
+ require_generator._defineProperty(this, "roots", /* @__PURE__ */ new Map());
39175
+ }
39176
+ get(id) {
39177
+ if (!id) throw new Error("Compiler root id 不能为空。");
39178
+ if (this.releasing.has(id)) throw new Error(`Compiler root 正在移除:${id}`);
39179
+ const cached = this.roots.get(id);
39180
+ if (cached) {
39181
+ if (!cached.accepting) throw new Error(`Compiler root 正在移除:${id}`);
39182
+ this.roots.delete(id);
39183
+ this.roots.set(id, cached);
39184
+ return cached;
39185
+ }
39186
+ if (this.roots.size >= this.maxRoots) {
39187
+ const oldest = [...this.roots.values()].find((entry) => entry.pendingCount === 0);
39188
+ if (oldest) this.remove(oldest.id, true);
39189
+ }
39190
+ const entry = {
39191
+ accepting: true,
39192
+ active: true,
39193
+ appliedInvalidation: 0,
39194
+ compilation: new DefaultCompilationSession(),
39195
+ compilationRevision: 0,
39196
+ dependencies: /* @__PURE__ */ new Set(),
39197
+ id,
39198
+ invalidation: 0,
39199
+ pending: Promise.resolve(),
39200
+ pendingCount: 0,
39201
+ sources: []
39202
+ };
39203
+ this.roots.set(id, entry);
39204
+ return entry;
39205
+ }
39206
+ attachDependencies(entry, dependencies) {
39207
+ this.detachDependencies(entry);
39208
+ if (!entry.accepting) return;
39209
+ for (const dependency of dependencies) {
39210
+ entry.dependencies.add(dependency);
39211
+ let owners = this.dependencyRoots.get(dependency);
39212
+ if (!owners) {
39213
+ owners = /* @__PURE__ */ new Set();
39214
+ this.dependencyRoots.set(dependency, owners);
39215
+ }
39216
+ owners.add(entry.id);
39217
+ }
39218
+ }
39219
+ attachSources(entry, sources) {
39220
+ entry.sources = [...sources];
39221
+ }
39222
+ invalidate(ids) {
39223
+ const affected = /* @__PURE__ */ new Set();
39224
+ for (const id of ids) {
39225
+ const root = this.roots.get(id);
39226
+ if (root?.accepting) affected.add(root.id);
39227
+ for (const rootId of this.dependencyRoots.get(id) ?? []) affected.add(rootId);
39228
+ const sourcePath = stripSourceQuery(id);
39229
+ for (const sourceRoot of this.roots.values()) if (sourceRoot.accepting && sourceRoot.sources.length > 0 && require_generator.isFileMatchedByTailwindSourceEntries(sourcePath, sourceRoot.sources)) affected.add(sourceRoot.id);
39230
+ }
39231
+ for (const rootId of affected) {
39232
+ const entry = this.roots.get(rootId);
39233
+ if (entry?.accepting) entry.invalidation += 1;
39234
+ }
39235
+ return Object.freeze([...affected].sort());
39236
+ }
39237
+ trim() {
39238
+ while (this.roots.size > this.maxRoots) {
39239
+ const oldest = [...this.roots.values()].find((entry) => entry.pendingCount === 0);
39240
+ if (!oldest) return;
39241
+ this.remove(oldest.id, true);
39242
+ }
39243
+ }
39244
+ remove(id, notifyEvicted = false) {
39245
+ const pendingRelease = this.releasing.get(id);
39246
+ if (pendingRelease) return pendingRelease;
39247
+ const entry = this.roots.get(id);
39248
+ if (!entry) return Promise.resolve();
39249
+ entry.accepting = false;
39250
+ this.roots.delete(id);
39251
+ this.detachDependencies(entry);
39252
+ const release = entry.pending.then(() => {
39253
+ entry.active = false;
39254
+ entry.compilation.dispose();
39255
+ entry.compilationCache = void 0;
39256
+ disposeGenerator(entry.generator);
39257
+ entry.generator = void 0;
39258
+ entry.generationCache = void 0;
39259
+ entry.latestSnapshot = void 0;
39260
+ entry.source = void 0;
39261
+ entry.sourceInput = void 0;
39262
+ entry.sourceFingerprint = void 0;
39263
+ entry.sources = [];
39264
+ if (notifyEvicted) this.onRootEvicted?.(id);
39265
+ }).finally(() => {
39266
+ this.releasing.delete(id);
39267
+ });
39268
+ this.releasing.set(id, release);
39269
+ return release;
39270
+ }
39271
+ async dispose() {
39272
+ await Promise.all([...[...this.roots.keys()].map((id) => this.remove(id)), ...this.releasing.values()]);
39273
+ this.dependencyRoots.clear();
39274
+ }
39275
+ detachDependencies(entry) {
39276
+ for (const dependency of entry.dependencies) {
39277
+ const owners = this.dependencyRoots.get(dependency);
39278
+ owners?.delete(entry.id);
39279
+ if (owners?.size === 0) this.dependencyRoots.delete(dependency);
39280
+ }
39281
+ entry.dependencies.clear();
39282
+ }
39283
+ };
39284
+ function stripSourceQuery(id) {
39285
+ return id.replace(/[?#].*$/, "");
39286
+ }
39287
+ //#endregion
39288
+ //#region src/core/compiler/snapshot.ts
39289
+ const readonlySetValues = /* @__PURE__ */ new WeakMap();
39290
+ const snapshotRegistry = /* @__PURE__ */ new WeakMap();
39291
+ var ImmutableSetView = class {
39292
+ constructor(values) {
39293
+ readonlySetValues.set(this, new Set(values));
39294
+ Object.freeze(this);
39295
+ }
39296
+ get size() {
39297
+ return this.valuesSet.size;
39298
+ }
39299
+ get [Symbol.toStringTag]() {
39300
+ return "Set";
39301
+ }
39302
+ has(value) {
39303
+ return this.valuesSet.has(value);
39304
+ }
39305
+ entries() {
39306
+ return this.valuesSet.entries();
39307
+ }
39308
+ keys() {
39309
+ return this.valuesSet.keys();
39310
+ }
39311
+ values() {
39312
+ return this.valuesSet.values();
39313
+ }
39314
+ forEach(callbackfn, thisArg) {
39315
+ for (const value of this.valuesSet) callbackfn.call(thisArg, value, value, this);
39316
+ }
39317
+ [Symbol.iterator]() {
39318
+ return this.values();
39319
+ }
39320
+ get valuesSet() {
39321
+ return readonlySetValues.get(this);
39322
+ }
39323
+ };
39324
+ function uniqueSorted(values) {
39325
+ return Object.freeze([...new Set(values)].sort());
39326
+ }
39327
+ function sourceKey(source) {
39328
+ return `${source.base}\0${source.pattern}\0${source.negated ? "1" : "0"}`;
39329
+ }
39330
+ function uniqueSortedSources(sources) {
39331
+ const values = /* @__PURE__ */ new Map();
39332
+ for (const source of sources) {
39333
+ const cloned = Object.freeze({ ...source });
39334
+ values.set(sourceKey(cloned), cloned);
39335
+ }
39336
+ return Object.freeze([...values.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([, value]) => value));
39337
+ }
39338
+ function createRootFingerprint(root, target, classSet, dependencies, sources) {
39339
+ return [
39340
+ root.id,
39341
+ String(root.revision),
39342
+ target,
39343
+ ...[...classSet].sort(),
39344
+ ...dependencies,
39345
+ ...[...sources].map(sourceKey)
39346
+ ].join("\0");
39347
+ }
39348
+ function createSnapshotFromState(state, reusableClassSet, reusableClassSetView) {
39349
+ const roots = Object.freeze([...state.roots.values()].sort((left, right) => left.id.localeCompare(right.id)).map(({ id, revision }) => Object.freeze({
39350
+ id,
39351
+ revision
39352
+ })));
39353
+ const classSet = reusableClassSet ?? new Set(state.classSet);
39354
+ const fingerprint = [
39355
+ state.target,
39356
+ ...[...state.roots.values()].map((root) => `${root.id}\0${root.revision}\0${root.fingerprint}`).sort(),
39357
+ ...[...classSet].sort(),
39358
+ ...state.dependencies,
39359
+ ...state.sources.map(sourceKey)
39360
+ ].join("\0");
39361
+ const snapshot = Object.freeze({
39362
+ classSet: reusableClassSetView ?? new ImmutableSetView(classSet),
39363
+ dependencies: state.dependencies,
39364
+ roots,
39365
+ sources: state.sources,
39366
+ target: state.target
39367
+ });
39368
+ snapshotRegistry.set(snapshot, {
39369
+ ...state,
39370
+ classSet,
39371
+ fingerprint
39372
+ });
39373
+ return snapshot;
39374
+ }
39375
+ function createRegisteredCompilerSnapshot(request, reusableClassSet, reusableClassSetView) {
39376
+ if (!request.id) throw new Error("Compiler snapshot 的 root id 不能为空。");
39377
+ const revision = request.revision ?? 0;
39378
+ if (!Number.isSafeInteger(revision) || revision < 0) throw new Error(`Compiler snapshot revision 必须是非负安全整数:${revision}`);
39379
+ const target = request.target ?? "weapp";
39380
+ const classSet = new Set(request.classSet);
39381
+ const dependencies = uniqueSorted(request.dependencies ?? []);
39382
+ const sources = uniqueSortedSources(request.sources ?? []);
39383
+ const root = {
39384
+ id: request.id,
39385
+ revision
39386
+ };
39387
+ const internalRoot = {
39388
+ ...root,
39389
+ fingerprint: createRootFingerprint(root, target, classSet, dependencies, sources)
39390
+ };
39391
+ return createSnapshotFromState({
39392
+ classSet,
39393
+ dependencies,
39394
+ roots: /* @__PURE__ */ new Map([[root.id, internalRoot]]),
39395
+ sources,
39396
+ target
39397
+ }, reusableClassSet, reusableClassSetView);
39398
+ }
39399
+ function getInternalCompilerSnapshot(snapshot) {
39400
+ const state = snapshotRegistry.get(snapshot);
39401
+ if (!state) throw new Error("Compiler snapshot 必须由 createSnapshot()、generate() 或 mergeSnapshots() 创建。");
39402
+ return state;
39403
+ }
39404
+ function mergeRegisteredCompilerSnapshots(snapshots) {
39405
+ const states = [...snapshots].map(getInternalCompilerSnapshot);
39406
+ if (states.length === 0) throw new Error("mergeSnapshots() 至少需要一个 snapshot。");
39407
+ const target = states[0].target;
39408
+ const roots = /* @__PURE__ */ new Map();
39409
+ const classSet = /* @__PURE__ */ new Set();
39410
+ const dependencies = [];
39411
+ const sources = [];
39412
+ for (const state of states) {
39413
+ if (state.target !== target) throw new Error(`不能合并不同 target 的 snapshot:${target} 与 ${state.target}`);
39414
+ for (const root of state.roots.values()) {
39415
+ const current = roots.get(root.id);
39416
+ if (current && current.revision !== root.revision) throw new Error(`同一 root 不能合并不同 revision:${root.id} (${current.revision} / ${root.revision})`);
39417
+ if (current && current.fingerprint !== root.fingerprint) throw new Error(`同一 root revision 的 snapshot 内容冲突:${root.id}@${root.revision}`);
39418
+ roots.set(root.id, root);
39419
+ }
39420
+ for (const candidate of state.classSet) classSet.add(candidate);
39421
+ dependencies.push(...state.dependencies);
39422
+ sources.push(...state.sources);
39423
+ }
39424
+ return createSnapshotFromState({
39425
+ classSet: new Set([...classSet].sort()),
39426
+ dependencies: uniqueSorted(dependencies),
39427
+ roots,
39428
+ sources: uniqueSortedSources(sources),
39429
+ target
39430
+ });
39431
+ }
39432
+ function createImmutableSet(values) {
39433
+ return new ImmutableSetView(values);
39434
+ }
39435
+ //#endregion
39436
+ //#region src/cache/index.ts
39437
+ function isProcessResult(value) {
39438
+ return typeof value === "object" && value !== null && "result" in value;
39439
+ }
39440
+ function createCache(options) {
39441
+ const disabled = options === false;
39442
+ const hashMap = /* @__PURE__ */ new Map();
39443
+ const instance = new lru_cache.LRUCache({
39444
+ max: 1024,
39445
+ ttl: 0,
39446
+ ttlAutopurge: false
39447
+ });
39448
+ const cache = {
39449
+ hashMap,
39450
+ instance,
39451
+ hasHashKey(key) {
39452
+ return hashMap.has(key);
39453
+ },
39454
+ getHashValue(key) {
39455
+ return hashMap.get(key);
39456
+ },
39457
+ setHashValue(key, value) {
39458
+ return hashMap.set(key, value);
39459
+ },
39460
+ get(key) {
39461
+ return instance.get(key);
39462
+ },
39463
+ set(key, value) {
39464
+ return instance.set(key, value);
39465
+ },
39466
+ computeHash(message) {
39467
+ return (0, _weapp_tailwindcss_shared_node.md5)(message);
39468
+ },
39469
+ calcHashValueChanged(key, hash) {
39470
+ const hit = hashMap.get(key);
39471
+ if (hit) hashMap.set(key, {
39472
+ changed: hash !== hit.hash,
39473
+ hash
39474
+ });
39475
+ else hashMap.set(key, {
39476
+ changed: true,
39477
+ hash
39478
+ });
39479
+ return cache;
39480
+ },
39481
+ pruneHashKeys(hashKeys) {
39482
+ const activeHashKeys = new Set(hashKeys);
39483
+ for (const key of hashMap.keys()) if (!activeHashKeys.has(key)) hashMap.delete(key);
39484
+ },
39485
+ prune(options) {
39486
+ if (options.cacheKeys) {
39487
+ const cacheKeys = new Set(options.cacheKeys);
39488
+ for (const key of instance.keys()) if (!cacheKeys.has(key)) instance.delete(key);
39489
+ }
39490
+ if (options.hashKeys) cache.pruneHashKeys?.(options.hashKeys);
39491
+ },
39492
+ has(key) {
39493
+ return instance.has(key);
39494
+ },
39495
+ async process({ key, hashKey, rawSource, hash, resolveCache, transform, onCacheHit }) {
39496
+ if (disabled) {
39497
+ const value = await transform();
39498
+ return isProcessResult(value) ? value.result : value;
39499
+ }
39500
+ const cacheHashKey = hashKey ?? key;
39501
+ let hasChanged = true;
39502
+ if (hash != null || rawSource != null) {
39503
+ const nextHash = hash ?? cache.computeHash(rawSource);
39504
+ cache.calcHashValueChanged(cacheHashKey, nextHash);
39505
+ hasChanged = cache.getHashValue(cacheHashKey)?.changed ?? true;
39506
+ }
39507
+ const readCache = resolveCache ?? (() => cache.get(key));
39508
+ if (!hasChanged) {
39509
+ const cached = readCache();
39510
+ if (cached !== void 0) {
39511
+ await onCacheHit?.(cached);
39512
+ return cached;
39513
+ }
39514
+ }
39515
+ const value = await transform();
39516
+ const normalized = isProcessResult(value) ? value : { result: value };
39517
+ const stored = normalized.cacheValue ?? normalized.result;
39518
+ cache.set(key, stored);
39519
+ return normalized.result;
39520
+ }
39521
+ };
39522
+ return cache;
39523
+ }
39524
+ function initializeCache(cacheConfig) {
39525
+ if (typeof cacheConfig === "boolean" || cacheConfig === void 0) return createCache(cacheConfig);
39526
+ return cacheConfig;
39527
+ }
39528
+ //#endregion
39529
+ //#region src/framework/platform.ts
39530
+ const MPX_TO_UNI_PLATFORM = {
39531
+ ali: "mp-alipay",
39532
+ dd: "mp-dingtalk",
39533
+ jd: "mp-jd",
39534
+ qq: "mp-qq",
39535
+ swan: "mp-baidu",
39536
+ tt: "mp-toutiao",
39537
+ wx: "mp-weixin"
39538
+ };
39539
+ function normalizeFrameworkStylePlatform(platform, appType) {
39540
+ const normalized = platform?.trim().toLowerCase();
39541
+ if (!normalized) return;
39542
+ if (appType === "mpx") return MPX_TO_UNI_PLATFORM[normalized] ?? normalized;
39543
+ return normalized;
39544
+ }
39545
+ //#endregion
39546
+ //#region src/tailwindcss/runtime.ts
39547
+ const debug$1 = createDebug("[tailwindcss:runtime] ");
39548
+ const refreshTailwindcssRuntimeSymbol = Symbol.for("weapp-tailwindcss.refreshTailwindcssRuntime");
39549
+ function createTailwindRuntimeReadyPromise(tailwindRuntime) {
39550
+ return Promise.resolve().then(async () => {
39551
+ require_tailwindcss.invalidateRuntimeClassSet(tailwindRuntime);
39552
+ });
39553
+ }
39554
+ const runtimeClassSetStateCache = /* @__PURE__ */ new WeakMap();
39555
+ function getRuntimeClassSetStateEntry(state) {
39556
+ let entry = runtimeClassSetStateCache.get(state);
39557
+ if (!entry) {
39558
+ entry = {};
39559
+ runtimeClassSetStateCache.set(state, entry);
39560
+ }
39561
+ return entry;
39562
+ }
39563
+ function getTailwindRuntime(state) {
39564
+ return state.tailwindRuntime;
39565
+ }
39566
+ function setTailwindRuntime(state, runtime) {
39567
+ state.tailwindRuntime = runtime;
39568
+ }
39569
+ function getRefreshTailwindRuntime(state) {
39570
+ return state.refreshTailwindcssRuntime;
39571
+ }
39572
+ async function refreshTailwindRuntimeState(state, forceOrOptions) {
39573
+ const normalizedOptions = typeof forceOrOptions === "boolean" ? { force: forceOrOptions } : forceOrOptions;
39574
+ const force = normalizedOptions.force;
39575
+ const clearCache = normalizedOptions.clearCache === true;
39576
+ if (!force) return false;
39577
+ const currentRuntime = getTailwindRuntime(state);
39578
+ debug$1("refresh runtime state start, clearCache=%s major=%s", clearCache, currentRuntime.majorVersion ?? "unknown");
39579
+ await state.readyPromise;
39580
+ let refreshed = false;
39581
+ const refreshTailwindRuntime = getRefreshTailwindRuntime(state);
39582
+ if (typeof refreshTailwindRuntime === "function") {
39583
+ const next = await refreshTailwindRuntime({ clearCache });
39584
+ if (next !== getTailwindRuntime(state)) setTailwindRuntime(state, next);
39585
+ refreshed = true;
39586
+ }
39587
+ if (refreshed) state.readyPromise = createTailwindRuntimeReadyPromise(getTailwindRuntime(state));
39588
+ debug$1("refresh runtime state end, refreshed=%s major=%s", refreshed, getTailwindRuntime(state).majorVersion ?? "unknown");
39589
+ return refreshed;
39590
+ }
39591
+ async function ensureRuntimeClassSet(state, options = {}) {
39592
+ const forceRefresh = options.forceRefresh === true;
39593
+ const forceCollect = options.forceCollect === true;
39594
+ const clearCache = options.clearCache === true;
39595
+ const allowEmpty = options.allowEmpty === true;
39596
+ if (forceRefresh) await refreshTailwindRuntimeState(state, {
39597
+ force: true,
39598
+ clearCache
39599
+ });
39600
+ await state.readyPromise;
39601
+ const entry = getRuntimeClassSetStateEntry(state);
39602
+ const signature = await require_tailwindcss.getRuntimeClassSetSignatureWithSources(getTailwindRuntime(state));
39603
+ const signatureChanged = entry.signature !== signature;
39604
+ const shouldForceCollect = forceCollect || forceRefresh || signatureChanged;
39605
+ if (!shouldForceCollect) {
39606
+ if (entry.value && (allowEmpty || entry.value.size > 0)) return entry.value;
39607
+ if (entry.promise) return entry.promise;
39608
+ }
39609
+ const task = (async () => {
39610
+ const collected = await collectRuntimeClassSet(getTailwindRuntime(state), {
39611
+ force: shouldForceCollect,
39612
+ skipRefresh: true,
39613
+ clearCache
39614
+ });
39615
+ if (allowEmpty || collected.size > 0) return collected;
39616
+ await refreshTailwindRuntimeState(state, {
39617
+ force: true,
39618
+ clearCache: true
39619
+ });
39620
+ await state.readyPromise;
39621
+ return collectRuntimeClassSet(getTailwindRuntime(state), {
39622
+ force: true,
39623
+ skipRefresh: true,
39624
+ clearCache: true
39625
+ });
39626
+ })();
39627
+ entry.promise = task;
39628
+ try {
39629
+ const runtimeSet = await task;
39630
+ entry.value = runtimeSet;
39631
+ entry.signature = await require_tailwindcss.getRuntimeClassSetSignatureWithSources(getTailwindRuntime(state));
39632
+ return runtimeSet;
39633
+ } finally {
39634
+ if (entry.promise === task) entry.promise = void 0;
39635
+ }
39636
+ }
39637
+ function tryGetRuntimeClassSetSync(tailwindRuntime) {
39638
+ if (typeof tailwindRuntime.getClassSetSync !== "function") return;
39639
+ try {
39640
+ const set = tailwindRuntime.getClassSetSync();
39641
+ if (set && set.size === 0) return;
39642
+ return set;
39643
+ } catch (error) {
39644
+ debug$1("getClassSetSync() unavailable for tailwindcss v4, fallback to async getClassSet(): %O", error);
39645
+ return;
39646
+ }
39647
+ }
39648
+ async function collectTailwindV4GeneratorClassSet(tailwindRuntime) {
39649
+ if (typeof tailwindRuntime.collectContentTokens !== "function") return;
39650
+ try {
39651
+ const source = require_generator.resolveCssMacroTailwindV4Source(await require_generator.resolveTailwindV4SourceFromRuntime(tailwindRuntime));
39652
+ const generated = await require_generator.createTailwindV4Engine(source).generate({
39653
+ scanSources: true,
39654
+ target: "web"
39655
+ });
39656
+ const designSystem = await (0, _tailwindcss_mangle_engine.loadTailwindV4DesignSystem)(source);
39657
+ const classSet = (0, _tailwindcss_mangle_engine.resolveValidTailwindV4Candidates)(designSystem, generated.classSet, { ...source.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: source.bareArbitraryValues } });
39658
+ debug$1("runtime class set resolved via tailwindcss v4 generator source scan, raw=%d valid=%d", generated.classSet.size, classSet.size);
39659
+ return classSet;
39660
+ } catch (error) {
39661
+ debug$1("tailwindcss v4 generator source scan failed, continuing fallback chain: %O", error);
39662
+ return;
39663
+ }
39664
+ }
39665
+ async function mergeTailwindV4GeneratorClassSet(tailwindRuntime, classSet) {
39666
+ const generatorClassSet = await collectTailwindV4GeneratorClassSet(tailwindRuntime).catch(() => void 0);
39667
+ if (!generatorClassSet || generatorClassSet.size === 0) return classSet;
39668
+ return /* @__PURE__ */ new Set([...classSet, ...generatorClassSet]);
39669
+ }
39670
+ async function collectRuntimeClassSet(tailwindRuntime, options = {}) {
39671
+ let activeRuntime = tailwindRuntime;
39672
+ if (options.force && !options.skipRefresh) {
39673
+ const refresh = activeRuntime[refreshTailwindcssRuntimeSymbol];
39674
+ if (typeof refresh === "function") try {
39675
+ const refreshed = await refresh({ clearCache: options.clearCache === true });
39676
+ if (refreshed) activeRuntime = refreshed;
39677
+ } catch (error) {
39678
+ debug$1("refreshTailwindcssRuntime failed, continuing with existing runtime: %O", error);
39679
+ }
39680
+ }
39681
+ const entry = require_tailwindcss.getRuntimeClassSetCacheEntry(activeRuntime);
39682
+ const signature = await require_tailwindcss.getRuntimeClassSetSignatureWithSources(activeRuntime);
39683
+ if (!options.force) {
39684
+ if (entry.value && entry.signature === signature) return entry.value;
39685
+ if (entry.promise) return entry.promise;
39686
+ } else entry.value = void 0;
39687
+ const task = (async () => {
39688
+ const preferExtract = options.force === true;
39689
+ try {
39690
+ const result = await activeRuntime.extract({ write: false });
39691
+ if (result?.classSet) {
39692
+ if (result.classSet.size > 0) {
39693
+ const merged = await mergeTailwindV4GeneratorClassSet(activeRuntime, result.classSet);
39694
+ debug$1("runtime class set resolved via extract() + tailwindcss v4 source scan, extract=%d merged=%d", result.classSet.size, merged.size);
39695
+ return merged;
39696
+ }
39697
+ if (preferExtract) debug$1("runtime class set from extract() is empty on force collect, fallback to generator/sync/async class set");
39698
+ else debug$1("runtime class set from extract() is empty, fallback to sync/async class set");
39699
+ }
39700
+ } catch (error) {
39701
+ debug$1("extract() failed, fallback to getClassSet(): %O", error);
39702
+ }
39703
+ const generatorClassSet = await collectTailwindV4GeneratorClassSet(activeRuntime);
39704
+ if (generatorClassSet && generatorClassSet.size > 0) return generatorClassSet;
39705
+ const syncSet = tryGetRuntimeClassSetSync(activeRuntime);
39706
+ if (syncSet) {
39707
+ debug$1("runtime class set resolved via getClassSetSync(), size=%d", syncSet.size);
39708
+ return syncSet;
39709
+ }
39710
+ try {
39711
+ const fallbackSet = await Promise.resolve(activeRuntime.getClassSet());
39712
+ if (fallbackSet) {
39713
+ debug$1("runtime class set resolved via getClassSet(), size=%d", fallbackSet.size);
39714
+ return fallbackSet;
39715
+ }
39716
+ } catch (error) {
39717
+ debug$1("getClassSet() failed, returning empty set: %O", error);
39718
+ }
39719
+ return /* @__PURE__ */ new Set();
39720
+ })();
39721
+ entry.promise = task;
39722
+ entry.signature = signature;
39723
+ try {
39724
+ const resolved = await task;
39725
+ entry.value = resolved;
39726
+ entry.promise = void 0;
39727
+ entry.signature = signature;
39728
+ return resolved;
39729
+ } catch (error) {
39730
+ entry.promise = void 0;
39731
+ throw error;
39732
+ }
39733
+ }
39734
+ //#endregion
39735
+ //#region src/tailwindcss/runtime-logs.ts
39736
+ const runtimeLogDedupeHolder = globalThis;
39737
+ const runtimeLogDedupe = runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ ?? (runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ = /* @__PURE__ */ new Set());
39738
+ function createRuntimeLogKey(category, baseDir, rootPath, version) {
39739
+ return JSON.stringify([
39740
+ category,
39741
+ baseDir ?? node_process.default.cwd(),
39742
+ rootPath ?? "",
39743
+ version ?? ""
39744
+ ]);
39745
+ }
39746
+ function markRuntimeLog(category, baseDir, rootPath, version) {
39747
+ const key = createRuntimeLogKey(category, baseDir, rootPath, version);
39748
+ if (runtimeLogDedupe.has(key)) return false;
39749
+ runtimeLogDedupe.add(key);
39750
+ return true;
39751
+ }
39752
+ function logRuntimeTailwindcssTarget(baseDir, rootPath, version) {
39753
+ if (!markRuntimeLog("target", baseDir, rootPath, version)) return;
39754
+ const versionText = version ? ` (v${version})` : "";
39755
+ _weapp_tailwindcss_logger.logger.info("%s 使用 Tailwind CSS%s", "Weapp-tailwindcss", versionText);
39756
+ }
39757
+ function logRuntimeTailwindcssVersion(baseDir, rootPath, version) {
39758
+ if (version) {
39759
+ if (!markRuntimeLog("version", baseDir, rootPath, version)) return;
39760
+ _weapp_tailwindcss_logger.logger.success(`当前使用 ${_weapp_tailwindcss_logger.pc.cyanBright("Tailwind CSS")} 版本为: ${_weapp_tailwindcss_logger.pc.underline(_weapp_tailwindcss_logger.pc.bold(_weapp_tailwindcss_logger.pc.green(version)))}`);
39761
+ return;
39762
+ }
39763
+ if (!markRuntimeLog("missing", baseDir, rootPath, version)) return;
39764
+ _weapp_tailwindcss_logger.logger.warn(`${_weapp_tailwindcss_logger.pc.cyanBright("Tailwind CSS")} 未安装,已跳过版本检测与运行时初始化。`);
39765
+ }
39766
+ //#endregion
39767
+ //#region src/tailwindcss/targets.ts
39768
+ function formatRelativeToBase(targetPath, baseDir) {
39769
+ const normalized = node_path.default.normalize(targetPath);
39770
+ if (!baseDir) return normalized.replace(/\\/g, "/");
39771
+ const relative = node_path.default.relative(baseDir, normalized);
39772
+ if (!relative || relative === ".") return ".";
39773
+ if (relative.startsWith("..")) return normalized.replace(/\\/g, "/");
39774
+ return node_path.default.join(".", relative).replace(/\\/g, "/");
39775
+ }
39776
+ function logTailwindcssTarget(tailwindRuntime, baseDir) {
39777
+ const packageInfo = tailwindRuntime?.packageInfo;
39778
+ const label = "Weapp-tailwindcss";
39779
+ if (!packageInfo?.rootPath) {
39780
+ _weapp_tailwindcss_logger.logger.warn("%s 未找到 Tailwind CSS 依赖,请检查在 %s 是否已安装 tailwindcss", label, baseDir ?? node_process.default.cwd());
39781
+ return;
39782
+ }
39783
+ const displayPath = formatRelativeToBase(packageInfo.rootPath, baseDir);
39784
+ const version = packageInfo.version ? ` (v${packageInfo.version})` : "";
39785
+ logRuntimeTailwindcssTarget(baseDir, packageInfo.rootPath, packageInfo.version);
39786
+ _weapp_tailwindcss_logger.logger.debug("%s 解析 Tailwind CSS -> %s%s", label, displayPath, version);
39787
+ }
39788
+ //#endregion
39789
+ //#region src/unocss/index.ts
39790
+ function normalizeUnocssOptions(unocss) {
39791
+ return require_generator.resolveBooleanObjectOption(unocss, {});
39792
+ }
39793
+ function resolveUnocssBareArbitraryValues(arbitraryValues, unocss) {
39794
+ const baseArbitraryValues = arbitraryValues ?? {};
39795
+ const options = normalizeUnocssOptions(unocss);
39796
+ if (!options) return baseArbitraryValues;
39797
+ if (baseArbitraryValues.bareArbitraryValues !== void 0 && baseArbitraryValues.bareArbitraryValues !== false) return baseArbitraryValues;
39798
+ const bareArbitraryValues = options.bareArbitraryValues ?? true;
39799
+ if (bareArbitraryValues === false) return baseArbitraryValues;
39800
+ return {
39801
+ ...baseArbitraryValues,
39802
+ bareArbitraryValues
39803
+ };
39804
+ }
39805
+ //#endregion
39806
+ //#region src/context/compiler-context-cache.ts
39807
+ const PAREN_CONTENT_RE = /\(([^)]+)\)/u;
39808
+ const AT_LOCATION_RE = /at\s+(\S.*)$/u;
39809
+ const TRAILING_LINE_COL_RE = /:\d+(?::\d+)?$/u;
39810
+ const DEFAULT_COMPILER_CONTEXT_CACHE_MAX = 32;
39811
+ const DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX = 64;
39812
+ const globalCacheHolder = globalThis;
39813
+ const compilerContextCache = globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
39814
+ const compilerContextKeyCacheByOptions = /* @__PURE__ */ new WeakMap();
39815
+ const compilerContextKeyCacheWithoutOptions = /* @__PURE__ */ new Map();
39816
+ function resolveCompilerContextCacheMax(defaultValue) {
39817
+ const raw = Number.parseInt(node_process.default.env["WEAPP_TW_COMPILER_CONTEXT_CACHE_MAX"] ?? "", 10);
39818
+ if (!Number.isFinite(raw) || raw <= 0) return defaultValue;
39819
+ return Math.floor(raw);
39820
+ }
39821
+ function touchMapValue(map, key, value) {
39822
+ map.delete(key);
39823
+ map.set(key, value);
39824
+ }
39825
+ function pruneMapToMaxSize(map, maxSize) {
39826
+ while (map.size > maxSize) {
39827
+ const firstKey = map.keys().next().value;
39828
+ if (firstKey === void 0) break;
39829
+ map.delete(firstKey);
39830
+ }
39831
+ }
39832
+ function withCircularGuard(value, stack, factory) {
39833
+ if (stack.has(value)) throw new TypeError("Cannot serialize circular structure in compiler context options");
39834
+ stack.add(value);
39835
+ try {
39836
+ return factory();
39837
+ } finally {
39838
+ stack.delete(value);
39839
+ }
39840
+ }
39841
+ function encodeTaggedValue(type, value) {
39842
+ const record = { __type: type };
39843
+ if (value !== void 0) record["value"] = value;
39844
+ return record;
39845
+ }
39846
+ function hasExplicitOptionBasedir(opts) {
39847
+ return typeof opts?.tailwindcssBasedir === "string" && opts.tailwindcssBasedir.length > 0;
39848
+ }
39849
+ function shouldProbeCallerLocation(opts) {
39850
+ if (hasExplicitOptionBasedir(opts)) return false;
39851
+ return !(node_process.default.env["WEAPP_TAILWINDCSS_BASEDIR"] || node_process.default.env["WEAPP_TAILWINDCSS_BASE_DIR"] || node_process.default.env["TAILWINDCSS_BASEDIR"] || node_process.default.env["TAILWINDCSS_BASE_DIR"]);
39852
+ }
39853
+ function detectCallerLocation() {
39854
+ const stack = (/* @__PURE__ */ new Error("compiler-context-cache stack probe")).stack;
39855
+ if (!stack) return;
39856
+ const lines = stack.split("\n");
39857
+ for (const line of lines) {
39858
+ const location = (line.match(PAREN_CONTENT_RE) ?? line.match(AT_LOCATION_RE))?.[1];
39859
+ if (!location) continue;
39860
+ const candidatePath = location.replace(TRAILING_LINE_COL_RE, "");
39861
+ if (!candidatePath || !node_path.default.isAbsolute(candidatePath)) continue;
39862
+ if (candidatePath.includes(`${node_path.default.sep}weapp-tailwindcss${node_path.default.sep}src${node_path.default.sep}`) || candidatePath.includes(`${node_path.default.sep}weapp-tailwindcss${node_path.default.sep}dist${node_path.default.sep}`) || candidatePath.includes(`${node_path.default.sep}node_modules${node_path.default.sep}weapp-tailwindcss${node_path.default.sep}`)) continue;
39863
+ return candidatePath;
39864
+ }
39865
+ }
39866
+ function getRuntimeCacheScope(opts) {
39867
+ if (hasExplicitOptionBasedir(opts)) return { caller: void 0 };
39868
+ const runtimeScope = {
39869
+ caller: void 0,
39870
+ cwd: node_process.default.cwd(),
39871
+ init_cwd: node_process.default.env["INIT_CWD"],
39872
+ npm_config_local_prefix: node_process.default.env["npm_config_local_prefix"],
39873
+ npm_package_json: node_process.default.env["npm_package_json"],
39874
+ pnpm_package_name: node_process.default.env["PNPM_PACKAGE_NAME"],
39875
+ pwd: node_process.default.env["PWD"],
39876
+ tailwindcss_base_dir: node_process.default.env["TAILWINDCSS_BASE_DIR"],
39877
+ tailwindcss_basedir: node_process.default.env["TAILWINDCSS_BASEDIR"],
39878
+ uni_app_input_dir: node_process.default.env["UNI_APP_INPUT_DIR"],
39879
+ uni_cli_root: node_process.default.env["UNI_CLI_ROOT"],
39880
+ uni_input_dir: node_process.default.env["UNI_INPUT_DIR"],
39881
+ uni_input_root: node_process.default.env["UNI_INPUT_ROOT"],
39882
+ weapp_tailwindcss_base_dir: node_process.default.env["WEAPP_TAILWINDCSS_BASE_DIR"],
39883
+ weapp_tailwindcss_basedir: node_process.default.env["WEAPP_TAILWINDCSS_BASEDIR"]
39884
+ };
39885
+ if (shouldProbeCallerLocation(opts)) runtimeScope.caller = detectCallerLocation();
39886
+ return runtimeScope;
39887
+ }
39888
+ function serializeNormalizedValue(value) {
39889
+ return JSON.stringify(value);
39890
+ }
39891
+ function createRuntimeCacheScopeKey(opts) {
39892
+ return serializeNormalizedValue(normalizeOptionsValue(getRuntimeCacheScope(opts)));
39893
+ }
39894
+ function getCompilerContextKeyCacheStore(opts) {
39895
+ if (!opts) return compilerContextKeyCacheWithoutOptions;
39896
+ let store = compilerContextKeyCacheByOptions.get(opts);
39897
+ if (!store) {
39898
+ store = /* @__PURE__ */ new Map();
39899
+ compilerContextKeyCacheByOptions.set(opts, store);
39900
+ }
39901
+ return store;
39902
+ }
39903
+ function createComparableNormalizedValue(rawValue, stack) {
39904
+ const normalized = normalizeOptionsValue(rawValue, stack);
39905
+ return {
39906
+ normalized,
39907
+ sortKey: serializeNormalizedValue(normalized)
39908
+ };
39909
+ }
39910
+ function getRuntimeCacheScopeValue(opts) {
39911
+ return {
39912
+ options: opts ?? {},
39913
+ runtime: getRuntimeCacheScope(opts)
39914
+ };
39915
+ }
39916
+ function normalizeOptionsValue(rawValue, stack = /* @__PURE__ */ new WeakSet()) {
39917
+ if (rawValue === null) return null;
39918
+ if (rawValue === void 0) return encodeTaggedValue("Undefined");
39919
+ const type = typeof rawValue;
39920
+ if (type === "string") return rawValue;
39921
+ if (type === "boolean") return rawValue;
39922
+ if (type === "number") {
39923
+ const numericValue = rawValue;
39924
+ if (Number.isNaN(numericValue)) return encodeTaggedValue("Number", "NaN");
39925
+ if (!Number.isFinite(numericValue)) return encodeTaggedValue("Number", numericValue > 0 ? "Infinity" : "-Infinity");
39926
+ if (Object.is(numericValue, -0)) return encodeTaggedValue("Number", "-0");
39927
+ return numericValue;
39928
+ }
39929
+ if (type === "bigint") return encodeTaggedValue("BigInt", rawValue.toString());
39930
+ if (type === "symbol") {
39931
+ const symbolValue = rawValue;
39932
+ return encodeTaggedValue("Symbol", symbolValue.description ?? String(symbolValue));
39933
+ }
39934
+ if (type === "function") return encodeTaggedValue("Function", rawValue.toString());
39935
+ if (Array.isArray(rawValue)) return withCircularGuard(rawValue, stack, () => rawValue.map((item) => normalizeOptionsValue(item, stack)));
39936
+ if (rawValue instanceof Date) return encodeTaggedValue("Date", rawValue.toISOString());
39937
+ if (rawValue instanceof RegExp) return {
39938
+ __type: "RegExp",
39939
+ source: rawValue.source,
39940
+ flags: rawValue.flags
39941
+ };
39942
+ if (typeof node_buffer.Buffer !== "undefined" && node_buffer.Buffer.isBuffer(rawValue)) return encodeTaggedValue("Buffer", rawValue.toString("base64"));
39943
+ if (ArrayBuffer.isView(rawValue)) {
39944
+ const view = rawValue;
39945
+ const buffer = node_buffer.Buffer.from(view.buffer, view.byteOffset, view.byteLength);
39946
+ return encodeTaggedValue(view.constructor?.name ?? "ArrayBufferView", buffer.toString("base64"));
39947
+ }
39948
+ if (rawValue instanceof ArrayBuffer) return encodeTaggedValue("ArrayBuffer", node_buffer.Buffer.from(rawValue).toString("base64"));
39949
+ if (rawValue instanceof Set) return withCircularGuard(rawValue, stack, () => {
39950
+ const normalizedEntries = Array.from(rawValue, (element) => createComparableNormalizedValue(element, stack));
39951
+ normalizedEntries.sort((a, b) => a.sortKey.localeCompare(b.sortKey));
39952
+ return {
39953
+ __type: "Set",
39954
+ value: normalizedEntries.map((entry) => entry.normalized)
39955
+ };
39956
+ });
39957
+ if (rawValue instanceof Map) return withCircularGuard(rawValue, stack, () => {
39958
+ const normalizedEntries = Array.from(rawValue.entries(), ([key, entryValue]) => {
39959
+ const normalizedKey = createComparableNormalizedValue(key, stack);
39960
+ return {
39961
+ key: normalizedKey.normalized,
39962
+ sortKey: normalizedKey.sortKey,
39963
+ value: normalizeOptionsValue(entryValue, stack)
39964
+ };
39965
+ });
39966
+ normalizedEntries.sort((a, b) => a.sortKey.localeCompare(b.sortKey));
39967
+ return {
39968
+ __type: "Map",
39969
+ value: normalizedEntries.map((entry) => [entry.key, entry.value])
39970
+ };
39971
+ });
39972
+ if (typeof URL !== "undefined" && rawValue instanceof URL) return encodeTaggedValue("URL", rawValue.toString());
39973
+ if (rawValue instanceof Error) {
39974
+ const errorValue = rawValue;
39975
+ return {
39976
+ __type: "Error",
39977
+ name: errorValue.name,
39978
+ message: errorValue.message,
39979
+ stack: errorValue.stack ?? ""
39980
+ };
39981
+ }
39982
+ if (rawValue instanceof Promise) return encodeTaggedValue("Promise");
39983
+ if (rawValue instanceof WeakMap) return encodeTaggedValue("WeakMap");
39984
+ if (rawValue instanceof WeakSet) return encodeTaggedValue("WeakSet");
39985
+ if (rawValue && typeof rawValue === "object") return withCircularGuard(rawValue, stack, () => {
39986
+ const result = {};
39987
+ const entries = Object.entries(rawValue);
39988
+ entries.sort(([a], [b]) => a.localeCompare(b));
39989
+ for (const [key, entryValue] of entries) result[key] = normalizeOptionsValue(entryValue, stack);
39990
+ return result;
39991
+ });
39992
+ return encodeTaggedValue(typeof rawValue, String(rawValue));
39993
+ }
39994
+ function createCompilerContextCacheKey(opts) {
39995
+ try {
39996
+ const runtimeCacheScopeKey = createRuntimeCacheScopeKey(opts);
39997
+ const keyStore = getCompilerContextKeyCacheStore(opts);
39998
+ const cached = keyStore.get(runtimeCacheScopeKey);
39999
+ if (cached !== void 0) return cached;
40000
+ const normalized = normalizeOptionsValue(getRuntimeCacheScopeValue(opts));
40001
+ const cacheKey = (0, _weapp_tailwindcss_shared_node.md5)(serializeNormalizedValue(normalized));
40002
+ touchMapValue(keyStore, runtimeCacheScopeKey, cacheKey);
40003
+ pruneMapToMaxSize(keyStore, resolveCompilerContextCacheMax(DEFAULT_COMPILER_CONTEXT_KEY_CACHE_MAX));
40004
+ return cacheKey;
40005
+ } catch (error) {
40006
+ _weapp_tailwindcss_logger.logger.debug("skip compiler context cache: %O", error);
40007
+ return;
40008
+ }
40009
+ }
40010
+ function withCompilerContextCache(opts, factory) {
40011
+ const cacheKey = createCompilerContextCacheKey(opts);
40012
+ if (cacheKey) {
40013
+ const cached = compilerContextCache.get(cacheKey);
40014
+ if (cached) {
40015
+ touchMapValue(compilerContextCache, cacheKey, cached);
40016
+ return cached;
40017
+ }
40018
+ }
40019
+ const ctx = factory();
40020
+ if (cacheKey) {
40021
+ touchMapValue(compilerContextCache, cacheKey, ctx);
40022
+ pruneMapToMaxSize(compilerContextCache, resolveCompilerContextCacheMax(DEFAULT_COMPILER_CONTEXT_CACHE_MAX));
40023
+ }
40024
+ return ctx;
40025
+ }
40026
+ //#endregion
40027
+ //#region src/context/custom-attributes.ts
40028
+ function toCustomAttributesEntities(customAttributes) {
40029
+ if (!customAttributes) return [];
40030
+ if ((0, _weapp_tailwindcss_shared.isMap)(customAttributes)) return [...customAttributes.entries()];
40031
+ return Object.entries(customAttributes);
40032
+ }
40033
+ //#endregion
40034
+ //#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.147.0_oxc-parser@0.147.0_rolldown@1.2.6/node_modules/oxc-walker/dist/index.mjs
40035
+ function isNode(v) {
40036
+ return v !== null && typeof v === "object" && typeof v.type === "string";
40037
+ }
40038
+ var WalkerBase = class {
40039
+ constructor(handler, options) {
40040
+ require_generator._defineProperty(this, "scopeTracker", void 0);
40041
+ require_generator._defineProperty(this, "enter", void 0);
40042
+ require_generator._defineProperty(this, "leave", void 0);
40043
+ require_generator._defineProperty(this, "contextEnter", {
40044
+ skip: () => {
40045
+ this._skip = true;
40046
+ },
40047
+ remove: () => {
40048
+ this._remove = true;
40049
+ },
40050
+ replace: (node) => {
40051
+ this._replacement = node;
40052
+ }
40053
+ });
40054
+ require_generator._defineProperty(this, "contextLeave", {
40055
+ remove: this.contextEnter.remove,
40056
+ replace: this.contextEnter.replace
40057
+ });
40058
+ require_generator._defineProperty(this, "_skip", false);
40059
+ require_generator._defineProperty(this, "_remove", false);
40060
+ require_generator._defineProperty(this, "_replacement", null);
40061
+ this.enter = handler.enter;
40062
+ this.leave = handler.leave;
40063
+ this.scopeTracker = options?.scopeTracker;
40064
+ }
40065
+ replace(parent, key, index, node) {
40066
+ if (!parent || key === null) return;
40067
+ if (index !== null) parent[key][index] = node;
40068
+ else parent[key] = node;
40069
+ }
40070
+ insert(parent, key, index, node) {
40071
+ if (!parent || key === null) return;
40072
+ if (index !== null) parent[key].splice(index, 0, node);
40073
+ else parent[key] = node;
40074
+ }
40075
+ remove(parent, key, index) {
40076
+ if (!parent || key === null) return;
40077
+ if (index !== null) parent[key].splice(index, 1);
40078
+ else delete parent[key];
40079
+ }
40080
+ };
40081
+ var WalkerSync = class extends WalkerBase {
40082
+ constructor(handler, options) {
40083
+ super(handler, options);
40084
+ }
40085
+ traverse(input, key, index, parent) {
40086
+ const ctx = {
40087
+ key: null,
40088
+ index: index ?? null,
40089
+ ast: input
40090
+ };
40091
+ const scopeTracker = this.scopeTracker;
40092
+ const enter = this.enter;
40093
+ const leave = this.leave;
40094
+ const contextEnter = this.contextEnter;
40095
+ const contextLeave = this.contextLeave;
40096
+ const _walk = (input, parent, key, index, skip) => {
40097
+ if (scopeTracker) scopeTracker.processNodeEnter(input);
40098
+ let currentNode = input;
40099
+ let removedInEnter = false;
40100
+ let replacedInEnter = false;
40101
+ let skipChildren = skip;
40102
+ if (enter && !skip) {
40103
+ const _skip = this._skip;
40104
+ const _remove = this._remove;
40105
+ const _replacement = this._replacement;
40106
+ this._skip = false;
40107
+ this._remove = false;
40108
+ this._replacement = null;
40109
+ ctx.key = key;
40110
+ ctx.index = index;
40111
+ enter.call(contextEnter, input, parent, ctx);
40112
+ if (this._replacement && !this._remove) {
40113
+ currentNode = this._replacement;
40114
+ replacedInEnter = true;
40115
+ this.replace(parent, key, index, this._replacement);
40116
+ if (scopeTracker) scopeTracker.processNodeEnter(currentNode);
40117
+ }
40118
+ if (this._remove) {
40119
+ removedInEnter = true;
40120
+ currentNode = null;
40121
+ this.remove(parent, key, index);
40122
+ }
40123
+ if (this._skip) skipChildren = true;
40124
+ this._skip = _skip;
40125
+ this._remove = _remove;
40126
+ this._replacement = _replacement;
40127
+ }
40128
+ if ((!skipChildren || scopeTracker) && currentNode) for (const k in currentNode) {
40129
+ if (k === "type" || k === "start" || k === "end") continue;
40130
+ const node = currentNode[k];
40131
+ if (!node || typeof node !== "object") continue;
40132
+ if (Array.isArray(node)) for (let i = 0; i < node.length; i++) {
40133
+ const child = node[i];
40134
+ if (isNode(child)) {
40135
+ if (_walk(child, currentNode, k, i, skipChildren) === null) i--;
40136
+ }
40137
+ }
40138
+ else if (typeof node.type === "string") _walk(node, currentNode, k, null, skipChildren);
40139
+ }
40140
+ if (scopeTracker) {
40141
+ if (replacedInEnter) scopeTracker.processNodeLeave(currentNode);
40142
+ scopeTracker.processNodeLeave(input);
40143
+ }
40144
+ if (leave && !skip) {
40145
+ const _replacement = this._replacement;
40146
+ const _remove = this._remove;
40147
+ this._replacement = null;
40148
+ this._remove = false;
40149
+ ctx.key = key;
40150
+ ctx.index = index;
40151
+ leave.call(contextLeave, input, parent, ctx);
40152
+ if (this._replacement && !this._remove) {
40153
+ currentNode = this._replacement;
40154
+ if (removedInEnter) this.insert(parent, key, index, this._replacement);
40155
+ else this.replace(parent, key, index, this._replacement);
40156
+ }
40157
+ if (this._remove) {
40158
+ currentNode = null;
40159
+ this.remove(parent, key, index);
40160
+ }
40161
+ this._replacement = _replacement;
40162
+ this._remove = _remove;
40163
+ }
40164
+ return currentNode;
40165
+ };
40166
+ if (!isNode(input)) return null;
40167
+ if (scopeTracker) scopeTracker.onWalkStart(input);
40168
+ if (scopeTracker && !enter && !leave) {
40169
+ const _walkScopesOnly = (input) => {
40170
+ scopeTracker.processNodeEnter(input);
40171
+ for (const k in input) {
40172
+ if (k === "type" || k === "start" || k === "end") continue;
40173
+ const node = input[k];
40174
+ if (!node || typeof node !== "object") continue;
40175
+ if (Array.isArray(node)) for (let i = 0; i < node.length; i++) {
40176
+ const child = node[i];
40177
+ if (isNode(child)) _walkScopesOnly(child);
40178
+ }
40179
+ else if (typeof node.type === "string") _walkScopesOnly(node);
40180
+ }
40181
+ scopeTracker.processNodeLeave(input);
40182
+ };
40183
+ _walkScopesOnly(input);
40184
+ return input;
40185
+ }
40186
+ return _walk(input, parent ?? null, key ?? null, index ?? null, false);
40187
+ }
40188
+ };
40189
+ /**
40190
+ * Walk the AST with the given options.
40191
+ * @param input The AST to walk.
40192
+ * @param options The options to be used when walking the AST. Here you can specify the callbacks for entering and leaving nodes, as well as other options.
40193
+ */
40194
+ function walk(input, options) {
40195
+ return new WalkerSync({
40196
+ enter: options.enter,
40197
+ leave: options.leave
40198
+ }, { scopeTracker: options.scopeTracker }).traverse(input);
40199
+ }
40200
+ //#endregion
40201
+ //#region src/js/literal-transform.ts
40202
+ function transformLiteralText(literal, options, classContext = true) {
40203
+ if (!options.alwaysEscape && (!options.classNameSet || options.classNameSet.size === 0)) return;
40204
+ const source = options.unescapeUnicode && literal.includes("\\u") ? decodeUnicode2(literal) : literal;
40205
+ const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(source);
40206
+ if (candidates.length === 0) return;
40207
+ const transformOptions = {
40208
+ ...options,
40209
+ classContext
40210
+ };
40211
+ const replacementCache = getReplacementCacheStore(options.escapeMap);
40212
+ let transformed = source;
40213
+ let mutated = false;
40214
+ for (const candidate of candidates) {
40215
+ const result = resolveClassNameTransformWithResult(candidate, transformOptions);
40216
+ if (result.decision === "skip" || !transformed.includes(candidate)) continue;
40217
+ const replacement = result.decision === "escaped" && result.escapedValue ? result.escapedValue : getReplacement(candidate, options.escapeMap, replacementCache);
40218
+ const replaced = transformed.replace(candidate, replacement);
40219
+ if (replaced !== transformed) {
40220
+ transformed = replaced;
40221
+ mutated = true;
40222
+ }
40223
+ }
40224
+ return mutated ? transformed : void 0;
40225
+ }
40226
+ //#endregion
40227
+ //#region src/js/fast-path/oxc.ts
40228
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
40229
+ let oxcParser;
40230
+ function isOxcParserRuntimeSupported(version = node_process.default.versions.node) {
40231
+ const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version);
40232
+ if (!match) return false;
40233
+ const major = Number(match[1]);
40234
+ const minor = Number(match[2]);
40235
+ if (major === 20) return minor >= 19;
40236
+ if (major === 21) return false;
40237
+ if (major === 22) return minor >= 12;
40238
+ return major > 22;
40239
+ }
40240
+ function loadOxcParser() {
40241
+ if (!isOxcParserRuntimeSupported()) return;
40242
+ if (oxcParser === false) return;
40243
+ if (oxcParser) return oxcParser;
40244
+ try {
40245
+ oxcParser = require$1("oxc-parser");
40246
+ } catch {
40247
+ oxcParser = false;
40248
+ return;
40249
+ }
40250
+ return oxcParser;
40251
+ }
40252
+ function hasValues(values) {
40253
+ return Array.isArray(values) && values.length > 0;
40254
+ }
40255
+ function hasUnsupportedSourceMarker(rawSource) {
40256
+ return rawSource.includes("eval(") || rawSource.includes("weapp-tw") && rawSource.includes("ignore");
40257
+ }
40258
+ function hasSupportedClassMatchSource(options) {
40259
+ return options.alwaysEscape === true || Boolean(options.classNameSet && options.classNameSet.size > 0);
40260
+ }
40261
+ function canAttemptOxcJsFastPath(options) {
40262
+ if (options.experimentalJsFastPath !== true && options.experimentalJsFastPath !== "oxc") return false;
40263
+ return !options.generateMap && !options.wrapExpression && !options.moduleGraph && !options.moduleSpecifierReplacements && hasSupportedClassMatchSource(options) && !hasValues(options.ignoreCallExpressionIdentifiers);
40264
+ }
40265
+ function getParserLang(filename) {
40266
+ if (filename?.endsWith(".ts") || filename?.endsWith(".mts") || filename?.endsWith(".cts")) return "ts";
40267
+ if (filename?.endsWith(".tsx")) return "tsx";
40268
+ if (filename?.endsWith(".jsx")) return "jsx";
40269
+ return "js";
40270
+ }
40271
+ function getParserSourceType(sourceType) {
40272
+ return sourceType === "script" || sourceType === "module" ? sourceType : "module";
40273
+ }
40274
+ function isRangeValid(start, end) {
40275
+ return typeof start === "number" && typeof end === "number" && start < end;
40276
+ }
40277
+ function getMagicString(rawSource, context) {
40278
+ if (!context.ms) context.ms = new MagicString(rawSource);
40279
+ return context.ms;
40280
+ }
40281
+ function addStringLiteralReplacement(rawSource, node, transformOptions, context) {
40282
+ if (typeof node.value !== "string" || typeof node.raw !== "string" || !isRangeValid(node.start, node.end)) return false;
40283
+ const transformed = transformLiteralText(node.value, transformOptions, false);
40284
+ if (!transformed) return false;
40285
+ const start = node.start + 1;
40286
+ const end = node.end - 1;
40287
+ if (start >= end || transformed === rawSource.slice(start, end)) return false;
40288
+ getMagicString(rawSource, context).update(start, end, jsStringEscape(transformed));
40289
+ return true;
40290
+ }
40291
+ function addTemplateElementReplacement(rawSource, node, transformOptions, context) {
40292
+ const raw = node.value?.raw;
40293
+ if (typeof raw !== "string" || !isRangeValid(node.start, node.end)) return false;
40294
+ const transformed = transformLiteralText(raw, transformOptions, false);
40295
+ if (!transformed || transformed === raw) return false;
40296
+ const first = rawSource[node.start];
40297
+ const last = rawSource[node.end - 1];
40298
+ const start = node.start + (first === "`" || first === "}" ? 1 : 0);
40299
+ const end = node.end - (last === "`" ? 1 : last === "{" ? 2 : 0);
40300
+ if (start >= end) return false;
40301
+ getMagicString(rawSource, context).update(start, end, transformed);
40302
+ return true;
40303
+ }
40304
+ function applyReplacements(rawSource, program, stringLiteralOptions, templateLiteralOptions, context) {
40305
+ let changed = false;
40306
+ walk(program, { enter(node) {
40307
+ if (node.type === "Literal") {
40308
+ changed = addStringLiteralReplacement(rawSource, node, stringLiteralOptions, context) || changed;
40309
+ return;
40310
+ }
40311
+ if (node.type === "TemplateElement") {
40312
+ changed = addTemplateElementReplacement(rawSource, node, templateLiteralOptions, context) || changed;
40313
+ this.skip();
40314
+ }
40315
+ } });
40316
+ return changed;
40317
+ }
40318
+ function hasTaggedTemplateExpression(program) {
40319
+ let found = false;
40320
+ walk(program, { enter(node) {
40321
+ if (node.type === "TaggedTemplateExpression") {
40322
+ found = true;
40323
+ this.skip();
40324
+ }
40325
+ } });
40326
+ return found;
40327
+ }
40328
+ function oxcJsHandler(rawSource, options) {
40329
+ if (!canAttemptOxcJsFastPath(options)) return;
40330
+ if (hasUnsupportedSourceMarker(rawSource)) return;
40331
+ const parser = loadOxcParser();
40332
+ if (!parser) return;
40333
+ let result;
40334
+ try {
40335
+ result = parser.parseSync(options.filename ?? "weapp-tailwindcss.js", rawSource, {
40336
+ sourceType: getParserSourceType(options.babelParserOptions?.sourceType),
40337
+ lang: getParserLang(options.filename)
40338
+ });
40339
+ } catch {
40340
+ return;
40341
+ }
40342
+ if (!result.program || Array.isArray(result.errors) && result.errors.length > 0) return;
40343
+ if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program)) return;
40344
+ const stringLiteralOptions = options.needEscaped === true ? options : {
40345
+ ...options,
40346
+ needEscaped: true
40347
+ };
40348
+ const templateLiteralOptions = options.needEscaped === false ? options : {
40349
+ ...options,
40350
+ needEscaped: false
40351
+ };
40352
+ const replacementContext = {};
40353
+ if (!applyReplacements(rawSource, result.program, stringLiteralOptions, templateLiteralOptions, replacementContext)) return { code: rawSource };
40354
+ return { code: replacementContext.ms.toString() };
40355
+ }
40356
+ //#endregion
40357
+ //#region src/js/precheck.ts
40358
+ /** 用于检测源码中是否包含类名相关模式的正则表达式 */
40359
+ const FAST_JS_TRANSFORM_HINT_RE = /className\b|class\s*=|classList\.|\b(?:twMerge|clsx|classnames|cn|cva)\b|\[["'`]class["'`]\]|text-\[|bg-\[|\b(?:[whpm]|px|py|mx|my|rounded|flex|grid|gap)-/;
40360
+ /** 用于检测源码中是否包含 import/export/require 语句的正则表达式 */
40361
+ const DEPENDENCY_HINT_RE = /\bimport\s*(?:["'`{]|\*\s+as\b)|\brequire\s*\(|\bexport\s+\*\s+from\s+["'`]|\bexport\s*\{[^}]*\}\s*from\s+["'`]/;
40362
+ /**
40363
+ * 判断源码是否可能声明跨模块依赖。
40364
+ *
40365
+ * 该检查只作为性能预筛:返回 `true` 时必须保守走 AST 模块图分析;
40366
+ * 返回 `false` 时源码中没有可被当前模块图消费的静态 import/export/require 形态。
40367
+ */
40368
+ function hasDependencyHint(rawSource) {
40369
+ return DEPENDENCY_HINT_RE.test(rawSource);
40370
+ }
40371
+ /**
40372
+ * 判断是否可以跳过 JS 转换。
40373
+ * 通过正则快速检测源码内容,避免不必要的 Babel AST 解析。
40374
+ *
40375
+ * @param rawSource - 原始 JS 源码字符串
40376
+ * @param options - 可选的 JS 处理器配置选项
40377
+ * @returns 如果可以跳过转换返回 `true`,否则返回 `false`
40378
+ */
40379
+ function shouldSkipJsTransform(rawSource, options) {
40380
+ if (node_process.default.env["WEAPP_TW_DISABLE_JS_PRECHECK"] === "1") return false;
40381
+ if (!rawSource) return true;
40382
+ if (options?.alwaysEscape) return false;
40383
+ if (options?.moduleSpecifierReplacements && Object.keys(options.moduleSpecifierReplacements).length > 0) return false;
40384
+ if (options?.wrapExpression) return false;
40385
+ if (hasDependencyHint(rawSource)) return false;
40386
+ return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
40387
+ }
40388
+ //#endregion
40389
+ //#region src/js/index.ts
40390
+ /** 默认 LRU 缓存最大条目数 */
40391
+ const RESULT_CACHE_MAX = 512;
40392
+ /** 仅对短片段做内层结果缓存,避免 bundler 热路径重复 hash 大块 JS。 */
40393
+ const CACHEABLE_SOURCE_MAX_LENGTH = 512;
40394
+ /** 为每个 ClassNameSet 实例分配递增 ID */
40395
+ const classNameSetIds = /* @__PURE__ */ new WeakMap();
40396
+ let nextClassNameSetId = 0;
40397
+ /**
40398
+ * 获取 ClassNameSet 的唯一身份 ID。
40399
+ * 每个 Set 引用分配一个递增整数,用于指纹计算。
40400
+ */
40401
+ function getClassNameSetId(set) {
40402
+ if (!set) return "none";
40403
+ const existing = classNameSetIds.get(set);
40404
+ if (existing !== void 0) return String(existing);
40405
+ const id = nextClassNameSetId++;
40406
+ classNameSetIds.set(set, id);
40407
+ return String(id);
40408
+ }
40409
+ /** 缓存 IJsHandlerOptions -> fingerprint 的映射 */
40410
+ const fingerprintCache = /* @__PURE__ */ new WeakMap();
40411
+ /**
40412
+ * 计算选项指纹,包含所有影响转译结果的字段。
40413
+ * 不包含 filename、moduleGraph、jsPreserveClass。
40414
+ */
40415
+ function getOptionsFingerprint(options) {
40416
+ const cached = fingerprintCache.get(options);
40417
+ if (cached) return cached;
40418
+ const fingerprint = [
40419
+ getClassNameSetId(options.classNameSet),
40420
+ JSON.stringify(options.escapeMap ?? null),
40421
+ options.needEscaped ? "1" : "0",
40422
+ options.alwaysEscape ? "1" : "0",
40423
+ options.unescapeUnicode ? "1" : "0",
40424
+ options.generateMap ? "1" : "0",
40425
+ options.uniAppX ? "1" : "0",
40426
+ options.wrapExpression ? "1" : "0",
40427
+ JSON.stringify(options.arbitraryValues ?? null),
40428
+ JSON.stringify(options.ignoreCallExpressionIdentifiers ?? null),
40429
+ JSON.stringify(options.ignoreTaggedTemplateExpressionIdentifiers?.map((v) => v instanceof RegExp ? v.source : v) ?? null),
40430
+ JSON.stringify(options.moduleSpecifierReplacements ?? null),
40431
+ String(options.experimentalJsFastPath ?? ""),
40432
+ JSON.stringify(options.babelParserOptions ?? null)
40433
+ ].join("|");
40434
+ fingerprintCache.set(options, fingerprint);
40435
+ return fingerprint;
40436
+ }
40437
+ function hasDefinedOverrides(options) {
40438
+ if (!options) return false;
40439
+ for (const key in options) if (options[key] !== void 0) return true;
40440
+ return false;
40441
+ }
40442
+ function shouldCacheJsResult(rawSource, options) {
40443
+ if (rawSource.length === 0 || rawSource.length > CACHEABLE_SOURCE_MAX_LENGTH) return false;
40444
+ if (options.moduleGraph || options.filename) return false;
40445
+ return true;
40446
+ }
40447
+ function resolveFastPathOptions(rawSource, options) {
40448
+ if (!options.moduleGraph) return options;
40449
+ if (options.moduleSpecifierReplacements && Object.keys(options.moduleSpecifierReplacements).length > 0) return options;
40450
+ if (hasDependencyHint(rawSource)) return options;
40451
+ const { moduleGraph: _moduleGraph, ...fastPathOptions } = options;
40452
+ return fastPathOptions;
40453
+ }
40454
+ function createJsHandler(options) {
40455
+ const defaults = {
40456
+ escapeMap: options.escapeMap,
40457
+ jsArbitraryValueFallback: options.jsArbitraryValueFallback,
40458
+ tailwindcssMajorVersion: options.tailwindcssMajorVersion,
40459
+ arbitraryValues: options.arbitraryValues,
40460
+ jsPreserveClass: options.jsPreserveClass,
40461
+ generateMap: options.generateMap,
40462
+ needEscaped: options.needEscaped,
40463
+ alwaysEscape: options.alwaysEscape,
40464
+ unescapeUnicode: options.unescapeUnicode,
40465
+ babelParserOptions: options.babelParserOptions,
40466
+ experimentalJsFastPath: options.experimentalJsFastPath,
40467
+ ignoreCallExpressionIdentifiers: options.ignoreCallExpressionIdentifiers,
40468
+ ignoreTaggedTemplateExpressionIdentifiers: options.ignoreTaggedTemplateExpressionIdentifiers,
40469
+ uniAppX: options.uniAppX,
40470
+ moduleSpecifierReplacements: options.moduleSpecifierReplacements
40471
+ };
40472
+ /** 层1: 无 override 时,classNameSet -> resolvedOptions */
40473
+ const defaultOptionsCache = /* @__PURE__ */ new WeakMap();
40474
+ let resolvedOptionsWithoutClassNameSet;
40475
+ /** 层2: 有 override 时,overrideOptions -> { bySet, noSet } */
40476
+ const overrideOptionsCache = /* @__PURE__ */ new WeakMap();
40477
+ const resultCache = new lru_cache.LRUCache({ max: RESULT_CACHE_MAX });
40478
+ function resolveDefaultOptions(classNameSet) {
40479
+ if (!classNameSet) {
40480
+ if (!resolvedOptionsWithoutClassNameSet) resolvedOptionsWithoutClassNameSet = {
40481
+ ...defaults,
40482
+ classNameSet
40483
+ };
40484
+ return resolvedOptionsWithoutClassNameSet;
40485
+ }
40486
+ const cached = defaultOptionsCache.get(classNameSet);
40487
+ if (cached) return cached;
40488
+ const created = {
40489
+ ...defaults,
40490
+ classNameSet
40491
+ };
40492
+ defaultOptionsCache.set(classNameSet, created);
40493
+ return created;
40494
+ }
40495
+ function getCachedJsResult(rawSource, resolvedOptions) {
40496
+ if (!shouldCacheJsResult(rawSource, resolvedOptions)) return;
40497
+ const key = `${getOptionsFingerprint(resolvedOptions)}:${(0, _weapp_tailwindcss_shared_node.md5)(rawSource)}`;
40498
+ return resultCache.get(key);
40499
+ }
40500
+ function setCachedJsResult(rawSource, resolvedOptions, result) {
40501
+ if (!shouldCacheJsResult(rawSource, resolvedOptions) || result.error || result.linked) return result;
40502
+ const key = `${getOptionsFingerprint(resolvedOptions)}:${(0, _weapp_tailwindcss_shared_node.md5)(rawSource)}`;
40503
+ resultCache.set(key, result);
40504
+ return result;
40505
+ }
40506
+ function resolveOptions(classNameSet, overrideOptions) {
40507
+ if (!hasDefinedOverrides(overrideOptions)) return resolveDefaultOptions(classNameSet);
40508
+ let entry = overrideOptionsCache.get(overrideOptions);
40509
+ if (!entry) {
40510
+ entry = { bySet: /* @__PURE__ */ new WeakMap() };
40511
+ overrideOptionsCache.set(overrideOptions, entry);
40512
+ }
40513
+ if (!classNameSet) {
40514
+ if (entry.noSet) return entry.noSet;
40515
+ const created = (0, _weapp_tailwindcss_shared.defuOverrideArray)({
40516
+ ...overrideOptions,
40517
+ classNameSet
40518
+ }, defaults);
40519
+ entry.noSet = created;
40520
+ return created;
40521
+ }
40522
+ const cached = entry.bySet.get(classNameSet);
40523
+ if (cached) return cached;
40524
+ const created = (0, _weapp_tailwindcss_shared.defuOverrideArray)({
40525
+ ...overrideOptions,
40526
+ classNameSet
40527
+ }, defaults);
40528
+ entry.bySet.set(classNameSet, created);
40529
+ return created;
40530
+ }
40531
+ function handler(rawSource, classNameSet, options) {
40532
+ const resolvedOptions = resolveOptions(classNameSet, options);
40533
+ const cached = getCachedJsResult(rawSource, resolvedOptions);
40534
+ if (cached) return cached;
40535
+ return setCachedJsResult(rawSource, resolvedOptions, oxcJsHandler(rawSource, resolveFastPathOptions(rawSource, resolvedOptions)) ?? jsHandler(rawSource, resolvedOptions));
40536
+ }
40537
+ return handler;
40538
+ }
40539
+ //#endregion
38253
40540
  //#region src/wxml/utils/codegen/legacy-visitor.ts
38254
40541
  function shouldSkipLegacyStringLiteral(path) {
38255
40542
  if (isMemberExpression$3(path.parent)) return true;
@@ -38320,13 +40607,13 @@ function isAllWhitespace(value) {
38320
40607
  //#region src/wxml/Tokenizer.ts
38321
40608
  var Tokenizer = class {
38322
40609
  constructor() {
38323
- require_object._defineProperty(this, "state", void 0);
38324
- require_object._defineProperty(this, "buffer", void 0);
38325
- require_object._defineProperty(this, "tokens", void 0);
38326
- require_object._defineProperty(this, "bufferStartIndex", void 0);
38327
- require_object._defineProperty(this, "expressionStartIndex", void 0);
38328
- require_object._defineProperty(this, "expressionBuffer", void 0);
38329
- require_object._defineProperty(this, "expressions", void 0);
40610
+ require_generator._defineProperty(this, "state", void 0);
40611
+ require_generator._defineProperty(this, "buffer", void 0);
40612
+ require_generator._defineProperty(this, "tokens", void 0);
40613
+ require_generator._defineProperty(this, "bufferStartIndex", void 0);
40614
+ require_generator._defineProperty(this, "expressionStartIndex", void 0);
40615
+ require_generator._defineProperty(this, "expressionBuffer", void 0);
40616
+ require_generator._defineProperty(this, "expressions", void 0);
38330
40617
  this.reset();
38331
40618
  }
38332
40619
  processChar(char, index) {
@@ -38589,6 +40876,911 @@ function createTemplateHandler(options = {}) {
38589
40876
  };
38590
40877
  }
38591
40878
  //#endregion
40879
+ //#region src/constants.ts
40880
+ const pluginName = "weapp-tailwindcss";
40881
+ const vitePluginName = "weapp-tailwindcss:adaptor";
40882
+ const DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS = {
40883
+ "tailwind-merge": "@weapp-tailwindcss/merge",
40884
+ "class-variance-authority": "@weapp-tailwindcss/cva",
40885
+ "tailwind-variants": "@weapp-tailwindcss/variants"
40886
+ };
40887
+ //#endregion
40888
+ //#region src/context/runtime-package-replacements.ts
40889
+ function resolveRuntimePackageReplacements(option) {
40890
+ const mapping = require_generator.resolveBooleanObjectOption(option, DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS);
40891
+ if (!mapping) return;
40892
+ const normalized = {};
40893
+ for (const [from, to] of Object.entries(mapping)) {
40894
+ if (!from || typeof to !== "string" || to.length === 0) continue;
40895
+ normalized[from] = to;
40896
+ }
40897
+ return Object.keys(normalized).length > 0 ? normalized : void 0;
40898
+ }
40899
+ //#endregion
40900
+ //#region src/context/style-options.ts
40901
+ function normalizeStyleHandlerMajorVersion(majorVersion) {
40902
+ return majorVersion === 4 ? 4 : void 0;
40903
+ }
40904
+ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
40905
+ const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX);
40906
+ const generatorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions(ctx.generator, {
40907
+ appType: ctx.appType,
40908
+ platform: ctx.cssOptions?.platform ?? ctx.platform,
40909
+ tailwindcssMajorVersion,
40910
+ uniAppX: resolvedUniAppXOptions
40911
+ });
40912
+ const branch = require_generator.resolveGeneratorRuntimeBranch(generatorOptions, {
40913
+ appType: ctx.appType,
40914
+ platform: ctx.cssOptions?.platform ?? ctx.platform,
40915
+ tailwindcssMajorVersion,
40916
+ uniAppX: resolvedUniAppXOptions
40917
+ });
40918
+ const hasCssOptions = ctx.cssOptions !== void 0;
40919
+ const configuredRem2rpx = ctx.cssOptions?.rem2rpx ?? ctx.rem2rpx;
40920
+ const rem2rpx = branch.isWeb && require_generator.shouldUseUniAppWebRpxCompatibility(ctx.appType) ? false : configuredRem2rpx;
40921
+ const cssOptions = {
40922
+ cssPreflight: ctx.cssOptions?.cssPreflight ?? ctx.cssPreflight,
40923
+ cssPreflightRange: ctx.cssOptions?.cssPreflightRange ?? ctx.cssPreflightRange,
40924
+ cssChildCombinatorReplaceValue: ctx.cssOptions?.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue,
40925
+ cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
40926
+ rem2rpx,
40927
+ cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
40928
+ cssRemoveActivePseudoClass: ctx.cssOptions?.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass,
40929
+ cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
40930
+ cssRemoveFocusPseudoClass: ctx.cssOptions?.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass,
40931
+ tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
40932
+ cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
40933
+ atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
40934
+ autoprefixer: ctx.cssOptions?.autoprefixer ?? ctx.autoprefixer,
40935
+ cssCalc: ctx.cssOptions?.cssCalc ?? ctx.cssCalc,
40936
+ platform: branch.platform ?? ctx.cssOptions?.platform ?? ctx.platform,
40937
+ px2rpx: ctx.cssOptions?.px2rpx ?? ctx.px2rpx,
40938
+ unitsToPx: ctx.cssOptions?.unitsToPx ?? ctx.unitsToPx,
40939
+ unitConversion: ctx.cssOptions?.unitConversion ?? ctx.unitConversion,
40940
+ injectAdditionalCssVarScope: ctx.cssOptions?.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope
40941
+ };
40942
+ return {
40943
+ appType: ctx.appType,
40944
+ postcssOptions: ctx.postcssOptions,
40945
+ cssPreflight: cssOptions.cssPreflight,
40946
+ cssPreflightRange: cssOptions.cssPreflightRange,
40947
+ cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
40948
+ cssSelectorReplacement: cssOptions.cssSelectorReplacement,
40949
+ rem2rpx: cssOptions.rem2rpx,
40950
+ ...hasCssOptions ? { cssOptions } : {},
40951
+ cssRemoveProperty: cssOptions.cssRemoveProperty,
40952
+ cssRemoveActivePseudoClass: cssOptions.cssRemoveActivePseudoClass,
40953
+ cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
40954
+ cssRemoveFocusPseudoClass: cssOptions.cssRemoveFocusPseudoClass,
40955
+ tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
40956
+ cssPresetEnv: cssOptions.cssPresetEnv,
40957
+ atRules: cssOptions.atRules,
40958
+ autoprefixer: cssOptions.autoprefixer,
40959
+ cssCalc: cssOptions.cssCalc,
40960
+ uniAppX: branch.isNativeApp,
40961
+ platform: cssOptions.platform,
40962
+ px2rpx: cssOptions.px2rpx,
40963
+ unitsToPx: cssOptions.unitsToPx,
40964
+ unitConversion: cssOptions.unitConversion
40965
+ };
40966
+ }
40967
+ //#endregion
40968
+ //#region src/context/handlers.ts
40969
+ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindcssMajorVersion) {
40970
+ const { escapeMap, injectAdditionalCssVarScope, postcssOptions, uniAppX, arbitraryValues, jsPreserveClass, babelParserOptions, experimentalJsFastPath, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
40971
+ const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(uniAppX);
40972
+ const styleOptions = resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion);
40973
+ const resolvedInjectAdditionalCssVarScope = styleOptions.cssOptions?.injectAdditionalCssVarScope ?? injectAdditionalCssVarScope;
40974
+ const uniAppXEnabled = styleOptions.uniAppX === true;
40975
+ const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
40976
+ const styleHandler = (0, _weapp_tailwindcss_postcss.createStyleHandler)({
40977
+ ...styleOptions,
40978
+ escapeMap,
40979
+ injectAdditionalCssVarScope: resolvedInjectAdditionalCssVarScope,
40980
+ postcssOptions,
40981
+ uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
40982
+ cssCalc: cssCalcOptions,
40983
+ majorVersion: normalizeStyleHandlerMajorVersion(tailwindcssMajorVersion)
40984
+ });
40985
+ const jsHandler = createJsHandler({
40986
+ escapeMap,
40987
+ arbitraryValues,
40988
+ jsPreserveClass,
40989
+ generateMap: true,
40990
+ babelParserOptions,
40991
+ experimentalJsFastPath,
40992
+ ignoreCallExpressionIdentifiers,
40993
+ ignoreTaggedTemplateExpressionIdentifiers,
40994
+ uniAppX: uniAppXEnabled,
40995
+ moduleSpecifierReplacements
40996
+ });
40997
+ return {
40998
+ styleHandler,
40999
+ jsHandler,
41000
+ templateHandler: createTemplateHandler({
41001
+ customAttributesEntities,
41002
+ escapeMap,
41003
+ inlineWxs,
41004
+ jsHandler,
41005
+ disabledDefaultTemplateHandler
41006
+ })
41007
+ };
41008
+ }
41009
+ //#endregion
41010
+ //#region src/context/logger.ts
41011
+ const loggerLevelMap = {
41012
+ error: 0,
41013
+ warn: 1,
41014
+ info: 3,
41015
+ silent: -999
41016
+ };
41017
+ function applyLoggerLevel(logLevel) {
41018
+ _weapp_tailwindcss_logger.logger.level = loggerLevelMap[logLevel ?? "info"] ?? loggerLevelMap.info;
41019
+ }
41020
+ //#endregion
41021
+ //#region src/context/index.ts
41022
+ function resolveContextCssPreflight(opts, ctx, majorVersion) {
41023
+ const userCssPreflight = opts?.cssOptions?.cssPreflight ?? opts?.cssPreflight;
41024
+ const cssPreflight = require_defaults.resolveDefaultCssPreflight(userCssPreflight, majorVersion);
41025
+ const shouldUseUniAppXPreflight = ctx.appType === "uni-app-x" || require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX).enabled;
41026
+ if (cssPreflight === false || !shouldUseUniAppXPreflight) return cssPreflight;
41027
+ const userCssPreflightObject = userCssPreflight && typeof userCssPreflight === "object" ? userCssPreflight : void 0;
41028
+ return {
41029
+ ...cssPreflight,
41030
+ "border-width": userCssPreflightObject && "border-width" in userCssPreflightObject ? cssPreflight["border-width"] ?? false : "0",
41031
+ "border-style": userCssPreflightObject && "border-style" in userCssPreflightObject ? cssPreflight["border-style"] ?? false : false,
41032
+ "border": userCssPreflightObject && "border" in userCssPreflightObject ? cssPreflight["border"] ?? false : false
41033
+ };
41034
+ }
41035
+ function syncCssOptionsToLegacyFields(ctx) {
41036
+ if (!ctx.cssOptions) return;
41037
+ const cssOptions = ctx.cssOptions;
41038
+ ctx.cssPreflight = cssOptions.cssPreflight ?? ctx.cssPreflight;
41039
+ ctx.cssPreflightRange = cssOptions.cssPreflightRange ?? ctx.cssPreflightRange;
41040
+ ctx.cssChildCombinatorReplaceValue = cssOptions.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue;
41041
+ ctx.cssSelectorReplacement = cssOptions.cssSelectorReplacement ?? ctx.cssSelectorReplacement;
41042
+ ctx.rem2rpx = cssOptions.rem2rpx ?? ctx.rem2rpx;
41043
+ ctx.cssRemoveProperty = cssOptions.cssRemoveProperty ?? ctx.cssRemoveProperty;
41044
+ ctx.cssRemoveActivePseudoClass = cssOptions.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass;
41045
+ ctx.cssRemoveHoverPseudoClass = cssOptions.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass;
41046
+ ctx.cssRemoveFocusPseudoClass = cssOptions.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass;
41047
+ ctx.tailwindcssV4GradientFallback = cssOptions.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback;
41048
+ ctx.cssPresetEnv = cssOptions.cssPresetEnv ?? ctx.cssPresetEnv;
41049
+ ctx.atRules = cssOptions.atRules ?? ctx.atRules;
41050
+ ctx.autoprefixer = cssOptions.autoprefixer ?? ctx.autoprefixer;
41051
+ ctx.cssCalc = cssOptions.cssCalc ?? ctx.cssCalc;
41052
+ ctx.platform = cssOptions.platform ?? ctx.platform;
41053
+ ctx.px2rpx = cssOptions.px2rpx ?? ctx.px2rpx;
41054
+ ctx.unitsToPx = cssOptions.unitsToPx ?? ctx.unitsToPx;
41055
+ ctx.unitConversion = cssOptions.unitConversion ?? ctx.unitConversion;
41056
+ ctx.injectAdditionalCssVarScope = cssOptions.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope;
41057
+ }
41058
+ function syncLegacyFieldsToCssOptions(ctx) {
41059
+ if (!ctx.cssOptions) return;
41060
+ ctx.cssOptions = {
41061
+ ...ctx.cssOptions ?? {},
41062
+ cssPreflight: ctx.cssPreflight,
41063
+ cssPreflightRange: ctx.cssPreflightRange,
41064
+ cssChildCombinatorReplaceValue: ctx.cssChildCombinatorReplaceValue,
41065
+ cssSelectorReplacement: ctx.cssSelectorReplacement,
41066
+ rem2rpx: ctx.rem2rpx,
41067
+ cssRemoveProperty: ctx.cssRemoveProperty,
41068
+ cssRemoveActivePseudoClass: ctx.cssRemoveActivePseudoClass,
41069
+ cssRemoveHoverPseudoClass: ctx.cssRemoveHoverPseudoClass,
41070
+ cssRemoveFocusPseudoClass: ctx.cssRemoveFocusPseudoClass,
41071
+ tailwindcssV4GradientFallback: ctx.tailwindcssV4GradientFallback,
41072
+ cssPresetEnv: ctx.cssPresetEnv,
41073
+ atRules: ctx.atRules,
41074
+ autoprefixer: ctx.autoprefixer,
41075
+ cssCalc: ctx.cssCalc,
41076
+ platform: ctx.platform,
41077
+ px2rpx: ctx.px2rpx,
41078
+ unitsToPx: ctx.unitsToPx,
41079
+ unitConversion: ctx.unitConversion,
41080
+ injectAdditionalCssVarScope: ctx.injectAdditionalCssVarScope
41081
+ };
41082
+ }
41083
+ function applyFrameworkPlatformDefaults(ctx) {
41084
+ if (ctx.cssOptions?.platform || ctx.platform) {
41085
+ ctx.platform = normalizeFrameworkStylePlatform(ctx.cssOptions?.platform ?? ctx.platform, ctx.appType);
41086
+ return;
41087
+ }
41088
+ if (ctx.appType === "mpx") ctx.platform = normalizeFrameworkStylePlatform(require_framework.resolveMpxPlatform().normalized, ctx.appType);
41089
+ }
41090
+ async function clearTailwindcssRuntimeCache(tailwindRuntime, options) {
41091
+ if (!tailwindRuntime) return;
41092
+ const cacheOptions = tailwindRuntime.options?.cache;
41093
+ if (cacheOptions == null || typeof cacheOptions === "object" && cacheOptions.enabled === false) return;
41094
+ if (typeof tailwindRuntime.clearCache === "function") try {
41095
+ await tailwindRuntime.clearCache({ scope: "all" });
41096
+ } catch (error) {
41097
+ _weapp_tailwindcss_logger.logger.debug("failed to clear tailwindcss runtime cache via clearCache(): %O", error);
41098
+ }
41099
+ if (!options?.removeDirectory) return;
41100
+ const cachePaths = /* @__PURE__ */ new Map();
41101
+ const normalizedCacheOptions = typeof cacheOptions === "object" ? cacheOptions : void 0;
41102
+ const privateCachePath = tailwindRuntime?.cacheStore?.options?.path;
41103
+ if (privateCachePath) cachePaths.set(privateCachePath, false);
41104
+ if (normalizedCacheOptions?.path) cachePaths.set(normalizedCacheOptions.path, false);
41105
+ if (options?.removeDirectory && normalizedCacheOptions?.dir) cachePaths.set(normalizedCacheOptions.dir, true);
41106
+ if (!cachePaths.size) return;
41107
+ for (const [cachePath, recursive] of cachePaths.entries()) try {
41108
+ await (0, node_fs_promises.rm)(cachePath, {
41109
+ force: true,
41110
+ recursive
41111
+ });
41112
+ } catch (error) {
41113
+ const err = error;
41114
+ if (err?.code === "ENOENT") continue;
41115
+ _weapp_tailwindcss_logger.logger.debug("failed to clear tailwindcss runtime cache: %s %O", cachePath, err);
41116
+ }
41117
+ }
41118
+ function createInternalCompilerContext(opts) {
41119
+ const ctx = (0, _weapp_tailwindcss_shared.defuOverrideArray)(opts, require_defaults.getDefaultOptions(), {});
41120
+ ctx.arbitraryValues = resolveUnocssBareArbitraryValues(ctx.arbitraryValues, ctx.unocss);
41121
+ ctx.escapeMap = ctx.customReplaceDictionary;
41122
+ syncCssOptionsToLegacyFields(ctx);
41123
+ applyFrameworkPlatformDefaults(ctx);
41124
+ applyLoggerLevel(ctx.logLevel);
41125
+ const tailwindRuntime = require_tailwindcss.createTailwindcssRuntimeFromContext(ctx);
41126
+ if (opts?.__internalViteDeferRuntimeLogs !== true) {
41127
+ logTailwindcssTarget(tailwindRuntime, ctx.tailwindcssBasedir);
41128
+ logRuntimeTailwindcssVersion(ctx.tailwindcssBasedir, tailwindRuntime.packageInfo?.rootPath, tailwindRuntime.packageInfo?.version);
41129
+ }
41130
+ if (opts?.__internalDeferMissingCssEntriesWarning !== true) require_tailwindcss.warnMissingCssEntries(ctx, tailwindRuntime);
41131
+ ctx.cssPreflight = resolveContextCssPreflight(opts, ctx, tailwindRuntime.majorVersion);
41132
+ const cssCalcOptions = require_tailwindcss.applyV4CssCalcDefaults(ctx.cssCalc, tailwindRuntime);
41133
+ ctx.cssCalc = cssCalcOptions;
41134
+ syncLegacyFieldsToCssOptions(ctx);
41135
+ const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
41136
+ ctx.customAttributesEntities = customAttributesEntities;
41137
+ const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindRuntime.majorVersion);
41138
+ ctx.styleHandler = styleHandler;
41139
+ ctx.jsHandler = jsHandler;
41140
+ ctx.templateHandler = templateHandler;
41141
+ ctx.cache = initializeCache(ctx.cache);
41142
+ ctx.tailwindRuntime = tailwindRuntime;
41143
+ const refreshTailwindcssRuntime = async (options) => {
41144
+ const previousRuntime = ctx.tailwindRuntime;
41145
+ if (options?.clearCache !== false) await clearTailwindcssRuntimeCache(previousRuntime);
41146
+ require_tailwindcss.invalidateRuntimeClassSet(previousRuntime);
41147
+ const nextRuntime = require_tailwindcss.createTailwindcssRuntimeFromContext(ctx);
41148
+ Object.assign(previousRuntime, nextRuntime);
41149
+ ctx.tailwindRuntime = previousRuntime;
41150
+ return previousRuntime;
41151
+ };
41152
+ ctx.refreshTailwindcssRuntime = refreshTailwindcssRuntime;
41153
+ Object.defineProperty(ctx.tailwindRuntime, refreshTailwindcssRuntimeSymbol, {
41154
+ value: refreshTailwindcssRuntime,
41155
+ configurable: true
41156
+ });
41157
+ return ctx;
41158
+ }
41159
+ /**
41160
+ * 获取用户定义选项的内部表示,并初始化相关的处理程序和 Tailwind 运行时。
41161
+ * @param opts - 用户定义的选项,可选。
41162
+ * @returns 返回一个包含内部用户定义选项的对象,包括样式、JS 和模板处理程序,以及 Tailwind CSS 运行时。
41163
+ */
41164
+ function getCompilerContext(opts) {
41165
+ return withCompilerContextCache(opts, () => createInternalCompilerContext(opts));
41166
+ }
41167
+ //#endregion
41168
+ //#region src/core/compiler/transforms.ts
41169
+ const DEFAULT_JS_OPTIONS = Object.freeze({ tailwindcssMajorVersion: 4 });
41170
+ const DEFAULT_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
41171
+ function clonePostcssResult(result) {
41172
+ return Object.assign(Object.create(Object.getPrototypeOf(result)), result, {
41173
+ messages: [...result.messages],
41174
+ root: result.root.clone()
41175
+ });
41176
+ }
41177
+ function resolveStyleOptions(options) {
41178
+ if (!options) return DEFAULT_STYLE_OPTIONS;
41179
+ return options?.isMainChunk === void 0 ? {
41180
+ ...options,
41181
+ isMainChunk: true
41182
+ } : options;
41183
+ }
41184
+ function resolveCssTransformOptions(options) {
41185
+ const { finalize: _finalize, ...styleOptions } = options ?? {};
41186
+ return {
41187
+ finalize: _finalize,
41188
+ styleOptions: resolveStyleOptions(styleOptions)
41189
+ };
41190
+ }
41191
+ function finalizeResultRoot(result, snapshot, shouldFinalize) {
41192
+ if (!shouldFinalize || result.root.type !== "root") return;
41193
+ (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssRoot)(result.root, { isTailwindcssV4: snapshot.target === "weapp" });
41194
+ result.css = result.root.toString();
41195
+ }
41196
+ function createCompilerTransforms({ ensureActive, track, userOptions }) {
41197
+ const context = getCompilerContext({
41198
+ ...userOptions,
41199
+ __internalDeferMissingCssEntriesWarning: true
41200
+ });
41201
+ const styleHandler = context.styleHandler;
41202
+ let cachedTemplateClassSet;
41203
+ let cachedTemplateOptions;
41204
+ function clearCache() {
41205
+ cachedTemplateClassSet = void 0;
41206
+ cachedTemplateOptions = void 0;
41207
+ }
41208
+ function createTemplateOptions(classSet, options) {
41209
+ const isDefault = !options || Object.keys(options).length === 0;
41210
+ if (isDefault && cachedTemplateClassSet === classSet && cachedTemplateOptions) return cachedTemplateOptions;
41211
+ const resolved = {
41212
+ ...options,
41213
+ classSetMode: "exact",
41214
+ jsHandler: (jsSource, _runtimeSet, jsOptions) => context.jsHandler(jsSource, classSet, {
41215
+ ...jsOptions,
41216
+ tailwindcssMajorVersion: jsOptions?.tailwindcssMajorVersion ?? 4
41217
+ }),
41218
+ runtimeSet: classSet
41219
+ };
41220
+ if (isDefault) {
41221
+ cachedTemplateClassSet = classSet;
41222
+ cachedTemplateOptions = resolved;
41223
+ }
41224
+ return resolved;
41225
+ }
41226
+ function transformCss(css, snapshot, options) {
41227
+ ensureActive();
41228
+ getInternalCompilerSnapshot(snapshot);
41229
+ const resolved = resolveCssTransformOptions(options);
41230
+ const shouldFinalize = resolved.finalize ?? snapshot.target === "weapp";
41231
+ return track(styleHandler(css, resolved.styleOptions).then((result) => {
41232
+ const cloned = clonePostcssResult(result);
41233
+ finalizeResultRoot(cloned, snapshot, shouldFinalize);
41234
+ return cloned;
41235
+ }));
41236
+ }
41237
+ function transformCssRoot(root, snapshot, options) {
41238
+ ensureActive();
41239
+ getInternalCompilerSnapshot(snapshot);
41240
+ const resolved = resolveCssTransformOptions(options);
41241
+ const shouldFinalize = resolved.finalize ?? snapshot.target === "weapp";
41242
+ return track(styleHandler.transformRoot(root, resolved.styleOptions).then((result) => {
41243
+ finalizeResultRoot(result, snapshot, shouldFinalize);
41244
+ return result;
41245
+ }));
41246
+ }
41247
+ function transformJavaScript(source, snapshot, options) {
41248
+ ensureActive();
41249
+ const classSet = getInternalCompilerSnapshot(snapshot).classSet;
41250
+ const resolvedOptions = options?.tailwindcssMajorVersion === void 0 ? options ? {
41251
+ ...options,
41252
+ tailwindcssMajorVersion: 4
41253
+ } : DEFAULT_JS_OPTIONS : options;
41254
+ return track(Promise.resolve(shouldSkipJsTransform(source, resolvedOptions) ? { code: source } : context.jsHandler(source, classSet, resolvedOptions)));
41255
+ }
41256
+ function transformTemplate(source, snapshot, options) {
41257
+ ensureActive();
41258
+ const classSet = getInternalCompilerSnapshot(snapshot).classSet;
41259
+ return track(context.templateHandler(source, createTemplateOptions(classSet, options)));
41260
+ }
41261
+ return {
41262
+ clearCache,
41263
+ transformCss,
41264
+ transformCssRoot,
41265
+ transformJavaScript,
41266
+ transformTemplate
41267
+ };
41268
+ }
41269
+ //#endregion
41270
+ //#region src/core/compiler/compiler.ts
41271
+ const DEFAULT_MAX_ROOTS = 128;
41272
+ function createCompiler(options = {}) {
41273
+ const { compiler: compilerOptions, ...userOptions } = options;
41274
+ const rootStore = new CompilerRootStore(Math.max(1, Math.floor(compilerOptions?.maxRoots ?? DEFAULT_MAX_ROOTS)), compilerOptions?.onRootEvicted);
41275
+ const activeTasks = /* @__PURE__ */ new Set();
41276
+ let lifecycle = "active";
41277
+ let disposePromise;
41278
+ function ensureActive() {
41279
+ if (lifecycle !== "active") throw new Error(lifecycle === "disposing" ? "Compiler 正在释放,不能接受新任务。" : "Compiler 已释放。");
41280
+ }
41281
+ function track(task) {
41282
+ activeTasks.add(task);
41283
+ task.then(() => activeTasks.delete(task), () => activeTasks.delete(task));
41284
+ return task;
41285
+ }
41286
+ const { clearCache: clearTransformCache, ...transforms } = createCompilerTransforms({
41287
+ ensureActive,
41288
+ track,
41289
+ userOptions
41290
+ });
41291
+ async function resolveRequestSource(entry, request) {
41292
+ if (request.source && request.sourceOptions) throw new Error("generate() 的 source 与 sourceOptions 互斥。");
41293
+ if (!request.source && !request.sourceOptions) throw new Error("generate() 必须提供 source 或 sourceOptions。");
41294
+ const sourceInput = request.source ?? request.sourceOptions;
41295
+ return {
41296
+ source: entry.source !== void 0 && entry.sourceInput === sourceInput && entry.appliedInvalidation === entry.invalidation ? entry.source : request.source ?? await require_generator.resolveTailwindV4Source(request.sourceOptions),
41297
+ sourceInput
41298
+ };
41299
+ }
41300
+ async function runGenerate(entry, request) {
41301
+ if (!entry.active) throw new Error(`Compiler root 已被移除:${entry.id}`);
41302
+ const invalidation = entry.invalidation;
41303
+ const { source, sourceInput } = await resolveRequestSource(entry, request);
41304
+ const sourceFingerprint = entry.sourceInput === sourceInput && entry.sourceFingerprint !== void 0 && entry.appliedInvalidation === invalidation ? entry.sourceFingerprint : createSourceFingerprint(source);
41305
+ const sourceReused = entry.sourceFingerprint === sourceFingerprint;
41306
+ const engineReused = sourceReused && entry.generator !== void 0 && entry.appliedInvalidation === invalidation;
41307
+ const generator = engineReused ? entry.generator : require_generator.createWeappTailwindcssGenerator(source);
41308
+ const target = request.target ?? "weapp";
41309
+ const { id: _id, source: _source, sourceOptions: _sourceOptions, target: _target, ...generateOptions } = request;
41310
+ const prepared = prepareCompilerGeneration(entry, request, source, !sourceReused || entry.appliedInvalidation !== invalidation);
41311
+ const generationCacheKey = createCompilerGenerationCacheKey(request, prepared.compilation.candidates, target);
41312
+ const reusableGeneration = engineReused && entry.generationCache && isSameCompilerGenerationCacheKey(entry.generationCache.key, generationCacheKey) ? entry.generationCache.result : void 0;
41313
+ try {
41314
+ const generated = reusableGeneration ? reuseCompilerGenerationResult(reusableGeneration) : await generator.generate({
41315
+ ...generateOptions,
41316
+ candidates: prepared.explicitCandidates ? prepared.compilation.candidates : void 0,
41317
+ incrementalCache: generateOptions.incrementalCache ?? true,
41318
+ target: target === "tailwind" ? "web" : target
41319
+ });
41320
+ if (!entry.active) throw new Error(`Compiler root 已被移除:${entry.id}`);
41321
+ const revision = (getLatestRevision(entry) ?? 0) + 1;
41322
+ const dependencies = [.../* @__PURE__ */ new Set([...source.dependencies, ...generated.dependencies])].sort();
41323
+ const sources = generated.sources ?? source.sources ?? [];
41324
+ const previousSnapshotState = entry.latestSnapshot ? getInternalCompilerSnapshot(entry.latestSnapshot) : void 0;
41325
+ const reusableClassSet = engineReused && generated.incrementalCss === "" && previousSnapshotState && previousSnapshotState.classSet.size === generated.classSet.size && [...generated.classSet].every((candidate) => previousSnapshotState.classSet.has(candidate)) ? previousSnapshotState.classSet : void 0;
41326
+ const reusableClassSetView = reusableClassSet ? entry.latestSnapshot?.classSet : void 0;
41327
+ const snapshot = createRegisteredCompilerSnapshot({
41328
+ classSet: generated.classSet,
41329
+ dependencies,
41330
+ id: entry.id,
41331
+ revision,
41332
+ sources,
41333
+ target
41334
+ }, reusableClassSet, reusableClassSetView);
41335
+ const internalSnapshot = getInternalCompilerSnapshot(snapshot);
41336
+ const previousGenerator = entry.generator;
41337
+ commitCompilerGeneration(entry, prepared, source, dependencies, generated.classSet);
41338
+ entry.generator = generator;
41339
+ entry.generationCache = {
41340
+ key: generationCacheKey,
41341
+ result: generated
41342
+ };
41343
+ entry.source = source;
41344
+ entry.sourceFingerprint = sourceFingerprint;
41345
+ entry.sourceInput = sourceInput;
41346
+ entry.appliedInvalidation = invalidation;
41347
+ entry.latestSnapshot = snapshot;
41348
+ rootStore.attachDependencies(entry, dependencies);
41349
+ rootStore.attachSources(entry, sources);
41350
+ if (!engineReused && previousGenerator !== generator) previousGenerator?.dispose?.();
41351
+ const css = target === "tailwind" ? generated.rawCss : generated.css;
41352
+ const incrementalCss = target === "tailwind" ? generated.incrementalRawCss : generated.incrementalCss;
41353
+ return {
41354
+ ...generated,
41355
+ cache: Object.freeze({
41356
+ engine: engineReused,
41357
+ output: reusableGeneration !== void 0 || engineReused && incrementalCss === "",
41358
+ source: sourceReused
41359
+ }),
41360
+ classSet: snapshot.classSet,
41361
+ css,
41362
+ dependencies: snapshot.dependencies,
41363
+ incrementalCss,
41364
+ rawCandidates: createImmutableSet(generated.rawCandidates),
41365
+ revision,
41366
+ snapshot,
41367
+ sources: internalSnapshot.sources,
41368
+ target
41369
+ };
41370
+ } catch (error) {
41371
+ if (!engineReused) generator.dispose?.();
41372
+ throw error;
41373
+ }
41374
+ }
41375
+ function getLatestRevision(entry) {
41376
+ return entry.latestSnapshot?.roots[0]?.revision;
41377
+ }
41378
+ function generate(request) {
41379
+ ensureActive();
41380
+ const entry = rootStore.get(request.id);
41381
+ entry.pendingCount += 1;
41382
+ const execution = entry.pending.then(() => runGenerate(entry, request));
41383
+ entry.pending = execution.finally(() => {
41384
+ entry.pendingCount -= 1;
41385
+ rootStore.trim();
41386
+ }).then(() => void 0, () => void 0);
41387
+ return track(execution);
41388
+ }
41389
+ function createSnapshot(request) {
41390
+ ensureActive();
41391
+ return createRegisteredCompilerSnapshot(request);
41392
+ }
41393
+ function finalizeCss(css, options) {
41394
+ ensureActive();
41395
+ return (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCss)(css, options);
41396
+ }
41397
+ function finalizeCssRoot(root, options) {
41398
+ ensureActive();
41399
+ const cloned = root.clone();
41400
+ (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssRoot)(cloned, options);
41401
+ return cloned;
41402
+ }
41403
+ function mergeSnapshots(snapshots) {
41404
+ ensureActive();
41405
+ return mergeRegisteredCompilerSnapshots(snapshots);
41406
+ }
41407
+ function invalidate(ids) {
41408
+ ensureActive();
41409
+ return rootStore.invalidate(ids);
41410
+ }
41411
+ async function remove(id) {
41412
+ if (lifecycle === "disposed") return;
41413
+ clearTransformCache();
41414
+ await rootStore.remove(id);
41415
+ }
41416
+ function dispose() {
41417
+ if (disposePromise) return disposePromise;
41418
+ lifecycle = "disposing";
41419
+ disposePromise = (async () => {
41420
+ await Promise.allSettled([...activeTasks]);
41421
+ clearTransformCache();
41422
+ await rootStore.dispose();
41423
+ lifecycle = "disposed";
41424
+ })();
41425
+ return disposePromise;
41426
+ }
41427
+ return {
41428
+ createSnapshot,
41429
+ dispose,
41430
+ finalizeCss,
41431
+ finalizeCssRoot,
41432
+ generate,
41433
+ invalidate,
41434
+ mergeSnapshots,
41435
+ remove,
41436
+ ...transforms
41437
+ };
41438
+ }
41439
+ //#endregion
41440
+ //#region src/compiler/framework-compiler-session.ts
41441
+ /**
41442
+ * 官方 bundler 共享的 compiler 生命周期边界。
41443
+ *
41444
+ * bundler 继续拥有模块图和 scope 投影;本层只负责把逻辑 source root
41445
+ * 映射到一个长期复用的 compiler,并保证 root 删除与 owner 释放可等待。
41446
+ */
41447
+ var FrameworkCompilerSession = class {
41448
+ constructor(options) {
41449
+ require_generator._defineProperty(this, "compiler", void 0);
41450
+ require_generator._defineProperty(this, "scopeRoots", /* @__PURE__ */ new Map());
41451
+ require_generator._defineProperty(this, "activeRoots", /* @__PURE__ */ new Set());
41452
+ require_generator._defineProperty(this, "transactionId", 0);
41453
+ require_generator._defineProperty(this, "disposed", false);
41454
+ this.compiler = createCompiler(options);
41455
+ }
41456
+ rootId(scopeId, sourceId) {
41457
+ return `framework:${this.encode(scopeId)}:${this.encode(sourceId)}`;
41458
+ }
41459
+ async generate(scopeId, sourceId, source, request) {
41460
+ if (this.disposed) throw new Error("FrameworkCompilerSession 已释放。");
41461
+ const stableId = this.rootId(scopeId, sourceId);
41462
+ const id = this.activeRoots.has(stableId) ? `${stableId}:transaction-${++this.transactionId}` : stableId;
41463
+ let roots = this.scopeRoots.get(scopeId);
41464
+ if (!roots) {
41465
+ roots = /* @__PURE__ */ new Set();
41466
+ this.scopeRoots.set(scopeId, roots);
41467
+ }
41468
+ roots.add(stableId);
41469
+ this.activeRoots.add(stableId);
41470
+ try {
41471
+ return await this.compiler.generate({
41472
+ ...request,
41473
+ id,
41474
+ source: {
41475
+ ...source,
41476
+ dependencies: source.dependencies ?? []
41477
+ }
41478
+ });
41479
+ } finally {
41480
+ this.activeRoots.delete(stableId);
41481
+ if (id !== stableId) await this.compiler.remove(id);
41482
+ }
41483
+ }
41484
+ async syncScope(scopeId, sourceIds) {
41485
+ if (this.disposed) return;
41486
+ const roots = this.scopeRoots.get(scopeId);
41487
+ if (!roots) return;
41488
+ const active = new Set([...sourceIds].map((sourceId) => this.rootId(scopeId, sourceId)));
41489
+ const removed = [...roots].filter((rootId) => !active.has(rootId));
41490
+ await Promise.all(removed.map((rootId) => this.compiler.remove(rootId)));
41491
+ for (const rootId of removed) roots.delete(rootId);
41492
+ if (roots.size === 0) this.scopeRoots.delete(scopeId);
41493
+ }
41494
+ async removeScope(scopeId) {
41495
+ const roots = this.scopeRoots.get(scopeId);
41496
+ if (!roots) return;
41497
+ this.scopeRoots.delete(scopeId);
41498
+ await Promise.all([...roots].map((rootId) => this.compiler.remove(rootId)));
41499
+ }
41500
+ invalidate(ids) {
41501
+ return this.compiler.invalidate(ids);
41502
+ }
41503
+ mergeSnapshots(snapshots) {
41504
+ return this.compiler.mergeSnapshots(snapshots);
41505
+ }
41506
+ dispose() {
41507
+ if (this.disposed) return Promise.resolve();
41508
+ this.disposed = true;
41509
+ this.scopeRoots.clear();
41510
+ return this.compiler.dispose();
41511
+ }
41512
+ encode(value) {
41513
+ return node_buffer.Buffer.from(value, "utf8").toString("base64url");
41514
+ }
41515
+ };
41516
+ const frameworkCompilerSessions = /* @__PURE__ */ new WeakMap();
41517
+ function getFrameworkCompilerSession(owner, options) {
41518
+ let session = frameworkCompilerSessions.get(owner);
41519
+ if (!session) {
41520
+ session = new FrameworkCompilerSession(options);
41521
+ frameworkCompilerSessions.set(owner, session);
41522
+ }
41523
+ return session;
41524
+ }
41525
+ function disposeFrameworkCompilerSession(owner) {
41526
+ const session = frameworkCompilerSessions.get(owner);
41527
+ if (!session) return Promise.resolve();
41528
+ frameworkCompilerSessions.delete(owner);
41529
+ return session.dispose();
41530
+ }
41531
+ //#endregion
41532
+ //#region src/compiler/shadow-report-session.ts
41533
+ const COMPILER_SHADOW_REPORT_CACHE_MAX = 512;
41534
+ function cloneSemanticValue(value) {
41535
+ if (Array.isArray(value)) return value.map(cloneSemanticValue);
41536
+ if (typeof value === "object" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, cloneSemanticValue(entry)]));
41537
+ return value;
41538
+ }
41539
+ function cloneCompilerShadowReport(report) {
41540
+ return {
41541
+ file: report.file,
41542
+ scopeId: report.scopeId,
41543
+ equal: report.equal,
41544
+ differences: report.differences.map((difference) => ({
41545
+ kind: difference.kind,
41546
+ path: difference.path,
41547
+ ..."left" in difference ? { left: cloneSemanticValue(difference.left) } : {},
41548
+ ..."right" in difference ? { right: cloneSemanticValue(difference.right) } : {}
41549
+ })),
41550
+ truncated: report.truncated,
41551
+ legacy: { ...report.legacy },
41552
+ graph: { ...report.graph }
41553
+ };
41554
+ }
41555
+ var CompilerShadowReportSession = class {
41556
+ constructor(maxReports = COMPILER_SHADOW_REPORT_CACHE_MAX) {
41557
+ this.maxReports = maxReports;
41558
+ require_generator._defineProperty(this, "reportsByScope", /* @__PURE__ */ new Map());
41559
+ require_generator._defineProperty(this, "revision", 0);
41560
+ require_generator._defineProperty(this, "dropped", 0);
41561
+ require_generator._defineProperty(this, "completed", false);
41562
+ require_generator._defineProperty(this, "disposed", false);
41563
+ if (!Number.isInteger(maxReports) || maxReports <= 0) throw new Error("CompilerShadowReportSession 的 maxReports 必须是正整数。");
41564
+ }
41565
+ beginRun() {
41566
+ this.ensureActive();
41567
+ this.revision += 1;
41568
+ this.reportsByScope.clear();
41569
+ this.dropped = 0;
41570
+ this.completed = false;
41571
+ return this.revision;
41572
+ }
41573
+ record(report, revision = this.revision) {
41574
+ this.ensureActive();
41575
+ if (revision !== this.revision || this.completed) return false;
41576
+ const cloned = cloneCompilerShadowReport(report);
41577
+ this.reportsByScope.delete(cloned.scopeId);
41578
+ this.reportsByScope.set(cloned.scopeId, cloned);
41579
+ while (this.reportsByScope.size > this.maxReports) {
41580
+ const oldestScopeId = this.reportsByScope.keys().next().value;
41581
+ if (oldestScopeId === void 0) break;
41582
+ this.reportsByScope.delete(oldestScopeId);
41583
+ this.dropped += 1;
41584
+ }
41585
+ return true;
41586
+ }
41587
+ getRevision() {
41588
+ this.ensureActive();
41589
+ return this.revision;
41590
+ }
41591
+ completeRun(revision = this.revision) {
41592
+ this.ensureActive();
41593
+ if (revision !== this.revision) return;
41594
+ this.completed = true;
41595
+ return this.snapshot();
41596
+ }
41597
+ snapshot() {
41598
+ this.ensureActive();
41599
+ const reports = [...this.reportsByScope.values()].sort((left, right) => left.scopeId.localeCompare(right.scopeId)).map(cloneCompilerShadowReport);
41600
+ return {
41601
+ revision: this.revision,
41602
+ completed: this.completed,
41603
+ reports,
41604
+ summary: {
41605
+ total: reports.length,
41606
+ matched: reports.filter((report) => report.equal).length,
41607
+ mismatched: reports.filter((report) => !report.equal).length,
41608
+ truncated: reports.filter((report) => report.truncated).length,
41609
+ dropped: this.dropped
41610
+ }
41611
+ };
41612
+ }
41613
+ dispose() {
41614
+ this.reportsByScope.clear();
41615
+ this.dropped = 0;
41616
+ this.completed = true;
41617
+ this.disposed = true;
41618
+ }
41619
+ ensureActive() {
41620
+ if (this.disposed) throw new Error("CompilerShadowReportSession 已释放。");
41621
+ }
41622
+ };
41623
+ const compilerShadowReportSessions = /* @__PURE__ */ new WeakMap();
41624
+ function getCompilerShadowReportSession(owner) {
41625
+ ensureCompilerOwnerActive(owner);
41626
+ let session = compilerShadowReportSessions.get(owner);
41627
+ if (!session) {
41628
+ session = new CompilerShadowReportSession();
41629
+ compilerShadowReportSessions.set(owner, session);
41630
+ }
41631
+ return session;
41632
+ }
41633
+ function beginCompilerShadowRun(owner) {
41634
+ return getCompilerShadowReportSession(owner).beginRun();
41635
+ }
41636
+ function getCompilerShadowRunRevision(owner) {
41637
+ return getCompilerShadowReportSession(owner).getRevision();
41638
+ }
41639
+ function recordCompilerShadowReport(owner, report, revision) {
41640
+ return getCompilerShadowReportSession(owner).record(report, revision);
41641
+ }
41642
+ function getCompilerShadowRunSnapshot(owner) {
41643
+ return getCompilerShadowReportSession(owner).snapshot();
41644
+ }
41645
+ function completeCompilerShadowReportRun(owner, revision) {
41646
+ return getCompilerShadowReportSession(owner).completeRun(revision);
41647
+ }
41648
+ function disposeCompilerShadowReportSession(owner) {
41649
+ const session = compilerShadowReportSessions.get(owner);
41650
+ if (!session) return;
41651
+ compilerShadowReportSessions.delete(owner);
41652
+ session.dispose();
41653
+ }
41654
+ //#endregion
41655
+ //#region src/compiler/owner-lifecycle.ts
41656
+ async function disposeCompilerOwnerResources(owner) {
41657
+ disposeCompilationChangeCoordinator(owner);
41658
+ await disposeCompilationSessionPool(owner);
41659
+ await disposeFrameworkCompilerSession(owner);
41660
+ disposeTailwindGenerationSessionPool(owner);
41661
+ disposeCompilerShadowReportSession(owner);
41662
+ }
41663
+ function disposeCompilerOwner(owner) {
41664
+ return runCompilerOwnerDisposal(owner, () => disposeCompilerOwnerResources(owner));
41665
+ }
41666
+ //#endregion
41667
+ //#region src/compiler/platform-adapter.ts
41668
+ function createStylePlatformAdapter(options) {
41669
+ return {
41670
+ id: options.id,
41671
+ prepare(request) {
41672
+ return {
41673
+ ...request,
41674
+ candidates: new Set(request.candidates),
41675
+ scope: { ...request.scope }
41676
+ };
41677
+ },
41678
+ async transform(artifact, context) {
41679
+ const transformed = cloneGenerationArtifact(artifact);
41680
+ for (const fragment of transformed.fragments) {
41681
+ fragment.root = (await options.styleHandler.transformRoot(fragment.root, options.styleOptions)).root.clone();
41682
+ fragment.stage = context.stage;
41683
+ }
41684
+ return transformed;
41685
+ }
41686
+ };
41687
+ }
41688
+ //#endregion
41689
+ //#region src/compiler/runtime-affecting-signature.ts
41690
+ const CSS_BLOCK_COMMENT_RE = /\/\*[\s\S]*?\*\//g;
41691
+ const CSS_AROUND_PUNCTUATION_RE = /\s*([{}:;,>+~()])\s*/g;
41692
+ const CSS_TRAILING_DECLARATION_SEMICOLON_RE = /;\}/g;
41693
+ const CSS_WHITESPACE_RE = /\s+/g;
41694
+ const JS_RUNTIME_AFFECTING_TEXT_HINT_RE = /["'`/]/;
41695
+ const JS_INCOMPLETE_TRAILING_OPERATOR_RE = /(?:=>|[=+\-*%&|^!~?:,.({[\]])\s*$/;
41696
+ const JS_AST_IGNORED_KEYS = /* @__PURE__ */ new Set([
41697
+ "comments",
41698
+ "errors",
41699
+ "extra",
41700
+ "innerComments",
41701
+ "leadingComments",
41702
+ "loc",
41703
+ "tokens",
41704
+ "trailingComments"
41705
+ ]);
41706
+ function isAstNode(value) {
41707
+ return Boolean(value && typeof value === "object" && typeof value.type === "string");
41708
+ }
41709
+ function createHtmlRuntimeAffectingSignature(source) {
41710
+ try {
41711
+ const parts = [];
41712
+ const parser = new Parser$1({
41713
+ onattribute(name, value) {
41714
+ parts.push(`a:${name}=${value}`);
41715
+ },
41716
+ oncomment(data) {
41717
+ parts.push(`c:${data}`);
41718
+ },
41719
+ ontext(data) {
41720
+ const value = data.trim();
41721
+ if (value.length > 0) parts.push(`t:${value}`);
41722
+ }
41723
+ }, { xmlMode: true });
41724
+ parser.write(source);
41725
+ parser.end();
41726
+ return parts.join("\n");
41727
+ } catch {
41728
+ return source;
41729
+ }
41730
+ }
41731
+ function createJsRuntimeAffectingSignature(source) {
41732
+ if (!JS_RUNTIME_AFFECTING_TEXT_HINT_RE.test(source) && !JS_INCOMPLETE_TRAILING_OPERATOR_RE.test(source)) return "";
41733
+ try {
41734
+ const ast = babelParse(source, {
41735
+ cache: true,
41736
+ cacheKey: "st:unambiguous",
41737
+ plugins: ["jsx", "typescript"],
41738
+ sourceType: "unambiguous"
41739
+ });
41740
+ const parts = [];
41741
+ const stack = [ast];
41742
+ while (stack.length > 0) {
41743
+ const node = stack.pop();
41744
+ if (node.type === "StringLiteral" && typeof node.value === "string") parts.push(`s:${node.value}`);
41745
+ else if (node.type === "TemplateElement" && node.value && typeof node.value === "object" && "raw" in node.value && typeof node.value.raw === "string") parts.push(`t:${node.value.raw}`);
41746
+ else if (node.type === "JSXText" && typeof node.value === "string") {
41747
+ const value = node.value.trim();
41748
+ if (value.length > 0) parts.push(`x:${value}`);
41749
+ }
41750
+ const children = [];
41751
+ for (const [key, value] of Object.entries(node)) {
41752
+ if (JS_AST_IGNORED_KEYS.has(key)) continue;
41753
+ if (Array.isArray(value)) {
41754
+ for (const item of value) if (isAstNode(item)) children.push(item);
41755
+ } else if (isAstNode(value)) children.push(value);
41756
+ }
41757
+ for (let index = children.length - 1; index >= 0; index--) stack.push(children[index]);
41758
+ }
41759
+ const comments = ast.comments;
41760
+ if (Array.isArray(comments)) {
41761
+ for (const comment of comments) if (typeof comment?.value === "string" && comment.value.length > 0) parts.push(`c:${comment.value}`);
41762
+ }
41763
+ return parts.join("\n");
41764
+ } catch {
41765
+ return source;
41766
+ }
41767
+ }
41768
+ function createCssRuntimeAffectingSignature(source) {
41769
+ return source.replace(CSS_BLOCK_COMMENT_RE, "").replace(CSS_AROUND_PUNCTUATION_RE, "$1").replace(CSS_TRAILING_DECLARATION_SEMICOLON_RE, "}").replace(CSS_WHITESPACE_RE, " ").trim();
41770
+ }
41771
+ function createRuntimeAffectingSourceSignature(source, type) {
41772
+ if (type === "html") return createHtmlRuntimeAffectingSignature(source);
41773
+ if (type === "js") return createJsRuntimeAffectingSignature(source);
41774
+ if (type === "css") return createCssRuntimeAffectingSignature(source);
41775
+ return source;
41776
+ }
41777
+ //#endregion
41778
+ Object.defineProperty(exports, "AssetEmissionPlan", {
41779
+ enumerable: true,
41780
+ get: function() {
41781
+ return AssetEmissionPlan;
41782
+ }
41783
+ });
38592
41784
  Object.defineProperty(exports, "JsTokenUpdater", {
38593
41785
  enumerable: true,
38594
41786
  get: function() {
@@ -38619,28 +41811,100 @@ Object.defineProperty(exports, "babelParse", {
38619
41811
  return babelParse;
38620
41812
  }
38621
41813
  });
41814
+ Object.defineProperty(exports, "beginCompilerShadowRun", {
41815
+ enumerable: true,
41816
+ get: function() {
41817
+ return beginCompilerShadowRun;
41818
+ }
41819
+ });
41820
+ Object.defineProperty(exports, "collectRuntimeClassSet", {
41821
+ enumerable: true,
41822
+ get: function() {
41823
+ return collectRuntimeClassSet;
41824
+ }
41825
+ });
41826
+ Object.defineProperty(exports, "completeCompilerShadowReportRun", {
41827
+ enumerable: true,
41828
+ get: function() {
41829
+ return completeCompilerShadowReportRun;
41830
+ }
41831
+ });
41832
+ Object.defineProperty(exports, "composeGenerationArtifact", {
41833
+ enumerable: true,
41834
+ get: function() {
41835
+ return composeGenerationArtifact;
41836
+ }
41837
+ });
41838
+ Object.defineProperty(exports, "consumeCompilationScopeChanges", {
41839
+ enumerable: true,
41840
+ get: function() {
41841
+ return consumeCompilationScopeChanges;
41842
+ }
41843
+ });
38622
41844
  Object.defineProperty(exports, "createAttributeMatcher", {
38623
41845
  enumerable: true,
38624
41846
  get: function() {
38625
41847
  return createAttributeMatcher;
38626
41848
  }
38627
41849
  });
41850
+ Object.defineProperty(exports, "createCompilationDependencyChanges", {
41851
+ enumerable: true,
41852
+ get: function() {
41853
+ return createCompilationDependencyChanges;
41854
+ }
41855
+ });
41856
+ Object.defineProperty(exports, "createCompiler", {
41857
+ enumerable: true,
41858
+ get: function() {
41859
+ return createCompiler;
41860
+ }
41861
+ });
41862
+ Object.defineProperty(exports, "createCssFragment", {
41863
+ enumerable: true,
41864
+ get: function() {
41865
+ return createCssFragment;
41866
+ }
41867
+ });
38628
41868
  Object.defineProperty(exports, "createDebug", {
38629
41869
  enumerable: true,
38630
41870
  get: function() {
38631
41871
  return createDebug;
38632
41872
  }
38633
41873
  });
38634
- Object.defineProperty(exports, "createTemplateHandler", {
41874
+ Object.defineProperty(exports, "createGenerationArtifact", {
38635
41875
  enumerable: true,
38636
41876
  get: function() {
38637
- return createTemplateHandler;
41877
+ return createGenerationArtifact;
38638
41878
  }
38639
41879
  });
38640
- Object.defineProperty(exports, "decodeUnicode2", {
41880
+ Object.defineProperty(exports, "createRuntimeAffectingSourceSignature", {
38641
41881
  enumerable: true,
38642
41882
  get: function() {
38643
- return decodeUnicode2;
41883
+ return createRuntimeAffectingSourceSignature;
41884
+ }
41885
+ });
41886
+ Object.defineProperty(exports, "createStylePlatformAdapter", {
41887
+ enumerable: true,
41888
+ get: function() {
41889
+ return createStylePlatformAdapter;
41890
+ }
41891
+ });
41892
+ Object.defineProperty(exports, "createTailwindRuntimeReadyPromise", {
41893
+ enumerable: true,
41894
+ get: function() {
41895
+ return createTailwindRuntimeReadyPromise;
41896
+ }
41897
+ });
41898
+ Object.defineProperty(exports, "disposeCompilerOwner", {
41899
+ enumerable: true,
41900
+ get: function() {
41901
+ return disposeCompilerOwner;
41902
+ }
41903
+ });
41904
+ Object.defineProperty(exports, "ensureRuntimeClassSet", {
41905
+ enumerable: true,
41906
+ get: function() {
41907
+ return ensureRuntimeClassSet;
38644
41908
  }
38645
41909
  });
38646
41910
  Object.defineProperty(exports, "generateCode", {
@@ -38649,16 +41913,52 @@ Object.defineProperty(exports, "generateCode", {
38649
41913
  return generateCode;
38650
41914
  }
38651
41915
  });
38652
- Object.defineProperty(exports, "getReplacement", {
41916
+ Object.defineProperty(exports, "getCompilationScopeDependencyRevision", {
41917
+ enumerable: true,
41918
+ get: function() {
41919
+ return getCompilationScopeDependencyRevision;
41920
+ }
41921
+ });
41922
+ Object.defineProperty(exports, "getCompilationSessionPool", {
41923
+ enumerable: true,
41924
+ get: function() {
41925
+ return getCompilationSessionPool;
41926
+ }
41927
+ });
41928
+ Object.defineProperty(exports, "getCompilerContext", {
41929
+ enumerable: true,
41930
+ get: function() {
41931
+ return getCompilerContext;
41932
+ }
41933
+ });
41934
+ Object.defineProperty(exports, "getCompilerShadowRunRevision", {
41935
+ enumerable: true,
41936
+ get: function() {
41937
+ return getCompilerShadowRunRevision;
41938
+ }
41939
+ });
41940
+ Object.defineProperty(exports, "getCompilerShadowRunSnapshot", {
41941
+ enumerable: true,
41942
+ get: function() {
41943
+ return getCompilerShadowRunSnapshot;
41944
+ }
41945
+ });
41946
+ Object.defineProperty(exports, "getFrameworkCompilerSession", {
41947
+ enumerable: true,
41948
+ get: function() {
41949
+ return getFrameworkCompilerSession;
41950
+ }
41951
+ });
41952
+ Object.defineProperty(exports, "getTailwindGenerationSessionPool", {
38653
41953
  enumerable: true,
38654
41954
  get: function() {
38655
- return getReplacement;
41955
+ return getTailwindGenerationSessionPool;
38656
41956
  }
38657
41957
  });
38658
- Object.defineProperty(exports, "getReplacementCacheStore", {
41958
+ Object.defineProperty(exports, "invalidateCompilationScope", {
38659
41959
  enumerable: true,
38660
41960
  get: function() {
38661
- return getReplacementCacheStore;
41961
+ return invalidateCompilationScope;
38662
41962
  }
38663
41963
  });
38664
41964
  Object.defineProperty(exports, "isClassContextLiteralPath", {
@@ -38667,16 +41967,58 @@ Object.defineProperty(exports, "isClassContextLiteralPath", {
38667
41967
  return isClassContextLiteralPath;
38668
41968
  }
38669
41969
  });
38670
- Object.defineProperty(exports, "jsHandler", {
41970
+ Object.defineProperty(exports, "logRuntimeTailwindcssVersion", {
41971
+ enumerable: true,
41972
+ get: function() {
41973
+ return logRuntimeTailwindcssVersion;
41974
+ }
41975
+ });
41976
+ Object.defineProperty(exports, "logTailwindcssTarget", {
41977
+ enumerable: true,
41978
+ get: function() {
41979
+ return logTailwindcssTarget;
41980
+ }
41981
+ });
41982
+ Object.defineProperty(exports, "mergeCompilationDependencyChanges", {
38671
41983
  enumerable: true,
38672
41984
  get: function() {
38673
- return jsHandler;
41985
+ return mergeCompilationDependencyChanges;
38674
41986
  }
38675
41987
  });
38676
- Object.defineProperty(exports, "jsStringEscape", {
41988
+ Object.defineProperty(exports, "normalizeFrameworkStylePlatform", {
38677
41989
  enumerable: true,
38678
41990
  get: function() {
38679
- return jsStringEscape;
41991
+ return normalizeFrameworkStylePlatform;
41992
+ }
41993
+ });
41994
+ Object.defineProperty(exports, "normalizeStyleHandlerMajorVersion", {
41995
+ enumerable: true,
41996
+ get: function() {
41997
+ return normalizeStyleHandlerMajorVersion;
41998
+ }
41999
+ });
42000
+ Object.defineProperty(exports, "pluginName", {
42001
+ enumerable: true,
42002
+ get: function() {
42003
+ return pluginName;
42004
+ }
42005
+ });
42006
+ Object.defineProperty(exports, "recordCompilationDependencyChanges", {
42007
+ enumerable: true,
42008
+ get: function() {
42009
+ return recordCompilationDependencyChanges;
42010
+ }
42011
+ });
42012
+ Object.defineProperty(exports, "recordCompilerShadowReport", {
42013
+ enumerable: true,
42014
+ get: function() {
42015
+ return recordCompilerShadowReport;
42016
+ }
42017
+ });
42018
+ Object.defineProperty(exports, "refreshTailwindRuntimeState", {
42019
+ enumerable: true,
42020
+ get: function() {
42021
+ return refreshTailwindRuntimeState;
38680
42022
  }
38681
42023
  });
38682
42024
  Object.defineProperty(exports, "replaceWxml", {
@@ -38685,10 +42027,28 @@ Object.defineProperty(exports, "replaceWxml", {
38685
42027
  return replaceWxml;
38686
42028
  }
38687
42029
  });
38688
- Object.defineProperty(exports, "resolveClassNameTransformWithResult", {
42030
+ Object.defineProperty(exports, "resolveStyleOptionsFromContext", {
42031
+ enumerable: true,
42032
+ get: function() {
42033
+ return resolveStyleOptionsFromContext;
42034
+ }
42035
+ });
42036
+ Object.defineProperty(exports, "runCompilerOwnerActivity", {
42037
+ enumerable: true,
42038
+ get: function() {
42039
+ return runCompilerOwnerActivity;
42040
+ }
42041
+ });
42042
+ Object.defineProperty(exports, "shouldSkipJsTransform", {
38689
42043
  enumerable: true,
38690
42044
  get: function() {
38691
- return resolveClassNameTransformWithResult;
42045
+ return shouldSkipJsTransform;
42046
+ }
42047
+ });
42048
+ Object.defineProperty(exports, "toCustomAttributesEntities", {
42049
+ enumerable: true,
42050
+ get: function() {
42051
+ return toCustomAttributesEntities;
38692
42052
  }
38693
42053
  });
38694
42054
  Object.defineProperty(exports, "traverse", {
@@ -38697,3 +42057,9 @@ Object.defineProperty(exports, "traverse", {
38697
42057
  return traverse;
38698
42058
  }
38699
42059
  });
42060
+ Object.defineProperty(exports, "vitePluginName", {
42061
+ enumerable: true,
42062
+ get: function() {
42063
+ return vitePluginName;
42064
+ }
42065
+ });