@fest-lib/dom 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -0
  3. package/dist/dom.js +1703 -0
  4. package/package.json +68 -0
package/dist/dom.js ADDED
@@ -0,0 +1,1703 @@
1
+ var Me = /* @__PURE__ */ new Set();
2
+ [
3
+ {
4
+ name: "--screen-width",
5
+ syntax: "<length-percentage>",
6
+ inherits: !0,
7
+ initialValue: "0px"
8
+ },
9
+ {
10
+ name: "--screen-height",
11
+ syntax: "<length-percentage>",
12
+ inherits: !0,
13
+ initialValue: "0px"
14
+ },
15
+ {
16
+ name: "--visual-width",
17
+ syntax: "<length-percentage>",
18
+ inherits: !0,
19
+ initialValue: "0px"
20
+ },
21
+ {
22
+ name: "--visual-height",
23
+ syntax: "<length-percentage>",
24
+ inherits: !0,
25
+ initialValue: "0px"
26
+ },
27
+ {
28
+ name: "--clip-ampl",
29
+ syntax: "<number>",
30
+ inherits: !0,
31
+ initialValue: "0"
32
+ },
33
+ {
34
+ name: "--clip-freq",
35
+ syntax: "<number>",
36
+ inherits: !0,
37
+ initialValue: "0"
38
+ },
39
+ {
40
+ name: "--avail-width",
41
+ syntax: "<length-percentage>",
42
+ inherits: !0,
43
+ initialValue: "0px"
44
+ },
45
+ {
46
+ name: "--avail-height",
47
+ syntax: "<length-percentage>",
48
+ inherits: !0,
49
+ initialValue: "0px"
50
+ },
51
+ {
52
+ name: "--pixel-ratio",
53
+ syntax: "<number>",
54
+ inherits: !0,
55
+ initialValue: "1"
56
+ },
57
+ {
58
+ name: "--percent",
59
+ syntax: "<number>",
60
+ inherits: !0,
61
+ initialValue: "0"
62
+ },
63
+ {
64
+ name: "--percent-x",
65
+ syntax: "<number>",
66
+ inherits: !0,
67
+ initialValue: "0"
68
+ },
69
+ {
70
+ name: "--percent-y",
71
+ syntax: "<number>",
72
+ inherits: !0,
73
+ initialValue: "0"
74
+ },
75
+ {
76
+ name: "--scroll-left",
77
+ syntax: "<number>",
78
+ inherits: !0,
79
+ initialValue: "0"
80
+ },
81
+ {
82
+ name: "--scroll-top",
83
+ syntax: "<number>",
84
+ inherits: !0,
85
+ initialValue: "0"
86
+ },
87
+ {
88
+ name: "--drag-x",
89
+ syntax: "<length>",
90
+ inherits: !1,
91
+ initialValue: "0px"
92
+ },
93
+ {
94
+ name: "--drag-y",
95
+ syntax: "<length>",
96
+ inherits: !1,
97
+ initialValue: "0px"
98
+ },
99
+ {
100
+ name: "--grid-r",
101
+ syntax: "<number>",
102
+ inherits: !1,
103
+ initialValue: "0"
104
+ },
105
+ {
106
+ name: "--grid-c",
107
+ syntax: "<number>",
108
+ inherits: !1,
109
+ initialValue: "0"
110
+ },
111
+ {
112
+ name: "--resize-x",
113
+ syntax: "<length>",
114
+ inherits: !1,
115
+ initialValue: "0px"
116
+ },
117
+ {
118
+ name: "--resize-y",
119
+ syntax: "<length>",
120
+ inherits: !1,
121
+ initialValue: "0px"
122
+ },
123
+ {
124
+ name: "--shift-x",
125
+ syntax: "<length>",
126
+ inherits: !1,
127
+ initialValue: "0px"
128
+ },
129
+ {
130
+ name: "--shift-y",
131
+ syntax: "<length>",
132
+ inherits: !1,
133
+ initialValue: "0px"
134
+ },
135
+ {
136
+ name: "--cs-grid-r",
137
+ syntax: "<number>",
138
+ inherits: !1,
139
+ initialValue: "0"
140
+ },
141
+ {
142
+ name: "--cs-grid-c",
143
+ syntax: "<number>",
144
+ inherits: !1,
145
+ initialValue: "0"
146
+ },
147
+ {
148
+ name: "--cs-p-grid-r",
149
+ syntax: "<number>",
150
+ inherits: !1,
151
+ initialValue: "0"
152
+ },
153
+ {
154
+ name: "--cs-p-grid-c",
155
+ syntax: "<number>",
156
+ inherits: !1,
157
+ initialValue: "0"
158
+ },
159
+ {
160
+ name: "--os-grid-r",
161
+ syntax: "<number>",
162
+ inherits: !1,
163
+ initialValue: "0"
164
+ },
165
+ {
166
+ name: "--os-grid-c",
167
+ syntax: "<number>",
168
+ inherits: !1,
169
+ initialValue: "0"
170
+ },
171
+ {
172
+ name: "--rv-grid-r",
173
+ syntax: "<number>",
174
+ inherits: !1,
175
+ initialValue: "0"
176
+ },
177
+ {
178
+ name: "--rv-grid-c",
179
+ syntax: "<number>",
180
+ inherits: !1,
181
+ initialValue: "0"
182
+ },
183
+ {
184
+ name: "--cell-x",
185
+ syntax: "<integer>",
186
+ inherits: !1,
187
+ initialValue: "0"
188
+ },
189
+ {
190
+ name: "--cell-y",
191
+ syntax: "<integer>",
192
+ inherits: !1,
193
+ initialValue: "0"
194
+ }
195
+ ].forEach((e) => {
196
+ if (typeof CSS > "u" || typeof CSS?.registerProperty != "function") return;
197
+ const t = String(e?.name || "").trim();
198
+ if (!(!t || Me.has(t)))
199
+ try {
200
+ CSS.registerProperty(e);
201
+ } catch (n) {
202
+ String(n?.name || "").toLowerCase() !== "invalidmodificationerror" && console.warn(n);
203
+ } finally {
204
+ Me.add(t);
205
+ }
206
+ });
207
+ var Gt = () => {
208
+ }, Je = () => {
209
+ let e = navigator?.userAgentData?.mobile || !1;
210
+ return ((t) => {
211
+ (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) && (e = !0);
212
+ })(navigator.userAgent || navigator.vendor || globalThis.opera), e;
213
+ }, Jt = () => [
214
+ /Android/i,
215
+ /webOS/i,
216
+ /iPhone/i,
217
+ /iPad/i,
218
+ /iPod/i,
219
+ /BlackBerry/i,
220
+ /Windows Phone/i
221
+ ].some(navigator.userAgent.match.bind(navigator.userAgent)) && (navigator.maxTouchPoints || "ontouchstart" in document.documentElement) && globalThis.matchMedia("(pointer: coarse)").matches, de = (e, t = "value") => (typeof e == "object" || typeof e == "function") && e != null && (t in e || e?.[t] != null), M = (e) => de(e, "value"), te = (e) => e && e?.replace?.(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), Fe = (e) => e && e?.replace?.(/-([a-z])/g, (t, n) => n.toUpperCase()), Ke = (e) => typeof CSSStyleValue < "u" && e instanceof CSSStyleValue, Qe = (e) => e != null && (typeof e == "boolean" ? e !== !1 : !0) && typeof e != "object" && typeof e != "function", ge = (e) => typeof e == "boolean" ? e ? "" : null : typeof e == "number" ? String(e) : e, Ee = /* @__PURE__ */ Symbol.for("@trigger-lock"), B = (e, t, n = "value") => {
222
+ de(e, n) && (e[Ee] = !0);
223
+ let r;
224
+ try {
225
+ r = t?.();
226
+ } finally {
227
+ de(e, n) && delete e[Ee];
228
+ }
229
+ return r;
230
+ }, Ie = (e) => {
231
+ if (typeof e != "string") return null;
232
+ const t = [...e?.matchAll?.(/^\d+(\.\d+)?$/g)];
233
+ if (t?.length != 1) return null;
234
+ const n = parseFloat(t[0][0]);
235
+ return !Number.isNaN(n) && Number.isFinite(n) ? n : null;
236
+ }, et = (e) => Array.isArray(e) || e != null && typeof e == "object" && typeof e[Symbol.iterator] == "function", le = (e, t, n = 0) => {
237
+ const r = [...t], i = [...e];
238
+ return n % 2 && (i.reverse(), r.reverse()), [(n == 0 || n == 3 ? i[0] : r[0] - i[0]) || 0, (n == 0 || n == 1 ? i[1] : r[1] - i[1]) || 0];
239
+ }, H = (e, t = [4, 8]) => {
240
+ if (Array.isArray(e) && e.length >= 2) return [Math.max(1, Math.floor(Number(e[0]) || t[0])), Math.max(1, Math.floor(Number(e[1]) || t[1]))];
241
+ if (e && typeof e == "object") {
242
+ const n = e;
243
+ return [Math.max(1, Math.floor(Number(n.columns) || t[0])), Math.max(1, Math.floor(Number(n.rows) || t[1]))];
244
+ }
245
+ return [t[0], t[1]];
246
+ }, tt = (e, t) => {
247
+ const [n, r] = H(t);
248
+ return [Math.max(0, Math.min(n - 1, Math.floor(Number(e[0]) || 0))), Math.max(0, Math.min(r - 1, Math.floor(Number(e[1]) || 0)))];
249
+ }, nt = (e, t, n, r, i) => {
250
+ const s = H(n), a = Math.max(1, t[0] || 1), o = Math.max(1, t[1] || 1), u = le(e, [a, o], r), p = {
251
+ item: i?.redirect?.item ?? { id: "" },
252
+ list: i?.redirect?.list ?? [],
253
+ items: i?.redirect?.items ?? /* @__PURE__ */ new Map(),
254
+ layout: s,
255
+ size: [a, o]
256
+ }, l = ot(u, p, r), h = (i?.mode ?? "floor") === "round" ? [Math.round(l[0]), Math.round(l[1])] : [Math.floor(l[0]), Math.floor(l[1])], c = it(h, p);
257
+ return tt(c, s);
258
+ }, rt = (e) => e == null ? [] : Array.isArray(e) ? e : e instanceof Map ? Array.from(e.values()) : e instanceof Set || typeof e[Symbol.iterator] == "function" ? Array.from(e) : [], it = (e, t) => {
259
+ const n = H(t?.layout ?? [4, 8]), r = {
260
+ ...t,
261
+ layout: n
262
+ }, i = rt(r?.items), s = r?.item || {}, a = (f) => i.filter((m) => !(m == s || m?.id == s?.id)).some((m) => (m?.cell?.[0] || 0) == (f[0] || 0) && (m?.cell?.[1] || 0) == (f[1] || 0)), o = [...e];
263
+ if (!a(o)) return [...o];
264
+ const u = n[0] || 4, p = n[1] || 8, l = ([
265
+ [o[0] + 1, o[1]],
266
+ [o[0] - 1, o[1]],
267
+ [o[0], o[1] + 1],
268
+ [o[0], o[1] - 1]
269
+ ].filter((f) => f[0] >= 0 && f[0] < u && f[1] >= 0 && f[1] < p) || []).find((f) => !a(f));
270
+ if (l) return [...l];
271
+ let h = 0, c = !0, d = [...o];
272
+ for (; c && h++ < u * p; ) {
273
+ if (!(c = a(d))) return [...d];
274
+ d[0]++, d[0] >= u && (d[0] = 0, d[1]++, d[1] >= p && (d[1] = 0));
275
+ }
276
+ return [...o];
277
+ }, ot = (e, t, n = 0) => {
278
+ const r = [...t.size], i = [...e], s = H(t.layout ?? [4, 8]);
279
+ n % 2 && r.reverse();
280
+ const a = [s[0] / r[0], s[1] / r[1]];
281
+ return [i[0] * a[0], i[1] * a[1]];
282
+ }, at = () => ({
283
+ didTimeout: !1,
284
+ timeRemaining: () => 0
285
+ }), Ae = (e, t = 1e3) => typeof globalThis.requestIdleCallback == "function" ? globalThis.requestIdleCallback(e, { timeout: t }) : setTimeout(() => e(at()), 0), st = (e) => e?.offsetParent ?? e?.host, Kt = (e) => {
286
+ const t = [];
287
+ let n = e;
288
+ for (; n; ) {
289
+ const r = st(n);
290
+ if (r && r instanceof HTMLHtmlElement) break;
291
+ (n = r) && t.push(n);
292
+ }
293
+ return t;
294
+ }, Qt = (e, t = 1e-6) => Math.abs(e.a - 1) < t && Math.abs(e.b) < t && Math.abs(e.c) < t && Math.abs(e.d - 1) < t && Math.abs(e.e) < t && Math.abs(e.f) < t, ut = () => {
295
+ const e = {
296
+ canceled: !1,
297
+ rAFs: /* @__PURE__ */ new Set(),
298
+ last: null,
299
+ cancel() {
300
+ return this.canceled = !0, cancelAnimationFrame(this.last), this;
301
+ },
302
+ shedule(t) {
303
+ return this.rAFs.add(t), this;
304
+ }
305
+ };
306
+ return (async () => {
307
+ for (; !e?.canceled; )
308
+ await Promise.all((e?.rAFs?.values?.() ?? [])?.map?.((t) => Promise.try(t)?.catch?.(console.warn.bind(console)))), e.rAFs?.clear?.(), typeof requestAnimationFrame < "u" ? await new Promise((t) => {
309
+ e.last = requestAnimationFrame(t);
310
+ }) : await new Promise((t) => {
311
+ setTimeout(t, 16);
312
+ });
313
+ })(), e;
314
+ }, en = (e = ut()) => (t) => e.shedule(t), tn = typeof document < "u" ? document?.documentElement : null, nn = (e, t = {}) => {
315
+ if (!(!t || typeof t != "object" || !e))
316
+ return Array.from(Object.entries(t)).map(([n, r]) => {
317
+ const i = e.getAttribute(n);
318
+ r == null ? e.removeAttribute(n) : r != i && e.setAttribute(n, i == "" ? r ?? i : i ?? r);
319
+ });
320
+ }, rn = (e, t = {}) => Array.from(Object.entries(t)).map(([n, r]) => {
321
+ r == null ? e.removeAttribute(n) : e.setAttribute(n, r ?? e.getAttribute(n));
322
+ }), ct = /* @__PURE__ */ new Map(), on = (e, t = 1e3, ...n) => {
323
+ const r = {
324
+ running: !0,
325
+ cancel: () => {
326
+ r.running = !1;
327
+ }
328
+ };
329
+ return Ae(async () => {
330
+ if (!(!e || typeof e != "function")) {
331
+ for (; r.running; )
332
+ await Promise.all([Promise.try(e, ...n), new Promise((i) => setTimeout(i, t))]).catch?.(console.warn.bind(console)), await Promise.any([new Promise((i) => Ae(i, t)), new Promise((i) => setTimeout(i, t))]);
333
+ r.cancel = () => {
334
+ };
335
+ }
336
+ }, { timeout: t }), r?.cancel;
337
+ };
338
+ typeof requestAnimationFrame < "u" && requestAnimationFrame(async () => {
339
+ for (; ; )
340
+ ct.forEach((e) => e?.()), await new Promise((e) => requestAnimationFrame(e));
341
+ });
342
+ var X = /* @__PURE__ */ Symbol("@border-box-width"), Y = /* @__PURE__ */ Symbol("@border-box-height"), G = /* @__PURE__ */ Symbol("@content-box-width"), J = /* @__PURE__ */ Symbol("@content-box-height"), Ce = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), an = (e, t = () => {
343
+ }) => {
344
+ if (e instanceof HTMLElement && !Re.has(e)) {
345
+ e[G] = e.clientWidth, e[J] = e.clientHeight;
346
+ const n = new ResizeObserver((r) => {
347
+ for (const i of r) if (i.contentBoxSize) {
348
+ const s = i.contentBoxSize[0];
349
+ s && (e[G] = Math.min(s.inlineSize, e.clientWidth), e[J] = Math.min(s.blockSize, e.clientHeight), t?.(e));
350
+ }
351
+ });
352
+ Re.set(e, n), n.observe(e?.element ?? e, { box: "content-box" });
353
+ }
354
+ }, sn = (e, t = () => {
355
+ }) => {
356
+ if (e instanceof HTMLElement && !Ce.has(e)) {
357
+ e[X] = e.offsetWidth, e[Y] = e.offsetHeight;
358
+ const n = new ResizeObserver((r) => {
359
+ for (const i of r) if (i.borderBoxSize) {
360
+ const s = i.borderBoxSize[0];
361
+ s && (e[X] = Math.min(s.inlineSize, e.offsetWidth), e[Y] = Math.min(s.blockSize, e.offsetHeight), t?.(e));
362
+ }
363
+ });
364
+ Ce.set(e, n), n.observe(e?.element ?? e, { box: "border-box" });
365
+ }
366
+ }, un = (e, ...t) => URL.createObjectURL(new Blob(t, { type: e })), cn = (e, t = "text/html") => {
367
+ const n = new DOMParser().parseFromString(e, t);
368
+ return n.querySelector("template") ?? n.querySelector("*");
369
+ }, dn = (e, t, n) => {
370
+ t != null && e.checked != t && (e?.type == "checkbox" || e?.type == "radio" && !e?.checked ? (e?.click?.(), n?.preventDefault?.()) : (e.checked = !!t, e?.dispatchEvent?.(new Event("change", {
371
+ bubbles: !0,
372
+ cancelable: !0
373
+ }))));
374
+ }, ln = (e) => e != null && e instanceof HTMLElement && !(e instanceof DocumentFragment || e instanceof HTMLBodyElement) ? e : null, fn = (e, t) => e == null || t == null ? -1 : Array.from(e?.childNodes ?? [])?.indexOf?.(t) ?? -1, pn = "(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)", hn = `^(?:(-?[_a-zA-Z]+[_a-zA-Z0-9-]*))|^#(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)|^\\.(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)|^\\[(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)(?:([*$|~^]?=)(["'])((?:(?=(\\\\?))\\8.)*?)\\6)?\\]`, yn = (e) => {
375
+ if (e == ":fragment:") return document.createDocumentFragment();
376
+ const t = document.createElement.bind(document);
377
+ for (var n = t("div"), r, i = ""; e && (r = e.match(`^(?:(-?[_a-zA-Z]+[_a-zA-Z0-9-]*))|^#(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)|^\\.(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)|^\\[(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)(?:([*$|~^]?=)(["'])((?:(?=(\\\\?))\\8.)*?)\\6)?\\]`)); )
378
+ r[1] && (n = t(r[1])), r[2] && (n.id = r[2]), r[3] && (i += " " + r[3]), r[4] && n.setAttribute(r[4], r[7] || ""), e = e.slice(r[0].length);
379
+ return i && (n.className = i.slice(1)), n;
380
+ }, mn = (e) => e != null && (e instanceof Node || e instanceof Text || e instanceof Element || e instanceof Comment || e instanceof HTMLElement || e instanceof DocumentFragment) ? e : null, gn = (e, t) => e.querySelector(t) ?? (e.matches(t) ? e : null), re = (e, t) => {
381
+ for (; e; ) {
382
+ if (!(e?.element ?? e)) return !1;
383
+ if ((e?.element ?? e) === (t?.element ?? t)) return !0;
384
+ e = e.parentElement ?? (e.parentNode == e?.getRootNode?.({ composed: !0 }) ? e?.getRootNode?.({ composed: !0 })?.host : e?.parentNode);
385
+ }
386
+ }, $e = {};
387
+ function y(e, t, n, r = $e) {
388
+ e?.addEventListener?.(t, n, r);
389
+ const i = typeof e == "object" || typeof e == "function" && !e?.deref ? new WeakRef(e) : e;
390
+ return () => i?.deref?.()?.removeEventListener?.(t, n, r);
391
+ }
392
+ function Pe(e, t, n, r = $e) {
393
+ e?.removeEventListener?.(t, n, r);
394
+ }
395
+ var K = (e, t) => (e = e instanceof WeakRef ? e.deref() : e, [...Object.entries(t)].map?.(([n, r]) => Array.isArray(r) ? y(e, n, ...r) : y(e, n, r))), vn = (e, t) => {
396
+ if (t) {
397
+ let n = t;
398
+ return t instanceof Map ? n = [...t.entries()] : n = [...Object.entries(t)], n.map(([r, i]) => ((et(i) ? [...i] : i) ?? [])?.map?.((s) => y(e, r, s)));
399
+ }
400
+ }, bn = (e, t) => (e = e instanceof WeakRef ? e.deref() : e, [...Object.entries(t)].map?.(([n, r]) => Array.isArray(r) ? Pe(e, n, ...r) : Pe(e, n, r))), wn = (e) => {
401
+ if (!e) return null;
402
+ if (e?.composedPath && typeof e.composedPath == "function") {
403
+ const n = e.composedPath();
404
+ for (const r of n) if (r instanceof HTMLElement || r instanceof Element) return r;
405
+ }
406
+ const t = e?.target;
407
+ return t instanceof HTMLElement || t instanceof Element ? t : null;
408
+ }, Sn = (e, t, n) => {
409
+ if (t == null || !(t instanceof Node) && t?.element == null) return !1;
410
+ if (e == t || (e?.element ?? e) == (t?.element ?? t)) return !0;
411
+ if (n?.composedPath && typeof n.composedPath == "function") {
412
+ const r = n.composedPath(), i = e?.element ?? e, s = t?.element ?? t;
413
+ if (r.includes(i) && r.includes(s)) {
414
+ const a = r.indexOf(i), o = r.indexOf(s);
415
+ if (o >= 0 && a >= 0 && o < a) return !0;
416
+ }
417
+ }
418
+ return !!(e?.contains?.(t?.element ?? t) || e?.getRootNode({ composed: !0 })?.host == (t?.element ?? t));
419
+ }, fe = (e, t, n) => {
420
+ if (n?.composedPath && typeof n.composedPath == "function") {
421
+ const o = n.composedPath();
422
+ for (const u of o) if ((u instanceof HTMLElement || u instanceof Element) && u.matches?.(t))
423
+ return u;
424
+ }
425
+ const r = e?.matches?.(t) ? e : null, i = (e?.getRootNode({ composed: !0 }) ?? e?.parentElement?.getRootNode({ composed: !0 }))?.host, s = i?.matches?.(t) ? i : null, a = e?.closest?.(t) ?? r?.closest?.(t) ?? s?.closest?.(t) ?? null;
426
+ return r ?? a ?? s;
427
+ }, xn = (e, t) => !!fe(e, t), Mn = (e, t, n = "parent") => {
428
+ if (!e || e.checkVisibility && !e.checkVisibility({
429
+ checkOpacity: !0,
430
+ checkVisibilityCSS: !0
431
+ }) || !e.checkVisibility && e.offsetParent === null && e.style.position !== "fixed") return !1;
432
+ let r = document.activeElement;
433
+ for (; r && r.shadowRoot && r.shadowRoot.activeElement; ) r = r.shadowRoot.activeElement;
434
+ const i = r === e || re(r, e), s = e.matches(":hover");
435
+ if (!i && !s && !t) return !1;
436
+ if (t) {
437
+ if (typeof t == "string") {
438
+ if (n === "parent") return !!fe(e, t);
439
+ {
440
+ const a = i ? r : e.querySelector(":hover") || e, o = !!fe(a, t);
441
+ return e?.querySelector?.(t) != null || e?.matches?.(t) || o;
442
+ }
443
+ } else if (t instanceof HTMLElement) return n === "parent" ? re(e, t) || !1 : re(t, e) || !1;
444
+ }
445
+ return !0;
446
+ }, En = () => "currentCSSZoom" in document.documentElement ? document.documentElement.currentCSSZoom || 1 : parseFloat(document.documentElement.style.getPropertyValue("--scaling") || "1") || 1, dt = /* @__PURE__ */ new WeakMap(), lt = (e = document.documentElement) => dt.getOrInsertComputed(e, () => {
447
+ const t = (e?.matches?.(".ui-orientbox") ? e : null) || e?.closest?.(".ui-orientbox") || document.body;
448
+ if (t?.zoom) return t?.zoom || 1;
449
+ if (e?.currentCSSZoom) return e?.currentCSSZoom || 1;
450
+ }), An = (e = 1) => (document.documentElement.style.setProperty("--scaling", e), document.documentElement.dispatchEvent(new CustomEvent("scaling", {
451
+ detail: { zoom: e },
452
+ bubbles: !0,
453
+ cancelable: !0
454
+ })), e), Cn = (e = document.documentElement) => (e?.currentCSSZoom != null ? 1 : lt(e)) || 1, pe = (e = document.documentElement) => (e?.currentCSSZoom == null ? 1 : e?.currentCSSZoom) || 1, z = (e = document.documentElement) => {
455
+ const t = (e?.matches?.('[orient], [data-mixin="ui-orientbox"]') ? e : null) || e?.closest?.('[orient], [data-mixin="ui-orientbox"]') || e;
456
+ if (t?.hasAttribute?.("orient")) return parseInt(t?.getAttribute?.("orient") || "0") || 0;
457
+ if (t?.orient != null && Number.isFinite(Number(t.orient))) return Number(t.orient) || 0;
458
+ try {
459
+ const n = t?.style?.getPropertyValue?.("--orient") || (typeof getComputedStyle == "function" && t ? getComputedStyle(t).getPropertyValue("--orient") : "") || "", r = parseInt(String(n).trim(), 10);
460
+ if (Number.isFinite(r)) return r;
461
+ } catch {
462
+ }
463
+ return 0;
464
+ }, Rn = (e, t = null) => {
465
+ const n = pe(e) || 1, r = e?.getBoundingClientRect?.(), i = {
466
+ left: r?.left / n,
467
+ right: r?.right / n,
468
+ top: r?.top / n,
469
+ bottom: r?.bottom / n,
470
+ width: r?.width / n,
471
+ height: r?.height / n
472
+ }, s = t ?? (z(e) || 0), a = typeof window < "u" ? window.visualViewport : null, o = [((a?.width ?? document.documentElement?.clientWidth ?? window.innerWidth) || 1) / n, ((a?.height ?? document.documentElement?.clientHeight ?? window.innerHeight) || 1) / n], [u, p] = le([i.left, i.top], o, s), [l, h] = le([i.right, i.bottom], o, s), [c, d] = s == 0 || s == 3 ? [u, l] : [l, u], [f, m] = s == 0 || s == 1 ? [p, h] : [h, p], [_, Ge] = s % 2 ? [i.height, i.width] : [i.width, i.height];
473
+ return {
474
+ left: c,
475
+ top: f,
476
+ right: d,
477
+ bottom: m,
478
+ width: _,
479
+ height: Ge
480
+ };
481
+ }, Pn = (e, t = null) => (t ?? z(e)) % 2 ? e[Y] ?? e?.clientHeight : e[X] ?? e?.clientWidth, zn = (e, t = null) => (t ?? z(e)) % 2 ? e[X] ?? e?.clientWidth : e[Y] ?? e?.clientHeight, Ln = (e, t = null) => (t ?? z(e)) % 2 ? e[J] ?? e?.clientHeight : e[G] ?? e?.clientWidth, kn = (e, t = null) => (t ?? z(e)) % 2 ? e[G] ?? e?.clientWidth : e[J] ?? e?.clientHeight, ft = (e, t = 100) => typeof globalThis.requestIdleCallback == "function" ? globalThis.requestIdleCallback(e, { timeout: t }) : setTimeout(() => e({
482
+ didTimeout: !1,
483
+ timeRemaining: () => 0
484
+ }), 0), Be = () => {
485
+ const e = typeof matchMedia < "u" ? matchMedia("(orientation: landscape)")?.matches : !1, t = typeof window < "u" ? window.visualViewport : null, n = t ? {
486
+ "--vv-width": `${t.width}px`,
487
+ "--vv-height": `${t.height}px`,
488
+ "--vv-offset-left": `${t.offsetLeft}px`,
489
+ "--vv-offset-top": `${t.offsetTop}px`,
490
+ "--vv-scale": String(t.scale ?? 1)
491
+ } : {
492
+ "--vv-width": typeof window < "u" ? `${window.innerWidth}px` : "0px",
493
+ "--vv-height": typeof window < "u" ? `${window.innerHeight}px` : "0px",
494
+ "--vv-offset-left": "0px",
495
+ "--vv-offset-top": "0px",
496
+ "--vv-scale": "1"
497
+ };
498
+ if (typeof screen < "u") {
499
+ const r = screen?.availWidth + "px", i = screen?.availHeight + "px";
500
+ return {
501
+ "--screen-width": Math.min(screen?.width, screen?.availWidth) + "px",
502
+ "--screen-height": Math.min(screen?.height, screen?.availHeight) + "px",
503
+ "--avail-width": e ? i : r,
504
+ "--avail-height": e ? r : i,
505
+ "--view-height": Math.min(screen?.availHeight, window?.innerHeight) + "px",
506
+ "--pixel-ratio": String(devicePixelRatio || 1),
507
+ ...n
508
+ };
509
+ }
510
+ return {
511
+ "--screen-width": "0px",
512
+ "--screen-height": "0px",
513
+ "--avail-width": "0px",
514
+ "--avail-height": "0px",
515
+ "--view-height": "0px",
516
+ "--pixel-ratio": "1",
517
+ ...n
518
+ };
519
+ }, he = Be(), Vn = [[":root, :host, :scope", he]], pt = {
520
+ "portrait-primary": 0,
521
+ "landscape-primary": 1,
522
+ "portrait-secondary": 2,
523
+ "landscape-secondary": 3
524
+ }, ht = (e) => {
525
+ const t = document.documentElement;
526
+ Object.assign(he, Be()), Object.entries(he).forEach(([n, r]) => {
527
+ const i = t?.style?.getPropertyValue(n);
528
+ (!i || i != r) && t?.style?.setProperty?.(n, r || "", "");
529
+ }), document.documentElement.style.setProperty("--orientation-secondary", screen?.orientation?.type?.endsWith?.("secondary") ? "1" : "0");
530
+ }, yt = () => {
531
+ let e = screen?.orientation?.type || "portrait-primary";
532
+ return globalThis.matchMedia("((display-mode: fullscreen) or (display-mode: standalone) or (display-mode: window-controls-overlay))").matches || (matchMedia("(orientation: portrait)").matches ? e = e.replace("landscape", "portrait") : matchMedia("(orientation: landscape)").matches && (e = e.replace("portrait", "landscape"))), e;
533
+ }, ie = { passive: !0 }, mt = (e) => {
534
+ let t = !1;
535
+ const n = () => {
536
+ t || (requestAnimationFrame(() => {
537
+ ht(), e(), t = !1;
538
+ }), t = !0);
539
+ }, r = [];
540
+ return r.push(y(navigator?.virtualKeyboard, "geometrychange", n, ie)), r.push(y(window?.visualViewport, "scroll", n, ie)), r.push(y(window?.visualViewport, "resize", n, ie)), r.push(y(screen?.orientation, "change", n)), r.push(y(window, "resize", n)), r.push(y(document?.documentElement, "fullscreenchange", n)), r.push(y(document, "DOMContentLoaded", n)), r.push(y(matchMedia("(orientation: portrait)"), "change", n)), r.push(y(matchMedia("(orientation: landscape)"), "change", n)), n(), ft(() => n(), 100), () => r.forEach((i) => i());
541
+ }, jn = (e) => {
542
+ if (!e?.classList?.contains?.("native-portrait-optimized"))
543
+ return e?.classList?.add?.("native-portrait-optimized"), mt(() => {
544
+ const t = pt?.[yt()] ?? 0;
545
+ e.orient = t, e.setAttribute?.("orient", String(t)), e.style?.setProperty?.("--orient", String(t));
546
+ });
547
+ }, R = new OffscreenCanvas(1, 1).getContext("2d"), He = (e, t) => {
548
+ const n = getComputedStyle(e, "");
549
+ if (t && n) {
550
+ const r = n.getPropertyValue("font-weight") || "normal", i = n.getPropertyValue("font-size") || "16px", s = n.getPropertyValue("font-family") || "Times New Roman", a = n.getPropertyValue("font-stretch") || "normal";
551
+ try {
552
+ t.fontStretch = a.includes("%") ? "normal" : a;
553
+ } catch {
554
+ }
555
+ try {
556
+ t.letterSpacing = n.getPropertyValue("letter-spacing") || "normal";
557
+ } catch {
558
+ }
559
+ try {
560
+ t.fontKerning = n.getPropertyValue("font-kerning") || "auto";
561
+ } catch {
562
+ }
563
+ try {
564
+ t.fontVariantCaps = n.getPropertyValue("font-variant-caps") || "normal";
565
+ } catch {
566
+ }
567
+ try {
568
+ t.font = `${r} ${i} ${s}`;
569
+ } catch {
570
+ }
571
+ }
572
+ }, gt = (e, t) => {
573
+ if (R) {
574
+ He(t, R);
575
+ try {
576
+ return R.measureText(e);
577
+ } catch {
578
+ }
579
+ }
580
+ return { width: null };
581
+ }, Tn = (e) => {
582
+ const t = e.value.slice(0, e.selectionEnd || 0);
583
+ return gt(t, e);
584
+ }, vt = (e, t) => {
585
+ const n = e?.value || "";
586
+ if (R) {
587
+ He(e, R);
588
+ let r = 0;
589
+ for (let i = 0; i < n.length; i++) {
590
+ if (r = R.measureText(n.slice(0, i))?.width, r == null) return n.length;
591
+ if (r != null && r >= t[0]) return Math.max(i - 1, 0);
592
+ }
593
+ }
594
+ return n.length;
595
+ }, On = (e, t) => {
596
+ const n = e.getBoundingClientRect(), r = [t[0] - n.left / pe(), t[1] - n.top / pe()];
597
+ return vt(e, r);
598
+ }, bt = (e, t) => {
599
+ const n = parseInt(e.getAttribute("data-grid-columns") || "", 10), r = parseInt(e.getAttribute("data-grid-rows") || "", 10), i = H(t ?? [4, 8]);
600
+ return [Number.isFinite(n) && n > 0 ? n : i[0], Number.isFinite(r) && r > 0 ? r : i[1]];
601
+ }, Wn = (e, t, n, r = "floor") => {
602
+ if (!e) return [0, 0];
603
+ const i = e.getBoundingClientRect?.();
604
+ if (!i) return [0, 0];
605
+ const s = bt(e, n?.layout), a = z(e), o = globalThis.getComputedStyle?.(e), u = parseFloat(o?.paddingLeft) || 0, p = parseFloat(o?.paddingTop) || 0, l = parseFloat(o?.paddingRight) || 0, h = parseFloat(o?.paddingBottom) || 0, c = Math.max(1, (i.width || e.clientWidth || 1) - u - l), d = Math.max(1, (i.height || e.clientHeight || 1) - p - h);
606
+ return nt([(t?.[0] || 0) - i.left - u, (t?.[1] || 0) - i.top - p], [c, d], s, a, {
607
+ mode: r,
608
+ redirect: {
609
+ item: n?.item,
610
+ list: n?.list,
611
+ items: n?.items
612
+ }
613
+ });
614
+ }, wt = async (e) => {
615
+ const t = () => {
616
+ e?.hasAttribute?.("data-hidden") || (e?.removeAttribute?.("data-opacity-animation"), e?.dispatchEvent?.(new CustomEvent("u2-appear", {
617
+ detail: {},
618
+ bubbles: !0,
619
+ cancelable: !0
620
+ })));
621
+ };
622
+ if (!e?.hasAttribute?.("data-hidden") && e?.dispatchEvent?.(new CustomEvent("u2-before-show", {
623
+ detail: {},
624
+ bubbles: !0,
625
+ cancelable: !0
626
+ })))
627
+ if (!matchMedia("(prefers-reduced-motion: reduce)").matches && !e.hasAttribute("data-opacity-animation") && !e.hasAttribute("data-instant") && e?.getAttribute?.("data-hidden") == null && e.setAttribute("data-opacity-animation", ""), e.hasAttribute("data-opacity-animation") && e?.getAttribute?.("data-hidden") == null) {
628
+ const n = e.animate([
629
+ {
630
+ easing: "linear",
631
+ offset: 0,
632
+ "--opacity": 0,
633
+ "--scale": 0.8,
634
+ display: "none",
635
+ pointerEvents: "none"
636
+ },
637
+ {
638
+ easing: "linear",
639
+ offset: 0.01,
640
+ "--opacity": 0,
641
+ "--scale": 0.8,
642
+ display: "none",
643
+ pointerEvents: "none"
644
+ },
645
+ {
646
+ easing: "linear",
647
+ offset: 1,
648
+ "--opacity": 1,
649
+ "--scale": 1,
650
+ display: "revert-layer",
651
+ pointerEvents: "revert-layer"
652
+ }
653
+ ], {
654
+ duration: Je() ? 100 : 80,
655
+ easing: "linear",
656
+ delay: 0
657
+ });
658
+ let r = !1;
659
+ const i = () => {
660
+ r || (r = !0, s?.forEach?.((a) => a?.()), n.currentTime = 1, n.finish(), t?.());
661
+ }, s = K(e, {
662
+ "u2-before-hide": [i, {
663
+ once: !0,
664
+ passive: !0
665
+ }],
666
+ "u2-before-show": [i, {
667
+ once: !0,
668
+ passive: !0
669
+ }]
670
+ });
671
+ await n.finished, i?.();
672
+ } else {
673
+ const { resolve: n, reject: r, promise: i } = Promise.withResolvers(), s = requestAnimationFrame(n);
674
+ let a = !1;
675
+ const o = () => {
676
+ a || (a = !0, u?.forEach?.((p) => p?.()), cancelAnimationFrame(s), n(performance.now()), t?.());
677
+ }, u = K(e, {
678
+ "u2-before-hide": [o, {
679
+ once: !0,
680
+ passive: !0
681
+ }],
682
+ "u2-before-show": [o, {
683
+ once: !0,
684
+ passive: !0
685
+ }]
686
+ });
687
+ await i, o?.();
688
+ }
689
+ }, St = async (e) => {
690
+ const t = () => {
691
+ e?.hasAttribute?.("data-hidden") && (e?.removeAttribute?.("data-opacity-animation"), e?.dispatchEvent?.(new CustomEvent("u2-hidden", {
692
+ detail: {},
693
+ bubbles: !0,
694
+ cancelable: !0
695
+ })));
696
+ };
697
+ if (e?.hasAttribute?.("data-hidden") && e?.dispatchEvent?.(new CustomEvent("u2-before-hide", {
698
+ detail: {},
699
+ bubbles: !0,
700
+ cancelable: !0
701
+ })))
702
+ if (!matchMedia("(prefers-reduced-motion: reduce)").matches && !e.hasAttribute("data-opacity-animation") && !e.hasAttribute("data-instant") && e.setAttribute("data-opacity-animation", ""), e.hasAttribute("data-opacity-animation")) {
703
+ const n = e.animate([
704
+ {
705
+ easing: "linear",
706
+ offset: 0,
707
+ pointerEvents: "none"
708
+ },
709
+ {
710
+ easing: "linear",
711
+ offset: 0.99,
712
+ "--opacity": 0,
713
+ "--scale": 0.8,
714
+ pointerEvents: "none"
715
+ },
716
+ {
717
+ easing: "linear",
718
+ offset: 1,
719
+ "--opacity": 0,
720
+ "--scale": 0.8,
721
+ display: "none",
722
+ pointerEvents: "none"
723
+ }
724
+ ], {
725
+ duration: 120,
726
+ easing: "linear",
727
+ delay: 0
728
+ });
729
+ let r = !1;
730
+ const i = () => {
731
+ r || (r = !0, s?.forEach?.((a) => a?.()), n.currentTime = 1, n.finish(), t?.());
732
+ }, s = K(e, { "u2-before-show": [i, {
733
+ once: !0,
734
+ passive: !0
735
+ }] });
736
+ await n.finished, i?.();
737
+ } else {
738
+ const { resolve: n, reject: r, promise: i } = Promise.withResolvers(), s = requestAnimationFrame(n);
739
+ let a = !1;
740
+ const o = () => {
741
+ a || (a = !0, u?.forEach?.((p) => p?.()), cancelAnimationFrame(s), n(performance.now()), t?.());
742
+ }, u = K(e, {
743
+ "u2-before-hide": [o, {
744
+ once: !0,
745
+ passive: !0
746
+ }],
747
+ "u2-before-show": [o, {
748
+ once: !0,
749
+ passive: !0
750
+ }]
751
+ });
752
+ await i, o?.();
753
+ }
754
+ }, L = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), q = (e) => (typeof e?.current == "object" && (e = e?.element ?? e?.current ?? (typeof e?.self == "object" ? e?.self : null) ?? e), e), Nn = (e, t) => {
755
+ if (!k.has(e = q(e))) {
756
+ const n = [], r = new ResizeObserver((i) => {
757
+ for (const s of i) if (s.contentBoxSize) {
758
+ const a = s.contentBoxSize[0];
759
+ a && n.forEach((o) => o?.(a, r));
760
+ }
761
+ });
762
+ t?.({
763
+ inlineSize: e.clientWidth,
764
+ blockSize: e.clientHeight
765
+ }, r), k.set(e, n), (e?.element ?? e) instanceof Node && r.observe(e?.element ?? e, { box: "content-box" });
766
+ }
767
+ return k.get(e)?.push?.(t), { disconnect: () => k.get(e)?.splice?.(k.get(e)?.indexOf(t) || -1, 1) };
768
+ }, Fn = (e, t) => {
769
+ if (!L.has(e = q(e))) {
770
+ const n = [], r = new ResizeObserver((i) => {
771
+ for (const s of i) if (s.borderBoxSize) {
772
+ const a = s.borderBoxSize[0];
773
+ a && n.forEach((o) => o?.(a, r));
774
+ }
775
+ });
776
+ t?.({
777
+ inlineSize: e.offsetWidth,
778
+ blockSize: e.offsetHeight
779
+ }, r), L.set(e, n), (e?.element ?? e) instanceof Node && r.observe(e?.element ?? e, { box: "border-box" });
780
+ }
781
+ return L.get(e)?.push?.(t), { disconnect: () => L.get(e)?.splice?.(L.get(e)?.indexOf(t) || -1, 1) };
782
+ }, In = (e, t, n) => {
783
+ if (typeof e?.selector == "string") return ve(e, e?.selector, t, n);
784
+ const r = new Set((t.split(",") || [t]).map((s) => s.trim())), i = new MutationObserver((s, a) => {
785
+ for (const o of s) o.attributeName && r.has(o.attributeName) && n(o, a);
786
+ });
787
+ return (e?.element ?? e) instanceof Node && i.observe(e = q(e), {
788
+ attributes: !0,
789
+ attributeOldValue: !0,
790
+ attributeFilter: [...r]
791
+ }), r.forEach((s) => n({
792
+ target: e,
793
+ type: "attributes",
794
+ attributeName: s,
795
+ oldValue: e?.getAttribute?.(s)
796
+ }, i)), i;
797
+ }, ve = (e, t, n, r) => {
798
+ const i = new Set([...n.split(",") || [n]].map((a) => a.trim())), s = new MutationObserver((a, o) => {
799
+ for (const u of a) if (u.type == "childList") {
800
+ const p = Array.from(u.addedNodes) || [], l = Array.from(u.removedNodes) || [];
801
+ p.push(...Array.from(u.addedNodes || []).flatMap((h) => Array.from(h?.querySelectorAll?.(t) || []))), l.push(...Array.from(u.removedNodes || []).flatMap((h) => Array.from(h?.querySelectorAll?.(t) || []))), [...new Set(p)].filter((h) => h?.matches?.(t))?.map?.((h) => {
802
+ i.forEach((c) => {
803
+ r({
804
+ target: h,
805
+ type: "attributes",
806
+ attributeName: c,
807
+ oldValue: h?.getAttribute?.(c)
808
+ }, o);
809
+ });
810
+ });
811
+ } else u.target?.matches?.(t) && u.attributeName && i.has(u.attributeName) && r(u, o);
812
+ });
813
+ return s.observe(e = q(e), {
814
+ attributeOldValue: !0,
815
+ attributes: !0,
816
+ attributeFilter: [...i],
817
+ childList: !0,
818
+ subtree: !0,
819
+ characterData: !0
820
+ }), [...e.querySelectorAll(t)].map((a) => i.forEach((o) => r({
821
+ target: a,
822
+ type: "attributes",
823
+ attributeName: o,
824
+ oldValue: a?.getAttribute?.(o)
825
+ }, s))), s;
826
+ }, xt = (e, t = "*", n = (r, i) => {
827
+ }) => {
828
+ const r = (c) => {
829
+ const d = Array.from(c || []) || [];
830
+ return d.push(...Array.from(c || []).flatMap((f) => Array.from(f?.querySelectorAll?.(t) || []))), [...Array.from(new Set(d).values())].filter((f) => f?.matches?.(t));
831
+ }, i = (c) => {
832
+ const d = l?.deref?.(), f = r(c.addedNodes), m = r(c.removedNodes);
833
+ (f.length > 0 || m.length > 0) && n?.({
834
+ type: c.type,
835
+ target: c.target,
836
+ attributeName: c.attributeName,
837
+ attributeNamespace: c.attributeNamespace,
838
+ nextSibling: c.nextSibling,
839
+ oldValue: c.oldValue,
840
+ previousSibling: c.previousSibling,
841
+ addedNodes: f,
842
+ removedNodes: m
843
+ }, d);
844
+ }, s = (c) => {
845
+ i({
846
+ addedNodes: [c?.target].filter((d) => !!d),
847
+ removedNodes: [c?.relatedTarget].filter((d) => !!d),
848
+ type: "childList",
849
+ target: c?.currentTarget
850
+ });
851
+ }, a = (c) => {
852
+ i({
853
+ addedNodes: [c?.relatedTarget].filter((d) => !!d),
854
+ removedNodes: [c?.target].filter((d) => !!d),
855
+ type: "childList",
856
+ target: c?.currentTarget
857
+ });
858
+ }, o = (c) => {
859
+ i({
860
+ addedNodes: [c?.target].filter((d) => !!d),
861
+ removedNodes: [c?.relatedTarget || document?.activeElement].filter((d) => !!d),
862
+ type: "childList",
863
+ target: c?.currentTarget
864
+ });
865
+ }, u = {
866
+ passive: !0,
867
+ capture: !1
868
+ };
869
+ if (t?.includes?.(":hover") && t?.includes?.(":active"))
870
+ return e.addEventListener("pointerover", s, u), e.addEventListener("pointerout", a, u), e.addEventListener("pointerdown", s, u), e.addEventListener("pointerup", a, u), e.addEventListener("pointercancel", a, u), { disconnect: () => {
871
+ e.removeEventListener("pointerover", s, u), e.removeEventListener("pointerout", a, u), e.removeEventListener("pointerdown", s, u), e.removeEventListener("pointerup", a, u), e.removeEventListener("pointercancel", a, u);
872
+ } };
873
+ if (t?.includes?.(":hover"))
874
+ return e.addEventListener("pointerover", s, u), e.addEventListener("pointerout", a, u), { disconnect: () => {
875
+ e.removeEventListener("pointerover", s, u), e.removeEventListener("pointerout", a, u);
876
+ } };
877
+ if (t?.includes?.(":active"))
878
+ return e.addEventListener("pointerdown", s, u), e.addEventListener("pointerup", a, u), e.addEventListener("pointercancel", a, u), { disconnect: () => {
879
+ e.removeEventListener("pointerdown", s, u), e.removeEventListener("pointerup", a, u), e.removeEventListener("pointercancel", a, u);
880
+ } };
881
+ if (t?.includes?.(":focus") && t?.includes?.(":focus-within") && t?.includes?.(":focus-visible"))
882
+ return e.addEventListener("focusin", s, u), e.addEventListener("focusout", a, u), e.addEventListener("click", o, u), { disconnect: () => {
883
+ e.removeEventListener("focusin", s, u), e.removeEventListener("focusout", a, u), e.removeEventListener("click", o, u);
884
+ } };
885
+ const p = new MutationObserver((c, d) => {
886
+ for (const f of c) f.type == "childList" && i(f);
887
+ }), l = new WeakRef(p);
888
+ (e?.element ?? e) instanceof Node && p.observe(e = q(e), {
889
+ childList: !0,
890
+ subtree: !0
891
+ });
892
+ const h = Array.from(e.querySelectorAll(t));
893
+ return h.length > 0 && n?.({
894
+ addedNodes: h,
895
+ removedNodes: []
896
+ }, p), p;
897
+ }, $n = async (e = document.body) => {
898
+ ve(e, "*", "data-hidden", (t, n) => {
899
+ if (t.attributeName == "data-hidden") {
900
+ const r = t.target;
901
+ r.getAttribute("data-hidden") !== t.oldValue && Promise?.try?.(r.getAttribute("data-hidden") != null ? St : wt, r, n)?.catch?.(console.warn.bind(console));
902
+ }
903
+ });
904
+ }, Bn = (e = 100, t = 0.05, n = 8) => {
905
+ const r = [];
906
+ for (let o = 0; o < e; o++) r.push(o / e);
907
+ const i = (o) => `calc(${o}rad * pi * 2)`, s = (o) => `calc(calc(cos(calc(var(--clip-freq, 8) * ${i(o)})) * 0.5 + 0.5) * var(--clip-amplitude, 0))`, a = (o) => [`calc(calc(0.5 + calc(cos(${i(o)}) * calc(0.5 - ${s(o)}))) * var(--icon-size, 100%))`, `calc(calc(0.5 + calc(sin(${i(o)}) * calc(0.5 - ${s(o)}))) * var(--icon-size, 100%))`];
908
+ return {
909
+ "--clip-amplitude": t,
910
+ "--clip-freq": n,
911
+ "--clip-path": `polygon(${r.map((o) => a(o).join(" ")).join(", ")})`
912
+ };
913
+ }, qe = () => typeof globalThis < "u" && typeof globalThis.CSSStyleSheet == "function", ze = (e) => typeof e == "string" && /@import\b/i.test(e), be = "DOM", N = typeof document < "u" ? document.createElement("style") : null;
914
+ N && (typeof document < "u" && document.querySelector("head")?.appendChild?.(N), N.dataset.owner = be);
915
+ var Le = (e, t, n = "") => {
916
+ e[0][e[1]] = e[1] == "innerHTML" ? `@import url("${t}") ${n && typeof n == "string" ? `layer(${n})` : ""};` : t;
917
+ }, Hn = (e) => e?.map?.((t) => jt(...t)), Mt = (e, t) => {
918
+ t ||= N?.sheet;
919
+ let n = Array.from(t?.cssRules || []).findIndex((i) => i instanceof CSSLayerBlockRule && i?.name === e), r;
920
+ return n === -1 && t ? r = t?.cssRules?.[n = t.insertRule(`@layer ${e} {}`)] : r = t?.cssRules?.[n], r;
921
+ }, Et = 0, oe = (e) => typeof ShadowRoot < "u" && e instanceof ShadowRoot, ke = (e) => typeof Document < "u" && e instanceof Document, At = (e) => typeof Element < "u" && e instanceof Element, Ve = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : Array.from(e).map((t) => `\\${t.codePointAt(0).toString(16)} `).join(""), Ct = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `ux-${Date.now().toString(36)}-${(++Et).toString(36)}`, Rt = (e, t) => (t = t.trim(), e ? t ? t.startsWith("::") ? `${e}${t}` : `${e} ${t}` : e : t), Pt = (e, t, n, r) => {
922
+ const i = Array.from(e?.cssRules || []), s = t.trim(), a = r.trim();
923
+ return i.findIndex((o) => {
924
+ if (!(o instanceof CSSStyleRule)) return !1;
925
+ const u = o.selectorText?.trim?.() ?? "";
926
+ return u === s ? !0 : a && u.endsWith(a) ? u.slice(0, u.length - a.length).trim() === n : !1;
927
+ });
928
+ }, we = (e, t, n = "ux-query", r = null) => {
929
+ const i = oe(r) || ke(r) ? r : r?.getRootNode?.() ?? (typeof document < "u" ? document : null), s = At(r) ? r : null;
930
+ let a = "";
931
+ if (s?.id) a = `#${Ve(s.id)}`;
932
+ else if (s) {
933
+ let l = s.getAttribute("data-style-id");
934
+ l || (l = Ct(), s.setAttribute("data-style-id", l)), a = `[data-style-id="${Ve(l)}"]`;
935
+ } else oe(i) ? a = ":host" : ke(i) && (a = ":root");
936
+ let o = null;
937
+ if (oe(i) ? (o = i.querySelector("style[data-ux-query]"), !o && typeof document < "u" && (o = document.createElement("style"), o.setAttribute("data-ux-query", ""), i.appendChild(o))) : o = zt(), t ||= o?.sheet, !t) return;
938
+ if (n) return we(e, Mt(n, t), null, r);
939
+ const u = Rt(a, e);
940
+ let p = Pt(t, u, a, e);
941
+ return p === -1 && (p = t.insertRule(`${u} {}`)), t.cssRules?.[p];
942
+ };
943
+ function zt() {
944
+ return N ?? null;
945
+ }
946
+ var ne = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", P = (e) => ne && e instanceof CSSStyleValue, A = (e) => ne && e instanceof CSSUnitValue, b = (e, t, n, r = "") => {
947
+ if (!(!e || !t)) {
948
+ if (n == null) {
949
+ e.getPropertyValue(t) !== "" && e.removeProperty(t);
950
+ return;
951
+ }
952
+ e.getPropertyValue(t) !== n && e.setProperty(t, n, r);
953
+ }
954
+ }, Lt = (e, t, n, r = "") => {
955
+ if (!e || !t) return e;
956
+ const i = te(t), s = e.style, a = e.attributeStyleMap ?? e.styleMap;
957
+ if (!ne || !a) return _e(e, t, n, r);
958
+ let o = M(n) && !(P(n) || A(n)) ? n?.value : n;
959
+ if (o == null)
960
+ return a.delete?.(i), s && b(s, i, null, r), e;
961
+ if (P(o)) {
962
+ const u = a.get(i);
963
+ if (A(o) && A(u)) {
964
+ if (u.value === o.value && u.unit === o.unit) return e;
965
+ } else if (u === o) return e;
966
+ return a.set(i, o), e;
967
+ }
968
+ if (typeof o == "number") if (CSS?.number && !i.startsWith("--")) {
969
+ const u = CSS.number(o), p = a.get(i);
970
+ return A(p) && p.value === u.value && p.unit === u.unit || a.set(i, u), e;
971
+ } else
972
+ return b(s, i, String(o), r), e;
973
+ if (typeof o == "string" && !P(o)) {
974
+ const u = Ie(o);
975
+ if (typeof u == "number" && CSS?.number && !i.startsWith("--")) {
976
+ const p = CSS.number(u), l = a.get(i);
977
+ return A(l) && l.value === p.value && l.unit === p.unit || a.set(i, p), e;
978
+ } else
979
+ return b(s, i, o, r), e;
980
+ }
981
+ return b(s, i, String(o), r), e;
982
+ }, _e = (e, t, n, r = "") => {
983
+ if (!e || !t) return e;
984
+ const i = te(t), s = e.style;
985
+ if (!s) return e;
986
+ let a = M(n) && !(P(n) || A(n)) ? n?.value : n;
987
+ return typeof a == "string" && !P(a) && (a = Ie(a) ?? a), a == null ? (b(s, i, null, r), e) : (P(a) || typeof a == "number", b(s, i, String(a), r), e);
988
+ }, Ze = (e, t) => typeof e?.then == "function" ? e?.then?.(t) : t(e), V = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new Map(), kt = (e) => {
989
+ if (!e) return null;
990
+ if (x.has(e)) return x.get(e);
991
+ if (e instanceof Blob || e instanceof File) {
992
+ if (V.has(e)) return V.get(e);
993
+ const t = URL.createObjectURL(e);
994
+ return V.set(e, t), x.set(t, t), t;
995
+ }
996
+ if (URL.canParse(e) || e?.trim?.()?.startsWith?.("./")) {
997
+ const t = fetch(e?.replace?.("?url", "?raw"), {
998
+ cache: "force-cache",
999
+ mode: "same-origin",
1000
+ priority: "high"
1001
+ })?.then?.(async (n) => {
1002
+ const r = await n.blob(), i = URL.createObjectURL(r);
1003
+ return V.set(r, i), x.set(e, i), x.set(i, i), i;
1004
+ });
1005
+ return x.set(e, t), t;
1006
+ }
1007
+ if (typeof e == "string") {
1008
+ const t = new Blob([e], { type: "text/css" }), n = URL.createObjectURL(t);
1009
+ return V.set(t, n), x.set(n, n), n;
1010
+ }
1011
+ return e;
1012
+ }, j = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new WeakMap(), Vt = (e) => {
1013
+ if (!e) return "";
1014
+ if (j.has(e)) return j.get(e) ?? "";
1015
+ if (e instanceof Blob || e instanceof File) {
1016
+ if (Z.has(e)) return Z.get(e) ?? "";
1017
+ const t = e?.text?.()?.then?.((n) => (Z.set(e, n), n));
1018
+ return Z.set(e, t), t;
1019
+ }
1020
+ if (URL.canParse(e) || e?.trim?.()?.startsWith?.("./")) {
1021
+ const t = fetch(e?.replace?.("?url", "?raw"), {
1022
+ cache: "force-cache",
1023
+ mode: "same-origin",
1024
+ priority: "high"
1025
+ })?.then?.(async (n) => {
1026
+ const r = await n.text();
1027
+ return j.set(e, r), r;
1028
+ });
1029
+ return j.set(e, t), t;
1030
+ }
1031
+ return typeof e == "string" && j.set(e, e), e;
1032
+ }, je = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new WeakMap(), qn = (e, t = "ux-query", n = null) => {
1033
+ if (!e || !qe()) return null;
1034
+ const r = n instanceof ShadowRoot ? n : n?.getRootNode ? n.getRootNode({ composed: !0 }) : null, i = r instanceof ShadowRoot, s = i ? r.adoptedStyleSheets : typeof document < "u" ? document.adoptedStyleSheets : null;
1035
+ if (!s) return null;
1036
+ const a = `${t || ""}:${e}`;
1037
+ let o;
1038
+ if (i) {
1039
+ let l = Te.get(r);
1040
+ l || (l = /* @__PURE__ */ new Map(), Te.set(r, l)), o = l.get(a), o || (o = new CSSStyleSheet(), l.set(a, o), s.includes(o) || s.push(o));
1041
+ } else
1042
+ o = je.get(a), o || (o = new CSSStyleSheet(), je.set(a, o), s.includes(o) || s.push(o));
1043
+ if (t) {
1044
+ let l;
1045
+ if (i) {
1046
+ let h = D.get(r);
1047
+ h || (h = /* @__PURE__ */ new Map(), D.set(r, h)), l = h.get(t);
1048
+ } else l = Oe.get(t);
1049
+ if (!l) {
1050
+ const h = Array.from(o.cssRules || []), c = h.findIndex((d) => d instanceof CSSLayerBlockRule && d.name === t);
1051
+ if (c === -1) try {
1052
+ o.insertRule(`@layer ${t} {}`, o.cssRules.length);
1053
+ const d = o.cssRules[o.cssRules.length - 1];
1054
+ d instanceof CSSLayerBlockRule && (l = d);
1055
+ } catch {
1056
+ l = void 0;
1057
+ }
1058
+ else l = h[c];
1059
+ if (l) if (i) {
1060
+ let d = D.get(r);
1061
+ d || (d = /* @__PURE__ */ new Map(), D.set(r, d)), d.set(t, l);
1062
+ } else Oe.set(t, l);
1063
+ }
1064
+ if (l) {
1065
+ let h = Array.from(l.cssRules || []).findIndex((c) => c instanceof CSSStyleRule && c.selectorText?.trim?.() === e?.trim?.());
1066
+ if (h === -1) try {
1067
+ h = l.insertRule(`${e} {}`, l.cssRules.length);
1068
+ } catch {
1069
+ return null;
1070
+ }
1071
+ return l.cssRules[h];
1072
+ }
1073
+ }
1074
+ let u = Array.from(o.cssRules || []).findIndex((l) => l instanceof CSSStyleRule && l.selectorText?.trim?.() === e?.trim?.());
1075
+ if (u === -1) try {
1076
+ u = o.insertRule(`${e} {}`, o.cssRules.length);
1077
+ } catch {
1078
+ return null;
1079
+ }
1080
+ const p = o.cssRules[u];
1081
+ return p instanceof CSSStyleRule ? p : null;
1082
+ }, w = (e, t, n, r = "") => ne ? Lt(e, t, n, r) : _e(e, t, n, r), _n = (e, t, n) => w(we(e), t, n), jt = (e, t) => {
1083
+ const n = we(e);
1084
+ return Object.entries(t).forEach(([r, i]) => w(n, r, i)), n;
1085
+ }, Zn = async (e) => {
1086
+ const t = await crypto?.subtle?.digest("SHA-256", typeof e == "string" ? new TextEncoder().encode(e) : e instanceof ArrayBuffer ? e : await e?.arrayBuffer?.());
1087
+ return "sha256-" + btoa(String.fromCharCode.apply(null, new Uint8Array(t)));
1088
+ }, De = (e, t, n = "", r) => {
1089
+ const i = kt(e), s = typeof e == "string" && URL.canParse(e) ? e : i;
1090
+ return t?.[0] && (t[0].fetchPriority = "high"), t && s && typeof s == "string" && Le(t, s, n), t?.[0] && (!URL.canParse(e) || r) && t?.[0] instanceof HTMLLinkElement, Ze(i, (a) => {
1091
+ t?.[0] && a && (Le(t, a, n), t?.[0].setAttribute("loaded", ""));
1092
+ })?.catch?.((a) => {
1093
+ console.warn("Failed to load style sheet:", a);
1094
+ });
1095
+ }, Tt = (e) => {
1096
+ const t = typeof document < "u" ? document.createElement("link") : null;
1097
+ return t && (t.fetchPriority = "high"), t ? (Object.assign(t, {
1098
+ rel: "stylesheet",
1099
+ type: "text/css",
1100
+ crossOrigin: "same-origin"
1101
+ }), t.dataset.owner = be, De(e, [t, "href"]), typeof document < "u" && document.head.append(t), t) : null;
1102
+ }, T = (e, t = typeof document < "u" ? document?.head : null, n = "") => {
1103
+ const r = t?.querySelector?.("head") ?? t;
1104
+ if (typeof HTMLHeadElement < "u" && r instanceof HTMLHeadElement) return Tt(e);
1105
+ const i = typeof document < "u" ? document.createElement("style") : null;
1106
+ return i ? (i.dataset.owner = be, De(e, [i, "innerHTML"], n), r?.prepend?.(i), i) : null;
1107
+ }, Dn = (e, t, n, r = "") => w(e, t, n, r), Un = (e) => Ot(e, ""), v = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), We = (e, t) => {
1108
+ if (!e || !t) return !1;
1109
+ try {
1110
+ return e.replaceSync(t), !0;
1111
+ } catch (n) {
1112
+ const r = String(n?.message || "").toLowerCase();
1113
+ return r.includes("@import rules are not allowed") || r.includes("@import") && r.includes("not allowed") || console.warn("[DOM] Failed to apply adopted stylesheet:", n), !1;
1114
+ }
1115
+ }, Ot = (e, t = null) => {
1116
+ if (!qe())
1117
+ return typeof e == "string" && T(e, void 0, t || ""), null;
1118
+ if (typeof e == "string" && ze(e))
1119
+ return T(e, void 0, t || ""), null;
1120
+ if (typeof e == "string" && v?.has?.(e)) {
1121
+ const r = v.get(e);
1122
+ return typeof document < "u" && document.adoptedStyleSheets && !document.adoptedStyleSheets.includes(r) && document.adoptedStyleSheets.push(r), r;
1123
+ }
1124
+ if ((e instanceof Blob || e instanceof File) && O?.has?.(e)) {
1125
+ const r = O.get(e);
1126
+ return typeof document < "u" && document.adoptedStyleSheets && !document.adoptedStyleSheets.includes(r) && document.adoptedStyleSheets.push(r), r;
1127
+ }
1128
+ if (!e) return null;
1129
+ const n = typeof e == "string" ? v.getOrInsertComputed(e, (r) => new CSSStyleSheet()) : O.getOrInsertComputed(e, (r) => new CSSStyleSheet());
1130
+ if (typeof document < "u" && document.adoptedStyleSheets && !document.adoptedStyleSheets.includes(n) && document.adoptedStyleSheets.push(n), typeof e == "string" && !URL.canParse(e)) {
1131
+ const r = t ? `@layer ${t} { ${e} }` : e;
1132
+ return v.set(e, n), We(n, r) || (ae(n), v.delete(e), T(e)), n;
1133
+ } else Ze(Vt(e), (r) => {
1134
+ if (v.set(r, n), r) {
1135
+ if (ze(r))
1136
+ return ae(n), v.delete(r), O.delete(e), T(r, void 0, t || ""), n;
1137
+ const i = t ? `@layer ${t} { ${r} }` : r;
1138
+ return We(n, i) || (ae(n), v.delete(r), O.delete(e), T(r, void 0, t || "")), n;
1139
+ }
1140
+ });
1141
+ return n;
1142
+ }, ae = (e) => {
1143
+ if (!e) return !1;
1144
+ const t = typeof e == "string" ? v.get(e) : e;
1145
+ if (!t || typeof document > "u") return !1;
1146
+ const n = document.adoptedStyleSheets, r = n.indexOf(t);
1147
+ return r !== -1 ? (n.splice(r, 1), !0) : !1;
1148
+ }, Wt = (e, t) => {
1149
+ const n = e.split(" ");
1150
+ return new DOMPoint(Ne(n[0], () => t.clientWidth), Ne(n[1], () => t.clientHeight));
1151
+ }, Ne = (e, t) => e.endsWith("%") ? parseFloat(e) / 100 * t() : parseFloat(e), Xn = (e) => {
1152
+ if (e?.computedStyleMap) {
1153
+ const t = e.computedStyleMap().get("transform")?.toMatrix?.();
1154
+ if (t) return t;
1155
+ } else if (e) {
1156
+ const t = getComputedStyle(e);
1157
+ return new DOMMatrix(t?.getPropertyValue?.("transform"));
1158
+ }
1159
+ return new DOMMatrix();
1160
+ }, Yn = (e) => {
1161
+ const t = getComputedStyle(e)?.getPropertyValue?.("transform-origin") || "50% 50%";
1162
+ return Wt(t, e);
1163
+ }, W = (e, t) => {
1164
+ if ("computedStyleMap" in e) {
1165
+ const n = e?.computedStyleMap?.()?.get(t);
1166
+ return n instanceof CSSUnitValue ? n?.value || 0 : n?.toString?.();
1167
+ }
1168
+ if (e instanceof HTMLElement) {
1169
+ const n = getComputedStyle?.(e, "");
1170
+ return parseFloat(n?.getPropertyValue?.(t)?.replace?.("px", "")) || 0;
1171
+ }
1172
+ return parseFloat((e?.style ?? e).getPropertyValue?.(t)?.replace?.("px", "")) || 0;
1173
+ }, Gn = (e) => {
1174
+ let t = 1, n = e;
1175
+ for (; n; ) {
1176
+ if ("currentCSSZoom" in n) {
1177
+ const i = n.currentCSSZoom;
1178
+ if (typeof i == "number") return t *= i;
1179
+ }
1180
+ const r = getComputedStyle(n);
1181
+ if (r.zoom && r.zoom !== "normal") return t *= parseFloat(r.zoom);
1182
+ if (r.zoom && r.zoom !== "normal" || "currentCSSZoom" in n) return t;
1183
+ n = n?.offsetParent ?? n?.parentElement;
1184
+ }
1185
+ return t;
1186
+ }, Jn = (e, t) => W?.(e, t), Kn = (e, t) => t == "inline" ? W(e, "padding-inline-start") + W(e, "padding-inline-end") : W(e, "padding-block-start") + W(e, "padding-block-end"), Ue = /* @__PURE__ */ new WeakMap(), Nt = (e, t, n) => (new WeakRef(e), t.has(n) || t.add(n), e), Qn = (e, t) => {
1187
+ if (e) {
1188
+ if (t) {
1189
+ const n = Ue.getOrInsert(e, /* @__PURE__ */ new Set());
1190
+ [...t?.values?.() || []].map((r) => Nt(e, n, r));
1191
+ }
1192
+ return e;
1193
+ }
1194
+ }, I = /* @__PURE__ */ new Map(), Ft = (e, t) => {
1195
+ const n = [...e.entries() || []];
1196
+ return new Map(n?.map?.(([r, i]) => [r, i?.get?.(t)])?.filter?.(([r, i]) => !!i) || []);
1197
+ }, It = (e, t, n) => {
1198
+ let r = I.get(t);
1199
+ return r || (r = /* @__PURE__ */ new WeakMap(), I.set(t, r)), r.has(e) || r.set(e, n), e;
1200
+ }, er = (e, t) => {
1201
+ if (!(!e || !t)) {
1202
+ for (const [n, r] of t.entries()) It(e, n, r);
1203
+ return e;
1204
+ }
1205
+ }, tr = (e, t) => {
1206
+ if (e) {
1207
+ if (t) {
1208
+ const n = S?.get?.(e) ?? /* @__PURE__ */ new WeakSet();
1209
+ S?.has?.(e) || S?.set?.(e, n), [...t?.values?.() || []].map((r) => $t(e, r, n));
1210
+ }
1211
+ return e;
1212
+ }
1213
+ }, F = (e) => ({
1214
+ storeSet: Ft(I, e),
1215
+ mixinSet: S?.get?.(e),
1216
+ behaviorSet: Ue?.get?.(e)
1217
+ }), $t = (e, t, n) => {
1218
+ const r = new WeakRef(e);
1219
+ return n ||= S?.get?.(e), n?.has?.(t) || (n?.add?.(t), C?.get?.(t)?.add?.(e), t.name && e?.setAttribute?.("data-mixin", [...e?.getAttribute?.("data-mixin")?.split?.(" ") || [], t.name].filter((i) => !!i).join(" ")), t?.connect?.(r, t, F(e))), e;
1220
+ }, S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new WeakMap(), Xe = (e, t) => {
1221
+ typeof t == "string" && (t = $?.get?.(t));
1222
+ const n = /* @__PURE__ */ new Set([...e?.getAttribute?.("data-mixin")?.split?.(" ") || []]), r = new Set([...n].map((a) => $?.get?.(a)).filter((a) => !!a)), i = S?.get?.(e) ?? /* @__PURE__ */ new WeakSet();
1223
+ C?.has?.(t) || C?.set?.(t, /* @__PURE__ */ new WeakSet()), S?.has?.(e) || S?.set?.(e, i);
1224
+ const s = new WeakRef(e);
1225
+ i?.has?.(t) || (r.has(t) || t?.disconnect?.(s, t, F(e)), (r.has(t) || !C?.get?.(t)?.has?.(e)) && (t?.connect?.(s, t, F(e)), n.add(Q?.get?.(t)), i?.add?.(t), e?.setAttribute?.("data-mixin", [...n].filter((a) => !!a).join(" "))), C?.get?.(t)?.add?.(e)), i?.has?.(t) && (r.has(t) || (i?.delete?.(t), t?.disconnect?.(s, t, F(e))));
1226
+ }, ye = /* @__PURE__ */ new Set(), Bt = (e = typeof document < "u" ? document : null) => {
1227
+ if (e)
1228
+ return ye?.has?.(e) || (ye?.add?.(e), ve(e, "*", "data-mixin", (t) => me(t.target)), xt(e, "[data-mixin]", (t) => {
1229
+ for (const n of t.addedNodes) n instanceof HTMLElement && me(n);
1230
+ })), e;
1231
+ }, me = (e) => {
1232
+ const t = /* @__PURE__ */ new Set([...e?.getAttribute?.("data-mixin")?.split?.(" ") || []]);
1233
+ [...new Set([...t].map((n) => $?.get?.(n)).filter((n) => !!n))].map?.((n) => Xe(e, n));
1234
+ }, Ht = (e, t) => {
1235
+ e.forEach((n) => t ? Xe(n, t) : me(n));
1236
+ }, qt = (e) => {
1237
+ for (const t of ye) Ht(t?.querySelectorAll?.("[data-mixin]"), e);
1238
+ }, _t = new FinalizationRegistry((e) => {
1239
+ $?.delete?.(e);
1240
+ }), Zt = (e, t) => {
1241
+ if (!Q?.has?.(t)) {
1242
+ const n = e?.trim?.();
1243
+ n && (Q?.set?.(t, n), $?.set?.(n, t), _t?.register?.(t, n), qt(t));
1244
+ }
1245
+ };
1246
+ Bt(typeof document < "u" ? document : null);
1247
+ var Se = class {
1248
+ constructor(e = null) {
1249
+ e && Zt(e, this);
1250
+ }
1251
+ connect(e, t, n) {
1252
+ return this;
1253
+ }
1254
+ disconnect(e, t, n) {
1255
+ return this;
1256
+ }
1257
+ storeForElement(e) {
1258
+ return I.get(this.name || "")?.get?.(e);
1259
+ }
1260
+ relatedForElement(e) {
1261
+ return F(e);
1262
+ }
1263
+ get elements() {
1264
+ return C?.get?.(this);
1265
+ }
1266
+ get storage() {
1267
+ return I?.get?.(this.name || "");
1268
+ }
1269
+ get name() {
1270
+ return Q?.get?.(this);
1271
+ }
1272
+ }, nr = (e, t, n) => {
1273
+ const r = n;
1274
+ M(n) && (n = n.value);
1275
+ const i = (n = ge(n)) != null && n !== !1;
1276
+ return B(r, () => {
1277
+ e instanceof HTMLInputElement ? e.hidden = !i : i ? e?.removeAttribute?.("data-hidden") : e?.setAttribute?.("data-hidden", "");
1278
+ }), e;
1279
+ }, rr = (e, t, n) => {
1280
+ if (!(t = typeof t == "string" ? Fe(t) : t) || !e || [
1281
+ "style",
1282
+ "dataset",
1283
+ "attributeStyleMap",
1284
+ "styleMap",
1285
+ "computedStyleMap"
1286
+ ].indexOf(t || "") != -1) return e;
1287
+ const r = n;
1288
+ return M(n) && (n = n.value), e?.[t] === n || e?.[t] !== n && B(r, () => {
1289
+ n != null ? e[t] = n : delete e[t];
1290
+ }), e;
1291
+ }, ir = (e, t, n) => {
1292
+ const r = e?.dataset;
1293
+ if (!t || !e || !r) return e;
1294
+ const i = n;
1295
+ return M(n) && (n = n?.value), t = Fe(t), r?.[t] === (n = ge(n)) || (n == null || n === !1 ? delete r[t] : B(i, () => {
1296
+ typeof n != "object" && typeof n != "function" ? r[t] = String(n) : delete r[t];
1297
+ })), e;
1298
+ }, Dt = (e, t) => e.style.removeProperty(te(t)), or = (e, t, n) => {
1299
+ const r = e?.style;
1300
+ return !t || typeof t != "string" || !e || !r || B(n, () => {
1301
+ Qe(n) || M(n) || Ke(n) ? w(e, t, n) : n == null && Dt(e, t);
1302
+ }), e;
1303
+ }, ar = (e, t, n) => {
1304
+ if (!t || !e) return e;
1305
+ const r = n;
1306
+ return M(n) && (n = n.value), t = te(t), e?.getAttribute?.(t) === (n = ge(n)) || B(r, () => {
1307
+ typeof n != "object" && typeof n != "function" && n != null && (typeof n != "boolean" || n == !0) ? e?.setAttribute?.(t, String(n)) : e?.removeAttribute?.(t);
1308
+ }), e;
1309
+ };
1310
+ function se(e, t) {
1311
+ const n = Math.min(e.x, t.x), r = Math.min(e.y, t.y), i = Math.max(e.x, t.x), s = Math.max(e.y, t.y);
1312
+ return {
1313
+ left: n,
1314
+ top: r,
1315
+ right: i,
1316
+ bottom: s,
1317
+ width: i - n,
1318
+ height: s - r
1319
+ };
1320
+ }
1321
+ var U = {
1322
+ start: "junction-select:start",
1323
+ move: "junction-select:move",
1324
+ end: "junction-select:end",
1325
+ cancel: "junction-select:cancel"
1326
+ }, ue = {
1327
+ start: "junction-drag:start",
1328
+ move: "junction-drag:move",
1329
+ end: "junction-drag:end"
1330
+ }, ce = {
1331
+ start: "junction-resize:start",
1332
+ move: "junction-resize:move",
1333
+ end: "junction-resize:end"
1334
+ }, ee = /* @__PURE__ */ new WeakMap(), g = (e, t, n) => {
1335
+ const r = ee.get(e) ?? /* @__PURE__ */ new Map(), i = r.get(t) ?? [];
1336
+ i.push(n), r.set(t, i), ee.set(e, r);
1337
+ }, xe = (e, t) => {
1338
+ const n = ee.get(e), r = n?.get(t);
1339
+ if (r) {
1340
+ for (const i of r) try {
1341
+ i();
1342
+ } catch {
1343
+ }
1344
+ n.delete(t), n.size === 0 && ee.delete(e);
1345
+ }
1346
+ }, E = (e, t) => {
1347
+ const n = globalThis.getComputedStyle?.(e)?.getPropertyValue?.(t)?.trim?.() ?? "", r = parseFloat(n);
1348
+ return Number.isFinite(r) ? r : 0;
1349
+ }, Ye = (e, t, n) => {
1350
+ const r = e.getAttribute(t)?.trim();
1351
+ if (!r) return n;
1352
+ const i = e.querySelector(r);
1353
+ return i instanceof HTMLElement ? i : n;
1354
+ }, Ut = class extends Se {
1355
+ constructor() {
1356
+ super("ui-junction-select");
1357
+ }
1358
+ connect(e) {
1359
+ const t = e?.deref?.();
1360
+ if (!t) return this;
1361
+ const n = document.createElement("div");
1362
+ n.className = "ui-junction-select-overlay", n.setAttribute("data-junction-overlay", ""), n.style.cssText = "position:absolute;pointer-events:none;z-index:9999;box-sizing:border-box;border:1px dashed color-mix(in oklab, #3794ff 70%, transparent);background:color-mix(in oklab, #3794ff 14%, transparent);display:none;inset:auto;min-width:0;min-height:0;", globalThis.getComputedStyle?.(t)?.position === "static" && (t.style.position = "relative"), t.appendChild(n);
1363
+ let i = !1, s = {
1364
+ x: 0,
1365
+ y: 0
1366
+ }, a = {
1367
+ x: 0,
1368
+ y: 0
1369
+ };
1370
+ const o = (f) => {
1371
+ const m = t.getBoundingClientRect();
1372
+ return {
1373
+ x: f.clientX - m.left,
1374
+ y: f.clientY - m.top
1375
+ };
1376
+ }, u = () => {
1377
+ const f = se(s, a);
1378
+ if (f.width < 1 && f.height < 1) {
1379
+ n.style.display = "none";
1380
+ return;
1381
+ }
1382
+ n.style.display = "block", n.style.left = `${f.left}px`, n.style.top = `${f.top}px`, n.style.width = `${f.width}px`, n.style.height = `${f.height}px`;
1383
+ }, p = (f) => {
1384
+ f.button === 0 && (f.target?.closest?.("[data-junction-ignore-select], [data-junction-drag-handle], [data-junction-resize-handle], button, a, input, textarea, select") || (f.target === t || t.contains(f.target)) && (i = !0, s = o(f), a = { ...s }, t.setPointerCapture(f.pointerId), t.dispatchEvent(new CustomEvent(U.start, {
1385
+ bubbles: !0,
1386
+ detail: {
1387
+ a: { ...s },
1388
+ b: { ...a },
1389
+ host: t
1390
+ }
1391
+ })), u()));
1392
+ }, l = (f) => {
1393
+ if (!i) return;
1394
+ a = o(f), u();
1395
+ const m = se(s, a);
1396
+ t.dispatchEvent(new CustomEvent(U.move, {
1397
+ bubbles: !0,
1398
+ detail: {
1399
+ a: { ...s },
1400
+ b: { ...a },
1401
+ box: m,
1402
+ host: t
1403
+ }
1404
+ }));
1405
+ }, h = (f) => {
1406
+ if (!i) return;
1407
+ i = !1;
1408
+ try {
1409
+ t.releasePointerCapture(f.pointerId);
1410
+ } catch {
1411
+ }
1412
+ const m = se(s, a);
1413
+ t.dispatchEvent(new CustomEvent(U.end, {
1414
+ bubbles: !0,
1415
+ detail: {
1416
+ a: { ...s },
1417
+ b: { ...a },
1418
+ box: m,
1419
+ host: t
1420
+ }
1421
+ }));
1422
+ }, c = (f) => {
1423
+ i && h(f);
1424
+ }, d = (f) => {
1425
+ if (i) {
1426
+ i = !1, n.style.display = "none";
1427
+ try {
1428
+ t.releasePointerCapture(f.pointerId);
1429
+ } catch {
1430
+ }
1431
+ t.dispatchEvent(new CustomEvent(U.cancel, {
1432
+ bubbles: !0,
1433
+ detail: { host: t }
1434
+ }));
1435
+ }
1436
+ };
1437
+ return g(t, "ui-junction-select", () => {
1438
+ n.remove();
1439
+ }), g(t, "ui-junction-select", y(t, "pointerdown", p)), g(t, "ui-junction-select", y(t, "pointermove", l)), g(t, "ui-junction-select", y(t, "pointerup", c)), g(t, "ui-junction-select", y(t, "pointercancel", d)), this;
1440
+ }
1441
+ disconnect(e) {
1442
+ const t = e?.deref?.();
1443
+ return t && xe(t, "ui-junction-select"), this;
1444
+ }
1445
+ }, Xt = class extends Se {
1446
+ constructor() {
1447
+ super("ui-junction-drag");
1448
+ }
1449
+ connect(e) {
1450
+ const t = e?.deref?.();
1451
+ if (!t) return this;
1452
+ w(t, "--jx-drag-x", E(t, "--jx-drag-x")), w(t, "--jx-drag-y", E(t, "--jx-drag-y"));
1453
+ const n = t.style.transform;
1454
+ (!t.style.transform || t.style.transform === "none") && (t.style.transform = "translate3d(calc(var(--jx-drag-x, 0) * 1px), calc(var(--jx-drag-y, 0) * 1px), 0)");
1455
+ const r = Ye(t, "data-junction-drag-handle", t);
1456
+ let i = !1, s = 0, a = 0, o = 0, u = 0;
1457
+ const p = (c) => {
1458
+ c.button === 0 && (c.target !== r && !r.contains(c.target) || (i = !0, s = c.clientX, a = c.clientY, o = E(t, "--jx-drag-x"), u = E(t, "--jx-drag-y"), r.setPointerCapture(c.pointerId), t.dispatchEvent(new CustomEvent(ue.start, {
1459
+ bubbles: !0,
1460
+ detail: {
1461
+ host: t,
1462
+ clientX: c.clientX,
1463
+ clientY: c.clientY,
1464
+ baseX: o,
1465
+ baseY: u
1466
+ }
1467
+ }))));
1468
+ }, l = (c) => {
1469
+ if (!i) return;
1470
+ const d = c.clientX - s, f = c.clientY - a, m = o + d, _ = u + f;
1471
+ w(t, "--jx-drag-x", m), w(t, "--jx-drag-y", _), t.dispatchEvent(new CustomEvent(ue.move, {
1472
+ bubbles: !0,
1473
+ detail: {
1474
+ host: t,
1475
+ dx: d,
1476
+ dy: f,
1477
+ x: m,
1478
+ y: _
1479
+ }
1480
+ }));
1481
+ }, h = (c) => {
1482
+ if (i) {
1483
+ i = !1;
1484
+ try {
1485
+ r.releasePointerCapture(c.pointerId);
1486
+ } catch {
1487
+ }
1488
+ t.dispatchEvent(new CustomEvent(ue.end, {
1489
+ bubbles: !0,
1490
+ detail: {
1491
+ host: t,
1492
+ x: E(t, "--jx-drag-x"),
1493
+ y: E(t, "--jx-drag-y")
1494
+ }
1495
+ }));
1496
+ }
1497
+ };
1498
+ return g(t, "ui-junction-drag", () => {
1499
+ t.style.transform = n;
1500
+ }), g(t, "ui-junction-drag", y(r, "pointerdown", p)), g(t, "ui-junction-drag", y(r, "pointermove", l)), g(t, "ui-junction-drag", y(r, "pointerup", h)), g(t, "ui-junction-drag", y(r, "pointercancel", h)), this;
1501
+ }
1502
+ disconnect(e) {
1503
+ const t = e?.deref?.();
1504
+ return t && xe(t, "ui-junction-drag"), this;
1505
+ }
1506
+ }, Yt = class extends Se {
1507
+ constructor() {
1508
+ super("ui-junction-resize");
1509
+ }
1510
+ connect(e) {
1511
+ const t = e?.deref?.();
1512
+ if (!t) return this;
1513
+ const n = Ye(t, "data-junction-resize-handle", t);
1514
+ let r = !1, i = 0, s = 0, a = 0, o = 0;
1515
+ const u = Math.max(120, parseFloat(t.getAttribute("data-junction-resize-min-w") || "") || 120), p = Math.max(80, parseFloat(t.getAttribute("data-junction-resize-min-h") || "") || 80), l = (d) => {
1516
+ d.button === 0 && (d.target !== n && !n.contains(d.target) || (r = !0, i = d.clientX, s = d.clientY, a = t.offsetWidth, o = t.offsetHeight, n.setPointerCapture(d.pointerId), t.dispatchEvent(new CustomEvent(ce.start, {
1517
+ bubbles: !0,
1518
+ detail: {
1519
+ host: t,
1520
+ width: a,
1521
+ height: o
1522
+ }
1523
+ }))));
1524
+ }, h = (d) => {
1525
+ if (!r) return;
1526
+ const f = Math.max(u, a + (d.clientX - i)), m = Math.max(p, o + (d.clientY - s));
1527
+ t.style.width = `${f}px`, t.style.height = `${m}px`, t.dispatchEvent(new CustomEvent(ce.move, {
1528
+ bubbles: !0,
1529
+ detail: {
1530
+ host: t,
1531
+ width: f,
1532
+ height: m
1533
+ }
1534
+ }));
1535
+ }, c = (d) => {
1536
+ if (r) {
1537
+ r = !1;
1538
+ try {
1539
+ n.releasePointerCapture(d.pointerId);
1540
+ } catch {
1541
+ }
1542
+ t.dispatchEvent(new CustomEvent(ce.end, {
1543
+ bubbles: !0,
1544
+ detail: {
1545
+ host: t,
1546
+ width: t.offsetWidth,
1547
+ height: t.offsetHeight
1548
+ }
1549
+ }));
1550
+ }
1551
+ };
1552
+ return g(t, "ui-junction-resize", y(n, "pointerdown", l)), g(t, "ui-junction-resize", y(n, "pointermove", h)), g(t, "ui-junction-resize", y(n, "pointerup", c)), g(t, "ui-junction-resize", y(n, "pointercancel", c)), this;
1553
+ }
1554
+ disconnect(e) {
1555
+ const t = e?.deref?.();
1556
+ return t && xe(t, "ui-junction-resize"), this;
1557
+ }
1558
+ };
1559
+ new Ut();
1560
+ new Xt();
1561
+ new Yt();
1562
+ export {
1563
+ Se as DOMMixin,
1564
+ Xt as JunctionDragMixin,
1565
+ Yt as JunctionResizeMixin,
1566
+ Ut as JunctionSelectMixin,
1567
+ pn as MATCH,
1568
+ xn as MOC,
1569
+ fe as MOCElement,
1570
+ en as RAFBehavior,
1571
+ hn as REGEX,
1572
+ tn as ROOT,
1573
+ Bn as WavyShapedCircle,
1574
+ Gt as __exportProperties,
1575
+ y as addEvent,
1576
+ K as addEvents,
1577
+ vn as addEventsList,
1578
+ Bt as addRoot,
1579
+ O as adoptedBlobMap,
1580
+ v as adoptedMap,
1581
+ St as animateHide,
1582
+ wt as animateShow,
1583
+ he as availSize,
1584
+ zn as bbh,
1585
+ Pn as bbw,
1586
+ Nt as bindBehavior,
1587
+ $t as bindMixins,
1588
+ It as bindStore,
1589
+ Y as borderBoxHeight,
1590
+ X as borderBoxWidth,
1591
+ Ue as boundBehaviors,
1592
+ S as boundMixinSet,
1593
+ kn as cbh,
1594
+ Ln as cbw,
1595
+ An as changeZoom,
1596
+ Vn as classes,
1597
+ vt as computeCaretPosition,
1598
+ On as computeCaretPositionFromClient,
1599
+ Sn as containsOrSelf,
1600
+ J as contentBoxHeight,
1601
+ G as contentBoxWidth,
1602
+ yn as createElementVanilla,
1603
+ Dt as deleteStyleProperty,
1604
+ Jt as detectMobile,
1605
+ sn as doBorderObserve,
1606
+ an as doContentObserve,
1607
+ kt as fetchAndCache,
1608
+ Vt as fetchAsInline,
1609
+ jn as fixOrientToScreen,
1610
+ Cn as fixedClientZoom,
1611
+ qn as getAdoptedStyleRule,
1612
+ Be as getAvailSize,
1613
+ Rn as getBoundingOrientRect,
1614
+ yt as getCorrectOrientation,
1615
+ F as getElementRelated,
1616
+ Gn as getElementZoom,
1617
+ wn as getEventTarget,
1618
+ st as getOffsetParent,
1619
+ Kt as getOffsetParentChain,
1620
+ Kn as getPadding,
1621
+ W as getPropertyValue,
1622
+ Jn as getPxValue,
1623
+ Ft as getStoresOfElement,
1624
+ Mt as getStyleLayer,
1625
+ we as getStyleRule,
1626
+ Xn as getTransform,
1627
+ Yn as getTransformOrigin,
1628
+ En as getZoom,
1629
+ ar as handleAttribute,
1630
+ ir as handleDataset,
1631
+ nr as handleHidden,
1632
+ rr as handleProperty,
1633
+ or as handleStyleChange,
1634
+ re as hasParent,
1635
+ Zn as hash,
1636
+ cn as html,
1637
+ gn as includeSelf,
1638
+ fn as indexOf,
1639
+ He as initTextStyle,
1640
+ $n as initVisibility,
1641
+ mn as isElement,
1642
+ Mn as isInFocus,
1643
+ Je as isMobile,
1644
+ Qt as isNearlyIdentity,
1645
+ ln as isValidParent,
1646
+ Ot as loadAsAdopted,
1647
+ Tt as loadBlobStyle,
1648
+ T as loadInlineStyle,
1649
+ De as loadStyleSheet,
1650
+ ut as makeRAFCycle,
1651
+ Tn as measureInputInFocus,
1652
+ gt as measureText,
1653
+ C as mixinElements,
1654
+ Q as mixinNamespace,
1655
+ $ as mixinRegistry,
1656
+ _t as nameRegistryF,
1657
+ I as namedStoreMaps,
1658
+ In as observeAttribute,
1659
+ ve as observeAttributeBySelector,
1660
+ Fn as observeBorderBox,
1661
+ xt as observeBySelector,
1662
+ Nn as observeContentBox,
1663
+ Ce as onBorderObserve,
1664
+ Re as onContentObserve,
1665
+ z as orientOf,
1666
+ pt as orientationNumberMap,
1667
+ Ne as parseLength,
1668
+ Wt as parseOrigin,
1669
+ $e as passiveOpts,
1670
+ Un as preloadStyle,
1671
+ bt as readLauncherLayoutFromElement,
1672
+ Qn as reflectBehaviors,
1673
+ tr as reflectMixins,
1674
+ er as reflectStores,
1675
+ Zt as registerMixin,
1676
+ ae as removeAdopted,
1677
+ Pe as removeEvent,
1678
+ bn as removeEvents,
1679
+ Wn as resolveGridCellFromClientPoint,
1680
+ ye as roots,
1681
+ rn as setAttributes,
1682
+ nn as setAttributesIfNull,
1683
+ dn as setChecked,
1684
+ on as setIdleInterval,
1685
+ Dn as setProperty,
1686
+ _n as setStyleInRule,
1687
+ w as setStyleProperty,
1688
+ _e as setStylePropertyFallback,
1689
+ Lt as setStylePropertyTyped,
1690
+ jt as setStyleRule,
1691
+ Hn as setStyleRules,
1692
+ Le as setStyleURL,
1693
+ ct as throttleMap,
1694
+ pe as unfixedClientZoom,
1695
+ me as updateAllMixins,
1696
+ Xe as updateMixinAttributes,
1697
+ Ht as updateMixinAttributesAll,
1698
+ qt as updateMixinAttributesAllInRoots,
1699
+ ht as updateVP,
1700
+ un as url,
1701
+ mt as whenAnyScreenChanges,
1702
+ lt as zoomOf
1703
+ };