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