@fkn/lib 0.9.60 → 0.9.62
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-DIsOqkSQ.cjs → account-generation-CVWVhbkh.cjs} +1 -1
- package/{account-generation-2ZvMy2tZ.js → account-generation-MjW8usme.js} +1 -1
- package/{account-storage-Cmzz-67T.js → account-storage-D98wfGuJ.js} +2 -2
- package/{account-storage-CPTct4Vz.cjs → account-storage-a_-uiS1N.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.d.ts +1 -1
- package/account.js +2 -2
- package/{api-C-N5AVos.js → api-C1lxKsM1.js} +77 -75
- package/api-D7Sbm8Oj.cjs +3 -0
- package/{api-_LPVMHpt.d.ts → api-xh6lzApn.d.ts} +1 -1
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- 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.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-CwWzWhRW.cjs → cloud-B8v_yMtd.cjs} +1 -1
- package/{cloud-BBQOLP4h.d.ts → cloud-CI7FFRMC.d.ts} +2 -2
- package/{cloud-7Ghfp7X2.js → cloud-CjQfUhhD.js} +3 -3
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-m0ztKGCd.d.ts → contract-BGMJVvTg.d.ts} +1 -1
- package/contract.d.ts +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +3 -3
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-C_eOfEjv.d.ts → extension-C1bcizcn.d.ts} +10 -0
- package/{extension-M8bUhlML.cjs → extension-C1oub0Dw.cjs} +1 -1
- package/{extension-AidgSVhb.js → extension-Ct5qQkQF.js} +3 -3
- package/extension.cjs +1 -1
- package/extension.d.ts +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-BlRxCJQW.cjs → fs-B8V-40ft.cjs} +1 -1
- package/{fs-C_RmxWk9.js → fs-nKDF2pOY.js} +2 -2
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +9 -9
- package/index.js +30 -45
- package/{lib-BGAmzIcU.js → lib-BrsqpUkv.js} +405 -410
- package/lib-C_X3WR4G.cjs +53 -0
- package/{net-dxm4WUEH.d.ts → net-BpyIeQ8r.d.ts} +3 -3
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +1 -1
- package/{proxy-C1RlnrDC.js → proxy-BJ1hSZgi.js} +1 -1
- package/{proxy-CII2NFYV.cjs → proxy-CiIj4vA1.cjs} +1 -1
- package/{proxy-CzciyJH2.d.ts → proxy-Dz60YyYy.d.ts} +2 -2
- package/{relay-choice-ka0GQUF2.d.ts → relay-choice-5yUPI-tJ.d.ts} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +16 -2
- package/rooms.js +1 -1
- package/storage.cjs +1 -1
- package/storage.d.ts +1 -1
- package/storage.js +3 -3
- package/api-ibGqkmtA.cjs +0 -3
- package/lib-BiQ6cOZ7.cjs +0 -53
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
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
|
|
3
|
+
import { BoxBase as _, createTypedEventTarget as v, expose as ee, recursiveBox as te, recursiveRevive as ne } from "osra";
|
|
4
4
|
//#region ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
|
-
var
|
|
5
|
+
var re = (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,
|
|
@@ -34,12 +34,12 @@ var ne = (e, t) => {
|
|
|
34
34
|
o !== void 0 && (o.listeners.delete(n), !(o.listeners.size > 0) && (e.removeEventListener(t, o.forward), r.delete(t)));
|
|
35
35
|
}
|
|
36
36
|
}), n;
|
|
37
|
-
},
|
|
37
|
+
}, ie = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, y = (e) => {
|
|
38
38
|
let t = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
return {
|
|
40
40
|
addEventListener: (n, r, i) => {
|
|
41
41
|
if (r === null) return;
|
|
42
|
-
let a = `${n}|${
|
|
42
|
+
let a = `${n}|${ie(i)}`, o = t.get(r);
|
|
43
43
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
44
44
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
45
45
|
s && o.delete(a);
|
|
@@ -50,18 +50,18 @@ var ne = (e, t) => {
|
|
|
50
50
|
},
|
|
51
51
|
removeEventListener: (n, r, i) => {
|
|
52
52
|
if (r === null) return;
|
|
53
|
-
let a = `${n}|${
|
|
53
|
+
let a = `${n}|${ie(i)}`, o = t.get(r), s = o?.get(a);
|
|
54
54
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
55
55
|
},
|
|
56
56
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, b = /* @__PURE__ */ e({
|
|
59
59
|
box: () => be,
|
|
60
|
-
createVideoElementHandle: () =>
|
|
60
|
+
createVideoElementHandle: () => S,
|
|
61
61
|
isType: () => ye,
|
|
62
62
|
revive: () => xe,
|
|
63
|
-
type: () =>
|
|
64
|
-
}),
|
|
63
|
+
type: () => x
|
|
64
|
+
}), x = "videoElement", ae = [
|
|
65
65
|
"currentTime",
|
|
66
66
|
"volume",
|
|
67
67
|
"muted",
|
|
@@ -72,22 +72,22 @@ var ne = (e, t) => {
|
|
|
72
72
|
"preload",
|
|
73
73
|
"poster",
|
|
74
74
|
"disableRemotePlayback"
|
|
75
|
-
],
|
|
75
|
+
], oe = [
|
|
76
76
|
"duration",
|
|
77
77
|
"paused",
|
|
78
78
|
"ended",
|
|
79
79
|
"seeking",
|
|
80
80
|
"readyState",
|
|
81
81
|
"currentSrc"
|
|
82
|
-
],
|
|
82
|
+
], se = ["buffered", "seekable"], ce = Symbol.for("fkn.remoteVideoElement"), le = Symbol.for("fkn.remoteVideoElement.state"), ue = Symbol.for("fkn.remoteVideoElement.controller"), de = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], fe = (e) => {
|
|
83
83
|
let t = {};
|
|
84
|
-
for (let n of [...
|
|
85
|
-
for (let n of
|
|
84
|
+
for (let n of [...ae, ...oe]) t[n] = e[n];
|
|
85
|
+
for (let n of se) t[n] = de(e[n]);
|
|
86
86
|
return t.error = e.error ? {
|
|
87
87
|
code: e.error.code,
|
|
88
88
|
message: e.error.message
|
|
89
89
|
} : null, t;
|
|
90
|
-
},
|
|
90
|
+
}, pe = (e) => {
|
|
91
91
|
let t = (t) => {
|
|
92
92
|
if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
|
|
93
93
|
};
|
|
@@ -102,17 +102,17 @@ var ne = (e, t) => {
|
|
|
102
102
|
return t(n), e[n][1];
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
},
|
|
105
|
+
}, me = (e) => e ? {
|
|
106
106
|
code: e.code,
|
|
107
107
|
message: e.message,
|
|
108
108
|
MEDIA_ERR_ABORTED: 1,
|
|
109
109
|
MEDIA_ERR_NETWORK: 2,
|
|
110
110
|
MEDIA_ERR_DECODE: 3,
|
|
111
111
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
112
|
-
} : null,
|
|
112
|
+
} : null, he = (e) => re(e, (e, t) => ({
|
|
113
113
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
114
|
-
snapshot:
|
|
115
|
-
})),
|
|
114
|
+
snapshot: fe(t)
|
|
115
|
+
})), ge = async (e, t) => {
|
|
116
116
|
switch (t) {
|
|
117
117
|
case "play": return await e.play(), null;
|
|
118
118
|
case "pause": return e.pause(), null;
|
|
@@ -127,19 +127,19 @@ var ne = (e, t) => {
|
|
|
127
127
|
}
|
|
128
128
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
129
129
|
}
|
|
130
|
-
},
|
|
131
|
-
call: async (t) =>
|
|
130
|
+
}, _e = (e) => ({
|
|
131
|
+
call: async (t) => ge(e, t),
|
|
132
132
|
set: async (t, n) => {
|
|
133
133
|
try {
|
|
134
134
|
e[t] = n;
|
|
135
135
|
} catch {}
|
|
136
|
-
return
|
|
136
|
+
return fe(e);
|
|
137
137
|
},
|
|
138
|
-
events:
|
|
139
|
-
}),
|
|
138
|
+
events: he(e)
|
|
139
|
+
}), ve = (e, t) => {
|
|
140
140
|
let n = new EventTarget();
|
|
141
|
-
Object.defineProperty(n,
|
|
142
|
-
let r =
|
|
141
|
+
Object.defineProperty(n, ce, { value: !0 }), Object.defineProperty(n, le, { value: e }), Object.defineProperty(n, ue, { value: t });
|
|
142
|
+
let r = y({
|
|
143
143
|
target: n,
|
|
144
144
|
remoteEvents: t.events,
|
|
145
145
|
unenrich: (t, n) => {
|
|
@@ -174,7 +174,7 @@ var ne = (e, t) => {
|
|
|
174
174
|
configurable: !0,
|
|
175
175
|
enumerable: !0,
|
|
176
176
|
get() {
|
|
177
|
-
return
|
|
177
|
+
return me(e.error);
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
play: {
|
|
@@ -210,7 +210,7 @@ var ne = (e, t) => {
|
|
|
210
210
|
value: 4
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
for (let n of
|
|
213
|
+
for (let n of ae) i[n] = {
|
|
214
214
|
configurable: !0,
|
|
215
215
|
enumerable: !0,
|
|
216
216
|
get() {
|
|
@@ -222,32 +222,32 @@ var ne = (e, t) => {
|
|
|
222
222
|
}, () => {});
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
|
-
for (let t of
|
|
225
|
+
for (let t of oe) i[t] = {
|
|
226
226
|
configurable: !0,
|
|
227
227
|
enumerable: !0,
|
|
228
228
|
get() {
|
|
229
229
|
return e[t];
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
for (let t of
|
|
232
|
+
for (let t of se) i[t] = {
|
|
233
233
|
configurable: !0,
|
|
234
234
|
enumerable: !0,
|
|
235
235
|
get() {
|
|
236
|
-
return
|
|
236
|
+
return pe(e[t]);
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
return Object.defineProperties(n, i), n;
|
|
240
|
-
},
|
|
240
|
+
}, S = (e) => ve(fe(e), _e(e)), ye = (e) => typeof e == "object" && !!e && e[ce] === !0, be = (e, t) => {
|
|
241
241
|
let n = e;
|
|
242
242
|
return {
|
|
243
243
|
..._,
|
|
244
|
-
type:
|
|
245
|
-
initialState: n[
|
|
246
|
-
controller:
|
|
244
|
+
type: x,
|
|
245
|
+
initialState: n[le],
|
|
246
|
+
controller: te(n[ue], t)
|
|
247
247
|
};
|
|
248
248
|
}, xe = (e, t) => {
|
|
249
|
-
let n =
|
|
250
|
-
return
|
|
249
|
+
let n = ne(e.controller, t);
|
|
250
|
+
return ve({ ...e.initialState }, n);
|
|
251
251
|
}, Se = (e) => {
|
|
252
252
|
let t = [];
|
|
253
253
|
return e.forEach((e, n) => {
|
|
@@ -276,13 +276,13 @@ var ne = (e, t) => {
|
|
|
276
276
|
status: e.status,
|
|
277
277
|
statusText: e.statusText,
|
|
278
278
|
headers: we.box(e.headers),
|
|
279
|
-
body: e.body ?
|
|
279
|
+
body: e.body ? te(e.body, t) : null,
|
|
280
280
|
url: e.url,
|
|
281
281
|
redirected: e.redirected
|
|
282
282
|
}),
|
|
283
283
|
revive: (e, t) => {
|
|
284
284
|
if (e.status === 0) return Response.error();
|
|
285
|
-
let n = we.revive(e.headers), r = e.body ?
|
|
285
|
+
let n = we.revive(e.headers), r = e.body ? ne(e.body, t) : null, i = Ee.has(e.status);
|
|
286
286
|
r && i && r.cancel().catch(() => {});
|
|
287
287
|
let a = new Response(i ? null : r, {
|
|
288
288
|
status: e.status,
|
|
@@ -298,7 +298,7 @@ var ne = (e, t) => {
|
|
|
298
298
|
}), a;
|
|
299
299
|
}
|
|
300
300
|
}, Oe = (e) => [
|
|
301
|
-
|
|
301
|
+
b,
|
|
302
302
|
we,
|
|
303
303
|
De,
|
|
304
304
|
...e
|
|
@@ -343,12 +343,12 @@ typeof document < "u" && document.addEventListener(Be, () => {
|
|
|
343
343
|
});
|
|
344
344
|
var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je] === "true", T = () => typeof document > "u" ? { status: "absent" } : Le(document.documentElement.dataset), Ue = null, We = (e) => {
|
|
345
345
|
Ue = e;
|
|
346
|
-
},
|
|
346
|
+
}, E = (e = 2e3) => new Promise((t, n) => {
|
|
347
347
|
let r = () => T().status === "ok";
|
|
348
348
|
if (r()) return t();
|
|
349
|
-
let i
|
|
350
|
-
clearTimeout(
|
|
351
|
-
},
|
|
349
|
+
let i = (e) => {
|
|
350
|
+
clearTimeout(s), o.disconnect(), e();
|
|
351
|
+
}, a = () => i(async () => {
|
|
352
352
|
let e = T();
|
|
353
353
|
if (e.status === "outdated") return n(new C(e.abi, e.required));
|
|
354
354
|
if (Ue) {
|
|
@@ -357,42 +357,37 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
357
357
|
if (e.status === "outdated") return n(new C(e.abi, e.required));
|
|
358
358
|
}
|
|
359
359
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
360
|
-
}),
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
}), l = () => {
|
|
365
|
-
document.readyState === "complete" && !r() && s();
|
|
366
|
-
};
|
|
367
|
-
if (i = setTimeout(o, e), c.observe(document.documentElement, {
|
|
360
|
+
}), o = new MutationObserver(() => {
|
|
361
|
+
r() && i(t);
|
|
362
|
+
}), s = setTimeout(a, e);
|
|
363
|
+
o.observe(document.documentElement, {
|
|
368
364
|
attributes: !0,
|
|
369
365
|
attributeFilter: [...Pe]
|
|
370
|
-
})
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
await E(), Ke ??= y({}, {
|
|
366
|
+
});
|
|
367
|
+
}), Ge, D = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
368
|
+
await E(), Ge ??= ee({}, {
|
|
374
369
|
transport: window,
|
|
375
370
|
revivableModules: Oe
|
|
376
371
|
});
|
|
377
|
-
let n = (await
|
|
372
|
+
let n = (await Ge)[t];
|
|
378
373
|
return n(...e);
|
|
379
374
|
} }), O = [
|
|
380
375
|
"origin",
|
|
381
376
|
"referer",
|
|
382
377
|
"cookie"
|
|
383
|
-
],
|
|
384
|
-
if (t === "include" &&
|
|
385
|
-
},
|
|
378
|
+
], Ke = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), qe = (e) => Ke(e, "cookie"), Je = (e, t) => {
|
|
379
|
+
if (t === "include" && qe(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
380
|
+
}, Ye = (e, t) => {
|
|
386
381
|
if (!Array.isArray(t)) throw Error(`${e}: requestHeaders must be an array of header operations`);
|
|
387
382
|
let n = [...new Set(t.map((e) => {
|
|
388
383
|
let t = e?.header;
|
|
389
384
|
return typeof t == "string" ? t.trim().toLowerCase() : String(t);
|
|
390
385
|
}).filter((e) => !O.includes(e)))];
|
|
391
386
|
if (n.length) throw Error(`${e}: refusing to rewrite request header(s): ${n.join(", ")}`);
|
|
392
|
-
},
|
|
387
|
+
}, Xe = (e) => {
|
|
393
388
|
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !O.includes(e)))];
|
|
394
389
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
395
|
-
},
|
|
390
|
+
}, Ze = /* @__PURE__ */ "fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,social-3n2.pages.dev,plugins.banou.dev".split(","), Qe = (e) => e.toLowerCase().replace(/\.+$/, ""), $e = ["79.127.204.69", "152.233.49.59"], et = (e) => {
|
|
396
391
|
let t;
|
|
397
392
|
try {
|
|
398
393
|
t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
|
|
@@ -411,21 +406,21 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
411
406
|
}
|
|
412
407
|
return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
|
|
413
408
|
}, k = (e) => {
|
|
414
|
-
let t =
|
|
415
|
-
if (
|
|
416
|
-
let n =
|
|
417
|
-
return n !== void 0 &&
|
|
418
|
-
},
|
|
409
|
+
let t = Qe(e);
|
|
410
|
+
if (Ze.some((e) => t === e || t.endsWith(`.${e}`))) return !0;
|
|
411
|
+
let n = et(t);
|
|
412
|
+
return n !== void 0 && $e.includes(n);
|
|
413
|
+
}, tt = 100, nt = (e) => [...e.trim()], A = (e, t) => {
|
|
419
414
|
if (typeof t != "string") return;
|
|
420
|
-
let n =
|
|
415
|
+
let n = nt(t).length;
|
|
421
416
|
if (n > 100) throw TypeError(`${e}: reason must be at most 100 characters, not ${n}`);
|
|
422
|
-
},
|
|
417
|
+
}, rt = {
|
|
423
418
|
scope: "network.fetch",
|
|
424
419
|
category: "network",
|
|
425
420
|
severity: 0,
|
|
426
421
|
title: "Fetch data from other sites",
|
|
427
422
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
428
|
-
},
|
|
423
|
+
}, it = {
|
|
429
424
|
scope: "network.fetchCredentialed",
|
|
430
425
|
category: "network",
|
|
431
426
|
severity: 3,
|
|
@@ -433,7 +428,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
433
428
|
unsafe: !0,
|
|
434
429
|
title: "Fetch from other sites, signed in as you",
|
|
435
430
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
436
|
-
},
|
|
431
|
+
}, at = {
|
|
437
432
|
scope: "network.fetchLocal",
|
|
438
433
|
category: "network",
|
|
439
434
|
severity: 3,
|
|
@@ -441,12 +436,12 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
441
436
|
unsafe: !0,
|
|
442
437
|
title: "Access devices on your local network",
|
|
443
438
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
444
|
-
},
|
|
439
|
+
}, ot = (e) => {
|
|
445
440
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
446
441
|
if (!t) return !1;
|
|
447
442
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
448
443
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
449
|
-
},
|
|
444
|
+
}, st = (e) => {
|
|
450
445
|
let t;
|
|
451
446
|
try {
|
|
452
447
|
t = new URL(e);
|
|
@@ -454,8 +449,8 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
454
449
|
return !1;
|
|
455
450
|
}
|
|
456
451
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
457
|
-
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:") :
|
|
458
|
-
},
|
|
452
|
+
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:") : ot(n);
|
|
453
|
+
}, ct = (e) => {
|
|
459
454
|
let t;
|
|
460
455
|
try {
|
|
461
456
|
t = new URL(e);
|
|
@@ -463,19 +458,19 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
463
458
|
return !1;
|
|
464
459
|
}
|
|
465
460
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || k(t.hostname);
|
|
461
|
+
}, lt = (e) => {
|
|
462
|
+
if (ct(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
466
463
|
}, ut = (e) => {
|
|
467
|
-
if (lt(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
468
|
-
}, dt = (e) => {
|
|
469
464
|
if (!e?.headers) return;
|
|
470
465
|
let t = new Headers(e.headers), n = O.map((e) => {
|
|
471
466
|
let n = t.get(e);
|
|
472
467
|
return n === null || n === "" ? void 0 : [e, n];
|
|
473
468
|
}).filter((e) => e !== void 0);
|
|
474
469
|
return n.length ? n : void 0;
|
|
475
|
-
},
|
|
470
|
+
}, dt = async (e, t) => {
|
|
476
471
|
A("fetch", t?.reason);
|
|
477
472
|
let n = new Request(e, t);
|
|
478
|
-
|
|
473
|
+
lt(n.url);
|
|
479
474
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
480
475
|
return D.proxyFetch({
|
|
481
476
|
url: n.url,
|
|
@@ -484,28 +479,28 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
484
479
|
body: r,
|
|
485
480
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
486
481
|
redirect: n.redirect,
|
|
487
|
-
unsafeHeaders:
|
|
482
|
+
unsafeHeaders: ut(t),
|
|
488
483
|
reason: t?.reason,
|
|
489
484
|
signal: t?.signal ?? void 0
|
|
490
485
|
});
|
|
491
|
-
},
|
|
486
|
+
}, ft = (e) => {
|
|
492
487
|
for (let t of e) if (typeof t == "string" && k(t.trim().toLowerCase())) return t;
|
|
493
|
-
},
|
|
488
|
+
}, pt = (e) => {
|
|
494
489
|
let t = e.trim().toLowerCase().replace(/^\.+|\.+$/g, "");
|
|
495
|
-
return t !== "" && (k(t) || [...
|
|
496
|
-
},
|
|
497
|
-
for (let t of e) if (typeof t == "string" &&
|
|
498
|
-
},
|
|
499
|
-
if (
|
|
500
|
-
},
|
|
490
|
+
return t !== "" && (k(t) || [...Ze, ...$e].some((e) => e.endsWith(`.${t}`)));
|
|
491
|
+
}, mt = (e) => {
|
|
492
|
+
for (let t of e) if (typeof t == "string" && pt(t)) return t;
|
|
493
|
+
}, ht = (e) => `${e}: refusing to target FKN platform domains`, gt = (e, t) => {
|
|
494
|
+
if (ft(t) !== void 0) throw Error(ht(e));
|
|
495
|
+
}, _t = (e) => {
|
|
501
496
|
try {
|
|
502
497
|
return new URL(String(e)).hostname;
|
|
503
498
|
} catch {
|
|
504
499
|
return "";
|
|
505
500
|
}
|
|
506
501
|
}, j = (e, t) => {
|
|
507
|
-
if (
|
|
508
|
-
},
|
|
502
|
+
if (mt(t) !== void 0) throw Error(ht(e));
|
|
503
|
+
}, vt = {
|
|
509
504
|
scope: "network.readCookie",
|
|
510
505
|
category: "network",
|
|
511
506
|
severity: 3,
|
|
@@ -513,7 +508,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
513
508
|
unsafe: !0,
|
|
514
509
|
title: "Read a site’s cookie",
|
|
515
510
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
516
|
-
},
|
|
511
|
+
}, yt = { get: async (e) => (gt("cookies.get", [_t(e.url)]), D.getCookie(e)) }, bt = {
|
|
517
512
|
scope: "network.modifyRequestHeaders",
|
|
518
513
|
category: "network",
|
|
519
514
|
severity: 2,
|
|
@@ -521,7 +516,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
521
516
|
unsafe: !0,
|
|
522
517
|
title: "Rewrite request headers to other sites",
|
|
523
518
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
524
|
-
},
|
|
519
|
+
}, xt = async (e) => (j("setRequestHeaderRule", e.domains), Ye("setRequestHeaderRule", e.requestHeaders), A("setRequestHeaderRule", e.reason), D.setRequestHeaderRule(e)), St = (e) => D.removeRequestHeaderRule({ ruleId: e }), Ct = class extends Error {
|
|
525
520
|
reason;
|
|
526
521
|
filename;
|
|
527
522
|
line;
|
|
@@ -530,7 +525,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
530
525
|
constructor(e, t, n, r, i) {
|
|
531
526
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
532
527
|
}
|
|
533
|
-
},
|
|
528
|
+
}, wt = class {
|
|
534
529
|
start;
|
|
535
530
|
end;
|
|
536
531
|
source;
|
|
@@ -541,7 +536,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
541
536
|
(function(e) {
|
|
542
537
|
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";
|
|
543
538
|
})(M ||= {});
|
|
544
|
-
var
|
|
539
|
+
var Tt = (e, t, n) => {
|
|
545
540
|
let r = n, i = 1e4;
|
|
546
541
|
do {
|
|
547
542
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -574,14 +569,14 @@ var Et = (e, t, n) => {
|
|
|
574
569
|
break;
|
|
575
570
|
case "\"":
|
|
576
571
|
{
|
|
577
|
-
let t =
|
|
572
|
+
let t = Tt(e, ["\""], o + 1);
|
|
578
573
|
if (t === -1) return -1;
|
|
579
574
|
r = t + 1;
|
|
580
575
|
}
|
|
581
576
|
break;
|
|
582
577
|
case "'":
|
|
583
578
|
{
|
|
584
|
-
let t =
|
|
579
|
+
let t = Tt(e, ["'"], o + 1);
|
|
585
580
|
if (t === -1) return -1;
|
|
586
581
|
r = t + 1;
|
|
587
582
|
}
|
|
@@ -591,17 +586,17 @@ var Et = (e, t, n) => {
|
|
|
591
586
|
i--;
|
|
592
587
|
} while (i > 0);
|
|
593
588
|
throw Error("Too many escaping");
|
|
594
|
-
},
|
|
589
|
+
}, Et = /\/\*[^]*?(?:\*\/|$)/g;
|
|
595
590
|
function P(e) {
|
|
596
591
|
return e ? e.trim() : "";
|
|
597
592
|
}
|
|
598
|
-
function
|
|
593
|
+
function F(e, t) {
|
|
599
594
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
600
595
|
for (let t in e) {
|
|
601
596
|
let n = e[t];
|
|
602
597
|
Array.isArray(n) ? n.forEach((e) => {
|
|
603
|
-
|
|
604
|
-
}) : n && typeof n == "object" &&
|
|
598
|
+
F(e, r);
|
|
599
|
+
}) : n && typeof n == "object" && F(n, r);
|
|
605
600
|
}
|
|
606
601
|
return n && Object.defineProperty(e, "parent", {
|
|
607
602
|
configurable: !0,
|
|
@@ -610,7 +605,7 @@ function Ot(e, t) {
|
|
|
610
605
|
value: t || null
|
|
611
606
|
}), e;
|
|
612
607
|
}
|
|
613
|
-
var
|
|
608
|
+
var Dt = class {
|
|
614
609
|
level = 0;
|
|
615
610
|
indentation = " ";
|
|
616
611
|
compress = !1;
|
|
@@ -760,7 +755,7 @@ var kt = class {
|
|
|
760
755
|
declaration(e) {
|
|
761
756
|
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(";");
|
|
762
757
|
}
|
|
763
|
-
},
|
|
758
|
+
}, Ot = (e, t) => {
|
|
764
759
|
t ||= {};
|
|
765
760
|
let n = 1, r = 1;
|
|
766
761
|
function i() {
|
|
@@ -768,14 +763,14 @@ var kt = class {
|
|
|
768
763
|
line: n,
|
|
769
764
|
column: r
|
|
770
765
|
};
|
|
771
|
-
return (i) => (i.position = new
|
|
766
|
+
return (i) => (i.position = new wt(e, {
|
|
772
767
|
line: n,
|
|
773
768
|
column: r
|
|
774
769
|
}, t?.source || ""), u(), i);
|
|
775
770
|
}
|
|
776
771
|
let a = [];
|
|
777
772
|
function o(i) {
|
|
778
|
-
let o = new
|
|
773
|
+
let o = new Ct(t?.source || "", i, n, r, e);
|
|
779
774
|
if (!t?.silent) throw o;
|
|
780
775
|
a.push(o);
|
|
781
776
|
}
|
|
@@ -827,7 +822,7 @@ var kt = class {
|
|
|
827
822
|
n.push(e.substring(r, i)), r = i + 1;
|
|
828
823
|
}
|
|
829
824
|
return n;
|
|
830
|
-
})(P(n).replace(
|
|
825
|
+
})(P(n).replace(Et, ""), [","]).map((e) => P(e));
|
|
831
826
|
}
|
|
832
827
|
function m() {
|
|
833
828
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
@@ -837,10 +832,10 @@ var kt = class {
|
|
|
837
832
|
if (!a) return o("property missing ':'");
|
|
838
833
|
l(a);
|
|
839
834
|
let s = "", c = N(e, [";", "}"]);
|
|
840
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(
|
|
835
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(Et, ""));
|
|
841
836
|
let u = t({
|
|
842
837
|
type: M.declaration,
|
|
843
|
-
property: r.replace(
|
|
838
|
+
property: r.replace(Et, ""),
|
|
844
839
|
value: s
|
|
845
840
|
}), d = /^[;\s]*/.exec(e);
|
|
846
841
|
return d && l(d), u;
|
|
@@ -869,14 +864,14 @@ var kt = class {
|
|
|
869
864
|
if (!s()) return o("missing '{'");
|
|
870
865
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
871
866
|
if (e.charAt(0) === "@") {
|
|
872
|
-
let e =
|
|
867
|
+
let e = b();
|
|
873
868
|
if (e) {
|
|
874
869
|
n.push(e), d(n);
|
|
875
870
|
continue;
|
|
876
871
|
}
|
|
877
872
|
}
|
|
878
873
|
if (g()) {
|
|
879
|
-
let e =
|
|
874
|
+
let e = x();
|
|
880
875
|
if (e) {
|
|
881
876
|
n.push(e), d(n);
|
|
882
877
|
continue;
|
|
@@ -901,14 +896,14 @@ var kt = class {
|
|
|
901
896
|
let n = [];
|
|
902
897
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
903
898
|
if (e.charAt(0) === "@") {
|
|
904
|
-
let e =
|
|
899
|
+
let e = b();
|
|
905
900
|
if (e) {
|
|
906
901
|
n.push(e), d(n);
|
|
907
902
|
continue;
|
|
908
903
|
}
|
|
909
904
|
}
|
|
910
905
|
if (g()) {
|
|
911
|
-
let e =
|
|
906
|
+
let e = x();
|
|
912
907
|
if (e) {
|
|
913
908
|
n.push(e), d(n);
|
|
914
909
|
continue;
|
|
@@ -929,7 +924,7 @@ var kt = class {
|
|
|
929
924
|
}
|
|
930
925
|
return n;
|
|
931
926
|
}
|
|
932
|
-
function
|
|
927
|
+
function ee() {
|
|
933
928
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
934
929
|
for (; r;) {
|
|
935
930
|
let n = l(r);
|
|
@@ -943,7 +938,7 @@ var kt = class {
|
|
|
943
938
|
declarations: h() || []
|
|
944
939
|
});
|
|
945
940
|
}
|
|
946
|
-
let
|
|
941
|
+
let te = RegExp(`^@(${[
|
|
947
942
|
"top-left-corner",
|
|
948
943
|
"top-left",
|
|
949
944
|
"top-center",
|
|
@@ -960,8 +955,8 @@ var kt = class {
|
|
|
960
955
|
"right-top",
|
|
961
956
|
"right-middle",
|
|
962
957
|
"right-bottom"
|
|
963
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
964
|
-
function
|
|
958
|
+
].join("|")})(?![\\w-])\\s*`), ne = y("import"), re = y("charset"), ie = y("namespace");
|
|
959
|
+
function y(t) {
|
|
965
960
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
966
961
|
return () => {
|
|
967
962
|
let r = i(), a = n.exec(e);
|
|
@@ -970,7 +965,7 @@ var kt = class {
|
|
|
970
965
|
return s[t] = o[1].trim(), r(s);
|
|
971
966
|
};
|
|
972
967
|
}
|
|
973
|
-
function
|
|
968
|
+
function b() {
|
|
974
969
|
if (e[0] === "@") return function() {
|
|
975
970
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
976
971
|
if (!n) return;
|
|
@@ -978,8 +973,8 @@ var kt = class {
|
|
|
978
973
|
if (!a) return o("@keyframes missing name");
|
|
979
974
|
let u = l(a)[1];
|
|
980
975
|
if (!s()) return o("@keyframes missing '{'");
|
|
981
|
-
let f = d(), p =
|
|
982
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
976
|
+
let f = d(), p = ee();
|
|
977
|
+
for (; p;) f.push(p), f = f.concat(d()), p = ee();
|
|
983
978
|
return c() ? t({
|
|
984
979
|
type: M.keyframes,
|
|
985
980
|
name: u,
|
|
@@ -1017,7 +1012,7 @@ var kt = class {
|
|
|
1017
1012
|
supports: r,
|
|
1018
1013
|
rules: a
|
|
1019
1014
|
}) : o("@supports missing '}'");
|
|
1020
|
-
}() ||
|
|
1015
|
+
}() || ne() || re() || ie() || function() {
|
|
1021
1016
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
1022
1017
|
if (!n) return;
|
|
1023
1018
|
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
@@ -1038,7 +1033,7 @@ var kt = class {
|
|
|
1038
1033
|
let a = [];
|
|
1039
1034
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
1040
1035
|
if (e.charAt(0) === "@") {
|
|
1041
|
-
let e =
|
|
1036
|
+
let e = b();
|
|
1042
1037
|
if (e) {
|
|
1043
1038
|
a.push(e), d(a);
|
|
1044
1039
|
continue;
|
|
@@ -1178,7 +1173,7 @@ var kt = class {
|
|
|
1178
1173
|
declarations: a
|
|
1179
1174
|
}) : o("@position-try missing '}'");
|
|
1180
1175
|
}() || function() {
|
|
1181
|
-
let t = i(), n =
|
|
1176
|
+
let t = i(), n = te.exec(e);
|
|
1182
1177
|
if (!n) return;
|
|
1183
1178
|
let r = l(n)[1];
|
|
1184
1179
|
if (!s()) return o(`@${r} missing '{'`);
|
|
@@ -1210,7 +1205,7 @@ var kt = class {
|
|
|
1210
1205
|
});
|
|
1211
1206
|
}();
|
|
1212
1207
|
}
|
|
1213
|
-
function
|
|
1208
|
+
function x() {
|
|
1214
1209
|
let e = i(), t = p();
|
|
1215
1210
|
return t ? (d(), e({
|
|
1216
1211
|
type: M.rule,
|
|
@@ -1218,7 +1213,7 @@ var kt = class {
|
|
|
1218
1213
|
declarations: _() || []
|
|
1219
1214
|
})) : o("selector missing");
|
|
1220
1215
|
}
|
|
1221
|
-
return
|
|
1216
|
+
return F(function() {
|
|
1222
1217
|
let n = function() {
|
|
1223
1218
|
let n, r = [];
|
|
1224
1219
|
for (u(), d(r); e.length;) {
|
|
@@ -1229,7 +1224,7 @@ var kt = class {
|
|
|
1229
1224
|
}
|
|
1230
1225
|
break;
|
|
1231
1226
|
}
|
|
1232
|
-
if (n =
|
|
1227
|
+
if (n = b() || x(), !n) {
|
|
1233
1228
|
if (t?.silent) {
|
|
1234
1229
|
l([e.charAt(0)]), u(), d(r);
|
|
1235
1230
|
continue;
|
|
@@ -1249,66 +1244,66 @@ var kt = class {
|
|
|
1249
1244
|
}
|
|
1250
1245
|
};
|
|
1251
1246
|
}());
|
|
1252
|
-
},
|
|
1247
|
+
}, kt = (e, t) => new Dt(t || {}).compile(e), At = Object.defineProperty, jt = (e, t) => {
|
|
1253
1248
|
let n = {};
|
|
1254
|
-
for (var r in e)
|
|
1249
|
+
for (var r in e) At(n, r, {
|
|
1255
1250
|
get: e[r],
|
|
1256
1251
|
enumerable: !0
|
|
1257
1252
|
});
|
|
1258
|
-
return t ||
|
|
1259
|
-
},
|
|
1260
|
-
name:
|
|
1253
|
+
return t || At(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1254
|
+
}, Mt = "LocatorError", I = "LocatorUnsupportedError", Nt = "LocatorDeniedError", Pt = "LocatorInvalidError", Ft = (e) => typeof e == "object" && e ? e.name : void 0, L = (e) => Object.assign(Error(e), { name: Mt }), R = (e, t = "", n) => Object.assign(Error(e), {
|
|
1255
|
+
name: I,
|
|
1261
1256
|
operation: t,
|
|
1262
1257
|
backend: n
|
|
1263
|
-
}),
|
|
1264
|
-
name:
|
|
1258
|
+
}), It = (e, t) => R(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), z = (e, t) => Object.assign(Error(e), {
|
|
1259
|
+
name: Nt,
|
|
1265
1260
|
operation: t
|
|
1266
|
-
}),
|
|
1267
|
-
name:
|
|
1261
|
+
}), Lt = (e, t) => Object.assign(Error(e), {
|
|
1262
|
+
name: Pt,
|
|
1268
1263
|
operation: t
|
|
1269
|
-
}),
|
|
1264
|
+
}), B = class extends Error {
|
|
1270
1265
|
name = "TimeoutError";
|
|
1271
1266
|
constructor(e, t) {
|
|
1272
1267
|
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1273
1268
|
}
|
|
1274
|
-
},
|
|
1269
|
+
}, Rt = (e) => Ft(e) === I, zt = (e) => Ft(e) === Nt, Bt = (e) => Ft(e) === Pt, Vt = (e) => zt(e) || Rt(e) || Bt(e), V = (e) => {
|
|
1275
1270
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1276
|
-
if (!t) throw
|
|
1271
|
+
if (!t) throw L("the resolved element belongs to a document with no window");
|
|
1277
1272
|
return t;
|
|
1278
|
-
},
|
|
1273
|
+
}, Ht = (e, t) => {
|
|
1279
1274
|
let n = e?.[t];
|
|
1280
1275
|
return typeof n == "function" ? n : null;
|
|
1281
|
-
},
|
|
1276
|
+
}, Ut = (e, t) => {
|
|
1282
1277
|
if (typeof e != "object" || !e) return null;
|
|
1283
1278
|
let n = (() => {
|
|
1284
1279
|
try {
|
|
1285
|
-
return
|
|
1280
|
+
return Ht(V(e), t);
|
|
1286
1281
|
} catch {
|
|
1287
1282
|
return null;
|
|
1288
1283
|
}
|
|
1289
1284
|
})();
|
|
1290
1285
|
if (n && e instanceof n) return n;
|
|
1291
|
-
let r =
|
|
1286
|
+
let r = Ht(globalThis, t);
|
|
1292
1287
|
return r && e instanceof r ? r : null;
|
|
1293
|
-
},
|
|
1294
|
-
if (e.length === 0) throw
|
|
1295
|
-
if (e.length > 1) throw
|
|
1288
|
+
}, H = (e, t) => Ut(e, t) !== null, U = (e) => {
|
|
1289
|
+
if (e.length === 0) throw L("No elements found");
|
|
1290
|
+
if (e.length > 1) throw L(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1296
1291
|
return e[0];
|
|
1297
|
-
},
|
|
1298
|
-
if (!
|
|
1292
|
+
}, Wt = (e, t) => {
|
|
1293
|
+
if (!H(e, t)) throw L(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1299
1294
|
return e;
|
|
1300
|
-
},
|
|
1301
|
-
|
|
1302
|
-
},
|
|
1295
|
+
}, Gt = (e) => e.tagName.toLowerCase(), Kt = /* @__PURE__ */ new Set(), qt = (e) => {
|
|
1296
|
+
Kt.add(e);
|
|
1297
|
+
}, Jt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Yt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Xt = (e) => !Jt.test(Yt(e.value)), Zt = /* @__PURE__ */ new Set([
|
|
1303
1298
|
M.import,
|
|
1304
1299
|
M.fontFace,
|
|
1305
1300
|
M.namespace,
|
|
1306
1301
|
M.charset,
|
|
1307
1302
|
M.document,
|
|
1308
1303
|
M.comment
|
|
1309
|
-
]),
|
|
1310
|
-
if (
|
|
1311
|
-
if (e.type === M.declaration) return
|
|
1304
|
+
]), Qt = (e) => {
|
|
1305
|
+
if (Zt.has(e.type)) return null;
|
|
1306
|
+
if (e.type === M.declaration) return Xt(e) ? e : null;
|
|
1312
1307
|
let t = e, n = { ...t };
|
|
1313
1308
|
for (let e of [
|
|
1314
1309
|
"declarations",
|
|
@@ -1316,18 +1311,18 @@ var kt = class {
|
|
|
1316
1311
|
"keyframes"
|
|
1317
1312
|
]) {
|
|
1318
1313
|
let r = t[e];
|
|
1319
|
-
Array.isArray(r) && (n[e] =
|
|
1314
|
+
Array.isArray(r) && (n[e] = $t(r));
|
|
1320
1315
|
}
|
|
1321
1316
|
return n;
|
|
1322
|
-
},
|
|
1317
|
+
}, $t = (e) => e.map((e) => Qt(e)).filter((e) => e !== null), en = (e) => {
|
|
1323
1318
|
let t;
|
|
1324
1319
|
try {
|
|
1325
|
-
t =
|
|
1320
|
+
t = Ot(e, { silent: !0 });
|
|
1326
1321
|
} catch {
|
|
1327
1322
|
return "";
|
|
1328
1323
|
}
|
|
1329
|
-
return t.stylesheet.rules =
|
|
1330
|
-
},
|
|
1324
|
+
return t.stylesheet.rules = $t(t.stylesheet.rules), kt(t);
|
|
1325
|
+
}, tn = (e, t) => {
|
|
1331
1326
|
let n = () => {
|
|
1332
1327
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1333
1328
|
};
|
|
@@ -1344,30 +1339,30 @@ var kt = class {
|
|
|
1344
1339
|
});
|
|
1345
1340
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1346
1341
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1347
|
-
},
|
|
1342
|
+
}, nn = { resolve: (e, t) => {
|
|
1348
1343
|
let n = e.document.createElement("style");
|
|
1349
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1344
|
+
n.textContent = t.noSanitize ? t.content : en(t.content);
|
|
1350
1345
|
try {
|
|
1351
|
-
|
|
1346
|
+
tn(e.document, n);
|
|
1352
1347
|
} catch (e) {
|
|
1353
1348
|
console.error(e);
|
|
1354
1349
|
}
|
|
1355
|
-
|
|
1356
|
-
} },
|
|
1350
|
+
qt(n);
|
|
1351
|
+
} }, rn = (e) => {
|
|
1357
1352
|
let t = [];
|
|
1358
1353
|
return e.forEach((e, n) => {
|
|
1359
1354
|
t.push([n, e]);
|
|
1360
1355
|
}), t;
|
|
1361
|
-
},
|
|
1356
|
+
}, W = {
|
|
1362
1357
|
kind: "frame",
|
|
1363
1358
|
ensureArgs: (e) => [void 0, e],
|
|
1364
1359
|
resolve: async (e, t, n = {}) => {
|
|
1365
|
-
if (typeof t != "string") throw
|
|
1366
|
-
let r =
|
|
1360
|
+
if (typeof t != "string") throw Lt("fetch: url must be a string", "fetch");
|
|
1361
|
+
let r = V(e.document), i;
|
|
1367
1362
|
try {
|
|
1368
1363
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1369
1364
|
} catch {
|
|
1370
|
-
throw
|
|
1365
|
+
throw Lt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1371
1366
|
}
|
|
1372
1367
|
let a = await r.fetch(i, {
|
|
1373
1368
|
method: n.method ?? "GET",
|
|
@@ -1383,31 +1378,31 @@ var kt = class {
|
|
|
1383
1378
|
url: a.url,
|
|
1384
1379
|
redirected: a.redirected,
|
|
1385
1380
|
type: a.type,
|
|
1386
|
-
headers:
|
|
1381
|
+
headers: rn(a.headers),
|
|
1387
1382
|
body: await a.arrayBuffer()
|
|
1388
1383
|
};
|
|
1389
1384
|
}
|
|
1390
|
-
},
|
|
1391
|
-
click: () =>
|
|
1392
|
-
count: () =>
|
|
1393
|
-
exists: () =>
|
|
1394
|
-
fill: () =>
|
|
1395
|
-
getAttribute: () =>
|
|
1396
|
-
hover: () =>
|
|
1397
|
-
isVisible: () =>
|
|
1398
|
-
textContent: () =>
|
|
1399
|
-
}),
|
|
1385
|
+
}, G = /* @__PURE__ */ jt({
|
|
1386
|
+
click: () => on,
|
|
1387
|
+
count: () => mn,
|
|
1388
|
+
exists: () => hn,
|
|
1389
|
+
fill: () => un,
|
|
1390
|
+
getAttribute: () => fn,
|
|
1391
|
+
hover: () => sn,
|
|
1392
|
+
isVisible: () => pn,
|
|
1393
|
+
textContent: () => dn
|
|
1394
|
+
}), an = (e, t) => {
|
|
1400
1395
|
let n = e.getBoundingClientRect();
|
|
1401
1396
|
return {
|
|
1402
1397
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1403
1398
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1404
1399
|
};
|
|
1405
|
-
},
|
|
1406
|
-
let n =
|
|
1400
|
+
}, on = { resolve: (e, t = {}) => {
|
|
1401
|
+
let n = U(e.elements), r = V(n), i = {
|
|
1407
1402
|
bubbles: !0,
|
|
1408
1403
|
cancelable: !0,
|
|
1409
1404
|
composed: !0,
|
|
1410
|
-
...
|
|
1405
|
+
...an(n, t.position),
|
|
1411
1406
|
button: 0
|
|
1412
1407
|
}, a = {
|
|
1413
1408
|
...i,
|
|
@@ -1431,12 +1426,12 @@ var kt = class {
|
|
|
1431
1426
|
...i,
|
|
1432
1427
|
buttons: 0
|
|
1433
1428
|
}));
|
|
1434
|
-
} },
|
|
1435
|
-
let n =
|
|
1429
|
+
} }, sn = { resolve: (e, t = {}) => {
|
|
1430
|
+
let n = U(e.elements), r = V(n), i = {
|
|
1436
1431
|
bubbles: !0,
|
|
1437
1432
|
cancelable: !0,
|
|
1438
1433
|
composed: !0,
|
|
1439
|
-
...
|
|
1434
|
+
...an(n, t.position)
|
|
1440
1435
|
}, a = {
|
|
1441
1436
|
...i,
|
|
1442
1437
|
pointerType: "mouse",
|
|
@@ -1450,11 +1445,11 @@ var kt = class {
|
|
|
1450
1445
|
...i,
|
|
1451
1446
|
bubbles: !1
|
|
1452
1447
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1453
|
-
} },
|
|
1448
|
+
} }, cn = (e, t) => {
|
|
1454
1449
|
e._valueTracker?.setValue("");
|
|
1455
|
-
let n = (
|
|
1450
|
+
let n = (Ut(e, "HTMLTextAreaElement") ?? Ut(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1456
1451
|
r ? r.call(e, t) : e.value = t;
|
|
1457
|
-
},
|
|
1452
|
+
}, ln = (e, t) => {
|
|
1458
1453
|
if (e.type !== "range") return null;
|
|
1459
1454
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1460
1455
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1491,61 +1486,61 @@ var kt = class {
|
|
|
1491
1486
|
buttons: 0
|
|
1492
1487
|
}
|
|
1493
1488
|
};
|
|
1494
|
-
},
|
|
1495
|
-
let r =
|
|
1496
|
-
if (a ||
|
|
1497
|
-
let e = r, n = a ?
|
|
1498
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1489
|
+
}, un = { resolve: (e, t, n = {}) => {
|
|
1490
|
+
let r = U(e.elements), i = V(r), a = H(r, "HTMLInputElement");
|
|
1491
|
+
if (a || H(r, "HTMLTextAreaElement")) {
|
|
1492
|
+
let e = r, n = a ? ln(e, t) : null;
|
|
1493
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), cn(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 }));
|
|
1499
1494
|
return;
|
|
1500
1495
|
}
|
|
1501
|
-
if (
|
|
1496
|
+
if (H(r, "HTMLElement") && r.isContentEditable) {
|
|
1502
1497
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1503
1498
|
return;
|
|
1504
1499
|
}
|
|
1505
|
-
throw Error(`fill: element <${
|
|
1506
|
-
} },
|
|
1507
|
-
let n =
|
|
1508
|
-
if (!
|
|
1509
|
-
let r =
|
|
1500
|
+
throw Error(`fill: element <${Gt(r)}> is not fillable`);
|
|
1501
|
+
} }, dn = { resolve: (e, t = {}) => U(e.elements).textContent }, fn = { resolve: (e, t, n = {}) => U(e.elements).getAttribute(t) }, pn = { resolve: (e, t = {}) => {
|
|
1502
|
+
let n = U(e.elements);
|
|
1503
|
+
if (!H(n, "HTMLElement")) return !0;
|
|
1504
|
+
let r = V(n).getComputedStyle(n);
|
|
1510
1505
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1511
1506
|
let i = n.getBoundingClientRect();
|
|
1512
1507
|
return i.width > 0 && i.height > 0;
|
|
1513
|
-
} },
|
|
1508
|
+
} }, mn = { resolve: (e, t = {}) => e.elements.length }, hn = { resolve: (e, t = {}) => e.elements.length > 0 }, K = (e, t) => (e.topLevel ? [e.document] : e.elements).flatMap((e) => [...e.querySelectorAll(t)]), gn = (e) => e.replaceAll("\"", "\\\""), _n = {
|
|
1514
1509
|
to: "element",
|
|
1515
1510
|
css: !0,
|
|
1516
|
-
resolve: (e, t) =>
|
|
1511
|
+
resolve: (e, t) => K(e, t),
|
|
1517
1512
|
render: (e) => ({
|
|
1518
1513
|
fragment: typeof e == "string" ? e : "?",
|
|
1519
1514
|
separator: "descend"
|
|
1520
1515
|
})
|
|
1521
|
-
},
|
|
1516
|
+
}, vn = {
|
|
1522
1517
|
to: "frame",
|
|
1523
1518
|
css: !0,
|
|
1524
1519
|
barrier: "down",
|
|
1525
|
-
resolve: (e, t) =>
|
|
1520
|
+
resolve: (e, t) => K(e, t),
|
|
1526
1521
|
render: (e) => ({
|
|
1527
1522
|
fragment: typeof e == "string" ? e : "?",
|
|
1528
1523
|
separator: "down"
|
|
1529
1524
|
})
|
|
1530
|
-
},
|
|
1525
|
+
}, yn = {
|
|
1531
1526
|
element: {
|
|
1532
1527
|
selectors: {
|
|
1533
|
-
locator:
|
|
1534
|
-
frameLocator:
|
|
1528
|
+
locator: _n,
|
|
1529
|
+
frameLocator: vn,
|
|
1535
1530
|
getByRole: {
|
|
1536
1531
|
to: "element",
|
|
1537
|
-
resolve: (e, t) =>
|
|
1538
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1532
|
+
resolve: (e, t) => K(e, `[role="${CSS.escape(t)}"]`),
|
|
1533
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${gn(e)}"]` : "[role]" })
|
|
1539
1534
|
},
|
|
1540
1535
|
getByText: {
|
|
1541
1536
|
to: "element",
|
|
1542
1537
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1543
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1538
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${gn(e)}")` : ":has-text(...)" })
|
|
1544
1539
|
},
|
|
1545
1540
|
getByTestId: {
|
|
1546
1541
|
to: "element",
|
|
1547
|
-
resolve: (e, t) =>
|
|
1548
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1542
|
+
resolve: (e, t) => K(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1543
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${gn(e)}"]` : "[data-testid]" })
|
|
1549
1544
|
},
|
|
1550
1545
|
first: {
|
|
1551
1546
|
to: "element",
|
|
@@ -1562,20 +1557,20 @@ var kt = class {
|
|
|
1562
1557
|
}
|
|
1563
1558
|
},
|
|
1564
1559
|
operations: {
|
|
1565
|
-
click:
|
|
1566
|
-
fill:
|
|
1567
|
-
hover:
|
|
1568
|
-
textContent:
|
|
1569
|
-
getAttribute:
|
|
1570
|
-
isVisible:
|
|
1571
|
-
count:
|
|
1572
|
-
exists:
|
|
1560
|
+
click: on,
|
|
1561
|
+
fill: un,
|
|
1562
|
+
hover: sn,
|
|
1563
|
+
textContent: dn,
|
|
1564
|
+
getAttribute: fn,
|
|
1565
|
+
isVisible: pn,
|
|
1566
|
+
count: mn,
|
|
1567
|
+
exists: hn
|
|
1573
1568
|
}
|
|
1574
1569
|
},
|
|
1575
1570
|
frame: {
|
|
1576
1571
|
selectors: {
|
|
1577
|
-
locator:
|
|
1578
|
-
frameLocator:
|
|
1572
|
+
locator: _n,
|
|
1573
|
+
frameLocator: vn,
|
|
1579
1574
|
owner: {
|
|
1580
1575
|
to: "frame",
|
|
1581
1576
|
barrier: "up",
|
|
@@ -1589,11 +1584,11 @@ var kt = class {
|
|
|
1589
1584
|
}
|
|
1590
1585
|
},
|
|
1591
1586
|
operations: {
|
|
1592
|
-
addStyleTag:
|
|
1593
|
-
fetch:
|
|
1587
|
+
addStyleTag: nn,
|
|
1588
|
+
fetch: W
|
|
1594
1589
|
}
|
|
1595
1590
|
}
|
|
1596
|
-
},
|
|
1591
|
+
}, bn = (e, t = yn) => ({
|
|
1597
1592
|
element: {
|
|
1598
1593
|
selectors: {
|
|
1599
1594
|
...t.element.selectors,
|
|
@@ -1614,31 +1609,31 @@ var kt = class {
|
|
|
1614
1609
|
...e.frame?.operations
|
|
1615
1610
|
}
|
|
1616
1611
|
}
|
|
1617
|
-
}),
|
|
1612
|
+
}), xn = 3e4, Sn = 50, q = (e) => {
|
|
1618
1613
|
let t = e[e.length - 1];
|
|
1619
1614
|
return typeof t == "object" && t ? t : void 0;
|
|
1620
|
-
},
|
|
1621
|
-
let t =
|
|
1622
|
-
return typeof t == "number" ? t :
|
|
1623
|
-
},
|
|
1615
|
+
}, Cn = (e) => {
|
|
1616
|
+
let t = q(e)?.timeout;
|
|
1617
|
+
return typeof t == "number" ? t : xn;
|
|
1618
|
+
}, wn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), Tn = async (e) => {
|
|
1624
1619
|
let t = {
|
|
1625
1620
|
parts: e.parts,
|
|
1626
1621
|
operation: e.operation,
|
|
1627
1622
|
args: e.args,
|
|
1628
1623
|
phase: "ensure"
|
|
1629
1624
|
};
|
|
1630
|
-
await e.gate?.(t,
|
|
1631
|
-
},
|
|
1625
|
+
await e.gate?.(t, wn(e));
|
|
1626
|
+
}, En = (e, t) => {
|
|
1632
1627
|
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`);
|
|
1633
|
-
},
|
|
1628
|
+
}, Dn = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), On = async (e) => {
|
|
1634
1629
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1635
|
-
|
|
1630
|
+
En(i, q(a)?.timeout), n && await n({
|
|
1636
1631
|
parts: r,
|
|
1637
1632
|
operation: i,
|
|
1638
1633
|
args: a,
|
|
1639
1634
|
phase: "execute"
|
|
1640
|
-
},
|
|
1641
|
-
let o =
|
|
1635
|
+
}, wn(e));
|
|
1636
|
+
let o = Cn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1642
1637
|
l.catch(() => {});
|
|
1643
1638
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1644
1639
|
try {
|
|
@@ -1647,48 +1642,48 @@ var kt = class {
|
|
|
1647
1642
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1648
1643
|
} catch (e) {
|
|
1649
1644
|
if (e === c) break;
|
|
1650
|
-
if (
|
|
1645
|
+
if (Vt(e)) throw e;
|
|
1651
1646
|
f = e;
|
|
1652
1647
|
let t = s - Date.now();
|
|
1653
1648
|
if (t <= 0) break;
|
|
1654
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1649
|
+
await new Promise((e) => setTimeout(e, Math.min(Sn, t)));
|
|
1655
1650
|
}
|
|
1656
1651
|
while (Date.now() < s);
|
|
1657
1652
|
} finally {
|
|
1658
1653
|
clearTimeout(d);
|
|
1659
1654
|
}
|
|
1660
|
-
throw f === c ? new
|
|
1661
|
-
},
|
|
1655
|
+
throw f === c ? new B(c.message) : new B(Dn(f), { cause: f });
|
|
1656
|
+
}, kn = (e, t, n, r, i) => {
|
|
1662
1657
|
let a = {};
|
|
1663
|
-
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) =>
|
|
1658
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => kn(e, t, n, s.to, [...i, {
|
|
1664
1659
|
kind: r,
|
|
1665
1660
|
name: o,
|
|
1666
1661
|
args: a
|
|
1667
1662
|
}]);
|
|
1668
|
-
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) =>
|
|
1663
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => On({
|
|
1669
1664
|
...e,
|
|
1670
1665
|
parts: i,
|
|
1671
1666
|
operation: n,
|
|
1672
1667
|
args: o.send ? o.send(...t) : t
|
|
1673
1668
|
});
|
|
1674
|
-
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) =>
|
|
1669
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => kn(e, t, n, s, c(i, ...r));
|
|
1675
1670
|
return a.ensure = (n, a = {}) => {
|
|
1676
1671
|
let o = t[r].operations[n]?.ensureArgs;
|
|
1677
|
-
return
|
|
1672
|
+
return Tn({
|
|
1678
1673
|
...e,
|
|
1679
1674
|
parts: i,
|
|
1680
1675
|
operation: n,
|
|
1681
1676
|
args: o?.(a) ?? [a]
|
|
1682
1677
|
});
|
|
1683
1678
|
}, a;
|
|
1684
|
-
},
|
|
1679
|
+
}, An = (e) => kn(e, e.modules ?? yn, e.rewrites ?? {}, "frame", []), jn = () => {
|
|
1685
1680
|
let e = T();
|
|
1686
1681
|
return e.status === "ok" && e.abi >= 2;
|
|
1687
|
-
},
|
|
1682
|
+
}, Mn = async () => {
|
|
1688
1683
|
await E();
|
|
1689
1684
|
let e = T();
|
|
1690
1685
|
if (e.status === "ok" && e.abi < 2) throw new C(e.abi, 2);
|
|
1691
|
-
},
|
|
1686
|
+
}, Nn = (e) => `Read the text, links and details ${e} shows.`, Pn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, Fn = [
|
|
1692
1687
|
{
|
|
1693
1688
|
id: "interaction",
|
|
1694
1689
|
heading: "Interaction",
|
|
@@ -1703,9 +1698,9 @@ var kt = class {
|
|
|
1703
1698
|
heading: "Site data",
|
|
1704
1699
|
summary: "Can read the website's data",
|
|
1705
1700
|
title: (e) => `Read data from ${e}`,
|
|
1706
|
-
description:
|
|
1701
|
+
description: Nn,
|
|
1707
1702
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1708
|
-
cloudDescription:
|
|
1703
|
+
cloudDescription: Nn
|
|
1709
1704
|
},
|
|
1710
1705
|
{
|
|
1711
1706
|
id: "network",
|
|
@@ -1721,11 +1716,11 @@ var kt = class {
|
|
|
1721
1716
|
heading: "Evaluation",
|
|
1722
1717
|
summary: "Can execute arbitrary code on the website",
|
|
1723
1718
|
title: (e) => `Run code on ${e}`,
|
|
1724
|
-
description:
|
|
1719
|
+
description: Pn,
|
|
1725
1720
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1726
|
-
cloudDescription:
|
|
1721
|
+
cloudDescription: Pn
|
|
1727
1722
|
}
|
|
1728
|
-
],
|
|
1723
|
+
], In = (e) => (t) => {
|
|
1729
1724
|
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1730
1725
|
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`);
|
|
1731
1726
|
let { relativePosition: n, ...r } = t;
|
|
@@ -1733,46 +1728,46 @@ var kt = class {
|
|
|
1733
1728
|
...r,
|
|
1734
1729
|
position: n
|
|
1735
1730
|
}];
|
|
1736
|
-
},
|
|
1731
|
+
}, Ln = async (e, t, n) => {
|
|
1737
1732
|
try {
|
|
1738
|
-
return await
|
|
1733
|
+
return await W.resolve(e, t, n);
|
|
1739
1734
|
} catch (e) {
|
|
1740
|
-
throw
|
|
1735
|
+
throw Vt(e) ? e : z(`frame.fetch: ${e instanceof Error ? `${e.name}: ${e.message}` : String(e)}; not retried, since the request may already have been sent`, "fetch");
|
|
1741
1736
|
}
|
|
1742
|
-
},
|
|
1737
|
+
}, Rn = bn({
|
|
1743
1738
|
element: { operations: {
|
|
1744
1739
|
click: {
|
|
1745
|
-
resolve: (e, t = {}) =>
|
|
1746
|
-
send:
|
|
1740
|
+
resolve: (e, t = {}) => G.click.resolve(e, t),
|
|
1741
|
+
send: In("click")
|
|
1747
1742
|
},
|
|
1748
1743
|
hover: {
|
|
1749
|
-
resolve: (e, t = {}) =>
|
|
1750
|
-
send:
|
|
1744
|
+
resolve: (e, t = {}) => G.hover.resolve(e, t),
|
|
1745
|
+
send: In("hover")
|
|
1751
1746
|
},
|
|
1752
|
-
fill: { resolve: (e, t, n = {}) =>
|
|
1753
|
-
textContent: { resolve: (e, t = {}) =>
|
|
1754
|
-
getAttribute: { resolve: (e, t, n = {}) =>
|
|
1755
|
-
isVisible: { resolve: (e, t = {}) =>
|
|
1756
|
-
count: { resolve: (e, t = {}) =>
|
|
1757
|
-
exists: { resolve: (e, t = {}) =>
|
|
1758
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1747
|
+
fill: { resolve: (e, t, n = {}) => G.fill.resolve(e, t, n) },
|
|
1748
|
+
textContent: { resolve: (e, t = {}) => G.textContent.resolve(e) },
|
|
1749
|
+
getAttribute: { resolve: (e, t, n = {}) => G.getAttribute.resolve(e, t) },
|
|
1750
|
+
isVisible: { resolve: (e, t = {}) => G.isVisible.resolve(e) },
|
|
1751
|
+
count: { resolve: (e, t = {}) => G.count.resolve(e) },
|
|
1752
|
+
exists: { resolve: (e, t = {}) => G.exists.resolve(e) },
|
|
1753
|
+
videoElement: { resolve: (e, t = {}) => S(Wt(U(e.elements), "HTMLVideoElement")) }
|
|
1759
1754
|
} },
|
|
1760
1755
|
frame: { operations: {
|
|
1761
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1756
|
+
addStyleTag: { resolve: (e, t) => nn.resolve(e, t) },
|
|
1762
1757
|
fetch: {
|
|
1763
|
-
resolve: (e, t, n = {}) =>
|
|
1764
|
-
kind:
|
|
1765
|
-
ensureArgs:
|
|
1758
|
+
resolve: (e, t, n = {}) => Ln(e, t, n),
|
|
1759
|
+
kind: W.kind,
|
|
1760
|
+
ensureArgs: W.ensureArgs
|
|
1766
1761
|
},
|
|
1767
1762
|
evaluate: {
|
|
1768
1763
|
kind: "frame",
|
|
1769
1764
|
typed: !1,
|
|
1770
1765
|
resolve: (e, t, n) => {
|
|
1771
|
-
throw
|
|
1766
|
+
throw It("evaluate", "this realm");
|
|
1772
1767
|
}
|
|
1773
1768
|
}
|
|
1774
1769
|
} }
|
|
1775
|
-
}),
|
|
1770
|
+
}), zn = (e) => e[e.length - 1], Bn = {
|
|
1776
1771
|
element: {
|
|
1777
1772
|
last: {
|
|
1778
1773
|
to: "element",
|
|
@@ -1785,7 +1780,7 @@ var kt = class {
|
|
|
1785
1780
|
contentFrame: {
|
|
1786
1781
|
to: "frame",
|
|
1787
1782
|
rewrite: (e) => {
|
|
1788
|
-
let t =
|
|
1783
|
+
let t = zn(e);
|
|
1789
1784
|
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1790
1785
|
return [...e.slice(0, -1), {
|
|
1791
1786
|
...t,
|
|
@@ -1798,7 +1793,7 @@ var kt = class {
|
|
|
1798
1793
|
owner: {
|
|
1799
1794
|
to: "element",
|
|
1800
1795
|
rewrite: (e) => {
|
|
1801
|
-
let t =
|
|
1796
|
+
let t = zn(e);
|
|
1802
1797
|
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1803
1798
|
return [...e.slice(0, -1), {
|
|
1804
1799
|
...t,
|
|
@@ -1815,7 +1810,7 @@ var kt = class {
|
|
|
1815
1810
|
}]
|
|
1816
1811
|
}
|
|
1817
1812
|
}
|
|
1818
|
-
},
|
|
1813
|
+
}, Vn = (e) => {
|
|
1819
1814
|
if (!e || e === "about:blank") return !1;
|
|
1820
1815
|
let t;
|
|
1821
1816
|
try {
|
|
@@ -1824,45 +1819,45 @@ var kt = class {
|
|
|
1824
1819
|
return !1;
|
|
1825
1820
|
}
|
|
1826
1821
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && k(t.hostname);
|
|
1827
|
-
},
|
|
1828
|
-
if (
|
|
1829
|
-
},
|
|
1822
|
+
}, J = (e) => {
|
|
1823
|
+
if (Vn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1824
|
+
}, Hn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1830
1825
|
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");
|
|
1831
|
-
},
|
|
1826
|
+
}, Un = {
|
|
1832
1827
|
scope: "embed.iframe",
|
|
1833
1828
|
category: "interaction",
|
|
1834
1829
|
severity: 0,
|
|
1835
1830
|
title: "Load another website inside this app",
|
|
1836
1831
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1837
|
-
},
|
|
1832
|
+
}, Wn = {
|
|
1838
1833
|
scope: "embed.open",
|
|
1839
1834
|
category: "interaction",
|
|
1840
1835
|
severity: 0,
|
|
1841
1836
|
title: "Open a website inside this app",
|
|
1842
1837
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1843
|
-
},
|
|
1838
|
+
}, Gn = ["load", "commit"], Kn = (e) => {
|
|
1844
1839
|
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1845
1840
|
let { waitUntil: t, timeout: n } = e;
|
|
1846
|
-
if (t !== void 0 && !
|
|
1841
|
+
if (t !== void 0 && !Gn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1847
1842
|
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1848
|
-
|
|
1849
|
-
},
|
|
1843
|
+
En("frame.goto", n);
|
|
1844
|
+
}, qn = class extends Error {
|
|
1850
1845
|
name = "FrameWindowBlockedError";
|
|
1851
1846
|
constructor() {
|
|
1852
1847
|
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1853
1848
|
}
|
|
1854
|
-
},
|
|
1849
|
+
}, Jn = /* @__PURE__ */ new Set([
|
|
1855
1850
|
"jar-unreachable",
|
|
1856
1851
|
"bad-url",
|
|
1857
1852
|
"opaque-opener"
|
|
1858
|
-
]),
|
|
1853
|
+
]), Yn = class extends Error {
|
|
1859
1854
|
name = "FrameWindowRefusedError";
|
|
1860
1855
|
reason;
|
|
1861
1856
|
constructor(e) {
|
|
1862
|
-
let t =
|
|
1857
|
+
let t = Jn.has(e) ? e : "unknown";
|
|
1863
1858
|
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;
|
|
1864
1859
|
}
|
|
1865
|
-
},
|
|
1860
|
+
}, Xn = ["message", "document"], Zn = (e) => {
|
|
1866
1861
|
if (e === "*") return "*";
|
|
1867
1862
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1868
1863
|
if (typeof e != "string") throw t();
|
|
@@ -1874,48 +1869,48 @@ var kt = class {
|
|
|
1874
1869
|
}
|
|
1875
1870
|
if (n === "null") throw t();
|
|
1876
1871
|
return n;
|
|
1877
|
-
},
|
|
1872
|
+
}, Qn = (e, t) => {
|
|
1878
1873
|
let n = typeof e == "object" && !!e;
|
|
1879
1874
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1880
1875
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1881
1876
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1882
1877
|
return {
|
|
1883
|
-
targetOrigin:
|
|
1878
|
+
targetOrigin: Zn(r),
|
|
1884
1879
|
transfer: i === void 0 ? [] : [...i]
|
|
1885
1880
|
};
|
|
1886
|
-
},
|
|
1881
|
+
}, $n = [
|
|
1887
1882
|
"url",
|
|
1888
1883
|
"path",
|
|
1889
1884
|
"type"
|
|
1890
|
-
],
|
|
1885
|
+
], er = ["content", "sourceUrl"], tr = /[\n\r\u2028\u2029]/, nr = (e) => {
|
|
1891
1886
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
|
|
1892
|
-
let t = Object.keys(e), n = t.find((e) =>
|
|
1887
|
+
let t = Object.keys(e), n = t.find((e) => $n.includes(e));
|
|
1893
1888
|
if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
|
|
1894
|
-
let r = t.find((e) => !
|
|
1889
|
+
let r = t.find((e) => !er.includes(e));
|
|
1895
1890
|
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1896
1891
|
let { content: i, sourceUrl: a } = e;
|
|
1897
1892
|
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1898
|
-
if (a !== void 0 && (typeof a != "string" || a === "" ||
|
|
1893
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || tr.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1899
1894
|
return a === void 0 ? { content: i } : {
|
|
1900
1895
|
content: i,
|
|
1901
1896
|
sourceUrl: a
|
|
1902
1897
|
};
|
|
1903
|
-
},
|
|
1898
|
+
}, rr = [
|
|
1904
1899
|
"name",
|
|
1905
1900
|
"domain",
|
|
1906
1901
|
"path"
|
|
1907
|
-
],
|
|
1902
|
+
], ir = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", ar = (e) => {
|
|
1908
1903
|
if (e === void 0) return {};
|
|
1909
1904
|
if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
|
|
1910
|
-
let t = e, n = Object.keys(t).find((e) => !
|
|
1905
|
+
let t = e, n = Object.keys(t).find((e) => !rr.includes(e));
|
|
1911
1906
|
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1912
|
-
let r =
|
|
1907
|
+
let r = rr.flatMap((e) => {
|
|
1913
1908
|
let n = t[e];
|
|
1914
1909
|
return n === void 0 ? [] : [{
|
|
1915
1910
|
key: e,
|
|
1916
1911
|
value: n
|
|
1917
1912
|
}];
|
|
1918
|
-
}), i = r.find(({ value: e }) =>
|
|
1913
|
+
}), i = r.find(({ value: e }) => ir(e));
|
|
1919
1914
|
if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
|
|
1920
1915
|
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1921
1916
|
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
@@ -1924,17 +1919,17 @@ var kt = class {
|
|
|
1924
1919
|
let s = {};
|
|
1925
1920
|
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1926
1921
|
return s;
|
|
1927
|
-
},
|
|
1922
|
+
}, or = (e) => {
|
|
1928
1923
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1929
|
-
},
|
|
1930
|
-
let { owner: t, ...n } =
|
|
1924
|
+
}, sr = (e) => {
|
|
1925
|
+
let { owner: t, ...n } = An({
|
|
1931
1926
|
executor: e.executor,
|
|
1932
|
-
modules:
|
|
1933
|
-
rewrites:
|
|
1927
|
+
modules: Rn,
|
|
1928
|
+
rewrites: Bn,
|
|
1934
1929
|
gate: async (t, n) => {
|
|
1935
|
-
A(t.operation,
|
|
1930
|
+
A(t.operation, q(t.args)?.reason), await e.gate?.(t, n);
|
|
1936
1931
|
}
|
|
1937
|
-
}), r = async (t, n = {}) => (
|
|
1932
|
+
}), r = async (t, n = {}) => (J(t), Kn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1938
1933
|
for (let e of t) A("frame.requestPermissions", e?.reason);
|
|
1939
1934
|
let n = e.requestPermissions;
|
|
1940
1935
|
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
@@ -1946,18 +1941,18 @@ var kt = class {
|
|
|
1946
1941
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1947
1942
|
return r(i, structuredClone(n));
|
|
1948
1943
|
}, s = async (t) => {
|
|
1949
|
-
let { content: n, ...r } =
|
|
1944
|
+
let { content: n, ...r } = nr(t), i = e.addScriptTag;
|
|
1950
1945
|
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1951
1946
|
await i(n, r);
|
|
1952
1947
|
}, c = async (t) => {
|
|
1953
|
-
let n =
|
|
1948
|
+
let n = ar(t), r = e.clearCookies;
|
|
1954
1949
|
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1955
1950
|
await r(n);
|
|
1956
1951
|
}, l = ((t, n, r) => {
|
|
1957
1952
|
try {
|
|
1958
1953
|
let i = e.postMessage;
|
|
1959
1954
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1960
|
-
let a =
|
|
1955
|
+
let a = Qn(n, r);
|
|
1961
1956
|
return i(t, a.targetOrigin, a.transfer);
|
|
1962
1957
|
} catch (e) {
|
|
1963
1958
|
return Promise.reject(e);
|
|
@@ -1966,7 +1961,7 @@ var kt = class {
|
|
|
1966
1961
|
message: /* @__PURE__ */ new Set(),
|
|
1967
1962
|
document: /* @__PURE__ */ new Set()
|
|
1968
1963
|
}, d = null, f = (e, t) => {
|
|
1969
|
-
if (!
|
|
1964
|
+
if (!Xn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${Xn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1970
1965
|
return u[e];
|
|
1971
1966
|
}, p = (e) => {
|
|
1972
1967
|
let t = e.type === "message" ? Object.freeze({
|
|
@@ -1982,7 +1977,7 @@ var kt = class {
|
|
|
1982
1977
|
for (let n of [...u[e.type]]) try {
|
|
1983
1978
|
n(t);
|
|
1984
1979
|
} catch (e) {
|
|
1985
|
-
|
|
1980
|
+
or(e);
|
|
1986
1981
|
}
|
|
1987
1982
|
}, m = (e, t) => {
|
|
1988
1983
|
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
@@ -2015,7 +2010,7 @@ var kt = class {
|
|
|
2015
2010
|
off: m
|
|
2016
2011
|
};
|
|
2017
2012
|
return _;
|
|
2018
|
-
},
|
|
2013
|
+
}, cr = [
|
|
2019
2014
|
h,
|
|
2020
2015
|
t,
|
|
2021
2016
|
g,
|
|
@@ -2029,43 +2024,43 @@ var kt = class {
|
|
|
2029
2024
|
l,
|
|
2030
2025
|
f,
|
|
2031
2026
|
u,
|
|
2032
|
-
|
|
2033
|
-
|
|
2027
|
+
Un,
|
|
2028
|
+
Wn,
|
|
2034
2029
|
m,
|
|
2035
2030
|
r,
|
|
2031
|
+
rt,
|
|
2036
2032
|
it,
|
|
2037
2033
|
at,
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
], dr = Ln.map((e) => e.id), fr = {
|
|
2034
|
+
vt,
|
|
2035
|
+
bt
|
|
2036
|
+
], lr = Fn.map((e) => e.id), ur = {
|
|
2042
2037
|
interaction: "act.click",
|
|
2043
2038
|
storage: "read.text",
|
|
2044
2039
|
network: "network.fetchCredentialed",
|
|
2045
2040
|
evaluation: "media.appearU"
|
|
2046
|
-
},
|
|
2041
|
+
}, dr = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", fr = cr, Y = /* @__PURE__ */ new Map(), pr = {};
|
|
2047
2042
|
(() => {
|
|
2048
|
-
|
|
2049
|
-
let e = (e) =>
|
|
2050
|
-
Object.fromEntries(
|
|
2043
|
+
Y = new Map(fr.map((e) => [e.scope, e])), pr = Object.fromEntries(Y), fr.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
2044
|
+
let e = (e) => fr.filter((t) => t.category === e && dr(t.severity) === "bundled");
|
|
2045
|
+
Object.fromEntries(lr.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(lr.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
2051
2046
|
})();
|
|
2052
|
-
var
|
|
2053
|
-
let t =
|
|
2054
|
-
return t &&
|
|
2055
|
-
},
|
|
2056
|
-
let t =
|
|
2057
|
-
if (t) return
|
|
2058
|
-
},
|
|
2059
|
-
let n = t ?? (e &&
|
|
2060
|
-
return n !== void 0 &&
|
|
2061
|
-
},
|
|
2062
|
-
for (let { category: n, key: r } of t) if (
|
|
2047
|
+
var mr = (e) => Y.get(e)?.category, hr = (e) => {
|
|
2048
|
+
let t = Y.get(e);
|
|
2049
|
+
return t && dr(t.severity);
|
|
2050
|
+
}, gr = (e) => {
|
|
2051
|
+
let t = Y.get(e);
|
|
2052
|
+
if (t) return dr(t.severity) === "critical" ? t.scope : t.category;
|
|
2053
|
+
}, _r = (e) => ur[e], vr = ({ category: e, key: t }) => {
|
|
2054
|
+
let n = t ?? (e && _r(e));
|
|
2055
|
+
return n !== void 0 && mr(n) !== void 0 ? n : void 0;
|
|
2056
|
+
}, yr = (e, t) => {
|
|
2057
|
+
for (let { category: n, key: r } of t) if (vr({
|
|
2063
2058
|
category: n,
|
|
2064
2059
|
key: r
|
|
2065
2060
|
}) === 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}"`);
|
|
2066
|
-
},
|
|
2061
|
+
}, br = (e, t = {}) => {
|
|
2067
2062
|
let n = [], r = e.map((e) => {
|
|
2068
|
-
let r =
|
|
2063
|
+
let r = vr(e), i = [];
|
|
2069
2064
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
2070
2065
|
...t,
|
|
2071
2066
|
key: r,
|
|
@@ -2075,8 +2070,8 @@ var gr = (e) => J.get(e)?.category, _r = (e) => {
|
|
|
2075
2070
|
reason: e.reason
|
|
2076
2071
|
});
|
|
2077
2072
|
return {
|
|
2078
|
-
key: r !== void 0 &&
|
|
2079
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
2073
|
+
key: r !== void 0 && hr(r) === "critical" ? r : void 0,
|
|
2074
|
+
category: r === void 0 ? e.category ?? "interaction" : pr[r].category,
|
|
2080
2075
|
hosts: e.hosts,
|
|
2081
2076
|
indexes: i
|
|
2082
2077
|
};
|
|
@@ -2090,31 +2085,31 @@ var gr = (e) => J.get(e)?.category, _r = (e) => {
|
|
|
2090
2085
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
2091
2086
|
}))
|
|
2092
2087
|
};
|
|
2093
|
-
},
|
|
2094
|
-
typeof window < "u" &&
|
|
2095
|
-
if (!
|
|
2088
|
+
}, xr = (e) => typeof e == "object" && !!e, Sr = typeof chrome < "u" && !!chrome.runtime?.id, Cr = (e) => xr(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", wr = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), Dr = /* @__PURE__ */ new Set();
|
|
2089
|
+
typeof window < "u" && Sr && window.addEventListener("message", (e) => {
|
|
2090
|
+
if (!Cr(e.data)) return;
|
|
2096
2091
|
e.stopImmediatePropagation();
|
|
2097
2092
|
let t = e.source;
|
|
2098
2093
|
if (!t || typeof t != "object") return;
|
|
2099
|
-
let n = t, r =
|
|
2100
|
-
if (
|
|
2101
|
-
let o =
|
|
2094
|
+
let n = t, r = wr.get(n), i = e.data.frameId, a = e.data.document;
|
|
2095
|
+
if (wr.set(n, i), Tr.set(n, a), r) for (let e of Dr) e(r);
|
|
2096
|
+
let o = Er.get(n);
|
|
2102
2097
|
if (o) {
|
|
2103
2098
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
2104
|
-
o.size ||
|
|
2099
|
+
o.size || Er.delete(n);
|
|
2105
2100
|
}
|
|
2106
2101
|
}, { capture: !0 });
|
|
2107
2102
|
//#endregion
|
|
2108
2103
|
//#region ../web-extension/lib/lib/evaluate-deadline.js
|
|
2109
|
-
var
|
|
2104
|
+
var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar = () => new B(kr), jr = (e) => Bt(e) && e.message === kr ? Ar() : e, Mr = [
|
|
2110
2105
|
/^frame load timed out after \d+ms for /,
|
|
2111
2106
|
/^frame goto: documentstart timed out$/,
|
|
2112
2107
|
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2113
|
-
],
|
|
2114
|
-
if (e instanceof
|
|
2108
|
+
], Nr = (e) => {
|
|
2109
|
+
if (e instanceof B) return e;
|
|
2115
2110
|
let t = typeof e?.message == "string" ? e.message : "";
|
|
2116
|
-
return
|
|
2117
|
-
},
|
|
2111
|
+
return Mr.some((e) => e.test(t)) ? new B(t) : e;
|
|
2112
|
+
}, Pr = (e) => {
|
|
2118
2113
|
let t = e;
|
|
2119
2114
|
if (t.window === void 0) return "iframe";
|
|
2120
2115
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
@@ -2122,11 +2117,11 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2122
2117
|
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
2123
2118
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
2124
2119
|
return "window";
|
|
2125
|
-
},
|
|
2120
|
+
}, Fr = (e, t, n) => {
|
|
2126
2121
|
if (e === void 0) return t;
|
|
2127
2122
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
2128
2123
|
return Math.round(e);
|
|
2129
|
-
},
|
|
2124
|
+
}, Ir = ({ url: e, width: t, height: n }) => {
|
|
2130
2125
|
let r = (() => {
|
|
2131
2126
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
2132
2127
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -2140,12 +2135,12 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2140
2135
|
if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
|
|
2141
2136
|
return t.href;
|
|
2142
2137
|
})();
|
|
2143
|
-
return r &&
|
|
2138
|
+
return r && J(r), {
|
|
2144
2139
|
url: r,
|
|
2145
|
-
width:
|
|
2146
|
-
height:
|
|
2140
|
+
width: Fr(t, 500, "width"),
|
|
2141
|
+
height: Fr(n, 700, "height")
|
|
2147
2142
|
};
|
|
2148
|
-
},
|
|
2143
|
+
}, Lr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Rr = 1e11, zr = [
|
|
2149
2144
|
"name",
|
|
2150
2145
|
"value",
|
|
2151
2146
|
"domain",
|
|
@@ -2154,11 +2149,11 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2154
2149
|
"httpOnly",
|
|
2155
2150
|
"secure",
|
|
2156
2151
|
"sameSite"
|
|
2157
|
-
],
|
|
2152
|
+
], Br = [
|
|
2158
2153
|
"Strict",
|
|
2159
2154
|
"Lax",
|
|
2160
2155
|
"None"
|
|
2161
|
-
],
|
|
2156
|
+
], Vr = /[;\x00-\x1f\x7f]/, X = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Z = (e) => Object.prototype.toString.call(e) === "[object Object]", Hr = (e) => {
|
|
2162
2157
|
let t = e.startsWith(".") ? e.slice(1) : e;
|
|
2163
2158
|
if (t === "") return null;
|
|
2164
2159
|
try {
|
|
@@ -2166,19 +2161,19 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2166
2161
|
} catch {
|
|
2167
2162
|
return null;
|
|
2168
2163
|
}
|
|
2169
|
-
},
|
|
2164
|
+
}, Ur = (e, t) => {
|
|
2170
2165
|
if (!Z(e)) throw X(t, "must be an object");
|
|
2171
|
-
let n = Object.keys(e).find((e) => !
|
|
2166
|
+
let n = Object.keys(e).find((e) => !zr.includes(e));
|
|
2172
2167
|
if (n !== void 0) throw X(`${t}.${n}`, "is not a cookie field");
|
|
2173
2168
|
let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
|
|
2174
|
-
if (typeof r != "string" || r === "" || r.includes("=") ||
|
|
2175
|
-
if (typeof i != "string" ||
|
|
2176
|
-
if (typeof a != "string" ||
|
|
2177
|
-
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") ||
|
|
2169
|
+
if (typeof r != "string" || r === "" || r.includes("=") || Vr.test(r)) throw X(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
|
|
2170
|
+
if (typeof i != "string" || Vr.test(i)) throw X(`${t}.value`, "must be a string with no \";\" or control character");
|
|
2171
|
+
if (typeof a != "string" || Hr(a) === null) throw X(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
|
|
2172
|
+
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || Vr.test(o))) throw X(`${t}.path`, "must be a string starting with \"/\"");
|
|
2178
2173
|
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw X(`${t}.expires`, "must be -1 for a session cookie, or milliseconds since the epoch");
|
|
2179
2174
|
if (c !== void 0 && typeof c != "boolean") throw X(`${t}.httpOnly`, "must be a boolean");
|
|
2180
2175
|
if (l !== void 0 && typeof l != "boolean") throw X(`${t}.secure`, "must be a boolean");
|
|
2181
|
-
if (u !== void 0 && !
|
|
2176
|
+
if (u !== void 0 && !Br.includes(u)) throw X(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
|
|
2182
2177
|
let d = r.toLowerCase();
|
|
2183
2178
|
if (u === "None" && l !== !0) throw X(t, "is SameSite=None, which needs secure: true");
|
|
2184
2179
|
if (d.startsWith("__secure-") && l !== !0) throw X(t, "is a __Secure- cookie, which needs secure: true");
|
|
@@ -2189,7 +2184,7 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2189
2184
|
domain: a
|
|
2190
2185
|
};
|
|
2191
2186
|
return o !== void 0 && (f.path = o), s !== void 0 && (f.expires = s), c !== void 0 && (f.httpOnly = c), l !== void 0 && (f.secure = l), u !== void 0 && (f.sameSite = u), f;
|
|
2192
|
-
},
|
|
2187
|
+
}, Wr = (e, t) => {
|
|
2193
2188
|
if (!Z(e)) throw X(t, "must be an object { origin, localStorage }");
|
|
2194
2189
|
let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
|
|
2195
2190
|
if (n !== void 0) throw X(`${t}.${n}`, "is not an origin field");
|
|
@@ -2213,30 +2208,30 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2213
2208
|
};
|
|
2214
2209
|
})
|
|
2215
2210
|
};
|
|
2216
|
-
},
|
|
2211
|
+
}, Gr = (e) => {
|
|
2217
2212
|
if (!Z(e)) throw X("", "must be an object { cookies?, origins? }");
|
|
2218
2213
|
let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
|
|
2219
2214
|
if (t !== void 0) throw X(`.${t}`, "is not a storageState key; it takes cookies and origins");
|
|
2220
2215
|
let { cookies: n = [], origins: r = [] } = e;
|
|
2221
2216
|
if (!Array.isArray(n)) throw X(".cookies", "must be an array");
|
|
2222
2217
|
if (!Array.isArray(r)) throw X(".origins", "must be an array");
|
|
2223
|
-
let i = n.map((e, t) =>
|
|
2218
|
+
let i = n.map((e, t) => Ur(e, `.cookies[${t}]`)), a = r.map((e, t) => Wr(e, `.origins[${t}]`));
|
|
2224
2219
|
return i.forEach(({ expires: e }, t) => {
|
|
2225
|
-
if (e !== void 0 && e > 0 && e <
|
|
2220
|
+
if (e !== void 0 && e > 0 && e < Rr) throw X(`.cookies[${t}].expires`, `is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`);
|
|
2226
2221
|
}), {
|
|
2227
2222
|
cookies: i,
|
|
2228
2223
|
origins: a
|
|
2229
2224
|
};
|
|
2230
|
-
},
|
|
2225
|
+
}, Kr = [
|
|
2231
2226
|
"persistent",
|
|
2232
2227
|
"ephemeral",
|
|
2233
2228
|
"native"
|
|
2234
|
-
],
|
|
2235
|
-
if ("syncCookies" in e) throw TypeError(
|
|
2229
|
+
], qr = "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'", Jr = (e) => {
|
|
2230
|
+
if ("syncCookies" in e) throw TypeError(qr);
|
|
2236
2231
|
let { cookies: t = "persistent" } = e;
|
|
2237
|
-
if (!
|
|
2238
|
-
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(
|
|
2239
|
-
let n = e.storageState === void 0 ? void 0 :
|
|
2232
|
+
if (!Kr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2233
|
+
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(Lr);
|
|
2234
|
+
let n = e.storageState === void 0 ? void 0 : Gr(e.storageState), r = Pr(e);
|
|
2240
2235
|
if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2241
2236
|
if (Array.isArray(e.permissions)) for (let t of e.permissions) A("attachFrame", t?.reason);
|
|
2242
2237
|
return n === void 0 ? {
|
|
@@ -2247,9 +2242,9 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2247
2242
|
cookies: t,
|
|
2248
2243
|
storageState: n
|
|
2249
2244
|
};
|
|
2250
|
-
},
|
|
2251
|
-
|
|
2252
|
-
},
|
|
2245
|
+
}, Yr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Xr = !1, Zr = () => {
|
|
2246
|
+
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."));
|
|
2247
|
+
}, Qr = "frame: this frame no longer holds the document the app attached it to", $r = "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", ei = () => {
|
|
2253
2248
|
let e = T();
|
|
2254
2249
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
2255
2250
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
@@ -2263,16 +2258,16 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2263
2258
|
}, $ = () => {
|
|
2264
2259
|
let e = T();
|
|
2265
2260
|
return e.status === "absent" ? 0 : e.abi;
|
|
2266
|
-
},
|
|
2267
|
-
let f = new Set(p(o, { ipv6: !0 })), m = (e) => f.has(p([
|
|
2268
|
-
return
|
|
2261
|
+
}, ti = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", ni = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", ri = "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", ii = ({ executeLocator: e, highlightLocator: t, ensureLocatorPermission: n, requestCategories: r, evaluateFrame: i, goto: a }, { hosts: o, url: s, page: c, unreachable: l, documents: u, navigated: d }) => {
|
|
2262
|
+
let f = new Set(p(o, { ipv6: !0 })), m = (e) => f.has(p([_t(e)], { ipv6: !0 })[0] ?? "");
|
|
2263
|
+
return sr({
|
|
2269
2264
|
backend: "extension",
|
|
2270
2265
|
executor: {
|
|
2271
2266
|
execute: e,
|
|
2272
2267
|
highlight: t
|
|
2273
2268
|
},
|
|
2274
2269
|
gate: (e) => n(e.parts, e.operation, e.args),
|
|
2275
|
-
requestPermissions: async (e) => (
|
|
2270
|
+
requestPermissions: async (e) => (yr("frame.requestPermissions", e), await Mn(), r(e)),
|
|
2276
2271
|
evaluate: async (e, t) => {
|
|
2277
2272
|
if (!ze(T(), "evaluate")) {
|
|
2278
2273
|
let e = T();
|
|
@@ -2282,25 +2277,25 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2282
2277
|
source: e,
|
|
2283
2278
|
arg: t
|
|
2284
2279
|
}).catch((e) => {
|
|
2285
|
-
throw
|
|
2280
|
+
throw jr(e);
|
|
2286
2281
|
});
|
|
2287
2282
|
},
|
|
2288
2283
|
addScriptTag: async () => {
|
|
2289
|
-
throw new w("addScriptTag", $(),
|
|
2284
|
+
throw new w("addScriptTag", $(), ni);
|
|
2290
2285
|
},
|
|
2291
2286
|
clearCookies: async () => {
|
|
2292
|
-
throw new w("clearCookies", $(),
|
|
2287
|
+
throw new w("clearCookies", $(), ri);
|
|
2293
2288
|
},
|
|
2294
2289
|
postMessage: (e, t, n) => {
|
|
2295
|
-
if (t === "*") throw
|
|
2296
|
-
if (!m(t)) throw
|
|
2290
|
+
if (t === "*") throw R($r, "postMessage", "extension");
|
|
2291
|
+
if (!m(t)) throw z(Qr, "postMessage");
|
|
2297
2292
|
let r = l();
|
|
2298
2293
|
if (r) throw r;
|
|
2299
2294
|
return c().postMessage(e, t, n), Promise.resolve();
|
|
2300
2295
|
},
|
|
2301
2296
|
listen: (e) => {
|
|
2302
2297
|
let t = (t) => {
|
|
2303
|
-
t.source !== null && t.source === c() && !
|
|
2298
|
+
t.source !== null && t.source === c() && !Cr(t.data) && m(t.origin) && e({
|
|
2304
2299
|
type: "message",
|
|
2305
2300
|
data: t.data,
|
|
2306
2301
|
origin: t.origin,
|
|
@@ -2325,21 +2320,21 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2325
2320
|
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2326
2321
|
...n === void 0 ? {} : { timeoutMs: n }
|
|
2327
2322
|
}).catch((e) => {
|
|
2328
|
-
throw
|
|
2323
|
+
throw Nr(e);
|
|
2329
2324
|
});
|
|
2330
2325
|
},
|
|
2331
2326
|
url: s
|
|
2332
2327
|
});
|
|
2333
|
-
},
|
|
2334
|
-
if (i !== void 0) throw new w("blank", $(),
|
|
2328
|
+
}, ai = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2329
|
+
if (i !== void 0) throw new w("blank", $(), ti);
|
|
2335
2330
|
let a = crypto.randomUUID();
|
|
2336
|
-
if (
|
|
2331
|
+
if (J(e.src), Hn({
|
|
2337
2332
|
src: e.src,
|
|
2338
2333
|
domains: t,
|
|
2339
2334
|
lockdown: n
|
|
2340
|
-
}), j("attachFrame", t), await E(), n &&
|
|
2341
|
-
e.dispatchEvent(new CustomEvent(
|
|
2342
|
-
let o =
|
|
2335
|
+
}), j("attachFrame", t), await E(), n && ei(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2336
|
+
e.dispatchEvent(new CustomEvent(Yr, { detail: a }));
|
|
2337
|
+
let o = ii(await D.attachFrame({
|
|
2343
2338
|
marker: a,
|
|
2344
2339
|
domains: t,
|
|
2345
2340
|
syncCookies: !0,
|
|
@@ -2348,17 +2343,17 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2348
2343
|
hosts: [...t, Q(e.src)],
|
|
2349
2344
|
url: () => e.src,
|
|
2350
2345
|
page: () => e.contentWindow,
|
|
2351
|
-
unreachable: () => e.contentWindow === null ?
|
|
2346
|
+
unreachable: () => e.contentWindow === null ? z("frame: navigate the frame before postMessage", "postMessage") : void 0,
|
|
2352
2347
|
documents: (t) => (e.addEventListener("load", t), () => e.removeEventListener("load", t))
|
|
2353
2348
|
});
|
|
2354
|
-
return r?.length && (
|
|
2355
|
-
},
|
|
2356
|
-
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } =
|
|
2349
|
+
return r?.length && (jn() ? await o.requestPermissions(r) : Zr()), o;
|
|
2350
|
+
}, oi = "attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page", si = "frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it", ci = "extension.attachFrame: the attached window closed; attach a fresh window", li = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, ui = async (e) => {
|
|
2351
|
+
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } = Ir(e.window);
|
|
2357
2352
|
j("attachFrame", t);
|
|
2358
2353
|
let o = T();
|
|
2359
|
-
if (!ze(o, "attachWindow")) throw o.status === "absent" ? new w("attachWindow", 0,
|
|
2354
|
+
if (!ze(o, "attachWindow")) throw o.status === "absent" ? new w("attachWindow", 0, oi) : new w("attachWindow", o.abi);
|
|
2360
2355
|
let s = window.open(r || "about:blank", "_blank", `popup,width=${i},height=${a}`);
|
|
2361
|
-
if (!s) throw new
|
|
2356
|
+
if (!s) throw new qn();
|
|
2362
2357
|
let c;
|
|
2363
2358
|
try {
|
|
2364
2359
|
c = await D.attachWindow({
|
|
@@ -2375,11 +2370,11 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2375
2370
|
u = !0;
|
|
2376
2371
|
}, () => {
|
|
2377
2372
|
u = !0;
|
|
2378
|
-
}), f = r, p =
|
|
2373
|
+
}), f = r, p = ii(c, {
|
|
2379
2374
|
hosts: r ? [...t, Q(r)] : t,
|
|
2380
2375
|
url: () => f,
|
|
2381
2376
|
page: () => s,
|
|
2382
|
-
unreachable: () => u ?
|
|
2377
|
+
unreachable: () => u ? R(ci, "postMessage", "extension") : s.closed ? z(si, "postMessage") : void 0,
|
|
2383
2378
|
documents: (e) => {
|
|
2384
2379
|
let t = !0;
|
|
2385
2380
|
return (async () => {
|
|
@@ -2412,11 +2407,11 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2412
2407
|
throw await h(), e;
|
|
2413
2408
|
}
|
|
2414
2409
|
return g;
|
|
2415
|
-
},
|
|
2416
|
-
let { kind: t, cookies: n } =
|
|
2417
|
-
if (n !== "native") throw new w("cookies", $(),
|
|
2418
|
-
return t === "window" ?
|
|
2419
|
-
}),
|
|
2410
|
+
}, di = (async (e) => {
|
|
2411
|
+
let { kind: t, cookies: n } = Jr(e);
|
|
2412
|
+
if (n !== "native") throw new w("cookies", $(), li(n));
|
|
2413
|
+
return t === "window" ? ui(e) : ai(e);
|
|
2414
|
+
}), fi = "permissions.request: pass hosts, the sites the grant applies to", pi = { request: async (e) => {
|
|
2420
2415
|
let t = e.map((e) => {
|
|
2421
2416
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
2422
2417
|
if (A("permissions.request", i), !("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -2425,17 +2420,17 @@ var Ar = 3e4, jr = `frame.evaluate: the code did not settle within ${Ar}ms`, Mr
|
|
|
2425
2420
|
reason: i
|
|
2426
2421
|
} };
|
|
2427
2422
|
let o = p(a ?? [], { ipv6: !0 });
|
|
2428
|
-
if (!o.length) throw TypeError(
|
|
2429
|
-
return
|
|
2423
|
+
if (!o.length) throw TypeError(fi);
|
|
2424
|
+
return gt("permissions.request", o), { ask: {
|
|
2430
2425
|
category: t,
|
|
2431
2426
|
key: n,
|
|
2432
2427
|
reason: i,
|
|
2433
2428
|
hosts: o
|
|
2434
2429
|
} };
|
|
2435
2430
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2436
|
-
|
|
2437
|
-
let { items: r, answer: i } =
|
|
2431
|
+
yr("permissions.request", n), n.length && await Mn();
|
|
2432
|
+
let { items: r, answer: i } = br(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await D.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
2438
2433
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2439
|
-
} },
|
|
2434
|
+
} }, mi = "PermissionDeniedError", hi = (e) => e instanceof Error ? e.name === mi : xr(e) && e.name === "PermissionDeniedError";
|
|
2440
2435
|
//#endregion
|
|
2441
|
-
export {
|
|
2436
|
+
export { Xe as $, Nt as A, xt as B, Vn as C, I as D, B as E, Mt as F, it as G, vt as H, zt as I, ct as J, at as K, Pt as L, Bt as M, R as N, Rt as O, Vt as P, O as Q, bt as R, Hn as S, q as T, lt as U, yt as V, dt as W, tt as X, st as Y, A as Z, Yn as _, x as _t, di as a, We as at, Wn as b, Nr as c, w as ct, xr as d, Re as dt, Je as et, yr as f, Oe as ft, qn as g, xe as gt, hr as h, ye as ht, Yr as i, T as it, It as j, z as k, Or as l, C as lt, gr as m, S as mt, hi as n, Ve as nt, Jr as o, E as ot, mr as p, be as pt, rt as q, pi as r, He as rt, Ir as s, ke as st, mi as t, qe as tt, Ar as u, Ae as ut, Un as v, Fn as w, J as x, sr as y, St as z };
|