leesto-connect 0.5.0 → 0.6.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.
@@ -1,62 +1,62 @@
1
- var rt = "login", ot = "rrweb-buffer", it = 6e3, st = 3e3;
2
- function at(e) {
1
+ var wt = "login", Et = "rrweb-buffer", St = "ambient", _t = 6e3, Tt = 3e3;
2
+ function Rt(e) {
3
3
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type.startsWith("leesto:");
4
4
  }
5
- var lt = [
5
+ var At = [
6
6
  "mask_all",
7
7
  "labels_visible",
8
8
  "inputs_only"
9
- ], le = "mask_all";
10
- function ct(e) {
11
- return typeof e == "string" && lt.includes(e);
9
+ ], pe = "mask_all";
10
+ function Lt(e) {
11
+ return typeof e == "string" && At.includes(e);
12
12
  }
13
- var ut = "leesto_diag", ft = "leesto_run", Le = "X-Leesto-Run-Id", dt = "leesto_mask", pt = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14
- function te(e) {
15
- return typeof e == "string" && pt.test(e);
13
+ var Ot = "leesto_diag", It = "leesto_run", Be = "X-Leesto-Run-Id", Ct = "leesto_mask", kt = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14
+ function ie(e) {
15
+ return typeof e == "string" && kt.test(e);
16
16
  }
17
- function ht() {
17
+ function Nt() {
18
18
  try {
19
19
  const e = globalThis.crypto, t = e?.randomUUID?.();
20
- if (te(t)) return t;
20
+ if (ie(t)) return t;
21
21
  if (!e?.getRandomValues) return;
22
22
  const n = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
23
23
  n[6] = (n[6] ?? 0) & 15 | 64, n[8] = (n[8] ?? 0) & 63 | 128;
24
- const r = Array.from(n, (i) => i.toString(16).padStart(2, "0")).join(""), o = `${r.slice(0, 8)}-${r.slice(8, 12)}-${r.slice(12, 16)}-${r.slice(16, 20)}-${r.slice(20)}`;
25
- return te(o) ? o : void 0;
24
+ const r = Array.from(n, (s) => s.toString(16).padStart(2, "0")).join(""), o = `${r.slice(0, 8)}-${r.slice(8, 12)}-${r.slice(12, 16)}-${r.slice(16, 20)}-${r.slice(20)}`;
25
+ return ie(o) ? o : void 0;
26
26
  } catch {
27
27
  return;
28
28
  }
29
29
  }
30
- function mt(e) {
30
+ function Mt(e) {
31
31
  try {
32
- const t = new URLSearchParams(e).getAll(dt), [n] = t;
33
- return t.some((r) => r !== n) ? le : ct(n) ? n : le;
32
+ const t = new URLSearchParams(e).getAll(Ct), [n] = t;
33
+ return t.some((r) => r !== n) ? pe : Lt(n) ? n : pe;
34
34
  } catch {
35
- return le;
35
+ return pe;
36
36
  }
37
37
  }
38
- function gt(e) {
38
+ function xt(e) {
39
39
  try {
40
- const t = new URLSearchParams(e).get(ft);
41
- return te(t) ? t : void 0;
40
+ const t = new URLSearchParams(e).get(It);
41
+ return ie(t) ? t : void 0;
42
42
  } catch {
43
43
  return;
44
44
  }
45
45
  }
46
- function pe(e) {
46
+ function we(e) {
47
47
  try {
48
- return new URLSearchParams(e).get(ut) === "1";
48
+ return new URLSearchParams(e).get(Ot) === "1";
49
49
  } catch {
50
50
  return !1;
51
51
  }
52
52
  }
53
- function yt(e, t) {
54
- if (pe(e)) return e;
53
+ function Dt(e, t) {
54
+ if (we(e)) return e;
55
55
  if (typeof t != "string" || !t.startsWith("leesto-arming?")) return "";
56
56
  const n = `?${t.slice(14)}`;
57
- return pe(n) ? n : "";
57
+ return we(n) ? n : "";
58
58
  }
59
- function vt(e) {
59
+ function Ft(e) {
60
60
  try {
61
61
  const t = new URL(e);
62
62
  return `${t.origin}${t.pathname}`;
@@ -64,19 +64,416 @@ function vt(e) {
64
64
  return e.split(/[?#]/)[0] ?? e;
65
65
  }
66
66
  }
67
- var Te = "leesto/console", bt = "leesto/network", wt = "leesto/network-ring", Et = "leesto/console-ring", St = {
67
+ var $e = "leesto/console", Pt = "leesto/network", Bt = "leesto/network-ring", $t = "leesto/console-ring", qt = {
68
68
  primary: "#08783f",
69
69
  hover: "#066633",
70
70
  foreground: "#f3fff7"
71
- }, _t = {
71
+ }, Ht = {
72
72
  primary: "#46c383",
73
73
  hover: "#65d49b",
74
74
  foreground: "#082315"
75
- }, Rt = {
76
- light: St,
77
- dark: _t
75
+ }, Ut = {
76
+ light: qt,
77
+ dark: Ht
78
+ }, $ = (e) => Math.min(1, Math.max(0, e));
79
+ function Ee(e, [t, n, r]) {
80
+ return e.map((o) => o[0] * t + o[1] * n + o[2] * r);
81
+ }
82
+ var K = (e) => {
83
+ const t = Math.abs(e);
84
+ return t <= 0.04045 ? e / 12.92 : Math.sign(e) * ((t + 0.055) / 1.055) ** 2.4;
85
+ }, he = (e) => {
86
+ const t = Math.abs(e);
87
+ return t <= 31308e-7 ? e * 12.92 : Math.sign(e) * (1.055 * t ** (1 / 2.4) - 0.055);
88
+ }, Gt = [
89
+ [
90
+ 1.2249401762805598,
91
+ -0.22494017628055996,
92
+ 0
93
+ ],
94
+ [
95
+ -0.04205695470968816,
96
+ 1.042056954709688,
97
+ 0
98
+ ],
99
+ [
100
+ -0.019637554590334432,
101
+ -0.07863604555063188,
102
+ 1.0982736001409663
103
+ ]
104
+ ], Wt = [
105
+ [
106
+ 0.955473421488075,
107
+ -0.02309845494876471,
108
+ 0.06325924320057072
109
+ ],
110
+ [
111
+ -0.0283697093338637,
112
+ 1.0099953980813041,
113
+ 0.021041441191917323
114
+ ],
115
+ [
116
+ 0.012314014864481998,
117
+ -0.020507649298898964,
118
+ 1.330365926242124
119
+ ]
120
+ ], Vt = [
121
+ [
122
+ 3.2409699419045226,
123
+ -1.537383177570094,
124
+ -0.4986107602930034
125
+ ],
126
+ [
127
+ -0.9692436362808796,
128
+ 1.8759675015077202,
129
+ 0.04155505740717559
130
+ ],
131
+ [
132
+ 0.05563007969699366,
133
+ -0.20397695888897652,
134
+ 1.0569715142428786
135
+ ]
136
+ ], me = [
137
+ 0.3457 / 0.3585,
138
+ 1,
139
+ 0.2958 / 0.3585
140
+ ];
141
+ function te([e, t, n], r) {
142
+ return {
143
+ r: $(he(e)),
144
+ g: $(he(t)),
145
+ b: $(he(n)),
146
+ a: $(r)
147
+ };
148
+ }
149
+ function qe(e, t, n) {
150
+ const r = (e + 0.3963377774 * t + 0.2158037573 * n) ** 3, o = (e - 0.1055613458 * t - 0.0638541728 * n) ** 3, s = (e - 0.0894841775 * t - 1.291485548 * n) ** 3;
151
+ return [
152
+ 4.0767416621 * r - 3.3077115913 * o + 0.2309699292 * s,
153
+ -1.2684380046 * r + 2.6097574011 * o - 0.3413193965 * s,
154
+ -0.0041960863 * r - 0.7034186147 * o + 1.707614701 * s
155
+ ];
156
+ }
157
+ function He(e, t, n) {
158
+ const r = 903.2962962962963, o = 216 / 24389, s = (e + 16) / 116, u = s + t / 500, a = s - n / 200, i = u ** 3 > o ? u ** 3 : (116 * u - 16) / r, l = e > r * o ? s ** 3 : e / r, c = a ** 3 > o ? a ** 3 : (116 * a - 16) / r, f = [
159
+ i * me[0],
160
+ l * me[1],
161
+ c * me[2]
162
+ ];
163
+ return Ee(Vt, Ee(Wt, f));
164
+ }
165
+ function B(e, t) {
166
+ if (e === void 0) return null;
167
+ if (e === "none") return 0;
168
+ const n = Number.parseFloat(e);
169
+ return Number.isFinite(n) ? e.endsWith("%") ? n / 100 * t : n : null;
170
+ }
171
+ var zt = /^(rgba?|oklch|oklab|lab|lch|color)\((.*)\)$/, jt = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/;
172
+ function Xt(e) {
173
+ const t = e.length <= 4 ? [...e].map((r) => r + r).join("") : e, n = (r) => Number.parseInt(t.slice(r * 2, r * 2 + 2), 16) / 255;
174
+ return {
175
+ r: n(0),
176
+ g: n(1),
177
+ b: n(2),
178
+ a: t.length === 8 ? n(3) : 1
179
+ };
180
+ }
181
+ function Le(e) {
182
+ const t = e.trim().toLowerCase();
183
+ if (t === "transparent") return {
184
+ r: 0,
185
+ g: 0,
186
+ b: 0,
187
+ a: 0
188
+ };
189
+ const n = jt.exec(t);
190
+ if (n) return Xt(n[1] ?? "");
191
+ const r = zt.exec(t);
192
+ if (!r) return null;
193
+ const o = r[1], [s = "", u] = (r[2] ?? "").split("/"), a = s.split(/[\s,]+/).filter(Boolean), i = u?.trim() ?? (o === "color" ? void 0 : a[3]), l = i === void 0 ? 1 : B(i, 1);
194
+ if (l === null) return null;
195
+ if (o === "color") {
196
+ const S = a[0], [v, T, R] = [
197
+ B(a[1], 1),
198
+ B(a[2], 1),
199
+ B(a[3], 1)
200
+ ];
201
+ return v === null || T === null || R === null ? null : S === "srgb" ? {
202
+ r: $(v),
203
+ g: $(T),
204
+ b: $(R),
205
+ a: $(l)
206
+ } : S === "srgb-linear" ? te([
207
+ v,
208
+ T,
209
+ R
210
+ ], l) : S === "display-p3" ? te(Ee(Gt, [
211
+ K(v),
212
+ K(T),
213
+ K(R)
214
+ ]), l) : null;
215
+ }
216
+ if (o === "rgb" || o === "rgba") {
217
+ const [S, v, T] = [
218
+ B(a[0], 255),
219
+ B(a[1], 255),
220
+ B(a[2], 255)
221
+ ];
222
+ return S === null || v === null || T === null ? null : {
223
+ r: $(S / 255),
224
+ g: $(v / 255),
225
+ b: $(T / 255),
226
+ a: $(l)
227
+ };
228
+ }
229
+ const c = o === "lab" || o === "lch", f = B(a[0], c ? 100 : 1);
230
+ if (f === null) return null;
231
+ if (o === "oklab" || o === "lab") {
232
+ const [S, v] = [B(a[1], c ? 125 : 0.4), B(a[2], c ? 125 : 0.4)];
233
+ return S === null || v === null ? null : te(c ? He(f, S, v) : qe(f, S, v), l);
234
+ }
235
+ const [d, h] = [B(a[1], c ? 150 : 0.4), B(a[2], 1)];
236
+ if (d === null || h === null) return null;
237
+ const b = h * Math.PI / 180, [_, A] = [d * Math.cos(b), d * Math.sin(b)];
238
+ return te(c ? He(f, _, A) : qe(f, _, A), l);
239
+ }
240
+ var Kt = /(?:rgba?|oklch|oklab|lab|lch|color)\([^()]*\)|\btransparent\b/g;
241
+ function Yt(e) {
242
+ if (!e.includes("gradient(")) return null;
243
+ const t = (e.toLowerCase().match(Kt) ?? []).map(Le).filter((o) => o !== null);
244
+ if (t.length === 0) return null;
245
+ const n = t.reduce((o, s) => o + s.a, 0);
246
+ if (n === 0) return {
247
+ r: 0,
248
+ g: 0,
249
+ b: 0,
250
+ a: 0
251
+ };
252
+ const r = (o) => t.reduce((s, u) => s + u[o] * u.a, 0) / n;
253
+ return {
254
+ r: r("r"),
255
+ g: r("g"),
256
+ b: r("b"),
257
+ a: n / t.length
258
+ };
259
+ }
260
+ function Se({ r: e, g: t, b: n }) {
261
+ const [r, o, s] = [
262
+ K(e),
263
+ K(t),
264
+ K(n)
265
+ ], u = Math.cbrt(0.4122214708 * r + 0.5363325363 * o + 0.0514459929 * s), a = Math.cbrt(0.2119034982 * r + 0.6806995451 * o + 0.1073969566 * s), i = Math.cbrt(0.0883024619 * r + 0.2817188376 * o + 0.6299787005 * s), l = 0.2104542553 * u + 0.793617785 * a - 0.0040720468 * i, c = 1.9779984951 * u - 2.428592205 * a + 0.4505937099 * i, f = 0.0259040371 * u + 0.7827717662 * a - 0.808675766 * i, d = Math.atan2(f, c) * 180 / Math.PI;
266
+ return {
267
+ L: l,
268
+ C: Math.hypot(c, f),
269
+ H: d < 0 ? d + 360 : d
270
+ };
271
+ }
272
+ var Zt = {
273
+ r: 1,
274
+ g: 1,
275
+ b: 1
276
+ }, Qt = {
277
+ r: 18 / 255,
278
+ g: 18 / 255,
279
+ b: 18 / 255
78
280
  };
79
- function Z(e) {
281
+ function Jt(e, t) {
282
+ return e.includes("dark") && (!e.includes("light") || t) ? Qt : Zt;
283
+ }
284
+ function en(e) {
285
+ const t = [], n = Yt(e.backgroundImage);
286
+ n && n.a > 0 && t.push(n);
287
+ const r = Le(e.backgroundColor);
288
+ return r && r.a > 0 && t.push(r), t;
289
+ }
290
+ function tn(e, t) {
291
+ const n = {
292
+ r: 0,
293
+ g: 0,
294
+ b: 0,
295
+ a: 0
296
+ };
297
+ for (const o of e) {
298
+ const s = (1 - n.a) * o.a;
299
+ n.r += o.r * s, n.g += o.g * s, n.b += o.b * s, n.a += s;
300
+ }
301
+ const r = 1 - n.a;
302
+ return {
303
+ r: n.r + t.r * r,
304
+ g: n.g + t.g * r,
305
+ b: n.b + t.b * r
306
+ };
307
+ }
308
+ function nn(e) {
309
+ const t = e.defaultView;
310
+ if (!t || typeof e.elementsFromPoint != "function") return [];
311
+ const { innerWidth: n, innerHeight: r } = t;
312
+ if (!n || !r) return [];
313
+ const o = Jt(t.getComputedStyle(e.documentElement).colorScheme ?? "", typeof t.matchMedia == "function" && t.matchMedia("(prefers-color-scheme: dark)").matches), s = /* @__PURE__ */ new Map(), u = (i) => {
314
+ let l = s.get(i);
315
+ return l || (l = i.matches("[data-leesto-picker-outline], [data-leesto-capture-cover]") ? [] : en(t.getComputedStyle(i)), s.set(i, l)), l;
316
+ }, a = [];
317
+ for (let i = 0; i < 10; i++) for (let l = 0; l < 16; l++) {
318
+ const c = (l + 0.5) * n / 16, f = (i + 0.5) * r / 10, d = [];
319
+ let h = 0;
320
+ for (const b of e.elementsFromPoint(c, f)) {
321
+ for (const _ of u(b))
322
+ d.push(_), h += (1 - h) * _.a;
323
+ if (h >= 0.95) break;
324
+ }
325
+ a.push(tn(d, o));
326
+ }
327
+ return a;
328
+ }
329
+ function rn(e) {
330
+ const t = e.defaultView, n = [];
331
+ for (const r of e.querySelectorAll('meta[name="theme-color"]')) {
332
+ const o = r.getAttribute("media");
333
+ o && !(typeof t?.matchMedia == "function" && t.matchMedia(o).matches) || n.push(r.content);
334
+ }
335
+ t && n.push(t.getComputedStyle(e.documentElement).getPropertyValue("accent-color"));
336
+ for (const r of n) {
337
+ const o = Le(r);
338
+ if (!o || o.a < 0.95) continue;
339
+ const s = {
340
+ r: o.r,
341
+ g: o.g,
342
+ b: o.b
343
+ };
344
+ if (Se(s).C >= 0.035) return s;
345
+ }
346
+ return null;
347
+ }
348
+ var Ue = (e) => Math.floor(e / 30) % 12;
349
+ function on(e, t = null) {
350
+ if (e.length === 0) return null;
351
+ const n = e.map(Se), r = n.reduce((d, h) => d + h.L, 0) / n.length, o = Math.round(Math.min(1, Math.max(0, r)) * 100) / 100, s = Array.from({ length: 12 }, () => 0), u = Array.from({ length: 12 }, () => 0);
352
+ for (const d of n) {
353
+ if (d.C < 0.035) continue;
354
+ const h = Ue(d.H);
355
+ s[h] = (s[h] ?? 0) + d.C ** 2, u[h] = (u[h] ?? 0) + 1;
356
+ }
357
+ const a = (d, h) => (d[(h + 11) % 12] ?? 0) + (d[h] ?? 0) + (d[(h + 1) % 12] ?? 0);
358
+ let i = null;
359
+ for (let d = 0; d < 12; d++)
360
+ a(u, d) < 4 || (i === null || a(s, d) > a(s, i)) && (i = d);
361
+ if (i === null || a(s, i) < 3e-3) return {
362
+ lightness: o,
363
+ hue: t ? Math.round(Se(t).H) % 360 : null
364
+ };
365
+ const l = /* @__PURE__ */ new Set([
366
+ (i + 11) % 12,
367
+ i,
368
+ (i + 1) % 12
369
+ ]), c = {
370
+ x: 0,
371
+ y: 0
372
+ };
373
+ for (const d of n) {
374
+ if (d.C < 0.035 || !l.has(Ue(d.H))) continue;
375
+ const h = d.C ** 2, b = d.H * Math.PI / 180;
376
+ c.x += h * Math.cos(b), c.y += h * Math.sin(b);
377
+ }
378
+ const f = Math.atan2(c.y, c.x) * 180 / Math.PI;
379
+ return {
380
+ lightness: o,
381
+ hue: Math.round(f + 360) % 360
382
+ };
383
+ }
384
+ function sn(e, t) {
385
+ if (!e || Math.abs(Math.round(e.lightness * 100) - Math.round(t.lightness * 100)) >= 2) return !0;
386
+ if (e.hue === null || t.hue === null) return e.hue !== t.hue;
387
+ const n = Math.abs(e.hue - t.hue) % 360;
388
+ return Math.min(n, 360 - n) >= 10;
389
+ }
390
+ var an = [150, 800], ln = 1e3;
391
+ var cn = 2e3, Ge = [
392
+ "class",
393
+ "style",
394
+ "data-theme",
395
+ "data-mode"
396
+ ];
397
+ function un(e, t = () => on(nn(document), rn(document))) {
398
+ let n = !1, r = !1, o = null, s = Number.NEGATIVE_INFINITY, u = null, a = null, i = null, l = null, c = null;
399
+ const f = /* @__PURE__ */ new Set(), d = () => {
400
+ if (n || document.hidden) return;
401
+ const O = s + 250 - Date.now();
402
+ if (O > 0) {
403
+ u ?? (u = setTimeout(() => {
404
+ u = null, d();
405
+ }, O));
406
+ return;
407
+ }
408
+ s = Date.now();
409
+ let C;
410
+ try {
411
+ C = t();
412
+ } catch {
413
+ return;
414
+ }
415
+ !C || !r && !sn(o, C) || (r = !1, o = C, e(C));
416
+ }, h = (O) => {
417
+ const C = setTimeout(() => {
418
+ f.delete(C), d();
419
+ }, O);
420
+ f.add(C);
421
+ }, b = () => {
422
+ d(), a && clearTimeout(a), a = setTimeout(() => {
423
+ a = null, d();
424
+ }, 250);
425
+ }, _ = () => {
426
+ d(), l && clearTimeout(l), l = setTimeout(() => {
427
+ l = null, d();
428
+ }, ln);
429
+ }, A = () => {
430
+ const O = Date.now();
431
+ c ?? (c = O), i && clearTimeout(i);
432
+ const C = Math.max(0, Math.min(500, c + cn - O));
433
+ i = setTimeout(() => {
434
+ i = null, c = null, d();
435
+ }, C);
436
+ }, S = () => {
437
+ document.hidden || h(0);
438
+ }, v = () => d(), T = typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, R = () => h(0), N = new MutationObserver(_);
439
+ N.observe(document.documentElement, {
440
+ attributes: !0,
441
+ attributeFilter: Ge
442
+ });
443
+ const F = new MutationObserver(A);
444
+ return document.body && (N.observe(document.body, {
445
+ attributes: !0,
446
+ attributeFilter: Ge
447
+ }), F.observe(document.body, {
448
+ subtree: !0,
449
+ childList: !0,
450
+ attributes: !0,
451
+ attributeFilter: ["class", "style"]
452
+ })), document.addEventListener("scroll", b, {
453
+ capture: !0,
454
+ passive: !0
455
+ }), window.addEventListener("resize", b), document.addEventListener("visibilitychange", S), T?.addEventListener("change", R), {
456
+ announce: () => {
457
+ n || (r = !0, document.readyState === "complete" ? d() : window.addEventListener("load", v, { once: !0 }));
458
+ },
459
+ navigated: () => {
460
+ if (!n)
461
+ for (const O of an) h(O);
462
+ },
463
+ stop: () => {
464
+ n = !0;
465
+ for (const O of [
466
+ ...f,
467
+ u,
468
+ a,
469
+ i,
470
+ l
471
+ ]) O && clearTimeout(O);
472
+ f.clear(), N.disconnect(), F.disconnect(), document.removeEventListener("scroll", b, { capture: !0 }), window.removeEventListener("resize", b), document.removeEventListener("visibilitychange", S), window.removeEventListener("load", v), T?.removeEventListener("change", R);
473
+ }
474
+ };
475
+ }
476
+ function ne(e) {
80
477
  const t = [];
81
478
  return {
82
479
  push(n) {
@@ -87,14 +484,14 @@ function Z(e) {
87
484
  }
88
485
  };
89
486
  }
90
- var At = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, Lt = /\b\d{3}-\d{2}-\d{4}\b/g, Tt = /\d(?:[ -]?\d){12,18}/g, Ot = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, It = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, kt = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, Nt = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, Ct = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, xt = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, Mt = /\bhttps?:\/\/[^\s"'<>)]+/gi, Dt = /(?::\d+){1,2}$/;
91
- function $t(e) {
487
+ var fn = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, dn = /\b\d{3}-\d{2}-\d{4}\b/g, pn = /\d(?:[ -]?\d){12,18}/g, hn = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, mn = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, gn = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, bn = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, yn = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, vn = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, wn = /\bhttps?:\/\/[^\s"'<>)]+/gi, En = /(?::\d+){1,2}$/;
488
+ function Sn(e) {
92
489
  const t = e.search(/[?#]/);
93
490
  if (t < 0) return e;
94
- const n = Dt.exec(e.slice(t))?.[0] ?? "";
491
+ const n = En.exec(e.slice(t))?.[0] ?? "";
95
492
  return e.slice(0, t) + n;
96
493
  }
97
- function Ft(e) {
494
+ function _n(e) {
98
495
  let t = 0, n = !1;
99
496
  for (let r = e.length - 1; r >= 0; r--) {
100
497
  let o = e.charCodeAt(r) - 48;
@@ -103,80 +500,80 @@ function Ft(e) {
103
500
  }
104
501
  return t % 10 === 0;
105
502
  }
106
- function he(e) {
503
+ function _e(e) {
107
504
  if (!e) return e;
108
- let t = e.replace(Mt, $t).replace(It, "$1$2[secret masqué]").replace(Ot, "$1 [secret masqué]").replace(xt, "[jeton masqué]").replace(Nt, "$1$2[secret masqué]").replace(kt, "$1$2[secret masqué]").replace(Ct, "$1$2[secret masqué]");
109
- return t = t.replace(At, "[email masqué]"), t = t.replace(Lt, "[id masqué]"), t = t.replace(Tt, (n) => {
505
+ let t = e.replace(wn, Sn).replace(mn, "$1$2[secret masqué]").replace(hn, "$1 [secret masqué]").replace(vn, "[jeton masqué]").replace(bn, "$1$2[secret masqué]").replace(gn, "$1$2[secret masqué]").replace(yn, "$1$2[secret masqué]");
506
+ return t = t.replace(fn, "[email masqué]"), t = t.replace(dn, "[id masqué]"), t = t.replace(pn, (n) => {
110
507
  const r = n.replace(/[ -]/g, "");
111
- return r.length >= 13 && r.length <= 19 && Ft(r) ? "[carte masquée]" : n;
508
+ return r.length >= 13 && r.length <= 19 && _n(r) ? "[carte masquée]" : n;
112
509
  }), t;
113
510
  }
114
- function W(e) {
511
+ function V(e) {
115
512
  const t = typeof e == "string" ? e : e instanceof URL ? e.href : e instanceof Request ? e.url : String(e);
116
513
  try {
117
514
  const n = new URL(t, typeof location < "u" ? location.href : void 0);
118
- return n.origin + he(n.pathname);
515
+ return n.origin + _e(n.pathname);
119
516
  } catch {
120
- return he(t.split("?")[0] ?? t);
517
+ return _e(t.split("?")[0] ?? t);
121
518
  }
122
519
  }
123
- var Pt = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), qt = ["deprecation", "intervention"], Bt = { teardown: () => {
520
+ var Tn = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), Rn = ["deprecation", "intervention"], An = { teardown: () => {
124
521
  } };
125
- function Ut(e) {
522
+ function Ln(e) {
126
523
  const t = typeof performance < "u" ? performance.timeOrigin : 0;
127
524
  return Math.round(t + e);
128
525
  }
129
- function Gt(e) {
526
+ function On(e) {
130
527
  const t = e.responseStatus;
131
528
  return typeof t == "number" && t > 0 ? t : void 0;
132
529
  }
133
- function Ht(e) {
134
- if (Pt.has(e.initiatorType)) return null;
135
- const t = Gt(e), n = e.transferSize || e.encodedBodySize || void 0;
530
+ function In(e) {
531
+ if (Tn.has(e.initiatorType)) return null;
532
+ const t = On(e), n = e.transferSize || e.encodedBodySize || void 0;
136
533
  return {
137
534
  method: "GET",
138
- url: W(e.name),
535
+ url: V(e.name),
139
536
  ...t !== void 0 ? { status: t } : {},
140
537
  durationMs: Math.round(e.duration),
141
538
  ...n ? { responseSize: n } : {},
142
- startedAt: Ut(e.startTime),
539
+ startedAt: Ln(e.startTime),
143
540
  ...t !== void 0 && t >= 400 ? { failed: !0 } : {},
144
541
  initiatorType: e.initiatorType
145
542
  };
146
543
  }
147
- function Wt(e) {
148
- if (typeof window > "u") return Bt;
544
+ function Cn(e) {
545
+ if (typeof window > "u") return An;
149
546
  const t = [];
150
547
  if (typeof PerformanceObserver < "u") try {
151
- const i = new PerformanceObserver((u) => {
152
- for (const l of u.getEntries()) try {
153
- const s = Ht(l);
154
- s && e.onResource(s);
548
+ const s = new PerformanceObserver((u) => {
549
+ for (const a of u.getEntries()) try {
550
+ const i = In(a);
551
+ i && e.onResource(i);
155
552
  } catch {
156
553
  }
157
554
  });
158
- i.observe({
555
+ s.observe({
159
556
  type: "resource",
160
557
  buffered: !0
161
- }), t.push(() => i.disconnect());
558
+ }), t.push(() => s.disconnect());
162
559
  } catch {
163
560
  }
164
561
  const n = window.ReportingObserver;
165
562
  if (n) try {
166
- const i = new n(((u) => {
167
- for (const l of u) {
168
- const s = typeof l.body?.message == "string" ? l.body.message : l.type;
169
- e.onReport("warn", `Navigateur (${l.type}) : ${s}`);
563
+ const s = new n(((u) => {
564
+ for (const a of u) {
565
+ const i = typeof a.body?.message == "string" ? a.body.message : a.type;
566
+ e.onReport("warn", `Navigateur (${a.type}) : ${i}`);
170
567
  }
171
568
  }), {
172
- types: qt,
569
+ types: Rn,
173
570
  buffered: !0
174
571
  });
175
- i.observe(), t.push(() => i.disconnect());
572
+ s.observe(), t.push(() => s.disconnect());
176
573
  } catch {
177
574
  }
178
- const r = (i) => {
179
- const u = i;
575
+ const r = (s) => {
576
+ const u = s;
180
577
  e.onReport("error", `CSP : ${u.blockedURI || "ressource"} bloqué par « ${u.violatedDirective} »`);
181
578
  };
182
579
  window.addEventListener("securitypolicyviolation", r), t.push(() => window.removeEventListener("securitypolicyviolation", r));
@@ -184,50 +581,50 @@ function Wt(e) {
184
581
  return { teardown: () => {
185
582
  if (!o) {
186
583
  o = !0;
187
- for (const i of t) try {
188
- i();
584
+ for (const s of t) try {
585
+ s();
189
586
  } catch {
190
587
  }
191
588
  }
192
589
  } };
193
590
  }
194
- var zt = 50, jt = 30, Vt = 100, Xt = 50, K = 500, Pe = 8e3, Kt = K * 4, Yt = Pe * 2;
195
- function qe(e, t, n) {
196
- return he(e.slice(0, n)).slice(0, t);
591
+ var kn = 50, Nn = 30, Mn = 100, xn = 50, J = 500, tt = 8e3, Dn = J * 4, Fn = tt * 2;
592
+ function nt(e, t, n) {
593
+ return _e(e.slice(0, n)).slice(0, t);
197
594
  }
198
- function V(e) {
199
- return qe(e, K, Kt);
595
+ function Z(e) {
596
+ return nt(e, J, Dn);
200
597
  }
201
- var Zt = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
202
- function ce(e) {
598
+ var Pn = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
599
+ function ge(e) {
203
600
  const t = e instanceof Error ? e.stack : void 0;
204
601
  if (t)
205
- return qe(t, Pe, Yt);
602
+ return nt(t, tt, Fn);
206
603
  }
207
- function ue(e) {
604
+ function be(e) {
208
605
  if (e instanceof Error) return `${e.name}: ${e.message}`;
209
606
  if (typeof e == "string") return e;
210
607
  if (typeof e == "object" && e !== null) {
211
608
  const t = /* @__PURE__ */ Symbol("overflow");
212
- let n = K * 8;
609
+ let n = J * 8;
213
610
  try {
214
611
  return JSON.stringify(e, (r, o) => {
215
- if (Zt.test(r)) return "[masqué]";
612
+ if (Pn.test(r)) return "[masqué]";
216
613
  if (n -= r.length + (typeof o == "string" ? o.length : 8), n < 0) throw t;
217
614
  return o;
218
- }).slice(0, K);
615
+ }).slice(0, J);
219
616
  } catch (r) {
220
617
  return r === t ? "[objet volumineux]" : "[objet]";
221
618
  }
222
619
  }
223
620
  return String(e);
224
621
  }
225
- function Oe(e) {
622
+ function We(e) {
226
623
  if (!e) return;
227
624
  const t = Number(e);
228
625
  return Number.isFinite(t) && t >= 0 ? t : void 0;
229
626
  }
230
- var Jt = {
627
+ var Bn = {
231
628
  snapshot: () => ({
232
629
  errors: [],
233
630
  logs: [],
@@ -240,252 +637,280 @@ var Jt = {
240
637
  teardown: () => {
241
638
  }
242
639
  };
243
- function Be(e) {
244
- if (typeof window > "u") return Jt;
245
- const t = Z(zt), n = Z(jt), r = Z(Vt), o = Z(Xt), i = te(e.runId) ? e.runId : void 0, u = (f) => {
246
- if (!i) return !1;
640
+ function rt(e) {
641
+ if (typeof window > "u") return Bn;
642
+ const t = ne(kn), n = ne(Nn), r = ne(Mn), o = ne(xn), s = ie(e.runId) ? e.runId : void 0, u = (p) => {
643
+ if (!s) return !1;
247
644
  try {
248
- const p = new URL(String(f), location.href);
249
- return p.origin === location.origin || (e.runIdOrigins ?? []).includes(p.origin);
645
+ const m = new URL(String(p), location.href);
646
+ return m.origin === location.origin || (e.runIdOrigins ?? []).includes(m.origin);
250
647
  } catch {
251
648
  return !1;
252
649
  }
253
650
  };
254
- let l = e.sink ?? null;
255
- const s = (f, p) => {
256
- l?.(f, p);
257
- }, a = (f) => {
258
- e.captureNetwork && t.push(f);
259
- }, c = (f) => {
260
- e.captureNetwork && s(bt, f);
261
- }, d = (f, p, m, E = {}) => {
262
- if (!p) return;
263
- const I = {
264
- level: f,
265
- message: p,
266
- ...m ? { stack: m } : {},
267
- ...E,
651
+ let a = e.sink ?? null;
652
+ const i = (p, m) => {
653
+ a?.(p, m);
654
+ }, l = (p) => {
655
+ e.captureNetwork && t.push(p);
656
+ }, c = (p) => {
657
+ e.captureNetwork && i(Pt, p);
658
+ }, f = (p, m, y, L = {}) => {
659
+ if (!m) return;
660
+ const k = {
661
+ level: p,
662
+ message: m,
663
+ ...y ? { stack: y } : {},
664
+ ...L,
268
665
  at: Date.now()
269
666
  };
270
- o.push(I), s(Te, I);
271
- }, y = (f, p) => {
667
+ o.push(k), i($e, k);
668
+ }, d = (p, m) => {
272
669
  try {
273
- const m = V(p.map(ue).join(" ")), E = p.find((I) => I instanceof Error);
274
- d(f, m, ce(E), {
670
+ const y = Z(m.map(be).join(" ")), L = m.find((k) => k instanceof Error);
671
+ f(p, y, ge(L), {
275
672
  mechanism: "console",
276
- ...E instanceof Error && E.name ? { name: E.name } : {}
673
+ ...L instanceof Error && L.name ? { name: L.name } : {}
277
674
  });
278
675
  } catch {
279
676
  }
280
- }, b = (f, p) => {
677
+ }, h = (p, m) => {
281
678
  try {
282
- const m = V(p.map(ue).join(" "));
283
- m && r.push({
284
- level: f,
285
- message: m,
679
+ const y = Z(m.map(be).join(" "));
680
+ y && r.push({
681
+ level: p,
682
+ message: y,
286
683
  at: Date.now()
287
684
  });
288
685
  } catch {
289
686
  }
290
- }, w = console.error, _ = console.warn, R = console.log, S = console.info;
291
- console.error = (...f) => (y("error", f), w.apply(console, f)), console.warn = (...f) => (y("warn", f), _.apply(console, f)), console.log = (...f) => (b("log", f), R.apply(console, f)), console.info = (...f) => (b("info", f), S.apply(console, f));
292
- const A = (f) => {
293
- const p = f.target;
294
- if (p instanceof Element) {
295
- const E = p.src || p.href || "";
296
- if (!E) return;
297
- d("error", `Ressource non chargée : <${p.tagName.toLowerCase()}> ${W(E)}`.slice(0, K), void 0, {
687
+ }, b = console.error, _ = console.warn, A = console.log, S = console.info;
688
+ console.error = (...p) => (d("error", p), b.apply(console, p)), console.warn = (...p) => (d("warn", p), _.apply(console, p)), console.log = (...p) => (h("log", p), A.apply(console, p)), console.info = (...p) => (h("info", p), S.apply(console, p));
689
+ const v = (p) => {
690
+ const m = p.target;
691
+ if (m instanceof Element) {
692
+ const L = m.src || m.href || "";
693
+ if (!L) return;
694
+ f("error", `Ressource non chargée : <${m.tagName.toLowerCase()}> ${V(L)}`.slice(0, J), void 0, {
298
695
  mechanism: "resource",
299
- sourceUrl: W(E)
696
+ sourceUrl: V(L)
300
697
  });
301
698
  return;
302
699
  }
303
- const m = f;
304
- d("error", V(`Erreur non gérée : ${m.message}`), ce(m.error), {
700
+ const y = p;
701
+ f("error", Z(`Erreur non gérée : ${y.message}`), ge(y.error), {
305
702
  mechanism: "window.error",
306
- ...typeof m.error?.name == "string" ? { name: m.error.name } : {},
307
- ...typeof m.filename == "string" && m.filename ? { sourceUrl: W(m.filename) } : {},
308
- ...typeof m.lineno == "number" && m.lineno > 0 ? { line: m.lineno } : {},
309
- ...typeof m.colno == "number" && m.colno > 0 ? { column: m.colno } : {}
703
+ ...typeof y.error?.name == "string" ? { name: y.error.name } : {},
704
+ ...typeof y.filename == "string" && y.filename ? { sourceUrl: V(y.filename) } : {},
705
+ ...typeof y.lineno == "number" && y.lineno > 0 ? { line: y.lineno } : {},
706
+ ...typeof y.colno == "number" && y.colno > 0 ? { column: y.colno } : {}
310
707
  });
311
- }, C = (f) => {
312
- d("error", V(`Promesse rejetée : ${ue(f.reason)}`), ce(f.reason), {
708
+ }, T = (p) => {
709
+ f("error", Z(`Promesse rejetée : ${be(p.reason)}`), ge(p.reason), {
313
710
  mechanism: "unhandledrejection",
314
- ...f.reason instanceof Error && f.reason.name ? { name: f.reason.name } : {}
711
+ ...p.reason instanceof Error && p.reason.name ? { name: p.reason.name } : {}
315
712
  });
316
713
  };
317
- window.addEventListener("error", A, !0), window.addEventListener("unhandledrejection", C);
318
- const O = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
319
- O && (window.fetch = (async (f, p) => {
320
- const m = Date.now(), E = (p?.method ?? (f instanceof Request ? f.method : "GET") ?? "GET").toUpperCase(), I = W(f);
321
- let B = p;
322
- if (i && u(f)) {
323
- const L = new Headers(f instanceof Request ? f.headers : void 0);
324
- for (const [T, G] of new Headers(p?.headers)) L.set(T, G);
325
- L.set(Le, i), B = {
326
- ...p,
327
- headers: L
714
+ window.addEventListener("error", v, !0), window.addEventListener("unhandledrejection", T);
715
+ const R = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
716
+ R && (window.fetch = (async (p, m) => {
717
+ const y = Date.now(), L = (m?.method ?? (p instanceof Request ? p.method : "GET") ?? "GET").toUpperCase(), k = V(p);
718
+ let q = m;
719
+ if (s && u(p)) {
720
+ const I = new Headers(p instanceof Request ? p.headers : void 0);
721
+ for (const [P, G] of new Headers(m?.headers)) I.set(P, G);
722
+ I.set(Be, s), q = {
723
+ ...m,
724
+ headers: I
328
725
  };
329
726
  }
330
727
  try {
331
- const L = await O(f, B);
728
+ const I = await R(p, q);
332
729
  try {
333
- const T = L.headers.get("x-request-id"), G = L.headers.get("traceparent");
334
- a({
335
- method: E,
336
- url: I,
337
- status: L.status,
338
- durationMs: Date.now() - m,
339
- responseSize: Oe(L.headers.get("content-length")),
340
- contentType: L.headers.get("content-type") ?? void 0,
341
- startedAt: m,
342
- ...T ? { requestId: T.slice(0, 200) } : {},
730
+ const P = I.headers.get("x-request-id"), G = I.headers.get("traceparent");
731
+ l({
732
+ method: L,
733
+ url: k,
734
+ status: I.status,
735
+ durationMs: Date.now() - y,
736
+ responseSize: We(I.headers.get("content-length")),
737
+ contentType: I.headers.get("content-type") ?? void 0,
738
+ startedAt: y,
739
+ ...P ? { requestId: P.slice(0, 200) } : {},
343
740
  ...G ? { traceparent: G.slice(0, 200) } : {},
344
- ...i ? { runId: i } : {}
345
- }), L.ok || c({
346
- method: E,
347
- url: I,
348
- status: L.status,
349
- durationMs: Date.now() - m
741
+ ...s ? { runId: s } : {}
742
+ }), I.ok || c({
743
+ method: L,
744
+ url: k,
745
+ status: I.status,
746
+ durationMs: Date.now() - y
350
747
  });
351
748
  } catch {
352
749
  }
353
- return L;
354
- } catch (L) {
750
+ return I;
751
+ } catch (I) {
355
752
  try {
356
- const T = Date.now() - m;
357
- a({
358
- method: E,
359
- url: I,
753
+ const P = Date.now() - y;
754
+ l({
755
+ method: L,
756
+ url: k,
360
757
  status: 0,
361
- durationMs: T,
362
- startedAt: m,
758
+ durationMs: P,
759
+ startedAt: y,
363
760
  failed: !0,
364
- ...i ? { runId: i } : {}
761
+ ...s ? { runId: s } : {}
365
762
  }), c({
366
- method: E,
367
- url: I,
763
+ method: L,
764
+ url: k,
368
765
  status: 0,
369
- durationMs: T
766
+ durationMs: P
370
767
  });
371
768
  } catch {
372
769
  }
373
- throw L;
770
+ throw I;
374
771
  }
375
772
  }));
376
- const M = XMLHttpRequest.prototype.open, D = XMLHttpRequest.prototype.send, F = "__echoNet";
377
- XMLHttpRequest.prototype.open = function(f, p, ...m) {
378
- return this[F] = {
379
- method: (f || "GET").toUpperCase(),
380
- url: W(p),
773
+ const N = XMLHttpRequest.prototype.open, F = XMLHttpRequest.prototype.send, O = "__echoNet";
774
+ XMLHttpRequest.prototype.open = function(p, m, ...y) {
775
+ return this[O] = {
776
+ method: (p || "GET").toUpperCase(),
777
+ url: V(m),
381
778
  start: 0,
382
- propagate: u(p)
383
- }, M.apply(this, [
384
- f,
779
+ propagate: u(m)
780
+ }, N.apply(this, [
385
781
  p,
386
- ...m
782
+ m,
783
+ ...y
387
784
  ]);
388
- }, XMLHttpRequest.prototype.send = function(...f) {
389
- const p = this[F];
390
- if (p) {
391
- if (p.start = Date.now(), i && p.propagate) try {
392
- this.setRequestHeader(Le, i);
785
+ }, XMLHttpRequest.prototype.send = function(...p) {
786
+ const m = this[O];
787
+ if (m) {
788
+ if (m.start = Date.now(), s && m.propagate) try {
789
+ this.setRequestHeader(Be, s);
393
790
  } catch {
394
791
  }
395
792
  this.addEventListener("loadend", () => {
396
793
  try {
397
- const m = Date.now() - p.start, E = this.status, I = E === 0, B = this.getResponseHeader("x-request-id"), L = this.getResponseHeader("traceparent");
398
- a({
399
- method: p.method,
400
- url: p.url,
401
- status: E,
402
- durationMs: m,
403
- responseSize: Oe(this.getResponseHeader("content-length")),
794
+ const y = Date.now() - m.start, L = this.status, k = L === 0, q = this.getResponseHeader("x-request-id"), I = this.getResponseHeader("traceparent");
795
+ l({
796
+ method: m.method,
797
+ url: m.url,
798
+ status: L,
799
+ durationMs: y,
800
+ responseSize: We(this.getResponseHeader("content-length")),
404
801
  contentType: this.getResponseHeader("content-type") ?? void 0,
405
- startedAt: p.start,
406
- ...I ? { failed: !0 } : {},
407
- ...i ? { runId: i } : {},
408
- ...B ? { requestId: B.slice(0, 200) } : {},
409
- ...L ? { traceparent: L.slice(0, 200) } : {}
410
- }), (I || E >= 400) && c({
411
- method: p.method,
412
- url: p.url,
413
- status: E,
414
- durationMs: m
802
+ startedAt: m.start,
803
+ ...k ? { failed: !0 } : {},
804
+ ...s ? { runId: s } : {},
805
+ ...q ? { requestId: q.slice(0, 200) } : {},
806
+ ...I ? { traceparent: I.slice(0, 200) } : {}
807
+ }), (k || L >= 400) && c({
808
+ method: m.method,
809
+ url: m.url,
810
+ status: L,
811
+ durationMs: y
415
812
  });
416
813
  } catch {
417
814
  }
418
815
  }, { once: !0 });
419
816
  }
420
- return D.apply(this, f);
817
+ return F.apply(this, p);
421
818
  };
422
- const q = Wt({
423
- onResource: (f) => {
424
- e.captureNetwork && n.push(i ? {
425
- ...f,
426
- runId: i
427
- } : f);
819
+ const C = Cn({
820
+ onResource: (p) => {
821
+ e.captureNetwork && n.push(s ? {
822
+ ...p,
823
+ runId: s
824
+ } : p);
428
825
  },
429
- onReport: (f, p) => d(f, V(p), void 0, { mechanism: "report" })
430
- }), $ = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((f, p) => f.startedAt - p.startedAt) : [];
431
- let U = !1;
826
+ onReport: (p, m) => f(p, Z(m), void 0, { mechanism: "report" })
827
+ }), Y = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((p, m) => p.startedAt - m.startedAt) : [];
828
+ let j = !1;
432
829
  return {
433
830
  snapshot: () => ({
434
831
  errors: o.snapshot(),
435
832
  logs: r.snapshot(),
436
- network: $(),
437
- ...i ? { runId: i } : {}
833
+ network: Y(),
834
+ ...s ? { runId: s } : {}
438
835
  }),
439
- setSink: (f) => {
440
- l = f;
836
+ setSink: (p) => {
837
+ a = p;
441
838
  },
442
839
  flushRings: () => {
443
- const f = $();
444
- f.length > 0 && s(wt, { entries: f });
445
- const p = r.snapshot();
446
- p.length > 0 && s(Et, { entries: p });
447
- const m = o.snapshot();
448
- m.length > 0 && s(Te, { entries: m });
840
+ const p = Y();
841
+ p.length > 0 && i(Bt, { entries: p });
842
+ const m = r.snapshot();
843
+ m.length > 0 && i($t, { entries: m });
844
+ const y = o.snapshot();
845
+ y.length > 0 && i($e, { entries: y });
449
846
  },
450
847
  teardown: () => {
451
- U || (U = !0, l = null, q.teardown(), console.error = w, console.warn = _, console.log = R, console.info = S, window.removeEventListener("error", A, !0), window.removeEventListener("unhandledrejection", C), O && (window.fetch = O), XMLHttpRequest.prototype.open = M, XMLHttpRequest.prototype.send = D);
848
+ j || (j = !0, a = null, C.teardown(), console.error = b, console.warn = _, console.log = A, console.info = S, window.removeEventListener("error", v, !0), window.removeEventListener("unhandledrejection", T), R && (window.fetch = R), XMLHttpRequest.prototype.open = N, XMLHttpRequest.prototype.send = F);
452
849
  }
453
850
  };
454
851
  }
455
- var ve = "leesto-mask", ne = "[data-leesto-block]", Ue = "leesto-mask-text", Ge = "[data-private]", He = `.${Ue}, ${Ge}`, Qt = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', en = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
456
- var We = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
457
- function ze(e) {
852
+ var $n = "data-leesto-scrollbars", qn = `@supports selector(::-webkit-scrollbar) {
853
+ ::-webkit-scrollbar { width: 10px; height: 10px; }
854
+ ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
855
+ ::-webkit-scrollbar-thumb {
856
+ background-color: rgb(128 128 128 / 0.4);
857
+ background-clip: padding-box;
858
+ border: 3px solid transparent;
859
+ border-radius: 999px;
860
+ }
861
+ }
862
+ @supports not selector(::-webkit-scrollbar) {
863
+ :where(html) { scrollbar-color: rgb(128 128 128 / 0.5) transparent; }
864
+ :where(*) { scrollbar-width: thin; }
865
+ }`;
866
+ function Hn(e) {
867
+ const t = e.createElement("div");
868
+ t.style.cssText = "position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden", e.documentElement.append(t);
869
+ const n = t.offsetWidth - t.clientWidth;
870
+ return t.remove(), n;
871
+ }
872
+ function Un(e = document, t = Hn) {
873
+ if (e.querySelector("style[data-leesto-scrollbars]")) return () => {
874
+ };
875
+ if (t(e) <= 0) return () => {
876
+ };
877
+ const n = e.createElement("style");
878
+ return n.setAttribute($n, ""), n.textContent = qn, (e.head ?? e.documentElement).prepend(n), () => n.remove();
879
+ }
880
+ var Oe = "leesto-mask", ae = "[data-leesto-block]", ot = "leesto-mask-text", st = "[data-private]", it = `.${ot}, ${st}`, Gn = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', Wn = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
881
+ var at = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
882
+ function lt(e) {
458
883
  return e.replace(/\S/g, "*");
459
884
  }
460
- function tn(e, t) {
885
+ function Vn(e, t) {
461
886
  try {
462
887
  return e.closest(t);
463
888
  } catch {
464
889
  return null;
465
890
  }
466
891
  }
467
- function je(e) {
468
- return tn(e, He) !== null;
892
+ function ct(e) {
893
+ return Vn(e, it) !== null;
469
894
  }
470
- var nn = `.${ve}, ${ne}, ${He}`;
471
- function Y(e) {
895
+ var zn = `.${Oe}, ${ae}, ${it}`;
896
+ function ee(e) {
472
897
  try {
473
- return e.closest(nn) !== null;
898
+ return e.closest(zn) !== null;
474
899
  } catch {
475
900
  return !0;
476
901
  }
477
902
  }
478
- function Ve(e) {
903
+ function ut(e) {
479
904
  if (!e || typeof e.closest != "function") return !1;
480
905
  try {
481
- if (je(e) || e.matches(We)) return !1;
482
- const t = e.closest(en);
906
+ if (ct(e) || e.matches(at)) return !1;
907
+ const t = e.closest(Wn);
483
908
  return t ? (t.textContent ?? "").trim().length <= 80 : !1;
484
909
  } catch {
485
910
  return !1;
486
911
  }
487
912
  }
488
- var Ie = {
913
+ var Ve = {
489
914
  maskAllInputs: !0,
490
915
  maskInputOptions: {
491
916
  password: !0,
@@ -493,26 +918,26 @@ var Ie = {
493
918
  tel: !0,
494
919
  text: !0
495
920
  },
496
- blockClass: ve,
497
- maskTextClass: Ue
921
+ blockClass: Oe,
922
+ maskTextClass: ot
498
923
  };
499
- function Xe(e) {
924
+ function ft(e) {
500
925
  if (e === "inputs_only") return {
501
- ...Ie,
502
- blockSelector: ne,
503
- maskTextSelector: Ge
926
+ ...Ve,
927
+ blockSelector: ae,
928
+ maskTextSelector: st
504
929
  };
505
930
  const t = {
506
- ...Ie,
507
- blockSelector: `${ne}, ${Qt}`,
931
+ ...Ve,
932
+ blockSelector: `${ae}, ${Gn}`,
508
933
  maskTextSelector: "*"
509
934
  };
510
935
  return e === "labels_visible" ? {
511
936
  ...t,
512
- maskTextFn: (n, r) => Ve(r) ? n : ze(n)
937
+ maskTextFn: (n, r) => ut(r) ? n : lt(n)
513
938
  } : t;
514
939
  }
515
- var ke = /* @__PURE__ */ new Set([
940
+ var ze = /* @__PURE__ */ new Set([
516
941
  "placeholder",
517
942
  "title",
518
943
  "alt",
@@ -522,10 +947,10 @@ var ke = /* @__PURE__ */ new Set([
522
947
  "aria-placeholder",
523
948
  "aria-roledescription",
524
949
  "aria-valuetext"
525
- ]), rn = 2, on = 3, sn = 4, an = 0, ln = 2;
526
- function cn(e, t, n) {
950
+ ]), jn = 2, Xn = 3, Kn = 4, Yn = 0, Zn = 2;
951
+ function Qn(e, t, n) {
527
952
  if (e) try {
528
- return e.matches(We);
953
+ return e.matches(at);
529
954
  } catch {
530
955
  return !0;
531
956
  }
@@ -535,47 +960,47 @@ function cn(e, t, n) {
535
960
  const o = String(n.type ?? "").toLowerCase();
536
961
  return o !== "button" && o !== "submit" && o !== "reset";
537
962
  }
538
- function Ke(e, t, n) {
963
+ function dt(e, t, n) {
539
964
  const r = e;
540
965
  if (!r || typeof r != "object" || !r.data) return e;
541
- const o = (a) => {
542
- if (typeof a != "number") return null;
966
+ const o = (l) => {
967
+ if (typeof l != "number") return null;
543
968
  try {
544
- const c = n(a);
969
+ const c = n(l);
545
970
  return c && c.nodeType === 1 ? c : null;
546
971
  } catch {
547
972
  return null;
548
973
  }
549
- }, i = (a, c, d, y) => {
974
+ }, s = (l, c, f, d) => {
550
975
  if (c === "value") {
551
- if (cn(a, d, y)) return !1;
552
- } else if (!ke.has(c)) return !0;
553
- return !a || je(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? Ve(a) : !1;
554
- }, u = (a, c, d) => {
555
- if (d)
556
- for (const y of Object.keys(d)) {
557
- const b = d[y];
558
- typeof b != "string" || !b || y !== "value" && !ke.has(y) || i(a, y, c, d) || (d[y] = ze(b));
976
+ if (Qn(l, f, d)) return !1;
977
+ } else if (!ze.has(c)) return !0;
978
+ return !l || ct(l) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? ut(l) : !1;
979
+ }, u = (l, c, f) => {
980
+ if (f)
981
+ for (const d of Object.keys(f)) {
982
+ const h = f[d];
983
+ typeof h != "string" || !h || d !== "value" && !ze.has(d) || s(l, d, c, f) || (f[d] = lt(h));
559
984
  }
560
- }, l = (a) => {
561
- const c = a ? [a] : [];
985
+ }, a = (l) => {
986
+ const c = l ? [l] : [];
562
987
  for (; c.length > 0; ) {
563
- const d = c.pop();
564
- d.type === ln && d.attributes && u(o(d.id), String(d.tagName ?? ""), d.attributes), Array.isArray(d.childNodes) && c.push(...d.childNodes);
988
+ const f = c.pop();
989
+ f.type === Zn && f.attributes && u(o(f.id), String(f.tagName ?? ""), f.attributes), Array.isArray(f.childNodes) && c.push(...f.childNodes);
565
990
  }
566
- }, s = r.data;
567
- if (r.type === sn && typeof s.href == "string") s.href = vt(s.href);
568
- else if (r.type === rn) l(s.node);
569
- else if (r.type === on && s.source === an) {
570
- for (const a of s.adds ?? []) l(a.node);
571
- for (const a of s.attributes ?? []) {
572
- const c = o(a.id);
573
- u(c, c?.tagName ?? "", a.attributes);
991
+ }, i = r.data;
992
+ if (r.type === Kn && typeof i.href == "string") i.href = Ft(i.href);
993
+ else if (r.type === jn) a(i.node);
994
+ else if (r.type === Xn && i.source === Yn) {
995
+ for (const l of i.adds ?? []) a(l.node);
996
+ for (const l of i.attributes ?? []) {
997
+ const c = o(l.id);
998
+ u(c, c?.tagName ?? "", l.attributes);
574
999
  }
575
1000
  }
576
1001
  return e;
577
1002
  }
578
- var un = 80, fn = {
1003
+ var Jn = 80, er = {
579
1004
  a: "link",
580
1005
  button: "button",
581
1006
  img: "img",
@@ -588,50 +1013,50 @@ var un = 80, fn = {
588
1013
  h5: "heading",
589
1014
  h6: "heading",
590
1015
  dialog: "dialog"
591
- }, dn = {
1016
+ }, tr = {
592
1017
  button: "button",
593
1018
  submit: "button",
594
1019
  reset: "button",
595
1020
  checkbox: "checkbox",
596
1021
  radio: "radio",
597
1022
  search: "searchbox"
598
- }, H = (e) => {
1023
+ }, W = (e) => {
599
1024
  const t = (e ?? "").replace(/\s+/g, " ").trim();
600
- return t ? t.slice(0, un) : null;
1025
+ return t ? t.slice(0, Jn) : null;
601
1026
  };
602
- function pn(e) {
1027
+ function nr(e) {
603
1028
  const t = [];
604
1029
  let n = 0;
605
1030
  const r = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
606
1031
  for (let o = r.nextNode(); o && n < 320; o = r.nextNode()) {
607
- const i = o.parentElement;
608
- if (i && i !== e && Y(i)) continue;
1032
+ const s = o.parentElement;
1033
+ if (s && s !== e && ee(s)) continue;
609
1034
  const u = o.nodeValue ?? "";
610
1035
  u.trim() && (t.push(u), n += u.length);
611
1036
  }
612
1037
  return t.join(" ");
613
1038
  }
614
- function hn(e, t) {
1039
+ function rr(e, t) {
615
1040
  const n = e.getAttribute("role")?.trim().split(/\s+/)[0];
616
- return n || (t === "input" ? dn[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : fn[t] ?? null);
1041
+ return n || (t === "input" ? tr[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : er[t] ?? null);
617
1042
  }
618
- function mn(e) {
1043
+ function or(e) {
619
1044
  const t = (e.getAttribute("aria-labelledby")?.split(/\s+/).filter(Boolean) ?? []).map((n) => {
620
1045
  const r = e.ownerDocument.getElementById(n);
621
- return r && !Y(r) ? r.textContent ?? "" : "";
1046
+ return r && !ee(r) ? r.textContent ?? "" : "";
622
1047
  });
623
- return H(t.join(" "));
1048
+ return W(t.join(" "));
624
1049
  }
625
- function gn(e, t) {
626
- const n = H(e.getAttribute("aria-label")) ?? mn(e) ?? (t === "img" ? H(e.getAttribute("alt")) : null) ?? H(e.getAttribute("title"));
1050
+ function sr(e, t) {
1051
+ const n = W(e.getAttribute("aria-label")) ?? or(e) ?? (t === "img" ? W(e.getAttribute("alt")) : null) ?? W(e.getAttribute("title"));
627
1052
  if (n) return n;
628
1053
  if (t === "input" || t === "textarea" || t === "select") {
629
- const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, i = o && !Y(o) ? o.textContent : null;
630
- return H(i) ?? H(e.getAttribute("placeholder"));
1054
+ const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, s = o && !ee(o) ? o.textContent : null;
1055
+ return W(s) ?? W(e.getAttribute("placeholder"));
631
1056
  }
632
- return H(pn(e));
1057
+ return W(nr(e));
633
1058
  }
634
- function yn(e) {
1059
+ function ir(e) {
635
1060
  if (!e) return null;
636
1061
  try {
637
1062
  const t = new URL(e, document.baseURI);
@@ -640,52 +1065,52 @@ function yn(e) {
640
1065
  return null;
641
1066
  }
642
1067
  }
643
- function vn(e) {
644
- const t = e.tagName.toLowerCase(), n = Y(e), r = {
1068
+ function ar(e) {
1069
+ const t = e.tagName.toLowerCase(), n = ee(e), r = {
645
1070
  tag: t,
646
- role: hn(e, t),
647
- name: n ? null : gn(e, t)
1071
+ role: rr(e, t),
1072
+ name: n ? null : sr(e, t)
648
1073
  };
649
1074
  return e instanceof HTMLImageElement && (r.image = {
650
- src: n ? null : yn(e.currentSrc || e.getAttribute("src") || ""),
1075
+ src: n ? null : ir(e.currentSrc || e.getAttribute("src") || ""),
651
1076
  loaded: e.complete && e.naturalWidth > 0
652
1077
  }), r;
653
1078
  }
654
- var bn = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, wn = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, En = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', Sn = 3;
655
- function me(e) {
1079
+ var lr = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, cr = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, ur = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', fr = 3;
1080
+ function Te(e) {
656
1081
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/\s+/g, " ").trim().toLowerCase();
657
1082
  }
658
- function _n(e) {
1083
+ function dr(e) {
659
1084
  const t = e.getAttribute("aria-label");
660
1085
  return t || (e instanceof HTMLInputElement ? e.value : e.textContent ?? "");
661
1086
  }
662
- function Rn(e) {
663
- for (const t of Array.from(e.querySelectorAll(En))) {
664
- if (bn.test(me(_n(t)))) return !0;
1087
+ function pr(e) {
1088
+ for (const t of Array.from(e.querySelectorAll(ur))) {
1089
+ if (lr.test(Te(dr(t)))) return !0;
665
1090
  const n = t.getAttribute("href");
666
- if (n && wn.test(n)) return !0;
1091
+ if (n && cr.test(n)) return !0;
667
1092
  }
668
1093
  return !1;
669
1094
  }
670
- function An(e, t) {
671
- const n = me(t);
672
- return n.length < Sn || !e.body ? !1 : me(e.body.innerText ?? e.body.textContent).includes(n);
1095
+ function hr(e, t) {
1096
+ const n = Te(t);
1097
+ return n.length < fr || !e.body ? !1 : Te(e.body.innerText ?? e.body.textContent).includes(n);
673
1098
  }
674
- function Ln(e, t) {
675
- return An(e, t) ? "same-account" : Rn(e) ? "signed-in" : "unknown";
1099
+ function mr(e, t) {
1100
+ return hr(e, t) ? "same-account" : pr(e) ? "signed-in" : "unknown";
676
1101
  }
677
- var Tn = 100, On = 800, In = [
1102
+ var gr = 100, br = 800, yr = [
678
1103
  "hidden",
679
1104
  "class",
680
1105
  "style",
681
1106
  "type",
682
1107
  "disabled",
683
1108
  "aria-hidden"
684
- ], ie = 'input[type="password"]', Ye = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', se = `${ie}, ${Ye}`, re = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, ge = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, kn = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, Nn = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Cn = /\b(effacer|vider|supprimer|clear|reset)\b/, xn = /[\u{1F441}\u{1F576}\u{1F440}]/u;
685
- function X(e) {
1109
+ ], ue = 'input[type="password"]', pt = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', fe = `${ue}, ${pt}`, le = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, Re = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, vr = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, wr = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Er = /\b(effacer|vider|supprimer|clear|reset)\b/, Sr = /[\u{1F441}\u{1F576}\u{1F440}]/u;
1110
+ function Q(e) {
686
1111
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[’‘]/g, "'").replace(/\s+/g, " ").trim().toLowerCase();
687
1112
  }
688
- function ae(e) {
1113
+ function de(e) {
689
1114
  let t = e;
690
1115
  for (; t; ) {
691
1116
  if (t.hasAttribute("hidden") || t.getAttribute("aria-hidden") === "true" || t instanceof HTMLInputElement && t.type === "hidden") return !1;
@@ -696,42 +1121,42 @@ function ae(e) {
696
1121
  return !0;
697
1122
  }
698
1123
  function z(e, t) {
699
- return Array.from(e.querySelectorAll(t)).filter(ae);
1124
+ return Array.from(e.querySelectorAll(t)).filter(de);
700
1125
  }
701
- function Mn(e) {
1126
+ function _r(e) {
702
1127
  return e ? e instanceof HTMLInputElement ? e.value : e.textContent ?? "" : "";
703
1128
  }
704
- function Ze(e, t) {
1129
+ function ht(e, t) {
705
1130
  return !e.outsideForms || !t.closest("form");
706
1131
  }
707
- function J(e, t) {
708
- return Array.from(e.scope.querySelectorAll(t)).filter((n) => ae(n) && Ze(e, n));
1132
+ function re(e, t) {
1133
+ return Array.from(e.scope.querySelectorAll(t)).filter((n) => de(n) && ht(e, n));
709
1134
  }
710
- function oe(e) {
711
- return X(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
1135
+ function ce(e) {
1136
+ return Q(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
712
1137
  }
713
- function Dn(e) {
714
- const t = oe(e);
715
- return Nn.test(t) || xn.test(t);
1138
+ function Tr(e) {
1139
+ const t = ce(e);
1140
+ return wr.test(t) || Sr.test(t);
716
1141
  }
717
- function $n(e, t) {
1142
+ function Rr(e, t) {
718
1143
  if (e.getAttribute("type") === "submit" || !t) return !1;
719
1144
  const n = e.parentElement;
720
- return !n || z(n, se).length === 0 ? !1 : !n.contains(t);
1145
+ return !n || z(n, fe).length === 0 ? !1 : !n.contains(t);
721
1146
  }
722
- var Fn = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
723
- function Pn(e) {
724
- return Array.from(e.querySelectorAll(Fn)).some(ae);
1147
+ var Ar = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
1148
+ function Lr(e) {
1149
+ return Array.from(e.querySelectorAll(Ar)).some(de);
725
1150
  }
726
- function qn(e, t) {
1151
+ function Or(e, t) {
727
1152
  let n = e.parentElement;
728
1153
  for (; n && !n.contains(t); ) {
729
- if (Pn(n)) return !0;
1154
+ if (Lr(n)) return !0;
730
1155
  n = n.parentElement;
731
1156
  }
732
1157
  return !1;
733
1158
  }
734
- function Bn(e) {
1159
+ function Ir(e) {
735
1160
  const t = [
736
1161
  e.getAttribute("name"),
737
1162
  e.getAttribute("id"),
@@ -743,150 +1168,150 @@ function Bn(e) {
743
1168
  const r = e.ownerDocument.querySelector(`label[for="${CSS.escape(n)}"]`);
744
1169
  r && t.push(r.textContent);
745
1170
  }
746
- return X(t.filter(Boolean).join(" "));
1171
+ return Q(t.filter(Boolean).join(" "));
747
1172
  }
748
- function Un(e, t) {
1173
+ function Cr(e, t) {
749
1174
  const n = e.parentElement;
750
1175
  if (!n) return null;
751
- const r = e.ownerDocument.body, o = (c) => t ? Je({
1176
+ const r = e.ownerDocument.body, o = (c) => t ? mt({
752
1177
  scope: c,
753
1178
  outsideForms: !0
754
- }, t) : e, i = (c) => ye({
1179
+ }, t) : e, s = (c) => Ae({
755
1180
  scope: c,
756
1181
  outsideForms: !0
757
- }, e, o(c)), u = (c) => !!o(c) && !!i(c);
758
- let l = n, s = null;
759
- const a = (c) => {
760
- const d = i(c);
761
- d && !s && re.test(oe(d)) && (s = c);
1182
+ }, e, o(c)), u = (c) => !!o(c) && !!s(c);
1183
+ let a = n, i = null;
1184
+ const l = (c) => {
1185
+ const f = s(c);
1186
+ f && !i && le.test(ce(f)) && (i = c);
762
1187
  };
763
- for (a(n); l !== r && !u(l); ) {
764
- const c = l.parentElement;
1188
+ for (l(n); a !== r && !u(a); ) {
1189
+ const c = a.parentElement;
765
1190
  if (!c || c.querySelector("form")) break;
766
- const d = [e], y = o(l);
767
- y && y !== e && d.push(y);
768
- const b = !!y;
769
- if (z(c, se).filter((w) => !w.closest("form") && !d.includes(w)).some((w) => w.matches(ie) || b || ge.test(Bn(w)) ? !0 : qn(w, e))) break;
770
- l = c, a(c);
1191
+ const f = [e], d = o(a);
1192
+ d && d !== e && f.push(d);
1193
+ const h = !!d;
1194
+ if (z(c, fe).filter((b) => !b.closest("form") && !f.includes(b)).some((b) => b.matches(ue) || h || Re.test(Ir(b)) ? !0 : Or(b, e))) break;
1195
+ a = c, l(c);
771
1196
  }
772
1197
  return {
773
- scope: u(l) ? l : s ?? n,
1198
+ scope: u(a) ? a : i ?? n,
774
1199
  outsideForms: !0
775
1200
  };
776
1201
  }
777
- function Ne(e, t, n) {
1202
+ function je(e, t, n) {
778
1203
  return e ? {
779
1204
  scope: e,
780
1205
  outsideForms: !1
781
- } : Un(t, n);
1206
+ } : Cr(t, n);
782
1207
  }
783
- function Gn(e, t) {
1208
+ function kr(e, t) {
784
1209
  let n = e.parentElement;
785
1210
  for (; n && n !== t.scope; ) {
786
- if (z(n, se).length === 1) return !0;
1211
+ if (z(n, fe).length === 1) return !0;
787
1212
  n = n.parentElement;
788
1213
  }
789
1214
  return !1;
790
1215
  }
791
- function ye(e, t, n) {
792
- const r = (s) => !!(t.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((s) => ae(s) && Ze(e, s) && (s.getAttribute("type") === "submit" || r(s)) && !Dn(s) && !Cn.test(oe(s)) && !$n(s, n));
1216
+ function Ae(e, t, n) {
1217
+ const r = (i) => !!(t.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((i) => de(i) && ht(e, i) && (i.getAttribute("type") === "submit" || r(i)) && !Tr(i) && !Er.test(ce(i)) && !Rr(i, n));
793
1218
  if (o.length === 0) return null;
794
- const i = (s, a) => {
795
- const c = r(s);
1219
+ const s = (i, l) => {
1220
+ const c = r(i);
796
1221
  return [
797
- Gn(s, e) ? 1 : 0,
798
- re.test(oe(s)) ? 0 : 1,
799
- s.getAttribute("type") === "submit" ? 0 : 1,
1222
+ kr(i, e) ? 1 : 0,
1223
+ le.test(ce(i)) ? 0 : 1,
1224
+ i.getAttribute("type") === "submit" ? 0 : 1,
800
1225
  c ? 0 : 1,
801
- c ? a : -a
1226
+ c ? l : -l
802
1227
  ];
803
1228
  };
804
- let u = o[0], l = i(u, 0);
805
- return o.forEach((s, a) => {
806
- const c = i(s, a);
807
- for (let d = 0; d < c.length; d++) {
808
- const y = c[d], b = l[d];
809
- if (y !== b) {
810
- y < b && (u = s, l = c);
1229
+ let u = o[0], a = s(u, 0);
1230
+ return o.forEach((i, l) => {
1231
+ const c = s(i, l);
1232
+ for (let f = 0; f < c.length; f++) {
1233
+ const d = c[f], h = a[f];
1234
+ if (d !== h) {
1235
+ d < h && (u = i, a = c);
811
1236
  return;
812
1237
  }
813
1238
  }
814
1239
  }), u;
815
1240
  }
816
- function Ce(e) {
817
- return e.querySelectorAll("form").length + (z(e, se).some((t) => !t.closest("form")) ? 1 : 0) === 1;
1241
+ function Xe(e) {
1242
+ return e.querySelectorAll("form").length + (z(e, fe).some((t) => !t.closest("form")) ? 1 : 0) === 1;
818
1243
  }
819
- function Hn(e, t) {
1244
+ function Nr(e, t) {
820
1245
  if (e) {
821
1246
  const n = e.getAttribute("aria-label");
822
1247
  if (n) return n;
823
1248
  const r = e.getAttribute("aria-labelledby");
824
1249
  if (r) {
825
- const l = e.ownerDocument.getElementById(r);
826
- if (l) return l.textContent ?? "";
1250
+ const a = e.ownerDocument.getElementById(r);
1251
+ if (a) return a.textContent ?? "";
827
1252
  }
828
1253
  const o = e.querySelector("h1, h2, h3, legend");
829
1254
  if (o) return o.textContent ?? "";
830
- let i = e.previousElementSibling;
831
- for (; i; ) {
832
- const l = /^(h1|h2|h3|legend)$/i.test(i.tagName) ? i : i.querySelector("h1, h2, h3, legend");
833
- if (l) {
834
- const s = e.parentElement;
835
- return s && Ce(s) ? l.textContent ?? "" : "";
1255
+ let s = e.previousElementSibling;
1256
+ for (; s; ) {
1257
+ const a = /^(h1|h2|h3|legend)$/i.test(s.tagName) ? s : s.querySelector("h1, h2, h3, legend");
1258
+ if (a) {
1259
+ const i = e.parentElement;
1260
+ return i && Xe(i) ? a.textContent ?? "" : "";
836
1261
  }
837
- i = i.previousElementSibling;
1262
+ s = s.previousElementSibling;
838
1263
  }
839
1264
  const u = e.closest("section, article, aside, dialog, fieldset, [role='dialog'], [role='region']");
840
1265
  if (u && u !== e) {
841
- const l = u.querySelector("h1, h2, h3, legend");
842
- if (l)
843
- return Ce(u) ? l.textContent ?? "" : "";
1266
+ const a = u.querySelector("h1, h2, h3, legend");
1267
+ if (a)
1268
+ return Xe(u) ? a.textContent ?? "" : "";
844
1269
  }
845
1270
  return "";
846
1271
  }
847
1272
  return (t instanceof Document ? t.body : t)?.querySelector("h1, h2, h3")?.textContent ?? "";
848
1273
  }
849
- function xe(e, t, n) {
850
- const r = X(Mn(n)), o = X(Hn(e, t)), i = (e?.getAttribute("action") ?? "").split("?")[0], u = X([
1274
+ function Ke(e, t, n) {
1275
+ const r = Q(_r(n)), o = Q(Nr(e, t)), s = (e?.getAttribute("action") ?? "").split("?")[0], u = Q([
851
1276
  e?.id,
852
1277
  e?.getAttribute("name"),
853
1278
  e?.className,
854
- i
1279
+ s
855
1280
  ].filter(Boolean).join(" "));
856
1281
  return {
857
- positive: re.test(r) || re.test(o),
858
- negative: ge.test(r) || ge.test(o) || kn.test(u)
1282
+ positive: le.test(r) || le.test(o),
1283
+ negative: Re.test(r) || Re.test(o) || vr.test(u)
859
1284
  };
860
1285
  }
861
- function Je(e, t) {
862
- const n = J(e, 'input[autocomplete="username"]')[0] ?? J(e, 'input[autocomplete="email"]')[0] ?? J(e, 'input[type="email"]')[0];
1286
+ function mt(e, t) {
1287
+ const n = re(e, 'input[autocomplete="username"]')[0] ?? re(e, 'input[autocomplete="email"]')[0] ?? re(e, 'input[type="email"]')[0];
863
1288
  if (n) return n;
864
1289
  if (!t) return null;
865
- const r = J(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
1290
+ const r = re(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
866
1291
  return r[r.length - 1] ?? null;
867
1292
  }
868
- function fe(e, t) {
1293
+ function ye(e, t) {
869
1294
  if (t.querySelector('input[autocomplete="new-password"]')) return null;
870
- const n = z(t, ie);
1295
+ const n = z(t, ue);
871
1296
  if (n.length > 1) return null;
872
1297
  if (n.length === 1) {
873
- const s = n[0], a = Ne(e, s, s);
874
- if (!a) return null;
875
- const c = Je(a, s), d = ye(a, s, c), y = xe(e, t, d);
876
- return !(s.autocomplete === "current-password" || y.positive) || y.negative ? null : {
1298
+ const i = n[0], l = je(e, i, i);
1299
+ if (!l) return null;
1300
+ const c = mt(l, i), f = Ae(l, i, c), d = Ke(e, t, f);
1301
+ return !(i.autocomplete === "current-password" || d.positive) || d.negative ? null : {
877
1302
  kind: "password",
878
1303
  form: e,
879
1304
  identifier: c,
880
- password: s,
881
- submit: d
1305
+ password: i,
1306
+ submit: f
882
1307
  };
883
1308
  }
884
- const r = z(t, Ye);
1309
+ const r = z(t, pt);
885
1310
  if (r.length !== 1) return null;
886
- const o = r[0], i = Ne(e, o, null);
887
- if (!i) return null;
888
- const u = ye(i, o, o), l = xe(e, t, u);
889
- return !(o.autocomplete === "username" || l.positive) || l.negative ? null : {
1311
+ const o = r[0], s = je(e, o, null);
1312
+ if (!s) return null;
1313
+ const u = Ae(s, o, o), a = Ke(e, t, u);
1314
+ return !(o.autocomplete === "username" || a.positive) || a.negative ? null : {
890
1315
  kind: "identifier",
891
1316
  form: e,
892
1317
  identifier: o,
@@ -894,22 +1319,22 @@ function fe(e, t) {
894
1319
  submit: u
895
1320
  };
896
1321
  }
897
- function Q(e = document) {
1322
+ function oe(e = document) {
898
1323
  const t = Array.from(e.querySelectorAll("form"));
899
1324
  for (const n of t) {
900
- const r = fe(n, n);
1325
+ const r = ye(n, n);
901
1326
  if (r) return r;
902
1327
  }
903
- return t.length === 0 || z(e, ie).find((n) => !n.closest("form")) ? fe(null, e) : null;
1328
+ return t.length === 0 || z(e, ue).find((n) => !n.closest("form")) ? ye(null, e) : null;
904
1329
  }
905
- function Me(e, t) {
1330
+ function Ye(e, t) {
906
1331
  const n = Object.getPrototypeOf(e), r = Object.getOwnPropertyDescriptor(n, "value")?.set ?? Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
907
1332
  r ? r.call(e, t) : e.value = t, e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
908
1333
  }
909
- function Wn(e) {
1334
+ function Mr(e) {
910
1335
  return !!e.form || !!e.submit;
911
1336
  }
912
- function zn(e) {
1337
+ function xr(e) {
913
1338
  const t = e.form, n = t?.noValidate;
914
1339
  t && (t.noValidate = !0);
915
1340
  try {
@@ -918,28 +1343,28 @@ function zn(e) {
918
1343
  t && (t.noValidate = n ?? !1);
919
1344
  }
920
1345
  }
921
- var jn = {
1346
+ var Dr = {
922
1347
  identifier: null,
923
1348
  password: null
924
1349
  };
925
- function De(e, t) {
1350
+ function Ze(e, t) {
926
1351
  return !e || e.disabled || e.readOnly ? !1 : e.value === "" || t !== null && e.value === t;
927
1352
  }
928
- function Qe(e, t, n) {
1353
+ function gt(e, t, n) {
929
1354
  return {
930
- identifier: De(e.identifier, n.identifier) && !t.identifier,
931
- password: De(e.password, n.password) && !t.password
1355
+ identifier: Ze(e.identifier, n.identifier) && !t.identifier,
1356
+ password: Ze(e.password, n.password) && !t.password
932
1357
  };
933
1358
  }
934
- function Vn(e, t, n) {
1359
+ function Fr(e, t, n) {
935
1360
  const r = e.identifier;
936
1361
  return !r || n.identifier ? !1 : r.value !== "" && r.value !== t.login;
937
1362
  }
938
- function Xn(e, t, n, r = jn) {
939
- const o = Qe(e, n, r);
940
- return !o.identifier && !o.password ? { error: "nothing-to-fill" } : Vn(e, t, o) ? { error: "identifier-mismatch" } : Wn(e) ? (o.identifier && Me(e.identifier, t.login), o.password && Me(e.password, t.password), zn(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
1363
+ function Pr(e, t, n, r = Dr) {
1364
+ const o = gt(e, n, r);
1365
+ return !o.identifier && !o.password ? { error: "nothing-to-fill" } : Fr(e, t, o) ? { error: "identifier-mismatch" } : Mr(e) ? (o.identifier && Ye(e.identifier, t.login), o.password && Ye(e.password, t.password), xr(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
941
1366
  }
942
- function Kn(e) {
1367
+ function Br(e) {
943
1368
  if (typeof window > "u" || typeof MutationObserver > "u") return {
944
1369
  watch() {
945
1370
  },
@@ -956,25 +1381,25 @@ function Kn(e) {
956
1381
  }, r = {
957
1382
  identifier: null,
958
1383
  password: null
959
- }, o = !1, i = null, u = null, l = null, s = null, a = 0;
1384
+ }, o = !1, s = null, u = null, a = null, i = null, l = 0;
960
1385
  const c = () => {
961
- l && clearTimeout(l), l = null;
1386
+ a && clearTimeout(a), a = null;
1387
+ }, f = () => {
1388
+ i && clearTimeout(i), i = null, l = 0;
962
1389
  }, d = () => {
963
- s && clearTimeout(s), s = null, a = 0;
964
- }, y = () => {
965
- if (s = null, a = 0, !t || n.identifier || n.password || Q(document)) return;
966
- const A = Ln(document, t.login);
967
- t = null, e.onNoForm(A);
1390
+ if (i = null, l = 0, !t || n.identifier || n.password || oe(document)) return;
1391
+ const v = mr(document, t.login);
1392
+ t = null, e.onNoForm(v);
1393
+ }, h = () => {
1394
+ if (!l) return;
1395
+ i && clearTimeout(i);
1396
+ const v = Math.max(0, l - Date.now());
1397
+ i = setTimeout(d, Math.min(br, v));
968
1398
  }, b = () => {
969
- if (!a) return;
970
- s && clearTimeout(s);
971
- const A = Math.max(0, a - Date.now());
972
- s = setTimeout(y, Math.min(On, A));
973
- }, w = () => {
974
- i?.disconnect(), i = null, c(), d(), u && clearTimeout(u), u = null;
1399
+ s?.disconnect(), s = null, c(), f(), u && clearTimeout(u), u = null;
975
1400
  }, _ = () => {
976
- const A = Q(document);
977
- if (!A) {
1401
+ const v = oe(document);
1402
+ if (!v) {
978
1403
  o = !1, r = {
979
1404
  identifier: null,
980
1405
  password: null
@@ -984,125 +1409,125 @@ function Kn(e) {
984
1409
  if (!t)
985
1410
  o || (o = !0, e.onDetected());
986
1411
  else {
987
- const C = Qe(A, n, r), O = Xn(A, t, n, r);
988
- if ("error" in O || (C.identifier && (n = {
1412
+ const T = gt(v, n, r), R = Pr(v, t, n, r);
1413
+ if ("error" in R || (T.identifier && (n = {
989
1414
  ...n,
990
1415
  identifier: !0
991
1416
  }, r = {
992
1417
  ...r,
993
1418
  identifier: t.login
994
- }), C.password && (n = {
1419
+ }), T.password && (n = {
995
1420
  ...n,
996
1421
  password: !0
997
1422
  }, r = {
998
1423
  ...r,
999
1424
  password: t.password
1000
- })), "error" in O) {
1001
- const M = O.error !== "nothing-to-fill" ? O.error : !n.identifier && !n.password ? "already-filled" : null;
1002
- M && (e.onError(M), t = null, w());
1425
+ })), "error" in R) {
1426
+ const N = R.error !== "nothing-to-fill" ? R.error : !n.identifier && !n.password ? "already-filled" : null;
1427
+ N && (e.onError(N), t = null, b());
1003
1428
  } else
1004
- e.onFilled(O.step), n.password && (t = null, c(), l = setTimeout(() => {
1005
- l = null, Q(document) && (o = !0, e.onDetected());
1006
- }, it));
1429
+ e.onFilled(R.step), n.password && (t = null, c(), a = setTimeout(() => {
1430
+ a = null, oe(document) && (o = !0, e.onDetected());
1431
+ }, _t));
1007
1432
  }
1008
- }, R = () => {
1009
- b(), u && clearTimeout(u), u = setTimeout(() => {
1433
+ }, A = () => {
1434
+ h(), u && clearTimeout(u), u = setTimeout(() => {
1010
1435
  u = null, _();
1011
- }, Tn);
1436
+ }, gr);
1012
1437
  }, S = () => {
1013
- i || (i = new MutationObserver(R), i.observe(document.body, {
1438
+ s || (s = new MutationObserver(A), s.observe(document.body, {
1014
1439
  childList: !0,
1015
1440
  subtree: !0,
1016
1441
  attributes: !0,
1017
- attributeFilter: In
1442
+ attributeFilter: yr
1018
1443
  }));
1019
1444
  };
1020
1445
  return {
1021
1446
  watch() {
1022
- i || (o = !1, S()), _();
1447
+ s || (o = !1, S()), _();
1023
1448
  },
1024
- fill(A) {
1025
- d(), t = A, S(), _(), t && !n.identifier && !n.password && !Q(document) && (a = Date.now() + st, b());
1449
+ fill(v) {
1450
+ f(), t = v, S(), _(), t && !n.identifier && !n.password && !oe(document) && (l = Date.now() + Tt, h());
1026
1451
  },
1027
1452
  cancel() {
1028
1453
  t = null, n = {
1029
1454
  identifier: !1,
1030
1455
  password: !1
1031
- }, o = !1, w();
1456
+ }, o = !1, b();
1032
1457
  },
1033
1458
  teardown() {
1034
- t = null, w();
1459
+ t = null, b();
1035
1460
  }
1036
1461
  };
1037
1462
  }
1038
- var Yn = "leesto/navigation";
1039
- function Zn(e) {
1463
+ var $r = "leesto/navigation";
1464
+ function qr(e) {
1040
1465
  const t = e?.timestamp;
1041
1466
  return typeof t == "number" ? t : void 0;
1042
1467
  }
1043
- function Jn(e) {
1468
+ function Hr(e) {
1044
1469
  return e?.type === 4;
1045
1470
  }
1046
- function Qn(e) {
1471
+ function Ur(e) {
1047
1472
  try {
1048
1473
  return JSON.stringify(e)?.length ?? 0;
1049
1474
  } catch {
1050
1475
  return 0;
1051
1476
  }
1052
1477
  }
1053
- function er(e) {
1054
- const t = e.now ?? Date.now, n = e.measure ?? Qn;
1055
- let r = [], o = 0, i = !1, u = Number.NEGATIVE_INFINITY;
1056
- const l = () => {
1057
- const a = r.shift();
1058
- a && (o -= a.bytes);
1059
- }, s = () => {
1060
- if (!i) {
1061
- const d = t() - e.windowMs;
1062
- for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= d; ) l();
1478
+ function Gr(e) {
1479
+ const t = e.now ?? Date.now, n = e.measure ?? Ur;
1480
+ let r = [], o = 0, s = !1, u = Number.NEGATIVE_INFINITY;
1481
+ const a = () => {
1482
+ const l = r.shift();
1483
+ l && (o -= l.bytes);
1484
+ }, i = () => {
1485
+ if (!s) {
1486
+ const f = t() - e.windowMs;
1487
+ for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= f; ) a();
1063
1488
  }
1064
- const a = i ? e.heldMaxBytes : e.maxBytes;
1065
- for (; o > a && r.length > 1; ) l();
1489
+ const l = s ? e.heldMaxBytes : e.maxBytes;
1490
+ for (; o > l && r.length > 1; ) a();
1066
1491
  const c = r[r.length - 1];
1067
- if (o > a && e.requestCheckout && (c?.events.length ?? 0) > 2) {
1068
- const d = t();
1069
- d - u >= e.minCheckoutIntervalMs && (u = d, e.requestCheckout());
1492
+ if (o > l && e.requestCheckout && (c?.events.length ?? 0) > 2) {
1493
+ const f = t();
1494
+ f - u >= e.minCheckoutIntervalMs && (u = f, e.requestCheckout());
1070
1495
  }
1071
1496
  };
1072
1497
  return {
1073
- push(a) {
1074
- const c = n(a);
1075
- if (Jn(a)) r.push({
1076
- start: Zn(a) ?? t(),
1077
- events: [a],
1498
+ push(l) {
1499
+ const c = n(l);
1500
+ if (Hr(l)) r.push({
1501
+ start: qr(l) ?? t(),
1502
+ events: [l],
1078
1503
  bytes: c
1079
1504
  });
1080
1505
  else {
1081
- const d = r[r.length - 1];
1082
- if (!d) return;
1083
- d.events.push(a), d.bytes += c;
1506
+ const f = r[r.length - 1];
1507
+ if (!f) return;
1508
+ f.events.push(l), f.bytes += c;
1084
1509
  }
1085
- o += c, s();
1510
+ o += c, i();
1086
1511
  },
1087
1512
  snapshot() {
1088
- const a = [];
1089
- for (const c of r) for (const d of c.events) a.push(d);
1090
- return a;
1513
+ const l = [];
1514
+ for (const c of r) for (const f of c.events) l.push(f);
1515
+ return l;
1091
1516
  },
1092
1517
  hold() {
1093
- s(), i = !0;
1518
+ i(), s = !0;
1094
1519
  },
1095
1520
  release() {
1096
- i = !1, s();
1521
+ s = !1, i();
1097
1522
  },
1098
1523
  stats() {
1099
- let a = 0;
1100
- for (const c of r) a += c.events.length;
1524
+ let l = 0;
1525
+ for (const c of r) l += c.events.length;
1101
1526
  return {
1102
1527
  segments: r.length,
1103
- events: a,
1528
+ events: l,
1104
1529
  bytes: o,
1105
- held: i
1530
+ held: s
1106
1531
  };
1107
1532
  },
1108
1533
  clear() {
@@ -1110,132 +1535,132 @@ function er(e) {
1110
1535
  }
1111
1536
  };
1112
1537
  }
1113
- var et = 6e5, tt = 1e3, tr = {
1538
+ var bt = 6e5, yt = 1e3, Wr = {
1114
1539
  mousemove: 100,
1115
1540
  scroll: 150
1116
- }, nr = {
1541
+ }, Vr = {
1117
1542
  windowMs: 12e4,
1118
1543
  checkoutEveryNms: 6e4,
1119
1544
  maxBytes: 8388608,
1120
1545
  heldMaxBytes: 33554432,
1121
1546
  minCheckoutIntervalMs: 15e3,
1122
- sampling: tr
1123
- }, rr = 5;
1124
- async function or(e) {
1547
+ sampling: Wr
1548
+ }, zr = 5;
1549
+ async function jr(e) {
1125
1550
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = e.maskPolicy ?? "mask_all", o = Date.now();
1126
- let i = [], u = !1, l = 0;
1127
- const s = () => {
1128
- if (i.length === 0) return;
1129
- const R = i;
1130
- i = [], e.onBatch(R);
1131
- }, a = t({
1132
- emit(R) {
1133
- i.push(Ke(R, r, (S) => t.mirror.getNode(S)));
1551
+ let s = [], u = !1, a = 0;
1552
+ const i = () => {
1553
+ if (s.length === 0) return;
1554
+ const A = s;
1555
+ s = [], e.onBatch(A);
1556
+ }, l = t({
1557
+ emit(A) {
1558
+ s.push(dt(A, r, (S) => t.mirror.getNode(S)));
1134
1559
  },
1135
- ...Xe(r)
1136
- }), c = e.diagnostics ?? null, d = a ? c ?? Be({ captureNetwork: e.captureNetwork !== !1 }) : null, y = d !== null && c === null;
1137
- d?.setSink((R, S) => {
1560
+ ...ft(r)
1561
+ }), c = e.diagnostics ?? null, f = l ? c ?? rt({ captureNetwork: e.captureNetwork !== !1 }) : null, d = f !== null && c === null;
1562
+ f?.setSink((A, S) => {
1138
1563
  try {
1139
- n(R, S);
1564
+ n(A, S);
1140
1565
  } catch {
1141
1566
  }
1142
1567
  });
1143
- const b = setInterval(s, tt), w = { timer: null }, _ = () => (u || (u = !0, clearInterval(b), clearTimeout(w.timer ?? void 0), d?.flushRings(), d?.setSink(null), y && d?.teardown(), a?.(), s(), l = Date.now() - o), l);
1144
- return w.timer = setTimeout(() => {
1568
+ const h = setInterval(i, yt), b = { timer: null }, _ = () => (u || (u = !0, clearInterval(h), clearTimeout(b.timer ?? void 0), f?.flushRings(), f?.setSink(null), d && f?.teardown(), l?.(), i(), a = Date.now() - o), a);
1569
+ return b.timer = setTimeout(() => {
1145
1570
  _(), e.onCap();
1146
- }, et), { stop: _ };
1571
+ }, bt), { stop: _ };
1147
1572
  }
1148
- async function ir(e) {
1573
+ async function Xr(e) {
1149
1574
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = {
1150
- ...nr,
1575
+ ...Vr,
1151
1576
  ...e.config
1152
- }, { diagnostics: o } = e, i = e.maskPolicy ?? "mask_all";
1153
- let u = !1, l = null, s = null;
1154
- const a = () => {
1577
+ }, { diagnostics: o } = e, s = e.maskPolicy ?? "mask_all";
1578
+ let u = !1, a = null, i = null;
1579
+ const l = () => {
1155
1580
  try {
1156
1581
  t.takeFullSnapshot(!0);
1157
1582
  } catch {
1158
1583
  }
1159
- }, c = er({
1584
+ }, c = Gr({
1160
1585
  windowMs: r.windowMs,
1161
1586
  maxBytes: r.maxBytes,
1162
1587
  heldMaxBytes: r.heldMaxBytes,
1163
1588
  minCheckoutIntervalMs: r.minCheckoutIntervalMs,
1164
1589
  requestCheckout: () => queueMicrotask(() => {
1165
- u || a();
1590
+ u || l();
1166
1591
  })
1167
- }), d = t({
1168
- emit(b) {
1169
- const w = Ke(b, i, (_) => t.mirror.getNode(_));
1170
- c.push(w), l?.(w);
1592
+ }), f = t({
1593
+ emit(h) {
1594
+ const b = dt(h, s, (_) => t.mirror.getNode(_));
1595
+ c.push(b), a?.(b);
1171
1596
  },
1172
1597
  checkoutEveryNms: r.checkoutEveryNms,
1173
1598
  sampling: r.sampling,
1174
- ...Xe(i)
1599
+ ...ft(s)
1175
1600
  });
1176
- if (!d) return null;
1177
- const y = (b, w) => {
1601
+ if (!f) return null;
1602
+ const d = (h, b) => {
1178
1603
  try {
1179
- n(b, w);
1604
+ n(h, b);
1180
1605
  } catch {
1181
1606
  }
1182
1607
  };
1183
- return o.setSink(y), {
1608
+ return o.setSink(d), {
1184
1609
  snapshot() {
1185
- const b = c.snapshot(), w = Date.now();
1186
- o.setSink((R, S) => {
1187
- b.push({
1188
- type: rr,
1610
+ const h = c.snapshot(), b = Date.now();
1611
+ o.setSink((A, S) => {
1612
+ h.push({
1613
+ type: zr,
1189
1614
  data: {
1190
- tag: R,
1615
+ tag: A,
1191
1616
  payload: S
1192
1617
  },
1193
- timestamp: w
1618
+ timestamp: b
1194
1619
  });
1195
1620
  });
1196
1621
  try {
1197
1622
  o.flushRings();
1198
1623
  } finally {
1199
- o.setSink(u ? null : y);
1624
+ o.setSink(u ? null : d);
1200
1625
  }
1201
- const _ = b[0]?.timestamp;
1626
+ const _ = h[0]?.timestamp;
1202
1627
  return {
1203
- events: b,
1204
- durationMs: typeof _ == "number" ? Math.max(0, w - _) : 0
1628
+ events: h,
1629
+ durationMs: typeof _ == "number" ? Math.max(0, b - _) : 0
1205
1630
  };
1206
1631
  },
1207
1632
  hold: () => c.hold(),
1208
1633
  release: () => c.release(),
1209
- markNavigation(b) {
1210
- u || y(Yn, { href: W(b) });
1634
+ markNavigation(h) {
1635
+ u || d($r, { href: V(h) });
1211
1636
  },
1212
1637
  stats: () => c.stats(),
1213
- stream({ onBatch: b, onCap: w }) {
1214
- s?.stop();
1638
+ stream({ onBatch: h, onCap: b }) {
1639
+ i?.stop();
1215
1640
  const _ = Date.now();
1216
- let R = [], S = !1, A = 0;
1217
- const C = () => {
1218
- if (R.length === 0) return;
1219
- const q = R;
1220
- R = [], b(q);
1221
- }, O = (q) => {
1222
- R.push(q);
1641
+ let A = [], S = !1, v = 0;
1642
+ const T = () => {
1643
+ if (A.length === 0) return;
1644
+ const C = A;
1645
+ A = [], h(C);
1646
+ }, R = (C) => {
1647
+ A.push(C);
1223
1648
  };
1224
- l = O, a();
1225
- const M = setInterval(C, tt), D = { timer: null }, F = { stop() {
1226
- return S || (S = !0, clearInterval(M), clearTimeout(D.timer ?? void 0), o.flushRings(), l === O && (l = null), s === F && (s = null), C(), A = Date.now() - _), A;
1649
+ a = R, l();
1650
+ const N = setInterval(T, yt), F = { timer: null }, O = { stop() {
1651
+ return S || (S = !0, clearInterval(N), clearTimeout(F.timer ?? void 0), o.flushRings(), a === R && (a = null), i === O && (i = null), T(), v = Date.now() - _), v;
1227
1652
  } };
1228
- return D.timer = setTimeout(() => {
1229
- F.stop(), w();
1230
- }, et), s = F, F;
1653
+ return F.timer = setTimeout(() => {
1654
+ O.stop(), b();
1655
+ }, bt), i = O, O;
1231
1656
  },
1232
1657
  stop() {
1233
- u || (u = !0, s?.stop(), o.setSink(null), d(), c.clear());
1658
+ u || (u = !0, i?.stop(), o.setSink(null), f(), c.clear());
1234
1659
  }
1235
1660
  };
1236
1661
  }
1237
- var sr = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], ar = ["http://localhost:3505", "http://127.0.0.1:3505"];
1238
- function lr(e) {
1662
+ var Kr = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], Yr = ["http://localhost:3505", "http://127.0.0.1:3505"];
1663
+ function Zr(e) {
1239
1664
  try {
1240
1665
  const t = new URL(e).hostname;
1241
1666
  return t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "[::1]";
@@ -1243,7 +1668,7 @@ function lr(e) {
1243
1668
  return !1;
1244
1669
  }
1245
1670
  }
1246
- function cr(e) {
1671
+ function Qr(e) {
1247
1672
  const t = e.trim();
1248
1673
  if (!t) return null;
1249
1674
  try {
@@ -1253,33 +1678,33 @@ function cr(e) {
1253
1678
  return null;
1254
1679
  }
1255
1680
  }
1256
- function ur(e) {
1257
- const t = (e.explicit ?? []).map(cr).filter((r) => r !== null);
1681
+ function Jr(e) {
1682
+ const t = (e.explicit ?? []).map(Qr).filter((r) => r !== null);
1258
1683
  if (t.length > 0) return [...new Set(t)];
1259
- const n = [...sr];
1260
- return lr(e.pageOrigin) && n.push(...ar), [...new Set(n)];
1684
+ const n = [...Kr];
1685
+ return Zr(e.pageOrigin) && n.push(...Yr), [...new Set(n)];
1261
1686
  }
1262
- function de(e, t) {
1687
+ function ve(e, t) {
1263
1688
  return !e || e === "*" || e === "null" ? !1 : t.includes(e);
1264
1689
  }
1265
- function ee() {
1690
+ function se() {
1266
1691
  return typeof navigator < "u" && navigator.globalPrivacyControl === !0;
1267
1692
  }
1268
- function fr(e) {
1693
+ function eo(e) {
1269
1694
  const t = (u) => {
1270
- const l = typeof u == "string" ? u.trim() : "";
1271
- return l.length > 0 ? l : void 0;
1695
+ const a = typeof u == "string" ? u.trim() : "";
1696
+ return a.length > 0 ? a : void 0;
1272
1697
  }, n = (u) => {
1273
1698
  if (!(typeof document > "u"))
1274
1699
  return t(document.querySelector(`meta[name="${u}"]`)?.getAttribute("content"));
1275
- }, r = typeof window < "u" ? window.__LEESTO_APP_BUILD__ : void 0, o = t(e?.version) ?? t(r?.version) ?? n("app-version"), i = t(e?.environment) ?? t(r?.environment) ?? n("app-environment");
1276
- if (!(!o && !i))
1700
+ }, r = typeof window < "u" ? window.__LEESTO_APP_BUILD__ : void 0, o = t(e?.version) ?? t(r?.version) ?? n("app-version"), s = t(e?.environment) ?? t(r?.environment) ?? n("app-environment");
1701
+ if (!(!o && !s))
1277
1702
  return {
1278
1703
  ...o ? { version: o } : {},
1279
- ...i ? { environment: i } : {}
1704
+ ...s ? { environment: s } : {}
1280
1705
  };
1281
1706
  }
1282
- function dr() {
1707
+ function to() {
1283
1708
  if (typeof document > "u") return;
1284
1709
  const e = document.querySelector('link[rel~="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]');
1285
1710
  if (e?.href)
@@ -1289,46 +1714,59 @@ function dr() {
1289
1714
  return;
1290
1715
  }
1291
1716
  }
1292
- function pr() {
1717
+ function no() {
1293
1718
  const e = (r) => !!r && r !== "transparent" && !/^rgba\(\s*0,\s*0,\s*0,\s*0\s*\)$/.test(r), t = getComputedStyle(document.body).backgroundColor;
1294
1719
  if (e(t)) return t;
1295
1720
  const n = getComputedStyle(document.documentElement).backgroundColor;
1296
1721
  return e(n) ? n : "#ffffff";
1297
1722
  }
1298
- async function $e(e) {
1723
+ var Qe = Promise.resolve();
1724
+ function Je(e) {
1725
+ const t = Qe.then(() => oo(e));
1726
+ return Qe = t.catch(() => {
1727
+ }), t;
1728
+ }
1729
+ function ro(e, t, n, r) {
1730
+ if (t !== "sticky") return [n, r];
1731
+ const o = e.getBoundingClientRect(), s = e.style.position;
1732
+ e.style.position = "static";
1733
+ const u = e.getBoundingClientRect();
1734
+ return e.style.position = s, [o.x - u.x, o.y - u.y];
1735
+ }
1736
+ async function oo(e) {
1299
1737
  const { domToPng: t } = await import("./chunks/dist-BTlWkbvW.js");
1300
1738
  if (e) {
1301
- const l = document.querySelector(e);
1302
- if (!l) throw new Error("element_not_found");
1303
- return t(l, { quality: 0.92 });
1739
+ const a = document.querySelector(e);
1740
+ if (!a) throw new Error("element_not_found");
1741
+ return t(a, { quality: 0.92 });
1304
1742
  }
1305
- const n = document.documentElement, r = window.scrollX, o = window.scrollY, i = [], u = [];
1743
+ const n = document.documentElement, r = window.scrollX, o = window.scrollY, s = [], u = [];
1306
1744
  try {
1307
- for (const l of n.querySelectorAll(`.${ve}, ${ne}`)) {
1308
- const s = l.getBoundingClientRect();
1309
- if (s.width <= 0 || s.height <= 0) continue;
1310
- const a = document.createElement("div");
1311
- a.dataset.leestoCaptureCover = "", Object.assign(a.style, {
1745
+ for (const a of n.querySelectorAll(`.${Oe}, ${ae}`)) {
1746
+ const i = a.getBoundingClientRect();
1747
+ if (i.width <= 0 || i.height <= 0) continue;
1748
+ const l = document.createElement("div");
1749
+ l.dataset.leestoCaptureCover = "", Object.assign(l.style, {
1312
1750
  position: "fixed",
1313
- left: `${s.x}px`,
1314
- top: `${s.y}px`,
1315
- width: `${s.width}px`,
1316
- height: `${s.height}px`,
1751
+ left: `${i.x}px`,
1752
+ top: `${i.y}px`,
1753
+ width: `${i.width}px`,
1754
+ height: `${i.height}px`,
1317
1755
  background: "#a1a1aa",
1318
1756
  zIndex: "2147483647",
1319
1757
  pointerEvents: "none"
1320
- }), n.append(a), i.push(a);
1758
+ }), n.append(l), s.push(l);
1321
1759
  }
1322
- for (const l of n.querySelectorAll("*")) {
1323
- const s = getComputedStyle(l).position;
1324
- if (s === "fixed" || s === "sticky") {
1325
- const a = l.style.transform;
1326
- u.push([l, a]), l.style.transform = `translate(${r}px, ${o}px)${a ? ` ${a}` : ""}`;
1760
+ for (const a of n.querySelectorAll("*")) {
1761
+ const i = getComputedStyle(a).position;
1762
+ if (i === "fixed" || i === "sticky") {
1763
+ const [l, c] = ro(a, i, r, o), f = a.style.transform;
1764
+ u.push([a, f]), a.style.transform = `translate(${l}px, ${c}px)${f ? ` ${f}` : ""}`;
1327
1765
  }
1328
1766
  }
1329
1767
  return await t(n, {
1330
1768
  quality: 0.92,
1331
- backgroundColor: pr(),
1769
+ backgroundColor: no(),
1332
1770
  width: n.clientWidth,
1333
1771
  height: n.clientHeight,
1334
1772
  style: {
@@ -1337,11 +1775,11 @@ async function $e(e) {
1337
1775
  }
1338
1776
  });
1339
1777
  } finally {
1340
- for (const l of i) l.remove();
1341
- for (const [l, s] of u) l.style.transform = s;
1778
+ for (const a of s) a.remove();
1779
+ for (const [a, i] of u) a.style.transform = i;
1342
1780
  }
1343
1781
  }
1344
- function hr(e) {
1782
+ function so(e) {
1345
1783
  if (e.id) return `#${CSS.escape(e.id)}`;
1346
1784
  const t = [];
1347
1785
  let n = e;
@@ -1353,75 +1791,75 @@ function hr(e) {
1353
1791
  let r = n.tagName.toLowerCase();
1354
1792
  const o = typeof n.className == "string" ? n.className.trim().split(/\s+/).filter(Boolean)[0] : null;
1355
1793
  o && (r += `.${CSS.escape(o)}`);
1356
- const i = n.parentElement;
1357
- if (i) {
1358
- const u = Array.from(i.children).filter((l) => l.tagName === n?.tagName);
1794
+ const s = n.parentElement;
1795
+ if (s) {
1796
+ const u = Array.from(s.children).filter((a) => a.tagName === n?.tagName);
1359
1797
  u.length > 1 && (r += `:nth-of-type(${u.indexOf(n) + 1})`);
1360
1798
  }
1361
- t.unshift(r), n = i;
1799
+ t.unshift(r), n = s;
1362
1800
  }
1363
1801
  return t.join(" > ");
1364
1802
  }
1365
- function mr(e) {
1803
+ function io(e) {
1366
1804
  const t = e.tagName.toLowerCase();
1367
- if (Y(e)) return t;
1805
+ if (ee(e)) return t;
1368
1806
  const n = (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 40);
1369
1807
  return n ? `${t} · ${n}` : t;
1370
1808
  }
1371
- var nt = "leesto:shell-origin";
1372
- function gr() {
1809
+ var vt = "leesto:shell-origin";
1810
+ function ao() {
1373
1811
  try {
1374
- return sessionStorage.getItem(nt);
1812
+ return sessionStorage.getItem(vt);
1375
1813
  } catch {
1376
1814
  return null;
1377
1815
  }
1378
1816
  }
1379
- function yr(e) {
1817
+ function lo(e) {
1380
1818
  try {
1381
- sessionStorage.setItem(nt, e);
1819
+ sessionStorage.setItem(vt, e);
1382
1820
  } catch {
1383
1821
  }
1384
1822
  }
1385
- function vr() {
1823
+ function co() {
1386
1824
  try {
1387
1825
  return typeof window.name == "string" ? window.name : "";
1388
1826
  } catch {
1389
1827
  return "";
1390
1828
  }
1391
1829
  }
1392
- function Fe(e = {}) {
1830
+ function et(e = {}) {
1393
1831
  if (typeof window > "u" || window.parent === window) return () => {
1394
1832
  };
1395
- const t = window.parent, n = e.highlightColor ?? Rt.light.primary, r = ur({
1833
+ const t = window.parent, n = e.highlightColor ?? Ut.light.primary, r = Jr({
1396
1834
  explicit: e.shellOrigins,
1397
1835
  pageOrigin: location.origin
1398
1836
  });
1399
1837
  let o = null;
1400
1838
  try {
1401
- const h = document.referrer ? new URL(document.referrer).origin : "";
1402
- de(h, r) && (o = h);
1839
+ const g = document.referrer ? new URL(document.referrer).origin : "";
1840
+ ve(g, r) && (o = g);
1403
1841
  } catch {
1404
1842
  }
1405
1843
  if (!o) {
1406
- const h = gr();
1407
- h && de(h, r) && (o = h);
1844
+ const g = ao();
1845
+ g && ve(g, r) && (o = g);
1408
1846
  }
1409
- const i = (h) => {
1847
+ const s = (g) => {
1410
1848
  if (o) {
1411
- t.postMessage(h, o);
1849
+ t.postMessage(g, o);
1412
1850
  return;
1413
1851
  }
1414
- for (const v of r) t.postMessage(h, v);
1852
+ for (const E of r) t.postMessage(g, E);
1415
1853
  };
1416
- let u = null, l = "";
1417
- const s = () => {
1418
- u && (u.style.outline = l), u = null;
1854
+ let u = null, a = "";
1855
+ const i = () => {
1856
+ u && (u.style.outline = a), u = null;
1419
1857
  };
1420
- let a = null;
1858
+ let l = null;
1421
1859
  const c = () => {
1422
- a?.(), s(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1423
- const h = document.createElement("div");
1424
- h.dataset.leestoPickerOutline = "", h.setAttribute("aria-hidden", "true"), Object.assign(h.style, {
1860
+ l?.(), i(), document.querySelector("[data-leesto-picker-outline]")?.remove();
1861
+ const g = document.createElement("div");
1862
+ g.dataset.leestoPickerOutline = "", g.setAttribute("aria-hidden", "true"), Object.assign(g.style, {
1425
1863
  position: "fixed",
1426
1864
  pointerEvents: "none",
1427
1865
  zIndex: "2147483647",
@@ -1429,197 +1867,206 @@ function Fe(e = {}) {
1429
1867
  border: `2px solid ${n}`,
1430
1868
  borderRadius: "4px",
1431
1869
  display: "none"
1432
- }), document.documentElement.append(h);
1433
- let v = null, g = null, P = null;
1434
- const j = document.body.style.cursor, N = () => {
1435
- const k = g ?? v;
1436
- if (!k) return;
1437
- const x = k.getBoundingClientRect();
1438
- g ? i({
1870
+ }), document.documentElement.append(g);
1871
+ let E = null, w = null, U = null;
1872
+ const X = document.body.style.cursor, x = () => {
1873
+ const M = w ?? E;
1874
+ if (!M) return;
1875
+ const D = M.getBoundingClientRect();
1876
+ w ? s({
1439
1877
  type: "leesto:element-picked",
1440
- selector: hr(k),
1441
- label: mr(k),
1878
+ selector: so(M),
1879
+ label: io(M),
1442
1880
  rect: {
1443
- x: x.x,
1444
- y: x.y,
1445
- width: x.width,
1446
- height: x.height
1881
+ x: D.x,
1882
+ y: D.y,
1883
+ width: D.width,
1884
+ height: D.height
1447
1885
  },
1448
- ...P ? { point: {
1449
- x: x.x + P.x,
1450
- y: x.y + P.y
1886
+ ...U ? { point: {
1887
+ x: D.x + U.x,
1888
+ y: D.y + U.y
1451
1889
  } } : {},
1452
1890
  viewport: {
1453
1891
  width: document.documentElement.clientWidth,
1454
1892
  height: document.documentElement.clientHeight
1455
1893
  },
1456
- context: vn(k)
1457
- }) : Object.assign(h.style, {
1894
+ context: ar(M)
1895
+ }) : Object.assign(g.style, {
1458
1896
  display: "block",
1459
- left: `${x.x}px`,
1460
- top: `${x.y}px`,
1461
- width: `${x.width}px`,
1462
- height: `${x.height}px`
1897
+ left: `${D.x}px`,
1898
+ top: `${D.y}px`,
1899
+ width: `${D.width}px`,
1900
+ height: `${D.height}px`
1463
1901
  });
1464
- }, Se = (k) => {
1465
- v = k.target instanceof Element ? k.target : null, N();
1466
- }, _e = () => {
1467
- h.remove(), document.removeEventListener("mousemove", Se, !0), document.removeEventListener("click", Re, !0), document.body.style.cursor = j;
1468
- }, Re = (k) => {
1469
- if (k.preventDefault(), k.stopPropagation(), g = k.target instanceof Element ? k.target : null, g) {
1470
- const x = g.getBoundingClientRect();
1471
- P = {
1472
- x: k.clientX - x.x,
1473
- y: k.clientY - x.y
1902
+ }, xe = (M) => {
1903
+ E = M.target instanceof Element ? M.target : null, x();
1904
+ }, De = () => {
1905
+ g.remove(), document.removeEventListener("mousemove", xe, !0), document.removeEventListener("click", Fe, !0), document.body.style.cursor = X;
1906
+ }, Fe = (M) => {
1907
+ if (M.preventDefault(), M.stopPropagation(), w = M.target instanceof Element ? M.target : null, w) {
1908
+ const D = w.getBoundingClientRect();
1909
+ U = {
1910
+ x: M.clientX - D.x,
1911
+ y: M.clientY - D.y
1474
1912
  };
1475
1913
  }
1476
- _e(), N();
1477
- }, Ae = (k) => {
1478
- k.key === "Escape" && (a?.(), i({ type: "leesto:pick-cancelled" }));
1914
+ De(), x();
1915
+ }, Pe = (M) => {
1916
+ M.key === "Escape" && (l?.(), s({ type: "leesto:pick-cancelled" }));
1479
1917
  };
1480
- a = () => {
1481
- _e(), document.removeEventListener("keydown", Ae, !0), document.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N), a = null;
1482
- }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", Se, !0), document.addEventListener("click", Re, !0), document.addEventListener("keydown", Ae, !0), document.addEventListener("scroll", N, !0), window.addEventListener("resize", N);
1483
- }, d = yt(location.search, vr()), y = pe(d) && !ee(), b = mt(d), w = y ? gt(d) ?? ht() : void 0, _ = y ? Be({
1918
+ l = () => {
1919
+ De(), document.removeEventListener("keydown", Pe, !0), document.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x), l = null;
1920
+ }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", xe, !0), document.addEventListener("click", Fe, !0), document.addEventListener("keydown", Pe, !0), document.addEventListener("scroll", x, !0), window.addEventListener("resize", x);
1921
+ }, f = Dt(location.search, co()), d = we(f) && !se(), h = Mt(f), b = d ? xt(f) ?? Nt() : void 0, _ = d ? rt({
1484
1922
  captureNetwork: e.captureNetwork !== !1,
1485
- runId: w,
1923
+ runId: b,
1486
1924
  runIdOrigins: e.runIdOrigins
1487
1925
  }) : null;
1488
- let R = !1;
1489
- const S = _ ? ir({
1926
+ let A = null;
1927
+ const S = () => {
1928
+ A ?? (A = Un());
1929
+ };
1930
+ (o || f) && S();
1931
+ let v = !1;
1932
+ const T = _ ? Xr({
1490
1933
  diagnostics: _,
1491
- maskPolicy: b
1492
- }).then((h) => h && R ? (h.stop(), null) : h).catch(() => null) : null;
1493
- let A = null, C = !1, O = !1;
1494
- const M = () => {
1495
- if (A) {
1496
- const h = A.stop();
1497
- A = null, i({
1934
+ maskPolicy: h
1935
+ }).then((g) => g && v ? (g.stop(), null) : g).catch(() => null) : null;
1936
+ let R = null, N = !1, F = !1;
1937
+ const O = () => {
1938
+ if (R) {
1939
+ const g = R.stop();
1940
+ R = null, s({
1498
1941
  type: "leesto:rec-stopped",
1499
- durationMs: h
1942
+ durationMs: g
1500
1943
  });
1501
- } else C && (O = !0);
1502
- }, D = Kn({
1503
- onDetected: () => i({ type: "leesto:login-form-detected" }),
1504
- onFilled: (h) => i({
1944
+ } else N && (F = !0);
1945
+ }, C = Br({
1946
+ onDetected: () => s({ type: "leesto:login-form-detected" }),
1947
+ onFilled: (g) => s({
1505
1948
  type: "leesto:login-filled",
1506
- step: h
1949
+ step: g
1507
1950
  }),
1508
- onError: (h) => i({
1951
+ onError: (g) => s({
1509
1952
  type: "leesto:login-error",
1510
- reason: h
1953
+ reason: g
1511
1954
  }),
1512
- onNoForm: (h) => i({
1955
+ onNoForm: (g) => s({
1513
1956
  type: "leesto:login-no-form",
1514
- signedIn: h
1957
+ signedIn: g
1515
1958
  })
1516
- }), F = () => D.cancel();
1517
- window.addEventListener("pagehide", F);
1518
- const q = fr(e.build), $ = window.navigation;
1519
- let U = !1;
1520
- const f = () => !U && $?.canGoBack === !0, p = () => !U && $?.canGoForward === !0;
1521
- let m = p(), E = f(), I = location.href;
1522
- const B = () => {
1523
- I = location.href, E = f(), m = p();
1524
- const h = dr();
1525
- i({
1959
+ }), Y = () => C.cancel();
1960
+ window.addEventListener("pagehide", Y);
1961
+ const j = un((g) => s({
1962
+ type: "leesto:ambient",
1963
+ ...g
1964
+ })), p = eo(e.build), m = window.navigation;
1965
+ let y = !1;
1966
+ const L = () => !y && m?.canGoBack === !0, k = () => !y && m?.canGoForward === !0;
1967
+ let q = k(), I = L(), P = location.href;
1968
+ const G = () => {
1969
+ P = location.href, I = L(), q = k();
1970
+ const g = to();
1971
+ s({
1526
1972
  type: "leesto:ready",
1527
1973
  url: location.href,
1528
1974
  bridgeVersion: 1,
1529
1975
  capabilities: [
1530
- rt,
1531
- ...$ ? ["navigation", "navigation-forward"] : [],
1532
- ...S ? [ot] : []
1976
+ wt,
1977
+ St,
1978
+ ...m ? ["navigation", "navigation-forward"] : [],
1979
+ ...T ? [Et] : []
1533
1980
  ],
1534
- canGoBack: E,
1535
- canGoForward: m,
1536
- ...h ? { favicon: h } : {},
1537
- ...q ? { build: q } : {},
1538
- ...w ? { diagnosticRunId: w } : {},
1539
- ...ee() ? { gpc: !0 } : {}
1540
- });
1541
- }, L = (h) => {
1542
- if (h.source !== t || !de(h.origin, r) || !at(h.data)) return;
1543
- o !== h.origin && (o = h.origin, yr(h.origin));
1544
- const v = h.data;
1545
- if (v.type === "leesto:ping")
1546
- i({ type: "leesto:pong" }), B();
1547
- else if (v.type === "leesto:navigate-back" || v.type === "leesto:navigate-forward") {
1548
- const g = v.type === "leesto:navigate-forward";
1549
- if (!$ || !(g ? p() : f())) return;
1550
- U = !0, T(), Promise.resolve((g ? $.forward() : $.back()).finished).catch(() => {
1981
+ canGoBack: I,
1982
+ canGoForward: q,
1983
+ ...g ? { favicon: g } : {},
1984
+ ...p ? { build: p } : {},
1985
+ ...b ? { diagnosticRunId: b } : {},
1986
+ ...se() ? { gpc: !0 } : {}
1987
+ }), j.announce();
1988
+ }, Ie = (g) => {
1989
+ if (g.source !== t || !ve(g.origin, r) || !Rt(g.data)) return;
1990
+ o !== g.origin && (o = g.origin, lo(g.origin)), S();
1991
+ const E = g.data;
1992
+ if (E.type === "leesto:ping")
1993
+ s({ type: "leesto:pong" }), G();
1994
+ else if (E.type === "leesto:navigate-back" || E.type === "leesto:navigate-forward") {
1995
+ const w = E.type === "leesto:navigate-forward";
1996
+ if (!m || !(w ? k() : L())) return;
1997
+ y = !0, H(), Promise.resolve((w ? m.forward() : m.back()).finished).catch(() => {
1551
1998
  }).finally(() => {
1552
- U = !1, R || T();
1999
+ y = !1, v || H();
1553
2000
  });
1554
- } else if (v.type === "leesto:highlight") {
1555
- if (s(), v.selector) {
1556
- let g = null;
2001
+ } else if (E.type === "leesto:highlight") {
2002
+ if (i(), E.selector) {
2003
+ let w = null;
1557
2004
  try {
1558
- g = document.querySelector(v.selector);
2005
+ w = document.querySelector(E.selector);
1559
2006
  } catch {
1560
- g = null;
2007
+ w = null;
1561
2008
  }
1562
- g && (u = g, l = g.style.outline, g.style.outline = `2px solid ${n}`, g.style.outlineOffset = "2px", g.scrollIntoView({
2009
+ w && (u = w, a = w.style.outline, w.style.outline = `2px solid ${n}`, w.style.outlineOffset = "2px", w.scrollIntoView({
1563
2010
  block: "center",
1564
2011
  behavior: "smooth"
1565
2012
  }));
1566
2013
  }
1567
- } else if (v.type === "leesto:pick-start") c();
1568
- else if (v.type === "leesto:pick-stop") a?.();
1569
- else if (v.type === "leesto:capture-request") (v.selector ? $e(v.selector) : (e.capture ?? $e)()).then((g) => i({
2014
+ } else if (E.type === "leesto:pick-start") c();
2015
+ else if (E.type === "leesto:pick-stop") l?.();
2016
+ else if (E.type === "leesto:capture-request") (E.selector ? Je(E.selector) : (e.capture ?? Je)()).then((w) => s({
1570
2017
  type: "leesto:screenshot",
1571
- dataUrl: g,
1572
- ...v.selector ? { selector: v.selector } : {}
1573
- })).catch((g) => i({
2018
+ dataUrl: w,
2019
+ ...E.selector ? { selector: E.selector } : {}
2020
+ })).catch((w) => s({
1574
2021
  type: "leesto:capture-failed",
1575
- reason: g instanceof Error ? g.message : "capture_error"
2022
+ reason: w instanceof Error ? w.message : "capture_error"
1576
2023
  }));
1577
- else if (v.type === "leesto:rec-start") {
1578
- if (A || C) return;
1579
- if (ee()) {
1580
- i({
2024
+ else if (E.type === "leesto:rec-start") {
2025
+ if (R || N) return;
2026
+ if (se()) {
2027
+ s({
1581
2028
  type: "leesto:rec-blocked",
1582
2029
  reason: "gpc"
1583
2030
  });
1584
2031
  return;
1585
2032
  }
1586
- C = !0, O = !1;
1587
- const g = (N) => i({
2033
+ N = !0, F = !1;
2034
+ const w = (x) => s({
1588
2035
  type: "leesto:rec-batch",
1589
- events: N
1590
- }), P = () => M(), j = () => or({
1591
- onBatch: g,
1592
- onCap: P,
2036
+ events: x
2037
+ }), U = () => O(), X = () => jr({
2038
+ onBatch: w,
2039
+ onCap: U,
1593
2040
  captureNetwork: e.captureNetwork,
1594
- maskPolicy: b,
2041
+ maskPolicy: h,
1595
2042
  diagnostics: _
1596
2043
  });
1597
- (S ? S.then((N) => N ? N.stream({
1598
- onBatch: g,
1599
- onCap: P
1600
- }) : j()) : j()).then((N) => {
1601
- C = !1, A = N, O && M();
1602
- }).catch((N) => {
1603
- C = !1, i({
2044
+ (T ? T.then((x) => x ? x.stream({
2045
+ onBatch: w,
2046
+ onCap: U
2047
+ }) : X()) : X()).then((x) => {
2048
+ N = !1, R = x, F && O();
2049
+ }).catch((x) => {
2050
+ N = !1, s({
1604
2051
  type: "leesto:rec-error",
1605
- reason: N instanceof Error ? N.message : "rec_error"
2052
+ reason: x instanceof Error ? x.message : "rec_error"
1606
2053
  });
1607
2054
  });
1608
- } else if (v.type === "leesto:rec-stop") M();
1609
- else if (v.type === "leesto:rec-buffer-request") {
1610
- if (!S) {
1611
- i({
2055
+ } else if (E.type === "leesto:rec-stop") O();
2056
+ else if (E.type === "leesto:rec-buffer-request") {
2057
+ if (!T) {
2058
+ s({
1612
2059
  type: "leesto:rec-buffer",
1613
2060
  events: [],
1614
2061
  durationMs: 0,
1615
- unavailable: ee() ? "gpc" : "not-armed"
2062
+ unavailable: se() ? "gpc" : "not-armed"
1616
2063
  });
1617
2064
  return;
1618
2065
  }
1619
- S.then((g) => {
1620
- if (R) return;
1621
- if (!g) {
1622
- i({
2066
+ T.then((w) => {
2067
+ if (v) return;
2068
+ if (!w) {
2069
+ s({
1623
2070
  type: "leesto:rec-buffer",
1624
2071
  events: [],
1625
2072
  durationMs: 0,
@@ -1627,62 +2074,62 @@ function Fe(e = {}) {
1627
2074
  });
1628
2075
  return;
1629
2076
  }
1630
- const { events: P, durationMs: j } = g.snapshot();
1631
- i({
2077
+ const { events: U, durationMs: X } = w.snapshot();
2078
+ s({
1632
2079
  type: "leesto:rec-buffer",
1633
- events: P,
1634
- durationMs: j
2080
+ events: U,
2081
+ durationMs: X
1635
2082
  });
1636
2083
  });
1637
- } else v.type === "leesto:rec-buffer-hold" ? S?.then((g) => g?.hold()) : v.type === "leesto:rec-buffer-release" ? S?.then((g) => g?.release()) : v.type === "leesto:diagnostics-request" ? i({
2084
+ } else E.type === "leesto:rec-buffer-hold" ? T?.then((w) => w?.hold()) : E.type === "leesto:rec-buffer-release" ? T?.then((w) => w?.release()) : E.type === "leesto:diagnostics-request" ? s({
1638
2085
  type: "leesto:diagnostics",
1639
2086
  snapshot: _?.snapshot() ?? {
1640
2087
  errors: [],
1641
2088
  logs: [],
1642
2089
  network: []
1643
2090
  }
1644
- }) : v.type === "leesto:login-watch" ? D.watch() : v.type === "leesto:login-fill" ? D.fill({
1645
- login: v.login,
1646
- password: v.password
1647
- }) : v.type === "leesto:login-cancel" && D.cancel();
2091
+ }) : E.type === "leesto:login-watch" ? C.watch() : E.type === "leesto:login-fill" ? C.fill({
2092
+ login: E.login,
2093
+ password: E.password
2094
+ }) : E.type === "leesto:login-cancel" && C.cancel();
1648
2095
  };
1649
- window.addEventListener("message", L), B();
1650
- const T = (h) => {
1651
- if (!(location.href === I && f() === E && p() === m)) {
1652
- if (location.href !== I) {
1653
- const v = location.href;
1654
- S?.then((g) => g?.markNavigation(v));
2096
+ window.addEventListener("message", Ie), G();
2097
+ const H = (g) => {
2098
+ if (!(location.href === P && L() === I && k() === q)) {
2099
+ if (location.href !== P) {
2100
+ const E = location.href;
2101
+ T?.then((w) => w?.markNavigation(E)), j.navigated();
1655
2102
  }
1656
- I = location.href, E = f(), m = p(), i({
2103
+ P = location.href, I = L(), q = k(), s({
1657
2104
  type: "leesto:location",
1658
2105
  url: location.href,
1659
- canGoBack: E,
1660
- canGoForward: m,
1661
- navigationType: typeof h == "string" ? h : "traverse"
2106
+ canGoBack: I,
2107
+ canGoForward: q,
2108
+ navigationType: typeof g == "string" ? g : "traverse"
1662
2109
  });
1663
2110
  }
1664
- }, G = history.pushState, be = history.replaceState, we = (...h) => {
1665
- G.apply(history, h), T("push");
1666
- }, Ee = (...h) => {
1667
- be.apply(history, h), T("replace");
2111
+ }, Ce = history.pushState, ke = history.replaceState, Ne = (...g) => {
2112
+ Ce.apply(history, g), H("push");
2113
+ }, Me = (...g) => {
2114
+ ke.apply(history, g), H("replace");
1668
2115
  };
1669
- return history.pushState = we, history.replaceState = Ee, $?.addEventListener("currententrychange", T), window.addEventListener("popstate", T), window.addEventListener("hashchange", T), () => {
1670
- R = !0, $?.removeEventListener("currententrychange", T), M(), S?.then((h) => h?.stop()), _?.teardown(), s(), a?.(), D.teardown(), window.removeEventListener("pagehide", F), window.removeEventListener("message", L), window.removeEventListener("popstate", T), window.removeEventListener("hashchange", T), history.pushState === we && (history.pushState = G), history.replaceState === Ee && (history.replaceState = be);
2116
+ return history.pushState = Ne, history.replaceState = Me, m?.addEventListener("currententrychange", H), window.addEventListener("popstate", H), window.addEventListener("hashchange", H), () => {
2117
+ v = !0, j.stop(), A?.(), m?.removeEventListener("currententrychange", H), O(), T?.then((g) => g?.stop()), _?.teardown(), i(), l?.(), C.teardown(), window.removeEventListener("pagehide", Y), window.removeEventListener("message", Ie), window.removeEventListener("popstate", H), window.removeEventListener("hashchange", H), history.pushState === Ne && (history.pushState = Ce), history.replaceState === Me && (history.replaceState = ke);
1671
2118
  };
1672
2119
  }
1673
- function br() {
2120
+ function uo() {
1674
2121
  return typeof document > "u" ? null : document.currentScript ?? document.querySelector("script[data-leesto-connect]");
1675
2122
  }
1676
- function wr(e) {
2123
+ function fo(e) {
1677
2124
  const t = {}, n = e?.dataset.highlightColor;
1678
2125
  n && (t.highlightColor = n);
1679
2126
  const r = (e?.dataset.shellOrigin ?? "").split(",").map((o) => o.trim()).filter(Boolean);
1680
2127
  return r.length > 0 && (t.shellOrigins = r), t;
1681
2128
  }
1682
2129
  if (typeof window < "u") {
1683
- window.LeestoConnect = { connect: (t) => Fe(t) };
1684
- const e = br();
1685
- (!e || e.dataset.leestoManual === void 0) && Fe(wr(e));
2130
+ window.LeestoConnect = { connect: (t) => et(t) };
2131
+ const e = uo();
2132
+ (!e || e.dataset.leestoManual === void 0) && et(fo(e));
1686
2133
  }
1687
2134
 
1688
2135
  //# sourceMappingURL=leesto-connect.js.map