@mgdis/stencil-helpers 3.2.10 → 3.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,24 +1,24 @@
1
- class Ii {
1
+ class Dt {
2
2
  /**
3
3
  * Available classes
4
4
  */
5
5
  classes;
6
- constructor(e = []) {
7
- this.classes = e;
6
+ constructor(t = []) {
7
+ this.classes = t;
8
8
  }
9
9
  /**
10
10
  * Add class
11
11
  * @param className - class name to add
12
12
  */
13
- add = (e) => {
14
- this.has(e) || this.classes.push(e);
13
+ add = (t) => {
14
+ this.has(t) || this.classes.push(t);
15
15
  };
16
16
  /**
17
17
  * Delete class
18
18
  * @param className - class name to delete
19
19
  */
20
- delete = (e) => {
21
- const s = this.classes.indexOf(e);
20
+ delete = (t) => {
21
+ const s = this.classes.indexOf(t);
22
22
  s > -1 && this.classes.splice(s, 1);
23
23
  };
24
24
  /**
@@ -26,36 +26,36 @@ class Ii {
26
26
  * @param className - class name to check
27
27
  * @returns class name is in the list
28
28
  */
29
- has = (e) => this.classes.includes(e);
29
+ has = (t) => this.classes.includes(t);
30
30
  /**
31
31
  * Join classes seperated by spaces
32
32
  * @returns joined values
33
33
  */
34
34
  join = () => this.classes.join(" ");
35
35
  }
36
- const at = (t) => typeof t == "object" && !Array.isArray(t) && t !== null, Hs = (t, e, s) => {
37
- if (!at(t) || typeof e != "string")
36
+ const G = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, He = (e, t, s) => {
37
+ if (!G(e) || typeof t != "string")
38
38
  return s;
39
- const [n, ...i] = e.split(".");
40
- return i.length ? Hs(t[n], i.join("."), s) : t[n] ?? s;
41
- }, Wi = (t) => Array.isArray(t) && t.every((e) => typeof e == "string"), Fs = (t) => typeof t == "string" && t.trim() !== "", zi = (t) => typeof t == "object" ? JSON.stringify(t) : String(t), Gi = (t) => typeof t == "string" ? t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : t, Bs = (t) => t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s > 0 ? "-" : "") + e.toLowerCase()).replace(/[^a-z0-9-]+/g, "-").replace(/--+/g, "-").replace(/(?:^-)|(?:-$)/g, ""), Hi = (t = "", e = 10) => {
42
- const s = new Uint8Array(e);
39
+ const [r, ...o] = t.split(".");
40
+ return o.length ? He(e[r], o.join("."), s) : e[r] ?? s;
41
+ }, jt = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Me = (e) => typeof e == "string" && e.trim() !== "", Pt = (e) => typeof e == "object" ? JSON.stringify(e) : String(e), zt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Fe = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, s) => (s > 0 ? "-" : "") + t.toLowerCase()).replace(/[^a-z0-9-]+/g, "-").replace(/--+/g, "-").replace(/(?:^-)|(?:-$)/g, ""), Ht = (e = "", t = 10) => {
42
+ const s = new Uint8Array(t);
43
43
  crypto.getRandomValues(s);
44
- const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, e);
45
- return t !== "" ? `${t}-${r}` : r;
46
- }, Fi = (t) => Fs(t) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(t) !== null, Bi = (t) => {
47
- let e;
48
- return typeof t == "string" ? e = t : t && typeof t == "object" && (at(t) || Array.isArray(t)) ? e = JSON.stringify(t) : t != null && typeof t != "boolean" && typeof t != "object" && (e = String(t)), e && Bs(e);
49
- }, Ui = async (t) => {
50
- if (t)
51
- return t();
52
- }, Zi = {
44
+ const n = Array.from(s).map((r) => r.toString(16).padStart(2, "0")).join("").slice(0, t);
45
+ return e !== "" ? `${e}-${n}` : n;
46
+ }, Mt = (e) => Me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null, Ft = (e) => {
47
+ let t;
48
+ return typeof e == "string" ? t = e : e && typeof e == "object" && (G(e) || Array.isArray(e)) ? t = JSON.stringify(e) : e != null && typeof e != "boolean" && typeof e != "object" && (t = String(e)), t && Fe(t);
49
+ }, Gt = async (e) => {
50
+ if (e)
51
+ return e();
52
+ }, Bt = {
53
53
  FIRST: "first",
54
54
  NEXT: "next",
55
55
  PREVIOUS: "previous",
56
56
  LAST: "last"
57
- }, Xt = 10;
58
- class Us {
57
+ }, fe = 10;
58
+ class Ge {
59
59
  /**
60
60
  * Define items
61
61
  */
@@ -67,7 +67,7 @@ class Us {
67
67
  /**
68
68
  * Define top
69
69
  */
70
- top = Xt;
70
+ top = fe;
71
71
  /**
72
72
  * Define next
73
73
  */
@@ -76,9 +76,9 @@ class Us {
76
76
  * Define base index
77
77
  */
78
78
  baseIndex = 1;
79
- constructor(e) {
80
- if (at(e))
81
- Array.isArray(e.items) && (this.items = e.items), typeof e.top == "number" && (this.top = e.top), this.total = typeof e.total == "number" ? e.total : this.items.length, this.next = e.next;
79
+ constructor(t) {
80
+ if (G(t))
81
+ Array.isArray(t.items) && (this.items = t.items), typeof t.top == "number" && (this.top = t.top), this.total = typeof t.total == "number" ? t.total : this.items.length, this.next = t.next;
82
82
  else
83
83
  throw new Error("Page - init must match IPage type.");
84
84
  }
@@ -88,31 +88,31 @@ class Us {
88
88
  * @param oldItem - previous item
89
89
  * @returns item index
90
90
  */
91
- getIndexFromCursor = (e = "first", s) => {
91
+ getIndexFromCursor = (t = "first", s) => {
92
92
  if (!Array.isArray(this.items) || !this.items.length)
93
93
  return null;
94
- const n = this.items.length - this.baseIndex;
95
- let i, a = 0;
96
- if (["previous", "next"].includes(e) && s) {
97
- const o = this.items.findIndex((l) => JSON.stringify(l) === JSON.stringify(s));
98
- if (o === -1)
94
+ const r = this.items.length - this.baseIndex;
95
+ let o, i = 0;
96
+ if (["previous", "next"].includes(t) && s) {
97
+ const u = this.items.findIndex((f) => JSON.stringify(f) === JSON.stringify(s));
98
+ if (u === -1)
99
99
  return 0;
100
- a = o;
100
+ i = u;
101
101
  }
102
- return e === "first" ? i = 0 : e === "last" ? i = n : e === "previous" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[0]) ? n : a - this.baseIndex : e === "next" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[n]) ? 0 : a + this.baseIndex : i = 0, i;
102
+ return t === "first" ? o = 0 : t === "last" ? o = r : t === "previous" ? o = JSON.stringify(this.items[i]) === JSON.stringify(this.items[0]) ? r : i - this.baseIndex : t === "next" ? o = JSON.stringify(this.items[i]) === JSON.stringify(this.items[r]) ? 0 : i + this.baseIndex : o = 0, o;
103
103
  };
104
104
  }
105
- class qi {
105
+ class Ut {
106
106
  /**
107
107
  * Define paginated items
108
108
  */
109
109
  items = [];
110
110
  /* Privates */
111
- #e = Xt;
111
+ #e = fe;
112
112
  #t;
113
113
  #s;
114
- constructor(e, s) {
115
- Array.isArray(e) && (this.items = e), s && (["string", "function"].includes(typeof s.next) || at(s.next) && URL.canParse(s.next)) && (this.#t = s.next), typeof s?.top == "number" && (this.#e = s.top), typeof s?.total == "number" && (this.#s = s.total);
114
+ constructor(t, s) {
115
+ Array.isArray(t) && (this.items = t), s && (["string", "function"].includes(typeof s.next) || G(s.next) && URL.canParse(s.next)) && (this.#t = s.next), typeof s?.top == "number" && (this.#e = s.top), typeof s?.total == "number" && (this.#s = s.total);
116
116
  }
117
117
  /**
118
118
  * Get page
@@ -120,2394 +120,364 @@ class qi {
120
120
  * @param filter - filter methode
121
121
  * @returns formated page
122
122
  */
123
- getPage = (e = 0, s) => {
124
- const r = typeof s == "function" ? this.items.filter(s) : this.items;
125
- let n;
126
- return this.#t ? n = this.#t : r.length > e + this.#e && (n = () => this.getPage(e + this.#e, s)), new Us({
127
- items: r.slice(e, e + this.#e),
123
+ getPage = (t = 0, s) => {
124
+ const n = typeof s == "function" ? this.items.filter(s) : this.items;
125
+ let r;
126
+ return this.#t ? r = this.#t : n.length > t + this.#e && (r = () => this.getPage(t + this.#e, s)), new Ge({
127
+ items: n.slice(t, t + this.#e),
128
128
  total: this.#s,
129
129
  top: this.#e,
130
- next: n
130
+ next: r
131
131
  });
132
132
  };
133
133
  }
134
- const Ji = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Xi = (t) => t.toISOString().split("T")[0], Yi = (t, e) => e.includes(t?.tagName.toLowerCase()), Ki = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Qi = (t) => typeof t == "number" && !Number.isNaN(t), Vi = (t) => {
135
- const e = Yt(t), s = Kt(t);
136
- return [t, ...e, ...s];
137
- }, Yt = (t, e = []) => {
138
- if (t.self !== t.top)
134
+ const Zt = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Wt = (e) => e.toISOString().split("T")[0], qt = (e, t) => t.includes(e?.tagName.toLowerCase()), Jt = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Yt = (e) => typeof e == "number" && !Number.isNaN(e), Kt = (e) => {
135
+ const t = ue(e), s = ge(e);
136
+ return [e, ...t, ...s];
137
+ }, ue = (e, t = []) => {
138
+ if (e.self !== e.top)
139
139
  try {
140
- const s = t.parent;
141
- return s ? (e.push(s), Yt(s, e)) : e;
140
+ const s = e.parent;
141
+ return s ? (t.push(s), ue(s, t)) : t;
142
142
  } catch (s) {
143
- return console.error("Different hosts between iframes:", s), e;
143
+ return console.error("Different hosts between iframes:", s), t;
144
144
  }
145
- return e;
146
- }, Kt = (t, e = []) => {
147
- if (t.frames.length > 0)
148
- for (const s of Array.from(t.frames))
149
- e.push(s), Kt(s, e);
150
- return e;
151
- };
152
- var Zs = Object.create, ot = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, Qt = Object.getOwnPropertyNames, Js = Object.getPrototypeOf, Xs = Object.prototype.hasOwnProperty, Vt = (t) => {
153
- throw TypeError(t);
154
- }, Ys = (t, e, s) => e in t ? ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, es = (t, e) => function() {
155
- return e || (0, t[Qt(t)[0]])((e = { exports: {} }).exports, e), e.exports;
156
- }, Ks = (t, e) => {
157
- for (var s in e)
158
- ot(t, s, { get: e[s], enumerable: !0 });
159
- }, Qs = (t, e, s, r) => {
160
- if (e && typeof e == "object" || typeof e == "function")
161
- for (let n of Qt(e))
162
- !Xs.call(t, n) && n !== s && ot(t, n, { get: () => e[n], enumerable: !(r = qs(e, n)) || r.enumerable });
163
145
  return t;
164
- }, Vs = (t, e, s) => (s = t != null ? Zs(Js(t)) : {}, Qs(
165
- // If the importer is in node compatibility mode or this is not an ESM
166
- // file that has been converted to a CommonJS file using a Babel-
167
- // compatible transform (i.e. "__esModule" has not been set), then set
168
- // "default" to the CommonJS "module.exports" for node compatibility.
169
- ot(s, "default", { value: t, enumerable: !0 }),
170
- t
171
- )), er = (t, e, s) => Ys(t, e + "", s), bt = (t, e, s) => e.has(t) || Vt("Cannot " + s), v = (t, e, s) => (bt(t, e, "read from private field"), s ? s.call(t) : e.get(t)), Z = (t, e, s) => e.has(t) ? Vt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), R = (t, e, s, r) => (bt(t, e, "write to private field"), e.set(t, s), s), ue = (t, e, s) => (bt(t, e, "access private method"), s), tr = es({
172
- "node_modules/balanced-match/index.js"(t, e) {
173
- e.exports = s;
174
- function s(i, a, o) {
175
- i instanceof RegExp && (i = r(i, o)), a instanceof RegExp && (a = r(a, o));
176
- var l = n(i, a, o);
177
- return l && {
178
- start: l[0],
179
- end: l[1],
180
- pre: o.slice(0, l[0]),
181
- body: o.slice(l[0] + i.length, l[1]),
182
- post: o.slice(l[1] + a.length)
183
- };
184
- }
185
- function r(i, a) {
186
- var o = a.match(i);
187
- return o ? o[0] : null;
188
- }
189
- s.range = n;
190
- function n(i, a, o) {
191
- var l, h, c, u, d, g = o.indexOf(i), f = o.indexOf(a, g + 1), p = g;
192
- if (g >= 0 && f > 0) {
193
- if (i === a)
194
- return [g, f];
195
- for (l = [], c = o.length; p >= 0 && !d; )
196
- p == g ? (l.push(p), g = o.indexOf(i, p + 1)) : l.length == 1 ? d = [l.pop(), f] : (h = l.pop(), h < c && (c = h, u = f), f = o.indexOf(a, p + 1)), p = g < f && g >= 0 ? g : f;
197
- l.length && (d = [c, u]);
198
- }
199
- return d;
200
- }
201
- }
202
- }), sr = es({
203
- "node_modules/brace-expansion/index.js"(t, e) {
204
- var s = tr();
205
- e.exports = d;
206
- var r = "\0SLASH" + Math.random() + "\0", n = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", o = "\0PERIOD" + Math.random() + "\0";
207
- function l($) {
208
- return parseInt($, 10) == $ ? parseInt($, 10) : $.charCodeAt(0);
209
- }
210
- function h($) {
211
- return $.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(i).split("\\,").join(a).split("\\.").join(o);
212
- }
213
- function c($) {
214
- return $.split(r).join("\\").split(n).join("{").split(i).join("}").split(a).join(",").split(o).join(".");
215
- }
216
- function u($) {
217
- if (!$)
218
- return [""];
219
- var w = [], b = s("{", "}", $);
220
- if (!b)
221
- return $.split(",");
222
- var m = b.pre, D = b.body, L = b.post, x = m.split(",");
223
- x[x.length - 1] += "{" + D + "}";
224
- var M = u(L);
225
- return L.length && (x[x.length - 1] += M.shift(), x.push.apply(x, M)), w.push.apply(w, x), w;
226
- }
227
- function d($) {
228
- return $ ? ($.substr(0, 2) === "{}" && ($ = "\\{\\}" + $.substr(2)), E(h($), !0).map(c)) : [];
229
- }
230
- function g($) {
231
- return "{" + $ + "}";
232
- }
233
- function f($) {
234
- return /^-?0\d/.test($);
235
- }
236
- function p($, w) {
237
- return $ <= w;
238
- }
239
- function y($, w) {
240
- return $ >= w;
241
- }
242
- function E($, w) {
243
- var b = [], m = s("{", "}", $);
244
- if (!m) return [$];
245
- var D = m.pre, L = m.post.length ? E(m.post, !1) : [""];
246
- if (/\$$/.test(m.pre))
247
- for (var x = 0; x < L.length; x++) {
248
- var M = D + "{" + m.body + "}" + L[x];
249
- b.push(M);
250
- }
251
- else {
252
- var me = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), oe = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), Q = me || oe, Ae = m.body.indexOf(",") >= 0;
253
- if (!Q && !Ae)
254
- return m.post.match(/,(?!,).*\}/) ? ($ = m.pre + "{" + m.body + i + m.post, E($)) : [$];
255
- var S;
256
- if (Q)
257
- S = m.body.split(/\.\./);
258
- else if (S = u(m.body), S.length === 1 && (S = E(S[0], !1).map(g), S.length === 1))
259
- return L.map(function(gt) {
260
- return m.pre + S[0] + gt;
261
- });
262
- var I;
263
- if (Q) {
264
- var le = l(S[0]), Re = l(S[1]), ut = Math.max(S[0].length, S[1].length), Ne = S.length == 3 ? Math.abs(l(S[2])) : 1, Le = p, ft = Re < le;
265
- ft && (Ne *= -1, Le = y);
266
- var pt = S.some(f);
267
- I = [];
268
- for (var V = le; Le(V, Re); V += Ne) {
269
- var A;
270
- if (oe)
271
- A = String.fromCharCode(V), A === "\\" && (A = "");
272
- else if (A = String(V), pt) {
273
- var Me = ut - A.length;
274
- if (Me > 0) {
275
- var ke = new Array(Me + 1).join("0");
276
- V < 0 ? A = "-" + ke + A.slice(1) : A = ke + A;
277
- }
278
- }
279
- I.push(A);
280
- }
281
- } else {
282
- I = [];
283
- for (var G = 0; G < S.length; G++)
284
- I.push.apply(I, E(S[G], !1));
285
- }
286
- for (var G = 0; G < I.length; G++)
287
- for (var x = 0; x < L.length; x++) {
288
- var M = D + I[G] + L[x];
289
- (!w || Q || M) && b.push(M);
290
- }
291
- }
292
- return b;
293
- }
294
- }
295
- }), rr = Vs(sr()), nr = 1024 * 64, Ve = (t) => {
296
- if (typeof t != "string")
297
- throw new TypeError("invalid pattern");
298
- if (t.length > nr)
299
- throw new TypeError("pattern is too long");
300
- }, ir = {
301
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
302
- "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
303
- "[:ascii:]": ["\\x00-\\x7f", !1],
304
- "[:blank:]": ["\\p{Zs}\\t", !0],
305
- "[:cntrl:]": ["\\p{Cc}", !0],
306
- "[:digit:]": ["\\p{Nd}", !0],
307
- "[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
308
- "[:lower:]": ["\\p{Ll}", !0],
309
- "[:print:]": ["\\p{C}", !0],
310
- "[:punct:]": ["\\p{P}", !0],
311
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
312
- "[:upper:]": ["\\p{Lu}", !0],
313
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
314
- "[:xdigit:]": ["A-Fa-f0-9", !1]
315
- }, Ce = (t) => t.replace(/[[\]\\-]/g, "\\$&"), ar = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Lt = (t) => t.join(""), or = (t, e) => {
316
- const s = e;
317
- if (t.charAt(s) !== "[")
318
- throw new Error("not in a brace expression");
319
- const r = [], n = [];
320
- let i = s + 1, a = !1, o = !1, l = !1, h = !1, c = s, u = "";
321
- e: for (; i < t.length; ) {
322
- const p = t.charAt(i);
323
- if ((p === "!" || p === "^") && i === s + 1) {
324
- h = !0, i++;
325
- continue;
326
- }
327
- if (p === "]" && a && !l) {
328
- c = i + 1;
329
- break;
330
- }
331
- if (a = !0, p === "\\" && !l) {
332
- l = !0, i++;
333
- continue;
334
- }
335
- if (p === "[" && !l) {
336
- for (const [y, [E, $, w]] of Object.entries(ir))
337
- if (t.startsWith(y, i)) {
338
- if (u)
339
- return ["$.", !1, t.length - s, !0];
340
- i += y.length, w ? n.push(E) : r.push(E), o = o || $;
341
- continue e;
342
- }
343
- }
344
- if (l = !1, u) {
345
- p > u ? r.push(Ce(u) + "-" + Ce(p)) : p === u && r.push(Ce(p)), u = "", i++;
346
- continue;
347
- }
348
- if (t.startsWith("-]", i + 1)) {
349
- r.push(Ce(p + "-")), i += 2;
350
- continue;
351
- }
352
- if (t.startsWith("-", i + 1)) {
353
- u = p, i += 2;
354
- continue;
355
- }
356
- r.push(Ce(p)), i++;
357
- }
358
- if (c < i)
359
- return ["", !1, 0, !1];
360
- if (!r.length && !n.length)
361
- return ["$.", !1, t.length - s, !0];
362
- if (n.length === 0 && r.length === 1 && /^\\?.$/.test(r[0]) && !h) {
363
- const p = r[0].length === 2 ? r[0].slice(-1) : r[0];
364
- return [ar(p), !1, c - s, !1];
365
- }
366
- const d = "[" + (h ? "^" : "") + Lt(r) + "]", g = "[" + (h ? "" : "^") + Lt(n) + "]";
367
- return [r.length && n.length ? "(" + d + "|" + g + ")" : r.length ? d : g, o, c - s, !0];
368
- }, We = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), lr = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), Mt = (t) => lr.has(t), cr = "(?!(?:^|/)\\.\\.?(?:$|/))", qe = "(?!\\.)", hr = /* @__PURE__ */ new Set(["[", "."]), ur = /* @__PURE__ */ new Set(["..", "."]), fr = new Set("().*{}+?[]^$\\!"), pr = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), St = "[^/]", ts = St + "*?", ss = St + "+?", j, W, ie, O, k, fe, be, de, ee, ye, et, Pe, rs, xe, Ye, dt, ns, re = class ce {
369
- constructor(e, s, r = {}) {
370
- Z(this, Pe), er(this, "type"), Z(this, j), Z(this, W), Z(this, ie, !1), Z(this, O, []), Z(this, k), Z(this, fe), Z(this, be), Z(this, de, !1), Z(this, ee), Z(this, ye), Z(this, et, !1), this.type = e, e && R(this, W, !0), R(this, k, s), R(this, j, v(this, k) ? v(v(this, k), j) : this), R(this, ee, v(this, j) === this ? r : v(v(this, j), ee)), R(this, be, v(this, j) === this ? [] : v(v(this, j), be)), e === "!" && !v(v(this, j), de) && v(this, be).push(this), R(this, fe, v(this, k) ? v(v(this, k), O).length : 0);
371
- }
372
- get hasMagic() {
373
- if (v(this, W) !== void 0)
374
- return v(this, W);
375
- for (const e of v(this, O))
376
- if (typeof e != "string" && (e.type || e.hasMagic))
377
- return R(this, W, !0);
378
- return v(this, W);
379
- }
380
- // reconstructs the pattern
381
- toString() {
382
- return v(this, ye) !== void 0 ? v(this, ye) : this.type ? R(this, ye, this.type + "(" + v(this, O).map((e) => String(e)).join("|") + ")") : R(this, ye, v(this, O).map((e) => String(e)).join(""));
383
- }
384
- push(...e) {
385
- for (const s of e)
386
- if (s !== "") {
387
- if (typeof s != "string" && !(s instanceof ce && v(s, k) === this))
388
- throw new Error("invalid part: " + s);
389
- v(this, O).push(s);
390
- }
391
- }
392
- toJSON() {
393
- var e;
394
- const s = this.type === null ? v(this, O).slice().map((r) => typeof r == "string" ? r : r.toJSON()) : [this.type, ...v(this, O).map((r) => r.toJSON())];
395
- return this.isStart() && !this.type && s.unshift([]), this.isEnd() && (this === v(this, j) || v(v(this, j), de) && ((e = v(this, k)) == null ? void 0 : e.type) === "!") && s.push({}), s;
396
- }
397
- isStart() {
398
- var e;
399
- if (v(this, j) === this)
400
- return !0;
401
- if (!((e = v(this, k)) != null && e.isStart()))
402
- return !1;
403
- if (v(this, fe) === 0)
404
- return !0;
405
- const s = v(this, k);
406
- for (let r = 0; r < v(this, fe); r++) {
407
- const n = v(s, O)[r];
408
- if (!(n instanceof ce && n.type === "!"))
409
- return !1;
410
- }
411
- return !0;
412
- }
413
- isEnd() {
414
- var e, s, r;
415
- if (v(this, j) === this || ((e = v(this, k)) == null ? void 0 : e.type) === "!")
416
- return !0;
417
- if (!((s = v(this, k)) != null && s.isEnd()))
418
- return !1;
419
- if (!this.type)
420
- return (r = v(this, k)) == null ? void 0 : r.isEnd();
421
- const n = v(this, k) ? v(v(this, k), O).length : 0;
422
- return v(this, fe) === n - 1;
423
- }
424
- copyIn(e) {
425
- typeof e == "string" ? this.push(e) : this.push(e.clone(this));
426
- }
427
- clone(e) {
428
- const s = new ce(this.type, e);
429
- for (const r of v(this, O))
430
- s.copyIn(r);
431
- return s;
432
- }
433
- static fromGlob(e, s = {}) {
434
- var r;
435
- const n = new ce(null, void 0, s);
436
- return ue(r = ce, xe, Ye).call(r, e, n, 0, s), n;
437
- }
438
- // returns the regular expression if there's magic, or the unescaped
439
- // string if not.
440
- toMMPattern() {
441
- if (this !== v(this, j))
442
- return v(this, j).toMMPattern();
443
- const e = this.toString(), [s, r, n, i] = this.toRegExpSource();
444
- if (!(n || v(this, W) || v(this, ee).nocase && !v(this, ee).nocaseMagicOnly && e.toUpperCase() !== e.toLowerCase()))
445
- return r;
446
- const o = (v(this, ee).nocase ? "i" : "") + (i ? "u" : "");
447
- return Object.assign(new RegExp(`^${s}$`, o), {
448
- _src: s,
449
- _glob: e
450
- });
451
- }
452
- get options() {
453
- return v(this, ee);
454
- }
455
- // returns the string match, the regexp source, whether there's magic
456
- // in the regexp (so a regular expression is required) and whether or
457
- // not the uflag is needed for the regular expression (for posix classes)
458
- // TODO: instead of injecting the start/end at this point, just return
459
- // the BODY of the regexp, along with the start/end portions suitable
460
- // for binding the start/end in either a joined full-path makeRe context
461
- // (where we bind to (^|/), or a standalone matchPart context (where
462
- // we bind to ^, and not /). Otherwise slashes get duped!
463
- //
464
- // In part-matching mode, the start is:
465
- // - if not isStart: nothing
466
- // - if traversal possible, but not allowed: ^(?!\.\.?$)
467
- // - if dots allowed or not possible: ^
468
- // - if dots possible and not allowed: ^(?!\.)
469
- // end is:
470
- // - if not isEnd(): nothing
471
- // - else: $
472
- //
473
- // In full-path matching mode, we put the slash at the START of the
474
- // pattern, so start is:
475
- // - if first pattern: same as part-matching mode
476
- // - if not isStart(): nothing
477
- // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
478
- // - if dots allowed or not possible: /
479
- // - if dots possible and not allowed: /(?!\.)
480
- // end is:
481
- // - if last pattern, same as part-matching mode
482
- // - else nothing
483
- //
484
- // Always put the (?:$|/) on negated tails, though, because that has to be
485
- // there to bind the end of the negated pattern portion, and it's easier to
486
- // just stick it in now rather than try to inject it later in the middle of
487
- // the pattern.
488
- //
489
- // We can just always return the same end, and leave it up to the caller
490
- // to know whether it's going to be used joined or in parts.
491
- // And, if the start is adjusted slightly, can do the same there:
492
- // - if not isStart: nothing
493
- // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
494
- // - if dots allowed or not possible: (?:/|^)
495
- // - if dots possible and not allowed: (?:/|^)(?!\.)
496
- //
497
- // But it's better to have a simpler binding without a conditional, for
498
- // performance, so probably better to return both start options.
499
- //
500
- // Then the caller just ignores the end if it's not the first pattern,
501
- // and the start always gets applied.
502
- //
503
- // But that's always going to be $ if it's the ending pattern, or nothing,
504
- // so the caller can just attach $ at the end of the pattern when building.
505
- //
506
- // So the todo is:
507
- // - better detect what kind of start is needed
508
- // - return both flavors of starting pattern
509
- // - attach $ at the end of the pattern when creating the actual RegExp
510
- //
511
- // Ah, but wait, no, that all only applies to the root when the first pattern
512
- // is not an extglob. If the first pattern IS an extglob, then we need all
513
- // that dot prevention biz to live in the extglob portions, because eg
514
- // +(*|.x*) can match .xy but not .yx.
515
- //
516
- // So, return the two flavors if it's #root and the first child is not an
517
- // AST, otherwise leave it to the child AST to handle it, and there,
518
- // use the (?:^|/) style of start binding.
519
- //
520
- // Even simplified further:
521
- // - Since the start for a join is eg /(?!\.) and the start for a part
522
- // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
523
- // or start or whatever) and prepend ^ or / at the Regexp construction.
524
- toRegExpSource(e) {
525
- var s;
526
- const r = e ?? !!v(this, ee).dot;
527
- if (v(this, j) === this && ue(this, Pe, rs).call(this), !this.type) {
528
- const h = this.isStart() && this.isEnd(), c = v(this, O).map((f) => {
529
- var p;
530
- const [y, E, $, w] = typeof f == "string" ? ue(p = ce, xe, ns).call(p, f, v(this, W), h) : f.toRegExpSource(e);
531
- return R(this, W, v(this, W) || $), R(this, ie, v(this, ie) || w), y;
532
- }).join("");
533
- let u = "";
534
- if (this.isStart() && typeof v(this, O)[0] == "string" && !(v(this, O).length === 1 && ur.has(v(this, O)[0]))) {
535
- const p = hr, y = (
536
- // dots are allowed, and the pattern starts with [ or .
537
- r && p.has(c.charAt(0)) || // the pattern starts with \., and then [ or .
538
- c.startsWith("\\.") && p.has(c.charAt(2)) || // the pattern starts with \.\., and then [ or .
539
- c.startsWith("\\.\\.") && p.has(c.charAt(4))
540
- ), E = !r && !e && p.has(c.charAt(0));
541
- u = y ? cr : E ? qe : "";
542
- }
543
- let d = "";
544
- return this.isEnd() && v(v(this, j), de) && ((s = v(this, k)) == null ? void 0 : s.type) === "!" && (d = "(?:$|\\/)"), [
545
- u + c + d,
546
- We(c),
547
- R(this, W, !!v(this, W)),
548
- v(this, ie)
549
- ];
550
- }
551
- const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
552
- let a = ue(this, Pe, dt).call(this, r);
553
- if (this.isStart() && this.isEnd() && !a && this.type !== "!") {
554
- const h = this.toString();
555
- return R(this, O, [h]), this.type = null, R(this, W, void 0), [h, We(this.toString()), !1, !1];
556
- }
557
- let o = !n || e || r || !qe ? "" : ue(this, Pe, dt).call(this, !0);
558
- o === a && (o = ""), o && (a = `(?:${a})(?:${o})*?`);
559
- let l = "";
560
- if (this.type === "!" && v(this, et))
561
- l = (this.isStart() && !r ? qe : "") + ss;
562
- else {
563
- const h = this.type === "!" ? (
564
- // !() must match something,but !(x) can match ''
565
- "))" + (this.isStart() && !r && !e ? qe : "") + ts + ")"
566
- ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
567
- l = i + a + h;
568
- }
569
- return [
570
- l,
571
- We(a),
572
- R(this, W, !!v(this, W)),
573
- v(this, ie)
574
- ];
575
- }
576
- };
577
- j = /* @__PURE__ */ new WeakMap();
578
- W = /* @__PURE__ */ new WeakMap();
579
- ie = /* @__PURE__ */ new WeakMap();
580
- O = /* @__PURE__ */ new WeakMap();
581
- k = /* @__PURE__ */ new WeakMap();
582
- fe = /* @__PURE__ */ new WeakMap();
583
- be = /* @__PURE__ */ new WeakMap();
584
- de = /* @__PURE__ */ new WeakMap();
585
- ee = /* @__PURE__ */ new WeakMap();
586
- ye = /* @__PURE__ */ new WeakMap();
587
- et = /* @__PURE__ */ new WeakMap();
588
- Pe = /* @__PURE__ */ new WeakSet();
589
- rs = function() {
590
- if (this !== v(this, j))
591
- throw new Error("should only call on root");
592
- if (v(this, de))
593
- return this;
594
- this.toString(), R(this, de, !0);
595
- let t;
596
- for (; t = v(this, be).pop(); ) {
597
- if (t.type !== "!")
598
- continue;
599
- let e = t, s = v(e, k);
600
- for (; s; ) {
601
- for (let r = v(e, fe) + 1; !s.type && r < v(s, O).length; r++)
602
- for (const n of v(t, O)) {
603
- if (typeof n == "string")
604
- throw new Error("string part in extglob AST??");
605
- n.copyIn(v(s, O)[r]);
606
- }
607
- e = s, s = v(e, k);
608
- }
609
- }
610
- return this;
611
- };
612
- xe = /* @__PURE__ */ new WeakSet();
613
- Ye = function(t, e, s, r) {
614
- var n, i;
615
- let a = !1, o = !1, l = -1, h = !1;
616
- if (e.type === null) {
617
- let f = s, p = "";
618
- for (; f < t.length; ) {
619
- const y = t.charAt(f++);
620
- if (a || y === "\\") {
621
- a = !a, p += y;
622
- continue;
623
- }
624
- if (o) {
625
- f === l + 1 ? (y === "^" || y === "!") && (h = !0) : y === "]" && !(f === l + 2 && h) && (o = !1), p += y;
626
- continue;
627
- } else if (y === "[") {
628
- o = !0, l = f, h = !1, p += y;
629
- continue;
630
- }
631
- if (!r.noext && Mt(y) && t.charAt(f) === "(") {
632
- e.push(p), p = "";
633
- const E = new re(y, e);
634
- f = ue(n = re, xe, Ye).call(n, t, E, f, r), e.push(E);
635
- continue;
636
- }
637
- p += y;
638
- }
639
- return e.push(p), f;
640
- }
641
- let c = s + 1, u = new re(null, e);
642
- const d = [];
643
- let g = "";
644
- for (; c < t.length; ) {
645
- const f = t.charAt(c++);
646
- if (a || f === "\\") {
647
- a = !a, g += f;
648
- continue;
649
- }
650
- if (o) {
651
- c === l + 1 ? (f === "^" || f === "!") && (h = !0) : f === "]" && !(c === l + 2 && h) && (o = !1), g += f;
652
- continue;
653
- } else if (f === "[") {
654
- o = !0, l = c, h = !1, g += f;
655
- continue;
656
- }
657
- if (Mt(f) && t.charAt(c) === "(") {
658
- u.push(g), g = "";
659
- const p = new re(f, u);
660
- u.push(p), c = ue(i = re, xe, Ye).call(i, t, p, c, r);
661
- continue;
662
- }
663
- if (f === "|") {
664
- u.push(g), g = "", d.push(u), u = new re(null, e);
665
- continue;
666
- }
667
- if (f === ")")
668
- return g === "" && v(e, O).length === 0 && R(e, et, !0), u.push(g), g = "", e.push(...d, u), c;
669
- g += f;
670
- }
671
- return e.type = null, R(e, W, void 0), R(e, O, [t.substring(s - 1)]), c;
672
- };
673
- dt = function(t) {
674
- return v(this, O).map((e) => {
675
- if (typeof e == "string")
676
- throw new Error("string type in extglob ast??");
677
- const [s, r, n, i] = e.toRegExpSource(t);
678
- return R(this, ie, v(this, ie) || i), s;
679
- }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
680
- };
681
- ns = function(t, e, s = !1) {
682
- let r = !1, n = "", i = !1;
683
- for (let a = 0; a < t.length; a++) {
684
- const o = t.charAt(a);
685
- if (r) {
686
- r = !1, n += (fr.has(o) ? "\\" : "") + o;
687
- continue;
688
- }
689
- if (o === "\\") {
690
- a === t.length - 1 ? n += "\\\\" : r = !0;
691
- continue;
692
- }
693
- if (o === "[") {
694
- const [l, h, c, u] = or(t, a);
695
- if (c) {
696
- n += l, i = i || h, a += c - 1, e = e || u;
697
- continue;
698
- }
699
- }
700
- if (o === "*") {
701
- s && t === "*" ? n += ss : n += ts, e = !0;
702
- continue;
703
- }
704
- if (o === "?") {
705
- n += St, e = !0;
706
- continue;
707
- }
708
- n += pr(o);
709
- }
710
- return [n, We(t), !!e, i];
711
- };
712
- Z(re, xe);
713
- var is = re, gr = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&"), H = (t, e, s = {}) => (Ve(e), !s.nocomment && e.charAt(0) === "#" ? !1 : new lt(e, s).match(t)), dr = /^\*+([^+@!?\*\[\(]*)$/, $r = (t) => (e) => !e.startsWith(".") && e.endsWith(t), vr = (t) => (e) => e.endsWith(t), _r = (t) => (t = t.toLowerCase(), (e) => !e.startsWith(".") && e.toLowerCase().endsWith(t)), mr = (t) => (t = t.toLowerCase(), (e) => e.toLowerCase().endsWith(t)), yr = /^\*+\.\*+$/, Er = (t) => !t.startsWith(".") && t.includes("."), wr = (t) => t !== "." && t !== ".." && t.includes("."), br = /^\.\*+$/, Sr = (t) => t !== "." && t !== ".." && t.startsWith("."), xr = /^\*+$/, Or = (t) => t.length !== 0 && !t.startsWith("."), Tr = (t) => t.length !== 0 && t !== "." && t !== "..", Ar = /^\?+([^+@!?\*\[\(]*)?$/, Rr = ([t, e = ""]) => {
714
- const s = as([t]);
715
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
716
- }, Nr = ([t, e = ""]) => {
717
- const s = os([t]);
718
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
719
- }, Lr = ([t, e = ""]) => {
720
- const s = os([t]);
721
- return e ? (r) => s(r) && r.endsWith(e) : s;
722
- }, Mr = ([t, e = ""]) => {
723
- const s = as([t]);
724
- return e ? (r) => s(r) && r.endsWith(e) : s;
725
- }, as = ([t]) => {
726
- const e = t.length;
727
- return (s) => s.length === e && !s.startsWith(".");
728
- }, os = ([t]) => {
729
- const e = t.length;
730
- return (s) => s.length === e && s !== "." && s !== "..";
731
- }, ls = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", kt = {
732
- win32: { sep: "\\" },
733
- posix: { sep: "/" }
734
- }, kr = ls === "win32" ? kt.win32.sep : kt.posix.sep;
735
- H.sep = kr;
736
- var Y = /* @__PURE__ */ Symbol("globstar **");
737
- H.GLOBSTAR = Y;
738
- var Cr = "[^/]", jr = Cr + "*?", Pr = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Dr = "(?:(?!(?:\\/|^)\\.).)*?", Ir = (t, e = {}) => (s) => H(s, t, e);
739
- H.filter = Ir;
740
- var J = (t, e = {}) => Object.assign({}, t, e), Wr = (t) => {
741
- if (!t || typeof t != "object" || !Object.keys(t).length)
742
- return H;
743
- const e = H;
744
- return Object.assign((r, n, i = {}) => e(r, n, J(t, i)), {
745
- Minimatch: class extends e.Minimatch {
746
- constructor(n, i = {}) {
747
- super(n, J(t, i));
748
- }
749
- static defaults(n) {
750
- return e.defaults(J(t, n)).Minimatch;
751
- }
752
- },
753
- AST: class extends e.AST {
754
- /* c8 ignore start */
755
- constructor(n, i, a = {}) {
756
- super(n, i, J(t, a));
757
- }
758
- /* c8 ignore stop */
759
- static fromGlob(n, i = {}) {
760
- return e.AST.fromGlob(n, J(t, i));
761
- }
762
- },
763
- unescape: (r, n = {}) => e.unescape(r, J(t, n)),
764
- escape: (r, n = {}) => e.escape(r, J(t, n)),
765
- filter: (r, n = {}) => e.filter(r, J(t, n)),
766
- defaults: (r) => e.defaults(J(t, r)),
767
- makeRe: (r, n = {}) => e.makeRe(r, J(t, n)),
768
- braceExpand: (r, n = {}) => e.braceExpand(r, J(t, n)),
769
- match: (r, n, i = {}) => e.match(r, n, J(t, i)),
770
- sep: e.sep,
771
- GLOBSTAR: Y
772
- });
773
- };
774
- H.defaults = Wr;
775
- var cs = (t, e = {}) => (Ve(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : (0, rr.default)(t));
776
- H.braceExpand = cs;
777
- var zr = (t, e = {}) => new lt(t, e).makeRe();
778
- H.makeRe = zr;
779
- var Gr = (t, e, s = {}) => {
780
- const r = new lt(e, s);
781
- return t = t.filter((n) => r.match(n)), r.options.nonull && !t.length && t.push(e), t;
782
- };
783
- H.match = Gr;
784
- var Ct = /[?*]|[+@!]\(.*?\)|\[|\]/, Hr = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), lt = class {
785
- options;
786
- set;
787
- pattern;
788
- windowsPathsNoEscape;
789
- nonegate;
790
- negate;
791
- comment;
792
- empty;
793
- preserveMultipleSlashes;
794
- partial;
795
- globSet;
796
- globParts;
797
- nocase;
798
- isWindows;
799
- platform;
800
- windowsNoMagicRoot;
801
- regexp;
802
- constructor(e, s = {}) {
803
- Ve(e), s = s || {}, this.options = s, this.pattern = e, this.platform = s.platform || ls, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!s.windowsPathsNoEscape || s.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!s.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!s.nonegate, this.comment = !1, this.empty = !1, this.partial = !!s.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = s.windowsNoMagicRoot !== void 0 ? s.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
804
- }
805
- hasMagic() {
806
- if (this.options.magicalBraces && this.set.length > 1)
807
- return !0;
808
- for (const e of this.set)
809
- for (const s of e)
810
- if (typeof s != "string")
811
- return !0;
812
- return !1;
813
- }
814
- debug(...e) {
815
- }
816
- make() {
817
- const e = this.pattern, s = this.options;
818
- if (!s.nocomment && e.charAt(0) === "#") {
819
- this.comment = !0;
820
- return;
821
- }
822
- if (!e) {
823
- this.empty = !0;
824
- return;
825
- }
826
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], s.debug && (this.debug = (...i) => console.error(...i)), this.debug(this.pattern, this.globSet);
827
- const r = this.globSet.map((i) => this.slashSplit(i));
828
- this.globParts = this.preprocess(r), this.debug(this.pattern, this.globParts);
829
- let n = this.globParts.map((i, a, o) => {
830
- if (this.isWindows && this.windowsNoMagicRoot) {
831
- const l = i[0] === "" && i[1] === "" && (i[2] === "?" || !Ct.test(i[2])) && !Ct.test(i[3]), h = /^[a-z]:/i.test(i[0]);
832
- if (l)
833
- return [...i.slice(0, 4), ...i.slice(4).map((c) => this.parse(c))];
834
- if (h)
835
- return [i[0], ...i.slice(1).map((c) => this.parse(c))];
836
- }
837
- return i.map((l) => this.parse(l));
838
- });
839
- if (this.debug(this.pattern, n), this.set = n.filter((i) => i.indexOf(!1) === -1), this.isWindows)
840
- for (let i = 0; i < this.set.length; i++) {
841
- const a = this.set[i];
842
- a[0] === "" && a[1] === "" && this.globParts[i][2] === "?" && typeof a[3] == "string" && /^[a-z]:$/i.test(a[3]) && (a[2] = "?");
843
- }
844
- this.debug(this.pattern, this.set);
845
- }
846
- // various transforms to equivalent pattern sets that are
847
- // faster to process in a filesystem walk. The goal is to
848
- // eliminate what we can, and push all ** patterns as far
849
- // to the right as possible, even if it increases the number
850
- // of patterns that we have to process.
851
- preprocess(e) {
852
- if (this.options.noglobstar)
853
- for (let r = 0; r < e.length; r++)
854
- for (let n = 0; n < e[r].length; n++)
855
- e[r][n] === "**" && (e[r][n] = "*");
856
- const { optimizationLevel: s = 1 } = this.options;
857
- return s >= 2 ? (e = this.firstPhasePreProcess(e), e = this.secondPhasePreProcess(e)) : s >= 1 ? e = this.levelOneOptimize(e) : e = this.adjascentGlobstarOptimize(e), e;
858
- }
859
- // just get rid of adjascent ** portions
860
- adjascentGlobstarOptimize(e) {
861
- return e.map((s) => {
862
- let r = -1;
863
- for (; (r = s.indexOf("**", r + 1)) !== -1; ) {
864
- let n = r;
865
- for (; s[n + 1] === "**"; )
866
- n++;
867
- n !== r && s.splice(r, n - r);
868
- }
869
- return s;
870
- });
871
- }
872
- // get rid of adjascent ** and resolve .. portions
873
- levelOneOptimize(e) {
874
- return e.map((s) => (s = s.reduce((r, n) => {
875
- const i = r[r.length - 1];
876
- return n === "**" && i === "**" ? r : n === ".." && i && i !== ".." && i !== "." && i !== "**" ? (r.pop(), r) : (r.push(n), r);
877
- }, []), s.length === 0 ? [""] : s));
878
- }
879
- levelTwoFileOptimize(e) {
880
- Array.isArray(e) || (e = this.slashSplit(e));
881
- let s = !1;
882
- do {
883
- if (s = !1, !this.preserveMultipleSlashes) {
884
- for (let n = 1; n < e.length - 1; n++) {
885
- const i = e[n];
886
- n === 1 && i === "" && e[0] === "" || (i === "." || i === "") && (s = !0, e.splice(n, 1), n--);
887
- }
888
- e[0] === "." && e.length === 2 && (e[1] === "." || e[1] === "") && (s = !0, e.pop());
889
- }
890
- let r = 0;
891
- for (; (r = e.indexOf("..", r + 1)) !== -1; ) {
892
- const n = e[r - 1];
893
- n && n !== "." && n !== ".." && n !== "**" && (s = !0, e.splice(r - 1, 2), r -= 2);
894
- }
895
- } while (s);
896
- return e.length === 0 ? [""] : e;
897
- }
898
- // First phase: single-pattern processing
899
- // <pre> is 1 or more portions
900
- // <rest> is 1 or more portions
901
- // <p> is any portion other than ., .., '', or **
902
- // <e> is . or ''
903
- //
904
- // **/.. is *brutal* for filesystem walking performance, because
905
- // it effectively resets the recursive walk each time it occurs,
906
- // and ** cannot be reduced out by a .. pattern part like a regexp
907
- // or most strings (other than .., ., and '') can be.
908
- //
909
- // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
910
- // <pre>/<e>/<rest> -> <pre>/<rest>
911
- // <pre>/<p>/../<rest> -> <pre>/<rest>
912
- // **/**/<rest> -> **/<rest>
913
- //
914
- // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
915
- // this WOULD be allowed if ** did follow symlinks, or * didn't
916
- firstPhasePreProcess(e) {
917
- let s = !1;
918
- do {
919
- s = !1;
920
- for (let r of e) {
921
- let n = -1;
922
- for (; (n = r.indexOf("**", n + 1)) !== -1; ) {
923
- let a = n;
924
- for (; r[a + 1] === "**"; )
925
- a++;
926
- a > n && r.splice(n + 1, a - n);
927
- let o = r[n + 1];
928
- const l = r[n + 2], h = r[n + 3];
929
- if (o !== ".." || !l || l === "." || l === ".." || !h || h === "." || h === "..")
930
- continue;
931
- s = !0, r.splice(n, 1);
932
- const c = r.slice(0);
933
- c[n] = "**", e.push(c), n--;
934
- }
935
- if (!this.preserveMultipleSlashes) {
936
- for (let a = 1; a < r.length - 1; a++) {
937
- const o = r[a];
938
- a === 1 && o === "" && r[0] === "" || (o === "." || o === "") && (s = !0, r.splice(a, 1), a--);
939
- }
940
- r[0] === "." && r.length === 2 && (r[1] === "." || r[1] === "") && (s = !0, r.pop());
941
- }
942
- let i = 0;
943
- for (; (i = r.indexOf("..", i + 1)) !== -1; ) {
944
- const a = r[i - 1];
945
- if (a && a !== "." && a !== ".." && a !== "**") {
946
- s = !0;
947
- const l = i === 1 && r[i + 1] === "**" ? ["."] : [];
948
- r.splice(i - 1, 2, ...l), r.length === 0 && r.push(""), i -= 2;
949
- }
950
- }
951
- }
952
- } while (s);
953
- return e;
954
- }
955
- // second phase: multi-pattern dedupes
956
- // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
957
- // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
958
- // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
959
- //
960
- // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
961
- // ^-- not valid because ** doens't follow symlinks
962
- secondPhasePreProcess(e) {
963
- for (let s = 0; s < e.length - 1; s++)
964
- for (let r = s + 1; r < e.length; r++) {
965
- const n = this.partsMatch(e[s], e[r], !this.preserveMultipleSlashes);
966
- n && (e[s] = n, e[r] = []);
967
- }
968
- return e.filter((s) => s.length);
969
- }
970
- partsMatch(e, s, r = !1) {
971
- let n = 0, i = 0, a = [], o = "";
972
- for (; n < e.length && i < s.length; )
973
- if (e[n] === s[i])
974
- a.push(o === "b" ? s[i] : e[n]), n++, i++;
975
- else if (r && e[n] === "**" && s[i] === e[n + 1])
976
- a.push(e[n]), n++;
977
- else if (r && s[i] === "**" && e[n] === s[i + 1])
978
- a.push(s[i]), i++;
979
- else if (e[n] === "*" && s[i] && (this.options.dot || !s[i].startsWith(".")) && s[i] !== "**") {
980
- if (o === "b")
981
- return !1;
982
- o = "a", a.push(e[n]), n++, i++;
983
- } else if (s[i] === "*" && e[n] && (this.options.dot || !e[n].startsWith(".")) && e[n] !== "**") {
984
- if (o === "a")
985
- return !1;
986
- o = "b", a.push(s[i]), n++, i++;
987
- } else
988
- return !1;
989
- return e.length === s.length && a;
990
- }
991
- parseNegate() {
992
- if (this.nonegate)
993
- return;
994
- const e = this.pattern;
995
- let s = !1, r = 0;
996
- for (let n = 0; n < e.length && e.charAt(n) === "!"; n++)
997
- s = !s, r++;
998
- r && (this.pattern = e.slice(r)), this.negate = s;
999
- }
1000
- // set partial to true to test if, for example,
1001
- // "/a/b" matches the start of "/*/b/*/d"
1002
- // Partial means, if you run out of file before you run
1003
- // out of pattern, then that's fine, as long as all
1004
- // the parts match.
1005
- matchOne(e, s, r = !1) {
1006
- const n = this.options;
1007
- if (this.isWindows) {
1008
- const p = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), y = !p && e[0] === "" && e[1] === "" && e[2] === "?" && /^[a-z]:$/i.test(e[3]), E = typeof s[0] == "string" && /^[a-z]:$/i.test(s[0]), $ = !E && s[0] === "" && s[1] === "" && s[2] === "?" && typeof s[3] == "string" && /^[a-z]:$/i.test(s[3]), w = y ? 3 : p ? 0 : void 0, b = $ ? 3 : E ? 0 : void 0;
1009
- if (typeof w == "number" && typeof b == "number") {
1010
- const [m, D] = [e[w], s[b]];
1011
- m.toLowerCase() === D.toLowerCase() && (s[b] = m, b > w ? s = s.slice(b) : w > b && (e = e.slice(w)));
1012
- }
1013
- }
1014
- const { optimizationLevel: i = 1 } = this.options;
1015
- i >= 2 && (e = this.levelTwoFileOptimize(e)), this.debug("matchOne", this, { file: e, pattern: s }), this.debug("matchOne", e.length, s.length);
1016
- for (var a = 0, o = 0, l = e.length, h = s.length; a < l && o < h; a++, o++) {
1017
- this.debug("matchOne loop");
1018
- var c = s[o], u = e[a];
1019
- if (this.debug(s, c, u), c === !1)
1020
- return !1;
1021
- if (c === Y) {
1022
- this.debug("GLOBSTAR", [s, c, u]);
1023
- var d = a, g = o + 1;
1024
- if (g === h) {
1025
- for (this.debug("** at the end"); a < l; a++)
1026
- if (e[a] === "." || e[a] === ".." || !n.dot && e[a].charAt(0) === ".")
1027
- return !1;
1028
- return !0;
1029
- }
1030
- for (; d < l; ) {
1031
- var f = e[d];
1032
- if (this.debug(`
1033
- globstar while`, e, d, s, g, f), this.matchOne(e.slice(d), s.slice(g), r))
1034
- return this.debug("globstar found match!", d, l, f), !0;
1035
- if (f === "." || f === ".." || !n.dot && f.charAt(0) === ".") {
1036
- this.debug("dot detected!", e, d, s, g);
1037
- break;
1038
- }
1039
- this.debug("globstar swallow a segment, and continue"), d++;
1040
- }
1041
- return !!(r && (this.debug(`
1042
- >>> no match, partial?`, e, d, s, g), d === l));
1043
- }
1044
- let p;
1045
- if (typeof c == "string" ? (p = u === c, this.debug("string match", c, u, p)) : (p = c.test(u), this.debug("pattern match", c, u, p)), !p)
1046
- return !1;
1047
- }
1048
- if (a === l && o === h)
1049
- return !0;
1050
- if (a === l)
1051
- return r;
1052
- if (o === h)
1053
- return a === l - 1 && e[a] === "";
1054
- throw new Error("wtf?");
1055
- }
1056
- braceExpand() {
1057
- return cs(this.pattern, this.options);
1058
- }
1059
- parse(e) {
1060
- Ve(e);
1061
- const s = this.options;
1062
- if (e === "**")
1063
- return Y;
1064
- if (e === "")
1065
- return "";
1066
- let r, n = null;
1067
- (r = e.match(xr)) ? n = s.dot ? Tr : Or : (r = e.match(dr)) ? n = (s.nocase ? s.dot ? mr : _r : s.dot ? vr : $r)(r[1]) : (r = e.match(Ar)) ? n = (s.nocase ? s.dot ? Nr : Rr : s.dot ? Lr : Mr)(r) : (r = e.match(yr)) ? n = s.dot ? wr : Er : (r = e.match(br)) && (n = Sr);
1068
- const i = is.fromGlob(e, this.options).toMMPattern();
1069
- return n && typeof i == "object" && Reflect.defineProperty(i, "test", { value: n }), i;
1070
- }
1071
- makeRe() {
1072
- if (this.regexp || this.regexp === !1)
1073
- return this.regexp;
1074
- const e = this.set;
1075
- if (!e.length)
1076
- return this.regexp = !1, this.regexp;
1077
- const s = this.options, r = s.noglobstar ? jr : s.dot ? Pr : Dr, n = new Set(s.nocase ? ["i"] : []);
1078
- let i = e.map((l) => {
1079
- const h = l.map((c) => {
1080
- if (c instanceof RegExp)
1081
- for (const u of c.flags.split(""))
1082
- n.add(u);
1083
- return typeof c == "string" ? Hr(c) : c === Y ? Y : c._src;
1084
- });
1085
- return h.forEach((c, u) => {
1086
- const d = h[u + 1], g = h[u - 1];
1087
- c !== Y || g === Y || (g === void 0 ? d !== void 0 && d !== Y ? h[u + 1] = "(?:\\/|" + r + "\\/)?" + d : h[u] = r : d === void 0 ? h[u - 1] = g + "(?:\\/|" + r + ")?" : d !== Y && (h[u - 1] = g + "(?:\\/|\\/" + r + "\\/)" + d, h[u + 1] = Y));
1088
- }), h.filter((c) => c !== Y).join("/");
1089
- }).join("|");
1090
- const [a, o] = e.length > 1 ? ["(?:", ")"] : ["", ""];
1091
- i = "^" + a + i + o + "$", this.negate && (i = "^(?!" + i + ").+$");
1092
- try {
1093
- this.regexp = new RegExp(i, [...n].join(""));
1094
- } catch {
1095
- this.regexp = !1;
1096
- }
1097
- return this.regexp;
1098
- }
1099
- slashSplit(e) {
1100
- return this.preserveMultipleSlashes ? e.split("/") : this.isWindows && /^\/\/[^\/]+/.test(e) ? ["", ...e.split(/\/+/)] : e.split(/\/+/);
1101
- }
1102
- match(e, s = this.partial) {
1103
- if (this.debug("match", e, this.pattern), this.comment)
1104
- return !1;
1105
- if (this.empty)
1106
- return e === "";
1107
- if (e === "/" && s)
1108
- return !0;
1109
- const r = this.options;
1110
- this.isWindows && (e = e.split("\\").join("/"));
1111
- const n = this.slashSplit(e);
1112
- this.debug(this.pattern, "split", n);
1113
- const i = this.set;
1114
- this.debug(this.pattern, "set", i);
1115
- let a = n[n.length - 1];
1116
- if (!a)
1117
- for (let o = n.length - 2; !a && o >= 0; o--)
1118
- a = n[o];
1119
- for (let o = 0; o < i.length; o++) {
1120
- const l = i[o];
1121
- let h = n;
1122
- if (r.matchBase && l.length === 1 && (h = [a]), this.matchOne(h, l, s))
1123
- return r.flipNegate ? !0 : !this.negate;
1124
- }
1125
- return r.flipNegate ? !1 : this.negate;
1126
- }
1127
- static defaults(e) {
1128
- return H.defaults(e).Minimatch;
1129
- }
1130
- };
1131
- H.AST = is;
1132
- H.Minimatch = lt;
1133
- H.escape = gr;
1134
- H.unescape = We;
1135
- var Fr = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Br = {};
1136
- Ks(Br, {
1137
- err: () => hs,
1138
- map: () => Ur,
1139
- ok: () => $t,
1140
- unwrap: () => Zr,
1141
- unwrapErr: () => qr
1142
- });
1143
- var $t = (t) => ({
1144
- isOk: !0,
1145
- isErr: !1,
1146
- value: t
1147
- }), hs = (t) => ({
1148
- isOk: !1,
1149
- isErr: !0,
1150
- value: t
1151
- });
1152
- function Ur(t, e) {
1153
- if (t.isOk) {
1154
- const s = e(t.value);
1155
- return s instanceof Promise ? s.then((r) => $t(r)) : $t(s);
1156
- }
1157
- if (t.isErr) {
1158
- const s = t.value;
1159
- return hs(s);
1160
- }
1161
- throw "should never get here";
1162
- }
1163
- var Zr = (t) => {
1164
- if (t.isOk)
1165
- return t.value;
1166
- throw t.value;
1167
- }, qr = (t) => {
1168
- if (t.isErr)
1169
- return t.value;
1170
- throw t.value;
1171
- }, xt = (t) => {
1172
- const e = Fr(t);
1173
- return new RegExp(
1174
- // First capture group: match any context before the selector that's not inside @supports selector()
1175
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
1176
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,
1177
- "g"
1178
- );
1179
- };
1180
- xt("::slotted");
1181
- xt(":host");
1182
- xt(":host-context");
1183
- const us = (t, e) => {
1184
- if (!e)
146
+ }, ge = (e, t = []) => {
147
+ if (e.frames.length > 0)
148
+ for (const s of Array.from(e.frames))
149
+ t.push(s), ge(s, t);
150
+ return t;
151
+ }, pe = (e, t) => {
152
+ if (!t)
1185
153
  return;
1186
- const s = e.split("/");
1187
- return `${t}${s.slice(2, s.length - 1).join("-")}--docs`;
1188
- }, Jr = (t, e) => {
1189
- if (e)
1190
- return `${t}${e}`;
1191
- }, fs = (t) => {
1192
- let e = t.overview ? `${t.overview}
154
+ const s = t.split("/");
155
+ return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
156
+ }, Be = (e, t) => {
157
+ if (t)
158
+ return `${e}${t}`;
159
+ }, $e = (e) => {
160
+ let t = e.overview ? `${e.overview}
1193
161
 
1194
162
  ` : "";
1195
- const s = t.props.filter(({ attr: n }) => n !== void 0);
1196
- s.length && (e += `Attributes:
1197
- `, e += s.map(({ attr: n, docs: i }) => `- \`${n}\`: ${i}
1198
- `).join(""), e += `
163
+ const s = e.props.filter(({ attr: r }) => r !== void 0);
164
+ s.length && (t += `Attributes:
165
+ `, t += s.map(({ attr: r, docs: o }) => `- \`${r}\`: ${o}
166
+ `).join(""), t += `
1199
167
  `);
1200
- const r = t.props.filter(({ attr: n }) => n === void 0);
1201
- return r.length && (e += `Properties:
1202
- `, e += r.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1203
- `).join(""), e += `
1204
- `), t.methods.length && (e += `Methods:
1205
- `, e += t.methods.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1206
- `).join(""), e += `
1207
- `), t.events.length && (e += `Events:
1208
- `, e += t.events.map(({ event: n, docs: i }) => `- \`${n}\`: ${i}
1209
- `).join(""), e += `
1210
- `), t.listeners.length && (e += `Listeners:
1211
- `, e += t.listeners.map(({ event: n }) => `- \`${n}\`
1212
- `).join(""), e += `
1213
- `), t.slots.length && (e += `Slots:
1214
- `, e += t.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
1215
- `).join(""), e += `
1216
- `), e;
1217
- }, vt = (t) => `${t.docs}
168
+ const n = e.props.filter(({ attr: r }) => r === void 0);
169
+ return n.length && (t += `Properties:
170
+ `, t += n.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
171
+ `).join(""), t += `
172
+ `), e.methods.length && (t += `Methods:
173
+ `, t += e.methods.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
174
+ `).join(""), t += `
175
+ `), e.events.length && (t += `Events:
176
+ `, t += e.events.map(({ event: r, docs: o }) => `- \`${r}\`: ${o}
177
+ `).join(""), t += `
178
+ `), e.listeners.length && (t += `Listeners:
179
+ `, t += e.listeners.map(({ event: r }) => `- \`${r}\`
180
+ `).join(""), t += `
181
+ `), e.slots.length && (t += `Slots:
182
+ `, t += e.slots.map(({ name: r, docs: o }) => `- \`${r}\`: ${o}
183
+ `).join(""), t += `
184
+ `), t;
185
+ }, Z = (e) => `${e.docs}
1218
186
 
1219
- Type: \`${t.type}\``, ra = (t, e, s, r) => ({
187
+ Type: \`${e.type}\``, Xt = (e, t, s, n) => ({
1220
188
  $schema: "https://json.schemastore.org/web-types",
1221
- name: t,
1222
- version: e,
189
+ name: e,
190
+ version: t,
1223
191
  "description-markup": "markdown",
1224
192
  contributions: {
1225
193
  html: {
1226
- elements: s.components.map((n) => {
1227
- const i = us(r, n.filePath);
194
+ elements: s.components.map((r) => {
195
+ const o = pe(n, r.filePath);
1228
196
  return {
1229
- name: n.tag,
1230
- description: fs(n),
1231
- "doc-url": i,
1232
- attributes: n.props.filter((a) => a.attr).map((a) => ({
1233
- name: a.attr,
1234
- description: vt(a),
1235
- "doc-url": i,
197
+ name: r.tag,
198
+ description: $e(r),
199
+ "doc-url": o,
200
+ attributes: r.props.filter((i) => i.attr).map((i) => ({
201
+ name: i.attr,
202
+ description: Z(i),
203
+ "doc-url": o,
1236
204
  value: {
1237
- type: a.type,
1238
- default: a.default,
1239
- required: a.required
205
+ type: i.type,
206
+ default: i.default,
207
+ required: i.required
1240
208
  }
1241
209
  })),
1242
210
  js: {
1243
- properties: n.props.map((a) => ({
1244
- name: a.name,
1245
- description: vt(a),
1246
- "doc-url": i,
211
+ properties: r.props.map((i) => ({
212
+ name: i.name,
213
+ description: Z(i),
214
+ "doc-url": o,
1247
215
  value: {
1248
- type: a.type,
1249
- default: a.default,
1250
- required: a.required
216
+ type: i.type,
217
+ default: i.default,
218
+ required: i.required
1251
219
  }
1252
220
  })),
1253
- events: n.events.map((a) => ({
1254
- name: a.event,
1255
- description: a.docs
221
+ events: r.events.map((i) => ({
222
+ name: i.event,
223
+ description: i.docs
1256
224
  }))
1257
225
  },
1258
226
  css: {
1259
- properties: n.styles.map((a) => ({
1260
- name: a.name,
1261
- description: a.docs
227
+ properties: r.styles.map((i) => ({
228
+ name: i.name,
229
+ description: i.docs
1262
230
  }))
1263
231
  }
1264
232
  };
1265
233
  })
1266
234
  }
1267
235
  }
1268
- }), Xr = (t, e, s) => [
1269
- { name: "Storybook", url: us(t, s) },
1270
- { name: "Sources", url: Jr(e, s) }
1271
- ], Yr = (t) => {
1272
- if (!t.values.some(({ value: e }) => e === void 0))
1273
- return t.values.map(({ value: e }) => ({ name: e }));
1274
- }, na = (t, e, s) => ({
236
+ }), Ue = (e, t, s) => [
237
+ { name: "Storybook", url: pe(e, s) },
238
+ { name: "Sources", url: Be(t, s) }
239
+ ], Ze = (e) => {
240
+ if (!e.values.some(({ value: t }) => t === void 0))
241
+ return e.values.map(({ value: t }) => ({ name: t }));
242
+ }, Qt = (e, t, s) => ({
1275
243
  version: 1.1,
1276
- tags: t.components.map((r) => {
1277
- const n = Xr(e, s, r.filePath);
244
+ tags: e.components.map((n) => {
245
+ const r = Ue(t, s, n.filePath);
1278
246
  return {
1279
- name: r.tag,
1280
- description: fs(r),
1281
- attributes: r.props.map((i) => ({
1282
- name: i.attr ?? i.name,
1283
- description: vt(i),
1284
- values: Yr(i),
1285
- references: n
247
+ name: n.tag,
248
+ description: $e(n),
249
+ attributes: n.props.map((o) => ({
250
+ name: o.attr ?? o.name,
251
+ description: Z(o),
252
+ values: Ze(o),
253
+ references: r
1286
254
  })),
1287
- references: n
255
+ references: r
1288
256
  };
1289
257
  }),
1290
258
  globalAttributes: [],
1291
259
  valueSets: []
1292
- }), ia = (t) => ({
260
+ }), Vt = (e) => ({
1293
261
  version: 1.1,
1294
- properties: t.components.flatMap((e) => e.styles.map((s) => ({
262
+ properties: e.components.flatMap((t) => t.styles.map((s) => ({
1295
263
  name: s.name,
1296
264
  description: s.docs
1297
265
  })))
1298
- }), Kr = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, aa = (t) => {
1299
- const e = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
1300
- return Vr([e.value, s.value, r.value].join("-"), t, { timeZone: "UTC" }).replace(e.value, e.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
1301
- }, Qr = (t, e, s) => {
1302
- const r = t.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r?.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, a = i.split("-").shift();
1303
- return Object.keys(e).length === 0 ? {
1304
- locale: i,
266
+ }), We = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, es = (e) => {
267
+ const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, n = { value: "24", pattern: "dd" };
268
+ return Je([t.value, s.value, n.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(n.value, n.pattern);
269
+ }, qe = (e, t, s) => {
270
+ const n = e.closest("[lang]"), r = Intl.NumberFormat.supportedLocalesOf(n?.lang), o = r.length > 0 && typeof r[0] == "string" ? r[0] : navigator.language || s, i = o.split("-").shift();
271
+ return Object.keys(t).length === 0 ? {
272
+ locale: o,
1305
273
  messages: { lang: s }
1306
274
  } : {
1307
- locale: i,
1308
- messages: e[a] ?? e[s] ?? { lang: s }
275
+ locale: o,
276
+ messages: t[i] ?? t[s] ?? { lang: s }
1309
277
  };
1310
- }, oa = (t, e, s) => new Intl.NumberFormat(e, { style: "currency", currency: s }).format(t), la = (t, e, s = 0) => new Intl.NumberFormat(e, { minimumFractionDigits: s }).format(Number(t)), ca = (t, e, s = 0) => new Intl.NumberFormat(e, {
278
+ }, ts = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), ss = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(Number(e)), ns = (e, t, s = 0) => new Intl.NumberFormat(t, {
1311
279
  style: "percent",
1312
280
  minimumFractionDigits: s,
1313
281
  maximumFractionDigits: s
1314
- }).format(t), ha = (t, e, s, r = "short", n = 0) => new Intl.NumberFormat(e, {
282
+ }).format(e), rs = (e, t, s, n = "short", r = 0) => new Intl.NumberFormat(t, {
1315
283
  style: "unit",
1316
284
  unit: s,
1317
- unitDisplay: r,
1318
- minimumFractionDigits: n,
1319
- maximumFractionDigits: n
1320
- }).format(t), Vr = (t, e, s) => typeof t != "string" || t === "" || !Kr.test(t) ? "" : new Intl.DateTimeFormat(e, s).format(new Date(t)), ua = (t, e) => (s) => Qr(s, t, e);
1321
- var He = {
285
+ unitDisplay: n,
286
+ minimumFractionDigits: r,
287
+ maximumFractionDigits: r
288
+ }).format(e), Je = (e, t, s) => typeof e != "string" || e === "" || !We.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), os = (e, t) => (s) => qe(s, e, t);
289
+ var X = {
1322
290
  updatable: !0,
1323
- slotRelocation: !0,
1324
- // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
1325
- experimentalSlotFixes: !1
1326
- }, en = Object.create, ct = Object.defineProperty, tn = Object.getOwnPropertyDescriptor, ps = Object.getOwnPropertyNames, sn = Object.getPrototypeOf, rn = Object.prototype.hasOwnProperty, gs = (t) => {
1327
- throw TypeError(t);
1328
- }, nn = (t, e, s) => e in t ? ct(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, ds = (t, e) => function() {
1329
- return e || (0, t[ps(t)[0]])((e = { exports: {} }).exports, e), e.exports;
1330
- }, an = (t, e) => {
1331
- for (var s in e)
1332
- ct(t, s, { get: e[s], enumerable: !0 });
1333
- }, on = (t, e, s, r) => {
1334
- if (e && typeof e == "object" || typeof e == "function")
1335
- for (let n of ps(e))
1336
- !rn.call(t, n) && n !== s && ct(t, n, { get: () => e[n], enumerable: !(r = tn(e, n)) || r.enumerable });
1337
- return t;
1338
- }, ln = (t, e, s) => (s = t != null ? en(sn(t)) : {}, on(
1339
- // If the importer is in node compatibility mode or this is not an ESM
1340
- // file that has been converted to a CommonJS file using a Babel-
1341
- // compatible transform (i.e. "__esModule" has not been set), then set
1342
- // "default" to the CommonJS "module.exports" for node compatibility.
1343
- ct(s, "default", { value: t, enumerable: !0 }),
1344
- t
1345
- )), cn = (t, e, s) => nn(t, e + "", s), Ot = (t, e, s) => e.has(t) || gs("Cannot " + s), _ = (t, e, s) => (Ot(t, e, "read from private field"), s ? s.call(t) : e.get(t)), q = (t, e, s) => e.has(t) ? gs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), N = (t, e, s, r) => (Ot(t, e, "write to private field"), e.set(t, s), s), pe = (t, e, s) => (Ot(t, e, "access private method"), s), hn = ds({
1346
- "node_modules/balanced-match/index.js"(t, e) {
1347
- e.exports = s;
1348
- function s(i, a, o) {
1349
- i instanceof RegExp && (i = r(i, o)), a instanceof RegExp && (a = r(a, o));
1350
- var l = n(i, a, o);
1351
- return l && {
1352
- start: l[0],
1353
- end: l[1],
1354
- pre: o.slice(0, l[0]),
1355
- body: o.slice(l[0] + i.length, l[1]),
1356
- post: o.slice(l[1] + a.length)
1357
- };
1358
- }
1359
- function r(i, a) {
1360
- var o = a.match(i);
1361
- return o ? o[0] : null;
1362
- }
1363
- s.range = n;
1364
- function n(i, a, o) {
1365
- var l, h, c, u, d, g = o.indexOf(i), f = o.indexOf(a, g + 1), p = g;
1366
- if (g >= 0 && f > 0) {
1367
- if (i === a)
1368
- return [g, f];
1369
- for (l = [], c = o.length; p >= 0 && !d; )
1370
- p == g ? (l.push(p), g = o.indexOf(i, p + 1)) : l.length == 1 ? d = [l.pop(), f] : (h = l.pop(), h < c && (c = h, u = f), f = o.indexOf(a, p + 1)), p = g < f && g >= 0 ? g : f;
1371
- l.length && (d = [c, u]);
1372
- }
1373
- return d;
1374
- }
1375
- }
1376
- }), un = ds({
1377
- "node_modules/brace-expansion/index.js"(t, e) {
1378
- var s = hn();
1379
- e.exports = d;
1380
- var r = "\0SLASH" + Math.random() + "\0", n = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", o = "\0PERIOD" + Math.random() + "\0";
1381
- function l($) {
1382
- return parseInt($, 10) == $ ? parseInt($, 10) : $.charCodeAt(0);
1383
- }
1384
- function h($) {
1385
- return $.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(i).split("\\,").join(a).split("\\.").join(o);
1386
- }
1387
- function c($) {
1388
- return $.split(r).join("\\").split(n).join("{").split(i).join("}").split(a).join(",").split(o).join(".");
1389
- }
1390
- function u($) {
1391
- if (!$)
1392
- return [""];
1393
- var w = [], b = s("{", "}", $);
1394
- if (!b)
1395
- return $.split(",");
1396
- var m = b.pre, D = b.body, L = b.post, x = m.split(",");
1397
- x[x.length - 1] += "{" + D + "}";
1398
- var M = u(L);
1399
- return L.length && (x[x.length - 1] += M.shift(), x.push.apply(x, M)), w.push.apply(w, x), w;
1400
- }
1401
- function d($) {
1402
- return $ ? ($.substr(0, 2) === "{}" && ($ = "\\{\\}" + $.substr(2)), E(h($), !0).map(c)) : [];
1403
- }
1404
- function g($) {
1405
- return "{" + $ + "}";
1406
- }
1407
- function f($) {
1408
- return /^-?0\d/.test($);
1409
- }
1410
- function p($, w) {
1411
- return $ <= w;
1412
- }
1413
- function y($, w) {
1414
- return $ >= w;
1415
- }
1416
- function E($, w) {
1417
- var b = [], m = s("{", "}", $);
1418
- if (!m) return [$];
1419
- var D = m.pre, L = m.post.length ? E(m.post, !1) : [""];
1420
- if (/\$$/.test(m.pre))
1421
- for (var x = 0; x < L.length; x++) {
1422
- var M = D + "{" + m.body + "}" + L[x];
1423
- b.push(M);
1424
- }
1425
- else {
1426
- var me = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), oe = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), Q = me || oe, Ae = m.body.indexOf(",") >= 0;
1427
- if (!Q && !Ae)
1428
- return m.post.match(/,(?!,).*\}/) ? ($ = m.pre + "{" + m.body + i + m.post, E($)) : [$];
1429
- var S;
1430
- if (Q)
1431
- S = m.body.split(/\.\./);
1432
- else if (S = u(m.body), S.length === 1 && (S = E(S[0], !1).map(g), S.length === 1))
1433
- return L.map(function(gt) {
1434
- return m.pre + S[0] + gt;
1435
- });
1436
- var I;
1437
- if (Q) {
1438
- var le = l(S[0]), Re = l(S[1]), ut = Math.max(S[0].length, S[1].length), Ne = S.length == 3 ? Math.abs(l(S[2])) : 1, Le = p, ft = Re < le;
1439
- ft && (Ne *= -1, Le = y);
1440
- var pt = S.some(f);
1441
- I = [];
1442
- for (var V = le; Le(V, Re); V += Ne) {
1443
- var A;
1444
- if (oe)
1445
- A = String.fromCharCode(V), A === "\\" && (A = "");
1446
- else if (A = String(V), pt) {
1447
- var Me = ut - A.length;
1448
- if (Me > 0) {
1449
- var ke = new Array(Me + 1).join("0");
1450
- V < 0 ? A = "-" + ke + A.slice(1) : A = ke + A;
1451
- }
1452
- }
1453
- I.push(A);
1454
- }
1455
- } else {
1456
- I = [];
1457
- for (var G = 0; G < S.length; G++)
1458
- I.push.apply(I, E(S[G], !1));
1459
- }
1460
- for (var G = 0; G < I.length; G++)
1461
- for (var x = 0; x < L.length; x++) {
1462
- var M = D + I[G] + L[x];
1463
- (!w || Q || M) && b.push(M);
1464
- }
1465
- }
1466
- return b;
1467
- }
1468
- }
1469
- }), fn = "http://www.w3.org/2000/svg", pn = "http://www.w3.org/1999/xhtml", jt = (t, e) => e in t, Pt = "http://www.w3.org/1999/xlink", $e = typeof window < "u" ? window : {}, Oe = {
291
+ slotRelocation: !0
292
+ }, Ye = "http://www.w3.org/2000/svg", Ke = "http://www.w3.org/1999/xhtml", Xe = (e) => {
293
+ if (e.__stencil__getHostRef)
294
+ return e.__stencil__getHostRef();
295
+ }, te = (e, t) => t in e, se = "http://www.w3.org/1999/xlink", A = typeof window < "u" ? window : {}, T = {
1470
296
  $flags$: 0,
1471
297
  $resourcesUrl$: "",
1472
- jmp: (t) => t(),
1473
- raf: (t) => requestAnimationFrame(t),
1474
- ael: (t, e, s, r) => t.addEventListener(e, s, r),
1475
- rel: (t, e, s, r) => t.removeEventListener(e, s, r),
1476
- ce: (t, e) => new CustomEvent(t, e)
1477
- }, gn = (t) => t != null && t !== void 0, $s = (t) => (t = typeof t, t === "object" || t === "function"), dn = ln(un()), $n = 1024 * 64, tt = (t) => {
1478
- if (typeof t != "string")
1479
- throw new TypeError("invalid pattern");
1480
- if (t.length > $n)
1481
- throw new TypeError("pattern is too long");
1482
- }, vn = {
1483
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
1484
- "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
1485
- "[:ascii:]": ["\\x00-\\x7f", !1],
1486
- "[:blank:]": ["\\p{Zs}\\t", !0],
1487
- "[:cntrl:]": ["\\p{Cc}", !0],
1488
- "[:digit:]": ["\\p{Nd}", !0],
1489
- "[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
1490
- "[:lower:]": ["\\p{Ll}", !0],
1491
- "[:print:]": ["\\p{C}", !0],
1492
- "[:punct:]": ["\\p{P}", !0],
1493
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
1494
- "[:upper:]": ["\\p{Lu}", !0],
1495
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
1496
- "[:xdigit:]": ["A-Fa-f0-9", !1]
1497
- }, je = (t) => t.replace(/[[\]\\-]/g, "\\$&"), _n = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Dt = (t) => t.join(""), mn = (t, e) => {
1498
- const s = e;
1499
- if (t.charAt(s) !== "[")
1500
- throw new Error("not in a brace expression");
1501
- const r = [], n = [];
1502
- let i = s + 1, a = !1, o = !1, l = !1, h = !1, c = s, u = "";
1503
- e: for (; i < t.length; ) {
1504
- const p = t.charAt(i);
1505
- if ((p === "!" || p === "^") && i === s + 1) {
1506
- h = !0, i++;
1507
- continue;
1508
- }
1509
- if (p === "]" && a && !l) {
1510
- c = i + 1;
1511
- break;
1512
- }
1513
- if (a = !0, p === "\\" && !l) {
1514
- l = !0, i++;
1515
- continue;
1516
- }
1517
- if (p === "[" && !l) {
1518
- for (const [y, [E, $, w]] of Object.entries(vn))
1519
- if (t.startsWith(y, i)) {
1520
- if (u)
1521
- return ["$.", !1, t.length - s, !0];
1522
- i += y.length, w ? n.push(E) : r.push(E), o = o || $;
1523
- continue e;
1524
- }
1525
- }
1526
- if (l = !1, u) {
1527
- p > u ? r.push(je(u) + "-" + je(p)) : p === u && r.push(je(p)), u = "", i++;
1528
- continue;
1529
- }
1530
- if (t.startsWith("-]", i + 1)) {
1531
- r.push(je(p + "-")), i += 2;
1532
- continue;
1533
- }
1534
- if (t.startsWith("-", i + 1)) {
1535
- u = p, i += 2;
1536
- continue;
1537
- }
1538
- r.push(je(p)), i++;
1539
- }
1540
- if (c < i)
1541
- return ["", !1, 0, !1];
1542
- if (!r.length && !n.length)
1543
- return ["$.", !1, t.length - s, !0];
1544
- if (n.length === 0 && r.length === 1 && /^\\?.$/.test(r[0]) && !h) {
1545
- const p = r[0].length === 2 ? r[0].slice(-1) : r[0];
1546
- return [_n(p), !1, c - s, !1];
1547
- }
1548
- const d = "[" + (h ? "^" : "") + Dt(r) + "]", g = "[" + (h ? "" : "^") + Dt(n) + "]";
1549
- return [r.length && n.length ? "(" + d + "|" + g + ")" : r.length ? d : g, o, c - s, !0];
1550
- }, ze = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), yn = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), It = (t) => yn.has(t), En = "(?!(?:^|/)\\.\\.?(?:$|/))", Je = "(?!\\.)", wn = /* @__PURE__ */ new Set(["[", "."]), bn = /* @__PURE__ */ new Set(["..", "."]), Sn = new Set("().*{}+?[]^$\\!"), xn = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Tt = "[^/]", vs = Tt + "*?", _s = Tt + "+?", P, z, ae, T, C, ge, Se, ve, te, Ee, st, De, ms, Te, Ke, _t, ys, ne = class he {
1551
- constructor(e, s, r = {}) {
1552
- q(this, De), cn(this, "type"), q(this, P), q(this, z), q(this, ae, !1), q(this, T, []), q(this, C), q(this, ge), q(this, Se), q(this, ve, !1), q(this, te), q(this, Ee), q(this, st, !1), this.type = e, e && N(this, z, !0), N(this, C, s), N(this, P, _(this, C) ? _(_(this, C), P) : this), N(this, te, _(this, P) === this ? r : _(_(this, P), te)), N(this, Se, _(this, P) === this ? [] : _(_(this, P), Se)), e === "!" && !_(_(this, P), ve) && _(this, Se).push(this), N(this, ge, _(this, C) ? _(_(this, C), T).length : 0);
1553
- }
1554
- get hasMagic() {
1555
- if (_(this, z) !== void 0)
1556
- return _(this, z);
1557
- for (const e of _(this, T))
1558
- if (typeof e != "string" && (e.type || e.hasMagic))
1559
- return N(this, z, !0);
1560
- return _(this, z);
1561
- }
1562
- // reconstructs the pattern
1563
- toString() {
1564
- return _(this, Ee) !== void 0 ? _(this, Ee) : this.type ? N(this, Ee, this.type + "(" + _(this, T).map((e) => String(e)).join("|") + ")") : N(this, Ee, _(this, T).map((e) => String(e)).join(""));
1565
- }
1566
- push(...e) {
1567
- for (const s of e)
1568
- if (s !== "") {
1569
- if (typeof s != "string" && !(s instanceof he && _(s, C) === this))
1570
- throw new Error("invalid part: " + s);
1571
- _(this, T).push(s);
1572
- }
1573
- }
1574
- toJSON() {
1575
- var e;
1576
- const s = this.type === null ? _(this, T).slice().map((r) => typeof r == "string" ? r : r.toJSON()) : [this.type, ..._(this, T).map((r) => r.toJSON())];
1577
- return this.isStart() && !this.type && s.unshift([]), this.isEnd() && (this === _(this, P) || _(_(this, P), ve) && ((e = _(this, C)) == null ? void 0 : e.type) === "!") && s.push({}), s;
1578
- }
1579
- isStart() {
1580
- var e;
1581
- if (_(this, P) === this)
1582
- return !0;
1583
- if (!((e = _(this, C)) != null && e.isStart()))
1584
- return !1;
1585
- if (_(this, ge) === 0)
1586
- return !0;
1587
- const s = _(this, C);
1588
- for (let r = 0; r < _(this, ge); r++) {
1589
- const n = _(s, T)[r];
1590
- if (!(n instanceof he && n.type === "!"))
1591
- return !1;
1592
- }
1593
- return !0;
1594
- }
1595
- isEnd() {
1596
- var e, s, r;
1597
- if (_(this, P) === this || ((e = _(this, C)) == null ? void 0 : e.type) === "!")
1598
- return !0;
1599
- if (!((s = _(this, C)) != null && s.isEnd()))
1600
- return !1;
1601
- if (!this.type)
1602
- return (r = _(this, C)) == null ? void 0 : r.isEnd();
1603
- const n = _(this, C) ? _(_(this, C), T).length : 0;
1604
- return _(this, ge) === n - 1;
1605
- }
1606
- copyIn(e) {
1607
- typeof e == "string" ? this.push(e) : this.push(e.clone(this));
1608
- }
1609
- clone(e) {
1610
- const s = new he(this.type, e);
1611
- for (const r of _(this, T))
1612
- s.copyIn(r);
1613
- return s;
1614
- }
1615
- static fromGlob(e, s = {}) {
1616
- var r;
1617
- const n = new he(null, void 0, s);
1618
- return pe(r = he, Te, Ke).call(r, e, n, 0, s), n;
1619
- }
1620
- // returns the regular expression if there's magic, or the unescaped
1621
- // string if not.
1622
- toMMPattern() {
1623
- if (this !== _(this, P))
1624
- return _(this, P).toMMPattern();
1625
- const e = this.toString(), [s, r, n, i] = this.toRegExpSource();
1626
- if (!(n || _(this, z) || _(this, te).nocase && !_(this, te).nocaseMagicOnly && e.toUpperCase() !== e.toLowerCase()))
1627
- return r;
1628
- const o = (_(this, te).nocase ? "i" : "") + (i ? "u" : "");
1629
- return Object.assign(new RegExp(`^${s}$`, o), {
1630
- _src: s,
1631
- _glob: e
1632
- });
1633
- }
1634
- get options() {
1635
- return _(this, te);
1636
- }
1637
- // returns the string match, the regexp source, whether there's magic
1638
- // in the regexp (so a regular expression is required) and whether or
1639
- // not the uflag is needed for the regular expression (for posix classes)
1640
- // TODO: instead of injecting the start/end at this point, just return
1641
- // the BODY of the regexp, along with the start/end portions suitable
1642
- // for binding the start/end in either a joined full-path makeRe context
1643
- // (where we bind to (^|/), or a standalone matchPart context (where
1644
- // we bind to ^, and not /). Otherwise slashes get duped!
1645
- //
1646
- // In part-matching mode, the start is:
1647
- // - if not isStart: nothing
1648
- // - if traversal possible, but not allowed: ^(?!\.\.?$)
1649
- // - if dots allowed or not possible: ^
1650
- // - if dots possible and not allowed: ^(?!\.)
1651
- // end is:
1652
- // - if not isEnd(): nothing
1653
- // - else: $
1654
- //
1655
- // In full-path matching mode, we put the slash at the START of the
1656
- // pattern, so start is:
1657
- // - if first pattern: same as part-matching mode
1658
- // - if not isStart(): nothing
1659
- // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
1660
- // - if dots allowed or not possible: /
1661
- // - if dots possible and not allowed: /(?!\.)
1662
- // end is:
1663
- // - if last pattern, same as part-matching mode
1664
- // - else nothing
1665
- //
1666
- // Always put the (?:$|/) on negated tails, though, because that has to be
1667
- // there to bind the end of the negated pattern portion, and it's easier to
1668
- // just stick it in now rather than try to inject it later in the middle of
1669
- // the pattern.
1670
- //
1671
- // We can just always return the same end, and leave it up to the caller
1672
- // to know whether it's going to be used joined or in parts.
1673
- // And, if the start is adjusted slightly, can do the same there:
1674
- // - if not isStart: nothing
1675
- // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
1676
- // - if dots allowed or not possible: (?:/|^)
1677
- // - if dots possible and not allowed: (?:/|^)(?!\.)
1678
- //
1679
- // But it's better to have a simpler binding without a conditional, for
1680
- // performance, so probably better to return both start options.
1681
- //
1682
- // Then the caller just ignores the end if it's not the first pattern,
1683
- // and the start always gets applied.
1684
- //
1685
- // But that's always going to be $ if it's the ending pattern, or nothing,
1686
- // so the caller can just attach $ at the end of the pattern when building.
1687
- //
1688
- // So the todo is:
1689
- // - better detect what kind of start is needed
1690
- // - return both flavors of starting pattern
1691
- // - attach $ at the end of the pattern when creating the actual RegExp
1692
- //
1693
- // Ah, but wait, no, that all only applies to the root when the first pattern
1694
- // is not an extglob. If the first pattern IS an extglob, then we need all
1695
- // that dot prevention biz to live in the extglob portions, because eg
1696
- // +(*|.x*) can match .xy but not .yx.
1697
- //
1698
- // So, return the two flavors if it's #root and the first child is not an
1699
- // AST, otherwise leave it to the child AST to handle it, and there,
1700
- // use the (?:^|/) style of start binding.
1701
- //
1702
- // Even simplified further:
1703
- // - Since the start for a join is eg /(?!\.) and the start for a part
1704
- // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
1705
- // or start or whatever) and prepend ^ or / at the Regexp construction.
1706
- toRegExpSource(e) {
1707
- var s;
1708
- const r = e ?? !!_(this, te).dot;
1709
- if (_(this, P) === this && pe(this, De, ms).call(this), !this.type) {
1710
- const h = this.isStart() && this.isEnd(), c = _(this, T).map((f) => {
1711
- var p;
1712
- const [y, E, $, w] = typeof f == "string" ? pe(p = he, Te, ys).call(p, f, _(this, z), h) : f.toRegExpSource(e);
1713
- return N(this, z, _(this, z) || $), N(this, ae, _(this, ae) || w), y;
1714
- }).join("");
1715
- let u = "";
1716
- if (this.isStart() && typeof _(this, T)[0] == "string" && !(_(this, T).length === 1 && bn.has(_(this, T)[0]))) {
1717
- const p = wn, y = (
1718
- // dots are allowed, and the pattern starts with [ or .
1719
- r && p.has(c.charAt(0)) || // the pattern starts with \., and then [ or .
1720
- c.startsWith("\\.") && p.has(c.charAt(2)) || // the pattern starts with \.\., and then [ or .
1721
- c.startsWith("\\.\\.") && p.has(c.charAt(4))
1722
- ), E = !r && !e && p.has(c.charAt(0));
1723
- u = y ? En : E ? Je : "";
1724
- }
1725
- let d = "";
1726
- return this.isEnd() && _(_(this, P), ve) && ((s = _(this, C)) == null ? void 0 : s.type) === "!" && (d = "(?:$|\\/)"), [
1727
- u + c + d,
1728
- ze(c),
1729
- N(this, z, !!_(this, z)),
1730
- _(this, ae)
1731
- ];
1732
- }
1733
- const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
1734
- let a = pe(this, De, _t).call(this, r);
1735
- if (this.isStart() && this.isEnd() && !a && this.type !== "!") {
1736
- const h = this.toString();
1737
- return N(this, T, [h]), this.type = null, N(this, z, void 0), [h, ze(this.toString()), !1, !1];
1738
- }
1739
- let o = !n || e || r || !Je ? "" : pe(this, De, _t).call(this, !0);
1740
- o === a && (o = ""), o && (a = `(?:${a})(?:${o})*?`);
1741
- let l = "";
1742
- if (this.type === "!" && _(this, st))
1743
- l = (this.isStart() && !r ? Je : "") + _s;
1744
- else {
1745
- const h = this.type === "!" ? (
1746
- // !() must match something,but !(x) can match ''
1747
- "))" + (this.isStart() && !r && !e ? Je : "") + vs + ")"
1748
- ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
1749
- l = i + a + h;
1750
- }
1751
- return [
1752
- l,
1753
- ze(a),
1754
- N(this, z, !!_(this, z)),
1755
- _(this, ae)
1756
- ];
1757
- }
1758
- };
1759
- P = /* @__PURE__ */ new WeakMap();
1760
- z = /* @__PURE__ */ new WeakMap();
1761
- ae = /* @__PURE__ */ new WeakMap();
1762
- T = /* @__PURE__ */ new WeakMap();
1763
- C = /* @__PURE__ */ new WeakMap();
1764
- ge = /* @__PURE__ */ new WeakMap();
1765
- Se = /* @__PURE__ */ new WeakMap();
1766
- ve = /* @__PURE__ */ new WeakMap();
1767
- te = /* @__PURE__ */ new WeakMap();
1768
- Ee = /* @__PURE__ */ new WeakMap();
1769
- st = /* @__PURE__ */ new WeakMap();
1770
- De = /* @__PURE__ */ new WeakSet();
1771
- ms = function() {
1772
- if (this !== _(this, P))
1773
- throw new Error("should only call on root");
1774
- if (_(this, ve))
1775
- return this;
1776
- this.toString(), N(this, ve, !0);
1777
- let t;
1778
- for (; t = _(this, Se).pop(); ) {
1779
- if (t.type !== "!")
1780
- continue;
1781
- let e = t, s = _(e, C);
1782
- for (; s; ) {
1783
- for (let r = _(e, ge) + 1; !s.type && r < _(s, T).length; r++)
1784
- for (const n of _(t, T)) {
1785
- if (typeof n == "string")
1786
- throw new Error("string part in extglob AST??");
1787
- n.copyIn(_(s, T)[r]);
1788
- }
1789
- e = s, s = _(e, C);
1790
- }
1791
- }
1792
- return this;
1793
- };
1794
- Te = /* @__PURE__ */ new WeakSet();
1795
- Ke = function(t, e, s, r) {
1796
- var n, i;
1797
- let a = !1, o = !1, l = -1, h = !1;
1798
- if (e.type === null) {
1799
- let f = s, p = "";
1800
- for (; f < t.length; ) {
1801
- const y = t.charAt(f++);
1802
- if (a || y === "\\") {
1803
- a = !a, p += y;
1804
- continue;
1805
- }
1806
- if (o) {
1807
- f === l + 1 ? (y === "^" || y === "!") && (h = !0) : y === "]" && !(f === l + 2 && h) && (o = !1), p += y;
1808
- continue;
1809
- } else if (y === "[") {
1810
- o = !0, l = f, h = !1, p += y;
1811
- continue;
1812
- }
1813
- if (!r.noext && It(y) && t.charAt(f) === "(") {
1814
- e.push(p), p = "";
1815
- const E = new ne(y, e);
1816
- f = pe(n = ne, Te, Ke).call(n, t, E, f, r), e.push(E);
1817
- continue;
1818
- }
1819
- p += y;
1820
- }
1821
- return e.push(p), f;
1822
- }
1823
- let c = s + 1, u = new ne(null, e);
1824
- const d = [];
1825
- let g = "";
1826
- for (; c < t.length; ) {
1827
- const f = t.charAt(c++);
1828
- if (a || f === "\\") {
1829
- a = !a, g += f;
1830
- continue;
1831
- }
1832
- if (o) {
1833
- c === l + 1 ? (f === "^" || f === "!") && (h = !0) : f === "]" && !(c === l + 2 && h) && (o = !1), g += f;
1834
- continue;
1835
- } else if (f === "[") {
1836
- o = !0, l = c, h = !1, g += f;
1837
- continue;
1838
- }
1839
- if (It(f) && t.charAt(c) === "(") {
1840
- u.push(g), g = "";
1841
- const p = new ne(f, u);
1842
- u.push(p), c = pe(i = ne, Te, Ke).call(i, t, p, c, r);
1843
- continue;
1844
- }
1845
- if (f === "|") {
1846
- u.push(g), g = "", d.push(u), u = new ne(null, e);
1847
- continue;
1848
- }
1849
- if (f === ")")
1850
- return g === "" && _(e, T).length === 0 && N(e, st, !0), u.push(g), g = "", e.push(...d, u), c;
1851
- g += f;
1852
- }
1853
- return e.type = null, N(e, z, void 0), N(e, T, [t.substring(s - 1)]), c;
1854
- };
1855
- _t = function(t) {
1856
- return _(this, T).map((e) => {
1857
- if (typeof e == "string")
1858
- throw new Error("string type in extglob ast??");
1859
- const [s, r, n, i] = e.toRegExpSource(t);
1860
- return N(this, ae, _(this, ae) || i), s;
1861
- }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
1862
- };
1863
- ys = function(t, e, s = !1) {
1864
- let r = !1, n = "", i = !1;
1865
- for (let a = 0; a < t.length; a++) {
1866
- const o = t.charAt(a);
1867
- if (r) {
1868
- r = !1, n += (Sn.has(o) ? "\\" : "") + o;
1869
- continue;
1870
- }
1871
- if (o === "\\") {
1872
- a === t.length - 1 ? n += "\\\\" : r = !0;
1873
- continue;
1874
- }
1875
- if (o === "[") {
1876
- const [l, h, c, u] = mn(t, a);
1877
- if (c) {
1878
- n += l, i = i || h, a += c - 1, e = e || u;
1879
- continue;
1880
- }
1881
- }
1882
- if (o === "*") {
1883
- s && t === "*" ? n += _s : n += vs, e = !0;
1884
- continue;
1885
- }
1886
- if (o === "?") {
1887
- n += Tt, e = !0;
1888
- continue;
1889
- }
1890
- n += xn(o);
1891
- }
1892
- return [n, ze(t), !!e, i];
1893
- };
1894
- q(ne, Te);
1895
- var Es = ne, On = (t, { windowsPathsNoEscape: e = !1 } = {}) => e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&"), F = (t, e, s = {}) => (tt(e), !s.nocomment && e.charAt(0) === "#" ? !1 : new ht(e, s).match(t)), Tn = /^\*+([^+@!?\*\[\(]*)$/, An = (t) => (e) => !e.startsWith(".") && e.endsWith(t), Rn = (t) => (e) => e.endsWith(t), Nn = (t) => (t = t.toLowerCase(), (e) => !e.startsWith(".") && e.toLowerCase().endsWith(t)), Ln = (t) => (t = t.toLowerCase(), (e) => e.toLowerCase().endsWith(t)), Mn = /^\*+\.\*+$/, kn = (t) => !t.startsWith(".") && t.includes("."), Cn = (t) => t !== "." && t !== ".." && t.includes("."), jn = /^\.\*+$/, Pn = (t) => t !== "." && t !== ".." && t.startsWith("."), Dn = /^\*+$/, In = (t) => t.length !== 0 && !t.startsWith("."), Wn = (t) => t.length !== 0 && t !== "." && t !== "..", zn = /^\?+([^+@!?\*\[\(]*)?$/, Gn = ([t, e = ""]) => {
1896
- const s = ws([t]);
1897
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
1898
- }, Hn = ([t, e = ""]) => {
1899
- const s = bs([t]);
1900
- return e ? (e = e.toLowerCase(), (r) => s(r) && r.toLowerCase().endsWith(e)) : s;
1901
- }, Fn = ([t, e = ""]) => {
1902
- const s = bs([t]);
1903
- return e ? (r) => s(r) && r.endsWith(e) : s;
1904
- }, Bn = ([t, e = ""]) => {
1905
- const s = ws([t]);
1906
- return e ? (r) => s(r) && r.endsWith(e) : s;
1907
- }, ws = ([t]) => {
1908
- const e = t.length;
1909
- return (s) => s.length === e && !s.startsWith(".");
1910
- }, bs = ([t]) => {
1911
- const e = t.length;
1912
- return (s) => s.length === e && s !== "." && s !== "..";
1913
- }, Ss = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", Wt = {
1914
- win32: { sep: "\\" },
1915
- posix: { sep: "/" }
1916
- }, Un = Ss === "win32" ? Wt.win32.sep : Wt.posix.sep;
1917
- F.sep = Un;
1918
- var K = /* @__PURE__ */ Symbol("globstar **");
1919
- F.GLOBSTAR = K;
1920
- var Zn = "[^/]", qn = Zn + "*?", Jn = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Xn = "(?:(?!(?:\\/|^)\\.).)*?", Yn = (t, e = {}) => (s) => F(s, t, e);
1921
- F.filter = Yn;
1922
- var X = (t, e = {}) => Object.assign({}, t, e), Kn = (t) => {
1923
- if (!t || typeof t != "object" || !Object.keys(t).length)
1924
- return F;
1925
- const e = F;
1926
- return Object.assign((r, n, i = {}) => e(r, n, X(t, i)), {
1927
- Minimatch: class extends e.Minimatch {
1928
- constructor(n, i = {}) {
1929
- super(n, X(t, i));
1930
- }
1931
- static defaults(n) {
1932
- return e.defaults(X(t, n)).Minimatch;
1933
- }
1934
- },
1935
- AST: class extends e.AST {
1936
- /* c8 ignore start */
1937
- constructor(n, i, a = {}) {
1938
- super(n, i, X(t, a));
1939
- }
1940
- /* c8 ignore stop */
1941
- static fromGlob(n, i = {}) {
1942
- return e.AST.fromGlob(n, X(t, i));
1943
- }
1944
- },
1945
- unescape: (r, n = {}) => e.unescape(r, X(t, n)),
1946
- escape: (r, n = {}) => e.escape(r, X(t, n)),
1947
- filter: (r, n = {}) => e.filter(r, X(t, n)),
1948
- defaults: (r) => e.defaults(X(t, r)),
1949
- makeRe: (r, n = {}) => e.makeRe(r, X(t, n)),
1950
- braceExpand: (r, n = {}) => e.braceExpand(r, X(t, n)),
1951
- match: (r, n, i = {}) => e.match(r, n, X(t, i)),
1952
- sep: e.sep,
1953
- GLOBSTAR: K
298
+ jmp: (e) => e(),
299
+ raf: (e) => requestAnimationFrame(e),
300
+ ael: (e, t, s, n) => e.addEventListener(t, s, n),
301
+ rel: (e, t, s, n) => e.removeEventListener(t, s, n),
302
+ ce: (e, t) => new CustomEvent(e, t)
303
+ }, de = (e) => {
304
+ const t = W(e, "childNodes");
305
+ e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && Q(t, e.tagName).forEach((n) => {
306
+ n.nodeType === 1 && n.tagName === "SLOT-FB" && (Ve(n, I(n), !1).length ? n.hidden = !0 : n.hidden = !1);
1954
307
  });
1955
- };
1956
- F.defaults = Kn;
1957
- var xs = (t, e = {}) => (tt(t), e.nobrace || !/\{(?:(?!\{).)*\}/.test(t) ? [t] : (0, dn.default)(t));
1958
- F.braceExpand = xs;
1959
- var Qn = (t, e = {}) => new ht(t, e).makeRe();
1960
- F.makeRe = Qn;
1961
- var Vn = (t, e, s = {}) => {
1962
- const r = new ht(e, s);
1963
- return t = t.filter((n) => r.match(n)), r.options.nonull && !t.length && t.push(e), t;
1964
- };
1965
- F.match = Vn;
1966
- var zt = /[?*]|[+@!]\(.*?\)|\[|\]/, ei = (t) => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), ht = class {
1967
- options;
1968
- set;
1969
- pattern;
1970
- windowsPathsNoEscape;
1971
- nonegate;
1972
- negate;
1973
- comment;
1974
- empty;
1975
- preserveMultipleSlashes;
1976
- partial;
1977
- globSet;
1978
- globParts;
1979
- nocase;
1980
- isWindows;
1981
- platform;
1982
- windowsNoMagicRoot;
1983
- regexp;
1984
- constructor(t, e = {}) {
1985
- tt(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ss, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1986
- }
1987
- hasMagic() {
1988
- if (this.options.magicalBraces && this.set.length > 1)
1989
- return !0;
1990
- for (const t of this.set)
1991
- for (const e of t)
1992
- if (typeof e != "string")
1993
- return !0;
1994
- return !1;
1995
- }
1996
- debug(...t) {
1997
- }
1998
- make() {
1999
- const t = this.pattern, e = this.options;
2000
- if (!e.nocomment && t.charAt(0) === "#") {
2001
- this.comment = !0;
2002
- return;
2003
- }
2004
- if (!t) {
2005
- this.empty = !0;
2006
- return;
2007
- }
2008
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...n) => console.error(...n)), this.debug(this.pattern, this.globSet);
2009
- const s = this.globSet.map((n) => this.slashSplit(n));
2010
- this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
2011
- let r = this.globParts.map((n, i, a) => {
2012
- if (this.isWindows && this.windowsNoMagicRoot) {
2013
- const o = n[0] === "" && n[1] === "" && (n[2] === "?" || !zt.test(n[2])) && !zt.test(n[3]), l = /^[a-z]:/i.test(n[0]);
2014
- if (o)
2015
- return [...n.slice(0, 4), ...n.slice(4).map((h) => this.parse(h))];
2016
- if (l)
2017
- return [n[0], ...n.slice(1).map((h) => this.parse(h))];
2018
- }
2019
- return n.map((o) => this.parse(o));
2020
- });
2021
- if (this.debug(this.pattern, r), this.set = r.filter((n) => n.indexOf(!1) === -1), this.isWindows)
2022
- for (let n = 0; n < this.set.length; n++) {
2023
- const i = this.set[n];
2024
- i[0] === "" && i[1] === "" && this.globParts[n][2] === "?" && typeof i[3] == "string" && /^[a-z]:$/i.test(i[3]) && (i[2] = "?");
2025
- }
2026
- this.debug(this.pattern, this.set);
2027
- }
2028
- // various transforms to equivalent pattern sets that are
2029
- // faster to process in a filesystem walk. The goal is to
2030
- // eliminate what we can, and push all ** patterns as far
2031
- // to the right as possible, even if it increases the number
2032
- // of patterns that we have to process.
2033
- preprocess(t) {
2034
- if (this.options.noglobstar)
2035
- for (let s = 0; s < t.length; s++)
2036
- for (let r = 0; r < t[s].length; r++)
2037
- t[s][r] === "**" && (t[s][r] = "*");
2038
- const { optimizationLevel: e = 1 } = this.options;
2039
- return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
2040
- }
2041
- // just get rid of adjascent ** portions
2042
- adjascentGlobstarOptimize(t) {
2043
- return t.map((e) => {
2044
- let s = -1;
2045
- for (; (s = e.indexOf("**", s + 1)) !== -1; ) {
2046
- let r = s;
2047
- for (; e[r + 1] === "**"; )
2048
- r++;
2049
- r !== s && e.splice(s, r - s);
2050
- }
2051
- return e;
2052
- });
2053
- }
2054
- // get rid of adjascent ** and resolve .. portions
2055
- levelOneOptimize(t) {
2056
- return t.map((e) => (e = e.reduce((s, r) => {
2057
- const n = s[s.length - 1];
2058
- return r === "**" && n === "**" ? s : r === ".." && n && n !== ".." && n !== "." && n !== "**" ? (s.pop(), s) : (s.push(r), s);
2059
- }, []), e.length === 0 ? [""] : e));
2060
- }
2061
- levelTwoFileOptimize(t) {
2062
- Array.isArray(t) || (t = this.slashSplit(t));
2063
- let e = !1;
2064
- do {
2065
- if (e = !1, !this.preserveMultipleSlashes) {
2066
- for (let r = 1; r < t.length - 1; r++) {
2067
- const n = t[r];
2068
- r === 1 && n === "" && t[0] === "" || (n === "." || n === "") && (e = !0, t.splice(r, 1), r--);
2069
- }
2070
- t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
2071
- }
2072
- let s = 0;
2073
- for (; (s = t.indexOf("..", s + 1)) !== -1; ) {
2074
- const r = t[s - 1];
2075
- r && r !== "." && r !== ".." && r !== "**" && (e = !0, t.splice(s - 1, 2), s -= 2);
2076
- }
2077
- } while (e);
2078
- return t.length === 0 ? [""] : t;
2079
- }
2080
- // First phase: single-pattern processing
2081
- // <pre> is 1 or more portions
2082
- // <rest> is 1 or more portions
2083
- // <p> is any portion other than ., .., '', or **
2084
- // <e> is . or ''
2085
- //
2086
- // **/.. is *brutal* for filesystem walking performance, because
2087
- // it effectively resets the recursive walk each time it occurs,
2088
- // and ** cannot be reduced out by a .. pattern part like a regexp
2089
- // or most strings (other than .., ., and '') can be.
2090
- //
2091
- // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
2092
- // <pre>/<e>/<rest> -> <pre>/<rest>
2093
- // <pre>/<p>/../<rest> -> <pre>/<rest>
2094
- // **/**/<rest> -> **/<rest>
2095
- //
2096
- // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
2097
- // this WOULD be allowed if ** did follow symlinks, or * didn't
2098
- firstPhasePreProcess(t) {
2099
- let e = !1;
2100
- do {
2101
- e = !1;
2102
- for (let s of t) {
2103
- let r = -1;
2104
- for (; (r = s.indexOf("**", r + 1)) !== -1; ) {
2105
- let i = r;
2106
- for (; s[i + 1] === "**"; )
2107
- i++;
2108
- i > r && s.splice(r + 1, i - r);
2109
- let a = s[r + 1];
2110
- const o = s[r + 2], l = s[r + 3];
2111
- if (a !== ".." || !o || o === "." || o === ".." || !l || l === "." || l === "..")
2112
- continue;
2113
- e = !0, s.splice(r, 1);
2114
- const h = s.slice(0);
2115
- h[r] = "**", t.push(h), r--;
2116
- }
2117
- if (!this.preserveMultipleSlashes) {
2118
- for (let i = 1; i < s.length - 1; i++) {
2119
- const a = s[i];
2120
- i === 1 && a === "" && s[0] === "" || (a === "." || a === "") && (e = !0, s.splice(i, 1), i--);
2121
- }
2122
- s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
2123
- }
2124
- let n = 0;
2125
- for (; (n = s.indexOf("..", n + 1)) !== -1; ) {
2126
- const i = s[n - 1];
2127
- if (i && i !== "." && i !== ".." && i !== "**") {
2128
- e = !0;
2129
- const o = n === 1 && s[n + 1] === "**" ? ["."] : [];
2130
- s.splice(n - 1, 2, ...o), s.length === 0 && s.push(""), n -= 2;
2131
- }
2132
- }
2133
- }
2134
- } while (e);
2135
- return t;
2136
- }
2137
- // second phase: multi-pattern dedupes
2138
- // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
2139
- // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
2140
- // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
2141
- //
2142
- // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
2143
- // ^-- not valid because ** doens't follow symlinks
2144
- secondPhasePreProcess(t) {
2145
- for (let e = 0; e < t.length - 1; e++)
2146
- for (let s = e + 1; s < t.length; s++) {
2147
- const r = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
2148
- r && (t[e] = r, t[s] = []);
2149
- }
2150
- return t.filter((e) => e.length);
2151
- }
2152
- partsMatch(t, e, s = !1) {
2153
- let r = 0, n = 0, i = [], a = "";
2154
- for (; r < t.length && n < e.length; )
2155
- if (t[r] === e[n])
2156
- i.push(a === "b" ? e[n] : t[r]), r++, n++;
2157
- else if (s && t[r] === "**" && e[n] === t[r + 1])
2158
- i.push(t[r]), r++;
2159
- else if (s && e[n] === "**" && t[r] === e[n + 1])
2160
- i.push(e[n]), n++;
2161
- else if (t[r] === "*" && e[n] && (this.options.dot || !e[n].startsWith(".")) && e[n] !== "**") {
2162
- if (a === "b")
2163
- return !1;
2164
- a = "a", i.push(t[r]), r++, n++;
2165
- } else if (e[n] === "*" && t[r] && (this.options.dot || !t[r].startsWith(".")) && t[r] !== "**") {
2166
- if (a === "a")
2167
- return !1;
2168
- a = "b", i.push(e[n]), r++, n++;
2169
- } else
2170
- return !1;
2171
- return t.length === e.length && i;
2172
- }
2173
- parseNegate() {
2174
- if (this.nonegate)
2175
- return;
2176
- const t = this.pattern;
2177
- let e = !1, s = 0;
2178
- for (let r = 0; r < t.length && t.charAt(r) === "!"; r++)
2179
- e = !e, s++;
2180
- s && (this.pattern = t.slice(s)), this.negate = e;
2181
- }
2182
- // set partial to true to test if, for example,
2183
- // "/a/b" matches the start of "/*/b/*/d"
2184
- // Partial means, if you run out of file before you run
2185
- // out of pattern, then that's fine, as long as all
2186
- // the parts match.
2187
- matchOne(t, e, s = !1) {
2188
- const r = this.options;
2189
- if (this.isWindows) {
2190
- const f = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), p = !f && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), y = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), E = !y && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), $ = p ? 3 : f ? 0 : void 0, w = E ? 3 : y ? 0 : void 0;
2191
- if (typeof $ == "number" && typeof w == "number") {
2192
- const [b, m] = [t[$], e[w]];
2193
- b.toLowerCase() === m.toLowerCase() && (e[w] = b, w > $ ? e = e.slice(w) : $ > w && (t = t.slice($)));
2194
- }
2195
- }
2196
- const { optimizationLevel: n = 1 } = this.options;
2197
- n >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
2198
- for (var i = 0, a = 0, o = t.length, l = e.length; i < o && a < l; i++, a++) {
2199
- this.debug("matchOne loop");
2200
- var h = e[a], c = t[i];
2201
- if (this.debug(e, h, c), h === !1)
2202
- return !1;
2203
- if (h === K) {
2204
- this.debug("GLOBSTAR", [e, h, c]);
2205
- var u = i, d = a + 1;
2206
- if (d === l) {
2207
- for (this.debug("** at the end"); i < o; i++)
2208
- if (t[i] === "." || t[i] === ".." || !r.dot && t[i].charAt(0) === ".")
2209
- return !1;
2210
- return !0;
2211
- }
2212
- for (; u < o; ) {
2213
- var g = t[u];
2214
- if (this.debug(`
2215
- globstar while`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), s))
2216
- return this.debug("globstar found match!", u, o, g), !0;
2217
- if (g === "." || g === ".." || !r.dot && g.charAt(0) === ".") {
2218
- this.debug("dot detected!", t, u, e, d);
2219
- break;
2220
- }
2221
- this.debug("globstar swallow a segment, and continue"), u++;
2222
- }
2223
- return !!(s && (this.debug(`
2224
- >>> no match, partial?`, t, u, e, d), u === o));
2225
- }
2226
- let f;
2227
- if (typeof h == "string" ? (f = c === h, this.debug("string match", h, c, f)) : (f = h.test(c), this.debug("pattern match", h, c, f)), !f)
2228
- return !1;
2229
- }
2230
- if (i === o && a === l)
2231
- return !0;
2232
- if (i === o)
2233
- return s;
2234
- if (a === l)
2235
- return i === o - 1 && t[i] === "";
2236
- throw new Error("wtf?");
2237
- }
2238
- braceExpand() {
2239
- return xs(this.pattern, this.options);
2240
- }
2241
- parse(t) {
2242
- tt(t);
2243
- const e = this.options;
2244
- if (t === "**")
2245
- return K;
2246
- if (t === "")
2247
- return "";
2248
- let s, r = null;
2249
- (s = t.match(Dn)) ? r = e.dot ? Wn : In : (s = t.match(Tn)) ? r = (e.nocase ? e.dot ? Ln : Nn : e.dot ? Rn : An)(s[1]) : (s = t.match(zn)) ? r = (e.nocase ? e.dot ? Hn : Gn : e.dot ? Fn : Bn)(s) : (s = t.match(Mn)) ? r = e.dot ? Cn : kn : (s = t.match(jn)) && (r = Pn);
2250
- const n = Es.fromGlob(t, this.options).toMMPattern();
2251
- return r && typeof n == "object" && Reflect.defineProperty(n, "test", { value: r }), n;
2252
- }
2253
- makeRe() {
2254
- if (this.regexp || this.regexp === !1)
2255
- return this.regexp;
2256
- const t = this.set;
2257
- if (!t.length)
2258
- return this.regexp = !1, this.regexp;
2259
- const e = this.options, s = e.noglobstar ? qn : e.dot ? Jn : Xn, r = new Set(e.nocase ? ["i"] : []);
2260
- let n = t.map((o) => {
2261
- const l = o.map((h) => {
2262
- if (h instanceof RegExp)
2263
- for (const c of h.flags.split(""))
2264
- r.add(c);
2265
- return typeof h == "string" ? ei(h) : h === K ? K : h._src;
2266
- });
2267
- return l.forEach((h, c) => {
2268
- const u = l[c + 1], d = l[c - 1];
2269
- h !== K || d === K || (d === void 0 ? u !== void 0 && u !== K ? l[c + 1] = "(?:\\/|" + s + "\\/)?" + u : l[c] = s : u === void 0 ? l[c - 1] = d + "(?:\\/|" + s + ")?" : u !== K && (l[c - 1] = d + "(?:\\/|\\/" + s + "\\/)" + u, l[c + 1] = K));
2270
- }), l.filter((h) => h !== K).join("/");
2271
- }).join("|");
2272
- const [i, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
2273
- n = "^" + i + n + a + "$", this.negate && (n = "^(?!" + n + ").+$");
2274
- try {
2275
- this.regexp = new RegExp(n, [...r].join(""));
2276
- } catch {
2277
- this.regexp = !1;
2278
- }
2279
- return this.regexp;
2280
- }
2281
- slashSplit(t) {
2282
- return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
2283
- }
2284
- match(t, e = this.partial) {
2285
- if (this.debug("match", t, this.pattern), this.comment)
2286
- return !1;
2287
- if (this.empty)
2288
- return t === "";
2289
- if (t === "/" && e)
2290
- return !0;
2291
- const s = this.options;
2292
- this.isWindows && (t = t.split("\\").join("/"));
2293
- const r = this.slashSplit(t);
2294
- this.debug(this.pattern, "split", r);
2295
- const n = this.set;
2296
- this.debug(this.pattern, "set", n);
2297
- let i = r[r.length - 1];
2298
- if (!i)
2299
- for (let a = r.length - 2; !i && a >= 0; a--)
2300
- i = r[a];
2301
- for (let a = 0; a < n.length; a++) {
2302
- const o = n[a];
2303
- let l = r;
2304
- if (s.matchBase && o.length === 1 && (l = [i]), this.matchOne(l, o, e))
2305
- return s.flipNegate ? !0 : !this.negate;
2306
- }
2307
- return s.flipNegate ? !1 : this.negate;
308
+ let s = 0;
309
+ for (s = 0; s < t.length; s++) {
310
+ const n = t[s];
311
+ n.nodeType === 1 && W(n, "childNodes").length && de(n);
2308
312
  }
2309
- static defaults(t) {
2310
- return F.defaults(t).Minimatch;
313
+ }, Qe = (e) => {
314
+ const t = [];
315
+ for (let s = 0; s < e.length; s++) {
316
+ const n = e[s]["s-nr"] || void 0;
317
+ n && n.isConnected && t.push(n);
2311
318
  }
319
+ return t;
2312
320
  };
2313
- F.AST = Es;
2314
- F.Minimatch = ht;
2315
- F.escape = On;
2316
- F.unescape = ze;
2317
- var ti = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), si = {};
2318
- an(si, {
2319
- err: () => Os,
2320
- map: () => ri,
2321
- ok: () => mt,
2322
- unwrap: () => ni,
2323
- unwrapErr: () => ii
2324
- });
2325
- var mt = (t) => ({
2326
- isOk: !0,
2327
- isErr: !1,
2328
- value: t
2329
- }), Os = (t) => ({
2330
- isOk: !1,
2331
- isErr: !0,
2332
- value: t
2333
- });
2334
- function ri(t, e) {
2335
- if (t.isOk) {
2336
- const s = e(t.value);
2337
- return s instanceof Promise ? s.then((r) => mt(r)) : mt(s);
2338
- }
2339
- if (t.isErr) {
2340
- const s = t.value;
2341
- return Os(s);
321
+ function Q(e, t, s) {
322
+ let n = 0, r = [], o;
323
+ for (; n < e.length; n++) {
324
+ if (o = e[n], o["s-sr"] && (!t || o["s-hn"] === t) && (s === void 0 || I(o) === s) && (r.push(o), typeof s < "u"))
325
+ return r;
326
+ r = [...r, ...Q(o.childNodes, t, s)];
2342
327
  }
2343
- throw "should never get here";
328
+ return r;
2344
329
  }
2345
- var ni = (t) => {
2346
- if (t.isOk)
2347
- return t.value;
2348
- throw t.value;
2349
- }, ii = (t) => {
2350
- if (t.isErr)
2351
- return t.value;
2352
- throw t.value;
2353
- }, Ts = (t) => {
2354
- const e = Ht(t, "childNodes");
2355
- t.tagName && t.tagName.includes("-") && t["s-cr"] && t.tagName !== "SLOT-FB" && As(e, t.tagName).forEach((r) => {
2356
- r.nodeType === 1 && r.tagName === "SLOT-FB" && (oi(r, At(r), !1).length ? r.hidden = !0 : r.hidden = !1);
2357
- });
2358
- let s = 0;
2359
- for (s = 0; s < e.length; s++) {
2360
- const r = e[s];
2361
- r.nodeType === 1 && Ht(r, "childNodes").length && Ts(r);
2362
- }
2363
- }, ai = (t) => {
2364
- const e = [];
2365
- for (let s = 0; s < t.length; s++) {
2366
- const r = t[s]["s-nr"] || void 0;
2367
- r && r.isConnected && e.push(r);
2368
- }
2369
- return e;
2370
- };
2371
- function As(t, e, s) {
2372
- let r = 0, n = [], i;
2373
- for (; r < t.length; r++)
2374
- i = t[r], i["s-sr"] && (!e || i["s-hn"] === e) && s === void 0 && n.push(i), n = [...n, ...As(i.childNodes, e, s)];
330
+ var Ve = (e, t, s = !0) => {
331
+ const n = [];
332
+ (s && e["s-sr"] || !e["s-sr"]) && n.push(e);
333
+ let r = e;
334
+ for (; r = r.nextSibling; )
335
+ I(r) === t && (s || !r["s-sr"]) && n.push(r);
2375
336
  return n;
2376
- }
2377
- var oi = (t, e, s = !0) => {
2378
- const r = [];
2379
- (s && t["s-sr"] || !t["s-sr"]) && r.push(t);
2380
- let n = t;
2381
- for (; n = n.nextSibling; )
2382
- At(n) === e && (s || !n["s-sr"]) && r.push(n);
2383
- return r;
2384
- }, Gt = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", At = (t) => typeof t["s-sn"] == "string" ? t["s-sn"] : t.nodeType === 1 && t.getAttribute("slot") || void 0;
2385
- function li(t) {
2386
- if (t.assignedElements || t.assignedNodes || !t["s-sr"]) return;
2387
- const e = (s) => (function(r) {
2388
- const n = [], i = this["s-sn"];
2389
- r?.flatten && console.error(`
337
+ }, ne = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", I = (e) => typeof e["s-sn"] == "string" ? e["s-sn"] : e.nodeType === 1 && e.getAttribute("slot") || void 0;
338
+ function et(e) {
339
+ if (e.assignedElements || e.assignedNodes || !e["s-sr"]) return;
340
+ const t = (s) => (function(n) {
341
+ const r = [], o = this["s-sn"];
342
+ n?.flatten && console.error(`
2390
343
  Flattening is not supported for Stencil non-shadow slots.
2391
344
  You can use \`.childNodes\` to nested slot fallback content.
2392
345
  If you have a particular use case, please open an issue on the Stencil repo.
2393
346
  `);
2394
- const a = this["s-cr"].parentElement;
2395
- return (a.__childNodes ? a.childNodes : ai(a.childNodes)).forEach((l) => {
2396
- i === At(l) && n.push(l);
2397
- }), s ? n.filter(
2398
- (l) => l.nodeType === 1
347
+ const i = this["s-cr"].parentElement;
348
+ return (i.__childNodes ? i.childNodes : Qe(i.childNodes)).forEach((f) => {
349
+ o === I(f) && r.push(f);
350
+ }), s ? r.filter(
351
+ (f) => f.nodeType === 1
2399
352
  /* ElementNode */
2400
- ) : n;
2401
- }).bind(t);
2402
- t.assignedElements = e(!0), t.assignedNodes = e(!1);
353
+ ) : r;
354
+ }).bind(e);
355
+ e.assignedElements = t(!0), e.assignedNodes = t(!1);
2403
356
  }
2404
- function Ht(t, e) {
2405
- if ("__" + e in t) {
2406
- const s = t["__" + e];
2407
- return typeof s != "function" ? s : s.bind(t);
357
+ function tt(e) {
358
+ e.dispatchEvent(new CustomEvent("slotchange", { bubbles: !1, cancelable: !1, composed: !1 }));
359
+ }
360
+ function st(e, t) {
361
+ var s;
362
+ if (t = t || ((s = e["s-ol"]) == null ? void 0 : s.parentElement), !t) return { slotNode: null, slotName: "" };
363
+ const n = e["s-sn"] = I(e) || "", r = W(t, "childNodes");
364
+ return { slotNode: Q(r, t.tagName, n)[0], slotName: n };
365
+ }
366
+ function W(e, t) {
367
+ if ("__" + t in e) {
368
+ const s = e["__" + t];
369
+ return typeof s != "function" ? s : s.bind(e);
2408
370
  } else
2409
- return typeof t[e] != "function" ? t[e] : t[e].bind(t);
371
+ return typeof e[t] != "function" ? e[t] : e[t].bind(e);
2410
372
  }
2411
- var ci = (t, e, ...s) => {
2412
- let r = null, n = null, i = null, a = !1, o = !1;
2413
- const l = [], h = (u) => {
2414
- for (let d = 0; d < u.length; d++)
2415
- r = u[d], Array.isArray(r) ? h(r) : r != null && typeof r != "boolean" && ((a = !$s(r)) && (r = String(r)), a && o ? l[l.length - 1].$text$ += r : l.push(a ? yt(null, r) : r), o = a);
373
+ var nt = (e) => e != null && e !== void 0, _e = (e) => (e = typeof e, e === "object" || e === "function"), rt = (e, t, ...s) => {
374
+ let n = null, r = null, o = null, i = !1, u = !1;
375
+ const f = [], c = (l) => {
376
+ for (let p = 0; p < l.length; p++)
377
+ n = l[p], Array.isArray(n) ? c(n) : n != null && typeof n != "boolean" && ((i = !_e(n)) && (n = String(n)), i && u ? f[f.length - 1].$text$ += n : f.push(i ? q(null, n) : n), u = i);
2416
378
  };
2417
- h(s);
2418
- const c = yt(t, null);
2419
- return c.$attrs$ = e, l.length > 0 && (c.$children$ = l), c.$key$ = n, c.$name$ = i, c;
2420
- }, yt = (t, e) => {
379
+ c(s);
380
+ const a = q(e, null);
381
+ return a.$attrs$ = t, f.length > 0 && (a.$children$ = f), a.$key$ = r, a.$name$ = o, a;
382
+ }, q = (e, t) => {
2421
383
  const s = {
2422
384
  $flags$: 0,
2423
- $tag$: t,
2424
- $text$: e,
385
+ $tag$: e,
386
+ // Normalize undefined to null to prevent rendering "undefined" as text
387
+ $text$: t ?? null,
2425
388
  $elm$: null,
2426
389
  $children$: null
2427
390
  };
2428
391
  return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
2429
- }, hi = {}, ui = (t) => t && t.$tag$ === hi, Rt = (t) => {
2430
- const e = ti(t);
2431
- return new RegExp(
2432
- // First capture group: match any context before the selector that's not inside @supports selector()
2433
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
2434
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,
2435
- "g"
2436
- );
2437
- };
2438
- Rt("::slotted");
2439
- Rt(":host");
2440
- Rt(":host-context");
2441
- var Ft = (t, e, s, r, n, i, a) => {
2442
- if (s === r)
392
+ }, ot = {}, it = (e) => e && e.$tag$ === ot, re = (e, t, s, n, r, o, i) => {
393
+ if (s === n)
394
+ return;
395
+ let u = te(e, t), f = t.toLowerCase();
396
+ if (t === "class") {
397
+ const c = e.classList, a = oe(s);
398
+ let l = oe(n);
399
+ c.remove(...a.filter((p) => p && !l.includes(p))), c.add(...l.filter((p) => p && !a.includes(p)));
400
+ } else if (t === "style") {
401
+ for (const c in s)
402
+ (!n || n[c] == null) && (c.includes("-") ? e.style.removeProperty(c) : e.style[c] = "");
403
+ for (const c in n)
404
+ (!s || n[c] !== s[c]) && (c.includes("-") ? e.style.setProperty(c, n[c]) : e.style[c] = n[c]);
405
+ } else if (t !== "key") if (t === "ref")
406
+ n && ft(n, e);
407
+ else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
408
+ if (t[2] === "-" ? t = t.slice(3) : te(A, f) ? t = f.slice(2) : t = f[2] + t.slice(3), s || n) {
409
+ const c = t.endsWith(he);
410
+ t = t.replace(lt, ""), s && T.rel(e, t, s, c), n && T.ael(e, t, n, c);
411
+ }
412
+ } else if (t[0] === "a" && t.startsWith("attr:")) {
413
+ const c = t.slice(5);
414
+ let a;
415
+ {
416
+ const l = Xe(e);
417
+ if (l && l.$cmpMeta$ && l.$cmpMeta$.$members$) {
418
+ const p = l.$cmpMeta$.$members$[c];
419
+ p && p[1] && (a = p[1]);
420
+ }
421
+ }
422
+ a || (a = c.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()), n == null || n === !1 ? (n !== !1 || e.getAttribute(a) === "") && e.removeAttribute(a) : e.setAttribute(a, n === !0 ? "" : n);
2443
423
  return;
2444
- let o = jt(t, e), l = e.toLowerCase();
2445
- if (e === "class") {
2446
- const h = t.classList, c = Bt(s);
2447
- let u = Bt(r);
2448
- h.remove(...c.filter((d) => d && !u.includes(d))), h.add(...u.filter((d) => d && !c.includes(d)));
2449
- } else if (e === "style") {
2450
- for (const h in s)
2451
- (!r || r[h] == null) && (h.includes("-") ? t.style.removeProperty(h) : t.style[h] = "");
2452
- for (const h in r)
2453
- (!s || r[h] !== s[h]) && (h.includes("-") ? t.style.setProperty(h, r[h]) : t.style[h] = r[h]);
2454
- } else if (e !== "key") if (e === "ref")
2455
- r && r(t);
2456
- else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n") {
2457
- if (e[2] === "-" ? e = e.slice(3) : jt($e, l) ? e = l.slice(2) : e = l[2] + e.slice(3), s || r) {
2458
- const h = e.endsWith(Rs);
2459
- e = e.replace(pi, ""), s && Oe.rel(t, e, s, h), r && Oe.ael(t, e, r, h);
424
+ } else if (t[0] === "p" && t.startsWith("prop:")) {
425
+ const c = t.slice(5);
426
+ try {
427
+ e[c] = n;
428
+ } catch {
2460
429
  }
430
+ return;
2461
431
  } else {
2462
- const h = $s(r);
2463
- if ((o || h && r !== null) && !n)
432
+ const c = _e(n);
433
+ if ((u || c && n !== null) && !r)
2464
434
  try {
2465
- if (t.tagName.includes("-"))
2466
- t[e] !== r && (t[e] = r);
435
+ if (e.tagName.includes("-"))
436
+ e[t] !== n && (e[t] = n);
2467
437
  else {
2468
- const u = r ?? "";
2469
- e === "list" ? o = !1 : (s == null || t[e] != u) && (typeof t.__lookupSetter__(e) == "function" ? t[e] = u : t.setAttribute(e, u));
438
+ const l = n ?? "";
439
+ t === "list" ? u = !1 : (s == null || e[t] !== l) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = l : e.setAttribute(t, l));
2470
440
  }
2471
441
  } catch {
2472
442
  }
2473
- let c = !1;
2474
- l !== (l = l.replace(/^xlink\:?/, "")) && (e = l, c = !0), r == null || r === !1 ? (r !== !1 || t.getAttribute(e) === "") && (c ? t.removeAttributeNS(Pt, e) : t.removeAttribute(e)) : (!o || i & 4 || n) && !h && t.nodeType === 1 && (r = r === !0 ? "" : r, c ? t.setAttributeNS(Pt, e, r) : t.setAttribute(e, r));
2475
- }
2476
- }, fi = /\s/, Bt = (t) => (typeof t == "object" && t && "baseVal" in t && (t = t.baseVal), !t || typeof t != "string" ? [] : t.split(fi)), Rs = "Capture", pi = new RegExp(Rs + "$"), Et = (t, e, s, r) => {
2477
- const n = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, i = t && t.$attrs$ || {}, a = e.$attrs$ || {};
2478
- for (const o of Ut(Object.keys(i)))
2479
- o in a || Ft(
2480
- n,
2481
- o,
2482
- i[o],
443
+ let a = !1;
444
+ f !== (f = f.replace(/^xlink\:?/, "")) && (t = f, a = !0), n == null || n === !1 ? (n !== !1 || e.getAttribute(t) === "") && (a ? e.removeAttributeNS(se, t) : e.removeAttribute(t)) : (!u || o & 4 || r) && !c && e.nodeType === 1 && (n = n === !0 ? "" : n, a ? e.setAttributeNS(se, t, n) : e.setAttribute(t, n));
445
+ }
446
+ }, at = /\s/, oe = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(at)), he = "Capture", lt = new RegExp(he + "$"), J = (e, t, s, n) => {
447
+ const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || {}, i = t.$attrs$ || {};
448
+ for (const u of ie(Object.keys(o)))
449
+ u in i || re(
450
+ r,
451
+ u,
452
+ o[u],
2483
453
  void 0,
2484
454
  s,
2485
- e.$flags$
455
+ t.$flags$
2486
456
  );
2487
- for (const o of Ut(Object.keys(a)))
2488
- Ft(
2489
- n,
2490
- o,
2491
- i[o],
2492
- a[o],
457
+ for (const u of ie(Object.keys(i)))
458
+ re(
459
+ r,
460
+ u,
461
+ o[u],
462
+ i[u],
2493
463
  s,
2494
- e.$flags$
464
+ t.$flags$
2495
465
  );
2496
466
  };
2497
- function Ut(t) {
2498
- return t.includes("ref") ? (
467
+ function ie(e) {
468
+ return e.includes("ref") ? (
2499
469
  // we need to sort these to ensure that `'ref'` is the last attr
2500
- [...t.filter((e) => e !== "ref"), "ref"]
470
+ [...e.filter((t) => t !== "ref"), "ref"]
2501
471
  ) : (
2502
472
  // no need to sort, return the original array
2503
- t
473
+ e
2504
474
  );
2505
475
  }
2506
- var Qe, rt, Fe, wt = !1, nt = !1, Nt = !1, B = !1, it = (t, e, s) => {
2507
- var r;
2508
- const n = e.$children$[s];
2509
- let i = 0, a, o, l;
2510
- if (wt || (Nt = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
476
+ var P, z, R, C = !1, H = !1, B = !1, E = !1, Y = [], K = [], M = (e, t, s) => {
477
+ var n;
478
+ const r = t.$children$[s];
479
+ let o = 0, i, u, f;
480
+ if (C || (B = !0, r.$tag$ === "slot" && (r.$flags$ |= r.$children$ ? (
2511
481
  // slot element has fallback content
2512
482
  // still create an element that "mocks" the slot element
2513
483
  2
@@ -2516,192 +486,239 @@ var Qe, rt, Fe, wt = !1, nt = !1, Nt = !1, B = !1, it = (t, e, s) => {
2516
486
  // create an html comment we'll use to always reference
2517
487
  // where actual slot content should sit next to
2518
488
  1
2519
- ))), n.$text$ !== null)
2520
- a = n.$elm$ = $e.document.createTextNode(n.$text$);
2521
- else if (n.$flags$ & 1)
2522
- a = n.$elm$ = $e.document.createTextNode(""), Et(null, n, B);
489
+ ))), r.$text$ != null)
490
+ i = r.$elm$ = A.document.createTextNode(r.$text$);
491
+ else if (r.$flags$ & 1)
492
+ i = r.$elm$ = A.document.createTextNode(""), J(null, r, E);
2523
493
  else {
2524
- if (B || (B = n.$tag$ === "svg"), !$e.document)
2525
- throw new Error(
2526
- "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."
2527
- );
2528
- if (a = n.$elm$ = $e.document.createElementNS(
2529
- B ? fn : pn,
2530
- !wt && He.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
2531
- ), B && n.$tag$ === "foreignObject" && (B = !1), Et(null, n, B), gn(Qe) && a["s-si"] !== Qe && a.classList.add(a["s-si"] = Qe), n.$children$) {
2532
- const h = n.$tag$ === "template" ? a.content : a;
2533
- for (i = 0; i < n.$children$.length; ++i)
2534
- o = it(t, n, i), o && h.appendChild(o);
2535
- }
2536
- n.$tag$ === "svg" ? B = !1 : a.tagName === "foreignObject" && (B = !0);
2537
- }
2538
- return a["s-hn"] = Fe, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = rt, a["s-sn"] = n.$name$ || "", a["s-rf"] = (r = n.$attrs$) == null ? void 0 : r.ref, li(a), l = t && t.$children$ && t.$children$[s], l && l.$tag$ === n.$tag$ && t.$elm$ && Be(t.$elm$, !1), Cs(rt, a, e.$elm$, t?.$elm$)), a;
2539
- }, Be = (t, e) => {
2540
- Oe.$flags$ |= 1;
2541
- const s = Array.from(t.__childNodes || t.childNodes);
2542
- t["s-sr"] && He.experimentalSlotFixes;
2543
- for (let r = s.length - 1; r >= 0; r--) {
2544
- const n = s[r];
2545
- n["s-hn"] !== Fe && n["s-ol"] && (_e(Ue(n).parentNode, n, Ue(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, Nt = !0), e && Be(n, e);
2546
- }
2547
- Oe.$flags$ &= -2;
2548
- }, Ns = (t, e, s, r, n, i) => {
2549
- let a = t["s-cr"] && t["s-cr"].parentNode || t, o;
2550
- for (a.shadowRoot && a.tagName === Fe && (a = a.shadowRoot), s.$tag$ === "template" && (a = a.content); n <= i; ++n)
2551
- r[n] && (o = it(null, s, n), o && (r[n].$elm$ = o, _e(a, o, Ue(e))));
2552
- }, Ls = (t, e, s) => {
2553
- for (let r = e; r <= s; ++r) {
2554
- const n = t[r];
2555
- if (n) {
2556
- const i = n.$elm$;
2557
- ks(n), i && (nt = !0, i["s-ol"] ? i["s-ol"].remove() : Be(i, !0), i.remove());
2558
- }
2559
- }
2560
- }, gi = (t, e, s, r, n = !1) => {
2561
- let i = 0, a = 0, o = 0, l = 0, h = e.length - 1, c = e[0], u = e[h], d = r.length - 1, g = r[0], f = r[d], p, y;
2562
- const E = s.$tag$ === "template" ? t.content : t;
2563
- for (; i <= h && a <= d; )
2564
- if (c == null)
2565
- c = e[++i];
2566
- else if (u == null)
2567
- u = e[--h];
494
+ if (E || (E = r.$tag$ === "svg"), !A.document)
495
+ throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
496
+ if (i = r.$elm$ = A.document.createElementNS(
497
+ E ? Ye : Ke,
498
+ !C && X.slotRelocation && r.$flags$ & 2 ? "slot-fb" : r.$tag$
499
+ ), E && r.$tag$ === "foreignObject" && (E = !1), J(null, r, E), nt(P) && i["s-si"] !== P && i.classList.add(i["s-si"] = P), r.$children$) {
500
+ const c = r.$tag$ === "template" ? i.content : i;
501
+ for (o = 0; o < r.$children$.length; ++o)
502
+ u = M(e, r, o), u && c.appendChild(u);
503
+ }
504
+ r.$tag$ === "svg" ? E = !1 : i.tagName === "foreignObject" && (E = !0);
505
+ }
506
+ return i["s-hn"] = R, r.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = z, i["s-sn"] = r.$name$ || "", i["s-rf"] = (n = r.$attrs$) == null ? void 0 : n.ref, et(i), f = e && e.$children$ && e.$children$[s], f && f.$tag$ === r.$tag$ && e.$elm$ && ye(e.$elm$), Oe(z, i, t.$elm$, e?.$elm$)), i;
507
+ }, ye = (e) => {
508
+ T.$flags$ |= 1;
509
+ const t = e.closest(R.toLowerCase());
510
+ if (t != null) {
511
+ const s = Array.from(t.__childNodes || t.childNodes).find(
512
+ (r) => r["s-cr"]
513
+ ), n = Array.from(
514
+ e.__childNodes || e.childNodes
515
+ );
516
+ for (const r of s ? n.reverse() : n)
517
+ r["s-sh"] != null && (v(t, r, s ?? null), r["s-sh"] = void 0, B = !0);
518
+ }
519
+ T.$flags$ &= -2;
520
+ }, F = (e, t) => {
521
+ T.$flags$ |= 1;
522
+ const s = Array.from(e.__childNodes || e.childNodes);
523
+ if (e["s-sr"]) {
524
+ let n = e;
525
+ for (; n = n.nextSibling; )
526
+ n && n["s-sn"] === e["s-sn"] && n["s-sh"] === R && s.push(n);
527
+ }
528
+ for (let n = s.length - 1; n >= 0; n--) {
529
+ const r = s[n];
530
+ r["s-hn"] !== R && r["s-ol"] && (v(w(r).parentNode, r, w(r)), r["s-ol"].remove(), r["s-ol"] = void 0, r["s-sh"] = void 0, B = !0), t && F(r, t);
531
+ }
532
+ T.$flags$ &= -2;
533
+ }, Ee = (e, t, s, n, r, o) => {
534
+ let i = e["s-cr"] && e["s-cr"].parentNode || e, u;
535
+ for (i.shadowRoot && i.tagName === R && (i = i.shadowRoot), s.$tag$ === "template" && (i = i.content); r <= o; ++r)
536
+ n[r] && (u = M(null, s, r), u && (n[r].$elm$ = u, v(i, u, w(t))));
537
+ }, be = (e, t, s) => {
538
+ for (let n = t; n <= s; ++n) {
539
+ const r = e[n];
540
+ if (r) {
541
+ const o = r.$elm$;
542
+ ve(r), o && (H = !0, o["s-ol"] ? o["s-ol"].remove() : F(o, !0), o.remove());
543
+ }
544
+ }
545
+ }, ct = (e, t, s, n, r = !1) => {
546
+ let o = 0, i = 0, u = 0, f = 0, c = t.length - 1, a = t[0], l = t[c], p = n.length - 1, $ = n[0], g = n[p], _, m;
547
+ const y = s.$tag$ === "template" ? e.content : e;
548
+ for (; o <= c && i <= p; )
549
+ if (a == null)
550
+ a = t[++o];
551
+ else if (l == null)
552
+ l = t[--c];
553
+ else if ($ == null)
554
+ $ = n[++i];
2568
555
  else if (g == null)
2569
- g = r[++a];
2570
- else if (f == null)
2571
- f = r[--d];
2572
- else if (Xe(c, g, n))
2573
- we(c, g, n), c = e[++i], g = r[++a];
2574
- else if (Xe(u, f, n))
2575
- we(u, f, n), u = e[--h], f = r[--d];
2576
- else if (Xe(c, f, n))
2577
- (c.$tag$ === "slot" || f.$tag$ === "slot") && Be(c.$elm$.parentNode, !1), we(c, f, n), _e(E, c.$elm$, u.$elm$.nextSibling), c = e[++i], f = r[--d];
2578
- else if (Xe(u, g, n))
2579
- (c.$tag$ === "slot" || f.$tag$ === "slot") && Be(u.$elm$.parentNode, !1), we(u, g, n), _e(E, u.$elm$, c.$elm$), u = e[--h], g = r[++a];
556
+ g = n[--p];
557
+ else if (j(a, $, r))
558
+ x(a, $, r), a = t[++o], $ = n[++i];
559
+ else if (j(l, g, r))
560
+ x(l, g, r), l = t[--c], g = n[--p];
561
+ else if (j(a, g, r))
562
+ (a.$tag$ === "slot" || g.$tag$ === "slot") && F(a.$elm$.parentNode, !1), x(a, g, r), v(y, a.$elm$, l.$elm$.nextSibling), a = t[++o], g = n[--p];
563
+ else if (j(l, $, r))
564
+ (a.$tag$ === "slot" || g.$tag$ === "slot") && F(l.$elm$.parentNode, !1), x(l, $, r), v(y, l.$elm$, a.$elm$), l = t[--c], $ = n[++i];
2580
565
  else {
2581
- for (o = -1, l = i; l <= h; ++l)
2582
- if (e[l] && e[l].$key$ !== null && e[l].$key$ === g.$key$) {
2583
- o = l;
566
+ for (u = -1, f = o; f <= c; ++f)
567
+ if (t[f] && t[f].$key$ !== null && t[f].$key$ === $.$key$) {
568
+ u = f;
2584
569
  break;
2585
570
  }
2586
- o >= 0 ? (y = e[o], y.$tag$ !== g.$tag$ ? p = it(e && e[a], s, o) : (we(y, g, n), e[o] = void 0, p = y.$elm$), g = r[++a]) : (p = it(e && e[a], s, a), g = r[++a]), p && _e(
2587
- Ue(c.$elm$).parentNode,
2588
- p,
2589
- Ue(c.$elm$)
571
+ u >= 0 ? (m = t[u], m.$tag$ !== $.$tag$ ? _ = M(t && t[i], s, u) : (x(m, $, r), t[u] = void 0, _ = m.$elm$), $ = n[++i]) : (_ = M(t && t[i], s, i), $ = n[++i]), _ && v(
572
+ w(a.$elm$).parentNode,
573
+ _,
574
+ w(a.$elm$)
2590
575
  );
2591
576
  }
2592
- i > h ? Ns(
2593
- t,
2594
- r[d + 1] == null ? null : r[d + 1].$elm$,
577
+ o > c ? Ee(
578
+ e,
579
+ n[p + 1] == null ? null : n[p + 1].$elm$,
2595
580
  s,
2596
- r,
2597
- a,
2598
- d
2599
- ) : a > d && Ls(e, i, h);
2600
- }, Xe = (t, e, s = !1) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : s ? (s && !t.$key$ && e.$key$ && (t.$key$ = e.$key$), !0) : t.$key$ === e.$key$ : !1, Ue = (t) => t && t["s-ol"] || t, we = (t, e, s = !1) => {
2601
- const r = e.$elm$ = t.$elm$, n = t.$children$, i = e.$children$, a = e.$tag$, o = e.$text$;
2602
- let l;
2603
- o === null ? (B = a === "svg" ? !0 : a === "foreignObject" ? !1 : B, Et(t, e, B), n !== null && i !== null ? gi(r, n, e, i, s) : i !== null ? (t.$text$ !== null && (r.textContent = ""), Ns(r, null, e, i, 0, i.length - 1)) : (
581
+ n,
582
+ i,
583
+ p
584
+ ) : i > p && be(t, o, c);
585
+ }, j = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? (s && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, w = (e) => e && e["s-ol"] || e, x = (e, t, s = !1) => {
586
+ const n = t.$elm$ = e.$elm$, r = e.$children$, o = t.$children$, i = t.$tag$, u = t.$text$;
587
+ let f;
588
+ u == null ? (E = i === "svg" ? !0 : i === "foreignObject" ? !1 : E, i === "slot" && !C && e.$name$ !== t.$name$ && (t.$elm$["s-sn"] = t.$name$ || "", ye(t.$elm$.parentElement)), J(e, t, E), r !== null && o !== null ? ct(n, r, t, o, s) : o !== null ? (e.$text$ !== null && (n.textContent = ""), Ee(n, null, t, o, 0, o.length - 1)) : (
2604
589
  // don't do this on initial render as it can cause non-hydrated content to be removed
2605
- !s && He.updatable && n !== null && Ls(n, 0, n.length - 1)
2606
- ), B && a === "svg" && (B = !1)) : (l = r["s-cr"]) ? l.parentNode.textContent = o : t.$text$ !== o && (r.data = o);
2607
- }, se = [], Ms = (t) => {
2608
- let e, s, r;
2609
- const n = t.__childNodes || t.childNodes;
2610
- for (const i of n) {
2611
- if (i["s-sr"] && (e = i["s-cr"]) && e.parentNode) {
2612
- s = e.parentNode.__childNodes || e.parentNode.childNodes;
2613
- const a = i["s-sn"];
2614
- for (r = s.length - 1; r >= 0; r--)
2615
- if (e = s[r], !e["s-cn"] && !e["s-nr"] && e["s-hn"] !== i["s-hn"])
2616
- if (Gt(e, a)) {
2617
- let o = se.find((l) => l.$nodeToRelocate$ === e);
2618
- nt = !0, e["s-sn"] = e["s-sn"] || a, o ? (o.$nodeToRelocate$["s-sh"] = i["s-hn"], o.$slotRefNode$ = i) : (e["s-sh"] = i["s-hn"], se.push({
2619
- $slotRefNode$: i,
2620
- $nodeToRelocate$: e
2621
- })), e["s-sr"] && se.map((l) => {
2622
- Gt(l.$nodeToRelocate$, e["s-sn"]) && (o = se.find((h) => h.$nodeToRelocate$ === e), o && !l.$slotRefNode$ && (l.$slotRefNode$ = o.$slotRefNode$));
590
+ !s && X.updatable && r !== null && be(r, 0, r.length - 1)
591
+ ), E && i === "svg" && (E = !1)) : (f = n["s-cr"]) ? f.parentNode.textContent = u : e.$text$ !== u && (n.data = u);
592
+ }, O = [], me = (e) => {
593
+ let t, s, n;
594
+ const r = e.__childNodes || e.childNodes;
595
+ for (const o of r) {
596
+ if (o["s-sr"] && (t = o["s-cr"]) && t.parentNode) {
597
+ s = t.parentNode.__childNodes || t.parentNode.childNodes;
598
+ const i = o["s-sn"];
599
+ for (n = s.length - 1; n >= 0; n--)
600
+ if (t = s[n], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && (!t["s-sh"] || t["s-sh"] !== o["s-hn"]))
601
+ if (ne(t, i)) {
602
+ let u = O.find((f) => f.$nodeToRelocate$ === t);
603
+ H = !0, t["s-sn"] = t["s-sn"] || i, u ? (u.$nodeToRelocate$["s-sh"] = o["s-hn"], u.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], O.push({
604
+ $slotRefNode$: o,
605
+ $nodeToRelocate$: t
606
+ })), t["s-sr"] && O.map((f) => {
607
+ ne(f.$nodeToRelocate$, t["s-sn"]) && (u = O.find((c) => c.$nodeToRelocate$ === t), u && !f.$slotRefNode$ && (f.$slotRefNode$ = u.$slotRefNode$));
2623
608
  });
2624
- } else se.some((o) => o.$nodeToRelocate$ === e) || se.push({
2625
- $nodeToRelocate$: e
609
+ } else O.some((u) => u.$nodeToRelocate$ === t) || O.push({
610
+ $nodeToRelocate$: t
2626
611
  });
2627
612
  }
2628
- i.nodeType === 1 && Ms(i);
2629
- }
2630
- }, ks = (t) => {
2631
- t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(ks);
2632
- }, _e = (t, e, s) => (typeof e["s-sn"] == "string" && e["s-sr"] && e["s-cr"] && Cs(e["s-cr"], e, t, e.parentElement), t?.insertBefore(e, s));
2633
- function Cs(t, e, s, r) {
2634
- var n, i;
2635
- let a;
2636
- if (t && typeof e["s-sn"] == "string" && e["s-sr"] && t.parentNode && t.parentNode["s-sc"] && (a = e["s-si"] || t.parentNode["s-sc"])) {
2637
- const o = e["s-sn"], l = e["s-hn"];
2638
- if ((n = s.classList) == null || n.add(a + "-s"), r && ((i = r.classList) != null && i.contains(a + "-s"))) {
2639
- let h = (r.__childNodes || r.childNodes)[0], c = !1;
2640
- for (; h; ) {
2641
- if (h["s-sn"] !== o && h["s-hn"] === l && h["s-sr"]) {
2642
- c = !0;
613
+ o.nodeType === 1 && me(o);
614
+ }
615
+ }, ve = (e) => {
616
+ e.$attrs$ && e.$attrs$.ref && Y.push(() => e.$attrs$.ref(null)), e.$children$ && e.$children$.map(ve);
617
+ }, ft = (e, t) => {
618
+ K.push(() => e(t));
619
+ }, ut = () => {
620
+ Y.forEach((e) => e()), Y.length = 0, K.forEach((e) => e()), K.length = 0;
621
+ }, v = (e, t, s, n) => {
622
+ if (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"])
623
+ Oe(t["s-cr"], t, e, t.parentElement);
624
+ else if (typeof t["s-sn"] == "string") {
625
+ e.insertBefore(t, s);
626
+ const { slotNode: r } = st(t);
627
+ return r && !n && tt(r), t;
628
+ }
629
+ return e.__insertBefore ? e.__insertBefore(t, s) : e?.insertBefore(t, s);
630
+ };
631
+ function Oe(e, t, s, n) {
632
+ var r, o;
633
+ let i;
634
+ if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (i = t["s-si"] || e.parentNode["s-sc"])) {
635
+ const u = t["s-sn"], f = t["s-hn"];
636
+ if ((r = s.classList) == null || r.add(i + "-s"), n && ((o = n.classList) != null && o.contains(i + "-s"))) {
637
+ let c = (n.__childNodes || n.childNodes)[0], a = !1;
638
+ for (; c; ) {
639
+ if (c["s-sn"] !== u && c["s-hn"] === f && c["s-sr"]) {
640
+ a = !0;
2643
641
  break;
2644
642
  }
2645
- h = h.nextSibling;
643
+ c = c.nextSibling;
2646
644
  }
2647
- c || r.classList.remove(a + "-s");
645
+ a || n.classList.remove(i + "-s");
2648
646
  }
2649
647
  }
2650
648
  }
2651
- var di = (t, e, s = !1) => {
2652
- var r, n, i, a, o;
2653
- const l = t.$hostElement$, h = t.$cmpMeta$, c = t.$vnode$ || yt(null, null), d = ui(e) ? e : ci(null, null, e);
2654
- if (Fe = l.tagName, h.$attrsToReflect$ && (d.$attrs$ = d.$attrs$ || {}, h.$attrsToReflect$.forEach(([g, f]) => {
2655
- He.serializer && t.$serializerValues$.has(g) ? d.$attrs$[f] = t.$serializerValues$.get(g) : d.$attrs$[f] = l[g];
2656
- })), s && d.$attrs$)
2657
- for (const g of Object.keys(d.$attrs$))
2658
- l.hasAttribute(g) && !["key", "ref", "style", "class"].includes(g) && (d.$attrs$[g] = l[g]);
2659
- d.$tag$ = null, d.$flags$ |= 4, t.$vnode$ = d, d.$elm$ = c.$elm$ = l.shadowRoot || l, Qe = l["s-sc"], wt = !!(h.$flags$ & 1) && !(h.$flags$ & 128), rt = l["s-cr"], nt = !1, we(c, d, s);
649
+ var gt = (e, t, s = !1) => {
650
+ var n, r, o, i, u;
651
+ const f = e.$hostElement$, c = e.$cmpMeta$, a = e.$vnode$ || q(null, null), p = it(t) ? t : rt(null, null, t);
652
+ if (R = f.tagName, c.$attrsToReflect$ && (p.$attrs$ = p.$attrs$ || {}, c.$attrsToReflect$.forEach(([$, g]) => {
653
+ X.serializer && e.$serializerValues$.has($) ? p.$attrs$[g] = e.$serializerValues$.get($) : p.$attrs$[g] = f[$];
654
+ })), s && p.$attrs$)
655
+ for (const $ of Object.keys(p.$attrs$))
656
+ f.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (p.$attrs$[$] = f[$]);
657
+ p.$tag$ = null, p.$flags$ |= 4, e.$vnode$ = p, p.$elm$ = a.$elm$ = f.shadowRoot || f, P = f["s-sc"], C = !!(c.$flags$ & 1) && !(c.$flags$ & 128), z = f["s-cr"], H = !1, x(a, p, s);
2660
658
  {
2661
- if (Oe.$flags$ |= 1, Nt) {
2662
- Ms(d.$elm$);
2663
- for (const g of se) {
2664
- const f = g.$nodeToRelocate$;
2665
- if (!f["s-ol"] && $e.document) {
2666
- const p = $e.document.createTextNode("");
2667
- p["s-nr"] = f, _e(f.parentNode, f["s-ol"] = p, f);
659
+ if (T.$flags$ |= 1, B) {
660
+ me(p.$elm$);
661
+ for (const $ of O) {
662
+ const g = $.$nodeToRelocate$;
663
+ if (!g["s-ol"] && A.document) {
664
+ const _ = A.document.createTextNode("");
665
+ _["s-nr"] = g, v(
666
+ g.parentNode,
667
+ g["s-ol"] = _,
668
+ g,
669
+ s
670
+ );
2668
671
  }
2669
672
  }
2670
- for (const g of se) {
2671
- const f = g.$nodeToRelocate$, p = g.$slotRefNode$;
2672
- if (f.nodeType === 1 && s && (f["s-ih"] = (r = f.hidden) != null ? r : !1), p) {
2673
- const y = p.parentNode;
2674
- let E = p.nextSibling;
2675
- {
2676
- let b = (n = f["s-ol"]) == null ? void 0 : n.previousSibling;
2677
- for (; b; ) {
2678
- let m = (i = b["s-nr"]) != null ? i : null;
2679
- if (m && m["s-sn"] === f["s-sn"] && y === (m.__parentNode || m.parentNode)) {
2680
- for (m = m.nextSibling; m === f || m?.["s-sr"]; )
2681
- m = m?.nextSibling;
2682
- if (!m || !m["s-nr"]) {
2683
- E = m;
673
+ for (const $ of O) {
674
+ const g = $.$nodeToRelocate$, _ = $.$slotRefNode$;
675
+ if (g.nodeType === 1 && s && (g["s-ih"] = (n = g.hidden) != null ? n : !1), _) {
676
+ const m = _.parentNode;
677
+ let y = _.nextSibling;
678
+ if (y && y.nodeType === 1) {
679
+ let h = (r = g["s-ol"]) == null ? void 0 : r.previousSibling;
680
+ for (; h; ) {
681
+ let d = (o = h["s-nr"]) != null ? o : null;
682
+ if (d && d["s-sn"] === g["s-sn"] && m === (d.__parentNode || d.parentNode)) {
683
+ for (d = d.nextSibling; d === g || d?.["s-sr"]; )
684
+ d = d?.nextSibling;
685
+ if (!d || !d["s-nr"]) {
686
+ y = d;
2684
687
  break;
2685
688
  }
2686
689
  }
2687
- b = b.previousSibling;
690
+ h = h.previousSibling;
691
+ }
692
+ }
693
+ const V = g.__parentNode || g.parentNode, D = g.__nextSibling || g.nextSibling;
694
+ if ((!y && m !== V || D !== y) && g !== y) {
695
+ if (v(m, g, y, s), g.nodeType === 8 && g.nodeValue.startsWith("s-nt-")) {
696
+ const h = A.document.createTextNode(g.nodeValue.replace(/^s-nt-/, ""));
697
+ h["s-hn"] = g["s-hn"], h["s-sn"] = g["s-sn"], h["s-sh"] = g["s-sh"], h["s-sr"] = g["s-sr"], h["s-ol"] = g["s-ol"], h["s-ol"]["s-nr"] = h, v(g.parentNode, h, g, s), g.parentNode.removeChild(g);
2688
698
  }
699
+ g.nodeType === 1 && g.tagName !== "SLOT-FB" && (g.hidden = (i = g["s-ih"]) != null ? i : !1);
2689
700
  }
2690
- const $ = f.__parentNode || f.parentNode, w = f.__nextSibling || f.nextSibling;
2691
- (!E && y !== $ || w !== E) && f !== E && (!f["s-hn"] && f["s-ol"] && (f["s-hn"] = f["s-ol"].parentNode.nodeName), _e(y, f, E), f.nodeType === 1 && f.tagName !== "SLOT-FB" && (f.hidden = (a = f["s-ih"]) != null ? a : !1)), f && typeof p["s-rf"] == "function" && p["s-rf"](p);
2692
- } else f.nodeType === 1 && (f.hidden = !0);
701
+ g && typeof _["s-rf"] == "function" && _["s-rf"](_);
702
+ } else g.nodeType === 1 && (g.hidden = !0);
2693
703
  }
2694
704
  }
2695
- nt && Ts(d.$elm$), Oe.$flags$ &= -2, se.length = 0;
2696
- }
2697
- if (He.experimentalScopedSlotChanges && h.$flags$ & 2) {
2698
- const g = d.$elm$.__childNodes || d.$elm$.childNodes;
2699
- for (const f of g)
2700
- f["s-hn"] !== Fe && !f["s-sh"] && f.nodeType === 1 && (s && f["s-ih"] == null && (f["s-ih"] = (o = f.hidden) != null ? o : !1), f.hidden = !0);
705
+ H && de(p.$elm$), T.$flags$ &= -2, O.length = 0;
706
+ }
707
+ if (!C && !(c.$flags$ & 1) && f["s-cr"]) {
708
+ const $ = p.$elm$.__childNodes || p.$elm$.childNodes;
709
+ for (const g of $)
710
+ if (g["s-hn"] !== R && !g["s-sh"]) {
711
+ if (s && g["s-ih"] == null && (g["s-ih"] = (u = g.hidden) != null ? u : !1), g.nodeType === 1)
712
+ g.hidden = !0;
713
+ else if (g.nodeType === 3 && g.nodeValue.trim()) {
714
+ const _ = A.document.createComment("s-nt-" + g.nodeValue);
715
+ _["s-sn"] = g["s-sn"], v(g.parentNode, _, g, s), g.parentNode.removeChild(g);
716
+ }
717
+ }
2701
718
  }
2702
- rt = void 0;
719
+ z = void 0, ut();
2703
720
  };
2704
- const Ie = {
721
+ const L = {
2705
722
  content_wrap: 0,
2706
723
  ignore: [],
2707
724
  ignore_with: "!i-£___£%_",
@@ -2709,7 +726,7 @@ const Ie = {
2709
726
  tab_size: 2,
2710
727
  tag_wrap: 0,
2711
728
  trim: []
2712
- }, js = [
729
+ }, Ae = [
2713
730
  "area",
2714
731
  "base",
2715
732
  "br",
@@ -2724,30 +741,30 @@ const Ie = {
2724
741
  "source",
2725
742
  "track",
2726
743
  "wbr"
2727
- ], Ps = {
744
+ ], Te = {
2728
745
  checked_html: !1,
2729
- config: { ...Ie },
746
+ config: { ...L },
2730
747
  ignored: !1,
2731
748
  constants: {
2732
- CONTENT_IGNORE_PLACEHOLDER: `${Ie.ignore_with}_`,
2733
- SELF_CLOSING_PLACEHOLDER: `${Ie.ignore_with}/_>`,
2734
- ATTRIBUTE_IGNORE_PLACEHOLDER: `${Ie.ignore_with}=_`
749
+ CONTENT_IGNORE_PLACEHOLDER: `${L.ignore_with}_`,
750
+ SELF_CLOSING_PLACEHOLDER: `${L.ignore_with}/_>`,
751
+ ATTRIBUTE_IGNORE_PLACEHOLDER: `${L.ignore_with}=_`
2735
752
  }
2736
- }, U = () => Ps, Ze = (t) => Object.assign(Ps, t), Ds = (t) => (Ze({ checked_html: !0 }), /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(t) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(t) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(t)), Is = (t, e) => {
2737
- if (!t || !e)
753
+ }, b = () => Te, k = (e) => Object.assign(Te, e), Re = (e) => (k({ checked_html: !0 }), /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)), xe = (e, t) => {
754
+ if (!e || !t)
2738
755
  throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
2739
756
  let s;
2740
- if (Array.isArray(t))
2741
- s = structuredClone(t).concat(e);
2742
- else if (typeof t == "object") {
2743
- s = { ...t };
2744
- for (let r of Object.keys(e))
2745
- typeof e[r] != "object" ? s[r] = e[r] : s[r] = Is(s[r] || {}, e[r]);
757
+ if (Array.isArray(e))
758
+ s = structuredClone(e).concat(t);
759
+ else if (typeof e == "object") {
760
+ s = { ...e };
761
+ for (let n of Object.keys(t))
762
+ typeof t[n] != "object" ? s[n] = t[n] : s[n] = xe(s[n] || {}, t[n]);
2746
763
  }
2747
764
  return s;
2748
- }, $i = (t, e) => {
2749
- const s = Is(t, e);
2750
- return Ze({
765
+ }, pt = (e, t) => {
766
+ const s = xe(e, t);
767
+ return k({
2751
768
  config: s,
2752
769
  constants: {
2753
770
  CONTENT_IGNORE_PLACEHOLDER: `${s.ignore_with}_`,
@@ -2755,419 +772,419 @@ const Ie = {
2755
772
  ATTRIBUTE_IGNORE_PLACEHOLDER: `${s.ignore_with}=_`
2756
773
  }
2757
774
  }), s;
2758
- }, vi = (t) => {
2759
- const { constants: e } = U();
2760
- return t = t.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, r) => s.replace(r, (n) => n.replace(/\n/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, e.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!"))), t;
2761
- }, _i = (t) => {
2762
- const { constants: e } = U();
2763
- return t.replace(/\n/g, e.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, e.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, e.CONTENT_IGNORE_PLACEHOLDER + "ws!");
2764
- }, mi = (t) => {
2765
- const e = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g, { constants: s } = U();
2766
- return t.replace(e, (r, n, i, a, o) => {
2767
- const l = i || o;
2768
- if (!l)
2769
- return r;
2770
- const h = l.replace(/\n/g, s.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, s.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, s.CONTENT_IGNORE_PLACEHOLDER + "ws!");
2771
- return r.replace(l, h);
775
+ }, $t = (e) => {
776
+ const { constants: t } = b();
777
+ return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, n) => s.replace(n, (r) => r.replace(/\n/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, t.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!"))), e;
778
+ }, dt = (e) => {
779
+ const { constants: t } = b();
780
+ return e.replace(/\n/g, t.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, t.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, t.CONTENT_IGNORE_PLACEHOLDER + "ws!");
781
+ }, _t = (e) => {
782
+ const t = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g, { constants: s } = b();
783
+ return e.replace(t, (n, r, o, i, u) => {
784
+ const f = o || u;
785
+ if (!f)
786
+ return n;
787
+ const c = f.replace(/\n/g, s.CONTENT_IGNORE_PLACEHOLDER + "nl!").replace(/\r/g, s.CONTENT_IGNORE_PLACEHOLDER + "cr!").replace(/\s/g, s.CONTENT_IGNORE_PLACEHOLDER + "ws!");
788
+ return n.replace(f, c);
2772
789
  });
2773
- }, yi = (t) => {
2774
- const e = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g, { constants: s } = U();
2775
- return t = t.replace(e, (r, n, i) => r.replace(i, (a) => a.replace(/</g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "lt!").replace(/>/g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "gt!"))), t;
2776
- }, Ei = (t, e) => {
2777
- for (let s = 0; s < e.length; s++) {
2778
- const r = new RegExp(`(<${e[s]}[^>]*>)\\s+`, "g"), n = new RegExp(`\\s+(</${e[s]}>)`, "g");
2779
- t = t.replace(r, "$1").replace(n, "$1");
790
+ }, ht = (e) => {
791
+ const t = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g, { constants: s } = b();
792
+ return e = e.replace(t, (n, r, o) => n.replace(o, (i) => i.replace(/</g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "lt!").replace(/>/g, s.ATTRIBUTE_IGNORE_PLACEHOLDER + "gt!"))), e;
793
+ }, yt = (e, t) => {
794
+ for (let s = 0; s < t.length; s++) {
795
+ const n = new RegExp(`(<${t[s]}[^>]*>)\\s+`, "g"), r = new RegExp(`\\s+(</${t[s]}>)`, "g");
796
+ e = e.replace(n, "$1").replace(r, "$1");
2780
797
  }
2781
- return t;
2782
- }, wi = (t) => {
2783
- const { constants: e } = U();
2784
- return t = t.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, r) => s.replace(r, (n) => n.replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!", "g"), `
2785
- `).replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(e.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), t;
2786
- }, bi = (t) => {
2787
- const { constants: e } = U();
2788
- return t = t.replace(new RegExp(`.*${e.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!.*`, "g"), (s) => s.replace(new RegExp(`${e.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!`, "g"), (r) => r.replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "nl!", "g"), `
2789
- `).replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(e.CONTENT_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), t;
2790
- }, Si = (t) => {
2791
- const e = /<([\w:\-]+)([^>]*)>/g, { constants: s } = U(), r = s.ATTRIBUTE_IGNORE_PLACEHOLDER.replace(
798
+ return e;
799
+ }, Et = (e) => {
800
+ const { constants: t } = b();
801
+ return e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (s, n) => s.replace(n, (r) => r.replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "nl!", "g"), `
802
+ `).replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(t.ATTRIBUTE_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
803
+ }, bt = (e) => {
804
+ const { constants: t } = b();
805
+ return e = e.replace(new RegExp(`.*${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!.*`, "g"), (s) => s.replace(new RegExp(`${t.CONTENT_IGNORE_PLACEHOLDER}[a-z]{2}!`, "g"), (n) => n.replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "nl!", "g"), `
806
+ `).replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "cr!", "g"), "\r").replace(new RegExp(t.CONTENT_IGNORE_PLACEHOLDER + "ws!", "g"), " "))), e;
807
+ }, mt = (e) => {
808
+ const t = /<([\w:\-]+)([^>]*)>/g, { constants: s } = b(), n = s.ATTRIBUTE_IGNORE_PLACEHOLDER.replace(
2792
809
  /[-\/\\^$*+?.()|[\]{}]/g,
2793
810
  "\\$&"
2794
- ), n = new RegExp(r + "lt!", "g"), i = new RegExp(r + "gt!", "g");
2795
- return t.replace(
2796
- e,
2797
- (a, o, l) => {
2798
- const h = l.replace(n, "<").replace(i, ">");
2799
- return `<${o}${h}>`;
811
+ ), r = new RegExp(n + "lt!", "g"), o = new RegExp(n + "gt!", "g");
812
+ return e.replace(
813
+ t,
814
+ (i, u, f) => {
815
+ const c = f.replace(r, "<").replace(o, ">");
816
+ return `<${u}${c}>`;
2800
817
  }
2801
818
  );
2802
- }, xi = (t) => {
2803
- if (typeof t != "object") throw new Error("Config must be an object.");
2804
- const e = { ...Ie };
2805
- if (!(Object.hasOwn(t, "content_wrap") || Object.hasOwn(t, "ignore") || Object.hasOwn(t, "ignore_with") || Object.hasOwn(t, "strict") || Object.hasOwn(t, "tab_size") || Object.hasOwn(t, "tag_wrap") || Object.hasOwn(t, "trim")))
2806
- return Ze({ config: e }), e;
2807
- let r = t.tab_size;
2808
- if (r) {
2809
- if (typeof r != "number") throw new Error(`tab_size must be a number, not ${typeof t.tab_size}.`);
2810
- if (!Number.isSafeInteger(r)) throw new Error(`Tab size ${r} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);
2811
- if (r = Math.floor(r), r < 1 || r > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
2812
- t.tab_size = r;
2813
- }
2814
- if (Object.hasOwn(t, "content_wrap") && typeof t.content_wrap != "number")
2815
- throw new Error(`content_wrap config must be a number, not ${typeof t.content_wrap}.`);
2816
- if (Object.hasOwn(t, "ignore") && (!Array.isArray(t.ignore) || !t.ignore?.every((n) => typeof n == "string")))
819
+ }, vt = (e) => {
820
+ if (typeof e != "object") throw new Error("Config must be an object.");
821
+ const t = { ...L };
822
+ if (!(Object.hasOwn(e, "content_wrap") || Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "trim")))
823
+ return k({ config: t }), t;
824
+ let n = e.tab_size;
825
+ if (n) {
826
+ if (typeof n != "number") throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
827
+ if (!Number.isSafeInteger(n)) throw new Error(`Tab size ${n} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);
828
+ if (n = Math.floor(n), n < 1 || n > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
829
+ e.tab_size = n;
830
+ }
831
+ if (Object.hasOwn(e, "content_wrap") && typeof e.content_wrap != "number")
832
+ throw new Error(`content_wrap config must be a number, not ${typeof e.content_wrap}.`);
833
+ if (Object.hasOwn(e, "ignore") && (!Array.isArray(e.ignore) || !e.ignore?.every((r) => typeof r == "string")))
2817
834
  throw new Error("Ignore config must be an array of strings.");
2818
- if (Object.hasOwn(t, "ignore_with")) {
2819
- if (typeof t.ignore_with != "string")
2820
- throw new Error(`ignore_with must be a string, not ${typeof t.ignore_with}.`);
2821
- if (t.ignore_with.startsWith("_"))
835
+ if (Object.hasOwn(e, "ignore_with")) {
836
+ if (typeof e.ignore_with != "string")
837
+ throw new Error(`ignore_with must be a string, not ${typeof e.ignore_with}.`);
838
+ if (e.ignore_with.startsWith("_"))
2822
839
  throw new Error("ignore_with cannot start with an underscore.");
2823
840
  }
2824
- if (Object.hasOwn(t, "strict") && typeof t.strict != "boolean")
2825
- throw new Error(`Strict config must be a boolean, not ${typeof t.strict}.`);
2826
- if (Object.hasOwn(t, "tag_wrap") && typeof t.tag_wrap != "number")
2827
- throw new Error(`tag_wrap config must be a number, not ${typeof t.tag_wrap}.`);
2828
- if (Object.hasOwn(t, "trim") && (!Array.isArray(t.trim) || !t.trim?.every((n) => typeof n == "string")))
841
+ if (Object.hasOwn(e, "strict") && typeof e.strict != "boolean")
842
+ throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);
843
+ if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap != "number")
844
+ throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);
845
+ if (Object.hasOwn(e, "trim") && (!Array.isArray(e.trim) || !e.trim?.every((r) => typeof r == "string")))
2829
846
  throw new Error("Trim config must be an array of strings.");
2830
- return $i(e, t);
2831
- }, Oi = (t, e, s) => {
2832
- const r = t.trim().split(/\s+/);
2833
- if (r.length === 0 || r.length === 1 && r[0] === "")
847
+ return pt(t, e);
848
+ }, Ot = (e, t, s) => {
849
+ const n = e.trim().split(/\s+/);
850
+ if (n.length === 0 || n.length === 1 && n[0] === "")
2834
851
  return "";
2835
- const n = [];
2836
- let i = "";
2837
- const a = s;
2838
- r.forEach((l) => {
2839
- if (l === "") return;
2840
- if (l.length >= e) {
2841
- i !== "" && n.push(n.length === 0 ? s + i : a + i), n.push(n.length === 0 ? s + l : a + l), i = "";
852
+ const r = [];
853
+ let o = "";
854
+ const i = s;
855
+ n.forEach((f) => {
856
+ if (f === "") return;
857
+ if (f.length >= t) {
858
+ o !== "" && r.push(r.length === 0 ? s + o : i + o), r.push(r.length === 0 ? s + f : i + f), o = "";
2842
859
  return;
2843
860
  }
2844
- const h = i === "" ? l : i + " " + l;
2845
- h.length <= e ? i = h : (i !== "" && n.push(n.length === 0 ? s + i : a + i), i = l);
2846
- }), i !== "" && n.push(n.length === 0 ? s + i : a + i);
2847
- const o = n.join(`
861
+ const c = o === "" ? f : o + " " + f;
862
+ c.length <= t ? o = c : (o !== "" && r.push(r.length === 0 ? s + o : i + o), o = f);
863
+ }), o !== "" && r.push(r.length === 0 ? s + o : i + o);
864
+ const u = r.join(`
2848
865
  `);
2849
- return _i(o);
866
+ return dt(u);
2850
867
  };
2851
- function Ws(t) {
2852
- Ze({ ignored: !0 });
2853
- const e = U().config;
2854
- let s = t;
2855
- const r = /* @__PURE__ */ new Map();
2856
- let n = 0;
2857
- const i = "___HTMLFY_SPECIAL_IGNORE_MARKER_";
2858
- for (const a of e.ignore) {
2859
- const o = a.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), l = new RegExp(
2860
- `(<\\s*${o}[^>]*>)(.*?)(<\\s*/\\s*${o}\\s*>)`,
868
+ function Se(e) {
869
+ k({ ignored: !0 });
870
+ const t = b().config;
871
+ let s = e;
872
+ const n = /* @__PURE__ */ new Map();
873
+ let r = 0;
874
+ const o = "___HTMLFY_SPECIAL_IGNORE_MARKER_";
875
+ for (const i of t.ignore) {
876
+ const u = i.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), f = new RegExp(
877
+ `(<\\s*${u}[^>]*>)(.*?)(<\\s*/\\s*${u}\\s*>)`,
2861
878
  "gs"
2862
879
  // global and dotAll
2863
880
  );
2864
- let h;
2865
- const c = [];
2866
- for (; (h = l.exec(s)) !== null; ) {
2867
- const u = `${i}${n++}___`;
2868
- r.set(u, h[2]), c.push({
2869
- start: h.index + h[1].length,
881
+ let c;
882
+ const a = [];
883
+ for (; (c = f.exec(s)) !== null; ) {
884
+ const l = `${o}${r++}___`;
885
+ n.set(l, c[2]), a.push({
886
+ start: c.index + c[1].length,
2870
887
  // start of content
2871
- end: h.index + h[1].length + h[2].length,
888
+ end: c.index + c[1].length + c[2].length,
2872
889
  // end of content
2873
- marker: u
890
+ marker: l
2874
891
  });
2875
892
  }
2876
- for (let u = c.length - 1; u >= 0; u--) {
2877
- const d = c[u];
2878
- s = s.substring(0, d.start) + d.marker + s.substring(d.end);
893
+ for (let l = a.length - 1; l >= 0; l--) {
894
+ const p = a[l];
895
+ s = s.substring(0, p.start) + p.marker + s.substring(p.end);
2879
896
  }
2880
897
  }
2881
- return { html_with_markers: s, extracted_map: r };
898
+ return { html_with_markers: s, extracted_map: n };
2882
899
  }
2883
- function zs(t, e) {
2884
- Ze({ ignored: !1 });
2885
- let s = t;
2886
- for (const [r, n] of e)
2887
- s = s.split(r).join(n);
900
+ function Le(e, t) {
901
+ k({ ignored: !1 });
902
+ let s = e;
903
+ for (const [n, r] of t)
904
+ s = s.split(n).join(r);
2888
905
  return s;
2889
906
  }
2890
- const Ti = new RegExp(`<(${js.join("|")})(?:\\s(?:[^/>]|/(?!>))*)*>`, "g");
2891
- function Ai(t) {
2892
- const { constants: e } = U();
2893
- return t.replace(
907
+ const At = new RegExp(`<(${Ae.join("|")})(?:\\s(?:[^/>]|/(?!>))*)*>`, "g");
908
+ function Tt(e) {
909
+ const { constants: t } = b();
910
+ return e.replace(
2894
911
  // match only void elements that are not self-closing
2895
- Ti,
2896
- (s) => s.replace(/>$/, e.SELF_CLOSING_PLACEHOLDER)
912
+ At,
913
+ (s) => s.replace(/>$/, t.SELF_CLOSING_PLACEHOLDER)
2897
914
  );
2898
915
  }
2899
- function Ri(t) {
2900
- const { constants: e } = U();
2901
- return t.replace(e.SELF_CLOSING_PLACEHOLDER, ">");
916
+ function Rt(e) {
917
+ const { constants: t } = b();
918
+ return e.replace(t.SELF_CLOSING_PLACEHOLDER, ">");
2902
919
  }
2903
- const Ni = (t, e = !1) => (t = t.replace(/<\s*textarea[^>]*>((.|\n)*?)<s*\/\s*textarea\s*>/g, (s, r) => s.replace(r, (n) => n.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\n/g, "&#10;").replace(/\r/g, "&#13;").replace(/\s/g, "&nbsp;"))), e && (t = t.replace(/<\s*textarea[^>]*>(.|\n)*?<\s*\/\s*textarea\s*>/g, (s) => s.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/<\s/g, "<").replace(/<\/\s/g, "</").replace(/class=["']\s/g, (r) => r.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"))), t), Li = (t) => t = t.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (e, s) => e.replace(s, (r) => (r = r.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#10;/g, `
2904
- `).replace(/&#13;/g, "\r").replace(/&nbsp;/g, " ").replace(/\s+/g, " "), r)));
2905
- let Zt;
2906
- const Mi = (t, e) => {
920
+ const xt = (e, t = !1) => (e = e.replace(/<\s*textarea[^>]*>((.|\n)*?)<s*\/\s*textarea\s*>/g, (s, n) => s.replace(n, (r) => r.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\n/g, "&#10;").replace(/\r/g, "&#13;").replace(/\s/g, "&nbsp;"))), t && (e = e.replace(/<\s*textarea[^>]*>(.|\n)*?<\s*\/\s*textarea\s*>/g, (s) => s.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/<\s/g, "<").replace(/<\/\s/g, "</").replace(/class=["']\s/g, (n) => n.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"))), e), St = (e) => e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (t, s) => t.replace(s, (n) => (n = n.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#10;/g, `
921
+ `).replace(/&#13;/g, "\r").replace(/&nbsp;/g, " ").replace(/\s+/g, " "), n)));
922
+ let ae;
923
+ const Lt = (e, t) => {
2907
924
  let s = !1;
2908
- const { checked_html: r, ignored: n, constants: i } = U();
2909
- if (!r && !Ds(t)) return t;
2910
- const o = U().config.ignore.length > 0;
2911
- if (!n && o) {
2912
- const { html_with_markers: l, extracted_map: h } = Ws(t);
2913
- t = l, Zt = h, s = !0;
2914
- }
2915
- return t = Ni(t, !0), t = t.replace(/\n|\t/g, ""), t = t.replace(/>\s+</g, "><"), t = t.replace(/ {2,}/g, " "), t = t.replace(
925
+ const { checked_html: n, ignored: r, constants: o } = b();
926
+ if (!n && !Re(e)) return e;
927
+ const u = b().config.ignore.length > 0;
928
+ if (!r && u) {
929
+ const { html_with_markers: f, extracted_map: c } = Se(e);
930
+ e = f, ae = c, s = !0;
931
+ }
932
+ return e = xt(e, !0), e = e.replace(/\n|\t/g, ""), e = e.replace(/>\s+</g, "><"), e = e.replace(/ {2,}/g, " "), e = e.replace(
2916
933
  /(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g,
2917
934
  "$1___MINIFY-PROTECTED-SPACE___$2"
2918
- ), t = t.replace(
935
+ ), e = e.replace(
2919
936
  /(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g,
2920
937
  "$1___MINIFY-PROTECTED-SPACE___$2"
2921
- ), t = t.replace(/ >/g, ">"), t = t.replace(/ </g, "<"), t = t.replace(/> /g, ">"), t = t.replace(/< /g, "<"), t = t.replace(/<\s+\//g, "</"), t = t.replace(/<\/\s+/g, "</"), t = t.replace(new RegExp("___MINIFY-PROTECTED-SPACE___", "g"), " "), t = t.replace(/ = /g, "="), t = t.replace(
938
+ ), e = e.replace(/ >/g, ">"), e = e.replace(/ </g, "<"), e = e.replace(/> /g, ">"), e = e.replace(/< /g, "<"), e = e.replace(/<\s+\//g, "</"), e = e.replace(/<\/\s+/g, "</"), e = e.replace(new RegExp("___MINIFY-PROTECTED-SPACE___", "g"), " "), e = e.replace(/ = /g, "="), e = e.replace(
2922
939
  /([a-zA-Z0-9_-]+)=(['"])(.*?)\2/g,
2923
- (l, h, c, u) => {
2924
- const d = u.trim();
2925
- return `${h}=${c}${d}${c}`;
940
+ (f, c, a, l) => {
941
+ const p = l.trim();
942
+ return `${c}=${a}${p}${a}`;
2926
943
  }
2927
- ), t = t.trim(), t = Li(t), s && (t = zs(t, Zt)), t;
2928
- }, Ge = {
944
+ ), e = e.trim(), e = St(e), s && (e = Le(e, ae)), e;
945
+ }, N = {
2929
946
  line: []
2930
947
  };
2931
- let qt;
2932
- const ki = (t) => {
2933
- Ge.line = [];
2934
- let e = -1;
948
+ let le;
949
+ const Nt = (e) => {
950
+ N.line = [];
951
+ let t = -1;
2935
952
  const s = /(<[^>]+>)|([^<]+)/g;
2936
- t.replace(s, (r, n, i) => (n ? Ge.line.push({ type: "tag", value: r }) : i && i.trim().length > 0 && Ge.line.push({ type: "text", value: r }), e++, `
2937
- [#-# : ${e} : ${r} : #-#]
953
+ e.replace(s, (n, r, o) => (r ? N.line.push({ type: "tag", value: n }) : o && o.trim().length > 0 && N.line.push({ type: "text", value: n }), t++, `
954
+ [#-# : ${t} : ${n} : #-#]
2938
955
  `));
2939
- }, Ci = () => {
2940
- const { config: t, constants: e } = U(), s = " ".repeat(t.tab_size), r = t.tag_wrap, n = t.content_wrap, i = t.strict;
2941
- let a = "";
2942
- const o = [], l = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, h = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
2943
- Ge.line.forEach((u, d) => {
2944
- let g = u.value;
2945
- const f = g.startsWith("___HTMLFY_SPECIAL_IGNORE_MARKER_");
2946
- let p = 0;
2947
- const y = Ge.line[d - 1], E = y?.value ?? "";
2948
- a += "0", d === 0 && p++, g.trim().startsWith("</") && p++, E.trim().startsWith("<!doctype") && p++, E.trim().startsWith("<!--") && p++, (E.trim().endsWith("/>") || E.trim().endsWith(e.SELF_CLOSING_PLACEHOLDER)) && p++, E.trim().startsWith("</") && p++, y?.type === "text" && p++;
2949
- const w = Math.max(0, a.length - p);
2950
- if (a = a.substring(0, w), u.type === "text" && /^[!,;\.]/.test(g)) {
2951
- if (g.length === 1) {
2952
- o[o.length - 1] = o.at(-1) + g;
956
+ }, Ct = () => {
957
+ const { config: e, constants: t } = b(), s = " ".repeat(e.tab_size), n = e.tag_wrap, r = e.content_wrap, o = e.strict;
958
+ let i = "";
959
+ const u = [], f = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, c = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
960
+ N.line.forEach((l, p) => {
961
+ let $ = l.value;
962
+ const g = $.startsWith("___HTMLFY_SPECIAL_IGNORE_MARKER_");
963
+ let _ = 0;
964
+ const m = N.line[p - 1], y = m?.value ?? "";
965
+ i += "0", p === 0 && _++, $.trim().startsWith("</") && _++, y.trim().startsWith("<!doctype") && _++, y.trim().startsWith("<!--") && _++, (y.trim().endsWith("/>") || y.trim().endsWith(t.SELF_CLOSING_PLACEHOLDER)) && _++, y.trim().startsWith("</") && _++, m?.type === "text" && _++;
966
+ const D = Math.max(0, i.length - _);
967
+ if (i = i.substring(0, D), l.type === "text" && /^[!,;\.]/.test($)) {
968
+ if ($.length === 1) {
969
+ u[u.length - 1] = u.at(-1) + $;
2953
970
  return;
2954
- } else if (o[o.length - 1] = o.at(-1) + g.charAt(0), g = g.slice(1).trim(), g.length === 0) return;
971
+ } else if (u[u.length - 1] = u.at(-1) + $.charAt(0), $ = $.slice(1).trim(), $.length === 0) return;
2955
972
  }
2956
- const b = s.repeat(w);
2957
- if (f)
2958
- o.push(g);
973
+ const h = s.repeat(D);
974
+ if (g)
975
+ u.push($);
2959
976
  else {
2960
- if (i && g.trim().startsWith("<!--"))
977
+ if (o && $.trim().startsWith("<!--"))
2961
978
  return;
2962
- let m = g;
2963
- if (m = Ri(m), u.type === "text" && n > 0 && m.length >= n)
2964
- m = Oi(m, n, b);
2965
- else if (r > 0 && m.length > r && l.test(m)) {
2966
- l.lastIndex = 0, h.lastIndex = 0;
2967
- const D = m.split(h).filter(Boolean);
2968
- if (D.length >= 2) {
2969
- const L = m.matchAll(h), x = b + s;
2970
- let M = b + D[0] + `
979
+ let d = $;
980
+ if (d = Rt(d), l.type === "text" && r > 0 && d.length >= r)
981
+ d = Ot(d, r, h);
982
+ else if (n > 0 && d.length > n && f.test(d)) {
983
+ f.lastIndex = 0, c.lastIndex = 0;
984
+ const S = d.split(c).filter(Boolean);
985
+ if (S.length >= 2) {
986
+ const Ce = d.matchAll(c), we = h + s;
987
+ let U = h + S[0] + `
2971
988
  `;
2972
- for (const I of L) {
2973
- const le = I[0].trim();
2974
- M += x + le + `
989
+ for (const Pe of Ce) {
990
+ const ze = Pe[0].trim();
991
+ U += we + ze + `
2975
992
  `;
2976
993
  }
2977
- const me = D[0].match(/<([A-Za-z_:-]+)/), oe = me ? me[1] : "", Q = D.at(-1)?.endsWith("/>") && js.includes(oe), Ae = D[1].trim(), S = b + (i && Q ? " " : "");
2978
- M += S + Ae, m = M;
994
+ const ee = S[0].match(/<([A-Za-z_:-]+)/), Ie = ee ? ee[1] : "", ke = S.at(-1)?.endsWith("/>") && Ae.includes(Ie), De = S[1].trim(), je = h + (o && ke ? " " : "");
995
+ U += je + De, d = U;
2979
996
  } else
2980
- m = b + m;
997
+ d = h + d;
2981
998
  } else
2982
- m = b + m;
2983
- o.push(m);
999
+ d = h + d;
1000
+ u.push(d);
2984
1001
  }
2985
1002
  });
2986
- let c = o.join(`
1003
+ let a = u.join(`
2987
1004
  `);
2988
- return r > 0 && (c = vi(c)), n > 0 && new RegExp(`/\\n[ ]*[^\\n]*${e.CONTENT_IGNORE_PLACEHOLDER}[^\\n]*\\n/`).test(c) && (c = mi(c)), c = c.replace(
1005
+ return n > 0 && (a = $t(a)), r > 0 && new RegExp(`/\\n[ ]*[^\\n]*${t.CONTENT_IGNORE_PLACEHOLDER}[^\\n]*\\n/`).test(a) && (a = _t(a)), a = a.replace(
2989
1006
  /<(?<Element>[^>\s]+)[^>]*>[^<]*?[^><\/\s][^<]*?<\/\k<Element>>|<script[^>]*>[\s]*<\/script>|<([\w:\._-]+)([^>]*)><\/\2>|<([\w:\._-]+)([^>]*)>[\s]+<\/\4>/g,
2990
- (u) => u.includes(e.SELF_CLOSING_PLACEHOLDER) || u.includes(e.CONTENT_IGNORE_PLACEHOLDER) ? u : u.replace(/\n|\t|\s{2,}/g, "")
2991
- ), n > 0 && (c = bi(c)), r > 0 && (c = wi(c)), i && (c = c.replace(/\s\/>|\/>/g, ">")), c.startsWith(`
2992
- `) && (c = c.substring(1)), c.endsWith(`
2993
- `) && (c = c.substring(0, c.length - 1)), c;
2994
- }, ji = (t, e) => {
1007
+ (l) => l.includes(t.SELF_CLOSING_PLACEHOLDER) || l.includes(t.CONTENT_IGNORE_PLACEHOLDER) ? l : l.replace(/\n|\t|\s{2,}/g, "")
1008
+ ), r > 0 && (a = bt(a)), n > 0 && (a = Et(a)), o && (a = a.replace(/\s\/>|\/>/g, ">")), a.startsWith(`
1009
+ `) && (a = a.substring(1)), a.endsWith(`
1010
+ `) && (a = a.substring(0, a.length - 1)), a;
1011
+ }, wt = (e, t) => {
2995
1012
  let s = !1;
2996
- const { checked_html: r, ignored: n } = U();
2997
- if (!r && !Ds(t)) return t;
2998
- const i = xi(e || {}), a = i.ignore.length > 0;
2999
- if (i.trim.length > 0 && (t = Ei(t, i.trim)), !n && a) {
3000
- const { html_with_markers: o, extracted_map: l } = Ws(t);
3001
- t = o, qt = l, s = !0;
3002
- }
3003
- return t = yi(t), t = Ai(t), t = Mi(t), ki(t), t = Ci(), t = Si(t), s && (t = zs(t, qt)), t;
3004
- }, Pi = (t, e, s) => {
3005
- [null, void 0, "", !1].includes(s) || ["innerHTML", "style", ""].includes(e) || t.setAttribute(e, ["object", "function"].includes(typeof s) ? "⚠️ Property must be set through a script or a framework-specific syntax." : s);
3006
- }, Gs = (t, e, s, r, n) => {
3007
- if (e && typeof e == "string") {
3008
- const i = document.createElement(e);
3009
- Object.keys(s || {}).forEach((a) => {
3010
- Pi(i, a, s[a]);
3011
- }), r?.forEach((a) => {
3012
- Gs(i, a.$tag$, a.$attrs$, a.$children$, a.$text$);
3013
- }), s?.innerHTML && (i.innerHTML = s.innerHTML), t.appendChild(i);
3014
- }
3015
- n && (t.innerHTML = n);
3016
- }, ga = (t, e, s = []) => {
3017
- const r = {};
3018
- if (typeof t != "object")
1013
+ const { checked_html: n, ignored: r } = b();
1014
+ if (!n && !Re(e)) return e;
1015
+ const o = vt(t || {}), i = o.ignore.length > 0;
1016
+ if (o.trim.length > 0 && (e = yt(e, o.trim)), !r && i) {
1017
+ const { html_with_markers: u, extracted_map: f } = Se(e);
1018
+ e = u, le = f, s = !0;
1019
+ }
1020
+ return e = ht(e), e = Tt(e), e = Lt(e), Nt(e), e = Ct(), e = mt(e), s && (e = Le(e, le)), e;
1021
+ }, It = (e, t, s) => {
1022
+ [null, void 0, "", !1].includes(s) || ["innerHTML", "style", ""].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "⚠️ Property must be set through a script or a framework-specific syntax." : s);
1023
+ }, Ne = (e, t, s, n, r) => {
1024
+ if (t && typeof t == "string") {
1025
+ const o = document.createElement(t);
1026
+ Object.keys(s || {}).forEach((i) => {
1027
+ It(o, i, s[i]);
1028
+ }), n?.forEach((i) => {
1029
+ Ne(o, i.$tag$, i.$attrs$, i.$children$, i.$text$);
1030
+ }), s?.innerHTML && (o.innerHTML = s.innerHTML), e.appendChild(o);
1031
+ }
1032
+ r && (e.innerHTML = r);
1033
+ }, is = (e, t, s = []) => {
1034
+ const n = {};
1035
+ if (typeof e != "object")
3019
1036
  throw new Error("filterArgs - args isn't an object.");
3020
- for (const n in t)
3021
- if (!s.includes(n)) {
3022
- const i = t[n], a = n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
3023
- (!e || !Object.keys(e).includes(n) || e[n] !== i) && (r[a] = i);
1037
+ for (const r in e)
1038
+ if (!s.includes(r)) {
1039
+ const o = e[r], i = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1040
+ (!t || !Object.keys(t).includes(r) || t[r] !== o) && (n[i] = o);
3024
1041
  }
3025
- return r;
3026
- }, da = (t, e) => {
1042
+ return n;
1043
+ }, as = (e, t) => {
3027
1044
  const s = document.getElementById("storybook-root");
3028
1045
  if (s !== null)
3029
- return document.querySelector("[lang]")?.setAttribute("lang", e.globals?.locale || "en"), di({
1046
+ return document.querySelector("[lang]")?.setAttribute("lang", t.globals?.locale || "en"), gt({
3030
1047
  $cmpMeta$: {
3031
1048
  $flags$: 0,
3032
1049
  $tagName$: s.tagName
3033
1050
  },
3034
1051
  $hostElement$: s
3035
- }, t(e)), s.children[s.children.length - 1];
3036
- }, $a = ({ $tag$: t, $attrs$: e, $children$: s, $text$: r }) => {
3037
- const n = document.createElement("div");
3038
- return Gs(n, t, e, s, r), ji(n.innerHTML, {
1052
+ }, e(t)), s.children[s.children.length - 1];
1053
+ }, ls = ({ $tag$: e, $attrs$: t, $children$: s, $text$: n }) => {
1054
+ const r = document.createElement("div");
1055
+ return Ne(r, e, t, s, n), wt(r.innerHTML, {
3039
1056
  tag_wrap: 40,
3040
1057
  content_wrap: 120
3041
1058
  }).replace(/="true"/g, "");
3042
- }, Jt = (t, e) => {
3043
- if (!e)
1059
+ }, ce = (e, t) => {
1060
+ if (!t)
3044
1061
  return;
3045
- const s = e.split("/");
3046
- return `${t}${s.slice(2, s.length - 1).join("-")}--docs`;
1062
+ const s = t.split("/");
1063
+ return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
3047
1064
  };
3048
- class va {
1065
+ class cs {
3049
1066
  /**
3050
1067
  * JsonDocs
3051
1068
  */
3052
1069
  jsonDoc;
3053
- constructor(e) {
3054
- this.jsonDoc = e;
1070
+ constructor(t) {
1071
+ this.jsonDoc = t;
3055
1072
  }
3056
1073
  /**
3057
1074
  * Get component data from the jsonDoc
3058
1075
  * @param tagName - tag name we want to get the data from
3059
1076
  * @returns component data
3060
1077
  */
3061
- #e = (e) => this.jsonDoc.components.find((s) => s.tag === e);
1078
+ #e = (t) => this.jsonDoc.components.find((s) => s.tag === t);
3062
1079
  /**
3063
1080
  * Get the control for the given prop
3064
1081
  * Based on https://storybook.js.org/docs/api/arg-types#controltype
3065
1082
  * @param prop - prop to get control for
3066
1083
  * @returns control type and options if applicable
3067
1084
  */
3068
- #t = (e) => {
3069
- const s = e.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
3070
- return e.type === "string" ? { control: { type: "text" } } : e.type === "number" ? { control: { type: "number" } } : e.type === "boolean" ? { control: { type: "boolean" } } : e.type.startsWith("{") && e.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r?.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
1085
+ #t = (t) => {
1086
+ const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (n) => n.replace(/\|/g, " OR ")).split("|").map((n) => n.trim().replace(/ OR /g, "|"));
1087
+ return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((n) => n?.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
3071
1088
  };
3072
1089
  /**
3073
1090
  * Extract component arg types from the component data
3074
1091
  * @param tagName - tag name we want to extract the arg types from
3075
1092
  * @returns component arg types
3076
1093
  */
3077
- extractArgTypes = (e) => {
3078
- const s = this.#e(e), r = s?.props.reduce((c, u) => {
3079
- const { control: d, options: g } = this.#t(u);
1094
+ extractArgTypes = (t) => {
1095
+ const s = this.#e(t), n = s?.props.reduce((a, l) => {
1096
+ const { control: p, options: $ } = this.#t(l);
3080
1097
  return {
3081
- ...c,
3082
- [u.name]: {
3083
- name: u.attr || u.name,
3084
- description: u.docs,
3085
- type: { required: u.required },
1098
+ ...a,
1099
+ [l.name]: {
1100
+ name: l.attr || l.name,
1101
+ description: l.docs,
1102
+ type: { required: l.required },
3086
1103
  table: {
3087
1104
  category: "props",
3088
- type: { summary: u.type },
3089
- defaultValue: { summary: u.default }
1105
+ type: { summary: l.type },
1106
+ defaultValue: { summary: l.default }
3090
1107
  },
3091
- control: d,
3092
- options: g
1108
+ control: p,
1109
+ options: $
3093
1110
  }
3094
1111
  };
3095
- }, {}), n = s?.events.reduce((c, u) => ({
3096
- ...c,
3097
- [u.event]: {
3098
- name: u.event,
3099
- description: u.docs,
1112
+ }, {}), r = s?.events.reduce((a, l) => ({
1113
+ ...a,
1114
+ [l.event]: {
1115
+ name: l.event,
1116
+ description: l.docs,
3100
1117
  table: {
3101
1118
  category: "events",
3102
- type: { summary: u.detail }
1119
+ type: { summary: l.detail }
3103
1120
  }
3104
1121
  }
3105
- }), {}), i = s?.methods.reduce((c, u) => ({
3106
- ...c,
3107
- [u.name]: {
3108
- name: u.name,
3109
- description: u.docs,
1122
+ }), {}), o = s?.methods.reduce((a, l) => ({
1123
+ ...a,
1124
+ [l.name]: {
1125
+ name: l.name,
1126
+ description: l.docs,
3110
1127
  table: {
3111
1128
  category: "methods",
3112
- type: { summary: u.signature }
1129
+ type: { summary: l.signature }
3113
1130
  }
3114
1131
  }
3115
- }), {}), a = s?.slots.reduce((c, u) => ({
3116
- ...c,
3117
- [u.name]: {
3118
- name: u.name !== "" ? u.name : "default",
1132
+ }), {}), i = s?.slots.reduce((a, l) => ({
1133
+ ...a,
1134
+ [l.name]: {
1135
+ name: l.name !== "" ? l.name : "default",
3119
1136
  // default slot are unnamed
3120
- description: u.docs,
1137
+ description: l.docs,
3121
1138
  table: {
3122
1139
  category: "slots",
3123
1140
  type: { summary: void 0 }
3124
1141
  }
3125
1142
  }
3126
- }), {}), o = s?.styles.reduce((c, u) => ({
3127
- ...c,
3128
- [u.name]: {
3129
- name: u.name,
3130
- description: u.docs,
1143
+ }), {}), u = s?.styles.reduce((a, l) => ({
1144
+ ...a,
1145
+ [l.name]: {
1146
+ name: l.name,
1147
+ description: l.docs,
3131
1148
  table: {
3132
1149
  category: "custom properties",
3133
1150
  type: { summary: void 0 }
3134
1151
  }
3135
1152
  }
3136
- }), {}), l = s?.dependencies.reduce((c, u) => {
3137
- const d = this.#e(u);
3138
- return d ? {
3139
- ...c,
3140
- [u]: {
3141
- name: u,
3142
- description: `<a href="./?path=/docs/${Jt("", d?.filePath)}">View Component Documentation</a>`,
1153
+ }), {}), f = s?.dependencies.reduce((a, l) => {
1154
+ const p = this.#e(l);
1155
+ return p ? {
1156
+ ...a,
1157
+ [l]: {
1158
+ name: l,
1159
+ description: `<a href="./?path=/docs/${ce("", p?.filePath)}">View Component Documentation</a>`,
3143
1160
  table: {
3144
1161
  category: "depends on",
3145
1162
  type: { summary: void 0 }
3146
1163
  }
3147
1164
  }
3148
- } : c;
3149
- }, {}), h = s?.dependents.reduce((c, u) => {
3150
- const d = this.#e(u);
3151
- return d ? {
3152
- ...c,
3153
- [u]: {
3154
- name: u,
3155
- description: `<a href="./?path=/docs/${Jt("", d?.filePath)}">View Component Documentation</a>`,
1165
+ } : a;
1166
+ }, {}), c = s?.dependents.reduce((a, l) => {
1167
+ const p = this.#e(l);
1168
+ return p ? {
1169
+ ...a,
1170
+ [l]: {
1171
+ name: l,
1172
+ description: `<a href="./?path=/docs/${ce("", p?.filePath)}">View Component Documentation</a>`,
3156
1173
  table: {
3157
1174
  category: "used by",
3158
1175
  type: { summary: void 0 }
3159
1176
  }
3160
1177
  }
3161
- } : c;
1178
+ } : a;
3162
1179
  }, {});
3163
1180
  return {
3164
- ...r,
3165
1181
  ...n,
3166
- ...i,
3167
- ...a,
1182
+ ...r,
3168
1183
  ...o,
3169
- ...l,
3170
- ...h
1184
+ ...i,
1185
+ ...u,
1186
+ ...f,
1187
+ ...c
3171
1188
  };
3172
1189
  };
3173
1190
  /**
@@ -3175,21 +1192,21 @@ class va {
3175
1192
  * @param tagName - tag name we want to extract the description from
3176
1193
  * @returns component description
3177
1194
  */
3178
- extractComponentDescription = (e) => {
3179
- const s = this.#e(e);
1195
+ extractComponentDescription = (t) => {
1196
+ const s = this.#e(t);
3180
1197
  return s?.readme || s?.docs;
3181
1198
  };
3182
1199
  }
3183
- const _a = ({ disconnect: t, observe: e, takeRecords: s }) => {
3184
- class r {
1200
+ const fs = ({ disconnect: e, observe: t, takeRecords: s }) => {
1201
+ class n {
3185
1202
  /**
3186
1203
  *
3187
1204
  */
3188
- disconnect = t;
1205
+ disconnect = e;
3189
1206
  /**
3190
1207
  *
3191
1208
  */
3192
- observe = e;
1209
+ observe = t;
3193
1210
  /**
3194
1211
  *
3195
1212
  */
@@ -3198,27 +1215,27 @@ const _a = ({ disconnect: t, observe: e, takeRecords: s }) => {
3198
1215
  *
3199
1216
  */
3200
1217
  cb;
3201
- constructor(i) {
3202
- this.cb = i;
1218
+ constructor(o) {
1219
+ this.cb = o;
3203
1220
  }
3204
1221
  }
3205
- return [window, global].forEach((n) => {
3206
- Object.defineProperty(n, "MutationObserver", {
1222
+ return [window, global].forEach((r) => {
1223
+ Object.defineProperty(r, "MutationObserver", {
3207
1224
  writable: !0,
3208
1225
  configurable: !0,
3209
- value: r
1226
+ value: n
3210
1227
  });
3211
- }), r;
3212
- }, ma = ({ disconnect: t, observe: e }) => {
1228
+ }), n;
1229
+ }, us = ({ disconnect: e, observe: t }) => {
3213
1230
  class s {
3214
1231
  /**
3215
1232
  *
3216
1233
  */
3217
- disconnect = t;
1234
+ disconnect = e;
3218
1235
  /**
3219
1236
  *
3220
1237
  */
3221
- observe = e;
1238
+ observe = t;
3222
1239
  /**
3223
1240
  *
3224
1241
  */
@@ -3227,85 +1244,85 @@ const _a = ({ disconnect: t, observe: e, takeRecords: s }) => {
3227
1244
  *
3228
1245
  */
3229
1246
  cb;
3230
- constructor(n) {
3231
- this.cb = n;
1247
+ constructor(r) {
1248
+ this.cb = r;
3232
1249
  }
3233
1250
  }
3234
- return [window, global].forEach((r) => {
3235
- Object.defineProperty(r, "ResizeObserver", {
1251
+ return [window, global].forEach((n) => {
1252
+ Object.defineProperty(n, "ResizeObserver", {
3236
1253
  writable: !0,
3237
1254
  configurable: !0,
3238
1255
  value: s
3239
1256
  });
3240
1257
  }), s;
3241
1258
  };
3242
- class Di extends Event {
1259
+ class kt extends Event {
3243
1260
  /**
3244
1261
  *
3245
1262
  */
3246
1263
  detail;
3247
1264
  // eslint-disable-line @typescript-eslint/no-explicit-any
3248
1265
  }
3249
- const ya = () => {
3250
- class t extends Di {
1266
+ const gs = () => {
1267
+ class e extends kt {
3251
1268
  }
3252
- return [window, global].forEach((e) => {
3253
- Object.defineProperty(e, "SubmitEvent", {
1269
+ return [window, global].forEach((t) => {
1270
+ Object.defineProperty(t, "SubmitEvent", {
3254
1271
  writable: !0,
3255
1272
  configurable: !0,
3256
- value: t
1273
+ value: e
3257
1274
  });
3258
- }), t;
3259
- }, Ea = (t) => {
3260
- const e = (s) => (setTimeout(s, 1), t(), 0);
1275
+ }), e;
1276
+ }, ps = (e) => {
1277
+ const t = (s) => (setTimeout(s, 1), e(), 0);
3261
1278
  return [window, global].forEach((s) => {
3262
1279
  Object.defineProperty(s, "requestAnimationFrame", {
3263
1280
  writable: !0,
3264
1281
  configurable: !0,
3265
- value: e
1282
+ value: t
3266
1283
  });
3267
- }), e;
1284
+ }), t;
3268
1285
  };
3269
1286
  export {
3270
- Ii as ClassList,
3271
- Zi as Cursor,
3272
- Us as Page,
3273
- qi as Paginate,
3274
- va as StorybookPreview,
3275
- Wi as allItemsAreString,
3276
- Gi as cleanString,
3277
- Hi as createID,
3278
- Ji as dateRegExp,
3279
- Xi as dateToString,
3280
- ua as defineLocales,
3281
- ga as filterArgs,
3282
- Ki as focusableElements,
3283
- Bi as formatID,
3284
- aa as getLocaleDatePattern,
3285
- Hs as getObjectValueFromKey,
3286
- Yt as getParentWindows,
3287
- $a as getStoryHTML,
3288
- Jt as getStorybookUrl,
3289
- Vi as getWindows,
3290
- at as isObject,
3291
- Yi as isTagName,
3292
- Qi as isValidNumber,
3293
- Fs as isValidString,
3294
- Fi as isValideID,
3295
- oa as localeCurrency,
3296
- Vr as localeDate,
3297
- la as localeNumber,
3298
- ca as localePercent,
3299
- ha as localeUnit,
3300
- Ui as nextTick,
3301
- Ea as setUpRequestAnimationFrameMock,
3302
- _a as setupMutationObserverMock,
3303
- ma as setupResizeObserverMock,
3304
- ya as setupSubmitEventMock,
3305
- da as stencilWrapper,
3306
- zi as toString,
3307
- ia as vsCodeCssGenerator,
3308
- na as vsCodeGenerator,
3309
- ra as webTypesGenerator
1287
+ Dt as ClassList,
1288
+ Bt as Cursor,
1289
+ Ge as Page,
1290
+ Ut as Paginate,
1291
+ cs as StorybookPreview,
1292
+ jt as allItemsAreString,
1293
+ zt as cleanString,
1294
+ Ht as createID,
1295
+ Zt as dateRegExp,
1296
+ Wt as dateToString,
1297
+ os as defineLocales,
1298
+ is as filterArgs,
1299
+ Jt as focusableElements,
1300
+ Ft as formatID,
1301
+ es as getLocaleDatePattern,
1302
+ He as getObjectValueFromKey,
1303
+ ue as getParentWindows,
1304
+ ls as getStoryHTML,
1305
+ ce as getStorybookUrl,
1306
+ Kt as getWindows,
1307
+ G as isObject,
1308
+ qt as isTagName,
1309
+ Yt as isValidNumber,
1310
+ Me as isValidString,
1311
+ Mt as isValideID,
1312
+ ts as localeCurrency,
1313
+ Je as localeDate,
1314
+ ss as localeNumber,
1315
+ ns as localePercent,
1316
+ rs as localeUnit,
1317
+ Gt as nextTick,
1318
+ ps as setUpRequestAnimationFrameMock,
1319
+ fs as setupMutationObserverMock,
1320
+ us as setupResizeObserverMock,
1321
+ gs as setupSubmitEventMock,
1322
+ as as stencilWrapper,
1323
+ Pt as toString,
1324
+ Vt as vsCodeCssGenerator,
1325
+ Qt as vsCodeGenerator,
1326
+ Xt as webTypesGenerator
3310
1327
  };
3311
1328
  //# sourceMappingURL=index.es.js.map