@mgdis/core-ui-helpers 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +17 -17
  2. package/CHANGELOG.md +13 -0
  3. package/dist/locale/index.cjs +24 -0
  4. package/dist/locale/index.cjs.map +1 -1
  5. package/dist/locale/index.d.ts +8 -1
  6. package/dist/locale/index.js +24 -1
  7. package/dist/locale/index.js.map +1 -1
  8. package/dist/locale/index.umd.js +24 -0
  9. package/dist/locale/index.umd.js.map +1 -1
  10. package/dist/playwright/index.cjs +2 -2
  11. package/dist/playwright/index.cjs.map +1 -1
  12. package/dist/playwright/index.js +2 -2
  13. package/dist/playwright/index.js.map +1 -1
  14. package/dist/playwright/index.umd.js +2 -2
  15. package/dist/playwright/index.umd.js.map +1 -1
  16. package/dist/stencil/index.cjs +1595 -1
  17. package/dist/stencil/index.cjs.map +1 -1
  18. package/dist/stencil/index.js +1595 -1
  19. package/dist/stencil/index.js.map +1 -1
  20. package/dist/stencil/index.umd.js +1595 -1
  21. package/dist/stencil/index.umd.js.map +1 -1
  22. package/dist/storybook/index.cjs +1633 -18
  23. package/dist/storybook/index.cjs.map +1 -1
  24. package/dist/storybook/index.js +1633 -18
  25. package/dist/storybook/index.js.map +1 -1
  26. package/dist/storybook/index.umd.js +1633 -18
  27. package/dist/storybook/index.umd.js.map +1 -1
  28. package/dist/vue/index.cjs.map +1 -1
  29. package/dist/vue/index.js.map +1 -1
  30. package/dist/vue/index.umd.js.map +1 -1
  31. package/package.json +15 -16
  32. package/rollup.config.mjs +1 -1
  33. package/src/locale/index.spec.ts +2 -1
  34. package/src/locale/locale.spec.ts +94 -1
  35. package/src/locale/locale.ts +27 -0
  36. package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +4 -4
  37. package/src/playwright/utils/utils.spec.ts +1 -1
  38. package/src/playwright/utils/utils.ts +2 -2
  39. package/src/stencil/ide/ide.spec.ts +5 -1
  40. package/src/stencil/index.spec.ts +5 -1
  41. package/src/storybook/index.spec.ts +5 -1
  42. package/src/storybook/stencil/stencil.spec.ts +4 -0
  43. package/src/tests/unit/__snapshots__/unit.spec.ts.snap +4 -4
  44. package/src/utils/components/__snapshots__/components.spec.ts.snap +1 -1
@@ -7,13 +7,254 @@ var BUILD = {
7
7
  };
8
8
 
9
9
  /*
10
- Stencil Client Platform v4.38.0 | MIT Licensed | https://stenciljs.com
10
+ Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
11
11
  */
12
+ var __create = Object.create;
12
13
  var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __typeError = (msg) => {
19
+ throw TypeError(msg);
20
+ };
21
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
+ var __commonJS = (cb, mod) => function __require() {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ };
13
25
  var __export = (target, all) => {
14
26
  for (var name in all)
15
27
  __defProp(target, name, { get: all[name], enumerable: true });
16
28
  };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
43
+ mod
44
+ ));
45
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
46
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
47
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
48
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
49
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
50
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
51
+
52
+ // node_modules/balanced-match/index.js
53
+ var require_balanced_match = __commonJS({
54
+ "node_modules/balanced-match/index.js"(exports$1, module) {
55
+ module.exports = balanced;
56
+ function balanced(a, b, str) {
57
+ if (a instanceof RegExp) a = maybeMatch(a, str);
58
+ if (b instanceof RegExp) b = maybeMatch(b, str);
59
+ var r = range(a, b, str);
60
+ return r && {
61
+ start: r[0],
62
+ end: r[1],
63
+ pre: str.slice(0, r[0]),
64
+ body: str.slice(r[0] + a.length, r[1]),
65
+ post: str.slice(r[1] + b.length)
66
+ };
67
+ }
68
+ function maybeMatch(reg, str) {
69
+ var m = str.match(reg);
70
+ return m ? m[0] : null;
71
+ }
72
+ balanced.range = range;
73
+ function range(a, b, str) {
74
+ var begs, beg, left, right, result;
75
+ var ai = str.indexOf(a);
76
+ var bi = str.indexOf(b, ai + 1);
77
+ var i2 = ai;
78
+ if (ai >= 0 && bi > 0) {
79
+ if (a === b) {
80
+ return [ai, bi];
81
+ }
82
+ begs = [];
83
+ left = str.length;
84
+ while (i2 >= 0 && !result) {
85
+ if (i2 == ai) {
86
+ begs.push(i2);
87
+ ai = str.indexOf(a, i2 + 1);
88
+ } else if (begs.length == 1) {
89
+ result = [begs.pop(), bi];
90
+ } else {
91
+ beg = begs.pop();
92
+ if (beg < left) {
93
+ left = beg;
94
+ right = bi;
95
+ }
96
+ bi = str.indexOf(b, i2 + 1);
97
+ }
98
+ i2 = ai < bi && ai >= 0 ? ai : bi;
99
+ }
100
+ if (begs.length) {
101
+ result = [left, right];
102
+ }
103
+ }
104
+ return result;
105
+ }
106
+ }
107
+ });
108
+
109
+ // node_modules/brace-expansion/index.js
110
+ var require_brace_expansion = __commonJS({
111
+ "node_modules/brace-expansion/index.js"(exports$1, module) {
112
+ var balanced = require_balanced_match();
113
+ module.exports = expandTop;
114
+ var escSlash = "\0SLASH" + Math.random() + "\0";
115
+ var escOpen = "\0OPEN" + Math.random() + "\0";
116
+ var escClose = "\0CLOSE" + Math.random() + "\0";
117
+ var escComma = "\0COMMA" + Math.random() + "\0";
118
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
119
+ function numeric(str) {
120
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
121
+ }
122
+ function escapeBraces(str) {
123
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
124
+ }
125
+ function unescapeBraces(str) {
126
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
127
+ }
128
+ function parseCommaParts(str) {
129
+ if (!str)
130
+ return [""];
131
+ var parts = [];
132
+ var m = balanced("{", "}", str);
133
+ if (!m)
134
+ return str.split(",");
135
+ var pre = m.pre;
136
+ var body = m.body;
137
+ var post = m.post;
138
+ var p = pre.split(",");
139
+ p[p.length - 1] += "{" + body + "}";
140
+ var postParts = parseCommaParts(post);
141
+ if (post.length) {
142
+ p[p.length - 1] += postParts.shift();
143
+ p.push.apply(p, postParts);
144
+ }
145
+ parts.push.apply(parts, p);
146
+ return parts;
147
+ }
148
+ function expandTop(str) {
149
+ if (!str)
150
+ return [];
151
+ if (str.substr(0, 2) === "{}") {
152
+ str = "\\{\\}" + str.substr(2);
153
+ }
154
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
155
+ }
156
+ function embrace(str) {
157
+ return "{" + str + "}";
158
+ }
159
+ function isPadded(el) {
160
+ return /^-?0\d/.test(el);
161
+ }
162
+ function lte(i2, y) {
163
+ return i2 <= y;
164
+ }
165
+ function gte(i2, y) {
166
+ return i2 >= y;
167
+ }
168
+ function expand2(str, isTop) {
169
+ var expansions = [];
170
+ var m = balanced("{", "}", str);
171
+ if (!m) return [str];
172
+ var pre = m.pre;
173
+ var post = m.post.length ? expand2(m.post, false) : [""];
174
+ if (/\$$/.test(m.pre)) {
175
+ for (var k = 0; k < post.length; k++) {
176
+ var expansion = pre + "{" + m.body + "}" + post[k];
177
+ expansions.push(expansion);
178
+ }
179
+ } else {
180
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
181
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
182
+ var isSequence = isNumericSequence || isAlphaSequence;
183
+ var isOptions = m.body.indexOf(",") >= 0;
184
+ if (!isSequence && !isOptions) {
185
+ if (m.post.match(/,(?!,).*\}/)) {
186
+ str = m.pre + "{" + m.body + escClose + m.post;
187
+ return expand2(str);
188
+ }
189
+ return [str];
190
+ }
191
+ var n;
192
+ if (isSequence) {
193
+ n = m.body.split(/\.\./);
194
+ } else {
195
+ n = parseCommaParts(m.body);
196
+ if (n.length === 1) {
197
+ n = expand2(n[0], false).map(embrace);
198
+ if (n.length === 1) {
199
+ return post.map(function(p) {
200
+ return m.pre + n[0] + p;
201
+ });
202
+ }
203
+ }
204
+ }
205
+ var N;
206
+ if (isSequence) {
207
+ var x = numeric(n[0]);
208
+ var y = numeric(n[1]);
209
+ var width = Math.max(n[0].length, n[1].length);
210
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
211
+ var test = lte;
212
+ var reverse = y < x;
213
+ if (reverse) {
214
+ incr *= -1;
215
+ test = gte;
216
+ }
217
+ var pad = n.some(isPadded);
218
+ N = [];
219
+ for (var i2 = x; test(i2, y); i2 += incr) {
220
+ var c;
221
+ if (isAlphaSequence) {
222
+ c = String.fromCharCode(i2);
223
+ if (c === "\\")
224
+ c = "";
225
+ } else {
226
+ c = String(i2);
227
+ if (pad) {
228
+ var need = width - c.length;
229
+ if (need > 0) {
230
+ var z = new Array(need + 1).join("0");
231
+ if (i2 < 0)
232
+ c = "-" + z + c.slice(1);
233
+ else
234
+ c = z + c;
235
+ }
236
+ }
237
+ }
238
+ N.push(c);
239
+ }
240
+ } else {
241
+ N = [];
242
+ for (var j = 0; j < n.length; j++) {
243
+ N.push.apply(N, expand2(n[j], false));
244
+ }
245
+ }
246
+ for (var j = 0; j < N.length; j++) {
247
+ for (var k = 0; k < post.length; k++) {
248
+ var expansion = pre + N[j] + post[k];
249
+ if (!isTop || isSequence || expansion)
250
+ expansions.push(expansion);
251
+ }
252
+ }
253
+ }
254
+ return expansions;
255
+ }
256
+ }
257
+ });
17
258
 
18
259
  // src/utils/constants.ts
19
260
  var SVG_NS = "http://www.w3.org/2000/svg";
@@ -38,6 +279,1359 @@ var isComplexType = (o) => {
38
279
  return o === "object" || o === "function";
39
280
  };
40
281
 
282
+ // node_modules/minimatch/dist/esm/index.js
283
+ var import_brace_expansion = __toESM(require_brace_expansion());
284
+
285
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
286
+ var MAX_PATTERN_LENGTH = 1024 * 64;
287
+ var assertValidPattern = (pattern) => {
288
+ if (typeof pattern !== "string") {
289
+ throw new TypeError("invalid pattern");
290
+ }
291
+ if (pattern.length > MAX_PATTERN_LENGTH) {
292
+ throw new TypeError("pattern is too long");
293
+ }
294
+ };
295
+
296
+ // node_modules/minimatch/dist/esm/brace-expressions.js
297
+ var posixClasses = {
298
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
299
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
300
+ "[:ascii:]": ["\\x00-\\x7f", false],
301
+ "[:blank:]": ["\\p{Zs}\\t", true],
302
+ "[:cntrl:]": ["\\p{Cc}", true],
303
+ "[:digit:]": ["\\p{Nd}", true],
304
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
305
+ "[:lower:]": ["\\p{Ll}", true],
306
+ "[:print:]": ["\\p{C}", true],
307
+ "[:punct:]": ["\\p{P}", true],
308
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
309
+ "[:upper:]": ["\\p{Lu}", true],
310
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
311
+ "[:xdigit:]": ["A-Fa-f0-9", false]
312
+ };
313
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
314
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
315
+ var rangesToString = (ranges) => ranges.join("");
316
+ var parseClass = (glob, position) => {
317
+ const pos = position;
318
+ if (glob.charAt(pos) !== "[") {
319
+ throw new Error("not in a brace expression");
320
+ }
321
+ const ranges = [];
322
+ const negs = [];
323
+ let i2 = pos + 1;
324
+ let sawStart = false;
325
+ let uflag = false;
326
+ let escaping = false;
327
+ let negate = false;
328
+ let endPos = pos;
329
+ let rangeStart = "";
330
+ WHILE: while (i2 < glob.length) {
331
+ const c = glob.charAt(i2);
332
+ if ((c === "!" || c === "^") && i2 === pos + 1) {
333
+ negate = true;
334
+ i2++;
335
+ continue;
336
+ }
337
+ if (c === "]" && sawStart && !escaping) {
338
+ endPos = i2 + 1;
339
+ break;
340
+ }
341
+ sawStart = true;
342
+ if (c === "\\") {
343
+ if (!escaping) {
344
+ escaping = true;
345
+ i2++;
346
+ continue;
347
+ }
348
+ }
349
+ if (c === "[" && !escaping) {
350
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
351
+ if (glob.startsWith(cls, i2)) {
352
+ if (rangeStart) {
353
+ return ["$.", false, glob.length - pos, true];
354
+ }
355
+ i2 += cls.length;
356
+ if (neg)
357
+ negs.push(unip);
358
+ else
359
+ ranges.push(unip);
360
+ uflag = uflag || u;
361
+ continue WHILE;
362
+ }
363
+ }
364
+ }
365
+ escaping = false;
366
+ if (rangeStart) {
367
+ if (c > rangeStart) {
368
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
369
+ } else if (c === rangeStart) {
370
+ ranges.push(braceEscape(c));
371
+ }
372
+ rangeStart = "";
373
+ i2++;
374
+ continue;
375
+ }
376
+ if (glob.startsWith("-]", i2 + 1)) {
377
+ ranges.push(braceEscape(c + "-"));
378
+ i2 += 2;
379
+ continue;
380
+ }
381
+ if (glob.startsWith("-", i2 + 1)) {
382
+ rangeStart = c;
383
+ i2 += 2;
384
+ continue;
385
+ }
386
+ ranges.push(braceEscape(c));
387
+ i2++;
388
+ }
389
+ if (endPos < i2) {
390
+ return ["", false, 0, false];
391
+ }
392
+ if (!ranges.length && !negs.length) {
393
+ return ["$.", false, glob.length - pos, true];
394
+ }
395
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
396
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
397
+ return [regexpEscape(r), false, endPos - pos, false];
398
+ }
399
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
400
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
401
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
402
+ return [comb, uflag, endPos - pos, true];
403
+ };
404
+
405
+ // node_modules/minimatch/dist/esm/unescape.js
406
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
407
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
408
+ };
409
+
410
+ // node_modules/minimatch/dist/esm/ast.js
411
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
412
+ var isExtglobType = (c) => types.has(c);
413
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
414
+ var startNoDot = "(?!\\.)";
415
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
416
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
417
+ var reSpecials = new Set("().*{}+?[]^$\\!");
418
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
419
+ var qmark = "[^/]";
420
+ var star = qmark + "*?";
421
+ var starNoEmpty = qmark + "+?";
422
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
423
+ var _AST = class _AST {
424
+ constructor(type, parent, options = {}) {
425
+ __privateAdd(this, _AST_instances);
426
+ __publicField(this, "type");
427
+ __privateAdd(this, _root);
428
+ __privateAdd(this, _hasMagic);
429
+ __privateAdd(this, _uflag, false);
430
+ __privateAdd(this, _parts, []);
431
+ __privateAdd(this, _parent);
432
+ __privateAdd(this, _parentIndex);
433
+ __privateAdd(this, _negs);
434
+ __privateAdd(this, _filledNegs, false);
435
+ __privateAdd(this, _options);
436
+ __privateAdd(this, _toString);
437
+ // set to true if it's an extglob with no children
438
+ // (which really means one child of '')
439
+ __privateAdd(this, _emptyExt, false);
440
+ this.type = type;
441
+ if (type)
442
+ __privateSet(this, _hasMagic, true);
443
+ __privateSet(this, _parent, parent);
444
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
445
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
446
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
447
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
448
+ __privateGet(this, _negs).push(this);
449
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
450
+ }
451
+ get hasMagic() {
452
+ if (__privateGet(this, _hasMagic) !== void 0)
453
+ return __privateGet(this, _hasMagic);
454
+ for (const p of __privateGet(this, _parts)) {
455
+ if (typeof p === "string")
456
+ continue;
457
+ if (p.type || p.hasMagic)
458
+ return __privateSet(this, _hasMagic, true);
459
+ }
460
+ return __privateGet(this, _hasMagic);
461
+ }
462
+ // reconstructs the pattern
463
+ toString() {
464
+ if (__privateGet(this, _toString) !== void 0)
465
+ return __privateGet(this, _toString);
466
+ if (!this.type) {
467
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
468
+ } else {
469
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
470
+ }
471
+ }
472
+ push(...parts) {
473
+ for (const p of parts) {
474
+ if (p === "")
475
+ continue;
476
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
477
+ throw new Error("invalid part: " + p);
478
+ }
479
+ __privateGet(this, _parts).push(p);
480
+ }
481
+ }
482
+ toJSON() {
483
+ var _a;
484
+ const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
485
+ if (this.isStart() && !this.type)
486
+ ret.unshift([]);
487
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
488
+ ret.push({});
489
+ }
490
+ return ret;
491
+ }
492
+ isStart() {
493
+ var _a;
494
+ if (__privateGet(this, _root) === this)
495
+ return true;
496
+ if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
497
+ return false;
498
+ if (__privateGet(this, _parentIndex) === 0)
499
+ return true;
500
+ const p = __privateGet(this, _parent);
501
+ for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
502
+ const pp = __privateGet(p, _parts)[i2];
503
+ if (!(pp instanceof _AST && pp.type === "!")) {
504
+ return false;
505
+ }
506
+ }
507
+ return true;
508
+ }
509
+ isEnd() {
510
+ var _a, _b, _c;
511
+ if (__privateGet(this, _root) === this)
512
+ return true;
513
+ if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
514
+ return true;
515
+ if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
516
+ return false;
517
+ if (!this.type)
518
+ return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
519
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
520
+ return __privateGet(this, _parentIndex) === pl - 1;
521
+ }
522
+ copyIn(part) {
523
+ if (typeof part === "string")
524
+ this.push(part);
525
+ else
526
+ this.push(part.clone(this));
527
+ }
528
+ clone(parent) {
529
+ const c = new _AST(this.type, parent);
530
+ for (const p of __privateGet(this, _parts)) {
531
+ c.copyIn(p);
532
+ }
533
+ return c;
534
+ }
535
+ static fromGlob(pattern, options = {}) {
536
+ var _a;
537
+ const ast = new _AST(null, void 0, options);
538
+ __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
539
+ return ast;
540
+ }
541
+ // returns the regular expression if there's magic, or the unescaped
542
+ // string if not.
543
+ toMMPattern() {
544
+ if (this !== __privateGet(this, _root))
545
+ return __privateGet(this, _root).toMMPattern();
546
+ const glob = this.toString();
547
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
548
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
549
+ if (!anyMagic) {
550
+ return body;
551
+ }
552
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
553
+ return Object.assign(new RegExp(`^${re}$`, flags), {
554
+ _src: re,
555
+ _glob: glob
556
+ });
557
+ }
558
+ get options() {
559
+ return __privateGet(this, _options);
560
+ }
561
+ // returns the string match, the regexp source, whether there's magic
562
+ // in the regexp (so a regular expression is required) and whether or
563
+ // not the uflag is needed for the regular expression (for posix classes)
564
+ // TODO: instead of injecting the start/end at this point, just return
565
+ // the BODY of the regexp, along with the start/end portions suitable
566
+ // for binding the start/end in either a joined full-path makeRe context
567
+ // (where we bind to (^|/), or a standalone matchPart context (where
568
+ // we bind to ^, and not /). Otherwise slashes get duped!
569
+ //
570
+ // In part-matching mode, the start is:
571
+ // - if not isStart: nothing
572
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
573
+ // - if dots allowed or not possible: ^
574
+ // - if dots possible and not allowed: ^(?!\.)
575
+ // end is:
576
+ // - if not isEnd(): nothing
577
+ // - else: $
578
+ //
579
+ // In full-path matching mode, we put the slash at the START of the
580
+ // pattern, so start is:
581
+ // - if first pattern: same as part-matching mode
582
+ // - if not isStart(): nothing
583
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
584
+ // - if dots allowed or not possible: /
585
+ // - if dots possible and not allowed: /(?!\.)
586
+ // end is:
587
+ // - if last pattern, same as part-matching mode
588
+ // - else nothing
589
+ //
590
+ // Always put the (?:$|/) on negated tails, though, because that has to be
591
+ // there to bind the end of the negated pattern portion, and it's easier to
592
+ // just stick it in now rather than try to inject it later in the middle of
593
+ // the pattern.
594
+ //
595
+ // We can just always return the same end, and leave it up to the caller
596
+ // to know whether it's going to be used joined or in parts.
597
+ // And, if the start is adjusted slightly, can do the same there:
598
+ // - if not isStart: nothing
599
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
600
+ // - if dots allowed or not possible: (?:/|^)
601
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
602
+ //
603
+ // But it's better to have a simpler binding without a conditional, for
604
+ // performance, so probably better to return both start options.
605
+ //
606
+ // Then the caller just ignores the end if it's not the first pattern,
607
+ // and the start always gets applied.
608
+ //
609
+ // But that's always going to be $ if it's the ending pattern, or nothing,
610
+ // so the caller can just attach $ at the end of the pattern when building.
611
+ //
612
+ // So the todo is:
613
+ // - better detect what kind of start is needed
614
+ // - return both flavors of starting pattern
615
+ // - attach $ at the end of the pattern when creating the actual RegExp
616
+ //
617
+ // Ah, but wait, no, that all only applies to the root when the first pattern
618
+ // is not an extglob. If the first pattern IS an extglob, then we need all
619
+ // that dot prevention biz to live in the extglob portions, because eg
620
+ // +(*|.x*) can match .xy but not .yx.
621
+ //
622
+ // So, return the two flavors if it's #root and the first child is not an
623
+ // AST, otherwise leave it to the child AST to handle it, and there,
624
+ // use the (?:^|/) style of start binding.
625
+ //
626
+ // Even simplified further:
627
+ // - Since the start for a join is eg /(?!\.) and the start for a part
628
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
629
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
630
+ toRegExpSource(allowDot) {
631
+ var _a;
632
+ const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
633
+ if (__privateGet(this, _root) === this)
634
+ __privateMethod(this, _AST_instances, fillNegs_fn).call(this);
635
+ if (!this.type) {
636
+ const noEmpty = this.isStart() && this.isEnd();
637
+ const src = __privateGet(this, _parts).map((p) => {
638
+ var _a2;
639
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
640
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
641
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
642
+ return re;
643
+ }).join("");
644
+ let start2 = "";
645
+ if (this.isStart()) {
646
+ if (typeof __privateGet(this, _parts)[0] === "string") {
647
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
648
+ if (!dotTravAllowed) {
649
+ const aps = addPatternStart;
650
+ const needNoTrav = (
651
+ // dots are allowed, and the pattern starts with [ or .
652
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
653
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
654
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
655
+ );
656
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
657
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
658
+ }
659
+ }
660
+ }
661
+ let end = "";
662
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
663
+ end = "(?:$|\\/)";
664
+ }
665
+ const final2 = start2 + src + end;
666
+ return [
667
+ final2,
668
+ unescape(src),
669
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
670
+ __privateGet(this, _uflag)
671
+ ];
672
+ }
673
+ const repeated = this.type === "*" || this.type === "+";
674
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
675
+ let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
676
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
677
+ const s = this.toString();
678
+ __privateSet(this, _parts, [s]);
679
+ this.type = null;
680
+ __privateSet(this, _hasMagic, void 0);
681
+ return [s, unescape(this.toString()), false, false];
682
+ }
683
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
684
+ if (bodyDotAllowed === body) {
685
+ bodyDotAllowed = "";
686
+ }
687
+ if (bodyDotAllowed) {
688
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
689
+ }
690
+ let final = "";
691
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
692
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
693
+ } else {
694
+ const close = this.type === "!" ? (
695
+ // !() must match something,but !(x) can match ''
696
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
697
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
698
+ final = start + body + close;
699
+ }
700
+ return [
701
+ final,
702
+ unescape(body),
703
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
704
+ __privateGet(this, _uflag)
705
+ ];
706
+ }
707
+ };
708
+ _root = new WeakMap();
709
+ _hasMagic = new WeakMap();
710
+ _uflag = new WeakMap();
711
+ _parts = new WeakMap();
712
+ _parent = new WeakMap();
713
+ _parentIndex = new WeakMap();
714
+ _negs = new WeakMap();
715
+ _filledNegs = new WeakMap();
716
+ _options = new WeakMap();
717
+ _toString = new WeakMap();
718
+ _emptyExt = new WeakMap();
719
+ _AST_instances = new WeakSet();
720
+ fillNegs_fn = function() {
721
+ if (this !== __privateGet(this, _root))
722
+ throw new Error("should only call on root");
723
+ if (__privateGet(this, _filledNegs))
724
+ return this;
725
+ this.toString();
726
+ __privateSet(this, _filledNegs, true);
727
+ let n;
728
+ while (n = __privateGet(this, _negs).pop()) {
729
+ if (n.type !== "!")
730
+ continue;
731
+ let p = n;
732
+ let pp = __privateGet(p, _parent);
733
+ while (pp) {
734
+ for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
735
+ for (const part of __privateGet(n, _parts)) {
736
+ if (typeof part === "string") {
737
+ throw new Error("string part in extglob AST??");
738
+ }
739
+ part.copyIn(__privateGet(pp, _parts)[i2]);
740
+ }
741
+ }
742
+ p = pp;
743
+ pp = __privateGet(p, _parent);
744
+ }
745
+ }
746
+ return this;
747
+ };
748
+ _AST_static = new WeakSet();
749
+ parseAST_fn = function(str, ast, pos, opt) {
750
+ var _a, _b;
751
+ let escaping = false;
752
+ let inBrace = false;
753
+ let braceStart = -1;
754
+ let braceNeg = false;
755
+ if (ast.type === null) {
756
+ let i3 = pos;
757
+ let acc2 = "";
758
+ while (i3 < str.length) {
759
+ const c = str.charAt(i3++);
760
+ if (escaping || c === "\\") {
761
+ escaping = !escaping;
762
+ acc2 += c;
763
+ continue;
764
+ }
765
+ if (inBrace) {
766
+ if (i3 === braceStart + 1) {
767
+ if (c === "^" || c === "!") {
768
+ braceNeg = true;
769
+ }
770
+ } else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
771
+ inBrace = false;
772
+ }
773
+ acc2 += c;
774
+ continue;
775
+ } else if (c === "[") {
776
+ inBrace = true;
777
+ braceStart = i3;
778
+ braceNeg = false;
779
+ acc2 += c;
780
+ continue;
781
+ }
782
+ if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
783
+ ast.push(acc2);
784
+ acc2 = "";
785
+ const ext2 = new _AST(c, ast);
786
+ i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
787
+ ast.push(ext2);
788
+ continue;
789
+ }
790
+ acc2 += c;
791
+ }
792
+ ast.push(acc2);
793
+ return i3;
794
+ }
795
+ let i2 = pos + 1;
796
+ let part = new _AST(null, ast);
797
+ const parts = [];
798
+ let acc = "";
799
+ while (i2 < str.length) {
800
+ const c = str.charAt(i2++);
801
+ if (escaping || c === "\\") {
802
+ escaping = !escaping;
803
+ acc += c;
804
+ continue;
805
+ }
806
+ if (inBrace) {
807
+ if (i2 === braceStart + 1) {
808
+ if (c === "^" || c === "!") {
809
+ braceNeg = true;
810
+ }
811
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
812
+ inBrace = false;
813
+ }
814
+ acc += c;
815
+ continue;
816
+ } else if (c === "[") {
817
+ inBrace = true;
818
+ braceStart = i2;
819
+ braceNeg = false;
820
+ acc += c;
821
+ continue;
822
+ }
823
+ if (isExtglobType(c) && str.charAt(i2) === "(") {
824
+ part.push(acc);
825
+ acc = "";
826
+ const ext2 = new _AST(c, part);
827
+ part.push(ext2);
828
+ i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
829
+ continue;
830
+ }
831
+ if (c === "|") {
832
+ part.push(acc);
833
+ acc = "";
834
+ parts.push(part);
835
+ part = new _AST(null, ast);
836
+ continue;
837
+ }
838
+ if (c === ")") {
839
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
840
+ __privateSet(ast, _emptyExt, true);
841
+ }
842
+ part.push(acc);
843
+ acc = "";
844
+ ast.push(...parts, part);
845
+ return i2;
846
+ }
847
+ acc += c;
848
+ }
849
+ ast.type = null;
850
+ __privateSet(ast, _hasMagic, void 0);
851
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
852
+ return i2;
853
+ };
854
+ partsToRegExp_fn = function(dot) {
855
+ return __privateGet(this, _parts).map((p) => {
856
+ if (typeof p === "string") {
857
+ throw new Error("string type in extglob ast??");
858
+ }
859
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
860
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
861
+ return re;
862
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
863
+ };
864
+ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
865
+ let escaping = false;
866
+ let re = "";
867
+ let uflag = false;
868
+ for (let i2 = 0; i2 < glob.length; i2++) {
869
+ const c = glob.charAt(i2);
870
+ if (escaping) {
871
+ escaping = false;
872
+ re += (reSpecials.has(c) ? "\\" : "") + c;
873
+ continue;
874
+ }
875
+ if (c === "\\") {
876
+ if (i2 === glob.length - 1) {
877
+ re += "\\\\";
878
+ } else {
879
+ escaping = true;
880
+ }
881
+ continue;
882
+ }
883
+ if (c === "[") {
884
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
885
+ if (consumed) {
886
+ re += src;
887
+ uflag = uflag || needUflag;
888
+ i2 += consumed - 1;
889
+ hasMagic = hasMagic || magic;
890
+ continue;
891
+ }
892
+ }
893
+ if (c === "*") {
894
+ if (noEmpty && glob === "*")
895
+ re += starNoEmpty;
896
+ else
897
+ re += star;
898
+ hasMagic = true;
899
+ continue;
900
+ }
901
+ if (c === "?") {
902
+ re += qmark;
903
+ hasMagic = true;
904
+ continue;
905
+ }
906
+ re += regExpEscape(c);
907
+ }
908
+ return [re, unescape(glob), !!hasMagic, uflag];
909
+ };
910
+ __privateAdd(_AST, _AST_static);
911
+ var AST = _AST;
912
+
913
+ // node_modules/minimatch/dist/esm/escape.js
914
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
915
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
916
+ };
917
+
918
+ // node_modules/minimatch/dist/esm/index.js
919
+ var minimatch = (p, pattern, options = {}) => {
920
+ assertValidPattern(pattern);
921
+ if (!options.nocomment && pattern.charAt(0) === "#") {
922
+ return false;
923
+ }
924
+ return new Minimatch(pattern, options).match(p);
925
+ };
926
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
927
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
928
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
929
+ var starDotExtTestNocase = (ext2) => {
930
+ ext2 = ext2.toLowerCase();
931
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
932
+ };
933
+ var starDotExtTestNocaseDot = (ext2) => {
934
+ ext2 = ext2.toLowerCase();
935
+ return (f) => f.toLowerCase().endsWith(ext2);
936
+ };
937
+ var starDotStarRE = /^\*+\.\*+$/;
938
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
939
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
940
+ var dotStarRE = /^\.\*+$/;
941
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
942
+ var starRE = /^\*+$/;
943
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
944
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
945
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
946
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
947
+ const noext = qmarksTestNoExt([$0]);
948
+ if (!ext2)
949
+ return noext;
950
+ ext2 = ext2.toLowerCase();
951
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
952
+ };
953
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
954
+ const noext = qmarksTestNoExtDot([$0]);
955
+ if (!ext2)
956
+ return noext;
957
+ ext2 = ext2.toLowerCase();
958
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
959
+ };
960
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
961
+ const noext = qmarksTestNoExtDot([$0]);
962
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
963
+ };
964
+ var qmarksTest = ([$0, ext2 = ""]) => {
965
+ const noext = qmarksTestNoExt([$0]);
966
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
967
+ };
968
+ var qmarksTestNoExt = ([$0]) => {
969
+ const len = $0.length;
970
+ return (f) => f.length === len && !f.startsWith(".");
971
+ };
972
+ var qmarksTestNoExtDot = ([$0]) => {
973
+ const len = $0.length;
974
+ return (f) => f.length === len && f !== "." && f !== "..";
975
+ };
976
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
977
+ var path = {
978
+ win32: { sep: "\\" },
979
+ posix: { sep: "/" }
980
+ };
981
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
982
+ minimatch.sep = sep;
983
+ var GLOBSTAR = Symbol("globstar **");
984
+ minimatch.GLOBSTAR = GLOBSTAR;
985
+ var qmark2 = "[^/]";
986
+ var star2 = qmark2 + "*?";
987
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
988
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
989
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
990
+ minimatch.filter = filter;
991
+ var ext = (a, b = {}) => Object.assign({}, a, b);
992
+ var defaults = (def) => {
993
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
994
+ return minimatch;
995
+ }
996
+ const orig = minimatch;
997
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
998
+ return Object.assign(m, {
999
+ Minimatch: class Minimatch extends orig.Minimatch {
1000
+ constructor(pattern, options = {}) {
1001
+ super(pattern, ext(def, options));
1002
+ }
1003
+ static defaults(options) {
1004
+ return orig.defaults(ext(def, options)).Minimatch;
1005
+ }
1006
+ },
1007
+ AST: class AST extends orig.AST {
1008
+ /* c8 ignore start */
1009
+ constructor(type, parent, options = {}) {
1010
+ super(type, parent, ext(def, options));
1011
+ }
1012
+ /* c8 ignore stop */
1013
+ static fromGlob(pattern, options = {}) {
1014
+ return orig.AST.fromGlob(pattern, ext(def, options));
1015
+ }
1016
+ },
1017
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
1018
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
1019
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
1020
+ defaults: (options) => orig.defaults(ext(def, options)),
1021
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
1022
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
1023
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
1024
+ sep: orig.sep,
1025
+ GLOBSTAR
1026
+ });
1027
+ };
1028
+ minimatch.defaults = defaults;
1029
+ var braceExpand = (pattern, options = {}) => {
1030
+ assertValidPattern(pattern);
1031
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1032
+ return [pattern];
1033
+ }
1034
+ return (0, import_brace_expansion.default)(pattern);
1035
+ };
1036
+ minimatch.braceExpand = braceExpand;
1037
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
1038
+ minimatch.makeRe = makeRe;
1039
+ var match = (list, pattern, options = {}) => {
1040
+ const mm = new Minimatch(pattern, options);
1041
+ list = list.filter((f) => mm.match(f));
1042
+ if (mm.options.nonull && !list.length) {
1043
+ list.push(pattern);
1044
+ }
1045
+ return list;
1046
+ };
1047
+ minimatch.match = match;
1048
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
1049
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1050
+ var Minimatch = class {
1051
+ options;
1052
+ set;
1053
+ pattern;
1054
+ windowsPathsNoEscape;
1055
+ nonegate;
1056
+ negate;
1057
+ comment;
1058
+ empty;
1059
+ preserveMultipleSlashes;
1060
+ partial;
1061
+ globSet;
1062
+ globParts;
1063
+ nocase;
1064
+ isWindows;
1065
+ platform;
1066
+ windowsNoMagicRoot;
1067
+ regexp;
1068
+ constructor(pattern, options = {}) {
1069
+ assertValidPattern(pattern);
1070
+ options = options || {};
1071
+ this.options = options;
1072
+ this.pattern = pattern;
1073
+ this.platform = options.platform || defaultPlatform;
1074
+ this.isWindows = this.platform === "win32";
1075
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
1076
+ if (this.windowsPathsNoEscape) {
1077
+ this.pattern = this.pattern.replace(/\\/g, "/");
1078
+ }
1079
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
1080
+ this.regexp = null;
1081
+ this.negate = false;
1082
+ this.nonegate = !!options.nonegate;
1083
+ this.comment = false;
1084
+ this.empty = false;
1085
+ this.partial = !!options.partial;
1086
+ this.nocase = !!this.options.nocase;
1087
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
1088
+ this.globSet = [];
1089
+ this.globParts = [];
1090
+ this.set = [];
1091
+ this.make();
1092
+ }
1093
+ hasMagic() {
1094
+ if (this.options.magicalBraces && this.set.length > 1) {
1095
+ return true;
1096
+ }
1097
+ for (const pattern of this.set) {
1098
+ for (const part of pattern) {
1099
+ if (typeof part !== "string")
1100
+ return true;
1101
+ }
1102
+ }
1103
+ return false;
1104
+ }
1105
+ debug(..._) {
1106
+ }
1107
+ make() {
1108
+ const pattern = this.pattern;
1109
+ const options = this.options;
1110
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1111
+ this.comment = true;
1112
+ return;
1113
+ }
1114
+ if (!pattern) {
1115
+ this.empty = true;
1116
+ return;
1117
+ }
1118
+ this.parseNegate();
1119
+ this.globSet = [...new Set(this.braceExpand())];
1120
+ if (options.debug) {
1121
+ this.debug = (...args) => console.error(...args);
1122
+ }
1123
+ this.debug(this.pattern, this.globSet);
1124
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
1125
+ this.globParts = this.preprocess(rawGlobParts);
1126
+ this.debug(this.pattern, this.globParts);
1127
+ let set = this.globParts.map((s, _, __) => {
1128
+ if (this.isWindows && this.windowsNoMagicRoot) {
1129
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
1130
+ const isDrive = /^[a-z]:/i.test(s[0]);
1131
+ if (isUNC) {
1132
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
1133
+ } else if (isDrive) {
1134
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
1135
+ }
1136
+ }
1137
+ return s.map((ss) => this.parse(ss));
1138
+ });
1139
+ this.debug(this.pattern, set);
1140
+ this.set = set.filter((s) => s.indexOf(false) === -1);
1141
+ if (this.isWindows) {
1142
+ for (let i2 = 0; i2 < this.set.length; i2++) {
1143
+ const p = this.set[i2];
1144
+ if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
1145
+ p[2] = "?";
1146
+ }
1147
+ }
1148
+ }
1149
+ this.debug(this.pattern, this.set);
1150
+ }
1151
+ // various transforms to equivalent pattern sets that are
1152
+ // faster to process in a filesystem walk. The goal is to
1153
+ // eliminate what we can, and push all ** patterns as far
1154
+ // to the right as possible, even if it increases the number
1155
+ // of patterns that we have to process.
1156
+ preprocess(globParts) {
1157
+ if (this.options.noglobstar) {
1158
+ for (let i2 = 0; i2 < globParts.length; i2++) {
1159
+ for (let j = 0; j < globParts[i2].length; j++) {
1160
+ if (globParts[i2][j] === "**") {
1161
+ globParts[i2][j] = "*";
1162
+ }
1163
+ }
1164
+ }
1165
+ }
1166
+ const { optimizationLevel = 1 } = this.options;
1167
+ if (optimizationLevel >= 2) {
1168
+ globParts = this.firstPhasePreProcess(globParts);
1169
+ globParts = this.secondPhasePreProcess(globParts);
1170
+ } else if (optimizationLevel >= 1) {
1171
+ globParts = this.levelOneOptimize(globParts);
1172
+ } else {
1173
+ globParts = this.adjascentGlobstarOptimize(globParts);
1174
+ }
1175
+ return globParts;
1176
+ }
1177
+ // just get rid of adjascent ** portions
1178
+ adjascentGlobstarOptimize(globParts) {
1179
+ return globParts.map((parts) => {
1180
+ let gs = -1;
1181
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1182
+ let i2 = gs;
1183
+ while (parts[i2 + 1] === "**") {
1184
+ i2++;
1185
+ }
1186
+ if (i2 !== gs) {
1187
+ parts.splice(gs, i2 - gs);
1188
+ }
1189
+ }
1190
+ return parts;
1191
+ });
1192
+ }
1193
+ // get rid of adjascent ** and resolve .. portions
1194
+ levelOneOptimize(globParts) {
1195
+ return globParts.map((parts) => {
1196
+ parts = parts.reduce((set, part) => {
1197
+ const prev = set[set.length - 1];
1198
+ if (part === "**" && prev === "**") {
1199
+ return set;
1200
+ }
1201
+ if (part === "..") {
1202
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
1203
+ set.pop();
1204
+ return set;
1205
+ }
1206
+ }
1207
+ set.push(part);
1208
+ return set;
1209
+ }, []);
1210
+ return parts.length === 0 ? [""] : parts;
1211
+ });
1212
+ }
1213
+ levelTwoFileOptimize(parts) {
1214
+ if (!Array.isArray(parts)) {
1215
+ parts = this.slashSplit(parts);
1216
+ }
1217
+ let didSomething = false;
1218
+ do {
1219
+ didSomething = false;
1220
+ if (!this.preserveMultipleSlashes) {
1221
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1222
+ const p = parts[i2];
1223
+ if (i2 === 1 && p === "" && parts[0] === "")
1224
+ continue;
1225
+ if (p === "." || p === "") {
1226
+ didSomething = true;
1227
+ parts.splice(i2, 1);
1228
+ i2--;
1229
+ }
1230
+ }
1231
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1232
+ didSomething = true;
1233
+ parts.pop();
1234
+ }
1235
+ }
1236
+ let dd = 0;
1237
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1238
+ const p = parts[dd - 1];
1239
+ if (p && p !== "." && p !== ".." && p !== "**") {
1240
+ didSomething = true;
1241
+ parts.splice(dd - 1, 2);
1242
+ dd -= 2;
1243
+ }
1244
+ }
1245
+ } while (didSomething);
1246
+ return parts.length === 0 ? [""] : parts;
1247
+ }
1248
+ // First phase: single-pattern processing
1249
+ // <pre> is 1 or more portions
1250
+ // <rest> is 1 or more portions
1251
+ // <p> is any portion other than ., .., '', or **
1252
+ // <e> is . or ''
1253
+ //
1254
+ // **/.. is *brutal* for filesystem walking performance, because
1255
+ // it effectively resets the recursive walk each time it occurs,
1256
+ // and ** cannot be reduced out by a .. pattern part like a regexp
1257
+ // or most strings (other than .., ., and '') can be.
1258
+ //
1259
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
1260
+ // <pre>/<e>/<rest> -> <pre>/<rest>
1261
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
1262
+ // **/**/<rest> -> **/<rest>
1263
+ //
1264
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
1265
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
1266
+ firstPhasePreProcess(globParts) {
1267
+ let didSomething = false;
1268
+ do {
1269
+ didSomething = false;
1270
+ for (let parts of globParts) {
1271
+ let gs = -1;
1272
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1273
+ let gss = gs;
1274
+ while (parts[gss + 1] === "**") {
1275
+ gss++;
1276
+ }
1277
+ if (gss > gs) {
1278
+ parts.splice(gs + 1, gss - gs);
1279
+ }
1280
+ let next = parts[gs + 1];
1281
+ const p = parts[gs + 2];
1282
+ const p2 = parts[gs + 3];
1283
+ if (next !== "..")
1284
+ continue;
1285
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
1286
+ continue;
1287
+ }
1288
+ didSomething = true;
1289
+ parts.splice(gs, 1);
1290
+ const other = parts.slice(0);
1291
+ other[gs] = "**";
1292
+ globParts.push(other);
1293
+ gs--;
1294
+ }
1295
+ if (!this.preserveMultipleSlashes) {
1296
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1297
+ const p = parts[i2];
1298
+ if (i2 === 1 && p === "" && parts[0] === "")
1299
+ continue;
1300
+ if (p === "." || p === "") {
1301
+ didSomething = true;
1302
+ parts.splice(i2, 1);
1303
+ i2--;
1304
+ }
1305
+ }
1306
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1307
+ didSomething = true;
1308
+ parts.pop();
1309
+ }
1310
+ }
1311
+ let dd = 0;
1312
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1313
+ const p = parts[dd - 1];
1314
+ if (p && p !== "." && p !== ".." && p !== "**") {
1315
+ didSomething = true;
1316
+ const needDot = dd === 1 && parts[dd + 1] === "**";
1317
+ const splin = needDot ? ["."] : [];
1318
+ parts.splice(dd - 1, 2, ...splin);
1319
+ if (parts.length === 0)
1320
+ parts.push("");
1321
+ dd -= 2;
1322
+ }
1323
+ }
1324
+ }
1325
+ } while (didSomething);
1326
+ return globParts;
1327
+ }
1328
+ // second phase: multi-pattern dedupes
1329
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
1330
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
1331
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
1332
+ //
1333
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
1334
+ // ^-- not valid because ** doens't follow symlinks
1335
+ secondPhasePreProcess(globParts) {
1336
+ for (let i2 = 0; i2 < globParts.length - 1; i2++) {
1337
+ for (let j = i2 + 1; j < globParts.length; j++) {
1338
+ const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
1339
+ if (!matched)
1340
+ continue;
1341
+ globParts[i2] = matched;
1342
+ globParts[j] = [];
1343
+ }
1344
+ }
1345
+ return globParts.filter((gs) => gs.length);
1346
+ }
1347
+ partsMatch(a, b, emptyGSMatch = false) {
1348
+ let ai = 0;
1349
+ let bi = 0;
1350
+ let result = [];
1351
+ let which = "";
1352
+ while (ai < a.length && bi < b.length) {
1353
+ if (a[ai] === b[bi]) {
1354
+ result.push(which === "b" ? b[bi] : a[ai]);
1355
+ ai++;
1356
+ bi++;
1357
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
1358
+ result.push(a[ai]);
1359
+ ai++;
1360
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
1361
+ result.push(b[bi]);
1362
+ bi++;
1363
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
1364
+ if (which === "b")
1365
+ return false;
1366
+ which = "a";
1367
+ result.push(a[ai]);
1368
+ ai++;
1369
+ bi++;
1370
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
1371
+ if (which === "a")
1372
+ return false;
1373
+ which = "b";
1374
+ result.push(b[bi]);
1375
+ ai++;
1376
+ bi++;
1377
+ } else {
1378
+ return false;
1379
+ }
1380
+ }
1381
+ return a.length === b.length && result;
1382
+ }
1383
+ parseNegate() {
1384
+ if (this.nonegate)
1385
+ return;
1386
+ const pattern = this.pattern;
1387
+ let negate = false;
1388
+ let negateOffset = 0;
1389
+ for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
1390
+ negate = !negate;
1391
+ negateOffset++;
1392
+ }
1393
+ if (negateOffset)
1394
+ this.pattern = pattern.slice(negateOffset);
1395
+ this.negate = negate;
1396
+ }
1397
+ // set partial to true to test if, for example,
1398
+ // "/a/b" matches the start of "/*/b/*/d"
1399
+ // Partial means, if you run out of file before you run
1400
+ // out of pattern, then that's fine, as long as all
1401
+ // the parts match.
1402
+ matchOne(file, pattern, partial = false) {
1403
+ const options = this.options;
1404
+ if (this.isWindows) {
1405
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
1406
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
1407
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
1408
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
1409
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
1410
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
1411
+ if (typeof fdi === "number" && typeof pdi === "number") {
1412
+ const [fd, pd] = [file[fdi], pattern[pdi]];
1413
+ if (fd.toLowerCase() === pd.toLowerCase()) {
1414
+ pattern[pdi] = fd;
1415
+ if (pdi > fdi) {
1416
+ pattern = pattern.slice(pdi);
1417
+ } else if (fdi > pdi) {
1418
+ file = file.slice(fdi);
1419
+ }
1420
+ }
1421
+ }
1422
+ }
1423
+ const { optimizationLevel = 1 } = this.options;
1424
+ if (optimizationLevel >= 2) {
1425
+ file = this.levelTwoFileOptimize(file);
1426
+ }
1427
+ this.debug("matchOne", this, { file, pattern });
1428
+ this.debug("matchOne", file.length, pattern.length);
1429
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
1430
+ this.debug("matchOne loop");
1431
+ var p = pattern[pi];
1432
+ var f = file[fi];
1433
+ this.debug(pattern, p, f);
1434
+ if (p === false) {
1435
+ return false;
1436
+ }
1437
+ if (p === GLOBSTAR) {
1438
+ this.debug("GLOBSTAR", [pattern, p, f]);
1439
+ var fr = fi;
1440
+ var pr = pi + 1;
1441
+ if (pr === pl) {
1442
+ this.debug("** at the end");
1443
+ for (; fi < fl; fi++) {
1444
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
1445
+ return false;
1446
+ }
1447
+ return true;
1448
+ }
1449
+ while (fr < fl) {
1450
+ var swallowee = file[fr];
1451
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
1452
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
1453
+ this.debug("globstar found match!", fr, fl, swallowee);
1454
+ return true;
1455
+ } else {
1456
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
1457
+ this.debug("dot detected!", file, fr, pattern, pr);
1458
+ break;
1459
+ }
1460
+ this.debug("globstar swallow a segment, and continue");
1461
+ fr++;
1462
+ }
1463
+ }
1464
+ if (partial) {
1465
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
1466
+ if (fr === fl) {
1467
+ return true;
1468
+ }
1469
+ }
1470
+ return false;
1471
+ }
1472
+ let hit;
1473
+ if (typeof p === "string") {
1474
+ hit = f === p;
1475
+ this.debug("string match", p, f, hit);
1476
+ } else {
1477
+ hit = p.test(f);
1478
+ this.debug("pattern match", p, f, hit);
1479
+ }
1480
+ if (!hit)
1481
+ return false;
1482
+ }
1483
+ if (fi === fl && pi === pl) {
1484
+ return true;
1485
+ } else if (fi === fl) {
1486
+ return partial;
1487
+ } else if (pi === pl) {
1488
+ return fi === fl - 1 && file[fi] === "";
1489
+ } else {
1490
+ throw new Error("wtf?");
1491
+ }
1492
+ }
1493
+ braceExpand() {
1494
+ return braceExpand(this.pattern, this.options);
1495
+ }
1496
+ parse(pattern) {
1497
+ assertValidPattern(pattern);
1498
+ const options = this.options;
1499
+ if (pattern === "**")
1500
+ return GLOBSTAR;
1501
+ if (pattern === "")
1502
+ return "";
1503
+ let m;
1504
+ let fastTest = null;
1505
+ if (m = pattern.match(starRE)) {
1506
+ fastTest = options.dot ? starTestDot : starTest;
1507
+ } else if (m = pattern.match(starDotExtRE)) {
1508
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
1509
+ } else if (m = pattern.match(qmarksRE)) {
1510
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
1511
+ } else if (m = pattern.match(starDotStarRE)) {
1512
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
1513
+ } else if (m = pattern.match(dotStarRE)) {
1514
+ fastTest = dotStarTest;
1515
+ }
1516
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
1517
+ if (fastTest && typeof re === "object") {
1518
+ Reflect.defineProperty(re, "test", { value: fastTest });
1519
+ }
1520
+ return re;
1521
+ }
1522
+ makeRe() {
1523
+ if (this.regexp || this.regexp === false)
1524
+ return this.regexp;
1525
+ const set = this.set;
1526
+ if (!set.length) {
1527
+ this.regexp = false;
1528
+ return this.regexp;
1529
+ }
1530
+ const options = this.options;
1531
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
1532
+ const flags = new Set(options.nocase ? ["i"] : []);
1533
+ let re = set.map((pattern) => {
1534
+ const pp = pattern.map((p) => {
1535
+ if (p instanceof RegExp) {
1536
+ for (const f of p.flags.split(""))
1537
+ flags.add(f);
1538
+ }
1539
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
1540
+ });
1541
+ pp.forEach((p, i2) => {
1542
+ const next = pp[i2 + 1];
1543
+ const prev = pp[i2 - 1];
1544
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
1545
+ return;
1546
+ }
1547
+ if (prev === void 0) {
1548
+ if (next !== void 0 && next !== GLOBSTAR) {
1549
+ pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
1550
+ } else {
1551
+ pp[i2] = twoStar;
1552
+ }
1553
+ } else if (next === void 0) {
1554
+ pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
1555
+ } else if (next !== GLOBSTAR) {
1556
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
1557
+ pp[i2 + 1] = GLOBSTAR;
1558
+ }
1559
+ });
1560
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
1561
+ }).join("|");
1562
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
1563
+ re = "^" + open + re + close + "$";
1564
+ if (this.negate)
1565
+ re = "^(?!" + re + ").+$";
1566
+ try {
1567
+ this.regexp = new RegExp(re, [...flags].join(""));
1568
+ } catch (ex) {
1569
+ this.regexp = false;
1570
+ }
1571
+ return this.regexp;
1572
+ }
1573
+ slashSplit(p) {
1574
+ if (this.preserveMultipleSlashes) {
1575
+ return p.split("/");
1576
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1577
+ return ["", ...p.split(/\/+/)];
1578
+ } else {
1579
+ return p.split(/\/+/);
1580
+ }
1581
+ }
1582
+ match(f, partial = this.partial) {
1583
+ this.debug("match", f, this.pattern);
1584
+ if (this.comment) {
1585
+ return false;
1586
+ }
1587
+ if (this.empty) {
1588
+ return f === "";
1589
+ }
1590
+ if (f === "/" && partial) {
1591
+ return true;
1592
+ }
1593
+ const options = this.options;
1594
+ if (this.isWindows) {
1595
+ f = f.split("\\").join("/");
1596
+ }
1597
+ const ff = this.slashSplit(f);
1598
+ this.debug(this.pattern, "split", ff);
1599
+ const set = this.set;
1600
+ this.debug(this.pattern, "set", set);
1601
+ let filename = ff[ff.length - 1];
1602
+ if (!filename) {
1603
+ for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
1604
+ filename = ff[i2];
1605
+ }
1606
+ }
1607
+ for (let i2 = 0; i2 < set.length; i2++) {
1608
+ const pattern = set[i2];
1609
+ let file = ff;
1610
+ if (options.matchBase && pattern.length === 1) {
1611
+ file = [filename];
1612
+ }
1613
+ const hit = this.matchOne(file, pattern, partial);
1614
+ if (hit) {
1615
+ if (options.flipNegate) {
1616
+ return true;
1617
+ }
1618
+ return !this.negate;
1619
+ }
1620
+ }
1621
+ if (options.flipNegate) {
1622
+ return false;
1623
+ }
1624
+ return this.negate;
1625
+ }
1626
+ static defaults(def) {
1627
+ return minimatch.defaults(def).Minimatch;
1628
+ }
1629
+ };
1630
+ minimatch.AST = AST;
1631
+ minimatch.Minimatch = Minimatch;
1632
+ minimatch.escape = escape;
1633
+ minimatch.unescape = unescape;
1634
+
41
1635
  // src/utils/regular-expression.ts
42
1636
  var escapeRegExpSpecialCharacters = (text) => {
43
1637
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -483,10 +2077,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
483
2077
  elm.classList.add(elm["s-si"] = scopeId);
484
2078
  }
485
2079
  if (newVNode2.$children$) {
2080
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
486
2081
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
487
2082
  childNode = createElm(oldParentVNode, newVNode2, i2);
488
2083
  if (childNode) {
489
- elm.appendChild(childNode);
2084
+ appendTarget.appendChild(childNode);
490
2085
  }
491
2086
  }
492
2087
  }
@@ -544,6 +2139,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
544
2139
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
545
2140
  containerElm = containerElm.shadowRoot;
546
2141
  }
2142
+ if (parentVNode.$tag$ === "template") {
2143
+ containerElm = containerElm.content;
2144
+ }
547
2145
  for (; startIdx <= endIdx; ++startIdx) {
548
2146
  if (vnodes[startIdx]) {
549
2147
  childNode = createElm(null, parentVNode, startIdx);
@@ -587,6 +2185,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
587
2185
  let newEndVnode = newCh[newEndIdx];
588
2186
  let node;
589
2187
  let elmToMove;
2188
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
590
2189
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
591
2190
  if (oldStartVnode == null) {
592
2191
  oldStartVnode = oldCh[++oldStartIdx];
@@ -609,7 +2208,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
609
2208
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
610
2209
  }
611
2210
  patch(oldStartVnode, newEndVnode, isInitialRender);
612
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2211
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
613
2212
  oldStartVnode = oldCh[++oldStartIdx];
614
2213
  newEndVnode = newCh[--newEndIdx];
615
2214
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
@@ -617,7 +2216,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
617
2216
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
618
2217
  }
619
2218
  patch(oldEndVnode, newStartVnode, isInitialRender);
620
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2219
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
621
2220
  oldEndVnode = oldCh[--oldEndIdx];
622
2221
  newStartVnode = newCh[++newStartIdx];
623
2222
  } else {
@@ -858,13 +2457,16 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
858
2457
  for (const relocateData of relocateNodes) {
859
2458
  const nodeToRelocate = relocateData.$nodeToRelocate$;
860
2459
  const slotRefNode = relocateData.$slotRefNode$;
2460
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
2461
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
2462
+ }
861
2463
  if (slotRefNode) {
862
2464
  const parentNodeRef = slotRefNode.parentNode;
863
2465
  let insertBeforeNode = slotRefNode.nextSibling;
864
2466
  {
865
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
2467
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
866
2468
  while (orgLocationNode) {
867
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
2469
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
868
2470
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
869
2471
  refNode = refNode.nextSibling;
870
2472
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -887,18 +2489,13 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
887
2489
  }
888
2490
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
889
2491
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
890
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
2492
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
891
2493
  }
892
2494
  }
893
2495
  }
894
2496
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
895
- } else {
896
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
897
- if (isInitialLoad) {
898
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
899
- }
900
- nodeToRelocate.hidden = true;
901
- }
2497
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
2498
+ nodeToRelocate.hidden = true;
902
2499
  }
903
2500
  }
904
2501
  }
@@ -911,7 +2508,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
911
2508
  if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
912
2509
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
913
2510
  for (const childNode of children) {
914
- if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
2511
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
915
2512
  if (isInitialLoad && childNode["s-ih"] == null) {
916
2513
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
917
2514
  }
@@ -1576,7 +3173,7 @@ let ignore_map$1;
1576
3173
  */
1577
3174
  const minify = (html, config) => {
1578
3175
  let reinsert_ignored = false;
1579
- const { checked_html, ignored } = getState();
3176
+ const { checked_html, ignored, constants } = getState();
1580
3177
 
1581
3178
  if (!checked_html && !isHtml(html)) return html
1582
3179
 
@@ -1607,6 +3204,18 @@ const minify = (html, config) => {
1607
3204
  // Collapse any remaining multiple spaces to single spaces.
1608
3205
  html = html.replace(/ {2,}/g, ' ');
1609
3206
 
3207
+ // Protect space between text content and an opening tag (e.g., "text <a>")
3208
+ html = html.replace(
3209
+ /(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g,
3210
+ `$1___MINIFY-PROTECTED-SPACE___$2`
3211
+ );
3212
+
3213
+ // Protect space between a closing tag and text content (e.g., "</a> text")
3214
+ html = html.replace(
3215
+ /(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g,
3216
+ `$1___MINIFY-PROTECTED-SPACE___$2`
3217
+ );
3218
+
1610
3219
  // Remove specific single spaces between tags and whitespace within tags.
1611
3220
  html = html.replace(/ >/g, ">"); // <tag > -> <tag>
1612
3221
  html = html.replace(/ </g, "<"); // leading space before tag
@@ -1615,6 +3224,9 @@ const minify = (html, config) => {
1615
3224
  html = html.replace(/<\s+\//g, '</'); // < /tag> -> </tag>
1616
3225
  html = html.replace(/<\/\s+/g, '</'); // </ tag> -> </tag>
1617
3226
 
3227
+ // Unprotect space around inner tags
3228
+ html = html.replace(new RegExp('___MINIFY-PROTECTED-SPACE___', 'g'), ' ');
3229
+
1618
3230
  // Trim spaces around equals signs in attributes (run before value trim)
1619
3231
  // This handles `attr = "value"` -> `attr="value"`
1620
3232
  html = html.replace(/ = /g, "=");
@@ -1690,7 +3302,7 @@ const enqueue = (html) => {
1690
3302
  *
1691
3303
  * @returns {string}
1692
3304
  */
1693
- const process = () => {
3305
+ const process$1 = () => {
1694
3306
  const { config, constants } = getState();
1695
3307
  const step = " ".repeat(config.tab_size);
1696
3308
  const tag_wrap = config.tag_wrap;
@@ -1759,6 +3371,9 @@ const process = () => {
1759
3371
  output_lines[output_lines.length - 1] =
1760
3372
  output_lines.at(-1) + current_line_value.charAt(0);
1761
3373
  current_line_value = current_line_value.slice(1).trim();
3374
+
3375
+ /* If nothing left after extracting punctuation, skip this line. */
3376
+ if (current_line_value.length === 0) return
1762
3377
  }
1763
3378
  }
1764
3379
 
@@ -1904,7 +3519,7 @@ const prettify = (html, config) => {
1904
3519
 
1905
3520
  html = minify(html);
1906
3521
  enqueue(html);
1907
- html = process();
3522
+ html = process$1();
1908
3523
 
1909
3524
  /* Revert html text within attribute values. */
1910
3525
  html = unsetIgnoreAttribute(html);