analog-clock-components 0.2.67 → 0.2.69

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.
@@ -0,0 +1,3009 @@
1
+ const NAMESPACE = 'analog-clock';
2
+ const BUILD = /* analog-clock */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
3
+
4
+ /*
5
+ Stencil Client Platform v4.40.0 | MIT Licensed | https://stenciljs.com
6
+ */
7
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __typeError = (msg) => {
14
+ throw TypeError(msg);
15
+ };
16
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __commonJS = (cb, mod) => function __require() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
+ // If the importer is in node compatibility mode or this is not an ESM
34
+ // file that has been converted to a CommonJS file using a Babel-
35
+ // compatible transform (i.e. "__esModule" has not been set), then set
36
+ // "default" to the CommonJS "module.exports" for node compatibility.
37
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
38
+ mod
39
+ ));
40
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
41
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
42
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
43
+ 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);
44
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
45
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
46
+
47
+ // node_modules/balanced-match/index.js
48
+ var require_balanced_match = __commonJS({
49
+ "node_modules/balanced-match/index.js"(exports, module) {
50
+ module.exports = balanced;
51
+ function balanced(a, b, str) {
52
+ if (a instanceof RegExp) a = maybeMatch(a, str);
53
+ if (b instanceof RegExp) b = maybeMatch(b, str);
54
+ var r = range(a, b, str);
55
+ return r && {
56
+ start: r[0],
57
+ end: r[1],
58
+ pre: str.slice(0, r[0]),
59
+ body: str.slice(r[0] + a.length, r[1]),
60
+ post: str.slice(r[1] + b.length)
61
+ };
62
+ }
63
+ function maybeMatch(reg, str) {
64
+ var m = str.match(reg);
65
+ return m ? m[0] : null;
66
+ }
67
+ balanced.range = range;
68
+ function range(a, b, str) {
69
+ var begs, beg, left, right, result;
70
+ var ai = str.indexOf(a);
71
+ var bi = str.indexOf(b, ai + 1);
72
+ var i2 = ai;
73
+ if (ai >= 0 && bi > 0) {
74
+ if (a === b) {
75
+ return [ai, bi];
76
+ }
77
+ begs = [];
78
+ left = str.length;
79
+ while (i2 >= 0 && !result) {
80
+ if (i2 == ai) {
81
+ begs.push(i2);
82
+ ai = str.indexOf(a, i2 + 1);
83
+ } else if (begs.length == 1) {
84
+ result = [begs.pop(), bi];
85
+ } else {
86
+ beg = begs.pop();
87
+ if (beg < left) {
88
+ left = beg;
89
+ right = bi;
90
+ }
91
+ bi = str.indexOf(b, i2 + 1);
92
+ }
93
+ i2 = ai < bi && ai >= 0 ? ai : bi;
94
+ }
95
+ if (begs.length) {
96
+ result = [left, right];
97
+ }
98
+ }
99
+ return result;
100
+ }
101
+ }
102
+ });
103
+
104
+ // node_modules/brace-expansion/index.js
105
+ var require_brace_expansion = __commonJS({
106
+ "node_modules/brace-expansion/index.js"(exports, module) {
107
+ var balanced = require_balanced_match();
108
+ module.exports = expandTop;
109
+ var escSlash = "\0SLASH" + Math.random() + "\0";
110
+ var escOpen = "\0OPEN" + Math.random() + "\0";
111
+ var escClose = "\0CLOSE" + Math.random() + "\0";
112
+ var escComma = "\0COMMA" + Math.random() + "\0";
113
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
114
+ function numeric(str) {
115
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
116
+ }
117
+ function escapeBraces(str) {
118
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
119
+ }
120
+ function unescapeBraces(str) {
121
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
122
+ }
123
+ function parseCommaParts(str) {
124
+ if (!str)
125
+ return [""];
126
+ var parts = [];
127
+ var m = balanced("{", "}", str);
128
+ if (!m)
129
+ return str.split(",");
130
+ var pre = m.pre;
131
+ var body = m.body;
132
+ var post = m.post;
133
+ var p = pre.split(",");
134
+ p[p.length - 1] += "{" + body + "}";
135
+ var postParts = parseCommaParts(post);
136
+ if (post.length) {
137
+ p[p.length - 1] += postParts.shift();
138
+ p.push.apply(p, postParts);
139
+ }
140
+ parts.push.apply(parts, p);
141
+ return parts;
142
+ }
143
+ function expandTop(str) {
144
+ if (!str)
145
+ return [];
146
+ if (str.substr(0, 2) === "{}") {
147
+ str = "\\{\\}" + str.substr(2);
148
+ }
149
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
150
+ }
151
+ function embrace(str) {
152
+ return "{" + str + "}";
153
+ }
154
+ function isPadded(el) {
155
+ return /^-?0\d/.test(el);
156
+ }
157
+ function lte(i2, y) {
158
+ return i2 <= y;
159
+ }
160
+ function gte(i2, y) {
161
+ return i2 >= y;
162
+ }
163
+ function expand2(str, isTop) {
164
+ var expansions = [];
165
+ var m = balanced("{", "}", str);
166
+ if (!m) return [str];
167
+ var pre = m.pre;
168
+ var post = m.post.length ? expand2(m.post, false) : [""];
169
+ if (/\$$/.test(m.pre)) {
170
+ for (var k = 0; k < post.length; k++) {
171
+ var expansion = pre + "{" + m.body + "}" + post[k];
172
+ expansions.push(expansion);
173
+ }
174
+ } else {
175
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
176
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
177
+ var isSequence = isNumericSequence || isAlphaSequence;
178
+ var isOptions = m.body.indexOf(",") >= 0;
179
+ if (!isSequence && !isOptions) {
180
+ if (m.post.match(/,(?!,).*\}/)) {
181
+ str = m.pre + "{" + m.body + escClose + m.post;
182
+ return expand2(str);
183
+ }
184
+ return [str];
185
+ }
186
+ var n;
187
+ if (isSequence) {
188
+ n = m.body.split(/\.\./);
189
+ } else {
190
+ n = parseCommaParts(m.body);
191
+ if (n.length === 1) {
192
+ n = expand2(n[0], false).map(embrace);
193
+ if (n.length === 1) {
194
+ return post.map(function(p) {
195
+ return m.pre + n[0] + p;
196
+ });
197
+ }
198
+ }
199
+ }
200
+ var N;
201
+ if (isSequence) {
202
+ var x = numeric(n[0]);
203
+ var y = numeric(n[1]);
204
+ var width = Math.max(n[0].length, n[1].length);
205
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
206
+ var test = lte;
207
+ var reverse = y < x;
208
+ if (reverse) {
209
+ incr *= -1;
210
+ test = gte;
211
+ }
212
+ var pad = n.some(isPadded);
213
+ N = [];
214
+ for (var i2 = x; test(i2, y); i2 += incr) {
215
+ var c;
216
+ if (isAlphaSequence) {
217
+ c = String.fromCharCode(i2);
218
+ if (c === "\\")
219
+ c = "";
220
+ } else {
221
+ c = String(i2);
222
+ if (pad) {
223
+ var need = width - c.length;
224
+ if (need > 0) {
225
+ var z = new Array(need + 1).join("0");
226
+ if (i2 < 0)
227
+ c = "-" + z + c.slice(1);
228
+ else
229
+ c = z + c;
230
+ }
231
+ }
232
+ }
233
+ N.push(c);
234
+ }
235
+ } else {
236
+ N = [];
237
+ for (var j = 0; j < n.length; j++) {
238
+ N.push.apply(N, expand2(n[j], false));
239
+ }
240
+ }
241
+ for (var j = 0; j < N.length; j++) {
242
+ for (var k = 0; k < post.length; k++) {
243
+ var expansion = pre + N[j] + post[k];
244
+ if (!isTop || isSequence || expansion)
245
+ expansions.push(expansion);
246
+ }
247
+ }
248
+ }
249
+ return expansions;
250
+ }
251
+ }
252
+ });
253
+
254
+ // src/utils/constants.ts
255
+ var SVG_NS = "http://www.w3.org/2000/svg";
256
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
257
+ var reWireGetterSetter = (instance, hostRef) => {
258
+ var _a;
259
+ const cmpMeta = hostRef.$cmpMeta$;
260
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
261
+ members.map(([memberName, [memberFlags]]) => {
262
+ if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
263
+ const ogValue = instance[memberName];
264
+ const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
265
+ if (ogDescriptor) {
266
+ Object.defineProperty(instance, memberName, {
267
+ get() {
268
+ return ogDescriptor.get.call(this);
269
+ },
270
+ set(newValue) {
271
+ ogDescriptor.set.call(this, newValue);
272
+ },
273
+ configurable: true,
274
+ enumerable: true
275
+ });
276
+ }
277
+ instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
278
+ }
279
+ });
280
+ };
281
+ function getPropertyDescriptor(obj, memberName) {
282
+ while (obj) {
283
+ const desc = Object.getOwnPropertyDescriptor(obj, memberName);
284
+ if (desc == null ? void 0 : desc.get) return desc;
285
+ obj = Object.getPrototypeOf(obj);
286
+ }
287
+ return void 0;
288
+ }
289
+
290
+ // src/client/client-host-ref.ts
291
+ var getHostRef = (ref) => {
292
+ if (ref.__stencil__getHostRef) {
293
+ return ref.__stencil__getHostRef();
294
+ }
295
+ return void 0;
296
+ };
297
+ var registerInstance = (lazyInstance, hostRef) => {
298
+ if (!hostRef) return;
299
+ lazyInstance.__stencil__getHostRef = () => hostRef;
300
+ hostRef.$lazyInstance$ = lazyInstance;
301
+ if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
302
+ reWireGetterSetter(lazyInstance, hostRef);
303
+ }
304
+ };
305
+ var registerHost = (hostElement, cmpMeta) => {
306
+ const hostRef = {
307
+ $flags$: 0,
308
+ $hostElement$: hostElement,
309
+ $cmpMeta$: cmpMeta,
310
+ $instanceValues$: /* @__PURE__ */ new Map(),
311
+ $serializerValues$: /* @__PURE__ */ new Map()
312
+ };
313
+ {
314
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
315
+ hostElement["s-p"] = [];
316
+ hostElement["s-rc"] = [];
317
+ }
318
+ {
319
+ hostRef.$fetchedCbList$ = [];
320
+ }
321
+ const ref = hostRef;
322
+ hostElement.__stencil__getHostRef = () => ref;
323
+ return ref;
324
+ };
325
+ var isMemberInElement = (elm, memberName) => memberName in elm;
326
+ var consoleError = (e, el) => (0, console.error)(e, el);
327
+
328
+ // src/client/client-load-module.ts
329
+ var cmpModules = /* @__PURE__ */ new Map();
330
+ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
331
+ const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
332
+ const bundleId = cmpMeta.$lazyBundleId$;
333
+ if (!bundleId) {
334
+ return void 0;
335
+ }
336
+ const module = cmpModules.get(bundleId) ;
337
+ if (module) {
338
+ return module[exportName];
339
+ }
340
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
341
+ return import(
342
+ /* @vite-ignore */
343
+ /* webpackInclude: /\.entry\.js$/ */
344
+ /* webpackExclude: /\.system\.entry\.js$/ */
345
+ /* webpackMode: "lazy" */
346
+ `./${bundleId}.entry.js${""}`
347
+ ).then(
348
+ (importedModule) => {
349
+ {
350
+ cmpModules.set(bundleId, importedModule);
351
+ }
352
+ return importedModule[exportName];
353
+ },
354
+ (e) => {
355
+ consoleError(e, hostRef.$hostElement$);
356
+ }
357
+ );
358
+ };
359
+
360
+ // src/client/client-style.ts
361
+ var styles = /* @__PURE__ */ new Map();
362
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
363
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
364
+ var win = typeof window !== "undefined" ? window : {};
365
+ var plt = {
366
+ $flags$: 0,
367
+ $resourcesUrl$: "",
368
+ jmp: (h2) => h2(),
369
+ raf: (h2) => requestAnimationFrame(h2),
370
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
371
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
372
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
373
+ };
374
+ var promiseResolve = (v) => Promise.resolve(v);
375
+ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
376
+ try {
377
+ new CSSStyleSheet();
378
+ return typeof new CSSStyleSheet().replaceSync === "function";
379
+ } catch (e) {
380
+ }
381
+ return false;
382
+ })() ;
383
+ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
384
+ var queuePending = false;
385
+ var queueDomReads = [];
386
+ var queueDomWrites = [];
387
+ var queueTask = (queue, write) => (cb) => {
388
+ queue.push(cb);
389
+ if (!queuePending) {
390
+ queuePending = true;
391
+ if (write && plt.$flags$ & 4 /* queueSync */) {
392
+ nextTick(flush);
393
+ } else {
394
+ plt.raf(flush);
395
+ }
396
+ }
397
+ };
398
+ var consume = (queue) => {
399
+ for (let i2 = 0; i2 < queue.length; i2++) {
400
+ try {
401
+ queue[i2](performance.now());
402
+ } catch (e) {
403
+ consoleError(e);
404
+ }
405
+ }
406
+ queue.length = 0;
407
+ };
408
+ var flush = () => {
409
+ consume(queueDomReads);
410
+ {
411
+ consume(queueDomWrites);
412
+ if (queuePending = queueDomReads.length > 0) {
413
+ plt.raf(flush);
414
+ }
415
+ }
416
+ };
417
+ var nextTick = (cb) => promiseResolve().then(cb);
418
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
419
+ var isComplexType = (o) => {
420
+ o = typeof o;
421
+ return o === "object" || o === "function";
422
+ };
423
+
424
+ // node_modules/minimatch/dist/esm/index.js
425
+ var import_brace_expansion = __toESM(require_brace_expansion());
426
+
427
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
428
+ var MAX_PATTERN_LENGTH = 1024 * 64;
429
+ var assertValidPattern = (pattern) => {
430
+ if (typeof pattern !== "string") {
431
+ throw new TypeError("invalid pattern");
432
+ }
433
+ if (pattern.length > MAX_PATTERN_LENGTH) {
434
+ throw new TypeError("pattern is too long");
435
+ }
436
+ };
437
+
438
+ // node_modules/minimatch/dist/esm/brace-expressions.js
439
+ var posixClasses = {
440
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
441
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
442
+ "[:ascii:]": ["\\x00-\\x7f", false],
443
+ "[:blank:]": ["\\p{Zs}\\t", true],
444
+ "[:cntrl:]": ["\\p{Cc}", true],
445
+ "[:digit:]": ["\\p{Nd}", true],
446
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
447
+ "[:lower:]": ["\\p{Ll}", true],
448
+ "[:print:]": ["\\p{C}", true],
449
+ "[:punct:]": ["\\p{P}", true],
450
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
451
+ "[:upper:]": ["\\p{Lu}", true],
452
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
453
+ "[:xdigit:]": ["A-Fa-f0-9", false]
454
+ };
455
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
456
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
457
+ var rangesToString = (ranges) => ranges.join("");
458
+ var parseClass = (glob, position) => {
459
+ const pos = position;
460
+ if (glob.charAt(pos) !== "[") {
461
+ throw new Error("not in a brace expression");
462
+ }
463
+ const ranges = [];
464
+ const negs = [];
465
+ let i2 = pos + 1;
466
+ let sawStart = false;
467
+ let uflag = false;
468
+ let escaping = false;
469
+ let negate = false;
470
+ let endPos = pos;
471
+ let rangeStart = "";
472
+ WHILE: while (i2 < glob.length) {
473
+ const c = glob.charAt(i2);
474
+ if ((c === "!" || c === "^") && i2 === pos + 1) {
475
+ negate = true;
476
+ i2++;
477
+ continue;
478
+ }
479
+ if (c === "]" && sawStart && !escaping) {
480
+ endPos = i2 + 1;
481
+ break;
482
+ }
483
+ sawStart = true;
484
+ if (c === "\\") {
485
+ if (!escaping) {
486
+ escaping = true;
487
+ i2++;
488
+ continue;
489
+ }
490
+ }
491
+ if (c === "[" && !escaping) {
492
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
493
+ if (glob.startsWith(cls, i2)) {
494
+ if (rangeStart) {
495
+ return ["$.", false, glob.length - pos, true];
496
+ }
497
+ i2 += cls.length;
498
+ if (neg)
499
+ negs.push(unip);
500
+ else
501
+ ranges.push(unip);
502
+ uflag = uflag || u;
503
+ continue WHILE;
504
+ }
505
+ }
506
+ }
507
+ escaping = false;
508
+ if (rangeStart) {
509
+ if (c > rangeStart) {
510
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
511
+ } else if (c === rangeStart) {
512
+ ranges.push(braceEscape(c));
513
+ }
514
+ rangeStart = "";
515
+ i2++;
516
+ continue;
517
+ }
518
+ if (glob.startsWith("-]", i2 + 1)) {
519
+ ranges.push(braceEscape(c + "-"));
520
+ i2 += 2;
521
+ continue;
522
+ }
523
+ if (glob.startsWith("-", i2 + 1)) {
524
+ rangeStart = c;
525
+ i2 += 2;
526
+ continue;
527
+ }
528
+ ranges.push(braceEscape(c));
529
+ i2++;
530
+ }
531
+ if (endPos < i2) {
532
+ return ["", false, 0, false];
533
+ }
534
+ if (!ranges.length && !negs.length) {
535
+ return ["$.", false, glob.length - pos, true];
536
+ }
537
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
538
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
539
+ return [regexpEscape(r), false, endPos - pos, false];
540
+ }
541
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
542
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
543
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
544
+ return [comb, uflag, endPos - pos, true];
545
+ };
546
+
547
+ // node_modules/minimatch/dist/esm/unescape.js
548
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
549
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
550
+ };
551
+
552
+ // node_modules/minimatch/dist/esm/ast.js
553
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
554
+ var isExtglobType = (c) => types.has(c);
555
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
556
+ var startNoDot = "(?!\\.)";
557
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
558
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
559
+ var reSpecials = new Set("().*{}+?[]^$\\!");
560
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
561
+ var qmark = "[^/]";
562
+ var star = qmark + "*?";
563
+ var starNoEmpty = qmark + "+?";
564
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
565
+ var _AST = class _AST {
566
+ constructor(type, parent, options = {}) {
567
+ __privateAdd(this, _AST_instances);
568
+ __publicField(this, "type");
569
+ __privateAdd(this, _root);
570
+ __privateAdd(this, _hasMagic);
571
+ __privateAdd(this, _uflag, false);
572
+ __privateAdd(this, _parts, []);
573
+ __privateAdd(this, _parent);
574
+ __privateAdd(this, _parentIndex);
575
+ __privateAdd(this, _negs);
576
+ __privateAdd(this, _filledNegs, false);
577
+ __privateAdd(this, _options);
578
+ __privateAdd(this, _toString);
579
+ // set to true if it's an extglob with no children
580
+ // (which really means one child of '')
581
+ __privateAdd(this, _emptyExt, false);
582
+ this.type = type;
583
+ if (type)
584
+ __privateSet(this, _hasMagic, true);
585
+ __privateSet(this, _parent, parent);
586
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
587
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
588
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
589
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
590
+ __privateGet(this, _negs).push(this);
591
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
592
+ }
593
+ get hasMagic() {
594
+ if (__privateGet(this, _hasMagic) !== void 0)
595
+ return __privateGet(this, _hasMagic);
596
+ for (const p of __privateGet(this, _parts)) {
597
+ if (typeof p === "string")
598
+ continue;
599
+ if (p.type || p.hasMagic)
600
+ return __privateSet(this, _hasMagic, true);
601
+ }
602
+ return __privateGet(this, _hasMagic);
603
+ }
604
+ // reconstructs the pattern
605
+ toString() {
606
+ if (__privateGet(this, _toString) !== void 0)
607
+ return __privateGet(this, _toString);
608
+ if (!this.type) {
609
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
610
+ } else {
611
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
612
+ }
613
+ }
614
+ push(...parts) {
615
+ for (const p of parts) {
616
+ if (p === "")
617
+ continue;
618
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
619
+ throw new Error("invalid part: " + p);
620
+ }
621
+ __privateGet(this, _parts).push(p);
622
+ }
623
+ }
624
+ toJSON() {
625
+ var _a;
626
+ 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())];
627
+ if (this.isStart() && !this.type)
628
+ ret.unshift([]);
629
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
630
+ ret.push({});
631
+ }
632
+ return ret;
633
+ }
634
+ isStart() {
635
+ var _a;
636
+ if (__privateGet(this, _root) === this)
637
+ return true;
638
+ if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
639
+ return false;
640
+ if (__privateGet(this, _parentIndex) === 0)
641
+ return true;
642
+ const p = __privateGet(this, _parent);
643
+ for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
644
+ const pp = __privateGet(p, _parts)[i2];
645
+ if (!(pp instanceof _AST && pp.type === "!")) {
646
+ return false;
647
+ }
648
+ }
649
+ return true;
650
+ }
651
+ isEnd() {
652
+ var _a, _b, _c;
653
+ if (__privateGet(this, _root) === this)
654
+ return true;
655
+ if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
656
+ return true;
657
+ if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
658
+ return false;
659
+ if (!this.type)
660
+ return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
661
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
662
+ return __privateGet(this, _parentIndex) === pl - 1;
663
+ }
664
+ copyIn(part) {
665
+ if (typeof part === "string")
666
+ this.push(part);
667
+ else
668
+ this.push(part.clone(this));
669
+ }
670
+ clone(parent) {
671
+ const c = new _AST(this.type, parent);
672
+ for (const p of __privateGet(this, _parts)) {
673
+ c.copyIn(p);
674
+ }
675
+ return c;
676
+ }
677
+ static fromGlob(pattern, options = {}) {
678
+ var _a;
679
+ const ast = new _AST(null, void 0, options);
680
+ __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
681
+ return ast;
682
+ }
683
+ // returns the regular expression if there's magic, or the unescaped
684
+ // string if not.
685
+ toMMPattern() {
686
+ if (this !== __privateGet(this, _root))
687
+ return __privateGet(this, _root).toMMPattern();
688
+ const glob = this.toString();
689
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
690
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
691
+ if (!anyMagic) {
692
+ return body;
693
+ }
694
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
695
+ return Object.assign(new RegExp(`^${re}$`, flags), {
696
+ _src: re,
697
+ _glob: glob
698
+ });
699
+ }
700
+ get options() {
701
+ return __privateGet(this, _options);
702
+ }
703
+ // returns the string match, the regexp source, whether there's magic
704
+ // in the regexp (so a regular expression is required) and whether or
705
+ // not the uflag is needed for the regular expression (for posix classes)
706
+ // TODO: instead of injecting the start/end at this point, just return
707
+ // the BODY of the regexp, along with the start/end portions suitable
708
+ // for binding the start/end in either a joined full-path makeRe context
709
+ // (where we bind to (^|/), or a standalone matchPart context (where
710
+ // we bind to ^, and not /). Otherwise slashes get duped!
711
+ //
712
+ // In part-matching mode, the start is:
713
+ // - if not isStart: nothing
714
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
715
+ // - if dots allowed or not possible: ^
716
+ // - if dots possible and not allowed: ^(?!\.)
717
+ // end is:
718
+ // - if not isEnd(): nothing
719
+ // - else: $
720
+ //
721
+ // In full-path matching mode, we put the slash at the START of the
722
+ // pattern, so start is:
723
+ // - if first pattern: same as part-matching mode
724
+ // - if not isStart(): nothing
725
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
726
+ // - if dots allowed or not possible: /
727
+ // - if dots possible and not allowed: /(?!\.)
728
+ // end is:
729
+ // - if last pattern, same as part-matching mode
730
+ // - else nothing
731
+ //
732
+ // Always put the (?:$|/) on negated tails, though, because that has to be
733
+ // there to bind the end of the negated pattern portion, and it's easier to
734
+ // just stick it in now rather than try to inject it later in the middle of
735
+ // the pattern.
736
+ //
737
+ // We can just always return the same end, and leave it up to the caller
738
+ // to know whether it's going to be used joined or in parts.
739
+ // And, if the start is adjusted slightly, can do the same there:
740
+ // - if not isStart: nothing
741
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
742
+ // - if dots allowed or not possible: (?:/|^)
743
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
744
+ //
745
+ // But it's better to have a simpler binding without a conditional, for
746
+ // performance, so probably better to return both start options.
747
+ //
748
+ // Then the caller just ignores the end if it's not the first pattern,
749
+ // and the start always gets applied.
750
+ //
751
+ // But that's always going to be $ if it's the ending pattern, or nothing,
752
+ // so the caller can just attach $ at the end of the pattern when building.
753
+ //
754
+ // So the todo is:
755
+ // - better detect what kind of start is needed
756
+ // - return both flavors of starting pattern
757
+ // - attach $ at the end of the pattern when creating the actual RegExp
758
+ //
759
+ // Ah, but wait, no, that all only applies to the root when the first pattern
760
+ // is not an extglob. If the first pattern IS an extglob, then we need all
761
+ // that dot prevention biz to live in the extglob portions, because eg
762
+ // +(*|.x*) can match .xy but not .yx.
763
+ //
764
+ // So, return the two flavors if it's #root and the first child is not an
765
+ // AST, otherwise leave it to the child AST to handle it, and there,
766
+ // use the (?:^|/) style of start binding.
767
+ //
768
+ // Even simplified further:
769
+ // - Since the start for a join is eg /(?!\.) and the start for a part
770
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
771
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
772
+ toRegExpSource(allowDot) {
773
+ var _a;
774
+ const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
775
+ if (__privateGet(this, _root) === this)
776
+ __privateMethod(this, _AST_instances, fillNegs_fn).call(this);
777
+ if (!this.type) {
778
+ const noEmpty = this.isStart() && this.isEnd();
779
+ const src = __privateGet(this, _parts).map((p) => {
780
+ var _a2;
781
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
782
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
783
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
784
+ return re;
785
+ }).join("");
786
+ let start2 = "";
787
+ if (this.isStart()) {
788
+ if (typeof __privateGet(this, _parts)[0] === "string") {
789
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
790
+ if (!dotTravAllowed) {
791
+ const aps = addPatternStart;
792
+ const needNoTrav = (
793
+ // dots are allowed, and the pattern starts with [ or .
794
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
795
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
796
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
797
+ );
798
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
799
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
800
+ }
801
+ }
802
+ }
803
+ let end = "";
804
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
805
+ end = "(?:$|\\/)";
806
+ }
807
+ const final2 = start2 + src + end;
808
+ return [
809
+ final2,
810
+ unescape(src),
811
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
812
+ __privateGet(this, _uflag)
813
+ ];
814
+ }
815
+ const repeated = this.type === "*" || this.type === "+";
816
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
817
+ let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
818
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
819
+ const s = this.toString();
820
+ __privateSet(this, _parts, [s]);
821
+ this.type = null;
822
+ __privateSet(this, _hasMagic, void 0);
823
+ return [s, unescape(this.toString()), false, false];
824
+ }
825
+ let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
826
+ if (bodyDotAllowed === body) {
827
+ bodyDotAllowed = "";
828
+ }
829
+ if (bodyDotAllowed) {
830
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
831
+ }
832
+ let final = "";
833
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
834
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
835
+ } else {
836
+ const close = this.type === "!" ? (
837
+ // !() must match something,but !(x) can match ''
838
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
839
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
840
+ final = start + body + close;
841
+ }
842
+ return [
843
+ final,
844
+ unescape(body),
845
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
846
+ __privateGet(this, _uflag)
847
+ ];
848
+ }
849
+ };
850
+ _root = new WeakMap();
851
+ _hasMagic = new WeakMap();
852
+ _uflag = new WeakMap();
853
+ _parts = new WeakMap();
854
+ _parent = new WeakMap();
855
+ _parentIndex = new WeakMap();
856
+ _negs = new WeakMap();
857
+ _filledNegs = new WeakMap();
858
+ _options = new WeakMap();
859
+ _toString = new WeakMap();
860
+ _emptyExt = new WeakMap();
861
+ _AST_instances = new WeakSet();
862
+ fillNegs_fn = function() {
863
+ if (this !== __privateGet(this, _root))
864
+ throw new Error("should only call on root");
865
+ if (__privateGet(this, _filledNegs))
866
+ return this;
867
+ this.toString();
868
+ __privateSet(this, _filledNegs, true);
869
+ let n;
870
+ while (n = __privateGet(this, _negs).pop()) {
871
+ if (n.type !== "!")
872
+ continue;
873
+ let p = n;
874
+ let pp = __privateGet(p, _parent);
875
+ while (pp) {
876
+ for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
877
+ for (const part of __privateGet(n, _parts)) {
878
+ if (typeof part === "string") {
879
+ throw new Error("string part in extglob AST??");
880
+ }
881
+ part.copyIn(__privateGet(pp, _parts)[i2]);
882
+ }
883
+ }
884
+ p = pp;
885
+ pp = __privateGet(p, _parent);
886
+ }
887
+ }
888
+ return this;
889
+ };
890
+ _AST_static = new WeakSet();
891
+ parseAST_fn = function(str, ast, pos, opt) {
892
+ var _a, _b;
893
+ let escaping = false;
894
+ let inBrace = false;
895
+ let braceStart = -1;
896
+ let braceNeg = false;
897
+ if (ast.type === null) {
898
+ let i3 = pos;
899
+ let acc2 = "";
900
+ while (i3 < str.length) {
901
+ const c = str.charAt(i3++);
902
+ if (escaping || c === "\\") {
903
+ escaping = !escaping;
904
+ acc2 += c;
905
+ continue;
906
+ }
907
+ if (inBrace) {
908
+ if (i3 === braceStart + 1) {
909
+ if (c === "^" || c === "!") {
910
+ braceNeg = true;
911
+ }
912
+ } else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
913
+ inBrace = false;
914
+ }
915
+ acc2 += c;
916
+ continue;
917
+ } else if (c === "[") {
918
+ inBrace = true;
919
+ braceStart = i3;
920
+ braceNeg = false;
921
+ acc2 += c;
922
+ continue;
923
+ }
924
+ if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
925
+ ast.push(acc2);
926
+ acc2 = "";
927
+ const ext2 = new _AST(c, ast);
928
+ i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
929
+ ast.push(ext2);
930
+ continue;
931
+ }
932
+ acc2 += c;
933
+ }
934
+ ast.push(acc2);
935
+ return i3;
936
+ }
937
+ let i2 = pos + 1;
938
+ let part = new _AST(null, ast);
939
+ const parts = [];
940
+ let acc = "";
941
+ while (i2 < str.length) {
942
+ const c = str.charAt(i2++);
943
+ if (escaping || c === "\\") {
944
+ escaping = !escaping;
945
+ acc += c;
946
+ continue;
947
+ }
948
+ if (inBrace) {
949
+ if (i2 === braceStart + 1) {
950
+ if (c === "^" || c === "!") {
951
+ braceNeg = true;
952
+ }
953
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
954
+ inBrace = false;
955
+ }
956
+ acc += c;
957
+ continue;
958
+ } else if (c === "[") {
959
+ inBrace = true;
960
+ braceStart = i2;
961
+ braceNeg = false;
962
+ acc += c;
963
+ continue;
964
+ }
965
+ if (isExtglobType(c) && str.charAt(i2) === "(") {
966
+ part.push(acc);
967
+ acc = "";
968
+ const ext2 = new _AST(c, part);
969
+ part.push(ext2);
970
+ i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
971
+ continue;
972
+ }
973
+ if (c === "|") {
974
+ part.push(acc);
975
+ acc = "";
976
+ parts.push(part);
977
+ part = new _AST(null, ast);
978
+ continue;
979
+ }
980
+ if (c === ")") {
981
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
982
+ __privateSet(ast, _emptyExt, true);
983
+ }
984
+ part.push(acc);
985
+ acc = "";
986
+ ast.push(...parts, part);
987
+ return i2;
988
+ }
989
+ acc += c;
990
+ }
991
+ ast.type = null;
992
+ __privateSet(ast, _hasMagic, void 0);
993
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
994
+ return i2;
995
+ };
996
+ partsToRegExp_fn = function(dot) {
997
+ return __privateGet(this, _parts).map((p) => {
998
+ if (typeof p === "string") {
999
+ throw new Error("string type in extglob ast??");
1000
+ }
1001
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
1002
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
1003
+ return re;
1004
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
1005
+ };
1006
+ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
1007
+ let escaping = false;
1008
+ let re = "";
1009
+ let uflag = false;
1010
+ for (let i2 = 0; i2 < glob.length; i2++) {
1011
+ const c = glob.charAt(i2);
1012
+ if (escaping) {
1013
+ escaping = false;
1014
+ re += (reSpecials.has(c) ? "\\" : "") + c;
1015
+ continue;
1016
+ }
1017
+ if (c === "\\") {
1018
+ if (i2 === glob.length - 1) {
1019
+ re += "\\\\";
1020
+ } else {
1021
+ escaping = true;
1022
+ }
1023
+ continue;
1024
+ }
1025
+ if (c === "[") {
1026
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
1027
+ if (consumed) {
1028
+ re += src;
1029
+ uflag = uflag || needUflag;
1030
+ i2 += consumed - 1;
1031
+ hasMagic = hasMagic || magic;
1032
+ continue;
1033
+ }
1034
+ }
1035
+ if (c === "*") {
1036
+ if (noEmpty && glob === "*")
1037
+ re += starNoEmpty;
1038
+ else
1039
+ re += star;
1040
+ hasMagic = true;
1041
+ continue;
1042
+ }
1043
+ if (c === "?") {
1044
+ re += qmark;
1045
+ hasMagic = true;
1046
+ continue;
1047
+ }
1048
+ re += regExpEscape(c);
1049
+ }
1050
+ return [re, unescape(glob), !!hasMagic, uflag];
1051
+ };
1052
+ __privateAdd(_AST, _AST_static);
1053
+ var AST = _AST;
1054
+
1055
+ // node_modules/minimatch/dist/esm/escape.js
1056
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
1057
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
1058
+ };
1059
+
1060
+ // node_modules/minimatch/dist/esm/index.js
1061
+ var minimatch = (p, pattern, options = {}) => {
1062
+ assertValidPattern(pattern);
1063
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1064
+ return false;
1065
+ }
1066
+ return new Minimatch(pattern, options).match(p);
1067
+ };
1068
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
1069
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
1070
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
1071
+ var starDotExtTestNocase = (ext2) => {
1072
+ ext2 = ext2.toLowerCase();
1073
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
1074
+ };
1075
+ var starDotExtTestNocaseDot = (ext2) => {
1076
+ ext2 = ext2.toLowerCase();
1077
+ return (f) => f.toLowerCase().endsWith(ext2);
1078
+ };
1079
+ var starDotStarRE = /^\*+\.\*+$/;
1080
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
1081
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
1082
+ var dotStarRE = /^\.\*+$/;
1083
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
1084
+ var starRE = /^\*+$/;
1085
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
1086
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
1087
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
1088
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
1089
+ const noext = qmarksTestNoExt([$0]);
1090
+ if (!ext2)
1091
+ return noext;
1092
+ ext2 = ext2.toLowerCase();
1093
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
1094
+ };
1095
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
1096
+ const noext = qmarksTestNoExtDot([$0]);
1097
+ if (!ext2)
1098
+ return noext;
1099
+ ext2 = ext2.toLowerCase();
1100
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
1101
+ };
1102
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
1103
+ const noext = qmarksTestNoExtDot([$0]);
1104
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
1105
+ };
1106
+ var qmarksTest = ([$0, ext2 = ""]) => {
1107
+ const noext = qmarksTestNoExt([$0]);
1108
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
1109
+ };
1110
+ var qmarksTestNoExt = ([$0]) => {
1111
+ const len = $0.length;
1112
+ return (f) => f.length === len && !f.startsWith(".");
1113
+ };
1114
+ var qmarksTestNoExtDot = ([$0]) => {
1115
+ const len = $0.length;
1116
+ return (f) => f.length === len && f !== "." && f !== "..";
1117
+ };
1118
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
1119
+ var path = {
1120
+ win32: { sep: "\\" },
1121
+ posix: { sep: "/" }
1122
+ };
1123
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
1124
+ minimatch.sep = sep;
1125
+ var GLOBSTAR = Symbol("globstar **");
1126
+ minimatch.GLOBSTAR = GLOBSTAR;
1127
+ var qmark2 = "[^/]";
1128
+ var star2 = qmark2 + "*?";
1129
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
1130
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
1131
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
1132
+ minimatch.filter = filter;
1133
+ var ext = (a, b = {}) => Object.assign({}, a, b);
1134
+ var defaults = (def) => {
1135
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
1136
+ return minimatch;
1137
+ }
1138
+ const orig = minimatch;
1139
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
1140
+ return Object.assign(m, {
1141
+ Minimatch: class Minimatch extends orig.Minimatch {
1142
+ constructor(pattern, options = {}) {
1143
+ super(pattern, ext(def, options));
1144
+ }
1145
+ static defaults(options) {
1146
+ return orig.defaults(ext(def, options)).Minimatch;
1147
+ }
1148
+ },
1149
+ AST: class AST extends orig.AST {
1150
+ /* c8 ignore start */
1151
+ constructor(type, parent, options = {}) {
1152
+ super(type, parent, ext(def, options));
1153
+ }
1154
+ /* c8 ignore stop */
1155
+ static fromGlob(pattern, options = {}) {
1156
+ return orig.AST.fromGlob(pattern, ext(def, options));
1157
+ }
1158
+ },
1159
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
1160
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
1161
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
1162
+ defaults: (options) => orig.defaults(ext(def, options)),
1163
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
1164
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
1165
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
1166
+ sep: orig.sep,
1167
+ GLOBSTAR
1168
+ });
1169
+ };
1170
+ minimatch.defaults = defaults;
1171
+ var braceExpand = (pattern, options = {}) => {
1172
+ assertValidPattern(pattern);
1173
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1174
+ return [pattern];
1175
+ }
1176
+ return (0, import_brace_expansion.default)(pattern);
1177
+ };
1178
+ minimatch.braceExpand = braceExpand;
1179
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
1180
+ minimatch.makeRe = makeRe;
1181
+ var match = (list, pattern, options = {}) => {
1182
+ const mm = new Minimatch(pattern, options);
1183
+ list = list.filter((f) => mm.match(f));
1184
+ if (mm.options.nonull && !list.length) {
1185
+ list.push(pattern);
1186
+ }
1187
+ return list;
1188
+ };
1189
+ minimatch.match = match;
1190
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
1191
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1192
+ var Minimatch = class {
1193
+ options;
1194
+ set;
1195
+ pattern;
1196
+ windowsPathsNoEscape;
1197
+ nonegate;
1198
+ negate;
1199
+ comment;
1200
+ empty;
1201
+ preserveMultipleSlashes;
1202
+ partial;
1203
+ globSet;
1204
+ globParts;
1205
+ nocase;
1206
+ isWindows;
1207
+ platform;
1208
+ windowsNoMagicRoot;
1209
+ regexp;
1210
+ constructor(pattern, options = {}) {
1211
+ assertValidPattern(pattern);
1212
+ options = options || {};
1213
+ this.options = options;
1214
+ this.pattern = pattern;
1215
+ this.platform = options.platform || defaultPlatform;
1216
+ this.isWindows = this.platform === "win32";
1217
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
1218
+ if (this.windowsPathsNoEscape) {
1219
+ this.pattern = this.pattern.replace(/\\/g, "/");
1220
+ }
1221
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
1222
+ this.regexp = null;
1223
+ this.negate = false;
1224
+ this.nonegate = !!options.nonegate;
1225
+ this.comment = false;
1226
+ this.empty = false;
1227
+ this.partial = !!options.partial;
1228
+ this.nocase = !!this.options.nocase;
1229
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
1230
+ this.globSet = [];
1231
+ this.globParts = [];
1232
+ this.set = [];
1233
+ this.make();
1234
+ }
1235
+ hasMagic() {
1236
+ if (this.options.magicalBraces && this.set.length > 1) {
1237
+ return true;
1238
+ }
1239
+ for (const pattern of this.set) {
1240
+ for (const part of pattern) {
1241
+ if (typeof part !== "string")
1242
+ return true;
1243
+ }
1244
+ }
1245
+ return false;
1246
+ }
1247
+ debug(..._) {
1248
+ }
1249
+ make() {
1250
+ const pattern = this.pattern;
1251
+ const options = this.options;
1252
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1253
+ this.comment = true;
1254
+ return;
1255
+ }
1256
+ if (!pattern) {
1257
+ this.empty = true;
1258
+ return;
1259
+ }
1260
+ this.parseNegate();
1261
+ this.globSet = [...new Set(this.braceExpand())];
1262
+ if (options.debug) {
1263
+ this.debug = (...args) => console.error(...args);
1264
+ }
1265
+ this.debug(this.pattern, this.globSet);
1266
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
1267
+ this.globParts = this.preprocess(rawGlobParts);
1268
+ this.debug(this.pattern, this.globParts);
1269
+ let set = this.globParts.map((s, _, __) => {
1270
+ if (this.isWindows && this.windowsNoMagicRoot) {
1271
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
1272
+ const isDrive = /^[a-z]:/i.test(s[0]);
1273
+ if (isUNC) {
1274
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
1275
+ } else if (isDrive) {
1276
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
1277
+ }
1278
+ }
1279
+ return s.map((ss) => this.parse(ss));
1280
+ });
1281
+ this.debug(this.pattern, set);
1282
+ this.set = set.filter((s) => s.indexOf(false) === -1);
1283
+ if (this.isWindows) {
1284
+ for (let i2 = 0; i2 < this.set.length; i2++) {
1285
+ const p = this.set[i2];
1286
+ if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
1287
+ p[2] = "?";
1288
+ }
1289
+ }
1290
+ }
1291
+ this.debug(this.pattern, this.set);
1292
+ }
1293
+ // various transforms to equivalent pattern sets that are
1294
+ // faster to process in a filesystem walk. The goal is to
1295
+ // eliminate what we can, and push all ** patterns as far
1296
+ // to the right as possible, even if it increases the number
1297
+ // of patterns that we have to process.
1298
+ preprocess(globParts) {
1299
+ if (this.options.noglobstar) {
1300
+ for (let i2 = 0; i2 < globParts.length; i2++) {
1301
+ for (let j = 0; j < globParts[i2].length; j++) {
1302
+ if (globParts[i2][j] === "**") {
1303
+ globParts[i2][j] = "*";
1304
+ }
1305
+ }
1306
+ }
1307
+ }
1308
+ const { optimizationLevel = 1 } = this.options;
1309
+ if (optimizationLevel >= 2) {
1310
+ globParts = this.firstPhasePreProcess(globParts);
1311
+ globParts = this.secondPhasePreProcess(globParts);
1312
+ } else if (optimizationLevel >= 1) {
1313
+ globParts = this.levelOneOptimize(globParts);
1314
+ } else {
1315
+ globParts = this.adjascentGlobstarOptimize(globParts);
1316
+ }
1317
+ return globParts;
1318
+ }
1319
+ // just get rid of adjascent ** portions
1320
+ adjascentGlobstarOptimize(globParts) {
1321
+ return globParts.map((parts) => {
1322
+ let gs = -1;
1323
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1324
+ let i2 = gs;
1325
+ while (parts[i2 + 1] === "**") {
1326
+ i2++;
1327
+ }
1328
+ if (i2 !== gs) {
1329
+ parts.splice(gs, i2 - gs);
1330
+ }
1331
+ }
1332
+ return parts;
1333
+ });
1334
+ }
1335
+ // get rid of adjascent ** and resolve .. portions
1336
+ levelOneOptimize(globParts) {
1337
+ return globParts.map((parts) => {
1338
+ parts = parts.reduce((set, part) => {
1339
+ const prev = set[set.length - 1];
1340
+ if (part === "**" && prev === "**") {
1341
+ return set;
1342
+ }
1343
+ if (part === "..") {
1344
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
1345
+ set.pop();
1346
+ return set;
1347
+ }
1348
+ }
1349
+ set.push(part);
1350
+ return set;
1351
+ }, []);
1352
+ return parts.length === 0 ? [""] : parts;
1353
+ });
1354
+ }
1355
+ levelTwoFileOptimize(parts) {
1356
+ if (!Array.isArray(parts)) {
1357
+ parts = this.slashSplit(parts);
1358
+ }
1359
+ let didSomething = false;
1360
+ do {
1361
+ didSomething = false;
1362
+ if (!this.preserveMultipleSlashes) {
1363
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1364
+ const p = parts[i2];
1365
+ if (i2 === 1 && p === "" && parts[0] === "")
1366
+ continue;
1367
+ if (p === "." || p === "") {
1368
+ didSomething = true;
1369
+ parts.splice(i2, 1);
1370
+ i2--;
1371
+ }
1372
+ }
1373
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1374
+ didSomething = true;
1375
+ parts.pop();
1376
+ }
1377
+ }
1378
+ let dd = 0;
1379
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1380
+ const p = parts[dd - 1];
1381
+ if (p && p !== "." && p !== ".." && p !== "**") {
1382
+ didSomething = true;
1383
+ parts.splice(dd - 1, 2);
1384
+ dd -= 2;
1385
+ }
1386
+ }
1387
+ } while (didSomething);
1388
+ return parts.length === 0 ? [""] : parts;
1389
+ }
1390
+ // First phase: single-pattern processing
1391
+ // <pre> is 1 or more portions
1392
+ // <rest> is 1 or more portions
1393
+ // <p> is any portion other than ., .., '', or **
1394
+ // <e> is . or ''
1395
+ //
1396
+ // **/.. is *brutal* for filesystem walking performance, because
1397
+ // it effectively resets the recursive walk each time it occurs,
1398
+ // and ** cannot be reduced out by a .. pattern part like a regexp
1399
+ // or most strings (other than .., ., and '') can be.
1400
+ //
1401
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
1402
+ // <pre>/<e>/<rest> -> <pre>/<rest>
1403
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
1404
+ // **/**/<rest> -> **/<rest>
1405
+ //
1406
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
1407
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
1408
+ firstPhasePreProcess(globParts) {
1409
+ let didSomething = false;
1410
+ do {
1411
+ didSomething = false;
1412
+ for (let parts of globParts) {
1413
+ let gs = -1;
1414
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1415
+ let gss = gs;
1416
+ while (parts[gss + 1] === "**") {
1417
+ gss++;
1418
+ }
1419
+ if (gss > gs) {
1420
+ parts.splice(gs + 1, gss - gs);
1421
+ }
1422
+ let next = parts[gs + 1];
1423
+ const p = parts[gs + 2];
1424
+ const p2 = parts[gs + 3];
1425
+ if (next !== "..")
1426
+ continue;
1427
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
1428
+ continue;
1429
+ }
1430
+ didSomething = true;
1431
+ parts.splice(gs, 1);
1432
+ const other = parts.slice(0);
1433
+ other[gs] = "**";
1434
+ globParts.push(other);
1435
+ gs--;
1436
+ }
1437
+ if (!this.preserveMultipleSlashes) {
1438
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1439
+ const p = parts[i2];
1440
+ if (i2 === 1 && p === "" && parts[0] === "")
1441
+ continue;
1442
+ if (p === "." || p === "") {
1443
+ didSomething = true;
1444
+ parts.splice(i2, 1);
1445
+ i2--;
1446
+ }
1447
+ }
1448
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1449
+ didSomething = true;
1450
+ parts.pop();
1451
+ }
1452
+ }
1453
+ let dd = 0;
1454
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1455
+ const p = parts[dd - 1];
1456
+ if (p && p !== "." && p !== ".." && p !== "**") {
1457
+ didSomething = true;
1458
+ const needDot = dd === 1 && parts[dd + 1] === "**";
1459
+ const splin = needDot ? ["."] : [];
1460
+ parts.splice(dd - 1, 2, ...splin);
1461
+ if (parts.length === 0)
1462
+ parts.push("");
1463
+ dd -= 2;
1464
+ }
1465
+ }
1466
+ }
1467
+ } while (didSomething);
1468
+ return globParts;
1469
+ }
1470
+ // second phase: multi-pattern dedupes
1471
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
1472
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
1473
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
1474
+ //
1475
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
1476
+ // ^-- not valid because ** doens't follow symlinks
1477
+ secondPhasePreProcess(globParts) {
1478
+ for (let i2 = 0; i2 < globParts.length - 1; i2++) {
1479
+ for (let j = i2 + 1; j < globParts.length; j++) {
1480
+ const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
1481
+ if (!matched)
1482
+ continue;
1483
+ globParts[i2] = matched;
1484
+ globParts[j] = [];
1485
+ }
1486
+ }
1487
+ return globParts.filter((gs) => gs.length);
1488
+ }
1489
+ partsMatch(a, b, emptyGSMatch = false) {
1490
+ let ai = 0;
1491
+ let bi = 0;
1492
+ let result = [];
1493
+ let which = "";
1494
+ while (ai < a.length && bi < b.length) {
1495
+ if (a[ai] === b[bi]) {
1496
+ result.push(which === "b" ? b[bi] : a[ai]);
1497
+ ai++;
1498
+ bi++;
1499
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
1500
+ result.push(a[ai]);
1501
+ ai++;
1502
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
1503
+ result.push(b[bi]);
1504
+ bi++;
1505
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
1506
+ if (which === "b")
1507
+ return false;
1508
+ which = "a";
1509
+ result.push(a[ai]);
1510
+ ai++;
1511
+ bi++;
1512
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
1513
+ if (which === "a")
1514
+ return false;
1515
+ which = "b";
1516
+ result.push(b[bi]);
1517
+ ai++;
1518
+ bi++;
1519
+ } else {
1520
+ return false;
1521
+ }
1522
+ }
1523
+ return a.length === b.length && result;
1524
+ }
1525
+ parseNegate() {
1526
+ if (this.nonegate)
1527
+ return;
1528
+ const pattern = this.pattern;
1529
+ let negate = false;
1530
+ let negateOffset = 0;
1531
+ for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
1532
+ negate = !negate;
1533
+ negateOffset++;
1534
+ }
1535
+ if (negateOffset)
1536
+ this.pattern = pattern.slice(negateOffset);
1537
+ this.negate = negate;
1538
+ }
1539
+ // set partial to true to test if, for example,
1540
+ // "/a/b" matches the start of "/*/b/*/d"
1541
+ // Partial means, if you run out of file before you run
1542
+ // out of pattern, then that's fine, as long as all
1543
+ // the parts match.
1544
+ matchOne(file, pattern, partial = false) {
1545
+ const options = this.options;
1546
+ if (this.isWindows) {
1547
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
1548
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
1549
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
1550
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
1551
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
1552
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
1553
+ if (typeof fdi === "number" && typeof pdi === "number") {
1554
+ const [fd, pd] = [file[fdi], pattern[pdi]];
1555
+ if (fd.toLowerCase() === pd.toLowerCase()) {
1556
+ pattern[pdi] = fd;
1557
+ if (pdi > fdi) {
1558
+ pattern = pattern.slice(pdi);
1559
+ } else if (fdi > pdi) {
1560
+ file = file.slice(fdi);
1561
+ }
1562
+ }
1563
+ }
1564
+ }
1565
+ const { optimizationLevel = 1 } = this.options;
1566
+ if (optimizationLevel >= 2) {
1567
+ file = this.levelTwoFileOptimize(file);
1568
+ }
1569
+ this.debug("matchOne", this, { file, pattern });
1570
+ this.debug("matchOne", file.length, pattern.length);
1571
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
1572
+ this.debug("matchOne loop");
1573
+ var p = pattern[pi];
1574
+ var f = file[fi];
1575
+ this.debug(pattern, p, f);
1576
+ if (p === false) {
1577
+ return false;
1578
+ }
1579
+ if (p === GLOBSTAR) {
1580
+ this.debug("GLOBSTAR", [pattern, p, f]);
1581
+ var fr = fi;
1582
+ var pr = pi + 1;
1583
+ if (pr === pl) {
1584
+ this.debug("** at the end");
1585
+ for (; fi < fl; fi++) {
1586
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
1587
+ return false;
1588
+ }
1589
+ return true;
1590
+ }
1591
+ while (fr < fl) {
1592
+ var swallowee = file[fr];
1593
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
1594
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
1595
+ this.debug("globstar found match!", fr, fl, swallowee);
1596
+ return true;
1597
+ } else {
1598
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
1599
+ this.debug("dot detected!", file, fr, pattern, pr);
1600
+ break;
1601
+ }
1602
+ this.debug("globstar swallow a segment, and continue");
1603
+ fr++;
1604
+ }
1605
+ }
1606
+ if (partial) {
1607
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
1608
+ if (fr === fl) {
1609
+ return true;
1610
+ }
1611
+ }
1612
+ return false;
1613
+ }
1614
+ let hit;
1615
+ if (typeof p === "string") {
1616
+ hit = f === p;
1617
+ this.debug("string match", p, f, hit);
1618
+ } else {
1619
+ hit = p.test(f);
1620
+ this.debug("pattern match", p, f, hit);
1621
+ }
1622
+ if (!hit)
1623
+ return false;
1624
+ }
1625
+ if (fi === fl && pi === pl) {
1626
+ return true;
1627
+ } else if (fi === fl) {
1628
+ return partial;
1629
+ } else if (pi === pl) {
1630
+ return fi === fl - 1 && file[fi] === "";
1631
+ } else {
1632
+ throw new Error("wtf?");
1633
+ }
1634
+ }
1635
+ braceExpand() {
1636
+ return braceExpand(this.pattern, this.options);
1637
+ }
1638
+ parse(pattern) {
1639
+ assertValidPattern(pattern);
1640
+ const options = this.options;
1641
+ if (pattern === "**")
1642
+ return GLOBSTAR;
1643
+ if (pattern === "")
1644
+ return "";
1645
+ let m;
1646
+ let fastTest = null;
1647
+ if (m = pattern.match(starRE)) {
1648
+ fastTest = options.dot ? starTestDot : starTest;
1649
+ } else if (m = pattern.match(starDotExtRE)) {
1650
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
1651
+ } else if (m = pattern.match(qmarksRE)) {
1652
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
1653
+ } else if (m = pattern.match(starDotStarRE)) {
1654
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
1655
+ } else if (m = pattern.match(dotStarRE)) {
1656
+ fastTest = dotStarTest;
1657
+ }
1658
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
1659
+ if (fastTest && typeof re === "object") {
1660
+ Reflect.defineProperty(re, "test", { value: fastTest });
1661
+ }
1662
+ return re;
1663
+ }
1664
+ makeRe() {
1665
+ if (this.regexp || this.regexp === false)
1666
+ return this.regexp;
1667
+ const set = this.set;
1668
+ if (!set.length) {
1669
+ this.regexp = false;
1670
+ return this.regexp;
1671
+ }
1672
+ const options = this.options;
1673
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
1674
+ const flags = new Set(options.nocase ? ["i"] : []);
1675
+ let re = set.map((pattern) => {
1676
+ const pp = pattern.map((p) => {
1677
+ if (p instanceof RegExp) {
1678
+ for (const f of p.flags.split(""))
1679
+ flags.add(f);
1680
+ }
1681
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
1682
+ });
1683
+ pp.forEach((p, i2) => {
1684
+ const next = pp[i2 + 1];
1685
+ const prev = pp[i2 - 1];
1686
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
1687
+ return;
1688
+ }
1689
+ if (prev === void 0) {
1690
+ if (next !== void 0 && next !== GLOBSTAR) {
1691
+ pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
1692
+ } else {
1693
+ pp[i2] = twoStar;
1694
+ }
1695
+ } else if (next === void 0) {
1696
+ pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
1697
+ } else if (next !== GLOBSTAR) {
1698
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
1699
+ pp[i2 + 1] = GLOBSTAR;
1700
+ }
1701
+ });
1702
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
1703
+ }).join("|");
1704
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
1705
+ re = "^" + open + re + close + "$";
1706
+ if (this.negate)
1707
+ re = "^(?!" + re + ").+$";
1708
+ try {
1709
+ this.regexp = new RegExp(re, [...flags].join(""));
1710
+ } catch (ex) {
1711
+ this.regexp = false;
1712
+ }
1713
+ return this.regexp;
1714
+ }
1715
+ slashSplit(p) {
1716
+ if (this.preserveMultipleSlashes) {
1717
+ return p.split("/");
1718
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1719
+ return ["", ...p.split(/\/+/)];
1720
+ } else {
1721
+ return p.split(/\/+/);
1722
+ }
1723
+ }
1724
+ match(f, partial = this.partial) {
1725
+ this.debug("match", f, this.pattern);
1726
+ if (this.comment) {
1727
+ return false;
1728
+ }
1729
+ if (this.empty) {
1730
+ return f === "";
1731
+ }
1732
+ if (f === "/" && partial) {
1733
+ return true;
1734
+ }
1735
+ const options = this.options;
1736
+ if (this.isWindows) {
1737
+ f = f.split("\\").join("/");
1738
+ }
1739
+ const ff = this.slashSplit(f);
1740
+ this.debug(this.pattern, "split", ff);
1741
+ const set = this.set;
1742
+ this.debug(this.pattern, "set", set);
1743
+ let filename = ff[ff.length - 1];
1744
+ if (!filename) {
1745
+ for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
1746
+ filename = ff[i2];
1747
+ }
1748
+ }
1749
+ for (let i2 = 0; i2 < set.length; i2++) {
1750
+ const pattern = set[i2];
1751
+ let file = ff;
1752
+ if (options.matchBase && pattern.length === 1) {
1753
+ file = [filename];
1754
+ }
1755
+ const hit = this.matchOne(file, pattern, partial);
1756
+ if (hit) {
1757
+ if (options.flipNegate) {
1758
+ return true;
1759
+ }
1760
+ return !this.negate;
1761
+ }
1762
+ }
1763
+ if (options.flipNegate) {
1764
+ return false;
1765
+ }
1766
+ return this.negate;
1767
+ }
1768
+ static defaults(def) {
1769
+ return minimatch.defaults(def).Minimatch;
1770
+ }
1771
+ };
1772
+ minimatch.AST = AST;
1773
+ minimatch.Minimatch = Minimatch;
1774
+ minimatch.escape = escape;
1775
+ minimatch.unescape = unescape;
1776
+
1777
+ // src/utils/query-nonce-meta-tag-content.ts
1778
+ function queryNonceMetaTagContent(doc) {
1779
+ var _a, _b, _c;
1780
+ return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
1781
+ }
1782
+
1783
+ // src/utils/regular-expression.ts
1784
+ var escapeRegExpSpecialCharacters = (text) => {
1785
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1786
+ };
1787
+
1788
+ // src/utils/result.ts
1789
+ var result_exports = {};
1790
+ __export(result_exports, {
1791
+ err: () => err,
1792
+ map: () => map,
1793
+ ok: () => ok,
1794
+ unwrap: () => unwrap,
1795
+ unwrapErr: () => unwrapErr
1796
+ });
1797
+ var ok = (value) => ({
1798
+ isOk: true,
1799
+ isErr: false,
1800
+ value
1801
+ });
1802
+ var err = (value) => ({
1803
+ isOk: false,
1804
+ isErr: true,
1805
+ value
1806
+ });
1807
+ function map(result, fn) {
1808
+ if (result.isOk) {
1809
+ const val = fn(result.value);
1810
+ if (val instanceof Promise) {
1811
+ return val.then((newVal) => ok(newVal));
1812
+ } else {
1813
+ return ok(val);
1814
+ }
1815
+ }
1816
+ if (result.isErr) {
1817
+ const value = result.value;
1818
+ return err(value);
1819
+ }
1820
+ throw "should never get here";
1821
+ }
1822
+ var unwrap = (result) => {
1823
+ if (result.isOk) {
1824
+ return result.value;
1825
+ } else {
1826
+ throw result.value;
1827
+ }
1828
+ };
1829
+ var unwrapErr = (result) => {
1830
+ if (result.isErr) {
1831
+ return result.value;
1832
+ } else {
1833
+ throw result.value;
1834
+ }
1835
+ };
1836
+
1837
+ // src/utils/style.ts
1838
+ function createStyleSheetIfNeededAndSupported(styles2) {
1839
+ return void 0;
1840
+ }
1841
+
1842
+ // src/utils/shadow-root.ts
1843
+ var globalStyleSheet;
1844
+ function createShadowRoot(cmpMeta) {
1845
+ var _a;
1846
+ const opts = { mode: "open" };
1847
+ const shadowRoot = this.attachShadow(opts);
1848
+ if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
1849
+ if (globalStyleSheet) {
1850
+ if (supportsMutableAdoptedStyleSheets) {
1851
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
1852
+ } else {
1853
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
1854
+ }
1855
+ }
1856
+ }
1857
+ var createTime = (fnName, tagName = "") => {
1858
+ {
1859
+ return () => {
1860
+ return;
1861
+ };
1862
+ }
1863
+ };
1864
+ var uniqueTime = (key, measureText) => {
1865
+ {
1866
+ return () => {
1867
+ return;
1868
+ };
1869
+ }
1870
+ };
1871
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1872
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1873
+ let style = styles.get(scopeId2);
1874
+ if (supportsConstructableStylesheets && allowCS) {
1875
+ style = style || new CSSStyleSheet();
1876
+ if (typeof style === "string") {
1877
+ style = cssText;
1878
+ } else {
1879
+ style.replaceSync(cssText);
1880
+ }
1881
+ } else {
1882
+ style = cssText;
1883
+ }
1884
+ styles.set(scopeId2, style);
1885
+ };
1886
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1887
+ var _a, _b, _c;
1888
+ const scopeId2 = getScopeId(cmpMeta);
1889
+ const style = styles.get(scopeId2);
1890
+ if (!win.document) {
1891
+ return scopeId2;
1892
+ }
1893
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1894
+ if (style) {
1895
+ if (typeof style === "string") {
1896
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1897
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1898
+ let styleElm;
1899
+ if (!appliedStyles) {
1900
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1901
+ }
1902
+ if (!appliedStyles.has(scopeId2)) {
1903
+ styleElm = win.document.createElement("style");
1904
+ styleElm.innerHTML = style;
1905
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1906
+ if (nonce != null) {
1907
+ styleElm.setAttribute("nonce", nonce);
1908
+ }
1909
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1910
+ if (styleContainerNode.nodeName === "HEAD") {
1911
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1912
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1913
+ styleContainerNode.insertBefore(
1914
+ styleElm,
1915
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1916
+ );
1917
+ } else if ("host" in styleContainerNode) {
1918
+ if (supportsConstructableStylesheets) {
1919
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
1920
+ const stylesheet = new currentWindow.CSSStyleSheet();
1921
+ stylesheet.replaceSync(style);
1922
+ if (supportsMutableAdoptedStyleSheets) {
1923
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1924
+ } else {
1925
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1926
+ }
1927
+ } else {
1928
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1929
+ if (existingStyleContainer) {
1930
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1931
+ } else {
1932
+ styleContainerNode.prepend(styleElm);
1933
+ }
1934
+ }
1935
+ } else {
1936
+ styleContainerNode.append(styleElm);
1937
+ }
1938
+ }
1939
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1940
+ styleContainerNode.insertBefore(styleElm, null);
1941
+ }
1942
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1943
+ styleElm.innerHTML += SLOT_FB_CSS;
1944
+ }
1945
+ if (appliedStyles) {
1946
+ appliedStyles.add(scopeId2);
1947
+ }
1948
+ }
1949
+ } else {
1950
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1951
+ if (!appliedStyles) {
1952
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1953
+ }
1954
+ if (!appliedStyles.has(scopeId2)) {
1955
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
1956
+ let stylesheet;
1957
+ if (style.constructor === currentWindow.CSSStyleSheet) {
1958
+ stylesheet = style;
1959
+ } else {
1960
+ stylesheet = new currentWindow.CSSStyleSheet();
1961
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
1962
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
1963
+ }
1964
+ }
1965
+ if (supportsMutableAdoptedStyleSheets) {
1966
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
1967
+ } else {
1968
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
1969
+ }
1970
+ appliedStyles.add(scopeId2);
1971
+ }
1972
+ }
1973
+ }
1974
+ return scopeId2;
1975
+ };
1976
+ var attachStyles = (hostRef) => {
1977
+ const cmpMeta = hostRef.$cmpMeta$;
1978
+ const elm = hostRef.$hostElement$;
1979
+ const flags = cmpMeta.$flags$;
1980
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1981
+ const scopeId2 = addStyle(
1982
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1983
+ cmpMeta);
1984
+ if (flags & 10 /* needsScopedEncapsulation */) {
1985
+ elm["s-sc"] = scopeId2;
1986
+ elm.classList.add(scopeId2 + "-h");
1987
+ }
1988
+ endAttachStyles();
1989
+ };
1990
+ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
1991
+ var h = (nodeName, vnodeData, ...children) => {
1992
+ if (typeof nodeName === "string") {
1993
+ nodeName = transformTag(nodeName);
1994
+ }
1995
+ let child = null;
1996
+ let key = null;
1997
+ let simple = false;
1998
+ let lastSimple = false;
1999
+ const vNodeChildren = [];
2000
+ const walk = (c) => {
2001
+ for (let i2 = 0; i2 < c.length; i2++) {
2002
+ child = c[i2];
2003
+ if (Array.isArray(child)) {
2004
+ walk(child);
2005
+ } else if (child != null && typeof child !== "boolean") {
2006
+ if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
2007
+ child = String(child);
2008
+ }
2009
+ if (simple && lastSimple) {
2010
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
2011
+ } else {
2012
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
2013
+ }
2014
+ lastSimple = simple;
2015
+ }
2016
+ }
2017
+ };
2018
+ walk(children);
2019
+ if (vnodeData) {
2020
+ if (vnodeData.key) {
2021
+ key = vnodeData.key;
2022
+ }
2023
+ {
2024
+ const classData = vnodeData.className || vnodeData.class;
2025
+ if (classData) {
2026
+ vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
2027
+ }
2028
+ }
2029
+ }
2030
+ const vnode = newVNode(nodeName, null);
2031
+ vnode.$attrs$ = vnodeData;
2032
+ if (vNodeChildren.length > 0) {
2033
+ vnode.$children$ = vNodeChildren;
2034
+ }
2035
+ {
2036
+ vnode.$key$ = key;
2037
+ }
2038
+ return vnode;
2039
+ };
2040
+ var newVNode = (tag, text) => {
2041
+ const vnode = {
2042
+ $flags$: 0,
2043
+ $tag$: tag,
2044
+ $text$: text,
2045
+ $elm$: null,
2046
+ $children$: null
2047
+ };
2048
+ {
2049
+ vnode.$attrs$ = null;
2050
+ }
2051
+ {
2052
+ vnode.$key$ = null;
2053
+ }
2054
+ return vnode;
2055
+ };
2056
+ var Host = {};
2057
+ var isHost = (node) => node && node.$tag$ === Host;
2058
+ var createSupportsRuleRe = (selector) => {
2059
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
2060
+ return new RegExp(
2061
+ // First capture group: match any context before the selector that's not inside @supports selector()
2062
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
2063
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
2064
+ "g"
2065
+ );
2066
+ };
2067
+ createSupportsRuleRe("::slotted");
2068
+ createSupportsRuleRe(":host");
2069
+ createSupportsRuleRe(":host-context");
2070
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2071
+ if (propValue != null && !isComplexType(propValue)) {
2072
+ if (propType & 2 /* Number */) {
2073
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2074
+ }
2075
+ return propValue;
2076
+ }
2077
+ return propValue;
2078
+ };
2079
+ var emitEvent = (elm, name, opts) => {
2080
+ const ev = plt.ce(name, opts);
2081
+ elm.dispatchEvent(ev);
2082
+ return ev;
2083
+ };
2084
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
2085
+ if (oldValue === newValue) {
2086
+ return;
2087
+ }
2088
+ let isProp = isMemberInElement(elm, memberName);
2089
+ memberName.toLowerCase();
2090
+ if (memberName === "class") {
2091
+ const classList = elm.classList;
2092
+ const oldClasses = parseClassList(oldValue);
2093
+ let newClasses = parseClassList(newValue);
2094
+ {
2095
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
2096
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
2097
+ }
2098
+ } else if (memberName === "key") ; else {
2099
+ const isComplex = isComplexType(newValue);
2100
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
2101
+ try {
2102
+ if (!elm.tagName.includes("-")) {
2103
+ const n = newValue == null ? "" : newValue;
2104
+ if (memberName === "list") {
2105
+ isProp = false;
2106
+ } else if (oldValue == null || elm[memberName] != n) {
2107
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
2108
+ elm[memberName] = n;
2109
+ } else {
2110
+ elm.setAttribute(memberName, n);
2111
+ }
2112
+ }
2113
+ } else if (elm[memberName] !== newValue) {
2114
+ elm[memberName] = newValue;
2115
+ }
2116
+ } catch (e) {
2117
+ }
2118
+ }
2119
+ if (newValue == null || newValue === false) {
2120
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
2121
+ {
2122
+ elm.removeAttribute(memberName);
2123
+ }
2124
+ }
2125
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
2126
+ newValue = newValue === true ? "" : newValue;
2127
+ {
2128
+ elm.setAttribute(memberName, newValue);
2129
+ }
2130
+ }
2131
+ }
2132
+ };
2133
+ var parseClassListRegex = /\s/;
2134
+ var parseClassList = (value) => {
2135
+ if (typeof value === "object" && value && "baseVal" in value) {
2136
+ value = value.baseVal;
2137
+ }
2138
+ if (!value || typeof value !== "string") {
2139
+ return [];
2140
+ }
2141
+ return value.split(parseClassListRegex);
2142
+ };
2143
+
2144
+ // src/runtime/vdom/update-element.ts
2145
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2146
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
2147
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
2148
+ const newVnodeAttrs = newVnode.$attrs$ || {};
2149
+ {
2150
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
2151
+ if (!(memberName in newVnodeAttrs)) {
2152
+ setAccessor(
2153
+ elm,
2154
+ memberName,
2155
+ oldVnodeAttrs[memberName],
2156
+ void 0,
2157
+ isSvgMode2,
2158
+ newVnode.$flags$);
2159
+ }
2160
+ }
2161
+ }
2162
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
2163
+ setAccessor(
2164
+ elm,
2165
+ memberName,
2166
+ oldVnodeAttrs[memberName],
2167
+ newVnodeAttrs[memberName],
2168
+ isSvgMode2,
2169
+ newVnode.$flags$);
2170
+ }
2171
+ };
2172
+ function sortedAttrNames(attrNames) {
2173
+ return attrNames.includes("ref") ? (
2174
+ // we need to sort these to ensure that `'ref'` is the last attr
2175
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
2176
+ ) : (
2177
+ // no need to sort, return the original array
2178
+ attrNames
2179
+ );
2180
+ }
2181
+ var hostTagName;
2182
+ var isSvgMode = false;
2183
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2184
+ const newVNode2 = newParentVNode.$children$[childIndex];
2185
+ let i2 = 0;
2186
+ let elm;
2187
+ let childNode;
2188
+ {
2189
+ if (!isSvgMode) {
2190
+ isSvgMode = newVNode2.$tag$ === "svg";
2191
+ }
2192
+ if (!win.document) {
2193
+ throw new Error(
2194
+ "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
2195
+ );
2196
+ }
2197
+ elm = newVNode2.$elm$ = win.document.createElementNS(
2198
+ isSvgMode ? SVG_NS : HTML_NS,
2199
+ newVNode2.$tag$
2200
+ ) ;
2201
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
2202
+ isSvgMode = false;
2203
+ }
2204
+ {
2205
+ updateElement(null, newVNode2, isSvgMode);
2206
+ }
2207
+ if (newVNode2.$children$) {
2208
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
2209
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
2210
+ childNode = createElm(oldParentVNode, newVNode2, i2);
2211
+ if (childNode) {
2212
+ appendTarget.appendChild(childNode);
2213
+ }
2214
+ }
2215
+ }
2216
+ {
2217
+ if (newVNode2.$tag$ === "svg") {
2218
+ isSvgMode = false;
2219
+ } else if (elm.tagName === "foreignObject") {
2220
+ isSvgMode = true;
2221
+ }
2222
+ }
2223
+ }
2224
+ elm["s-hn"] = hostTagName;
2225
+ return elm;
2226
+ };
2227
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2228
+ let containerElm = parentElm;
2229
+ let childNode;
2230
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
2231
+ containerElm = containerElm.shadowRoot;
2232
+ }
2233
+ if (parentVNode.$tag$ === "template") {
2234
+ containerElm = containerElm.content;
2235
+ }
2236
+ for (; startIdx <= endIdx; ++startIdx) {
2237
+ if (vnodes[startIdx]) {
2238
+ childNode = createElm(null, parentVNode, startIdx);
2239
+ if (childNode) {
2240
+ vnodes[startIdx].$elm$ = childNode;
2241
+ insertBefore(containerElm, childNode, before);
2242
+ }
2243
+ }
2244
+ }
2245
+ };
2246
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
2247
+ for (let index = startIdx; index <= endIdx; ++index) {
2248
+ const vnode = vnodes[index];
2249
+ if (vnode) {
2250
+ const elm = vnode.$elm$;
2251
+ if (elm) {
2252
+ elm.remove();
2253
+ }
2254
+ }
2255
+ }
2256
+ };
2257
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
2258
+ let oldStartIdx = 0;
2259
+ let newStartIdx = 0;
2260
+ let idxInOld = 0;
2261
+ let i2 = 0;
2262
+ let oldEndIdx = oldCh.length - 1;
2263
+ let oldStartVnode = oldCh[0];
2264
+ let oldEndVnode = oldCh[oldEndIdx];
2265
+ let newEndIdx = newCh.length - 1;
2266
+ let newStartVnode = newCh[0];
2267
+ let newEndVnode = newCh[newEndIdx];
2268
+ let node;
2269
+ let elmToMove;
2270
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
2271
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
2272
+ if (oldStartVnode == null) {
2273
+ oldStartVnode = oldCh[++oldStartIdx];
2274
+ } else if (oldEndVnode == null) {
2275
+ oldEndVnode = oldCh[--oldEndIdx];
2276
+ } else if (newStartVnode == null) {
2277
+ newStartVnode = newCh[++newStartIdx];
2278
+ } else if (newEndVnode == null) {
2279
+ newEndVnode = newCh[--newEndIdx];
2280
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
2281
+ patch(oldStartVnode, newStartVnode, isInitialRender);
2282
+ oldStartVnode = oldCh[++oldStartIdx];
2283
+ newStartVnode = newCh[++newStartIdx];
2284
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
2285
+ patch(oldEndVnode, newEndVnode, isInitialRender);
2286
+ oldEndVnode = oldCh[--oldEndIdx];
2287
+ newEndVnode = newCh[--newEndIdx];
2288
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
2289
+ patch(oldStartVnode, newEndVnode, isInitialRender);
2290
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2291
+ oldStartVnode = oldCh[++oldStartIdx];
2292
+ newEndVnode = newCh[--newEndIdx];
2293
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
2294
+ patch(oldEndVnode, newStartVnode, isInitialRender);
2295
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2296
+ oldEndVnode = oldCh[--oldEndIdx];
2297
+ newStartVnode = newCh[++newStartIdx];
2298
+ } else {
2299
+ idxInOld = -1;
2300
+ {
2301
+ for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
2302
+ if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
2303
+ idxInOld = i2;
2304
+ break;
2305
+ }
2306
+ }
2307
+ }
2308
+ if (idxInOld >= 0) {
2309
+ elmToMove = oldCh[idxInOld];
2310
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
2311
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
2312
+ } else {
2313
+ patch(elmToMove, newStartVnode, isInitialRender);
2314
+ oldCh[idxInOld] = void 0;
2315
+ node = elmToMove.$elm$;
2316
+ }
2317
+ newStartVnode = newCh[++newStartIdx];
2318
+ } else {
2319
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
2320
+ newStartVnode = newCh[++newStartIdx];
2321
+ }
2322
+ if (node) {
2323
+ {
2324
+ insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
2325
+ }
2326
+ }
2327
+ }
2328
+ }
2329
+ if (oldStartIdx > oldEndIdx) {
2330
+ addVnodes(
2331
+ parentElm,
2332
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
2333
+ newVNode2,
2334
+ newCh,
2335
+ newStartIdx,
2336
+ newEndIdx
2337
+ );
2338
+ } else if (newStartIdx > newEndIdx) {
2339
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
2340
+ }
2341
+ };
2342
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
2343
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
2344
+ if (!isInitialRender) {
2345
+ return leftVNode.$key$ === rightVNode.$key$;
2346
+ }
2347
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
2348
+ leftVNode.$key$ = rightVNode.$key$;
2349
+ }
2350
+ return true;
2351
+ }
2352
+ return false;
2353
+ };
2354
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2355
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
2356
+ const oldChildren = oldVNode.$children$;
2357
+ const newChildren = newVNode2.$children$;
2358
+ const tag = newVNode2.$tag$;
2359
+ {
2360
+ {
2361
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2362
+ }
2363
+ {
2364
+ updateElement(oldVNode, newVNode2, isSvgMode);
2365
+ }
2366
+ if (oldChildren !== null && newChildren !== null) {
2367
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
2368
+ } else if (newChildren !== null) {
2369
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
2370
+ } else if (
2371
+ // don't do this on initial render as it can cause non-hydrated content to be removed
2372
+ !isInitialRender && BUILD.updatable && oldChildren !== null
2373
+ ) {
2374
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
2375
+ } else ;
2376
+ if (isSvgMode && tag === "svg") {
2377
+ isSvgMode = false;
2378
+ }
2379
+ }
2380
+ };
2381
+ var insertBefore = (parent, newNode, reference) => {
2382
+ {
2383
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
2384
+ }
2385
+ };
2386
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
2387
+ const hostElm = hostRef.$hostElement$;
2388
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
2389
+ const isHostElement = isHost(renderFnResults);
2390
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
2391
+ hostTagName = hostElm.tagName;
2392
+ if (isInitialLoad && rootVnode.$attrs$) {
2393
+ for (const key of Object.keys(rootVnode.$attrs$)) {
2394
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
2395
+ rootVnode.$attrs$[key] = hostElm[key];
2396
+ }
2397
+ }
2398
+ }
2399
+ rootVnode.$tag$ = null;
2400
+ rootVnode.$flags$ |= 4 /* isHost */;
2401
+ hostRef.$vnode$ = rootVnode;
2402
+ rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
2403
+ patch(oldVNode, rootVnode, isInitialLoad);
2404
+ };
2405
+
2406
+ // src/runtime/update-component.ts
2407
+ var attachToAncestor = (hostRef, ancestorComponent) => {
2408
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2409
+ const index = ancestorComponent["s-p"].push(
2410
+ new Promise(
2411
+ (r) => hostRef.$onRenderResolve$ = () => {
2412
+ ancestorComponent["s-p"].splice(index - 1, 1);
2413
+ r();
2414
+ }
2415
+ )
2416
+ );
2417
+ }
2418
+ };
2419
+ var scheduleUpdate = (hostRef, isInitialLoad) => {
2420
+ {
2421
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
2422
+ }
2423
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2424
+ hostRef.$flags$ |= 512 /* needsRerender */;
2425
+ return;
2426
+ }
2427
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
2428
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
2429
+ if (isInitialLoad) {
2430
+ queueMicrotask(() => {
2431
+ dispatch();
2432
+ });
2433
+ return;
2434
+ }
2435
+ return writeTask(dispatch) ;
2436
+ };
2437
+ var dispatchHooks = (hostRef, isInitialLoad) => {
2438
+ const elm = hostRef.$hostElement$;
2439
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
2440
+ const instance = hostRef.$lazyInstance$ ;
2441
+ if (!instance) {
2442
+ throw new Error(
2443
+ `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
2444
+ );
2445
+ }
2446
+ let maybePromise;
2447
+ if (isInitialLoad) {
2448
+ {
2449
+ if (hostRef.$fetchedCbList$.length) {
2450
+ hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
2451
+ }
2452
+ }
2453
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
2454
+ } else {
2455
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
2456
+ }
2457
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
2458
+ endSchedule();
2459
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
2460
+ };
2461
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
2462
+ console.error(err2);
2463
+ fn();
2464
+ }) : fn();
2465
+ var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
2466
+ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2467
+ var _a;
2468
+ const elm = hostRef.$hostElement$;
2469
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
2470
+ const rc = elm["s-rc"];
2471
+ if (isInitialLoad) {
2472
+ attachStyles(hostRef);
2473
+ }
2474
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
2475
+ {
2476
+ callRender(hostRef, instance, elm, isInitialLoad);
2477
+ }
2478
+ if (rc) {
2479
+ rc.map((cb) => cb());
2480
+ elm["s-rc"] = void 0;
2481
+ }
2482
+ endRender();
2483
+ endUpdate();
2484
+ {
2485
+ const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
2486
+ const postUpdate = () => postUpdateComponent(hostRef);
2487
+ if (childrenPromises.length === 0) {
2488
+ postUpdate();
2489
+ } else {
2490
+ Promise.all(childrenPromises).then(postUpdate);
2491
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
2492
+ childrenPromises.length = 0;
2493
+ }
2494
+ }
2495
+ };
2496
+ var callRender = (hostRef, instance, elm, isInitialLoad) => {
2497
+ try {
2498
+ instance = instance.render() ;
2499
+ {
2500
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
2501
+ }
2502
+ {
2503
+ hostRef.$flags$ |= 2 /* hasRendered */;
2504
+ }
2505
+ {
2506
+ {
2507
+ {
2508
+ renderVdom(hostRef, instance, isInitialLoad);
2509
+ }
2510
+ }
2511
+ }
2512
+ } catch (e) {
2513
+ consoleError(e, hostRef.$hostElement$);
2514
+ }
2515
+ return null;
2516
+ };
2517
+ var postUpdateComponent = (hostRef) => {
2518
+ const tagName = hostRef.$cmpMeta$.$tagName$;
2519
+ const elm = hostRef.$hostElement$;
2520
+ const endPostUpdate = createTime("postUpdate", tagName);
2521
+ const instance = hostRef.$lazyInstance$ ;
2522
+ const ancestorComponent = hostRef.$ancestorComponent$;
2523
+ safeCall(instance, "componentDidRender", void 0, elm);
2524
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
2525
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
2526
+ {
2527
+ addHydratedFlag(elm);
2528
+ }
2529
+ safeCall(instance, "componentDidLoad", void 0, elm);
2530
+ endPostUpdate();
2531
+ {
2532
+ hostRef.$onReadyResolve$(elm);
2533
+ if (!ancestorComponent) {
2534
+ appDidLoad();
2535
+ }
2536
+ }
2537
+ } else {
2538
+ safeCall(instance, "componentDidUpdate", void 0, elm);
2539
+ endPostUpdate();
2540
+ }
2541
+ {
2542
+ if (hostRef.$onRenderResolve$) {
2543
+ hostRef.$onRenderResolve$();
2544
+ hostRef.$onRenderResolve$ = void 0;
2545
+ }
2546
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
2547
+ nextTick(() => scheduleUpdate(hostRef, false));
2548
+ }
2549
+ hostRef.$flags$ &= -517;
2550
+ }
2551
+ };
2552
+ var appDidLoad = (who) => {
2553
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
2554
+ };
2555
+ var safeCall = (instance, method, arg, elm) => {
2556
+ if (instance && instance[method]) {
2557
+ try {
2558
+ return instance[method](arg);
2559
+ } catch (e) {
2560
+ consoleError(e, elm);
2561
+ }
2562
+ }
2563
+ return void 0;
2564
+ };
2565
+ var addHydratedFlag = (elm) => {
2566
+ var _a;
2567
+ return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
2568
+ };
2569
+
2570
+ // src/runtime/set-value.ts
2571
+ var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2572
+ var setValue = (ref, propName, newVal, cmpMeta) => {
2573
+ const hostRef = getHostRef(ref);
2574
+ if (!hostRef) {
2575
+ return;
2576
+ }
2577
+ if (!hostRef) {
2578
+ throw new Error(
2579
+ `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
2580
+ );
2581
+ }
2582
+ const oldVal = hostRef.$instanceValues$.get(propName);
2583
+ const flags = hostRef.$flags$;
2584
+ const instance = hostRef.$lazyInstance$ ;
2585
+ newVal = parsePropertyValue(
2586
+ newVal,
2587
+ cmpMeta.$members$[propName][0]);
2588
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2589
+ const didValueChange = newVal !== oldVal && !areBothNaN;
2590
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2591
+ hostRef.$instanceValues$.set(propName, newVal);
2592
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2593
+ if (instance.componentShouldUpdate) {
2594
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2595
+ return;
2596
+ }
2597
+ }
2598
+ scheduleUpdate(hostRef, false);
2599
+ }
2600
+ }
2601
+ };
2602
+
2603
+ // src/runtime/proxy-component.ts
2604
+ var proxyComponent = (Cstr, cmpMeta, flags) => {
2605
+ var _a, _b;
2606
+ const prototype = Cstr.prototype;
2607
+ if (cmpMeta.$members$ || BUILD.propChangeCallback) {
2608
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2609
+ members.map(([memberName, [memberFlags]]) => {
2610
+ if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2611
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
2612
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
2613
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
2614
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
2615
+ Object.defineProperty(prototype, memberName, {
2616
+ get() {
2617
+ {
2618
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
2619
+ return getValue(this, memberName);
2620
+ }
2621
+ const ref = getHostRef(this);
2622
+ const instance = ref ? ref.$lazyInstance$ : prototype;
2623
+ if (!instance) return;
2624
+ return instance[memberName];
2625
+ }
2626
+ },
2627
+ configurable: true,
2628
+ enumerable: true
2629
+ });
2630
+ }
2631
+ Object.defineProperty(prototype, memberName, {
2632
+ set(newValue) {
2633
+ const ref = getHostRef(this);
2634
+ if (!ref) {
2635
+ return;
2636
+ }
2637
+ if (origSetter) {
2638
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2639
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
2640
+ newValue = ref.$instanceValues$.get(memberName);
2641
+ }
2642
+ origSetter.apply(this, [
2643
+ parsePropertyValue(
2644
+ newValue,
2645
+ memberFlags)
2646
+ ]);
2647
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2648
+ setValue(this, memberName, newValue, cmpMeta);
2649
+ return;
2650
+ }
2651
+ {
2652
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
2653
+ setValue(this, memberName, newValue, cmpMeta);
2654
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
2655
+ ref.$fetchedCbList$.push(() => {
2656
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
2657
+ ref.$lazyInstance$[memberName] = newValue;
2658
+ }
2659
+ });
2660
+ }
2661
+ return;
2662
+ }
2663
+ const setterSetVal = () => {
2664
+ const currentValue = ref.$lazyInstance$[memberName];
2665
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2666
+ ref.$instanceValues$.set(memberName, currentValue);
2667
+ }
2668
+ ref.$lazyInstance$[memberName] = parsePropertyValue(
2669
+ newValue,
2670
+ memberFlags);
2671
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
2672
+ };
2673
+ if (ref.$lazyInstance$) {
2674
+ setterSetVal();
2675
+ } else {
2676
+ ref.$fetchedCbList$.push(() => {
2677
+ setterSetVal();
2678
+ });
2679
+ }
2680
+ }
2681
+ }
2682
+ });
2683
+ }
2684
+ });
2685
+ if ((flags & 1 /* isElementConstructor */)) {
2686
+ const attrNameToPropName = /* @__PURE__ */ new Map();
2687
+ prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2688
+ plt.jmp(() => {
2689
+ var _a2;
2690
+ const propName = attrNameToPropName.get(attrName);
2691
+ const hostRef = getHostRef(this);
2692
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
2693
+ newValue = this[propName];
2694
+ delete this[propName];
2695
+ }
2696
+ if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
2697
+ this[propName] == newValue) {
2698
+ return;
2699
+ } else if (propName == null) {
2700
+ const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2701
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
2702
+ const instance = hostRef.$lazyInstance$ ;
2703
+ const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2704
+ entry == null ? void 0 : entry.forEach((watcher) => {
2705
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
2706
+ if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
2707
+ instance[watchMethodName].call(instance, newValue, oldValue, attrName);
2708
+ }
2709
+ });
2710
+ }
2711
+ return;
2712
+ }
2713
+ const propFlags = members.find(([m]) => m === propName);
2714
+ if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
2715
+ newValue = newValue === null || newValue === "false" ? false : true;
2716
+ }
2717
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2718
+ if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
2719
+ this[propName] = newValue;
2720
+ }
2721
+ });
2722
+ };
2723
+ Cstr.observedAttributes = Array.from(
2724
+ /* @__PURE__ */ new Set([
2725
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
2726
+ ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
2727
+ const attrName = m[1] || propName;
2728
+ attrNameToPropName.set(attrName, propName);
2729
+ return attrName;
2730
+ })
2731
+ ])
2732
+ );
2733
+ }
2734
+ }
2735
+ return Cstr;
2736
+ };
2737
+
2738
+ // src/runtime/initialize-component.ts
2739
+ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2740
+ let Cstr;
2741
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2742
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2743
+ const bundleId = cmpMeta.$lazyBundleId$;
2744
+ if (bundleId) {
2745
+ const CstrImport = loadModule(cmpMeta, hostRef);
2746
+ if (CstrImport && "then" in CstrImport) {
2747
+ const endLoad = uniqueTime();
2748
+ Cstr = await CstrImport;
2749
+ endLoad();
2750
+ } else {
2751
+ Cstr = CstrImport;
2752
+ }
2753
+ if (!Cstr) {
2754
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2755
+ }
2756
+ if (!Cstr.isProxied) {
2757
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2758
+ Cstr.isProxied = true;
2759
+ }
2760
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
2761
+ {
2762
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
2763
+ }
2764
+ try {
2765
+ new Cstr(hostRef);
2766
+ } catch (e) {
2767
+ consoleError(e, elm);
2768
+ }
2769
+ {
2770
+ hostRef.$flags$ &= -9 /* isConstructingInstance */;
2771
+ }
2772
+ endNewInstance();
2773
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
2774
+ } else {
2775
+ Cstr = elm.constructor;
2776
+ const cmpTag = elm.localName;
2777
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2778
+ }
2779
+ if (Cstr && Cstr.style) {
2780
+ let style;
2781
+ if (typeof Cstr.style === "string") {
2782
+ style = Cstr.style;
2783
+ }
2784
+ const scopeId2 = getScopeId(cmpMeta);
2785
+ if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
2786
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2787
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2788
+ endRegisterStyles();
2789
+ }
2790
+ }
2791
+ }
2792
+ const ancestorComponent = hostRef.$ancestorComponent$;
2793
+ const schedule = () => scheduleUpdate(hostRef, true);
2794
+ if (ancestorComponent && ancestorComponent["s-rc"]) {
2795
+ ancestorComponent["s-rc"].push(schedule);
2796
+ } else {
2797
+ schedule();
2798
+ }
2799
+ };
2800
+ var fireConnectedCallback = (instance, elm) => {
2801
+ {
2802
+ safeCall(instance, "connectedCallback", void 0, elm);
2803
+ }
2804
+ };
2805
+
2806
+ // src/runtime/connected-callback.ts
2807
+ var connectedCallback = (elm) => {
2808
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2809
+ const hostRef = getHostRef(elm);
2810
+ if (!hostRef) {
2811
+ return;
2812
+ }
2813
+ const cmpMeta = hostRef.$cmpMeta$;
2814
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2815
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2816
+ hostRef.$flags$ |= 1 /* hasConnected */;
2817
+ {
2818
+ let ancestorComponent = elm;
2819
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2820
+ if (ancestorComponent["s-p"]) {
2821
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2822
+ break;
2823
+ }
2824
+ }
2825
+ }
2826
+ if (cmpMeta.$members$) {
2827
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2828
+ if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
2829
+ const value = elm[memberName];
2830
+ delete elm[memberName];
2831
+ elm[memberName] = value;
2832
+ }
2833
+ });
2834
+ }
2835
+ {
2836
+ initializeComponent(elm, hostRef, cmpMeta);
2837
+ }
2838
+ } else {
2839
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2840
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
2841
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2842
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
2843
+ }
2844
+ }
2845
+ endConnected();
2846
+ }
2847
+ };
2848
+ var disconnectInstance = (instance, elm) => {
2849
+ {
2850
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
2851
+ }
2852
+ };
2853
+ var disconnectedCallback = async (elm) => {
2854
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2855
+ const hostRef = getHostRef(elm);
2856
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2857
+ disconnectInstance(hostRef.$lazyInstance$, elm);
2858
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2859
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
2860
+ }
2861
+ }
2862
+ if (rootAppliedStyles.has(elm)) {
2863
+ rootAppliedStyles.delete(elm);
2864
+ }
2865
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
2866
+ rootAppliedStyles.delete(elm.shadowRoot);
2867
+ }
2868
+ };
2869
+
2870
+ // src/runtime/bootstrap-lazy.ts
2871
+ var bootstrapLazy = (lazyBundles, options = {}) => {
2872
+ var _a;
2873
+ if (!win.document) {
2874
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
2875
+ return;
2876
+ }
2877
+ const endBootstrap = createTime();
2878
+ const cmpTags = [];
2879
+ const exclude = options.exclude || [];
2880
+ const customElements2 = win.customElements;
2881
+ const head = win.document.head;
2882
+ const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
2883
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
2884
+ const deferredConnectedCallbacks = [];
2885
+ let appLoadFallback;
2886
+ let isBootstrapping = true;
2887
+ Object.assign(plt, options);
2888
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
2889
+ let hasSlotRelocation = false;
2890
+ lazyBundles.map((lazyBundle) => {
2891
+ lazyBundle[1].map((compactMeta) => {
2892
+ const cmpMeta = {
2893
+ $flags$: compactMeta[0],
2894
+ $tagName$: compactMeta[1],
2895
+ $members$: compactMeta[2],
2896
+ $listeners$: compactMeta[3]
2897
+ };
2898
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2899
+ hasSlotRelocation = true;
2900
+ }
2901
+ {
2902
+ cmpMeta.$members$ = compactMeta[2];
2903
+ }
2904
+ const tagName = transformTag(cmpMeta.$tagName$);
2905
+ const HostElement = class extends HTMLElement {
2906
+ // StencilLazyHost
2907
+ constructor(self) {
2908
+ super(self);
2909
+ this.hasRegisteredEventListeners = false;
2910
+ self = this;
2911
+ registerHost(self, cmpMeta);
2912
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2913
+ {
2914
+ if (!self.shadowRoot) {
2915
+ createShadowRoot.call(self, cmpMeta);
2916
+ } else {
2917
+ if (self.shadowRoot.mode !== "open") {
2918
+ throw new Error(
2919
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
2920
+ );
2921
+ }
2922
+ }
2923
+ }
2924
+ }
2925
+ }
2926
+ connectedCallback() {
2927
+ const hostRef = getHostRef(this);
2928
+ if (!hostRef) {
2929
+ return;
2930
+ }
2931
+ if (!this.hasRegisteredEventListeners) {
2932
+ this.hasRegisteredEventListeners = true;
2933
+ }
2934
+ if (appLoadFallback) {
2935
+ clearTimeout(appLoadFallback);
2936
+ appLoadFallback = null;
2937
+ }
2938
+ if (isBootstrapping) {
2939
+ deferredConnectedCallbacks.push(this);
2940
+ } else {
2941
+ plt.jmp(() => connectedCallback(this));
2942
+ }
2943
+ }
2944
+ disconnectedCallback() {
2945
+ plt.jmp(() => disconnectedCallback(this));
2946
+ plt.raf(() => {
2947
+ var _a3;
2948
+ const hostRef = getHostRef(this);
2949
+ if (!hostRef) {
2950
+ return;
2951
+ }
2952
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
2953
+ if (i2 > -1) {
2954
+ deferredConnectedCallbacks.splice(i2, 1);
2955
+ }
2956
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
2957
+ delete hostRef.$vnode$.$elm$;
2958
+ }
2959
+ });
2960
+ }
2961
+ componentOnReady() {
2962
+ var _a3;
2963
+ return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
2964
+ }
2965
+ };
2966
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2967
+ if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
2968
+ cmpTags.push(tagName);
2969
+ customElements2.define(
2970
+ tagName,
2971
+ proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
2972
+ );
2973
+ }
2974
+ });
2975
+ });
2976
+ if (cmpTags.length > 0) {
2977
+ if (hasSlotRelocation) {
2978
+ dataStyles.textContent += SLOT_FB_CSS;
2979
+ }
2980
+ {
2981
+ dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2982
+ }
2983
+ if (dataStyles.innerHTML.length) {
2984
+ dataStyles.setAttribute("data-styles", "");
2985
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2986
+ if (nonce != null) {
2987
+ dataStyles.setAttribute("nonce", nonce);
2988
+ }
2989
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2990
+ }
2991
+ }
2992
+ isBootstrapping = false;
2993
+ if (deferredConnectedCallbacks.length) {
2994
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
2995
+ } else {
2996
+ {
2997
+ plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
2998
+ }
2999
+ }
3000
+ endBootstrap();
3001
+ };
3002
+
3003
+ // src/runtime/nonce.ts
3004
+ var setNonce = (nonce) => plt.$nonce$ = nonce;
3005
+ function transformTag(tag) {
3006
+ return tag;
3007
+ }
3008
+
3009
+ export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };