vite-plugin-vue-devtools 7.0.3 → 7.0.4

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.
@@ -1,1974 +0,0 @@
1
- const Ie = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Ne = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, Fe = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
2
- function De(e, t) {
3
- if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
4
- Ue(e);
5
- return;
6
- }
7
- return t;
8
- }
9
- function Ue(e) {
10
- console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
11
- }
12
- function ze(e, t = {}) {
13
- if (typeof e != "string")
14
- return e;
15
- const r = e.trim();
16
- if (
17
- // eslint-disable-next-line unicorn/prefer-at
18
- e[0] === '"' && e.at(-1) === '"' && !e.includes("\\")
19
- )
20
- return r.slice(1, -1);
21
- if (r.length <= 9) {
22
- const n = r.toLowerCase();
23
- if (n === "true")
24
- return !0;
25
- if (n === "false")
26
- return !1;
27
- if (n === "undefined")
28
- return;
29
- if (n === "null")
30
- return null;
31
- if (n === "nan")
32
- return Number.NaN;
33
- if (n === "infinity")
34
- return Number.POSITIVE_INFINITY;
35
- if (n === "-infinity")
36
- return Number.NEGATIVE_INFINITY;
37
- }
38
- if (!Fe.test(e)) {
39
- if (t.strict)
40
- throw new SyntaxError("[destr] Invalid JSON");
41
- return e;
42
- }
43
- try {
44
- if (Ie.test(e) || Ne.test(e)) {
45
- if (t.strict)
46
- throw new Error("[destr] Possible prototype pollution");
47
- return JSON.parse(e, De);
48
- }
49
- return JSON.parse(e);
50
- } catch (n) {
51
- if (t.strict)
52
- throw n;
53
- return e;
54
- }
55
- }
56
- const Ve = /#/g, Be = /&/g, qe = /=/g, re = /\+/g, He = /%5e/gi, Ge = /%60/gi, We = /%7c/gi, Je = /%20/gi;
57
- function Qe(e) {
58
- return encodeURI("" + e).replace(We, "|");
59
- }
60
- function X(e) {
61
- return Qe(typeof e == "string" ? e : JSON.stringify(e)).replace(re, "%2B").replace(Je, "+").replace(Ve, "%23").replace(Be, "%26").replace(Ge, "`").replace(He, "^");
62
- }
63
- function W(e) {
64
- return X(e).replace(qe, "%3D");
65
- }
66
- function Se(e = "") {
67
- try {
68
- return decodeURIComponent("" + e);
69
- } catch {
70
- return "" + e;
71
- }
72
- }
73
- function Ke(e) {
74
- return Se(e.replace(re, " "));
75
- }
76
- function Ye(e) {
77
- return Se(e.replace(re, " "));
78
- }
79
- function Xe(e = "") {
80
- const t = {};
81
- e[0] === "?" && (e = e.slice(1));
82
- for (const r of e.split("&")) {
83
- const n = r.match(/([^=]+)=?(.*)/) || [];
84
- if (n.length < 2)
85
- continue;
86
- const s = Ke(n[1]);
87
- if (s === "__proto__" || s === "constructor")
88
- continue;
89
- const o = Ye(n[2] || "");
90
- t[s] === void 0 ? t[s] = o : Array.isArray(t[s]) ? t[s].push(o) : t[s] = [t[s], o];
91
- }
92
- return t;
93
- }
94
- function Ze(e, t) {
95
- return (typeof t == "number" || typeof t == "boolean") && (t = String(t)), t ? Array.isArray(t) ? t.map((r) => `${W(e)}=${X(r)}`).join("&") : `${W(e)}=${X(t)}` : W(e);
96
- }
97
- function et(e) {
98
- return Object.keys(e).filter((t) => e[t] !== void 0).map((t) => Ze(t, e[t])).filter(Boolean).join("&");
99
- }
100
- const tt = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/, rt = /^[\s\w\0+.-]{2,}:([/\\]{2})?/, nt = /^([/\\]\s*){2,}[^/\\]/;
101
- function _e(e, t = {}) {
102
- return typeof t == "boolean" && (t = { acceptRelative: t }), t.strict ? tt.test(e) : rt.test(e) || (t.acceptRelative ? nt.test(e) : !1);
103
- }
104
- const st = /\/$|\/\?|\/#/;
105
- function Z(e = "", t) {
106
- return t ? st.test(e) : e.endsWith("/");
107
- }
108
- function ot(e = "", t) {
109
- if (!t)
110
- return (Z(e) ? e.slice(0, -1) : e) || "/";
111
- if (!Z(e, !0))
112
- return e || "/";
113
- let r = e, n = "";
114
- const s = e.indexOf("#");
115
- s >= 0 && (r = e.slice(0, s), n = e.slice(s));
116
- const [o, ...c] = r.split("?");
117
- return (o.slice(0, -1) || "/") + (c.length > 0 ? `?${c.join("?")}` : "") + n;
118
- }
119
- function it(e = "", t) {
120
- if (!t)
121
- return e.endsWith("/") ? e : e + "/";
122
- if (Z(e, !0))
123
- return e || "/";
124
- let r = e, n = "";
125
- const s = e.indexOf("#");
126
- if (s >= 0 && (r = e.slice(0, s), n = e.slice(s), !r))
127
- return n;
128
- const [o, ...c] = r.split("?");
129
- return o + "/" + (c.length > 0 ? `?${c.join("?")}` : "") + n;
130
- }
131
- function ct(e, t) {
132
- if (lt(t) || _e(e))
133
- return e;
134
- const r = ot(t);
135
- return e.startsWith(r) ? e : ht(r, e);
136
- }
137
- function at(e, t) {
138
- const r = $e(e), n = { ...Xe(r.search), ...t };
139
- return r.search = et(n), pt(r);
140
- }
141
- function lt(e) {
142
- return !e || e === "/";
143
- }
144
- function ft(e) {
145
- return e && e !== "/";
146
- }
147
- const ut = /^\.?\//;
148
- function ht(e, ...t) {
149
- let r = e || "";
150
- for (const n of t.filter((s) => ft(s)))
151
- if (r) {
152
- const s = n.replace(ut, "");
153
- r = it(r) + s;
154
- } else
155
- r = n;
156
- return r;
157
- }
158
- function $e(e = "", t) {
159
- const r = e.match(
160
- /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
161
- );
162
- if (r) {
163
- const [, u, p = ""] = r;
164
- return {
165
- protocol: u.toLowerCase(),
166
- pathname: p,
167
- href: u + p,
168
- auth: "",
169
- host: "",
170
- search: "",
171
- hash: ""
172
- };
173
- }
174
- if (!_e(e, { acceptRelative: !0 }))
175
- return t ? $e(t + e) : oe(e);
176
- const [, n = "", s, o = ""] = e.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [], [, c = "", l = ""] = o.match(/([^#/?]*)(.*)?/) || [], { pathname: a, search: f, hash: i } = oe(
177
- l.replace(/\/(?=[A-Za-z]:)/, "")
178
- );
179
- return {
180
- protocol: n.toLowerCase(),
181
- auth: s ? s.slice(0, Math.max(0, s.length - 1)) : "",
182
- host: c,
183
- pathname: a,
184
- search: f,
185
- hash: i
186
- };
187
- }
188
- function oe(e = "") {
189
- const [t = "", r = "", n = ""] = (e.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
190
- return {
191
- pathname: t,
192
- search: r,
193
- hash: n
194
- };
195
- }
196
- function pt(e) {
197
- const t = e.pathname || "", r = e.search ? (e.search.startsWith("?") ? "" : "?") + e.search : "", n = e.hash || "", s = e.auth ? e.auth + "@" : "", o = e.host || "";
198
- return (e.protocol ? e.protocol + "//" : "") + s + o + t + r + n;
199
- }
200
- class dt extends Error {
201
- constructor(t, r) {
202
- super(t, r), this.name = "FetchError", r != null && r.cause && !this.cause && (this.cause = r.cause);
203
- }
204
- }
205
- function mt(e) {
206
- var a, f, i, u, p;
207
- const t = ((a = e.error) == null ? void 0 : a.message) || ((f = e.error) == null ? void 0 : f.toString()) || "", r = ((i = e.request) == null ? void 0 : i.method) || ((u = e.options) == null ? void 0 : u.method) || "GET", n = ((p = e.request) == null ? void 0 : p.url) || String(e.request) || "/", s = `[${r}] ${JSON.stringify(n)}`, o = e.response ? `${e.response.status} ${e.response.statusText}` : "<no response>", c = `${s}: ${o}${t ? ` ${t}` : ""}`, l = new dt(
208
- c,
209
- e.error ? { cause: e.error } : void 0
210
- );
211
- for (const d of ["request", "options", "response"])
212
- Object.defineProperty(l, d, {
213
- get() {
214
- return e[d];
215
- }
216
- });
217
- for (const [d, w] of [
218
- ["data", "_data"],
219
- ["status", "status"],
220
- ["statusCode", "status"],
221
- ["statusText", "statusText"],
222
- ["statusMessage", "statusText"]
223
- ])
224
- Object.defineProperty(l, d, {
225
- get() {
226
- return e.response && e.response[w];
227
- }
228
- });
229
- return l;
230
- }
231
- const gt = new Set(
232
- Object.freeze(["PATCH", "POST", "PUT", "DELETE"])
233
- );
234
- function ie(e = "GET") {
235
- return gt.has(e.toUpperCase());
236
- }
237
- function yt(e) {
238
- if (e === void 0)
239
- return !1;
240
- const t = typeof e;
241
- return t === "string" || t === "number" || t === "boolean" || t === null ? !0 : t !== "object" ? !1 : Array.isArray(e) ? !0 : e.buffer ? !1 : e.constructor && e.constructor.name === "Object" || typeof e.toJSON == "function";
242
- }
243
- const wt = /* @__PURE__ */ new Set([
244
- "image/svg",
245
- "application/xml",
246
- "application/xhtml",
247
- "application/html"
248
- ]), bt = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
249
- function St(e = "") {
250
- if (!e)
251
- return "json";
252
- const t = e.split(";").shift() || "";
253
- return bt.test(t) ? "json" : wt.has(t) || t.startsWith("text/") ? "text" : "blob";
254
- }
255
- function _t(e, t, r = globalThis.Headers) {
256
- const n = {
257
- ...t,
258
- ...e
259
- };
260
- if (t != null && t.params && (e != null && e.params) && (n.params = {
261
- ...t == null ? void 0 : t.params,
262
- ...e == null ? void 0 : e.params
263
- }), t != null && t.query && (e != null && e.query) && (n.query = {
264
- ...t == null ? void 0 : t.query,
265
- ...e == null ? void 0 : e.query
266
- }), t != null && t.headers && (e != null && e.headers)) {
267
- n.headers = new r((t == null ? void 0 : t.headers) || {});
268
- for (const [s, o] of new r((e == null ? void 0 : e.headers) || {}))
269
- n.headers.set(s, o);
270
- }
271
- return n;
272
- }
273
- const $t = /* @__PURE__ */ new Set([
274
- 408,
275
- // Request Timeout
276
- 409,
277
- // Conflict
278
- 425,
279
- // Too Early
280
- 429,
281
- // Too Many Requests
282
- 500,
283
- // Internal Server Error
284
- 502,
285
- // Bad Gateway
286
- 503,
287
- // Service Unavailable
288
- 504
289
- // Gateway Timeout
290
- ]), Et = /* @__PURE__ */ new Set([101, 204, 205, 304]);
291
- function Ee(e = {}) {
292
- const {
293
- fetch: t = globalThis.fetch,
294
- Headers: r = globalThis.Headers,
295
- AbortController: n = globalThis.AbortController
296
- } = e;
297
- async function s(l) {
298
- const a = l.error && l.error.name === "AbortError" && !l.options.timeout || !1;
299
- if (l.options.retry !== !1 && !a) {
300
- let i;
301
- typeof l.options.retry == "number" ? i = l.options.retry : i = ie(l.options.method) ? 0 : 1;
302
- const u = l.response && l.response.status || 500;
303
- if (i > 0 && (Array.isArray(l.options.retryStatusCodes) ? l.options.retryStatusCodes.includes(u) : $t.has(u))) {
304
- const p = l.options.retryDelay || 0;
305
- return p > 0 && await new Promise((d) => setTimeout(d, p)), o(l.request, {
306
- ...l.options,
307
- retry: i - 1,
308
- timeout: l.options.timeout
309
- });
310
- }
311
- }
312
- const f = mt(l);
313
- throw Error.captureStackTrace && Error.captureStackTrace(f, o), f;
314
- }
315
- const o = async function(a, f = {}) {
316
- var p;
317
- const i = {
318
- request: a,
319
- options: _t(f, e.defaults, r),
320
- response: void 0,
321
- error: void 0
322
- };
323
- if (i.options.method = (p = i.options.method) == null ? void 0 : p.toUpperCase(), i.options.onRequest && await i.options.onRequest(i), typeof i.request == "string" && (i.options.baseURL && (i.request = ct(i.request, i.options.baseURL)), (i.options.query || i.options.params) && (i.request = at(i.request, {
324
- ...i.options.params,
325
- ...i.options.query
326
- }))), i.options.body && ie(i.options.method) && (yt(i.options.body) ? (i.options.body = typeof i.options.body == "string" ? i.options.body : JSON.stringify(i.options.body), i.options.headers = new r(i.options.headers || {}), i.options.headers.has("content-type") || i.options.headers.set("content-type", "application/json"), i.options.headers.has("accept") || i.options.headers.set("accept", "application/json")) : (
327
- // ReadableStream Body
328
- ("pipeTo" in i.options.body && typeof i.options.body.pipeTo == "function" || // Node.js Stream Body
329
- typeof i.options.body.pipe == "function") && ("duplex" in i.options || (i.options.duplex = "half"))
330
- )), !i.options.signal && i.options.timeout) {
331
- const d = new n();
332
- setTimeout(() => d.abort(), i.options.timeout), i.options.signal = d.signal;
333
- }
334
- try {
335
- i.response = await t(
336
- i.request,
337
- i.options
338
- );
339
- } catch (d) {
340
- return i.error = d, i.options.onRequestError && await i.options.onRequestError(i), await s(i);
341
- }
342
- if (i.response.body && !Et.has(i.response.status) && i.options.method !== "HEAD") {
343
- const d = (i.options.parseResponse ? "json" : i.options.responseType) || St(i.response.headers.get("content-type") || "");
344
- switch (d) {
345
- case "json": {
346
- const w = await i.response.text(), g = i.options.parseResponse || ze;
347
- i.response._data = g(w);
348
- break;
349
- }
350
- case "stream": {
351
- i.response._data = i.response.body;
352
- break;
353
- }
354
- default:
355
- i.response._data = await i.response[d]();
356
- }
357
- }
358
- return i.options.onResponse && await i.options.onResponse(i), !i.options.ignoreResponseError && i.response.status >= 400 && i.response.status < 600 ? (i.options.onResponseError && await i.options.onResponseError(i), await s(i)) : i.response;
359
- }, c = async function(a, f) {
360
- return (await o(a, f))._data;
361
- };
362
- return c.raw = o, c.native = (...l) => t(...l), c.create = (l = {}) => Ee({
363
- ...e,
364
- defaults: {
365
- ...e.defaults,
366
- ...l
367
- }
368
- }), c;
369
- }
370
- const ne = function() {
371
- if (typeof globalThis < "u")
372
- return globalThis;
373
- if (typeof self < "u")
374
- return self;
375
- if (typeof window < "u")
376
- return window;
377
- if (typeof global < "u")
378
- return global;
379
- throw new Error("unable to locate global object");
380
- }(), vt = ne.fetch || (() => Promise.reject(new Error("[ofetch] global.fetch is not supported!"))), At = ne.Headers, xt = ne.AbortController, Ct = Ee({ fetch: vt, Headers: At, AbortController: xt }), Ot = Ct;
381
- function Rt(e) {
382
- const t = e.length;
383
- let r = -1, n, s = "";
384
- const o = e.charCodeAt(0);
385
- for (; ++r < t; ) {
386
- if (n = e.charCodeAt(r), n === 0) {
387
- s += "�";
388
- continue;
389
- }
390
- if (n === 37) {
391
- s += "\\%";
392
- continue;
393
- }
394
- if (n === 44) {
395
- s += "\\,";
396
- continue;
397
- }
398
- if (
399
- // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
400
- // U+007F, […]
401
- n >= 1 && n <= 31 || n === 127 || r === 0 && n >= 48 && n <= 57 || r === 1 && n >= 48 && n <= 57 && o === 45
402
- ) {
403
- s += `\\${n.toString(16)} `;
404
- continue;
405
- }
406
- if (
407
- // If the character is the first character and is a `-` (U+002D), and
408
- // there is no second character, […]
409
- r === 0 && t === 1 && n === 45
410
- ) {
411
- s += `\\${e.charAt(r)}`;
412
- continue;
413
- }
414
- if (n >= 128 || n === 45 || n === 95 || n >= 48 && n <= 57 || n >= 65 && n <= 90 || n >= 97 && n <= 122) {
415
- s += e.charAt(r);
416
- continue;
417
- }
418
- s += `\\${e.charAt(r)}`;
419
- }
420
- return s;
421
- }
422
- const J = Rt;
423
- function k(e = []) {
424
- return Array.isArray(e) ? e : [e];
425
- }
426
- function H(e) {
427
- return Array.from(new Set(e));
428
- }
429
- function jt(e, t) {
430
- return e.reduce((r, n) => (r.findIndex((o) => t(n, o)) === -1 && r.push(n), r), []);
431
- }
432
- function T(e) {
433
- return typeof e == "string";
434
- }
435
- function U(e) {
436
- return T(e) ? e : (Array.isArray(e) ? e : Object.entries(e)).filter((t) => t[1] != null);
437
- }
438
- function Tt(e) {
439
- return Array.isArray(e) ? e.find((t) => !Array.isArray(t) || Array.isArray(t[0])) ? e.map((t) => U(t)) : [e] : [U(e)];
440
- }
441
- function Mt(e) {
442
- return e.filter(([t, r], n) => {
443
- if (t.startsWith("$$"))
444
- return !1;
445
- for (let s = n - 1; s >= 0; s--)
446
- if (e[s][0] === t && e[s][1] === r)
447
- return !1;
448
- return !0;
449
- });
450
- }
451
- function Q(e) {
452
- return e == null ? "" : Mt(e).map(([t, r]) => r != null ? `${t}:${r};` : void 0).filter(Boolean).join("");
453
- }
454
- function V(e) {
455
- return e && typeof e == "object" && !Array.isArray(e);
456
- }
457
- function ve(e, t, r = !1) {
458
- const n = e, s = t;
459
- if (Array.isArray(s))
460
- return r && Array.isArray(s) ? [...n, ...s] : [...s];
461
- const o = { ...n };
462
- return V(n) && V(s) && Object.keys(s).forEach((c) => {
463
- V(n[c]) && V(s[c]) || Array.isArray(n[c]) && Array.isArray(s[c]) ? o[c] = ve(n[c], s[c], r) : Object.assign(o, { [c]: s[c] });
464
- }), o;
465
- }
466
- function q(e) {
467
- let t, r, n;
468
- if (Array.isArray(e)) {
469
- for (r = Array(t = e.length); t--; )
470
- r[t] = (n = e[t]) && typeof n == "object" ? q(n) : n;
471
- return r;
472
- }
473
- if (Object.prototype.toString.call(e) === "[object Object]") {
474
- r = {};
475
- for (t in e)
476
- t === "__proto__" ? Object.defineProperty(r, t, {
477
- value: q(e[t]),
478
- configurable: !0,
479
- enumerable: !0,
480
- writable: !0
481
- }) : r[t] = (n = e[t]) && typeof n == "object" ? q(n) : n;
482
- return r;
483
- }
484
- return e;
485
- }
486
- function Pt(e) {
487
- return T(e[0]);
488
- }
489
- function Lt(e) {
490
- return T(e[0]);
491
- }
492
- const ce = "$$shortcut-no-merge";
493
- function kt(e) {
494
- return typeof e == "function" ? { match: e } : e;
495
- }
496
- function ae(e) {
497
- return e.length === 3;
498
- }
499
- function It(e) {
500
- return e != null;
501
- }
502
- function Nt() {
503
- }
504
- var Ft = Object.defineProperty, Dt = (e, t, r) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ut = (e, t, r) => (Dt(e, typeof t != "symbol" ? t + "" : t, r), r);
505
- class zt {
506
- constructor() {
507
- Ut(this, "_map", /* @__PURE__ */ new Map());
508
- }
509
- get(t, r) {
510
- const n = this._map.get(t);
511
- if (n)
512
- return n.get(r);
513
- }
514
- getFallback(t, r, n) {
515
- let s = this._map.get(t);
516
- return s || (s = /* @__PURE__ */ new Map(), this._map.set(t, s)), s.has(r) || s.set(r, n), s.get(r);
517
- }
518
- set(t, r, n) {
519
- let s = this._map.get(t);
520
- return s || (s = /* @__PURE__ */ new Map(), this._map.set(t, s)), s.set(r, n), this;
521
- }
522
- has(t, r) {
523
- var n;
524
- return (n = this._map.get(t)) == null ? void 0 : n.has(r);
525
- }
526
- delete(t, r) {
527
- var n;
528
- return ((n = this._map.get(t)) == null ? void 0 : n.delete(r)) || !1;
529
- }
530
- deleteTop(t) {
531
- return this._map.delete(t);
532
- }
533
- map(t) {
534
- return Array.from(this._map.entries()).flatMap(([r, n]) => Array.from(n.entries()).map(([s, o]) => t(o, r, s)));
535
- }
536
- }
537
- var Vt = Object.defineProperty, Bt = (e, t, r) => t in e ? Vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, qt = (e, t, r) => (Bt(e, typeof t != "symbol" ? t + "" : t, r), r);
538
- class Ae extends Set {
539
- constructor(t) {
540
- super(t), qt(this, "_map"), this._map ?? (this._map = /* @__PURE__ */ new Map());
541
- }
542
- add(t) {
543
- return this._map ?? (this._map = /* @__PURE__ */ new Map()), this._map.set(t, (this._map.get(t) ?? 0) + 1), super.add(t);
544
- }
545
- delete(t) {
546
- return this._map.delete(t), super.delete(t);
547
- }
548
- clear() {
549
- this._map.clear(), super.clear();
550
- }
551
- getCount(t) {
552
- return this._map.get(t) ?? 0;
553
- }
554
- setCount(t, r) {
555
- return this._map.set(t, r), super.add(t);
556
- }
557
- }
558
- function K(e) {
559
- return e instanceof Ae;
560
- }
561
- const B = {};
562
- function Ht(e = ["-", ":"]) {
563
- const t = e.join("|");
564
- return B[t] || (B[t] = new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${t})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`, "gm")), B[t].lastIndex = 0, B[t];
565
- }
566
- function Gt(e, t = ["-", ":"], r = 5) {
567
- const n = Ht(t);
568
- let s, o = e.toString();
569
- const c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
570
- do
571
- s = !1, o = o.replace(
572
- n,
573
- (f, i, u, p, d) => {
574
- var y;
575
- if (!t.includes(u))
576
- return f;
577
- s = !0, c.add(i + u);
578
- const w = d + i.length + u.length + 1, g = { length: f.length, items: [] };
579
- l.set(d, g);
580
- for (const $ of [...p.matchAll(/\S+/g)]) {
581
- const E = w + $.index;
582
- let S = (y = l.get(E)) == null ? void 0 : y.items;
583
- S ? l.delete(E) : S = [{
584
- offset: E,
585
- length: $[0].length,
586
- className: $[0]
587
- }];
588
- for (const m of S)
589
- m.className = m.className === "~" ? i : m.className.replace(/^(!?)(.*)/, `$1${i}${u}$2`), g.items.push(m);
590
- }
591
- return "$".repeat(f.length);
592
- }
593
- ), r -= 1;
594
- while (s && r);
595
- let a;
596
- if (typeof e == "string") {
597
- a = "";
598
- let f = 0;
599
- for (const [i, u] of l)
600
- a += e.slice(f, i), a += u.items.map((p) => p.className).join(" "), f = i + u.length;
601
- a += e.slice(f);
602
- } else {
603
- a = e;
604
- for (const [f, i] of l)
605
- a.overwrite(
606
- f,
607
- f + i.length,
608
- i.items.map((u) => u.className).join(" ")
609
- );
610
- }
611
- return {
612
- prefixes: Array.from(c),
613
- hasChanged: s,
614
- groupsByOffset: l,
615
- // Computed lazily because MagicString's toString does a lot of work
616
- get expanded() {
617
- return a.toString();
618
- }
619
- };
620
- }
621
- function Wt(e, t = ["-", ":"], r = 5) {
622
- const n = Gt(e, t, r);
623
- return typeof e == "string" ? n.expanded : e;
624
- }
625
- const le = /* @__PURE__ */ new Set();
626
- function xe(e) {
627
- le.has(e) || (console.warn("[unocss]", e), le.add(e));
628
- }
629
- const Jt = /[\\:]?[\s'"`;{}]+/g;
630
- function Qt(e) {
631
- return e.split(Jt);
632
- }
633
- const Kt = {
634
- name: "@unocss/core/extractor-split",
635
- order: 0,
636
- extract({ code: e }) {
637
- return Qt(e);
638
- }
639
- };
640
- function Yt() {
641
- return {
642
- events: {},
643
- emit(e, ...t) {
644
- (this.events[e] || []).forEach((r) => r(...t));
645
- },
646
- on(e, t) {
647
- return (this.events[e] = this.events[e] || []).push(t), () => this.events[e] = (this.events[e] || []).filter((r) => r !== t);
648
- }
649
- };
650
- }
651
- const ee = "default", te = "preflights", Xt = "shortcuts", Zt = "imports", er = {
652
- [Zt]: -200,
653
- [te]: -100,
654
- [Xt]: -10,
655
- [ee]: 0
656
- };
657
- function Ce(e) {
658
- return k(e).flatMap((t) => Array.isArray(t) ? [t] : Object.entries(t));
659
- }
660
- const fe = "_uno_resolved";
661
- function tr(e) {
662
- var n;
663
- let t = typeof e == "function" ? e() : e;
664
- if (fe in t)
665
- return t;
666
- t = { ...t }, Object.defineProperty(t, fe, {
667
- value: !0,
668
- enumerable: !1
669
- });
670
- const r = t.shortcuts ? Ce(t.shortcuts) : void 0;
671
- if (t.shortcuts = r, t.prefix || t.layer) {
672
- const s = (o) => {
673
- o[2] || (o[2] = {});
674
- const c = o[2];
675
- c.prefix == null && t.prefix && (c.prefix = k(t.prefix)), c.layer == null && t.layer && (c.layer = t.layer);
676
- };
677
- r == null || r.forEach(s), (n = t.rules) == null || n.forEach(s);
678
- }
679
- return t;
680
- }
681
- function Oe(e) {
682
- const t = tr(e);
683
- if (!t.presets)
684
- return [t];
685
- const r = (t.presets || []).flatMap(k).flatMap(Oe);
686
- return [t, ...r];
687
- }
688
- function ue(e = {}, t = {}) {
689
- var m, A;
690
- const r = Object.assign({}, t, e), n = jt((r.presets || []).flatMap(k).flatMap(Oe), (h, _) => h.name === _.name), s = [
691
- ...n.filter((h) => h.enforce === "pre"),
692
- ...n.filter((h) => !h.enforce),
693
- ...n.filter((h) => h.enforce === "post")
694
- ], o = [
695
- ...s,
696
- r
697
- ], c = [...o].reverse(), l = Object.assign({}, er, ...o.map((h) => h.layers));
698
- function a(h) {
699
- return H(o.flatMap((_) => k(_[h] || [])));
700
- }
701
- const f = a("extractors");
702
- let i = (m = c.find((h) => h.extractorDefault !== void 0)) == null ? void 0 : m.extractorDefault;
703
- i === void 0 && (i = Kt), i && !f.includes(i) && f.unshift(i), f.sort((h, _) => (h.order || 0) - (_.order || 0));
704
- const u = a("rules"), p = {}, d = u.length, w = u.map((h, _) => {
705
- var R;
706
- if (Pt(h)) {
707
- k(((R = h[2]) == null ? void 0 : R.prefix) || "").forEach((I) => {
708
- p[I + h[0]] = [_, h[1], h[2], h];
709
- });
710
- return;
711
- }
712
- return [_, ...h];
713
- }).filter(Boolean).reverse();
714
- let g = rr(o.map((h) => h.theme));
715
- const y = a("extendTheme");
716
- for (const h of y)
717
- g = h(g) || g;
718
- const $ = {
719
- templates: H(o.flatMap((h) => {
720
- var _;
721
- return k((_ = h.autocomplete) == null ? void 0 : _.templates);
722
- })),
723
- extractors: o.flatMap((h) => {
724
- var _;
725
- return k((_ = h.autocomplete) == null ? void 0 : _.extractors);
726
- }).sort((h, _) => (h.order || 0) - (_.order || 0)),
727
- shorthands: nr(o.map((h) => {
728
- var _;
729
- return ((_ = h.autocomplete) == null ? void 0 : _.shorthands) || {};
730
- }))
731
- };
732
- let E = a("separators");
733
- E.length || (E = [":", "-"]);
734
- const S = {
735
- mergeSelectors: !0,
736
- warn: !0,
737
- sortLayers: (h) => h,
738
- ...r,
739
- blocklist: a("blocklist"),
740
- presets: s,
741
- envMode: r.envMode || "build",
742
- shortcutsLayer: r.shortcutsLayer || "shortcuts",
743
- layers: l,
744
- theme: g,
745
- rulesSize: d,
746
- rulesDynamic: w,
747
- rulesStaticMap: p,
748
- preprocess: a("preprocess"),
749
- postprocess: a("postprocess"),
750
- preflights: a("preflights"),
751
- autocomplete: $,
752
- variants: a("variants").map(kt).sort((h, _) => (h.order || 0) - (_.order || 0)),
753
- shortcuts: Ce(a("shortcuts")).reverse(),
754
- extractors: f,
755
- safelist: a("safelist"),
756
- separators: E,
757
- details: r.details ?? r.envMode === "dev"
758
- };
759
- for (const h of o)
760
- (A = h == null ? void 0 : h.configResolved) == null || A.call(h, S);
761
- return S;
762
- }
763
- function rr(e) {
764
- return e.map((t) => t ? q(t) : {}).reduce((t, r) => ve(t, r), {});
765
- }
766
- function nr(e) {
767
- return e.reduce((t, r) => {
768
- const n = {};
769
- for (const s in r) {
770
- const o = r[s];
771
- Array.isArray(o) ? n[s] = `(${o.join("|")})` : n[s] = o;
772
- }
773
- return {
774
- ...t,
775
- ...n
776
- };
777
- }, {});
778
- }
779
- const sr = "0.58.2";
780
- var or = Object.defineProperty, ir = (e, t, r) => t in e ? or(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, F = (e, t, r) => (ir(e, typeof t != "symbol" ? t + "" : t, r), r);
781
- class cr {
782
- constructor(t = {}, r = {}) {
783
- this.userConfig = t, this.defaults = r, F(this, "version", sr), F(this, "_cache", /* @__PURE__ */ new Map()), F(this, "config"), F(this, "blocked", /* @__PURE__ */ new Set()), F(this, "parentOrders", /* @__PURE__ */ new Map()), F(this, "events", Yt()), this.config = ue(t, r), this.events.emit("config", this.config);
784
- }
785
- setConfig(t, r) {
786
- t && (r && (this.defaults = r), this.userConfig = t, this.blocked.clear(), this.parentOrders.clear(), this._cache.clear(), this.config = ue(t, this.defaults), this.events.emit("config", this.config));
787
- }
788
- async applyExtractors(t, r, n = /* @__PURE__ */ new Set()) {
789
- var o;
790
- const s = {
791
- original: t,
792
- code: t,
793
- id: r,
794
- extracted: n,
795
- envMode: this.config.envMode
796
- };
797
- for (const c of this.config.extractors) {
798
- const l = await ((o = c.extract) == null ? void 0 : o.call(c, s));
799
- if (l)
800
- if (K(l) && K(n))
801
- for (const a of l)
802
- n.setCount(a, n.getCount(a) + l.getCount(a));
803
- else
804
- for (const a of l)
805
- n.add(a);
806
- }
807
- return n;
808
- }
809
- makeContext(t, r) {
810
- const n = {
811
- rawSelector: t,
812
- currentSelector: r[1],
813
- theme: this.config.theme,
814
- generator: this,
815
- variantHandlers: r[2],
816
- constructCSS: (...s) => this.constructCustomCSS(n, ...s),
817
- variantMatch: r
818
- };
819
- return n;
820
- }
821
- async parseToken(t, r) {
822
- var f;
823
- if (this.blocked.has(t))
824
- return;
825
- const n = `${t}${r ? ` ${r}` : ""}`;
826
- if (this._cache.has(n))
827
- return this._cache.get(n);
828
- let s = t;
829
- for (const i of this.config.preprocess)
830
- s = i(t);
831
- if (this.isBlocked(s)) {
832
- this.blocked.add(t), this._cache.set(n, null);
833
- return;
834
- }
835
- const o = await this.matchVariants(t, s);
836
- if (!o || this.isBlocked(o[1])) {
837
- this.blocked.add(t), this._cache.set(n, null);
838
- return;
839
- }
840
- const c = this.makeContext(t, [r || o[0], o[1], o[2], o[3]]);
841
- this.config.details && (c.variants = [...o[3]]);
842
- const l = await this.expandShortcut(c.currentSelector, c), a = l ? await this.stringifyShortcuts(c.variantMatch, c, l[0], l[1]) : (f = await this.parseUtil(c.variantMatch, c)) == null ? void 0 : f.map((i) => this.stringifyUtil(i, c)).filter(It);
843
- if (a != null && a.length)
844
- return this._cache.set(n, a), a;
845
- this._cache.set(n, null);
846
- }
847
- async generate(t, r = {}) {
848
- const {
849
- id: n,
850
- scope: s,
851
- preflights: o = !0,
852
- safelist: c = !0,
853
- minify: l = !1,
854
- extendedInfo: a = !1
855
- } = r, f = T(t) ? await this.applyExtractors(
856
- t,
857
- n,
858
- a ? new Ae() : /* @__PURE__ */ new Set()
859
- ) : Array.isArray(t) ? new Set(t) : t;
860
- c && this.config.safelist.forEach((m) => {
861
- f.has(m) || f.add(m);
862
- });
863
- const i = l ? "" : `
864
- `, u = /* @__PURE__ */ new Set([ee]), p = a ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Map();
865
- let w = {};
866
- const g = Array.from(f).map(async (m) => {
867
- var h;
868
- if (p.has(m))
869
- return;
870
- const A = await this.parseToken(m);
871
- if (A != null) {
872
- p instanceof Map ? p.set(m, {
873
- data: A,
874
- count: K(f) ? f.getCount(m) : -1
875
- }) : p.add(m);
876
- for (const _ of A) {
877
- const R = _[3] || "", M = (h = _[4]) == null ? void 0 : h.layer;
878
- d.has(R) || d.set(R, []), d.get(R).push(_), M && u.add(M);
879
- }
880
- }
881
- });
882
- await Promise.all(g), await (async () => {
883
- if (!o)
884
- return;
885
- const m = {
886
- generator: this,
887
- theme: this.config.theme
888
- }, A = /* @__PURE__ */ new Set([]);
889
- this.config.preflights.forEach(({ layer: h = te }) => {
890
- u.add(h), A.add(h);
891
- }), w = Object.fromEntries(
892
- await Promise.all(Array.from(A).map(
893
- async (h) => {
894
- const R = (await Promise.all(
895
- this.config.preflights.filter((M) => (M.layer || te) === h).map(async (M) => await M.getCSS(m))
896
- )).filter(Boolean).join(i);
897
- return [h, R];
898
- }
899
- ))
900
- );
901
- })();
902
- const y = this.config.sortLayers(Array.from(u).sort((m, A) => (this.config.layers[m] ?? 0) - (this.config.layers[A] ?? 0) || m.localeCompare(A))), $ = {}, E = (m) => {
903
- if ($[m])
904
- return $[m];
905
- let A = Array.from(d).sort((_, R) => {
906
- var M;
907
- return (this.parentOrders.get(_[0]) ?? 0) - (this.parentOrders.get(R[0]) ?? 0) || ((M = _[0]) == null ? void 0 : M.localeCompare(R[0] || "")) || 0;
908
- }).map(([_, R]) => {
909
- const M = R.length, I = R.filter((O) => {
910
- var j;
911
- return (((j = O[4]) == null ? void 0 : j.layer) || ee) === m;
912
- }).sort((O, j) => {
913
- var P, b, x, v, C, L, N;
914
- return O[0] - j[0] || (((P = O[4]) == null ? void 0 : P.sort) || 0) - (((b = j[4]) == null ? void 0 : b.sort) || 0) || ((C = (x = O[5]) == null ? void 0 : x.currentSelector) == null ? void 0 : C.localeCompare(((v = j[5]) == null ? void 0 : v.currentSelector) ?? "")) || ((L = O[1]) == null ? void 0 : L.localeCompare(j[1] || "")) || ((N = O[2]) == null ? void 0 : N.localeCompare(j[2] || "")) || 0;
915
- }).map(([, O, j, , P, , b]) => [
916
- [[(O && fr(O, s)) ?? "", (P == null ? void 0 : P.sort) ?? 0]],
917
- j,
918
- !!(b ?? (P == null ? void 0 : P.noMerge))
919
- ]);
920
- if (!I.length)
921
- return;
922
- const D = I.reverse().map(([O, j, P], b) => {
923
- if (!P && this.config.mergeSelectors)
924
- for (let v = b + 1; v < M; v++) {
925
- const C = I[v];
926
- if (C && !C[2] && (O && C[0] || O == null && C[0] == null) && C[1] === j)
927
- return O && C[0] && C[0].push(...O), null;
928
- }
929
- const x = O ? H(O.sort((v, C) => {
930
- var L;
931
- return v[1] - C[1] || ((L = v[0]) == null ? void 0 : L.localeCompare(C[0] || "")) || 0;
932
- }).map((v) => v[0]).filter(Boolean)) : [];
933
- return x.length ? `${x.join(`,${i}`)}{${j}}` : j;
934
- }).filter(Boolean).reverse().join(i);
935
- if (!_)
936
- return D;
937
- const z = _.split(" $$ ");
938
- return `${z.join("{")}{${i}${D}${i}${"}".repeat(z.length)}`;
939
- }).filter(Boolean).join(i);
940
- o && (A = [w[m], A].filter(Boolean).join(i));
941
- const h = l ? "" : `/* layer: ${m} */${i}`;
942
- return $[m] = A ? h + A : "";
943
- }, S = (m = y, A) => m.filter((h) => !(A != null && A.includes(h))).map((h) => E(h) || "").filter(Boolean).join(i);
944
- return {
945
- get css() {
946
- return S();
947
- },
948
- layers: y,
949
- matched: p,
950
- getLayers: S,
951
- getLayer: E
952
- };
953
- }
954
- async matchVariants(t, r) {
955
- const n = /* @__PURE__ */ new Set(), s = [];
956
- let o = r || t, c = !0;
957
- const l = {
958
- rawSelector: t,
959
- theme: this.config.theme,
960
- generator: this
961
- };
962
- for (; c; ) {
963
- c = !1;
964
- for (const a of this.config.variants) {
965
- if (!a.multiPass && n.has(a))
966
- continue;
967
- let f = await a.match(o, l);
968
- if (f) {
969
- if (T(f)) {
970
- if (f === o)
971
- continue;
972
- f = { matcher: f };
973
- }
974
- o = f.matcher, s.unshift(f), n.add(a), c = !0;
975
- break;
976
- }
977
- }
978
- if (!c)
979
- break;
980
- if (s.length > 500)
981
- throw new Error(`Too many variants applied to "${t}"`);
982
- }
983
- return [t, o, s, n];
984
- }
985
- applyVariants(t, r = t[4], n = t[1]) {
986
- const o = r.slice().sort((f, i) => (f.order || 0) - (i.order || 0)).reduceRight(
987
- (f, i) => (u) => {
988
- var w, g;
989
- const p = ((w = i.body) == null ? void 0 : w.call(i, u.entries)) || u.entries, d = Array.isArray(i.parent) ? i.parent : [i.parent, void 0];
990
- return (i.handle ?? hr)({
991
- ...u,
992
- entries: p,
993
- selector: ((g = i.selector) == null ? void 0 : g.call(i, u.selector, p)) || u.selector,
994
- parent: d[0] || u.parent,
995
- parentOrder: d[1] || u.parentOrder,
996
- layer: i.layer || u.layer,
997
- sort: i.sort || u.sort
998
- }, f);
999
- },
1000
- (f) => f
1001
- )({
1002
- prefix: "",
1003
- selector: ur(n),
1004
- pseudo: "",
1005
- entries: t[2]
1006
- }), { parent: c, parentOrder: l } = o;
1007
- c != null && l != null && this.parentOrders.set(c, l);
1008
- const a = {
1009
- selector: [
1010
- o.prefix,
1011
- o.selector,
1012
- o.pseudo
1013
- ].join(""),
1014
- entries: o.entries,
1015
- parent: c,
1016
- layer: o.layer,
1017
- sort: o.sort,
1018
- noMerge: o.noMerge
1019
- };
1020
- for (const f of this.config.postprocess)
1021
- f(a);
1022
- return a;
1023
- }
1024
- constructCustomCSS(t, r, n) {
1025
- const s = U(r);
1026
- if (T(s))
1027
- return s;
1028
- const { selector: o, entries: c, parent: l } = this.applyVariants([0, n || t.rawSelector, s, void 0, t.variantHandlers]), a = `${o}{${Q(c)}}`;
1029
- return l ? `${l}{${a}}` : a;
1030
- }
1031
- async parseUtil(t, r, n = !1, s) {
1032
- var i;
1033
- const [o, c, l] = T(t) ? await this.matchVariants(t) : t;
1034
- this.config.details && (r.rules = r.rules ?? []);
1035
- const a = this.config.rulesStaticMap[c];
1036
- if (a && a[1] && (n || !((i = a[2]) != null && i.internal))) {
1037
- this.config.details && r.rules.push(a[3]);
1038
- const u = a[0], p = U(a[1]), d = a[2];
1039
- return T(p) ? [[u, p, d]] : [[u, o, p, d, l]];
1040
- }
1041
- r.variantHandlers = l;
1042
- const { rulesDynamic: f } = this.config;
1043
- for (const [u, p, d, w] of f) {
1044
- if (w != null && w.internal && !n)
1045
- continue;
1046
- let g = c;
1047
- if (w != null && w.prefix) {
1048
- const S = k(w.prefix);
1049
- if (s) {
1050
- const m = k(s);
1051
- if (!S.some((A) => m.includes(A)))
1052
- continue;
1053
- } else {
1054
- const m = S.find((A) => c.startsWith(A));
1055
- if (m == null)
1056
- continue;
1057
- g = c.slice(m.length);
1058
- }
1059
- }
1060
- const y = g.match(p);
1061
- if (!y)
1062
- continue;
1063
- const $ = await d(y, r);
1064
- if (!$)
1065
- continue;
1066
- this.config.details && r.rules.push([p, d, w]);
1067
- const E = Tt($).filter((S) => S.length);
1068
- if (E.length)
1069
- return E.map((S) => T(S) ? [u, S, w] : [u, o, S, w, l]);
1070
- }
1071
- }
1072
- stringifyUtil(t, r) {
1073
- if (!t)
1074
- return;
1075
- if (ae(t))
1076
- return [t[0], void 0, t[1], void 0, t[2], this.config.details ? r : void 0, void 0];
1077
- const { selector: n, entries: s, parent: o, layer: c, sort: l, noMerge: a } = this.applyVariants(t), f = Q(s);
1078
- if (!f)
1079
- return;
1080
- const { layer: i, sort: u, ...p } = t[3] ?? {}, d = {
1081
- ...p,
1082
- layer: c ?? i,
1083
- sort: l ?? u
1084
- };
1085
- return [t[0], n, f, o, d, this.config.details ? r : void 0, a];
1086
- }
1087
- async expandShortcut(t, r, n = 5) {
1088
- var l;
1089
- if (n === 0)
1090
- return;
1091
- const s = this.config.details ? (a) => {
1092
- r.shortcuts = r.shortcuts ?? [], r.shortcuts.push(a);
1093
- } : Nt;
1094
- let o, c;
1095
- for (const a of this.config.shortcuts) {
1096
- let f = t;
1097
- if ((l = a[2]) != null && l.prefix) {
1098
- const u = k(a[2].prefix).find((p) => t.startsWith(p));
1099
- if (u == null)
1100
- continue;
1101
- f = t.slice(u.length);
1102
- }
1103
- if (Lt(a)) {
1104
- if (a[0] === f) {
1105
- o = o || a[2], c = a[1], s(a);
1106
- break;
1107
- }
1108
- } else {
1109
- const i = f.match(a[0]);
1110
- if (i && (c = a[1](i, r)), c) {
1111
- o = o || a[2], s(a);
1112
- break;
1113
- }
1114
- }
1115
- }
1116
- if (T(c) && (c = Wt(c.trim()).split(/\s+/g)), !c) {
1117
- const [a, f] = T(t) ? await this.matchVariants(t) : t;
1118
- if (a !== f) {
1119
- const i = await this.expandShortcut(f, r, n - 1);
1120
- i && (c = i[0].map((u) => T(u) ? a.replace(f, u) : u));
1121
- }
1122
- }
1123
- if (c)
1124
- return [
1125
- (await Promise.all(c.map(async (a) => {
1126
- var f;
1127
- return (T(a) ? (f = await this.expandShortcut(a, r, n - 1)) == null ? void 0 : f[0] : void 0) || [a];
1128
- }))).flat(1).filter(Boolean),
1129
- o
1130
- ];
1131
- }
1132
- async stringifyShortcuts(t, r, n, s = { layer: this.config.shortcutsLayer }) {
1133
- var i;
1134
- const o = new zt(), c = (await Promise.all(H(n).map(async (u) => {
1135
- const p = T(u) ? await this.parseUtil(u, r, !0, s.prefix) : [[Number.POSITIVE_INFINITY, "{inline}", U(u), void 0, []]];
1136
- return !p && this.config.warn && xe(`unmatched utility "${u}" in shortcut "${t[1]}"`), p || [];
1137
- }))).flat(1).filter(Boolean).sort((u, p) => u[0] - p[0]), [l, , a] = t, f = [];
1138
- for (const u of c) {
1139
- if (ae(u)) {
1140
- f.push([u[0], void 0, u[1], void 0, u[2], r, void 0]);
1141
- continue;
1142
- }
1143
- const { selector: p, entries: d, parent: w, sort: g, noMerge: y } = this.applyVariants(u, [...u[4], ...a], l);
1144
- o.getFallback(p, w, [[], u[0]])[0].push([d, !!(y ?? ((i = u[3]) == null ? void 0 : i.noMerge)), g ?? 0]);
1145
- }
1146
- return f.concat(o.map(([u, p], d, w) => {
1147
- const g = ($, E, S) => {
1148
- const m = Math.max(...S.map((h) => h[1])), A = S.map((h) => h[0]);
1149
- return ($ ? [A.flat(1)] : A).map((h) => {
1150
- const _ = Q(h);
1151
- if (_)
1152
- return [p, d, _, w, { ...s, noMerge: E, sort: m }, r, void 0];
1153
- });
1154
- };
1155
- return [
1156
- [u.filter(([, $]) => $).map(([$, , E]) => [$, E]), !0],
1157
- [u.filter(([, $]) => !$).map(([$, , E]) => [$, E]), !1]
1158
- ].map(([$, E]) => [
1159
- ...g(!1, E, $.filter(([S]) => S.some((m) => m[0] === ce))),
1160
- ...g(!0, E, $.filter(([S]) => S.every((m) => m[0] !== ce)))
1161
- ]);
1162
- }).flat(2).filter(Boolean));
1163
- }
1164
- isBlocked(t) {
1165
- return !t || this.config.blocklist.some((r) => typeof r == "function" ? r(t) : T(r) ? r === t : r.test(t));
1166
- }
1167
- }
1168
- function ar(e, t) {
1169
- return new cr(e, t);
1170
- }
1171
- const Re = /\s\$\$\s+/g;
1172
- function lr(e) {
1173
- return Re.test(e);
1174
- }
1175
- function fr(e, t) {
1176
- return lr(e) ? e.replace(Re, t ? ` ${t} ` : " ") : t ? `${t} ${e}` : e;
1177
- }
1178
- const he = /^\[(.+?)(~?=)"(.*)"\]$/;
1179
- function ur(e) {
1180
- return he.test(e) ? e.replace(he, (t, r, n, s) => `[${J(r)}${n}"${J(s)}"]`) : `.${J(e)}`;
1181
- }
1182
- function hr(e, t) {
1183
- return t(e);
1184
- }
1185
- const pr = Object.freeze(
1186
- {
1187
- left: 0,
1188
- top: 0,
1189
- width: 16,
1190
- height: 16
1191
- }
1192
- ), G = Object.freeze({
1193
- rotate: 0,
1194
- vFlip: !1,
1195
- hFlip: !1
1196
- }), je = Object.freeze({
1197
- ...pr,
1198
- ...G
1199
- }), dr = Object.freeze({
1200
- ...je,
1201
- body: "",
1202
- hidden: !1
1203
- }), mr = Object.freeze({
1204
- width: null,
1205
- height: null
1206
- }), Te = Object.freeze({
1207
- // Dimensions
1208
- ...mr,
1209
- // Transformations
1210
- ...G
1211
- });
1212
- function gr(e, t) {
1213
- const r = {};
1214
- !e.hFlip != !t.hFlip && (r.hFlip = !0), !e.vFlip != !t.vFlip && (r.vFlip = !0);
1215
- const n = ((e.rotate || 0) + (t.rotate || 0)) % 4;
1216
- return n && (r.rotate = n), r;
1217
- }
1218
- function pe(e, t) {
1219
- const r = gr(e, t);
1220
- for (const n in dr)
1221
- n in G ? n in e && !(n in r) && (r[n] = G[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
1222
- return r;
1223
- }
1224
- function yr(e, t) {
1225
- const r = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null);
1226
- function o(c) {
1227
- if (r[c])
1228
- return s[c] = [];
1229
- if (!(c in s)) {
1230
- s[c] = null;
1231
- const l = n[c] && n[c].parent, a = l && o(l);
1232
- a && (s[c] = [l].concat(a));
1233
- }
1234
- return s[c];
1235
- }
1236
- return (t || Object.keys(r).concat(Object.keys(n))).forEach(o), s;
1237
- }
1238
- function de(e, t, r) {
1239
- const n = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null);
1240
- let o = {};
1241
- function c(l) {
1242
- o = pe(
1243
- n[l] || s[l],
1244
- o
1245
- );
1246
- }
1247
- return c(t), r.forEach(c), pe(e, o);
1248
- }
1249
- function wr(e, t) {
1250
- if (e.icons[t])
1251
- return de(e, t, []);
1252
- const r = yr(e, [t])[t];
1253
- return r ? de(e, t, r) : null;
1254
- }
1255
- const br = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Sr = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
1256
- function me(e, t, r) {
1257
- if (t === 1)
1258
- return e;
1259
- if (r = r || 100, typeof e == "number")
1260
- return Math.ceil(e * t * r) / r;
1261
- if (typeof e != "string")
1262
- return e;
1263
- const n = e.split(br);
1264
- if (n === null || !n.length)
1265
- return e;
1266
- const s = [];
1267
- let o = n.shift(), c = Sr.test(o);
1268
- for (; ; ) {
1269
- if (c) {
1270
- const l = parseFloat(o);
1271
- isNaN(l) ? s.push(o) : s.push(Math.ceil(l * t * r) / r);
1272
- } else
1273
- s.push(o);
1274
- if (o = n.shift(), o === void 0)
1275
- return s.join("");
1276
- c = !c;
1277
- }
1278
- }
1279
- function _r(e, t = "defs") {
1280
- let r = "";
1281
- const n = e.indexOf("<" + t);
1282
- for (; n >= 0; ) {
1283
- const s = e.indexOf(">", n), o = e.indexOf("</" + t);
1284
- if (s === -1 || o === -1)
1285
- break;
1286
- const c = e.indexOf(">", o);
1287
- if (c === -1)
1288
- break;
1289
- r += e.slice(s + 1, o).trim(), e = e.slice(0, n).trim() + e.slice(c + 1);
1290
- }
1291
- return {
1292
- defs: r,
1293
- content: e
1294
- };
1295
- }
1296
- function $r(e, t) {
1297
- return e ? "<defs>" + e + "</defs>" + t : t;
1298
- }
1299
- function Er(e, t, r) {
1300
- const n = _r(e);
1301
- return $r(n.defs, t + n.content + r);
1302
- }
1303
- const se = (e) => e === "unset" || e === "undefined" || e === "none";
1304
- function vr(e, t) {
1305
- const r = {
1306
- ...je,
1307
- ...e
1308
- }, n = {
1309
- ...Te,
1310
- ...t
1311
- }, s = {
1312
- left: r.left,
1313
- top: r.top,
1314
- width: r.width,
1315
- height: r.height
1316
- };
1317
- let o = r.body;
1318
- [r, n].forEach((g) => {
1319
- const y = [], $ = g.hFlip, E = g.vFlip;
1320
- let S = g.rotate;
1321
- $ ? E ? S += 2 : (y.push(
1322
- "translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"
1323
- ), y.push("scale(-1 1)"), s.top = s.left = 0) : E && (y.push(
1324
- "translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"
1325
- ), y.push("scale(1 -1)"), s.top = s.left = 0);
1326
- let m;
1327
- switch (S < 0 && (S -= Math.floor(S / 4) * 4), S = S % 4, S) {
1328
- case 1:
1329
- m = s.height / 2 + s.top, y.unshift(
1330
- "rotate(90 " + m.toString() + " " + m.toString() + ")"
1331
- );
1332
- break;
1333
- case 2:
1334
- y.unshift(
1335
- "rotate(180 " + (s.width / 2 + s.left).toString() + " " + (s.height / 2 + s.top).toString() + ")"
1336
- );
1337
- break;
1338
- case 3:
1339
- m = s.width / 2 + s.left, y.unshift(
1340
- "rotate(-90 " + m.toString() + " " + m.toString() + ")"
1341
- );
1342
- break;
1343
- }
1344
- S % 2 === 1 && (s.left !== s.top && (m = s.left, s.left = s.top, s.top = m), s.width !== s.height && (m = s.width, s.width = s.height, s.height = m)), y.length && (o = Er(
1345
- o,
1346
- '<g transform="' + y.join(" ") + '">',
1347
- "</g>"
1348
- ));
1349
- });
1350
- const c = n.width, l = n.height, a = s.width, f = s.height;
1351
- let i, u;
1352
- c === null ? (u = l === null ? "1em" : l === "auto" ? f : l, i = me(u, a / f)) : (i = c === "auto" ? a : c, u = l === null ? me(i, f / a) : l === "auto" ? f : l);
1353
- const p = {}, d = (g, y) => {
1354
- se(y) || (p[g] = y.toString());
1355
- };
1356
- d("width", i), d("height", u);
1357
- const w = [s.left, s.top, a, f];
1358
- return p.viewBox = w.join(" "), {
1359
- attributes: p,
1360
- viewBox: w,
1361
- body: o
1362
- };
1363
- }
1364
- function Ar(e) {
1365
- return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1366
- }
1367
- function xr(e) {
1368
- let t = e.startsWith("<svg>") ? e.replace("<svg>", "<svg >") : e;
1369
- return !t.includes(" xmlns:xlink=") && t.includes(" xlink:") && (t = t.replace(
1370
- "<svg ",
1371
- '<svg xmlns:xlink="http://www.w3.org/1999/xlink" '
1372
- )), t.includes(" xmlns=") || (t = t.replace(
1373
- "<svg ",
1374
- '<svg xmlns="http://www.w3.org/2000/svg" '
1375
- )), Ar(t);
1376
- }
1377
- function Cr(e) {
1378
- return e.replace(/(['"])\s*\n\s*([^>\\/\s])/g, "$1 $2").replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
1379
- }
1380
- const Or = /\swidth\s*=\s*["'](\w+)["']/, Rr = /\sheight\s*=\s*["'](\w+)["']/, Y = /<svg\s+/;
1381
- function jr(e, t, r) {
1382
- const n = e.slice(0, e.indexOf(">")), s = (o, c) => {
1383
- const l = c.exec(n), a = l != null, f = t[o];
1384
- return !f && !se(f) && (typeof r == "number" ? r > 0 && (t[o] = `${r}em`) : l && (t[o] = l[1])), a;
1385
- };
1386
- return [s("width", Or), s("height", Rr)];
1387
- }
1388
- async function Me(e, t, r, n, s, o) {
1389
- const { scale: c, addXmlNs: l = !1 } = n ?? {}, { additionalProps: a = {}, iconCustomizer: f } = (n == null ? void 0 : n.customizations) ?? {}, i = await (s == null ? void 0 : s()) ?? {};
1390
- await (f == null ? void 0 : f(t, r, i)), Object.keys(a).forEach((g) => {
1391
- const y = a[g];
1392
- y != null && (i[g] = y);
1393
- }), o == null || o(i);
1394
- const [u, p] = jr(e, i, c);
1395
- l && (!e.includes("xmlns=") && !i.xmlns && (i.xmlns = "http://www.w3.org/2000/svg"), !e.includes("xmlns:xlink=") && e.includes("xlink:") && !i["xmlns:xlink"] && (i["xmlns:xlink"] = "http://www.w3.org/1999/xlink"));
1396
- const d = Object.keys(i).map(
1397
- (g) => g === "width" && u || g === "height" && p ? null : `${g}="${i[g]}"`
1398
- ).filter((g) => g != null);
1399
- if (d.length && (e = e.replace(Y, `<svg ${d.join(" ")} `)), n) {
1400
- const { defaultStyle: g, defaultClass: y } = n;
1401
- y && !e.includes("class=") && (e = e.replace(Y, `<svg class="${y}" `)), g && !e.includes("style=") && (e = e.replace(Y, `<svg style="${g}" `));
1402
- }
1403
- const w = n == null ? void 0 : n.usedProps;
1404
- return w && (Object.keys(a).forEach((g) => {
1405
- const y = i[g];
1406
- y != null && (w[g] = y);
1407
- }), typeof i.width < "u" && i.width !== null && (w.width = i.width), typeof i.height < "u" && i.height !== null && (w.height = i.height)), e;
1408
- }
1409
- async function ge(e, t, r, n) {
1410
- var o;
1411
- let s;
1412
- try {
1413
- if (typeof e == "function")
1414
- s = await e(r);
1415
- else {
1416
- const c = e[r];
1417
- s = typeof c == "function" ? await c() : c;
1418
- }
1419
- } catch (c) {
1420
- console.warn(
1421
- `Failed to load custom icon "${r}" in "${t}":`,
1422
- c
1423
- );
1424
- return;
1425
- }
1426
- if (s) {
1427
- const c = s.indexOf("<svg");
1428
- c > 0 && (s = s.slice(c));
1429
- const { transform: l } = (n == null ? void 0 : n.customizations) ?? {};
1430
- return s = typeof l == "function" ? await l(s, t, r) : s, s.startsWith("<svg") ? await Me(
1431
- ((o = n == null ? void 0 : n.customizations) == null ? void 0 : o.trimCustomSvg) === !0 ? Cr(s) : s,
1432
- t,
1433
- r,
1434
- n,
1435
- void 0
1436
- ) : (console.warn(
1437
- `Custom icon "${r}" in "${t}" is not a valid SVG`
1438
- ), s);
1439
- }
1440
- }
1441
- async function Pe(e, t, r, n) {
1442
- let s;
1443
- const { customize: o } = (n == null ? void 0 : n.customizations) ?? {};
1444
- for (const c of r)
1445
- if (s = wr(e, c), s) {
1446
- let l = { ...Te };
1447
- typeof o == "function" && (l = o(l));
1448
- const {
1449
- attributes: { width: a, height: f, ...i },
1450
- body: u
1451
- } = vr(s, l), p = n == null ? void 0 : n.scale;
1452
- return await Me(
1453
- // DON'T remove space on <svg >
1454
- `<svg >${u}</svg>`,
1455
- t,
1456
- c,
1457
- n,
1458
- () => ({ ...i }),
1459
- (d) => {
1460
- const w = (g, y) => {
1461
- const $ = d[g];
1462
- let E;
1463
- if (!se($)) {
1464
- if ($)
1465
- return;
1466
- typeof p == "number" ? p && (E = `${p}em`) : E = y;
1467
- }
1468
- E ? d[g] = E : delete d[g];
1469
- };
1470
- w("width", a), w("height", f);
1471
- }
1472
- );
1473
- }
1474
- }
1475
- const Le = async (e, t, r) => {
1476
- var s;
1477
- const n = (s = r == null ? void 0 : r.customCollections) == null ? void 0 : s[e];
1478
- if (n)
1479
- if (typeof n == "function") {
1480
- let o;
1481
- try {
1482
- o = await n(t);
1483
- } catch (c) {
1484
- console.warn(
1485
- `Failed to load custom icon "${t}" in "${e}":`,
1486
- c
1487
- );
1488
- return;
1489
- }
1490
- if (o) {
1491
- if (typeof o == "string")
1492
- return await ge(
1493
- () => o,
1494
- e,
1495
- t,
1496
- r
1497
- );
1498
- if ("icons" in o) {
1499
- const c = [
1500
- t,
1501
- t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(),
1502
- t.replace(/([a-z])(\d+)/g, "$1-$2")
1503
- ];
1504
- return await Pe(
1505
- o,
1506
- e,
1507
- c,
1508
- r
1509
- );
1510
- }
1511
- }
1512
- } else
1513
- return await ge(n, e, t, r);
1514
- };
1515
- function Tr(e) {
1516
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1517
- }
1518
- var Mr = [
1519
- "academicons",
1520
- "akar-icons",
1521
- "ant-design",
1522
- "arcticons",
1523
- "basil",
1524
- "bi",
1525
- "bpmn",
1526
- "brandico",
1527
- "bx",
1528
- "bxl",
1529
- "bxs",
1530
- "bytesize",
1531
- "carbon",
1532
- "charm",
1533
- "ci",
1534
- "cib",
1535
- "cif",
1536
- "cil",
1537
- "circle-flags",
1538
- "circum",
1539
- "clarity",
1540
- "codicon",
1541
- "covid",
1542
- "cryptocurrency-color",
1543
- "cryptocurrency",
1544
- "dashicons",
1545
- "devicon-line",
1546
- "devicon-original",
1547
- "devicon-plain",
1548
- "devicon",
1549
- "ei",
1550
- "el",
1551
- "emblemicons",
1552
- "emojione-monotone",
1553
- "emojione-v1",
1554
- "emojione",
1555
- "entypo-social",
1556
- "entypo",
1557
- "eos-icons",
1558
- "ep",
1559
- "et",
1560
- "eva",
1561
- "fa-brands",
1562
- "fa-regular",
1563
- "fa-solid",
1564
- "fa",
1565
- "fa6-brands",
1566
- "fa6-regular",
1567
- "fa6-solid",
1568
- "fad",
1569
- "fe",
1570
- "feather",
1571
- "file-icons",
1572
- "flag",
1573
- "flagpack",
1574
- "flat-color-icons",
1575
- "flat-ui",
1576
- "fluent-emoji-flat",
1577
- "fluent-emoji-high-contrast",
1578
- "fluent-emoji",
1579
- "fluent-mdl2",
1580
- "fluent",
1581
- "fontelico",
1582
- "fontisto",
1583
- "formkit",
1584
- "foundation",
1585
- "fxemoji",
1586
- "gala",
1587
- "game-icons",
1588
- "geo",
1589
- "gg",
1590
- "gis",
1591
- "gravity-ui",
1592
- "gridicons",
1593
- "grommet-icons",
1594
- "guidance",
1595
- "healthicons",
1596
- "heroicons-outline",
1597
- "heroicons-solid",
1598
- "heroicons",
1599
- "humbleicons",
1600
- "ic",
1601
- "icomoon-free",
1602
- "icon-park-outline",
1603
- "icon-park-solid",
1604
- "icon-park-twotone",
1605
- "icon-park",
1606
- "iconamoon",
1607
- "iconoir",
1608
- "icons8",
1609
- "il",
1610
- "ion",
1611
- "iwwa",
1612
- "jam",
1613
- "la",
1614
- "lets-icons",
1615
- "line-md",
1616
- "logos",
1617
- "ls",
1618
- "lucide",
1619
- "majesticons",
1620
- "maki",
1621
- "map",
1622
- "material-symbols-light",
1623
- "material-symbols",
1624
- "mdi-light",
1625
- "mdi",
1626
- "medical-icon",
1627
- "memory",
1628
- "meteocons",
1629
- "mi",
1630
- "mingcute",
1631
- "mono-icons",
1632
- "mynaui",
1633
- "nimbus",
1634
- "nonicons",
1635
- "noto-v1",
1636
- "noto",
1637
- "octicon",
1638
- "oi",
1639
- "ooui",
1640
- "openmoji",
1641
- "pajamas",
1642
- "pepicons-pencil",
1643
- "pepicons-pop",
1644
- "pepicons-print",
1645
- "pepicons",
1646
- "ph",
1647
- "pixelarticons",
1648
- "prime",
1649
- "ps",
1650
- "quill",
1651
- "radix-icons",
1652
- "raphael",
1653
- "ri",
1654
- "si-glyph",
1655
- "simple-icons",
1656
- "simple-line-icons",
1657
- "skill-icons",
1658
- "solar",
1659
- "streamline-emojis",
1660
- "streamline",
1661
- "subway",
1662
- "svg-spinners",
1663
- "system-uicons",
1664
- "tabler",
1665
- "tdesign",
1666
- "teenyicons",
1667
- "topcoat",
1668
- "twemoji",
1669
- "typcn",
1670
- "uil",
1671
- "uim",
1672
- "uis",
1673
- "uit",
1674
- "uiw",
1675
- "vaadin",
1676
- "vs",
1677
- "vscode-icons",
1678
- "websymbol",
1679
- "whh",
1680
- "wi",
1681
- "wpf",
1682
- "zmdi",
1683
- "zondicons"
1684
- ];
1685
- const Pr = /* @__PURE__ */ Tr(Mr), Lr = 3;
1686
- function kr(e) {
1687
- return (t = {}) => {
1688
- const {
1689
- scale: r = 1,
1690
- mode: n = "auto",
1691
- prefix: s = "i-",
1692
- warn: o = !1,
1693
- collections: c,
1694
- extraProperties: l = {},
1695
- customizations: a = {},
1696
- autoInstall: f = !1,
1697
- layer: i = "icons",
1698
- unit: u
1699
- } = t, p = {
1700
- addXmlNs: !0,
1701
- scale: r,
1702
- customCollections: c,
1703
- autoInstall: f,
1704
- // avoid warn from @iconify/loader: we'll warn below if not found
1705
- warn: void 0,
1706
- customizations: {
1707
- ...a,
1708
- additionalProps: { ...l },
1709
- trimCustomSvg: !0,
1710
- async iconCustomizer(w, g, y) {
1711
- var $;
1712
- await (($ = a.iconCustomizer) == null ? void 0 : $.call(a, w, g, y)), u && (y.width || (y.width = `${r}${u}`), y.height || (y.height = `${r}${u}`));
1713
- }
1714
- }
1715
- };
1716
- let d;
1717
- return {
1718
- name: "@unocss/preset-icons",
1719
- enforce: "pre",
1720
- options: t,
1721
- layers: { icons: -30 },
1722
- rules: [[
1723
- /^([a-z0-9:_-]+)(?:\?(mask|bg|auto))?$/,
1724
- async ([w, g, y = n]) => {
1725
- let $ = "", E = "", S;
1726
- d = d || await e(t);
1727
- const m = {};
1728
- if (g.includes(":"))
1729
- [$, E] = g.split(":"), S = await d($, E, { ...p, usedProps: m });
1730
- else {
1731
- const h = g.split(/-/g);
1732
- for (let _ = Lr; _ >= 1 && ($ = h.slice(0, _).join("-"), E = h.slice(_).join("-"), S = await d($, E, { ...p, usedProps: m }), !S); _--)
1733
- ;
1734
- }
1735
- if (!S) {
1736
- o && xe(`failed to load icon "${w}"`);
1737
- return;
1738
- }
1739
- const A = `url("data:image/svg+xml;utf8,${xr(S)}")`;
1740
- return y === "auto" && (y = S.includes("currentColor") ? "mask" : "bg"), y === "mask" ? {
1741
- "--un-icon": A,
1742
- "-webkit-mask": "var(--un-icon) no-repeat",
1743
- mask: "var(--un-icon) no-repeat",
1744
- "-webkit-mask-size": "100% 100%",
1745
- "mask-size": "100% 100%",
1746
- "background-color": "currentColor",
1747
- // for Safari https://github.com/elk-zone/elk/pull/264
1748
- color: "inherit",
1749
- ...m
1750
- } : {
1751
- background: `${A} no-repeat`,
1752
- "background-size": "100% 100%",
1753
- "background-color": "transparent",
1754
- ...m
1755
- };
1756
- },
1757
- { layer: i, prefix: s }
1758
- ]]
1759
- };
1760
- };
1761
- }
1762
- function ke(e, t) {
1763
- const r = /* @__PURE__ */ new Map();
1764
- function n(s) {
1765
- if (Pr.includes(s))
1766
- return r.has(s) || r.set(s, e(`${t}@iconify-json/${s}/icons.json`)), r.get(s);
1767
- }
1768
- return async (s, o, c) => {
1769
- let l = await Le(s, o, c);
1770
- if (l)
1771
- return l;
1772
- const a = await n(s);
1773
- if (a) {
1774
- const f = [
1775
- o,
1776
- o.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(),
1777
- o.replace(/([a-z])(\d+)/g, "$1-$2")
1778
- ];
1779
- l = await Pe(a, s, f, c);
1780
- }
1781
- return l;
1782
- };
1783
- }
1784
- function Ir(e) {
1785
- return ke(Ot, e);
1786
- }
1787
- const Nr = kr(async (e) => {
1788
- const t = e == null ? void 0 : e.customFetch, r = e == null ? void 0 : e.cdn;
1789
- return t && r ? ke(t, r) : r ? Ir(r) : Le;
1790
- });
1791
- function Fr(e) {
1792
- return e.replace(/-(\w)/g, (t, r) => r ? r.toUpperCase() : "");
1793
- }
1794
- function ye(e) {
1795
- return e.charAt(0).toUpperCase() + e.slice(1);
1796
- }
1797
- function we(e) {
1798
- return e.replace(/(?:^|\B)([A-Z])/g, "-$1").toLowerCase();
1799
- }
1800
- var be = ["Webkit", "Moz", "ms"];
1801
- function Dr(e) {
1802
- const t = {};
1803
- function r(n) {
1804
- const s = t[n];
1805
- if (s)
1806
- return s;
1807
- let o = Fr(n);
1808
- if (o !== "filter" && o in e)
1809
- return t[n] = we(o);
1810
- o = ye(o);
1811
- for (let c = 0; c < be.length; c++) {
1812
- const l = `${be[c]}${o}`;
1813
- if (l in e)
1814
- return t[n] = we(ye(l));
1815
- }
1816
- return n;
1817
- }
1818
- return ({ entries: n }) => n.forEach((s) => {
1819
- s[0].startsWith("--") || (s[0] = r(s[0]));
1820
- });
1821
- }
1822
- function Ur(e) {
1823
- return e.replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<");
1824
- }
1825
- function zr(e = {}) {
1826
- var O, j, P;
1827
- if (typeof window > "u") {
1828
- console.warn("@unocss/runtime been used in non-browser environment, skipped.");
1829
- return;
1830
- }
1831
- const t = window, r = window.document, n = () => r.documentElement, s = t.__unocss || {}, o = Object.assign({}, e, s.runtime), c = o.defaults || {}, l = o.cloakAttribute ?? "un-cloak";
1832
- o.autoPrefix && (c.postprocess = k(c.postprocess)).unshift(Dr(r.createElement("div").style)), (O = o.configResolved) == null || O.call(o, s, c);
1833
- const a = ar(s, c), f = (b) => o.inject ? o.inject(b) : n().prepend(b), i = () => o.rootElement ? o.rootElement() : r.body, u = /* @__PURE__ */ new Map();
1834
- let p = !0, d = /* @__PURE__ */ new Set(), w, g, y = [];
1835
- const $ = () => new Promise((b) => {
1836
- y.push(b), g != null && clearTimeout(g), g = setTimeout(() => m().then(() => {
1837
- const x = y;
1838
- y = [], x.forEach((v) => v());
1839
- }), 0);
1840
- });
1841
- function E(b) {
1842
- if (b.nodeType !== 1)
1843
- return;
1844
- const x = b;
1845
- x.hasAttribute(l) && x.removeAttribute(l), x.querySelectorAll(`[${l}]`).forEach((v) => {
1846
- v.removeAttribute(l);
1847
- });
1848
- }
1849
- function S(b, x) {
1850
- let v = u.get(b);
1851
- if (!v)
1852
- if (v = r.createElement("style"), v.setAttribute("data-unocss-runtime-layer", b), u.set(b, v), x == null)
1853
- f(v);
1854
- else {
1855
- const C = S(x), L = C.parentNode;
1856
- L ? L.insertBefore(v, C.nextSibling) : f(v);
1857
- }
1858
- return v;
1859
- }
1860
- async function m() {
1861
- const b = await a.generate(d);
1862
- return b.layers.reduce((x, v) => (S(v, x).innerHTML = b.getLayer(v) ?? "", v), void 0), d = b.matched, {
1863
- ...b,
1864
- getStyleElement: (x) => u.get(x),
1865
- getStyleElements: () => u
1866
- };
1867
- }
1868
- async function A(b) {
1869
- const x = d.size;
1870
- await a.applyExtractors(b, void 0, d), x !== d.size && await $();
1871
- }
1872
- async function h(b = i()) {
1873
- const x = b && b.outerHTML;
1874
- x && (await A(`${x} ${Ur(x)}`), E(n()), E(b));
1875
- }
1876
- const _ = new MutationObserver((b) => {
1877
- p || b.forEach(async (x) => {
1878
- if (x.target.nodeType !== 1)
1879
- return;
1880
- const v = x.target;
1881
- for (const C of u)
1882
- if (v === C[1])
1883
- return;
1884
- if (x.type === "childList")
1885
- x.addedNodes.forEach(async (C) => {
1886
- if (C.nodeType !== 1)
1887
- return;
1888
- const L = C;
1889
- w && !w(L) || (await A(L.outerHTML), E(L));
1890
- });
1891
- else {
1892
- if (w && !w(v))
1893
- return;
1894
- if (x.attributeName !== l) {
1895
- const C = Array.from(v.attributes).map((N) => N.value ? `${N.name}="${N.value}"` : N.name).join(" "), L = `<${v.tagName.toLowerCase()} ${C}>`;
1896
- await A(L);
1897
- }
1898
- v.hasAttribute(l) && v.removeAttribute(l);
1899
- }
1900
- });
1901
- });
1902
- let R = !1;
1903
- function M() {
1904
- var x, v;
1905
- if (R)
1906
- return;
1907
- const b = (x = o.observer) != null && x.target ? o.observer.target() : i();
1908
- b && (_.observe(b, {
1909
- childList: !0,
1910
- subtree: !0,
1911
- attributes: !0,
1912
- attributeFilter: (v = o.observer) == null ? void 0 : v.attributeFilter
1913
- }), R = !0);
1914
- }
1915
- function I() {
1916
- o.bypassDefined && Vr(a.blocked), h(), M();
1917
- }
1918
- function D() {
1919
- r.readyState === "loading" ? t.addEventListener("DOMContentLoaded", I) : I();
1920
- }
1921
- const z = t.__unocss_runtime = t.__unocss_runtime = {
1922
- version: a.version,
1923
- uno: a,
1924
- async extract(b) {
1925
- T(b) || (b.forEach((x) => d.add(x)), b = ""), await A(b);
1926
- },
1927
- extractAll: h,
1928
- inspect(b) {
1929
- w = b;
1930
- },
1931
- toggleObserver(b) {
1932
- b === void 0 ? p = !p : p = !!b, !R && !p && D();
1933
- },
1934
- update: m,
1935
- presets: ((j = t.__unocss_runtime) == null ? void 0 : j.presets) ?? {}
1936
- };
1937
- ((P = o.ready) == null ? void 0 : P.call(o, z)) !== !1 && (p = !1, D());
1938
- }
1939
- function Vr(e = /* @__PURE__ */ new Set()) {
1940
- for (let t = 0; t < document.styleSheets.length; t++) {
1941
- const r = document.styleSheets[t];
1942
- let n;
1943
- try {
1944
- if (n = r.cssRules || r.rules, !n)
1945
- continue;
1946
- Array.from(n).flatMap((s) => {
1947
- var o;
1948
- return ((o = s.selectorText) == null ? void 0 : o.split(/,/g)) || [];
1949
- }).forEach((s) => {
1950
- s && (s = s.trim(), s.startsWith(".") && (s = s.slice(1)), e.add(s));
1951
- });
1952
- } catch {
1953
- continue;
1954
- }
1955
- }
1956
- return e;
1957
- }
1958
- zr({
1959
- defaults: {
1960
- presets: [
1961
- Nr({
1962
- prefix: ["i-", ""],
1963
- collections: {},
1964
- cdn: "https://esm.sh/",
1965
- scale: 1.2,
1966
- extraProperties: {
1967
- display: "inline-block",
1968
- "vertical-align": "middle"
1969
- }
1970
- })
1971
- ]
1972
- },
1973
- bypassDefined: !0
1974
- });