@fkn/lib 0.9.32 → 0.9.34
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.cjs +1 -1
- package/account.js +1 -1
- package/{api-DLvscoll.js → api-BdTgLphT.js} +80 -65
- package/{api-LKxHamsI.d.ts → api-Bgsg9t9D.d.ts} +7 -1
- package/api-MW-Lm0u8.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/attach-policy.cjs +1 -1
- package/attach-policy.d.ts +30 -5
- package/attach-policy.js +16 -18
- 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-BYw0XBF4.d.ts → cloud-C40YCPuv.d.ts} +4 -4
- package/cloud-DBNeXS9R.js +272 -0
- package/cloud-DHuqVKrl.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-CSdeTq_Y.d.ts → contract-Gd543I6m.d.ts} +31 -1
- package/contract.d.ts +2 -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-DNkuFy1Y.d.ts → extension-Bm-PwsD6.d.ts} +23 -147
- package/extension-DALH11b4.js +87 -0
- package/extension-lR-cSs2P.cjs +1 -0
- 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.js +1 -1
- package/{fs-DEnJQLa9.cjs → fs-Bv3aFjqA.cjs} +1 -1
- package/{fs-gY-aKqaf.js → fs-O2bp9J0x.js} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/hosts-C4-8lWwz.js +161 -0
- package/hosts-DD4rDeQH.cjs +1 -0
- package/http.d.ts +1 -1
- package/{index-DH3_12nU.d.ts → index-DIK21kfh.d.ts} +278 -5
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +62 -62
- package/{lib-duLPF_WZ.js → lib-C3f3XmGZ.js} +544 -393
- package/lib-WiHTYaNP.cjs +53 -0
- package/{net-DtRM2eKo.d.ts → net-BBtYFEzu.d.ts} +2 -2
- 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 +5 -2
- package/{proxy-AooDS--C.d.ts → proxy-XeHtHIdZ.d.ts} +2 -2
- package/proxy-_m6Sqcr6.cjs +1 -0
- package/proxy-fXckOcRn.js +60 -0
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +1 -1
- package/{storage-5o8AtNi_.js → storage-C6Cd4J5E.js} +1 -1
- package/{storage-Dk6d2Vlz.cjs → storage-D2eBifiu.cjs} +1 -1
- package/api-BCJO3EWi.cjs +0 -3
- package/cloud-B2ZG-0MF.cjs +0 -1
- package/cloud-DolBoNvR.js +0 -174
- package/extension-DBazc3ff.cjs +0 -1
- package/extension-Dw9gzvei.js +0 -84
- package/lib-DLM2M3_i.cjs +0 -53
- package/proxy-CefKCs-i.cjs +0 -1
- package/proxy-KUfE4cEQ.js +0 -75
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { _ as t, a as n, d as r, g as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, t as p, u as m } from "./hosts-C4-8lWwz.js";
|
|
3
|
+
import { BoxBase as ee, createTypedEventTarget as h, expose as te, recursiveBox as g, recursiveRevive as _ } from "osra";
|
|
3
4
|
//#region ../web-extension/lib/lib/revivables/event-proxy.js
|
|
4
|
-
var
|
|
5
|
+
var ne = (e, t) => {
|
|
5
6
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
6
7
|
return Object.defineProperty(n, "addEventListener", {
|
|
7
8
|
configurable: !0,
|
|
@@ -30,34 +31,34 @@ var o = (e, t) => {
|
|
|
30
31
|
o && (e.removeEventListener(t, o), r.delete(t));
|
|
31
32
|
}
|
|
32
33
|
}), n;
|
|
33
|
-
},
|
|
34
|
+
}, v = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, re = (e) => {
|
|
34
35
|
let t = /* @__PURE__ */ new WeakMap();
|
|
35
36
|
return {
|
|
36
37
|
addEventListener: (n, r, i) => {
|
|
37
38
|
if (r === null) return;
|
|
38
|
-
let a = `${n}|${
|
|
39
|
+
let a = `${n}|${v(i)}`, o = t.get(r);
|
|
39
40
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
40
|
-
let
|
|
41
|
-
|
|
41
|
+
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
42
|
+
s && o.delete(a);
|
|
42
43
|
let i = e.unenrich(t, n);
|
|
43
44
|
typeof r == "function" ? r.call(e.target, i) : r.handleEvent(i);
|
|
44
45
|
};
|
|
45
|
-
o.set(a,
|
|
46
|
+
o.set(a, c), e.remoteEvents.addEventListener(n, c, i);
|
|
46
47
|
},
|
|
47
48
|
removeEventListener: (n, r, i) => {
|
|
48
49
|
if (r === null) return;
|
|
49
|
-
let a = `${n}|${
|
|
50
|
-
|
|
50
|
+
let a = `${n}|${v(i)}`, o = t.get(r), s = o?.get(a);
|
|
51
|
+
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
51
52
|
},
|
|
52
53
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
53
54
|
};
|
|
54
|
-
},
|
|
55
|
-
box: () =>
|
|
56
|
-
createVideoElementHandle: () =>
|
|
57
|
-
isType: () =>
|
|
58
|
-
revive: () =>
|
|
59
|
-
type: () =>
|
|
60
|
-
}),
|
|
55
|
+
}, ie = /* @__PURE__ */ e({
|
|
56
|
+
box: () => _e,
|
|
57
|
+
createVideoElementHandle: () => C,
|
|
58
|
+
isType: () => ge,
|
|
59
|
+
revive: () => ve,
|
|
60
|
+
type: () => y
|
|
61
|
+
}), y = "videoElement", b = [
|
|
61
62
|
"currentTime",
|
|
62
63
|
"volume",
|
|
63
64
|
"muted",
|
|
@@ -68,22 +69,22 @@ var o = (e, t) => {
|
|
|
68
69
|
"preload",
|
|
69
70
|
"poster",
|
|
70
71
|
"disableRemotePlayback"
|
|
71
|
-
],
|
|
72
|
+
], x = [
|
|
72
73
|
"duration",
|
|
73
74
|
"paused",
|
|
74
75
|
"ended",
|
|
75
76
|
"seeking",
|
|
76
77
|
"readyState",
|
|
77
78
|
"currentSrc"
|
|
78
|
-
],
|
|
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)]) : [], S = (e) => {
|
|
79
80
|
let t = {};
|
|
80
|
-
for (let n of [...
|
|
81
|
-
for (let n of
|
|
81
|
+
for (let n of [...b, ...x]) t[n] = e[n];
|
|
82
|
+
for (let n of ae) t[n] = le(e[n]);
|
|
82
83
|
return t.error = e.error ? {
|
|
83
84
|
code: e.error.code,
|
|
84
85
|
message: e.error.message
|
|
85
86
|
} : null, t;
|
|
86
|
-
},
|
|
87
|
+
}, ue = (e) => {
|
|
87
88
|
let t = (t) => {
|
|
88
89
|
if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
|
|
89
90
|
};
|
|
@@ -98,17 +99,17 @@ var o = (e, t) => {
|
|
|
98
99
|
return t(n), e[n][1];
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
|
-
},
|
|
102
|
+
}, de = (e) => e ? {
|
|
102
103
|
code: e.code,
|
|
103
104
|
message: e.message,
|
|
104
105
|
MEDIA_ERR_ABORTED: 1,
|
|
105
106
|
MEDIA_ERR_NETWORK: 2,
|
|
106
107
|
MEDIA_ERR_DECODE: 3,
|
|
107
108
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
108
|
-
} : null,
|
|
109
|
+
} : null, fe = (e) => ne(e, (e, t) => ({
|
|
109
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
110
|
-
snapshot:
|
|
111
|
-
})),
|
|
111
|
+
snapshot: S(t)
|
|
112
|
+
})), pe = async (e, t) => {
|
|
112
113
|
switch (t) {
|
|
113
114
|
case "play": return await e.play(), null;
|
|
114
115
|
case "pause": return e.pause(), null;
|
|
@@ -123,19 +124,19 @@ var o = (e, t) => {
|
|
|
123
124
|
}
|
|
124
125
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
125
126
|
}
|
|
126
|
-
},
|
|
127
|
-
call: async (t) =>
|
|
127
|
+
}, me = (e) => ({
|
|
128
|
+
call: async (t) => pe(e, t),
|
|
128
129
|
set: async (t, n) => {
|
|
129
130
|
try {
|
|
130
131
|
e[t] = n;
|
|
131
132
|
} catch {}
|
|
132
|
-
return
|
|
133
|
+
return S(e);
|
|
133
134
|
},
|
|
134
|
-
events:
|
|
135
|
-
}),
|
|
135
|
+
events: fe(e)
|
|
136
|
+
}), he = (e, t) => {
|
|
136
137
|
let n = new EventTarget();
|
|
137
|
-
Object.defineProperty(n,
|
|
138
|
-
let r =
|
|
138
|
+
Object.defineProperty(n, oe, { value: !0 }), Object.defineProperty(n, se, { value: e }), Object.defineProperty(n, ce, { value: t });
|
|
139
|
+
let r = re({
|
|
139
140
|
target: n,
|
|
140
141
|
remoteEvents: t.events,
|
|
141
142
|
unenrich: (t, n) => {
|
|
@@ -170,7 +171,7 @@ var o = (e, t) => {
|
|
|
170
171
|
configurable: !0,
|
|
171
172
|
enumerable: !0,
|
|
172
173
|
get() {
|
|
173
|
-
return
|
|
174
|
+
return de(e.error);
|
|
174
175
|
}
|
|
175
176
|
},
|
|
176
177
|
play: {
|
|
@@ -206,7 +207,7 @@ var o = (e, t) => {
|
|
|
206
207
|
value: 4
|
|
207
208
|
}
|
|
208
209
|
};
|
|
209
|
-
for (let n of
|
|
210
|
+
for (let n of b) i[n] = {
|
|
210
211
|
configurable: !0,
|
|
211
212
|
enumerable: !0,
|
|
212
213
|
get() {
|
|
@@ -218,43 +219,43 @@ var o = (e, t) => {
|
|
|
218
219
|
}, () => {});
|
|
219
220
|
}
|
|
220
221
|
};
|
|
221
|
-
for (let t of
|
|
222
|
+
for (let t of x) i[t] = {
|
|
222
223
|
configurable: !0,
|
|
223
224
|
enumerable: !0,
|
|
224
225
|
get() {
|
|
225
226
|
return e[t];
|
|
226
227
|
}
|
|
227
228
|
};
|
|
228
|
-
for (let t of
|
|
229
|
+
for (let t of ae) i[t] = {
|
|
229
230
|
configurable: !0,
|
|
230
231
|
enumerable: !0,
|
|
231
232
|
get() {
|
|
232
|
-
return
|
|
233
|
+
return ue(e[t]);
|
|
233
234
|
}
|
|
234
235
|
};
|
|
235
236
|
return Object.defineProperties(n, i), n;
|
|
236
|
-
},
|
|
237
|
-
let
|
|
237
|
+
}, C = (e) => he(S(e), me(e)), ge = (e) => typeof e == "object" && !!e && e[oe] === !0, _e = (e, t) => {
|
|
238
|
+
let n = e;
|
|
238
239
|
return {
|
|
239
|
-
...
|
|
240
|
-
type:
|
|
241
|
-
initialState:
|
|
242
|
-
controller:
|
|
240
|
+
...ee,
|
|
241
|
+
type: y,
|
|
242
|
+
initialState: n[se],
|
|
243
|
+
controller: g(n[ce], t)
|
|
243
244
|
};
|
|
244
|
-
},
|
|
245
|
-
let n =
|
|
246
|
-
return
|
|
247
|
-
},
|
|
245
|
+
}, ve = (e, t) => {
|
|
246
|
+
let n = _(e.controller, t);
|
|
247
|
+
return he({ ...e.initialState }, n);
|
|
248
|
+
}, ye = (e) => [ie, ...e], be = 2, xe = 0, Se = "fknExtension", Ce = "fknExtensionAbi", we = "fknExtensionOps", Te = [
|
|
248
249
|
"data-fkn-extension",
|
|
249
250
|
"data-fkn-extension-abi",
|
|
250
251
|
"data-fkn-extension-ops"
|
|
251
|
-
],
|
|
252
|
+
], Ee = (e) => {
|
|
252
253
|
if (e === void 0) return 0;
|
|
253
254
|
let t = Number(e);
|
|
254
255
|
return Number.isInteger(t) && t >= 0 ? t : 0;
|
|
255
|
-
},
|
|
256
|
+
}, De = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), Oe = (e, t = 0) => {
|
|
256
257
|
if (e.fknExtension !== "true") return { status: "absent" };
|
|
257
|
-
let n =
|
|
258
|
+
let n = Ee(e[Ce]), r = De(e[we]);
|
|
258
259
|
return n < t ? {
|
|
259
260
|
status: "outdated",
|
|
260
261
|
abi: n,
|
|
@@ -265,42 +266,42 @@ var o = (e, t) => {
|
|
|
265
266
|
abi: n,
|
|
266
267
|
operations: r
|
|
267
268
|
};
|
|
268
|
-
},
|
|
269
|
+
}, ke = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, w = class extends Error {
|
|
269
270
|
abi;
|
|
270
271
|
required;
|
|
271
272
|
name = "ExtensionOutdatedError";
|
|
272
273
|
constructor(e, t) {
|
|
273
274
|
super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`), this.abi = e, this.required = t;
|
|
274
275
|
}
|
|
275
|
-
},
|
|
276
|
+
}, Ae = class extends Error {
|
|
276
277
|
operation;
|
|
277
278
|
abi;
|
|
278
279
|
name = "ExtensionOperationUnsupportedError";
|
|
279
280
|
constructor(e, t) {
|
|
280
281
|
super(`The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
281
282
|
}
|
|
282
|
-
},
|
|
283
|
-
typeof document < "u" && document.addEventListener(
|
|
284
|
-
|
|
283
|
+
}, je = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Me = Se, Ne = h();
|
|
284
|
+
typeof document < "u" && document.addEventListener(je, () => {
|
|
285
|
+
Ne.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Pe() } }));
|
|
285
286
|
});
|
|
286
|
-
var
|
|
287
|
-
|
|
288
|
-
},
|
|
289
|
-
let r = () =>
|
|
287
|
+
var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me] === "true", T = () => typeof document > "u" ? { status: "absent" } : Oe(document.documentElement.dataset), E = null, Fe = (e) => {
|
|
288
|
+
E = e;
|
|
289
|
+
}, Ie = 150, D = (e = 1e3) => new Promise((t, n) => {
|
|
290
|
+
let r = () => T().status === "ok";
|
|
290
291
|
if (r()) return t();
|
|
291
292
|
let i, a = (e) => {
|
|
292
293
|
clearTimeout(i), c.disconnect(), document.removeEventListener("readystatechange", l), e();
|
|
293
294
|
}, o = () => a(async () => {
|
|
294
|
-
let e =
|
|
295
|
-
if (e.status === "outdated") return n(new
|
|
296
|
-
if (
|
|
297
|
-
if (await
|
|
298
|
-
let e =
|
|
299
|
-
if (e.status === "outdated") return n(new
|
|
295
|
+
let e = T();
|
|
296
|
+
if (e.status === "outdated") return n(new w(e.abi, e.required));
|
|
297
|
+
if (E) {
|
|
298
|
+
if (await E().catch(() => {}), r()) return t();
|
|
299
|
+
let e = T();
|
|
300
|
+
if (e.status === "outdated") return n(new w(e.abi, e.required));
|
|
300
301
|
}
|
|
301
302
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
302
303
|
}), s = () => {
|
|
303
|
-
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(),
|
|
304
|
+
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Ie);
|
|
304
305
|
}, c = new MutationObserver(() => {
|
|
305
306
|
r() && a(t);
|
|
306
307
|
}), l = () => {
|
|
@@ -308,58 +309,60 @@ var ye = () => typeof document > "u" ? !1 : document.documentElement.dataset[_e]
|
|
|
308
309
|
};
|
|
309
310
|
if (i = setTimeout(o, e), c.observe(document.documentElement, {
|
|
310
311
|
attributes: !0,
|
|
311
|
-
attributeFilter: [...
|
|
312
|
+
attributeFilter: [...Te]
|
|
312
313
|
}), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
|
|
313
314
|
r() && a(t);
|
|
314
|
-
}),
|
|
315
|
-
await
|
|
315
|
+
}), Le, O = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
316
|
+
await D(), Le ??= te({}, {
|
|
316
317
|
transport: window,
|
|
317
|
-
revivableModules:
|
|
318
|
+
revivableModules: ye
|
|
318
319
|
});
|
|
319
|
-
let n = (await
|
|
320
|
+
let n = (await Le)[t];
|
|
320
321
|
return n(...e);
|
|
321
|
-
} }),
|
|
322
|
+
} }), k = [
|
|
322
323
|
"origin",
|
|
323
324
|
"referer",
|
|
324
325
|
"cookie"
|
|
325
|
-
],
|
|
326
|
-
if (t === "include" &&
|
|
327
|
-
},
|
|
328
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !
|
|
326
|
+
], Re = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), ze = (e) => Re(e, "cookie"), Be = (e, t) => {
|
|
327
|
+
if (t === "include" && ze(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
328
|
+
}, Ve = (e) => {
|
|
329
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !k.includes(e)))];
|
|
329
330
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
330
|
-
},
|
|
331
|
+
}, He = [
|
|
331
332
|
"fkn.app",
|
|
332
333
|
"fkn.dev",
|
|
333
334
|
"sdbx.app"
|
|
334
|
-
],
|
|
335
|
-
let t =
|
|
336
|
-
return
|
|
337
|
-
},
|
|
335
|
+
], Ue = (e) => e.replace(/\.+$/, ""), We = (e) => {
|
|
336
|
+
let t = Ue(e);
|
|
337
|
+
return He.some((e) => t === e || t.endsWith(`.${e}`));
|
|
338
|
+
}, A = {
|
|
338
339
|
scope: "network.fetch",
|
|
339
340
|
category: "network",
|
|
340
341
|
severity: 0,
|
|
341
342
|
title: "Fetch data from other sites",
|
|
342
343
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
343
|
-
},
|
|
344
|
+
}, j = {
|
|
344
345
|
scope: "network.fetchCredentialed",
|
|
345
346
|
category: "network",
|
|
346
347
|
severity: 3,
|
|
348
|
+
chip: "load as you",
|
|
347
349
|
unsafe: !0,
|
|
348
350
|
title: "Fetch from other sites, signed in as you",
|
|
349
351
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
350
|
-
},
|
|
352
|
+
}, Ge = {
|
|
351
353
|
scope: "network.fetchLocal",
|
|
352
354
|
category: "network",
|
|
353
355
|
severity: 3,
|
|
356
|
+
chip: "local network",
|
|
354
357
|
unsafe: !0,
|
|
355
358
|
title: "Access devices on your local network",
|
|
356
359
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
357
|
-
},
|
|
360
|
+
}, Ke = (e) => {
|
|
358
361
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
359
362
|
if (!t) return !1;
|
|
360
363
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
361
364
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
362
|
-
},
|
|
365
|
+
}, qe = (e) => {
|
|
363
366
|
let t;
|
|
364
367
|
try {
|
|
365
368
|
t = new URL(e);
|
|
@@ -367,54 +370,100 @@ var ye = () => typeof document > "u" ? !1 : document.documentElement.dataset[_e]
|
|
|
367
370
|
return !1;
|
|
368
371
|
}
|
|
369
372
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
370
|
-
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:") :
|
|
371
|
-
},
|
|
373
|
+
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:") : Ke(n);
|
|
374
|
+
}, Je = (e) => {
|
|
372
375
|
let t;
|
|
373
376
|
try {
|
|
374
377
|
t = new URL(e);
|
|
375
378
|
} catch {
|
|
376
379
|
return !1;
|
|
377
380
|
}
|
|
378
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" ||
|
|
379
|
-
},
|
|
380
|
-
if (
|
|
381
|
-
},
|
|
381
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || We(t.hostname);
|
|
382
|
+
}, Ye = (e) => {
|
|
383
|
+
if (Je(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
384
|
+
}, Xe = (e) => {
|
|
382
385
|
if (!e?.headers) return;
|
|
383
|
-
let t = new Headers(e.headers), n =
|
|
386
|
+
let t = new Headers(e.headers), n = k.map((e) => {
|
|
384
387
|
let n = t.get(e);
|
|
385
388
|
return n === null || n === "" ? void 0 : [e, n];
|
|
386
389
|
}).filter((e) => e !== void 0);
|
|
387
390
|
return n.length ? n : void 0;
|
|
388
|
-
},
|
|
391
|
+
}, Ze = async (e, t) => {
|
|
389
392
|
let n = new Request(e, t);
|
|
390
|
-
|
|
393
|
+
Ye(n.url);
|
|
391
394
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
392
|
-
return
|
|
395
|
+
return O.proxyFetch({
|
|
393
396
|
url: n.url,
|
|
394
397
|
method: n.method,
|
|
395
398
|
headers: [...n.headers],
|
|
396
399
|
body: r,
|
|
397
400
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
398
401
|
redirect: n.redirect,
|
|
399
|
-
unsafeHeaders:
|
|
402
|
+
unsafeHeaders: Xe(t),
|
|
400
403
|
reason: t?.reason,
|
|
401
404
|
signal: t?.signal ?? void 0
|
|
402
405
|
});
|
|
403
|
-
},
|
|
406
|
+
}, Qe = {
|
|
404
407
|
scope: "network.readCookie",
|
|
405
408
|
category: "network",
|
|
406
409
|
severity: 3,
|
|
410
|
+
chip: "read cookie",
|
|
407
411
|
unsafe: !0,
|
|
408
412
|
title: "Read a site’s cookie",
|
|
409
413
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
410
|
-
},
|
|
414
|
+
}, $e = { get: (e) => O.getCookie(e) }, et = {
|
|
411
415
|
scope: "network.modifyRequestHeaders",
|
|
412
416
|
category: "network",
|
|
413
417
|
severity: 2,
|
|
418
|
+
chip: "rewrite headers",
|
|
414
419
|
unsafe: !0,
|
|
415
420
|
title: "Rewrite request headers to other sites",
|
|
416
421
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
417
|
-
},
|
|
422
|
+
}, tt = (e) => O.setRequestHeaderRule(e), nt = (e) => O.removeRequestHeaderRule({ ruleId: e }), rt = () => {
|
|
423
|
+
let e = T();
|
|
424
|
+
return e.status === "ok" && e.abi >= 2;
|
|
425
|
+
}, it = async () => {
|
|
426
|
+
await D();
|
|
427
|
+
let e = T();
|
|
428
|
+
if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
|
|
429
|
+
}, at = (e) => `Read the text, links and details ${e} shows.`, ot = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, st = [
|
|
430
|
+
{
|
|
431
|
+
id: "interaction",
|
|
432
|
+
heading: "Interaction",
|
|
433
|
+
summary: "Allow the app to interact with the website (clicks, type in text, etc.)",
|
|
434
|
+
title: (e) => `Interact with ${e}`,
|
|
435
|
+
description: (e, t) => t ? `Click, type and hover on ${e} for you. If you are signed in there, this happens as you.` : `Click, type and hover on ${e} for you, in a signed-out view.`,
|
|
436
|
+
cloudTitle: (e) => `Interact with ${e}`,
|
|
437
|
+
cloudDescription: (e) => `Click, type and hover on ${e} for you, through the session in this frame. If you signed in there, this happens as you.`
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: "storage",
|
|
441
|
+
heading: "Site data",
|
|
442
|
+
summary: "Can read the website's data",
|
|
443
|
+
title: (e) => `Read data from ${e}`,
|
|
444
|
+
description: at,
|
|
445
|
+
cloudTitle: (e) => `Read data from ${e}`,
|
|
446
|
+
cloudDescription: at
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
id: "network",
|
|
450
|
+
heading: "Network",
|
|
451
|
+
summary: "Make requests on behalf of the website (using your cookies, etc.)",
|
|
452
|
+
title: (e) => `Make requests to ${e} as you`,
|
|
453
|
+
description: (e) => `Load pages and data from ${e} and send changes there with your signed-in session.`,
|
|
454
|
+
cloudTitle: (e) => `Make requests to ${e}`,
|
|
455
|
+
cloudDescription: (e) => `Load pages and data from ${e} and send changes there through the session in this frame. If you signed in there, this happens as you.`
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: "evaluation",
|
|
459
|
+
heading: "Evaluation",
|
|
460
|
+
summary: "Can execute arbitrary code on the website",
|
|
461
|
+
title: (e) => `Run code on ${e}`,
|
|
462
|
+
description: ot,
|
|
463
|
+
cloudTitle: (e) => `Run code on ${e}`,
|
|
464
|
+
cloudDescription: ot
|
|
465
|
+
}
|
|
466
|
+
], ct = class extends Error {
|
|
418
467
|
reason;
|
|
419
468
|
filename;
|
|
420
469
|
line;
|
|
@@ -423,18 +472,18 @@ var ye = () => typeof document > "u" ? !1 : document.documentElement.dataset[_e]
|
|
|
423
472
|
constructor(e, t, n, r, i) {
|
|
424
473
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
425
474
|
}
|
|
426
|
-
},
|
|
475
|
+
}, lt = class {
|
|
427
476
|
start;
|
|
428
477
|
end;
|
|
429
478
|
source;
|
|
430
479
|
constructor(e, t, n) {
|
|
431
480
|
this.start = e, this.end = t, this.source = n;
|
|
432
481
|
}
|
|
433
|
-
},
|
|
482
|
+
}, M;
|
|
434
483
|
(function(e) {
|
|
435
484
|
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";
|
|
436
|
-
})(
|
|
437
|
-
var
|
|
485
|
+
})(M ||= {});
|
|
486
|
+
var ut = (e, t, n) => {
|
|
438
487
|
let r = n, i = 1e4;
|
|
439
488
|
do {
|
|
440
489
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -446,7 +495,7 @@ var He = (e, t, n) => {
|
|
|
446
495
|
r = o + 2, i--;
|
|
447
496
|
} while (i > 0);
|
|
448
497
|
throw Error("Too many escaping");
|
|
449
|
-
},
|
|
498
|
+
}, N = (e, t, n) => {
|
|
450
499
|
let r = n, i = 1e4;
|
|
451
500
|
do {
|
|
452
501
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -460,21 +509,21 @@ var He = (e, t, n) => {
|
|
|
460
509
|
break;
|
|
461
510
|
case "(":
|
|
462
511
|
{
|
|
463
|
-
let t =
|
|
512
|
+
let t = N(e, [")"], o + 1);
|
|
464
513
|
if (t === -1) return -1;
|
|
465
514
|
r = t + 1;
|
|
466
515
|
}
|
|
467
516
|
break;
|
|
468
517
|
case "\"":
|
|
469
518
|
{
|
|
470
|
-
let t =
|
|
519
|
+
let t = ut(e, ["\""], o + 1);
|
|
471
520
|
if (t === -1) return -1;
|
|
472
521
|
r = t + 1;
|
|
473
522
|
}
|
|
474
523
|
break;
|
|
475
524
|
case "'":
|
|
476
525
|
{
|
|
477
|
-
let t =
|
|
526
|
+
let t = ut(e, ["'"], o + 1);
|
|
478
527
|
if (t === -1) return -1;
|
|
479
528
|
r = t + 1;
|
|
480
529
|
}
|
|
@@ -484,17 +533,17 @@ var He = (e, t, n) => {
|
|
|
484
533
|
i--;
|
|
485
534
|
} while (i > 0);
|
|
486
535
|
throw Error("Too many escaping");
|
|
487
|
-
},
|
|
488
|
-
function
|
|
536
|
+
}, P = /\/\*[^]*?(?:\*\/|$)/g;
|
|
537
|
+
function F(e) {
|
|
489
538
|
return e ? e.trim() : "";
|
|
490
539
|
}
|
|
491
|
-
function
|
|
540
|
+
function I(e, t) {
|
|
492
541
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
493
542
|
for (let t in e) {
|
|
494
543
|
let n = e[t];
|
|
495
544
|
Array.isArray(n) ? n.forEach((e) => {
|
|
496
|
-
|
|
497
|
-
}) : n && typeof n == "object" &&
|
|
545
|
+
I(e, r);
|
|
546
|
+
}) : n && typeof n == "object" && I(n, r);
|
|
498
547
|
}
|
|
499
548
|
return n && Object.defineProperty(e, "parent", {
|
|
500
549
|
configurable: !0,
|
|
@@ -503,7 +552,7 @@ function z(e, t) {
|
|
|
503
552
|
value: t || null
|
|
504
553
|
}), e;
|
|
505
554
|
}
|
|
506
|
-
var
|
|
555
|
+
var dt = class {
|
|
507
556
|
level = 0;
|
|
508
557
|
indentation = " ";
|
|
509
558
|
compress = !1;
|
|
@@ -518,33 +567,33 @@ var Ue = class {
|
|
|
518
567
|
}
|
|
519
568
|
visit(e) {
|
|
520
569
|
switch (e.type) {
|
|
521
|
-
case
|
|
522
|
-
case
|
|
523
|
-
case
|
|
524
|
-
case
|
|
525
|
-
case
|
|
526
|
-
case
|
|
527
|
-
case
|
|
528
|
-
case
|
|
529
|
-
case
|
|
530
|
-
case
|
|
531
|
-
case
|
|
532
|
-
case
|
|
533
|
-
case
|
|
534
|
-
case
|
|
535
|
-
case
|
|
536
|
-
case
|
|
537
|
-
case
|
|
538
|
-
case
|
|
539
|
-
case
|
|
540
|
-
case
|
|
541
|
-
case
|
|
542
|
-
case
|
|
543
|
-
case
|
|
544
|
-
case
|
|
545
|
-
case
|
|
546
|
-
case
|
|
547
|
-
case
|
|
570
|
+
case M.stylesheet: return this.stylesheet(e);
|
|
571
|
+
case M.rule: return this.rule(e);
|
|
572
|
+
case M.declaration: return this.declaration(e);
|
|
573
|
+
case M.comment: return this.comment(e);
|
|
574
|
+
case M.container: return this.container(e);
|
|
575
|
+
case M.charset: return this.charset(e);
|
|
576
|
+
case M.counterStyle: return this.counterStyle(e);
|
|
577
|
+
case M.document: return this.document(e);
|
|
578
|
+
case M.customMedia: return this.customMedia(e);
|
|
579
|
+
case M.fontFace: return this.fontFace(e);
|
|
580
|
+
case M.fontFeatureValues: return this.fontFeatureValues(e);
|
|
581
|
+
case M.host: return this.host(e);
|
|
582
|
+
case M.import: return this.import(e);
|
|
583
|
+
case M.keyframes: return this.keyframes(e);
|
|
584
|
+
case M.keyframe: return this.keyframe(e);
|
|
585
|
+
case M.layer: return this.layer(e);
|
|
586
|
+
case M.media: return this.media(e);
|
|
587
|
+
case M.namespace: return this.namespace(e);
|
|
588
|
+
case M.page: return this.page(e);
|
|
589
|
+
case M.pageMarginBox: return this.pageMarginBox(e);
|
|
590
|
+
case M.positionTry: return this.positionTry(e);
|
|
591
|
+
case M.property: return this.property(e);
|
|
592
|
+
case M.scope: return this.scope(e);
|
|
593
|
+
case M.startingStyle: return this.startingStyle(e);
|
|
594
|
+
case M.supports: return this.supports(e);
|
|
595
|
+
case M.viewTransition: return this.viewTransition(e);
|
|
596
|
+
case M.atRule: return this.genericAtRule(e);
|
|
548
597
|
}
|
|
549
598
|
}
|
|
550
599
|
mapVisit(e, t) {
|
|
@@ -640,7 +689,7 @@ var Ue = class {
|
|
|
640
689
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
641
690
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
642
691
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
643
|
-
let n = e.rules.some((e) => e.type !==
|
|
692
|
+
let n = e.rules.some((e) => e.type !== M.declaration && e.type !== M.comment), r = n ? "\n\n" : "\n";
|
|
644
693
|
return this.emit(`${this.indent()}@${e.name}${t}`, e.position) + this.emit(n ? ` {\n${this.indent(1)}` : " {\n") + this.emit(n ? "" : this.indent(1)) + this.mapVisit(e.rules, r) + this.emit(n ? `\n${this.indent(-1)}${this.indent()}}` : `${this.indent(-1)}\n${this.indent()}}`);
|
|
645
694
|
}
|
|
646
695
|
rule(e) {
|
|
@@ -653,7 +702,7 @@ var Ue = class {
|
|
|
653
702
|
declaration(e) {
|
|
654
703
|
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(";");
|
|
655
704
|
}
|
|
656
|
-
},
|
|
705
|
+
}, ft = (e, t) => {
|
|
657
706
|
t ||= {};
|
|
658
707
|
let n = 1, r = 1;
|
|
659
708
|
function i() {
|
|
@@ -661,14 +710,14 @@ var Ue = class {
|
|
|
661
710
|
line: n,
|
|
662
711
|
column: r
|
|
663
712
|
};
|
|
664
|
-
return (i) => (i.position = new
|
|
713
|
+
return (i) => (i.position = new lt(e, {
|
|
665
714
|
line: n,
|
|
666
715
|
column: r
|
|
667
716
|
}, t?.source || ""), u(), i);
|
|
668
717
|
}
|
|
669
718
|
let a = [];
|
|
670
719
|
function o(i) {
|
|
671
|
-
let o = new
|
|
720
|
+
let o = new ct(t?.source || "", i, n, r, e);
|
|
672
721
|
if (!t?.silent) throw o;
|
|
673
722
|
a.push(o);
|
|
674
723
|
}
|
|
@@ -704,41 +753,41 @@ var Ue = class {
|
|
|
704
753
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
705
754
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
706
755
|
return n ? (l(n), t({
|
|
707
|
-
type:
|
|
756
|
+
type: M.comment,
|
|
708
757
|
comment: n[0].slice(2, -2)
|
|
709
758
|
})) : o("End of comment missing");
|
|
710
759
|
}
|
|
711
760
|
function p() {
|
|
712
|
-
let t =
|
|
761
|
+
let t = N(e, ["{"]);
|
|
713
762
|
if (t === -1 || t === 0) return;
|
|
714
763
|
let n = e.substring(0, t);
|
|
715
764
|
return l([n]), ((e, t) => {
|
|
716
765
|
let n = [], r = 0;
|
|
717
766
|
for (; r < e.length;) {
|
|
718
|
-
let i =
|
|
767
|
+
let i = N(e, t, r);
|
|
719
768
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
720
769
|
n.push(e.substring(r, i)), r = i + 1;
|
|
721
770
|
}
|
|
722
771
|
return n;
|
|
723
|
-
})(
|
|
772
|
+
})(F(n).replace(P, ""), [","]).map((e) => F(e));
|
|
724
773
|
}
|
|
725
774
|
function m() {
|
|
726
775
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
727
776
|
if (!n) return;
|
|
728
777
|
l(n);
|
|
729
|
-
let r =
|
|
778
|
+
let r = F(n[0]), a = /^:\s*/.exec(e);
|
|
730
779
|
if (!a) return o("property missing ':'");
|
|
731
780
|
l(a);
|
|
732
|
-
let s = "", c =
|
|
733
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s =
|
|
781
|
+
let s = "", c = N(e, [";", "}"]);
|
|
782
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = F(s).replace(P, ""));
|
|
734
783
|
let u = t({
|
|
735
|
-
type:
|
|
736
|
-
property: r.replace(
|
|
784
|
+
type: M.declaration,
|
|
785
|
+
property: r.replace(P, ""),
|
|
737
786
|
value: s
|
|
738
787
|
}), d = /^[;\s]*/.exec(e);
|
|
739
788
|
return d && l(d), u;
|
|
740
789
|
}
|
|
741
|
-
function
|
|
790
|
+
function ee() {
|
|
742
791
|
let n = [];
|
|
743
792
|
if (!s()) return o("missing '{'");
|
|
744
793
|
d(n);
|
|
@@ -751,25 +800,25 @@ var Ue = class {
|
|
|
751
800
|
}
|
|
752
801
|
return c() ? n : o("missing '}'");
|
|
753
802
|
}
|
|
754
|
-
function
|
|
755
|
-
let t =
|
|
803
|
+
function h() {
|
|
804
|
+
let t = N(e, ["{"]);
|
|
756
805
|
if (t === -1) return !1;
|
|
757
|
-
let n =
|
|
806
|
+
let n = N(e, [";"]), r = N(e, ["}"]);
|
|
758
807
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
759
808
|
}
|
|
760
|
-
function
|
|
809
|
+
function te() {
|
|
761
810
|
let n = [];
|
|
762
811
|
if (!s()) return o("missing '{'");
|
|
763
812
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
764
813
|
if (e.charAt(0) === "@") {
|
|
765
|
-
let e =
|
|
814
|
+
let e = b();
|
|
766
815
|
if (e) {
|
|
767
816
|
n.push(e), d(n);
|
|
768
817
|
continue;
|
|
769
818
|
}
|
|
770
819
|
}
|
|
771
|
-
if (
|
|
772
|
-
let e =
|
|
820
|
+
if (h()) {
|
|
821
|
+
let e = x();
|
|
773
822
|
if (e) {
|
|
774
823
|
n.push(e), d(n);
|
|
775
824
|
continue;
|
|
@@ -790,18 +839,18 @@ var Ue = class {
|
|
|
790
839
|
}
|
|
791
840
|
return c() ? n : o("missing '}'");
|
|
792
841
|
}
|
|
793
|
-
function
|
|
842
|
+
function g() {
|
|
794
843
|
let n = [];
|
|
795
844
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
796
845
|
if (e.charAt(0) === "@") {
|
|
797
|
-
let e =
|
|
846
|
+
let e = b();
|
|
798
847
|
if (e) {
|
|
799
848
|
n.push(e), d(n);
|
|
800
849
|
continue;
|
|
801
850
|
}
|
|
802
851
|
}
|
|
803
|
-
if (
|
|
804
|
-
let e =
|
|
852
|
+
if (h()) {
|
|
853
|
+
let e = x();
|
|
805
854
|
if (e) {
|
|
806
855
|
n.push(e), d(n);
|
|
807
856
|
continue;
|
|
@@ -822,7 +871,7 @@ var Ue = class {
|
|
|
822
871
|
}
|
|
823
872
|
return n;
|
|
824
873
|
}
|
|
825
|
-
function
|
|
874
|
+
function _() {
|
|
826
875
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
827
876
|
for (; r;) {
|
|
828
877
|
let n = l(r);
|
|
@@ -831,12 +880,12 @@ var Ue = class {
|
|
|
831
880
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
832
881
|
}
|
|
833
882
|
if (t.length) return n({
|
|
834
|
-
type:
|
|
883
|
+
type: M.keyframe,
|
|
835
884
|
values: t,
|
|
836
|
-
declarations:
|
|
885
|
+
declarations: ee() || []
|
|
837
886
|
});
|
|
838
887
|
}
|
|
839
|
-
let
|
|
888
|
+
let ne = RegExp(`^@(${[
|
|
840
889
|
"top-left-corner",
|
|
841
890
|
"top-left",
|
|
842
891
|
"top-center",
|
|
@@ -853,8 +902,8 @@ var Ue = class {
|
|
|
853
902
|
"right-top",
|
|
854
903
|
"right-middle",
|
|
855
904
|
"right-bottom"
|
|
856
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
857
|
-
function
|
|
905
|
+
].join("|")})(?![\\w-])\\s*`), v = y("import"), re = y("charset"), ie = y("namespace");
|
|
906
|
+
function y(t) {
|
|
858
907
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
859
908
|
return () => {
|
|
860
909
|
let r = i(), a = n.exec(e);
|
|
@@ -863,7 +912,7 @@ var Ue = class {
|
|
|
863
912
|
return s[t] = o[1].trim(), r(s);
|
|
864
913
|
};
|
|
865
914
|
}
|
|
866
|
-
function
|
|
915
|
+
function b() {
|
|
867
916
|
if (e[0] === "@") return function() {
|
|
868
917
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
869
918
|
if (!n) return;
|
|
@@ -871,10 +920,10 @@ var Ue = class {
|
|
|
871
920
|
if (!a) return o("@keyframes missing name");
|
|
872
921
|
let u = l(a)[1];
|
|
873
922
|
if (!s()) return o("@keyframes missing '{'");
|
|
874
|
-
let f = d(), p =
|
|
875
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
923
|
+
let f = d(), p = _();
|
|
924
|
+
for (; p;) f.push(p), f = f.concat(d()), p = _();
|
|
876
925
|
return c() ? t({
|
|
877
|
-
type:
|
|
926
|
+
type: M.keyframes,
|
|
878
927
|
name: u,
|
|
879
928
|
vendor: r,
|
|
880
929
|
keyframes: f
|
|
@@ -882,11 +931,11 @@ var Ue = class {
|
|
|
882
931
|
}() || function() {
|
|
883
932
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
884
933
|
if (!n) return;
|
|
885
|
-
let r =
|
|
934
|
+
let r = F(l(n)[1]);
|
|
886
935
|
if (!s()) return o("@media missing '{'");
|
|
887
|
-
let a =
|
|
936
|
+
let a = g();
|
|
888
937
|
return c() ? t({
|
|
889
|
-
type:
|
|
938
|
+
type: M.media,
|
|
890
939
|
media: r,
|
|
891
940
|
rules: a
|
|
892
941
|
}) : o("@media missing '}'");
|
|
@@ -895,29 +944,29 @@ var Ue = class {
|
|
|
895
944
|
if (!n) return;
|
|
896
945
|
let r = l(n);
|
|
897
946
|
return t({
|
|
898
|
-
type:
|
|
899
|
-
name:
|
|
900
|
-
media:
|
|
947
|
+
type: M.customMedia,
|
|
948
|
+
name: F(r[1]),
|
|
949
|
+
media: F(r[2])
|
|
901
950
|
});
|
|
902
951
|
}() || function() {
|
|
903
952
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
904
953
|
if (!n) return;
|
|
905
|
-
let r =
|
|
954
|
+
let r = F(l(n)[1]);
|
|
906
955
|
if (!s()) return o("@supports missing '{'");
|
|
907
|
-
let a =
|
|
956
|
+
let a = g();
|
|
908
957
|
return c() ? t({
|
|
909
|
-
type:
|
|
958
|
+
type: M.supports,
|
|
910
959
|
supports: r,
|
|
911
960
|
rules: a
|
|
912
961
|
}) : o("@supports missing '}'");
|
|
913
|
-
}() ||
|
|
962
|
+
}() || v() || re() || ie() || function() {
|
|
914
963
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
915
964
|
if (!n) return;
|
|
916
|
-
let r = l(n), a =
|
|
965
|
+
let r = l(n), a = F(r[1]), u = F(r[2]);
|
|
917
966
|
if (!s()) return o("@document missing '{'");
|
|
918
|
-
let d =
|
|
967
|
+
let d = g();
|
|
919
968
|
return c() ? t({
|
|
920
|
-
type:
|
|
969
|
+
type: M.document,
|
|
921
970
|
document: u,
|
|
922
971
|
vendor: a,
|
|
923
972
|
rules: d
|
|
@@ -931,7 +980,7 @@ var Ue = class {
|
|
|
931
980
|
let a = [];
|
|
932
981
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
933
982
|
if (e.charAt(0) === "@") {
|
|
934
|
-
let e =
|
|
983
|
+
let e = b();
|
|
935
984
|
if (e) {
|
|
936
985
|
a.push(e), d(a);
|
|
937
986
|
continue;
|
|
@@ -942,7 +991,7 @@ var Ue = class {
|
|
|
942
991
|
a.push(t), d(a);
|
|
943
992
|
}
|
|
944
993
|
return c() ? t({
|
|
945
|
-
type:
|
|
994
|
+
type: M.page,
|
|
946
995
|
selectors: r,
|
|
947
996
|
declarations: a
|
|
948
997
|
}) : o("@page missing '}'");
|
|
@@ -950,9 +999,9 @@ var Ue = class {
|
|
|
950
999
|
let t = i(), n = /^@host\s*/.exec(e);
|
|
951
1000
|
if (!n) return;
|
|
952
1001
|
if (l(n), !s()) return o("@host missing '{'");
|
|
953
|
-
let r =
|
|
1002
|
+
let r = g();
|
|
954
1003
|
return c() ? t({
|
|
955
|
-
type:
|
|
1004
|
+
type: M.host,
|
|
956
1005
|
rules: r
|
|
957
1006
|
}) : o("@host missing '}'");
|
|
958
1007
|
}() || function() {
|
|
@@ -962,28 +1011,28 @@ var Ue = class {
|
|
|
962
1011
|
let r = d(), a = m();
|
|
963
1012
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
964
1013
|
return c() ? t({
|
|
965
|
-
type:
|
|
1014
|
+
type: M.fontFace,
|
|
966
1015
|
declarations: r
|
|
967
1016
|
}) : o("@font-face missing '}'");
|
|
968
1017
|
}() || function() {
|
|
969
1018
|
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
970
1019
|
if (!n) return;
|
|
971
|
-
let r =
|
|
1020
|
+
let r = F(l(n)[1]);
|
|
972
1021
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
973
|
-
let a =
|
|
1022
|
+
let a = g();
|
|
974
1023
|
return c() ? t({
|
|
975
|
-
type:
|
|
1024
|
+
type: M.fontFeatureValues,
|
|
976
1025
|
fontFamily: r,
|
|
977
1026
|
rules: a
|
|
978
1027
|
}) : o("@font-feature-values missing '}'");
|
|
979
1028
|
}() || function() {
|
|
980
1029
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
981
1030
|
if (!n) return;
|
|
982
|
-
let r =
|
|
1031
|
+
let r = F(l(n)[1]);
|
|
983
1032
|
if (!s()) return o("@container missing '{'");
|
|
984
|
-
let a =
|
|
1033
|
+
let a = g();
|
|
985
1034
|
return c() ? t({
|
|
986
|
-
type:
|
|
1035
|
+
type: M.container,
|
|
987
1036
|
container: r,
|
|
988
1037
|
rules: a
|
|
989
1038
|
}) : o("@container missing '}'");
|
|
@@ -991,25 +1040,25 @@ var Ue = class {
|
|
|
991
1040
|
let t = i(), n = /^@starting-style\s*/.exec(e);
|
|
992
1041
|
if (!n) return;
|
|
993
1042
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
994
|
-
let r =
|
|
1043
|
+
let r = g();
|
|
995
1044
|
return c() ? t({
|
|
996
|
-
type:
|
|
1045
|
+
type: M.startingStyle,
|
|
997
1046
|
rules: r
|
|
998
1047
|
}) : o("@starting-style missing '}'");
|
|
999
1048
|
}() || function() {
|
|
1000
1049
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
1001
1050
|
if (!n) return;
|
|
1002
|
-
let r =
|
|
1051
|
+
let r = F(l(n)[1]);
|
|
1003
1052
|
if (!s()) {
|
|
1004
1053
|
let n = /^[;\s]*/.exec(e);
|
|
1005
1054
|
return n && l(n), t({
|
|
1006
|
-
type:
|
|
1055
|
+
type: M.layer,
|
|
1007
1056
|
layer: r
|
|
1008
1057
|
});
|
|
1009
1058
|
}
|
|
1010
|
-
let a =
|
|
1059
|
+
let a = g();
|
|
1011
1060
|
return c() ? t({
|
|
1012
|
-
type:
|
|
1061
|
+
type: M.layer,
|
|
1013
1062
|
layer: r,
|
|
1014
1063
|
rules: a
|
|
1015
1064
|
}) : o("@layer missing '}'");
|
|
@@ -1021,7 +1070,7 @@ var Ue = class {
|
|
|
1021
1070
|
let a = d(), u = m();
|
|
1022
1071
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1023
1072
|
return c() ? t({
|
|
1024
|
-
type:
|
|
1073
|
+
type: M.property,
|
|
1025
1074
|
name: r,
|
|
1026
1075
|
declarations: a
|
|
1027
1076
|
}) : o("@property missing '}'");
|
|
@@ -1033,18 +1082,18 @@ var Ue = class {
|
|
|
1033
1082
|
let a = d(), u = m();
|
|
1034
1083
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1035
1084
|
return c() ? t({
|
|
1036
|
-
type:
|
|
1085
|
+
type: M.counterStyle,
|
|
1037
1086
|
name: r,
|
|
1038
1087
|
declarations: a
|
|
1039
1088
|
}) : o("@counter-style missing '}'");
|
|
1040
1089
|
}() || function() {
|
|
1041
1090
|
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
1042
1091
|
if (!n) return;
|
|
1043
|
-
let r =
|
|
1092
|
+
let r = F(l(n)[1]);
|
|
1044
1093
|
if (!s()) return o("@scope missing '{'");
|
|
1045
|
-
let a =
|
|
1094
|
+
let a = g();
|
|
1046
1095
|
return c() ? t({
|
|
1047
|
-
type:
|
|
1096
|
+
type: M.scope,
|
|
1048
1097
|
scope: r,
|
|
1049
1098
|
rules: a
|
|
1050
1099
|
}) : o("@scope missing '}'");
|
|
@@ -1055,7 +1104,7 @@ var Ue = class {
|
|
|
1055
1104
|
let r = d(), a = m();
|
|
1056
1105
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1057
1106
|
return c() ? t({
|
|
1058
|
-
type:
|
|
1107
|
+
type: M.viewTransition,
|
|
1059
1108
|
declarations: r
|
|
1060
1109
|
}) : o("@view-transition missing '}'");
|
|
1061
1110
|
}() || function() {
|
|
@@ -1066,30 +1115,30 @@ var Ue = class {
|
|
|
1066
1115
|
let a = d(), u = m();
|
|
1067
1116
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1068
1117
|
return c() ? t({
|
|
1069
|
-
type:
|
|
1118
|
+
type: M.positionTry,
|
|
1070
1119
|
name: r,
|
|
1071
1120
|
declarations: a
|
|
1072
1121
|
}) : o("@position-try missing '}'");
|
|
1073
1122
|
}() || function() {
|
|
1074
|
-
let t = i(), n =
|
|
1123
|
+
let t = i(), n = ne.exec(e);
|
|
1075
1124
|
if (!n) return;
|
|
1076
1125
|
let r = l(n)[1];
|
|
1077
1126
|
if (!s()) return o(`@${r} missing '{'`);
|
|
1078
1127
|
let a = d(), u = m();
|
|
1079
1128
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1080
1129
|
return c() ? t({
|
|
1081
|
-
type:
|
|
1130
|
+
type: M.pageMarginBox,
|
|
1082
1131
|
name: r,
|
|
1083
1132
|
declarations: a
|
|
1084
1133
|
}) : o(`@${r} missing '}'`);
|
|
1085
1134
|
}() || function() {
|
|
1086
1135
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1087
1136
|
if (!n) return;
|
|
1088
|
-
let r = l(n)[1], a = "", u =
|
|
1089
|
-
if (u !== -1 && u > 0 && (a =
|
|
1090
|
-
let e =
|
|
1137
|
+
let r = l(n)[1], a = "", u = N(e, ["{", ";"]);
|
|
1138
|
+
if (u !== -1 && u > 0 && (a = F(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1139
|
+
let e = g();
|
|
1091
1140
|
return c() ? t({
|
|
1092
|
-
type:
|
|
1141
|
+
type: M.atRule,
|
|
1093
1142
|
name: r,
|
|
1094
1143
|
prelude: a,
|
|
1095
1144
|
rules: e
|
|
@@ -1097,21 +1146,21 @@ var Ue = class {
|
|
|
1097
1146
|
}
|
|
1098
1147
|
let d = /^[;\s]*/.exec(e);
|
|
1099
1148
|
return d && l(d), t({
|
|
1100
|
-
type:
|
|
1149
|
+
type: M.atRule,
|
|
1101
1150
|
name: r,
|
|
1102
1151
|
prelude: a
|
|
1103
1152
|
});
|
|
1104
1153
|
}();
|
|
1105
1154
|
}
|
|
1106
|
-
function
|
|
1155
|
+
function x() {
|
|
1107
1156
|
let e = i(), t = p();
|
|
1108
1157
|
return t ? (d(), e({
|
|
1109
|
-
type:
|
|
1158
|
+
type: M.rule,
|
|
1110
1159
|
selectors: t,
|
|
1111
|
-
declarations:
|
|
1160
|
+
declarations: te() || []
|
|
1112
1161
|
})) : o("selector missing");
|
|
1113
1162
|
}
|
|
1114
|
-
return
|
|
1163
|
+
return I(function() {
|
|
1115
1164
|
let n = function() {
|
|
1116
1165
|
let n, r = [];
|
|
1117
1166
|
for (u(), d(r); e.length;) {
|
|
@@ -1122,7 +1171,7 @@ var Ue = class {
|
|
|
1122
1171
|
}
|
|
1123
1172
|
break;
|
|
1124
1173
|
}
|
|
1125
|
-
if (n =
|
|
1174
|
+
if (n = b() || x(), !n) {
|
|
1126
1175
|
if (t?.silent) {
|
|
1127
1176
|
l([e.charAt(0)]), u(), d(r);
|
|
1128
1177
|
continue;
|
|
@@ -1134,7 +1183,7 @@ var Ue = class {
|
|
|
1134
1183
|
return r;
|
|
1135
1184
|
}();
|
|
1136
1185
|
return {
|
|
1137
|
-
type:
|
|
1186
|
+
type: M.stylesheet,
|
|
1138
1187
|
stylesheet: {
|
|
1139
1188
|
source: t?.source,
|
|
1140
1189
|
rules: n,
|
|
@@ -1142,61 +1191,61 @@ var Ue = class {
|
|
|
1142
1191
|
}
|
|
1143
1192
|
};
|
|
1144
1193
|
}());
|
|
1145
|
-
},
|
|
1194
|
+
}, pt = (e, t) => new dt(t || {}).compile(e), mt = Object.defineProperty, ht = (e, t) => {
|
|
1146
1195
|
let n = {};
|
|
1147
|
-
for (var r in e)
|
|
1196
|
+
for (var r in e) mt(n, r, {
|
|
1148
1197
|
get: e[r],
|
|
1149
1198
|
enumerable: !0
|
|
1150
1199
|
});
|
|
1151
|
-
return t ||
|
|
1152
|
-
},
|
|
1153
|
-
name:
|
|
1200
|
+
return t || mt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1201
|
+
}, gt = "LocatorError", L = "LocatorUnsupportedError", R = "LocatorDeniedError", _t = "LocatorInvalidError", z = (e) => typeof e == "object" && e ? e.name : void 0, B = (e) => Object.assign(Error(e), { name: gt }), vt = (e, t = "", n) => Object.assign(Error(e), {
|
|
1202
|
+
name: L,
|
|
1154
1203
|
operation: t,
|
|
1155
1204
|
backend: n
|
|
1156
|
-
}),
|
|
1157
|
-
name:
|
|
1205
|
+
}), yt = (e, t) => vt(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), bt = (e, t) => Object.assign(Error(e), {
|
|
1206
|
+
name: R,
|
|
1158
1207
|
operation: t
|
|
1159
|
-
}),
|
|
1160
|
-
name:
|
|
1208
|
+
}), xt = (e, t) => Object.assign(Error(e), {
|
|
1209
|
+
name: _t,
|
|
1161
1210
|
operation: t
|
|
1162
|
-
}),
|
|
1211
|
+
}), St = (e) => z(e) === L, Ct = (e) => z(e) === R, wt = (e) => z(e) === _t, Tt = (e) => Ct(e) || St(e) || wt(e), V = (e) => {
|
|
1163
1212
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1164
|
-
if (!t) throw
|
|
1213
|
+
if (!t) throw B("the resolved element belongs to a document with no window");
|
|
1165
1214
|
return t;
|
|
1166
|
-
},
|
|
1215
|
+
}, H = (e, t) => {
|
|
1167
1216
|
let n = e?.[t];
|
|
1168
1217
|
return typeof n == "function" ? n : null;
|
|
1169
|
-
},
|
|
1218
|
+
}, U = (e, t) => {
|
|
1170
1219
|
if (typeof e != "object" || !e) return null;
|
|
1171
1220
|
let n = (() => {
|
|
1172
1221
|
try {
|
|
1173
|
-
return
|
|
1222
|
+
return H(V(e), t);
|
|
1174
1223
|
} catch {
|
|
1175
1224
|
return null;
|
|
1176
1225
|
}
|
|
1177
1226
|
})();
|
|
1178
1227
|
if (n && e instanceof n) return n;
|
|
1179
|
-
let r =
|
|
1228
|
+
let r = H(globalThis, t);
|
|
1180
1229
|
return r && e instanceof r ? r : null;
|
|
1181
|
-
},
|
|
1182
|
-
if (e.length === 0) throw
|
|
1183
|
-
if (e.length > 1) throw
|
|
1230
|
+
}, W = (e, t) => U(e, t) !== null, G = (e) => {
|
|
1231
|
+
if (e.length === 0) throw B("No elements found");
|
|
1232
|
+
if (e.length > 1) throw B(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1184
1233
|
return e[0];
|
|
1185
|
-
},
|
|
1186
|
-
if (!
|
|
1234
|
+
}, Et = (e, t) => {
|
|
1235
|
+
if (!W(e, t)) throw B(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1187
1236
|
return e;
|
|
1188
|
-
},
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
]),
|
|
1198
|
-
if (
|
|
1199
|
-
if (e.type ===
|
|
1237
|
+
}, Dt = (e) => e.tagName.toLowerCase(), Ot = /* @__PURE__ */ new Set(), kt = (e) => {
|
|
1238
|
+
Ot.add(e);
|
|
1239
|
+
}, At = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, jt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Mt = (e) => !At.test(jt(e.value)), Nt = /* @__PURE__ */ new Set([
|
|
1240
|
+
M.import,
|
|
1241
|
+
M.fontFace,
|
|
1242
|
+
M.namespace,
|
|
1243
|
+
M.charset,
|
|
1244
|
+
M.document,
|
|
1245
|
+
M.comment
|
|
1246
|
+
]), Pt = (e) => {
|
|
1247
|
+
if (Nt.has(e.type)) return null;
|
|
1248
|
+
if (e.type === M.declaration) return Mt(e) ? e : null;
|
|
1200
1249
|
let t = e, n = { ...t };
|
|
1201
1250
|
for (let e of [
|
|
1202
1251
|
"declarations",
|
|
@@ -1204,18 +1253,18 @@ var Ue = class {
|
|
|
1204
1253
|
"keyframes"
|
|
1205
1254
|
]) {
|
|
1206
1255
|
let r = t[e];
|
|
1207
|
-
Array.isArray(r) && (n[e] =
|
|
1256
|
+
Array.isArray(r) && (n[e] = Ft(r));
|
|
1208
1257
|
}
|
|
1209
1258
|
return n;
|
|
1210
|
-
},
|
|
1259
|
+
}, Ft = (e) => e.map((e) => Pt(e)).filter((e) => e !== null), It = (e) => {
|
|
1211
1260
|
let t;
|
|
1212
1261
|
try {
|
|
1213
|
-
t =
|
|
1262
|
+
t = ft(e, { silent: !0 });
|
|
1214
1263
|
} catch {
|
|
1215
1264
|
return "";
|
|
1216
1265
|
}
|
|
1217
|
-
return t.stylesheet.rules =
|
|
1218
|
-
},
|
|
1266
|
+
return t.stylesheet.rules = Ft(t.stylesheet.rules), pt(t);
|
|
1267
|
+
}, Lt = (e, t) => {
|
|
1219
1268
|
let n = () => {
|
|
1220
1269
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1221
1270
|
};
|
|
@@ -1232,29 +1281,30 @@ var Ue = class {
|
|
|
1232
1281
|
});
|
|
1233
1282
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1234
1283
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1235
|
-
},
|
|
1284
|
+
}, Rt = { resolve: (e, t) => {
|
|
1236
1285
|
let n = e.document.createElement("style");
|
|
1237
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1286
|
+
n.textContent = t.noSanitize ? t.content : It(t.content);
|
|
1238
1287
|
try {
|
|
1239
|
-
|
|
1288
|
+
Lt(e.document, n);
|
|
1240
1289
|
} catch (e) {
|
|
1241
1290
|
console.error(e);
|
|
1242
1291
|
}
|
|
1243
|
-
|
|
1244
|
-
} },
|
|
1292
|
+
kt(n);
|
|
1293
|
+
} }, zt = (e) => {
|
|
1245
1294
|
let t = [];
|
|
1246
1295
|
return e.forEach((e, n) => {
|
|
1247
1296
|
t.push([n, e]);
|
|
1248
1297
|
}), t;
|
|
1249
|
-
},
|
|
1298
|
+
}, K = {
|
|
1250
1299
|
kind: "frame",
|
|
1300
|
+
ensureArgs: (e) => [void 0, e],
|
|
1251
1301
|
resolve: async (e, t, n = {}) => {
|
|
1252
|
-
if (typeof t != "string") throw
|
|
1253
|
-
let r =
|
|
1302
|
+
if (typeof t != "string") throw xt("fetch: url must be a string", "fetch");
|
|
1303
|
+
let r = V(e.document), i;
|
|
1254
1304
|
try {
|
|
1255
1305
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1256
1306
|
} catch {
|
|
1257
|
-
throw
|
|
1307
|
+
throw xt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1258
1308
|
}
|
|
1259
1309
|
let a = await r.fetch(i, {
|
|
1260
1310
|
method: n.method ?? "GET",
|
|
@@ -1270,31 +1320,31 @@ var Ue = class {
|
|
|
1270
1320
|
url: a.url,
|
|
1271
1321
|
redirected: a.redirected,
|
|
1272
1322
|
type: a.type,
|
|
1273
|
-
headers:
|
|
1323
|
+
headers: zt(a.headers),
|
|
1274
1324
|
body: await a.arrayBuffer()
|
|
1275
1325
|
};
|
|
1276
1326
|
}
|
|
1277
|
-
},
|
|
1278
|
-
click: () =>
|
|
1279
|
-
count: () =>
|
|
1280
|
-
exists: () =>
|
|
1281
|
-
fill: () =>
|
|
1282
|
-
getAttribute: () =>
|
|
1283
|
-
hover: () =>
|
|
1284
|
-
isVisible: () =>
|
|
1285
|
-
textContent: () =>
|
|
1286
|
-
}),
|
|
1327
|
+
}, q = /* @__PURE__ */ ht({
|
|
1328
|
+
click: () => Vt,
|
|
1329
|
+
count: () => Yt,
|
|
1330
|
+
exists: () => Xt,
|
|
1331
|
+
fill: () => Gt,
|
|
1332
|
+
getAttribute: () => qt,
|
|
1333
|
+
hover: () => Ht,
|
|
1334
|
+
isVisible: () => Jt,
|
|
1335
|
+
textContent: () => Kt
|
|
1336
|
+
}), Bt = (e, t) => {
|
|
1287
1337
|
let n = e.getBoundingClientRect();
|
|
1288
1338
|
return {
|
|
1289
1339
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1290
1340
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1291
1341
|
};
|
|
1292
|
-
},
|
|
1293
|
-
let n =
|
|
1342
|
+
}, Vt = { resolve: (e, t = {}) => {
|
|
1343
|
+
let n = G(e.elements), r = V(n), i = {
|
|
1294
1344
|
bubbles: !0,
|
|
1295
1345
|
cancelable: !0,
|
|
1296
1346
|
composed: !0,
|
|
1297
|
-
...
|
|
1347
|
+
...Bt(n, t.position),
|
|
1298
1348
|
button: 0
|
|
1299
1349
|
}, a = {
|
|
1300
1350
|
...i,
|
|
@@ -1318,12 +1368,12 @@ var Ue = class {
|
|
|
1318
1368
|
...i,
|
|
1319
1369
|
buttons: 0
|
|
1320
1370
|
}));
|
|
1321
|
-
} },
|
|
1322
|
-
let n =
|
|
1371
|
+
} }, Ht = { resolve: (e, t = {}) => {
|
|
1372
|
+
let n = G(e.elements), r = V(n), i = {
|
|
1323
1373
|
bubbles: !0,
|
|
1324
1374
|
cancelable: !0,
|
|
1325
1375
|
composed: !0,
|
|
1326
|
-
...
|
|
1376
|
+
...Bt(n, t.position)
|
|
1327
1377
|
}, a = {
|
|
1328
1378
|
...i,
|
|
1329
1379
|
pointerType: "mouse",
|
|
@@ -1337,11 +1387,11 @@ var Ue = class {
|
|
|
1337
1387
|
...i,
|
|
1338
1388
|
bubbles: !1
|
|
1339
1389
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1340
|
-
} },
|
|
1390
|
+
} }, Ut = (e, t) => {
|
|
1341
1391
|
e._valueTracker?.setValue("");
|
|
1342
|
-
let n = (
|
|
1392
|
+
let n = (U(e, "HTMLTextAreaElement") ?? U(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1343
1393
|
r ? r.call(e, t) : e.value = t;
|
|
1344
|
-
},
|
|
1394
|
+
}, Wt = (e, t) => {
|
|
1345
1395
|
if (e.type !== "range") return null;
|
|
1346
1396
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1347
1397
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1378,61 +1428,61 @@ var Ue = class {
|
|
|
1378
1428
|
buttons: 0
|
|
1379
1429
|
}
|
|
1380
1430
|
};
|
|
1381
|
-
},
|
|
1382
|
-
let r =
|
|
1383
|
-
if (a ||
|
|
1384
|
-
let e = r, n = a ?
|
|
1385
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1431
|
+
}, Gt = { resolve: (e, t, n = {}) => {
|
|
1432
|
+
let r = G(e.elements), i = V(r), a = W(r, "HTMLInputElement");
|
|
1433
|
+
if (a || W(r, "HTMLTextAreaElement")) {
|
|
1434
|
+
let e = r, n = a ? Wt(e, t) : null;
|
|
1435
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Ut(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 }));
|
|
1386
1436
|
return;
|
|
1387
1437
|
}
|
|
1388
|
-
if (
|
|
1438
|
+
if (W(r, "HTMLElement") && r.isContentEditable) {
|
|
1389
1439
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1390
1440
|
return;
|
|
1391
1441
|
}
|
|
1392
|
-
throw Error(`fill: element <${
|
|
1393
|
-
} },
|
|
1394
|
-
let n =
|
|
1395
|
-
if (!
|
|
1396
|
-
let r =
|
|
1442
|
+
throw Error(`fill: element <${Dt(r)}> is not fillable`);
|
|
1443
|
+
} }, Kt = { resolve: (e, t = {}) => G(e.elements).textContent }, qt = { resolve: (e, t, n = {}) => G(e.elements).getAttribute(t) }, Jt = { resolve: (e, t = {}) => {
|
|
1444
|
+
let n = G(e.elements);
|
|
1445
|
+
if (!W(n, "HTMLElement")) return !0;
|
|
1446
|
+
let r = V(n).getComputedStyle(n);
|
|
1397
1447
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1398
1448
|
let i = n.getBoundingClientRect();
|
|
1399
1449
|
return i.width > 0 && i.height > 0;
|
|
1400
|
-
} },
|
|
1450
|
+
} }, Yt = { resolve: (e, t = {}) => e.elements.length }, Xt = { resolve: (e, t = {}) => e.elements.length > 0 }, J = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Y = (e) => e.replaceAll("\"", "\\\""), Zt = {
|
|
1401
1451
|
to: "element",
|
|
1402
1452
|
css: !0,
|
|
1403
|
-
resolve: (e, t) =>
|
|
1453
|
+
resolve: (e, t) => J(e, t),
|
|
1404
1454
|
render: (e) => ({
|
|
1405
1455
|
fragment: typeof e == "string" ? e : "?",
|
|
1406
1456
|
separator: "descend"
|
|
1407
1457
|
})
|
|
1408
|
-
},
|
|
1458
|
+
}, Qt = {
|
|
1409
1459
|
to: "frame",
|
|
1410
1460
|
css: !0,
|
|
1411
1461
|
barrier: "down",
|
|
1412
|
-
resolve: (e, t) =>
|
|
1462
|
+
resolve: (e, t) => J(e, t),
|
|
1413
1463
|
render: (e) => ({
|
|
1414
1464
|
fragment: typeof e == "string" ? e : "?",
|
|
1415
1465
|
separator: "down"
|
|
1416
1466
|
})
|
|
1417
|
-
},
|
|
1467
|
+
}, $t = {
|
|
1418
1468
|
element: {
|
|
1419
1469
|
selectors: {
|
|
1420
|
-
locator:
|
|
1421
|
-
frameLocator:
|
|
1470
|
+
locator: Zt,
|
|
1471
|
+
frameLocator: Qt,
|
|
1422
1472
|
getByRole: {
|
|
1423
1473
|
to: "element",
|
|
1424
|
-
resolve: (e, t) =>
|
|
1425
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1474
|
+
resolve: (e, t) => J(e, `[role="${CSS.escape(t)}"]`),
|
|
1475
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${Y(e)}"]` : "[role]" })
|
|
1426
1476
|
},
|
|
1427
1477
|
getByText: {
|
|
1428
1478
|
to: "element",
|
|
1429
1479
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1430
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1480
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${Y(e)}")` : ":has-text(...)" })
|
|
1431
1481
|
},
|
|
1432
1482
|
getByTestId: {
|
|
1433
1483
|
to: "element",
|
|
1434
|
-
resolve: (e, t) =>
|
|
1435
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1484
|
+
resolve: (e, t) => J(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1485
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${Y(e)}"]` : "[data-testid]" })
|
|
1436
1486
|
},
|
|
1437
1487
|
first: {
|
|
1438
1488
|
to: "element",
|
|
@@ -1449,20 +1499,20 @@ var Ue = class {
|
|
|
1449
1499
|
}
|
|
1450
1500
|
},
|
|
1451
1501
|
operations: {
|
|
1452
|
-
click:
|
|
1453
|
-
fill:
|
|
1454
|
-
hover:
|
|
1455
|
-
textContent:
|
|
1456
|
-
getAttribute:
|
|
1457
|
-
isVisible:
|
|
1458
|
-
count:
|
|
1459
|
-
exists:
|
|
1502
|
+
click: Vt,
|
|
1503
|
+
fill: Gt,
|
|
1504
|
+
hover: Ht,
|
|
1505
|
+
textContent: Kt,
|
|
1506
|
+
getAttribute: qt,
|
|
1507
|
+
isVisible: Jt,
|
|
1508
|
+
count: Yt,
|
|
1509
|
+
exists: Xt
|
|
1460
1510
|
}
|
|
1461
1511
|
},
|
|
1462
1512
|
frame: {
|
|
1463
1513
|
selectors: {
|
|
1464
|
-
locator:
|
|
1465
|
-
frameLocator:
|
|
1514
|
+
locator: Zt,
|
|
1515
|
+
frameLocator: Qt,
|
|
1466
1516
|
owner: {
|
|
1467
1517
|
to: "frame",
|
|
1468
1518
|
barrier: "up",
|
|
@@ -1476,11 +1526,11 @@ var Ue = class {
|
|
|
1476
1526
|
}
|
|
1477
1527
|
},
|
|
1478
1528
|
operations: {
|
|
1479
|
-
addStyleTag:
|
|
1480
|
-
fetch:
|
|
1529
|
+
addStyleTag: Rt,
|
|
1530
|
+
fetch: K
|
|
1481
1531
|
}
|
|
1482
1532
|
}
|
|
1483
|
-
},
|
|
1533
|
+
}, en = (e, t = $t) => ({
|
|
1484
1534
|
element: {
|
|
1485
1535
|
selectors: {
|
|
1486
1536
|
...t.element.selectors,
|
|
@@ -1501,29 +1551,29 @@ var Ue = class {
|
|
|
1501
1551
|
...e.frame?.operations
|
|
1502
1552
|
}
|
|
1503
1553
|
}
|
|
1504
|
-
}),
|
|
1554
|
+
}), tn = 3e4, nn = 50, rn = (e) => {
|
|
1505
1555
|
let t = e[e.length - 1];
|
|
1506
1556
|
return typeof t == "object" && t ? t : void 0;
|
|
1507
|
-
},
|
|
1508
|
-
let t =
|
|
1509
|
-
return typeof t == "number" ? t :
|
|
1510
|
-
},
|
|
1557
|
+
}, an = (e) => {
|
|
1558
|
+
let t = rn(e)?.timeout;
|
|
1559
|
+
return typeof t == "number" ? t : tn;
|
|
1560
|
+
}, on = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), sn = async (e) => {
|
|
1511
1561
|
let t = {
|
|
1512
1562
|
parts: e.parts,
|
|
1513
1563
|
operation: e.operation,
|
|
1514
1564
|
args: e.args,
|
|
1515
1565
|
phase: "ensure"
|
|
1516
1566
|
};
|
|
1517
|
-
await e.gate?.(t,
|
|
1518
|
-
},
|
|
1567
|
+
await e.gate?.(t, on(e));
|
|
1568
|
+
}, cn = async (e) => {
|
|
1519
1569
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1520
1570
|
n && await n({
|
|
1521
1571
|
parts: r,
|
|
1522
1572
|
operation: i,
|
|
1523
1573
|
args: a,
|
|
1524
1574
|
phase: "execute"
|
|
1525
|
-
},
|
|
1526
|
-
let o =
|
|
1575
|
+
}, on(e));
|
|
1576
|
+
let o = an(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1527
1577
|
l.catch(() => {});
|
|
1528
1578
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1529
1579
|
try {
|
|
@@ -1531,55 +1581,59 @@ var Ue = class {
|
|
|
1531
1581
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1532
1582
|
} catch (e) {
|
|
1533
1583
|
if (e === c) break;
|
|
1534
|
-
if (
|
|
1584
|
+
if (Tt(e)) throw e;
|
|
1535
1585
|
f = e;
|
|
1536
1586
|
let t = s - Date.now();
|
|
1537
1587
|
if (t <= 0) break;
|
|
1538
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1588
|
+
await new Promise((e) => setTimeout(e, Math.min(nn, t)));
|
|
1539
1589
|
}
|
|
1540
1590
|
} finally {
|
|
1541
1591
|
clearTimeout(d);
|
|
1542
1592
|
}
|
|
1543
1593
|
throw f;
|
|
1544
|
-
},
|
|
1594
|
+
}, ln = (e, t, n, r) => {
|
|
1545
1595
|
let i = {};
|
|
1546
|
-
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) =>
|
|
1596
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => ln(e, t, o.to, [...r, {
|
|
1547
1597
|
kind: n,
|
|
1548
1598
|
name: a,
|
|
1549
1599
|
args: i
|
|
1550
1600
|
}]);
|
|
1551
|
-
for (let a of Object.keys(t[n].operations)) i[a] = (...t) =>
|
|
1601
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => cn({
|
|
1552
1602
|
...e,
|
|
1553
1603
|
parts: r,
|
|
1554
1604
|
operation: a,
|
|
1555
1605
|
args: t
|
|
1556
1606
|
});
|
|
1557
|
-
return i.ensure = (
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1607
|
+
return i.ensure = (i, a = {}) => {
|
|
1608
|
+
let o = t[n].operations[i]?.ensureArgs;
|
|
1609
|
+
return sn({
|
|
1610
|
+
...e,
|
|
1611
|
+
parts: r,
|
|
1612
|
+
operation: i,
|
|
1613
|
+
args: o?.(a) ?? [a]
|
|
1614
|
+
});
|
|
1615
|
+
}, i;
|
|
1616
|
+
}, un = (e) => ln(e, e.modules ?? $t, "frame", []), dn = en({
|
|
1564
1617
|
element: { operations: {
|
|
1565
|
-
click: { resolve: (e, t = {}) =>
|
|
1566
|
-
hover: { resolve: (e, t = {}) =>
|
|
1567
|
-
fill: { resolve: (e, t, n = {}) =>
|
|
1568
|
-
textContent: { resolve: (e, t = {}) =>
|
|
1569
|
-
getAttribute: { resolve: (e, t, n = {}) =>
|
|
1570
|
-
isVisible: { resolve: (e, t = {}) =>
|
|
1571
|
-
count: { resolve: (e, t = {}) =>
|
|
1572
|
-
exists: { resolve: (e, t = {}) =>
|
|
1573
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1618
|
+
click: { resolve: (e, t = {}) => q.click.resolve(e, t) },
|
|
1619
|
+
hover: { resolve: (e, t = {}) => q.hover.resolve(e, t) },
|
|
1620
|
+
fill: { resolve: (e, t, n = {}) => q.fill.resolve(e, t, n) },
|
|
1621
|
+
textContent: { resolve: (e, t = {}) => q.textContent.resolve(e) },
|
|
1622
|
+
getAttribute: { resolve: (e, t, n = {}) => q.getAttribute.resolve(e, t) },
|
|
1623
|
+
isVisible: { resolve: (e, t = {}) => q.isVisible.resolve(e) },
|
|
1624
|
+
count: { resolve: (e, t = {}) => q.count.resolve(e) },
|
|
1625
|
+
exists: { resolve: (e, t = {}) => q.exists.resolve(e) },
|
|
1626
|
+
videoElement: { resolve: (e, t = {}) => C(Et(G(e.elements), "HTMLVideoElement")) }
|
|
1574
1627
|
} },
|
|
1575
1628
|
frame: { operations: {
|
|
1576
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1629
|
+
addStyleTag: { resolve: (e, t) => Rt.resolve(e, t) },
|
|
1577
1630
|
fetch: {
|
|
1578
|
-
resolve: (e, t, n = {}) =>
|
|
1579
|
-
kind:
|
|
1631
|
+
resolve: (e, t, n = {}) => K.resolve(e, t, n),
|
|
1632
|
+
kind: K.kind,
|
|
1633
|
+
ensureArgs: K.ensureArgs
|
|
1580
1634
|
}
|
|
1581
1635
|
} }
|
|
1582
|
-
}),
|
|
1636
|
+
}), fn = (e) => {
|
|
1583
1637
|
if (!e || e === "about:blank") return !1;
|
|
1584
1638
|
let t;
|
|
1585
1639
|
try {
|
|
@@ -1587,64 +1641,161 @@ var Ue = class {
|
|
|
1587
1641
|
} catch {
|
|
1588
1642
|
return !1;
|
|
1589
1643
|
}
|
|
1590
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" &&
|
|
1591
|
-
},
|
|
1592
|
-
if (
|
|
1593
|
-
},
|
|
1644
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && We(t.hostname);
|
|
1645
|
+
}, X = (e) => {
|
|
1646
|
+
if (fn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1647
|
+
}, pn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1594
1648
|
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");
|
|
1595
|
-
},
|
|
1649
|
+
}, mn = {
|
|
1596
1650
|
scope: "embed.iframe",
|
|
1597
|
-
category: "
|
|
1651
|
+
category: "interaction",
|
|
1598
1652
|
severity: 0,
|
|
1599
1653
|
title: "Load another website inside this app",
|
|
1600
1654
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1601
|
-
},
|
|
1655
|
+
}, hn = {
|
|
1602
1656
|
scope: "embed.open",
|
|
1603
|
-
category: "
|
|
1657
|
+
category: "interaction",
|
|
1604
1658
|
severity: 0,
|
|
1605
1659
|
title: "Open a website inside this app",
|
|
1606
1660
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1607
|
-
},
|
|
1608
|
-
let t =
|
|
1661
|
+
}, gn = (e) => {
|
|
1662
|
+
let t = un({
|
|
1609
1663
|
executor: e.executor,
|
|
1610
|
-
modules:
|
|
1664
|
+
modules: dn,
|
|
1611
1665
|
gate: e.gate
|
|
1612
|
-
}), n = (t, n = {}) => (
|
|
1666
|
+
}), n = (t, n = {}) => (X(t), e.goto(t, n)), r = () => e.url(), i = async (t) => {
|
|
1667
|
+
let n = e.request;
|
|
1668
|
+
if (!n) throw Error("frame.request: this backend cannot ask for permission categories");
|
|
1669
|
+
return n(t);
|
|
1670
|
+
};
|
|
1613
1671
|
return {
|
|
1614
1672
|
...t,
|
|
1615
1673
|
goto: n,
|
|
1616
|
-
url: r
|
|
1674
|
+
url: r,
|
|
1675
|
+
request: i
|
|
1676
|
+
};
|
|
1677
|
+
}, _n = [
|
|
1678
|
+
i,
|
|
1679
|
+
a,
|
|
1680
|
+
t,
|
|
1681
|
+
d,
|
|
1682
|
+
c,
|
|
1683
|
+
l,
|
|
1684
|
+
o,
|
|
1685
|
+
f,
|
|
1686
|
+
r,
|
|
1687
|
+
n,
|
|
1688
|
+
u,
|
|
1689
|
+
mn,
|
|
1690
|
+
hn,
|
|
1691
|
+
s,
|
|
1692
|
+
m,
|
|
1693
|
+
A,
|
|
1694
|
+
j,
|
|
1695
|
+
Ge,
|
|
1696
|
+
Qe,
|
|
1697
|
+
et
|
|
1698
|
+
], vn = st.map((e) => e.id), yn = {
|
|
1699
|
+
interaction: "act.click",
|
|
1700
|
+
storage: "read.text",
|
|
1701
|
+
network: "network.fetchCredentialed",
|
|
1702
|
+
evaluation: "media.appearU"
|
|
1703
|
+
}, Z = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Q = _n, $ = /* @__PURE__ */ new Map(), bn = {};
|
|
1704
|
+
(() => {
|
|
1705
|
+
$ = new Map(Q.map((e) => [e.scope, e])), bn = Object.fromEntries($), Q.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
1706
|
+
let e = (e) => Q.filter((t) => t.category === e && Z(t.severity) === "bundled");
|
|
1707
|
+
Object.fromEntries(vn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(vn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
1708
|
+
})();
|
|
1709
|
+
var xn = (e) => $.get(e)?.category, Sn = (e) => {
|
|
1710
|
+
let t = $.get(e);
|
|
1711
|
+
return t && Z(t.severity);
|
|
1712
|
+
}, Cn = (e) => {
|
|
1713
|
+
let t = $.get(e);
|
|
1714
|
+
if (t) return Z(t.severity) === "critical" ? t.scope : t.category;
|
|
1715
|
+
}, wn = (e) => yn[e], Tn = ({ category: e, key: t }) => {
|
|
1716
|
+
let n = t ?? (e && wn(e));
|
|
1717
|
+
return n !== void 0 && xn(n) !== void 0 ? n : void 0;
|
|
1718
|
+
}, En = (e, t) => {
|
|
1719
|
+
for (let { category: n, key: r } of t) if (Tn({
|
|
1720
|
+
category: n,
|
|
1721
|
+
key: r
|
|
1722
|
+
}) === 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}"`);
|
|
1723
|
+
}, Dn = (e, t = {}) => {
|
|
1724
|
+
let n = [], r = e.map((e) => {
|
|
1725
|
+
let r = Tn(e), i = [];
|
|
1726
|
+
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1727
|
+
...t,
|
|
1728
|
+
key: r,
|
|
1729
|
+
scope: "",
|
|
1730
|
+
site: a,
|
|
1731
|
+
hosts: e.hosts,
|
|
1732
|
+
reason: e.reason
|
|
1733
|
+
});
|
|
1734
|
+
return {
|
|
1735
|
+
key: r !== void 0 && Sn(r) === "critical" ? r : void 0,
|
|
1736
|
+
category: e.category ?? (r === void 0 ? "interaction" : bn[r].category),
|
|
1737
|
+
hosts: e.hosts,
|
|
1738
|
+
indexes: i
|
|
1739
|
+
};
|
|
1740
|
+
});
|
|
1741
|
+
return {
|
|
1742
|
+
items: n,
|
|
1743
|
+
answer: (e) => r.map(({ key: t, category: n, hosts: r, indexes: i }) => ({
|
|
1744
|
+
category: n,
|
|
1745
|
+
...t === void 0 ? {} : { key: t },
|
|
1746
|
+
hosts: r,
|
|
1747
|
+
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1748
|
+
}))
|
|
1617
1749
|
};
|
|
1618
|
-
},
|
|
1619
|
-
|
|
1620
|
-
|
|
1750
|
+
}, On = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", kn = !1, An = () => {
|
|
1751
|
+
kn || (kn = !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."));
|
|
1752
|
+
}, jn = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1, permissions: i }) => {
|
|
1753
|
+
let a = crypto.randomUUID();
|
|
1754
|
+
if (X(e.src), pn({
|
|
1621
1755
|
src: e.src,
|
|
1622
1756
|
domains: t,
|
|
1623
1757
|
lockdown: r
|
|
1624
|
-
}), await
|
|
1625
|
-
e.dispatchEvent(new CustomEvent(
|
|
1626
|
-
let { executeLocator:
|
|
1627
|
-
marker:
|
|
1758
|
+
}), await D(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1759
|
+
e.dispatchEvent(new CustomEvent(On, { detail: a }));
|
|
1760
|
+
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, goto: u } = await O.attachFrame({
|
|
1761
|
+
marker: a,
|
|
1628
1762
|
domains: t,
|
|
1629
1763
|
syncCookies: n,
|
|
1630
1764
|
lockdown: r
|
|
1631
|
-
})
|
|
1632
|
-
return qt({
|
|
1765
|
+
}), d = gn({
|
|
1633
1766
|
executor: {
|
|
1634
|
-
execute:
|
|
1635
|
-
highlight:
|
|
1767
|
+
execute: o,
|
|
1768
|
+
highlight: s
|
|
1636
1769
|
},
|
|
1637
|
-
gate: (e) =>
|
|
1638
|
-
|
|
1770
|
+
gate: (e) => c(e.parts, e.operation, e.args),
|
|
1771
|
+
request: async (e) => (En("frame.request", e), await it(), l(e)),
|
|
1772
|
+
goto: (e, t = {}) => u({
|
|
1639
1773
|
url: e,
|
|
1640
1774
|
...t
|
|
1641
1775
|
}),
|
|
1642
1776
|
url: () => e.src
|
|
1643
1777
|
});
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1778
|
+
return i?.length && (rt() ? await d.request(i) : An()), d;
|
|
1779
|
+
}, Mn = "permissions.request: pass hosts, the sites the grant applies to", Nn = { request: async (e) => {
|
|
1780
|
+
let t = e.map((e) => {
|
|
1781
|
+
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
1782
|
+
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
1783
|
+
key: n,
|
|
1784
|
+
scope: r ?? "",
|
|
1785
|
+
reason: i
|
|
1786
|
+
} };
|
|
1787
|
+
let o = p(a ?? [], { ipv6: !0 });
|
|
1788
|
+
if (!o.length) throw TypeError(Mn);
|
|
1789
|
+
return { ask: {
|
|
1790
|
+
category: t,
|
|
1791
|
+
key: n,
|
|
1792
|
+
reason: i,
|
|
1793
|
+
hosts: o
|
|
1794
|
+
} };
|
|
1795
|
+
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
1796
|
+
En("permissions.request", n), n.length && await it();
|
|
1797
|
+
let { items: r, answer: i } = Dn(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await O.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
1798
|
+
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
1799
|
+
} }, Pn = (e) => typeof e == "object" && !!e, Fn = "PermissionDeniedError", In = (e) => e instanceof Error ? e.name === Fn : Pn(e) && e.name === "PermissionDeniedError";
|
|
1649
1800
|
//#endregion
|
|
1650
|
-
export {
|
|
1801
|
+
export { ge as $, Ze as A, Ne as B, st as C, $e as D, tt as E, qe as F, be as G, T as H, k as I, xe as J, Ae as K, Ve as L, Ge as M, A as N, Qe as O, Je as P, C as Q, Be as R, gt as S, nt as T, Fe as U, Pe as V, D as W, ye as X, ke as Y, _e as Z, yt as _, jn as a, bt as b, Sn as c, hn as d, ve as et, X as f, L as g, Ct as h, On as i, j, Ye as k, mn as l, fn as m, In as n, xn as o, pn as p, w as q, Nn as r, Cn as s, Fn as t, y as tt, gn as u, St as v, et as w, Tt as x, R as y, ze as z };
|