proto-autos-wc 0.1.125 → 0.1.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-CHtgcRuD.js → index-CZCzt3Q9.js} +1738 -106
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-autos-wc.cjs.js +3 -3
- package/dist/cjs/proto-autos.cjs.entry.js +2 -381
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/{index-CUeCNkv1.js → index-Djdza2ry.js} +1738 -106
- package/dist/esm/loader.js +3 -3
- package/dist/esm/proto-autos-wc.js +4 -4
- package/dist/esm/proto-autos.entry.js +2 -381
- package/dist/proto-autos-wc/p-Djdza2ry.js +2 -0
- package/dist/proto-autos-wc/{p-d8159ca8.entry.js → p-dcbe9181.entry.js} +1 -1
- package/dist/proto-autos-wc/proto-autos-wc.esm.js +1 -1
- package/dist/types/stencil-public-runtime.d.ts +14 -3
- package/package.json +2 -2
- package/dist/proto-autos-wc/p-CUeCNkv1.js +0 -2
|
@@ -1,15 +1,256 @@
|
|
|
1
1
|
const NAMESPACE = 'proto-autos-wc';
|
|
2
|
-
const BUILD = /* proto-autos-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
2
|
+
const BUILD = /* proto-autos-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, shadowSlotAssignmentManual: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
3
3
|
const Env = /* proto-autos-wc */ {};
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Platform v4.
|
|
6
|
+
Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
|
+
var __create = Object.create;
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __typeError = (msg) => {
|
|
15
|
+
throw TypeError(msg);
|
|
16
|
+
};
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
19
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
+
};
|
|
9
21
|
var __export = (target, all) => {
|
|
10
22
|
for (var name in all)
|
|
11
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
24
|
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
41
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
42
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
43
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
44
|
+
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);
|
|
45
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
46
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
47
|
+
|
|
48
|
+
// node_modules/balanced-match/index.js
|
|
49
|
+
var require_balanced_match = __commonJS({
|
|
50
|
+
"node_modules/balanced-match/index.js"(exports, module) {
|
|
51
|
+
module.exports = balanced;
|
|
52
|
+
function balanced(a, b, str) {
|
|
53
|
+
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
54
|
+
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
55
|
+
var r = range(a, b, str);
|
|
56
|
+
return r && {
|
|
57
|
+
start: r[0],
|
|
58
|
+
end: r[1],
|
|
59
|
+
pre: str.slice(0, r[0]),
|
|
60
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
61
|
+
post: str.slice(r[1] + b.length)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function maybeMatch(reg, str) {
|
|
65
|
+
var m = str.match(reg);
|
|
66
|
+
return m ? m[0] : null;
|
|
67
|
+
}
|
|
68
|
+
balanced.range = range;
|
|
69
|
+
function range(a, b, str) {
|
|
70
|
+
var begs, beg, left, right, result;
|
|
71
|
+
var ai = str.indexOf(a);
|
|
72
|
+
var bi = str.indexOf(b, ai + 1);
|
|
73
|
+
var i2 = ai;
|
|
74
|
+
if (ai >= 0 && bi > 0) {
|
|
75
|
+
if (a === b) {
|
|
76
|
+
return [ai, bi];
|
|
77
|
+
}
|
|
78
|
+
begs = [];
|
|
79
|
+
left = str.length;
|
|
80
|
+
while (i2 >= 0 && !result) {
|
|
81
|
+
if (i2 == ai) {
|
|
82
|
+
begs.push(i2);
|
|
83
|
+
ai = str.indexOf(a, i2 + 1);
|
|
84
|
+
} else if (begs.length == 1) {
|
|
85
|
+
result = [begs.pop(), bi];
|
|
86
|
+
} else {
|
|
87
|
+
beg = begs.pop();
|
|
88
|
+
if (beg < left) {
|
|
89
|
+
left = beg;
|
|
90
|
+
right = bi;
|
|
91
|
+
}
|
|
92
|
+
bi = str.indexOf(b, i2 + 1);
|
|
93
|
+
}
|
|
94
|
+
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
95
|
+
}
|
|
96
|
+
if (begs.length) {
|
|
97
|
+
result = [left, right];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// node_modules/brace-expansion/index.js
|
|
106
|
+
var require_brace_expansion = __commonJS({
|
|
107
|
+
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
108
|
+
var balanced = require_balanced_match();
|
|
109
|
+
module.exports = expandTop;
|
|
110
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
111
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
112
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
113
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
114
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
115
|
+
function numeric(str) {
|
|
116
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
117
|
+
}
|
|
118
|
+
function escapeBraces(str) {
|
|
119
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
120
|
+
}
|
|
121
|
+
function unescapeBraces(str) {
|
|
122
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
123
|
+
}
|
|
124
|
+
function parseCommaParts(str) {
|
|
125
|
+
if (!str)
|
|
126
|
+
return [""];
|
|
127
|
+
var parts = [];
|
|
128
|
+
var m = balanced("{", "}", str);
|
|
129
|
+
if (!m)
|
|
130
|
+
return str.split(",");
|
|
131
|
+
var pre = m.pre;
|
|
132
|
+
var body = m.body;
|
|
133
|
+
var post = m.post;
|
|
134
|
+
var p = pre.split(",");
|
|
135
|
+
p[p.length - 1] += "{" + body + "}";
|
|
136
|
+
var postParts = parseCommaParts(post);
|
|
137
|
+
if (post.length) {
|
|
138
|
+
p[p.length - 1] += postParts.shift();
|
|
139
|
+
p.push.apply(p, postParts);
|
|
140
|
+
}
|
|
141
|
+
parts.push.apply(parts, p);
|
|
142
|
+
return parts;
|
|
143
|
+
}
|
|
144
|
+
function expandTop(str) {
|
|
145
|
+
if (!str)
|
|
146
|
+
return [];
|
|
147
|
+
if (str.substr(0, 2) === "{}") {
|
|
148
|
+
str = "\\{\\}" + str.substr(2);
|
|
149
|
+
}
|
|
150
|
+
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
151
|
+
}
|
|
152
|
+
function embrace(str) {
|
|
153
|
+
return "{" + str + "}";
|
|
154
|
+
}
|
|
155
|
+
function isPadded(el) {
|
|
156
|
+
return /^-?0\d/.test(el);
|
|
157
|
+
}
|
|
158
|
+
function lte(i2, y) {
|
|
159
|
+
return i2 <= y;
|
|
160
|
+
}
|
|
161
|
+
function gte(i2, y) {
|
|
162
|
+
return i2 >= y;
|
|
163
|
+
}
|
|
164
|
+
function expand2(str, isTop) {
|
|
165
|
+
var expansions = [];
|
|
166
|
+
var m = balanced("{", "}", str);
|
|
167
|
+
if (!m) return [str];
|
|
168
|
+
var pre = m.pre;
|
|
169
|
+
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
170
|
+
if (/\$$/.test(m.pre)) {
|
|
171
|
+
for (var k = 0; k < post.length; k++) {
|
|
172
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
173
|
+
expansions.push(expansion);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
177
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
178
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
179
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
180
|
+
if (!isSequence && !isOptions) {
|
|
181
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
182
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
183
|
+
return expand2(str);
|
|
184
|
+
}
|
|
185
|
+
return [str];
|
|
186
|
+
}
|
|
187
|
+
var n;
|
|
188
|
+
if (isSequence) {
|
|
189
|
+
n = m.body.split(/\.\./);
|
|
190
|
+
} else {
|
|
191
|
+
n = parseCommaParts(m.body);
|
|
192
|
+
if (n.length === 1) {
|
|
193
|
+
n = expand2(n[0], false).map(embrace);
|
|
194
|
+
if (n.length === 1) {
|
|
195
|
+
return post.map(function(p) {
|
|
196
|
+
return m.pre + n[0] + p;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var N;
|
|
202
|
+
if (isSequence) {
|
|
203
|
+
var x = numeric(n[0]);
|
|
204
|
+
var y = numeric(n[1]);
|
|
205
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
206
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
207
|
+
var test = lte;
|
|
208
|
+
var reverse = y < x;
|
|
209
|
+
if (reverse) {
|
|
210
|
+
incr *= -1;
|
|
211
|
+
test = gte;
|
|
212
|
+
}
|
|
213
|
+
var pad = n.some(isPadded);
|
|
214
|
+
N = [];
|
|
215
|
+
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
216
|
+
var c;
|
|
217
|
+
if (isAlphaSequence) {
|
|
218
|
+
c = String.fromCharCode(i2);
|
|
219
|
+
if (c === "\\")
|
|
220
|
+
c = "";
|
|
221
|
+
} else {
|
|
222
|
+
c = String(i2);
|
|
223
|
+
if (pad) {
|
|
224
|
+
var need = width - c.length;
|
|
225
|
+
if (need > 0) {
|
|
226
|
+
var z = new Array(need + 1).join("0");
|
|
227
|
+
if (i2 < 0)
|
|
228
|
+
c = "-" + z + c.slice(1);
|
|
229
|
+
else
|
|
230
|
+
c = z + c;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
N.push(c);
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
N = [];
|
|
238
|
+
for (var j = 0; j < n.length; j++) {
|
|
239
|
+
N.push.apply(N, expand2(n[j], false));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
for (var j = 0; j < N.length; j++) {
|
|
243
|
+
for (var k = 0; k < post.length; k++) {
|
|
244
|
+
var expansion = pre + N[j] + post[k];
|
|
245
|
+
if (!isTop || isSequence || expansion)
|
|
246
|
+
expansions.push(expansion);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return expansions;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
13
254
|
var Build = {
|
|
14
255
|
isDev: BUILD.isDev ? true : false,
|
|
15
256
|
isBrowser: true,
|
|
@@ -237,6 +478,9 @@ var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
|
237
478
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
238
479
|
var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
|
|
239
480
|
try {
|
|
481
|
+
if (!win.document.adoptedStyleSheets) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
240
484
|
new CSSStyleSheet();
|
|
241
485
|
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
242
486
|
} catch (e) {
|
|
@@ -318,11 +562,11 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
318
562
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
319
563
|
|
|
320
564
|
// src/runtime/asset-path.ts
|
|
321
|
-
var getAssetPath = (
|
|
322
|
-
const assetUrl = new URL(
|
|
565
|
+
var getAssetPath = (path2) => {
|
|
566
|
+
const assetUrl = new URL(path2, plt.$resourcesUrl$);
|
|
323
567
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
324
568
|
};
|
|
325
|
-
var setAssetPath = (
|
|
569
|
+
var setAssetPath = (path2) => plt.$resourcesUrl$ = path2;
|
|
326
570
|
|
|
327
571
|
// src/utils/helpers.ts
|
|
328
572
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -331,6 +575,1359 @@ var isComplexType = (o) => {
|
|
|
331
575
|
return o === "object" || o === "function";
|
|
332
576
|
};
|
|
333
577
|
|
|
578
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
579
|
+
var import_brace_expansion = __toESM(require_brace_expansion());
|
|
580
|
+
|
|
581
|
+
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
582
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
583
|
+
var assertValidPattern = (pattern) => {
|
|
584
|
+
if (typeof pattern !== "string") {
|
|
585
|
+
throw new TypeError("invalid pattern");
|
|
586
|
+
}
|
|
587
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
588
|
+
throw new TypeError("pattern is too long");
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
593
|
+
var posixClasses = {
|
|
594
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
595
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
596
|
+
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
597
|
+
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
598
|
+
"[:cntrl:]": ["\\p{Cc}", true],
|
|
599
|
+
"[:digit:]": ["\\p{Nd}", true],
|
|
600
|
+
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
601
|
+
"[:lower:]": ["\\p{Ll}", true],
|
|
602
|
+
"[:print:]": ["\\p{C}", true],
|
|
603
|
+
"[:punct:]": ["\\p{P}", true],
|
|
604
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
605
|
+
"[:upper:]": ["\\p{Lu}", true],
|
|
606
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
607
|
+
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
608
|
+
};
|
|
609
|
+
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
610
|
+
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
611
|
+
var rangesToString = (ranges) => ranges.join("");
|
|
612
|
+
var parseClass = (glob, position) => {
|
|
613
|
+
const pos = position;
|
|
614
|
+
if (glob.charAt(pos) !== "[") {
|
|
615
|
+
throw new Error("not in a brace expression");
|
|
616
|
+
}
|
|
617
|
+
const ranges = [];
|
|
618
|
+
const negs = [];
|
|
619
|
+
let i2 = pos + 1;
|
|
620
|
+
let sawStart = false;
|
|
621
|
+
let uflag = false;
|
|
622
|
+
let escaping = false;
|
|
623
|
+
let negate = false;
|
|
624
|
+
let endPos = pos;
|
|
625
|
+
let rangeStart = "";
|
|
626
|
+
WHILE: while (i2 < glob.length) {
|
|
627
|
+
const c = glob.charAt(i2);
|
|
628
|
+
if ((c === "!" || c === "^") && i2 === pos + 1) {
|
|
629
|
+
negate = true;
|
|
630
|
+
i2++;
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
if (c === "]" && sawStart && !escaping) {
|
|
634
|
+
endPos = i2 + 1;
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
sawStart = true;
|
|
638
|
+
if (c === "\\") {
|
|
639
|
+
if (!escaping) {
|
|
640
|
+
escaping = true;
|
|
641
|
+
i2++;
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (c === "[" && !escaping) {
|
|
646
|
+
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
647
|
+
if (glob.startsWith(cls, i2)) {
|
|
648
|
+
if (rangeStart) {
|
|
649
|
+
return ["$.", false, glob.length - pos, true];
|
|
650
|
+
}
|
|
651
|
+
i2 += cls.length;
|
|
652
|
+
if (neg)
|
|
653
|
+
negs.push(unip);
|
|
654
|
+
else
|
|
655
|
+
ranges.push(unip);
|
|
656
|
+
uflag = uflag || u;
|
|
657
|
+
continue WHILE;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
escaping = false;
|
|
662
|
+
if (rangeStart) {
|
|
663
|
+
if (c > rangeStart) {
|
|
664
|
+
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
665
|
+
} else if (c === rangeStart) {
|
|
666
|
+
ranges.push(braceEscape(c));
|
|
667
|
+
}
|
|
668
|
+
rangeStart = "";
|
|
669
|
+
i2++;
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (glob.startsWith("-]", i2 + 1)) {
|
|
673
|
+
ranges.push(braceEscape(c + "-"));
|
|
674
|
+
i2 += 2;
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
if (glob.startsWith("-", i2 + 1)) {
|
|
678
|
+
rangeStart = c;
|
|
679
|
+
i2 += 2;
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
ranges.push(braceEscape(c));
|
|
683
|
+
i2++;
|
|
684
|
+
}
|
|
685
|
+
if (endPos < i2) {
|
|
686
|
+
return ["", false, 0, false];
|
|
687
|
+
}
|
|
688
|
+
if (!ranges.length && !negs.length) {
|
|
689
|
+
return ["$.", false, glob.length - pos, true];
|
|
690
|
+
}
|
|
691
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
692
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
693
|
+
return [regexpEscape(r), false, endPos - pos, false];
|
|
694
|
+
}
|
|
695
|
+
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
696
|
+
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
697
|
+
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
698
|
+
return [comb, uflag, endPos - pos, true];
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
// node_modules/minimatch/dist/esm/unescape.js
|
|
702
|
+
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
703
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
// node_modules/minimatch/dist/esm/ast.js
|
|
707
|
+
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
708
|
+
var isExtglobType = (c) => types.has(c);
|
|
709
|
+
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
710
|
+
var startNoDot = "(?!\\.)";
|
|
711
|
+
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
712
|
+
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
713
|
+
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
714
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
715
|
+
var qmark = "[^/]";
|
|
716
|
+
var star = qmark + "*?";
|
|
717
|
+
var starNoEmpty = qmark + "+?";
|
|
718
|
+
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
719
|
+
var _AST = class _AST {
|
|
720
|
+
constructor(type, parent, options = {}) {
|
|
721
|
+
__privateAdd(this, _AST_instances);
|
|
722
|
+
__publicField(this, "type");
|
|
723
|
+
__privateAdd(this, _root);
|
|
724
|
+
__privateAdd(this, _hasMagic);
|
|
725
|
+
__privateAdd(this, _uflag, false);
|
|
726
|
+
__privateAdd(this, _parts, []);
|
|
727
|
+
__privateAdd(this, _parent);
|
|
728
|
+
__privateAdd(this, _parentIndex);
|
|
729
|
+
__privateAdd(this, _negs);
|
|
730
|
+
__privateAdd(this, _filledNegs, false);
|
|
731
|
+
__privateAdd(this, _options);
|
|
732
|
+
__privateAdd(this, _toString);
|
|
733
|
+
// set to true if it's an extglob with no children
|
|
734
|
+
// (which really means one child of '')
|
|
735
|
+
__privateAdd(this, _emptyExt, false);
|
|
736
|
+
this.type = type;
|
|
737
|
+
if (type)
|
|
738
|
+
__privateSet(this, _hasMagic, true);
|
|
739
|
+
__privateSet(this, _parent, parent);
|
|
740
|
+
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
741
|
+
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
742
|
+
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
743
|
+
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
744
|
+
__privateGet(this, _negs).push(this);
|
|
745
|
+
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
746
|
+
}
|
|
747
|
+
get hasMagic() {
|
|
748
|
+
if (__privateGet(this, _hasMagic) !== void 0)
|
|
749
|
+
return __privateGet(this, _hasMagic);
|
|
750
|
+
for (const p of __privateGet(this, _parts)) {
|
|
751
|
+
if (typeof p === "string")
|
|
752
|
+
continue;
|
|
753
|
+
if (p.type || p.hasMagic)
|
|
754
|
+
return __privateSet(this, _hasMagic, true);
|
|
755
|
+
}
|
|
756
|
+
return __privateGet(this, _hasMagic);
|
|
757
|
+
}
|
|
758
|
+
// reconstructs the pattern
|
|
759
|
+
toString() {
|
|
760
|
+
if (__privateGet(this, _toString) !== void 0)
|
|
761
|
+
return __privateGet(this, _toString);
|
|
762
|
+
if (!this.type) {
|
|
763
|
+
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
764
|
+
} else {
|
|
765
|
+
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
push(...parts) {
|
|
769
|
+
for (const p of parts) {
|
|
770
|
+
if (p === "")
|
|
771
|
+
continue;
|
|
772
|
+
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
773
|
+
throw new Error("invalid part: " + p);
|
|
774
|
+
}
|
|
775
|
+
__privateGet(this, _parts).push(p);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
toJSON() {
|
|
779
|
+
var _a;
|
|
780
|
+
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())];
|
|
781
|
+
if (this.isStart() && !this.type)
|
|
782
|
+
ret.unshift([]);
|
|
783
|
+
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
|
|
784
|
+
ret.push({});
|
|
785
|
+
}
|
|
786
|
+
return ret;
|
|
787
|
+
}
|
|
788
|
+
isStart() {
|
|
789
|
+
var _a;
|
|
790
|
+
if (__privateGet(this, _root) === this)
|
|
791
|
+
return true;
|
|
792
|
+
if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
|
|
793
|
+
return false;
|
|
794
|
+
if (__privateGet(this, _parentIndex) === 0)
|
|
795
|
+
return true;
|
|
796
|
+
const p = __privateGet(this, _parent);
|
|
797
|
+
for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
|
|
798
|
+
const pp = __privateGet(p, _parts)[i2];
|
|
799
|
+
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
805
|
+
isEnd() {
|
|
806
|
+
var _a, _b, _c;
|
|
807
|
+
if (__privateGet(this, _root) === this)
|
|
808
|
+
return true;
|
|
809
|
+
if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
|
|
810
|
+
return true;
|
|
811
|
+
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
812
|
+
return false;
|
|
813
|
+
if (!this.type)
|
|
814
|
+
return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
|
|
815
|
+
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
816
|
+
return __privateGet(this, _parentIndex) === pl - 1;
|
|
817
|
+
}
|
|
818
|
+
copyIn(part) {
|
|
819
|
+
if (typeof part === "string")
|
|
820
|
+
this.push(part);
|
|
821
|
+
else
|
|
822
|
+
this.push(part.clone(this));
|
|
823
|
+
}
|
|
824
|
+
clone(parent) {
|
|
825
|
+
const c = new _AST(this.type, parent);
|
|
826
|
+
for (const p of __privateGet(this, _parts)) {
|
|
827
|
+
c.copyIn(p);
|
|
828
|
+
}
|
|
829
|
+
return c;
|
|
830
|
+
}
|
|
831
|
+
static fromGlob(pattern, options = {}) {
|
|
832
|
+
var _a;
|
|
833
|
+
const ast = new _AST(null, void 0, options);
|
|
834
|
+
__privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
835
|
+
return ast;
|
|
836
|
+
}
|
|
837
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
838
|
+
// string if not.
|
|
839
|
+
toMMPattern() {
|
|
840
|
+
if (this !== __privateGet(this, _root))
|
|
841
|
+
return __privateGet(this, _root).toMMPattern();
|
|
842
|
+
const glob = this.toString();
|
|
843
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
844
|
+
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
845
|
+
if (!anyMagic) {
|
|
846
|
+
return body;
|
|
847
|
+
}
|
|
848
|
+
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
849
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
850
|
+
_src: re,
|
|
851
|
+
_glob: glob
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
get options() {
|
|
855
|
+
return __privateGet(this, _options);
|
|
856
|
+
}
|
|
857
|
+
// returns the string match, the regexp source, whether there's magic
|
|
858
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
859
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
860
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
861
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
862
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
863
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
864
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
865
|
+
//
|
|
866
|
+
// In part-matching mode, the start is:
|
|
867
|
+
// - if not isStart: nothing
|
|
868
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
869
|
+
// - if dots allowed or not possible: ^
|
|
870
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
871
|
+
// end is:
|
|
872
|
+
// - if not isEnd(): nothing
|
|
873
|
+
// - else: $
|
|
874
|
+
//
|
|
875
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
876
|
+
// pattern, so start is:
|
|
877
|
+
// - if first pattern: same as part-matching mode
|
|
878
|
+
// - if not isStart(): nothing
|
|
879
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
880
|
+
// - if dots allowed or not possible: /
|
|
881
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
882
|
+
// end is:
|
|
883
|
+
// - if last pattern, same as part-matching mode
|
|
884
|
+
// - else nothing
|
|
885
|
+
//
|
|
886
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
887
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
888
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
889
|
+
// the pattern.
|
|
890
|
+
//
|
|
891
|
+
// We can just always return the same end, and leave it up to the caller
|
|
892
|
+
// to know whether it's going to be used joined or in parts.
|
|
893
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
894
|
+
// - if not isStart: nothing
|
|
895
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
896
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
897
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
898
|
+
//
|
|
899
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
900
|
+
// performance, so probably better to return both start options.
|
|
901
|
+
//
|
|
902
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
903
|
+
// and the start always gets applied.
|
|
904
|
+
//
|
|
905
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
906
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
907
|
+
//
|
|
908
|
+
// So the todo is:
|
|
909
|
+
// - better detect what kind of start is needed
|
|
910
|
+
// - return both flavors of starting pattern
|
|
911
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
912
|
+
//
|
|
913
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
914
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
915
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
916
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
917
|
+
//
|
|
918
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
919
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
920
|
+
// use the (?:^|/) style of start binding.
|
|
921
|
+
//
|
|
922
|
+
// Even simplified further:
|
|
923
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
924
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
925
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
926
|
+
toRegExpSource(allowDot) {
|
|
927
|
+
var _a;
|
|
928
|
+
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
929
|
+
if (__privateGet(this, _root) === this)
|
|
930
|
+
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
931
|
+
if (!this.type) {
|
|
932
|
+
const noEmpty = this.isStart() && this.isEnd();
|
|
933
|
+
const src = __privateGet(this, _parts).map((p) => {
|
|
934
|
+
var _a2;
|
|
935
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
936
|
+
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
937
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
938
|
+
return re;
|
|
939
|
+
}).join("");
|
|
940
|
+
let start2 = "";
|
|
941
|
+
if (this.isStart()) {
|
|
942
|
+
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
943
|
+
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
944
|
+
if (!dotTravAllowed) {
|
|
945
|
+
const aps = addPatternStart;
|
|
946
|
+
const needNoTrav = (
|
|
947
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
948
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
949
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
950
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
951
|
+
);
|
|
952
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
953
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
let end = "";
|
|
958
|
+
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
|
|
959
|
+
end = "(?:$|\\/)";
|
|
960
|
+
}
|
|
961
|
+
const final2 = start2 + src + end;
|
|
962
|
+
return [
|
|
963
|
+
final2,
|
|
964
|
+
unescape(src),
|
|
965
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
966
|
+
__privateGet(this, _uflag)
|
|
967
|
+
];
|
|
968
|
+
}
|
|
969
|
+
const repeated = this.type === "*" || this.type === "+";
|
|
970
|
+
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
971
|
+
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
972
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
973
|
+
const s = this.toString();
|
|
974
|
+
__privateSet(this, _parts, [s]);
|
|
975
|
+
this.type = null;
|
|
976
|
+
__privateSet(this, _hasMagic, void 0);
|
|
977
|
+
return [s, unescape(this.toString()), false, false];
|
|
978
|
+
}
|
|
979
|
+
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
980
|
+
if (bodyDotAllowed === body) {
|
|
981
|
+
bodyDotAllowed = "";
|
|
982
|
+
}
|
|
983
|
+
if (bodyDotAllowed) {
|
|
984
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
985
|
+
}
|
|
986
|
+
let final = "";
|
|
987
|
+
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
988
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
989
|
+
} else {
|
|
990
|
+
const close = this.type === "!" ? (
|
|
991
|
+
// !() must match something,but !(x) can match ''
|
|
992
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
993
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
994
|
+
final = start + body + close;
|
|
995
|
+
}
|
|
996
|
+
return [
|
|
997
|
+
final,
|
|
998
|
+
unescape(body),
|
|
999
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
1000
|
+
__privateGet(this, _uflag)
|
|
1001
|
+
];
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
_root = new WeakMap();
|
|
1005
|
+
_hasMagic = new WeakMap();
|
|
1006
|
+
_uflag = new WeakMap();
|
|
1007
|
+
_parts = new WeakMap();
|
|
1008
|
+
_parent = new WeakMap();
|
|
1009
|
+
_parentIndex = new WeakMap();
|
|
1010
|
+
_negs = new WeakMap();
|
|
1011
|
+
_filledNegs = new WeakMap();
|
|
1012
|
+
_options = new WeakMap();
|
|
1013
|
+
_toString = new WeakMap();
|
|
1014
|
+
_emptyExt = new WeakMap();
|
|
1015
|
+
_AST_instances = new WeakSet();
|
|
1016
|
+
fillNegs_fn = function() {
|
|
1017
|
+
if (this !== __privateGet(this, _root))
|
|
1018
|
+
throw new Error("should only call on root");
|
|
1019
|
+
if (__privateGet(this, _filledNegs))
|
|
1020
|
+
return this;
|
|
1021
|
+
this.toString();
|
|
1022
|
+
__privateSet(this, _filledNegs, true);
|
|
1023
|
+
let n;
|
|
1024
|
+
while (n = __privateGet(this, _negs).pop()) {
|
|
1025
|
+
if (n.type !== "!")
|
|
1026
|
+
continue;
|
|
1027
|
+
let p = n;
|
|
1028
|
+
let pp = __privateGet(p, _parent);
|
|
1029
|
+
while (pp) {
|
|
1030
|
+
for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
|
|
1031
|
+
for (const part of __privateGet(n, _parts)) {
|
|
1032
|
+
if (typeof part === "string") {
|
|
1033
|
+
throw new Error("string part in extglob AST??");
|
|
1034
|
+
}
|
|
1035
|
+
part.copyIn(__privateGet(pp, _parts)[i2]);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
p = pp;
|
|
1039
|
+
pp = __privateGet(p, _parent);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return this;
|
|
1043
|
+
};
|
|
1044
|
+
_AST_static = new WeakSet();
|
|
1045
|
+
parseAST_fn = function(str, ast, pos, opt) {
|
|
1046
|
+
var _a, _b;
|
|
1047
|
+
let escaping = false;
|
|
1048
|
+
let inBrace = false;
|
|
1049
|
+
let braceStart = -1;
|
|
1050
|
+
let braceNeg = false;
|
|
1051
|
+
if (ast.type === null) {
|
|
1052
|
+
let i3 = pos;
|
|
1053
|
+
let acc2 = "";
|
|
1054
|
+
while (i3 < str.length) {
|
|
1055
|
+
const c = str.charAt(i3++);
|
|
1056
|
+
if (escaping || c === "\\") {
|
|
1057
|
+
escaping = !escaping;
|
|
1058
|
+
acc2 += c;
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
if (inBrace) {
|
|
1062
|
+
if (i3 === braceStart + 1) {
|
|
1063
|
+
if (c === "^" || c === "!") {
|
|
1064
|
+
braceNeg = true;
|
|
1065
|
+
}
|
|
1066
|
+
} else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
|
|
1067
|
+
inBrace = false;
|
|
1068
|
+
}
|
|
1069
|
+
acc2 += c;
|
|
1070
|
+
continue;
|
|
1071
|
+
} else if (c === "[") {
|
|
1072
|
+
inBrace = true;
|
|
1073
|
+
braceStart = i3;
|
|
1074
|
+
braceNeg = false;
|
|
1075
|
+
acc2 += c;
|
|
1076
|
+
continue;
|
|
1077
|
+
}
|
|
1078
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
|
|
1079
|
+
ast.push(acc2);
|
|
1080
|
+
acc2 = "";
|
|
1081
|
+
const ext2 = new _AST(c, ast);
|
|
1082
|
+
i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
|
|
1083
|
+
ast.push(ext2);
|
|
1084
|
+
continue;
|
|
1085
|
+
}
|
|
1086
|
+
acc2 += c;
|
|
1087
|
+
}
|
|
1088
|
+
ast.push(acc2);
|
|
1089
|
+
return i3;
|
|
1090
|
+
}
|
|
1091
|
+
let i2 = pos + 1;
|
|
1092
|
+
let part = new _AST(null, ast);
|
|
1093
|
+
const parts = [];
|
|
1094
|
+
let acc = "";
|
|
1095
|
+
while (i2 < str.length) {
|
|
1096
|
+
const c = str.charAt(i2++);
|
|
1097
|
+
if (escaping || c === "\\") {
|
|
1098
|
+
escaping = !escaping;
|
|
1099
|
+
acc += c;
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
if (inBrace) {
|
|
1103
|
+
if (i2 === braceStart + 1) {
|
|
1104
|
+
if (c === "^" || c === "!") {
|
|
1105
|
+
braceNeg = true;
|
|
1106
|
+
}
|
|
1107
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
1108
|
+
inBrace = false;
|
|
1109
|
+
}
|
|
1110
|
+
acc += c;
|
|
1111
|
+
continue;
|
|
1112
|
+
} else if (c === "[") {
|
|
1113
|
+
inBrace = true;
|
|
1114
|
+
braceStart = i2;
|
|
1115
|
+
braceNeg = false;
|
|
1116
|
+
acc += c;
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (isExtglobType(c) && str.charAt(i2) === "(") {
|
|
1120
|
+
part.push(acc);
|
|
1121
|
+
acc = "";
|
|
1122
|
+
const ext2 = new _AST(c, part);
|
|
1123
|
+
part.push(ext2);
|
|
1124
|
+
i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
if (c === "|") {
|
|
1128
|
+
part.push(acc);
|
|
1129
|
+
acc = "";
|
|
1130
|
+
parts.push(part);
|
|
1131
|
+
part = new _AST(null, ast);
|
|
1132
|
+
continue;
|
|
1133
|
+
}
|
|
1134
|
+
if (c === ")") {
|
|
1135
|
+
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
1136
|
+
__privateSet(ast, _emptyExt, true);
|
|
1137
|
+
}
|
|
1138
|
+
part.push(acc);
|
|
1139
|
+
acc = "";
|
|
1140
|
+
ast.push(...parts, part);
|
|
1141
|
+
return i2;
|
|
1142
|
+
}
|
|
1143
|
+
acc += c;
|
|
1144
|
+
}
|
|
1145
|
+
ast.type = null;
|
|
1146
|
+
__privateSet(ast, _hasMagic, void 0);
|
|
1147
|
+
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
1148
|
+
return i2;
|
|
1149
|
+
};
|
|
1150
|
+
partsToRegExp_fn = function(dot) {
|
|
1151
|
+
return __privateGet(this, _parts).map((p) => {
|
|
1152
|
+
if (typeof p === "string") {
|
|
1153
|
+
throw new Error("string type in extglob ast??");
|
|
1154
|
+
}
|
|
1155
|
+
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
1156
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
1157
|
+
return re;
|
|
1158
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
1159
|
+
};
|
|
1160
|
+
parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
1161
|
+
let escaping = false;
|
|
1162
|
+
let re = "";
|
|
1163
|
+
let uflag = false;
|
|
1164
|
+
for (let i2 = 0; i2 < glob.length; i2++) {
|
|
1165
|
+
const c = glob.charAt(i2);
|
|
1166
|
+
if (escaping) {
|
|
1167
|
+
escaping = false;
|
|
1168
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
1169
|
+
continue;
|
|
1170
|
+
}
|
|
1171
|
+
if (c === "\\") {
|
|
1172
|
+
if (i2 === glob.length - 1) {
|
|
1173
|
+
re += "\\\\";
|
|
1174
|
+
} else {
|
|
1175
|
+
escaping = true;
|
|
1176
|
+
}
|
|
1177
|
+
continue;
|
|
1178
|
+
}
|
|
1179
|
+
if (c === "[") {
|
|
1180
|
+
const [src, needUflag, consumed, magic] = parseClass(glob, i2);
|
|
1181
|
+
if (consumed) {
|
|
1182
|
+
re += src;
|
|
1183
|
+
uflag = uflag || needUflag;
|
|
1184
|
+
i2 += consumed - 1;
|
|
1185
|
+
hasMagic = hasMagic || magic;
|
|
1186
|
+
continue;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
if (c === "*") {
|
|
1190
|
+
if (noEmpty && glob === "*")
|
|
1191
|
+
re += starNoEmpty;
|
|
1192
|
+
else
|
|
1193
|
+
re += star;
|
|
1194
|
+
hasMagic = true;
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
if (c === "?") {
|
|
1198
|
+
re += qmark;
|
|
1199
|
+
hasMagic = true;
|
|
1200
|
+
continue;
|
|
1201
|
+
}
|
|
1202
|
+
re += regExpEscape(c);
|
|
1203
|
+
}
|
|
1204
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
1205
|
+
};
|
|
1206
|
+
__privateAdd(_AST, _AST_static);
|
|
1207
|
+
var AST = _AST;
|
|
1208
|
+
|
|
1209
|
+
// node_modules/minimatch/dist/esm/escape.js
|
|
1210
|
+
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
1211
|
+
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
1215
|
+
var minimatch = (p, pattern, options = {}) => {
|
|
1216
|
+
assertValidPattern(pattern);
|
|
1217
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1218
|
+
return false;
|
|
1219
|
+
}
|
|
1220
|
+
return new Minimatch(pattern, options).match(p);
|
|
1221
|
+
};
|
|
1222
|
+
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1223
|
+
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1224
|
+
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1225
|
+
var starDotExtTestNocase = (ext2) => {
|
|
1226
|
+
ext2 = ext2.toLowerCase();
|
|
1227
|
+
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
1228
|
+
};
|
|
1229
|
+
var starDotExtTestNocaseDot = (ext2) => {
|
|
1230
|
+
ext2 = ext2.toLowerCase();
|
|
1231
|
+
return (f) => f.toLowerCase().endsWith(ext2);
|
|
1232
|
+
};
|
|
1233
|
+
var starDotStarRE = /^\*+\.\*+$/;
|
|
1234
|
+
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
1235
|
+
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
1236
|
+
var dotStarRE = /^\.\*+$/;
|
|
1237
|
+
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
1238
|
+
var starRE = /^\*+$/;
|
|
1239
|
+
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1240
|
+
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1241
|
+
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
1242
|
+
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1243
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1244
|
+
if (!ext2)
|
|
1245
|
+
return noext;
|
|
1246
|
+
ext2 = ext2.toLowerCase();
|
|
1247
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1248
|
+
};
|
|
1249
|
+
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
1250
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1251
|
+
if (!ext2)
|
|
1252
|
+
return noext;
|
|
1253
|
+
ext2 = ext2.toLowerCase();
|
|
1254
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1255
|
+
};
|
|
1256
|
+
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
1257
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1258
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1259
|
+
};
|
|
1260
|
+
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
1261
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1262
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1263
|
+
};
|
|
1264
|
+
var qmarksTestNoExt = ([$0]) => {
|
|
1265
|
+
const len = $0.length;
|
|
1266
|
+
return (f) => f.length === len && !f.startsWith(".");
|
|
1267
|
+
};
|
|
1268
|
+
var qmarksTestNoExtDot = ([$0]) => {
|
|
1269
|
+
const len = $0.length;
|
|
1270
|
+
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1271
|
+
};
|
|
1272
|
+
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1273
|
+
var path = {
|
|
1274
|
+
win32: { sep: "\\" },
|
|
1275
|
+
posix: { sep: "/" }
|
|
1276
|
+
};
|
|
1277
|
+
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1278
|
+
minimatch.sep = sep;
|
|
1279
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
1280
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1281
|
+
var qmark2 = "[^/]";
|
|
1282
|
+
var star2 = qmark2 + "*?";
|
|
1283
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1284
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1285
|
+
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
1286
|
+
minimatch.filter = filter;
|
|
1287
|
+
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
1288
|
+
var defaults = (def) => {
|
|
1289
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
1290
|
+
return minimatch;
|
|
1291
|
+
}
|
|
1292
|
+
const orig = minimatch;
|
|
1293
|
+
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
1294
|
+
return Object.assign(m, {
|
|
1295
|
+
Minimatch: class Minimatch extends orig.Minimatch {
|
|
1296
|
+
constructor(pattern, options = {}) {
|
|
1297
|
+
super(pattern, ext(def, options));
|
|
1298
|
+
}
|
|
1299
|
+
static defaults(options) {
|
|
1300
|
+
return orig.defaults(ext(def, options)).Minimatch;
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
AST: class AST extends orig.AST {
|
|
1304
|
+
/* c8 ignore start */
|
|
1305
|
+
constructor(type, parent, options = {}) {
|
|
1306
|
+
super(type, parent, ext(def, options));
|
|
1307
|
+
}
|
|
1308
|
+
/* c8 ignore stop */
|
|
1309
|
+
static fromGlob(pattern, options = {}) {
|
|
1310
|
+
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
1314
|
+
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
1315
|
+
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
1316
|
+
defaults: (options) => orig.defaults(ext(def, options)),
|
|
1317
|
+
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
1318
|
+
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
1319
|
+
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
1320
|
+
sep: orig.sep,
|
|
1321
|
+
GLOBSTAR
|
|
1322
|
+
});
|
|
1323
|
+
};
|
|
1324
|
+
minimatch.defaults = defaults;
|
|
1325
|
+
var braceExpand = (pattern, options = {}) => {
|
|
1326
|
+
assertValidPattern(pattern);
|
|
1327
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
1328
|
+
return [pattern];
|
|
1329
|
+
}
|
|
1330
|
+
return (0, import_brace_expansion.default)(pattern);
|
|
1331
|
+
};
|
|
1332
|
+
minimatch.braceExpand = braceExpand;
|
|
1333
|
+
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
1334
|
+
minimatch.makeRe = makeRe;
|
|
1335
|
+
var match = (list, pattern, options = {}) => {
|
|
1336
|
+
const mm = new Minimatch(pattern, options);
|
|
1337
|
+
list = list.filter((f) => mm.match(f));
|
|
1338
|
+
if (mm.options.nonull && !list.length) {
|
|
1339
|
+
list.push(pattern);
|
|
1340
|
+
}
|
|
1341
|
+
return list;
|
|
1342
|
+
};
|
|
1343
|
+
minimatch.match = match;
|
|
1344
|
+
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1345
|
+
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1346
|
+
var Minimatch = class {
|
|
1347
|
+
options;
|
|
1348
|
+
set;
|
|
1349
|
+
pattern;
|
|
1350
|
+
windowsPathsNoEscape;
|
|
1351
|
+
nonegate;
|
|
1352
|
+
negate;
|
|
1353
|
+
comment;
|
|
1354
|
+
empty;
|
|
1355
|
+
preserveMultipleSlashes;
|
|
1356
|
+
partial;
|
|
1357
|
+
globSet;
|
|
1358
|
+
globParts;
|
|
1359
|
+
nocase;
|
|
1360
|
+
isWindows;
|
|
1361
|
+
platform;
|
|
1362
|
+
windowsNoMagicRoot;
|
|
1363
|
+
regexp;
|
|
1364
|
+
constructor(pattern, options = {}) {
|
|
1365
|
+
assertValidPattern(pattern);
|
|
1366
|
+
options = options || {};
|
|
1367
|
+
this.options = options;
|
|
1368
|
+
this.pattern = pattern;
|
|
1369
|
+
this.platform = options.platform || defaultPlatform;
|
|
1370
|
+
this.isWindows = this.platform === "win32";
|
|
1371
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
1372
|
+
if (this.windowsPathsNoEscape) {
|
|
1373
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
1374
|
+
}
|
|
1375
|
+
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
1376
|
+
this.regexp = null;
|
|
1377
|
+
this.negate = false;
|
|
1378
|
+
this.nonegate = !!options.nonegate;
|
|
1379
|
+
this.comment = false;
|
|
1380
|
+
this.empty = false;
|
|
1381
|
+
this.partial = !!options.partial;
|
|
1382
|
+
this.nocase = !!this.options.nocase;
|
|
1383
|
+
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
1384
|
+
this.globSet = [];
|
|
1385
|
+
this.globParts = [];
|
|
1386
|
+
this.set = [];
|
|
1387
|
+
this.make();
|
|
1388
|
+
}
|
|
1389
|
+
hasMagic() {
|
|
1390
|
+
if (this.options.magicalBraces && this.set.length > 1) {
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
for (const pattern of this.set) {
|
|
1394
|
+
for (const part of pattern) {
|
|
1395
|
+
if (typeof part !== "string")
|
|
1396
|
+
return true;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
return false;
|
|
1400
|
+
}
|
|
1401
|
+
debug(..._) {
|
|
1402
|
+
}
|
|
1403
|
+
make() {
|
|
1404
|
+
const pattern = this.pattern;
|
|
1405
|
+
const options = this.options;
|
|
1406
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1407
|
+
this.comment = true;
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
if (!pattern) {
|
|
1411
|
+
this.empty = true;
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
this.parseNegate();
|
|
1415
|
+
this.globSet = [...new Set(this.braceExpand())];
|
|
1416
|
+
if (options.debug) {
|
|
1417
|
+
this.debug = (...args) => console.error(...args);
|
|
1418
|
+
}
|
|
1419
|
+
this.debug(this.pattern, this.globSet);
|
|
1420
|
+
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
1421
|
+
this.globParts = this.preprocess(rawGlobParts);
|
|
1422
|
+
this.debug(this.pattern, this.globParts);
|
|
1423
|
+
let set = this.globParts.map((s, _, __) => {
|
|
1424
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1425
|
+
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
1426
|
+
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
1427
|
+
if (isUNC) {
|
|
1428
|
+
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
1429
|
+
} else if (isDrive) {
|
|
1430
|
+
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
return s.map((ss) => this.parse(ss));
|
|
1434
|
+
});
|
|
1435
|
+
this.debug(this.pattern, set);
|
|
1436
|
+
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
1437
|
+
if (this.isWindows) {
|
|
1438
|
+
for (let i2 = 0; i2 < this.set.length; i2++) {
|
|
1439
|
+
const p = this.set[i2];
|
|
1440
|
+
if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
1441
|
+
p[2] = "?";
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
this.debug(this.pattern, this.set);
|
|
1446
|
+
}
|
|
1447
|
+
// various transforms to equivalent pattern sets that are
|
|
1448
|
+
// faster to process in a filesystem walk. The goal is to
|
|
1449
|
+
// eliminate what we can, and push all ** patterns as far
|
|
1450
|
+
// to the right as possible, even if it increases the number
|
|
1451
|
+
// of patterns that we have to process.
|
|
1452
|
+
preprocess(globParts) {
|
|
1453
|
+
if (this.options.noglobstar) {
|
|
1454
|
+
for (let i2 = 0; i2 < globParts.length; i2++) {
|
|
1455
|
+
for (let j = 0; j < globParts[i2].length; j++) {
|
|
1456
|
+
if (globParts[i2][j] === "**") {
|
|
1457
|
+
globParts[i2][j] = "*";
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1463
|
+
if (optimizationLevel >= 2) {
|
|
1464
|
+
globParts = this.firstPhasePreProcess(globParts);
|
|
1465
|
+
globParts = this.secondPhasePreProcess(globParts);
|
|
1466
|
+
} else if (optimizationLevel >= 1) {
|
|
1467
|
+
globParts = this.levelOneOptimize(globParts);
|
|
1468
|
+
} else {
|
|
1469
|
+
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
1470
|
+
}
|
|
1471
|
+
return globParts;
|
|
1472
|
+
}
|
|
1473
|
+
// just get rid of adjascent ** portions
|
|
1474
|
+
adjascentGlobstarOptimize(globParts) {
|
|
1475
|
+
return globParts.map((parts) => {
|
|
1476
|
+
let gs = -1;
|
|
1477
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1478
|
+
let i2 = gs;
|
|
1479
|
+
while (parts[i2 + 1] === "**") {
|
|
1480
|
+
i2++;
|
|
1481
|
+
}
|
|
1482
|
+
if (i2 !== gs) {
|
|
1483
|
+
parts.splice(gs, i2 - gs);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return parts;
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
// get rid of adjascent ** and resolve .. portions
|
|
1490
|
+
levelOneOptimize(globParts) {
|
|
1491
|
+
return globParts.map((parts) => {
|
|
1492
|
+
parts = parts.reduce((set, part) => {
|
|
1493
|
+
const prev = set[set.length - 1];
|
|
1494
|
+
if (part === "**" && prev === "**") {
|
|
1495
|
+
return set;
|
|
1496
|
+
}
|
|
1497
|
+
if (part === "..") {
|
|
1498
|
+
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
1499
|
+
set.pop();
|
|
1500
|
+
return set;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
set.push(part);
|
|
1504
|
+
return set;
|
|
1505
|
+
}, []);
|
|
1506
|
+
return parts.length === 0 ? [""] : parts;
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
levelTwoFileOptimize(parts) {
|
|
1510
|
+
if (!Array.isArray(parts)) {
|
|
1511
|
+
parts = this.slashSplit(parts);
|
|
1512
|
+
}
|
|
1513
|
+
let didSomething = false;
|
|
1514
|
+
do {
|
|
1515
|
+
didSomething = false;
|
|
1516
|
+
if (!this.preserveMultipleSlashes) {
|
|
1517
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1518
|
+
const p = parts[i2];
|
|
1519
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1520
|
+
continue;
|
|
1521
|
+
if (p === "." || p === "") {
|
|
1522
|
+
didSomething = true;
|
|
1523
|
+
parts.splice(i2, 1);
|
|
1524
|
+
i2--;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1528
|
+
didSomething = true;
|
|
1529
|
+
parts.pop();
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
let dd = 0;
|
|
1533
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1534
|
+
const p = parts[dd - 1];
|
|
1535
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1536
|
+
didSomething = true;
|
|
1537
|
+
parts.splice(dd - 1, 2);
|
|
1538
|
+
dd -= 2;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
} while (didSomething);
|
|
1542
|
+
return parts.length === 0 ? [""] : parts;
|
|
1543
|
+
}
|
|
1544
|
+
// First phase: single-pattern processing
|
|
1545
|
+
// <pre> is 1 or more portions
|
|
1546
|
+
// <rest> is 1 or more portions
|
|
1547
|
+
// <p> is any portion other than ., .., '', or **
|
|
1548
|
+
// <e> is . or ''
|
|
1549
|
+
//
|
|
1550
|
+
// **/.. is *brutal* for filesystem walking performance, because
|
|
1551
|
+
// it effectively resets the recursive walk each time it occurs,
|
|
1552
|
+
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
1553
|
+
// or most strings (other than .., ., and '') can be.
|
|
1554
|
+
//
|
|
1555
|
+
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
1556
|
+
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
1557
|
+
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
1558
|
+
// **/**/<rest> -> **/<rest>
|
|
1559
|
+
//
|
|
1560
|
+
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
1561
|
+
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
1562
|
+
firstPhasePreProcess(globParts) {
|
|
1563
|
+
let didSomething = false;
|
|
1564
|
+
do {
|
|
1565
|
+
didSomething = false;
|
|
1566
|
+
for (let parts of globParts) {
|
|
1567
|
+
let gs = -1;
|
|
1568
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1569
|
+
let gss = gs;
|
|
1570
|
+
while (parts[gss + 1] === "**") {
|
|
1571
|
+
gss++;
|
|
1572
|
+
}
|
|
1573
|
+
if (gss > gs) {
|
|
1574
|
+
parts.splice(gs + 1, gss - gs);
|
|
1575
|
+
}
|
|
1576
|
+
let next = parts[gs + 1];
|
|
1577
|
+
const p = parts[gs + 2];
|
|
1578
|
+
const p2 = parts[gs + 3];
|
|
1579
|
+
if (next !== "..")
|
|
1580
|
+
continue;
|
|
1581
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
1582
|
+
continue;
|
|
1583
|
+
}
|
|
1584
|
+
didSomething = true;
|
|
1585
|
+
parts.splice(gs, 1);
|
|
1586
|
+
const other = parts.slice(0);
|
|
1587
|
+
other[gs] = "**";
|
|
1588
|
+
globParts.push(other);
|
|
1589
|
+
gs--;
|
|
1590
|
+
}
|
|
1591
|
+
if (!this.preserveMultipleSlashes) {
|
|
1592
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1593
|
+
const p = parts[i2];
|
|
1594
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1595
|
+
continue;
|
|
1596
|
+
if (p === "." || p === "") {
|
|
1597
|
+
didSomething = true;
|
|
1598
|
+
parts.splice(i2, 1);
|
|
1599
|
+
i2--;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1603
|
+
didSomething = true;
|
|
1604
|
+
parts.pop();
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
let dd = 0;
|
|
1608
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1609
|
+
const p = parts[dd - 1];
|
|
1610
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1611
|
+
didSomething = true;
|
|
1612
|
+
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
1613
|
+
const splin = needDot ? ["."] : [];
|
|
1614
|
+
parts.splice(dd - 1, 2, ...splin);
|
|
1615
|
+
if (parts.length === 0)
|
|
1616
|
+
parts.push("");
|
|
1617
|
+
dd -= 2;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
} while (didSomething);
|
|
1622
|
+
return globParts;
|
|
1623
|
+
}
|
|
1624
|
+
// second phase: multi-pattern dedupes
|
|
1625
|
+
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
1626
|
+
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
1627
|
+
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
1628
|
+
//
|
|
1629
|
+
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
1630
|
+
// ^-- not valid because ** doens't follow symlinks
|
|
1631
|
+
secondPhasePreProcess(globParts) {
|
|
1632
|
+
for (let i2 = 0; i2 < globParts.length - 1; i2++) {
|
|
1633
|
+
for (let j = i2 + 1; j < globParts.length; j++) {
|
|
1634
|
+
const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
|
|
1635
|
+
if (!matched)
|
|
1636
|
+
continue;
|
|
1637
|
+
globParts[i2] = matched;
|
|
1638
|
+
globParts[j] = [];
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
return globParts.filter((gs) => gs.length);
|
|
1642
|
+
}
|
|
1643
|
+
partsMatch(a, b, emptyGSMatch = false) {
|
|
1644
|
+
let ai = 0;
|
|
1645
|
+
let bi = 0;
|
|
1646
|
+
let result = [];
|
|
1647
|
+
let which = "";
|
|
1648
|
+
while (ai < a.length && bi < b.length) {
|
|
1649
|
+
if (a[ai] === b[bi]) {
|
|
1650
|
+
result.push(which === "b" ? b[bi] : a[ai]);
|
|
1651
|
+
ai++;
|
|
1652
|
+
bi++;
|
|
1653
|
+
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
1654
|
+
result.push(a[ai]);
|
|
1655
|
+
ai++;
|
|
1656
|
+
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
1657
|
+
result.push(b[bi]);
|
|
1658
|
+
bi++;
|
|
1659
|
+
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
1660
|
+
if (which === "b")
|
|
1661
|
+
return false;
|
|
1662
|
+
which = "a";
|
|
1663
|
+
result.push(a[ai]);
|
|
1664
|
+
ai++;
|
|
1665
|
+
bi++;
|
|
1666
|
+
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
1667
|
+
if (which === "a")
|
|
1668
|
+
return false;
|
|
1669
|
+
which = "b";
|
|
1670
|
+
result.push(b[bi]);
|
|
1671
|
+
ai++;
|
|
1672
|
+
bi++;
|
|
1673
|
+
} else {
|
|
1674
|
+
return false;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return a.length === b.length && result;
|
|
1678
|
+
}
|
|
1679
|
+
parseNegate() {
|
|
1680
|
+
if (this.nonegate)
|
|
1681
|
+
return;
|
|
1682
|
+
const pattern = this.pattern;
|
|
1683
|
+
let negate = false;
|
|
1684
|
+
let negateOffset = 0;
|
|
1685
|
+
for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
|
|
1686
|
+
negate = !negate;
|
|
1687
|
+
negateOffset++;
|
|
1688
|
+
}
|
|
1689
|
+
if (negateOffset)
|
|
1690
|
+
this.pattern = pattern.slice(negateOffset);
|
|
1691
|
+
this.negate = negate;
|
|
1692
|
+
}
|
|
1693
|
+
// set partial to true to test if, for example,
|
|
1694
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
1695
|
+
// Partial means, if you run out of file before you run
|
|
1696
|
+
// out of pattern, then that's fine, as long as all
|
|
1697
|
+
// the parts match.
|
|
1698
|
+
matchOne(file, pattern, partial = false) {
|
|
1699
|
+
const options = this.options;
|
|
1700
|
+
if (this.isWindows) {
|
|
1701
|
+
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1702
|
+
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
1703
|
+
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
1704
|
+
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
1705
|
+
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
1706
|
+
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
1707
|
+
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
1708
|
+
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
1709
|
+
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1710
|
+
pattern[pdi] = fd;
|
|
1711
|
+
if (pdi > fdi) {
|
|
1712
|
+
pattern = pattern.slice(pdi);
|
|
1713
|
+
} else if (fdi > pdi) {
|
|
1714
|
+
file = file.slice(fdi);
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1720
|
+
if (optimizationLevel >= 2) {
|
|
1721
|
+
file = this.levelTwoFileOptimize(file);
|
|
1722
|
+
}
|
|
1723
|
+
this.debug("matchOne", this, { file, pattern });
|
|
1724
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
1725
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1726
|
+
this.debug("matchOne loop");
|
|
1727
|
+
var p = pattern[pi];
|
|
1728
|
+
var f = file[fi];
|
|
1729
|
+
this.debug(pattern, p, f);
|
|
1730
|
+
if (p === false) {
|
|
1731
|
+
return false;
|
|
1732
|
+
}
|
|
1733
|
+
if (p === GLOBSTAR) {
|
|
1734
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
1735
|
+
var fr = fi;
|
|
1736
|
+
var pr = pi + 1;
|
|
1737
|
+
if (pr === pl) {
|
|
1738
|
+
this.debug("** at the end");
|
|
1739
|
+
for (; fi < fl; fi++) {
|
|
1740
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
1741
|
+
return false;
|
|
1742
|
+
}
|
|
1743
|
+
return true;
|
|
1744
|
+
}
|
|
1745
|
+
while (fr < fl) {
|
|
1746
|
+
var swallowee = file[fr];
|
|
1747
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
1748
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1749
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1750
|
+
return true;
|
|
1751
|
+
} else {
|
|
1752
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1753
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1754
|
+
break;
|
|
1755
|
+
}
|
|
1756
|
+
this.debug("globstar swallow a segment, and continue");
|
|
1757
|
+
fr++;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
if (partial) {
|
|
1761
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
1762
|
+
if (fr === fl) {
|
|
1763
|
+
return true;
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
let hit;
|
|
1769
|
+
if (typeof p === "string") {
|
|
1770
|
+
hit = f === p;
|
|
1771
|
+
this.debug("string match", p, f, hit);
|
|
1772
|
+
} else {
|
|
1773
|
+
hit = p.test(f);
|
|
1774
|
+
this.debug("pattern match", p, f, hit);
|
|
1775
|
+
}
|
|
1776
|
+
if (!hit)
|
|
1777
|
+
return false;
|
|
1778
|
+
}
|
|
1779
|
+
if (fi === fl && pi === pl) {
|
|
1780
|
+
return true;
|
|
1781
|
+
} else if (fi === fl) {
|
|
1782
|
+
return partial;
|
|
1783
|
+
} else if (pi === pl) {
|
|
1784
|
+
return fi === fl - 1 && file[fi] === "";
|
|
1785
|
+
} else {
|
|
1786
|
+
throw new Error("wtf?");
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
braceExpand() {
|
|
1790
|
+
return braceExpand(this.pattern, this.options);
|
|
1791
|
+
}
|
|
1792
|
+
parse(pattern) {
|
|
1793
|
+
assertValidPattern(pattern);
|
|
1794
|
+
const options = this.options;
|
|
1795
|
+
if (pattern === "**")
|
|
1796
|
+
return GLOBSTAR;
|
|
1797
|
+
if (pattern === "")
|
|
1798
|
+
return "";
|
|
1799
|
+
let m;
|
|
1800
|
+
let fastTest = null;
|
|
1801
|
+
if (m = pattern.match(starRE)) {
|
|
1802
|
+
fastTest = options.dot ? starTestDot : starTest;
|
|
1803
|
+
} else if (m = pattern.match(starDotExtRE)) {
|
|
1804
|
+
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
1805
|
+
} else if (m = pattern.match(qmarksRE)) {
|
|
1806
|
+
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
1807
|
+
} else if (m = pattern.match(starDotStarRE)) {
|
|
1808
|
+
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
1809
|
+
} else if (m = pattern.match(dotStarRE)) {
|
|
1810
|
+
fastTest = dotStarTest;
|
|
1811
|
+
}
|
|
1812
|
+
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1813
|
+
if (fastTest && typeof re === "object") {
|
|
1814
|
+
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
1815
|
+
}
|
|
1816
|
+
return re;
|
|
1817
|
+
}
|
|
1818
|
+
makeRe() {
|
|
1819
|
+
if (this.regexp || this.regexp === false)
|
|
1820
|
+
return this.regexp;
|
|
1821
|
+
const set = this.set;
|
|
1822
|
+
if (!set.length) {
|
|
1823
|
+
this.regexp = false;
|
|
1824
|
+
return this.regexp;
|
|
1825
|
+
}
|
|
1826
|
+
const options = this.options;
|
|
1827
|
+
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
1828
|
+
const flags = new Set(options.nocase ? ["i"] : []);
|
|
1829
|
+
let re = set.map((pattern) => {
|
|
1830
|
+
const pp = pattern.map((p) => {
|
|
1831
|
+
if (p instanceof RegExp) {
|
|
1832
|
+
for (const f of p.flags.split(""))
|
|
1833
|
+
flags.add(f);
|
|
1834
|
+
}
|
|
1835
|
+
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1836
|
+
});
|
|
1837
|
+
pp.forEach((p, i2) => {
|
|
1838
|
+
const next = pp[i2 + 1];
|
|
1839
|
+
const prev = pp[i2 - 1];
|
|
1840
|
+
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
if (prev === void 0) {
|
|
1844
|
+
if (next !== void 0 && next !== GLOBSTAR) {
|
|
1845
|
+
pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
1846
|
+
} else {
|
|
1847
|
+
pp[i2] = twoStar;
|
|
1848
|
+
}
|
|
1849
|
+
} else if (next === void 0) {
|
|
1850
|
+
pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
|
|
1851
|
+
} else if (next !== GLOBSTAR) {
|
|
1852
|
+
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
1853
|
+
pp[i2 + 1] = GLOBSTAR;
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
|
1857
|
+
}).join("|");
|
|
1858
|
+
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1859
|
+
re = "^" + open + re + close + "$";
|
|
1860
|
+
if (this.negate)
|
|
1861
|
+
re = "^(?!" + re + ").+$";
|
|
1862
|
+
try {
|
|
1863
|
+
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1864
|
+
} catch (ex) {
|
|
1865
|
+
this.regexp = false;
|
|
1866
|
+
}
|
|
1867
|
+
return this.regexp;
|
|
1868
|
+
}
|
|
1869
|
+
slashSplit(p) {
|
|
1870
|
+
if (this.preserveMultipleSlashes) {
|
|
1871
|
+
return p.split("/");
|
|
1872
|
+
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
1873
|
+
return ["", ...p.split(/\/+/)];
|
|
1874
|
+
} else {
|
|
1875
|
+
return p.split(/\/+/);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
match(f, partial = this.partial) {
|
|
1879
|
+
this.debug("match", f, this.pattern);
|
|
1880
|
+
if (this.comment) {
|
|
1881
|
+
return false;
|
|
1882
|
+
}
|
|
1883
|
+
if (this.empty) {
|
|
1884
|
+
return f === "";
|
|
1885
|
+
}
|
|
1886
|
+
if (f === "/" && partial) {
|
|
1887
|
+
return true;
|
|
1888
|
+
}
|
|
1889
|
+
const options = this.options;
|
|
1890
|
+
if (this.isWindows) {
|
|
1891
|
+
f = f.split("\\").join("/");
|
|
1892
|
+
}
|
|
1893
|
+
const ff = this.slashSplit(f);
|
|
1894
|
+
this.debug(this.pattern, "split", ff);
|
|
1895
|
+
const set = this.set;
|
|
1896
|
+
this.debug(this.pattern, "set", set);
|
|
1897
|
+
let filename = ff[ff.length - 1];
|
|
1898
|
+
if (!filename) {
|
|
1899
|
+
for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
|
|
1900
|
+
filename = ff[i2];
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
for (let i2 = 0; i2 < set.length; i2++) {
|
|
1904
|
+
const pattern = set[i2];
|
|
1905
|
+
let file = ff;
|
|
1906
|
+
if (options.matchBase && pattern.length === 1) {
|
|
1907
|
+
file = [filename];
|
|
1908
|
+
}
|
|
1909
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
1910
|
+
if (hit) {
|
|
1911
|
+
if (options.flipNegate) {
|
|
1912
|
+
return true;
|
|
1913
|
+
}
|
|
1914
|
+
return !this.negate;
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
if (options.flipNegate) {
|
|
1918
|
+
return false;
|
|
1919
|
+
}
|
|
1920
|
+
return this.negate;
|
|
1921
|
+
}
|
|
1922
|
+
static defaults(def) {
|
|
1923
|
+
return minimatch.defaults(def).Minimatch;
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
minimatch.AST = AST;
|
|
1927
|
+
minimatch.Minimatch = Minimatch;
|
|
1928
|
+
minimatch.escape = escape;
|
|
1929
|
+
minimatch.unescape = unescape;
|
|
1930
|
+
|
|
334
1931
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
335
1932
|
function queryNonceMetaTagContent(doc) {
|
|
336
1933
|
var _a, _b, _c;
|
|
@@ -503,10 +2100,17 @@ function createStyleSheetIfNeededAndSupported(styles2) {
|
|
|
503
2100
|
var globalStyleSheet;
|
|
504
2101
|
function createShadowRoot(cmpMeta) {
|
|
505
2102
|
var _a;
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
delegatesFocus
|
|
509
|
-
}
|
|
2103
|
+
const opts = { mode: "open" };
|
|
2104
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2105
|
+
opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
|
|
2106
|
+
}
|
|
2107
|
+
if (BUILD.shadowSlotAssignmentManual) {
|
|
2108
|
+
const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
|
|
2109
|
+
if (isManual) {
|
|
2110
|
+
opts.slotAssignment = "manual";
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
const shadowRoot = this.attachShadow(opts);
|
|
510
2114
|
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
511
2115
|
if (globalStyleSheet) {
|
|
512
2116
|
if (supportsMutableAdoptedStyleSheets) {
|
|
@@ -1133,7 +2737,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
|
1133
2737
|
styles.set(scopeId2, style);
|
|
1134
2738
|
};
|
|
1135
2739
|
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
1136
|
-
var _a;
|
|
2740
|
+
var _a, _b, _c;
|
|
1137
2741
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1138
2742
|
const style = styles.get(scopeId2);
|
|
1139
2743
|
if (!BUILD.attachStyles || !win.document) {
|
|
@@ -1148,52 +2752,52 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1148
2752
|
if (!appliedStyles) {
|
|
1149
2753
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1150
2754
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1180
|
-
}
|
|
2755
|
+
const existingStyleElm = (BUILD.hydrateClientSide || BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
2756
|
+
if (existingStyleElm) {
|
|
2757
|
+
existingStyleElm.innerHTML = style;
|
|
2758
|
+
} else if (!appliedStyles.has(scopeId2)) {
|
|
2759
|
+
styleElm = win.document.createElement("style");
|
|
2760
|
+
styleElm.innerHTML = style;
|
|
2761
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2762
|
+
if (nonce != null) {
|
|
2763
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2764
|
+
}
|
|
2765
|
+
if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2766
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2767
|
+
}
|
|
2768
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2769
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2770
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2771
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2772
|
+
styleContainerNode.insertBefore(
|
|
2773
|
+
styleElm,
|
|
2774
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
2775
|
+
);
|
|
2776
|
+
} else if ("host" in styleContainerNode) {
|
|
2777
|
+
if (supportsConstructableStylesheets) {
|
|
2778
|
+
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
|
|
2779
|
+
const stylesheet = new currentWindow.CSSStyleSheet();
|
|
2780
|
+
stylesheet.replaceSync(style);
|
|
2781
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2782
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
1181
2783
|
} else {
|
|
1182
|
-
|
|
1183
|
-
if (existingStyleContainer) {
|
|
1184
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1185
|
-
} else {
|
|
1186
|
-
styleContainerNode.prepend(styleElm);
|
|
1187
|
-
}
|
|
2784
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1188
2785
|
}
|
|
1189
2786
|
} else {
|
|
1190
|
-
styleContainerNode.
|
|
2787
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2788
|
+
if (existingStyleContainer) {
|
|
2789
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2790
|
+
} else {
|
|
2791
|
+
styleContainerNode.prepend(styleElm);
|
|
2792
|
+
}
|
|
1191
2793
|
}
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
2794
|
+
} else {
|
|
2795
|
+
styleContainerNode.append(styleElm);
|
|
1195
2796
|
}
|
|
1196
2797
|
}
|
|
2798
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2799
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2800
|
+
}
|
|
1197
2801
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1198
2802
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1199
2803
|
}
|
|
@@ -1201,11 +2805,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1201
2805
|
appliedStyles.add(scopeId2);
|
|
1202
2806
|
}
|
|
1203
2807
|
}
|
|
1204
|
-
} else if (BUILD.constructableCSS
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
2808
|
+
} else if (BUILD.constructableCSS) {
|
|
2809
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2810
|
+
if (!appliedStyles) {
|
|
2811
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2812
|
+
}
|
|
2813
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2814
|
+
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
|
|
2815
|
+
let stylesheet;
|
|
2816
|
+
if (style.constructor === currentWindow.CSSStyleSheet) {
|
|
2817
|
+
stylesheet = style;
|
|
2818
|
+
} else {
|
|
2819
|
+
stylesheet = new currentWindow.CSSStyleSheet();
|
|
2820
|
+
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
|
|
2821
|
+
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2825
|
+
styleContainerNode.adoptedStyleSheets.push(stylesheet);
|
|
2826
|
+
} else {
|
|
2827
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
|
|
2828
|
+
}
|
|
2829
|
+
appliedStyles.add(scopeId2);
|
|
1209
2830
|
}
|
|
1210
2831
|
}
|
|
1211
2832
|
}
|
|
@@ -1382,7 +3003,7 @@ var validateInputProperties = (inputElm) => {
|
|
|
1382
3003
|
|
|
1383
3004
|
// src/runtime/client-hydrate.ts
|
|
1384
3005
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1385
|
-
var _a, _b;
|
|
3006
|
+
var _a, _b, _c, _d;
|
|
1386
3007
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1387
3008
|
const shadowRoot = hostElm.shadowRoot;
|
|
1388
3009
|
const childRenderNodes = [];
|
|
@@ -1475,6 +3096,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1475
3096
|
let snGroupIdx;
|
|
1476
3097
|
let snGroupLen;
|
|
1477
3098
|
let slottedItem;
|
|
3099
|
+
let currentPos = 0;
|
|
1478
3100
|
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1479
3101
|
slotGroup = slottedNodes[snIndex];
|
|
1480
3102
|
if (!slotGroup || !slotGroup.length) continue;
|
|
@@ -1488,7 +3110,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1488
3110
|
if (!hosts[slottedItem.hostId]) continue;
|
|
1489
3111
|
const hostEle = hosts[slottedItem.hostId];
|
|
1490
3112
|
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1491
|
-
hostEle.
|
|
3113
|
+
hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
|
|
1492
3114
|
}
|
|
1493
3115
|
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1494
3116
|
if (!slottedItem.slot["s-cr"]) {
|
|
@@ -1499,14 +3121,15 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1499
3121
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1500
3122
|
}
|
|
1501
3123
|
}
|
|
1502
|
-
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1503
|
-
if (((
|
|
3124
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
3125
|
+
if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
|
|
1504
3126
|
slottedItem.node.removeAttribute("slot");
|
|
1505
3127
|
}
|
|
1506
3128
|
if (BUILD.experimentalSlotFixes) {
|
|
1507
3129
|
patchSlottedNode(slottedItem.node);
|
|
1508
3130
|
}
|
|
1509
3131
|
}
|
|
3132
|
+
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
1510
3133
|
}
|
|
1511
3134
|
}
|
|
1512
3135
|
if (BUILD.scoped && scopeId2 && slotNodes.length) {
|
|
@@ -1528,7 +3151,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1528
3151
|
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
1529
3152
|
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
1530
3153
|
node.removeAttribute("hidden");
|
|
1531
|
-
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue
|
|
3154
|
+
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
|
|
1532
3155
|
node.parentNode.removeChild(node);
|
|
1533
3156
|
}
|
|
1534
3157
|
}
|
|
@@ -1695,10 +3318,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1695
3318
|
vnode.$elm$ = node;
|
|
1696
3319
|
vnode.$index$ = "0";
|
|
1697
3320
|
parentVNode.$children$ = [vnode];
|
|
1698
|
-
} else {
|
|
1699
|
-
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
|
|
1700
|
-
node.remove();
|
|
1701
|
-
}
|
|
1702
3321
|
}
|
|
1703
3322
|
return parentVNode;
|
|
1704
3323
|
};
|
|
@@ -2069,16 +3688,16 @@ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
|
2069
3688
|
let scopedSelector = "";
|
|
2070
3689
|
let startIndex = 0;
|
|
2071
3690
|
let res;
|
|
2072
|
-
const
|
|
3691
|
+
const sep2 = /( |>|\+|~(?!=))(?=(?:[^()]*\([^()]*\))*[^()]*$)\s*/g;
|
|
2073
3692
|
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2074
3693
|
let shouldScope = !hasHost;
|
|
2075
|
-
while ((res =
|
|
3694
|
+
while ((res = sep2.exec(selector)) !== null) {
|
|
2076
3695
|
const separator = res[1];
|
|
2077
3696
|
const part2 = selector.slice(startIndex, res.index).trim();
|
|
2078
3697
|
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2079
3698
|
const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
|
|
2080
3699
|
scopedSelector += `${scopedPart} ${separator} `;
|
|
2081
|
-
startIndex =
|
|
3700
|
+
startIndex = sep2.lastIndex;
|
|
2082
3701
|
}
|
|
2083
3702
|
const part = selector.substring(startIndex);
|
|
2084
3703
|
shouldScope = !part.match(_safePartRe) && (shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1);
|
|
@@ -2497,10 +4116,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2497
4116
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
2498
4117
|
}
|
|
2499
4118
|
if (newVNode2.$children$) {
|
|
4119
|
+
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
|
|
2500
4120
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
2501
4121
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
2502
4122
|
if (childNode) {
|
|
2503
|
-
|
|
4123
|
+
appendTarget.appendChild(childNode);
|
|
2504
4124
|
}
|
|
2505
4125
|
}
|
|
2506
4126
|
}
|
|
@@ -2587,6 +4207,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
2587
4207
|
if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
2588
4208
|
containerElm = containerElm.shadowRoot;
|
|
2589
4209
|
}
|
|
4210
|
+
if (parentVNode.$tag$ === "template") {
|
|
4211
|
+
containerElm = containerElm.content;
|
|
4212
|
+
}
|
|
2590
4213
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
2591
4214
|
if (vnodes[startIdx]) {
|
|
2592
4215
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -2630,6 +4253,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2630
4253
|
let newEndVnode = newCh[newEndIdx];
|
|
2631
4254
|
let node;
|
|
2632
4255
|
let elmToMove;
|
|
4256
|
+
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
|
|
2633
4257
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
2634
4258
|
if (oldStartVnode == null) {
|
|
2635
4259
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
@@ -2652,7 +4276,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2652
4276
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
2653
4277
|
}
|
|
2654
4278
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
2655
|
-
insertBefore(
|
|
4279
|
+
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
2656
4280
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
2657
4281
|
newEndVnode = newCh[--newEndIdx];
|
|
2658
4282
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
@@ -2660,7 +4284,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2660
4284
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
2661
4285
|
}
|
|
2662
4286
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
2663
|
-
insertBefore(
|
|
4287
|
+
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
2664
4288
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
2665
4289
|
newStartVnode = newCh[++newStartIdx];
|
|
2666
4290
|
} else {
|
|
@@ -2935,13 +4559,16 @@ render() {
|
|
|
2935
4559
|
for (const relocateData of relocateNodes) {
|
|
2936
4560
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2937
4561
|
const slotRefNode = relocateData.$slotRefNode$;
|
|
4562
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
|
|
4563
|
+
nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
|
|
4564
|
+
}
|
|
2938
4565
|
if (slotRefNode) {
|
|
2939
4566
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2940
4567
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2941
4568
|
if (!BUILD.hydrateServerSide && (!BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2942
|
-
let orgLocationNode = (
|
|
4569
|
+
let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
|
|
2943
4570
|
while (orgLocationNode) {
|
|
2944
|
-
let refNode = (
|
|
4571
|
+
let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
|
|
2945
4572
|
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
2946
4573
|
refNode = refNode.nextSibling;
|
|
2947
4574
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
@@ -2964,18 +4591,13 @@ render() {
|
|
|
2964
4591
|
}
|
|
2965
4592
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
2966
4593
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
2967
|
-
nodeToRelocate.hidden = (
|
|
4594
|
+
nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
|
|
2968
4595
|
}
|
|
2969
4596
|
}
|
|
2970
4597
|
}
|
|
2971
4598
|
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
2972
|
-
} else {
|
|
2973
|
-
|
|
2974
|
-
if (isInitialLoad) {
|
|
2975
|
-
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
2976
|
-
}
|
|
2977
|
-
nodeToRelocate.hidden = true;
|
|
2978
|
-
}
|
|
4599
|
+
} else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
4600
|
+
nodeToRelocate.hidden = true;
|
|
2979
4601
|
}
|
|
2980
4602
|
}
|
|
2981
4603
|
}
|
|
@@ -3329,7 +4951,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3329
4951
|
if (BUILD.serializer && BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
3330
4952
|
if (instance && cmpMeta.$serializers$ && cmpMeta.$serializers$[propName]) {
|
|
3331
4953
|
let attrVal = newVal;
|
|
3332
|
-
for (const
|
|
4954
|
+
for (const serializer of cmpMeta.$serializers$[propName]) {
|
|
4955
|
+
const [[methodName]] = Object.entries(serializer);
|
|
3333
4956
|
attrVal = instance[methodName](attrVal, propName);
|
|
3334
4957
|
}
|
|
3335
4958
|
hostRef.$serializerValues$.set(propName, attrVal);
|
|
@@ -3358,27 +4981,34 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3358
4981
|
);
|
|
3359
4982
|
}
|
|
3360
4983
|
}
|
|
3361
|
-
if (
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
4984
|
+
if (BUILD.propChangeCallback && cmpMeta.$watchers$) {
|
|
4985
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
4986
|
+
if (watchMethods) {
|
|
4987
|
+
watchMethods.map((watcher) => {
|
|
4988
|
+
try {
|
|
4989
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
4990
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
4991
|
+
if (!instance) {
|
|
4992
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
4993
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
4994
|
+
});
|
|
4995
|
+
} else {
|
|
4996
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
4997
|
+
}
|
|
3370
4998
|
}
|
|
3371
|
-
})
|
|
3372
|
-
|
|
3373
|
-
}
|
|
3374
|
-
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
3375
|
-
if (instance.componentShouldUpdate) {
|
|
3376
|
-
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
3377
|
-
return;
|
|
4999
|
+
} catch (e) {
|
|
5000
|
+
consoleError(e, elm);
|
|
3378
5001
|
}
|
|
5002
|
+
});
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5005
|
+
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
5006
|
+
if (instance.componentShouldUpdate) {
|
|
5007
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
5008
|
+
return;
|
|
3379
5009
|
}
|
|
3380
|
-
scheduleUpdate(hostRef, false);
|
|
3381
5010
|
}
|
|
5011
|
+
scheduleUpdate(hostRef, false);
|
|
3382
5012
|
}
|
|
3383
5013
|
}
|
|
3384
5014
|
};
|
|
@@ -3561,7 +5191,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3561
5191
|
this[propName] = deserializeVal;
|
|
3562
5192
|
}
|
|
3563
5193
|
};
|
|
3564
|
-
for (const
|
|
5194
|
+
for (const deserializer of cmpMeta.$deserializers$[propName]) {
|
|
5195
|
+
const [[methodName]] = Object.entries(deserializer);
|
|
3565
5196
|
if (BUILD.lazyLoad) {
|
|
3566
5197
|
if (hostRef.$lazyInstance$) {
|
|
3567
5198
|
setVal(methodName, hostRef.$lazyInstance$);
|
|
@@ -3580,13 +5211,14 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3580
5211
|
return;
|
|
3581
5212
|
} else if (propName == null) {
|
|
3582
5213
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
3583
|
-
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) &&
|
|
5214
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
|
|
3584
5215
|
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
3585
5216
|
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3586
5217
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
3587
|
-
entry == null ? void 0 : entry.forEach((
|
|
3588
|
-
|
|
3589
|
-
|
|
5218
|
+
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
5219
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
5220
|
+
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
5221
|
+
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
3590
5222
|
}
|
|
3591
5223
|
});
|
|
3592
5224
|
}
|
|
@@ -3687,7 +5319,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3687
5319
|
}
|
|
3688
5320
|
}
|
|
3689
5321
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
3690
|
-
if (!styles.has(scopeId2)) {
|
|
5322
|
+
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement && hmrVersionId) {
|
|
3691
5323
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
3692
5324
|
if (BUILD.hydrateServerSide && BUILD.shadowDom) {
|
|
3693
5325
|
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
@@ -3850,7 +5482,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3850
5482
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3851
5483
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3852
5484
|
}
|
|
3853
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5485
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
3854
5486
|
if (BUILD.experimentalSlotFixes) {
|
|
3855
5487
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3856
5488
|
} else {
|
|
@@ -4079,7 +5711,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4079
5711
|
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
4080
5712
|
}
|
|
4081
5713
|
};
|
|
4082
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5714
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
4083
5715
|
if (BUILD.experimentalSlotFixes) {
|
|
4084
5716
|
patchPseudoShadowDom(HostElement.prototype);
|
|
4085
5717
|
} else {
|