vlt 0.0.0-3 → 0.0.0-5

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 (125) hide show
  1. package/README.md +2 -1
  2. package/package.json +17 -10
  3. package/postinstall.cjs +56 -0
  4. package/vlix +25 -0
  5. package/vlr +25 -0
  6. package/vlrx +25 -0
  7. package/vlt +25 -0
  8. package/vlx +25 -0
  9. package/cache-unzip-src-unzip.js +0 -7896
  10. package/cache-unzip-src-unzip.js.map +0 -7
  11. package/chunk-227OF2U2.js +0 -1183
  12. package/chunk-227OF2U2.js.map +0 -7
  13. package/chunk-3HXIYJS2.js +0 -54
  14. package/chunk-3HXIYJS2.js.map +0 -7
  15. package/chunk-AA6MVXJX.js +0 -19823
  16. package/chunk-AA6MVXJX.js.map +0 -7
  17. package/chunk-BCK4ZGNG.js +0 -41
  18. package/chunk-BCK4ZGNG.js.map +0 -7
  19. package/chunk-DH36SF3E.js +0 -35
  20. package/chunk-DH36SF3E.js.map +0 -7
  21. package/chunk-FNKWJ7AZ.js +0 -1379
  22. package/chunk-FNKWJ7AZ.js.map +0 -7
  23. package/chunk-H77UDCL3.js +0 -9820
  24. package/chunk-H77UDCL3.js.map +0 -7
  25. package/chunk-HL76E44L.js +0 -73
  26. package/chunk-HL76E44L.js.map +0 -7
  27. package/chunk-IN7DEH7F.js +0 -44
  28. package/chunk-IN7DEH7F.js.map +0 -7
  29. package/chunk-JLP2QDXQ.js +0 -1137
  30. package/chunk-JLP2QDXQ.js.map +0 -7
  31. package/chunk-JMGSFQ32.js +0 -969
  32. package/chunk-JMGSFQ32.js.map +0 -7
  33. package/chunk-JQRUGUZ3.js +0 -512
  34. package/chunk-JQRUGUZ3.js.map +0 -7
  35. package/chunk-K2BYYPM7.js +0 -8656
  36. package/chunk-K2BYYPM7.js.map +0 -7
  37. package/chunk-LNUDEBGP.js +0 -2071
  38. package/chunk-LNUDEBGP.js.map +0 -7
  39. package/chunk-MV5ZQ3LW.js +0 -1105
  40. package/chunk-MV5ZQ3LW.js.map +0 -7
  41. package/chunk-O7CDQZDW.js +0 -5234
  42. package/chunk-O7CDQZDW.js.map +0 -7
  43. package/chunk-OFW7MWFP.js +0 -82
  44. package/chunk-OFW7MWFP.js.map +0 -7
  45. package/chunk-PGDJ2ZZ6.js +0 -4810
  46. package/chunk-PGDJ2ZZ6.js.map +0 -7
  47. package/chunk-POVPHE2F.js +0 -1864
  48. package/chunk-POVPHE2F.js.map +0 -7
  49. package/chunk-PTVPYZHU.js +0 -72
  50. package/chunk-PTVPYZHU.js.map +0 -7
  51. package/chunk-SXBMMXTY.js +0 -11837
  52. package/chunk-SXBMMXTY.js.map +0 -7
  53. package/chunk-UZZ72UON.js +0 -152
  54. package/chunk-UZZ72UON.js.map +0 -7
  55. package/chunk-V7KRP7IO.js +0 -481
  56. package/chunk-V7KRP7IO.js.map +0 -7
  57. package/chunk-WVNUD273.js +0 -83
  58. package/chunk-WVNUD273.js.map +0 -7
  59. package/chunk-WYPE3MV4.js +0 -62
  60. package/chunk-WYPE3MV4.js.map +0 -7
  61. package/chunk-ZRNJWPYC.js +0 -37
  62. package/chunk-ZRNJWPYC.js.map +0 -7
  63. package/cli-package.json +0 -107
  64. package/config-3QQHUYLI.js +0 -179
  65. package/config-3QQHUYLI.js.map +0 -7
  66. package/devtools-5BBQJTDW.js +0 -16682
  67. package/devtools-5BBQJTDW.js.map +0 -7
  68. package/exec-C6GK336U.js +0 -50
  69. package/exec-C6GK336U.js.map +0 -7
  70. package/gui-IQ4M4K5X.js +0 -46
  71. package/gui-IQ4M4K5X.js.map +0 -7
  72. package/gui-assets/favicon.ico +0 -0
  73. package/gui-assets/fonts/geist-mono.ttf +0 -0
  74. package/gui-assets/fonts/inter.ttf +0 -0
  75. package/gui-assets/images/folder.png +0 -0
  76. package/gui-assets/index.html +0 -34
  77. package/gui-assets/index.js +0 -1549
  78. package/gui-assets/index.js.map +0 -7
  79. package/gui-assets/main.css +0 -1
  80. package/help-R6TSKVEA.js +0 -25
  81. package/help-R6TSKVEA.js.map +0 -7
  82. package/init-UTJGYULC.js +0 -25
  83. package/init-UTJGYULC.js.map +0 -7
  84. package/install-5XDTGLAU.js +0 -56
  85. package/install-5XDTGLAU.js.map +0 -7
  86. package/install-exec-VMPN3JE7.js +0 -28
  87. package/install-exec-VMPN3JE7.js.map +0 -7
  88. package/list-Q7IANZ3I.js +0 -129
  89. package/list-Q7IANZ3I.js.map +0 -7
  90. package/login-VHJEIRVU.js +0 -36
  91. package/login-VHJEIRVU.js.map +0 -7
  92. package/logout-5KMCSSR4.js +0 -36
  93. package/logout-5KMCSSR4.js.map +0 -7
  94. package/pkg-WYFDWETL.js +0 -364
  95. package/pkg-WYFDWETL.js.map +0 -7
  96. package/query-KP4F5D2Y.js +0 -117
  97. package/query-KP4F5D2Y.js.map +0 -7
  98. package/registry-client-package.json +0 -85
  99. package/reporter-LFGXWL6N.js +0 -18
  100. package/reporter-LFGXWL6N.js.map +0 -7
  101. package/rollback-remove-src-remove.js +0 -7398
  102. package/rollback-remove-src-remove.js.map +0 -7
  103. package/run-XNDZH72D.js +0 -68
  104. package/run-XNDZH72D.js.map +0 -7
  105. package/run-exec-NXA33NXJ.js +0 -41
  106. package/run-exec-NXA33NXJ.js.map +0 -7
  107. package/source-JWPG6PR3.js +0 -33
  108. package/source-JWPG6PR3.js.map +0 -7
  109. package/token-6IJNGEMI.js +0 -86
  110. package/token-6IJNGEMI.js.map +0 -7
  111. package/uninstall-MI7NFD27.js +0 -45
  112. package/uninstall-MI7NFD27.js.map +0 -7
  113. package/vlix.js +0 -25
  114. package/vlix.js.map +0 -7
  115. package/vlr.js +0 -25
  116. package/vlr.js.map +0 -7
  117. package/vlrx.js +0 -25
  118. package/vlrx.js.map +0 -7
  119. package/vlt.js +0 -24
  120. package/vlt.js.map +0 -7
  121. package/vlx.js +0 -25
  122. package/vlx.js.map +0 -7
  123. package/whoami-3IEXJF3U.js +0 -46
  124. package/whoami-3IEXJF3U.js.map +0 -7
  125. package/yoga.wasm +0 -0
package/chunk-PGDJ2ZZ6.js DELETED
@@ -1,4810 +0,0 @@
1
- var global = globalThis;
2
- import {Buffer} from "node:buffer";
3
- import {setImmediate, clearImmediate} from "node:timers";
4
- import {createRequire as _vlt_createRequire} from 'node:module';
5
- var require = _vlt_createRequire(import.meta.filename);
6
- import {
7
- hydrate,
8
- splitDepID
9
- } from "./chunk-K2BYYPM7.js";
10
- import {
11
- asManifest,
12
- compare,
13
- eq,
14
- gt,
15
- gte,
16
- lt,
17
- lte,
18
- major,
19
- minor,
20
- neq,
21
- parse2 as parse,
22
- parseRange,
23
- patch,
24
- satisfies
25
- } from "./chunk-POVPHE2F.js";
26
- import {
27
- error
28
- } from "./chunk-ZRNJWPYC.js";
29
- import {
30
- __commonJS,
31
- __require,
32
- __toESM
33
- } from "./chunk-3HXIYJS2.js";
34
-
35
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/unesc.js
36
- var require_unesc = __commonJS({
37
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/unesc.js"(exports, module) {
38
- "use strict";
39
- exports.__esModule = true;
40
- exports["default"] = unesc;
41
- function gobbleHex(str) {
42
- var lower = str.toLowerCase();
43
- var hex = "";
44
- var spaceTerminated = false;
45
- for (var i = 0; i < 6 && lower[i] !== void 0; i++) {
46
- var code = lower.charCodeAt(i);
47
- var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;
48
- spaceTerminated = code === 32;
49
- if (!valid) {
50
- break;
51
- }
52
- hex += lower[i];
53
- }
54
- if (hex.length === 0) {
55
- return void 0;
56
- }
57
- var codePoint = parseInt(hex, 16);
58
- var isSurrogate = codePoint >= 55296 && codePoint <= 57343;
59
- if (isSurrogate || codePoint === 0 || codePoint > 1114111) {
60
- return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
61
- }
62
- return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
63
- }
64
- var CONTAINS_ESCAPE = /\\/;
65
- function unesc(str) {
66
- var needToProcess = CONTAINS_ESCAPE.test(str);
67
- if (!needToProcess) {
68
- return str;
69
- }
70
- var ret = "";
71
- for (var i = 0; i < str.length; i++) {
72
- if (str[i] === "\\") {
73
- var gobbled = gobbleHex(str.slice(i + 1, i + 7));
74
- if (gobbled !== void 0) {
75
- ret += gobbled[0];
76
- i += gobbled[1];
77
- continue;
78
- }
79
- if (str[i + 1] === "\\") {
80
- ret += "\\";
81
- i++;
82
- continue;
83
- }
84
- if (str.length === i + 1) {
85
- ret += str[i];
86
- }
87
- continue;
88
- }
89
- ret += str[i];
90
- }
91
- return ret;
92
- }
93
- module.exports = exports.default;
94
- }
95
- });
96
-
97
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/getProp.js
98
- var require_getProp = __commonJS({
99
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/getProp.js"(exports, module) {
100
- "use strict";
101
- exports.__esModule = true;
102
- exports["default"] = getProp;
103
- function getProp(obj) {
104
- for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
105
- props[_key - 1] = arguments[_key];
106
- }
107
- while (props.length > 0) {
108
- var prop = props.shift();
109
- if (!obj[prop]) {
110
- return void 0;
111
- }
112
- obj = obj[prop];
113
- }
114
- return obj;
115
- }
116
- module.exports = exports.default;
117
- }
118
- });
119
-
120
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/ensureObject.js
121
- var require_ensureObject = __commonJS({
122
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/ensureObject.js"(exports, module) {
123
- "use strict";
124
- exports.__esModule = true;
125
- exports["default"] = ensureObject;
126
- function ensureObject(obj) {
127
- for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
128
- props[_key - 1] = arguments[_key];
129
- }
130
- while (props.length > 0) {
131
- var prop = props.shift();
132
- if (!obj[prop]) {
133
- obj[prop] = {};
134
- }
135
- obj = obj[prop];
136
- }
137
- }
138
- module.exports = exports.default;
139
- }
140
- });
141
-
142
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/stripComments.js
143
- var require_stripComments = __commonJS({
144
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/stripComments.js"(exports, module) {
145
- "use strict";
146
- exports.__esModule = true;
147
- exports["default"] = stripComments;
148
- function stripComments(str) {
149
- var s = "";
150
- var commentStart = str.indexOf("/*");
151
- var lastEnd = 0;
152
- while (commentStart >= 0) {
153
- s = s + str.slice(lastEnd, commentStart);
154
- var commentEnd = str.indexOf("*/", commentStart + 2);
155
- if (commentEnd < 0) {
156
- return s;
157
- }
158
- lastEnd = commentEnd + 2;
159
- commentStart = str.indexOf("/*", lastEnd);
160
- }
161
- s = s + str.slice(lastEnd);
162
- return s;
163
- }
164
- module.exports = exports.default;
165
- }
166
- });
167
-
168
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/index.js
169
- var require_util = __commonJS({
170
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/util/index.js"(exports) {
171
- "use strict";
172
- exports.__esModule = true;
173
- exports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0;
174
- var _unesc = _interopRequireDefault(require_unesc());
175
- exports.unesc = _unesc["default"];
176
- var _getProp = _interopRequireDefault(require_getProp());
177
- exports.getProp = _getProp["default"];
178
- var _ensureObject = _interopRequireDefault(require_ensureObject());
179
- exports.ensureObject = _ensureObject["default"];
180
- var _stripComments = _interopRequireDefault(require_stripComments());
181
- exports.stripComments = _stripComments["default"];
182
- function _interopRequireDefault(obj) {
183
- return obj && obj.__esModule ? obj : { "default": obj };
184
- }
185
- }
186
- });
187
-
188
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/node.js
189
- var require_node = __commonJS({
190
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/node.js"(exports, module) {
191
- "use strict";
192
- exports.__esModule = true;
193
- exports["default"] = void 0;
194
- var _util = require_util();
195
- function _defineProperties(target, props) {
196
- for (var i = 0; i < props.length; i++) {
197
- var descriptor = props[i];
198
- descriptor.enumerable = descriptor.enumerable || false;
199
- descriptor.configurable = true;
200
- if ("value" in descriptor) descriptor.writable = true;
201
- Object.defineProperty(target, descriptor.key, descriptor);
202
- }
203
- }
204
- function _createClass(Constructor, protoProps, staticProps) {
205
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
206
- if (staticProps) _defineProperties(Constructor, staticProps);
207
- Object.defineProperty(Constructor, "prototype", { writable: false });
208
- return Constructor;
209
- }
210
- var cloneNode = function cloneNode2(obj, parent) {
211
- if (typeof obj !== "object" || obj === null) {
212
- return obj;
213
- }
214
- var cloned = new obj.constructor();
215
- for (var i in obj) {
216
- if (!obj.hasOwnProperty(i)) {
217
- continue;
218
- }
219
- var value = obj[i];
220
- var type = typeof value;
221
- if (i === "parent" && type === "object") {
222
- if (parent) {
223
- cloned[i] = parent;
224
- }
225
- } else if (value instanceof Array) {
226
- cloned[i] = value.map(function(j) {
227
- return cloneNode2(j, cloned);
228
- });
229
- } else {
230
- cloned[i] = cloneNode2(value, cloned);
231
- }
232
- }
233
- return cloned;
234
- };
235
- var Node = /* @__PURE__ */ function() {
236
- function Node2(opts) {
237
- if (opts === void 0) {
238
- opts = {};
239
- }
240
- Object.assign(this, opts);
241
- this.spaces = this.spaces || {};
242
- this.spaces.before = this.spaces.before || "";
243
- this.spaces.after = this.spaces.after || "";
244
- }
245
- var _proto = Node2.prototype;
246
- _proto.remove = function remove() {
247
- if (this.parent) {
248
- this.parent.removeChild(this);
249
- }
250
- this.parent = void 0;
251
- return this;
252
- };
253
- _proto.replaceWith = function replaceWith() {
254
- if (this.parent) {
255
- for (var index in arguments) {
256
- this.parent.insertBefore(this, arguments[index]);
257
- }
258
- this.remove();
259
- }
260
- return this;
261
- };
262
- _proto.next = function next() {
263
- return this.parent.at(this.parent.index(this) + 1);
264
- };
265
- _proto.prev = function prev() {
266
- return this.parent.at(this.parent.index(this) - 1);
267
- };
268
- _proto.clone = function clone(overrides) {
269
- if (overrides === void 0) {
270
- overrides = {};
271
- }
272
- var cloned = cloneNode(this);
273
- for (var name in overrides) {
274
- cloned[name] = overrides[name];
275
- }
276
- return cloned;
277
- };
278
- _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
279
- if (!this.raws) {
280
- this.raws = {};
281
- }
282
- var originalValue = this[name];
283
- var originalEscaped = this.raws[name];
284
- this[name] = originalValue + value;
285
- if (originalEscaped || valueEscaped !== value) {
286
- this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
287
- } else {
288
- delete this.raws[name];
289
- }
290
- };
291
- _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
292
- if (!this.raws) {
293
- this.raws = {};
294
- }
295
- this[name] = value;
296
- this.raws[name] = valueEscaped;
297
- };
298
- _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
299
- this[name] = value;
300
- if (this.raws) {
301
- delete this.raws[name];
302
- }
303
- };
304
- _proto.isAtPosition = function isAtPosition(line, column) {
305
- if (this.source && this.source.start && this.source.end) {
306
- if (this.source.start.line > line) {
307
- return false;
308
- }
309
- if (this.source.end.line < line) {
310
- return false;
311
- }
312
- if (this.source.start.line === line && this.source.start.column > column) {
313
- return false;
314
- }
315
- if (this.source.end.line === line && this.source.end.column < column) {
316
- return false;
317
- }
318
- return true;
319
- }
320
- return void 0;
321
- };
322
- _proto.stringifyProperty = function stringifyProperty(name) {
323
- return this.raws && this.raws[name] || this[name];
324
- };
325
- _proto.valueToString = function valueToString() {
326
- return String(this.stringifyProperty("value"));
327
- };
328
- _proto.toString = function toString() {
329
- return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join("");
330
- };
331
- _createClass(Node2, [{
332
- key: "rawSpaceBefore",
333
- get: function get() {
334
- var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
335
- if (rawSpace === void 0) {
336
- rawSpace = this.spaces && this.spaces.before;
337
- }
338
- return rawSpace || "";
339
- },
340
- set: function set(raw) {
341
- (0, _util.ensureObject)(this, "raws", "spaces");
342
- this.raws.spaces.before = raw;
343
- }
344
- }, {
345
- key: "rawSpaceAfter",
346
- get: function get() {
347
- var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
348
- if (rawSpace === void 0) {
349
- rawSpace = this.spaces.after;
350
- }
351
- return rawSpace || "";
352
- },
353
- set: function set(raw) {
354
- (0, _util.ensureObject)(this, "raws", "spaces");
355
- this.raws.spaces.after = raw;
356
- }
357
- }]);
358
- return Node2;
359
- }();
360
- exports["default"] = Node;
361
- module.exports = exports.default;
362
- }
363
- });
364
-
365
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/types.js
366
- var require_types = __commonJS({
367
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/types.js"(exports) {
368
- "use strict";
369
- exports.__esModule = true;
370
- exports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0;
371
- var TAG = "tag";
372
- exports.TAG = TAG;
373
- var STRING = "string";
374
- exports.STRING = STRING;
375
- var SELECTOR = "selector";
376
- exports.SELECTOR = SELECTOR;
377
- var ROOT = "root";
378
- exports.ROOT = ROOT;
379
- var PSEUDO = "pseudo";
380
- exports.PSEUDO = PSEUDO;
381
- var NESTING = "nesting";
382
- exports.NESTING = NESTING;
383
- var ID = "id";
384
- exports.ID = ID;
385
- var COMMENT = "comment";
386
- exports.COMMENT = COMMENT;
387
- var COMBINATOR = "combinator";
388
- exports.COMBINATOR = COMBINATOR;
389
- var CLASS = "class";
390
- exports.CLASS = CLASS;
391
- var ATTRIBUTE = "attribute";
392
- exports.ATTRIBUTE = ATTRIBUTE;
393
- var UNIVERSAL = "universal";
394
- exports.UNIVERSAL = UNIVERSAL;
395
- }
396
- });
397
-
398
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/container.js
399
- var require_container = __commonJS({
400
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/container.js"(exports, module) {
401
- "use strict";
402
- exports.__esModule = true;
403
- exports["default"] = void 0;
404
- var _node = _interopRequireDefault(require_node());
405
- var types = _interopRequireWildcard(require_types());
406
- function _getRequireWildcardCache(nodeInterop) {
407
- if (typeof WeakMap !== "function") return null;
408
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
409
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
410
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
411
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
412
- })(nodeInterop);
413
- }
414
- function _interopRequireWildcard(obj, nodeInterop) {
415
- if (!nodeInterop && obj && obj.__esModule) {
416
- return obj;
417
- }
418
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
419
- return { "default": obj };
420
- }
421
- var cache = _getRequireWildcardCache(nodeInterop);
422
- if (cache && cache.has(obj)) {
423
- return cache.get(obj);
424
- }
425
- var newObj = {};
426
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
427
- for (var key in obj) {
428
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
429
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
430
- if (desc && (desc.get || desc.set)) {
431
- Object.defineProperty(newObj, key, desc);
432
- } else {
433
- newObj[key] = obj[key];
434
- }
435
- }
436
- }
437
- newObj["default"] = obj;
438
- if (cache) {
439
- cache.set(obj, newObj);
440
- }
441
- return newObj;
442
- }
443
- function _interopRequireDefault(obj) {
444
- return obj && obj.__esModule ? obj : { "default": obj };
445
- }
446
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
447
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
448
- if (it) return (it = it.call(o)).next.bind(it);
449
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
450
- if (it) o = it;
451
- var i = 0;
452
- return function() {
453
- if (i >= o.length) return { done: true };
454
- return { done: false, value: o[i++] };
455
- };
456
- }
457
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
458
- }
459
- function _unsupportedIterableToArray(o, minLen) {
460
- if (!o) return;
461
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
462
- var n = Object.prototype.toString.call(o).slice(8, -1);
463
- if (n === "Object" && o.constructor) n = o.constructor.name;
464
- if (n === "Map" || n === "Set") return Array.from(o);
465
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
466
- }
467
- function _arrayLikeToArray(arr, len) {
468
- if (len == null || len > arr.length) len = arr.length;
469
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
470
- arr2[i] = arr[i];
471
- }
472
- return arr2;
473
- }
474
- function _defineProperties(target, props) {
475
- for (var i = 0; i < props.length; i++) {
476
- var descriptor = props[i];
477
- descriptor.enumerable = descriptor.enumerable || false;
478
- descriptor.configurable = true;
479
- if ("value" in descriptor) descriptor.writable = true;
480
- Object.defineProperty(target, descriptor.key, descriptor);
481
- }
482
- }
483
- function _createClass(Constructor, protoProps, staticProps) {
484
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
485
- if (staticProps) _defineProperties(Constructor, staticProps);
486
- Object.defineProperty(Constructor, "prototype", { writable: false });
487
- return Constructor;
488
- }
489
- function _inheritsLoose(subClass, superClass) {
490
- subClass.prototype = Object.create(superClass.prototype);
491
- subClass.prototype.constructor = subClass;
492
- _setPrototypeOf(subClass, superClass);
493
- }
494
- function _setPrototypeOf(o, p) {
495
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
496
- o2.__proto__ = p2;
497
- return o2;
498
- };
499
- return _setPrototypeOf(o, p);
500
- }
501
- var Container = /* @__PURE__ */ function(_Node) {
502
- _inheritsLoose(Container2, _Node);
503
- function Container2(opts) {
504
- var _this;
505
- _this = _Node.call(this, opts) || this;
506
- if (!_this.nodes) {
507
- _this.nodes = [];
508
- }
509
- return _this;
510
- }
511
- var _proto = Container2.prototype;
512
- _proto.append = function append(selector) {
513
- selector.parent = this;
514
- this.nodes.push(selector);
515
- return this;
516
- };
517
- _proto.prepend = function prepend(selector) {
518
- selector.parent = this;
519
- this.nodes.unshift(selector);
520
- return this;
521
- };
522
- _proto.at = function at(index) {
523
- return this.nodes[index];
524
- };
525
- _proto.index = function index(child) {
526
- if (typeof child === "number") {
527
- return child;
528
- }
529
- return this.nodes.indexOf(child);
530
- };
531
- _proto.removeChild = function removeChild(child) {
532
- child = this.index(child);
533
- this.at(child).parent = void 0;
534
- this.nodes.splice(child, 1);
535
- var index;
536
- for (var id2 in this.indexes) {
537
- index = this.indexes[id2];
538
- if (index >= child) {
539
- this.indexes[id2] = index - 1;
540
- }
541
- }
542
- return this;
543
- };
544
- _proto.removeAll = function removeAll() {
545
- for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done; ) {
546
- var node = _step.value;
547
- node.parent = void 0;
548
- }
549
- this.nodes = [];
550
- return this;
551
- };
552
- _proto.empty = function empty2() {
553
- return this.removeAll();
554
- };
555
- _proto.insertAfter = function insertAfter(oldNode, newNode) {
556
- newNode.parent = this;
557
- var oldIndex = this.index(oldNode);
558
- this.nodes.splice(oldIndex + 1, 0, newNode);
559
- newNode.parent = this;
560
- var index;
561
- for (var id2 in this.indexes) {
562
- index = this.indexes[id2];
563
- if (oldIndex <= index) {
564
- this.indexes[id2] = index + 1;
565
- }
566
- }
567
- return this;
568
- };
569
- _proto.insertBefore = function insertBefore(oldNode, newNode) {
570
- newNode.parent = this;
571
- var oldIndex = this.index(oldNode);
572
- this.nodes.splice(oldIndex, 0, newNode);
573
- newNode.parent = this;
574
- var index;
575
- for (var id2 in this.indexes) {
576
- index = this.indexes[id2];
577
- if (index <= oldIndex) {
578
- this.indexes[id2] = index + 1;
579
- }
580
- }
581
- return this;
582
- };
583
- _proto._findChildAtPosition = function _findChildAtPosition(line, col) {
584
- var found = void 0;
585
- this.each(function(node) {
586
- if (node.atPosition) {
587
- var foundChild = node.atPosition(line, col);
588
- if (foundChild) {
589
- found = foundChild;
590
- return false;
591
- }
592
- } else if (node.isAtPosition(line, col)) {
593
- found = node;
594
- return false;
595
- }
596
- });
597
- return found;
598
- };
599
- _proto.atPosition = function atPosition(line, col) {
600
- if (this.isAtPosition(line, col)) {
601
- return this._findChildAtPosition(line, col) || this;
602
- } else {
603
- return void 0;
604
- }
605
- };
606
- _proto._inferEndPosition = function _inferEndPosition() {
607
- if (this.last && this.last.source && this.last.source.end) {
608
- this.source = this.source || {};
609
- this.source.end = this.source.end || {};
610
- Object.assign(this.source.end, this.last.source.end);
611
- }
612
- };
613
- _proto.each = function each(callback) {
614
- if (!this.lastEach) {
615
- this.lastEach = 0;
616
- }
617
- if (!this.indexes) {
618
- this.indexes = {};
619
- }
620
- this.lastEach++;
621
- var id2 = this.lastEach;
622
- this.indexes[id2] = 0;
623
- if (!this.length) {
624
- return void 0;
625
- }
626
- var index, result;
627
- while (this.indexes[id2] < this.length) {
628
- index = this.indexes[id2];
629
- result = callback(this.at(index), index);
630
- if (result === false) {
631
- break;
632
- }
633
- this.indexes[id2] += 1;
634
- }
635
- delete this.indexes[id2];
636
- if (result === false) {
637
- return false;
638
- }
639
- };
640
- _proto.walk = function walk2(callback) {
641
- return this.each(function(node, i) {
642
- var result = callback(node, i);
643
- if (result !== false && node.length) {
644
- result = node.walk(callback);
645
- }
646
- if (result === false) {
647
- return false;
648
- }
649
- });
650
- };
651
- _proto.walkAttributes = function walkAttributes(callback) {
652
- var _this2 = this;
653
- return this.walk(function(selector) {
654
- if (selector.type === types.ATTRIBUTE) {
655
- return callback.call(_this2, selector);
656
- }
657
- });
658
- };
659
- _proto.walkClasses = function walkClasses(callback) {
660
- var _this3 = this;
661
- return this.walk(function(selector) {
662
- if (selector.type === types.CLASS) {
663
- return callback.call(_this3, selector);
664
- }
665
- });
666
- };
667
- _proto.walkCombinators = function walkCombinators(callback) {
668
- var _this4 = this;
669
- return this.walk(function(selector) {
670
- if (selector.type === types.COMBINATOR) {
671
- return callback.call(_this4, selector);
672
- }
673
- });
674
- };
675
- _proto.walkComments = function walkComments(callback) {
676
- var _this5 = this;
677
- return this.walk(function(selector) {
678
- if (selector.type === types.COMMENT) {
679
- return callback.call(_this5, selector);
680
- }
681
- });
682
- };
683
- _proto.walkIds = function walkIds(callback) {
684
- var _this6 = this;
685
- return this.walk(function(selector) {
686
- if (selector.type === types.ID) {
687
- return callback.call(_this6, selector);
688
- }
689
- });
690
- };
691
- _proto.walkNesting = function walkNesting(callback) {
692
- var _this7 = this;
693
- return this.walk(function(selector) {
694
- if (selector.type === types.NESTING) {
695
- return callback.call(_this7, selector);
696
- }
697
- });
698
- };
699
- _proto.walkPseudos = function walkPseudos(callback) {
700
- var _this8 = this;
701
- return this.walk(function(selector) {
702
- if (selector.type === types.PSEUDO) {
703
- return callback.call(_this8, selector);
704
- }
705
- });
706
- };
707
- _proto.walkTags = function walkTags(callback) {
708
- var _this9 = this;
709
- return this.walk(function(selector) {
710
- if (selector.type === types.TAG) {
711
- return callback.call(_this9, selector);
712
- }
713
- });
714
- };
715
- _proto.walkUniversals = function walkUniversals(callback) {
716
- var _this10 = this;
717
- return this.walk(function(selector) {
718
- if (selector.type === types.UNIVERSAL) {
719
- return callback.call(_this10, selector);
720
- }
721
- });
722
- };
723
- _proto.split = function split(callback) {
724
- var _this11 = this;
725
- var current = [];
726
- return this.reduce(function(memo, node, index) {
727
- var split2 = callback.call(_this11, node);
728
- current.push(node);
729
- if (split2) {
730
- memo.push(current);
731
- current = [];
732
- } else if (index === _this11.length - 1) {
733
- memo.push(current);
734
- }
735
- return memo;
736
- }, []);
737
- };
738
- _proto.map = function map(callback) {
739
- return this.nodes.map(callback);
740
- };
741
- _proto.reduce = function reduce(callback, memo) {
742
- return this.nodes.reduce(callback, memo);
743
- };
744
- _proto.every = function every(callback) {
745
- return this.nodes.every(callback);
746
- };
747
- _proto.some = function some(callback) {
748
- return this.nodes.some(callback);
749
- };
750
- _proto.filter = function filter(callback) {
751
- return this.nodes.filter(callback);
752
- };
753
- _proto.sort = function sort(callback) {
754
- return this.nodes.sort(callback);
755
- };
756
- _proto.toString = function toString() {
757
- return this.map(String).join("");
758
- };
759
- _createClass(Container2, [{
760
- key: "first",
761
- get: function get() {
762
- return this.at(0);
763
- }
764
- }, {
765
- key: "last",
766
- get: function get() {
767
- return this.at(this.length - 1);
768
- }
769
- }, {
770
- key: "length",
771
- get: function get() {
772
- return this.nodes.length;
773
- }
774
- }]);
775
- return Container2;
776
- }(_node["default"]);
777
- exports["default"] = Container;
778
- module.exports = exports.default;
779
- }
780
- });
781
-
782
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/root.js
783
- var require_root = __commonJS({
784
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/root.js"(exports, module) {
785
- "use strict";
786
- exports.__esModule = true;
787
- exports["default"] = void 0;
788
- var _container = _interopRequireDefault(require_container());
789
- var _types = require_types();
790
- function _interopRequireDefault(obj) {
791
- return obj && obj.__esModule ? obj : { "default": obj };
792
- }
793
- function _defineProperties(target, props) {
794
- for (var i = 0; i < props.length; i++) {
795
- var descriptor = props[i];
796
- descriptor.enumerable = descriptor.enumerable || false;
797
- descriptor.configurable = true;
798
- if ("value" in descriptor) descriptor.writable = true;
799
- Object.defineProperty(target, descriptor.key, descriptor);
800
- }
801
- }
802
- function _createClass(Constructor, protoProps, staticProps) {
803
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
804
- if (staticProps) _defineProperties(Constructor, staticProps);
805
- Object.defineProperty(Constructor, "prototype", { writable: false });
806
- return Constructor;
807
- }
808
- function _inheritsLoose(subClass, superClass) {
809
- subClass.prototype = Object.create(superClass.prototype);
810
- subClass.prototype.constructor = subClass;
811
- _setPrototypeOf(subClass, superClass);
812
- }
813
- function _setPrototypeOf(o, p) {
814
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
815
- o2.__proto__ = p2;
816
- return o2;
817
- };
818
- return _setPrototypeOf(o, p);
819
- }
820
- var Root = /* @__PURE__ */ function(_Container) {
821
- _inheritsLoose(Root2, _Container);
822
- function Root2(opts) {
823
- var _this;
824
- _this = _Container.call(this, opts) || this;
825
- _this.type = _types.ROOT;
826
- return _this;
827
- }
828
- var _proto = Root2.prototype;
829
- _proto.toString = function toString() {
830
- var str = this.reduce(function(memo, selector) {
831
- memo.push(String(selector));
832
- return memo;
833
- }, []).join(",");
834
- return this.trailingComma ? str + "," : str;
835
- };
836
- _proto.error = function error2(message, options) {
837
- if (this._error) {
838
- return this._error(message, options);
839
- } else {
840
- return new Error(message);
841
- }
842
- };
843
- _createClass(Root2, [{
844
- key: "errorGenerator",
845
- set: function set(handler) {
846
- this._error = handler;
847
- }
848
- }]);
849
- return Root2;
850
- }(_container["default"]);
851
- exports["default"] = Root;
852
- module.exports = exports.default;
853
- }
854
- });
855
-
856
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/selector.js
857
- var require_selector = __commonJS({
858
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/selector.js"(exports, module) {
859
- "use strict";
860
- exports.__esModule = true;
861
- exports["default"] = void 0;
862
- var _container = _interopRequireDefault(require_container());
863
- var _types = require_types();
864
- function _interopRequireDefault(obj) {
865
- return obj && obj.__esModule ? obj : { "default": obj };
866
- }
867
- function _inheritsLoose(subClass, superClass) {
868
- subClass.prototype = Object.create(superClass.prototype);
869
- subClass.prototype.constructor = subClass;
870
- _setPrototypeOf(subClass, superClass);
871
- }
872
- function _setPrototypeOf(o, p) {
873
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
874
- o2.__proto__ = p2;
875
- return o2;
876
- };
877
- return _setPrototypeOf(o, p);
878
- }
879
- var Selector = /* @__PURE__ */ function(_Container) {
880
- _inheritsLoose(Selector2, _Container);
881
- function Selector2(opts) {
882
- var _this;
883
- _this = _Container.call(this, opts) || this;
884
- _this.type = _types.SELECTOR;
885
- return _this;
886
- }
887
- return Selector2;
888
- }(_container["default"]);
889
- exports["default"] = Selector;
890
- module.exports = exports.default;
891
- }
892
- });
893
-
894
- // ../../node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js
895
- var require_cssesc = __commonJS({
896
- "../../node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js"(exports, module) {
897
- "use strict";
898
- var object = {};
899
- var hasOwnProperty = object.hasOwnProperty;
900
- var merge = function merge2(options, defaults) {
901
- if (!options) {
902
- return defaults;
903
- }
904
- var result = {};
905
- for (var key in defaults) {
906
- result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
907
- }
908
- return result;
909
- };
910
- var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
911
- var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
912
- var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
913
- var cssesc = function cssesc2(string, options) {
914
- options = merge(options, cssesc2.options);
915
- if (options.quotes != "single" && options.quotes != "double") {
916
- options.quotes = "single";
917
- }
918
- var quote = options.quotes == "double" ? '"' : "'";
919
- var isIdentifier = options.isIdentifier;
920
- var firstChar = string.charAt(0);
921
- var output = "";
922
- var counter = 0;
923
- var length = string.length;
924
- while (counter < length) {
925
- var character = string.charAt(counter++);
926
- var codePoint = character.charCodeAt();
927
- var value = void 0;
928
- if (codePoint < 32 || codePoint > 126) {
929
- if (codePoint >= 55296 && codePoint <= 56319 && counter < length) {
930
- var extra = string.charCodeAt(counter++);
931
- if ((extra & 64512) == 56320) {
932
- codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536;
933
- } else {
934
- counter--;
935
- }
936
- }
937
- value = "\\" + codePoint.toString(16).toUpperCase() + " ";
938
- } else {
939
- if (options.escapeEverything) {
940
- if (regexAnySingleEscape.test(character)) {
941
- value = "\\" + character;
942
- } else {
943
- value = "\\" + codePoint.toString(16).toUpperCase() + " ";
944
- }
945
- } else if (/[\t\n\f\r\x0B]/.test(character)) {
946
- value = "\\" + codePoint.toString(16).toUpperCase() + " ";
947
- } else if (character == "\\" || !isIdentifier && (character == '"' && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
948
- value = "\\" + character;
949
- } else {
950
- value = character;
951
- }
952
- }
953
- output += value;
954
- }
955
- if (isIdentifier) {
956
- if (/^-[-\d]/.test(output)) {
957
- output = "\\-" + output.slice(1);
958
- } else if (/\d/.test(firstChar)) {
959
- output = "\\3" + firstChar + " " + output.slice(1);
960
- }
961
- }
962
- output = output.replace(regexExcessiveSpaces, function($0, $1, $2) {
963
- if ($1 && $1.length % 2) {
964
- return $0;
965
- }
966
- return ($1 || "") + $2;
967
- });
968
- if (!isIdentifier && options.wrap) {
969
- return quote + output + quote;
970
- }
971
- return output;
972
- };
973
- cssesc.options = {
974
- "escapeEverything": false,
975
- "isIdentifier": false,
976
- "quotes": "single",
977
- "wrap": false
978
- };
979
- cssesc.version = "3.0.0";
980
- module.exports = cssesc;
981
- }
982
- });
983
-
984
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/className.js
985
- var require_className = __commonJS({
986
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/className.js"(exports, module) {
987
- "use strict";
988
- exports.__esModule = true;
989
- exports["default"] = void 0;
990
- var _cssesc = _interopRequireDefault(require_cssesc());
991
- var _util = require_util();
992
- var _node = _interopRequireDefault(require_node());
993
- var _types = require_types();
994
- function _interopRequireDefault(obj) {
995
- return obj && obj.__esModule ? obj : { "default": obj };
996
- }
997
- function _defineProperties(target, props) {
998
- for (var i = 0; i < props.length; i++) {
999
- var descriptor = props[i];
1000
- descriptor.enumerable = descriptor.enumerable || false;
1001
- descriptor.configurable = true;
1002
- if ("value" in descriptor) descriptor.writable = true;
1003
- Object.defineProperty(target, descriptor.key, descriptor);
1004
- }
1005
- }
1006
- function _createClass(Constructor, protoProps, staticProps) {
1007
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1008
- if (staticProps) _defineProperties(Constructor, staticProps);
1009
- Object.defineProperty(Constructor, "prototype", { writable: false });
1010
- return Constructor;
1011
- }
1012
- function _inheritsLoose(subClass, superClass) {
1013
- subClass.prototype = Object.create(superClass.prototype);
1014
- subClass.prototype.constructor = subClass;
1015
- _setPrototypeOf(subClass, superClass);
1016
- }
1017
- function _setPrototypeOf(o, p) {
1018
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1019
- o2.__proto__ = p2;
1020
- return o2;
1021
- };
1022
- return _setPrototypeOf(o, p);
1023
- }
1024
- var ClassName = /* @__PURE__ */ function(_Node) {
1025
- _inheritsLoose(ClassName2, _Node);
1026
- function ClassName2(opts) {
1027
- var _this;
1028
- _this = _Node.call(this, opts) || this;
1029
- _this.type = _types.CLASS;
1030
- _this._constructed = true;
1031
- return _this;
1032
- }
1033
- var _proto = ClassName2.prototype;
1034
- _proto.valueToString = function valueToString() {
1035
- return "." + _Node.prototype.valueToString.call(this);
1036
- };
1037
- _createClass(ClassName2, [{
1038
- key: "value",
1039
- get: function get() {
1040
- return this._value;
1041
- },
1042
- set: function set(v) {
1043
- if (this._constructed) {
1044
- var escaped = (0, _cssesc["default"])(v, {
1045
- isIdentifier: true
1046
- });
1047
- if (escaped !== v) {
1048
- (0, _util.ensureObject)(this, "raws");
1049
- this.raws.value = escaped;
1050
- } else if (this.raws) {
1051
- delete this.raws.value;
1052
- }
1053
- }
1054
- this._value = v;
1055
- }
1056
- }]);
1057
- return ClassName2;
1058
- }(_node["default"]);
1059
- exports["default"] = ClassName;
1060
- module.exports = exports.default;
1061
- }
1062
- });
1063
-
1064
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/comment.js
1065
- var require_comment = __commonJS({
1066
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/comment.js"(exports, module) {
1067
- "use strict";
1068
- exports.__esModule = true;
1069
- exports["default"] = void 0;
1070
- var _node = _interopRequireDefault(require_node());
1071
- var _types = require_types();
1072
- function _interopRequireDefault(obj) {
1073
- return obj && obj.__esModule ? obj : { "default": obj };
1074
- }
1075
- function _inheritsLoose(subClass, superClass) {
1076
- subClass.prototype = Object.create(superClass.prototype);
1077
- subClass.prototype.constructor = subClass;
1078
- _setPrototypeOf(subClass, superClass);
1079
- }
1080
- function _setPrototypeOf(o, p) {
1081
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1082
- o2.__proto__ = p2;
1083
- return o2;
1084
- };
1085
- return _setPrototypeOf(o, p);
1086
- }
1087
- var Comment = /* @__PURE__ */ function(_Node) {
1088
- _inheritsLoose(Comment2, _Node);
1089
- function Comment2(opts) {
1090
- var _this;
1091
- _this = _Node.call(this, opts) || this;
1092
- _this.type = _types.COMMENT;
1093
- return _this;
1094
- }
1095
- return Comment2;
1096
- }(_node["default"]);
1097
- exports["default"] = Comment;
1098
- module.exports = exports.default;
1099
- }
1100
- });
1101
-
1102
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/id.js
1103
- var require_id = __commonJS({
1104
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/id.js"(exports, module) {
1105
- "use strict";
1106
- exports.__esModule = true;
1107
- exports["default"] = void 0;
1108
- var _node = _interopRequireDefault(require_node());
1109
- var _types = require_types();
1110
- function _interopRequireDefault(obj) {
1111
- return obj && obj.__esModule ? obj : { "default": obj };
1112
- }
1113
- function _inheritsLoose(subClass, superClass) {
1114
- subClass.prototype = Object.create(superClass.prototype);
1115
- subClass.prototype.constructor = subClass;
1116
- _setPrototypeOf(subClass, superClass);
1117
- }
1118
- function _setPrototypeOf(o, p) {
1119
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1120
- o2.__proto__ = p2;
1121
- return o2;
1122
- };
1123
- return _setPrototypeOf(o, p);
1124
- }
1125
- var ID = /* @__PURE__ */ function(_Node) {
1126
- _inheritsLoose(ID2, _Node);
1127
- function ID2(opts) {
1128
- var _this;
1129
- _this = _Node.call(this, opts) || this;
1130
- _this.type = _types.ID;
1131
- return _this;
1132
- }
1133
- var _proto = ID2.prototype;
1134
- _proto.valueToString = function valueToString() {
1135
- return "#" + _Node.prototype.valueToString.call(this);
1136
- };
1137
- return ID2;
1138
- }(_node["default"]);
1139
- exports["default"] = ID;
1140
- module.exports = exports.default;
1141
- }
1142
- });
1143
-
1144
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/namespace.js
1145
- var require_namespace = __commonJS({
1146
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/namespace.js"(exports, module) {
1147
- "use strict";
1148
- exports.__esModule = true;
1149
- exports["default"] = void 0;
1150
- var _cssesc = _interopRequireDefault(require_cssesc());
1151
- var _util = require_util();
1152
- var _node = _interopRequireDefault(require_node());
1153
- function _interopRequireDefault(obj) {
1154
- return obj && obj.__esModule ? obj : { "default": obj };
1155
- }
1156
- function _defineProperties(target, props) {
1157
- for (var i = 0; i < props.length; i++) {
1158
- var descriptor = props[i];
1159
- descriptor.enumerable = descriptor.enumerable || false;
1160
- descriptor.configurable = true;
1161
- if ("value" in descriptor) descriptor.writable = true;
1162
- Object.defineProperty(target, descriptor.key, descriptor);
1163
- }
1164
- }
1165
- function _createClass(Constructor, protoProps, staticProps) {
1166
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1167
- if (staticProps) _defineProperties(Constructor, staticProps);
1168
- Object.defineProperty(Constructor, "prototype", { writable: false });
1169
- return Constructor;
1170
- }
1171
- function _inheritsLoose(subClass, superClass) {
1172
- subClass.prototype = Object.create(superClass.prototype);
1173
- subClass.prototype.constructor = subClass;
1174
- _setPrototypeOf(subClass, superClass);
1175
- }
1176
- function _setPrototypeOf(o, p) {
1177
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1178
- o2.__proto__ = p2;
1179
- return o2;
1180
- };
1181
- return _setPrototypeOf(o, p);
1182
- }
1183
- var Namespace = /* @__PURE__ */ function(_Node) {
1184
- _inheritsLoose(Namespace2, _Node);
1185
- function Namespace2() {
1186
- return _Node.apply(this, arguments) || this;
1187
- }
1188
- var _proto = Namespace2.prototype;
1189
- _proto.qualifiedName = function qualifiedName(value) {
1190
- if (this.namespace) {
1191
- return this.namespaceString + "|" + value;
1192
- } else {
1193
- return value;
1194
- }
1195
- };
1196
- _proto.valueToString = function valueToString() {
1197
- return this.qualifiedName(_Node.prototype.valueToString.call(this));
1198
- };
1199
- _createClass(Namespace2, [{
1200
- key: "namespace",
1201
- get: function get() {
1202
- return this._namespace;
1203
- },
1204
- set: function set(namespace) {
1205
- if (namespace === true || namespace === "*" || namespace === "&") {
1206
- this._namespace = namespace;
1207
- if (this.raws) {
1208
- delete this.raws.namespace;
1209
- }
1210
- return;
1211
- }
1212
- var escaped = (0, _cssesc["default"])(namespace, {
1213
- isIdentifier: true
1214
- });
1215
- this._namespace = namespace;
1216
- if (escaped !== namespace) {
1217
- (0, _util.ensureObject)(this, "raws");
1218
- this.raws.namespace = escaped;
1219
- } else if (this.raws) {
1220
- delete this.raws.namespace;
1221
- }
1222
- }
1223
- }, {
1224
- key: "ns",
1225
- get: function get() {
1226
- return this._namespace;
1227
- },
1228
- set: function set(namespace) {
1229
- this.namespace = namespace;
1230
- }
1231
- }, {
1232
- key: "namespaceString",
1233
- get: function get() {
1234
- if (this.namespace) {
1235
- var ns = this.stringifyProperty("namespace");
1236
- if (ns === true) {
1237
- return "";
1238
- } else {
1239
- return ns;
1240
- }
1241
- } else {
1242
- return "";
1243
- }
1244
- }
1245
- }]);
1246
- return Namespace2;
1247
- }(_node["default"]);
1248
- exports["default"] = Namespace;
1249
- module.exports = exports.default;
1250
- }
1251
- });
1252
-
1253
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/tag.js
1254
- var require_tag = __commonJS({
1255
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/tag.js"(exports, module) {
1256
- "use strict";
1257
- exports.__esModule = true;
1258
- exports["default"] = void 0;
1259
- var _namespace = _interopRequireDefault(require_namespace());
1260
- var _types = require_types();
1261
- function _interopRequireDefault(obj) {
1262
- return obj && obj.__esModule ? obj : { "default": obj };
1263
- }
1264
- function _inheritsLoose(subClass, superClass) {
1265
- subClass.prototype = Object.create(superClass.prototype);
1266
- subClass.prototype.constructor = subClass;
1267
- _setPrototypeOf(subClass, superClass);
1268
- }
1269
- function _setPrototypeOf(o, p) {
1270
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1271
- o2.__proto__ = p2;
1272
- return o2;
1273
- };
1274
- return _setPrototypeOf(o, p);
1275
- }
1276
- var Tag = /* @__PURE__ */ function(_Namespace) {
1277
- _inheritsLoose(Tag2, _Namespace);
1278
- function Tag2(opts) {
1279
- var _this;
1280
- _this = _Namespace.call(this, opts) || this;
1281
- _this.type = _types.TAG;
1282
- return _this;
1283
- }
1284
- return Tag2;
1285
- }(_namespace["default"]);
1286
- exports["default"] = Tag;
1287
- module.exports = exports.default;
1288
- }
1289
- });
1290
-
1291
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/string.js
1292
- var require_string = __commonJS({
1293
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/string.js"(exports, module) {
1294
- "use strict";
1295
- exports.__esModule = true;
1296
- exports["default"] = void 0;
1297
- var _node = _interopRequireDefault(require_node());
1298
- var _types = require_types();
1299
- function _interopRequireDefault(obj) {
1300
- return obj && obj.__esModule ? obj : { "default": obj };
1301
- }
1302
- function _inheritsLoose(subClass, superClass) {
1303
- subClass.prototype = Object.create(superClass.prototype);
1304
- subClass.prototype.constructor = subClass;
1305
- _setPrototypeOf(subClass, superClass);
1306
- }
1307
- function _setPrototypeOf(o, p) {
1308
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1309
- o2.__proto__ = p2;
1310
- return o2;
1311
- };
1312
- return _setPrototypeOf(o, p);
1313
- }
1314
- var String2 = /* @__PURE__ */ function(_Node) {
1315
- _inheritsLoose(String3, _Node);
1316
- function String3(opts) {
1317
- var _this;
1318
- _this = _Node.call(this, opts) || this;
1319
- _this.type = _types.STRING;
1320
- return _this;
1321
- }
1322
- return String3;
1323
- }(_node["default"]);
1324
- exports["default"] = String2;
1325
- module.exports = exports.default;
1326
- }
1327
- });
1328
-
1329
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/pseudo.js
1330
- var require_pseudo = __commonJS({
1331
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/pseudo.js"(exports, module) {
1332
- "use strict";
1333
- exports.__esModule = true;
1334
- exports["default"] = void 0;
1335
- var _container = _interopRequireDefault(require_container());
1336
- var _types = require_types();
1337
- function _interopRequireDefault(obj) {
1338
- return obj && obj.__esModule ? obj : { "default": obj };
1339
- }
1340
- function _inheritsLoose(subClass, superClass) {
1341
- subClass.prototype = Object.create(superClass.prototype);
1342
- subClass.prototype.constructor = subClass;
1343
- _setPrototypeOf(subClass, superClass);
1344
- }
1345
- function _setPrototypeOf(o, p) {
1346
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1347
- o2.__proto__ = p2;
1348
- return o2;
1349
- };
1350
- return _setPrototypeOf(o, p);
1351
- }
1352
- var Pseudo = /* @__PURE__ */ function(_Container) {
1353
- _inheritsLoose(Pseudo2, _Container);
1354
- function Pseudo2(opts) {
1355
- var _this;
1356
- _this = _Container.call(this, opts) || this;
1357
- _this.type = _types.PSEUDO;
1358
- return _this;
1359
- }
1360
- var _proto = Pseudo2.prototype;
1361
- _proto.toString = function toString() {
1362
- var params = this.length ? "(" + this.map(String).join(",") + ")" : "";
1363
- return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join("");
1364
- };
1365
- return Pseudo2;
1366
- }(_container["default"]);
1367
- exports["default"] = Pseudo;
1368
- module.exports = exports.default;
1369
- }
1370
- });
1371
-
1372
- // ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js
1373
- var require_node2 = __commonJS({
1374
- "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports, module) {
1375
- module.exports = __require("node:util").deprecate;
1376
- }
1377
- });
1378
-
1379
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/attribute.js
1380
- var require_attribute = __commonJS({
1381
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/attribute.js"(exports) {
1382
- "use strict";
1383
- exports.__esModule = true;
1384
- exports["default"] = void 0;
1385
- exports.unescapeValue = unescapeValue;
1386
- var _cssesc = _interopRequireDefault(require_cssesc());
1387
- var _unesc = _interopRequireDefault(require_unesc());
1388
- var _namespace = _interopRequireDefault(require_namespace());
1389
- var _types = require_types();
1390
- var _CSSESC_QUOTE_OPTIONS;
1391
- function _interopRequireDefault(obj) {
1392
- return obj && obj.__esModule ? obj : { "default": obj };
1393
- }
1394
- function _defineProperties(target, props) {
1395
- for (var i = 0; i < props.length; i++) {
1396
- var descriptor = props[i];
1397
- descriptor.enumerable = descriptor.enumerable || false;
1398
- descriptor.configurable = true;
1399
- if ("value" in descriptor) descriptor.writable = true;
1400
- Object.defineProperty(target, descriptor.key, descriptor);
1401
- }
1402
- }
1403
- function _createClass(Constructor, protoProps, staticProps) {
1404
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1405
- if (staticProps) _defineProperties(Constructor, staticProps);
1406
- Object.defineProperty(Constructor, "prototype", { writable: false });
1407
- return Constructor;
1408
- }
1409
- function _inheritsLoose(subClass, superClass) {
1410
- subClass.prototype = Object.create(superClass.prototype);
1411
- subClass.prototype.constructor = subClass;
1412
- _setPrototypeOf(subClass, superClass);
1413
- }
1414
- function _setPrototypeOf(o, p) {
1415
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1416
- o2.__proto__ = p2;
1417
- return o2;
1418
- };
1419
- return _setPrototypeOf(o, p);
1420
- }
1421
- var deprecate = require_node2();
1422
- var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
1423
- var warnOfDeprecatedValueAssignment = deprecate(function() {
1424
- }, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead.");
1425
- var warnOfDeprecatedQuotedAssignment = deprecate(function() {
1426
- }, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
1427
- var warnOfDeprecatedConstructor = deprecate(function() {
1428
- }, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
1429
- function unescapeValue(value) {
1430
- var deprecatedUsage = false;
1431
- var quoteMark = null;
1432
- var unescaped = value;
1433
- var m = unescaped.match(WRAPPED_IN_QUOTES);
1434
- if (m) {
1435
- quoteMark = m[1];
1436
- unescaped = m[2];
1437
- }
1438
- unescaped = (0, _unesc["default"])(unescaped);
1439
- if (unescaped !== value) {
1440
- deprecatedUsage = true;
1441
- }
1442
- return {
1443
- deprecatedUsage,
1444
- unescaped,
1445
- quoteMark
1446
- };
1447
- }
1448
- function handleDeprecatedContructorOpts(opts) {
1449
- if (opts.quoteMark !== void 0) {
1450
- return opts;
1451
- }
1452
- if (opts.value === void 0) {
1453
- return opts;
1454
- }
1455
- warnOfDeprecatedConstructor();
1456
- var _unescapeValue = unescapeValue(opts.value), quoteMark = _unescapeValue.quoteMark, unescaped = _unescapeValue.unescaped;
1457
- if (!opts.raws) {
1458
- opts.raws = {};
1459
- }
1460
- if (opts.raws.value === void 0) {
1461
- opts.raws.value = opts.value;
1462
- }
1463
- opts.value = unescaped;
1464
- opts.quoteMark = quoteMark;
1465
- return opts;
1466
- }
1467
- var Attribute = /* @__PURE__ */ function(_Namespace) {
1468
- _inheritsLoose(Attribute2, _Namespace);
1469
- function Attribute2(opts) {
1470
- var _this;
1471
- if (opts === void 0) {
1472
- opts = {};
1473
- }
1474
- _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;
1475
- _this.type = _types.ATTRIBUTE;
1476
- _this.raws = _this.raws || {};
1477
- Object.defineProperty(_this.raws, "unquoted", {
1478
- get: deprecate(function() {
1479
- return _this.value;
1480
- }, "attr.raws.unquoted is deprecated. Call attr.value instead."),
1481
- set: deprecate(function() {
1482
- return _this.value;
1483
- }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")
1484
- });
1485
- _this._constructed = true;
1486
- return _this;
1487
- }
1488
- var _proto = Attribute2.prototype;
1489
- _proto.getQuotedValue = function getQuotedValue(options) {
1490
- if (options === void 0) {
1491
- options = {};
1492
- }
1493
- var quoteMark = this._determineQuoteMark(options);
1494
- var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
1495
- var escaped = (0, _cssesc["default"])(this._value, cssescopts);
1496
- return escaped;
1497
- };
1498
- _proto._determineQuoteMark = function _determineQuoteMark(options) {
1499
- return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
1500
- };
1501
- _proto.setValue = function setValue(value, options) {
1502
- if (options === void 0) {
1503
- options = {};
1504
- }
1505
- this._value = value;
1506
- this._quoteMark = this._determineQuoteMark(options);
1507
- this._syncRawValue();
1508
- };
1509
- _proto.smartQuoteMark = function smartQuoteMark(options) {
1510
- var v = this.value;
1511
- var numSingleQuotes = v.replace(/[^']/g, "").length;
1512
- var numDoubleQuotes = v.replace(/[^"]/g, "").length;
1513
- if (numSingleQuotes + numDoubleQuotes === 0) {
1514
- var escaped = (0, _cssesc["default"])(v, {
1515
- isIdentifier: true
1516
- });
1517
- if (escaped === v) {
1518
- return Attribute2.NO_QUOTE;
1519
- } else {
1520
- var pref = this.preferredQuoteMark(options);
1521
- if (pref === Attribute2.NO_QUOTE) {
1522
- var quote = this.quoteMark || options.quoteMark || Attribute2.DOUBLE_QUOTE;
1523
- var opts = CSSESC_QUOTE_OPTIONS[quote];
1524
- var quoteValue = (0, _cssesc["default"])(v, opts);
1525
- if (quoteValue.length < escaped.length) {
1526
- return quote;
1527
- }
1528
- }
1529
- return pref;
1530
- }
1531
- } else if (numDoubleQuotes === numSingleQuotes) {
1532
- return this.preferredQuoteMark(options);
1533
- } else if (numDoubleQuotes < numSingleQuotes) {
1534
- return Attribute2.DOUBLE_QUOTE;
1535
- } else {
1536
- return Attribute2.SINGLE_QUOTE;
1537
- }
1538
- };
1539
- _proto.preferredQuoteMark = function preferredQuoteMark(options) {
1540
- var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
1541
- if (quoteMark === void 0) {
1542
- quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
1543
- }
1544
- if (quoteMark === void 0) {
1545
- quoteMark = Attribute2.DOUBLE_QUOTE;
1546
- }
1547
- return quoteMark;
1548
- };
1549
- _proto._syncRawValue = function _syncRawValue() {
1550
- var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
1551
- if (rawValue === this._value) {
1552
- if (this.raws) {
1553
- delete this.raws.value;
1554
- }
1555
- } else {
1556
- this.raws.value = rawValue;
1557
- }
1558
- };
1559
- _proto._handleEscapes = function _handleEscapes(prop, value) {
1560
- if (this._constructed) {
1561
- var escaped = (0, _cssesc["default"])(value, {
1562
- isIdentifier: true
1563
- });
1564
- if (escaped !== value) {
1565
- this.raws[prop] = escaped;
1566
- } else {
1567
- delete this.raws[prop];
1568
- }
1569
- }
1570
- };
1571
- _proto._spacesFor = function _spacesFor(name) {
1572
- var attrSpaces = {
1573
- before: "",
1574
- after: ""
1575
- };
1576
- var spaces = this.spaces[name] || {};
1577
- var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};
1578
- return Object.assign(attrSpaces, spaces, rawSpaces);
1579
- };
1580
- _proto._stringFor = function _stringFor(name, spaceName, concat) {
1581
- if (spaceName === void 0) {
1582
- spaceName = name;
1583
- }
1584
- if (concat === void 0) {
1585
- concat = defaultAttrConcat;
1586
- }
1587
- var attrSpaces = this._spacesFor(spaceName);
1588
- return concat(this.stringifyProperty(name), attrSpaces);
1589
- };
1590
- _proto.offsetOf = function offsetOf(name) {
1591
- var count = 1;
1592
- var attributeSpaces = this._spacesFor("attribute");
1593
- count += attributeSpaces.before.length;
1594
- if (name === "namespace" || name === "ns") {
1595
- return this.namespace ? count : -1;
1596
- }
1597
- if (name === "attributeNS") {
1598
- return count;
1599
- }
1600
- count += this.namespaceString.length;
1601
- if (this.namespace) {
1602
- count += 1;
1603
- }
1604
- if (name === "attribute") {
1605
- return count;
1606
- }
1607
- count += this.stringifyProperty("attribute").length;
1608
- count += attributeSpaces.after.length;
1609
- var operatorSpaces = this._spacesFor("operator");
1610
- count += operatorSpaces.before.length;
1611
- var operator = this.stringifyProperty("operator");
1612
- if (name === "operator") {
1613
- return operator ? count : -1;
1614
- }
1615
- count += operator.length;
1616
- count += operatorSpaces.after.length;
1617
- var valueSpaces = this._spacesFor("value");
1618
- count += valueSpaces.before.length;
1619
- var value = this.stringifyProperty("value");
1620
- if (name === "value") {
1621
- return value ? count : -1;
1622
- }
1623
- count += value.length;
1624
- count += valueSpaces.after.length;
1625
- var insensitiveSpaces = this._spacesFor("insensitive");
1626
- count += insensitiveSpaces.before.length;
1627
- if (name === "insensitive") {
1628
- return this.insensitive ? count : -1;
1629
- }
1630
- return -1;
1631
- };
1632
- _proto.toString = function toString() {
1633
- var _this2 = this;
1634
- var selector = [this.rawSpaceBefore, "["];
1635
- selector.push(this._stringFor("qualifiedAttribute", "attribute"));
1636
- if (this.operator && (this.value || this.value === "")) {
1637
- selector.push(this._stringFor("operator"));
1638
- selector.push(this._stringFor("value"));
1639
- selector.push(this._stringFor("insensitiveFlag", "insensitive", function(attrValue, attrSpaces) {
1640
- if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) {
1641
- attrSpaces.before = " ";
1642
- }
1643
- return defaultAttrConcat(attrValue, attrSpaces);
1644
- }));
1645
- }
1646
- selector.push("]");
1647
- selector.push(this.rawSpaceAfter);
1648
- return selector.join("");
1649
- };
1650
- _createClass(Attribute2, [{
1651
- key: "quoted",
1652
- get: function get() {
1653
- var qm = this.quoteMark;
1654
- return qm === "'" || qm === '"';
1655
- },
1656
- set: function set(value) {
1657
- warnOfDeprecatedQuotedAssignment();
1658
- }
1659
- /**
1660
- * returns a single (`'`) or double (`"`) quote character if the value is quoted.
1661
- * returns `null` if the value is not quoted.
1662
- * returns `undefined` if the quotation state is unknown (this can happen when
1663
- * the attribute is constructed without specifying a quote mark.)
1664
- */
1665
- }, {
1666
- key: "quoteMark",
1667
- get: function get() {
1668
- return this._quoteMark;
1669
- },
1670
- set: function set(quoteMark) {
1671
- if (!this._constructed) {
1672
- this._quoteMark = quoteMark;
1673
- return;
1674
- }
1675
- if (this._quoteMark !== quoteMark) {
1676
- this._quoteMark = quoteMark;
1677
- this._syncRawValue();
1678
- }
1679
- }
1680
- }, {
1681
- key: "qualifiedAttribute",
1682
- get: function get() {
1683
- return this.qualifiedName(this.raws.attribute || this.attribute);
1684
- }
1685
- }, {
1686
- key: "insensitiveFlag",
1687
- get: function get() {
1688
- return this.insensitive ? "i" : "";
1689
- }
1690
- }, {
1691
- key: "value",
1692
- get: function get() {
1693
- return this._value;
1694
- },
1695
- set: (
1696
- /**
1697
- * Before 3.0, the value had to be set to an escaped value including any wrapped
1698
- * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
1699
- * is unescaped during parsing and any quote marks are removed.
1700
- *
1701
- * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,
1702
- * a deprecation warning is raised when the new value contains any characters that would
1703
- * require escaping (including if it contains wrapped quotes).
1704
- *
1705
- * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
1706
- * how the new value is quoted.
1707
- */
1708
- function set(v) {
1709
- if (this._constructed) {
1710
- var _unescapeValue2 = unescapeValue(v), deprecatedUsage = _unescapeValue2.deprecatedUsage, unescaped = _unescapeValue2.unescaped, quoteMark = _unescapeValue2.quoteMark;
1711
- if (deprecatedUsage) {
1712
- warnOfDeprecatedValueAssignment();
1713
- }
1714
- if (unescaped === this._value && quoteMark === this._quoteMark) {
1715
- return;
1716
- }
1717
- this._value = unescaped;
1718
- this._quoteMark = quoteMark;
1719
- this._syncRawValue();
1720
- } else {
1721
- this._value = v;
1722
- }
1723
- }
1724
- )
1725
- }, {
1726
- key: "insensitive",
1727
- get: function get() {
1728
- return this._insensitive;
1729
- },
1730
- set: function set(insensitive) {
1731
- if (!insensitive) {
1732
- this._insensitive = false;
1733
- if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) {
1734
- this.raws.insensitiveFlag = void 0;
1735
- }
1736
- }
1737
- this._insensitive = insensitive;
1738
- }
1739
- }, {
1740
- key: "attribute",
1741
- get: function get() {
1742
- return this._attribute;
1743
- },
1744
- set: function set(name) {
1745
- this._handleEscapes("attribute", name);
1746
- this._attribute = name;
1747
- }
1748
- }]);
1749
- return Attribute2;
1750
- }(_namespace["default"]);
1751
- exports["default"] = Attribute;
1752
- Attribute.NO_QUOTE = null;
1753
- Attribute.SINGLE_QUOTE = "'";
1754
- Attribute.DOUBLE_QUOTE = '"';
1755
- var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = {
1756
- "'": {
1757
- quotes: "single",
1758
- wrap: true
1759
- },
1760
- '"': {
1761
- quotes: "double",
1762
- wrap: true
1763
- }
1764
- }, _CSSESC_QUOTE_OPTIONS[null] = {
1765
- isIdentifier: true
1766
- }, _CSSESC_QUOTE_OPTIONS);
1767
- function defaultAttrConcat(attrValue, attrSpaces) {
1768
- return "" + attrSpaces.before + attrValue + attrSpaces.after;
1769
- }
1770
- }
1771
- });
1772
-
1773
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/universal.js
1774
- var require_universal = __commonJS({
1775
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/universal.js"(exports, module) {
1776
- "use strict";
1777
- exports.__esModule = true;
1778
- exports["default"] = void 0;
1779
- var _namespace = _interopRequireDefault(require_namespace());
1780
- var _types = require_types();
1781
- function _interopRequireDefault(obj) {
1782
- return obj && obj.__esModule ? obj : { "default": obj };
1783
- }
1784
- function _inheritsLoose(subClass, superClass) {
1785
- subClass.prototype = Object.create(superClass.prototype);
1786
- subClass.prototype.constructor = subClass;
1787
- _setPrototypeOf(subClass, superClass);
1788
- }
1789
- function _setPrototypeOf(o, p) {
1790
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1791
- o2.__proto__ = p2;
1792
- return o2;
1793
- };
1794
- return _setPrototypeOf(o, p);
1795
- }
1796
- var Universal = /* @__PURE__ */ function(_Namespace) {
1797
- _inheritsLoose(Universal2, _Namespace);
1798
- function Universal2(opts) {
1799
- var _this;
1800
- _this = _Namespace.call(this, opts) || this;
1801
- _this.type = _types.UNIVERSAL;
1802
- _this.value = "*";
1803
- return _this;
1804
- }
1805
- return Universal2;
1806
- }(_namespace["default"]);
1807
- exports["default"] = Universal;
1808
- module.exports = exports.default;
1809
- }
1810
- });
1811
-
1812
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/combinator.js
1813
- var require_combinator = __commonJS({
1814
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/combinator.js"(exports, module) {
1815
- "use strict";
1816
- exports.__esModule = true;
1817
- exports["default"] = void 0;
1818
- var _node = _interopRequireDefault(require_node());
1819
- var _types = require_types();
1820
- function _interopRequireDefault(obj) {
1821
- return obj && obj.__esModule ? obj : { "default": obj };
1822
- }
1823
- function _inheritsLoose(subClass, superClass) {
1824
- subClass.prototype = Object.create(superClass.prototype);
1825
- subClass.prototype.constructor = subClass;
1826
- _setPrototypeOf(subClass, superClass);
1827
- }
1828
- function _setPrototypeOf(o, p) {
1829
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1830
- o2.__proto__ = p2;
1831
- return o2;
1832
- };
1833
- return _setPrototypeOf(o, p);
1834
- }
1835
- var Combinator = /* @__PURE__ */ function(_Node) {
1836
- _inheritsLoose(Combinator2, _Node);
1837
- function Combinator2(opts) {
1838
- var _this;
1839
- _this = _Node.call(this, opts) || this;
1840
- _this.type = _types.COMBINATOR;
1841
- return _this;
1842
- }
1843
- return Combinator2;
1844
- }(_node["default"]);
1845
- exports["default"] = Combinator;
1846
- module.exports = exports.default;
1847
- }
1848
- });
1849
-
1850
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/nesting.js
1851
- var require_nesting = __commonJS({
1852
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/nesting.js"(exports, module) {
1853
- "use strict";
1854
- exports.__esModule = true;
1855
- exports["default"] = void 0;
1856
- var _node = _interopRequireDefault(require_node());
1857
- var _types = require_types();
1858
- function _interopRequireDefault(obj) {
1859
- return obj && obj.__esModule ? obj : { "default": obj };
1860
- }
1861
- function _inheritsLoose(subClass, superClass) {
1862
- subClass.prototype = Object.create(superClass.prototype);
1863
- subClass.prototype.constructor = subClass;
1864
- _setPrototypeOf(subClass, superClass);
1865
- }
1866
- function _setPrototypeOf(o, p) {
1867
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1868
- o2.__proto__ = p2;
1869
- return o2;
1870
- };
1871
- return _setPrototypeOf(o, p);
1872
- }
1873
- var Nesting = /* @__PURE__ */ function(_Node) {
1874
- _inheritsLoose(Nesting2, _Node);
1875
- function Nesting2(opts) {
1876
- var _this;
1877
- _this = _Node.call(this, opts) || this;
1878
- _this.type = _types.NESTING;
1879
- _this.value = "&";
1880
- return _this;
1881
- }
1882
- return Nesting2;
1883
- }(_node["default"]);
1884
- exports["default"] = Nesting;
1885
- module.exports = exports.default;
1886
- }
1887
- });
1888
-
1889
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/sortAscending.js
1890
- var require_sortAscending = __commonJS({
1891
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/sortAscending.js"(exports, module) {
1892
- "use strict";
1893
- exports.__esModule = true;
1894
- exports["default"] = sortAscending;
1895
- function sortAscending(list) {
1896
- return list.sort(function(a, b) {
1897
- return a - b;
1898
- });
1899
- }
1900
- module.exports = exports.default;
1901
- }
1902
- });
1903
-
1904
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/tokenTypes.js
1905
- var require_tokenTypes = __commonJS({
1906
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/tokenTypes.js"(exports) {
1907
- "use strict";
1908
- exports.__esModule = true;
1909
- exports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0;
1910
- var ampersand = 38;
1911
- exports.ampersand = ampersand;
1912
- var asterisk = 42;
1913
- exports.asterisk = asterisk;
1914
- var at = 64;
1915
- exports.at = at;
1916
- var comma = 44;
1917
- exports.comma = comma;
1918
- var colon = 58;
1919
- exports.colon = colon;
1920
- var semicolon = 59;
1921
- exports.semicolon = semicolon;
1922
- var openParenthesis = 40;
1923
- exports.openParenthesis = openParenthesis;
1924
- var closeParenthesis = 41;
1925
- exports.closeParenthesis = closeParenthesis;
1926
- var openSquare = 91;
1927
- exports.openSquare = openSquare;
1928
- var closeSquare = 93;
1929
- exports.closeSquare = closeSquare;
1930
- var dollar = 36;
1931
- exports.dollar = dollar;
1932
- var tilde = 126;
1933
- exports.tilde = tilde;
1934
- var caret = 94;
1935
- exports.caret = caret;
1936
- var plus = 43;
1937
- exports.plus = plus;
1938
- var equals = 61;
1939
- exports.equals = equals;
1940
- var pipe = 124;
1941
- exports.pipe = pipe;
1942
- var greaterThan = 62;
1943
- exports.greaterThan = greaterThan;
1944
- var space = 32;
1945
- exports.space = space;
1946
- var singleQuote = 39;
1947
- exports.singleQuote = singleQuote;
1948
- var doubleQuote = 34;
1949
- exports.doubleQuote = doubleQuote;
1950
- var slash = 47;
1951
- exports.slash = slash;
1952
- var bang = 33;
1953
- exports.bang = bang;
1954
- var backslash = 92;
1955
- exports.backslash = backslash;
1956
- var cr = 13;
1957
- exports.cr = cr;
1958
- var feed = 12;
1959
- exports.feed = feed;
1960
- var newline = 10;
1961
- exports.newline = newline;
1962
- var tab = 9;
1963
- exports.tab = tab;
1964
- var str = singleQuote;
1965
- exports.str = str;
1966
- var comment = -1;
1967
- exports.comment = comment;
1968
- var word = -2;
1969
- exports.word = word;
1970
- var combinator2 = -3;
1971
- exports.combinator = combinator2;
1972
- }
1973
- });
1974
-
1975
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/tokenize.js
1976
- var require_tokenize = __commonJS({
1977
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/tokenize.js"(exports) {
1978
- "use strict";
1979
- exports.__esModule = true;
1980
- exports.FIELDS = void 0;
1981
- exports["default"] = tokenize;
1982
- var t = _interopRequireWildcard(require_tokenTypes());
1983
- var _unescapable;
1984
- var _wordDelimiters;
1985
- function _getRequireWildcardCache(nodeInterop) {
1986
- if (typeof WeakMap !== "function") return null;
1987
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
1988
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
1989
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
1990
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
1991
- })(nodeInterop);
1992
- }
1993
- function _interopRequireWildcard(obj, nodeInterop) {
1994
- if (!nodeInterop && obj && obj.__esModule) {
1995
- return obj;
1996
- }
1997
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
1998
- return { "default": obj };
1999
- }
2000
- var cache = _getRequireWildcardCache(nodeInterop);
2001
- if (cache && cache.has(obj)) {
2002
- return cache.get(obj);
2003
- }
2004
- var newObj = {};
2005
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
2006
- for (var key in obj) {
2007
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
2008
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
2009
- if (desc && (desc.get || desc.set)) {
2010
- Object.defineProperty(newObj, key, desc);
2011
- } else {
2012
- newObj[key] = obj[key];
2013
- }
2014
- }
2015
- }
2016
- newObj["default"] = obj;
2017
- if (cache) {
2018
- cache.set(obj, newObj);
2019
- }
2020
- return newObj;
2021
- }
2022
- var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);
2023
- var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);
2024
- var hex = {};
2025
- var hexChars = "0123456789abcdefABCDEF";
2026
- for (i = 0; i < hexChars.length; i++) {
2027
- hex[hexChars.charCodeAt(i)] = true;
2028
- }
2029
- var i;
2030
- function consumeWord(css, start) {
2031
- var next = start;
2032
- var code;
2033
- do {
2034
- code = css.charCodeAt(next);
2035
- if (wordDelimiters[code]) {
2036
- return next - 1;
2037
- } else if (code === t.backslash) {
2038
- next = consumeEscape(css, next) + 1;
2039
- } else {
2040
- next++;
2041
- }
2042
- } while (next < css.length);
2043
- return next - 1;
2044
- }
2045
- function consumeEscape(css, start) {
2046
- var next = start;
2047
- var code = css.charCodeAt(next + 1);
2048
- if (unescapable[code]) {
2049
- } else if (hex[code]) {
2050
- var hexDigits = 0;
2051
- do {
2052
- next++;
2053
- hexDigits++;
2054
- code = css.charCodeAt(next + 1);
2055
- } while (hex[code] && hexDigits < 6);
2056
- if (hexDigits < 6 && code === t.space) {
2057
- next++;
2058
- }
2059
- } else {
2060
- next++;
2061
- }
2062
- return next;
2063
- }
2064
- var FIELDS = {
2065
- TYPE: 0,
2066
- START_LINE: 1,
2067
- START_COL: 2,
2068
- END_LINE: 3,
2069
- END_COL: 4,
2070
- START_POS: 5,
2071
- END_POS: 6
2072
- };
2073
- exports.FIELDS = FIELDS;
2074
- function tokenize(input) {
2075
- var tokens = [];
2076
- var css = input.css.valueOf();
2077
- var _css = css, length = _css.length;
2078
- var offset = -1;
2079
- var line = 1;
2080
- var start = 0;
2081
- var end = 0;
2082
- var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
2083
- function unclosed(what, fix) {
2084
- if (input.safe) {
2085
- css += fix;
2086
- next = css.length - 1;
2087
- } else {
2088
- throw input.error("Unclosed " + what, line, start - offset, start);
2089
- }
2090
- }
2091
- while (start < length) {
2092
- code = css.charCodeAt(start);
2093
- if (code === t.newline) {
2094
- offset = start;
2095
- line += 1;
2096
- }
2097
- switch (code) {
2098
- case t.space:
2099
- case t.tab:
2100
- case t.newline:
2101
- case t.cr:
2102
- case t.feed:
2103
- next = start;
2104
- do {
2105
- next += 1;
2106
- code = css.charCodeAt(next);
2107
- if (code === t.newline) {
2108
- offset = next;
2109
- line += 1;
2110
- }
2111
- } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
2112
- tokenType = t.space;
2113
- endLine = line;
2114
- endColumn = next - offset - 1;
2115
- end = next;
2116
- break;
2117
- case t.plus:
2118
- case t.greaterThan:
2119
- case t.tilde:
2120
- case t.pipe:
2121
- next = start;
2122
- do {
2123
- next += 1;
2124
- code = css.charCodeAt(next);
2125
- } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
2126
- tokenType = t.combinator;
2127
- endLine = line;
2128
- endColumn = start - offset;
2129
- end = next;
2130
- break;
2131
- // Consume these characters as single tokens.
2132
- case t.asterisk:
2133
- case t.ampersand:
2134
- case t.bang:
2135
- case t.comma:
2136
- case t.equals:
2137
- case t.dollar:
2138
- case t.caret:
2139
- case t.openSquare:
2140
- case t.closeSquare:
2141
- case t.colon:
2142
- case t.semicolon:
2143
- case t.openParenthesis:
2144
- case t.closeParenthesis:
2145
- next = start;
2146
- tokenType = code;
2147
- endLine = line;
2148
- endColumn = start - offset;
2149
- end = next + 1;
2150
- break;
2151
- case t.singleQuote:
2152
- case t.doubleQuote:
2153
- quote = code === t.singleQuote ? "'" : '"';
2154
- next = start;
2155
- do {
2156
- escaped = false;
2157
- next = css.indexOf(quote, next + 1);
2158
- if (next === -1) {
2159
- unclosed("quote", quote);
2160
- }
2161
- escapePos = next;
2162
- while (css.charCodeAt(escapePos - 1) === t.backslash) {
2163
- escapePos -= 1;
2164
- escaped = !escaped;
2165
- }
2166
- } while (escaped);
2167
- tokenType = t.str;
2168
- endLine = line;
2169
- endColumn = start - offset;
2170
- end = next + 1;
2171
- break;
2172
- default:
2173
- if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
2174
- next = css.indexOf("*/", start + 2) + 1;
2175
- if (next === 0) {
2176
- unclosed("comment", "*/");
2177
- }
2178
- content = css.slice(start, next + 1);
2179
- lines = content.split("\n");
2180
- last = lines.length - 1;
2181
- if (last > 0) {
2182
- nextLine = line + last;
2183
- nextOffset = next - lines[last].length;
2184
- } else {
2185
- nextLine = line;
2186
- nextOffset = offset;
2187
- }
2188
- tokenType = t.comment;
2189
- line = nextLine;
2190
- endLine = nextLine;
2191
- endColumn = next - nextOffset;
2192
- } else if (code === t.slash) {
2193
- next = start;
2194
- tokenType = code;
2195
- endLine = line;
2196
- endColumn = start - offset;
2197
- end = next + 1;
2198
- } else {
2199
- next = consumeWord(css, start);
2200
- tokenType = t.word;
2201
- endLine = line;
2202
- endColumn = next - offset;
2203
- }
2204
- end = next + 1;
2205
- break;
2206
- }
2207
- tokens.push([
2208
- tokenType,
2209
- // [0] Token type
2210
- line,
2211
- // [1] Starting line
2212
- start - offset,
2213
- // [2] Starting column
2214
- endLine,
2215
- // [3] Ending line
2216
- endColumn,
2217
- // [4] Ending column
2218
- start,
2219
- // [5] Start position / Source index
2220
- end
2221
- // [6] End position
2222
- ]);
2223
- if (nextOffset) {
2224
- offset = nextOffset;
2225
- nextOffset = null;
2226
- }
2227
- start = end;
2228
- }
2229
- return tokens;
2230
- }
2231
- }
2232
- });
2233
-
2234
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/parser.js
2235
- var require_parser = __commonJS({
2236
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/parser.js"(exports, module) {
2237
- "use strict";
2238
- exports.__esModule = true;
2239
- exports["default"] = void 0;
2240
- var _root = _interopRequireDefault(require_root());
2241
- var _selector = _interopRequireDefault(require_selector());
2242
- var _className = _interopRequireDefault(require_className());
2243
- var _comment = _interopRequireDefault(require_comment());
2244
- var _id = _interopRequireDefault(require_id());
2245
- var _tag = _interopRequireDefault(require_tag());
2246
- var _string = _interopRequireDefault(require_string());
2247
- var _pseudo = _interopRequireDefault(require_pseudo());
2248
- var _attribute = _interopRequireWildcard(require_attribute());
2249
- var _universal = _interopRequireDefault(require_universal());
2250
- var _combinator = _interopRequireDefault(require_combinator());
2251
- var _nesting = _interopRequireDefault(require_nesting());
2252
- var _sortAscending = _interopRequireDefault(require_sortAscending());
2253
- var _tokenize = _interopRequireWildcard(require_tokenize());
2254
- var tokens = _interopRequireWildcard(require_tokenTypes());
2255
- var types = _interopRequireWildcard(require_types());
2256
- var _util = require_util();
2257
- var _WHITESPACE_TOKENS;
2258
- var _Object$assign;
2259
- function _getRequireWildcardCache(nodeInterop) {
2260
- if (typeof WeakMap !== "function") return null;
2261
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
2262
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
2263
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
2264
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
2265
- })(nodeInterop);
2266
- }
2267
- function _interopRequireWildcard(obj, nodeInterop) {
2268
- if (!nodeInterop && obj && obj.__esModule) {
2269
- return obj;
2270
- }
2271
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
2272
- return { "default": obj };
2273
- }
2274
- var cache = _getRequireWildcardCache(nodeInterop);
2275
- if (cache && cache.has(obj)) {
2276
- return cache.get(obj);
2277
- }
2278
- var newObj = {};
2279
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
2280
- for (var key in obj) {
2281
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
2282
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
2283
- if (desc && (desc.get || desc.set)) {
2284
- Object.defineProperty(newObj, key, desc);
2285
- } else {
2286
- newObj[key] = obj[key];
2287
- }
2288
- }
2289
- }
2290
- newObj["default"] = obj;
2291
- if (cache) {
2292
- cache.set(obj, newObj);
2293
- }
2294
- return newObj;
2295
- }
2296
- function _interopRequireDefault(obj) {
2297
- return obj && obj.__esModule ? obj : { "default": obj };
2298
- }
2299
- function _defineProperties(target, props) {
2300
- for (var i = 0; i < props.length; i++) {
2301
- var descriptor = props[i];
2302
- descriptor.enumerable = descriptor.enumerable || false;
2303
- descriptor.configurable = true;
2304
- if ("value" in descriptor) descriptor.writable = true;
2305
- Object.defineProperty(target, descriptor.key, descriptor);
2306
- }
2307
- }
2308
- function _createClass(Constructor, protoProps, staticProps) {
2309
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2310
- if (staticProps) _defineProperties(Constructor, staticProps);
2311
- Object.defineProperty(Constructor, "prototype", { writable: false });
2312
- return Constructor;
2313
- }
2314
- var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);
2315
- var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));
2316
- function tokenStart(token) {
2317
- return {
2318
- line: token[_tokenize.FIELDS.START_LINE],
2319
- column: token[_tokenize.FIELDS.START_COL]
2320
- };
2321
- }
2322
- function tokenEnd(token) {
2323
- return {
2324
- line: token[_tokenize.FIELDS.END_LINE],
2325
- column: token[_tokenize.FIELDS.END_COL]
2326
- };
2327
- }
2328
- function getSource(startLine, startColumn, endLine, endColumn) {
2329
- return {
2330
- start: {
2331
- line: startLine,
2332
- column: startColumn
2333
- },
2334
- end: {
2335
- line: endLine,
2336
- column: endColumn
2337
- }
2338
- };
2339
- }
2340
- function getTokenSource(token) {
2341
- return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]);
2342
- }
2343
- function getTokenSourceSpan(startToken, endToken) {
2344
- if (!startToken) {
2345
- return void 0;
2346
- }
2347
- return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]);
2348
- }
2349
- function unescapeProp(node, prop) {
2350
- var value = node[prop];
2351
- if (typeof value !== "string") {
2352
- return;
2353
- }
2354
- if (value.indexOf("\\") !== -1) {
2355
- (0, _util.ensureObject)(node, "raws");
2356
- node[prop] = (0, _util.unesc)(value);
2357
- if (node.raws[prop] === void 0) {
2358
- node.raws[prop] = value;
2359
- }
2360
- }
2361
- return node;
2362
- }
2363
- function indexesOf(array, item) {
2364
- var i = -1;
2365
- var indexes = [];
2366
- while ((i = array.indexOf(item, i + 1)) !== -1) {
2367
- indexes.push(i);
2368
- }
2369
- return indexes;
2370
- }
2371
- function uniqs() {
2372
- var list = Array.prototype.concat.apply([], arguments);
2373
- return list.filter(function(item, i) {
2374
- return i === list.indexOf(item);
2375
- });
2376
- }
2377
- var Parser = /* @__PURE__ */ function() {
2378
- function Parser2(rule, options) {
2379
- if (options === void 0) {
2380
- options = {};
2381
- }
2382
- this.rule = rule;
2383
- this.options = Object.assign({
2384
- lossy: false,
2385
- safe: false
2386
- }, options);
2387
- this.position = 0;
2388
- this.css = typeof this.rule === "string" ? this.rule : this.rule.selector;
2389
- this.tokens = (0, _tokenize["default"])({
2390
- css: this.css,
2391
- error: this._errorGenerator(),
2392
- safe: this.options.safe
2393
- });
2394
- var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);
2395
- this.root = new _root["default"]({
2396
- source: rootSource
2397
- });
2398
- this.root.errorGenerator = this._errorGenerator();
2399
- var selector = new _selector["default"]({
2400
- source: {
2401
- start: {
2402
- line: 1,
2403
- column: 1
2404
- }
2405
- },
2406
- sourceIndex: 0
2407
- });
2408
- this.root.append(selector);
2409
- this.current = selector;
2410
- this.loop();
2411
- }
2412
- var _proto = Parser2.prototype;
2413
- _proto._errorGenerator = function _errorGenerator() {
2414
- var _this = this;
2415
- return function(message, errorOptions) {
2416
- if (typeof _this.rule === "string") {
2417
- return new Error(message);
2418
- }
2419
- return _this.rule.error(message, errorOptions);
2420
- };
2421
- };
2422
- _proto.attribute = function attribute2() {
2423
- var attr2 = [];
2424
- var startingToken = this.currToken;
2425
- this.position++;
2426
- while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
2427
- attr2.push(this.currToken);
2428
- this.position++;
2429
- }
2430
- if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
2431
- return this.expected("closing square bracket", this.currToken[_tokenize.FIELDS.START_POS]);
2432
- }
2433
- var len = attr2.length;
2434
- var node = {
2435
- source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
2436
- sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
2437
- };
2438
- if (len === 1 && !~[tokens.word].indexOf(attr2[0][_tokenize.FIELDS.TYPE])) {
2439
- return this.expected("attribute", attr2[0][_tokenize.FIELDS.START_POS]);
2440
- }
2441
- var pos = 0;
2442
- var spaceBefore = "";
2443
- var commentBefore = "";
2444
- var lastAdded = null;
2445
- var spaceAfterMeaningfulToken = false;
2446
- while (pos < len) {
2447
- var token = attr2[pos];
2448
- var content = this.content(token);
2449
- var next = attr2[pos + 1];
2450
- switch (token[_tokenize.FIELDS.TYPE]) {
2451
- case tokens.space:
2452
- spaceAfterMeaningfulToken = true;
2453
- if (this.options.lossy) {
2454
- break;
2455
- }
2456
- if (lastAdded) {
2457
- (0, _util.ensureObject)(node, "spaces", lastAdded);
2458
- var prevContent = node.spaces[lastAdded].after || "";
2459
- node.spaces[lastAdded].after = prevContent + content;
2460
- var existingComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || null;
2461
- if (existingComment) {
2462
- node.raws.spaces[lastAdded].after = existingComment + content;
2463
- }
2464
- } else {
2465
- spaceBefore = spaceBefore + content;
2466
- commentBefore = commentBefore + content;
2467
- }
2468
- break;
2469
- case tokens.asterisk:
2470
- if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
2471
- node.operator = content;
2472
- lastAdded = "operator";
2473
- } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) {
2474
- if (spaceBefore) {
2475
- (0, _util.ensureObject)(node, "spaces", "attribute");
2476
- node.spaces.attribute.before = spaceBefore;
2477
- spaceBefore = "";
2478
- }
2479
- if (commentBefore) {
2480
- (0, _util.ensureObject)(node, "raws", "spaces", "attribute");
2481
- node.raws.spaces.attribute.before = spaceBefore;
2482
- commentBefore = "";
2483
- }
2484
- node.namespace = (node.namespace || "") + content;
2485
- var rawValue = (0, _util.getProp)(node, "raws", "namespace") || null;
2486
- if (rawValue) {
2487
- node.raws.namespace += content;
2488
- }
2489
- lastAdded = "namespace";
2490
- }
2491
- spaceAfterMeaningfulToken = false;
2492
- break;
2493
- case tokens.dollar:
2494
- if (lastAdded === "value") {
2495
- var oldRawValue = (0, _util.getProp)(node, "raws", "value");
2496
- node.value += "$";
2497
- if (oldRawValue) {
2498
- node.raws.value = oldRawValue + "$";
2499
- }
2500
- break;
2501
- }
2502
- // Falls through
2503
- case tokens.caret:
2504
- if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
2505
- node.operator = content;
2506
- lastAdded = "operator";
2507
- }
2508
- spaceAfterMeaningfulToken = false;
2509
- break;
2510
- case tokens.combinator:
2511
- if (content === "~" && next[_tokenize.FIELDS.TYPE] === tokens.equals) {
2512
- node.operator = content;
2513
- lastAdded = "operator";
2514
- }
2515
- if (content !== "|") {
2516
- spaceAfterMeaningfulToken = false;
2517
- break;
2518
- }
2519
- if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
2520
- node.operator = content;
2521
- lastAdded = "operator";
2522
- } else if (!node.namespace && !node.attribute) {
2523
- node.namespace = true;
2524
- }
2525
- spaceAfterMeaningfulToken = false;
2526
- break;
2527
- case tokens.word:
2528
- if (next && this.content(next) === "|" && attr2[pos + 2] && attr2[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved.
2529
- !node.operator && !node.namespace) {
2530
- node.namespace = content;
2531
- lastAdded = "namespace";
2532
- } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) {
2533
- if (spaceBefore) {
2534
- (0, _util.ensureObject)(node, "spaces", "attribute");
2535
- node.spaces.attribute.before = spaceBefore;
2536
- spaceBefore = "";
2537
- }
2538
- if (commentBefore) {
2539
- (0, _util.ensureObject)(node, "raws", "spaces", "attribute");
2540
- node.raws.spaces.attribute.before = commentBefore;
2541
- commentBefore = "";
2542
- }
2543
- node.attribute = (node.attribute || "") + content;
2544
- var _rawValue = (0, _util.getProp)(node, "raws", "attribute") || null;
2545
- if (_rawValue) {
2546
- node.raws.attribute += content;
2547
- }
2548
- lastAdded = "attribute";
2549
- } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
2550
- var _unescaped = (0, _util.unesc)(content);
2551
- var _oldRawValue = (0, _util.getProp)(node, "raws", "value") || "";
2552
- var oldValue = node.value || "";
2553
- node.value = oldValue + _unescaped;
2554
- node.quoteMark = null;
2555
- if (_unescaped !== content || _oldRawValue) {
2556
- (0, _util.ensureObject)(node, "raws");
2557
- node.raws.value = (_oldRawValue || oldValue) + content;
2558
- }
2559
- lastAdded = "value";
2560
- } else {
2561
- var insensitive = content === "i" || content === "I";
2562
- if ((node.value || node.value === "") && (node.quoteMark || spaceAfterMeaningfulToken)) {
2563
- node.insensitive = insensitive;
2564
- if (!insensitive || content === "I") {
2565
- (0, _util.ensureObject)(node, "raws");
2566
- node.raws.insensitiveFlag = content;
2567
- }
2568
- lastAdded = "insensitive";
2569
- if (spaceBefore) {
2570
- (0, _util.ensureObject)(node, "spaces", "insensitive");
2571
- node.spaces.insensitive.before = spaceBefore;
2572
- spaceBefore = "";
2573
- }
2574
- if (commentBefore) {
2575
- (0, _util.ensureObject)(node, "raws", "spaces", "insensitive");
2576
- node.raws.spaces.insensitive.before = commentBefore;
2577
- commentBefore = "";
2578
- }
2579
- } else if (node.value || node.value === "") {
2580
- lastAdded = "value";
2581
- node.value += content;
2582
- if (node.raws.value) {
2583
- node.raws.value += content;
2584
- }
2585
- }
2586
- }
2587
- spaceAfterMeaningfulToken = false;
2588
- break;
2589
- case tokens.str:
2590
- if (!node.attribute || !node.operator) {
2591
- return this.error("Expected an attribute followed by an operator preceding the string.", {
2592
- index: token[_tokenize.FIELDS.START_POS]
2593
- });
2594
- }
2595
- var _unescapeValue = (0, _attribute.unescapeValue)(content), unescaped = _unescapeValue.unescaped, quoteMark = _unescapeValue.quoteMark;
2596
- node.value = unescaped;
2597
- node.quoteMark = quoteMark;
2598
- lastAdded = "value";
2599
- (0, _util.ensureObject)(node, "raws");
2600
- node.raws.value = content;
2601
- spaceAfterMeaningfulToken = false;
2602
- break;
2603
- case tokens.equals:
2604
- if (!node.attribute) {
2605
- return this.expected("attribute", token[_tokenize.FIELDS.START_POS], content);
2606
- }
2607
- if (node.value) {
2608
- return this.error('Unexpected "=" found; an operator was already defined.', {
2609
- index: token[_tokenize.FIELDS.START_POS]
2610
- });
2611
- }
2612
- node.operator = node.operator ? node.operator + content : content;
2613
- lastAdded = "operator";
2614
- spaceAfterMeaningfulToken = false;
2615
- break;
2616
- case tokens.comment:
2617
- if (lastAdded) {
2618
- if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") {
2619
- var lastComment = (0, _util.getProp)(node, "spaces", lastAdded, "after") || "";
2620
- var rawLastComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
2621
- (0, _util.ensureObject)(node, "raws", "spaces", lastAdded);
2622
- node.raws.spaces[lastAdded].after = rawLastComment + content;
2623
- } else {
2624
- var lastValue = node[lastAdded] || "";
2625
- var rawLastValue = (0, _util.getProp)(node, "raws", lastAdded) || lastValue;
2626
- (0, _util.ensureObject)(node, "raws");
2627
- node.raws[lastAdded] = rawLastValue + content;
2628
- }
2629
- } else {
2630
- commentBefore = commentBefore + content;
2631
- }
2632
- break;
2633
- default:
2634
- return this.error('Unexpected "' + content + '" found.', {
2635
- index: token[_tokenize.FIELDS.START_POS]
2636
- });
2637
- }
2638
- pos++;
2639
- }
2640
- unescapeProp(node, "attribute");
2641
- unescapeProp(node, "namespace");
2642
- this.newNode(new _attribute["default"](node));
2643
- this.position++;
2644
- };
2645
- _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) {
2646
- if (stopPosition < 0) {
2647
- stopPosition = this.tokens.length;
2648
- }
2649
- var startPosition = this.position;
2650
- var nodes = [];
2651
- var space = "";
2652
- var lastComment = void 0;
2653
- do {
2654
- if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {
2655
- if (!this.options.lossy) {
2656
- space += this.content();
2657
- }
2658
- } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) {
2659
- var spaces = {};
2660
- if (space) {
2661
- spaces.before = space;
2662
- space = "";
2663
- }
2664
- lastComment = new _comment["default"]({
2665
- value: this.content(),
2666
- source: getTokenSource(this.currToken),
2667
- sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
2668
- spaces
2669
- });
2670
- nodes.push(lastComment);
2671
- }
2672
- } while (++this.position < stopPosition);
2673
- if (space) {
2674
- if (lastComment) {
2675
- lastComment.spaces.after = space;
2676
- } else if (!this.options.lossy) {
2677
- var firstToken = this.tokens[startPosition];
2678
- var lastToken = this.tokens[this.position - 1];
2679
- nodes.push(new _string["default"]({
2680
- value: "",
2681
- source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]),
2682
- sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
2683
- spaces: {
2684
- before: space,
2685
- after: ""
2686
- }
2687
- }));
2688
- }
2689
- }
2690
- return nodes;
2691
- };
2692
- _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {
2693
- var _this2 = this;
2694
- if (requiredSpace === void 0) {
2695
- requiredSpace = false;
2696
- }
2697
- var space = "";
2698
- var rawSpace = "";
2699
- nodes.forEach(function(n) {
2700
- var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace);
2701
- var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace);
2702
- space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
2703
- rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
2704
- });
2705
- if (rawSpace === space) {
2706
- rawSpace = void 0;
2707
- }
2708
- var result = {
2709
- space,
2710
- rawSpace
2711
- };
2712
- return result;
2713
- };
2714
- _proto.isNamedCombinator = function isNamedCombinator(position) {
2715
- if (position === void 0) {
2716
- position = this.position;
2717
- }
2718
- return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;
2719
- };
2720
- _proto.namedCombinator = function namedCombinator() {
2721
- if (this.isNamedCombinator()) {
2722
- var nameRaw = this.content(this.tokens[this.position + 1]);
2723
- var name = (0, _util.unesc)(nameRaw).toLowerCase();
2724
- var raws = {};
2725
- if (name !== nameRaw) {
2726
- raws.value = "/" + nameRaw + "/";
2727
- }
2728
- var node = new _combinator["default"]({
2729
- value: "/" + name + "/",
2730
- source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]),
2731
- sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
2732
- raws
2733
- });
2734
- this.position = this.position + 3;
2735
- return node;
2736
- } else {
2737
- this.unexpected();
2738
- }
2739
- };
2740
- _proto.combinator = function combinator2() {
2741
- var _this3 = this;
2742
- if (this.content() === "|") {
2743
- return this.namespace();
2744
- }
2745
- var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
2746
- if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
2747
- var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
2748
- if (nodes.length > 0) {
2749
- var last = this.current.last;
2750
- if (last) {
2751
- var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), space = _this$convertWhitespa.space, rawSpace = _this$convertWhitespa.rawSpace;
2752
- if (rawSpace !== void 0) {
2753
- last.rawSpaceAfter += rawSpace;
2754
- }
2755
- last.spaces.after += space;
2756
- } else {
2757
- nodes.forEach(function(n) {
2758
- return _this3.newNode(n);
2759
- });
2760
- }
2761
- }
2762
- return;
2763
- }
2764
- var firstToken = this.currToken;
2765
- var spaceOrDescendantSelectorNodes = void 0;
2766
- if (nextSigTokenPos > this.position) {
2767
- spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
2768
- }
2769
- var node;
2770
- if (this.isNamedCombinator()) {
2771
- node = this.namedCombinator();
2772
- } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) {
2773
- node = new _combinator["default"]({
2774
- value: this.content(),
2775
- source: getTokenSource(this.currToken),
2776
- sourceIndex: this.currToken[_tokenize.FIELDS.START_POS]
2777
- });
2778
- this.position++;
2779
- } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {
2780
- } else if (!spaceOrDescendantSelectorNodes) {
2781
- this.unexpected();
2782
- }
2783
- if (node) {
2784
- if (spaceOrDescendantSelectorNodes) {
2785
- var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), _space = _this$convertWhitespa2.space, _rawSpace = _this$convertWhitespa2.rawSpace;
2786
- node.spaces.before = _space;
2787
- node.rawSpaceBefore = _rawSpace;
2788
- }
2789
- } else {
2790
- var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), _space2 = _this$convertWhitespa3.space, _rawSpace2 = _this$convertWhitespa3.rawSpace;
2791
- if (!_rawSpace2) {
2792
- _rawSpace2 = _space2;
2793
- }
2794
- var spaces = {};
2795
- var raws = {
2796
- spaces: {}
2797
- };
2798
- if (_space2.endsWith(" ") && _rawSpace2.endsWith(" ")) {
2799
- spaces.before = _space2.slice(0, _space2.length - 1);
2800
- raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);
2801
- } else if (_space2.startsWith(" ") && _rawSpace2.startsWith(" ")) {
2802
- spaces.after = _space2.slice(1);
2803
- raws.spaces.after = _rawSpace2.slice(1);
2804
- } else {
2805
- raws.value = _rawSpace2;
2806
- }
2807
- node = new _combinator["default"]({
2808
- value: " ",
2809
- source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
2810
- sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
2811
- spaces,
2812
- raws
2813
- });
2814
- }
2815
- if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) {
2816
- node.spaces.after = this.optionalSpace(this.content());
2817
- this.position++;
2818
- }
2819
- return this.newNode(node);
2820
- };
2821
- _proto.comma = function comma() {
2822
- if (this.position === this.tokens.length - 1) {
2823
- this.root.trailingComma = true;
2824
- this.position++;
2825
- return;
2826
- }
2827
- this.current._inferEndPosition();
2828
- var selector = new _selector["default"]({
2829
- source: {
2830
- start: tokenStart(this.tokens[this.position + 1])
2831
- },
2832
- sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS]
2833
- });
2834
- this.current.parent.append(selector);
2835
- this.current = selector;
2836
- this.position++;
2837
- };
2838
- _proto.comment = function comment() {
2839
- var current = this.currToken;
2840
- this.newNode(new _comment["default"]({
2841
- value: this.content(),
2842
- source: getTokenSource(current),
2843
- sourceIndex: current[_tokenize.FIELDS.START_POS]
2844
- }));
2845
- this.position++;
2846
- };
2847
- _proto.error = function error2(message, opts) {
2848
- throw this.root.error(message, opts);
2849
- };
2850
- _proto.missingBackslash = function missingBackslash() {
2851
- return this.error("Expected a backslash preceding the semicolon.", {
2852
- index: this.currToken[_tokenize.FIELDS.START_POS]
2853
- });
2854
- };
2855
- _proto.missingParenthesis = function missingParenthesis() {
2856
- return this.expected("opening parenthesis", this.currToken[_tokenize.FIELDS.START_POS]);
2857
- };
2858
- _proto.missingSquareBracket = function missingSquareBracket() {
2859
- return this.expected("opening square bracket", this.currToken[_tokenize.FIELDS.START_POS]);
2860
- };
2861
- _proto.unexpected = function unexpected() {
2862
- return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]);
2863
- };
2864
- _proto.unexpectedPipe = function unexpectedPipe() {
2865
- return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]);
2866
- };
2867
- _proto.namespace = function namespace() {
2868
- var before = this.prevToken && this.content(this.prevToken) || true;
2869
- if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) {
2870
- this.position++;
2871
- return this.word(before);
2872
- } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) {
2873
- this.position++;
2874
- return this.universal(before);
2875
- }
2876
- this.unexpectedPipe();
2877
- };
2878
- _proto.nesting = function nesting() {
2879
- if (this.nextToken) {
2880
- var nextContent = this.content(this.nextToken);
2881
- if (nextContent === "|") {
2882
- this.position++;
2883
- return;
2884
- }
2885
- }
2886
- var current = this.currToken;
2887
- this.newNode(new _nesting["default"]({
2888
- value: this.content(),
2889
- source: getTokenSource(current),
2890
- sourceIndex: current[_tokenize.FIELDS.START_POS]
2891
- }));
2892
- this.position++;
2893
- };
2894
- _proto.parentheses = function parentheses() {
2895
- var last = this.current.last;
2896
- var unbalanced = 1;
2897
- this.position++;
2898
- if (last && last.type === types.PSEUDO) {
2899
- var selector = new _selector["default"]({
2900
- source: {
2901
- start: tokenStart(this.tokens[this.position])
2902
- },
2903
- sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS]
2904
- });
2905
- var cache = this.current;
2906
- last.append(selector);
2907
- this.current = selector;
2908
- while (this.position < this.tokens.length && unbalanced) {
2909
- if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
2910
- unbalanced++;
2911
- }
2912
- if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
2913
- unbalanced--;
2914
- }
2915
- if (unbalanced) {
2916
- this.parse();
2917
- } else {
2918
- this.current.source.end = tokenEnd(this.currToken);
2919
- this.current.parent.source.end = tokenEnd(this.currToken);
2920
- this.position++;
2921
- }
2922
- }
2923
- this.current = cache;
2924
- } else {
2925
- var parenStart = this.currToken;
2926
- var parenValue = "(";
2927
- var parenEnd;
2928
- while (this.position < this.tokens.length && unbalanced) {
2929
- if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
2930
- unbalanced++;
2931
- }
2932
- if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
2933
- unbalanced--;
2934
- }
2935
- parenEnd = this.currToken;
2936
- parenValue += this.parseParenthesisToken(this.currToken);
2937
- this.position++;
2938
- }
2939
- if (last) {
2940
- last.appendToPropertyAndEscape("value", parenValue, parenValue);
2941
- } else {
2942
- this.newNode(new _string["default"]({
2943
- value: parenValue,
2944
- source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]),
2945
- sourceIndex: parenStart[_tokenize.FIELDS.START_POS]
2946
- }));
2947
- }
2948
- }
2949
- if (unbalanced) {
2950
- return this.expected("closing parenthesis", this.currToken[_tokenize.FIELDS.START_POS]);
2951
- }
2952
- };
2953
- _proto.pseudo = function pseudo2() {
2954
- var _this4 = this;
2955
- var pseudoStr = "";
2956
- var startingToken = this.currToken;
2957
- while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) {
2958
- pseudoStr += this.content();
2959
- this.position++;
2960
- }
2961
- if (!this.currToken) {
2962
- return this.expected(["pseudo-class", "pseudo-element"], this.position - 1);
2963
- }
2964
- if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) {
2965
- this.splitWord(false, function(first, length) {
2966
- pseudoStr += first;
2967
- _this4.newNode(new _pseudo["default"]({
2968
- value: pseudoStr,
2969
- source: getTokenSourceSpan(startingToken, _this4.currToken),
2970
- sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
2971
- }));
2972
- if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
2973
- _this4.error("Misplaced parenthesis.", {
2974
- index: _this4.nextToken[_tokenize.FIELDS.START_POS]
2975
- });
2976
- }
2977
- });
2978
- } else {
2979
- return this.expected(["pseudo-class", "pseudo-element"], this.currToken[_tokenize.FIELDS.START_POS]);
2980
- }
2981
- };
2982
- _proto.space = function space() {
2983
- var content = this.content();
2984
- if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function(node) {
2985
- return node.type === "comment";
2986
- })) {
2987
- this.spaces = this.optionalSpace(content);
2988
- this.position++;
2989
- } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
2990
- this.current.last.spaces.after = this.optionalSpace(content);
2991
- this.position++;
2992
- } else {
2993
- this.combinator();
2994
- }
2995
- };
2996
- _proto.string = function string() {
2997
- var current = this.currToken;
2998
- this.newNode(new _string["default"]({
2999
- value: this.content(),
3000
- source: getTokenSource(current),
3001
- sourceIndex: current[_tokenize.FIELDS.START_POS]
3002
- }));
3003
- this.position++;
3004
- };
3005
- _proto.universal = function universal(namespace) {
3006
- var nextToken = this.nextToken;
3007
- if (nextToken && this.content(nextToken) === "|") {
3008
- this.position++;
3009
- return this.namespace();
3010
- }
3011
- var current = this.currToken;
3012
- this.newNode(new _universal["default"]({
3013
- value: this.content(),
3014
- source: getTokenSource(current),
3015
- sourceIndex: current[_tokenize.FIELDS.START_POS]
3016
- }), namespace);
3017
- this.position++;
3018
- };
3019
- _proto.splitWord = function splitWord(namespace, firstCallback) {
3020
- var _this5 = this;
3021
- var nextToken = this.nextToken;
3022
- var word = this.content();
3023
- while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) {
3024
- this.position++;
3025
- var current = this.content();
3026
- word += current;
3027
- if (current.lastIndexOf("\\") === current.length - 1) {
3028
- var next = this.nextToken;
3029
- if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) {
3030
- word += this.requiredSpace(this.content(next));
3031
- this.position++;
3032
- }
3033
- }
3034
- nextToken = this.nextToken;
3035
- }
3036
- var hasClass = indexesOf(word, ".").filter(function(i) {
3037
- var escapedDot = word[i - 1] === "\\";
3038
- var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
3039
- return !escapedDot && !isKeyframesPercent;
3040
- });
3041
- var hasId = indexesOf(word, "#").filter(function(i) {
3042
- return word[i - 1] !== "\\";
3043
- });
3044
- var interpolations = indexesOf(word, "#{");
3045
- if (interpolations.length) {
3046
- hasId = hasId.filter(function(hashIndex) {
3047
- return !~interpolations.indexOf(hashIndex);
3048
- });
3049
- }
3050
- var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId)));
3051
- indices.forEach(function(ind, i) {
3052
- var index = indices[i + 1] || word.length;
3053
- var value = word.slice(ind, index);
3054
- if (i === 0 && firstCallback) {
3055
- return firstCallback.call(_this5, value, indices.length);
3056
- }
3057
- var node;
3058
- var current2 = _this5.currToken;
3059
- var sourceIndex = current2[_tokenize.FIELDS.START_POS] + indices[i];
3060
- var source = getSource(current2[1], current2[2] + ind, current2[3], current2[2] + (index - 1));
3061
- if (~hasClass.indexOf(ind)) {
3062
- var classNameOpts = {
3063
- value: value.slice(1),
3064
- source,
3065
- sourceIndex
3066
- };
3067
- node = new _className["default"](unescapeProp(classNameOpts, "value"));
3068
- } else if (~hasId.indexOf(ind)) {
3069
- var idOpts = {
3070
- value: value.slice(1),
3071
- source,
3072
- sourceIndex
3073
- };
3074
- node = new _id["default"](unescapeProp(idOpts, "value"));
3075
- } else {
3076
- var tagOpts = {
3077
- value,
3078
- source,
3079
- sourceIndex
3080
- };
3081
- unescapeProp(tagOpts, "value");
3082
- node = new _tag["default"](tagOpts);
3083
- }
3084
- _this5.newNode(node, namespace);
3085
- namespace = null;
3086
- });
3087
- this.position++;
3088
- };
3089
- _proto.word = function word(namespace) {
3090
- var nextToken = this.nextToken;
3091
- if (nextToken && this.content(nextToken) === "|") {
3092
- this.position++;
3093
- return this.namespace();
3094
- }
3095
- return this.splitWord(namespace);
3096
- };
3097
- _proto.loop = function loop() {
3098
- while (this.position < this.tokens.length) {
3099
- this.parse(true);
3100
- }
3101
- this.current._inferEndPosition();
3102
- return this.root;
3103
- };
3104
- _proto.parse = function parse2(throwOnParenthesis) {
3105
- switch (this.currToken[_tokenize.FIELDS.TYPE]) {
3106
- case tokens.space:
3107
- this.space();
3108
- break;
3109
- case tokens.comment:
3110
- this.comment();
3111
- break;
3112
- case tokens.openParenthesis:
3113
- this.parentheses();
3114
- break;
3115
- case tokens.closeParenthesis:
3116
- if (throwOnParenthesis) {
3117
- this.missingParenthesis();
3118
- }
3119
- break;
3120
- case tokens.openSquare:
3121
- this.attribute();
3122
- break;
3123
- case tokens.dollar:
3124
- case tokens.caret:
3125
- case tokens.equals:
3126
- case tokens.word:
3127
- this.word();
3128
- break;
3129
- case tokens.colon:
3130
- this.pseudo();
3131
- break;
3132
- case tokens.comma:
3133
- this.comma();
3134
- break;
3135
- case tokens.asterisk:
3136
- this.universal();
3137
- break;
3138
- case tokens.ampersand:
3139
- this.nesting();
3140
- break;
3141
- case tokens.slash:
3142
- case tokens.combinator:
3143
- this.combinator();
3144
- break;
3145
- case tokens.str:
3146
- this.string();
3147
- break;
3148
- // These cases throw; no break needed.
3149
- case tokens.closeSquare:
3150
- this.missingSquareBracket();
3151
- case tokens.semicolon:
3152
- this.missingBackslash();
3153
- default:
3154
- this.unexpected();
3155
- }
3156
- };
3157
- _proto.expected = function expected(description, index, found) {
3158
- if (Array.isArray(description)) {
3159
- var last = description.pop();
3160
- description = description.join(", ") + " or " + last;
3161
- }
3162
- var an = /^[aeiou]/.test(description[0]) ? "an" : "a";
3163
- if (!found) {
3164
- return this.error("Expected " + an + " " + description + ".", {
3165
- index
3166
- });
3167
- }
3168
- return this.error("Expected " + an + " " + description + ', found "' + found + '" instead.', {
3169
- index
3170
- });
3171
- };
3172
- _proto.requiredSpace = function requiredSpace(space) {
3173
- return this.options.lossy ? " " : space;
3174
- };
3175
- _proto.optionalSpace = function optionalSpace(space) {
3176
- return this.options.lossy ? "" : space;
3177
- };
3178
- _proto.lossySpace = function lossySpace(space, required) {
3179
- if (this.options.lossy) {
3180
- return required ? " " : "";
3181
- } else {
3182
- return space;
3183
- }
3184
- };
3185
- _proto.parseParenthesisToken = function parseParenthesisToken(token) {
3186
- var content = this.content(token);
3187
- if (token[_tokenize.FIELDS.TYPE] === tokens.space) {
3188
- return this.requiredSpace(content);
3189
- } else {
3190
- return content;
3191
- }
3192
- };
3193
- _proto.newNode = function newNode(node, namespace) {
3194
- if (namespace) {
3195
- if (/^ +$/.test(namespace)) {
3196
- if (!this.options.lossy) {
3197
- this.spaces = (this.spaces || "") + namespace;
3198
- }
3199
- namespace = true;
3200
- }
3201
- node.namespace = namespace;
3202
- unescapeProp(node, "namespace");
3203
- }
3204
- if (this.spaces) {
3205
- node.spaces.before = this.spaces;
3206
- this.spaces = "";
3207
- }
3208
- return this.current.append(node);
3209
- };
3210
- _proto.content = function content(token) {
3211
- if (token === void 0) {
3212
- token = this.currToken;
3213
- }
3214
- return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);
3215
- };
3216
- _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) {
3217
- if (startPosition === void 0) {
3218
- startPosition = this.position + 1;
3219
- }
3220
- var searchPosition = startPosition;
3221
- while (searchPosition < this.tokens.length) {
3222
- if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) {
3223
- searchPosition++;
3224
- continue;
3225
- } else {
3226
- return searchPosition;
3227
- }
3228
- }
3229
- return -1;
3230
- };
3231
- _createClass(Parser2, [{
3232
- key: "currToken",
3233
- get: function get() {
3234
- return this.tokens[this.position];
3235
- }
3236
- }, {
3237
- key: "nextToken",
3238
- get: function get() {
3239
- return this.tokens[this.position + 1];
3240
- }
3241
- }, {
3242
- key: "prevToken",
3243
- get: function get() {
3244
- return this.tokens[this.position - 1];
3245
- }
3246
- }]);
3247
- return Parser2;
3248
- }();
3249
- exports["default"] = Parser;
3250
- module.exports = exports.default;
3251
- }
3252
- });
3253
-
3254
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/processor.js
3255
- var require_processor = __commonJS({
3256
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/processor.js"(exports, module) {
3257
- "use strict";
3258
- exports.__esModule = true;
3259
- exports["default"] = void 0;
3260
- var _parser = _interopRequireDefault(require_parser());
3261
- function _interopRequireDefault(obj) {
3262
- return obj && obj.__esModule ? obj : { "default": obj };
3263
- }
3264
- var Processor = /* @__PURE__ */ function() {
3265
- function Processor2(func, options) {
3266
- this.func = func || function noop() {
3267
- };
3268
- this.funcRes = null;
3269
- this.options = options;
3270
- }
3271
- var _proto = Processor2.prototype;
3272
- _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {
3273
- if (options === void 0) {
3274
- options = {};
3275
- }
3276
- var merged = Object.assign({}, this.options, options);
3277
- if (merged.updateSelector === false) {
3278
- return false;
3279
- } else {
3280
- return typeof rule !== "string";
3281
- }
3282
- };
3283
- _proto._isLossy = function _isLossy(options) {
3284
- if (options === void 0) {
3285
- options = {};
3286
- }
3287
- var merged = Object.assign({}, this.options, options);
3288
- if (merged.lossless === false) {
3289
- return true;
3290
- } else {
3291
- return false;
3292
- }
3293
- };
3294
- _proto._root = function _root(rule, options) {
3295
- if (options === void 0) {
3296
- options = {};
3297
- }
3298
- var parser = new _parser["default"](rule, this._parseOptions(options));
3299
- return parser.root;
3300
- };
3301
- _proto._parseOptions = function _parseOptions(options) {
3302
- return {
3303
- lossy: this._isLossy(options)
3304
- };
3305
- };
3306
- _proto._run = function _run(rule, options) {
3307
- var _this = this;
3308
- if (options === void 0) {
3309
- options = {};
3310
- }
3311
- return new Promise(function(resolve, reject) {
3312
- try {
3313
- var root2 = _this._root(rule, options);
3314
- Promise.resolve(_this.func(root2)).then(function(transform) {
3315
- var string = void 0;
3316
- if (_this._shouldUpdateSelector(rule, options)) {
3317
- string = root2.toString();
3318
- rule.selector = string;
3319
- }
3320
- return {
3321
- transform,
3322
- root: root2,
3323
- string
3324
- };
3325
- }).then(resolve, reject);
3326
- } catch (e) {
3327
- reject(e);
3328
- return;
3329
- }
3330
- });
3331
- };
3332
- _proto._runSync = function _runSync(rule, options) {
3333
- if (options === void 0) {
3334
- options = {};
3335
- }
3336
- var root2 = this._root(rule, options);
3337
- var transform = this.func(root2);
3338
- if (transform && typeof transform.then === "function") {
3339
- throw new Error("Selector processor returned a promise to a synchronous call.");
3340
- }
3341
- var string = void 0;
3342
- if (options.updateSelector && typeof rule !== "string") {
3343
- string = root2.toString();
3344
- rule.selector = string;
3345
- }
3346
- return {
3347
- transform,
3348
- root: root2,
3349
- string
3350
- };
3351
- };
3352
- _proto.ast = function ast(rule, options) {
3353
- return this._run(rule, options).then(function(result) {
3354
- return result.root;
3355
- });
3356
- };
3357
- _proto.astSync = function astSync(rule, options) {
3358
- return this._runSync(rule, options).root;
3359
- };
3360
- _proto.transform = function transform(rule, options) {
3361
- return this._run(rule, options).then(function(result) {
3362
- return result.transform;
3363
- });
3364
- };
3365
- _proto.transformSync = function transformSync(rule, options) {
3366
- return this._runSync(rule, options).transform;
3367
- };
3368
- _proto.process = function process(rule, options) {
3369
- return this._run(rule, options).then(function(result) {
3370
- return result.string || result.root.toString();
3371
- });
3372
- };
3373
- _proto.processSync = function processSync(rule, options) {
3374
- var result = this._runSync(rule, options);
3375
- return result.string || result.root.toString();
3376
- };
3377
- return Processor2;
3378
- }();
3379
- exports["default"] = Processor;
3380
- module.exports = exports.default;
3381
- }
3382
- });
3383
-
3384
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/constructors.js
3385
- var require_constructors = __commonJS({
3386
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/constructors.js"(exports) {
3387
- "use strict";
3388
- exports.__esModule = true;
3389
- exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;
3390
- var _attribute = _interopRequireDefault(require_attribute());
3391
- var _className = _interopRequireDefault(require_className());
3392
- var _combinator = _interopRequireDefault(require_combinator());
3393
- var _comment = _interopRequireDefault(require_comment());
3394
- var _id = _interopRequireDefault(require_id());
3395
- var _nesting = _interopRequireDefault(require_nesting());
3396
- var _pseudo = _interopRequireDefault(require_pseudo());
3397
- var _root = _interopRequireDefault(require_root());
3398
- var _selector = _interopRequireDefault(require_selector());
3399
- var _string = _interopRequireDefault(require_string());
3400
- var _tag = _interopRequireDefault(require_tag());
3401
- var _universal = _interopRequireDefault(require_universal());
3402
- function _interopRequireDefault(obj) {
3403
- return obj && obj.__esModule ? obj : { "default": obj };
3404
- }
3405
- var attribute2 = function attribute3(opts) {
3406
- return new _attribute["default"](opts);
3407
- };
3408
- exports.attribute = attribute2;
3409
- var className = function className2(opts) {
3410
- return new _className["default"](opts);
3411
- };
3412
- exports.className = className;
3413
- var combinator2 = function combinator3(opts) {
3414
- return new _combinator["default"](opts);
3415
- };
3416
- exports.combinator = combinator2;
3417
- var comment = function comment2(opts) {
3418
- return new _comment["default"](opts);
3419
- };
3420
- exports.comment = comment;
3421
- var id2 = function id3(opts) {
3422
- return new _id["default"](opts);
3423
- };
3424
- exports.id = id2;
3425
- var nesting = function nesting2(opts) {
3426
- return new _nesting["default"](opts);
3427
- };
3428
- exports.nesting = nesting;
3429
- var pseudo2 = function pseudo3(opts) {
3430
- return new _pseudo["default"](opts);
3431
- };
3432
- exports.pseudo = pseudo2;
3433
- var root2 = function root3(opts) {
3434
- return new _root["default"](opts);
3435
- };
3436
- exports.root = root2;
3437
- var selector = function selector2(opts) {
3438
- return new _selector["default"](opts);
3439
- };
3440
- exports.selector = selector;
3441
- var string = function string2(opts) {
3442
- return new _string["default"](opts);
3443
- };
3444
- exports.string = string;
3445
- var tag = function tag2(opts) {
3446
- return new _tag["default"](opts);
3447
- };
3448
- exports.tag = tag;
3449
- var universal = function universal2(opts) {
3450
- return new _universal["default"](opts);
3451
- };
3452
- exports.universal = universal;
3453
- }
3454
- });
3455
-
3456
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/guards.js
3457
- var require_guards = __commonJS({
3458
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/guards.js"(exports) {
3459
- "use strict";
3460
- exports.__esModule = true;
3461
- exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0;
3462
- exports.isContainer = isContainer;
3463
- exports.isIdentifier = void 0;
3464
- exports.isNamespace = isNamespace;
3465
- exports.isNesting = void 0;
3466
- exports.isNode = isNode;
3467
- exports.isPseudo = void 0;
3468
- exports.isPseudoClass = isPseudoClass;
3469
- exports.isPseudoElement = isPseudoElement;
3470
- exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0;
3471
- var _types = require_types();
3472
- var _IS_TYPE;
3473
- var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
3474
- function isNode(node) {
3475
- return typeof node === "object" && IS_TYPE[node.type];
3476
- }
3477
- function isNodeType(type, node) {
3478
- return isNode(node) && node.type === type;
3479
- }
3480
- var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);
3481
- exports.isAttribute = isAttribute;
3482
- var isClassName = isNodeType.bind(null, _types.CLASS);
3483
- exports.isClassName = isClassName;
3484
- var isCombinator = isNodeType.bind(null, _types.COMBINATOR);
3485
- exports.isCombinator = isCombinator;
3486
- var isComment = isNodeType.bind(null, _types.COMMENT);
3487
- exports.isComment = isComment;
3488
- var isIdentifier = isNodeType.bind(null, _types.ID);
3489
- exports.isIdentifier = isIdentifier;
3490
- var isNesting = isNodeType.bind(null, _types.NESTING);
3491
- exports.isNesting = isNesting;
3492
- var isPseudo = isNodeType.bind(null, _types.PSEUDO);
3493
- exports.isPseudo = isPseudo;
3494
- var isRoot = isNodeType.bind(null, _types.ROOT);
3495
- exports.isRoot = isRoot;
3496
- var isSelector = isNodeType.bind(null, _types.SELECTOR);
3497
- exports.isSelector = isSelector;
3498
- var isString = isNodeType.bind(null, _types.STRING);
3499
- exports.isString = isString;
3500
- var isTag = isNodeType.bind(null, _types.TAG);
3501
- exports.isTag = isTag;
3502
- var isUniversal = isNodeType.bind(null, _types.UNIVERSAL);
3503
- exports.isUniversal = isUniversal;
3504
- function isPseudoElement(node) {
3505
- return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line");
3506
- }
3507
- function isPseudoClass(node) {
3508
- return isPseudo(node) && !isPseudoElement(node);
3509
- }
3510
- function isContainer(node) {
3511
- return !!(isNode(node) && node.walk);
3512
- }
3513
- function isNamespace(node) {
3514
- return isAttribute(node) || isTag(node);
3515
- }
3516
- }
3517
- });
3518
-
3519
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/index.js
3520
- var require_selectors = __commonJS({
3521
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/selectors/index.js"(exports) {
3522
- "use strict";
3523
- exports.__esModule = true;
3524
- var _types = require_types();
3525
- Object.keys(_types).forEach(function(key) {
3526
- if (key === "default" || key === "__esModule") return;
3527
- if (key in exports && exports[key] === _types[key]) return;
3528
- exports[key] = _types[key];
3529
- });
3530
- var _constructors = require_constructors();
3531
- Object.keys(_constructors).forEach(function(key) {
3532
- if (key === "default" || key === "__esModule") return;
3533
- if (key in exports && exports[key] === _constructors[key]) return;
3534
- exports[key] = _constructors[key];
3535
- });
3536
- var _guards = require_guards();
3537
- Object.keys(_guards).forEach(function(key) {
3538
- if (key === "default" || key === "__esModule") return;
3539
- if (key in exports && exports[key] === _guards[key]) return;
3540
- exports[key] = _guards[key];
3541
- });
3542
- }
3543
- });
3544
-
3545
- // ../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/index.js
3546
- var require_dist = __commonJS({
3547
- "../../node_modules/.pnpm/postcss-selector-parser@6.1.2/node_modules/postcss-selector-parser/dist/index.js"(exports, module) {
3548
- "use strict";
3549
- exports.__esModule = true;
3550
- exports["default"] = void 0;
3551
- var _processor = _interopRequireDefault(require_processor());
3552
- var selectors2 = _interopRequireWildcard(require_selectors());
3553
- function _getRequireWildcardCache(nodeInterop) {
3554
- if (typeof WeakMap !== "function") return null;
3555
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
3556
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
3557
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
3558
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
3559
- })(nodeInterop);
3560
- }
3561
- function _interopRequireWildcard(obj, nodeInterop) {
3562
- if (!nodeInterop && obj && obj.__esModule) {
3563
- return obj;
3564
- }
3565
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
3566
- return { "default": obj };
3567
- }
3568
- var cache = _getRequireWildcardCache(nodeInterop);
3569
- if (cache && cache.has(obj)) {
3570
- return cache.get(obj);
3571
- }
3572
- var newObj = {};
3573
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
3574
- for (var key in obj) {
3575
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
3576
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
3577
- if (desc && (desc.get || desc.set)) {
3578
- Object.defineProperty(newObj, key, desc);
3579
- } else {
3580
- newObj[key] = obj[key];
3581
- }
3582
- }
3583
- }
3584
- newObj["default"] = obj;
3585
- if (cache) {
3586
- cache.set(obj, newObj);
3587
- }
3588
- return newObj;
3589
- }
3590
- function _interopRequireDefault(obj) {
3591
- return obj && obj.__esModule ? obj : { "default": obj };
3592
- }
3593
- var parser = function parser2(processor) {
3594
- return new _processor["default"](processor);
3595
- };
3596
- Object.assign(parser, selectors2);
3597
- delete parser.__esModule;
3598
- var _default = parser;
3599
- exports["default"] = _default;
3600
- module.exports = exports.default;
3601
- }
3602
- });
3603
-
3604
- // ../../src/query/src/index.ts
3605
- var import_postcss_selector_parser = __toESM(require_dist(), 1);
3606
-
3607
- // ../../src/query/src/types.ts
3608
- var isPostcssNodeWithChildren = (node) => "type" in node && "nodes" in node;
3609
- var asPostcssNodeWithChildren = (node) => {
3610
- if (!node) {
3611
- throw error("Expected a query node");
3612
- }
3613
- if (!isPostcssNodeWithChildren(node)) {
3614
- throw error("Not a query selector node with children", {
3615
- found: node
3616
- });
3617
- }
3618
- return node;
3619
- };
3620
- var isObj = (o) => !!o && typeof o === "object";
3621
- var isAttributeNode = (node) => isObj(node) && !!node.attribute && node.type === "attribute";
3622
- var asAttributeNode = (node) => {
3623
- if (!node) {
3624
- throw error("Expected a query node");
3625
- }
3626
- if (!isAttributeNode(node)) {
3627
- throw error("Mismatching query node", {
3628
- wanted: "attribute",
3629
- found: node.type
3630
- });
3631
- }
3632
- return node;
3633
- };
3634
- var isClassNode = (node) => isObj(node) && !!node.value && node.type === "class";
3635
- var asClassNode = (node) => {
3636
- if (!node) {
3637
- throw error("Expected a query node");
3638
- }
3639
- if (!isClassNode(node)) {
3640
- throw error("Mismatching query node", {
3641
- wanted: "class",
3642
- found: node.type
3643
- });
3644
- }
3645
- return node;
3646
- };
3647
- var isCombinatorNode = (node) => isObj(node) && !!node.value && node.type === "combinator";
3648
- var asCombinatorNode = (node) => {
3649
- if (!node) {
3650
- throw error("Expected a query node");
3651
- }
3652
- if (!isCombinatorNode(node)) {
3653
- throw error("Mismatching query node", {
3654
- wanted: "combinator",
3655
- found: node.type
3656
- });
3657
- }
3658
- return node;
3659
- };
3660
- var isIdentifierNode = (node) => isObj(node) && !!node.value && node.type === "id";
3661
- var asIdentifierNode = (node) => {
3662
- if (!node) {
3663
- throw error("Expected a query node");
3664
- }
3665
- if (!isIdentifierNode(node)) {
3666
- throw error("Mismatching query node", {
3667
- wanted: "id",
3668
- found: node.type
3669
- });
3670
- }
3671
- return node;
3672
- };
3673
- var isSelectorNode = (node) => isPostcssNodeWithChildren(node) && node.type === "selector";
3674
- var isPseudoNode = (node) => isObj(node) && !!node.value && node.type === "pseudo";
3675
- var asPseudoNode = (node) => {
3676
- if (!node) {
3677
- throw error("Expected a query node");
3678
- }
3679
- if (!isPseudoNode(node)) {
3680
- throw error("Mismatching query node", {
3681
- wanted: "pseudo",
3682
- found: node.type
3683
- });
3684
- }
3685
- return node;
3686
- };
3687
- var isTagNode = (node) => isObj(node) && !!node.value && node.type === "tag";
3688
- var asTagNode = (node) => {
3689
- if (!node) {
3690
- throw error("Expected a query node");
3691
- }
3692
- if (!isTagNode(node)) {
3693
- throw error("Mismatching query node", {
3694
- wanted: "tag",
3695
- found: node.type
3696
- });
3697
- }
3698
- return node;
3699
- };
3700
- var isStringNode = (node) => isObj(node) && !!node.value && node.type === "string";
3701
- var asStringNode = (node) => {
3702
- if (!node) {
3703
- throw error("Expected a query node");
3704
- }
3705
- if (!isStringNode(node)) {
3706
- throw error("Mismatching query node", {
3707
- wanted: "string",
3708
- found: node.type
3709
- });
3710
- }
3711
- return node;
3712
- };
3713
-
3714
- // ../../src/query/src/attribute.ts
3715
- var jsonFieldToString = (v) => String(v);
3716
- var getManifestPropertyValues = (node, properties, attribute2) => {
3717
- if (!node.manifest) return;
3718
- const traverse = /* @__PURE__ */ new Set([node.manifest]);
3719
- const props = /* @__PURE__ */ new Set();
3720
- for (const key of properties) {
3721
- for (const prop of traverse) {
3722
- if (!prop) {
3723
- throw error("failed to find nested property in :attr", {
3724
- found: properties
3725
- });
3726
- }
3727
- if (Array.isArray(prop)) {
3728
- for (const p of prop) {
3729
- traverse.add(p);
3730
- }
3731
- continue;
3732
- }
3733
- if (typeof prop === "string" || typeof prop === "number" || typeof prop === "boolean") {
3734
- continue;
3735
- }
3736
- if (key in prop) {
3737
- const nextValue = prop[key];
3738
- if (nextValue) {
3739
- if (key === attribute2) {
3740
- props.add(nextValue);
3741
- } else {
3742
- traverse.delete(prop);
3743
- traverse.add(nextValue);
3744
- }
3745
- }
3746
- }
3747
- }
3748
- }
3749
- if (!props.size) return;
3750
- const collect = /* @__PURE__ */ new Set();
3751
- for (const prop of props) {
3752
- if (Array.isArray(prop)) {
3753
- for (const p of prop) {
3754
- collect.add(p ? jsonFieldToString(p) : "");
3755
- }
3756
- } else {
3757
- collect.add(jsonFieldToString(prop));
3758
- }
3759
- }
3760
- return [...collect];
3761
- };
3762
- var filterAttributes = (state, comparator, value, propertyName, insensitive, prefixProperties = []) => {
3763
- const check = (attr2) => comparator?.(
3764
- insensitive ? jsonFieldToString(attr2).toLowerCase() : jsonFieldToString(attr2),
3765
- insensitive ? value.toLowerCase() : value
3766
- );
3767
- const deleteNode = (node) => {
3768
- for (const edge of node.edgesIn) {
3769
- state.partial.edges.delete(edge);
3770
- }
3771
- state.partial.nodes.delete(node);
3772
- };
3773
- for (const node of state.partial.nodes) {
3774
- const prefixes = prefixProperties.length ? prefixProperties : [propertyName];
3775
- const attrs = getManifestPropertyValues(
3776
- node,
3777
- prefixes,
3778
- propertyName
3779
- );
3780
- if (!attrs?.length) {
3781
- deleteNode(node);
3782
- continue;
3783
- }
3784
- if (comparator && !attrs.some(check)) {
3785
- deleteNode(node);
3786
- }
3787
- }
3788
- for (const edge of state.partial.edges) {
3789
- if (propertyName === "name" && check(edge.name)) {
3790
- continue;
3791
- }
3792
- if (!edge.to) {
3793
- state.partial.edges.delete(edge);
3794
- }
3795
- }
3796
- return state;
3797
- };
3798
- var attributeSelectors = {
3799
- "=": (attr2, value = "") => attr2 === value,
3800
- "^=": (attr2, value = "") => attr2.startsWith(value),
3801
- "$=": (attr2, value = "") => attr2.endsWith(value),
3802
- "~=": (attr2, value = "") => new Set(attr2.match(/\w+/g)).has(value),
3803
- "*=": (attr2, value = "") => attr2.includes(value),
3804
- "|=": (attr2, value = "") => attr2 === value || attr2.startsWith(`${value}-`),
3805
- undefined: (attr2) => !!attr2
3806
- };
3807
- var attributeSelectorsMap = new Map(
3808
- Object.entries(attributeSelectors)
3809
- );
3810
- var attribute = async (state) => {
3811
- await state.cancellable();
3812
- const curr = asAttributeNode(state.current);
3813
- const operatorFn = attributeSelectorsMap.get(String(curr.operator));
3814
- if (!operatorFn) {
3815
- if (state.loose) {
3816
- return state;
3817
- }
3818
- throw new Error(
3819
- `Unsupported attribute operator: ${curr.operator}`
3820
- );
3821
- }
3822
- const value = curr.value || "";
3823
- const propertyName = curr.attribute;
3824
- const insensitive = !!curr.insensitive;
3825
- return filterAttributes(
3826
- state,
3827
- operatorFn,
3828
- value,
3829
- propertyName,
3830
- insensitive
3831
- );
3832
- };
3833
-
3834
- // ../../src/query/src/class.ts
3835
- var classSelectors = {
3836
- prod: async (state) => {
3837
- for (const edge of state.partial.edges) {
3838
- if (edge.type !== "prod" || edge.from.dev) {
3839
- state.partial.edges.delete(edge);
3840
- }
3841
- }
3842
- for (const node of state.partial.nodes) {
3843
- if (!node.edgesIn.size) {
3844
- state.partial.nodes.delete(node);
3845
- continue;
3846
- }
3847
- const iterator = new Set(node.edgesIn);
3848
- for (const edge of iterator) {
3849
- if (!state.partial.edges.has(edge)) {
3850
- iterator.delete(edge);
3851
- }
3852
- }
3853
- if (!iterator.size) {
3854
- state.partial.nodes.delete(node);
3855
- }
3856
- }
3857
- return state;
3858
- },
3859
- dev: async (state) => {
3860
- for (const edge of state.partial.edges) {
3861
- if (edge.type !== "dev" && !edge.from.dev) {
3862
- state.partial.edges.delete(edge);
3863
- }
3864
- }
3865
- for (const node of state.partial.nodes) {
3866
- if (!node.edgesIn.size) {
3867
- state.partial.nodes.delete(node);
3868
- continue;
3869
- }
3870
- const iterator = new Set(node.edgesIn);
3871
- for (const edge of iterator) {
3872
- if (!state.partial.edges.has(edge)) {
3873
- iterator.delete(edge);
3874
- }
3875
- }
3876
- if (!iterator.size) {
3877
- state.partial.nodes.delete(node);
3878
- }
3879
- }
3880
- return state;
3881
- },
3882
- optional: async (state) => {
3883
- for (const edge of state.partial.edges) {
3884
- if (edge.type !== "optional" && !edge.from.optional) {
3885
- state.partial.edges.delete(edge);
3886
- }
3887
- }
3888
- for (const node of state.partial.nodes) {
3889
- if (!node.edgesIn.size) {
3890
- state.partial.nodes.delete(node);
3891
- continue;
3892
- }
3893
- const iterator = new Set(node.edgesIn);
3894
- for (const edge of iterator) {
3895
- if (!state.partial.edges.has(edge)) {
3896
- iterator.delete(edge);
3897
- }
3898
- }
3899
- if (!iterator.size) {
3900
- state.partial.nodes.delete(node);
3901
- }
3902
- }
3903
- return state;
3904
- },
3905
- peer: async (state) => {
3906
- for (const edge of state.partial.edges) {
3907
- if (edge.type !== "peer") {
3908
- state.partial.edges.delete(edge);
3909
- }
3910
- }
3911
- for (const node of state.partial.nodes) {
3912
- if (!node.edgesIn.size) {
3913
- state.partial.nodes.delete(node);
3914
- continue;
3915
- }
3916
- for (const e of node.edgesIn) {
3917
- if (!state.partial.edges.has(e)) {
3918
- state.partial.nodes.delete(node);
3919
- }
3920
- }
3921
- }
3922
- return state;
3923
- },
3924
- workspace: async (state) => {
3925
- for (const node of state.partial.nodes) {
3926
- if (!node.importer || node.mainImporter) {
3927
- state.partial.nodes.delete(node);
3928
- }
3929
- }
3930
- for (const edge of state.partial.edges) {
3931
- if (!edge.to) {
3932
- state.partial.edges.delete(edge);
3933
- } else if (!state.partial.nodes.has(edge.to)) {
3934
- state.partial.edges.delete(edge);
3935
- }
3936
- }
3937
- return state;
3938
- }
3939
- // TBD: all things bundled
3940
- // bundled: () => false,
3941
- };
3942
- var classSelectorsMap = new Map(
3943
- Object.entries(classSelectors)
3944
- );
3945
- var classFn = async (state) => {
3946
- await state.cancellable();
3947
- const curr = asClassNode(state.current);
3948
- const comparatorFn = curr.value && classSelectorsMap.get(curr.value);
3949
- if (!comparatorFn) {
3950
- if (state.loose) {
3951
- return state;
3952
- }
3953
- throw new Error(`Unsupported class: ${state.current.value}`);
3954
- }
3955
- return comparatorFn(state);
3956
- };
3957
-
3958
- // ../../src/query/src/combinator.ts
3959
- var childCombinator = async (state) => {
3960
- const traverse = new Set(state.partial.nodes);
3961
- state.partial.edges.clear();
3962
- state.partial.nodes.clear();
3963
- for (const node of traverse) {
3964
- for (const edge of node.edgesOut.values()) {
3965
- if (edge.to) {
3966
- state.partial.edges.add(edge);
3967
- state.partial.nodes.add(edge.to);
3968
- }
3969
- }
3970
- }
3971
- return state;
3972
- };
3973
- var subsequentSiblingCombinator = async (state) => {
3974
- const traverse = new Set(state.partial.nodes);
3975
- state.partial.edges.clear();
3976
- state.partial.nodes.clear();
3977
- for (const node of traverse) {
3978
- for (const edge of node.edgesIn) {
3979
- const parents = edge.from.edgesOut.values();
3980
- for (const edge2 of parents) {
3981
- if (edge2.to && edge2.to !== node) {
3982
- state.partial.edges.add(edge2);
3983
- state.partial.nodes.add(edge2.to);
3984
- }
3985
- }
3986
- }
3987
- }
3988
- return state;
3989
- };
3990
- var descendentCombinator = async (state) => {
3991
- if (state.prev?.type === "tag" || state.next?.type === "tag") {
3992
- return state;
3993
- }
3994
- const traverse = new Set(state.partial.nodes);
3995
- state.partial.edges.clear();
3996
- state.partial.nodes.clear();
3997
- for (const node of traverse) {
3998
- const children = /* @__PURE__ */ new Set();
3999
- for (const edge of node.edgesOut.values()) {
4000
- if (edge.to) {
4001
- children.add(edge.to);
4002
- state.partial.edges.add(edge);
4003
- state.partial.nodes.add(edge.to);
4004
- }
4005
- }
4006
- for (const child of children) {
4007
- traverse.add(child);
4008
- }
4009
- }
4010
- return state;
4011
- };
4012
- var combinatorSelectors = {
4013
- ">": childCombinator,
4014
- "~": subsequentSiblingCombinator,
4015
- " ": descendentCombinator
4016
- };
4017
- var combinatorSelectorsMap = new Map(
4018
- Object.entries(combinatorSelectors)
4019
- );
4020
- var combinator = async (state) => {
4021
- await state.cancellable();
4022
- const curr = asCombinatorNode(state.current);
4023
- const parserFn = curr.value && combinatorSelectorsMap.get(curr.value);
4024
- if (!parserFn) {
4025
- if (state.loose) {
4026
- return state;
4027
- }
4028
- throw new Error(`Unsupported combinator: ${state.current.value}`);
4029
- }
4030
- return parserFn(state);
4031
- };
4032
-
4033
- // ../../src/query/src/id.ts
4034
- var id = async (state) => {
4035
- const { value } = asIdentifierNode(state.current);
4036
- const comparator = attributeSelectorsMap.get("=");
4037
- if (!value) {
4038
- throw error("Missing identifier name");
4039
- }
4040
- if (!comparator) {
4041
- throw error("Could not find attribute selector comparator");
4042
- }
4043
- return filterAttributes(state, comparator, value, "name", true);
4044
- };
4045
-
4046
- // ../../src/query/src/pseudo/attr.ts
4047
- var parseInternals = (nodes) => {
4048
- const attributeSelector = asAttributeNode(
4049
- asPostcssNodeWithChildren(nodes.pop()).nodes[0]
4050
- );
4051
- const properties = [];
4052
- for (const selector of nodes) {
4053
- properties.push(
4054
- asTagNode(asPostcssNodeWithChildren(selector).nodes[0]).value
4055
- );
4056
- }
4057
- properties.push(attributeSelector.attribute);
4058
- return {
4059
- attribute: attributeSelector.attribute,
4060
- insensitive: attributeSelector.insensitive || false,
4061
- operator: attributeSelector.operator,
4062
- value: attributeSelector.value,
4063
- properties
4064
- };
4065
- };
4066
- var attr = async (state) => {
4067
- let internals;
4068
- try {
4069
- internals = parseInternals(
4070
- asPostcssNodeWithChildren(state.current).nodes
4071
- );
4072
- } catch (err) {
4073
- throw error("Failed to parse :attr selector", {
4074
- cause: err
4075
- });
4076
- }
4077
- const comparator = internals.operator ? attributeSelectorsMap.get(internals.operator) : void 0;
4078
- const value = internals.value || "";
4079
- const propertyName = internals.attribute;
4080
- const insensitive = internals.insensitive;
4081
- const prefixProperties = internals.properties;
4082
- return filterAttributes(
4083
- state,
4084
- comparator,
4085
- value,
4086
- propertyName,
4087
- insensitive,
4088
- prefixProperties
4089
- );
4090
- };
4091
-
4092
- // ../../src/query/src/pseudo/helpers.ts
4093
- var removeNode = (state, node) => {
4094
- for (const edge of node.edgesIn) {
4095
- state.partial.edges.delete(edge);
4096
- }
4097
- state.partial.nodes.delete(node);
4098
- };
4099
- var removeDanglingEdges = (state) => {
4100
- for (const edge of state.partial.edges) {
4101
- if (!edge.to) {
4102
- state.partial.edges.delete(edge);
4103
- }
4104
- }
4105
- };
4106
- var removeQuotes = (value) => value.replace(/^"(.*?)"$/, "$1");
4107
-
4108
- // ../../src/query/src/pseudo/outdated.ts
4109
- var kinds = /* @__PURE__ */ new Set([
4110
- "any",
4111
- "major",
4112
- "minor",
4113
- "patch",
4114
- "in-range",
4115
- "out-of-range"
4116
- ]);
4117
- var isOutdatedKind = (value) => kinds.has(value);
4118
- var asOutdatedKind = (value) => {
4119
- if (!isOutdatedKind(value)) {
4120
- throw error("Expected a valid outdated kind", {
4121
- found: value,
4122
- validOptions: Array.from(kinds)
4123
- });
4124
- }
4125
- return value;
4126
- };
4127
- var retrieveRemoteVersions = async (node, specOptions) => {
4128
- const spec = hydrate(node.id, String(node.name), specOptions);
4129
- if (!spec.registry || !node.name) {
4130
- return [];
4131
- }
4132
- const url = new URL(spec.registry);
4133
- url.pathname = `/${node.name}`;
4134
- try {
4135
- const response = await fetch(String(url), {
4136
- headers: {
4137
- Accept: "application/vnd.npm.install-v1+json"
4138
- }
4139
- });
4140
- if (!response.ok) {
4141
- console.warn(
4142
- error("Failed to fetch packument", {
4143
- name: String(node.name),
4144
- spec,
4145
- response
4146
- })
4147
- );
4148
- return [];
4149
- }
4150
- const packument = await response.json();
4151
- return Object.keys(packument.versions).sort(compare);
4152
- } catch (e) {
4153
- const err = e;
4154
- console.warn(
4155
- error("Could not retrieve registry versions", {
4156
- name: String(node.name),
4157
- spec,
4158
- cause: err
4159
- })
4160
- );
4161
- return [];
4162
- }
4163
- };
4164
- var parseInternals2 = (nodes) => {
4165
- let kind = "any";
4166
- if (isStringNode(asPostcssNodeWithChildren(nodes[0]).nodes[0])) {
4167
- kind = asOutdatedKind(
4168
- removeQuotes(
4169
- asStringNode(asPostcssNodeWithChildren(nodes[0]).nodes[0]).value
4170
- )
4171
- );
4172
- } else if (isTagNode(asPostcssNodeWithChildren(nodes[0]).nodes[0])) {
4173
- kind = asOutdatedKind(
4174
- asTagNode(asPostcssNodeWithChildren(nodes[0]).nodes[0]).value
4175
- );
4176
- }
4177
- return { kind };
4178
- };
4179
- var queueNode = async (state, node, kind) => {
4180
- if (!node.name || !node.version) {
4181
- return node;
4182
- }
4183
- const nodeVersion = node.version;
4184
- const versions = await retrieveRemoteVersions(
4185
- node,
4186
- state.specOptions
4187
- );
4188
- const greaterVersions = versions.filter(
4189
- (version) => gt(version, nodeVersion)
4190
- );
4191
- if (!greaterVersions.length) {
4192
- return node;
4193
- }
4194
- const checkKind = /* @__PURE__ */ new Map([
4195
- ["major", major],
4196
- ["minor", minor],
4197
- ["patch", patch]
4198
- ]);
4199
- switch (kind) {
4200
- case "any":
4201
- return;
4202
- case "major":
4203
- case "minor":
4204
- case "patch": {
4205
- return greaterVersions.some((version) => {
4206
- const va = checkKind.get(kind)?.(version);
4207
- const vb = checkKind.get(kind)?.(nodeVersion);
4208
- if (va === void 0 || vb === void 0) return false;
4209
- return va > vb;
4210
- }) ? void 0 : node;
4211
- }
4212
- // the node should be part of the result as long as it has at least
4213
- // one parent node that has a spec definition that satisfies one
4214
- // of the available remove versions
4215
- case "in-range": {
4216
- for (const edge of node.edgesIn) {
4217
- if (!state.partial.edges.has(edge)) continue;
4218
- if (greaterVersions.some(
4219
- (version) => edge.spec.final.range && satisfies(version, edge.spec.final.range)
4220
- )) {
4221
- return;
4222
- }
4223
- }
4224
- return node;
4225
- }
4226
- // the node is part of the result as long as none of its parents has
4227
- // a spec definition that satisfies one of the available remote versions
4228
- case "out-of-range": {
4229
- for (const edge of node.edgesIn) {
4230
- if (!state.partial.edges.has(edge)) continue;
4231
- if (greaterVersions.some(
4232
- (version) => edge.spec.final.range && satisfies(version, edge.spec.final.range)
4233
- )) {
4234
- return node;
4235
- }
4236
- }
4237
- return;
4238
- }
4239
- }
4240
- };
4241
- var outdated = async (state) => {
4242
- let internals;
4243
- try {
4244
- internals = parseInternals2(
4245
- asPostcssNodeWithChildren(state.current).nodes
4246
- );
4247
- } catch (err) {
4248
- throw error("Failed to parse :outdated selector", {
4249
- cause: err
4250
- });
4251
- }
4252
- const { kind } = internals;
4253
- const queue = [];
4254
- for (const node of state.partial.nodes) {
4255
- if (node.mainImporter || node.manifest?.private || splitDepID(node.id)[0] !== "registry") {
4256
- removeNode(state, node);
4257
- continue;
4258
- }
4259
- queue.push(queueNode(state, node, kind));
4260
- }
4261
- const removeNodeQueue = await Promise.all(queue);
4262
- for (const node of removeNodeQueue) {
4263
- if (node) {
4264
- removeNode(state, node);
4265
- }
4266
- }
4267
- return state;
4268
- };
4269
-
4270
- // ../../src/query/src/pseudo/semver.ts
4271
- var semverFunctionNames = /* @__PURE__ */ new Set([
4272
- "satisfies",
4273
- "gt",
4274
- "gte",
4275
- "lt",
4276
- "lte",
4277
- "eq",
4278
- "neq"
4279
- ]);
4280
- var isSemverFunctionName = (name) => semverFunctionNames.has(name);
4281
- var asSemverFunctionName = (name) => {
4282
- if (!isSemverFunctionName(name)) {
4283
- throw error("Invalid semver function name", {
4284
- found: name,
4285
- validOptions: Array.from(semverFunctionNames)
4286
- });
4287
- }
4288
- return name;
4289
- };
4290
- var semverFunctions = /* @__PURE__ */ new Map([
4291
- ["satisfies", satisfies],
4292
- ["gt", gt],
4293
- ["gte", gte],
4294
- ["lt", lt],
4295
- ["lte", lte],
4296
- ["eq", eq],
4297
- ["neq", neq]
4298
- ]);
4299
- var unspacedCombinators = /* @__PURE__ */ new Set([" ", "+"]);
4300
- var parseInternals3 = (nodes, loose) => {
4301
- let semverValue;
4302
- try {
4303
- semverValue = removeQuotes(
4304
- asStringNode(asPostcssNodeWithChildren(nodes[0]).nodes[0]).value
4305
- );
4306
- } catch (e) {
4307
- const err = e;
4308
- if (err.message === "Mismatching query node") {
4309
- semverValue = "";
4310
- for (const node of asPostcssNodeWithChildren(nodes[0]).nodes) {
4311
- if (isClassNode(node)) {
4312
- semverValue += ".";
4313
- } else if (isCombinatorNode(node) && !unspacedCombinators.has(node.value)) {
4314
- semverValue += " ";
4315
- }
4316
- if (node.value) {
4317
- semverValue += node.value;
4318
- }
4319
- }
4320
- } else {
4321
- throw err;
4322
- }
4323
- }
4324
- let fnName = "satisfies";
4325
- try {
4326
- if (nodes[1]) {
4327
- try {
4328
- fnName = asSemverFunctionName(
4329
- removeQuotes(
4330
- asStringNode(asPostcssNodeWithChildren(nodes[1]).nodes[0]).value
4331
- )
4332
- );
4333
- } catch (e) {
4334
- const err = e;
4335
- if (err.message === "Mismatching query node") {
4336
- fnName = asSemverFunctionName(
4337
- asTagNode(asPostcssNodeWithChildren(nodes[1]).nodes[0]).value
4338
- );
4339
- } else {
4340
- throw err;
4341
- }
4342
- }
4343
- }
4344
- } catch (e) {
4345
- if (!loose) {
4346
- throw e;
4347
- }
4348
- }
4349
- const semverFunction = semverFunctions.get(fnName);
4350
- if (!semverFunction) {
4351
- throw error("Invalid semver function name", {
4352
- found: fnName,
4353
- validOptions: Array.from(semverFunctions.keys())
4354
- });
4355
- }
4356
- let compareAttribute;
4357
- if (nodes[2]) {
4358
- const parentNode = asPostcssNodeWithChildren(nodes[2]);
4359
- const currNode = parentNode.nodes[0];
4360
- if (isAttributeNode(currNode)) {
4361
- const { attribute: attribute2 } = asAttributeNode(currNode);
4362
- compareAttribute = {
4363
- attribute: attribute2,
4364
- properties: [attribute2]
4365
- };
4366
- } else if (isPseudoNode(currNode)) {
4367
- compareAttribute = parseInternals(
4368
- asPseudoNode(currNode).nodes
4369
- );
4370
- } else if (isStringNode(currNode)) {
4371
- const attribute2 = removeQuotes(asStringNode(currNode).value);
4372
- compareAttribute = {
4373
- attribute: attribute2,
4374
- properties: [attribute2]
4375
- };
4376
- }
4377
- }
4378
- return {
4379
- semverValue,
4380
- semverFunction,
4381
- compareAttribute
4382
- };
4383
- };
4384
- var semverParser = async (state) => {
4385
- let internals;
4386
- try {
4387
- internals = parseInternals3(
4388
- asPostcssNodeWithChildren(state.current).nodes,
4389
- !!state.loose
4390
- );
4391
- } catch (err) {
4392
- throw error("Failed to parse :semver selector", {
4393
- cause: err
4394
- });
4395
- }
4396
- const { semverValue, semverFunction, compareAttribute } = internals;
4397
- for (const node of state.partial.nodes) {
4398
- if (compareAttribute) {
4399
- const compareValues = getManifestPropertyValues(
4400
- node,
4401
- compareAttribute.properties,
4402
- compareAttribute.attribute
4403
- );
4404
- const compareValue = compareValues?.[0];
4405
- const semverValueVersion = parse(semverValue);
4406
- const compareValueRange = compareValue && parseRange(compareValue);
4407
- if (semverFunction === satisfies && semverValueVersion && compareValueRange) {
4408
- if (!satisfies(semverValueVersion, compareValueRange)) {
4409
- removeNode(state, node);
4410
- }
4411
- } else if (!compareValue || !semverFunction(compareValue, semverValue)) {
4412
- removeNode(state, node);
4413
- }
4414
- } else {
4415
- const manifestVersion = node.manifest?.version;
4416
- if (!manifestVersion || !semverFunction(manifestVersion, semverValue)) {
4417
- removeNode(state, node);
4418
- }
4419
- }
4420
- }
4421
- return state;
4422
- };
4423
-
4424
- // ../../src/query/src/pseudo.ts
4425
- var empty = async (state) => {
4426
- for (const node of state.partial.nodes) {
4427
- if (node.edgesOut.size > 0) {
4428
- removeNode(state, node);
4429
- }
4430
- }
4431
- return state;
4432
- };
4433
- var has = async (state) => {
4434
- const top = asPostcssNodeWithChildren(state.current);
4435
- const collectNodes = /* @__PURE__ */ new Set();
4436
- const collectEdges = /* @__PURE__ */ new Set();
4437
- for (const node of top.nodes) {
4438
- if (isSelectorNode(node)) {
4439
- const nestedState = await state.walk({
4440
- cancellable: state.cancellable,
4441
- initial: {
4442
- edges: new Set(state.initial.edges),
4443
- nodes: new Set(state.initial.nodes)
4444
- },
4445
- current: node,
4446
- walk: state.walk,
4447
- collect: {
4448
- edges: /* @__PURE__ */ new Set(),
4449
- nodes: /* @__PURE__ */ new Set()
4450
- },
4451
- partial: {
4452
- edges: new Set(state.partial.edges),
4453
- nodes: new Set(state.partial.nodes)
4454
- },
4455
- specOptions: state.specOptions
4456
- });
4457
- for (const n of nestedState.collect.nodes) {
4458
- collectNodes.add(n);
4459
- }
4460
- for (const e of nestedState.partial.edges) {
4461
- collectEdges.add(e);
4462
- }
4463
- }
4464
- }
4465
- if (collectNodes.size === 0) {
4466
- state.partial.edges.clear();
4467
- state.partial.nodes.clear();
4468
- return state;
4469
- }
4470
- const compareNodes = /* @__PURE__ */ new Set();
4471
- const traverse = new Set(collectNodes);
4472
- for (const node of traverse) {
4473
- for (const edge of node.edgesIn) {
4474
- compareNodes.add(edge.from);
4475
- if (edge.from.edgesIn.size) {
4476
- traverse.add(edge.from);
4477
- }
4478
- }
4479
- }
4480
- nodesLoop: for (const node of state.partial.nodes) {
4481
- if (node.edgesOut.size === 0 || !compareNodes.has(node)) {
4482
- removeNode(state, node);
4483
- continue;
4484
- }
4485
- for (const edge of node.edgesOut.values()) {
4486
- if (collectEdges.has(edge)) {
4487
- continue nodesLoop;
4488
- }
4489
- }
4490
- removeNode(state, node);
4491
- }
4492
- removeDanglingEdges(state);
4493
- return state;
4494
- };
4495
- var is = async (state) => {
4496
- const top = asPostcssNodeWithChildren(state.current);
4497
- const collect = /* @__PURE__ */ new Set();
4498
- for (const node of top.nodes) {
4499
- if (isSelectorNode(node)) {
4500
- const nestedState = await state.walk({
4501
- cancellable: state.cancellable,
4502
- collect: {
4503
- edges: /* @__PURE__ */ new Set(),
4504
- nodes: /* @__PURE__ */ new Set()
4505
- },
4506
- current: node,
4507
- initial: state.initial,
4508
- loose: true,
4509
- partial: {
4510
- nodes: new Set(state.partial.nodes),
4511
- edges: new Set(state.partial.edges)
4512
- },
4513
- walk: state.walk,
4514
- specOptions: state.specOptions
4515
- });
4516
- for (const n of nestedState.collect.nodes) {
4517
- collect.add(n);
4518
- }
4519
- }
4520
- }
4521
- for (const node of state.partial.nodes) {
4522
- if (!collect.has(node)) {
4523
- removeNode(state, node);
4524
- }
4525
- }
4526
- return state;
4527
- };
4528
- var missing = async (state) => {
4529
- for (const edge of state.partial.edges) {
4530
- if (edge.to) {
4531
- state.partial.edges.delete(edge);
4532
- }
4533
- }
4534
- state.partial.nodes.clear();
4535
- return state;
4536
- };
4537
- var not = async (state) => {
4538
- const top = asPostcssNodeWithChildren(state.current);
4539
- const collect = /* @__PURE__ */ new Set();
4540
- for (const node of top.nodes) {
4541
- if (isSelectorNode(node)) {
4542
- const nestedState = await state.walk({
4543
- cancellable: state.cancellable,
4544
- collect: {
4545
- edges: /* @__PURE__ */ new Set(),
4546
- nodes: /* @__PURE__ */ new Set()
4547
- },
4548
- current: node,
4549
- initial: state.initial,
4550
- partial: {
4551
- nodes: new Set(state.partial.nodes),
4552
- edges: new Set(state.partial.edges)
4553
- },
4554
- walk: state.walk,
4555
- specOptions: state.specOptions
4556
- });
4557
- for (const n of nestedState.collect.nodes) {
4558
- collect.add(n);
4559
- }
4560
- } else {
4561
- throw error("Error parsing :not() selectors", {
4562
- wanted: { type: "selector" },
4563
- found: node
4564
- });
4565
- }
4566
- }
4567
- for (const node of state.partial.nodes) {
4568
- if (collect.has(node)) {
4569
- removeNode(state, node);
4570
- }
4571
- }
4572
- return state;
4573
- };
4574
- var privateFn = async (state) => {
4575
- for (const node of state.partial.nodes) {
4576
- if (!node.manifest || !asManifest(node.manifest).private) {
4577
- removeNode(state, node);
4578
- }
4579
- }
4580
- removeDanglingEdges(state);
4581
- return state;
4582
- };
4583
- var root = async (state) => {
4584
- const [anyNode] = state.initial.nodes.values();
4585
- const mainImporter = anyNode?.graph.mainImporter;
4586
- if (!mainImporter) {
4587
- throw error(":root pseudo-element works on local graphs only");
4588
- }
4589
- for (const edge of state.partial.edges) {
4590
- if (edge.to !== mainImporter) {
4591
- state.partial.edges.delete(edge);
4592
- }
4593
- }
4594
- state.partial.nodes.clear();
4595
- state.partial.nodes.add(mainImporter);
4596
- return state;
4597
- };
4598
- var project = async (state) => {
4599
- const [anyNode] = state.initial.nodes.values();
4600
- const importers = anyNode?.graph.importers;
4601
- if (!importers?.size) {
4602
- throw error(":project pseudo-element works on local graphs only");
4603
- }
4604
- const importersEdgesIn = /* @__PURE__ */ new Set();
4605
- for (const importer of importers) {
4606
- for (const edge of importer.edgesIn) {
4607
- importersEdgesIn.add(edge);
4608
- }
4609
- }
4610
- for (const edge of state.partial.edges) {
4611
- if (!edge.to || !importersEdgesIn.has(edge)) {
4612
- state.partial.edges.delete(edge);
4613
- }
4614
- }
4615
- state.partial.nodes.clear();
4616
- for (const importer of importers) {
4617
- state.partial.nodes.add(importer);
4618
- }
4619
- return state;
4620
- };
4621
- var scope = async (state) => {
4622
- state.partial.edges.clear();
4623
- state.partial.nodes.clear();
4624
- for (const edge of state.initial.edges) {
4625
- state.partial.edges.add(edge);
4626
- }
4627
- for (const node of state.initial.nodes) {
4628
- state.partial.nodes.add(node);
4629
- }
4630
- return state;
4631
- };
4632
- var typeFn = async (state) => {
4633
- const type = asPostcssNodeWithChildren(state.current);
4634
- const selector = asPostcssNodeWithChildren(type.nodes[0]);
4635
- const name = asTagNode(selector.nodes[0]).value;
4636
- for (const node of state.partial.nodes) {
4637
- const nodeType = splitDepID(node.id)[0];
4638
- if (nodeType !== name) {
4639
- removeNode(state, node);
4640
- }
4641
- }
4642
- return state;
4643
- };
4644
- var pseudoSelectors = new Map(
4645
- Object.entries({
4646
- attr,
4647
- empty,
4648
- has,
4649
- is,
4650
- // TODO: link
4651
- missing,
4652
- not,
4653
- // TODO: overridden
4654
- private: privateFn,
4655
- project,
4656
- root,
4657
- scope,
4658
- type: typeFn,
4659
- semver: semverParser,
4660
- outdated
4661
- })
4662
- );
4663
- var pseudo = async (state) => {
4664
- await state.cancellable();
4665
- const curr = asPseudoNode(state.current);
4666
- const parserFn = curr.value && pseudoSelectors.get(curr.value.slice(1));
4667
- if (!parserFn) {
4668
- if (state.loose) {
4669
- return state;
4670
- }
4671
- throw new Error(
4672
- `Unsupported pseudo-class: ${state.current.value}`
4673
- );
4674
- }
4675
- return parserFn(state);
4676
- };
4677
-
4678
- // ../../src/query/src/index.ts
4679
- var noopFn = async (state) => state;
4680
- var selectors = {
4681
- attribute,
4682
- class: classFn,
4683
- combinator,
4684
- comment: noopFn,
4685
- id,
4686
- nesting: noopFn,
4687
- pseudo,
4688
- root: noopFn,
4689
- selector: async (state) => {
4690
- state.partial.nodes = new Set(state.initial.nodes);
4691
- state.partial.edges = new Set(state.initial.edges);
4692
- return state;
4693
- },
4694
- string: async (state) => {
4695
- throw error("Unsupported selector", { found: state.current });
4696
- },
4697
- tag: async (state) => {
4698
- if (state.current.value !== "{" && state.current.value !== "}") {
4699
- throw error("Unsupported selector", { found: state.current });
4700
- }
4701
- return state;
4702
- },
4703
- universal: noopFn
4704
- };
4705
- var selectorsMap = new Map(
4706
- Object.entries(selectors)
4707
- );
4708
- var walk = async (state) => {
4709
- await state.cancellable();
4710
- const parserFn = selectorsMap.get(state.current.type);
4711
- if (!parserFn) {
4712
- if (state.loose) {
4713
- return state;
4714
- }
4715
- throw new Error(
4716
- `Missing parser for query node: ${state.current.type}`
4717
- );
4718
- }
4719
- state = await parserFn(state);
4720
- if (isPostcssNodeWithChildren(state.current) && state.current.type !== "pseudo") {
4721
- const node = asPostcssNodeWithChildren(
4722
- state.current
4723
- );
4724
- if (node.nodes.length) {
4725
- for (let i = 0; i < node.nodes.length; i++) {
4726
- const current = node.nodes[i];
4727
- if (!current) continue;
4728
- const childState = {
4729
- ...state,
4730
- current,
4731
- next: node.nodes[i + 1],
4732
- prev: node.nodes[i - 1]
4733
- };
4734
- state = await walk(childState);
4735
- }
4736
- }
4737
- if (isSelectorNode(node)) {
4738
- for (const edge of state.partial.edges) {
4739
- state.collect.edges.add(edge);
4740
- }
4741
- for (const node2 of state.partial.nodes) {
4742
- state.collect.nodes.add(node2);
4743
- }
4744
- }
4745
- }
4746
- return state;
4747
- };
4748
- var Query = class {
4749
- #cache;
4750
- #graph;
4751
- #specOptions;
4752
- constructor({ graph, specOptions }) {
4753
- this.#cache = /* @__PURE__ */ new Map();
4754
- this.#graph = graph;
4755
- this.#specOptions = specOptions;
4756
- }
4757
- async search(query, signal) {
4758
- if (typeof query !== "string") {
4759
- throw new TypeError(
4760
- "Query search argument needs to be a string"
4761
- );
4762
- }
4763
- if (!query) return { edges: [], nodes: [] };
4764
- const cachedResult = this.#cache.get(query);
4765
- if (cachedResult) {
4766
- return cachedResult;
4767
- }
4768
- const nodes = new Set(
4769
- Array.from(this.#graph.nodes.values())
4770
- );
4771
- const edges = new Set(Array.from(this.#graph.edges));
4772
- const { collect } = await walk({
4773
- cancellable: async () => {
4774
- await new Promise((resolve) => {
4775
- setTimeout(resolve, 0);
4776
- });
4777
- signal?.throwIfAborted();
4778
- },
4779
- current: (0, import_postcss_selector_parser.default)().astSync(query),
4780
- initial: {
4781
- nodes: new Set(nodes),
4782
- edges: new Set(edges)
4783
- },
4784
- collect: {
4785
- nodes: /* @__PURE__ */ new Set(),
4786
- edges: /* @__PURE__ */ new Set()
4787
- },
4788
- partial: { nodes, edges },
4789
- signal,
4790
- specOptions: this.#specOptions,
4791
- walk
4792
- });
4793
- const res = {
4794
- edges: Array.from(collect.edges),
4795
- nodes: Array.from(collect.nodes)
4796
- };
4797
- this.#cache.set(query, res);
4798
- return res;
4799
- }
4800
- };
4801
-
4802
- export {
4803
- Query
4804
- };
4805
- /*! Bundled license information:
4806
-
4807
- cssesc/cssesc.js:
4808
- (*! https://mths.be/cssesc v3.0.0 by @mathias *)
4809
- */
4810
- //# sourceMappingURL=chunk-PGDJ2ZZ6.js.map