@makefully/notefully 0.2.2 → 0.2.4
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/README.md +7 -2
- package/dist/notefully.css +1 -1
- package/dist/notefully.iife.js +44 -33
- package/dist/notefully.js +950 -883
- package/package.json +1 -1
package/dist/notefully.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ve = {
|
|
2
2
|
"launcher.open": "Leave a note…",
|
|
3
3
|
"tool.crop": "Crop",
|
|
4
4
|
"tool.resetCrop": "Reset crop",
|
|
@@ -14,9 +14,21 @@ const me = {
|
|
|
14
14
|
"tool.video": "Record video",
|
|
15
15
|
"tool.stopVideo": "Stop",
|
|
16
16
|
"form.messagePlaceholder": "Describe the bug or the change you want…",
|
|
17
|
+
"form.placeholder.bug": "What did you expect to happen and what happened instead?",
|
|
18
|
+
"form.placeholder.idea": "What's your idea?",
|
|
19
|
+
"form.placeholder.other": "Describe what you are reporting in detail.",
|
|
20
|
+
"form.placeholder.custom": "{kind}: Describe what you are reporting in detail.",
|
|
21
|
+
"form.title.bug": "Report a Problem",
|
|
22
|
+
"form.title.idea": "Share an Idea",
|
|
23
|
+
"form.title.other": "Send Feedback",
|
|
24
|
+
"form.intro.bug": "Tell us what went wrong.",
|
|
25
|
+
"form.intro.idea": "Tell us what we could improve.",
|
|
26
|
+
"form.intro.other": "Let us know what you think.",
|
|
27
|
+
"form.screenshotNote": "A screenshot of this page is attached. Use the image tools to crop, annotate, remove, or retake the screenshot.",
|
|
17
28
|
"form.author": "Author",
|
|
18
29
|
"form.authorPlaceholder": "Anonymous",
|
|
19
|
-
"form.submit": "
|
|
30
|
+
"form.submit": "Send Report",
|
|
31
|
+
"form.close": "Close",
|
|
20
32
|
"form.done": "Done",
|
|
21
33
|
"form.success": "Submitted!",
|
|
22
34
|
"form.viewReport": "View Report",
|
|
@@ -33,6 +45,8 @@ const me = {
|
|
|
33
45
|
"status.screenshotFailed": "Screenshot failed; you can still send text.",
|
|
34
46
|
"status.recaptureFailed": "Recapture failed.",
|
|
35
47
|
"status.submitFailed": "Submit failed.",
|
|
48
|
+
"status.submitTooLarge": "Screenshot too large; retrying smaller…",
|
|
49
|
+
"status.submitWithoutImage": "Submitted without screenshot.",
|
|
36
50
|
"status.emptyReport": "Add a note, screenshot, or video first.",
|
|
37
51
|
"status.missingConfig": "Notefully is missing endpoint or projectKey.",
|
|
38
52
|
"status.speechUnsupported": "Speech recognition is not supported in this browser.",
|
|
@@ -55,9 +69,9 @@ const me = {
|
|
|
55
69
|
"diag.timezone": "Timezone",
|
|
56
70
|
"diag.viewport": "Viewport",
|
|
57
71
|
"diag.user": "User"
|
|
58
|
-
},
|
|
59
|
-
"en-US":
|
|
60
|
-
},
|
|
72
|
+
}, ke = {
|
|
73
|
+
"en-US": ve
|
|
74
|
+
}, De = {
|
|
61
75
|
en: "en-US",
|
|
62
76
|
no: "nb",
|
|
63
77
|
tl: "fil",
|
|
@@ -84,33 +98,33 @@ const me = {
|
|
|
84
98
|
"es-PR": ["es-419", "es"],
|
|
85
99
|
"es-CU": ["es-419", "es"]
|
|
86
100
|
}, ka = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
|
|
87
|
-
let
|
|
88
|
-
function
|
|
89
|
-
!e || !t || typeof t != "object" || (
|
|
101
|
+
let ue = "en-US", Pt = {};
|
|
102
|
+
function f(e, t) {
|
|
103
|
+
!e || !t || typeof t != "object" || (ke[String(e)] = t);
|
|
90
104
|
}
|
|
91
|
-
function
|
|
105
|
+
function ie(e) {
|
|
92
106
|
return String(e || "").trim().replace(/_/g, "-");
|
|
93
107
|
}
|
|
94
108
|
function ba(e) {
|
|
95
|
-
const t =
|
|
109
|
+
const t = ie(e);
|
|
96
110
|
if (!t)
|
|
97
111
|
return ["en-US"];
|
|
98
|
-
const a = t, o =
|
|
99
|
-
|
|
112
|
+
const a = t, o = De[a] || De[a.toLowerCase()] || a, s = [], i = (l) => {
|
|
113
|
+
l && !s.includes(l) && s.push(l);
|
|
100
114
|
};
|
|
101
115
|
i(o);
|
|
102
|
-
for (const [
|
|
103
|
-
|
|
116
|
+
for (const [l, u] of Object.entries(va))
|
|
117
|
+
l.toLowerCase() === o.toLowerCase() && u.forEach(i);
|
|
104
118
|
const r = o.split("-");
|
|
105
|
-
for (let
|
|
106
|
-
i(r.slice(0,
|
|
107
|
-
return i(
|
|
119
|
+
for (let l = r.length - 1; l >= 1; l -= 1)
|
|
120
|
+
i(r.slice(0, l).join("-"));
|
|
121
|
+
return i(De[r[0]] || r[0]), i("en-US"), s;
|
|
108
122
|
}
|
|
109
123
|
function wa(e) {
|
|
110
124
|
for (const t of ba(e)) {
|
|
111
|
-
if (
|
|
125
|
+
if (ke[t])
|
|
112
126
|
return t;
|
|
113
|
-
const a = Object.keys(
|
|
127
|
+
const a = Object.keys(ke).find(
|
|
114
128
|
(o) => o.toLowerCase() === t.toLowerCase()
|
|
115
129
|
);
|
|
116
130
|
if (a)
|
|
@@ -121,33 +135,33 @@ function wa(e) {
|
|
|
121
135
|
function Sa(e = {}) {
|
|
122
136
|
var t;
|
|
123
137
|
if (e.locale != null && String(e.locale).trim())
|
|
124
|
-
return
|
|
138
|
+
return ie(e.locale);
|
|
125
139
|
if (typeof document < "u") {
|
|
126
140
|
const a = (t = document.documentElement) == null ? void 0 : t.lang;
|
|
127
141
|
if (a && String(a).trim())
|
|
128
|
-
return
|
|
142
|
+
return ie(a);
|
|
129
143
|
}
|
|
130
|
-
return typeof navigator < "u" && navigator.language ?
|
|
144
|
+
return typeof navigator < "u" && navigator.language ? ie(navigator.language) : "en-US";
|
|
131
145
|
}
|
|
132
146
|
function Aa(e, t) {
|
|
133
|
-
return e != null && (
|
|
147
|
+
return e != null && (ue = ie(e) || "en-US"), ue;
|
|
134
148
|
}
|
|
135
149
|
function Ca(e) {
|
|
136
150
|
Pt = e && typeof e == "object" ? { ...e } : {};
|
|
137
151
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
152
|
+
function be() {
|
|
153
|
+
return ue;
|
|
140
154
|
}
|
|
141
|
-
function za(e =
|
|
142
|
-
const t =
|
|
155
|
+
function za(e = ue) {
|
|
156
|
+
const t = ie(e).split("-")[0].toLowerCase();
|
|
143
157
|
return ka.has(t) ? "rtl" : "ltr";
|
|
144
158
|
}
|
|
145
|
-
function
|
|
146
|
-
const a = String(e || ""), o = wa(
|
|
147
|
-
let i = Pt[a] ?? s[a] ??
|
|
148
|
-
return String(i);
|
|
159
|
+
function p(e, t) {
|
|
160
|
+
const a = String(e || ""), o = wa(ue), s = ke[o] || ve;
|
|
161
|
+
let i = Pt[a] ?? s[a] ?? ve[a] ?? a;
|
|
162
|
+
return t && typeof t == "object" && (i = String(i).replace(/\{(\w+)\}/g, (r, l) => t[l] == null ? `{${l}}` : String(t[l]))), String(i);
|
|
149
163
|
}
|
|
150
|
-
const
|
|
164
|
+
const Ea = {
|
|
151
165
|
"launcher.open": "Оставете бележка...",
|
|
152
166
|
"tool.crop": "Реколта",
|
|
153
167
|
"tool.resetCrop": "Нулиране на изрязването",
|
|
@@ -204,7 +218,7 @@ const ja = {
|
|
|
204
218
|
"diag.timezone": "Часова зона",
|
|
205
219
|
"diag.viewport": "Изгледна плоча",
|
|
206
220
|
"diag.user": "Потребител"
|
|
207
|
-
},
|
|
221
|
+
}, ja = {
|
|
208
222
|
"launcher.open": "Deixa una nota...",
|
|
209
223
|
"tool.crop": "Cultiu",
|
|
210
224
|
"tool.resetCrop": "Restablir el cultiu",
|
|
@@ -375,7 +389,7 @@ const ja = {
|
|
|
375
389
|
"diag.timezone": "Tidszone",
|
|
376
390
|
"diag.viewport": "Viewport",
|
|
377
391
|
"diag.user": "Bruger"
|
|
378
|
-
},
|
|
392
|
+
}, xa = {
|
|
379
393
|
"launcher.open": "Hinterlassen Sie eine Notiz...",
|
|
380
394
|
"tool.crop": "Ernte",
|
|
381
395
|
"tool.resetCrop": "Zuschnitt zurücksetzen",
|
|
@@ -432,7 +446,7 @@ const ja = {
|
|
|
432
446
|
"diag.timezone": "Zeitzone",
|
|
433
447
|
"diag.viewport": "Sichtfenster",
|
|
434
448
|
"diag.user": "Nutzer"
|
|
435
|
-
},
|
|
449
|
+
}, La = {
|
|
436
450
|
"launcher.open": "Αφήστε ένα σημείωμα...",
|
|
437
451
|
"tool.crop": "Καλλιέργεια",
|
|
438
452
|
"tool.resetCrop": "Επαναφορά της καλλιέργειας",
|
|
@@ -505,9 +519,21 @@ const ja = {
|
|
|
505
519
|
"tool.video": "Record video",
|
|
506
520
|
"tool.stopVideo": "Stop",
|
|
507
521
|
"form.messagePlaceholder": "Describe the bug or the change you want…",
|
|
522
|
+
"form.placeholder.bug": "What did you expect to happen and what happened instead?",
|
|
523
|
+
"form.placeholder.idea": "What's your idea?",
|
|
524
|
+
"form.placeholder.other": "Describe what you are reporting in detail.",
|
|
525
|
+
"form.placeholder.custom": "{kind}: Describe what you are reporting in detail.",
|
|
526
|
+
"form.title.bug": "Report a Problem",
|
|
527
|
+
"form.title.idea": "Share an Idea",
|
|
528
|
+
"form.title.other": "Send Feedback",
|
|
529
|
+
"form.intro.bug": "Tell us what went wrong.",
|
|
530
|
+
"form.intro.idea": "Tell us what we could improve.",
|
|
531
|
+
"form.intro.other": "Let us know what you think.",
|
|
532
|
+
"form.screenshotNote": "A screenshot of this page is attached. Use the image tools to crop, annotate, remove, or retake the screenshot.",
|
|
508
533
|
"form.author": "Author",
|
|
509
534
|
"form.authorPlaceholder": "Anonymous",
|
|
510
|
-
"form.submit": "
|
|
535
|
+
"form.submit": "Send Report",
|
|
536
|
+
"form.close": "Close",
|
|
511
537
|
"form.done": "Done",
|
|
512
538
|
"form.success": "Submitted!",
|
|
513
539
|
"form.viewReport": "View Report",
|
|
@@ -524,6 +550,8 @@ const ja = {
|
|
|
524
550
|
"status.screenshotFailed": "Screenshot failed; you can still send text.",
|
|
525
551
|
"status.recaptureFailed": "Recapture failed.",
|
|
526
552
|
"status.submitFailed": "Submit failed.",
|
|
553
|
+
"status.submitTooLarge": "Screenshot too large; retrying smaller…",
|
|
554
|
+
"status.submitWithoutImage": "Submitted without screenshot.",
|
|
527
555
|
"status.emptyReport": "Add a note, screenshot, or video first.",
|
|
528
556
|
"status.missingConfig": "Notefully is missing endpoint or projectKey.",
|
|
529
557
|
"status.speechUnsupported": "Speech recognition is not supported in this browser.",
|
|
@@ -660,7 +688,7 @@ const ja = {
|
|
|
660
688
|
"diag.timezone": "Zona horaria",
|
|
661
689
|
"diag.viewport": "ViEWPORT",
|
|
662
690
|
"diag.user": "Usuario"
|
|
663
|
-
},
|
|
691
|
+
}, Da = {
|
|
664
692
|
"launcher.open": "Jäta märkus...",
|
|
665
693
|
"tool.crop": "Põllukultuur",
|
|
666
694
|
"tool.resetCrop": "Lähtesta põllukultuur",
|
|
@@ -717,7 +745,7 @@ const ja = {
|
|
|
717
745
|
"diag.timezone": "Ajavöönd",
|
|
718
746
|
"diag.viewport": "Vaatenurk",
|
|
719
747
|
"diag.user": "Kasutaja"
|
|
720
|
-
},
|
|
748
|
+
}, Oa = {
|
|
721
749
|
"launcher.open": "Jätä muistiinpano...",
|
|
722
750
|
"tool.crop": "Viljely",
|
|
723
751
|
"tool.resetCrop": "Nollaa rajaus",
|
|
@@ -2371,46 +2399,46 @@ const ja = {
|
|
|
2371
2399
|
"diag.viewport": "視埠",
|
|
2372
2400
|
"diag.user": "使用者"
|
|
2373
2401
|
};
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2402
|
+
f("en-US", ve);
|
|
2403
|
+
f("bg", Ea);
|
|
2404
|
+
f("ca", ja);
|
|
2405
|
+
f("cs", Ra);
|
|
2406
|
+
f("da", Pa);
|
|
2407
|
+
f("de", xa);
|
|
2408
|
+
f("el", La);
|
|
2409
|
+
f("en-GB", Ua);
|
|
2410
|
+
f("es", Ta);
|
|
2411
|
+
f("es-419", Fa);
|
|
2412
|
+
f("et", Da);
|
|
2413
|
+
f("fi", Oa);
|
|
2414
|
+
f("fr", Ma);
|
|
2415
|
+
f("hi", Ia);
|
|
2416
|
+
f("hr", Va);
|
|
2417
|
+
f("hu", $a);
|
|
2418
|
+
f("id", Ba);
|
|
2419
|
+
f("it", Na);
|
|
2420
|
+
f("ja", Ka);
|
|
2421
|
+
f("ko", Ha);
|
|
2422
|
+
f("lt", Ga);
|
|
2423
|
+
f("lv", qa);
|
|
2424
|
+
f("nb", _a);
|
|
2425
|
+
f("nl", Wa);
|
|
2426
|
+
f("pl", Za);
|
|
2427
|
+
f("pt-BR", Ja);
|
|
2428
|
+
f("pt-PT", Ya);
|
|
2429
|
+
f("ro", Xa);
|
|
2430
|
+
f("ru", Qa);
|
|
2431
|
+
f("sk", eo);
|
|
2432
|
+
f("sl", to);
|
|
2433
|
+
f("sr", ao);
|
|
2434
|
+
f("sv", oo);
|
|
2435
|
+
f("fil", io);
|
|
2436
|
+
f("th", so);
|
|
2437
|
+
f("tr", ro);
|
|
2438
|
+
f("uk", no);
|
|
2439
|
+
f("vi", lo);
|
|
2440
|
+
f("zh-CN", uo);
|
|
2441
|
+
f("zh-TW", co);
|
|
2414
2442
|
function po(e, t) {
|
|
2415
2443
|
if (e.match(/^[a-z]+:\/\//i))
|
|
2416
2444
|
return e;
|
|
@@ -2429,29 +2457,29 @@ const go = /* @__PURE__ */ (() => {
|
|
|
2429
2457
|
);
|
|
2430
2458
|
return () => (e += 1, `u${t()}${e}`);
|
|
2431
2459
|
})();
|
|
2432
|
-
function
|
|
2460
|
+
function J(e) {
|
|
2433
2461
|
const t = [];
|
|
2434
2462
|
for (let a = 0, o = e.length; a < o; a++)
|
|
2435
2463
|
t.push(e[a]);
|
|
2436
2464
|
return t;
|
|
2437
2465
|
}
|
|
2438
|
-
let
|
|
2439
|
-
function
|
|
2440
|
-
return
|
|
2466
|
+
let ae = null;
|
|
2467
|
+
function xt(e = {}) {
|
|
2468
|
+
return ae || (e.includeStyleProperties ? (ae = e.includeStyleProperties, ae) : (ae = J(window.getComputedStyle(document.documentElement)), ae));
|
|
2441
2469
|
}
|
|
2442
|
-
function
|
|
2470
|
+
function we(e, t) {
|
|
2443
2471
|
const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
2444
2472
|
return o ? parseFloat(o.replace("px", "")) : 0;
|
|
2445
2473
|
}
|
|
2446
2474
|
function mo(e) {
|
|
2447
|
-
const t =
|
|
2475
|
+
const t = we(e, "border-left-width"), a = we(e, "border-right-width");
|
|
2448
2476
|
return e.clientWidth + t + a;
|
|
2449
2477
|
}
|
|
2450
2478
|
function ho(e) {
|
|
2451
|
-
const t =
|
|
2479
|
+
const t = we(e, "border-top-width"), a = we(e, "border-bottom-width");
|
|
2452
2480
|
return e.clientHeight + t + a;
|
|
2453
2481
|
}
|
|
2454
|
-
function
|
|
2482
|
+
function Lt(e, t = {}) {
|
|
2455
2483
|
const a = t.width || mo(e), o = t.height || ho(e);
|
|
2456
2484
|
return { width: a, height: o };
|
|
2457
2485
|
}
|
|
@@ -2464,11 +2492,11 @@ function fo() {
|
|
|
2464
2492
|
const a = t && t.env ? t.env.devicePixelRatio : null;
|
|
2465
2493
|
return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
2466
2494
|
}
|
|
2467
|
-
const
|
|
2495
|
+
const U = 16384;
|
|
2468
2496
|
function yo(e) {
|
|
2469
|
-
(e.width >
|
|
2497
|
+
(e.width > U || e.height > U) && (e.width > U && e.height > U ? e.width > e.height ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U) : e.width > U ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U));
|
|
2470
2498
|
}
|
|
2471
|
-
function
|
|
2499
|
+
function Se(e) {
|
|
2472
2500
|
return new Promise((t, a) => {
|
|
2473
2501
|
const o = new Image();
|
|
2474
2502
|
o.onload = () => {
|
|
@@ -2485,18 +2513,18 @@ async function ko(e, t, a) {
|
|
|
2485
2513
|
const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
|
|
2486
2514
|
return s.setAttribute("width", `${t}`), s.setAttribute("height", `${a}`), s.setAttribute("viewBox", `0 0 ${t} ${a}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), s.appendChild(i), i.appendChild(e), vo(s);
|
|
2487
2515
|
}
|
|
2488
|
-
const
|
|
2516
|
+
const L = (e, t) => {
|
|
2489
2517
|
if (e instanceof t)
|
|
2490
2518
|
return !0;
|
|
2491
2519
|
const a = Object.getPrototypeOf(e);
|
|
2492
|
-
return a === null ? !1 : a.constructor.name === t.name ||
|
|
2520
|
+
return a === null ? !1 : a.constructor.name === t.name || L(a, t);
|
|
2493
2521
|
};
|
|
2494
2522
|
function bo(e) {
|
|
2495
2523
|
const t = e.getPropertyValue("content");
|
|
2496
2524
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
2497
2525
|
}
|
|
2498
2526
|
function wo(e, t) {
|
|
2499
|
-
return
|
|
2527
|
+
return xt(t).map((a) => {
|
|
2500
2528
|
const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
|
|
2501
2529
|
return `${a}: ${o}${s ? " !important" : ""};`;
|
|
2502
2530
|
}).join(" ");
|
|
@@ -2505,7 +2533,7 @@ function So(e, t, a, o) {
|
|
|
2505
2533
|
const s = `.${e}:${t}`, i = a.cssText ? bo(a) : wo(a, o);
|
|
2506
2534
|
return document.createTextNode(`${s}{${i}}`);
|
|
2507
2535
|
}
|
|
2508
|
-
function
|
|
2536
|
+
function it(e, t, a, o) {
|
|
2509
2537
|
const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
|
|
2510
2538
|
if (i === "" || i === "none")
|
|
2511
2539
|
return;
|
|
@@ -2515,20 +2543,20 @@ function st(e, t, a, o) {
|
|
|
2515
2543
|
} catch {
|
|
2516
2544
|
return;
|
|
2517
2545
|
}
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2546
|
+
const l = document.createElement("style");
|
|
2547
|
+
l.appendChild(So(r, a, s, o)), t.appendChild(l);
|
|
2520
2548
|
}
|
|
2521
2549
|
function Ao(e, t, a) {
|
|
2522
|
-
|
|
2550
|
+
it(e, t, ":before", a), it(e, t, ":after", a);
|
|
2523
2551
|
}
|
|
2524
|
-
const
|
|
2525
|
-
woff:
|
|
2526
|
-
woff2:
|
|
2552
|
+
const st = "application/font-woff", rt = "image/jpeg", Co = {
|
|
2553
|
+
woff: st,
|
|
2554
|
+
woff2: st,
|
|
2527
2555
|
ttf: "application/font-truetype",
|
|
2528
2556
|
eot: "application/vnd.ms-fontobject",
|
|
2529
2557
|
png: "image/png",
|
|
2530
|
-
jpg:
|
|
2531
|
-
jpeg:
|
|
2558
|
+
jpg: rt,
|
|
2559
|
+
jpeg: rt,
|
|
2532
2560
|
gif: "image/gif",
|
|
2533
2561
|
tiff: "image/tiff",
|
|
2534
2562
|
svg: "image/svg+xml",
|
|
@@ -2538,17 +2566,17 @@ function zo(e) {
|
|
|
2538
2566
|
const t = /\.([^./]*?)$/g.exec(e);
|
|
2539
2567
|
return t ? t[1] : "";
|
|
2540
2568
|
}
|
|
2541
|
-
function
|
|
2569
|
+
function _e(e) {
|
|
2542
2570
|
const t = zo(e).toLowerCase();
|
|
2543
2571
|
return Co[t] || "";
|
|
2544
2572
|
}
|
|
2545
|
-
function
|
|
2573
|
+
function Eo(e) {
|
|
2546
2574
|
return e.split(/,/)[1];
|
|
2547
2575
|
}
|
|
2548
|
-
function
|
|
2576
|
+
function Be(e) {
|
|
2549
2577
|
return e.search(/^(data:)/) !== -1;
|
|
2550
2578
|
}
|
|
2551
|
-
function
|
|
2579
|
+
function jo(e, t) {
|
|
2552
2580
|
return `data:${t};base64,${e}`;
|
|
2553
2581
|
}
|
|
2554
2582
|
async function Ut(e, t, a) {
|
|
@@ -2557,62 +2585,62 @@ async function Ut(e, t, a) {
|
|
|
2557
2585
|
throw new Error(`Resource "${o.url}" not found`);
|
|
2558
2586
|
const s = await o.blob();
|
|
2559
2587
|
return new Promise((i, r) => {
|
|
2560
|
-
const
|
|
2561
|
-
|
|
2588
|
+
const l = new FileReader();
|
|
2589
|
+
l.onerror = r, l.onloadend = () => {
|
|
2562
2590
|
try {
|
|
2563
|
-
i(a({ res: o, result:
|
|
2591
|
+
i(a({ res: o, result: l.result }));
|
|
2564
2592
|
} catch (u) {
|
|
2565
2593
|
r(u);
|
|
2566
2594
|
}
|
|
2567
|
-
},
|
|
2595
|
+
}, l.readAsDataURL(s);
|
|
2568
2596
|
});
|
|
2569
2597
|
}
|
|
2570
|
-
const
|
|
2598
|
+
const Oe = {};
|
|
2571
2599
|
function Ro(e, t, a) {
|
|
2572
2600
|
let o = e.replace(/\?.*/, "");
|
|
2573
2601
|
return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
|
|
2574
2602
|
}
|
|
2575
|
-
async function
|
|
2603
|
+
async function We(e, t, a) {
|
|
2576
2604
|
const o = Ro(e, t, a.includeQueryParams);
|
|
2577
|
-
if (
|
|
2578
|
-
return
|
|
2605
|
+
if (Oe[o] != null)
|
|
2606
|
+
return Oe[o];
|
|
2579
2607
|
a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
2580
2608
|
let s;
|
|
2581
2609
|
try {
|
|
2582
|
-
const i = await Ut(e, a.fetchRequestInit, ({ res: r, result:
|
|
2583
|
-
s =
|
|
2610
|
+
const i = await Ut(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Eo(l)));
|
|
2611
|
+
s = jo(i, t);
|
|
2584
2612
|
} catch (i) {
|
|
2585
2613
|
s = a.imagePlaceholder || "";
|
|
2586
2614
|
let r = `Failed to fetch resource: ${e}`;
|
|
2587
2615
|
i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
|
|
2588
2616
|
}
|
|
2589
|
-
return
|
|
2617
|
+
return Oe[o] = s, s;
|
|
2590
2618
|
}
|
|
2591
2619
|
async function Po(e) {
|
|
2592
2620
|
const t = e.toDataURL();
|
|
2593
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
2621
|
+
return t === "data:," ? e.cloneNode(!1) : Se(t);
|
|
2594
2622
|
}
|
|
2595
|
-
async function
|
|
2623
|
+
async function xo(e, t) {
|
|
2596
2624
|
if (e.currentSrc) {
|
|
2597
2625
|
const i = document.createElement("canvas"), r = i.getContext("2d");
|
|
2598
2626
|
i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
|
|
2599
|
-
const
|
|
2600
|
-
return
|
|
2627
|
+
const l = i.toDataURL();
|
|
2628
|
+
return Se(l);
|
|
2601
2629
|
}
|
|
2602
|
-
const a = e.poster, o =
|
|
2603
|
-
return
|
|
2630
|
+
const a = e.poster, o = _e(a), s = await We(a, o, t);
|
|
2631
|
+
return Se(s);
|
|
2604
2632
|
}
|
|
2605
|
-
async function
|
|
2633
|
+
async function Lo(e, t) {
|
|
2606
2634
|
var a;
|
|
2607
2635
|
try {
|
|
2608
2636
|
if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
|
|
2609
|
-
return await
|
|
2637
|
+
return await xe(e.contentDocument.body, t, !0);
|
|
2610
2638
|
} catch {
|
|
2611
2639
|
}
|
|
2612
2640
|
return e.cloneNode(!1);
|
|
2613
2641
|
}
|
|
2614
2642
|
async function Uo(e, t) {
|
|
2615
|
-
return
|
|
2643
|
+
return L(e, HTMLCanvasElement) ? Po(e) : L(e, HTMLVideoElement) ? xo(e, t) : L(e, HTMLIFrameElement) ? Lo(e, t) : e.cloneNode(Tt(e));
|
|
2616
2644
|
}
|
|
2617
2645
|
const To = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Tt = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
2618
2646
|
async function Fo(e, t, a) {
|
|
@@ -2620,31 +2648,31 @@ async function Fo(e, t, a) {
|
|
|
2620
2648
|
if (Tt(t))
|
|
2621
2649
|
return t;
|
|
2622
2650
|
let i = [];
|
|
2623
|
-
return To(e) && e.assignedNodes ? i =
|
|
2651
|
+
return To(e) && e.assignedNodes ? i = J(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = J(e.contentDocument.body.childNodes) : i = J(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => xe(l, a)).then((u) => {
|
|
2624
2652
|
u && t.appendChild(u);
|
|
2625
2653
|
}), Promise.resolve()), t;
|
|
2626
2654
|
}
|
|
2627
|
-
function
|
|
2655
|
+
function Do(e, t, a) {
|
|
2628
2656
|
const o = t.style;
|
|
2629
2657
|
if (!o)
|
|
2630
2658
|
return;
|
|
2631
2659
|
const s = window.getComputedStyle(e);
|
|
2632
|
-
s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) :
|
|
2660
|
+
s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : xt(a).forEach((i) => {
|
|
2633
2661
|
let r = s.getPropertyValue(i);
|
|
2634
|
-
i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`),
|
|
2662
|
+
i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`), L(e, HTMLIFrameElement) && i === "display" && r === "inline" && (r = "block"), i === "d" && t.getAttribute("d") && (r = `path(${t.getAttribute("d")})`), o.setProperty(i, r, s.getPropertyPriority(i));
|
|
2635
2663
|
});
|
|
2636
2664
|
}
|
|
2637
|
-
function
|
|
2638
|
-
|
|
2665
|
+
function Oo(e, t) {
|
|
2666
|
+
L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
2639
2667
|
}
|
|
2640
2668
|
function Mo(e, t) {
|
|
2641
|
-
if (
|
|
2669
|
+
if (L(e, HTMLSelectElement)) {
|
|
2642
2670
|
const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
|
|
2643
2671
|
o && o.setAttribute("selected", "");
|
|
2644
2672
|
}
|
|
2645
2673
|
}
|
|
2646
2674
|
function Io(e, t, a) {
|
|
2647
|
-
return
|
|
2675
|
+
return L(t, Element) && (Do(e, t, a), Ao(e, t, a), Oo(e, t), Mo(e, t)), t;
|
|
2648
2676
|
}
|
|
2649
2677
|
async function Vo(e, t) {
|
|
2650
2678
|
const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
@@ -2652,25 +2680,25 @@ async function Vo(e, t) {
|
|
|
2652
2680
|
return e;
|
|
2653
2681
|
const o = {};
|
|
2654
2682
|
for (let i = 0; i < a.length; i++) {
|
|
2655
|
-
const
|
|
2656
|
-
if (
|
|
2657
|
-
const u = e.querySelector(
|
|
2658
|
-
!u &&
|
|
2683
|
+
const l = a[i].getAttribute("xlink:href");
|
|
2684
|
+
if (l) {
|
|
2685
|
+
const u = e.querySelector(l), c = document.querySelector(l);
|
|
2686
|
+
!u && c && !o[l] && (o[l] = await xe(c, t, !0));
|
|
2659
2687
|
}
|
|
2660
2688
|
}
|
|
2661
2689
|
const s = Object.values(o);
|
|
2662
2690
|
if (s.length) {
|
|
2663
2691
|
const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
|
|
2664
2692
|
r.setAttribute("xmlns", i), r.style.position = "absolute", r.style.width = "0", r.style.height = "0", r.style.overflow = "hidden", r.style.display = "none";
|
|
2665
|
-
const
|
|
2666
|
-
r.appendChild(
|
|
2693
|
+
const l = document.createElementNS(i, "defs");
|
|
2694
|
+
r.appendChild(l);
|
|
2667
2695
|
for (let u = 0; u < s.length; u++)
|
|
2668
|
-
|
|
2696
|
+
l.appendChild(s[u]);
|
|
2669
2697
|
e.appendChild(r);
|
|
2670
2698
|
}
|
|
2671
2699
|
return e;
|
|
2672
2700
|
}
|
|
2673
|
-
async function
|
|
2701
|
+
async function xe(e, t, a) {
|
|
2674
2702
|
return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => Uo(o, t)).then((o) => Fo(e, o, t)).then((o) => Io(e, o, t)).then((o) => Vo(o, t));
|
|
2675
2703
|
}
|
|
2676
2704
|
const Ft = /url\((['"]?)([^'"]+?)\1\)/g, $o = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Bo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
@@ -2680,13 +2708,13 @@ function No(e) {
|
|
|
2680
2708
|
}
|
|
2681
2709
|
function Ko(e) {
|
|
2682
2710
|
const t = [];
|
|
2683
|
-
return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) =>
|
|
2711
|
+
return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
|
|
2684
2712
|
}
|
|
2685
2713
|
async function Ho(e, t, a, o, s) {
|
|
2686
2714
|
try {
|
|
2687
|
-
const i = a ? po(t, a) : t, r =
|
|
2688
|
-
let
|
|
2689
|
-
return s || (
|
|
2715
|
+
const i = a ? po(t, a) : t, r = _e(t);
|
|
2716
|
+
let l;
|
|
2717
|
+
return s || (l = await We(i, r, o)), e.replace(No(t), `$1${l}$3`);
|
|
2690
2718
|
} catch {
|
|
2691
2719
|
}
|
|
2692
2720
|
return e;
|
|
@@ -2702,50 +2730,50 @@ function Go(e, { preferredFontFormat: t }) {
|
|
|
2702
2730
|
}
|
|
2703
2731
|
}) : e;
|
|
2704
2732
|
}
|
|
2705
|
-
function
|
|
2733
|
+
function Dt(e) {
|
|
2706
2734
|
return e.search(Ft) !== -1;
|
|
2707
2735
|
}
|
|
2708
|
-
async function
|
|
2709
|
-
if (!
|
|
2736
|
+
async function Ot(e, t, a) {
|
|
2737
|
+
if (!Dt(e))
|
|
2710
2738
|
return e;
|
|
2711
2739
|
const o = Go(e, a);
|
|
2712
|
-
return Ko(o).reduce((i, r) => i.then((
|
|
2740
|
+
return Ko(o).reduce((i, r) => i.then((l) => Ho(l, r, t, a)), Promise.resolve(o));
|
|
2713
2741
|
}
|
|
2714
|
-
async function
|
|
2742
|
+
async function oe(e, t, a) {
|
|
2715
2743
|
var o;
|
|
2716
2744
|
const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
|
|
2717
2745
|
if (s) {
|
|
2718
|
-
const i = await
|
|
2746
|
+
const i = await Ot(s, null, a);
|
|
2719
2747
|
return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
|
|
2720
2748
|
}
|
|
2721
2749
|
return !1;
|
|
2722
2750
|
}
|
|
2723
2751
|
async function qo(e, t) {
|
|
2724
|
-
await
|
|
2752
|
+
await oe("background", e, t) || await oe("background-image", e, t), await oe("mask", e, t) || await oe("-webkit-mask", e, t) || await oe("mask-image", e, t) || await oe("-webkit-mask-image", e, t);
|
|
2725
2753
|
}
|
|
2726
2754
|
async function _o(e, t) {
|
|
2727
|
-
const a =
|
|
2728
|
-
if (!(a &&
|
|
2755
|
+
const a = L(e, HTMLImageElement);
|
|
2756
|
+
if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
|
|
2729
2757
|
return;
|
|
2730
|
-
const o = a ? e.src : e.href.baseVal, s = await
|
|
2758
|
+
const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
|
|
2731
2759
|
await new Promise((i, r) => {
|
|
2732
2760
|
e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
|
|
2733
2761
|
try {
|
|
2734
2762
|
i(t.onImageErrorHandler(...u));
|
|
2735
|
-
} catch (
|
|
2736
|
-
r(
|
|
2763
|
+
} catch (c) {
|
|
2764
|
+
r(c);
|
|
2737
2765
|
}
|
|
2738
2766
|
} : r;
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2767
|
+
const l = e;
|
|
2768
|
+
l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
|
|
2741
2769
|
});
|
|
2742
2770
|
}
|
|
2743
2771
|
async function Wo(e, t) {
|
|
2744
|
-
const o =
|
|
2772
|
+
const o = J(e.childNodes).map((s) => Mt(s, t));
|
|
2745
2773
|
await Promise.all(o).then(() => e);
|
|
2746
2774
|
}
|
|
2747
2775
|
async function Mt(e, t) {
|
|
2748
|
-
|
|
2776
|
+
L(e, Element) && (await qo(e, t), await _o(e, t), await Wo(e, t));
|
|
2749
2777
|
}
|
|
2750
2778
|
function Zo(e, t) {
|
|
2751
2779
|
const { style: a } = e;
|
|
@@ -2755,19 +2783,19 @@ function Zo(e, t) {
|
|
|
2755
2783
|
a[s] = o[s];
|
|
2756
2784
|
}), e;
|
|
2757
2785
|
}
|
|
2758
|
-
const
|
|
2759
|
-
async function
|
|
2760
|
-
let t =
|
|
2786
|
+
const nt = {};
|
|
2787
|
+
async function lt(e) {
|
|
2788
|
+
let t = nt[e];
|
|
2761
2789
|
if (t != null)
|
|
2762
2790
|
return t;
|
|
2763
2791
|
const o = await (await fetch(e)).text();
|
|
2764
|
-
return t = { url: e, cssText: o },
|
|
2792
|
+
return t = { url: e, cssText: o }, nt[e] = t, t;
|
|
2765
2793
|
}
|
|
2766
|
-
async function
|
|
2794
|
+
async function ut(e, t) {
|
|
2767
2795
|
let a = e.cssText;
|
|
2768
2796
|
const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
|
|
2769
|
-
let
|
|
2770
|
-
return
|
|
2797
|
+
let l = r.replace(o, "$1");
|
|
2798
|
+
return l.startsWith("https://") || (l = new URL(l, e.url).href), Ut(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
|
|
2771
2799
|
});
|
|
2772
2800
|
return Promise.all(i).then(() => a);
|
|
2773
2801
|
}
|
|
@@ -2784,15 +2812,15 @@ function ct(e) {
|
|
|
2784
2812
|
t.push(u[0]);
|
|
2785
2813
|
}
|
|
2786
2814
|
o = o.replace(s, "");
|
|
2787
|
-
const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",
|
|
2815
|
+
const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", l = new RegExp(r, "gi");
|
|
2788
2816
|
for (; ; ) {
|
|
2789
2817
|
let u = i.exec(o);
|
|
2790
2818
|
if (u === null) {
|
|
2791
|
-
if (u =
|
|
2819
|
+
if (u = l.exec(o), u === null)
|
|
2792
2820
|
break;
|
|
2793
|
-
i.lastIndex =
|
|
2821
|
+
i.lastIndex = l.lastIndex;
|
|
2794
2822
|
} else
|
|
2795
|
-
|
|
2823
|
+
l.lastIndex = i.lastIndex;
|
|
2796
2824
|
t.push(u[0]);
|
|
2797
2825
|
}
|
|
2798
2826
|
return t;
|
|
@@ -2802,36 +2830,36 @@ async function Jo(e, t) {
|
|
|
2802
2830
|
return e.forEach((s) => {
|
|
2803
2831
|
if ("cssRules" in s)
|
|
2804
2832
|
try {
|
|
2805
|
-
|
|
2833
|
+
J(s.cssRules || []).forEach((i, r) => {
|
|
2806
2834
|
if (i.type === CSSRule.IMPORT_RULE) {
|
|
2807
|
-
let
|
|
2808
|
-
const u = i.href,
|
|
2835
|
+
let l = r + 1;
|
|
2836
|
+
const u = i.href, c = lt(u).then((g) => ut(g, t)).then((g) => ct(g).forEach((v) => {
|
|
2809
2837
|
try {
|
|
2810
|
-
s.insertRule(
|
|
2811
|
-
} catch (
|
|
2838
|
+
s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
|
|
2839
|
+
} catch (k) {
|
|
2812
2840
|
console.error("Error inserting rule from remote css", {
|
|
2813
|
-
rule:
|
|
2814
|
-
error:
|
|
2841
|
+
rule: v,
|
|
2842
|
+
error: k
|
|
2815
2843
|
});
|
|
2816
2844
|
}
|
|
2817
|
-
})).catch((
|
|
2818
|
-
console.error("Error loading remote css",
|
|
2845
|
+
})).catch((g) => {
|
|
2846
|
+
console.error("Error loading remote css", g.toString());
|
|
2819
2847
|
});
|
|
2820
|
-
o.push(
|
|
2848
|
+
o.push(c);
|
|
2821
2849
|
}
|
|
2822
2850
|
});
|
|
2823
2851
|
} catch (i) {
|
|
2824
|
-
const r = e.find((
|
|
2825
|
-
s.href != null && o.push(
|
|
2852
|
+
const r = e.find((l) => l.href == null) || document.styleSheets[0];
|
|
2853
|
+
s.href != null && o.push(lt(s.href).then((l) => ut(l, t)).then((l) => ct(l).forEach((u) => {
|
|
2826
2854
|
r.insertRule(u, r.cssRules.length);
|
|
2827
|
-
})).catch((
|
|
2828
|
-
console.error("Error loading remote stylesheet",
|
|
2855
|
+
})).catch((l) => {
|
|
2856
|
+
console.error("Error loading remote stylesheet", l);
|
|
2829
2857
|
})), console.error("Error inlining remote css file", i);
|
|
2830
2858
|
}
|
|
2831
2859
|
}), Promise.all(o).then(() => (e.forEach((s) => {
|
|
2832
2860
|
if ("cssRules" in s)
|
|
2833
2861
|
try {
|
|
2834
|
-
|
|
2862
|
+
J(s.cssRules || []).forEach((i) => {
|
|
2835
2863
|
a.push(i);
|
|
2836
2864
|
});
|
|
2837
2865
|
} catch (i) {
|
|
@@ -2840,12 +2868,12 @@ async function Jo(e, t) {
|
|
|
2840
2868
|
}), a));
|
|
2841
2869
|
}
|
|
2842
2870
|
function Yo(e) {
|
|
2843
|
-
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) =>
|
|
2871
|
+
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Dt(t.style.getPropertyValue("src")));
|
|
2844
2872
|
}
|
|
2845
2873
|
async function Xo(e, t) {
|
|
2846
2874
|
if (e.ownerDocument == null)
|
|
2847
2875
|
throw new Error("Provided element is not within a Document");
|
|
2848
|
-
const a =
|
|
2876
|
+
const a = J(e.ownerDocument.styleSheets), o = await Jo(a, t);
|
|
2849
2877
|
return Yo(o);
|
|
2850
2878
|
}
|
|
2851
2879
|
function It(e) {
|
|
@@ -2866,7 +2894,7 @@ async function ei(e, t) {
|
|
|
2866
2894
|
const a = await Xo(e, t), o = Qo(e);
|
|
2867
2895
|
return (await Promise.all(a.filter((i) => o.has(It(i.style.fontFamily))).map((i) => {
|
|
2868
2896
|
const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
|
|
2869
|
-
return
|
|
2897
|
+
return Ot(i.cssText, r, t);
|
|
2870
2898
|
}))).join(`
|
|
2871
2899
|
`);
|
|
2872
2900
|
}
|
|
@@ -2878,19 +2906,19 @@ async function ti(e, t) {
|
|
|
2878
2906
|
}
|
|
2879
2907
|
}
|
|
2880
2908
|
async function ai(e, t = {}) {
|
|
2881
|
-
const { width: a, height: o } =
|
|
2909
|
+
const { width: a, height: o } = Lt(e, t), s = await xe(e, t, !0);
|
|
2882
2910
|
return await ti(s, t), await Mt(s, t), Zo(s, t), await ko(s, a, o);
|
|
2883
2911
|
}
|
|
2884
2912
|
async function oi(e, t = {}) {
|
|
2885
|
-
const { width: a, height: o } =
|
|
2886
|
-
return r.width =
|
|
2913
|
+
const { width: a, height: o } = Lt(e, t), s = await ai(e, t), i = await Se(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || fo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
|
|
2914
|
+
return r.width = c * u, r.height = g * u, t.skipAutoScale || yo(r), r.style.width = `${c}`, r.style.height = `${g}`, t.backgroundColor && (l.fillStyle = t.backgroundColor, l.fillRect(0, 0, r.width, r.height)), l.drawImage(i, 0, 0, r.width, r.height), r;
|
|
2887
2915
|
}
|
|
2888
|
-
async function
|
|
2916
|
+
async function dt(e, t = {}) {
|
|
2889
2917
|
return (await oi(e, t)).toDataURL();
|
|
2890
2918
|
}
|
|
2891
|
-
const
|
|
2919
|
+
const Ae = "data-nf-capture-chrome", ii = "data-nf-canvas-snap", si = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
|
2892
2920
|
function Vt(e) {
|
|
2893
|
-
return e instanceof Element && (e.hasAttribute(
|
|
2921
|
+
return e instanceof Element && (e.hasAttribute(Ae) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
|
|
2894
2922
|
}
|
|
2895
2923
|
function ri() {
|
|
2896
2924
|
const e = [];
|
|
@@ -2933,27 +2961,27 @@ function ni() {
|
|
|
2933
2961
|
}), () => e.forEach((a) => a.remove());
|
|
2934
2962
|
}
|
|
2935
2963
|
function li() {
|
|
2936
|
-
const e = document.querySelector(`[${
|
|
2964
|
+
const e = document.querySelector(`[${Ae}]`);
|
|
2937
2965
|
if (e)
|
|
2938
2966
|
return e;
|
|
2939
2967
|
const t = document.createElement("div");
|
|
2940
|
-
return t.setAttribute(
|
|
2968
|
+
return t.setAttribute(Ae, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = `<span class="nf-capture-chrome-pill">${p("status.capturing")}</span>`, document.body.appendChild(t), t;
|
|
2941
2969
|
}
|
|
2942
2970
|
function ui() {
|
|
2943
|
-
document.querySelectorAll(`[${
|
|
2971
|
+
document.querySelectorAll(`[${Ae}]`).forEach((e) => e.remove());
|
|
2944
2972
|
}
|
|
2945
|
-
function
|
|
2973
|
+
function Ne() {
|
|
2946
2974
|
return new Promise((e) => {
|
|
2947
2975
|
requestAnimationFrame(() => requestAnimationFrame(e));
|
|
2948
2976
|
});
|
|
2949
2977
|
}
|
|
2950
|
-
function
|
|
2978
|
+
function Y(e) {
|
|
2951
2979
|
if (typeof e != "string" || !e.startsWith("data:image/"))
|
|
2952
2980
|
return !1;
|
|
2953
2981
|
const t = e.indexOf(",");
|
|
2954
2982
|
return t > 0 && t < e.length - 1;
|
|
2955
2983
|
}
|
|
2956
|
-
function
|
|
2984
|
+
function ci() {
|
|
2957
2985
|
const e = document.documentElement, t = document.body, a = Math.max(
|
|
2958
2986
|
window.innerWidth || 0,
|
|
2959
2987
|
(e == null ? void 0 : e.clientWidth) || 0,
|
|
@@ -2969,7 +2997,7 @@ function di() {
|
|
|
2969
2997
|
);
|
|
2970
2998
|
return { width: a, height: o };
|
|
2971
2999
|
}
|
|
2972
|
-
async function
|
|
3000
|
+
async function di() {
|
|
2973
3001
|
const e = [], t = Array.from(document.querySelectorAll("canvas"));
|
|
2974
3002
|
for (const a of t) {
|
|
2975
3003
|
if (a.closest("#notefully") || Vt(a))
|
|
@@ -3003,17 +3031,17 @@ async function pi(e) {
|
|
|
3003
3031
|
if (!e)
|
|
3004
3032
|
return null;
|
|
3005
3033
|
if (typeof e == "string")
|
|
3006
|
-
return
|
|
3034
|
+
return Y(e) ? e : null;
|
|
3007
3035
|
if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
|
|
3008
3036
|
try {
|
|
3009
3037
|
const t = e.toDataURL("image/png");
|
|
3010
|
-
return
|
|
3038
|
+
return Y(t) ? t : null;
|
|
3011
3039
|
} catch {
|
|
3012
3040
|
return null;
|
|
3013
3041
|
}
|
|
3014
3042
|
if (typeof Blob < "u" && e instanceof Blob) {
|
|
3015
3043
|
const t = await gi(e);
|
|
3016
|
-
return
|
|
3044
|
+
return Y(t) ? t : null;
|
|
3017
3045
|
}
|
|
3018
3046
|
return null;
|
|
3019
3047
|
}
|
|
@@ -3029,7 +3057,7 @@ async function gi(e) {
|
|
|
3029
3057
|
async function mi() {
|
|
3030
3058
|
var t;
|
|
3031
3059
|
if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
|
|
3032
|
-
throw new Error(
|
|
3060
|
+
throw new Error(p("status.screenUnsupported"));
|
|
3033
3061
|
const e = await navigator.mediaDevices.getDisplayMedia({
|
|
3034
3062
|
video: { displaySurface: "browser" },
|
|
3035
3063
|
audio: !1,
|
|
@@ -3038,14 +3066,14 @@ async function mi() {
|
|
|
3038
3066
|
});
|
|
3039
3067
|
try {
|
|
3040
3068
|
const a = document.createElement("video");
|
|
3041
|
-
a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((
|
|
3042
|
-
a.onloadedmetadata = () =>
|
|
3043
|
-
}), await
|
|
3069
|
+
a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
|
|
3070
|
+
a.onloadedmetadata = () => l();
|
|
3071
|
+
}), await Ne();
|
|
3044
3072
|
const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
|
|
3045
3073
|
i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
|
|
3046
3074
|
const r = i.toDataURL("image/png");
|
|
3047
|
-
if (!
|
|
3048
|
-
throw new Error(
|
|
3075
|
+
if (!Y(r))
|
|
3076
|
+
throw new Error(p("status.screenEmpty"));
|
|
3049
3077
|
return r;
|
|
3050
3078
|
} finally {
|
|
3051
3079
|
e.getTracks().forEach((a) => a.stop());
|
|
@@ -3058,32 +3086,32 @@ async function $t(e = {}) {
|
|
|
3058
3086
|
t && (t.style.display = "none");
|
|
3059
3087
|
const r = ni();
|
|
3060
3088
|
try {
|
|
3061
|
-
if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await
|
|
3062
|
-
const
|
|
3063
|
-
if (
|
|
3064
|
-
return
|
|
3089
|
+
if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
|
|
3090
|
+
const v = await pi(await e.capture());
|
|
3091
|
+
if (v)
|
|
3092
|
+
return v;
|
|
3065
3093
|
}
|
|
3066
|
-
i = await
|
|
3067
|
-
const { width:
|
|
3094
|
+
i = await di(), await Ne();
|
|
3095
|
+
const { width: l, height: u } = ci(), c = {
|
|
3068
3096
|
cacheBust: !0,
|
|
3069
|
-
width:
|
|
3097
|
+
width: l,
|
|
3070
3098
|
height: u,
|
|
3071
3099
|
pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
|
|
3072
|
-
filter: (
|
|
3100
|
+
filter: (v) => !Vt(v),
|
|
3073
3101
|
// 404 / CORS images must not abort the whole capture.
|
|
3074
3102
|
imagePlaceholder: si,
|
|
3075
3103
|
onImageErrorHandler: () => {
|
|
3076
3104
|
}
|
|
3077
3105
|
};
|
|
3078
|
-
let
|
|
3106
|
+
let g = "";
|
|
3079
3107
|
try {
|
|
3080
|
-
|
|
3108
|
+
g = await dt(document.body, c);
|
|
3081
3109
|
} catch {
|
|
3082
|
-
|
|
3110
|
+
g = await dt(document.body, { ...c, skipFonts: !0 });
|
|
3083
3111
|
}
|
|
3084
|
-
if (!
|
|
3085
|
-
throw new Error(
|
|
3086
|
-
return
|
|
3112
|
+
if (!Y(g))
|
|
3113
|
+
throw new Error(p("status.captureEmpty"));
|
|
3114
|
+
return g;
|
|
3087
3115
|
} finally {
|
|
3088
3116
|
try {
|
|
3089
3117
|
i();
|
|
@@ -3115,6 +3143,11 @@ function yi(e = {}) {
|
|
|
3115
3143
|
height: window.innerHeight,
|
|
3116
3144
|
dpr: window.devicePixelRatio || 1
|
|
3117
3145
|
},
|
|
3146
|
+
screen: {
|
|
3147
|
+
width: typeof screen < "u" ? screen.width : null,
|
|
3148
|
+
height: typeof screen < "u" ? screen.height : null,
|
|
3149
|
+
dpr: window.devicePixelRatio || 1
|
|
3150
|
+
},
|
|
3118
3151
|
user: {
|
|
3119
3152
|
userId: e.userId || null,
|
|
3120
3153
|
email: e.email || null,
|
|
@@ -3122,11 +3155,11 @@ function yi(e = {}) {
|
|
|
3122
3155
|
}
|
|
3123
3156
|
};
|
|
3124
3157
|
}
|
|
3125
|
-
const
|
|
3158
|
+
const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
|
|
3126
3159
|
id: "userId",
|
|
3127
3160
|
username: "displayName",
|
|
3128
3161
|
name: "displayName"
|
|
3129
|
-
},
|
|
3162
|
+
}, mt = /* @__PURE__ */ new Set([
|
|
3130
3163
|
"endpoint",
|
|
3131
3164
|
"projectKey",
|
|
3132
3165
|
"version",
|
|
@@ -3144,7 +3177,7 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
|
|
|
3144
3177
|
"displayLink",
|
|
3145
3178
|
"locale",
|
|
3146
3179
|
"translations"
|
|
3147
|
-
]),
|
|
3180
|
+
]), ht = {
|
|
3148
3181
|
slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
|
|
3149
3182
|
projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
|
|
3150
3183
|
project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
|
|
@@ -3155,14 +3188,14 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
|
|
|
3155
3188
|
};
|
|
3156
3189
|
function vi(e = {}, t = {}) {
|
|
3157
3190
|
const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
|
|
3158
|
-
for (const r of
|
|
3191
|
+
for (const r of pt)
|
|
3159
3192
|
Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
|
|
3160
|
-
for (const [r,
|
|
3161
|
-
Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s,
|
|
3193
|
+
for (const [r, l] of Object.entries(gt))
|
|
3194
|
+
Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
|
|
3162
3195
|
for (const r of Object.keys(o))
|
|
3163
|
-
|
|
3196
|
+
pt.has(r) || Object.prototype.hasOwnProperty.call(gt, r) || i.push(r);
|
|
3164
3197
|
if (i.length) {
|
|
3165
|
-
const r = i.some((
|
|
3198
|
+
const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
|
|
3166
3199
|
a(
|
|
3167
3200
|
`Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
|
|
3168
3201
|
);
|
|
@@ -3170,23 +3203,23 @@ function vi(e = {}, t = {}) {
|
|
|
3170
3203
|
return s;
|
|
3171
3204
|
}
|
|
3172
3205
|
function ki(e = {}, t = {}) {
|
|
3173
|
-
const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !
|
|
3206
|
+
const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !mt.has(i));
|
|
3174
3207
|
if (s.length)
|
|
3175
3208
|
for (const i of s) {
|
|
3176
|
-
if (
|
|
3177
|
-
a(`Notefully.init: ignoring "${i}". ${
|
|
3209
|
+
if (ht[i]) {
|
|
3210
|
+
a(`Notefully.init: ignoring "${i}". ${ht[i]}`);
|
|
3178
3211
|
continue;
|
|
3179
3212
|
}
|
|
3180
3213
|
a(
|
|
3181
|
-
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...
|
|
3214
|
+
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...mt].join(", ")}.`
|
|
3182
3215
|
);
|
|
3183
3216
|
}
|
|
3184
3217
|
}
|
|
3185
3218
|
function Bt(e) {
|
|
3186
3219
|
typeof console < "u" && typeof console.warn == "function" && console.warn(e);
|
|
3187
3220
|
}
|
|
3188
|
-
const
|
|
3189
|
-
function
|
|
3221
|
+
const ft = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, bi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
|
|
3222
|
+
function yt(e) {
|
|
3190
3223
|
if (e instanceof Error)
|
|
3191
3224
|
return e.stack || e.message || String(e);
|
|
3192
3225
|
if (typeof e == "string")
|
|
@@ -3197,33 +3230,33 @@ function vt(e) {
|
|
|
3197
3230
|
return String(e);
|
|
3198
3231
|
}
|
|
3199
3232
|
}
|
|
3200
|
-
function
|
|
3233
|
+
function Ze(e) {
|
|
3201
3234
|
if (!e || typeof e != "string")
|
|
3202
3235
|
return "";
|
|
3203
3236
|
let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
|
|
3204
|
-
return t ? (
|
|
3237
|
+
return t ? (ft.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ft.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
|
|
3205
3238
|
}
|
|
3206
3239
|
function wi(e = []) {
|
|
3207
3240
|
if (!e.length)
|
|
3208
3241
|
return { text: "", segments: [{ text: "", style: null }] };
|
|
3209
3242
|
const t = e[0];
|
|
3210
3243
|
if (typeof t != "string" || !t.includes("%c")) {
|
|
3211
|
-
const r = e.map(
|
|
3244
|
+
const r = e.map(yt).join(" ");
|
|
3212
3245
|
return { text: r, segments: [{ text: r, style: null }] };
|
|
3213
3246
|
}
|
|
3214
3247
|
const a = t.split("%c"), o = [];
|
|
3215
3248
|
let s = 1;
|
|
3216
3249
|
for (let r = 0; r < a.length; r++) {
|
|
3217
|
-
const
|
|
3250
|
+
const l = a[r];
|
|
3218
3251
|
if (r === 0) {
|
|
3219
|
-
|
|
3252
|
+
l && o.push({ text: l, style: null });
|
|
3220
3253
|
continue;
|
|
3221
3254
|
}
|
|
3222
|
-
const u = s < e.length ? String(e[s++] ?? "") : "",
|
|
3223
|
-
o.push({ text:
|
|
3255
|
+
const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
|
|
3256
|
+
o.push({ text: l, style: c });
|
|
3224
3257
|
}
|
|
3225
3258
|
if (s < e.length) {
|
|
3226
|
-
const r = e.slice(s).map(
|
|
3259
|
+
const r = e.slice(s).map(yt).join(" ");
|
|
3227
3260
|
r && o.push({
|
|
3228
3261
|
text: (o.length ? " " : "") + r,
|
|
3229
3262
|
style: null
|
|
@@ -3241,62 +3274,62 @@ function Si(e) {
|
|
|
3241
3274
|
const a = t.split("%c"), o = a[a.length - 1], s = o.match(bi);
|
|
3242
3275
|
let i = "";
|
|
3243
3276
|
if (s) {
|
|
3244
|
-
const u = s.index,
|
|
3245
|
-
/^[a-z-]+\s*:/i.test(o.slice(
|
|
3277
|
+
const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
|
|
3278
|
+
/^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
|
|
3246
3279
|
}
|
|
3247
|
-
const r =
|
|
3280
|
+
const r = Ze(i) || null, l = [];
|
|
3248
3281
|
for (let u = 0; u < a.length; u++) {
|
|
3249
|
-
const
|
|
3282
|
+
const c = a[u];
|
|
3250
3283
|
if (u === 0) {
|
|
3251
|
-
|
|
3284
|
+
c && l.push({ text: c, style: null });
|
|
3252
3285
|
continue;
|
|
3253
3286
|
}
|
|
3254
|
-
|
|
3255
|
-
text:
|
|
3287
|
+
l.push({
|
|
3288
|
+
text: c,
|
|
3256
3289
|
style: u === 1 ? r : null
|
|
3257
3290
|
});
|
|
3258
3291
|
}
|
|
3259
|
-
return
|
|
3292
|
+
return l.length ? l : [{ text: t, style: null }];
|
|
3260
3293
|
}
|
|
3261
3294
|
function Nt(e = {}) {
|
|
3262
3295
|
return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
|
|
3263
3296
|
text: String((t == null ? void 0 : t.text) ?? ""),
|
|
3264
|
-
style:
|
|
3297
|
+
style: Ze(t == null ? void 0 : t.style) || null
|
|
3265
3298
|
})) : Si(e.text);
|
|
3266
3299
|
}
|
|
3267
3300
|
function Ai(e = {}) {
|
|
3268
3301
|
return Nt(e).map((a) => a.text).join("");
|
|
3269
3302
|
}
|
|
3270
|
-
function
|
|
3303
|
+
function vt(e) {
|
|
3271
3304
|
return String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3272
3305
|
}
|
|
3273
3306
|
function Ci(e = {}) {
|
|
3274
3307
|
return Nt(e).map((t) => {
|
|
3275
|
-
const a =
|
|
3276
|
-
return t.style ? `<span class="nf-console-styled" style="${
|
|
3308
|
+
const a = vt(t.text);
|
|
3309
|
+
return t.style ? `<span class="nf-console-styled" style="${vt(t.style)}">${a}</span>` : a;
|
|
3277
3310
|
}).join("");
|
|
3278
3311
|
}
|
|
3279
3312
|
const zi = 80;
|
|
3280
|
-
function
|
|
3313
|
+
function Ei() {
|
|
3281
3314
|
const e = [], t = {};
|
|
3282
3315
|
let a = !1;
|
|
3283
3316
|
const o = (i, r) => {
|
|
3284
|
-
let
|
|
3317
|
+
let l = "", u = null;
|
|
3285
3318
|
try {
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3319
|
+
const g = wi(r);
|
|
3320
|
+
l = g.text, u = g.segments;
|
|
3288
3321
|
} catch {
|
|
3289
|
-
|
|
3322
|
+
l = String(r[0]), u = [{ text: l, style: null }];
|
|
3290
3323
|
}
|
|
3291
|
-
const
|
|
3324
|
+
const c = {
|
|
3292
3325
|
level: i,
|
|
3293
|
-
text:
|
|
3326
|
+
text: l.slice(0, 2e3),
|
|
3294
3327
|
at: Date.now()
|
|
3295
3328
|
};
|
|
3296
|
-
u && u.some((
|
|
3297
|
-
text: String(
|
|
3298
|
-
style:
|
|
3299
|
-
}))), e.push(
|
|
3329
|
+
u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
|
|
3330
|
+
text: String(g.text || "").slice(0, 2e3),
|
|
3331
|
+
style: g.style || null
|
|
3332
|
+
}))), e.push(c), e.length > zi && e.shift();
|
|
3300
3333
|
};
|
|
3301
3334
|
return {
|
|
3302
3335
|
hook: () => {
|
|
@@ -3315,7 +3348,7 @@ function ji() {
|
|
|
3315
3348
|
}
|
|
3316
3349
|
};
|
|
3317
3350
|
}
|
|
3318
|
-
function
|
|
3351
|
+
function ji(e) {
|
|
3319
3352
|
const t = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
3320
3353
|
let a = null, o = !1;
|
|
3321
3354
|
const s = () => {
|
|
@@ -3328,11 +3361,11 @@ function Ei(e) {
|
|
|
3328
3361
|
return {
|
|
3329
3362
|
start: (r = {}) => {
|
|
3330
3363
|
if (!t)
|
|
3331
|
-
throw new Error(
|
|
3332
|
-
return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (
|
|
3364
|
+
throw new Error(p("status.speechUnsupported"));
|
|
3365
|
+
return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
|
|
3333
3366
|
let u = "";
|
|
3334
|
-
for (let
|
|
3335
|
-
|
|
3367
|
+
for (let c = l.resultIndex; c < l.results.length; c += 1)
|
|
3368
|
+
l.results[c].isFinal && (u += l.results[c][0].transcript);
|
|
3336
3369
|
u && e(u);
|
|
3337
3370
|
}, a.onerror = () => {
|
|
3338
3371
|
o = !1;
|
|
@@ -3348,23 +3381,23 @@ function Ei(e) {
|
|
|
3348
3381
|
const Ri = 60 * 1e3;
|
|
3349
3382
|
function Pi({ onStart: e, onStop: t, onError: a }) {
|
|
3350
3383
|
let o = null, s = null, i = [], r = null;
|
|
3351
|
-
const
|
|
3384
|
+
const l = () => {
|
|
3352
3385
|
if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
|
|
3353
3386
|
try {
|
|
3354
3387
|
s.stop();
|
|
3355
3388
|
} catch {
|
|
3356
3389
|
}
|
|
3357
|
-
o && (o.getTracks().forEach((
|
|
3390
|
+
o && (o.getTracks().forEach((g) => g.stop()), o = null);
|
|
3358
3391
|
}, u = () => {
|
|
3359
3392
|
if (s && s.state === "recording") {
|
|
3360
3393
|
s.stop();
|
|
3361
3394
|
return;
|
|
3362
3395
|
}
|
|
3363
|
-
|
|
3396
|
+
l(), t(null);
|
|
3364
3397
|
};
|
|
3365
3398
|
return { start: async () => {
|
|
3366
|
-
var
|
|
3367
|
-
if (!((
|
|
3399
|
+
var g, v;
|
|
3400
|
+
if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
|
|
3368
3401
|
throw new Error("Screen recording is not supported in this browser.");
|
|
3369
3402
|
o = await navigator.mediaDevices.getDisplayMedia({
|
|
3370
3403
|
video: { displaySurface: "browser" },
|
|
@@ -3373,15 +3406,15 @@ function Pi({ onStart: e, onStop: t, onError: a }) {
|
|
|
3373
3406
|
selfBrowserSurface: "include"
|
|
3374
3407
|
}), i = [], s = new MediaRecorder(o, {
|
|
3375
3408
|
mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
|
|
3376
|
-
}), s.ondataavailable = (
|
|
3377
|
-
|
|
3409
|
+
}), s.ondataavailable = (k) => {
|
|
3410
|
+
k.data && k.data.size && i.push(k.data);
|
|
3378
3411
|
}, s.onstop = () => {
|
|
3379
|
-
const
|
|
3380
|
-
|
|
3381
|
-
}, (
|
|
3412
|
+
const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
|
|
3413
|
+
l(), t(k);
|
|
3414
|
+
}, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ri);
|
|
3382
3415
|
}, stop: u };
|
|
3383
3416
|
}
|
|
3384
|
-
function
|
|
3417
|
+
function xi() {
|
|
3385
3418
|
const e = /* @__PURE__ */ new Set();
|
|
3386
3419
|
return {
|
|
3387
3420
|
alloc() {
|
|
@@ -3399,10 +3432,10 @@ function Li() {
|
|
|
3399
3432
|
}
|
|
3400
3433
|
};
|
|
3401
3434
|
}
|
|
3402
|
-
const
|
|
3403
|
-
function
|
|
3404
|
-
const e =
|
|
3405
|
-
let t = [], a = { ...
|
|
3435
|
+
const Me = { x: 0, y: 0, w: 1, h: 1 };
|
|
3436
|
+
function Je() {
|
|
3437
|
+
const e = xi();
|
|
3438
|
+
let t = [], a = { ...Me }, o = 1;
|
|
3406
3439
|
return {
|
|
3407
3440
|
list: () => t.filter((i) => Ti(i, a)),
|
|
3408
3441
|
all: () => t.slice(),
|
|
@@ -3411,13 +3444,13 @@ function Ye() {
|
|
|
3411
3444
|
return a = Ui(i), a;
|
|
3412
3445
|
},
|
|
3413
3446
|
resetCrop() {
|
|
3414
|
-
return a = { ...
|
|
3447
|
+
return a = { ...Me }, a;
|
|
3415
3448
|
},
|
|
3416
3449
|
isCropped() {
|
|
3417
3450
|
return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
|
|
3418
3451
|
},
|
|
3419
3452
|
add(i, r) {
|
|
3420
|
-
const
|
|
3453
|
+
const l = {
|
|
3421
3454
|
id: `s${o++}`,
|
|
3422
3455
|
type: i,
|
|
3423
3456
|
number: e.alloc(),
|
|
@@ -3429,36 +3462,36 @@ function Ye() {
|
|
|
3429
3462
|
y2: 0.28,
|
|
3430
3463
|
...r
|
|
3431
3464
|
};
|
|
3432
|
-
return t.push(
|
|
3465
|
+
return t.push(l), l;
|
|
3433
3466
|
},
|
|
3434
3467
|
update(i, r) {
|
|
3435
|
-
const
|
|
3436
|
-
return
|
|
3468
|
+
const l = t.find((u) => u.id === i);
|
|
3469
|
+
return l ? (Object.assign(l, r), l) : null;
|
|
3437
3470
|
},
|
|
3438
3471
|
remove(i) {
|
|
3439
3472
|
const r = t.findIndex((u) => u.id === i);
|
|
3440
3473
|
if (r < 0)
|
|
3441
3474
|
return null;
|
|
3442
|
-
const [
|
|
3443
|
-
return e.free(
|
|
3475
|
+
const [l] = t.splice(r, 1);
|
|
3476
|
+
return e.free(l.number), l;
|
|
3444
3477
|
},
|
|
3445
3478
|
reset() {
|
|
3446
|
-
for (t = [], a = { ...
|
|
3479
|
+
for (t = [], a = { ...Me }, o = 1; e.peekUsed().length; )
|
|
3447
3480
|
e.free(e.peekUsed()[0]);
|
|
3448
3481
|
}
|
|
3449
3482
|
};
|
|
3450
3483
|
}
|
|
3451
|
-
function
|
|
3484
|
+
function Li(e, t) {
|
|
3452
3485
|
const a = Number(t == null ? void 0 : t.w) || 1, o = Number(t == null ? void 0 : t.h) || 1, s = Number(t == null ? void 0 : t.x) || 0, i = Number(t == null ? void 0 : t.y) || 0;
|
|
3453
3486
|
return (Array.isArray(e) ? e : []).map((r) => {
|
|
3454
|
-
const
|
|
3487
|
+
const l = {
|
|
3455
3488
|
...r,
|
|
3456
3489
|
x: (r.x - s) / a,
|
|
3457
3490
|
y: (r.y - i) / o,
|
|
3458
3491
|
w: (r.w || 0) / a,
|
|
3459
3492
|
h: (r.h || 0) / o
|
|
3460
3493
|
};
|
|
3461
|
-
return Number.isFinite(r.x2) && (
|
|
3494
|
+
return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
|
|
3462
3495
|
});
|
|
3463
3496
|
}
|
|
3464
3497
|
function Ui(e) {
|
|
@@ -3469,7 +3502,7 @@ function Ti(e, t) {
|
|
|
3469
3502
|
const a = e.type === "arrow" ? (e.x + (e.x2 ?? e.x)) / 2 : e.x + (e.w || 0) / 2, o = e.type === "arrow" ? (e.y + (e.y2 ?? e.y)) / 2 : e.y + (e.h || 0) / 2;
|
|
3470
3503
|
return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
|
|
3471
3504
|
}
|
|
3472
|
-
function
|
|
3505
|
+
function Kt(e) {
|
|
3473
3506
|
const t = Math.max(1, Number(e) || 1);
|
|
3474
3507
|
return {
|
|
3475
3508
|
stroke: Math.max(2, t * 75e-4),
|
|
@@ -3479,103 +3512,61 @@ function Xe(e) {
|
|
|
3479
3512
|
arrowHeadAngle: 0.4
|
|
3480
3513
|
};
|
|
3481
3514
|
}
|
|
3482
|
-
function Fi(e, {
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
if (d.number == null || d.number === "")
|
|
3514
|
-
return;
|
|
3515
|
-
const E = Oi(d, a, o, s, p, y, v), M = String(d.number);
|
|
3516
|
-
e.beginPath(), e.arc(E.x, E.y, u.badgeRadius, 0, Math.PI * 2), e.fillStyle = r, e.fill(), e.fillStyle = n, e.textAlign = "center", e.textBaseline = "middle", e.fillText(M, E.x, E.y + 0.5), e.fillStyle = r;
|
|
3517
|
-
}), e.restore();
|
|
3515
|
+
function Fi(e, t, a, o, s) {
|
|
3516
|
+
const i = Math.atan2(o - t, a - e), r = s.arrowHead, l = Math.min(s.stroke, r * 0.2), u = a, c = o, g = a - Math.cos(i) * r, v = o - Math.sin(i) * r, k = {
|
|
3517
|
+
x: u - r * Math.cos(i - s.arrowHeadAngle),
|
|
3518
|
+
y: c - r * Math.sin(i - s.arrowHeadAngle)
|
|
3519
|
+
}, w = {
|
|
3520
|
+
x: u - r * Math.cos(i + s.arrowHeadAngle),
|
|
3521
|
+
y: c - r * Math.sin(i + s.arrowHeadAngle)
|
|
3522
|
+
}, b = {
|
|
3523
|
+
x: a - Math.cos(i) * l,
|
|
3524
|
+
y: o - Math.sin(i) * l
|
|
3525
|
+
};
|
|
3526
|
+
return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
|
|
3527
|
+
}
|
|
3528
|
+
async function kt(e, t = {}) {
|
|
3529
|
+
const a = t.crop || { x: 0, y: 0, w: 1, h: 1 }, o = Math.max(1, Number(t.maxEdge) || 2048), s = t.webpQuality ?? 0.82, i = await Ii(e), r = Math.round(a.x * i.width), l = Math.round(a.y * i.height), u = Math.max(1, Math.round(a.w * i.width)), c = Math.max(1, Math.round(a.h * i.height)), g = Di(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
|
|
3530
|
+
w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
|
|
3531
|
+
const z = await bt(w, "image/webp", s);
|
|
3532
|
+
if (z && z.size > 0 && z.type === "image/webp")
|
|
3533
|
+
return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
|
|
3534
|
+
const R = await bt(w, "image/png");
|
|
3535
|
+
if (!R || !R.size)
|
|
3536
|
+
throw new Error("Could not encode screenshot");
|
|
3537
|
+
return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
|
|
3538
|
+
}
|
|
3539
|
+
function Di(e, t, a = 2048) {
|
|
3540
|
+
const o = Math.max(1, Number(e) || 1), s = Math.max(1, Number(t) || 1), i = Math.max(1, Number(a) || 2048), r = Math.min(1, i / Math.max(o, s));
|
|
3541
|
+
return {
|
|
3542
|
+
width: Math.max(1, Math.round(o * r)),
|
|
3543
|
+
height: Math.max(1, Math.round(s * r)),
|
|
3544
|
+
scale: r
|
|
3545
|
+
};
|
|
3518
3546
|
}
|
|
3519
|
-
function
|
|
3520
|
-
|
|
3547
|
+
function Oi(e = 2048) {
|
|
3548
|
+
const t = Math.floor(Number(e) / 2);
|
|
3549
|
+
return Math.max(1, Math.min(1024, t || 1024));
|
|
3521
3550
|
}
|
|
3522
|
-
function
|
|
3523
|
-
|
|
3551
|
+
function Mi(e, t = null) {
|
|
3552
|
+
if ((t == null ? void 0 : t.code) === "payload_too_large" || Number(t == null ? void 0 : t.status) === 413 || Number(e == null ? void 0 : e.status) === 413)
|
|
3553
|
+
return !0;
|
|
3554
|
+
const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
|
|
3555
|
+
return a.includes("failed to fetch") || a.includes("networkerror") || a.includes("load failed") || a.includes("too large") || a.includes("payload") || a.includes("entity too large") ? !0 : Number(e == null ? void 0 : e.status) === 413;
|
|
3524
3556
|
}
|
|
3525
|
-
function
|
|
3526
|
-
|
|
3527
|
-
const
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
y: (i + u) / 2
|
|
3531
|
-
};
|
|
3532
|
-
}
|
|
3533
|
-
return { x: s + r / 2, y: i };
|
|
3557
|
+
function Ii(e) {
|
|
3558
|
+
return new Promise((t, a) => {
|
|
3559
|
+
const o = new Image();
|
|
3560
|
+
o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
|
|
3561
|
+
});
|
|
3534
3562
|
}
|
|
3535
|
-
function
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
}, C = {
|
|
3543
|
-
x: a - Math.cos(i) * n,
|
|
3544
|
-
y: o - Math.sin(i) * n
|
|
3545
|
-
};
|
|
3546
|
-
return { angle: i, tipX: u, tipY: d, baseX: p, baseY: y, left: v, right: b, shaftEnd: C };
|
|
3547
|
-
}
|
|
3548
|
-
function Di(e, t, a, o, s, i) {
|
|
3549
|
-
const r = Kt(t, a, o, s, i);
|
|
3550
|
-
e.beginPath(), e.moveTo(t, a), e.lineTo(r.shaftEnd.x, r.shaftEnd.y), e.stroke(), e.beginPath(), e.moveTo(r.tipX, r.tipY), e.lineTo(r.left.x, r.left.y), e.lineTo(r.right.x, r.right.y), e.closePath(), e.fill();
|
|
3551
|
-
}
|
|
3552
|
-
function Mi(e, t) {
|
|
3553
|
-
return Ht(e, t, [], {});
|
|
3554
|
-
}
|
|
3555
|
-
function Ii(e, t, a, o = {}) {
|
|
3556
|
-
return Ht(e, t, a, o);
|
|
3557
|
-
}
|
|
3558
|
-
function Ht(e, t, a, o) {
|
|
3559
|
-
return new Promise((s, i) => {
|
|
3560
|
-
const r = new Image();
|
|
3561
|
-
r.onload = () => {
|
|
3562
|
-
const n = Math.round(t.x * r.width), u = Math.round(t.y * r.height), d = Math.max(1, Math.round(t.w * r.width)), p = Math.max(1, Math.round(t.h * r.height)), y = document.createElement("canvas");
|
|
3563
|
-
y.width = d, y.height = p;
|
|
3564
|
-
const v = y.getContext("2d");
|
|
3565
|
-
v.drawImage(r, n, u, d, p, 0, 0, d, p), a != null && a.length && Fi(v, {
|
|
3566
|
-
stickers: a,
|
|
3567
|
-
crop: t,
|
|
3568
|
-
width: d,
|
|
3569
|
-
height: p,
|
|
3570
|
-
colors: o
|
|
3571
|
-
}), y.toBlob((b) => {
|
|
3572
|
-
if (!b) {
|
|
3573
|
-
i(new Error("Could not encode screenshot"));
|
|
3574
|
-
return;
|
|
3575
|
-
}
|
|
3576
|
-
s(b);
|
|
3577
|
-
}, "image/png");
|
|
3578
|
-
}, r.onerror = () => i(new Error("Could not load screenshot")), r.src = e;
|
|
3563
|
+
function bt(e, t, a) {
|
|
3564
|
+
return new Promise((o) => {
|
|
3565
|
+
try {
|
|
3566
|
+
e.toBlob((s) => o(s), t, a);
|
|
3567
|
+
} catch {
|
|
3568
|
+
o(null);
|
|
3569
|
+
}
|
|
3579
3570
|
});
|
|
3580
3571
|
}
|
|
3581
3572
|
const Vi = [
|
|
@@ -3598,7 +3589,7 @@ function Bi(e = {}) {
|
|
|
3598
3589
|
const o = e[a];
|
|
3599
3590
|
o == null || o === "" || a === "user" && !$i(o) || t.push({
|
|
3600
3591
|
key: a,
|
|
3601
|
-
label:
|
|
3592
|
+
label: p(`diag.${a}`),
|
|
3602
3593
|
value: o,
|
|
3603
3594
|
redacted: !1
|
|
3604
3595
|
});
|
|
@@ -3623,14 +3614,14 @@ function Ki(e = []) {
|
|
|
3623
3614
|
const t = e.filter((a) => a.redacted).length;
|
|
3624
3615
|
return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
|
|
3625
3616
|
}
|
|
3626
|
-
function
|
|
3617
|
+
function Ce(e, t) {
|
|
3627
3618
|
e.forEach((a) => {
|
|
3628
3619
|
a.redacted = !!t;
|
|
3629
3620
|
});
|
|
3630
3621
|
}
|
|
3631
3622
|
function Hi(e = {}) {
|
|
3632
3623
|
const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
|
|
3633
|
-
return o && s ?
|
|
3624
|
+
return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
|
|
3634
3625
|
}
|
|
3635
3626
|
function Gi(e) {
|
|
3636
3627
|
if (e == null)
|
|
@@ -3658,68 +3649,73 @@ function qi(e = {}) {
|
|
|
3658
3649
|
});
|
|
3659
3650
|
return t.console = a, t;
|
|
3660
3651
|
}
|
|
3661
|
-
const
|
|
3652
|
+
const _ = [
|
|
3662
3653
|
{ id: "bug", label: "Bug" },
|
|
3663
3654
|
{ id: "idea", label: "Idea" },
|
|
3664
3655
|
{ id: "other", label: "Other" }
|
|
3665
3656
|
];
|
|
3666
|
-
function
|
|
3657
|
+
function wt(e) {
|
|
3667
3658
|
return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
|
|
3668
3659
|
}
|
|
3669
|
-
function
|
|
3660
|
+
function ye(e) {
|
|
3670
3661
|
const t = String(e || "").trim();
|
|
3671
3662
|
return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
|
|
3672
3663
|
}
|
|
3673
3664
|
function _i(e) {
|
|
3674
3665
|
if (!Array.isArray(e) || !e.length)
|
|
3675
|
-
return
|
|
3666
|
+
return _.map((o) => ({ ...o }));
|
|
3676
3667
|
const t = /* @__PURE__ */ new Set(), a = [];
|
|
3677
3668
|
for (const o of e) {
|
|
3678
|
-
let s = "", i = "";
|
|
3679
|
-
typeof o == "string" || typeof o == "number" ? (s =
|
|
3669
|
+
let s = "", i = "", r = "", l = "";
|
|
3670
|
+
if (typeof o == "string" || typeof o == "number" ? (s = wt(o), i = ye(s)) : o && typeof o == "object" && (s = wt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || ye(s)).trim() || ye(s), r = String(o.title || "").trim(), l = String(o.description || o.intro || "").trim()), !s || t.has(s))
|
|
3671
|
+
continue;
|
|
3672
|
+
t.add(s);
|
|
3673
|
+
const u = { id: s, label: i };
|
|
3674
|
+
r && (u.title = r), l && (u.description = l), a.push(u);
|
|
3680
3675
|
}
|
|
3681
|
-
return a.length ? a :
|
|
3676
|
+
return a.length ? a : _.map((o) => ({ ...o }));
|
|
3682
3677
|
}
|
|
3683
|
-
function
|
|
3678
|
+
function Le(e) {
|
|
3684
3679
|
var a;
|
|
3685
|
-
const t = Array.isArray(e) && e.length ? e :
|
|
3680
|
+
const t = Array.isArray(e) && e.length ? e : _;
|
|
3686
3681
|
return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
|
|
3687
3682
|
}
|
|
3688
|
-
const Wi = ["maker", "all-business", "brighter-day", "quiet-night"],
|
|
3683
|
+
const Wi = ["maker", "all-business", "brighter-day", "quiet-night"], Ht = "maker", Zi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, St = 0.05, Ji = `
|
|
3689
3684
|
<svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
3690
3685
|
<path fill="currentColor" d="M5.2 2.8h9.1A2.7 2.7 0 0 1 17 5.5v8.2c0 .4-.3.7-.7.7h-.1a.7.7 0 0 1-.7-.7V5.5c0-.7-.6-1.3-1.3-1.3H5.2c-.7 0-1.3.6-1.3 1.3v12.2c0 .7.6 1.3 1.3 1.3h6.4a.7.7 0 0 1 0 1.4H5.2A2.7 2.7 0 0 1 2.5 17.7V5.5A2.7 2.7 0 0 1 5.2 2.8zm1.6 4.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h3.6a.7.7 0 0 0 0-1.4H6.8z"/>
|
|
3691
3686
|
<path fill="currentColor" d="M14.7 13.05 20.2 7.55a1.55 1.55 0 0 1 2.2 2.2l-5.5 5.5-.45 1.9a.6.6 0 0 1-.72.45l-1.9-.45.87-1.9z"/>
|
|
3692
3687
|
</svg>
|
|
3693
3688
|
`;
|
|
3694
|
-
function
|
|
3689
|
+
function D(e) {
|
|
3695
3690
|
return `<svg class="nf-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`;
|
|
3696
3691
|
}
|
|
3697
|
-
const
|
|
3698
|
-
crop:
|
|
3699
|
-
resetCrop:
|
|
3700
|
-
arrow:
|
|
3701
|
-
rect:
|
|
3702
|
-
circle:
|
|
3703
|
-
discard:
|
|
3704
|
-
recapture:
|
|
3705
|
-
privacy:
|
|
3706
|
-
audio:
|
|
3707
|
-
video:
|
|
3708
|
-
openArrow:
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3692
|
+
const T = {
|
|
3693
|
+
crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
|
|
3694
|
+
resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
|
|
3695
|
+
arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
|
|
3696
|
+
rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
|
|
3697
|
+
circle: D('<circle cx="12" cy="12" r="8"/>'),
|
|
3698
|
+
discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
|
|
3699
|
+
recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
|
|
3700
|
+
privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
|
|
3701
|
+
audio: D('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
|
|
3702
|
+
video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
|
|
3703
|
+
openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>'),
|
|
3704
|
+
close: D('<path d="M6 6l12 12M18 6 6 18"/>')
|
|
3705
|
+
}, Gt = Ei();
|
|
3706
|
+
Gt.hook();
|
|
3707
|
+
const qt = 10, Yi = 80, _t = "notefully.author", Wt = "notefully.kind", Zt = "notefully.redactSections";
|
|
3708
|
+
let d = {
|
|
3713
3709
|
endpoint: "",
|
|
3714
3710
|
projectKey: "",
|
|
3715
3711
|
version: "0.0.0",
|
|
3716
3712
|
name: "",
|
|
3717
3713
|
targets: null,
|
|
3718
3714
|
hideLauncher: !1,
|
|
3719
|
-
theme:
|
|
3715
|
+
theme: Ht,
|
|
3720
3716
|
video: !1,
|
|
3721
|
-
consoleLogLimit:
|
|
3722
|
-
kinds:
|
|
3717
|
+
consoleLogLimit: qt,
|
|
3718
|
+
kinds: _.map((e) => ({ ...e })),
|
|
3723
3719
|
kindsCustom: !1,
|
|
3724
3720
|
capture: null,
|
|
3725
3721
|
onBeforeCapture: null,
|
|
@@ -3728,50 +3724,55 @@ let c = {
|
|
|
3728
3724
|
displayLink: !1,
|
|
3729
3725
|
locale: null,
|
|
3730
3726
|
translations: null
|
|
3731
|
-
},
|
|
3732
|
-
function
|
|
3733
|
-
return
|
|
3727
|
+
}, ce = !1, Ie = !1, N = {}, y = null, n = {}, A = Je(), G = "", se = "", K = null, H = Le(_), W = null, M = null, j = null, E = null, fe = null, Q = null, le = null, q = { w: 0, h: 0 }, Ve = !1, de = !1, pe = !1, $ = [], V = [], Z = !1;
|
|
3728
|
+
function h(e) {
|
|
3729
|
+
return y.querySelector(e);
|
|
3734
3730
|
}
|
|
3735
|
-
function
|
|
3731
|
+
function Jt(e) {
|
|
3736
3732
|
const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
|
|
3737
|
-
return Wi.includes(t) ? t :
|
|
3733
|
+
return Wi.includes(t) ? t : Ht;
|
|
3738
3734
|
}
|
|
3739
|
-
function
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
async function Xi(e) {
|
|
3743
|
-
return (await fetch(e)).blob();
|
|
3744
|
-
}
|
|
3745
|
-
function A(e, t = !1) {
|
|
3746
|
-
l.status && (l.status.textContent = e || "", ge && (clearTimeout(ge), ge = null), e && !t && (ge = setTimeout(() => {
|
|
3747
|
-
l.status.textContent = "";
|
|
3735
|
+
function S(e, t = !1) {
|
|
3736
|
+
n.status && (n.status.textContent = e || "", fe && (clearTimeout(fe), fe = null), e && !t && (fe = setTimeout(() => {
|
|
3737
|
+
n.status.textContent = "";
|
|
3748
3738
|
}, 4e3)));
|
|
3749
3739
|
}
|
|
3750
|
-
function
|
|
3751
|
-
return
|
|
3740
|
+
function Ye() {
|
|
3741
|
+
return y && document.body.contains(y) || (y = document.createElement("div"), y.id = "notefully", y.innerHTML = `
|
|
3752
3742
|
<button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Ji}</button>
|
|
3753
3743
|
<div class="nf-dialog" hidden>
|
|
3754
3744
|
<div class="nf-panel">
|
|
3745
|
+
<button class="nf-close nf-icon-btn" type="button" data-i18n-title="form.close" data-i18n-aria="form.close">${T.close}</button>
|
|
3755
3746
|
<div class="nf-panel-body">
|
|
3747
|
+
<div class="nf-heading">
|
|
3748
|
+
<h2 class="nf-title"></h2>
|
|
3749
|
+
<p class="nf-intro"></p>
|
|
3750
|
+
</div>
|
|
3756
3751
|
<div class="nf-stage" hidden>
|
|
3757
|
-
<div class="nf-
|
|
3758
|
-
<
|
|
3759
|
-
<
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3752
|
+
<div class="nf-shot-block">
|
|
3753
|
+
<div class="nf-canvas"></div>
|
|
3754
|
+
<div class="nf-palette">
|
|
3755
|
+
<div class="nf-palette-tools">
|
|
3756
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${T.crop}</button>
|
|
3757
|
+
<button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${T.resetCrop}</button>
|
|
3758
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${T.arrow}</button>
|
|
3759
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${T.rect}</button>
|
|
3760
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${T.circle}</button>
|
|
3761
|
+
</div>
|
|
3762
|
+
<div class="nf-palette-shot">
|
|
3763
|
+
<button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${T.recapture}</button>
|
|
3764
|
+
<button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${T.discard}</button>
|
|
3765
|
+
</div>
|
|
3766
|
+
</div>
|
|
3765
3767
|
</div>
|
|
3766
|
-
<div class="nf-canvas"></div>
|
|
3767
3768
|
</div>
|
|
3768
|
-
<textarea class="nf-text"
|
|
3769
|
+
<textarea class="nf-text"></textarea>
|
|
3769
3770
|
<input class="nf-author" type="text" name="author" autocomplete="nickname" data-i18n-placeholder="form.authorPlaceholder" data-i18n-aria="form.author">
|
|
3770
3771
|
<div class="nf-kind-row">
|
|
3771
3772
|
<div class="nf-kind"></div>
|
|
3772
3773
|
<div class="nf-privacy-summary">
|
|
3773
3774
|
<span class="nf-privacy-text"></span>
|
|
3774
|
-
<button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${
|
|
3775
|
+
<button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${T.privacy}</button>
|
|
3775
3776
|
</div>
|
|
3776
3777
|
</div>
|
|
3777
3778
|
<div class="nf-privacy">
|
|
@@ -3781,9 +3782,9 @@ function Qe() {
|
|
|
3781
3782
|
</div>
|
|
3782
3783
|
</div>
|
|
3783
3784
|
<div class="nf-actions">
|
|
3784
|
-
<button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${
|
|
3785
|
-
<button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${
|
|
3786
|
-
<button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${
|
|
3785
|
+
<button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${T.resetCrop}</button>
|
|
3786
|
+
<button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${T.audio}</button>
|
|
3787
|
+
<button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${T.video}</button>
|
|
3787
3788
|
<button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
|
|
3788
3789
|
</div>
|
|
3789
3790
|
<div class="nf-status"></div>
|
|
@@ -3791,116 +3792,144 @@ function Qe() {
|
|
|
3791
3792
|
<p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
|
|
3792
3793
|
<a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
|
|
3793
3794
|
<span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
|
|
3794
|
-
${
|
|
3795
|
+
${T.openArrow}
|
|
3795
3796
|
</a>
|
|
3796
3797
|
</div>
|
|
3797
3798
|
</div>
|
|
3798
3799
|
<button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
|
|
3799
|
-
`, document.body.appendChild(
|
|
3800
|
-
launcher:
|
|
3801
|
-
dialog:
|
|
3802
|
-
panel:
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3800
|
+
`, document.body.appendChild(y), n = {
|
|
3801
|
+
launcher: h(".nf-launcher"),
|
|
3802
|
+
dialog: h(".nf-dialog"),
|
|
3803
|
+
panel: h(".nf-panel"),
|
|
3804
|
+
close: h(".nf-close"),
|
|
3805
|
+
panelBody: h(".nf-panel-body"),
|
|
3806
|
+
heading: h(".nf-heading"),
|
|
3807
|
+
title: h(".nf-title"),
|
|
3808
|
+
intro: h(".nf-intro"),
|
|
3809
|
+
successMsg: h(".nf-success-msg"),
|
|
3810
|
+
successLink: h(".nf-success-link"),
|
|
3811
|
+
stage: h(".nf-stage"),
|
|
3812
|
+
shotBlock: h(".nf-shot-block"),
|
|
3813
|
+
palette: h(".nf-palette"),
|
|
3814
|
+
paletteTools: h(".nf-palette-tools"),
|
|
3815
|
+
paletteShot: h(".nf-palette-shot"),
|
|
3816
|
+
canvas: h(".nf-canvas"),
|
|
3817
|
+
text: h(".nf-text"),
|
|
3818
|
+
author: h(".nf-author"),
|
|
3819
|
+
kindRow: h(".nf-kind-row"),
|
|
3820
|
+
kind: h(".nf-kind"),
|
|
3821
|
+
privacy: h(".nf-privacy"),
|
|
3822
|
+
privacySummary: h(".nf-privacy-summary"),
|
|
3823
|
+
privacyText: h(".nf-privacy-text"),
|
|
3824
|
+
privacyChange: h(".nf-privacy-change"),
|
|
3825
|
+
privacyPanel: h(".nf-privacy-panel"),
|
|
3826
|
+
privacyScroll: h(".nf-privacy-scroll"),
|
|
3827
|
+
privacyDone: h(".nf-privacy-done"),
|
|
3828
|
+
actions: h(".nf-actions"),
|
|
3829
|
+
restore: h(".nf-restore"),
|
|
3830
|
+
status: h(".nf-status"),
|
|
3831
|
+
audio: h(".nf-audio"),
|
|
3832
|
+
video: h(".nf-video"),
|
|
3833
|
+
discard: h(".nf-discard-shot"),
|
|
3834
|
+
recapture: h(".nf-recapture"),
|
|
3835
|
+
stop: h(".nf-stop-video"),
|
|
3836
|
+
resetCrop: h(".nf-reset-crop"),
|
|
3837
|
+
submit: h(".nf-submit"),
|
|
3830
3838
|
shot: null
|
|
3831
|
-
},
|
|
3839
|
+
}, Qi(), re()), y;
|
|
3832
3840
|
}
|
|
3833
|
-
function
|
|
3841
|
+
function re() {
|
|
3834
3842
|
var e;
|
|
3835
|
-
|
|
3836
|
-
t.label =
|
|
3837
|
-
}), Qt(),
|
|
3843
|
+
y && (Yt(), y.dataset.theme = Jt(d.theme), y.lang = be(), y.dir = za(be()), d.hideLauncher ? y.setAttribute("data-nf-hidden-launcher", "") : y.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Xi(), $.length && $.forEach((t) => {
|
|
3844
|
+
t.label = p(`diag.${t.key}`);
|
|
3845
|
+
}), Qt(), Z ? ot() : at(), (e = n.dialog) != null && e.hidden && ze());
|
|
3838
3846
|
}
|
|
3839
|
-
function
|
|
3847
|
+
function Yt() {
|
|
3840
3848
|
const e = Sa({
|
|
3841
|
-
locale:
|
|
3849
|
+
locale: d.locale == null ? void 0 : d.locale
|
|
3842
3850
|
});
|
|
3843
|
-
Ca(
|
|
3844
|
-
}
|
|
3845
|
-
function
|
|
3846
|
-
if (
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3851
|
+
Ca(d.translations), Aa(e);
|
|
3852
|
+
}
|
|
3853
|
+
function Xi() {
|
|
3854
|
+
if (y) {
|
|
3855
|
+
if (y.querySelectorAll("[data-i18n-title]").forEach((e) => {
|
|
3856
|
+
e.title = p(e.getAttribute("data-i18n-title"));
|
|
3857
|
+
}), y.querySelectorAll("[data-i18n-aria]").forEach((e) => {
|
|
3858
|
+
e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
|
|
3859
|
+
}), y.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
|
|
3860
|
+
e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
|
|
3861
|
+
}), y.querySelectorAll("[data-i18n-text]").forEach((e) => {
|
|
3862
|
+
e.textContent = p(e.getAttribute("data-i18n-text"));
|
|
3863
|
+
}), n.audio) {
|
|
3864
|
+
const e = n.audio.dataset.active === "true";
|
|
3865
|
+
Te(e);
|
|
3866
|
+
}
|
|
3867
|
+
Qe();
|
|
3857
3868
|
}
|
|
3858
3869
|
}
|
|
3859
|
-
function
|
|
3860
|
-
if (
|
|
3870
|
+
function Xt(e) {
|
|
3871
|
+
if (d.kindsCustom)
|
|
3861
3872
|
return e.label;
|
|
3862
|
-
const t = `kind.${e.id}`, a =
|
|
3873
|
+
const t = `kind.${e.id}`, a = p(t);
|
|
3863
3874
|
return a === t ? e.label : a;
|
|
3864
3875
|
}
|
|
3865
|
-
function
|
|
3866
|
-
|
|
3876
|
+
function ze() {
|
|
3877
|
+
n.launcher && (n.launcher.hidden = !!d.hideLauncher);
|
|
3867
3878
|
}
|
|
3868
|
-
function
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
}
|
|
3884
|
-
|
|
3879
|
+
function Qi() {
|
|
3880
|
+
var t;
|
|
3881
|
+
n.launcher.addEventListener("click", () => ha()), h(".nf-dialog").addEventListener("click", (a) => {
|
|
3882
|
+
de && !pe || a.target === n.dialog && ee();
|
|
3883
|
+
}), (t = n.close) == null || t.addEventListener("click", () => {
|
|
3884
|
+
de && !pe || ee();
|
|
3885
|
+
}), document.addEventListener("keydown", da), y.querySelectorAll(".nf-tool").forEach((a) => {
|
|
3886
|
+
a.addEventListener("click", () => ge(a.dataset.tool));
|
|
3887
|
+
}), n.resetCrop.addEventListener("click", ds), n.canvas.addEventListener("pointerdown", rs), n.canvas.addEventListener("dragstart", (a) => a.preventDefault());
|
|
3888
|
+
const e = h(".nf-kind");
|
|
3889
|
+
e && e.addEventListener("click", (a) => {
|
|
3890
|
+
const o = a.target.closest("[data-kind]");
|
|
3891
|
+
o && Xe(o.dataset.kind);
|
|
3892
|
+
}), n.discard.addEventListener("click", ps), n.recapture.addEventListener("click", () => {
|
|
3893
|
+
ms().catch((a) => S(a.message || p("status.recaptureFailed")));
|
|
3894
|
+
}), n.restore.addEventListener("click", gs), n.audio.addEventListener("click", hs), n.video.addEventListener("click", fs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Pe(!Z)), n.privacyDone.addEventListener("click", () => Pe(!1)), n.privacyScroll.addEventListener("change", Ps), h(".nf-submit").addEventListener("click", () => {
|
|
3895
|
+
ya().catch((a) => S(a.message || p("status.submitFailed")));
|
|
3896
|
+
}), Qt(), ge(null);
|
|
3897
|
+
}
|
|
3898
|
+
function x(e) {
|
|
3885
3899
|
return String(e || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3886
3900
|
}
|
|
3887
3901
|
function Qt() {
|
|
3888
|
-
const e =
|
|
3902
|
+
const e = y == null ? void 0 : y.querySelector(".nf-kind");
|
|
3889
3903
|
if (!e)
|
|
3890
3904
|
return;
|
|
3891
|
-
const t = Array.isArray(
|
|
3892
|
-
e.innerHTML = t.map((s) => `<button type="button" data-kind="${
|
|
3893
|
-
const o = t.map((s) => s.id).includes(
|
|
3894
|
-
|
|
3905
|
+
const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _;
|
|
3906
|
+
e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Xt(s))}</button>`).join("");
|
|
3907
|
+
const o = t.map((s) => s.id).includes(H) ? H : Le(t);
|
|
3908
|
+
Xe(o);
|
|
3895
3909
|
}
|
|
3896
|
-
function
|
|
3897
|
-
|
|
3898
|
-
a.dataset.active = String(a.dataset.kind ===
|
|
3899
|
-
}), os(
|
|
3910
|
+
function Xe(e) {
|
|
3911
|
+
H = (d.kinds || _).map((a) => a.id).includes(e) ? e : Le(d.kinds), y == null || y.querySelectorAll("[data-kind]").forEach((a) => {
|
|
3912
|
+
a.dataset.active = String(a.dataset.kind === H);
|
|
3913
|
+
}), os(H), Qe();
|
|
3914
|
+
}
|
|
3915
|
+
function es() {
|
|
3916
|
+
return (Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _).find((t) => t.id === H) || null;
|
|
3917
|
+
}
|
|
3918
|
+
function ts() {
|
|
3919
|
+
const e = es(), t = (e == null ? void 0 : e.id) || H || "other", a = t === "bug" || t === "idea" || t === "other", o = (e == null ? void 0 : e.title) && String(e.title).trim() || p(a ? `form.title.${t}` : "form.title.other"), s = (e == null ? void 0 : e.description) && String(e.description).trim() || p(a ? `form.intro.${t}` : "form.intro.other"), i = a ? p(`form.placeholder.${t}`) : p("form.placeholder.custom", {
|
|
3920
|
+
kind: e ? Xt(e) : ye(t)
|
|
3921
|
+
});
|
|
3922
|
+
return { title: o, intro: s, placeholder: i };
|
|
3923
|
+
}
|
|
3924
|
+
function Qe() {
|
|
3925
|
+
if (!n.title && !n.intro && !n.text)
|
|
3926
|
+
return;
|
|
3927
|
+
const e = ts(), t = I() ? ` ${p("form.screenshotNote")}` : "";
|
|
3928
|
+
n.title && (n.title.textContent = e.title), n.intro && (n.intro.textContent = `${e.intro}${t}`), n.text && n.text.setAttribute("placeholder", e.placeholder);
|
|
3900
3929
|
}
|
|
3901
3930
|
function as() {
|
|
3902
3931
|
try {
|
|
3903
|
-
return String(localStorage.getItem(
|
|
3932
|
+
return String(localStorage.getItem(Wt) || "").trim().toLowerCase();
|
|
3904
3933
|
} catch {
|
|
3905
3934
|
return "";
|
|
3906
3935
|
}
|
|
@@ -3909,128 +3938,128 @@ function os(e) {
|
|
|
3909
3938
|
const t = String(e || "").trim().toLowerCase();
|
|
3910
3939
|
if (t)
|
|
3911
3940
|
try {
|
|
3912
|
-
localStorage.setItem(
|
|
3941
|
+
localStorage.setItem(Wt, t);
|
|
3913
3942
|
} catch {
|
|
3914
3943
|
}
|
|
3915
3944
|
}
|
|
3916
3945
|
function is() {
|
|
3917
|
-
const e = (
|
|
3918
|
-
return t && e.includes(t) ? t :
|
|
3946
|
+
const e = (d.kinds || _).map((a) => a.id), t = as();
|
|
3947
|
+
return t && e.includes(t) ? t : Le(d.kinds);
|
|
3919
3948
|
}
|
|
3920
|
-
function
|
|
3921
|
-
|
|
3922
|
-
t.dataset.active = String(t.dataset.tool ===
|
|
3923
|
-
}),
|
|
3949
|
+
function ge(e) {
|
|
3950
|
+
W = Zi.has(e) ? e : null, M = null, y.querySelectorAll(".nf-tool").forEach((t) => {
|
|
3951
|
+
t.dataset.active = String(t.dataset.tool === W);
|
|
3952
|
+
}), n.canvas && (n.canvas.dataset.draw = W ? "true" : "false"), I() && O();
|
|
3924
3953
|
}
|
|
3925
3954
|
function At(e) {
|
|
3926
3955
|
return Math.min(1, Math.max(0, e));
|
|
3927
3956
|
}
|
|
3928
|
-
function
|
|
3929
|
-
return
|
|
3957
|
+
function me() {
|
|
3958
|
+
return n.shot || n.canvas;
|
|
3930
3959
|
}
|
|
3931
|
-
function
|
|
3932
|
-
const t =
|
|
3960
|
+
function Ee(e) {
|
|
3961
|
+
const t = me().getBoundingClientRect();
|
|
3933
3962
|
return {
|
|
3934
3963
|
x: At((e.clientX - t.left) / Math.max(t.width, 1)),
|
|
3935
3964
|
y: At((e.clientY - t.top) / Math.max(t.height, 1))
|
|
3936
3965
|
};
|
|
3937
3966
|
}
|
|
3938
3967
|
function ss(e) {
|
|
3939
|
-
const t =
|
|
3968
|
+
const t = me().getBoundingClientRect();
|
|
3940
3969
|
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
3941
3970
|
}
|
|
3942
3971
|
function ea(e) {
|
|
3943
|
-
const t =
|
|
3972
|
+
const t = Ee(e), a = A.crop();
|
|
3944
3973
|
return {
|
|
3945
3974
|
x: a.x + t.x * a.w,
|
|
3946
3975
|
y: a.y + t.y * a.h
|
|
3947
3976
|
};
|
|
3948
3977
|
}
|
|
3949
|
-
function
|
|
3978
|
+
function Ue(e, t) {
|
|
3950
3979
|
const a = Math.min(e.x, t.x), o = Math.min(e.y, t.y);
|
|
3951
3980
|
return {
|
|
3952
3981
|
x: a,
|
|
3953
3982
|
y: o,
|
|
3954
|
-
w: Math.max(
|
|
3955
|
-
h: Math.max(
|
|
3983
|
+
w: Math.max(Ke, Math.abs(t.x - e.x)),
|
|
3984
|
+
h: Math.max(Ke, Math.abs(t.y - e.y))
|
|
3956
3985
|
};
|
|
3957
3986
|
}
|
|
3958
|
-
function
|
|
3959
|
-
|
|
3987
|
+
function et(e) {
|
|
3988
|
+
y && (e ? y.dataset.grabbing = "true" : delete y.dataset.grabbing);
|
|
3960
3989
|
}
|
|
3961
|
-
function
|
|
3990
|
+
function $e(e) {
|
|
3962
3991
|
try {
|
|
3963
|
-
|
|
3992
|
+
n.canvas.setPointerCapture(e.pointerId);
|
|
3964
3993
|
} catch {
|
|
3965
3994
|
}
|
|
3966
3995
|
}
|
|
3967
|
-
function
|
|
3968
|
-
window.addEventListener("pointermove", aa), window.addEventListener("pointerup",
|
|
3996
|
+
function He() {
|
|
3997
|
+
window.addEventListener("pointermove", aa), window.addEventListener("pointerup", je), window.addEventListener("pointercancel", je);
|
|
3969
3998
|
}
|
|
3970
3999
|
function ta() {
|
|
3971
|
-
window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup",
|
|
4000
|
+
window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup", je), window.removeEventListener("pointercancel", je);
|
|
3972
4001
|
}
|
|
3973
4002
|
function rs(e) {
|
|
3974
|
-
if (e.button !== 0 || !
|
|
4003
|
+
if (e.button !== 0 || !I())
|
|
3975
4004
|
return;
|
|
3976
4005
|
if (!e.target.closest(".nf-sticker") && !ss(e)) {
|
|
3977
|
-
|
|
4006
|
+
M = null, O();
|
|
3978
4007
|
return;
|
|
3979
4008
|
}
|
|
3980
4009
|
const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
|
|
3981
4010
|
if (a && a.dataset.preview !== "true") {
|
|
3982
|
-
e.preventDefault(), e.stopPropagation(),
|
|
4011
|
+
e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), ns({
|
|
3983
4012
|
kind: "sticker",
|
|
3984
|
-
id:
|
|
4013
|
+
id: M,
|
|
3985
4014
|
dir: (t == null ? void 0 : t.dataset.dir) || "move"
|
|
3986
|
-
}, e),
|
|
4015
|
+
}, e), O();
|
|
3987
4016
|
return;
|
|
3988
4017
|
}
|
|
3989
|
-
if (
|
|
3990
|
-
e.preventDefault(),
|
|
4018
|
+
if (M = null, W === "crop") {
|
|
4019
|
+
e.preventDefault(), $e(e), j = { kind: "crop", start: Ee(e), current: Ee(e) }, He(), O();
|
|
3991
4020
|
return;
|
|
3992
4021
|
}
|
|
3993
|
-
if (
|
|
3994
|
-
e.preventDefault(),
|
|
4022
|
+
if (W === "arrow" || W === "rect" || W === "circle") {
|
|
4023
|
+
e.preventDefault(), $e(e);
|
|
3995
4024
|
const o = ea(e);
|
|
3996
|
-
|
|
4025
|
+
j = { kind: "sticker", type: W, start: o, current: o }, He(), O();
|
|
3997
4026
|
return;
|
|
3998
4027
|
}
|
|
3999
|
-
|
|
4028
|
+
O();
|
|
4000
4029
|
}
|
|
4001
4030
|
function ns(e, t) {
|
|
4002
4031
|
t.preventDefault(), t.stopPropagation();
|
|
4003
|
-
const a =
|
|
4004
|
-
|
|
4032
|
+
const a = me().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
|
|
4033
|
+
E = {
|
|
4005
4034
|
...e,
|
|
4006
4035
|
startX: t.clientX,
|
|
4007
4036
|
startY: t.clientY,
|
|
4008
|
-
crop:
|
|
4037
|
+
crop: A.crop(),
|
|
4009
4038
|
sticker: o ? { ...o } : null,
|
|
4010
4039
|
rect: a
|
|
4011
|
-
},
|
|
4040
|
+
}, et(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
|
|
4012
4041
|
}
|
|
4013
4042
|
function aa(e) {
|
|
4014
|
-
if (
|
|
4015
|
-
|
|
4043
|
+
if (j) {
|
|
4044
|
+
j.current = j.kind === "crop" ? Ee(e) : ea(e), O();
|
|
4016
4045
|
return;
|
|
4017
4046
|
}
|
|
4018
|
-
if (!
|
|
4047
|
+
if (!E)
|
|
4019
4048
|
return;
|
|
4020
|
-
const t = (e.clientX -
|
|
4049
|
+
const t = (e.clientX - E.startX) / E.rect.width * E.crop.w, a = (e.clientY - E.startY) / E.rect.height * E.crop.h, o = E.sticker;
|
|
4021
4050
|
if (o) {
|
|
4022
|
-
if (
|
|
4023
|
-
|
|
4051
|
+
if (E.dir === "end")
|
|
4052
|
+
A.update(o.id, {
|
|
4024
4053
|
x2: o.x2 + t,
|
|
4025
4054
|
y2: o.y2 + a
|
|
4026
4055
|
});
|
|
4027
|
-
else if (
|
|
4028
|
-
|
|
4056
|
+
else if (E.dir === "start")
|
|
4057
|
+
A.update(o.id, {
|
|
4029
4058
|
x: o.x + t,
|
|
4030
4059
|
y: o.y + a
|
|
4031
4060
|
});
|
|
4032
|
-
else if (
|
|
4033
|
-
|
|
4061
|
+
else if (E.dir === "move")
|
|
4062
|
+
A.update(o.id, {
|
|
4034
4063
|
x: o.x + t,
|
|
4035
4064
|
y: o.y + a,
|
|
4036
4065
|
x2: (o.x2 || o.x) + t,
|
|
@@ -4038,9 +4067,9 @@ function aa(e) {
|
|
|
4038
4067
|
});
|
|
4039
4068
|
else {
|
|
4040
4069
|
const s = { x: o.x, y: o.y, w: o.w, h: o.h };
|
|
4041
|
-
ls(s,
|
|
4070
|
+
ls(s, E.dir, t, a), A.update(o.id, s);
|
|
4042
4071
|
}
|
|
4043
|
-
|
|
4072
|
+
O();
|
|
4044
4073
|
}
|
|
4045
4074
|
}
|
|
4046
4075
|
function ls(e, t, a, o) {
|
|
@@ -4053,52 +4082,52 @@ function ls(e, t, a, o) {
|
|
|
4053
4082
|
e.y += e.h - s, e.h = s;
|
|
4054
4083
|
}
|
|
4055
4084
|
}
|
|
4056
|
-
function
|
|
4057
|
-
if (ta(),
|
|
4085
|
+
function je(e) {
|
|
4086
|
+
if (ta(), et(!1), j) {
|
|
4058
4087
|
us();
|
|
4059
4088
|
return;
|
|
4060
4089
|
}
|
|
4061
|
-
if (
|
|
4062
|
-
if (
|
|
4063
|
-
const t =
|
|
4064
|
-
(e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (
|
|
4090
|
+
if (E) {
|
|
4091
|
+
if (E.kind === "sticker") {
|
|
4092
|
+
const t = n.canvas.getBoundingClientRect();
|
|
4093
|
+
(e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (A.remove(E.id), M = null);
|
|
4065
4094
|
}
|
|
4066
|
-
|
|
4095
|
+
E = null, O();
|
|
4067
4096
|
}
|
|
4068
4097
|
}
|
|
4069
4098
|
function us() {
|
|
4070
|
-
const e =
|
|
4071
|
-
if (
|
|
4099
|
+
const e = j;
|
|
4100
|
+
if (j = null, !e)
|
|
4072
4101
|
return;
|
|
4073
4102
|
if (e.kind === "crop") {
|
|
4074
|
-
const a =
|
|
4075
|
-
if (Math.abs(e.current.x - e.start.x) <
|
|
4076
|
-
|
|
4103
|
+
const a = Ue(e.start, e.current);
|
|
4104
|
+
if (Math.abs(e.current.x - e.start.x) < St || Math.abs(e.current.y - e.start.y) < St) {
|
|
4105
|
+
O();
|
|
4077
4106
|
return;
|
|
4078
4107
|
}
|
|
4079
|
-
const s =
|
|
4080
|
-
|
|
4108
|
+
const s = A.crop();
|
|
4109
|
+
A.setCrop({
|
|
4081
4110
|
x: s.x + a.x * s.w,
|
|
4082
4111
|
y: s.y + a.y * s.h,
|
|
4083
4112
|
w: a.w * s.w,
|
|
4084
4113
|
h: a.h * s.h
|
|
4085
|
-
}),
|
|
4114
|
+
}), te();
|
|
4086
4115
|
return;
|
|
4087
4116
|
}
|
|
4088
|
-
const t =
|
|
4089
|
-
t && (
|
|
4117
|
+
const t = cs(e);
|
|
4118
|
+
t && (M = t.id), O();
|
|
4090
4119
|
}
|
|
4091
|
-
function
|
|
4120
|
+
function cs(e) {
|
|
4092
4121
|
if (e.type === "arrow") {
|
|
4093
4122
|
const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
|
|
4094
|
-
return Math.hypot(t, a) <
|
|
4123
|
+
return Math.hypot(t, a) < Ke ? A.add("arrow", {
|
|
4095
4124
|
x: e.start.x,
|
|
4096
4125
|
y: e.start.y,
|
|
4097
4126
|
x2: e.start.x + 0.12,
|
|
4098
4127
|
y2: e.start.y,
|
|
4099
4128
|
w: 0.12,
|
|
4100
4129
|
h: 0.02
|
|
4101
|
-
}) :
|
|
4130
|
+
}) : A.add("arrow", {
|
|
4102
4131
|
x: e.start.x,
|
|
4103
4132
|
y: e.start.y,
|
|
4104
4133
|
x2: e.current.x,
|
|
@@ -4107,49 +4136,49 @@ function ds(e) {
|
|
|
4107
4136
|
h: Math.abs(a)
|
|
4108
4137
|
});
|
|
4109
4138
|
}
|
|
4110
|
-
return
|
|
4139
|
+
return A.add(e.type, Ue(e.start, e.current));
|
|
4111
4140
|
}
|
|
4112
|
-
function
|
|
4113
|
-
|
|
4141
|
+
function ds() {
|
|
4142
|
+
A.resetCrop(), M = null, te();
|
|
4114
4143
|
}
|
|
4115
|
-
function
|
|
4116
|
-
|
|
4144
|
+
function Re() {
|
|
4145
|
+
n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
|
|
4117
4146
|
}
|
|
4118
|
-
function
|
|
4119
|
-
if (!
|
|
4147
|
+
function Te(e) {
|
|
4148
|
+
if (!n.audio)
|
|
4120
4149
|
return;
|
|
4121
|
-
const t =
|
|
4122
|
-
|
|
4150
|
+
const t = p(e ? "tool.audioStop" : "tool.audio");
|
|
4151
|
+
n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
|
|
4123
4152
|
}
|
|
4124
|
-
function
|
|
4125
|
-
return
|
|
4153
|
+
function I() {
|
|
4154
|
+
return Y(G);
|
|
4126
4155
|
}
|
|
4127
|
-
function
|
|
4128
|
-
if (!
|
|
4156
|
+
function he() {
|
|
4157
|
+
if (!n.stage || !n.palette || !n.actions || !n.recapture)
|
|
4129
4158
|
return;
|
|
4130
|
-
const e =
|
|
4131
|
-
|
|
4159
|
+
const e = I();
|
|
4160
|
+
n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !se), e && n.paletteShot ? (n.paletteShot.appendChild(n.recapture), n.paletteShot.appendChild(n.discard)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1, Qe();
|
|
4132
4161
|
}
|
|
4133
4162
|
function ps() {
|
|
4134
|
-
|
|
4163
|
+
I() && (se = G), G = "", ge(null), he(), te();
|
|
4135
4164
|
}
|
|
4136
4165
|
function gs() {
|
|
4137
|
-
|
|
4166
|
+
Y(se) && (G = se, he(), te());
|
|
4138
4167
|
}
|
|
4139
4168
|
function oa() {
|
|
4140
4169
|
return {
|
|
4141
|
-
capture: typeof
|
|
4142
|
-
onBeforeCapture: typeof
|
|
4170
|
+
capture: typeof d.capture == "function" ? d.capture : void 0,
|
|
4171
|
+
onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
|
|
4143
4172
|
};
|
|
4144
4173
|
}
|
|
4145
4174
|
function ia(e) {
|
|
4146
|
-
if (!
|
|
4147
|
-
throw new Error(
|
|
4148
|
-
|
|
4175
|
+
if (!Y(e))
|
|
4176
|
+
throw new Error(p("status.screenshotFailed"));
|
|
4177
|
+
G = e, se = e, A = Je(), q = { w: 0, h: 0 }, M = null, j = null, E = null, ge(null);
|
|
4149
4178
|
}
|
|
4150
4179
|
async function ms() {
|
|
4151
|
-
if (!(
|
|
4152
|
-
|
|
4180
|
+
if (!(Ie || !n.dialog || n.dialog.hidden)) {
|
|
4181
|
+
Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
|
|
4153
4182
|
try {
|
|
4154
4183
|
let e = "";
|
|
4155
4184
|
try {
|
|
@@ -4157,69 +4186,69 @@ async function ms() {
|
|
|
4157
4186
|
} catch {
|
|
4158
4187
|
e = await $t(oa());
|
|
4159
4188
|
}
|
|
4160
|
-
ia(e),
|
|
4189
|
+
ia(e), S("");
|
|
4161
4190
|
} catch (e) {
|
|
4162
|
-
|
|
4191
|
+
S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
|
|
4163
4192
|
} finally {
|
|
4164
|
-
|
|
4193
|
+
n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, he(), te();
|
|
4165
4194
|
}
|
|
4166
4195
|
}
|
|
4167
4196
|
}
|
|
4168
4197
|
function hs() {
|
|
4169
4198
|
try {
|
|
4170
|
-
if (
|
|
4171
|
-
const a =
|
|
4172
|
-
|
|
4173
|
-
})), !
|
|
4174
|
-
|
|
4199
|
+
if (Q || (Q = ji((t) => {
|
|
4200
|
+
const a = n.text.value.trim();
|
|
4201
|
+
n.text.value = a ? `${a} ${t}` : t;
|
|
4202
|
+
})), !Q.isSupported()) {
|
|
4203
|
+
S(p("status.audioUnsupported"));
|
|
4175
4204
|
return;
|
|
4176
4205
|
}
|
|
4177
|
-
const e =
|
|
4178
|
-
|
|
4206
|
+
const e = Q.start({ lang: be() });
|
|
4207
|
+
Te(e), S(e ? p("status.listening") : "");
|
|
4179
4208
|
} catch (e) {
|
|
4180
|
-
|
|
4209
|
+
S(e.message);
|
|
4181
4210
|
}
|
|
4182
4211
|
}
|
|
4183
4212
|
async function fs() {
|
|
4184
|
-
if (!
|
|
4185
|
-
|
|
4213
|
+
if (!d.video) {
|
|
4214
|
+
S(p("status.videoDisabled"));
|
|
4186
4215
|
return;
|
|
4187
4216
|
}
|
|
4188
|
-
|
|
4217
|
+
n.dialog.hidden = !0, n.stop.hidden = !1, re(), n.launcher.hidden = !0, le = Pi({
|
|
4189
4218
|
onStart() {
|
|
4190
4219
|
},
|
|
4191
4220
|
onStop(e) {
|
|
4192
|
-
|
|
4221
|
+
K = e, n.stop.hidden = !0, ze(), n.dialog.hidden = !1, he(), te(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
|
|
4193
4222
|
},
|
|
4194
4223
|
onError(e) {
|
|
4195
|
-
|
|
4224
|
+
S(e.message);
|
|
4196
4225
|
}
|
|
4197
4226
|
});
|
|
4198
4227
|
try {
|
|
4199
|
-
await
|
|
4228
|
+
await le.start();
|
|
4200
4229
|
} catch (e) {
|
|
4201
|
-
|
|
4230
|
+
n.stop.hidden = !0, ze(), n.dialog.hidden = !1, S(e.message);
|
|
4202
4231
|
}
|
|
4203
4232
|
}
|
|
4204
|
-
function
|
|
4205
|
-
if (
|
|
4206
|
-
|
|
4233
|
+
function te() {
|
|
4234
|
+
if (n.shot = null, !I()) {
|
|
4235
|
+
n.canvas.style.removeProperty("--nf-shot-aspect"), n.canvas.style.removeProperty("aspect-ratio"), n.canvas.innerHTML = K ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(K)}"></video>` : "", Re();
|
|
4207
4236
|
return;
|
|
4208
4237
|
}
|
|
4209
|
-
|
|
4210
|
-
const e =
|
|
4238
|
+
n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${G}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
|
|
4239
|
+
const e = n.shot.querySelector("img");
|
|
4211
4240
|
e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
|
|
4212
4241
|
const t = () => {
|
|
4213
|
-
ys(e),
|
|
4242
|
+
ys(e), O();
|
|
4214
4243
|
};
|
|
4215
|
-
e.addEventListener("load", t), e.complete && e.naturalWidth && t(),
|
|
4244
|
+
e.addEventListener("load", t), e.complete && e.naturalWidth && t(), Re();
|
|
4216
4245
|
}
|
|
4217
4246
|
function ys(e) {
|
|
4218
|
-
const t = e.naturalWidth ||
|
|
4219
|
-
if (t && a && (
|
|
4247
|
+
const t = e.naturalWidth || q.w, a = e.naturalHeight || q.h;
|
|
4248
|
+
if (t && a && (q = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !q.w || !q.h)
|
|
4220
4249
|
return;
|
|
4221
|
-
const o =
|
|
4222
|
-
|
|
4250
|
+
const o = A.crop(), s = q.w / q.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
|
|
4251
|
+
n.shot.style.left = `${(1 - r) / 2 * 100}%`, n.shot.style.top = `${(1 - l) / 2 * 100}%`, n.shot.style.width = `${r * 100}%`, n.shot.style.height = `${l * 100}%`, e.style.width = `${100 / o.w}%`, e.style.height = `${100 / o.h}%`, e.style.left = `${-o.x / o.w * 100}%`, e.style.top = `${-o.y / o.h * 100}%`;
|
|
4223
4252
|
}
|
|
4224
4253
|
function vs(e) {
|
|
4225
4254
|
return e.type === "arrow" ? {
|
|
@@ -4236,42 +4265,42 @@ function vs(e) {
|
|
|
4236
4265
|
id: "preview",
|
|
4237
4266
|
type: e.type,
|
|
4238
4267
|
number: "",
|
|
4239
|
-
...
|
|
4268
|
+
...Ue(e.start, e.current)
|
|
4240
4269
|
};
|
|
4241
4270
|
}
|
|
4242
|
-
function
|
|
4243
|
-
if ((
|
|
4244
|
-
|
|
4271
|
+
function O() {
|
|
4272
|
+
if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !I() || !n.shot) {
|
|
4273
|
+
Re();
|
|
4245
4274
|
return;
|
|
4246
4275
|
}
|
|
4247
|
-
const t =
|
|
4248
|
-
if (
|
|
4276
|
+
const t = A.crop(), a = me(), o = Kt(a.clientWidth || 400);
|
|
4277
|
+
if (n.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), n.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), n.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), n.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (j == null ? void 0 : j.kind) === "crop") {
|
|
4249
4278
|
const i = document.createElement("div");
|
|
4250
|
-
i.className = "nf-crop", Ct(i,
|
|
4279
|
+
i.className = "nf-crop", Ct(i, Ue(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
|
|
4251
4280
|
}
|
|
4252
|
-
const s =
|
|
4253
|
-
if ((
|
|
4254
|
-
const r = i.id === "preview",
|
|
4255
|
-
if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id,
|
|
4256
|
-
const
|
|
4257
|
-
|
|
4281
|
+
const s = A.list().slice();
|
|
4282
|
+
if ((j == null ? void 0 : j.kind) === "sticker" && s.push(vs(j)), s.forEach((i) => {
|
|
4283
|
+
const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
|
|
4284
|
+
if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, l && (u.dataset.selected = "true"), r && (u.dataset.preview = "true"), i.type === "arrow" ? ks(u, i, t, l, o) : (Ct(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
|
|
4285
|
+
const c = document.createElement("span");
|
|
4286
|
+
c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
|
|
4258
4287
|
}
|
|
4259
|
-
|
|
4260
|
-
}),
|
|
4288
|
+
n.shot.appendChild(u);
|
|
4289
|
+
}), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
|
|
4261
4290
|
const i = document.createElement("video");
|
|
4262
|
-
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(
|
|
4291
|
+
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(K), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", n.canvas.appendChild(i);
|
|
4263
4292
|
}
|
|
4264
|
-
|
|
4293
|
+
Re();
|
|
4265
4294
|
}
|
|
4266
|
-
function ks(e, t, a, o, s =
|
|
4267
|
-
const i =
|
|
4268
|
-
e.style.left = `${
|
|
4269
|
-
<line class="nf-arrow-hit" x1="${
|
|
4270
|
-
<line class="nf-arrow-shaft" x1="${
|
|
4271
|
-
<polygon class="nf-arrow-head" points="${
|
|
4272
|
-
`, e.appendChild(
|
|
4295
|
+
function ks(e, t, a, o, s = Kt(400)) {
|
|
4296
|
+
const i = me(), r = i.clientWidth, l = i.clientHeight, u = (t.x - a.x) / a.w * r, c = (t.y - a.y) / a.h * l, g = ((t.x2 ?? t.x + t.w) - a.x) / a.w * r, v = ((t.y2 ?? t.y) - a.y) / a.h * l, k = Math.max(18, s.arrowHead + s.stroke * 2), w = Math.min(u, g) - k, b = Math.min(c, v) - k, z = Math.max(2, Math.abs(g - u)) + k * 2, R = Math.max(2, Math.abs(v - c)) + k * 2, F = u - w, B = c - b, P = g - w, m = v - b, C = Fi(F, B, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4297
|
+
e.style.left = `${w}px`, e.style.top = `${b}px`, e.style.width = `${z}px`, e.style.height = `${R}px`, X.setAttribute("class", "nf-arrow-svg"), X.setAttribute("viewBox", `0 0 ${z} ${R}`), X.setAttribute("width", String(z)), X.setAttribute("height", String(R)), X.innerHTML = `
|
|
4298
|
+
<line class="nf-arrow-hit" x1="${F}" y1="${B}" x2="${P}" y2="${m}" />
|
|
4299
|
+
<line class="nf-arrow-shaft" x1="${F}" y1="${B}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
|
|
4300
|
+
<polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
|
|
4301
|
+
`, e.appendChild(X), o && (Ge(e, "start", { left: F - 5, top: B - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
|
|
4273
4302
|
}
|
|
4274
|
-
function
|
|
4303
|
+
function Ge(e, t, a) {
|
|
4275
4304
|
const o = document.createElement("span");
|
|
4276
4305
|
o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
|
|
4277
4306
|
}
|
|
@@ -4280,22 +4309,22 @@ function Ct(e, t, a) {
|
|
|
4280
4309
|
}
|
|
4281
4310
|
function sa() {
|
|
4282
4311
|
try {
|
|
4283
|
-
return String(localStorage.getItem(
|
|
4312
|
+
return String(localStorage.getItem(_t) || "").trim();
|
|
4284
4313
|
} catch {
|
|
4285
4314
|
return "";
|
|
4286
4315
|
}
|
|
4287
4316
|
}
|
|
4288
4317
|
function bs(e) {
|
|
4289
4318
|
const t = String(e || "").trim();
|
|
4290
|
-
if (!(!t || t ===
|
|
4319
|
+
if (!(!t || t === qe()))
|
|
4291
4320
|
try {
|
|
4292
|
-
localStorage.setItem(
|
|
4321
|
+
localStorage.setItem(_t, t);
|
|
4293
4322
|
} catch {
|
|
4294
4323
|
}
|
|
4295
4324
|
}
|
|
4296
4325
|
function ra() {
|
|
4297
4326
|
try {
|
|
4298
|
-
const e = localStorage.getItem(
|
|
4327
|
+
const e = localStorage.getItem(Zt);
|
|
4299
4328
|
if (!e)
|
|
4300
4329
|
return { diagnostics: !1, logs: !1 };
|
|
4301
4330
|
const t = JSON.parse(e);
|
|
@@ -4313,7 +4342,7 @@ function zt(e = {}) {
|
|
|
4313
4342
|
...e
|
|
4314
4343
|
};
|
|
4315
4344
|
try {
|
|
4316
|
-
localStorage.setItem(
|
|
4345
|
+
localStorage.setItem(Zt, JSON.stringify({
|
|
4317
4346
|
diagnostics: !!t.diagnostics,
|
|
4318
4347
|
logs: !!t.logs
|
|
4319
4348
|
}));
|
|
@@ -4321,67 +4350,67 @@ function zt(e = {}) {
|
|
|
4321
4350
|
}
|
|
4322
4351
|
}
|
|
4323
4352
|
function na() {
|
|
4324
|
-
return !!(String(
|
|
4353
|
+
return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
|
|
4325
4354
|
}
|
|
4326
4355
|
function la() {
|
|
4327
4356
|
return String(
|
|
4328
|
-
|
|
4357
|
+
N.displayName || N.email || N.userId || ""
|
|
4329
4358
|
).trim();
|
|
4330
4359
|
}
|
|
4331
|
-
function
|
|
4332
|
-
return
|
|
4360
|
+
function qe() {
|
|
4361
|
+
return p("form.authorPlaceholder");
|
|
4333
4362
|
}
|
|
4334
4363
|
function ws() {
|
|
4335
4364
|
var t;
|
|
4336
4365
|
if (na())
|
|
4337
|
-
return la() ||
|
|
4338
|
-
const e = String(((t =
|
|
4339
|
-
return e ? (bs(e), e) :
|
|
4366
|
+
return la() || qe();
|
|
4367
|
+
const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
|
|
4368
|
+
return e ? (bs(e), e) : qe();
|
|
4340
4369
|
}
|
|
4341
4370
|
function ua() {
|
|
4342
|
-
if (!
|
|
4371
|
+
if (!n.author)
|
|
4343
4372
|
return;
|
|
4344
4373
|
const e = na();
|
|
4345
|
-
if (
|
|
4346
|
-
|
|
4374
|
+
if (n.author.hidden = e, e) {
|
|
4375
|
+
n.author.value = "";
|
|
4347
4376
|
return;
|
|
4348
4377
|
}
|
|
4349
|
-
|
|
4378
|
+
n.author.value = sa();
|
|
4350
4379
|
}
|
|
4351
|
-
function
|
|
4380
|
+
function ca(e, t = qt) {
|
|
4352
4381
|
const a = Number(e);
|
|
4353
4382
|
return Number.isFinite(a) ? Math.min(Yi, Math.max(0, Math.floor(a))) : t;
|
|
4354
4383
|
}
|
|
4355
|
-
function
|
|
4356
|
-
e.key !== "Escape" || !
|
|
4384
|
+
function da(e) {
|
|
4385
|
+
e.key !== "Escape" || !n.dialog || n.dialog.hidden || de && !pe || ee();
|
|
4357
4386
|
}
|
|
4358
4387
|
function pa(e = {}) {
|
|
4359
4388
|
ki(e);
|
|
4360
4389
|
const t = Object.prototype.hasOwnProperty.call(e, "kinds");
|
|
4361
|
-
|
|
4362
|
-
...
|
|
4363
|
-
endpoint: String(e.endpoint ||
|
|
4364
|
-
projectKey: e.projectKey == null ?
|
|
4365
|
-
version: e.version == null ?
|
|
4366
|
-
name: e.name == null ?
|
|
4367
|
-
targets: e.targets === void 0 ?
|
|
4368
|
-
hideLauncher: e.hideLauncher == null ?
|
|
4369
|
-
theme:
|
|
4370
|
-
video: e.video == null ?
|
|
4371
|
-
consoleLogLimit: e.consoleLogLimit == null ?
|
|
4372
|
-
kinds: t ? _i(e.kinds) :
|
|
4373
|
-
kindsCustom: t ? !0 :
|
|
4374
|
-
capture: e.capture === void 0 ?
|
|
4375
|
-
onBeforeCapture: e.onBeforeCapture === void 0 ?
|
|
4376
|
-
onOpen: e.onOpen === void 0 ?
|
|
4377
|
-
onClose: e.onClose === void 0 ?
|
|
4378
|
-
displayLink: e.displayLink == null ?
|
|
4379
|
-
locale: e.locale === void 0 ?
|
|
4380
|
-
translations: e.translations === void 0 ?
|
|
4390
|
+
d = {
|
|
4391
|
+
...d,
|
|
4392
|
+
endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
|
|
4393
|
+
projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
|
|
4394
|
+
version: e.version == null ? d.version : String(e.version),
|
|
4395
|
+
name: e.name == null ? d.name : String(e.name || ""),
|
|
4396
|
+
targets: e.targets === void 0 ? d.targets : e.targets,
|
|
4397
|
+
hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
|
|
4398
|
+
theme: Jt(e.theme ?? d.theme),
|
|
4399
|
+
video: e.video == null ? d.video : !!e.video,
|
|
4400
|
+
consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : ca(e.consoleLogLimit, d.consoleLogLimit),
|
|
4401
|
+
kinds: t ? _i(e.kinds) : d.kinds,
|
|
4402
|
+
kindsCustom: t ? !0 : d.kindsCustom,
|
|
4403
|
+
capture: e.capture === void 0 ? d.capture : e.capture,
|
|
4404
|
+
onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
|
|
4405
|
+
onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
|
|
4406
|
+
onClose: e.onClose === void 0 ? d.onClose : e.onClose,
|
|
4407
|
+
displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
|
|
4408
|
+
locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
|
|
4409
|
+
translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
|
|
4381
4410
|
};
|
|
4382
4411
|
}
|
|
4383
4412
|
function ga(e) {
|
|
4384
|
-
const t =
|
|
4413
|
+
const t = d[e];
|
|
4385
4414
|
if (typeof t == "function")
|
|
4386
4415
|
try {
|
|
4387
4416
|
t();
|
|
@@ -4390,102 +4419,102 @@ function ga(e) {
|
|
|
4390
4419
|
}
|
|
4391
4420
|
}
|
|
4392
4421
|
function Ss() {
|
|
4393
|
-
return
|
|
4422
|
+
return ce;
|
|
4394
4423
|
}
|
|
4395
4424
|
function As() {
|
|
4396
|
-
return
|
|
4425
|
+
return be();
|
|
4397
4426
|
}
|
|
4398
4427
|
function Cs(e, t) {
|
|
4399
|
-
return
|
|
4428
|
+
return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), y ? re() : Yt(), Fe;
|
|
4400
4429
|
}
|
|
4401
|
-
function
|
|
4402
|
-
return pa(e),
|
|
4430
|
+
function tt(e = {}) {
|
|
4431
|
+
return pa(e), y && re(), Fe;
|
|
4403
4432
|
}
|
|
4404
4433
|
function zs(e = {}) {
|
|
4405
|
-
return pa(e),
|
|
4406
|
-
}
|
|
4407
|
-
function js(e) {
|
|
4408
|
-
return at({ theme: e });
|
|
4434
|
+
return pa(e), Ye(), re(), Fe;
|
|
4409
4435
|
}
|
|
4410
4436
|
function Es(e) {
|
|
4437
|
+
return tt({ theme: e });
|
|
4438
|
+
}
|
|
4439
|
+
function js(e) {
|
|
4411
4440
|
const t = !!e;
|
|
4412
|
-
return !t &&
|
|
4441
|
+
return !t && y && n.dialog && !n.dialog.hidden && ee(), tt({ hideLauncher: !t });
|
|
4413
4442
|
}
|
|
4414
4443
|
function Rs() {
|
|
4415
4444
|
const e = la() || sa() || void 0, t = yi({
|
|
4416
|
-
...
|
|
4417
|
-
displayName:
|
|
4445
|
+
...N,
|
|
4446
|
+
displayName: N.displayName || e
|
|
4418
4447
|
});
|
|
4419
|
-
|
|
4420
|
-
|
|
4448
|
+
$ = Bi(t), V = Ni(
|
|
4449
|
+
Gt.snapshot().slice(-ca(d.consoleLogLimit))
|
|
4421
4450
|
);
|
|
4422
4451
|
const a = ra();
|
|
4423
|
-
a.diagnostics &&
|
|
4452
|
+
a.diagnostics && Ce($, !0), a.logs && V.length && Ce(V, !0), Z = !1;
|
|
4424
4453
|
}
|
|
4425
|
-
function
|
|
4426
|
-
|
|
4454
|
+
function Pe(e) {
|
|
4455
|
+
Z = !!e, n.privacyPanel && (n.privacyPanel.hidden = !Z), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", Z ? "true" : "false"), n.privacyChange.dataset.active = String(Z)), Z && ot();
|
|
4427
4456
|
}
|
|
4428
|
-
function
|
|
4429
|
-
if (!
|
|
4457
|
+
function at() {
|
|
4458
|
+
if (!n.privacy || !n.privacyText || !n.privacyChange)
|
|
4430
4459
|
return;
|
|
4431
4460
|
const e = Hi({
|
|
4432
|
-
diagnostics:
|
|
4433
|
-
logs:
|
|
4461
|
+
diagnostics: $,
|
|
4462
|
+
logs: V
|
|
4434
4463
|
});
|
|
4435
|
-
|
|
4436
|
-
const t =
|
|
4437
|
-
|
|
4464
|
+
n.privacyText.textContent = e, n.privacyText.hidden = !e;
|
|
4465
|
+
const t = $.length === 0 && V.length === 0;
|
|
4466
|
+
n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
|
|
4438
4467
|
}
|
|
4439
4468
|
function ma(e, t, a) {
|
|
4440
4469
|
return `<label class="nf-privacy-toggle">
|
|
4441
|
-
<span class="nf-privacy-toggle-label">${
|
|
4442
|
-
<input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${
|
|
4470
|
+
<span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
|
|
4471
|
+
<input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
|
|
4443
4472
|
</label>`;
|
|
4444
4473
|
}
|
|
4445
|
-
function
|
|
4446
|
-
const r = ma(s, !1, `${
|
|
4474
|
+
function Et(e, t, a, o, s, i = null) {
|
|
4475
|
+
const r = ma(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
|
|
4447
4476
|
if (s) {
|
|
4448
|
-
const
|
|
4449
|
-
return `<div class="nf-privacy-row" data-kind="${
|
|
4477
|
+
const c = l ? `${a}: ${l}` : a;
|
|
4478
|
+
return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
|
|
4450
4479
|
<div class="nf-privacy-row-text">
|
|
4451
|
-
<div class="nf-privacy-row-summary" title="${
|
|
4480
|
+
<div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
|
|
4452
4481
|
</div>
|
|
4453
4482
|
${r}
|
|
4454
4483
|
</div>`;
|
|
4455
4484
|
}
|
|
4456
|
-
const u = i ??
|
|
4457
|
-
return `<div class="nf-privacy-row" data-kind="${
|
|
4485
|
+
const u = i ?? x(l);
|
|
4486
|
+
return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
|
|
4458
4487
|
<div class="nf-privacy-row-text">
|
|
4459
|
-
<div class="nf-privacy-row-title">${
|
|
4488
|
+
<div class="nf-privacy-row-title">${x(a)}</div>
|
|
4460
4489
|
<div class="nf-privacy-row-detail">${u}</div>
|
|
4461
4490
|
</div>
|
|
4462
4491
|
${r}
|
|
4463
4492
|
</div>`;
|
|
4464
4493
|
}
|
|
4465
|
-
function
|
|
4494
|
+
function jt(e, t, a, o) {
|
|
4466
4495
|
if (!a.length)
|
|
4467
4496
|
return "";
|
|
4468
4497
|
const s = Ki(a), i = s.checked && !s.indeterminate;
|
|
4469
|
-
return `<section class="nf-privacy-section" data-section="${
|
|
4498
|
+
return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
|
|
4470
4499
|
<div class="nf-privacy-section-head">
|
|
4471
|
-
<h3 class="nf-privacy-section-title">${
|
|
4472
|
-
${ma(s.checked, s.indeterminate, `${
|
|
4500
|
+
<h3 class="nf-privacy-section-title">${x(t)}</h3>
|
|
4501
|
+
${ma(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
|
|
4473
4502
|
</div>
|
|
4474
4503
|
<div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
|
|
4475
4504
|
</section>`;
|
|
4476
4505
|
}
|
|
4477
|
-
function
|
|
4478
|
-
if (!
|
|
4506
|
+
function ot() {
|
|
4507
|
+
if (!n.privacyScroll)
|
|
4479
4508
|
return;
|
|
4480
|
-
const e =
|
|
4509
|
+
const e = $.map((a) => Et(
|
|
4481
4510
|
"diagnostic",
|
|
4482
4511
|
a.key,
|
|
4483
4512
|
a.label,
|
|
4484
4513
|
Gi(a.value),
|
|
4485
4514
|
a.redacted
|
|
4486
|
-
)).join(""), t =
|
|
4515
|
+
)).join(""), t = V.map((a) => {
|
|
4487
4516
|
const o = Ai(a);
|
|
4488
|
-
return
|
|
4517
|
+
return Et(
|
|
4489
4518
|
"log",
|
|
4490
4519
|
a.id,
|
|
4491
4520
|
a.level,
|
|
@@ -4494,12 +4523,12 @@ function it() {
|
|
|
4494
4523
|
a.redacted ? null : Ci(a)
|
|
4495
4524
|
);
|
|
4496
4525
|
}).join("");
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
].join(""),
|
|
4526
|
+
n.privacyScroll.innerHTML = [
|
|
4527
|
+
jt("diagnostics", p("privacy.section.diagnostics"), $, e),
|
|
4528
|
+
V.length ? jt("logs", p("privacy.section.logs"), V, t) : ""
|
|
4529
|
+
].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
|
|
4501
4530
|
a.indeterminate = !0, a.removeAttribute("data-indeterminate");
|
|
4502
|
-
}),
|
|
4531
|
+
}), at();
|
|
4503
4532
|
}
|
|
4504
4533
|
function Ps(e) {
|
|
4505
4534
|
const t = e.target;
|
|
@@ -4509,167 +4538,205 @@ function Ps(e) {
|
|
|
4509
4538
|
if (o) {
|
|
4510
4539
|
const i = o.dataset.kind, r = o.dataset.id;
|
|
4511
4540
|
if (i === "diagnostic") {
|
|
4512
|
-
const
|
|
4513
|
-
|
|
4541
|
+
const l = $.find((u) => u.key === r);
|
|
4542
|
+
l && (l.redacted = s);
|
|
4514
4543
|
} else if (i === "log") {
|
|
4515
|
-
const
|
|
4516
|
-
|
|
4544
|
+
const l = V.find((u) => u.id === r);
|
|
4545
|
+
l && (l.redacted = s);
|
|
4517
4546
|
}
|
|
4518
4547
|
} else if (a) {
|
|
4519
4548
|
const i = a.dataset.section;
|
|
4520
|
-
i === "diagnostics" ? (
|
|
4549
|
+
i === "diagnostics" ? (Ce($, s), zt({ diagnostics: s })) : i === "logs" && (Ce(V, s), zt({ logs: s }));
|
|
4521
4550
|
} else
|
|
4522
4551
|
return;
|
|
4523
|
-
|
|
4552
|
+
ot();
|
|
4524
4553
|
}
|
|
4525
4554
|
async function ha() {
|
|
4526
|
-
|
|
4555
|
+
Ye(), ce || (ce = !0, ga("onOpen")), fa(), re(), n.launcher.hidden = !0, A = Je(), q = { w: 0, h: 0 }, K = null, G = "", se = "", M = null, j = null, E = null, H = is(), Xe(H), ge(null), Te(!1), n.text.value = "", ua(), S(""), Rs();
|
|
4527
4556
|
try {
|
|
4528
|
-
ia(await $t(oa())),
|
|
4557
|
+
ia(await $t(oa())), S("");
|
|
4529
4558
|
} catch (t) {
|
|
4530
|
-
|
|
4559
|
+
G = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
|
|
4531
4560
|
}
|
|
4532
|
-
|
|
4561
|
+
he(), Pe(!1), at(), n.dialog.hidden = !1, te(), n.text.focus();
|
|
4533
4562
|
}
|
|
4534
|
-
function
|
|
4535
|
-
if (!
|
|
4563
|
+
function ee() {
|
|
4564
|
+
if (!y)
|
|
4536
4565
|
return;
|
|
4537
|
-
const e =
|
|
4538
|
-
|
|
4566
|
+
const e = ce;
|
|
4567
|
+
Q == null || Q.stop(), Te(!1), ta(), j = null, E = null, et(!1), fa(), Pe(!1), n.dialog.hidden = !0, n.stop.hidden = !0, ze(), e && (ce = !1, ga("onClose"));
|
|
4539
4568
|
}
|
|
4540
|
-
function
|
|
4541
|
-
const t =
|
|
4569
|
+
function xs(e = "") {
|
|
4570
|
+
const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
|
|
4542
4571
|
if (!t || !a || !o || !s)
|
|
4543
4572
|
return Promise.resolve(!1);
|
|
4544
|
-
|
|
4545
|
-
const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches,
|
|
4546
|
-
if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky",
|
|
4573
|
+
de = !0, pe = l, S("");
|
|
4574
|
+
const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
|
|
4575
|
+
if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", l), t.style.opacity = "1", i && (l ? (i.hidden = !1, i.href = r) : (i.hidden = !0, i.removeAttribute("href"))), l) {
|
|
4547
4576
|
if (u)
|
|
4548
4577
|
return Promise.resolve(!0);
|
|
4549
|
-
const
|
|
4550
|
-
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${
|
|
4551
|
-
let
|
|
4552
|
-
const
|
|
4553
|
-
|
|
4554
|
-
},
|
|
4555
|
-
|
|
4578
|
+
const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
|
|
4579
|
+
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
|
|
4580
|
+
let F = !1;
|
|
4581
|
+
const B = () => {
|
|
4582
|
+
F || (F = !0, a.removeEventListener("transitionend", P), R(!0));
|
|
4583
|
+
}, P = (m) => {
|
|
4584
|
+
m.target !== a || m.propertyName !== "transform" || B();
|
|
4556
4585
|
};
|
|
4557
|
-
a.addEventListener("transitionend",
|
|
4586
|
+
a.addEventListener("transitionend", P), requestAnimationFrame(() => {
|
|
4558
4587
|
a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
|
|
4559
|
-
}), window.setTimeout(
|
|
4588
|
+
}), window.setTimeout(B, 700);
|
|
4560
4589
|
});
|
|
4561
4590
|
}
|
|
4562
4591
|
if (u)
|
|
4563
|
-
return new Promise((
|
|
4564
|
-
window.setTimeout(() =>
|
|
4592
|
+
return new Promise((w) => {
|
|
4593
|
+
window.setTimeout(() => w(!1), 1e3);
|
|
4565
4594
|
});
|
|
4566
|
-
const
|
|
4567
|
-
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${
|
|
4568
|
-
let
|
|
4569
|
-
const
|
|
4570
|
-
|
|
4571
|
-
t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() =>
|
|
4595
|
+
const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
|
|
4596
|
+
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
|
|
4597
|
+
let b = !1;
|
|
4598
|
+
const z = () => {
|
|
4599
|
+
b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
|
|
4600
|
+
t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
|
|
4572
4601
|
}, 1e3));
|
|
4573
|
-
},
|
|
4574
|
-
|
|
4602
|
+
}, R = (F) => {
|
|
4603
|
+
F.target !== a || F.propertyName !== "transform" || z();
|
|
4575
4604
|
};
|
|
4576
|
-
a.addEventListener("transitionend",
|
|
4605
|
+
a.addEventListener("transitionend", R), requestAnimationFrame(() => {
|
|
4577
4606
|
a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
|
|
4578
|
-
}), window.setTimeout(
|
|
4607
|
+
}), window.setTimeout(z, 700);
|
|
4579
4608
|
});
|
|
4580
4609
|
}
|
|
4581
4610
|
function fa() {
|
|
4582
|
-
|
|
4611
|
+
de = !1, pe = !1, n.dialog && (n.dialog.classList.remove("nf-success", "nf-success-sticky"), n.dialog.style.opacity = "", n.dialog.style.transition = "", n.panel && (n.panel.style.transform = "", n.panel.style.transition = "", n.panel.style.transformOrigin = ""), n.panelBody && (n.panelBody.hidden = !1), n.successMsg && (n.successMsg.hidden = !0), n.successLink && (n.successLink.hidden = !0, n.successLink.removeAttribute("href")));
|
|
4583
4612
|
}
|
|
4584
|
-
function
|
|
4585
|
-
|
|
4613
|
+
function Ls(e = {}) {
|
|
4614
|
+
N = { ...N, ...vi(e) }, ua();
|
|
4586
4615
|
}
|
|
4587
4616
|
async function ya() {
|
|
4588
|
-
|
|
4617
|
+
var t, a;
|
|
4618
|
+
if (Ye(), Ve)
|
|
4589
4619
|
return null;
|
|
4590
|
-
const e =
|
|
4591
|
-
if (!e && !
|
|
4592
|
-
return
|
|
4593
|
-
if (!
|
|
4594
|
-
return
|
|
4595
|
-
|
|
4620
|
+
const e = n.text.value.trim();
|
|
4621
|
+
if (!e && !I() && !K)
|
|
4622
|
+
return S(p("status.emptyReport")), null;
|
|
4623
|
+
if (!d.endpoint || !d.projectKey)
|
|
4624
|
+
return S(p("status.missingConfig")), null;
|
|
4625
|
+
Ve = !0, Rt(!0), S(p("status.submitting"), !0);
|
|
4596
4626
|
try {
|
|
4597
|
-
const
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4627
|
+
const o = ws(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Li(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = qi({
|
|
4628
|
+
author: o,
|
|
4629
|
+
diagnostics: $,
|
|
4630
|
+
logs: V
|
|
4631
|
+
}), g = {
|
|
4632
|
+
width: typeof screen < "u" ? screen.width : null,
|
|
4633
|
+
height: typeof screen < "u" ? screen.height : null,
|
|
4634
|
+
dpr: window.devicePixelRatio || 1
|
|
4635
|
+
}, v = [];
|
|
4636
|
+
let k = 2048, w = null, b = null;
|
|
4637
|
+
I() && (b = await kt(G, {
|
|
4638
|
+
crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
|
|
4639
|
+
maxEdge: k
|
|
4640
|
+
}));
|
|
4641
|
+
for (let z = 1; z <= 3; z += 1) {
|
|
4642
|
+
const R = z === 3 || !b, F = R ? {
|
|
4643
|
+
...b ? { width: b.width, height: b.height, mime: b.mime } : {},
|
|
4644
|
+
attempt: z,
|
|
4645
|
+
omitted: !0
|
|
4646
|
+
} : {
|
|
4647
|
+
width: b.width,
|
|
4648
|
+
height: b.height,
|
|
4649
|
+
mime: b.mime,
|
|
4650
|
+
attempt: z
|
|
4651
|
+
}, B = {
|
|
4652
|
+
...c,
|
|
4653
|
+
screen: g,
|
|
4654
|
+
screenshotMeta: F
|
|
4655
|
+
};
|
|
4656
|
+
R && I() && (B.screenshotError = {
|
|
4657
|
+
message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
|
|
4658
|
+
attempts: [...v]
|
|
4659
|
+
});
|
|
4660
|
+
const P = new FormData();
|
|
4661
|
+
P.append("message", e), P.append("kind", H), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify(B)), P.append("annotations", JSON.stringify(l)), P.append("crop", JSON.stringify(u)), Array.isArray(d.targets) && P.append("targets", JSON.stringify(d.targets)), !R && b && P.append("screenshot", b.blob, `screenshot.${b.ext}`), K && P.append("recording", K, "recording.webm");
|
|
4662
|
+
try {
|
|
4663
|
+
const m = await fetch(`${d.endpoint}/v1/reports`, {
|
|
4664
|
+
method: "POST",
|
|
4665
|
+
headers: {
|
|
4666
|
+
"X-Notefully-Key": d.projectKey
|
|
4667
|
+
},
|
|
4668
|
+
body: P
|
|
4669
|
+
});
|
|
4670
|
+
let C = null;
|
|
4671
|
+
try {
|
|
4672
|
+
C = await m.json();
|
|
4673
|
+
} catch {
|
|
4674
|
+
C = null;
|
|
4675
|
+
}
|
|
4676
|
+
if (!m.ok) {
|
|
4677
|
+
const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
|
|
4678
|
+
throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
|
|
4679
|
+
}
|
|
4680
|
+
return R && I() && S(p("status.submitWithoutImage"), !0), await xs((C == null ? void 0 : C.trackerUrl) || "") || ee(), C;
|
|
4681
|
+
} catch (m) {
|
|
4682
|
+
if (w = m, v.push({
|
|
4683
|
+
attempt: z,
|
|
4684
|
+
maxEdge: R ? null : k,
|
|
4685
|
+
status: (m == null ? void 0 : m.status) || null,
|
|
4686
|
+
code: (m == null ? void 0 : m.code) || null,
|
|
4687
|
+
message: String((m == null ? void 0 : m.message) || m)
|
|
4688
|
+
}), R || !b)
|
|
4689
|
+
throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
|
|
4690
|
+
if (!Mi(m, (m == null ? void 0 : m.json) || null))
|
|
4691
|
+
throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
|
|
4692
|
+
if (z === 1) {
|
|
4693
|
+
S(p("status.submitTooLarge"), !0), k = Oi(k), b = await kt(G, {
|
|
4694
|
+
crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
|
|
4695
|
+
maxEdge: k
|
|
4696
|
+
});
|
|
4697
|
+
continue;
|
|
4698
|
+
}
|
|
4699
|
+
S(p("status.submitTooLarge"), !0), b = null;
|
|
4617
4700
|
}
|
|
4618
4701
|
}
|
|
4619
|
-
|
|
4620
|
-
const r = await fetch(`${c.endpoint}/v1/reports`, {
|
|
4621
|
-
method: "POST",
|
|
4622
|
-
headers: {
|
|
4623
|
-
"X-Notefully-Key": c.projectKey
|
|
4624
|
-
},
|
|
4625
|
-
body: a
|
|
4626
|
-
});
|
|
4627
|
-
let n = null;
|
|
4628
|
-
try {
|
|
4629
|
-
n = await r.json();
|
|
4630
|
-
} catch {
|
|
4631
|
-
n = null;
|
|
4632
|
-
}
|
|
4633
|
-
if (!r.ok)
|
|
4634
|
-
throw A((n == null ? void 0 : n.error) || m("status.submitFailed")), new Error((n == null ? void 0 : n.error) || `${m("status.submitFailed")} (${r.status})`);
|
|
4635
|
-
return await Ls((n == null ? void 0 : n.trackerUrl) || "") || re(), n;
|
|
4702
|
+
throw w || new Error(p("status.submitFailed"));
|
|
4636
4703
|
} finally {
|
|
4637
|
-
|
|
4704
|
+
Ve = !1, Rt(!1);
|
|
4638
4705
|
}
|
|
4639
4706
|
}
|
|
4640
4707
|
function Rt(e) {
|
|
4641
|
-
|
|
4708
|
+
n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
|
|
4642
4709
|
}
|
|
4643
4710
|
function Us() {
|
|
4644
|
-
|
|
4711
|
+
ee(), document.removeEventListener("keydown", da), y == null || y.remove(), y = null, n = {};
|
|
4645
4712
|
}
|
|
4646
|
-
const
|
|
4713
|
+
const Fe = {
|
|
4647
4714
|
init: zs,
|
|
4648
|
-
configure:
|
|
4649
|
-
setTheme:
|
|
4650
|
-
setVisible:
|
|
4715
|
+
configure: tt,
|
|
4716
|
+
setTheme: Es,
|
|
4717
|
+
setVisible: js,
|
|
4651
4718
|
open: ha,
|
|
4652
|
-
close:
|
|
4719
|
+
close: ee,
|
|
4653
4720
|
isOpen: Ss,
|
|
4654
4721
|
getLocale: As,
|
|
4655
4722
|
setLocale: Cs,
|
|
4656
|
-
identify:
|
|
4723
|
+
identify: Ls,
|
|
4657
4724
|
submit: ya,
|
|
4658
4725
|
destroy: Us
|
|
4659
4726
|
};
|
|
4660
|
-
typeof window < "u" && (window.Notefully =
|
|
4727
|
+
typeof window < "u" && (window.Notefully = Fe);
|
|
4661
4728
|
export {
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4729
|
+
ee as close,
|
|
4730
|
+
tt as configure,
|
|
4731
|
+
Fe as default,
|
|
4665
4732
|
Us as destroy,
|
|
4666
4733
|
As as getLocaleTag,
|
|
4667
|
-
|
|
4734
|
+
Ls as identify,
|
|
4668
4735
|
zs as init,
|
|
4669
4736
|
Ss as isOpen,
|
|
4670
4737
|
ha as open,
|
|
4671
4738
|
Cs as setLocale,
|
|
4672
|
-
|
|
4673
|
-
|
|
4739
|
+
Es as setTheme,
|
|
4740
|
+
js as setVisible,
|
|
4674
4741
|
ya as submit
|
|
4675
4742
|
};
|