@fkn/lib 0.9.40 → 0.9.42
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.
- package/account-generation-B-6Pn0b5.cjs +1 -0
- package/account-generation-XNWOvLea.js +28 -0
- package/account.cjs +1 -1
- package/account.d.ts +11 -0
- package/account.js +8 -20
- package/api--LOXTOpv.cjs +3 -0
- package/{api-Dp-2AT3u.js → api-DIgTslNb.js} +154 -114
- package/{api-BE5zPvFZ.d.ts → api-SwxtiYVU.d.ts} +38 -14
- package/api.cjs +1 -1
- package/api.d.ts +3 -3
- package/api.js +2 -2
- package/attach-policy.cjs +1 -1
- package/attach-policy.js +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +4 -4
- package/cloud/fs.js +31 -24
- package/cloud/net.d.ts +1 -1
- package/cloud-868OlBKn.cjs +1 -0
- package/{cloud-5eldoFxK.d.ts → cloud-DUH-v10C.d.ts} +6 -4
- package/cloud-f3j4s8yZ.js +545 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-Cvr_8gCL.d.ts → contract-CCxPKIC7.d.ts} +105 -13
- package/contract.d.ts +3 -2
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/extension-BOBuYwZc.js +92 -0
- package/extension-hoUs5yJ7.cjs +1 -0
- package/{extension-DMU-CwMw.d.ts → extension-yhwDSIiD.d.ts} +22 -3
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-CVnmXRf7.js +513 -0
- package/{fs--NhtUyYa.d.ts → fs-D0MMRnHC.d.ts} +8 -4
- package/fs-p0bOOj5n.cjs +1 -0
- package/fs.cjs +1 -1
- package/fs.d.ts +4 -3
- package/fs.js +4 -2
- package/{hosts-9dYv63ud.cjs → hosts-GNBhZO3-.cjs} +1 -1
- package/{hosts-BzbzOhG8.js → hosts-t7CKGTRz.js} +4 -1
- package/http.d.ts +1 -1
- package/{index-D2CA-NX5.d.ts → index-BtFiGoVQ.d.ts} +465 -51
- package/{index-kuPqkS_-.d.ts → index-D2lvaQDs.d.ts} +28 -38
- package/index.cjs +1 -1
- package/index.d.ts +17 -17
- package/index.js +62 -59
- package/lib-CfdmsLoI.cjs +53 -0
- package/{lib-C4Eeg9eM.js → lib-DppqX10G.js} +470 -302
- package/{messages-C66ghz_A.d.ts → messages-CRcziTuC.d.ts} +17 -1
- package/messages.cjs +1 -1
- package/messages.d.ts +2 -2
- package/messages.js +2 -2
- package/{net-zThwNoA8.d.ts → net-DcLF-6E-.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/{node-fs-BZy9bzKd.js → node-fs-CK2wWIYS.js} +140 -137
- package/node-fs-nfX7wisL.cjs +1 -0
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +14 -14
- package/{proxy-Dc0gDOxz.d.ts → proxy-CE46SkyA.d.ts} +2 -2
- package/{proxy-DjoPtJH9.cjs → proxy-CFK-KiwE.cjs} +1 -1
- package/{proxy-DMTdQ4dN.js → proxy-Dixbk1WL.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +11 -11
- package/storage-BVr2Rb-d.d.ts +167 -0
- package/storage-D2cUJlVH.cjs +1 -0
- package/storage-Dn1gTLSZ.js +123 -0
- package/api-jOTOA-5n.cjs +0 -3
- package/cloud-BLv19j-W.js +0 -480
- package/cloud-D7aQY4GH.cjs +0 -1
- package/extension-B9v933cT.js +0 -89
- package/extension-D2zMdc2f.cjs +0 -1
- package/fs-CaQFRiIT.cjs +0 -1
- package/fs-D3IsGdnN.js +0 -360
- package/lib-BfAg9mHD.cjs +0 -53
- package/node-fs-BNTPsX5c.cjs +0 -1
- package/storage-BJd-mWHE.cjs +0 -1
- package/storage-DSvL-t80.js +0 -67
- package/storage-ZrY4Y4L5.d.ts +0 -88
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-
|
|
3
|
-
import { BoxBase as
|
|
2
|
+
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-t7CKGTRz.js";
|
|
3
|
+
import { BoxBase as _, createTypedEventTarget as v, expose as y, recursiveBox as ee, recursiveRevive as te } from "osra";
|
|
4
4
|
//#region ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
|
-
var
|
|
5
|
+
var ne = (e, t) => {
|
|
6
6
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
7
7
|
return Object.defineProperty(n, "addEventListener", {
|
|
8
8
|
configurable: !0,
|
|
@@ -31,12 +31,12 @@ var re = (e, t) => {
|
|
|
31
31
|
o && (e.removeEventListener(t, o), r.delete(t));
|
|
32
32
|
}
|
|
33
33
|
}), n;
|
|
34
|
-
},
|
|
34
|
+
}, b = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, x = (e) => {
|
|
35
35
|
let t = /* @__PURE__ */ new WeakMap();
|
|
36
36
|
return {
|
|
37
37
|
addEventListener: (n, r, i) => {
|
|
38
38
|
if (r === null) return;
|
|
39
|
-
let a = `${n}|${
|
|
39
|
+
let a = `${n}|${b(i)}`, o = t.get(r);
|
|
40
40
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
41
41
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
42
42
|
s && o.delete(a);
|
|
@@ -47,18 +47,18 @@ var re = (e, t) => {
|
|
|
47
47
|
},
|
|
48
48
|
removeEventListener: (n, r, i) => {
|
|
49
49
|
if (r === null) return;
|
|
50
|
-
let a = `${n}|${
|
|
50
|
+
let a = `${n}|${b(i)}`, o = t.get(r), s = o?.get(a);
|
|
51
51
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
52
52
|
},
|
|
53
53
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
54
54
|
};
|
|
55
|
-
},
|
|
55
|
+
}, S = /* @__PURE__ */ e({
|
|
56
56
|
box: () => ve,
|
|
57
57
|
createVideoElementHandle: () => w,
|
|
58
58
|
isType: () => _e,
|
|
59
59
|
revive: () => ye,
|
|
60
|
-
type: () =>
|
|
61
|
-
}),
|
|
60
|
+
type: () => C
|
|
61
|
+
}), C = "videoElement", re = [
|
|
62
62
|
"currentTime",
|
|
63
63
|
"volume",
|
|
64
64
|
"muted",
|
|
@@ -69,17 +69,17 @@ var re = (e, t) => {
|
|
|
69
69
|
"preload",
|
|
70
70
|
"poster",
|
|
71
71
|
"disableRemotePlayback"
|
|
72
|
-
],
|
|
72
|
+
], ie = [
|
|
73
73
|
"duration",
|
|
74
74
|
"paused",
|
|
75
75
|
"ended",
|
|
76
76
|
"seeking",
|
|
77
77
|
"readyState",
|
|
78
78
|
"currentSrc"
|
|
79
|
-
],
|
|
79
|
+
], ae = ["buffered", "seekable"], oe = Symbol.for("fkn.remoteVideoElement"), se = Symbol.for("fkn.remoteVideoElement.state"), ce = Symbol.for("fkn.remoteVideoElement.controller"), le = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], ue = (e) => {
|
|
80
80
|
let t = {};
|
|
81
|
-
for (let n of [...
|
|
82
|
-
for (let n of
|
|
81
|
+
for (let n of [...re, ...ie]) t[n] = e[n];
|
|
82
|
+
for (let n of ae) t[n] = le(e[n]);
|
|
83
83
|
return t.error = e.error ? {
|
|
84
84
|
code: e.error.code,
|
|
85
85
|
message: e.error.message
|
|
@@ -106,9 +106,9 @@ var re = (e, t) => {
|
|
|
106
106
|
MEDIA_ERR_NETWORK: 2,
|
|
107
107
|
MEDIA_ERR_DECODE: 3,
|
|
108
108
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
109
|
-
} : null, pe = (e) =>
|
|
109
|
+
} : null, pe = (e) => ne(e, (e, t) => ({
|
|
110
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
|
-
snapshot:
|
|
111
|
+
snapshot: ue(t)
|
|
112
112
|
})), me = async (e, t) => {
|
|
113
113
|
switch (t) {
|
|
114
114
|
case "play": return await e.play(), null;
|
|
@@ -130,13 +130,13 @@ var re = (e, t) => {
|
|
|
130
130
|
try {
|
|
131
131
|
e[t] = n;
|
|
132
132
|
} catch {}
|
|
133
|
-
return
|
|
133
|
+
return ue(e);
|
|
134
134
|
},
|
|
135
135
|
events: pe(e)
|
|
136
136
|
}), ge = (e, t) => {
|
|
137
137
|
let n = new EventTarget();
|
|
138
|
-
Object.defineProperty(n,
|
|
139
|
-
let r =
|
|
138
|
+
Object.defineProperty(n, oe, { value: !0 }), Object.defineProperty(n, se, { value: e }), Object.defineProperty(n, ce, { value: t });
|
|
139
|
+
let r = x({
|
|
140
140
|
target: n,
|
|
141
141
|
remoteEvents: t.events,
|
|
142
142
|
unenrich: (t, n) => {
|
|
@@ -207,7 +207,7 @@ var re = (e, t) => {
|
|
|
207
207
|
value: 4
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
|
-
for (let n of
|
|
210
|
+
for (let n of re) i[n] = {
|
|
211
211
|
configurable: !0,
|
|
212
212
|
enumerable: !0,
|
|
213
213
|
get() {
|
|
@@ -219,14 +219,14 @@ var re = (e, t) => {
|
|
|
219
219
|
}, () => {});
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
|
-
for (let t of
|
|
222
|
+
for (let t of ie) i[t] = {
|
|
223
223
|
configurable: !0,
|
|
224
224
|
enumerable: !0,
|
|
225
225
|
get() {
|
|
226
226
|
return e[t];
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
for (let t of
|
|
229
|
+
for (let t of ae) i[t] = {
|
|
230
230
|
configurable: !0,
|
|
231
231
|
enumerable: !0,
|
|
232
232
|
get() {
|
|
@@ -234,18 +234,18 @@ var re = (e, t) => {
|
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
}, w = (e) => ge(
|
|
237
|
+
}, w = (e) => ge(ue(e), he(e)), _e = (e) => typeof e == "object" && !!e && e[oe] === !0, ve = (e, t) => {
|
|
238
238
|
let n = e;
|
|
239
239
|
return {
|
|
240
|
-
...
|
|
241
|
-
type:
|
|
242
|
-
initialState: n[
|
|
243
|
-
controller:
|
|
240
|
+
..._,
|
|
241
|
+
type: C,
|
|
242
|
+
initialState: n[se],
|
|
243
|
+
controller: ee(n[ce], t)
|
|
244
244
|
};
|
|
245
245
|
}, ye = (e, t) => {
|
|
246
|
-
let n =
|
|
246
|
+
let n = te(e.controller, t);
|
|
247
247
|
return ge({ ...e.initialState }, n);
|
|
248
|
-
}, be = (e) => [
|
|
248
|
+
}, be = (e) => [S, ...e], xe = 3, Se = 0, Ce = "fknExtension", we = "fknExtensionAbi", Te = "fknExtensionOps", Ee = [
|
|
249
249
|
"data-fkn-extension",
|
|
250
250
|
"data-fkn-extension-abi",
|
|
251
251
|
"data-fkn-extension-ops"
|
|
@@ -280,13 +280,13 @@ var re = (e, t) => {
|
|
|
280
280
|
constructor(e, t, n) {
|
|
281
281
|
super(n ?? `The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
282
282
|
}
|
|
283
|
-
}, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe =
|
|
283
|
+
}, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe = v();
|
|
284
284
|
typeof document < "u" && document.addEventListener(Me, () => {
|
|
285
285
|
Pe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Fe() } }));
|
|
286
286
|
});
|
|
287
|
-
var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", D = () => typeof document > "u" ? { status: "absent" } : ke(document.documentElement.dataset),
|
|
288
|
-
|
|
289
|
-
},
|
|
287
|
+
var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", D = () => typeof document > "u" ? { status: "absent" } : ke(document.documentElement.dataset), O = null, Ie = (e) => {
|
|
288
|
+
O = e;
|
|
289
|
+
}, Le = 150, k = (e = 1e3) => new Promise((t, n) => {
|
|
290
290
|
let r = () => D().status === "ok";
|
|
291
291
|
if (r()) return t();
|
|
292
292
|
let i, a = (e) => {
|
|
@@ -294,14 +294,14 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
294
294
|
}, o = () => a(async () => {
|
|
295
295
|
let e = D();
|
|
296
296
|
if (e.status === "outdated") return n(new T(e.abi, e.required));
|
|
297
|
-
if (
|
|
298
|
-
if (await
|
|
297
|
+
if (O) {
|
|
298
|
+
if (await O().catch(() => {}), r()) return t();
|
|
299
299
|
let e = D();
|
|
300
300
|
if (e.status === "outdated") return n(new T(e.abi, e.required));
|
|
301
301
|
}
|
|
302
302
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
303
303
|
}), s = () => {
|
|
304
|
-
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(),
|
|
304
|
+
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Le);
|
|
305
305
|
}, c = new MutationObserver(() => {
|
|
306
306
|
r() && a(t);
|
|
307
307
|
}), l = () => {
|
|
@@ -312,21 +312,21 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
312
312
|
attributeFilter: [...Ee]
|
|
313
313
|
}), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
|
|
314
314
|
r() && a(t);
|
|
315
|
-
}),
|
|
316
|
-
await
|
|
315
|
+
}), Re, A = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
316
|
+
await k(), Re ??= y({}, {
|
|
317
317
|
transport: window,
|
|
318
318
|
revivableModules: be
|
|
319
319
|
});
|
|
320
|
-
let n = (await
|
|
320
|
+
let n = (await Re)[t];
|
|
321
321
|
return n(...e);
|
|
322
|
-
} }),
|
|
322
|
+
} }), ze = [
|
|
323
323
|
"origin",
|
|
324
324
|
"referer",
|
|
325
325
|
"cookie"
|
|
326
326
|
], Be = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Ve = (e) => Be(e, "cookie"), He = (e, t) => {
|
|
327
327
|
if (t === "include" && Ve(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
328
328
|
}, Ue = (e) => {
|
|
329
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !
|
|
329
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !ze.includes(e)))];
|
|
330
330
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
331
331
|
}, We = [
|
|
332
332
|
"fkn.app",
|
|
@@ -383,7 +383,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
383
383
|
if (Qe(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
384
384
|
}, et = (e) => {
|
|
385
385
|
if (!e?.headers) return;
|
|
386
|
-
let t = new Headers(e.headers), n =
|
|
386
|
+
let t = new Headers(e.headers), n = ze.map((e) => {
|
|
387
387
|
let n = t.get(e);
|
|
388
388
|
return n === null || n === "" ? void 0 : [e, n];
|
|
389
389
|
}).filter((e) => e !== void 0);
|
|
@@ -392,7 +392,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
392
392
|
let n = new Request(e, t);
|
|
393
393
|
$e(n.url);
|
|
394
394
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
395
|
-
return
|
|
395
|
+
return A.proxyFetch({
|
|
396
396
|
url: n.url,
|
|
397
397
|
method: n.method,
|
|
398
398
|
headers: [...n.headers],
|
|
@@ -411,7 +411,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
411
411
|
unsafe: !0,
|
|
412
412
|
title: "Read a site’s cookie",
|
|
413
413
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
414
|
-
}, rt = { get: (e) =>
|
|
414
|
+
}, rt = { get: (e) => A.getCookie(e) }, it = {
|
|
415
415
|
scope: "network.modifyRequestHeaders",
|
|
416
416
|
category: "network",
|
|
417
417
|
severity: 2,
|
|
@@ -419,7 +419,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
|
|
|
419
419
|
unsafe: !0,
|
|
420
420
|
title: "Rewrite request headers to other sites",
|
|
421
421
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
422
|
-
}, at = (e) =>
|
|
422
|
+
}, at = (e) => A.setRequestHeaderRule(e), ot = (e) => A.removeRequestHeaderRule({ ruleId: e }), st = class extends Error {
|
|
423
423
|
reason;
|
|
424
424
|
filename;
|
|
425
425
|
line;
|
|
@@ -762,19 +762,19 @@ var ut = class {
|
|
|
762
762
|
let n = M(e, [";"]), r = M(e, ["}"]);
|
|
763
763
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function _() {
|
|
766
766
|
let n = [];
|
|
767
767
|
if (!s()) return o("missing '{'");
|
|
768
768
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
769
769
|
if (e.charAt(0) === "@") {
|
|
770
|
-
let e =
|
|
770
|
+
let e = S();
|
|
771
771
|
if (e) {
|
|
772
772
|
n.push(e), d(n);
|
|
773
773
|
continue;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
if (g()) {
|
|
777
|
-
let e =
|
|
777
|
+
let e = C();
|
|
778
778
|
if (e) {
|
|
779
779
|
n.push(e), d(n);
|
|
780
780
|
continue;
|
|
@@ -795,18 +795,18 @@ var ut = class {
|
|
|
795
795
|
}
|
|
796
796
|
return c() ? n : o("missing '}'");
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function v() {
|
|
799
799
|
let n = [];
|
|
800
800
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
801
801
|
if (e.charAt(0) === "@") {
|
|
802
|
-
let e =
|
|
802
|
+
let e = S();
|
|
803
803
|
if (e) {
|
|
804
804
|
n.push(e), d(n);
|
|
805
805
|
continue;
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
if (g()) {
|
|
809
|
-
let e =
|
|
809
|
+
let e = C();
|
|
810
810
|
if (e) {
|
|
811
811
|
n.push(e), d(n);
|
|
812
812
|
continue;
|
|
@@ -827,7 +827,7 @@ var ut = class {
|
|
|
827
827
|
}
|
|
828
828
|
return n;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function y() {
|
|
831
831
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
832
832
|
for (; r;) {
|
|
833
833
|
let n = l(r);
|
|
@@ -841,7 +841,7 @@ var ut = class {
|
|
|
841
841
|
declarations: h() || []
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
let
|
|
844
|
+
let ee = RegExp(`^@(${[
|
|
845
845
|
"top-left-corner",
|
|
846
846
|
"top-left",
|
|
847
847
|
"top-center",
|
|
@@ -858,8 +858,8 @@ var ut = class {
|
|
|
858
858
|
"right-top",
|
|
859
859
|
"right-middle",
|
|
860
860
|
"right-bottom"
|
|
861
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
862
|
-
function
|
|
861
|
+
].join("|")})(?![\\w-])\\s*`), te = x("import"), ne = x("charset"), b = x("namespace");
|
|
862
|
+
function x(t) {
|
|
863
863
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
864
864
|
return () => {
|
|
865
865
|
let r = i(), a = n.exec(e);
|
|
@@ -868,7 +868,7 @@ var ut = class {
|
|
|
868
868
|
return s[t] = o[1].trim(), r(s);
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function S() {
|
|
872
872
|
if (e[0] === "@") return function() {
|
|
873
873
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
874
874
|
if (!n) return;
|
|
@@ -876,8 +876,8 @@ var ut = class {
|
|
|
876
876
|
if (!a) return o("@keyframes missing name");
|
|
877
877
|
let u = l(a)[1];
|
|
878
878
|
if (!s()) return o("@keyframes missing '{'");
|
|
879
|
-
let f = d(), p =
|
|
880
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
879
|
+
let f = d(), p = y();
|
|
880
|
+
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
881
881
|
return c() ? t({
|
|
882
882
|
type: j.keyframes,
|
|
883
883
|
name: u,
|
|
@@ -889,7 +889,7 @@ var ut = class {
|
|
|
889
889
|
if (!n) return;
|
|
890
890
|
let r = P(l(n)[1]);
|
|
891
891
|
if (!s()) return o("@media missing '{'");
|
|
892
|
-
let a =
|
|
892
|
+
let a = v();
|
|
893
893
|
return c() ? t({
|
|
894
894
|
type: j.media,
|
|
895
895
|
media: r,
|
|
@@ -909,18 +909,18 @@ var ut = class {
|
|
|
909
909
|
if (!n) return;
|
|
910
910
|
let r = P(l(n)[1]);
|
|
911
911
|
if (!s()) return o("@supports missing '{'");
|
|
912
|
-
let a =
|
|
912
|
+
let a = v();
|
|
913
913
|
return c() ? t({
|
|
914
914
|
type: j.supports,
|
|
915
915
|
supports: r,
|
|
916
916
|
rules: a
|
|
917
917
|
}) : o("@supports missing '}'");
|
|
918
|
-
}() ||
|
|
918
|
+
}() || te() || ne() || b() || function() {
|
|
919
919
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
920
920
|
if (!n) return;
|
|
921
921
|
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
922
922
|
if (!s()) return o("@document missing '{'");
|
|
923
|
-
let d =
|
|
923
|
+
let d = v();
|
|
924
924
|
return c() ? t({
|
|
925
925
|
type: j.document,
|
|
926
926
|
document: u,
|
|
@@ -936,7 +936,7 @@ var ut = class {
|
|
|
936
936
|
let a = [];
|
|
937
937
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
938
938
|
if (e.charAt(0) === "@") {
|
|
939
|
-
let e =
|
|
939
|
+
let e = S();
|
|
940
940
|
if (e) {
|
|
941
941
|
a.push(e), d(a);
|
|
942
942
|
continue;
|
|
@@ -955,7 +955,7 @@ var ut = class {
|
|
|
955
955
|
let t = i(), n = /^@host\s*/.exec(e);
|
|
956
956
|
if (!n) return;
|
|
957
957
|
if (l(n), !s()) return o("@host missing '{'");
|
|
958
|
-
let r =
|
|
958
|
+
let r = v();
|
|
959
959
|
return c() ? t({
|
|
960
960
|
type: j.host,
|
|
961
961
|
rules: r
|
|
@@ -975,7 +975,7 @@ var ut = class {
|
|
|
975
975
|
if (!n) return;
|
|
976
976
|
let r = P(l(n)[1]);
|
|
977
977
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
978
|
-
let a =
|
|
978
|
+
let a = v();
|
|
979
979
|
return c() ? t({
|
|
980
980
|
type: j.fontFeatureValues,
|
|
981
981
|
fontFamily: r,
|
|
@@ -986,7 +986,7 @@ var ut = class {
|
|
|
986
986
|
if (!n) return;
|
|
987
987
|
let r = P(l(n)[1]);
|
|
988
988
|
if (!s()) return o("@container missing '{'");
|
|
989
|
-
let a =
|
|
989
|
+
let a = v();
|
|
990
990
|
return c() ? t({
|
|
991
991
|
type: j.container,
|
|
992
992
|
container: r,
|
|
@@ -996,7 +996,7 @@ var ut = class {
|
|
|
996
996
|
let t = i(), n = /^@starting-style\s*/.exec(e);
|
|
997
997
|
if (!n) return;
|
|
998
998
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
999
|
-
let r =
|
|
999
|
+
let r = v();
|
|
1000
1000
|
return c() ? t({
|
|
1001
1001
|
type: j.startingStyle,
|
|
1002
1002
|
rules: r
|
|
@@ -1012,7 +1012,7 @@ var ut = class {
|
|
|
1012
1012
|
layer: r
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
|
-
let a =
|
|
1015
|
+
let a = v();
|
|
1016
1016
|
return c() ? t({
|
|
1017
1017
|
type: j.layer,
|
|
1018
1018
|
layer: r,
|
|
@@ -1047,7 +1047,7 @@ var ut = class {
|
|
|
1047
1047
|
if (!n) return;
|
|
1048
1048
|
let r = P(l(n)[1]);
|
|
1049
1049
|
if (!s()) return o("@scope missing '{'");
|
|
1050
|
-
let a =
|
|
1050
|
+
let a = v();
|
|
1051
1051
|
return c() ? t({
|
|
1052
1052
|
type: j.scope,
|
|
1053
1053
|
scope: r,
|
|
@@ -1076,7 +1076,7 @@ var ut = class {
|
|
|
1076
1076
|
declarations: a
|
|
1077
1077
|
}) : o("@position-try missing '}'");
|
|
1078
1078
|
}() || function() {
|
|
1079
|
-
let t = i(), n =
|
|
1079
|
+
let t = i(), n = ee.exec(e);
|
|
1080
1080
|
if (!n) return;
|
|
1081
1081
|
let r = l(n)[1];
|
|
1082
1082
|
if (!s()) return o(`@${r} missing '{'`);
|
|
@@ -1092,7 +1092,7 @@ var ut = class {
|
|
|
1092
1092
|
if (!n) return;
|
|
1093
1093
|
let r = l(n)[1], a = "", u = M(e, ["{", ";"]);
|
|
1094
1094
|
if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1095
|
-
let e =
|
|
1095
|
+
let e = v();
|
|
1096
1096
|
return c() ? t({
|
|
1097
1097
|
type: j.atRule,
|
|
1098
1098
|
name: r,
|
|
@@ -1108,12 +1108,12 @@ var ut = class {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}();
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function C() {
|
|
1112
1112
|
let e = i(), t = p();
|
|
1113
1113
|
return t ? (d(), e({
|
|
1114
1114
|
type: j.rule,
|
|
1115
1115
|
selectors: t,
|
|
1116
|
-
declarations:
|
|
1116
|
+
declarations: _() || []
|
|
1117
1117
|
})) : o("selector missing");
|
|
1118
1118
|
}
|
|
1119
1119
|
return F(function() {
|
|
@@ -1127,7 +1127,7 @@ var ut = class {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
break;
|
|
1129
1129
|
}
|
|
1130
|
-
if (n =
|
|
1130
|
+
if (n = S() || C(), !n) {
|
|
1131
1131
|
if (t?.silent) {
|
|
1132
1132
|
l([e.charAt(0)]), u(), d(r);
|
|
1133
1133
|
continue;
|
|
@@ -1154,54 +1154,59 @@ var ut = class {
|
|
|
1154
1154
|
enumerable: !0
|
|
1155
1155
|
});
|
|
1156
1156
|
return t || pt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1157
|
-
}, ht = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError",
|
|
1157
|
+
}, ht = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError", R = "LocatorInvalidError", gt = (e) => typeof e == "object" && e ? e.name : void 0, z = (e) => Object.assign(Error(e), { name: ht }), _t = (e, t = "", n) => Object.assign(Error(e), {
|
|
1158
1158
|
name: I,
|
|
1159
1159
|
operation: t,
|
|
1160
1160
|
backend: n
|
|
1161
|
-
}),
|
|
1161
|
+
}), vt = (e, t) => _t(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), B = (e, t) => Object.assign(Error(e), {
|
|
1162
1162
|
name: L,
|
|
1163
1163
|
operation: t
|
|
1164
|
-
}),
|
|
1165
|
-
name:
|
|
1164
|
+
}), yt = (e, t) => Object.assign(Error(e), {
|
|
1165
|
+
name: R,
|
|
1166
1166
|
operation: t
|
|
1167
|
-
}),
|
|
1167
|
+
}), V = class extends Error {
|
|
1168
|
+
name = "TimeoutError";
|
|
1169
|
+
constructor(e, t) {
|
|
1170
|
+
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1171
|
+
}
|
|
1172
|
+
}, bt = (e) => gt(e) === I, xt = (e) => gt(e) === L, H = (e) => gt(e) === R, St = (e) => xt(e) || bt(e) || H(e), U = (e) => {
|
|
1168
1173
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1169
1174
|
if (!t) throw z("the resolved element belongs to a document with no window");
|
|
1170
1175
|
return t;
|
|
1171
|
-
},
|
|
1176
|
+
}, Ct = (e, t) => {
|
|
1172
1177
|
let n = e?.[t];
|
|
1173
1178
|
return typeof n == "function" ? n : null;
|
|
1174
1179
|
}, W = (e, t) => {
|
|
1175
1180
|
if (typeof e != "object" || !e) return null;
|
|
1176
1181
|
let n = (() => {
|
|
1177
1182
|
try {
|
|
1178
|
-
return
|
|
1183
|
+
return Ct(U(e), t);
|
|
1179
1184
|
} catch {
|
|
1180
1185
|
return null;
|
|
1181
1186
|
}
|
|
1182
1187
|
})();
|
|
1183
1188
|
if (n && e instanceof n) return n;
|
|
1184
|
-
let r =
|
|
1189
|
+
let r = Ct(globalThis, t);
|
|
1185
1190
|
return r && e instanceof r ? r : null;
|
|
1186
1191
|
}, G = (e, t) => W(e, t) !== null, K = (e) => {
|
|
1187
1192
|
if (e.length === 0) throw z("No elements found");
|
|
1188
1193
|
if (e.length > 1) throw z(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1189
1194
|
return e[0];
|
|
1190
|
-
},
|
|
1195
|
+
}, wt = (e, t) => {
|
|
1191
1196
|
if (!G(e, t)) throw z(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1192
1197
|
return e;
|
|
1193
|
-
},
|
|
1194
|
-
|
|
1195
|
-
},
|
|
1198
|
+
}, Tt = (e) => e.tagName.toLowerCase(), Et = /* @__PURE__ */ new Set(), Dt = (e) => {
|
|
1199
|
+
Et.add(e);
|
|
1200
|
+
}, Ot = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, kt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), At = (e) => !Ot.test(kt(e.value)), jt = /* @__PURE__ */ new Set([
|
|
1196
1201
|
j.import,
|
|
1197
1202
|
j.fontFace,
|
|
1198
1203
|
j.namespace,
|
|
1199
1204
|
j.charset,
|
|
1200
1205
|
j.document,
|
|
1201
1206
|
j.comment
|
|
1202
|
-
]),
|
|
1203
|
-
if (
|
|
1204
|
-
if (e.type === j.declaration) return
|
|
1207
|
+
]), Mt = (e) => {
|
|
1208
|
+
if (jt.has(e.type)) return null;
|
|
1209
|
+
if (e.type === j.declaration) return At(e) ? e : null;
|
|
1205
1210
|
let t = e, n = { ...t };
|
|
1206
1211
|
for (let e of [
|
|
1207
1212
|
"declarations",
|
|
@@ -1209,18 +1214,18 @@ var ut = class {
|
|
|
1209
1214
|
"keyframes"
|
|
1210
1215
|
]) {
|
|
1211
1216
|
let r = t[e];
|
|
1212
|
-
Array.isArray(r) && (n[e] =
|
|
1217
|
+
Array.isArray(r) && (n[e] = Nt(r));
|
|
1213
1218
|
}
|
|
1214
1219
|
return n;
|
|
1215
|
-
},
|
|
1220
|
+
}, Nt = (e) => e.map((e) => Mt(e)).filter((e) => e !== null), Pt = (e) => {
|
|
1216
1221
|
let t;
|
|
1217
1222
|
try {
|
|
1218
1223
|
t = dt(e, { silent: !0 });
|
|
1219
1224
|
} catch {
|
|
1220
1225
|
return "";
|
|
1221
1226
|
}
|
|
1222
|
-
return t.stylesheet.rules =
|
|
1223
|
-
},
|
|
1227
|
+
return t.stylesheet.rules = Nt(t.stylesheet.rules), ft(t);
|
|
1228
|
+
}, Ft = (e, t) => {
|
|
1224
1229
|
let n = () => {
|
|
1225
1230
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1226
1231
|
};
|
|
@@ -1237,16 +1242,16 @@ var ut = class {
|
|
|
1237
1242
|
});
|
|
1238
1243
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1239
1244
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1240
|
-
},
|
|
1245
|
+
}, It = { resolve: (e, t) => {
|
|
1241
1246
|
let n = e.document.createElement("style");
|
|
1242
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1247
|
+
n.textContent = t.noSanitize ? t.content : Pt(t.content);
|
|
1243
1248
|
try {
|
|
1244
|
-
|
|
1249
|
+
Ft(e.document, n);
|
|
1245
1250
|
} catch (e) {
|
|
1246
1251
|
console.error(e);
|
|
1247
1252
|
}
|
|
1248
|
-
|
|
1249
|
-
} },
|
|
1253
|
+
Dt(n);
|
|
1254
|
+
} }, Lt = (e) => {
|
|
1250
1255
|
let t = [];
|
|
1251
1256
|
return e.forEach((e, n) => {
|
|
1252
1257
|
t.push([n, e]);
|
|
@@ -1255,12 +1260,12 @@ var ut = class {
|
|
|
1255
1260
|
kind: "frame",
|
|
1256
1261
|
ensureArgs: (e) => [void 0, e],
|
|
1257
1262
|
resolve: async (e, t, n = {}) => {
|
|
1258
|
-
if (typeof t != "string") throw
|
|
1263
|
+
if (typeof t != "string") throw yt("fetch: url must be a string", "fetch");
|
|
1259
1264
|
let r = U(e.document), i;
|
|
1260
1265
|
try {
|
|
1261
1266
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1262
1267
|
} catch {
|
|
1263
|
-
throw
|
|
1268
|
+
throw yt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1264
1269
|
}
|
|
1265
1270
|
let a = await r.fetch(i, {
|
|
1266
1271
|
method: n.method ?? "GET",
|
|
@@ -1276,31 +1281,31 @@ var ut = class {
|
|
|
1276
1281
|
url: a.url,
|
|
1277
1282
|
redirected: a.redirected,
|
|
1278
1283
|
type: a.type,
|
|
1279
|
-
headers:
|
|
1284
|
+
headers: Lt(a.headers),
|
|
1280
1285
|
body: await a.arrayBuffer()
|
|
1281
1286
|
};
|
|
1282
1287
|
}
|
|
1283
1288
|
}, J = /* @__PURE__ */ mt({
|
|
1284
|
-
click: () =>
|
|
1285
|
-
count: () =>
|
|
1286
|
-
exists: () =>
|
|
1287
|
-
fill: () =>
|
|
1288
|
-
getAttribute: () =>
|
|
1289
|
-
hover: () =>
|
|
1290
|
-
isVisible: () =>
|
|
1291
|
-
textContent: () =>
|
|
1292
|
-
}),
|
|
1289
|
+
click: () => zt,
|
|
1290
|
+
count: () => qt,
|
|
1291
|
+
exists: () => Jt,
|
|
1292
|
+
fill: () => Ut,
|
|
1293
|
+
getAttribute: () => Gt,
|
|
1294
|
+
hover: () => Bt,
|
|
1295
|
+
isVisible: () => Kt,
|
|
1296
|
+
textContent: () => Wt
|
|
1297
|
+
}), Rt = (e, t) => {
|
|
1293
1298
|
let n = e.getBoundingClientRect();
|
|
1294
1299
|
return {
|
|
1295
1300
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1296
1301
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1297
1302
|
};
|
|
1298
|
-
},
|
|
1303
|
+
}, zt = { resolve: (e, t = {}) => {
|
|
1299
1304
|
let n = K(e.elements), r = U(n), i = {
|
|
1300
1305
|
bubbles: !0,
|
|
1301
1306
|
cancelable: !0,
|
|
1302
1307
|
composed: !0,
|
|
1303
|
-
...
|
|
1308
|
+
...Rt(n, t.position),
|
|
1304
1309
|
button: 0
|
|
1305
1310
|
}, a = {
|
|
1306
1311
|
...i,
|
|
@@ -1324,12 +1329,12 @@ var ut = class {
|
|
|
1324
1329
|
...i,
|
|
1325
1330
|
buttons: 0
|
|
1326
1331
|
}));
|
|
1327
|
-
} },
|
|
1332
|
+
} }, Bt = { resolve: (e, t = {}) => {
|
|
1328
1333
|
let n = K(e.elements), r = U(n), i = {
|
|
1329
1334
|
bubbles: !0,
|
|
1330
1335
|
cancelable: !0,
|
|
1331
1336
|
composed: !0,
|
|
1332
|
-
...
|
|
1337
|
+
...Rt(n, t.position)
|
|
1333
1338
|
}, a = {
|
|
1334
1339
|
...i,
|
|
1335
1340
|
pointerType: "mouse",
|
|
@@ -1343,11 +1348,11 @@ var ut = class {
|
|
|
1343
1348
|
...i,
|
|
1344
1349
|
bubbles: !1
|
|
1345
1350
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1346
|
-
} },
|
|
1351
|
+
} }, Vt = (e, t) => {
|
|
1347
1352
|
e._valueTracker?.setValue("");
|
|
1348
1353
|
let n = (W(e, "HTMLTextAreaElement") ?? W(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1349
1354
|
r ? r.call(e, t) : e.value = t;
|
|
1350
|
-
},
|
|
1355
|
+
}, Ht = (e, t) => {
|
|
1351
1356
|
if (e.type !== "range") return null;
|
|
1352
1357
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1353
1358
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1384,26 +1389,26 @@ var ut = class {
|
|
|
1384
1389
|
buttons: 0
|
|
1385
1390
|
}
|
|
1386
1391
|
};
|
|
1387
|
-
},
|
|
1392
|
+
}, Ut = { resolve: (e, t, n = {}) => {
|
|
1388
1393
|
let r = K(e.elements), i = U(r), a = G(r, "HTMLInputElement");
|
|
1389
1394
|
if (a || G(r, "HTMLTextAreaElement")) {
|
|
1390
|
-
let e = r, n = a ?
|
|
1391
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1395
|
+
let e = r, n = a ? Ht(e, t) : null;
|
|
1396
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Vt(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 }));
|
|
1392
1397
|
return;
|
|
1393
1398
|
}
|
|
1394
1399
|
if (G(r, "HTMLElement") && r.isContentEditable) {
|
|
1395
1400
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1396
1401
|
return;
|
|
1397
1402
|
}
|
|
1398
|
-
throw Error(`fill: element <${
|
|
1399
|
-
} },
|
|
1403
|
+
throw Error(`fill: element <${Tt(r)}> is not fillable`);
|
|
1404
|
+
} }, Wt = { resolve: (e, t = {}) => K(e.elements).textContent }, Gt = { resolve: (e, t, n = {}) => K(e.elements).getAttribute(t) }, Kt = { resolve: (e, t = {}) => {
|
|
1400
1405
|
let n = K(e.elements);
|
|
1401
1406
|
if (!G(n, "HTMLElement")) return !0;
|
|
1402
1407
|
let r = U(n).getComputedStyle(n);
|
|
1403
1408
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1404
1409
|
let i = n.getBoundingClientRect();
|
|
1405
1410
|
return i.width > 0 && i.height > 0;
|
|
1406
|
-
} },
|
|
1411
|
+
} }, qt = { resolve: (e, t = {}) => e.elements.length }, Jt = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), X = (e) => e.replaceAll("\"", "\\\""), Yt = {
|
|
1407
1412
|
to: "element",
|
|
1408
1413
|
css: !0,
|
|
1409
1414
|
resolve: (e, t) => Y(e, t),
|
|
@@ -1411,7 +1416,7 @@ var ut = class {
|
|
|
1411
1416
|
fragment: typeof e == "string" ? e : "?",
|
|
1412
1417
|
separator: "descend"
|
|
1413
1418
|
})
|
|
1414
|
-
},
|
|
1419
|
+
}, Xt = {
|
|
1415
1420
|
to: "frame",
|
|
1416
1421
|
css: !0,
|
|
1417
1422
|
barrier: "down",
|
|
@@ -1420,11 +1425,11 @@ var ut = class {
|
|
|
1420
1425
|
fragment: typeof e == "string" ? e : "?",
|
|
1421
1426
|
separator: "down"
|
|
1422
1427
|
})
|
|
1423
|
-
},
|
|
1428
|
+
}, Zt = {
|
|
1424
1429
|
element: {
|
|
1425
1430
|
selectors: {
|
|
1426
|
-
locator:
|
|
1427
|
-
frameLocator:
|
|
1431
|
+
locator: Yt,
|
|
1432
|
+
frameLocator: Xt,
|
|
1428
1433
|
getByRole: {
|
|
1429
1434
|
to: "element",
|
|
1430
1435
|
resolve: (e, t) => Y(e, `[role="${CSS.escape(t)}"]`),
|
|
@@ -1455,20 +1460,20 @@ var ut = class {
|
|
|
1455
1460
|
}
|
|
1456
1461
|
},
|
|
1457
1462
|
operations: {
|
|
1458
|
-
click:
|
|
1459
|
-
fill:
|
|
1460
|
-
hover:
|
|
1461
|
-
textContent:
|
|
1462
|
-
getAttribute:
|
|
1463
|
-
isVisible:
|
|
1464
|
-
count:
|
|
1465
|
-
exists:
|
|
1463
|
+
click: zt,
|
|
1464
|
+
fill: Ut,
|
|
1465
|
+
hover: Bt,
|
|
1466
|
+
textContent: Wt,
|
|
1467
|
+
getAttribute: Gt,
|
|
1468
|
+
isVisible: Kt,
|
|
1469
|
+
count: qt,
|
|
1470
|
+
exists: Jt
|
|
1466
1471
|
}
|
|
1467
1472
|
},
|
|
1468
1473
|
frame: {
|
|
1469
1474
|
selectors: {
|
|
1470
|
-
locator:
|
|
1471
|
-
frameLocator:
|
|
1475
|
+
locator: Yt,
|
|
1476
|
+
frameLocator: Xt,
|
|
1472
1477
|
owner: {
|
|
1473
1478
|
to: "frame",
|
|
1474
1479
|
barrier: "up",
|
|
@@ -1482,11 +1487,11 @@ var ut = class {
|
|
|
1482
1487
|
}
|
|
1483
1488
|
},
|
|
1484
1489
|
operations: {
|
|
1485
|
-
addStyleTag:
|
|
1490
|
+
addStyleTag: It,
|
|
1486
1491
|
fetch: q
|
|
1487
1492
|
}
|
|
1488
1493
|
}
|
|
1489
|
-
},
|
|
1494
|
+
}, Qt = (e, t = Zt) => ({
|
|
1490
1495
|
element: {
|
|
1491
1496
|
selectors: {
|
|
1492
1497
|
...t.element.selectors,
|
|
@@ -1507,29 +1512,31 @@ var ut = class {
|
|
|
1507
1512
|
...e.frame?.operations
|
|
1508
1513
|
}
|
|
1509
1514
|
}
|
|
1510
|
-
}),
|
|
1515
|
+
}), $t = 3e4, en = 50, tn = (e) => {
|
|
1511
1516
|
let t = e[e.length - 1];
|
|
1512
1517
|
return typeof t == "object" && t ? t : void 0;
|
|
1513
|
-
},
|
|
1514
|
-
let t =
|
|
1515
|
-
return typeof t == "number" ? t :
|
|
1516
|
-
},
|
|
1518
|
+
}, nn = (e) => {
|
|
1519
|
+
let t = tn(e)?.timeout;
|
|
1520
|
+
return typeof t == "number" ? t : $t;
|
|
1521
|
+
}, rn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), an = async (e) => {
|
|
1517
1522
|
let t = {
|
|
1518
1523
|
parts: e.parts,
|
|
1519
1524
|
operation: e.operation,
|
|
1520
1525
|
args: e.args,
|
|
1521
1526
|
phase: "ensure"
|
|
1522
1527
|
};
|
|
1523
|
-
await e.gate?.(t,
|
|
1524
|
-
},
|
|
1528
|
+
await e.gate?.(t, rn(e));
|
|
1529
|
+
}, on = (e, t) => {
|
|
1530
|
+
if (t !== void 0 && typeof t == "number" && !(Number.isFinite(t) && t > 0)) throw TypeError(`${e}: timeout must be a positive number of milliseconds, not ${t}; every call ends at its deadline, so 0 does not turn it off`);
|
|
1531
|
+
}, sn = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), cn = async (e) => {
|
|
1525
1532
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1526
|
-
n && await n({
|
|
1533
|
+
on(i, tn(a)?.timeout), n && await n({
|
|
1527
1534
|
parts: r,
|
|
1528
1535
|
operation: i,
|
|
1529
1536
|
args: a,
|
|
1530
1537
|
phase: "execute"
|
|
1531
|
-
},
|
|
1532
|
-
let o =
|
|
1538
|
+
}, rn(e));
|
|
1539
|
+
let o = nn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1533
1540
|
l.catch(() => {});
|
|
1534
1541
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1535
1542
|
try {
|
|
@@ -1537,46 +1544,47 @@ var ut = class {
|
|
|
1537
1544
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1538
1545
|
} catch (e) {
|
|
1539
1546
|
if (e === c) break;
|
|
1540
|
-
if (
|
|
1547
|
+
if (St(e)) throw e;
|
|
1541
1548
|
f = e;
|
|
1542
1549
|
let t = s - Date.now();
|
|
1543
1550
|
if (t <= 0) break;
|
|
1544
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1551
|
+
await new Promise((e) => setTimeout(e, Math.min(en, t)));
|
|
1545
1552
|
}
|
|
1546
1553
|
} finally {
|
|
1547
1554
|
clearTimeout(d);
|
|
1548
1555
|
}
|
|
1549
|
-
throw f;
|
|
1550
|
-
},
|
|
1551
|
-
let
|
|
1552
|
-
for (let [
|
|
1553
|
-
kind:
|
|
1554
|
-
name:
|
|
1555
|
-
args:
|
|
1556
|
+
throw f === c ? new V(c.message) : new V(sn(f), { cause: f });
|
|
1557
|
+
}, ln = (e, t, n, r, i) => {
|
|
1558
|
+
let a = {};
|
|
1559
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => ln(e, t, n, s.to, [...i, {
|
|
1560
|
+
kind: r,
|
|
1561
|
+
name: o,
|
|
1562
|
+
args: a
|
|
1556
1563
|
}]);
|
|
1557
|
-
for (let
|
|
1564
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => cn({
|
|
1558
1565
|
...e,
|
|
1559
|
-
parts:
|
|
1560
|
-
operation:
|
|
1561
|
-
args: t
|
|
1566
|
+
parts: i,
|
|
1567
|
+
operation: n,
|
|
1568
|
+
args: o.send ? o.send(...t) : t
|
|
1562
1569
|
});
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1570
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => ln(e, t, n, s, c(i, ...r));
|
|
1571
|
+
return a.ensure = (n, a = {}) => {
|
|
1572
|
+
let o = t[r].operations[n]?.ensureArgs;
|
|
1573
|
+
return an({
|
|
1566
1574
|
...e,
|
|
1567
|
-
parts:
|
|
1568
|
-
operation:
|
|
1575
|
+
parts: i,
|
|
1576
|
+
operation: n,
|
|
1569
1577
|
args: o?.(a) ?? [a]
|
|
1570
1578
|
});
|
|
1571
|
-
},
|
|
1572
|
-
},
|
|
1579
|
+
}, a;
|
|
1580
|
+
}, un = (e) => ln(e, e.modules ?? Zt, e.rewrites ?? {}, "frame", []), dn = () => {
|
|
1573
1581
|
let e = D();
|
|
1574
1582
|
return e.status === "ok" && e.abi >= 2;
|
|
1575
|
-
},
|
|
1576
|
-
await
|
|
1583
|
+
}, fn = async () => {
|
|
1584
|
+
await k();
|
|
1577
1585
|
let e = D();
|
|
1578
1586
|
if (e.status === "ok" && e.abi < 2) throw new T(e.abi, 2);
|
|
1579
|
-
},
|
|
1587
|
+
}, pn = (e) => `Read the text, links and details ${e} shows.`, mn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, hn = [
|
|
1580
1588
|
{
|
|
1581
1589
|
id: "interaction",
|
|
1582
1590
|
heading: "Interaction",
|
|
@@ -1591,9 +1599,9 @@ var ut = class {
|
|
|
1591
1599
|
heading: "Site data",
|
|
1592
1600
|
summary: "Can read the website's data",
|
|
1593
1601
|
title: (e) => `Read data from ${e}`,
|
|
1594
|
-
description:
|
|
1602
|
+
description: pn,
|
|
1595
1603
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1596
|
-
cloudDescription:
|
|
1604
|
+
cloudDescription: pn
|
|
1597
1605
|
},
|
|
1598
1606
|
{
|
|
1599
1607
|
id: "network",
|
|
@@ -1609,24 +1617,38 @@ var ut = class {
|
|
|
1609
1617
|
heading: "Evaluation",
|
|
1610
1618
|
summary: "Can execute arbitrary code on the website",
|
|
1611
1619
|
title: (e) => `Run code on ${e}`,
|
|
1612
|
-
description:
|
|
1620
|
+
description: mn,
|
|
1613
1621
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1614
|
-
cloudDescription:
|
|
1615
|
-
}
|
|
1616
|
-
],
|
|
1622
|
+
cloudDescription: mn
|
|
1623
|
+
}
|
|
1624
|
+
], gn = (e) => (t) => {
|
|
1625
|
+
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1626
|
+
if (t.position !== void 0) throw TypeError(`${e}: position is Playwright's offset in pixels, which no backend serves yet; pass relativePosition, a 0..1 fraction of the box`);
|
|
1627
|
+
let { relativePosition: n, ...r } = t;
|
|
1628
|
+
return [n === void 0 ? r : {
|
|
1629
|
+
...r,
|
|
1630
|
+
position: n
|
|
1631
|
+
}];
|
|
1632
|
+
}, _n = Qt({
|
|
1617
1633
|
element: { operations: {
|
|
1618
|
-
click: {
|
|
1619
|
-
|
|
1634
|
+
click: {
|
|
1635
|
+
resolve: (e, t = {}) => J.click.resolve(e, t),
|
|
1636
|
+
send: gn("click")
|
|
1637
|
+
},
|
|
1638
|
+
hover: {
|
|
1639
|
+
resolve: (e, t = {}) => J.hover.resolve(e, t),
|
|
1640
|
+
send: gn("hover")
|
|
1641
|
+
},
|
|
1620
1642
|
fill: { resolve: (e, t, n = {}) => J.fill.resolve(e, t, n) },
|
|
1621
1643
|
textContent: { resolve: (e, t = {}) => J.textContent.resolve(e) },
|
|
1622
1644
|
getAttribute: { resolve: (e, t, n = {}) => J.getAttribute.resolve(e, t) },
|
|
1623
1645
|
isVisible: { resolve: (e, t = {}) => J.isVisible.resolve(e) },
|
|
1624
1646
|
count: { resolve: (e, t = {}) => J.count.resolve(e) },
|
|
1625
1647
|
exists: { resolve: (e, t = {}) => J.exists.resolve(e) },
|
|
1626
|
-
videoElement: { resolve: (e, t = {}) => w(
|
|
1648
|
+
videoElement: { resolve: (e, t = {}) => w(wt(K(e.elements), "HTMLVideoElement")) }
|
|
1627
1649
|
} },
|
|
1628
1650
|
frame: { operations: {
|
|
1629
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1651
|
+
addStyleTag: { resolve: (e, t) => It.resolve(e, t) },
|
|
1630
1652
|
fetch: {
|
|
1631
1653
|
resolve: (e, t, n = {}) => q.resolve(e, t, n),
|
|
1632
1654
|
kind: q.kind,
|
|
@@ -1634,12 +1656,56 @@ var ut = class {
|
|
|
1634
1656
|
},
|
|
1635
1657
|
evaluate: {
|
|
1636
1658
|
kind: "frame",
|
|
1659
|
+
typed: !1,
|
|
1637
1660
|
resolve: (e, t, n) => {
|
|
1638
|
-
throw
|
|
1661
|
+
throw vt("evaluate", "this realm");
|
|
1639
1662
|
}
|
|
1640
1663
|
}
|
|
1641
1664
|
} }
|
|
1642
|
-
}),
|
|
1665
|
+
}), vn = (e) => e[e.length - 1], yn = {
|
|
1666
|
+
element: {
|
|
1667
|
+
last: {
|
|
1668
|
+
to: "element",
|
|
1669
|
+
rewrite: (e) => [...e, {
|
|
1670
|
+
kind: "element",
|
|
1671
|
+
name: "nth",
|
|
1672
|
+
args: [-1]
|
|
1673
|
+
}]
|
|
1674
|
+
},
|
|
1675
|
+
contentFrame: {
|
|
1676
|
+
to: "frame",
|
|
1677
|
+
rewrite: (e) => {
|
|
1678
|
+
let t = vn(e);
|
|
1679
|
+
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1680
|
+
return [...e.slice(0, -1), {
|
|
1681
|
+
...t,
|
|
1682
|
+
name: "frameLocator"
|
|
1683
|
+
}];
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
frame: {
|
|
1688
|
+
owner: {
|
|
1689
|
+
to: "element",
|
|
1690
|
+
rewrite: (e) => {
|
|
1691
|
+
let t = vn(e);
|
|
1692
|
+
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1693
|
+
return [...e.slice(0, -1), {
|
|
1694
|
+
...t,
|
|
1695
|
+
name: "locator"
|
|
1696
|
+
}];
|
|
1697
|
+
}
|
|
1698
|
+
},
|
|
1699
|
+
getByTestId: {
|
|
1700
|
+
to: "element",
|
|
1701
|
+
rewrite: (e, t) => [...e, {
|
|
1702
|
+
kind: "element",
|
|
1703
|
+
name: "getByTestId",
|
|
1704
|
+
args: [t]
|
|
1705
|
+
}]
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}, bn = (e) => {
|
|
1643
1709
|
if (!e || e === "about:blank") return !1;
|
|
1644
1710
|
let t;
|
|
1645
1711
|
try {
|
|
@@ -1649,38 +1715,44 @@ var ut = class {
|
|
|
1649
1715
|
}
|
|
1650
1716
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Ke(t.hostname);
|
|
1651
1717
|
}, Z = (e) => {
|
|
1652
|
-
if (
|
|
1653
|
-
},
|
|
1718
|
+
if (bn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1719
|
+
}, xn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1654
1720
|
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");
|
|
1655
|
-
},
|
|
1721
|
+
}, Sn = {
|
|
1656
1722
|
scope: "embed.iframe",
|
|
1657
1723
|
category: "interaction",
|
|
1658
1724
|
severity: 0,
|
|
1659
1725
|
title: "Load another website inside this app",
|
|
1660
1726
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1661
|
-
},
|
|
1727
|
+
}, Cn = {
|
|
1662
1728
|
scope: "embed.open",
|
|
1663
1729
|
category: "interaction",
|
|
1664
1730
|
severity: 0,
|
|
1665
1731
|
title: "Open a website inside this app",
|
|
1666
1732
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1667
|
-
},
|
|
1733
|
+
}, wn = ["load", "commit"], Tn = (e) => {
|
|
1734
|
+
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1735
|
+
let { waitUntil: t, timeout: n } = e;
|
|
1736
|
+
if (t !== void 0 && !wn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1737
|
+
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1738
|
+
on("frame.goto", n);
|
|
1739
|
+
}, En = class extends Error {
|
|
1668
1740
|
name = "FrameWindowBlockedError";
|
|
1669
1741
|
constructor() {
|
|
1670
1742
|
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1671
1743
|
}
|
|
1672
|
-
},
|
|
1744
|
+
}, Dn = /* @__PURE__ */ new Set([
|
|
1673
1745
|
"jar-unreachable",
|
|
1674
1746
|
"bad-url",
|
|
1675
1747
|
"opaque-opener"
|
|
1676
|
-
]),
|
|
1748
|
+
]), On = class extends Error {
|
|
1677
1749
|
name = "FrameWindowRefusedError";
|
|
1678
1750
|
reason;
|
|
1679
1751
|
constructor(e) {
|
|
1680
|
-
let t =
|
|
1752
|
+
let t = Dn.has(e) ? e : "unknown";
|
|
1681
1753
|
super(t === "opaque-opener" ? "attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened" : `attachFrame: the window refused to attach (${t}), and loaded nothing`), this.reason = t;
|
|
1682
1754
|
}
|
|
1683
|
-
},
|
|
1755
|
+
}, kn = ["message", "document"], An = (e) => {
|
|
1684
1756
|
if (e === "*") return "*";
|
|
1685
1757
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1686
1758
|
if (typeof e != "string") throw t();
|
|
@@ -1692,92 +1764,145 @@ var ut = class {
|
|
|
1692
1764
|
}
|
|
1693
1765
|
if (n === "null") throw t();
|
|
1694
1766
|
return n;
|
|
1695
|
-
},
|
|
1767
|
+
}, jn = (e, t) => {
|
|
1696
1768
|
let n = typeof e == "object" && !!e;
|
|
1697
1769
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1698
1770
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1699
1771
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1700
1772
|
return {
|
|
1701
|
-
targetOrigin:
|
|
1773
|
+
targetOrigin: An(r),
|
|
1702
1774
|
transfer: i === void 0 ? [] : [...i]
|
|
1703
1775
|
};
|
|
1704
|
-
},
|
|
1776
|
+
}, Mn = [
|
|
1777
|
+
"url",
|
|
1778
|
+
"path",
|
|
1779
|
+
"type"
|
|
1780
|
+
], Nn = ["content", "sourceUrl"], Pn = /[\n\r\u2028\u2029]/, Fn = (e) => {
|
|
1781
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
|
|
1782
|
+
let t = Object.keys(e), n = t.find((e) => Mn.includes(e));
|
|
1783
|
+
if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
|
|
1784
|
+
let r = t.find((e) => !Nn.includes(e));
|
|
1785
|
+
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1786
|
+
let { content: i, sourceUrl: a } = e;
|
|
1787
|
+
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1788
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || Pn.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1789
|
+
return a === void 0 ? { content: i } : {
|
|
1790
|
+
content: i,
|
|
1791
|
+
sourceUrl: a
|
|
1792
|
+
};
|
|
1793
|
+
}, In = [
|
|
1794
|
+
"name",
|
|
1795
|
+
"domain",
|
|
1796
|
+
"path"
|
|
1797
|
+
], Ln = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Rn = (e) => {
|
|
1798
|
+
if (e === void 0) return {};
|
|
1799
|
+
if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
|
|
1800
|
+
let t = e, n = Object.keys(t).find((e) => !In.includes(e));
|
|
1801
|
+
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1802
|
+
let r = In.flatMap((e) => {
|
|
1803
|
+
let n = t[e];
|
|
1804
|
+
return n === void 0 ? [] : [{
|
|
1805
|
+
key: e,
|
|
1806
|
+
value: n
|
|
1807
|
+
}];
|
|
1808
|
+
}), i = r.find(({ value: e }) => Ln(e));
|
|
1809
|
+
if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
|
|
1810
|
+
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1811
|
+
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
1812
|
+
let o = r.find(({ value: e }) => e === "");
|
|
1813
|
+
if (o !== void 0) throw TypeError(`frame.clearCookies: ${o.key} must not be empty; leave it out to match every ${o.key}`);
|
|
1814
|
+
let s = {};
|
|
1815
|
+
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1816
|
+
return s;
|
|
1817
|
+
}, zn = (e) => {
|
|
1705
1818
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1706
|
-
},
|
|
1707
|
-
let t =
|
|
1819
|
+
}, Bn = (e) => {
|
|
1820
|
+
let { owner: t, ...n } = un({
|
|
1708
1821
|
executor: e.executor,
|
|
1709
|
-
modules:
|
|
1822
|
+
modules: _n,
|
|
1823
|
+
rewrites: yn,
|
|
1710
1824
|
gate: e.gate
|
|
1711
|
-
}),
|
|
1712
|
-
let n = e.
|
|
1713
|
-
if (!n) throw Error("frame.
|
|
1825
|
+
}), r = async (t, n = {}) => (Z(t), Tn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1826
|
+
let n = e.requestPermissions;
|
|
1827
|
+
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
1714
1828
|
return n(t);
|
|
1715
|
-
},
|
|
1829
|
+
}, o = async (t, n) => {
|
|
1716
1830
|
let r = e.evaluate;
|
|
1717
1831
|
if (!r) throw Error("frame.evaluate: this backend cannot run code in the attached frame");
|
|
1718
1832
|
let i = typeof t == "function" ? t.toString() : t;
|
|
1719
1833
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1720
|
-
return r(i, n);
|
|
1721
|
-
},
|
|
1834
|
+
return r(i, structuredClone(n));
|
|
1835
|
+
}, s = async (t) => {
|
|
1836
|
+
let { content: n, ...r } = Fn(t), i = e.addScriptTag;
|
|
1837
|
+
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1838
|
+
await i(n, r);
|
|
1839
|
+
}, c = async (t) => {
|
|
1840
|
+
let n = Rn(t), r = e.clearCookies;
|
|
1841
|
+
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1842
|
+
await r(n);
|
|
1843
|
+
}, l = ((t, n, r) => {
|
|
1722
1844
|
try {
|
|
1723
1845
|
let i = e.postMessage;
|
|
1724
1846
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1725
|
-
let a =
|
|
1847
|
+
let a = jn(n, r);
|
|
1726
1848
|
return i(t, a.targetOrigin, a.transfer);
|
|
1727
1849
|
} catch (e) {
|
|
1728
1850
|
return Promise.reject(e);
|
|
1729
1851
|
}
|
|
1730
|
-
}),
|
|
1852
|
+
}), u = {
|
|
1731
1853
|
message: /* @__PURE__ */ new Set(),
|
|
1732
1854
|
document: /* @__PURE__ */ new Set()
|
|
1733
|
-
},
|
|
1734
|
-
if (!
|
|
1735
|
-
return
|
|
1736
|
-
},
|
|
1855
|
+
}, d = null, f = (e, t) => {
|
|
1856
|
+
if (!kn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${kn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1857
|
+
return u[e];
|
|
1858
|
+
}, p = (e) => {
|
|
1737
1859
|
let t = e.type === "message" ? Object.freeze({
|
|
1738
1860
|
type: "message",
|
|
1739
1861
|
data: e.data,
|
|
1740
1862
|
origin: e.origin,
|
|
1741
1863
|
ports: Object.freeze([...e.ports]),
|
|
1742
|
-
source:
|
|
1864
|
+
source: _
|
|
1743
1865
|
}) : Object.freeze({
|
|
1744
1866
|
type: "document",
|
|
1745
1867
|
origin: e.origin
|
|
1746
1868
|
});
|
|
1747
|
-
for (let n of [...
|
|
1869
|
+
for (let n of [...u[e.type]]) try {
|
|
1748
1870
|
n(t);
|
|
1749
1871
|
} catch (e) {
|
|
1750
|
-
|
|
1872
|
+
zn(e);
|
|
1751
1873
|
}
|
|
1752
|
-
},
|
|
1753
|
-
if (
|
|
1754
|
-
let e =
|
|
1755
|
-
|
|
1874
|
+
}, m = (e, t) => {
|
|
1875
|
+
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
1876
|
+
let e = d;
|
|
1877
|
+
d = null, e();
|
|
1756
1878
|
}
|
|
1757
|
-
},
|
|
1758
|
-
let i =
|
|
1759
|
-
if (typeof n != "function") throw TypeError("frame.
|
|
1879
|
+
}, h = (t, n, r = {}) => {
|
|
1880
|
+
let i = f(t, "on");
|
|
1881
|
+
if (typeof n != "function") throw TypeError("frame.on: the listener must be a function");
|
|
1760
1882
|
let { signal: a } = r;
|
|
1761
1883
|
if (!(a?.aborted || i.has(n))) {
|
|
1762
|
-
if (
|
|
1884
|
+
if (d === null) {
|
|
1763
1885
|
let t = e.listen;
|
|
1764
|
-
if (!t) throw Error("frame.
|
|
1765
|
-
|
|
1886
|
+
if (!t) throw Error("frame.on: this backend cannot relay the page's messages");
|
|
1887
|
+
d = t(p);
|
|
1766
1888
|
}
|
|
1767
|
-
i.add(n), a?.addEventListener("abort", () =>
|
|
1889
|
+
i.add(n), a?.addEventListener("abort", () => m(t, n), { once: !0 });
|
|
1768
1890
|
}
|
|
1769
|
-
},
|
|
1770
|
-
...
|
|
1771
|
-
goto:
|
|
1772
|
-
url:
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1891
|
+
}, g = () => e.backend, _ = {
|
|
1892
|
+
...n,
|
|
1893
|
+
goto: r,
|
|
1894
|
+
url: i,
|
|
1895
|
+
backend: g,
|
|
1896
|
+
requestPermissions: a,
|
|
1897
|
+
evaluate: o,
|
|
1898
|
+
addScriptTag: s,
|
|
1899
|
+
clearCookies: c,
|
|
1900
|
+
postMessage: l,
|
|
1901
|
+
on: h,
|
|
1902
|
+
off: m
|
|
1778
1903
|
};
|
|
1779
|
-
return
|
|
1780
|
-
},
|
|
1904
|
+
return _;
|
|
1905
|
+
}, Vn = [
|
|
1781
1906
|
h,
|
|
1782
1907
|
t,
|
|
1783
1908
|
g,
|
|
@@ -1791,8 +1916,8 @@ var ut = class {
|
|
|
1791
1916
|
l,
|
|
1792
1917
|
f,
|
|
1793
1918
|
u,
|
|
1794
|
-
|
|
1795
|
-
|
|
1919
|
+
Sn,
|
|
1920
|
+
Cn,
|
|
1796
1921
|
m,
|
|
1797
1922
|
r,
|
|
1798
1923
|
qe,
|
|
@@ -1800,34 +1925,34 @@ var ut = class {
|
|
|
1800
1925
|
Ye,
|
|
1801
1926
|
nt,
|
|
1802
1927
|
it
|
|
1803
|
-
],
|
|
1928
|
+
], Hn = hn.map((e) => e.id), Un = {
|
|
1804
1929
|
interaction: "act.click",
|
|
1805
1930
|
storage: "read.text",
|
|
1806
1931
|
network: "network.fetchCredentialed",
|
|
1807
1932
|
evaluation: "media.appearU"
|
|
1808
|
-
},
|
|
1933
|
+
}, Wn = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Gn = Vn, Q = /* @__PURE__ */ new Map(), Kn = {};
|
|
1809
1934
|
(() => {
|
|
1810
|
-
|
|
1811
|
-
let e = (e) =>
|
|
1812
|
-
Object.fromEntries(
|
|
1935
|
+
Q = new Map(Gn.map((e) => [e.scope, e])), Kn = Object.fromEntries(Q), Gn.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
1936
|
+
let e = (e) => Gn.filter((t) => t.category === e && Wn(t.severity) === "bundled");
|
|
1937
|
+
Object.fromEntries(Hn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Hn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
1813
1938
|
})();
|
|
1814
|
-
var
|
|
1815
|
-
let t =
|
|
1816
|
-
return t &&
|
|
1817
|
-
},
|
|
1818
|
-
let t =
|
|
1819
|
-
if (t) return
|
|
1820
|
-
},
|
|
1821
|
-
let n = t ?? (e &&
|
|
1822
|
-
return n !== void 0 &&
|
|
1823
|
-
},
|
|
1824
|
-
for (let { category: n, key: r } of t) if (
|
|
1939
|
+
var qn = (e) => Q.get(e)?.category, Jn = (e) => {
|
|
1940
|
+
let t = Q.get(e);
|
|
1941
|
+
return t && Wn(t.severity);
|
|
1942
|
+
}, Yn = (e) => {
|
|
1943
|
+
let t = Q.get(e);
|
|
1944
|
+
if (t) return Wn(t.severity) === "critical" ? t.scope : t.category;
|
|
1945
|
+
}, Xn = (e) => Un[e], Zn = ({ category: e, key: t }) => {
|
|
1946
|
+
let n = t ?? (e && Xn(e));
|
|
1947
|
+
return n !== void 0 && qn(n) !== void 0 ? n : void 0;
|
|
1948
|
+
}, Qn = (e, t) => {
|
|
1949
|
+
for (let { category: n, key: r } of t) if (Zn({
|
|
1825
1950
|
category: n,
|
|
1826
1951
|
key: r
|
|
1827
1952
|
}) === void 0) throw TypeError(r === void 0 ? n === void 0 ? `${e}: name a category or a permission key` : `${e}: unknown permission category "${n}"` : `${e}: unknown permission key "${r}"`);
|
|
1828
|
-
},
|
|
1953
|
+
}, $n = (e, t = {}) => {
|
|
1829
1954
|
let n = [], r = e.map((e) => {
|
|
1830
|
-
let r =
|
|
1955
|
+
let r = Zn(e), i = [];
|
|
1831
1956
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1832
1957
|
...t,
|
|
1833
1958
|
key: r,
|
|
@@ -1837,8 +1962,8 @@ var jn = (e) => $.get(e)?.category, Mn = (e) => {
|
|
|
1837
1962
|
reason: e.reason
|
|
1838
1963
|
});
|
|
1839
1964
|
return {
|
|
1840
|
-
key: r !== void 0 &&
|
|
1841
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
1965
|
+
key: r !== void 0 && Jn(r) === "critical" ? r : void 0,
|
|
1966
|
+
category: r === void 0 ? e.category ?? "interaction" : Kn[r].category,
|
|
1842
1967
|
hosts: e.hosts,
|
|
1843
1968
|
indexes: i
|
|
1844
1969
|
};
|
|
@@ -1852,34 +1977,43 @@ var jn = (e) => $.get(e)?.category, Mn = (e) => {
|
|
|
1852
1977
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1853
1978
|
}))
|
|
1854
1979
|
};
|
|
1855
|
-
},
|
|
1856
|
-
typeof window < "u" &&
|
|
1857
|
-
if (!
|
|
1980
|
+
}, er = (e) => typeof e == "object" && !!e, tr = typeof chrome < "u" && !!chrome.runtime?.id, nr = (e) => er(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", rr = /* @__PURE__ */ new WeakMap(), ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new Set();
|
|
1981
|
+
typeof window < "u" && tr && window.addEventListener("message", (e) => {
|
|
1982
|
+
if (!nr(e.data)) return;
|
|
1858
1983
|
e.stopImmediatePropagation();
|
|
1859
1984
|
let t = e.source;
|
|
1860
1985
|
if (!t || typeof t != "object") return;
|
|
1861
|
-
let n = t, r =
|
|
1862
|
-
if (
|
|
1863
|
-
let o =
|
|
1986
|
+
let n = t, r = rr.get(n), i = e.data.frameId, a = e.data.document;
|
|
1987
|
+
if (rr.set(n, i), ir.set(n, a), r) for (let e of or) e(r);
|
|
1988
|
+
let o = ar.get(n);
|
|
1864
1989
|
if (o) {
|
|
1865
1990
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
1866
|
-
o.size ||
|
|
1991
|
+
o.size || ar.delete(n);
|
|
1867
1992
|
}
|
|
1868
1993
|
}, { capture: !0 });
|
|
1869
1994
|
//#endregion
|
|
1870
|
-
//#region ../web-extension/lib/lib/
|
|
1871
|
-
var
|
|
1995
|
+
//#region ../web-extension/lib/lib/evaluate-deadline.js
|
|
1996
|
+
var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr = () => new V(cr), ur = (e) => H(e) && e.message === cr ? lr() : e, dr = [
|
|
1997
|
+
/^frame load timed out after \d+ms for /,
|
|
1998
|
+
/^frame goto: documentstart timed out$/,
|
|
1999
|
+
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2000
|
+
], fr = (e) => {
|
|
2001
|
+
if (e instanceof V) return e;
|
|
2002
|
+
let t = typeof e?.message == "string" ? e.message : "";
|
|
2003
|
+
return dr.some((e) => e.test(t)) ? new V(t) : e;
|
|
2004
|
+
}, pr = (e) => {
|
|
1872
2005
|
let t = e;
|
|
1873
2006
|
if (t.window === void 0) return "iframe";
|
|
1874
2007
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
1875
2008
|
if (t.lockdown) throw TypeError("attachFrame: lockdown applies to an iframe, never to a window");
|
|
2009
|
+
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
1876
2010
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
1877
2011
|
return "window";
|
|
1878
|
-
},
|
|
2012
|
+
}, mr = (e, t, n) => {
|
|
1879
2013
|
if (e === void 0) return t;
|
|
1880
2014
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
1881
2015
|
return Math.round(e);
|
|
1882
|
-
},
|
|
2016
|
+
}, hr = ({ url: e, width: t, height: n }) => {
|
|
1883
2017
|
let r = (() => {
|
|
1884
2018
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
1885
2019
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -1895,48 +2029,68 @@ var Gn = (e) => {
|
|
|
1895
2029
|
})();
|
|
1896
2030
|
return r && Z(r), {
|
|
1897
2031
|
url: r,
|
|
1898
|
-
width:
|
|
1899
|
-
height:
|
|
2032
|
+
width: mr(t, 500, "width"),
|
|
2033
|
+
height: mr(n, 700, "height")
|
|
2034
|
+
};
|
|
2035
|
+
}, gr = [
|
|
2036
|
+
"persistent",
|
|
2037
|
+
"ephemeral",
|
|
2038
|
+
"native"
|
|
2039
|
+
], _r = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", vr = (e) => {
|
|
2040
|
+
if ("syncCookies" in e) throw TypeError(_r);
|
|
2041
|
+
let { cookies: t = "persistent" } = e;
|
|
2042
|
+
if (!gr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2043
|
+
if ("storageState" in e) throw TypeError("attachFrame: storageState is not available yet");
|
|
2044
|
+
let n = pr(e);
|
|
2045
|
+
if (n === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2046
|
+
return {
|
|
2047
|
+
kind: n,
|
|
2048
|
+
cookies: t
|
|
1900
2049
|
};
|
|
1901
|
-
},
|
|
2050
|
+
}, yr = (e) => {
|
|
1902
2051
|
try {
|
|
1903
2052
|
return new URL(e).hostname;
|
|
1904
2053
|
} catch {
|
|
1905
2054
|
return "";
|
|
1906
2055
|
}
|
|
1907
|
-
},
|
|
1908
|
-
|
|
1909
|
-
},
|
|
2056
|
+
}, br = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", xr = !1, Sr = () => {
|
|
2057
|
+
xr || (xr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
|
|
2058
|
+
}, Cr = "frame: this frame no longer holds the document the app attached it to", wr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Tr = () => {
|
|
1910
2059
|
let e = D();
|
|
1911
2060
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
1912
2061
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
1913
2062
|
throw new E("lockdown", t, `attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`);
|
|
1914
|
-
},
|
|
2063
|
+
}, Er = (e) => {
|
|
1915
2064
|
try {
|
|
1916
2065
|
return new URL(e, location.href).hostname;
|
|
1917
2066
|
} catch {
|
|
1918
2067
|
return "";
|
|
1919
2068
|
}
|
|
1920
|
-
},
|
|
2069
|
+
}, $ = () => {
|
|
2070
|
+
let e = D();
|
|
2071
|
+
return e.status === "absent" ? 0 : e.abi;
|
|
2072
|
+
}, Dr = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", Or = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", kr = "frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar", Ar = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2073
|
+
if (i !== void 0) throw new E("blank", $(), Dr);
|
|
1921
2074
|
let a = crypto.randomUUID();
|
|
1922
|
-
if (Z(e.src),
|
|
2075
|
+
if (Z(e.src), xn({
|
|
1923
2076
|
src: e.src,
|
|
1924
2077
|
domains: t,
|
|
1925
|
-
lockdown:
|
|
1926
|
-
}), await
|
|
1927
|
-
e.dispatchEvent(new CustomEvent(
|
|
1928
|
-
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await
|
|
2078
|
+
lockdown: n
|
|
2079
|
+
}), await k(), n && Tr(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2080
|
+
e.dispatchEvent(new CustomEvent(br, { detail: a }));
|
|
2081
|
+
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await A.attachFrame({
|
|
1929
2082
|
marker: a,
|
|
1930
2083
|
domains: t,
|
|
1931
|
-
syncCookies:
|
|
1932
|
-
lockdown:
|
|
1933
|
-
}), f = new Set(p([...t,
|
|
2084
|
+
syncCookies: !0,
|
|
2085
|
+
lockdown: n
|
|
2086
|
+
}), f = new Set(p([...t, Er(e.src)], { ipv6: !0 })), m = (e) => f.has(p([yr(e)], { ipv6: !0 })[0] ?? ""), h = Bn({
|
|
2087
|
+
backend: "extension",
|
|
1934
2088
|
executor: {
|
|
1935
2089
|
execute: o,
|
|
1936
2090
|
highlight: s
|
|
1937
2091
|
},
|
|
1938
2092
|
gate: (e) => c(e.parts, e.operation, e.args),
|
|
1939
|
-
|
|
2093
|
+
requestPermissions: async (e) => (Qn("frame.requestPermissions", e), await fn(), l(e)),
|
|
1940
2094
|
evaluate: async (e, t) => {
|
|
1941
2095
|
if (!je(D(), "evaluate")) {
|
|
1942
2096
|
let e = D();
|
|
@@ -1945,18 +2099,26 @@ var Gn = (e) => {
|
|
|
1945
2099
|
return u({
|
|
1946
2100
|
source: e,
|
|
1947
2101
|
arg: t
|
|
2102
|
+
}).catch((e) => {
|
|
2103
|
+
throw ur(e);
|
|
1948
2104
|
});
|
|
1949
2105
|
},
|
|
2106
|
+
addScriptTag: async () => {
|
|
2107
|
+
throw new E("addScriptTag", $(), Or);
|
|
2108
|
+
},
|
|
2109
|
+
clearCookies: async () => {
|
|
2110
|
+
throw new E("clearCookies", $(), kr);
|
|
2111
|
+
},
|
|
1950
2112
|
postMessage: (t, n, r) => {
|
|
1951
|
-
if (n === "*") throw
|
|
1952
|
-
if (!m(n)) throw
|
|
2113
|
+
if (n === "*") throw _t(wr, "postMessage", "extension");
|
|
2114
|
+
if (!m(n)) throw B(Cr, "postMessage");
|
|
1953
2115
|
let i = e.contentWindow;
|
|
1954
|
-
if (i === null) throw
|
|
2116
|
+
if (i === null) throw B("frame: navigate the frame before postMessage", "postMessage");
|
|
1955
2117
|
return i.postMessage(t, n, r), Promise.resolve();
|
|
1956
2118
|
},
|
|
1957
2119
|
listen: (t) => {
|
|
1958
2120
|
let n = (n) => {
|
|
1959
|
-
n.source !== null && n.source === e.contentWindow && !
|
|
2121
|
+
n.source !== null && n.source === e.contentWindow && !nr(n.data) && m(n.origin) && t({
|
|
1960
2122
|
type: "message",
|
|
1961
2123
|
data: n.data,
|
|
1962
2124
|
origin: n.origin,
|
|
@@ -1970,21 +2132,27 @@ var Gn = (e) => {
|
|
|
1970
2132
|
window.removeEventListener("message", n), e.removeEventListener("load", r);
|
|
1971
2133
|
};
|
|
1972
2134
|
},
|
|
1973
|
-
goto: (e, t = {}) => {
|
|
1974
|
-
for (let t of p([
|
|
2135
|
+
goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
|
|
2136
|
+
for (let t of p([Er(e)], { ipv6: !0 })) f.add(t);
|
|
1975
2137
|
return d({
|
|
1976
2138
|
url: e,
|
|
1977
|
-
...
|
|
2139
|
+
...r,
|
|
2140
|
+
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2141
|
+
...n === void 0 ? {} : { timeoutMs: n }
|
|
2142
|
+
}).catch((e) => {
|
|
2143
|
+
throw fr(e);
|
|
1978
2144
|
});
|
|
1979
2145
|
},
|
|
1980
2146
|
url: () => e.src
|
|
1981
2147
|
});
|
|
1982
|
-
return
|
|
1983
|
-
},
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2148
|
+
return r?.length && (dn() ? await h.requestPermissions(r) : Sr()), h;
|
|
2149
|
+
}, jr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Mr = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Nr = async (e) => {
|
|
2150
|
+
throw hr(e.window), new E("attachWindow", $(), jr);
|
|
2151
|
+
}, Pr = (async (e) => {
|
|
2152
|
+
let { kind: t, cookies: n } = vr(e);
|
|
2153
|
+
if (n !== "native") throw new E("cookies", $(), Mr(n));
|
|
2154
|
+
return t === "window" ? Nr(e) : Ar(e);
|
|
2155
|
+
}), Fr = "permissions.request: pass hosts, the sites the grant applies to", Ir = { request: async (e) => {
|
|
1988
2156
|
let t = e.map((e) => {
|
|
1989
2157
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
1990
2158
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -1993,7 +2161,7 @@ var Gn = (e) => {
|
|
|
1993
2161
|
reason: i
|
|
1994
2162
|
} };
|
|
1995
2163
|
let o = p(a ?? [], { ipv6: !0 });
|
|
1996
|
-
if (!o.length) throw TypeError(
|
|
2164
|
+
if (!o.length) throw TypeError(Fr);
|
|
1997
2165
|
return { ask: {
|
|
1998
2166
|
category: t,
|
|
1999
2167
|
key: n,
|
|
@@ -2001,9 +2169,9 @@ var Gn = (e) => {
|
|
|
2001
2169
|
hosts: o
|
|
2002
2170
|
} };
|
|
2003
2171
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2004
|
-
|
|
2005
|
-
let { items: r, answer: i } =
|
|
2172
|
+
Qn("permissions.request", n), n.length && await fn();
|
|
2173
|
+
let { items: r, answer: i } = $n(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await A.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
2006
2174
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2007
|
-
} },
|
|
2175
|
+
} }, Lr = "PermissionDeniedError", Rr = (e) => e instanceof Error ? e.name === Lr : er(e) && e.name === "PermissionDeniedError";
|
|
2008
2176
|
//#endregion
|
|
2009
|
-
export {
|
|
2177
|
+
export { Fe as $, H as A, nt as B, hn as C, B as D, bt as E, R as F, qe as G, tt as H, it as I, ze as J, Qe as K, ot as L, St as M, ht as N, L as O, xt as P, Pe as Q, at as R, bn as S, I as T, Je as U, $e as V, Ye as W, He as X, Ue as Y, Ve as Z, Sn as _, Pr as a, T as at, Z as b, fr as c, be as ct, Qn as d, _e as dt, D as et, qn as f, ye as ft, On as g, En as h, br as i, E as it, _t as j, vt as k, sr as l, ve as lt, Jn as m, Rr as n, k as nt, vr as o, Se as ot, Yn as p, C as pt, Ze as q, Ir as r, xe as rt, hr as s, Ae as st, Lr as t, Ie as tt, lr as u, w as ut, Bn as v, V as w, xn as x, Cn as y, rt as z };
|