@fkn/lib 0.9.14 → 0.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/cloud/dgram.cjs +1 -1
  2. package/cloud/dgram.js +1 -1
  3. package/cloud/net.cjs +1 -1
  4. package/cloud/net.d.ts +1 -1
  5. package/cloud/net.js +1 -1
  6. package/{cloud-xlvU7_rs.d.ts → cloud--8SYg1so.d.ts} +2 -2
  7. package/cloud-Djen7gmX.js +130 -0
  8. package/cloud-OOksFtTZ.cjs +1 -0
  9. package/cloud.cjs +1 -1
  10. package/cloud.d.ts +2 -2
  11. package/cloud.js +3 -3
  12. package/{dgram-BDXvc69t.js → dgram-BP0jykk_.js} +14 -7
  13. package/dgram-CECo4EQT.cjs +1 -0
  14. package/dgram.cjs +1 -1
  15. package/dgram.d.ts +55 -0
  16. package/dgram.js +1 -1
  17. package/{extension-B0qU5XuR.d.ts → extension-CN9oFZ0Q.d.ts} +1 -1
  18. package/extension-DPlyfEPO.cjs +1 -0
  19. package/extension-xVdvgkZL.js +78 -0
  20. package/extension.cjs +1 -1
  21. package/extension.d.ts +2 -2
  22. package/extension.js +3 -3
  23. package/http.cjs +1 -1
  24. package/http.d.ts +1 -1
  25. package/http.js +1 -1
  26. package/{index-DQfP-Uhy.d.ts → index-DLaonjpx.d.ts} +18 -18
  27. package/index.cjs +1 -1
  28. package/index.d.ts +4 -4
  29. package/index.js +11 -11
  30. package/{lib-BcEnB4iV.js → lib-CegQxwDI.js} +559 -298
  31. package/lib-ulyxIbTr.cjs +53 -0
  32. package/{net-CR3V3Q5W.js → net-BDAN5Mvc.js} +12 -4
  33. package/{net-1AjTrb23.d.ts → net-BnGcJpUb.d.ts} +14 -1
  34. package/net-kma1sFhK.cjs +1 -0
  35. package/net.cjs +1 -1
  36. package/net.d.ts +1 -1
  37. package/net.js +1 -1
  38. package/package.json +1 -1
  39. package/cloud-C28lGQEP.cjs +0 -1
  40. package/cloud-y88zoTpE.js +0 -283
  41. package/dgram-C1E6TUWN.cjs +0 -1
  42. package/extension-B8fd9lvk.cjs +0 -1
  43. package/extension-Cts968cO.js +0 -78
  44. package/lib-CQqdCndr.cjs +0 -31
  45. package/net-D3A-Z8RL.cjs +0 -1
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { BoxBase as t, createTypedEventTarget as n, expose as r, recursiveBox as i, recursiveRevive as a } from "osra";
3
- //#region ../web-extension/lib/lib/revivables/event-proxy.js
3
+ //#region node_modules/@mfkn/web-extension/lib/lib/revivables/event-proxy.js
4
4
  var o = (e, t) => {
5
5
  let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
6
6
  return Object.defineProperty(n, "addEventListener", {
@@ -52,10 +52,10 @@ var o = (e, t) => {
52
52
  dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
53
53
  };
54
54
  }, l = /* @__PURE__ */ e({
55
- box: () => S,
56
- createVideoElementHandle: () => b,
57
- isType: () => x,
58
- revive: () => C,
55
+ box: () => C,
56
+ createVideoElementHandle: () => x,
57
+ isType: () => S,
58
+ revive: () => w,
59
59
  type: () => u
60
60
  }), u = "videoElement", d = [
61
61
  "currentTime",
@@ -75,15 +75,15 @@ var o = (e, t) => {
75
75
  "seeking",
76
76
  "readyState",
77
77
  "currentSrc"
78
- ], p = ["buffered", "seekable"], m = Symbol.for("fkn.remoteVideoElement"), h = Symbol.for("fkn.remoteVideoElement.state"), g = Symbol.for("fkn.remoteVideoElement.controller"), _ = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], v = (e) => {
78
+ ], p = ["buffered", "seekable"], m = Symbol.for("fkn.remoteVideoElement"), h = Symbol.for("fkn.remoteVideoElement.state"), g = Symbol.for("fkn.remoteVideoElement.controller"), ee = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], _ = (e) => {
79
79
  let t = {};
80
80
  for (let n of [...d, ...f]) t[n] = e[n];
81
- for (let n of p) t[n] = _(e[n]);
81
+ for (let n of p) t[n] = ee(e[n]);
82
82
  return t.error = e.error ? {
83
83
  code: e.error.code,
84
84
  message: e.error.message
85
85
  } : null, t;
86
- }, ee = (e) => {
86
+ }, v = (e) => {
87
87
  let t = (t) => {
88
88
  if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
89
89
  };
@@ -105,10 +105,10 @@ var o = (e, t) => {
105
105
  MEDIA_ERR_NETWORK: 2,
106
106
  MEDIA_ERR_DECODE: 3,
107
107
  MEDIA_ERR_SRC_NOT_SUPPORTED: 4
108
- } : null, y = (e) => o(e, (e, t) => ({
108
+ } : null, ne = (e) => o(e, (e, t) => ({
109
109
  originalDetail: e instanceof CustomEvent ? e.detail : null,
110
- snapshot: v(t)
111
- })), ne = async (e, t) => {
110
+ snapshot: _(t)
111
+ })), y = async (e, t) => {
112
112
  switch (t) {
113
113
  case "play": return await e.play(), null;
114
114
  case "pause": return e.pause(), null;
@@ -124,15 +124,15 @@ var o = (e, t) => {
124
124
  default: throw Error(`videoElement: unknown method "${t}"`);
125
125
  }
126
126
  }, re = (e) => ({
127
- call: async (t) => ne(e, t),
127
+ call: async (t) => y(e, t),
128
128
  set: async (t, n) => {
129
129
  try {
130
130
  e[t] = n;
131
131
  } catch {}
132
- return v(e);
132
+ return _(e);
133
133
  },
134
- events: y(e)
135
- }), ie = (e, t) => {
134
+ events: ne(e)
135
+ }), b = (e, t) => {
136
136
  let n = new EventTarget();
137
137
  Object.defineProperty(n, m, { value: !0 }), Object.defineProperty(n, h, { value: e }), Object.defineProperty(n, g, { value: t });
138
138
  let r = c({
@@ -229,11 +229,11 @@ var o = (e, t) => {
229
229
  configurable: !0,
230
230
  enumerable: !0,
231
231
  get() {
232
- return ee(e[t]);
232
+ return v(e[t]);
233
233
  }
234
234
  };
235
235
  return Object.defineProperties(n, i), n;
236
- }, b = (e) => ie(v(e), re(e)), x = (e) => typeof e == "object" && !!e && e[m] === !0, S = (e, n) => {
236
+ }, x = (e) => b(_(e), re(e)), S = (e) => typeof e == "object" && !!e && e[m] === !0, C = (e, n) => {
237
237
  let r = e;
238
238
  return {
239
239
  ...t,
@@ -241,76 +241,76 @@ var o = (e, t) => {
241
241
  initialState: r[h],
242
242
  controller: i(r[g], n)
243
243
  };
244
- }, C = (e, t) => {
244
+ }, w = (e, t) => {
245
245
  let n = a(e.controller, t);
246
- return ie({ ...e.initialState }, n);
247
- }, w = (e) => [l, ...e], ae = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", oe = "fknExtension", se = n();
248
- typeof document < "u" && document.addEventListener(ae, () => {
249
- se.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: T() } }));
246
+ return b({ ...e.initialState }, n);
247
+ }, T = (e) => [l, ...e], ie = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", ae = "fknExtension", E = n();
248
+ typeof document < "u" && document.addEventListener(ie, () => {
249
+ E.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: D() } }));
250
250
  });
251
- var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe] === "true", E = null, ce = (e) => {
252
- E = e;
253
- }, le = 150, D = (e = 1e3) => new Promise((t, n) => {
254
- if (T()) return t();
251
+ var D = () => typeof document > "u" ? !1 : document.documentElement.dataset[ae] === "true", O = null, oe = (e) => {
252
+ O = e;
253
+ }, se = 150, k = (e = 1e3) => new Promise((t, n) => {
254
+ if (D()) return t();
255
255
  let r, i = (e) => {
256
256
  clearTimeout(r), s.disconnect(), document.removeEventListener("readystatechange", c), e();
257
257
  }, a = () => i(async () => {
258
- if (E && (await E().catch(() => {}), T())) return t();
258
+ if (O && (await O().catch(() => {}), D())) return t();
259
259
  n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
260
260
  }), o = () => {
261
- clearTimeout(r), r = setTimeout(() => T() ? i(t) : a(), le);
261
+ clearTimeout(r), r = setTimeout(() => D() ? i(t) : a(), se);
262
262
  }, s = new MutationObserver(() => {
263
- T() && i(t);
263
+ D() && i(t);
264
264
  }), c = () => {
265
- document.readyState === "complete" && !T() && o();
265
+ document.readyState === "complete" && !D() && o();
266
266
  };
267
267
  if (r = setTimeout(a, e), s.observe(document.documentElement, {
268
268
  attributes: !0,
269
269
  attributeFilter: ["data-fkn-extension"]
270
270
  }), document.addEventListener("readystatechange", c), document.readyState === "complete") return o();
271
- T() && i(t);
272
- }), ue, O = new Proxy({}, { get: (e, t) => async (...e) => {
273
- await D(), ue ??= r({}, {
271
+ D() && i(t);
272
+ }), ce, A = new Proxy({}, { get: (e, t) => async (...e) => {
273
+ await k(), ce ??= r({}, {
274
274
  transport: window,
275
- revivableModules: w
275
+ revivableModules: T
276
276
  });
277
- let n = (await ue)[t];
277
+ let n = (await ce)[t];
278
278
  return n(...e);
279
- } }), k = [
279
+ } }), j = [
280
280
  "origin",
281
281
  "referer",
282
282
  "cookie"
283
- ], de = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), fe = (e) => de(e, "cookie"), pe = (e, t) => {
284
- if (t === "include" && fe(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
285
- }, me = (e) => {
286
- let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !k.includes(e)))];
283
+ ], le = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), ue = (e) => le(e, "cookie"), de = (e, t) => {
284
+ if (t === "include" && ue(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
285
+ }, fe = (e) => {
286
+ let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !j.includes(e)))];
287
287
  if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
288
- }, he = {
288
+ }, pe = {
289
289
  scope: "network.fetch",
290
290
  category: "network",
291
291
  severity: 0,
292
292
  title: "Fetch data from other sites",
293
293
  description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
294
- }, ge = {
294
+ }, me = {
295
295
  scope: "network.fetchCredentialed",
296
296
  category: "network",
297
297
  severity: 3,
298
298
  unsafe: !0,
299
299
  title: "Fetch from other sites, signed in as you",
300
300
  description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
301
- }, _e = {
301
+ }, he = {
302
302
  scope: "network.fetchLocal",
303
303
  category: "network",
304
304
  severity: 3,
305
305
  unsafe: !0,
306
306
  title: "Access devices on your local network",
307
307
  description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
308
- }, ve = (e) => {
308
+ }, ge = (e) => {
309
309
  let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
310
310
  if (!t) return !1;
311
311
  let [n, r] = [Number(t[1]), Number(t[2])];
312
312
  return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
313
- }, ye = (e) => {
313
+ }, _e = (e) => {
314
314
  let t;
315
315
  try {
316
316
  t = new URL(e);
@@ -318,8 +318,8 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
318
318
  return !1;
319
319
  }
320
320
  let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
321
- return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : ve(n);
322
- }, be = ["fkn.app", "fkn.dev"], A = (e) => {
321
+ return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : ge(n);
322
+ }, ve = ["fkn.app", "fkn.dev"], M = (e) => {
323
323
  let t;
324
324
  try {
325
325
  t = new URL(e);
@@ -328,46 +328,46 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
328
328
  }
329
329
  if (t.protocol === "chrome-extension:" || t.protocol === "moz-extension:") return !0;
330
330
  let n = t.hostname;
331
- return be.some((e) => n === e || n.endsWith(`.${e}`));
332
- }, j = (e) => {
333
- if (A(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
334
- }, xe = (e) => {
331
+ return ve.some((e) => n === e || n.endsWith(`.${e}`));
332
+ }, N = (e) => {
333
+ if (M(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
334
+ }, ye = (e) => {
335
335
  if (!e?.headers) return;
336
- let t = new Headers(e.headers), n = k.map((e) => {
336
+ let t = new Headers(e.headers), n = j.map((e) => {
337
337
  let n = t.get(e);
338
338
  return n === null || n === "" ? void 0 : [e, n];
339
339
  }).filter((e) => e !== void 0);
340
340
  return n.length ? n : void 0;
341
- }, Se = async (e, t) => {
341
+ }, be = async (e, t) => {
342
342
  let n = new Request(e, t);
343
- j(n.url);
343
+ N(n.url);
344
344
  let r = n.body ? await n.arrayBuffer() : null;
345
- return O.proxyFetch({
345
+ return A.proxyFetch({
346
346
  url: n.url,
347
347
  method: n.method,
348
348
  headers: [...n.headers],
349
349
  body: r,
350
350
  credentials: t?.credentials === "include" ? "include" : "omit",
351
351
  redirect: n.redirect,
352
- unsafeHeaders: xe(t),
352
+ unsafeHeaders: ye(t),
353
353
  reason: t?.reason,
354
354
  signal: t?.signal ?? void 0
355
355
  });
356
- }, Ce = {
356
+ }, xe = {
357
357
  scope: "network.readCookie",
358
358
  category: "network",
359
359
  severity: 3,
360
360
  unsafe: !0,
361
361
  title: "Read a site’s cookie",
362
362
  description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
363
- }, we = { get: (e) => O.getCookie(e) }, Te = {
363
+ }, Se = { get: (e) => A.getCookie(e) }, Ce = {
364
364
  scope: "network.modifyRequestHeaders",
365
365
  category: "network",
366
366
  severity: 2,
367
367
  unsafe: !0,
368
368
  title: "Rewrite request headers to other sites",
369
369
  description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
370
- }, Ee = (e) => O.setRequestHeaderRule(e), De = (e) => O.removeRequestHeaderRule({ ruleId: e }), Oe = class extends Error {
370
+ }, we = (e) => A.setRequestHeaderRule(e), Te = (e) => A.removeRequestHeaderRule({ ruleId: e }), Ee = class extends Error {
371
371
  reason;
372
372
  filename;
373
373
  line;
@@ -376,18 +376,18 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
376
376
  constructor(e, t, n, r, i) {
377
377
  super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
378
378
  }
379
- }, ke = class {
379
+ }, De = class {
380
380
  start;
381
381
  end;
382
382
  source;
383
383
  constructor(e, t, n) {
384
384
  this.start = e, this.end = t, this.source = n;
385
385
  }
386
- }, M;
386
+ }, P;
387
387
  (function(e) {
388
- e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.container = "container", e.charset = "charset", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.startingStyle = "starting-style", e.supports = "supports";
389
- })(M ||= {});
390
- var N = (e, t, n) => {
388
+ e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.atRule = "at-rule", e.container = "container", e.charset = "charset", e.counterStyle = "counter-style", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.fontFeatureValues = "font-feature-values", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.pageMarginBox = "page-margin-box", e.positionTry = "position-try", e.property = "property", e.scope = "scope", e.startingStyle = "starting-style", e.supports = "supports", e.viewTransition = "view-transition";
389
+ })(P ||= {});
390
+ var F = (e, t, n) => {
391
391
  let r = n, i = 1e4;
392
392
  do {
393
393
  let n = t.map((t) => e.indexOf(t, r));
@@ -399,7 +399,7 @@ var N = (e, t, n) => {
399
399
  r = o + 2, i--;
400
400
  } while (i > 0);
401
401
  throw Error("Too many escaping");
402
- }, P = (e, t, n) => {
402
+ }, I = (e, t, n) => {
403
403
  let r = n, i = 1e4;
404
404
  do {
405
405
  let n = t.map((t) => e.indexOf(t, r));
@@ -413,21 +413,21 @@ var N = (e, t, n) => {
413
413
  break;
414
414
  case "(":
415
415
  {
416
- let t = P(e, [")"], o + 1);
416
+ let t = I(e, [")"], o + 1);
417
417
  if (t === -1) return -1;
418
418
  r = t + 1;
419
419
  }
420
420
  break;
421
421
  case "\"":
422
422
  {
423
- let t = N(e, ["\""], o + 1);
423
+ let t = F(e, ["\""], o + 1);
424
424
  if (t === -1) return -1;
425
425
  r = t + 1;
426
426
  }
427
427
  break;
428
428
  case "'":
429
429
  {
430
- let t = N(e, ["'"], o + 1);
430
+ let t = F(e, ["'"], o + 1);
431
431
  if (t === -1) return -1;
432
432
  r = t + 1;
433
433
  }
@@ -437,17 +437,17 @@ var N = (e, t, n) => {
437
437
  i--;
438
438
  } while (i > 0);
439
439
  throw Error("Too many escaping");
440
- }, F = /\/\*[^]*?(?:\*\/|$)/g;
441
- function I(e) {
440
+ }, L = /\/\*[^]*?(?:\*\/|$)/g;
441
+ function R(e) {
442
442
  return e ? e.trim() : "";
443
443
  }
444
- function L(e, t) {
444
+ function z(e, t) {
445
445
  let n = e && typeof e.type == "string", r = n ? e : t;
446
446
  for (let t in e) {
447
447
  let n = e[t];
448
448
  Array.isArray(n) ? n.forEach((e) => {
449
- L(e, r);
450
- }) : n && typeof n == "object" && L(n, r);
449
+ z(e, r);
450
+ }) : n && typeof n == "object" && z(n, r);
451
451
  }
452
452
  return n && Object.defineProperty(e, "parent", {
453
453
  configurable: !0,
@@ -456,7 +456,7 @@ function L(e, t) {
456
456
  value: t || null
457
457
  }), e;
458
458
  }
459
- var Ae = class {
459
+ var Oe = class {
460
460
  level = 0;
461
461
  indentation = " ";
462
462
  compress = !1;
@@ -471,25 +471,33 @@ var Ae = class {
471
471
  }
472
472
  visit(e) {
473
473
  switch (e.type) {
474
- case M.stylesheet: return this.stylesheet(e);
475
- case M.rule: return this.rule(e);
476
- case M.declaration: return this.declaration(e);
477
- case M.comment: return this.comment(e);
478
- case M.container: return this.container(e);
479
- case M.charset: return this.charset(e);
480
- case M.document: return this.document(e);
481
- case M.customMedia: return this.customMedia(e);
482
- case M.fontFace: return this.fontFace(e);
483
- case M.host: return this.host(e);
484
- case M.import: return this.import(e);
485
- case M.keyframes: return this.keyframes(e);
486
- case M.keyframe: return this.keyframe(e);
487
- case M.layer: return this.layer(e);
488
- case M.media: return this.media(e);
489
- case M.namespace: return this.namespace(e);
490
- case M.page: return this.page(e);
491
- case M.startingStyle: return this.startingStyle(e);
492
- case M.supports: return this.supports(e);
474
+ case P.stylesheet: return this.stylesheet(e);
475
+ case P.rule: return this.rule(e);
476
+ case P.declaration: return this.declaration(e);
477
+ case P.comment: return this.comment(e);
478
+ case P.container: return this.container(e);
479
+ case P.charset: return this.charset(e);
480
+ case P.counterStyle: return this.counterStyle(e);
481
+ case P.document: return this.document(e);
482
+ case P.customMedia: return this.customMedia(e);
483
+ case P.fontFace: return this.fontFace(e);
484
+ case P.fontFeatureValues: return this.fontFeatureValues(e);
485
+ case P.host: return this.host(e);
486
+ case P.import: return this.import(e);
487
+ case P.keyframes: return this.keyframes(e);
488
+ case P.keyframe: return this.keyframe(e);
489
+ case P.layer: return this.layer(e);
490
+ case P.media: return this.media(e);
491
+ case P.namespace: return this.namespace(e);
492
+ case P.page: return this.page(e);
493
+ case P.pageMarginBox: return this.pageMarginBox(e);
494
+ case P.positionTry: return this.positionTry(e);
495
+ case P.property: return this.property(e);
496
+ case P.scope: return this.scope(e);
497
+ case P.startingStyle: return this.startingStyle(e);
498
+ case P.supports: return this.supports(e);
499
+ case P.viewTransition: return this.viewTransition(e);
500
+ case P.atRule: return this.genericAtRule(e);
493
501
  }
494
502
  }
495
503
  mapVisit(e, t) {
@@ -550,6 +558,9 @@ var Ae = class {
550
558
  let t = e.selectors.length ? `${e.selectors.join(", ")} ` : "";
551
559
  return this.emit(`@page ${t}`, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
552
560
  }
561
+ pageMarginBox(e) {
562
+ return this.compress ? this.emit(`@${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`${this.indent()}@${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit(`\n${this.indent()}}`);
563
+ }
553
564
  fontFace(e) {
554
565
  return this.compress ? this.emit("@font-face", e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit("@font-face ", e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
555
566
  }
@@ -559,6 +570,32 @@ var Ae = class {
559
570
  customMedia(e) {
560
571
  return this.emit(`@custom-media ${e.name} ${e.media};`, e.position);
561
572
  }
573
+ property(e) {
574
+ return this.compress ? this.emit(`@property ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@property ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
575
+ }
576
+ counterStyle(e) {
577
+ return this.compress ? this.emit(`@counter-style ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@counter-style ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
578
+ }
579
+ fontFeatureValues(e) {
580
+ return this.compress ? this.emit(`@font-feature-values ${e.fontFamily}`, e.position) + this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : this.emit(`${this.indent()}@font-feature-values ${e.fontFamily}`, e.position) + this.emit(` {\n${this.indent(1)}`) + this.mapVisit(e.rules, "\n\n") + this.emit(`\n${this.indent(-1)}${this.indent()}}`);
581
+ }
582
+ scope(e) {
583
+ let t = e.scope ? ` ${e.scope}` : "";
584
+ return this.compress ? this.emit(`@scope${t}`, e.position) + this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : this.emit(`${this.indent()}@scope${t}`, e.position) + this.emit(` {\n${this.indent(1)}`) + this.mapVisit(e.rules, "\n\n") + this.emit(`\n${this.indent(-1)}${this.indent()}}`);
585
+ }
586
+ viewTransition(e) {
587
+ return this.compress ? this.emit("@view-transition", e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit("@view-transition ", e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
588
+ }
589
+ positionTry(e) {
590
+ return this.compress ? this.emit(`@position-try ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@position-try ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
591
+ }
592
+ genericAtRule(e) {
593
+ let t = e.prelude ? ` ${e.prelude}` : "";
594
+ if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
595
+ if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
596
+ let n = e.rules.some((e) => e.type !== P.declaration && e.type !== P.comment), r = n ? "\n\n" : "\n";
597
+ return this.emit(`${this.indent()}@${e.name}${t}`, e.position) + this.emit(n ? ` {\n${this.indent(1)}` : " {\n") + this.emit(n ? "" : this.indent(1)) + this.mapVisit(e.rules, r) + this.emit(n ? `\n${this.indent(-1)}${this.indent()}}` : `${this.indent(-1)}\n${this.indent()}}`);
598
+ }
562
599
  rule(e) {
563
600
  let t = e.declarations;
564
601
  if (!t.length) return "";
@@ -569,7 +606,7 @@ var Ae = class {
569
606
  declaration(e) {
570
607
  return this.compress ? this.emit(`${e.property}:${e.value}`, e.position) + this.emit(";") : e.property === "grid-template-areas" ? this.emit(this.indent()) + this.emit(e.property + ": " + e.value.split("\n").join("\n".padEnd(22) + this.indent()), e.position) + this.emit(";") : this.emit(this.indent()) + this.emit(`${e.property}: ${e.value}`, e.position) + this.emit(";");
571
608
  }
572
- }, je = (e, t) => {
609
+ }, ke = (e, t) => {
573
610
  t ||= {};
574
611
  let n = 1, r = 1;
575
612
  function i() {
@@ -577,31 +614,26 @@ var Ae = class {
577
614
  line: n,
578
615
  column: r
579
616
  };
580
- return (i) => (i.position = new ke(e, {
617
+ return (i) => (i.position = new De(e, {
581
618
  line: n,
582
619
  column: r
583
- }, t?.source || ""), d(), i);
620
+ }, t?.source || ""), u(), i);
584
621
  }
585
622
  let a = [];
586
623
  function o(i) {
587
- let o = new Oe(t?.source || "", i, n, r, e);
624
+ let o = new Ee(t?.source || "", i, n, r, e);
588
625
  if (!t?.silent) throw o;
589
626
  a.push(o);
590
627
  }
591
628
  function s() {
592
629
  let t = /^{\s*/.exec(e);
593
- return !!t && (u(t), !0);
630
+ return !!t && (l(t), !0);
594
631
  }
595
632
  function c() {
596
633
  let t = /^}/.exec(e);
597
- return !!t && (u(t), !0);
634
+ return !!t && (l(t), !0);
598
635
  }
599
- function l() {
600
- let t, n = [];
601
- for (d(), f(n); e.length && e.charAt(0) !== "}" && (t = ne() || re(), t);) n.push(t), f(n);
602
- return n;
603
- }
604
- function u(t) {
636
+ function l(t) {
605
637
  let i = t[0];
606
638
  return function(e) {
607
639
  let t = e.match(/\n/g);
@@ -610,272 +642,501 @@ var Ae = class {
610
642
  r = ~i ? e.length - i : r + e.length;
611
643
  }(i), e = e.slice(i.length), t;
612
644
  }
613
- function d() {
645
+ function u() {
614
646
  let t = /^\s*/.exec(e);
615
- t && u(t);
647
+ t && l(t);
616
648
  }
617
- function f(e) {
649
+ function d(e) {
618
650
  e ||= [];
619
- let t = p();
620
- for (; t;) e.push(t), t = p();
651
+ let t = f();
652
+ for (; t;) e.push(t), t = f();
621
653
  return e;
622
654
  }
623
- function p() {
655
+ function f() {
624
656
  let t = i();
625
657
  if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
626
658
  let n = /^\/\*[^]*?\*\//.exec(e);
627
- return n ? (u(n), t({
628
- type: M.comment,
659
+ return n ? (l(n), t({
660
+ type: P.comment,
629
661
  comment: n[0].slice(2, -2)
630
662
  })) : o("End of comment missing");
631
663
  }
632
- function m() {
633
- let t = /^([^{]+)/.exec(e);
634
- if (t) return u(t), ((e, t) => {
664
+ function p() {
665
+ let t = I(e, ["{"]);
666
+ if (t === -1 || t === 0) return;
667
+ let n = e.substring(0, t);
668
+ return l([n]), ((e, t) => {
635
669
  let n = [], r = 0;
636
670
  for (; r < e.length;) {
637
- let i = P(e, t, r);
671
+ let i = I(e, t, r);
638
672
  if (i === -1) return n.push(e.substring(r)), n;
639
673
  n.push(e.substring(r, i)), r = i + 1;
640
674
  }
641
675
  return n;
642
- })(I(t[0]).replace(F, ""), [","]).map((e) => I(e));
676
+ })(R(n).replace(L, ""), [","]).map((e) => R(e));
643
677
  }
644
- function h() {
678
+ function m() {
645
679
  let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
646
680
  if (!n) return;
647
- u(n);
648
- let r = I(n[0]), a = /^:\s*/.exec(e);
681
+ l(n);
682
+ let r = R(n[0]), a = /^:\s*/.exec(e);
649
683
  if (!a) return o("property missing ':'");
650
- u(a);
651
- let s = "", c = P(e, [";", "}"]);
652
- c !== -1 && (s = e.substring(0, c), u([s]), s = I(s).replace(F, ""));
653
- let l = t({
654
- type: M.declaration,
655
- property: r.replace(F, ""),
684
+ l(a);
685
+ let s = "", c = I(e, [";", "}"]);
686
+ c !== -1 && (s = e.substring(0, c), l([s]), s = R(s).replace(L, ""));
687
+ let u = t({
688
+ type: P.declaration,
689
+ property: r.replace(L, ""),
656
690
  value: s
657
691
  }), d = /^[;\s]*/.exec(e);
658
- return d && u(d), l;
692
+ return d && l(d), u;
693
+ }
694
+ function h() {
695
+ let n = [];
696
+ if (!s()) return o("missing '{'");
697
+ d(n);
698
+ let r = m();
699
+ for (; r;) n.push(r), d(n), r = m();
700
+ for (; t?.silent && e.length && e.charAt(0) !== "}";) {
701
+ let t = e.indexOf(";"), i = e.indexOf("}");
702
+ if (t === -1 || !(i === -1 || t < i)) break;
703
+ for (l([e.substring(0, t + 1)]), u(), d(n), r = m(); r;) n.push(r), d(n), r = m();
704
+ }
705
+ return c() ? n : o("missing '}'");
659
706
  }
660
707
  function g() {
661
- let e = [];
708
+ let t = I(e, ["{"]);
709
+ if (t === -1) return !1;
710
+ let n = I(e, [";"]), r = I(e, ["}"]);
711
+ return !(n !== -1 && n < t) && !(r !== -1 && r < t);
712
+ }
713
+ function ee() {
714
+ let n = [];
662
715
  if (!s()) return o("missing '{'");
663
- f(e);
664
- let t = h();
665
- for (; t;) e.push(t), f(e), t = h();
666
- return c() ? e : o("missing '}'");
716
+ for (d(n); e.length && e.charAt(0) !== "}";) {
717
+ if (e.charAt(0) === "@") {
718
+ let e = x();
719
+ if (e) {
720
+ n.push(e), d(n);
721
+ continue;
722
+ }
723
+ }
724
+ if (g()) {
725
+ let e = S();
726
+ if (e) {
727
+ n.push(e), d(n);
728
+ continue;
729
+ }
730
+ }
731
+ let r = m();
732
+ if (!r) {
733
+ if (t?.silent) {
734
+ let t = e.indexOf(";"), r = e.indexOf("}");
735
+ if (t !== -1 && (r === -1 || t < r)) {
736
+ l([e.substring(0, t + 1)]), u(), d(n);
737
+ continue;
738
+ }
739
+ }
740
+ break;
741
+ }
742
+ n.push(r), d(n);
743
+ }
744
+ return c() ? n : o("missing '}'");
667
745
  }
668
746
  function _() {
747
+ let n = [];
748
+ for (u(), d(n); e.length && e.charAt(0) !== "}";) {
749
+ if (e.charAt(0) === "@") {
750
+ let e = x();
751
+ if (e) {
752
+ n.push(e), d(n);
753
+ continue;
754
+ }
755
+ }
756
+ if (g()) {
757
+ let e = S();
758
+ if (e) {
759
+ n.push(e), d(n);
760
+ continue;
761
+ }
762
+ }
763
+ let r = m();
764
+ if (!r) {
765
+ if (t?.silent) {
766
+ let t = e.indexOf(";"), r = e.indexOf("}");
767
+ if (t !== -1 && (r === -1 || t < r)) {
768
+ l([e.substring(0, t + 1)]), u(), d(n);
769
+ continue;
770
+ }
771
+ }
772
+ break;
773
+ }
774
+ n.push(r), d(n);
775
+ }
776
+ return n;
777
+ }
778
+ function v() {
669
779
  let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
670
780
  for (; r;) {
671
- let n = u(r);
781
+ let n = l(r);
672
782
  t.push(n[1]);
673
783
  let i = /^,\s*/.exec(e);
674
- i && u(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
784
+ i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
675
785
  }
676
786
  if (t.length) return n({
677
- type: M.keyframe,
787
+ type: P.keyframe,
678
788
  values: t,
679
- declarations: g() || []
789
+ declarations: h() || []
680
790
  });
681
791
  }
682
- let v = y("import"), ee = y("charset"), te = y("namespace");
683
- function y(t) {
792
+ let te = RegExp(`^@(${[
793
+ "top-left-corner",
794
+ "top-left",
795
+ "top-center",
796
+ "top-right",
797
+ "top-right-corner",
798
+ "bottom-left-corner",
799
+ "bottom-left",
800
+ "bottom-center",
801
+ "bottom-right",
802
+ "bottom-right-corner",
803
+ "left-top",
804
+ "left-middle",
805
+ "left-bottom",
806
+ "right-top",
807
+ "right-middle",
808
+ "right-bottom"
809
+ ].join("|")})(?![\\w-])\\s*`), ne = b("import"), y = b("charset"), re = b("namespace");
810
+ function b(t) {
684
811
  let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
685
812
  return () => {
686
813
  let r = i(), a = n.exec(e);
687
814
  if (!a) return;
688
- let o = u(a), s = { type: t };
815
+ let o = l(a), s = { type: t };
689
816
  return s[t] = o[1].trim(), r(s);
690
817
  };
691
818
  }
692
- function ne() {
819
+ function x() {
693
820
  if (e[0] === "@") return function() {
694
821
  let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
695
822
  if (!n) return;
696
- let r = u(n)[1], a = /^([-\w]+)\s*/.exec(e);
823
+ let r = l(n)[1], a = /^([-\w]+)\s*/.exec(e);
697
824
  if (!a) return o("@keyframes missing name");
698
- let l = u(a)[1];
825
+ let u = l(a)[1];
699
826
  if (!s()) return o("@keyframes missing '{'");
700
- let d = f(), p = _();
701
- for (; p;) d.push(p), d = d.concat(f()), p = _();
827
+ let f = d(), p = v();
828
+ for (; p;) f.push(p), f = f.concat(d()), p = v();
702
829
  return c() ? t({
703
- type: M.keyframes,
704
- name: l,
830
+ type: P.keyframes,
831
+ name: u,
705
832
  vendor: r,
706
- keyframes: d
833
+ keyframes: f
707
834
  }) : o("@keyframes missing '}'");
708
835
  }() || function() {
709
836
  let t = i(), n = /^@media *([^{]+)/.exec(e);
710
837
  if (!n) return;
711
- let r = I(u(n)[1]);
838
+ let r = R(l(n)[1]);
712
839
  if (!s()) return o("@media missing '{'");
713
- let a = f().concat(l());
840
+ let a = _();
714
841
  return c() ? t({
715
- type: M.media,
842
+ type: P.media,
716
843
  media: r,
717
844
  rules: a
718
845
  }) : o("@media missing '}'");
719
846
  }() || function() {
720
847
  let t = i(), n = /^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);
721
848
  if (!n) return;
722
- let r = u(n);
849
+ let r = l(n);
723
850
  return t({
724
- type: M.customMedia,
725
- name: I(r[1]),
726
- media: I(r[2])
851
+ type: P.customMedia,
852
+ name: R(r[1]),
853
+ media: R(r[2])
727
854
  });
728
855
  }() || function() {
729
856
  let t = i(), n = /^@supports *([^{]+)/.exec(e);
730
857
  if (!n) return;
731
- let r = I(u(n)[1]);
858
+ let r = R(l(n)[1]);
732
859
  if (!s()) return o("@supports missing '{'");
733
- let a = f().concat(l());
860
+ let a = _();
734
861
  return c() ? t({
735
- type: M.supports,
862
+ type: P.supports,
736
863
  supports: r,
737
864
  rules: a
738
865
  }) : o("@supports missing '}'");
739
- }() || v() || ee() || te() || function() {
866
+ }() || ne() || y() || re() || function() {
740
867
  let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
741
868
  if (!n) return;
742
- let r = u(n), a = I(r[1]), d = I(r[2]);
869
+ let r = l(n), a = R(r[1]), u = R(r[2]);
743
870
  if (!s()) return o("@document missing '{'");
744
- let p = f().concat(l());
871
+ let d = _();
745
872
  return c() ? t({
746
- type: M.document,
747
- document: d,
873
+ type: P.document,
874
+ document: u,
748
875
  vendor: a,
749
- rules: p
876
+ rules: d
750
877
  }) : o("@document missing '}'");
751
878
  }() || function() {
752
879
  let t = i(), n = /^@page */.exec(e);
753
880
  if (!n) return;
754
- u(n);
755
- let r = m() || [];
881
+ l(n);
882
+ let r = p() || [];
756
883
  if (!s()) return o("@page missing '{'");
757
- let a = f(), l = h();
758
- for (; l;) a.push(l), a = a.concat(f()), l = h();
884
+ let a = [];
885
+ for (d(a); e.length && e.charAt(0) !== "}";) {
886
+ if (e.charAt(0) === "@") {
887
+ let e = x();
888
+ if (e) {
889
+ a.push(e), d(a);
890
+ continue;
891
+ }
892
+ }
893
+ let t = m();
894
+ if (!t) break;
895
+ a.push(t), d(a);
896
+ }
759
897
  return c() ? t({
760
- type: M.page,
898
+ type: P.page,
761
899
  selectors: r,
762
900
  declarations: a
763
901
  }) : o("@page missing '}'");
764
902
  }() || function() {
765
903
  let t = i(), n = /^@host\s*/.exec(e);
766
904
  if (!n) return;
767
- if (u(n), !s()) return o("@host missing '{'");
768
- let r = f().concat(l());
905
+ if (l(n), !s()) return o("@host missing '{'");
906
+ let r = _();
769
907
  return c() ? t({
770
- type: M.host,
908
+ type: P.host,
771
909
  rules: r
772
910
  }) : o("@host missing '}'");
773
911
  }() || function() {
774
912
  let t = i(), n = /^@font-face\s*/.exec(e);
775
913
  if (!n) return;
776
- if (u(n), !s()) return o("@font-face missing '{'");
777
- let r = f(), a = h();
778
- for (; a;) r.push(a), r = r.concat(f()), a = h();
914
+ if (l(n), !s()) return o("@font-face missing '{'");
915
+ let r = d(), a = m();
916
+ for (; a;) r.push(a), r = r.concat(d()), a = m();
779
917
  return c() ? t({
780
- type: M.fontFace,
918
+ type: P.fontFace,
781
919
  declarations: r
782
920
  }) : o("@font-face missing '}'");
921
+ }() || function() {
922
+ let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
923
+ if (!n) return;
924
+ let r = R(l(n)[1]);
925
+ if (!s()) return o("@font-feature-values missing '{'");
926
+ let a = _();
927
+ return c() ? t({
928
+ type: P.fontFeatureValues,
929
+ fontFamily: r,
930
+ rules: a
931
+ }) : o("@font-feature-values missing '}'");
783
932
  }() || function() {
784
933
  let t = i(), n = /^@container *([^{]+)/.exec(e);
785
934
  if (!n) return;
786
- let r = I(u(n)[1]);
935
+ let r = R(l(n)[1]);
787
936
  if (!s()) return o("@container missing '{'");
788
- let a = f().concat(l());
937
+ let a = _();
789
938
  return c() ? t({
790
- type: M.container,
939
+ type: P.container,
791
940
  container: r,
792
941
  rules: a
793
942
  }) : o("@container missing '}'");
794
943
  }() || function() {
795
944
  let t = i(), n = /^@starting-style\s*/.exec(e);
796
945
  if (!n) return;
797
- if (u(n), !s()) return o("@starting-style missing '{'");
798
- let r = f().concat(l());
946
+ if (l(n), !s()) return o("@starting-style missing '{'");
947
+ let r = _();
799
948
  return c() ? t({
800
- type: M.startingStyle,
949
+ type: P.startingStyle,
801
950
  rules: r
802
951
  }) : o("@starting-style missing '}'");
803
952
  }() || function() {
804
953
  let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
805
954
  if (!n) return;
806
- let r = I(u(n)[1]);
955
+ let r = R(l(n)[1]);
807
956
  if (!s()) {
808
957
  let n = /^[;\s]*/.exec(e);
809
- return n && u(n), t({
810
- type: M.layer,
958
+ return n && l(n), t({
959
+ type: P.layer,
811
960
  layer: r
812
961
  });
813
962
  }
814
- let a = f().concat(l());
963
+ let a = _();
815
964
  return c() ? t({
816
- type: M.layer,
965
+ type: P.layer,
817
966
  layer: r,
818
967
  rules: a
819
968
  }) : o("@layer missing '}'");
969
+ }() || function() {
970
+ let t = i(), n = /^@property\s+(--[-\w]+)\s*/.exec(e);
971
+ if (!n) return;
972
+ let r = l(n)[1];
973
+ if (!s()) return o("@property missing '{'");
974
+ let a = d(), u = m();
975
+ for (; u;) a.push(u), a = a.concat(d()), u = m();
976
+ return c() ? t({
977
+ type: P.property,
978
+ name: r,
979
+ declarations: a
980
+ }) : o("@property missing '}'");
981
+ }() || function() {
982
+ let t = i(), n = /^@counter-style\s+([-\w]+)\s*/.exec(e);
983
+ if (!n) return;
984
+ let r = l(n)[1];
985
+ if (!s()) return o("@counter-style missing '{'");
986
+ let a = d(), u = m();
987
+ for (; u;) a.push(u), a = a.concat(d()), u = m();
988
+ return c() ? t({
989
+ type: P.counterStyle,
990
+ name: r,
991
+ declarations: a
992
+ }) : o("@counter-style missing '}'");
993
+ }() || function() {
994
+ let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
995
+ if (!n) return;
996
+ let r = R(l(n)[1]);
997
+ if (!s()) return o("@scope missing '{'");
998
+ let a = _();
999
+ return c() ? t({
1000
+ type: P.scope,
1001
+ scope: r,
1002
+ rules: a
1003
+ }) : o("@scope missing '}'");
1004
+ }() || function() {
1005
+ let t = i(), n = /^@view-transition\s*/.exec(e);
1006
+ if (!n) return;
1007
+ if (l(n), !s()) return o("@view-transition missing '{'");
1008
+ let r = d(), a = m();
1009
+ for (; a;) r.push(a), r = r.concat(d()), a = m();
1010
+ return c() ? t({
1011
+ type: P.viewTransition,
1012
+ declarations: r
1013
+ }) : o("@view-transition missing '}'");
1014
+ }() || function() {
1015
+ let t = i(), n = /^@position-try\s+(--[-\w]+)\s*/.exec(e);
1016
+ if (!n) return;
1017
+ let r = l(n)[1];
1018
+ if (!s()) return o("@position-try missing '{'");
1019
+ let a = d(), u = m();
1020
+ for (; u;) a.push(u), a = a.concat(d()), u = m();
1021
+ return c() ? t({
1022
+ type: P.positionTry,
1023
+ name: r,
1024
+ declarations: a
1025
+ }) : o("@position-try missing '}'");
1026
+ }() || function() {
1027
+ let t = i(), n = te.exec(e);
1028
+ if (!n) return;
1029
+ let r = l(n)[1];
1030
+ if (!s()) return o(`@${r} missing '{'`);
1031
+ let a = d(), u = m();
1032
+ for (; u;) a.push(u), a = a.concat(d()), u = m();
1033
+ return c() ? t({
1034
+ type: P.pageMarginBox,
1035
+ name: r,
1036
+ declarations: a
1037
+ }) : o(`@${r} missing '}'`);
1038
+ }() || function() {
1039
+ let t = i(), n = /^@([-\w]+)\s*/.exec(e);
1040
+ if (!n) return;
1041
+ let r = l(n)[1], a = "", u = I(e, ["{", ";"]);
1042
+ if (u !== -1 && u > 0 && (a = R(e.substring(0, u)), l([e.substring(0, u)])), s()) {
1043
+ let e = _();
1044
+ return c() ? t({
1045
+ type: P.atRule,
1046
+ name: r,
1047
+ prelude: a,
1048
+ rules: e
1049
+ }) : o(`@${r} missing '}'`);
1050
+ }
1051
+ let d = /^[;\s]*/.exec(e);
1052
+ return d && l(d), t({
1053
+ type: P.atRule,
1054
+ name: r,
1055
+ prelude: a
1056
+ });
820
1057
  }();
821
1058
  }
822
- function re() {
823
- let e = i(), t = m();
824
- return t ? (f(), e({
825
- type: M.rule,
1059
+ function S() {
1060
+ let e = i(), t = p();
1061
+ return t ? (d(), e({
1062
+ type: P.rule,
826
1063
  selectors: t,
827
- declarations: g() || []
1064
+ declarations: ee() || []
828
1065
  })) : o("selector missing");
829
1066
  }
830
- return L(function() {
831
- let e = l();
1067
+ return z(function() {
1068
+ let n = function() {
1069
+ let n, r = [];
1070
+ for (u(), d(r); e.length;) {
1071
+ if (e.charAt(0) === "}") {
1072
+ if (t?.silent) {
1073
+ o("extra '}'"), l(["}"]), u(), d(r);
1074
+ continue;
1075
+ }
1076
+ break;
1077
+ }
1078
+ if (n = x() || S(), !n) {
1079
+ if (t?.silent) {
1080
+ l([e.charAt(0)]), u(), d(r);
1081
+ continue;
1082
+ }
1083
+ break;
1084
+ }
1085
+ r.push(n), d(r);
1086
+ }
1087
+ return r;
1088
+ }();
832
1089
  return {
833
- type: M.stylesheet,
1090
+ type: P.stylesheet,
834
1091
  stylesheet: {
835
1092
  source: t?.source,
836
- rules: e,
1093
+ rules: n,
837
1094
  parsingErrors: a
838
1095
  }
839
1096
  };
840
1097
  }());
841
- }, Me = (e, t) => new Ae(t || {}).compile(e), R = "LocatorError", z = "LocatorUnsupportedError", B = "LocatorDeniedError", V = (e) => typeof e == "object" && e ? e.name : void 0, H = (e) => Object.assign(Error(e), { name: R }), U = (e) => V(e) === z, W = (e) => V(e) === B, Ne = (e) => W(e) || U(e), G = (e) => {
1098
+ }, Ae = (e, t) => new Oe(t || {}).compile(e), B = "LocatorError", V = "LocatorUnsupportedError", H = "LocatorDeniedError", U = (e) => typeof e == "object" && e ? e.name : void 0, W = (e) => Object.assign(Error(e), { name: B }), je = (e, t = "", n) => Object.assign(Error(e), {
1099
+ name: V,
1100
+ operation: t,
1101
+ backend: n
1102
+ }), Me = (e, t) => je(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), Ne = (e) => U(e) === V, Pe = (e) => U(e) === H, Fe = (e) => Pe(e) || Ne(e), G = (e) => {
842
1103
  let t = (e.ownerDocument ?? e).defaultView;
843
- if (!t) throw H("the resolved element belongs to a document with no window");
1104
+ if (!t) throw W("the resolved element belongs to a document with no window");
844
1105
  return t;
845
- }, Pe = (e, t) => {
1106
+ }, Ie = (e, t) => {
846
1107
  let n = e?.[t];
847
1108
  return typeof n == "function" ? n : null;
848
1109
  }, K = (e, t) => {
849
1110
  if (typeof e != "object" || !e) return null;
850
1111
  let n = (() => {
851
1112
  try {
852
- return Pe(G(e), t);
1113
+ return Ie(G(e), t);
853
1114
  } catch {
854
1115
  return null;
855
1116
  }
856
1117
  })();
857
1118
  if (n && e instanceof n) return n;
858
- let r = Pe(globalThis, t);
1119
+ let r = Ie(globalThis, t);
859
1120
  return r && e instanceof r ? r : null;
860
1121
  }, q = (e, t) => K(e, t) !== null, J = (e) => {
861
- if (e.length === 0) throw H("No elements found");
862
- if (e.length > 1) throw H(`Strict mode violation: locator resolved to ${e.length} elements`);
1122
+ if (e.length === 0) throw W("No elements found");
1123
+ if (e.length > 1) throw W(`Strict mode violation: locator resolved to ${e.length} elements`);
863
1124
  return e[0];
864
- }, Fe = (e, t) => {
865
- if (!q(e, t)) throw H(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
1125
+ }, Le = (e, t) => {
1126
+ if (!q(e, t)) throw W(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
866
1127
  return e;
867
- }, Ie = (e) => e.tagName.toLowerCase(), Le = /* @__PURE__ */ new Set(), Re = (e) => {
868
- Le.add(e);
869
- }, ze = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Be = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Ve = (e) => !ze.test(Be(e.value)), He = /* @__PURE__ */ new Set([
870
- M.import,
871
- M.fontFace,
872
- M.namespace,
873
- M.charset,
874
- M.document,
875
- M.comment
876
- ]), Ue = (e) => {
877
- if (He.has(e.type)) return null;
878
- if (e.type === M.declaration) return Ve(e) ? e : null;
1128
+ }, Re = (e) => e.tagName.toLowerCase(), ze = /* @__PURE__ */ new Set(), Be = (e) => {
1129
+ ze.add(e);
1130
+ }, Ve = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, He = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Ue = (e) => !Ve.test(He(e.value)), We = /* @__PURE__ */ new Set([
1131
+ P.import,
1132
+ P.fontFace,
1133
+ P.namespace,
1134
+ P.charset,
1135
+ P.document,
1136
+ P.comment
1137
+ ]), Ge = (e) => {
1138
+ if (We.has(e.type)) return null;
1139
+ if (e.type === P.declaration) return Ue(e) ? e : null;
879
1140
  let t = e, n = { ...t };
880
1141
  for (let e of [
881
1142
  "declarations",
@@ -883,18 +1144,18 @@ var Ae = class {
883
1144
  "keyframes"
884
1145
  ]) {
885
1146
  let r = t[e];
886
- Array.isArray(r) && (n[e] = We(r));
1147
+ Array.isArray(r) && (n[e] = Ke(r));
887
1148
  }
888
1149
  return n;
889
- }, We = (e) => e.map((e) => Ue(e)).filter((e) => e !== null), Ge = (e) => {
1150
+ }, Ke = (e) => e.map((e) => Ge(e)).filter((e) => e !== null), qe = (e) => {
890
1151
  let t;
891
1152
  try {
892
- t = je(e, { silent: !0 });
1153
+ t = ke(e, { silent: !0 });
893
1154
  } catch {
894
1155
  return "";
895
1156
  }
896
- return t.stylesheet.rules = We(t.stylesheet.rules), Me(t);
897
- }, Ke = (e, t) => {
1157
+ return t.stylesheet.rules = Ke(t.stylesheet.rules), Ae(t);
1158
+ }, Je = (e, t) => {
898
1159
  let n = () => {
899
1160
  t.parentNode || (e.head ?? e.documentElement).appendChild(t);
900
1161
  };
@@ -911,27 +1172,27 @@ var Ae = class {
911
1172
  });
912
1173
  let i = () => r.disconnect(), a = e.defaultView;
913
1174
  a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
914
- }, qe = { resolve: (e, t) => {
1175
+ }, Ye = { resolve: (e, t) => {
915
1176
  let n = e.document.createElement("style");
916
- n.textContent = t.noSanitize ? t.content : Ge(t.content);
1177
+ n.textContent = t.noSanitize ? t.content : qe(t.content);
917
1178
  try {
918
- Ke(e.document, n);
1179
+ Je(e.document, n);
919
1180
  } catch (e) {
920
1181
  console.error(e);
921
1182
  }
922
- Re(n);
923
- } }, Je = (e, t) => {
1183
+ Be(n);
1184
+ } }, Xe = (e, t) => {
924
1185
  let n = e.getBoundingClientRect();
925
1186
  return {
926
1187
  clientX: n.left + n.width * (t?.x ?? .5),
927
1188
  clientY: n.top + n.height * (t?.y ?? .5)
928
1189
  };
929
- }, Ye = { resolve: (e, t = {}) => {
1190
+ }, Ze = { resolve: (e, t = {}) => {
930
1191
  let n = J(e.elements), r = G(n), i = {
931
1192
  bubbles: !0,
932
1193
  cancelable: !0,
933
1194
  composed: !0,
934
- ...Je(n, t.position),
1195
+ ...Xe(n, t.position),
935
1196
  button: 0
936
1197
  }, a = {
937
1198
  ...i,
@@ -955,12 +1216,12 @@ var Ae = class {
955
1216
  ...i,
956
1217
  buttons: 0
957
1218
  }));
958
- } }, Xe = { resolve: (e, t = {}) => {
1219
+ } }, Qe = { resolve: (e, t = {}) => {
959
1220
  let n = J(e.elements), r = G(n), i = {
960
1221
  bubbles: !0,
961
1222
  cancelable: !0,
962
1223
  composed: !0,
963
- ...Je(n, t.position)
1224
+ ...Xe(n, t.position)
964
1225
  }, a = {
965
1226
  ...i,
966
1227
  pointerType: "mouse",
@@ -974,11 +1235,11 @@ var Ae = class {
974
1235
  ...i,
975
1236
  bubbles: !1
976
1237
  })), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
977
- } }, Ze = (e, t) => {
1238
+ } }, $e = (e, t) => {
978
1239
  e._valueTracker?.setValue("");
979
1240
  let n = (K(e, "HTMLTextAreaElement") ?? K(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
980
1241
  r ? r.call(e, t) : e.value = t;
981
- }, Qe = (e, t) => {
1242
+ }, et = (e, t) => {
982
1243
  if (e.type !== "range") return null;
983
1244
  let n = Number(e.min || 0), r = Number(e.max || 100);
984
1245
  if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
@@ -1015,36 +1276,36 @@ var Ae = class {
1015
1276
  buttons: 0
1016
1277
  }
1017
1278
  };
1018
- }, $e = { resolve: (e, t, n = {}) => {
1279
+ }, tt = { resolve: (e, t, n = {}) => {
1019
1280
  let r = J(e.elements), i = G(r), a = q(r, "HTMLInputElement");
1020
1281
  if (a || q(r, "HTMLTextAreaElement")) {
1021
- let e = r, n = a ? Qe(e, t) : null;
1022
- n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Ze(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1282
+ let e = r, n = a ? et(e, t) : null;
1283
+ n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), $e(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1023
1284
  return;
1024
1285
  }
1025
1286
  if (q(r, "HTMLElement") && r.isContentEditable) {
1026
1287
  r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
1027
1288
  return;
1028
1289
  }
1029
- throw Error(`fill: element <${Ie(r)}> is not fillable`);
1030
- } }, et = { resolve: (e, t = {}) => J(e.elements).textContent }, tt = { resolve: (e, t, n = {}) => J(e.elements).getAttribute(t) }, nt = { resolve: (e, t = {}) => {
1290
+ throw Error(`fill: element <${Re(r)}> is not fillable`);
1291
+ } }, nt = { resolve: (e, t = {}) => J(e.elements).textContent }, rt = { resolve: (e, t, n = {}) => J(e.elements).getAttribute(t) }, it = { resolve: (e, t = {}) => {
1031
1292
  let n = J(e.elements);
1032
1293
  if (!q(n, "HTMLElement")) return !0;
1033
1294
  let r = G(n).getComputedStyle(n);
1034
1295
  if (r?.display === "none" || r?.visibility === "hidden") return !1;
1035
1296
  let i = n.getBoundingClientRect();
1036
1297
  return i.width > 0 && i.height > 0;
1037
- } }, rt = { resolve: (e, t = {}) => e.elements.length }, it = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1298
+ } }, at = { resolve: (e, t = {}) => e.elements.length }, ot = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1038
1299
  __proto__: null,
1039
- click: Ye,
1040
- count: rt,
1041
- exists: it,
1042
- fill: $e,
1043
- getAttribute: tt,
1044
- hover: Xe,
1045
- isVisible: nt,
1046
- textContent: et
1047
- }, Symbol.toStringTag, { value: "Module" })), X = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Z = (e) => e.replaceAll("\"", "\\\""), at = {
1300
+ click: Ze,
1301
+ count: at,
1302
+ exists: ot,
1303
+ fill: tt,
1304
+ getAttribute: rt,
1305
+ hover: Qe,
1306
+ isVisible: it,
1307
+ textContent: nt
1308
+ }, Symbol.toStringTag, { value: "Module" })), X = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Z = (e) => e.replaceAll("\"", "\\\""), st = {
1048
1309
  to: "element",
1049
1310
  css: !0,
1050
1311
  resolve: (e, t) => X(e, t),
@@ -1052,7 +1313,7 @@ var Ae = class {
1052
1313
  fragment: typeof e == "string" ? e : "?",
1053
1314
  separator: "descend"
1054
1315
  })
1055
- }, Q = {
1316
+ }, ct = {
1056
1317
  to: "frame",
1057
1318
  css: !0,
1058
1319
  barrier: "down",
@@ -1061,11 +1322,11 @@ var Ae = class {
1061
1322
  fragment: typeof e == "string" ? e : "?",
1062
1323
  separator: "down"
1063
1324
  })
1064
- }, ot = {
1325
+ }, lt = {
1065
1326
  element: {
1066
1327
  selectors: {
1067
- locator: at,
1068
- frameLocator: Q,
1328
+ locator: st,
1329
+ frameLocator: ct,
1069
1330
  getByRole: {
1070
1331
  to: "element",
1071
1332
  resolve: (e, t) => X(e, `[role="${CSS.escape(t)}"]`),
@@ -1096,20 +1357,20 @@ var Ae = class {
1096
1357
  }
1097
1358
  },
1098
1359
  operations: {
1099
- click: Ye,
1100
- fill: $e,
1101
- hover: Xe,
1102
- textContent: et,
1103
- getAttribute: tt,
1104
- isVisible: nt,
1105
- count: rt,
1106
- exists: it
1360
+ click: Ze,
1361
+ fill: tt,
1362
+ hover: Qe,
1363
+ textContent: nt,
1364
+ getAttribute: rt,
1365
+ isVisible: it,
1366
+ count: at,
1367
+ exists: ot
1107
1368
  }
1108
1369
  },
1109
1370
  frame: {
1110
1371
  selectors: {
1111
- locator: at,
1112
- frameLocator: Q,
1372
+ locator: st,
1373
+ frameLocator: ct,
1113
1374
  owner: {
1114
1375
  to: "frame",
1115
1376
  barrier: "up",
@@ -1122,9 +1383,9 @@ var Ae = class {
1122
1383
  })
1123
1384
  }
1124
1385
  },
1125
- operations: { addStyleTag: qe }
1386
+ operations: { addStyleTag: Ye }
1126
1387
  }
1127
- }, st = (e, t = ot) => ({
1388
+ }, ut = (e, t = lt) => ({
1128
1389
  element: {
1129
1390
  selectors: {
1130
1391
  ...t.element.selectors,
@@ -1145,29 +1406,29 @@ var Ae = class {
1145
1406
  ...e.frame?.operations
1146
1407
  }
1147
1408
  }
1148
- }), ct = 3e4, lt = 50, ut = (e) => {
1409
+ }), dt = 3e4, ft = 50, pt = (e) => {
1149
1410
  let t = e[e.length - 1];
1150
1411
  return typeof t == "object" && t ? t : void 0;
1151
- }, dt = (e) => {
1152
- let t = ut(e)?.timeout;
1153
- return typeof t == "number" ? t : ct;
1154
- }, ft = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), pt = async (e) => {
1412
+ }, mt = (e) => {
1413
+ let t = pt(e)?.timeout;
1414
+ return typeof t == "number" ? t : dt;
1415
+ }, ht = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), gt = async (e) => {
1155
1416
  let t = {
1156
1417
  parts: e.parts,
1157
1418
  operation: e.operation,
1158
1419
  args: e.args,
1159
1420
  phase: "ensure"
1160
1421
  };
1161
- await e.gate?.(t, ft(e));
1162
- }, mt = async (e) => {
1422
+ await e.gate?.(t, ht(e));
1423
+ }, _t = async (e) => {
1163
1424
  let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
1164
1425
  n && await n({
1165
1426
  parts: r,
1166
1427
  operation: i,
1167
1428
  args: a,
1168
1429
  phase: "execute"
1169
- }, ft(e));
1170
- let o = dt(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1430
+ }, ht(e));
1431
+ let o = mt(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1171
1432
  l.catch(() => {});
1172
1433
  let d = setTimeout(() => u(c), o), f = c;
1173
1434
  try {
@@ -1175,36 +1436,36 @@ var Ae = class {
1175
1436
  return await Promise.race([t.execute(r, i, a), l]);
1176
1437
  } catch (e) {
1177
1438
  if (e === c) break;
1178
- if (Ne(e)) throw e;
1439
+ if (Fe(e)) throw e;
1179
1440
  f = e;
1180
1441
  let t = s - Date.now();
1181
1442
  if (t <= 0) break;
1182
- await new Promise((e) => setTimeout(e, Math.min(lt, t)));
1443
+ await new Promise((e) => setTimeout(e, Math.min(ft, t)));
1183
1444
  }
1184
1445
  } finally {
1185
1446
  clearTimeout(d);
1186
1447
  }
1187
1448
  throw f;
1188
- }, ht = (e, t, n, r) => {
1449
+ }, vt = (e, t, n, r) => {
1189
1450
  let i = {};
1190
- for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => ht(e, t, o.to, [...r, {
1451
+ for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => vt(e, t, o.to, [...r, {
1191
1452
  kind: n,
1192
1453
  name: a,
1193
1454
  args: i
1194
1455
  }]);
1195
- for (let a of Object.keys(t[n].operations)) i[a] = (...t) => mt({
1456
+ for (let a of Object.keys(t[n].operations)) i[a] = (...t) => _t({
1196
1457
  ...e,
1197
1458
  parts: r,
1198
1459
  operation: a,
1199
1460
  args: t
1200
1461
  });
1201
- return i.ensure = (t, n = {}) => pt({
1462
+ return i.ensure = (t, n = {}) => gt({
1202
1463
  ...e,
1203
1464
  parts: r,
1204
1465
  operation: t,
1205
1466
  args: [n]
1206
1467
  }), i;
1207
- }, gt = (e) => ht(e, e.modules ?? ot, "frame", []), _t = st({
1468
+ }, yt = (e) => vt(e, e.modules ?? lt, "frame", []), bt = ut({
1208
1469
  element: { operations: {
1209
1470
  click: { resolve: (e, t = {}) => Y.click.resolve(e, t) },
1210
1471
  hover: { resolve: (e, t = {}) => Y.hover.resolve(e, t) },
@@ -1214,10 +1475,10 @@ var Ae = class {
1214
1475
  isVisible: { resolve: (e, t = {}) => Y.isVisible.resolve(e) },
1215
1476
  count: { resolve: (e, t = {}) => Y.count.resolve(e) },
1216
1477
  exists: { resolve: (e, t = {}) => Y.exists.resolve(e) },
1217
- videoElement: { resolve: (e, t = {}) => b(Fe(J(e.elements), "HTMLVideoElement")) }
1478
+ videoElement: { resolve: (e, t = {}) => x(Le(J(e.elements), "HTMLVideoElement")) }
1218
1479
  } },
1219
- frame: { operations: { addStyleTag: { resolve: (e, t) => qe.resolve(e, t) } } }
1220
- }), vt = (e) => {
1480
+ frame: { operations: { addStyleTag: { resolve: (e, t) => Ye.resolve(e, t) } } }
1481
+ }), Q = (e) => {
1221
1482
  if (!e || e === "about:blank") return !1;
1222
1483
  let t;
1223
1484
  try {
@@ -1230,25 +1491,25 @@ var Ae = class {
1230
1491
  let n = t.hostname, r = (e) => n === e || n.endsWith(`.${e}`);
1231
1492
  return r("fkn.app") || r("fkn.dev") || r("sdbx.app");
1232
1493
  }, $ = (e) => {
1233
- if (vt(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1234
- }, yt = ({ src: e, domains: t, lockdown: n }) => {
1494
+ if (Q(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1495
+ }, xt = ({ src: e, domains: t, lockdown: n }) => {
1235
1496
  if (!(!n || t.length) && e && e !== "about:blank") throw Error("attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto");
1236
- }, bt = {
1497
+ }, St = {
1237
1498
  scope: "embed.iframe",
1238
1499
  category: "embed",
1239
1500
  severity: 0,
1240
1501
  title: "Load another website inside this app",
1241
1502
  description: "Lets the app embed external pages directly inside its own view."
1242
- }, xt = {
1503
+ }, Ct = {
1243
1504
  scope: "embed.open",
1244
1505
  category: "embed",
1245
1506
  severity: 0,
1246
1507
  title: "Open a website inside this app",
1247
1508
  description: "Lets the app navigate to another site without leaving its window."
1248
- }, St = (e) => {
1249
- let t = gt({
1509
+ }, wt = (e) => {
1510
+ let t = yt({
1250
1511
  executor: e.executor,
1251
- modules: _t,
1512
+ modules: bt,
1252
1513
  gate: e.gate
1253
1514
  }), n = (t, n = {}) => ($(t), e.goto(t, n)), r = () => e.url();
1254
1515
  return {
@@ -1256,21 +1517,21 @@ var Ae = class {
1256
1517
  goto: n,
1257
1518
  url: r
1258
1519
  };
1259
- }, Ct = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", wt = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1 }) => {
1520
+ }, Tt = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Et = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1 }) => {
1260
1521
  let i = crypto.randomUUID();
1261
- if ($(e.src), yt({
1522
+ if ($(e.src), xt({
1262
1523
  src: e.src,
1263
1524
  domains: t,
1264
1525
  lockdown: r
1265
- }), await D(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
1266
- e.dispatchEvent(new CustomEvent(Ct, { detail: i }));
1267
- let { executeLocator: a, highlightLocator: o, ensureLocatorPermission: s, goto: c } = await O.attachFrame({
1526
+ }), await k(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
1527
+ e.dispatchEvent(new CustomEvent(Tt, { detail: i }));
1528
+ let { executeLocator: a, highlightLocator: o, ensureLocatorPermission: s, goto: c } = await A.attachFrame({
1268
1529
  marker: i,
1269
1530
  domains: t,
1270
1531
  syncCookies: n,
1271
1532
  lockdown: r
1272
1533
  });
1273
- return St({
1534
+ return wt({
1274
1535
  executor: {
1275
1536
  execute: a,
1276
1537
  highlight: o
@@ -1282,10 +1543,10 @@ var Ae = class {
1282
1543
  }),
1283
1544
  url: () => e.src
1284
1545
  });
1285
- }, Tt = { request: (e) => O.requestPermissions(e.map((e) => ({
1546
+ }, Dt = { request: (e) => A.requestPermissions(e.map((e) => ({
1286
1547
  key: e.key,
1287
1548
  scope: e.scope ?? "",
1288
1549
  reason: e.reason
1289
1550
  }))) };
1290
1551
  //#endregion
1291
- export { pe as A, C as B, ge as C, ye as D, A as E, D as F, w as I, S as L, se as M, T as N, k as O, ce as P, b as R, Se as S, he as T, u as V, De as _, St as a, Ce as b, yt as c, W as d, Ne as f, Te as g, B as h, bt as i, fe as j, me as k, vt as l, z as m, Ct as n, xt as o, U as p, wt as r, $ as s, Tt as t, R as u, Ee as v, _e as w, j as x, we as y, x as z };
1552
+ export { fe as A, S as B, be as C, M as D, pe as E, oe as F, u as H, k as I, T as L, ue as M, E as N, _e as O, D as P, C as R, N as S, he as T, w as V, Ce as _, wt as a, Se as b, xt as c, Pe as d, Me as f, H as g, V as h, St as i, de as j, j as k, Q as l, Ne as m, Tt as n, Ct as o, Fe as p, Et as r, $ as s, Dt as t, B as u, Te as v, me as w, xe as x, we as y, x as z };