@makefully/notefully 0.2.3 → 0.2.5

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/dist/notefully.js CHANGED
@@ -1,4 +1,4 @@
1
- const he = {
1
+ const wt = {
2
2
  "launcher.open": "Leave a note…",
3
3
  "tool.crop": "Crop",
4
4
  "tool.resetCrop": "Reset crop",
@@ -14,9 +14,21 @@ const he = {
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": "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",
@@ -43,6 +55,8 @@ const he = {
43
55
  "status.captureEmpty": "Screenshot capture produced an empty image.",
44
56
  "shot.alt": "Screenshot",
45
57
  "privacy.redact": "Redact",
58
+ "privacy.included": "Included",
59
+ "privacy.redacted": "Redacted",
46
60
  "privacy.section.diagnostics": "Diagnostics",
47
61
  "privacy.section.logs": "Logs",
48
62
  "privacy.disclosure.both": "Also sending logs and diagnostic information",
@@ -57,15 +71,15 @@ const he = {
57
71
  "diag.timezone": "Timezone",
58
72
  "diag.viewport": "Viewport",
59
73
  "diag.user": "User"
60
- }, fe = {
61
- "en-US": he
62
- }, Fe = {
74
+ }, St = {
75
+ "en-US": wt
76
+ }, Dt = {
63
77
  en: "en-US",
64
78
  no: "nb",
65
79
  tl: "fil",
66
80
  "zh-Hans": "zh-CN",
67
81
  "zh-Hant": "zh-TW"
68
- }, fa = {
82
+ }, ba = {
69
83
  "es-MX": ["es-419", "es"],
70
84
  "es-AR": ["es-419", "es"],
71
85
  "es-CL": ["es-419", "es"],
@@ -85,71 +99,71 @@ const he = {
85
99
  "es-DO": ["es-419", "es"],
86
100
  "es-PR": ["es-419", "es"],
87
101
  "es-CU": ["es-419", "es"]
88
- }, ya = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
89
- let ue = "en-US", Rt = {};
90
- function h(e, t) {
91
- !e || !t || typeof t != "object" || (fe[String(e)] = t);
102
+ }, wa = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
103
+ let dt = "en-US", Le = {};
104
+ function f(t, e) {
105
+ !t || !e || typeof e != "object" || (St[String(t)] = e);
92
106
  }
93
- function oe(e) {
94
- return String(e || "").trim().replace(/_/g, "-");
107
+ function rt(t) {
108
+ return String(t || "").trim().replace(/_/g, "-");
95
109
  }
96
- function va(e) {
97
- const t = oe(e);
98
- if (!t)
110
+ function Sa(t) {
111
+ const e = rt(t);
112
+ if (!e)
99
113
  return ["en-US"];
100
- const a = t, o = Fe[a] || Fe[a.toLowerCase()] || a, s = [], i = (l) => {
101
- l && !s.includes(l) && s.push(l);
114
+ const a = e, o = Dt[a] || Dt[a.toLowerCase()] || a, i = [], s = (l) => {
115
+ l && !i.includes(l) && i.push(l);
102
116
  };
103
- i(o);
104
- for (const [l, u] of Object.entries(fa))
105
- l.toLowerCase() === o.toLowerCase() && u.forEach(i);
106
- const r = o.split("-");
107
- for (let l = r.length - 1; l >= 1; l -= 1)
108
- i(r.slice(0, l).join("-"));
109
- return i(Fe[r[0]] || r[0]), i("en-US"), s;
110
- }
111
- function ka(e) {
112
- for (const t of va(e)) {
113
- if (fe[t])
114
- return t;
115
- const a = Object.keys(fe).find(
116
- (o) => o.toLowerCase() === t.toLowerCase()
117
+ s(o);
118
+ for (const [l, u] of Object.entries(ba))
119
+ l.toLowerCase() === o.toLowerCase() && u.forEach(s);
120
+ const n = o.split("-");
121
+ for (let l = n.length - 1; l >= 1; l -= 1)
122
+ s(n.slice(0, l).join("-"));
123
+ return s(Dt[n[0]] || n[0]), s("en-US"), i;
124
+ }
125
+ function Aa(t) {
126
+ for (const e of Sa(t)) {
127
+ if (St[e])
128
+ return e;
129
+ const a = Object.keys(St).find(
130
+ (o) => o.toLowerCase() === e.toLowerCase()
117
131
  );
118
132
  if (a)
119
133
  return a;
120
134
  }
121
135
  return "en-US";
122
136
  }
123
- function ba(e = {}) {
124
- var t;
125
- if (e.locale != null && String(e.locale).trim())
126
- return oe(e.locale);
137
+ function Ca(t = {}) {
138
+ var e;
139
+ if (t.locale != null && String(t.locale).trim())
140
+ return rt(t.locale);
127
141
  if (typeof document < "u") {
128
- const a = (t = document.documentElement) == null ? void 0 : t.lang;
142
+ const a = (e = document.documentElement) == null ? void 0 : e.lang;
129
143
  if (a && String(a).trim())
130
- return oe(a);
144
+ return rt(a);
131
145
  }
132
- return typeof navigator < "u" && navigator.language ? oe(navigator.language) : "en-US";
146
+ return typeof navigator < "u" && navigator.language ? rt(navigator.language) : "en-US";
133
147
  }
134
- function wa(e, t) {
135
- return e != null && (ue = oe(e) || "en-US"), ue;
148
+ function za(t, e) {
149
+ return t != null && (dt = rt(t) || "en-US"), dt;
136
150
  }
137
- function Sa(e) {
138
- Rt = e && typeof e == "object" ? { ...e } : {};
151
+ function Ea(t) {
152
+ Le = t && typeof t == "object" ? { ...t } : {};
139
153
  }
140
- function ye() {
141
- return ue;
154
+ function At() {
155
+ return dt;
142
156
  }
143
- function Aa(e = ue) {
144
- const t = oe(e).split("-")[0].toLowerCase();
145
- return ya.has(t) ? "rtl" : "ltr";
157
+ function Ra(t = dt) {
158
+ const e = rt(t).split("-")[0].toLowerCase();
159
+ return wa.has(e) ? "rtl" : "ltr";
146
160
  }
147
- function p(e, t) {
148
- const a = String(e || ""), o = ka(ue), s = fe[o] || he;
149
- let i = Rt[a] ?? s[a] ?? he[a] ?? a;
150
- return String(i);
161
+ function p(t, e) {
162
+ const a = String(t || ""), o = Aa(dt), i = St[o] || wt;
163
+ let s = Le[a] ?? i[a] ?? wt[a] ?? a;
164
+ return e && typeof e == "object" && (s = String(s).replace(/\{(\w+)\}/g, (n, l) => e[l] == null ? `{${l}}` : String(e[l]))), String(s);
151
165
  }
152
- const Ca = {
166
+ const ja = {
153
167
  "launcher.open": "Оставете бележка...",
154
168
  "tool.crop": "Реколта",
155
169
  "tool.resetCrop": "Нулиране на изрязването",
@@ -206,7 +220,7 @@ const Ca = {
206
220
  "diag.timezone": "Часова зона",
207
221
  "diag.viewport": "Изгледна плоча",
208
222
  "diag.user": "Потребител"
209
- }, za = {
223
+ }, Pa = {
210
224
  "launcher.open": "Deixa una nota...",
211
225
  "tool.crop": "Cultiu",
212
226
  "tool.resetCrop": "Restablir el cultiu",
@@ -263,7 +277,7 @@ const Ca = {
263
277
  "diag.timezone": "Zona horària",
264
278
  "diag.viewport": "Porta de vista",
265
279
  "diag.user": "Usuari"
266
- }, Ea = {
280
+ }, xa = {
267
281
  "launcher.open": "Zanechte poznámku...",
268
282
  "tool.crop": "Oříznout",
269
283
  "tool.resetCrop": "Obnovit oříznutí",
@@ -320,7 +334,7 @@ const Ca = {
320
334
  "diag.timezone": "Časové pásmo",
321
335
  "diag.viewport": "Výřez",
322
336
  "diag.user": "Uživatel"
323
- }, ja = {
337
+ }, La = {
324
338
  "launcher.open": "Efterlad en note...",
325
339
  "tool.crop": "Afgrøde",
326
340
  "tool.resetCrop": "Nulstil afgrøde",
@@ -377,7 +391,7 @@ const Ca = {
377
391
  "diag.timezone": "Tidszone",
378
392
  "diag.viewport": "Viewport",
379
393
  "diag.user": "Bruger"
380
- }, Ra = {
394
+ }, Ua = {
381
395
  "launcher.open": "Hinterlassen Sie eine Notiz...",
382
396
  "tool.crop": "Ernte",
383
397
  "tool.resetCrop": "Zuschnitt zurücksetzen",
@@ -434,7 +448,7 @@ const Ca = {
434
448
  "diag.timezone": "Zeitzone",
435
449
  "diag.viewport": "Sichtfenster",
436
450
  "diag.user": "Nutzer"
437
- }, Pa = {
451
+ }, Ta = {
438
452
  "launcher.open": "Αφήστε ένα σημείωμα...",
439
453
  "tool.crop": "Καλλιέργεια",
440
454
  "tool.resetCrop": "Επαναφορά της καλλιέργειας",
@@ -491,7 +505,7 @@ const Ca = {
491
505
  "diag.timezone": "Ζώνη ώρας",
492
506
  "diag.viewport": "Θύρα προβολής",
493
507
  "diag.user": "Χρήστης"
494
- }, xa = {
508
+ }, Fa = {
495
509
  "launcher.open": "Leave a note…",
496
510
  "tool.crop": "Crop",
497
511
  "tool.resetCrop": "Reset crop",
@@ -507,9 +521,21 @@ const Ca = {
507
521
  "tool.video": "Record video",
508
522
  "tool.stopVideo": "Stop",
509
523
  "form.messagePlaceholder": "Describe the bug or the change you want…",
524
+ "form.placeholder.bug": "What did you expect to happen and what happened instead?",
525
+ "form.placeholder.idea": "What's your idea?",
526
+ "form.placeholder.other": "Describe what you are reporting in detail.",
527
+ "form.placeholder.custom": "{kind}: Describe what you are reporting in detail.",
528
+ "form.title.bug": "Report a Problem",
529
+ "form.title.idea": "Share an Idea",
530
+ "form.title.other": "Send Feedback",
531
+ "form.intro.bug": "Tell us what went wrong.",
532
+ "form.intro.idea": "Tell us what we could improve.",
533
+ "form.intro.other": "Let us know what you think.",
534
+ "form.screenshotNote": "A screenshot of this page is attached. Use the image tools to crop, annotate, remove, or retake the screenshot.",
510
535
  "form.author": "Author",
511
536
  "form.authorPlaceholder": "Anonymous",
512
- "form.submit": "Submit",
537
+ "form.submit": "Send Report",
538
+ "form.close": "Close",
513
539
  "form.done": "Done",
514
540
  "form.success": "Submitted!",
515
541
  "form.viewReport": "View Report",
@@ -536,6 +562,8 @@ const Ca = {
536
562
  "status.captureEmpty": "Screenshot capture produced an empty image.",
537
563
  "shot.alt": "Screenshot",
538
564
  "privacy.redact": "Redact",
565
+ "privacy.included": "Included",
566
+ "privacy.redacted": "Redacted",
539
567
  "privacy.section.diagnostics": "Diagnostics",
540
568
  "privacy.section.logs": "Logs",
541
569
  "privacy.disclosure.both": "Also sending logs and diagnostic information",
@@ -550,7 +578,7 @@ const Ca = {
550
578
  "diag.timezone": "Timezone",
551
579
  "diag.viewport": "Viewport",
552
580
  "diag.user": "User"
553
- }, La = {
581
+ }, Ma = {
554
582
  "launcher.open": "Deja una nota...",
555
583
  "tool.crop": "Cultivo",
556
584
  "tool.resetCrop": "Restablecer cultivo",
@@ -607,7 +635,7 @@ const Ca = {
607
635
  "diag.timezone": "Zona horaria",
608
636
  "diag.viewport": "Ventana",
609
637
  "diag.user": "Usuario"
610
- }, Ua = {
638
+ }, Da = {
611
639
  "launcher.open": "Deja una nota...",
612
640
  "tool.crop": "Cultivo",
613
641
  "tool.resetCrop": "Restablecer recorte",
@@ -664,7 +692,7 @@ const Ca = {
664
692
  "diag.timezone": "Zona horaria",
665
693
  "diag.viewport": "ViEWPORT",
666
694
  "diag.user": "Usuario"
667
- }, Ta = {
695
+ }, Oa = {
668
696
  "launcher.open": "Jäta märkus...",
669
697
  "tool.crop": "Põllukultuur",
670
698
  "tool.resetCrop": "Lähtesta põllukultuur",
@@ -721,7 +749,7 @@ const Ca = {
721
749
  "diag.timezone": "Ajavöönd",
722
750
  "diag.viewport": "Vaatenurk",
723
751
  "diag.user": "Kasutaja"
724
- }, Fa = {
752
+ }, Ia = {
725
753
  "launcher.open": "Jätä muistiinpano...",
726
754
  "tool.crop": "Viljely",
727
755
  "tool.resetCrop": "Nollaa rajaus",
@@ -778,7 +806,7 @@ const Ca = {
778
806
  "diag.timezone": "Aikavyöhyke",
779
807
  "diag.viewport": "Näyttöikkuna",
780
808
  "diag.user": "Käyttäjä"
781
- }, Oa = {
809
+ }, Va = {
782
810
  "launcher.open": "Laissez un message...",
783
811
  "tool.crop": "Récolte",
784
812
  "tool.resetCrop": "Réinitialiser la récolte",
@@ -835,7 +863,7 @@ const Ca = {
835
863
  "diag.timezone": "Fuseau horaire",
836
864
  "diag.viewport": "Viewport",
837
865
  "diag.user": "Utilisateur"
838
- }, Da = {
866
+ }, $a = {
839
867
  "launcher.open": "एक नोट छोड़ें...",
840
868
  "tool.crop": "क्रॉप",
841
869
  "tool.resetCrop": "क्रॉप रीसेट करें",
@@ -892,7 +920,7 @@ const Ca = {
892
920
  "diag.timezone": "टाइमज़ोन",
893
921
  "diag.viewport": "व्यूपोर्ट",
894
922
  "diag.user": "यूज़र"
895
- }, Ma = {
923
+ }, Ba = {
896
924
  "launcher.open": "Ostavite poruku...",
897
925
  "tool.crop": "Usjev",
898
926
  "tool.resetCrop": "Resetirajte obrezivanje",
@@ -949,7 +977,7 @@ const Ca = {
949
977
  "diag.timezone": "Vremenska zona",
950
978
  "diag.viewport": "Prikaznica",
951
979
  "diag.user": "Korisnik"
952
- }, Ia = {
980
+ }, Na = {
953
981
  "launcher.open": "Hagyjon egy jegyzetet...",
954
982
  "tool.crop": "Termés",
955
983
  "tool.resetCrop": "Vágás visszaállítása",
@@ -1006,7 +1034,7 @@ const Ca = {
1006
1034
  "diag.timezone": "Időzóna",
1007
1035
  "diag.viewport": "Nézetablak",
1008
1036
  "diag.user": "Felhasználó"
1009
- }, Va = {
1037
+ }, Ka = {
1010
1038
  "launcher.open": "Tinggalkan catatan...",
1011
1039
  "tool.crop": "Panas",
1012
1040
  "tool.resetCrop": "Setel ulang tanaman",
@@ -1063,7 +1091,7 @@ const Ca = {
1063
1091
  "diag.timezone": "Zona Waktu",
1064
1092
  "diag.viewport": "Pintu pandang",
1065
1093
  "diag.user": "Pengguna"
1066
- }, $a = {
1094
+ }, Ha = {
1067
1095
  "launcher.open": "Lascia una nota...",
1068
1096
  "tool.crop": "Ritaglia",
1069
1097
  "tool.resetCrop": "Reimposta il ritaglio",
@@ -1120,7 +1148,7 @@ const Ca = {
1120
1148
  "diag.timezone": "Fuso orario",
1121
1149
  "diag.viewport": "Viewport",
1122
1150
  "diag.user": "Utente"
1123
- }, Ba = {
1151
+ }, Ga = {
1124
1152
  "launcher.open": "メモを残してください...",
1125
1153
  "tool.crop": "クロップ",
1126
1154
  "tool.resetCrop": "トリミングをリセット",
@@ -1177,7 +1205,7 @@ const Ca = {
1177
1205
  "diag.timezone": "タイムゾーン",
1178
1206
  "diag.viewport": "ビューポート",
1179
1207
  "diag.user": "ユーザ"
1180
- }, Na = {
1208
+ }, qa = {
1181
1209
  "launcher.open": "메모 남기기...",
1182
1210
  "tool.crop": "크롭",
1183
1211
  "tool.resetCrop": "크롭 재설정",
@@ -1234,7 +1262,7 @@ const Ca = {
1234
1262
  "diag.timezone": "타임존",
1235
1263
  "diag.viewport": "뷰포트",
1236
1264
  "diag.user": "사용자"
1237
- }, Ka = {
1265
+ }, _a = {
1238
1266
  "launcher.open": "Palikite pastabą...",
1239
1267
  "tool.crop": "Apkarpyti",
1240
1268
  "tool.resetCrop": "Iš naujo nustatyti apkarpymą",
@@ -1291,7 +1319,7 @@ const Ca = {
1291
1319
  "diag.timezone": "Laiko juosta",
1292
1320
  "diag.viewport": "Peržiūros sritis",
1293
1321
  "diag.user": "Vartotojas"
1294
- }, Ha = {
1322
+ }, Wa = {
1295
1323
  "launcher.open": "Atstājiet piezīmi...",
1296
1324
  "tool.crop": "Kultūraugs",
1297
1325
  "tool.resetCrop": "Atiestatīt apgriešanu",
@@ -1348,7 +1376,7 @@ const Ca = {
1348
1376
  "diag.timezone": "Laika josla",
1349
1377
  "diag.viewport": "Skatu laukums",
1350
1378
  "diag.user": "Lietotājs"
1351
- }, Ga = {
1379
+ }, Za = {
1352
1380
  "launcher.open": "Legg igjen et notat...",
1353
1381
  "tool.crop": "Beskjæring",
1354
1382
  "tool.resetCrop": "Tilbakestill beskjæring",
@@ -1405,7 +1433,7 @@ const Ca = {
1405
1433
  "diag.timezone": "Tidssone",
1406
1434
  "diag.viewport": "Visningsport",
1407
1435
  "diag.user": "Bruker"
1408
- }, qa = {
1436
+ }, Ja = {
1409
1437
  "launcher.open": "Laat een briefje achter...",
1410
1438
  "tool.crop": "Gewas",
1411
1439
  "tool.resetCrop": "Bijsnijden opnieuw instellen",
@@ -1462,7 +1490,7 @@ const Ca = {
1462
1490
  "diag.timezone": "Tijdzone",
1463
1491
  "diag.viewport": "Viewport",
1464
1492
  "diag.user": "Gebruiker"
1465
- }, _a = {
1493
+ }, Ya = {
1466
1494
  "launcher.open": "Zostaw notatkę...",
1467
1495
  "tool.crop": "Uprawa",
1468
1496
  "tool.resetCrop": "Resetuj kadrowanie",
@@ -1519,7 +1547,7 @@ const Ca = {
1519
1547
  "diag.timezone": "Strefa czasowa",
1520
1548
  "diag.viewport": "rzutnia",
1521
1549
  "diag.user": "Użytkownik"
1522
- }, Wa = {
1550
+ }, Xa = {
1523
1551
  "launcher.open": "Deixe uma nota...",
1524
1552
  "tool.crop": "Colheita",
1525
1553
  "tool.resetCrop": "Redefinir o corte",
@@ -1576,7 +1604,7 @@ const Ca = {
1576
1604
  "diag.timezone": "Fuso horário",
1577
1605
  "diag.viewport": "Janela de visualização",
1578
1606
  "diag.user": "Usuário"
1579
- }, Za = {
1607
+ }, Qa = {
1580
1608
  "launcher.open": "Deixe uma nota...",
1581
1609
  "tool.crop": "Colheita",
1582
1610
  "tool.resetCrop": "Redefinir o recorte",
@@ -1633,7 +1661,7 @@ const Ca = {
1633
1661
  "diag.timezone": "Fuso horário",
1634
1662
  "diag.viewport": "Viewport",
1635
1663
  "diag.user": "Utilizador"
1636
- }, Ja = {
1664
+ }, to = {
1637
1665
  "launcher.open": "Lăsați o notă...",
1638
1666
  "tool.crop": "Cultură",
1639
1667
  "tool.resetCrop": "Resetați recolta",
@@ -1690,7 +1718,7 @@ const Ca = {
1690
1718
  "diag.timezone": "Fus orar",
1691
1719
  "diag.viewport": "Portul de vizualizare",
1692
1720
  "diag.user": "Utilizator"
1693
- }, Ya = {
1721
+ }, eo = {
1694
1722
  "launcher.open": "Оставьте заметку...",
1695
1723
  "tool.crop": "урожай",
1696
1724
  "tool.resetCrop": "Сбросить урожай",
@@ -1747,7 +1775,7 @@ const Ca = {
1747
1775
  "diag.timezone": "Часовой пояс",
1748
1776
  "diag.viewport": "окно просмотра",
1749
1777
  "diag.user": "Пользователь"
1750
- }, Xa = {
1778
+ }, ao = {
1751
1779
  "launcher.open": "Zanechať poznámku...",
1752
1780
  "tool.crop": "Oplodina",
1753
1781
  "tool.resetCrop": "Obnoviť orezanie",
@@ -1804,7 +1832,7 @@ const Ca = {
1804
1832
  "diag.timezone": "Časové pásmo",
1805
1833
  "diag.viewport": "Zobrazenie",
1806
1834
  "diag.user": "Používateľ"
1807
- }, Qa = {
1835
+ }, oo = {
1808
1836
  "launcher.open": "Pustite opombo...",
1809
1837
  "tool.crop": "Pridelek",
1810
1838
  "tool.resetCrop": "Ponastavi obrezovanje",
@@ -1861,7 +1889,7 @@ const Ca = {
1861
1889
  "diag.timezone": "Časovni pas",
1862
1890
  "diag.viewport": "Razgledna plošča",
1863
1891
  "diag.user": "Uporabnik"
1864
- }, eo = {
1892
+ }, io = {
1865
1893
  "launcher.open": "Ostavite belešku...",
1866
1894
  "tool.crop": "Usjev",
1867
1895
  "tool.resetCrop": "Resetujte usev",
@@ -1918,7 +1946,7 @@ const Ca = {
1918
1946
  "diag.timezone": "Vremenska zona",
1919
1947
  "diag.viewport": "Viedport",
1920
1948
  "diag.user": "Korisnik"
1921
- }, to = {
1949
+ }, so = {
1922
1950
  "launcher.open": "Lämna en anteckning...",
1923
1951
  "tool.crop": "Skörda",
1924
1952
  "tool.resetCrop": "Återställ beskärning",
@@ -1975,7 +2003,7 @@ const Ca = {
1975
2003
  "diag.timezone": "Tidszon",
1976
2004
  "diag.viewport": "Viewport",
1977
2005
  "diag.user": "Användare"
1978
- }, ao = {
2006
+ }, ro = {
1979
2007
  "launcher.open": "Mag-iwan ng tala...",
1980
2008
  "tool.crop": "Pag-ani",
1981
2009
  "tool.resetCrop": "I-reset ang panani",
@@ -2032,7 +2060,7 @@ const Ca = {
2032
2060
  "diag.timezone": "Timesone",
2033
2061
  "diag.viewport": "Viewport",
2034
2062
  "diag.user": "Gumagamit"
2035
- }, oo = {
2063
+ }, no = {
2036
2064
  "launcher.open": "ทิ้งหมายเหตุ...",
2037
2065
  "tool.crop": "พืชผล",
2038
2066
  "tool.resetCrop": "รีเซ็ตการตัดพืช",
@@ -2089,7 +2117,7 @@ const Ca = {
2089
2117
  "diag.timezone": "เขตเวลา",
2090
2118
  "diag.viewport": "พอร์ตมุมมอง",
2091
2119
  "diag.user": "ผู้ใช้"
2092
- }, io = {
2120
+ }, lo = {
2093
2121
  "launcher.open": "Bir not bırakın...",
2094
2122
  "tool.crop": "Mahsul",
2095
2123
  "tool.resetCrop": "Kırpmayı sıfırla",
@@ -2146,7 +2174,7 @@ const Ca = {
2146
2174
  "diag.timezone": "Saat dilimi",
2147
2175
  "diag.viewport": "Görünüm noktası",
2148
2176
  "diag.user": "Kullanıcı"
2149
- }, so = {
2177
+ }, uo = {
2150
2178
  "launcher.open": "Залиште записку...",
2151
2179
  "tool.crop": "Урожай",
2152
2180
  "tool.resetCrop": "Скинути обрізку",
@@ -2203,7 +2231,7 @@ const Ca = {
2203
2231
  "diag.timezone": "Часовий пояс",
2204
2232
  "diag.viewport": "Вигляд",
2205
2233
  "diag.user": "Користувач"
2206
- }, ro = {
2234
+ }, co = {
2207
2235
  "launcher.open": "Để lại một ghi chú...",
2208
2236
  "tool.crop": "Cây trồng",
2209
2237
  "tool.resetCrop": "Đặt lại cây trồng",
@@ -2260,7 +2288,7 @@ const Ca = {
2260
2288
  "diag.timezone": "Múi giờ",
2261
2289
  "diag.viewport": "Cổng quan sát",
2262
2290
  "diag.user": "Người dùng"
2263
- }, no = {
2291
+ }, po = {
2264
2292
  "launcher.open": "留个笔记...",
2265
2293
  "tool.crop": "作物",
2266
2294
  "tool.resetCrop": "重置裁剪",
@@ -2317,7 +2345,7 @@ const Ca = {
2317
2345
  "diag.timezone": "时区",
2318
2346
  "diag.viewport": "视口",
2319
2347
  "diag.user": "用户"
2320
- }, lo = {
2348
+ }, go = {
2321
2349
  "launcher.open": "留下筆記...",
2322
2350
  "tool.crop": "作物",
2323
2351
  "tool.resetCrop": "重設裁切",
@@ -2375,556 +2403,556 @@ const Ca = {
2375
2403
  "diag.viewport": "視埠",
2376
2404
  "diag.user": "使用者"
2377
2405
  };
2378
- h("en-US", he);
2379
- h("bg", Ca);
2380
- h("ca", za);
2381
- h("cs", Ea);
2382
- h("da", ja);
2383
- h("de", Ra);
2384
- h("el", Pa);
2385
- h("en-GB", xa);
2386
- h("es", La);
2387
- h("es-419", Ua);
2388
- h("et", Ta);
2389
- h("fi", Fa);
2390
- h("fr", Oa);
2391
- h("hi", Da);
2392
- h("hr", Ma);
2393
- h("hu", Ia);
2394
- h("id", Va);
2395
- h("it", $a);
2396
- h("ja", Ba);
2397
- h("ko", Na);
2398
- h("lt", Ka);
2399
- h("lv", Ha);
2400
- h("nb", Ga);
2401
- h("nl", qa);
2402
- h("pl", _a);
2403
- h("pt-BR", Wa);
2404
- h("pt-PT", Za);
2405
- h("ro", Ja);
2406
- h("ru", Ya);
2407
- h("sk", Xa);
2408
- h("sl", Qa);
2409
- h("sr", eo);
2410
- h("sv", to);
2411
- h("fil", ao);
2412
- h("th", oo);
2413
- h("tr", io);
2414
- h("uk", so);
2415
- h("vi", ro);
2416
- h("zh-CN", no);
2417
- h("zh-TW", lo);
2418
- function uo(e, t) {
2419
- if (e.match(/^[a-z]+:\/\//i))
2420
- return e;
2421
- if (e.match(/^\/\//))
2422
- return window.location.protocol + e;
2423
- if (e.match(/^[a-z]+:/i))
2424
- return e;
2425
- const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), s = a.createElement("a");
2426
- return a.head.appendChild(o), a.body.appendChild(s), t && (o.href = t), s.href = e, s.href;
2406
+ f("en-US", wt);
2407
+ f("bg", ja);
2408
+ f("ca", Pa);
2409
+ f("cs", xa);
2410
+ f("da", La);
2411
+ f("de", Ua);
2412
+ f("el", Ta);
2413
+ f("en-GB", Fa);
2414
+ f("es", Ma);
2415
+ f("es-419", Da);
2416
+ f("et", Oa);
2417
+ f("fi", Ia);
2418
+ f("fr", Va);
2419
+ f("hi", $a);
2420
+ f("hr", Ba);
2421
+ f("hu", Na);
2422
+ f("id", Ka);
2423
+ f("it", Ha);
2424
+ f("ja", Ga);
2425
+ f("ko", qa);
2426
+ f("lt", _a);
2427
+ f("lv", Wa);
2428
+ f("nb", Za);
2429
+ f("nl", Ja);
2430
+ f("pl", Ya);
2431
+ f("pt-BR", Xa);
2432
+ f("pt-PT", Qa);
2433
+ f("ro", to);
2434
+ f("ru", eo);
2435
+ f("sk", ao);
2436
+ f("sl", oo);
2437
+ f("sr", io);
2438
+ f("sv", so);
2439
+ f("fil", ro);
2440
+ f("th", no);
2441
+ f("tr", lo);
2442
+ f("uk", uo);
2443
+ f("vi", co);
2444
+ f("zh-CN", po);
2445
+ f("zh-TW", go);
2446
+ function mo(t, e) {
2447
+ if (t.match(/^[a-z]+:\/\//i))
2448
+ return t;
2449
+ if (t.match(/^\/\//))
2450
+ return window.location.protocol + t;
2451
+ if (t.match(/^[a-z]+:/i))
2452
+ return t;
2453
+ const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), i = a.createElement("a");
2454
+ return a.head.appendChild(o), a.body.appendChild(i), e && (o.href = e), i.href = t, i.href;
2427
2455
  }
2428
- const co = /* @__PURE__ */ (() => {
2429
- let e = 0;
2430
- const t = () => (
2456
+ const ho = /* @__PURE__ */ (() => {
2457
+ let t = 0;
2458
+ const e = () => (
2431
2459
  // eslint-disable-next-line no-bitwise
2432
2460
  `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
2433
2461
  );
2434
- return () => (e += 1, `u${t()}${e}`);
2462
+ return () => (t += 1, `u${e()}${t}`);
2435
2463
  })();
2436
- function W(e) {
2437
- const t = [];
2438
- for (let a = 0, o = e.length; a < o; a++)
2439
- t.push(e[a]);
2440
- return t;
2464
+ function X(t) {
2465
+ const e = [];
2466
+ for (let a = 0, o = t.length; a < o; a++)
2467
+ e.push(t[a]);
2468
+ return e;
2441
2469
  }
2442
- let te = null;
2443
- function Pt(e = {}) {
2444
- return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te = W(window.getComputedStyle(document.documentElement)), te));
2470
+ let it = null;
2471
+ function Ue(t = {}) {
2472
+ return it || (t.includeStyleProperties ? (it = t.includeStyleProperties, it) : (it = X(window.getComputedStyle(document.documentElement)), it));
2445
2473
  }
2446
- function ve(e, t) {
2447
- const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
2474
+ function Ct(t, e) {
2475
+ const o = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
2448
2476
  return o ? parseFloat(o.replace("px", "")) : 0;
2449
2477
  }
2450
- function po(e) {
2451
- const t = ve(e, "border-left-width"), a = ve(e, "border-right-width");
2452
- return e.clientWidth + t + a;
2478
+ function fo(t) {
2479
+ const e = Ct(t, "border-left-width"), a = Ct(t, "border-right-width");
2480
+ return t.clientWidth + e + a;
2453
2481
  }
2454
- function go(e) {
2455
- const t = ve(e, "border-top-width"), a = ve(e, "border-bottom-width");
2456
- return e.clientHeight + t + a;
2482
+ function yo(t) {
2483
+ const e = Ct(t, "border-top-width"), a = Ct(t, "border-bottom-width");
2484
+ return t.clientHeight + e + a;
2457
2485
  }
2458
- function xt(e, t = {}) {
2459
- const a = t.width || po(e), o = t.height || go(e);
2486
+ function Te(t, e = {}) {
2487
+ const a = e.width || fo(t), o = e.height || yo(t);
2460
2488
  return { width: a, height: o };
2461
2489
  }
2462
- function mo() {
2463
- let e, t;
2490
+ function vo() {
2491
+ let t, e;
2464
2492
  try {
2465
- t = process;
2493
+ e = process;
2466
2494
  } catch {
2467
2495
  }
2468
- const a = t && t.env ? t.env.devicePixelRatio : null;
2469
- return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
2496
+ const a = e && e.env ? e.env.devicePixelRatio : null;
2497
+ return a && (t = parseInt(a, 10), Number.isNaN(t) && (t = 1)), t || window.devicePixelRatio || 1;
2470
2498
  }
2471
2499
  const U = 16384;
2472
- function ho(e) {
2473
- (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));
2500
+ function ko(t) {
2501
+ (t.width > U || t.height > U) && (t.width > U && t.height > U ? t.width > t.height ? (t.height *= U / t.width, t.width = U) : (t.width *= U / t.height, t.height = U) : t.width > U ? (t.height *= U / t.width, t.width = U) : (t.width *= U / t.height, t.height = U));
2474
2502
  }
2475
- function ke(e) {
2476
- return new Promise((t, a) => {
2503
+ function zt(t) {
2504
+ return new Promise((e, a) => {
2477
2505
  const o = new Image();
2478
2506
  o.onload = () => {
2479
2507
  o.decode().then(() => {
2480
- requestAnimationFrame(() => t(o));
2508
+ requestAnimationFrame(() => e(o));
2481
2509
  });
2482
- }, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = e;
2510
+ }, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = t;
2483
2511
  });
2484
2512
  }
2485
- async function fo(e) {
2486
- return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
2513
+ async function bo(t) {
2514
+ return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
2487
2515
  }
2488
- async function yo(e, t, a) {
2489
- const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
2490
- 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), fo(s);
2516
+ async function wo(t, e, a) {
2517
+ const o = "http://www.w3.org/2000/svg", i = document.createElementNS(o, "svg"), s = document.createElementNS(o, "foreignObject");
2518
+ return i.setAttribute("width", `${e}`), i.setAttribute("height", `${a}`), i.setAttribute("viewBox", `0 0 ${e} ${a}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), i.appendChild(s), s.appendChild(t), bo(i);
2491
2519
  }
2492
- const L = (e, t) => {
2493
- if (e instanceof t)
2520
+ const L = (t, e) => {
2521
+ if (t instanceof e)
2494
2522
  return !0;
2495
- const a = Object.getPrototypeOf(e);
2496
- return a === null ? !1 : a.constructor.name === t.name || L(a, t);
2523
+ const a = Object.getPrototypeOf(t);
2524
+ return a === null ? !1 : a.constructor.name === e.name || L(a, e);
2497
2525
  };
2498
- function vo(e) {
2499
- const t = e.getPropertyValue("content");
2500
- return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
2501
- }
2502
- function ko(e, t) {
2503
- return Pt(t).map((a) => {
2504
- const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
2505
- return `${a}: ${o}${s ? " !important" : ""};`;
2526
+ function So(t) {
2527
+ const e = t.getPropertyValue("content");
2528
+ return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
2529
+ }
2530
+ function Ao(t, e) {
2531
+ return Ue(e).map((a) => {
2532
+ const o = t.getPropertyValue(a), i = t.getPropertyPriority(a);
2533
+ return `${a}: ${o}${i ? " !important" : ""};`;
2506
2534
  }).join(" ");
2507
2535
  }
2508
- function bo(e, t, a, o) {
2509
- const s = `.${e}:${t}`, i = a.cssText ? vo(a) : ko(a, o);
2510
- return document.createTextNode(`${s}{${i}}`);
2536
+ function Co(t, e, a, o) {
2537
+ const i = `.${t}:${e}`, s = a.cssText ? So(a) : Ao(a, o);
2538
+ return document.createTextNode(`${i}{${s}}`);
2511
2539
  }
2512
- function ot(e, t, a, o) {
2513
- const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
2514
- if (i === "" || i === "none")
2540
+ function re(t, e, a, o) {
2541
+ const i = window.getComputedStyle(t, a), s = i.getPropertyValue("content");
2542
+ if (s === "" || s === "none")
2515
2543
  return;
2516
- const r = co();
2544
+ const n = ho();
2517
2545
  try {
2518
- t.className = `${t.className} ${r}`;
2546
+ e.className = `${e.className} ${n}`;
2519
2547
  } catch {
2520
2548
  return;
2521
2549
  }
2522
2550
  const l = document.createElement("style");
2523
- l.appendChild(bo(r, a, s, o)), t.appendChild(l);
2551
+ l.appendChild(Co(n, a, i, o)), e.appendChild(l);
2524
2552
  }
2525
- function wo(e, t, a) {
2526
- ot(e, t, ":before", a), ot(e, t, ":after", a);
2553
+ function zo(t, e, a) {
2554
+ re(t, e, ":before", a), re(t, e, ":after", a);
2527
2555
  }
2528
- const it = "application/font-woff", st = "image/jpeg", So = {
2529
- woff: it,
2530
- woff2: it,
2556
+ const ne = "application/font-woff", le = "image/jpeg", Eo = {
2557
+ woff: ne,
2558
+ woff2: ne,
2531
2559
  ttf: "application/font-truetype",
2532
2560
  eot: "application/vnd.ms-fontobject",
2533
2561
  png: "image/png",
2534
- jpg: st,
2535
- jpeg: st,
2562
+ jpg: le,
2563
+ jpeg: le,
2536
2564
  gif: "image/gif",
2537
2565
  tiff: "image/tiff",
2538
2566
  svg: "image/svg+xml",
2539
2567
  webp: "image/webp"
2540
2568
  };
2541
- function Ao(e) {
2542
- const t = /\.([^./]*?)$/g.exec(e);
2543
- return t ? t[1] : "";
2569
+ function Ro(t) {
2570
+ const e = /\.([^./]*?)$/g.exec(t);
2571
+ return e ? e[1] : "";
2544
2572
  }
2545
- function _e(e) {
2546
- const t = Ao(e).toLowerCase();
2547
- return So[t] || "";
2573
+ function Wt(t) {
2574
+ const e = Ro(t).toLowerCase();
2575
+ return Eo[e] || "";
2548
2576
  }
2549
- function Co(e) {
2550
- return e.split(/,/)[1];
2577
+ function jo(t) {
2578
+ return t.split(/,/)[1];
2551
2579
  }
2552
- function Be(e) {
2553
- return e.search(/^(data:)/) !== -1;
2580
+ function Nt(t) {
2581
+ return t.search(/^(data:)/) !== -1;
2554
2582
  }
2555
- function zo(e, t) {
2556
- return `data:${t};base64,${e}`;
2583
+ function Po(t, e) {
2584
+ return `data:${e};base64,${t}`;
2557
2585
  }
2558
- async function Lt(e, t, a) {
2559
- const o = await fetch(e, t);
2586
+ async function Fe(t, e, a) {
2587
+ const o = await fetch(t, e);
2560
2588
  if (o.status === 404)
2561
2589
  throw new Error(`Resource "${o.url}" not found`);
2562
- const s = await o.blob();
2563
- return new Promise((i, r) => {
2590
+ const i = await o.blob();
2591
+ return new Promise((s, n) => {
2564
2592
  const l = new FileReader();
2565
- l.onerror = r, l.onloadend = () => {
2593
+ l.onerror = n, l.onloadend = () => {
2566
2594
  try {
2567
- i(a({ res: o, result: l.result }));
2595
+ s(a({ res: o, result: l.result }));
2568
2596
  } catch (u) {
2569
- r(u);
2597
+ n(u);
2570
2598
  }
2571
- }, l.readAsDataURL(s);
2599
+ }, l.readAsDataURL(i);
2572
2600
  });
2573
2601
  }
2574
- const Oe = {};
2575
- function Eo(e, t, a) {
2576
- let o = e.replace(/\?.*/, "");
2577
- return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
2578
- }
2579
- async function We(e, t, a) {
2580
- const o = Eo(e, t, a.includeQueryParams);
2581
- if (Oe[o] != null)
2582
- return Oe[o];
2583
- a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2584
- let s;
2602
+ const Ot = {};
2603
+ function xo(t, e, a) {
2604
+ let o = t.replace(/\?.*/, "");
2605
+ return a && (o = t), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), e ? `[${e}]${o}` : o;
2606
+ }
2607
+ async function Zt(t, e, a) {
2608
+ const o = xo(t, e, a.includeQueryParams);
2609
+ if (Ot[o] != null)
2610
+ return Ot[o];
2611
+ a.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2612
+ let i;
2585
2613
  try {
2586
- const i = await Lt(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Co(l)));
2587
- s = zo(i, t);
2588
- } catch (i) {
2589
- s = a.imagePlaceholder || "";
2590
- let r = `Failed to fetch resource: ${e}`;
2591
- i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
2614
+ const s = await Fe(t, a.fetchRequestInit, ({ res: n, result: l }) => (e || (e = n.headers.get("Content-Type") || ""), jo(l)));
2615
+ i = Po(s, e);
2616
+ } catch (s) {
2617
+ i = a.imagePlaceholder || "";
2618
+ let n = `Failed to fetch resource: ${t}`;
2619
+ s && (n = typeof s == "string" ? s : s.message), n && console.warn(n);
2592
2620
  }
2593
- return Oe[o] = s, s;
2594
- }
2595
- async function jo(e) {
2596
- const t = e.toDataURL();
2597
- return t === "data:," ? e.cloneNode(!1) : ke(t);
2598
- }
2599
- async function Ro(e, t) {
2600
- if (e.currentSrc) {
2601
- const i = document.createElement("canvas"), r = i.getContext("2d");
2602
- i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
2603
- const l = i.toDataURL();
2604
- return ke(l);
2621
+ return Ot[o] = i, i;
2622
+ }
2623
+ async function Lo(t) {
2624
+ const e = t.toDataURL();
2625
+ return e === "data:," ? t.cloneNode(!1) : zt(e);
2626
+ }
2627
+ async function Uo(t, e) {
2628
+ if (t.currentSrc) {
2629
+ const s = document.createElement("canvas"), n = s.getContext("2d");
2630
+ s.width = t.clientWidth, s.height = t.clientHeight, n == null || n.drawImage(t, 0, 0, s.width, s.height);
2631
+ const l = s.toDataURL();
2632
+ return zt(l);
2605
2633
  }
2606
- const a = e.poster, o = _e(a), s = await We(a, o, t);
2607
- return ke(s);
2634
+ const a = t.poster, o = Wt(a), i = await Zt(a, o, e);
2635
+ return zt(i);
2608
2636
  }
2609
- async function Po(e, t) {
2637
+ async function To(t, e) {
2610
2638
  var a;
2611
2639
  try {
2612
- if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
2613
- return await je(e.contentDocument.body, t, !0);
2640
+ if (!((a = t == null ? void 0 : t.contentDocument) === null || a === void 0) && a.body)
2641
+ return await Ut(t.contentDocument.body, e, !0);
2614
2642
  } catch {
2615
2643
  }
2616
- return e.cloneNode(!1);
2644
+ return t.cloneNode(!1);
2617
2645
  }
2618
- async function xo(e, t) {
2619
- return L(e, HTMLCanvasElement) ? jo(e) : L(e, HTMLVideoElement) ? Ro(e, t) : L(e, HTMLIFrameElement) ? Po(e, t) : e.cloneNode(Ut(e));
2646
+ async function Fo(t, e) {
2647
+ return L(t, HTMLCanvasElement) ? Lo(t) : L(t, HTMLVideoElement) ? Uo(t, e) : L(t, HTMLIFrameElement) ? To(t, e) : t.cloneNode(Me(t));
2620
2648
  }
2621
- const Lo = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ut = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
2622
- async function Uo(e, t, a) {
2623
- var o, s;
2624
- if (Ut(t))
2625
- return t;
2626
- let i = [];
2627
- return Lo(e) && e.assignedNodes ? i = W(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = W(e.contentDocument.body.childNodes) : i = W(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => je(l, a)).then((u) => {
2628
- u && t.appendChild(u);
2629
- }), Promise.resolve()), t;
2649
+ const Mo = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT", Me = (t) => t.tagName != null && t.tagName.toUpperCase() === "SVG";
2650
+ async function Do(t, e, a) {
2651
+ var o, i;
2652
+ if (Me(e))
2653
+ return e;
2654
+ let s = [];
2655
+ return Mo(t) && t.assignedNodes ? s = X(t.assignedNodes()) : L(t, HTMLIFrameElement) && (!((o = t.contentDocument) === null || o === void 0) && o.body) ? s = X(t.contentDocument.body.childNodes) : s = X(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes), s.length === 0 || L(t, HTMLVideoElement) || await s.reduce((n, l) => n.then(() => Ut(l, a)).then((u) => {
2656
+ u && e.appendChild(u);
2657
+ }), Promise.resolve()), e;
2630
2658
  }
2631
- function To(e, t, a) {
2632
- const o = t.style;
2659
+ function Oo(t, e, a) {
2660
+ const o = e.style;
2633
2661
  if (!o)
2634
2662
  return;
2635
- const s = window.getComputedStyle(e);
2636
- s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : Pt(a).forEach((i) => {
2637
- let r = s.getPropertyValue(i);
2638
- 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));
2663
+ const i = window.getComputedStyle(t);
2664
+ i.cssText ? (o.cssText = i.cssText, o.transformOrigin = i.transformOrigin) : Ue(a).forEach((s) => {
2665
+ let n = i.getPropertyValue(s);
2666
+ s === "font-size" && n.endsWith("px") && (n = `${Math.floor(parseFloat(n.substring(0, n.length - 2))) - 0.1}px`), L(t, HTMLIFrameElement) && s === "display" && n === "inline" && (n = "block"), s === "d" && e.getAttribute("d") && (n = `path(${e.getAttribute("d")})`), o.setProperty(s, n, i.getPropertyPriority(s));
2639
2667
  });
2640
2668
  }
2641
- function Fo(e, t) {
2642
- L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
2669
+ function Io(t, e) {
2670
+ L(t, HTMLTextAreaElement) && (e.innerHTML = t.value), L(t, HTMLInputElement) && e.setAttribute("value", t.value);
2643
2671
  }
2644
- function Oo(e, t) {
2645
- if (L(e, HTMLSelectElement)) {
2646
- const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
2672
+ function Vo(t, e) {
2673
+ if (L(t, HTMLSelectElement)) {
2674
+ const o = Array.from(e.children).find((i) => t.value === i.getAttribute("value"));
2647
2675
  o && o.setAttribute("selected", "");
2648
2676
  }
2649
2677
  }
2650
- function Do(e, t, a) {
2651
- return L(t, Element) && (To(e, t, a), wo(e, t, a), Fo(e, t), Oo(e, t)), t;
2678
+ function $o(t, e, a) {
2679
+ return L(e, Element) && (Oo(t, e, a), zo(t, e, a), Io(t, e), Vo(t, e)), e;
2652
2680
  }
2653
- async function Mo(e, t) {
2654
- const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
2681
+ async function Bo(t, e) {
2682
+ const a = t.querySelectorAll ? t.querySelectorAll("use") : [];
2655
2683
  if (a.length === 0)
2656
- return e;
2684
+ return t;
2657
2685
  const o = {};
2658
- for (let i = 0; i < a.length; i++) {
2659
- const l = a[i].getAttribute("xlink:href");
2686
+ for (let s = 0; s < a.length; s++) {
2687
+ const l = a[s].getAttribute("xlink:href");
2660
2688
  if (l) {
2661
- const u = e.querySelector(l), c = document.querySelector(l);
2662
- !u && c && !o[l] && (o[l] = await je(c, t, !0));
2689
+ const u = t.querySelector(l), d = document.querySelector(l);
2690
+ !u && d && !o[l] && (o[l] = await Ut(d, e, !0));
2663
2691
  }
2664
2692
  }
2665
- const s = Object.values(o);
2666
- if (s.length) {
2667
- const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
2668
- r.setAttribute("xmlns", i), r.style.position = "absolute", r.style.width = "0", r.style.height = "0", r.style.overflow = "hidden", r.style.display = "none";
2669
- const l = document.createElementNS(i, "defs");
2670
- r.appendChild(l);
2671
- for (let u = 0; u < s.length; u++)
2672
- l.appendChild(s[u]);
2673
- e.appendChild(r);
2693
+ const i = Object.values(o);
2694
+ if (i.length) {
2695
+ const s = "http://www.w3.org/1999/xhtml", n = document.createElementNS(s, "svg");
2696
+ n.setAttribute("xmlns", s), n.style.position = "absolute", n.style.width = "0", n.style.height = "0", n.style.overflow = "hidden", n.style.display = "none";
2697
+ const l = document.createElementNS(s, "defs");
2698
+ n.appendChild(l);
2699
+ for (let u = 0; u < i.length; u++)
2700
+ l.appendChild(i[u]);
2701
+ t.appendChild(n);
2674
2702
  }
2675
- return e;
2703
+ return t;
2676
2704
  }
2677
- async function je(e, t, a) {
2678
- return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => xo(o, t)).then((o) => Uo(e, o, t)).then((o) => Do(e, o, t)).then((o) => Mo(o, t));
2705
+ async function Ut(t, e, a) {
2706
+ return !a && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((o) => Fo(o, e)).then((o) => Do(t, o, e)).then((o) => $o(t, o, e)).then((o) => Bo(o, e));
2679
2707
  }
2680
- const Tt = /url\((['"]?)([^'"]+?)\1\)/g, Io = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Vo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2681
- function $o(e) {
2682
- const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
2683
- return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
2708
+ const De = /url\((['"]?)([^'"]+?)\1\)/g, No = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Ko = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2709
+ function Ho(t) {
2710
+ const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
2711
+ return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
2684
2712
  }
2685
- function Bo(e) {
2686
- const t = [];
2687
- return e.replace(Tt, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
2713
+ function Go(t) {
2714
+ const e = [];
2715
+ return t.replace(De, (a, o, i) => (e.push(i), a)), e.filter((a) => !Nt(a));
2688
2716
  }
2689
- async function No(e, t, a, o, s) {
2717
+ async function qo(t, e, a, o, i) {
2690
2718
  try {
2691
- const i = a ? uo(t, a) : t, r = _e(t);
2719
+ const s = a ? mo(e, a) : e, n = Wt(e);
2692
2720
  let l;
2693
- return s || (l = await We(i, r, o)), e.replace($o(t), `$1${l}$3`);
2721
+ return i || (l = await Zt(s, n, o)), t.replace(Ho(e), `$1${l}$3`);
2694
2722
  } catch {
2695
2723
  }
2696
- return e;
2724
+ return t;
2697
2725
  }
2698
- function Ko(e, { preferredFontFormat: t }) {
2699
- return t ? e.replace(Vo, (a) => {
2726
+ function _o(t, { preferredFontFormat: e }) {
2727
+ return e ? t.replace(Ko, (a) => {
2700
2728
  for (; ; ) {
2701
- const [o, , s] = Io.exec(a) || [];
2702
- if (!s)
2729
+ const [o, , i] = No.exec(a) || [];
2730
+ if (!i)
2703
2731
  return "";
2704
- if (s === t)
2732
+ if (i === e)
2705
2733
  return `src: ${o};`;
2706
2734
  }
2707
- }) : e;
2735
+ }) : t;
2708
2736
  }
2709
- function Ft(e) {
2710
- return e.search(Tt) !== -1;
2737
+ function Oe(t) {
2738
+ return t.search(De) !== -1;
2711
2739
  }
2712
- async function Ot(e, t, a) {
2713
- if (!Ft(e))
2714
- return e;
2715
- const o = Ko(e, a);
2716
- return Bo(o).reduce((i, r) => i.then((l) => No(l, r, t, a)), Promise.resolve(o));
2740
+ async function Ie(t, e, a) {
2741
+ if (!Oe(t))
2742
+ return t;
2743
+ const o = _o(t, a);
2744
+ return Go(o).reduce((s, n) => s.then((l) => qo(l, n, e, a)), Promise.resolve(o));
2717
2745
  }
2718
- async function ae(e, t, a) {
2746
+ async function st(t, e, a) {
2719
2747
  var o;
2720
- const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
2721
- if (s) {
2722
- const i = await Ot(s, null, a);
2723
- return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
2748
+ const i = (o = e.style) === null || o === void 0 ? void 0 : o.getPropertyValue(t);
2749
+ if (i) {
2750
+ const s = await Ie(i, null, a);
2751
+ return e.style.setProperty(t, s, e.style.getPropertyPriority(t)), !0;
2724
2752
  }
2725
2753
  return !1;
2726
2754
  }
2727
- async function Ho(e, t) {
2728
- await ae("background", e, t) || await ae("background-image", e, t), await ae("mask", e, t) || await ae("-webkit-mask", e, t) || await ae("mask-image", e, t) || await ae("-webkit-mask-image", e, t);
2755
+ async function Wo(t, e) {
2756
+ await st("background", t, e) || await st("background-image", t, e), await st("mask", t, e) || await st("-webkit-mask", t, e) || await st("mask-image", t, e) || await st("-webkit-mask-image", t, e);
2729
2757
  }
2730
- async function Go(e, t) {
2731
- const a = L(e, HTMLImageElement);
2732
- if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
2758
+ async function Zo(t, e) {
2759
+ const a = L(t, HTMLImageElement);
2760
+ if (!(a && !Nt(t.src)) && !(L(t, SVGImageElement) && !Nt(t.href.baseVal)))
2733
2761
  return;
2734
- const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
2735
- await new Promise((i, r) => {
2736
- e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
2762
+ const o = a ? t.src : t.href.baseVal, i = await Zt(o, Wt(o), e);
2763
+ await new Promise((s, n) => {
2764
+ t.onload = s, t.onerror = e.onImageErrorHandler ? (...u) => {
2737
2765
  try {
2738
- i(t.onImageErrorHandler(...u));
2739
- } catch (c) {
2740
- r(c);
2766
+ s(e.onImageErrorHandler(...u));
2767
+ } catch (d) {
2768
+ n(d);
2741
2769
  }
2742
- } : r;
2743
- const l = e;
2744
- l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2770
+ } : n;
2771
+ const l = t;
2772
+ l.decode && (l.decode = s), l.loading === "lazy" && (l.loading = "eager"), a ? (t.srcset = "", t.src = i) : t.href.baseVal = i;
2745
2773
  });
2746
2774
  }
2747
- async function qo(e, t) {
2748
- const o = W(e.childNodes).map((s) => Dt(s, t));
2749
- await Promise.all(o).then(() => e);
2750
- }
2751
- async function Dt(e, t) {
2752
- L(e, Element) && (await Ho(e, t), await Go(e, t), await qo(e, t));
2753
- }
2754
- function _o(e, t) {
2755
- const { style: a } = e;
2756
- t.backgroundColor && (a.backgroundColor = t.backgroundColor), t.width && (a.width = `${t.width}px`), t.height && (a.height = `${t.height}px`);
2757
- const o = t.style;
2758
- return o != null && Object.keys(o).forEach((s) => {
2759
- a[s] = o[s];
2760
- }), e;
2761
- }
2762
- const rt = {};
2763
- async function nt(e) {
2764
- let t = rt[e];
2765
- if (t != null)
2766
- return t;
2767
- const o = await (await fetch(e)).text();
2768
- return t = { url: e, cssText: o }, rt[e] = t, t;
2769
- }
2770
- async function lt(e, t) {
2771
- let a = e.cssText;
2772
- const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
2773
- let l = r.replace(o, "$1");
2774
- return l.startsWith("https://") || (l = new URL(l, e.url).href), Lt(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2775
+ async function Jo(t, e) {
2776
+ const o = X(t.childNodes).map((i) => Ve(i, e));
2777
+ await Promise.all(o).then(() => t);
2778
+ }
2779
+ async function Ve(t, e) {
2780
+ L(t, Element) && (await Wo(t, e), await Zo(t, e), await Jo(t, e));
2781
+ }
2782
+ function Yo(t, e) {
2783
+ const { style: a } = t;
2784
+ e.backgroundColor && (a.backgroundColor = e.backgroundColor), e.width && (a.width = `${e.width}px`), e.height && (a.height = `${e.height}px`);
2785
+ const o = e.style;
2786
+ return o != null && Object.keys(o).forEach((i) => {
2787
+ a[i] = o[i];
2788
+ }), t;
2789
+ }
2790
+ const ue = {};
2791
+ async function ce(t) {
2792
+ let e = ue[t];
2793
+ if (e != null)
2794
+ return e;
2795
+ const o = await (await fetch(t)).text();
2796
+ return e = { url: t, cssText: o }, ue[t] = e, e;
2797
+ }
2798
+ async function de(t, e) {
2799
+ let a = t.cssText;
2800
+ const o = /url\(["']?([^"')]+)["']?\)/g, s = (a.match(/url\([^)]+\)/g) || []).map(async (n) => {
2801
+ let l = n.replace(o, "$1");
2802
+ return l.startsWith("https://") || (l = new URL(l, t.url).href), Fe(l, e.fetchRequestInit, ({ result: u }) => (a = a.replace(n, `url(${u})`), [n, u]));
2775
2803
  });
2776
- return Promise.all(i).then(() => a);
2804
+ return Promise.all(s).then(() => a);
2777
2805
  }
2778
- function ut(e) {
2779
- if (e == null)
2806
+ function pe(t) {
2807
+ if (t == null)
2780
2808
  return [];
2781
- const t = [], a = /(\/\*[\s\S]*?\*\/)/gi;
2782
- let o = e.replace(a, "");
2783
- const s = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
2809
+ const e = [], a = /(\/\*[\s\S]*?\*\/)/gi;
2810
+ let o = t.replace(a, "");
2811
+ const i = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
2784
2812
  for (; ; ) {
2785
- const u = s.exec(o);
2813
+ const u = i.exec(o);
2786
2814
  if (u === null)
2787
2815
  break;
2788
- t.push(u[0]);
2816
+ e.push(u[0]);
2789
2817
  }
2790
- o = o.replace(s, "");
2791
- 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");
2818
+ o = o.replace(i, "");
2819
+ const s = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, n = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", l = new RegExp(n, "gi");
2792
2820
  for (; ; ) {
2793
- let u = i.exec(o);
2821
+ let u = s.exec(o);
2794
2822
  if (u === null) {
2795
2823
  if (u = l.exec(o), u === null)
2796
2824
  break;
2797
- i.lastIndex = l.lastIndex;
2825
+ s.lastIndex = l.lastIndex;
2798
2826
  } else
2799
- l.lastIndex = i.lastIndex;
2800
- t.push(u[0]);
2827
+ l.lastIndex = s.lastIndex;
2828
+ e.push(u[0]);
2801
2829
  }
2802
- return t;
2830
+ return e;
2803
2831
  }
2804
- async function Wo(e, t) {
2832
+ async function Xo(t, e) {
2805
2833
  const a = [], o = [];
2806
- return e.forEach((s) => {
2807
- if ("cssRules" in s)
2834
+ return t.forEach((i) => {
2835
+ if ("cssRules" in i)
2808
2836
  try {
2809
- W(s.cssRules || []).forEach((i, r) => {
2810
- if (i.type === CSSRule.IMPORT_RULE) {
2811
- let l = r + 1;
2812
- const u = i.href, c = nt(u).then((g) => lt(g, t)).then((g) => ut(g).forEach((v) => {
2837
+ X(i.cssRules || []).forEach((s, n) => {
2838
+ if (s.type === CSSRule.IMPORT_RULE) {
2839
+ let l = n + 1;
2840
+ const u = s.href, d = ce(u).then((g) => de(g, e)).then((g) => pe(g).forEach((k) => {
2813
2841
  try {
2814
- s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
2815
- } catch (k) {
2842
+ i.insertRule(k, k.startsWith("@import") ? l += 1 : i.cssRules.length);
2843
+ } catch (v) {
2816
2844
  console.error("Error inserting rule from remote css", {
2817
- rule: v,
2818
- error: k
2845
+ rule: k,
2846
+ error: v
2819
2847
  });
2820
2848
  }
2821
2849
  })).catch((g) => {
2822
2850
  console.error("Error loading remote css", g.toString());
2823
2851
  });
2824
- o.push(c);
2852
+ o.push(d);
2825
2853
  }
2826
2854
  });
2827
- } catch (i) {
2828
- const r = e.find((l) => l.href == null) || document.styleSheets[0];
2829
- s.href != null && o.push(nt(s.href).then((l) => lt(l, t)).then((l) => ut(l).forEach((u) => {
2830
- r.insertRule(u, r.cssRules.length);
2855
+ } catch (s) {
2856
+ const n = t.find((l) => l.href == null) || document.styleSheets[0];
2857
+ i.href != null && o.push(ce(i.href).then((l) => de(l, e)).then((l) => pe(l).forEach((u) => {
2858
+ n.insertRule(u, n.cssRules.length);
2831
2859
  })).catch((l) => {
2832
2860
  console.error("Error loading remote stylesheet", l);
2833
- })), console.error("Error inlining remote css file", i);
2861
+ })), console.error("Error inlining remote css file", s);
2834
2862
  }
2835
- }), Promise.all(o).then(() => (e.forEach((s) => {
2836
- if ("cssRules" in s)
2863
+ }), Promise.all(o).then(() => (t.forEach((i) => {
2864
+ if ("cssRules" in i)
2837
2865
  try {
2838
- W(s.cssRules || []).forEach((i) => {
2839
- a.push(i);
2866
+ X(i.cssRules || []).forEach((s) => {
2867
+ a.push(s);
2840
2868
  });
2841
- } catch (i) {
2842
- console.error(`Error while reading CSS rules from ${s.href}`, i);
2869
+ } catch (s) {
2870
+ console.error(`Error while reading CSS rules from ${i.href}`, s);
2843
2871
  }
2844
2872
  }), a));
2845
2873
  }
2846
- function Zo(e) {
2847
- return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ft(t.style.getPropertyValue("src")));
2874
+ function Qo(t) {
2875
+ return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Oe(e.style.getPropertyValue("src")));
2848
2876
  }
2849
- async function Jo(e, t) {
2850
- if (e.ownerDocument == null)
2877
+ async function ti(t, e) {
2878
+ if (t.ownerDocument == null)
2851
2879
  throw new Error("Provided element is not within a Document");
2852
- const a = W(e.ownerDocument.styleSheets), o = await Wo(a, t);
2853
- return Zo(o);
2880
+ const a = X(t.ownerDocument.styleSheets), o = await Xo(a, e);
2881
+ return Qo(o);
2854
2882
  }
2855
- function Mt(e) {
2856
- return e.trim().replace(/["']/g, "");
2883
+ function $e(t) {
2884
+ return t.trim().replace(/["']/g, "");
2857
2885
  }
2858
- function Yo(e) {
2859
- const t = /* @__PURE__ */ new Set();
2886
+ function ei(t) {
2887
+ const e = /* @__PURE__ */ new Set();
2860
2888
  function a(o) {
2861
- (o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((i) => {
2862
- t.add(Mt(i));
2863
- }), Array.from(o.children).forEach((i) => {
2864
- i instanceof HTMLElement && a(i);
2889
+ (o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((s) => {
2890
+ e.add($e(s));
2891
+ }), Array.from(o.children).forEach((s) => {
2892
+ s instanceof HTMLElement && a(s);
2865
2893
  });
2866
2894
  }
2867
- return a(e), t;
2895
+ return a(t), e;
2868
2896
  }
2869
- async function Xo(e, t) {
2870
- const a = await Jo(e, t), o = Yo(e);
2871
- return (await Promise.all(a.filter((i) => o.has(Mt(i.style.fontFamily))).map((i) => {
2872
- const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
2873
- return Ot(i.cssText, r, t);
2897
+ async function ai(t, e) {
2898
+ const a = await ti(t, e), o = ei(t);
2899
+ return (await Promise.all(a.filter((s) => o.has($e(s.style.fontFamily))).map((s) => {
2900
+ const n = s.parentStyleSheet ? s.parentStyleSheet.href : null;
2901
+ return Ie(s.cssText, n, e);
2874
2902
  }))).join(`
2875
2903
  `);
2876
2904
  }
2877
- async function Qo(e, t) {
2878
- const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await Xo(e, t);
2905
+ async function oi(t, e) {
2906
+ const a = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await ai(t, e);
2879
2907
  if (a) {
2880
- const o = document.createElement("style"), s = document.createTextNode(a);
2881
- o.appendChild(s), e.firstChild ? e.insertBefore(o, e.firstChild) : e.appendChild(o);
2908
+ const o = document.createElement("style"), i = document.createTextNode(a);
2909
+ o.appendChild(i), t.firstChild ? t.insertBefore(o, t.firstChild) : t.appendChild(o);
2882
2910
  }
2883
2911
  }
2884
- async function ei(e, t = {}) {
2885
- const { width: a, height: o } = xt(e, t), s = await je(e, t, !0);
2886
- return await Qo(s, t), await Dt(s, t), _o(s, t), await yo(s, a, o);
2912
+ async function ii(t, e = {}) {
2913
+ const { width: a, height: o } = Te(t, e), i = await Ut(t, e, !0);
2914
+ return await oi(i, e), await Ve(i, e), Yo(i, e), await wo(i, a, o);
2887
2915
  }
2888
- async function ti(e, t = {}) {
2889
- const { width: a, height: o } = xt(e, t), s = await ei(e, t), i = await ke(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || mo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
2890
- return r.width = c * u, r.height = g * u, t.skipAutoScale || ho(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;
2916
+ async function si(t, e = {}) {
2917
+ const { width: a, height: o } = Te(t, e), i = await ii(t, e), s = await zt(i), n = document.createElement("canvas"), l = n.getContext("2d"), u = e.pixelRatio || vo(), d = e.canvasWidth || a, g = e.canvasHeight || o;
2918
+ return n.width = d * u, n.height = g * u, e.skipAutoScale || ko(n), n.style.width = `${d}`, n.style.height = `${g}`, e.backgroundColor && (l.fillStyle = e.backgroundColor, l.fillRect(0, 0, n.width, n.height)), l.drawImage(s, 0, 0, n.width, n.height), n;
2891
2919
  }
2892
- async function ct(e, t = {}) {
2893
- return (await ti(e, t)).toDataURL();
2920
+ async function ge(t, e = {}) {
2921
+ return (await si(t, e)).toDataURL();
2894
2922
  }
2895
- const be = "data-nf-capture-chrome", ai = "data-nf-canvas-snap", oi = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2896
- function It(e) {
2897
- return e instanceof Element && (e.hasAttribute(be) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2923
+ const Et = "data-nf-capture-chrome", ri = "data-nf-canvas-snap", ni = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2924
+ function Be(t) {
2925
+ return t instanceof Element && (t.hasAttribute(Et) || t.hasAttribute("data-nf-mask-cover") || t.id === "notefully");
2898
2926
  }
2899
- function ii() {
2900
- const e = [];
2901
- return Array.from(document.styleSheets).forEach((t) => {
2927
+ function li() {
2928
+ const t = [];
2929
+ return Array.from(document.styleSheets).forEach((e) => {
2902
2930
  try {
2903
- t.cssRules;
2931
+ e.cssRules;
2904
2932
  } catch {
2905
2933
  try {
2906
- if (t.disabled)
2934
+ if (e.disabled)
2907
2935
  return;
2908
- t.disabled = !0, e.push(t);
2936
+ e.disabled = !0, t.push(e);
2909
2937
  } catch {
2910
- const a = t.ownerNode;
2911
- a && "disabled" in a && !a.disabled && (a.disabled = !0, e.push({ node: a }));
2938
+ const a = e.ownerNode;
2939
+ a && "disabled" in a && !a.disabled && (a.disabled = !0, t.push({ node: a }));
2912
2940
  }
2913
2941
  }
2914
2942
  }), () => {
2915
- e.forEach((t) => {
2943
+ t.forEach((e) => {
2916
2944
  try {
2917
- t && t.node ? t.node.disabled = !1 : t && (t.disabled = !1);
2945
+ e && e.node ? e.node.disabled = !1 : e && (e.disabled = !1);
2918
2946
  } catch {
2919
2947
  }
2920
2948
  });
2921
2949
  };
2922
2950
  }
2923
- function si() {
2924
- const e = [];
2951
+ function ui() {
2952
+ const t = [];
2925
2953
  return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((a) => {
2926
- const o = a.getBoundingClientRect(), s = document.createElement("div");
2927
- s.setAttribute("data-nf-mask-cover", "1"), s.style.cssText = [
2954
+ const o = a.getBoundingClientRect(), i = document.createElement("div");
2955
+ i.setAttribute("data-nf-mask-cover", "1"), i.style.cssText = [
2928
2956
  "position:fixed",
2929
2957
  `left:${o.left}px`,
2930
2958
  `top:${o.top}px`,
@@ -2933,50 +2961,50 @@ function si() {
2933
2961
  "background:#111",
2934
2962
  "z-index:2147483646",
2935
2963
  "pointer-events:none"
2936
- ].join(";"), document.body.appendChild(s), e.push(s);
2937
- }), () => e.forEach((a) => a.remove());
2964
+ ].join(";"), document.body.appendChild(i), t.push(i);
2965
+ }), () => t.forEach((a) => a.remove());
2938
2966
  }
2939
- function ri() {
2940
- const e = document.querySelector(`[${be}]`);
2941
- if (e)
2942
- return e;
2943
- const t = document.createElement("div");
2944
- return t.setAttribute(be, "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;
2967
+ function ci() {
2968
+ const t = document.querySelector(`[${Et}]`);
2969
+ if (t)
2970
+ return t;
2971
+ const e = document.createElement("div");
2972
+ return e.setAttribute(Et, "1"), e.className = "nf-capture-chrome", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.innerHTML = `<span class="nf-capture-chrome-pill">${p("status.capturing")}</span>`, document.body.appendChild(e), e;
2945
2973
  }
2946
- function ni() {
2947
- document.querySelectorAll(`[${be}]`).forEach((e) => e.remove());
2974
+ function di() {
2975
+ document.querySelectorAll(`[${Et}]`).forEach((t) => t.remove());
2948
2976
  }
2949
- function Ne() {
2950
- return new Promise((e) => {
2951
- requestAnimationFrame(() => requestAnimationFrame(e));
2977
+ function Kt() {
2978
+ return new Promise((t) => {
2979
+ requestAnimationFrame(() => requestAnimationFrame(t));
2952
2980
  });
2953
2981
  }
2954
- function Z(e) {
2955
- if (typeof e != "string" || !e.startsWith("data:image/"))
2982
+ function Q(t) {
2983
+ if (typeof t != "string" || !t.startsWith("data:image/"))
2956
2984
  return !1;
2957
- const t = e.indexOf(",");
2958
- return t > 0 && t < e.length - 1;
2985
+ const e = t.indexOf(",");
2986
+ return e > 0 && e < t.length - 1;
2959
2987
  }
2960
- function li() {
2961
- const e = document.documentElement, t = document.body, a = Math.max(
2988
+ function pi() {
2989
+ const t = document.documentElement, e = document.body, a = Math.max(
2962
2990
  window.innerWidth || 0,
2963
- (e == null ? void 0 : e.clientWidth) || 0,
2964
- (e == null ? void 0 : e.scrollWidth) || 0,
2991
+ (t == null ? void 0 : t.clientWidth) || 0,
2965
2992
  (t == null ? void 0 : t.scrollWidth) || 0,
2993
+ (e == null ? void 0 : e.scrollWidth) || 0,
2966
2994
  1
2967
2995
  ), o = Math.max(
2968
2996
  window.innerHeight || 0,
2969
- (e == null ? void 0 : e.clientHeight) || 0,
2970
- (e == null ? void 0 : e.scrollHeight) || 0,
2997
+ (t == null ? void 0 : t.clientHeight) || 0,
2971
2998
  (t == null ? void 0 : t.scrollHeight) || 0,
2999
+ (e == null ? void 0 : e.scrollHeight) || 0,
2972
3000
  1
2973
3001
  );
2974
3002
  return { width: a, height: o };
2975
3003
  }
2976
- async function ui() {
2977
- const e = [], t = Array.from(document.querySelectorAll("canvas"));
2978
- for (const a of t) {
2979
- if (a.closest("#notefully") || It(a))
3004
+ async function gi() {
3005
+ const t = [], e = Array.from(document.querySelectorAll("canvas"));
3006
+ for (const a of e) {
3007
+ if (a.closest("#notefully") || Be(a))
2980
3008
  continue;
2981
3009
  let o = "";
2982
3010
  try {
@@ -2986,16 +3014,16 @@ async function ui() {
2986
3014
  }
2987
3015
  if (!o || o === "data:,")
2988
3016
  continue;
2989
- const s = document.createElement("img"), i = getComputedStyle(a);
2990
- s.setAttribute(ai, "1"), s.alt = "", s.src = o, s.className = a.className, s.style.cssText = a.style.cssText, s.style.width = i.width, s.style.height = i.height, s.style.maxWidth = i.maxWidth, s.style.maxHeight = i.maxHeight, s.style.objectFit = "fill", s.style.display = i.display === "inline" ? "inline-block" : i.display, a.replaceWith(s), e.push({ canvas: a, img: s });
3017
+ const i = document.createElement("img"), s = getComputedStyle(a);
3018
+ i.setAttribute(ri, "1"), i.alt = "", i.src = o, i.className = a.className, i.style.cssText = a.style.cssText, i.style.width = s.width, i.style.height = s.height, i.style.maxWidth = s.maxWidth, i.style.maxHeight = s.maxHeight, i.style.objectFit = "fill", i.style.display = s.display === "inline" ? "inline-block" : s.display, a.replaceWith(i), t.push({ canvas: a, img: i });
2991
3019
  }
2992
- return await Promise.all(e.map(({ img: a }) => {
3020
+ return await Promise.all(t.map(({ img: a }) => {
2993
3021
  if (!a.complete)
2994
3022
  return new Promise((o) => {
2995
3023
  a.onload = () => o(), a.onerror = () => o();
2996
3024
  });
2997
3025
  })), () => {
2998
- e.forEach(({ canvas: a, img: o }) => {
3026
+ t.forEach(({ canvas: a, img: o }) => {
2999
3027
  try {
3000
3028
  o.parentNode && o.replaceWith(a);
3001
3029
  } catch {
@@ -3003,38 +3031,38 @@ async function ui() {
3003
3031
  });
3004
3032
  };
3005
3033
  }
3006
- async function ci(e) {
3007
- if (!e)
3034
+ async function mi(t) {
3035
+ if (!t)
3008
3036
  return null;
3009
- if (typeof e == "string")
3010
- return Z(e) ? e : null;
3011
- if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
3037
+ if (typeof t == "string")
3038
+ return Q(t) ? t : null;
3039
+ if (typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement)
3012
3040
  try {
3013
- const t = e.toDataURL("image/png");
3014
- return Z(t) ? t : null;
3041
+ const e = t.toDataURL("image/png");
3042
+ return Q(e) ? e : null;
3015
3043
  } catch {
3016
3044
  return null;
3017
3045
  }
3018
- if (typeof Blob < "u" && e instanceof Blob) {
3019
- const t = await di(e);
3020
- return Z(t) ? t : null;
3046
+ if (typeof Blob < "u" && t instanceof Blob) {
3047
+ const e = await hi(t);
3048
+ return Q(e) ? e : null;
3021
3049
  }
3022
3050
  return null;
3023
3051
  }
3024
- async function di(e) {
3052
+ async function hi(t) {
3025
3053
  if (typeof FileReader == "function")
3026
- return new Promise((o, s) => {
3027
- const i = new FileReader();
3028
- i.onload = () => o(String(i.result || "")), i.onerror = () => s(i.error || new Error("Could not read capture blob")), i.readAsDataURL(e);
3054
+ return new Promise((o, i) => {
3055
+ const s = new FileReader();
3056
+ s.onload = () => o(String(s.result || "")), s.onerror = () => i(s.error || new Error("Could not read capture blob")), s.readAsDataURL(t);
3029
3057
  });
3030
- const t = Buffer.from(await e.arrayBuffer());
3031
- return `data:${e.type || "application/octet-stream"};base64,${t.toString("base64")}`;
3058
+ const e = Buffer.from(await t.arrayBuffer());
3059
+ return `data:${t.type || "application/octet-stream"};base64,${e.toString("base64")}`;
3032
3060
  }
3033
- async function pi() {
3034
- var t;
3035
- if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
3061
+ async function fi() {
3062
+ var e;
3063
+ if (!((e = navigator.mediaDevices) != null && e.getDisplayMedia))
3036
3064
  throw new Error(p("status.screenUnsupported"));
3037
- const e = await navigator.mediaDevices.getDisplayMedia({
3065
+ const t = await navigator.mediaDevices.getDisplayMedia({
3038
3066
  video: { displaySurface: "browser" },
3039
3067
  audio: !1,
3040
3068
  preferCurrentTab: !0,
@@ -3042,76 +3070,76 @@ async function pi() {
3042
3070
  });
3043
3071
  try {
3044
3072
  const a = document.createElement("video");
3045
- a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
3073
+ a.muted = !0, a.playsInline = !0, a.srcObject = t, await a.play(), a.videoWidth || await new Promise((l) => {
3046
3074
  a.onloadedmetadata = () => l();
3047
- }), await Ne();
3048
- const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
3049
- i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
3050
- const r = i.toDataURL("image/png");
3051
- if (!Z(r))
3075
+ }), await Kt();
3076
+ const o = a.videoWidth || 1, i = a.videoHeight || 1, s = document.createElement("canvas");
3077
+ s.width = o, s.height = i, s.getContext("2d").drawImage(a, 0, 0, o, i);
3078
+ const n = s.toDataURL("image/png");
3079
+ if (!Q(n))
3052
3080
  throw new Error(p("status.screenEmpty"));
3053
- return r;
3081
+ return n;
3054
3082
  } finally {
3055
- e.getTracks().forEach((a) => a.stop());
3083
+ t.getTracks().forEach((a) => a.stop());
3056
3084
  }
3057
3085
  }
3058
- async function Vt(e = {}) {
3059
- const t = document.getElementById("notefully"), a = t ? t.style.display : "", o = ri(), s = ii();
3060
- let i = () => {
3086
+ async function Ne(t = {}) {
3087
+ const e = document.getElementById("notefully"), a = e ? e.style.display : "", o = ci(), i = li();
3088
+ let s = () => {
3061
3089
  };
3062
- t && (t.style.display = "none");
3063
- const r = si();
3090
+ e && (e.style.display = "none");
3091
+ const n = ui();
3064
3092
  try {
3065
- if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
3066
- const v = await ci(await e.capture());
3067
- if (v)
3068
- return v;
3093
+ if (typeof t.onBeforeCapture == "function" && await t.onBeforeCapture(), await Kt(), typeof t.capture == "function") {
3094
+ const k = await mi(await t.capture());
3095
+ if (k)
3096
+ return k;
3069
3097
  }
3070
- i = await ui(), await Ne();
3071
- const { width: l, height: u } = li(), c = {
3098
+ s = await gi(), await Kt();
3099
+ const { width: l, height: u } = pi(), d = {
3072
3100
  cacheBust: !0,
3073
3101
  width: l,
3074
3102
  height: u,
3075
3103
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
3076
- filter: (v) => !It(v),
3104
+ filter: (k) => !Be(k),
3077
3105
  // 404 / CORS images must not abort the whole capture.
3078
- imagePlaceholder: oi,
3106
+ imagePlaceholder: ni,
3079
3107
  onImageErrorHandler: () => {
3080
3108
  }
3081
3109
  };
3082
3110
  let g = "";
3083
3111
  try {
3084
- g = await ct(document.body, c);
3112
+ g = await ge(document.body, d);
3085
3113
  } catch {
3086
- g = await ct(document.body, { ...c, skipFonts: !0 });
3114
+ g = await ge(document.body, { ...d, skipFonts: !0 });
3087
3115
  }
3088
- if (!Z(g))
3116
+ if (!Q(g))
3089
3117
  throw new Error(p("status.captureEmpty"));
3090
3118
  return g;
3091
3119
  } finally {
3092
3120
  try {
3093
- i();
3121
+ s();
3094
3122
  } catch {
3095
3123
  }
3096
- r(), s(), o.remove(), ni(), t && (t.style.display = a);
3124
+ n(), i(), o.remove(), di(), e && (e.style.display = a);
3097
3125
  }
3098
3126
  }
3099
- function gi(e = "") {
3100
- const t = String(e || "");
3101
- return t ? /Windows NT/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : "Other" : "";
3127
+ function yi(t = "") {
3128
+ const e = String(t || "");
3129
+ return e ? /Windows NT/i.test(e) ? "Windows" : /iPhone|iPad|iPod/i.test(e) ? "iOS" : /Mac OS X|Macintosh/i.test(e) ? "macOS" : /Android/i.test(e) ? "Android" : /CrOS/i.test(e) ? "ChromeOS" : /Linux/i.test(e) ? "Linux" : "Other" : "";
3102
3130
  }
3103
- function mi(e = "") {
3104
- const t = String(e || "");
3105
- return t ? /Edg\//i.test(t) ? "Edge" : /OPR\/|Opera/i.test(t) ? "Opera" : /Firefox\//i.test(t) ? "Firefox" : /Chrome\//i.test(t) || /CriOS\//i.test(t) ? "Chrome" : /Safari\//i.test(t) ? "Safari" : "Other" : "";
3131
+ function vi(t = "") {
3132
+ const e = String(t || "");
3133
+ return e ? /Edg\//i.test(e) ? "Edge" : /OPR\/|Opera/i.test(e) ? "Opera" : /Firefox\//i.test(e) ? "Firefox" : /Chrome\//i.test(e) || /CriOS\//i.test(e) ? "Chrome" : /Safari\//i.test(e) ? "Safari" : "Other" : "";
3106
3134
  }
3107
- function hi(e = {}) {
3108
- const t = navigator.userAgent;
3135
+ function ki(t = {}) {
3136
+ const e = navigator.userAgent;
3109
3137
  return {
3110
3138
  url: location.href,
3111
3139
  title: document.title,
3112
- userAgent: t,
3113
- os: gi(t),
3114
- browser: mi(t),
3140
+ userAgent: e,
3141
+ os: yi(e),
3142
+ browser: vi(e),
3115
3143
  language: navigator.language,
3116
3144
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
3117
3145
  viewport: {
@@ -3125,17 +3153,17 @@ function hi(e = {}) {
3125
3153
  dpr: window.devicePixelRatio || 1
3126
3154
  },
3127
3155
  user: {
3128
- userId: e.userId || null,
3129
- email: e.email || null,
3130
- displayName: e.displayName || null
3156
+ userId: t.userId || null,
3157
+ email: t.email || null,
3158
+ displayName: t.displayName || null
3131
3159
  }
3132
3160
  };
3133
3161
  }
3134
- const dt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), pt = {
3162
+ const me = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), he = {
3135
3163
  id: "userId",
3136
3164
  username: "displayName",
3137
3165
  name: "displayName"
3138
- }, gt = /* @__PURE__ */ new Set([
3166
+ }, fe = /* @__PURE__ */ new Set([
3139
3167
  "endpoint",
3140
3168
  "projectKey",
3141
3169
  "version",
@@ -3153,7 +3181,7 @@ const dt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), pt = {
3153
3181
  "displayLink",
3154
3182
  "locale",
3155
3183
  "translations"
3156
- ]), mt = {
3184
+ ]), ye = {
3157
3185
  slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
3158
3186
  projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
3159
3187
  project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
@@ -3162,217 +3190,220 @@ const dt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), pt = {
3162
3190
  email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
3163
3191
  displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
3164
3192
  };
3165
- function fi(e = {}, t = {}) {
3166
- const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
3167
- for (const r of dt)
3168
- Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
3169
- for (const [r, l] of Object.entries(pt))
3170
- Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
3171
- for (const r of Object.keys(o))
3172
- dt.has(r) || Object.prototype.hasOwnProperty.call(pt, r) || i.push(r);
3173
- if (i.length) {
3174
- const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3193
+ function bi(t = {}, e = {}) {
3194
+ const a = e.warn || Ke, o = t && typeof t == "object" ? t : {}, i = {}, s = [];
3195
+ for (const n of me)
3196
+ Object.prototype.hasOwnProperty.call(o, n) && (i[n] = o[n]);
3197
+ for (const [n, l] of Object.entries(he))
3198
+ Object.prototype.hasOwnProperty.call(o, n) && (Object.prototype.hasOwnProperty.call(i, l) || (i[l] = o[n]));
3199
+ for (const n of Object.keys(o))
3200
+ me.has(n) || Object.prototype.hasOwnProperty.call(he, n) || s.push(n);
3201
+ if (s.length) {
3202
+ const n = s.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3175
3203
  a(
3176
- `Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
3204
+ `Notefully.identify: ignoring unknown key(s): ${s.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + n
3177
3205
  );
3178
3206
  }
3179
- return s;
3180
- }
3181
- function yi(e = {}, t = {}) {
3182
- const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !gt.has(i));
3183
- if (s.length)
3184
- for (const i of s) {
3185
- if (mt[i]) {
3186
- a(`Notefully.init: ignoring "${i}". ${mt[i]}`);
3207
+ return i;
3208
+ }
3209
+ function wi(t = {}, e = {}) {
3210
+ const a = e.warn || Ke, o = t && typeof t == "object" ? t : {}, i = Object.keys(o).filter((s) => !fe.has(s));
3211
+ if (i.length)
3212
+ for (const s of i) {
3213
+ if (ye[s]) {
3214
+ a(`Notefully.init: ignoring "${s}". ${ye[s]}`);
3187
3215
  continue;
3188
3216
  }
3189
3217
  a(
3190
- `Notefully.init: ignoring unknown key "${i}". Supported: ${[...gt].join(", ")}.`
3218
+ `Notefully.init: ignoring unknown key "${s}". Supported: ${[...fe].join(", ")}.`
3191
3219
  );
3192
3220
  }
3193
3221
  }
3194
- function $t(e) {
3195
- typeof console < "u" && typeof console.warn == "function" && console.warn(e);
3222
+ function Ke(t) {
3223
+ typeof console < "u" && typeof console.warn == "function" && console.warn(t);
3196
3224
  }
3197
- const ht = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, vi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3198
- function ft(e) {
3199
- if (e instanceof Error)
3200
- return e.stack || e.message || String(e);
3201
- if (typeof e == "string")
3202
- return e;
3225
+ const ve = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, Si = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3226
+ function ke(t) {
3227
+ if (t instanceof Error)
3228
+ return t.stack || t.message || String(t);
3229
+ if (typeof t == "string")
3230
+ return t;
3203
3231
  try {
3204
- return JSON.stringify(e);
3232
+ return JSON.stringify(t);
3205
3233
  } catch {
3206
- return String(e);
3234
+ return String(t);
3207
3235
  }
3208
3236
  }
3209
- function Ze(e) {
3210
- if (!e || typeof e != "string")
3237
+ function Jt(t) {
3238
+ if (!t || typeof t != "string")
3211
3239
  return "";
3212
- let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3213
- return t ? (ht.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ht.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3240
+ let e = t.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3241
+ return e ? (ve.test(e) && (e = e.split(";").map((a) => a.trim()).filter((a) => a && !ve.test(a)).join("; "), e && !e.endsWith(";") && (e += ";")), e.slice(0, 500)) : "";
3214
3242
  }
3215
- function ki(e = []) {
3216
- if (!e.length)
3243
+ function Ai(t = []) {
3244
+ if (!t.length)
3217
3245
  return { text: "", segments: [{ text: "", style: null }] };
3218
- const t = e[0];
3219
- if (typeof t != "string" || !t.includes("%c")) {
3220
- const r = e.map(ft).join(" ");
3221
- return { text: r, segments: [{ text: r, style: null }] };
3246
+ const e = t[0];
3247
+ if (typeof e != "string" || !e.includes("%c")) {
3248
+ const n = t.map(ke).join(" ");
3249
+ return { text: n, segments: [{ text: n, style: null }] };
3222
3250
  }
3223
- const a = t.split("%c"), o = [];
3224
- let s = 1;
3225
- for (let r = 0; r < a.length; r++) {
3226
- const l = a[r];
3227
- if (r === 0) {
3251
+ const a = e.split("%c"), o = [];
3252
+ let i = 1;
3253
+ for (let n = 0; n < a.length; n++) {
3254
+ const l = a[n];
3255
+ if (n === 0) {
3228
3256
  l && o.push({ text: l, style: null });
3229
3257
  continue;
3230
3258
  }
3231
- const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
3232
- o.push({ text: l, style: c });
3259
+ const u = i < t.length ? String(t[i++] ?? "") : "", d = Jt(u) || null;
3260
+ o.push({ text: l, style: d });
3233
3261
  }
3234
- if (s < e.length) {
3235
- const r = e.slice(s).map(ft).join(" ");
3236
- r && o.push({
3237
- text: (o.length ? " " : "") + r,
3262
+ if (i < t.length) {
3263
+ const n = t.slice(i).map(ke).join(" ");
3264
+ n && o.push({
3265
+ text: (o.length ? " " : "") + n,
3238
3266
  style: null
3239
3267
  });
3240
3268
  }
3241
3269
  return {
3242
- text: o.map((r) => r.text).join(""),
3270
+ text: o.map((n) => n.text).join(""),
3243
3271
  segments: o.length ? o : [{ text: "", style: null }]
3244
3272
  };
3245
3273
  }
3246
- function bi(e) {
3247
- const t = String(e ?? "");
3248
- if (!t.includes("%c"))
3249
- return [{ text: t, style: null }];
3250
- const a = t.split("%c"), o = a[a.length - 1], s = o.match(vi);
3251
- let i = "";
3252
- if (s) {
3253
- const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
3254
- /^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
3274
+ function Ci(t) {
3275
+ const e = String(t ?? "");
3276
+ if (!e.includes("%c"))
3277
+ return [{ text: e, style: null }];
3278
+ const a = e.split("%c"), o = a[a.length - 1], i = o.match(Si);
3279
+ let s = "";
3280
+ if (i) {
3281
+ const u = i.index, d = /\s/.test(o[u]) ? u + 1 : u;
3282
+ /^[a-z-]+\s*:/i.test(o.slice(d)) && (a[a.length - 1] = o.slice(0, d).replace(/\s+$/, ""), s = o.slice(d).trim());
3255
3283
  }
3256
- const r = Ze(i) || null, l = [];
3284
+ const n = Jt(s) || null, l = [];
3257
3285
  for (let u = 0; u < a.length; u++) {
3258
- const c = a[u];
3286
+ const d = a[u];
3259
3287
  if (u === 0) {
3260
- c && l.push({ text: c, style: null });
3288
+ d && l.push({ text: d, style: null });
3261
3289
  continue;
3262
3290
  }
3263
3291
  l.push({
3264
- text: c,
3265
- style: u === 1 ? r : null
3292
+ text: d,
3293
+ style: u === 1 ? n : null
3266
3294
  });
3267
3295
  }
3268
- return l.length ? l : [{ text: t, style: null }];
3296
+ return l.length ? l : [{ text: e, style: null }];
3269
3297
  }
3270
- function Bt(e = {}) {
3271
- return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
3272
- text: String((t == null ? void 0 : t.text) ?? ""),
3273
- style: Ze(t == null ? void 0 : t.style) || null
3274
- })) : bi(e.text);
3298
+ function He(t = {}) {
3299
+ return Array.isArray(t.segments) && t.segments.length ? t.segments.map((e) => ({
3300
+ text: String((e == null ? void 0 : e.text) ?? ""),
3301
+ style: Jt(e == null ? void 0 : e.style) || null
3302
+ })) : Ci(t.text);
3275
3303
  }
3276
- function wi(e = {}) {
3277
- return Bt(e).map((a) => a.text).join("");
3304
+ function zi(t = {}) {
3305
+ return He(t).map((a) => a.text).join("");
3278
3306
  }
3279
- function yt(e) {
3280
- return String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3307
+ function be(t) {
3308
+ return String(t ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3281
3309
  }
3282
- function Si(e = {}) {
3283
- return Bt(e).map((t) => {
3284
- const a = yt(t.text);
3285
- return t.style ? `<span class="nf-console-styled" style="${yt(t.style)}">${a}</span>` : a;
3310
+ function Ei(t = {}) {
3311
+ return He(t).map((e) => {
3312
+ const a = be(e.text);
3313
+ return e.style ? `<span class="nf-console-styled" style="${be(e.style)}">${a}</span>` : a;
3286
3314
  }).join("");
3287
3315
  }
3288
- const Ai = 80;
3289
- function Ci() {
3290
- const e = [], t = {};
3316
+ const Ri = 80;
3317
+ function ji() {
3318
+ const t = [], e = {};
3291
3319
  let a = !1;
3292
- const o = (i, r) => {
3320
+ const o = (s, n) => {
3293
3321
  let l = "", u = null;
3294
3322
  try {
3295
- const g = ki(r);
3323
+ const g = Ai(n);
3296
3324
  l = g.text, u = g.segments;
3297
3325
  } catch {
3298
- l = String(r[0]), u = [{ text: l, style: null }];
3326
+ l = String(n[0]), u = [{ text: l, style: null }];
3299
3327
  }
3300
- const c = {
3301
- level: i,
3328
+ const d = {
3329
+ level: s,
3302
3330
  text: l.slice(0, 2e3),
3303
3331
  at: Date.now()
3304
3332
  };
3305
- u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
3333
+ u && u.some((g) => g.style) && (d.segments = u.map((g) => ({
3306
3334
  text: String(g.text || "").slice(0, 2e3),
3307
3335
  style: g.style || null
3308
- }))), e.push(c), e.length > Ai && e.shift();
3336
+ }))), t.push(d), t.length > Ri && t.shift();
3309
3337
  };
3310
3338
  return {
3311
3339
  hook: () => {
3312
- a || typeof window > "u" || (a = !0, ["log", "info", "warn", "error"].forEach((i) => {
3313
- t[i] = console[i].bind(console), console[i] = (...r) => {
3314
- o(i, r), t[i](...r);
3340
+ a || typeof window > "u" || (a = !0, ["log", "info", "warn", "error"].forEach((s) => {
3341
+ e[s] = console[s].bind(console), console[s] = (...n) => {
3342
+ o(s, n), e[s](...n);
3315
3343
  };
3316
- }), window.addEventListener("error", (i) => {
3317
- o("error", [i.message || "window.error"]);
3318
- }), window.addEventListener("unhandledrejection", (i) => {
3319
- o("error", [i.reason || "unhandledrejection"]);
3344
+ }), window.addEventListener("error", (s) => {
3345
+ o("error", [s.message || "window.error"]);
3346
+ }), window.addEventListener("unhandledrejection", (s) => {
3347
+ o("error", [s.reason || "unhandledrejection"]);
3320
3348
  }));
3321
3349
  },
3322
3350
  snapshot() {
3323
- return e.slice();
3351
+ return t.slice();
3324
3352
  }
3325
3353
  };
3326
3354
  }
3327
- function zi(e) {
3328
- const t = window.SpeechRecognition || window.webkitSpeechRecognition;
3329
- let a = null, o = !1;
3330
- const s = () => {
3331
- if (o = !1, a)
3355
+ function Pi(t, e = {}) {
3356
+ const a = window.SpeechRecognition || window.webkitSpeechRecognition, o = typeof e.onActiveChange == "function" ? e.onActiveChange : null;
3357
+ let i = null, s = !1;
3358
+ const n = (d) => {
3359
+ const g = !!d;
3360
+ s !== g && (s = g, o == null || o(s));
3361
+ }, l = () => {
3362
+ if (n(!1), i)
3332
3363
  try {
3333
- a.stop();
3364
+ i.stop();
3334
3365
  } catch {
3335
3366
  }
3336
3367
  };
3337
3368
  return {
3338
- start: (r = {}) => {
3339
- if (!t)
3369
+ start: (d = {}) => {
3370
+ if (!a)
3340
3371
  throw new Error(p("status.speechUnsupported"));
3341
- return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
3342
- let u = "";
3343
- for (let c = l.resultIndex; c < l.results.length; c += 1)
3344
- l.results[c].isFinal && (u += l.results[c][0].transcript);
3345
- u && e(u);
3346
- }, a.onerror = () => {
3347
- o = !1;
3348
- }, a.onend = () => {
3349
- o = !1;
3350
- }, a.start(), o = !0, !0);
3372
+ return s ? (l(), !1) : (i = new a(), i.continuous = !0, i.interimResults = !0, i.lang = d.lang || navigator.language || "en-US", i.onresult = (g) => {
3373
+ let k = "";
3374
+ for (let v = g.resultIndex; v < g.results.length; v += 1)
3375
+ g.results[v].isFinal && (k += g.results[v][0].transcript);
3376
+ k && t(k);
3377
+ }, i.onerror = () => {
3378
+ n(!1);
3379
+ }, i.onend = () => {
3380
+ n(!1);
3381
+ }, i.start(), n(!0), !0);
3351
3382
  },
3352
- stop: s,
3353
- isSupported: () => !!t,
3354
- isActive: () => o
3383
+ stop: l,
3384
+ isSupported: () => !!a,
3385
+ isActive: () => s
3355
3386
  };
3356
3387
  }
3357
- const Ei = 60 * 1e3;
3358
- function ji({ onStart: e, onStop: t, onError: a }) {
3359
- let o = null, s = null, i = [], r = null;
3388
+ const xi = 60 * 1e3;
3389
+ function Li({ onStart: t, onStop: e, onError: a }) {
3390
+ let o = null, i = null, s = [], n = null;
3360
3391
  const l = () => {
3361
- if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
3392
+ if (n && (clearTimeout(n), n = null), i && i.state !== "inactive")
3362
3393
  try {
3363
- s.stop();
3394
+ i.stop();
3364
3395
  } catch {
3365
3396
  }
3366
3397
  o && (o.getTracks().forEach((g) => g.stop()), o = null);
3367
3398
  }, u = () => {
3368
- if (s && s.state === "recording") {
3369
- s.stop();
3399
+ if (i && i.state === "recording") {
3400
+ i.stop();
3370
3401
  return;
3371
3402
  }
3372
- l(), t(null);
3403
+ l(), e(null);
3373
3404
  };
3374
3405
  return { start: async () => {
3375
- var g, v;
3406
+ var g, k;
3376
3407
  if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
3377
3408
  throw new Error("Screen recording is not supported in this browser.");
3378
3409
  o = await navigator.mediaDevices.getDisplayMedia({
@@ -3380,172 +3411,172 @@ function ji({ onStart: e, onStop: t, onError: a }) {
3380
3411
  audio: !1,
3381
3412
  preferCurrentTab: !0,
3382
3413
  selfBrowserSurface: "include"
3383
- }), i = [], s = new MediaRecorder(o, {
3414
+ }), s = [], i = new MediaRecorder(o, {
3384
3415
  mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
3385
- }), s.ondataavailable = (k) => {
3386
- k.data && k.data.size && i.push(k.data);
3387
- }, s.onstop = () => {
3388
- const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3389
- l(), t(k);
3390
- }, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ei);
3416
+ }), i.ondataavailable = (v) => {
3417
+ v.data && v.data.size && s.push(v.data);
3418
+ }, i.onstop = () => {
3419
+ const v = s.length ? new Blob(s, { type: i.mimeType || "video/webm" }) : null;
3420
+ l(), e(v);
3421
+ }, (k = o.getVideoTracks()[0]) == null || k.addEventListener("ended", () => u()), i.start(), n = setTimeout(u, xi), t();
3391
3422
  }, stop: u };
3392
3423
  }
3393
- function Ri() {
3394
- const e = /* @__PURE__ */ new Set();
3424
+ function Ui() {
3425
+ const t = /* @__PURE__ */ new Set();
3395
3426
  return {
3396
3427
  alloc() {
3397
- let t = 1;
3398
- for (; e.has(t); )
3399
- t += 1;
3400
- return e.add(t), t;
3428
+ let e = 1;
3429
+ for (; t.has(e); )
3430
+ e += 1;
3431
+ return t.add(e), e;
3401
3432
  },
3402
- free(t) {
3403
- const a = Number(t);
3404
- Number.isInteger(a) && a > 0 && e.delete(a);
3433
+ free(e) {
3434
+ const a = Number(e);
3435
+ Number.isInteger(a) && a > 0 && t.delete(a);
3405
3436
  },
3406
3437
  peekUsed() {
3407
- return [...e].sort((t, a) => t - a);
3438
+ return [...t].sort((e, a) => e - a);
3408
3439
  }
3409
3440
  };
3410
3441
  }
3411
- const De = { x: 0, y: 0, w: 1, h: 1 };
3412
- function Je() {
3413
- const e = Ri();
3414
- let t = [], a = { ...De }, o = 1;
3442
+ const It = { x: 0, y: 0, w: 1, h: 1 };
3443
+ function Yt() {
3444
+ const t = Ui();
3445
+ let e = [], a = { ...It }, o = 1;
3415
3446
  return {
3416
- list: () => t.filter((i) => Li(i, a)),
3417
- all: () => t.slice(),
3447
+ list: () => e.filter((s) => Mi(s, a)),
3448
+ all: () => e.slice(),
3418
3449
  crop: () => ({ ...a }),
3419
- setCrop(i) {
3420
- return a = xi(i), a;
3450
+ setCrop(s) {
3451
+ return a = Fi(s), a;
3421
3452
  },
3422
3453
  resetCrop() {
3423
- return a = { ...De }, a;
3454
+ return a = { ...It }, a;
3424
3455
  },
3425
3456
  isCropped() {
3426
3457
  return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
3427
3458
  },
3428
- add(i, r) {
3459
+ add(s, n) {
3429
3460
  const l = {
3430
3461
  id: `s${o++}`,
3431
- type: i,
3432
- number: e.alloc(),
3462
+ type: s,
3463
+ number: t.alloc(),
3433
3464
  x: 0.2,
3434
3465
  y: 0.2,
3435
- w: i === "arrow" ? 0.2 : 0.22,
3436
- h: i === "arrow" ? 0.05 : 0.16,
3466
+ w: s === "arrow" ? 0.2 : 0.22,
3467
+ h: s === "arrow" ? 0.05 : 0.16,
3437
3468
  x2: 0.4,
3438
3469
  y2: 0.28,
3439
- ...r
3470
+ ...n
3440
3471
  };
3441
- return t.push(l), l;
3472
+ return e.push(l), l;
3442
3473
  },
3443
- update(i, r) {
3444
- const l = t.find((u) => u.id === i);
3445
- return l ? (Object.assign(l, r), l) : null;
3474
+ update(s, n) {
3475
+ const l = e.find((u) => u.id === s);
3476
+ return l ? (Object.assign(l, n), l) : null;
3446
3477
  },
3447
- remove(i) {
3448
- const r = t.findIndex((u) => u.id === i);
3449
- if (r < 0)
3478
+ remove(s) {
3479
+ const n = e.findIndex((u) => u.id === s);
3480
+ if (n < 0)
3450
3481
  return null;
3451
- const [l] = t.splice(r, 1);
3452
- return e.free(l.number), l;
3482
+ const [l] = e.splice(n, 1);
3483
+ return t.free(l.number), l;
3453
3484
  },
3454
3485
  reset() {
3455
- for (t = [], a = { ...De }, o = 1; e.peekUsed().length; )
3456
- e.free(e.peekUsed()[0]);
3486
+ for (e = [], a = { ...It }, o = 1; t.peekUsed().length; )
3487
+ t.free(t.peekUsed()[0]);
3457
3488
  }
3458
3489
  };
3459
3490
  }
3460
- function Pi(e, t) {
3461
- 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;
3462
- return (Array.isArray(e) ? e : []).map((r) => {
3491
+ function Ti(t, e) {
3492
+ const a = Number(e == null ? void 0 : e.w) || 1, o = Number(e == null ? void 0 : e.h) || 1, i = Number(e == null ? void 0 : e.x) || 0, s = Number(e == null ? void 0 : e.y) || 0;
3493
+ return (Array.isArray(t) ? t : []).map((n) => {
3463
3494
  const l = {
3464
- ...r,
3465
- x: (r.x - s) / a,
3466
- y: (r.y - i) / o,
3467
- w: (r.w || 0) / a,
3468
- h: (r.h || 0) / o
3495
+ ...n,
3496
+ x: (n.x - i) / a,
3497
+ y: (n.y - s) / o,
3498
+ w: (n.w || 0) / a,
3499
+ h: (n.h || 0) / o
3469
3500
  };
3470
- return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
3501
+ return Number.isFinite(n.x2) && (l.x2 = (n.x2 - i) / a), Number.isFinite(n.y2) && (l.y2 = (n.y2 - s) / o), l;
3471
3502
  });
3472
3503
  }
3473
- function xi(e) {
3474
- const t = Math.min(Math.max(e.x, 0), 0.95), a = Math.min(Math.max(e.y, 0), 0.95), o = Math.min(Math.max(e.w, 0.05), 1 - t), s = Math.min(Math.max(e.h, 0.05), 1 - a);
3475
- return { x: t, y: a, w: o, h: s };
3504
+ function Fi(t) {
3505
+ const e = Math.min(Math.max(t.x, 0), 0.95), a = Math.min(Math.max(t.y, 0), 0.95), o = Math.min(Math.max(t.w, 0.05), 1 - e), i = Math.min(Math.max(t.h, 0.05), 1 - a);
3506
+ return { x: e, y: a, w: o, h: i };
3476
3507
  }
3477
- function Li(e, t) {
3478
- 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;
3479
- return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
3508
+ function Mi(t, e) {
3509
+ const a = t.type === "arrow" ? (t.x + (t.x2 ?? t.x)) / 2 : t.x + (t.w || 0) / 2, o = t.type === "arrow" ? (t.y + (t.y2 ?? t.y)) / 2 : t.y + (t.h || 0) / 2;
3510
+ return a >= e.x && o >= e.y && a <= e.x + e.w && o <= e.y + e.h;
3480
3511
  }
3481
- function Nt(e) {
3482
- const t = Math.max(1, Number(e) || 1);
3512
+ function Ge(t) {
3513
+ const e = Math.max(1, Number(t) || 1);
3483
3514
  return {
3484
- stroke: Math.max(2, t * 75e-4),
3485
- badgeRadius: Math.max(8, t * 0.025),
3486
- fontSize: Math.max(10, t * 0.0275),
3487
- arrowHead: Math.max(8, t * 0.035),
3515
+ stroke: Math.max(2, e * 75e-4),
3516
+ badgeRadius: Math.max(8, e * 0.025),
3517
+ fontSize: Math.max(10, e * 0.0275),
3518
+ arrowHead: Math.max(8, e * 0.035),
3488
3519
  arrowHeadAngle: 0.4
3489
3520
  };
3490
3521
  }
3491
- function Ui(e, t, a, o, s) {
3492
- 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 = {
3493
- x: u - r * Math.cos(i - s.arrowHeadAngle),
3494
- y: c - r * Math.sin(i - s.arrowHeadAngle)
3522
+ function Di(t, e, a, o, i) {
3523
+ const s = Math.atan2(o - e, a - t), n = i.arrowHead, l = Math.min(i.stroke, n * 0.2), u = a, d = o, g = a - Math.cos(s) * n, k = o - Math.sin(s) * n, v = {
3524
+ x: u - n * Math.cos(s - i.arrowHeadAngle),
3525
+ y: d - n * Math.sin(s - i.arrowHeadAngle)
3495
3526
  }, w = {
3496
- x: u - r * Math.cos(i + s.arrowHeadAngle),
3497
- y: c - r * Math.sin(i + s.arrowHeadAngle)
3527
+ x: u - n * Math.cos(s + i.arrowHeadAngle),
3528
+ y: d - n * Math.sin(s + i.arrowHeadAngle)
3498
3529
  }, b = {
3499
- x: a - Math.cos(i) * l,
3500
- y: o - Math.sin(i) * l
3530
+ x: a - Math.cos(s) * l,
3531
+ y: o - Math.sin(s) * l
3501
3532
  };
3502
- return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
3533
+ return { angle: s, tipX: u, tipY: d, baseX: g, baseY: k, left: v, right: w, shaftEnd: b };
3503
3534
  }
3504
- async function vt(e, t = {}) {
3505
- 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 Di(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 = Ti(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
3506
- w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
3507
- const z = await kt(w, "image/webp", s);
3535
+ async function we(t, e = {}) {
3536
+ const a = e.crop || { x: 0, y: 0, w: 1, h: 1 }, o = Math.max(1, Number(e.maxEdge) || 2048), i = e.webpQuality ?? 0.82, s = await $i(t), n = Math.round(a.x * s.width), l = Math.round(a.y * s.height), u = Math.max(1, Math.round(a.w * s.width)), d = Math.max(1, Math.round(a.h * s.height)), g = Oi(u, d, o), k = g.width, v = g.height, w = document.createElement("canvas");
3537
+ w.width = k, w.height = v, w.getContext("2d").drawImage(s, n, l, u, d, 0, 0, k, v);
3538
+ const z = await Se(w, "image/webp", i);
3508
3539
  if (z && z.size > 0 && z.type === "image/webp")
3509
- return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
3510
- const R = await kt(w, "image/png");
3511
- if (!R || !R.size)
3540
+ return { blob: z, width: k, height: v, mime: "image/webp", ext: "webp" };
3541
+ const j = await Se(w, "image/png");
3542
+ if (!j || !j.size)
3512
3543
  throw new Error("Could not encode screenshot");
3513
- return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
3544
+ return { blob: j, width: k, height: v, mime: "image/png", ext: "png" };
3514
3545
  }
3515
- function Ti(e, t, a = 2048) {
3516
- 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));
3546
+ function Oi(t, e, a = 2048) {
3547
+ const o = Math.max(1, Number(t) || 1), i = Math.max(1, Number(e) || 1), s = Math.max(1, Number(a) || 2048), n = Math.min(1, s / Math.max(o, i));
3517
3548
  return {
3518
- width: Math.max(1, Math.round(o * r)),
3519
- height: Math.max(1, Math.round(s * r)),
3520
- scale: r
3549
+ width: Math.max(1, Math.round(o * n)),
3550
+ height: Math.max(1, Math.round(i * n)),
3551
+ scale: n
3521
3552
  };
3522
3553
  }
3523
- function Fi(e = 2048) {
3524
- const t = Math.floor(Number(e) / 2);
3525
- return Math.max(1, Math.min(1024, t || 1024));
3554
+ function Ii(t = 2048) {
3555
+ const e = Math.floor(Number(t) / 2);
3556
+ return Math.max(1, Math.min(1024, e || 1024));
3526
3557
  }
3527
- function Oi(e, t = null) {
3528
- 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)
3558
+ function Vi(t, e = null) {
3559
+ if ((e == null ? void 0 : e.code) === "payload_too_large" || Number(e == null ? void 0 : e.status) === 413 || Number(t == null ? void 0 : t.status) === 413)
3529
3560
  return !0;
3530
- const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
3531
- 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;
3561
+ const a = String((t == null ? void 0 : t.message) || t || (e == null ? void 0 : e.error) || "").toLowerCase();
3562
+ 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(t == null ? void 0 : t.status) === 413;
3532
3563
  }
3533
- function Di(e) {
3534
- return new Promise((t, a) => {
3564
+ function $i(t) {
3565
+ return new Promise((e, a) => {
3535
3566
  const o = new Image();
3536
- o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
3567
+ o.onload = () => e(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = t;
3537
3568
  });
3538
3569
  }
3539
- function kt(e, t, a) {
3570
+ function Se(t, e, a) {
3540
3571
  return new Promise((o) => {
3541
3572
  try {
3542
- e.toBlob((s) => o(s), t, a);
3573
+ t.toBlob((i) => o(i), e, a);
3543
3574
  } catch {
3544
3575
  o(null);
3545
3576
  }
3546
3577
  });
3547
3578
  }
3548
- const Mi = [
3579
+ const Bi = [
3549
3580
  "url",
3550
3581
  "title",
3551
3582
  "userAgent",
@@ -3556,137 +3587,143 @@ const Mi = [
3556
3587
  "viewport",
3557
3588
  "user"
3558
3589
  ];
3559
- function Ii(e) {
3560
- return !e || typeof e != "object" ? !1 : !!(e.userId || e.email || e.displayName);
3590
+ function Ni(t) {
3591
+ return !t || typeof t != "object" ? !1 : !!(t.userId || t.email || t.displayName);
3561
3592
  }
3562
- function Vi(e = {}) {
3563
- const t = [];
3564
- for (const a of Mi) {
3565
- const o = e[a];
3566
- o == null || o === "" || a === "user" && !Ii(o) || t.push({
3593
+ function Ki(t = {}) {
3594
+ const e = [];
3595
+ for (const a of Bi) {
3596
+ const o = t[a];
3597
+ o == null || o === "" || a === "user" && !Ni(o) || e.push({
3567
3598
  key: a,
3568
3599
  label: p(`diag.${a}`),
3569
3600
  value: o,
3570
3601
  redacted: !1
3571
3602
  });
3572
3603
  }
3573
- return t;
3604
+ return e;
3574
3605
  }
3575
- function $i(e = []) {
3576
- return e.map((t, a) => {
3606
+ function Hi(t = []) {
3607
+ return t.map((e, a) => {
3577
3608
  const o = {
3578
- id: `log-${a}-${t.at || 0}`,
3579
- level: t.level || "log",
3580
- text: String(t.text || ""),
3581
- at: t.at || 0,
3609
+ id: `log-${a}-${e.at || 0}`,
3610
+ level: e.level || "log",
3611
+ text: String(e.text || ""),
3612
+ at: e.at || 0,
3582
3613
  redacted: !1
3583
3614
  };
3584
- return Array.isArray(t.segments) && t.segments.length && (o.segments = t.segments), o;
3615
+ return Array.isArray(e.segments) && e.segments.length && (o.segments = e.segments), o;
3585
3616
  });
3586
3617
  }
3587
- function Bi(e = []) {
3588
- if (!e.length)
3589
- return { checked: !1, indeterminate: !1 };
3590
- const t = e.filter((a) => a.redacted).length;
3591
- return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3618
+ function Gi(t = []) {
3619
+ if (!t.length)
3620
+ return { checked: !0, indeterminate: !1 };
3621
+ const e = t.filter((a) => !a.redacted).length;
3622
+ return e === t.length ? { checked: !0, indeterminate: !1 } : e === 0 ? { checked: !1, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3592
3623
  }
3593
- function we(e, t) {
3594
- e.forEach((a) => {
3595
- a.redacted = !!t;
3624
+ function Rt(t, e) {
3625
+ t.forEach((a) => {
3626
+ a.redacted = !!e;
3596
3627
  });
3597
3628
  }
3598
- function Ni(e = {}) {
3599
- const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
3600
- return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
3629
+ function qi(t = {}) {
3630
+ const e = t.diagnostics || [], a = t.logs || [], o = e.some((s) => !s.redacted), i = a.length > 0 && a.some((s) => !s.redacted);
3631
+ return o && i ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : i ? p("privacy.disclosure.logs") : "";
3601
3632
  }
3602
- function Ki(e) {
3603
- if (e == null)
3633
+ function _i(t) {
3634
+ if (t == null)
3604
3635
  return "";
3605
- if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
3606
- return String(e);
3636
+ if (typeof t == "string" || typeof t == "number" || typeof t == "boolean")
3637
+ return String(t);
3607
3638
  try {
3608
- return JSON.stringify(e);
3639
+ return JSON.stringify(t);
3609
3640
  } catch {
3610
- return String(e);
3641
+ return String(t);
3611
3642
  }
3612
3643
  }
3613
- function Hi(e = {}) {
3614
- const t = {};
3615
- e.author != null && e.author !== "" && (t.author = e.author);
3616
- for (const o of e.diagnostics || [])
3617
- o.redacted || (t[o.key] = o.value);
3618
- const a = (e.logs || []).filter((o) => !o.redacted).map((o) => {
3619
- const s = {
3644
+ function Wi(t = {}) {
3645
+ const e = {};
3646
+ t.author != null && t.author !== "" && (e.author = t.author);
3647
+ for (const o of t.diagnostics || [])
3648
+ o.redacted || (e[o.key] = o.value);
3649
+ const a = (t.logs || []).filter((o) => !o.redacted).map((o) => {
3650
+ const i = {
3620
3651
  level: o.level,
3621
3652
  text: o.text,
3622
3653
  at: o.at
3623
3654
  };
3624
- return Array.isArray(o.segments) && o.segments.length && (s.segments = o.segments), s;
3655
+ return Array.isArray(o.segments) && o.segments.length && (i.segments = o.segments), i;
3625
3656
  });
3626
- return t.console = a, t;
3657
+ return e.console = a, e;
3627
3658
  }
3628
- const Y = [
3659
+ const J = [
3629
3660
  { id: "bug", label: "Bug" },
3630
3661
  { id: "idea", label: "Idea" },
3631
3662
  { id: "other", label: "Other" }
3632
3663
  ];
3633
- function bt(e) {
3634
- return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3635
- }
3636
- function Me(e) {
3637
- const t = String(e || "").trim();
3638
- return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3639
- }
3640
- function Gi(e) {
3641
- if (!Array.isArray(e) || !e.length)
3642
- return Y.map((o) => ({ ...o }));
3643
- const t = /* @__PURE__ */ new Set(), a = [];
3644
- for (const o of e) {
3645
- let s = "", i = "";
3646
- typeof o == "string" || typeof o == "number" ? (s = bt(o), i = Me(s)) : o && typeof o == "object" && (s = bt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || Me(s)).trim() || Me(s)), !(!s || t.has(s)) && (t.add(s), a.push({ id: s, label: i }));
3664
+ function Ae(t) {
3665
+ return String(t || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3666
+ }
3667
+ function bt(t) {
3668
+ const e = String(t || "").trim();
3669
+ return e ? e.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3670
+ }
3671
+ function Zi(t) {
3672
+ if (!Array.isArray(t) || !t.length)
3673
+ return J.map((o) => ({ ...o }));
3674
+ const e = /* @__PURE__ */ new Set(), a = [];
3675
+ for (const o of t) {
3676
+ let i = "", s = "", n = "", l = "";
3677
+ if (typeof o == "string" || typeof o == "number" ? (i = Ae(o), s = bt(i)) : o && typeof o == "object" && (i = Ae(o.id ?? o.value ?? o.kind), s = String(o.label || o.name || bt(i)).trim() || bt(i), n = String(o.title || "").trim(), l = String(o.description || o.intro || "").trim()), !i || e.has(i))
3678
+ continue;
3679
+ e.add(i);
3680
+ const u = { id: i, label: s };
3681
+ n && (u.title = n), l && (u.description = l), a.push(u);
3647
3682
  }
3648
- return a.length ? a : Y.map((o) => ({ ...o }));
3683
+ return a.length ? a : J.map((o) => ({ ...o }));
3649
3684
  }
3650
- function Re(e) {
3685
+ function Tt(t) {
3651
3686
  var a;
3652
- const t = Array.isArray(e) && e.length ? e : Y;
3653
- return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
3687
+ const e = Array.isArray(t) && t.length ? t : J;
3688
+ return e.some((o) => o.id === "bug") ? "bug" : ((a = e[0]) == null ? void 0 : a.id) || "other";
3654
3689
  }
3655
- const qi = ["maker", "all-business", "brighter-day", "quiet-night"], Kt = "maker", _i = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, wt = 0.05, Wi = `
3690
+ const Ji = ["maker", "all-business", "brighter-day", "quiet-night"], qe = "maker", Yi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ht = 0.02, Ce = 0.05, Xi = `
3656
3691
  <svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
3657
3692
  <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"/>
3658
3693
  <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"/>
3659
3694
  </svg>
3660
3695
  `;
3661
- function D(e) {
3662
- 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>`;
3663
- }
3664
- const F = {
3665
- crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3666
- resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3667
- arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3668
- rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3669
- circle: D('<circle cx="12" cy="12" r="8"/>'),
3670
- discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3671
- recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3672
- privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3673
- 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"/>'),
3674
- video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3675
- openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
3676
- }, Ht = Ci();
3677
- Ht.hook();
3678
- const Gt = 10, Zi = 80, qt = "notefully.author", _t = "notefully.kind", Wt = "notefully.redactSections";
3679
- let d = {
3696
+ function F(t) {
3697
+ 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">${t}</svg>`;
3698
+ }
3699
+ const x = {
3700
+ crop: F('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3701
+ resetCrop: F('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3702
+ arrow: F('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3703
+ rect: F('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3704
+ circle: F('<circle cx="12" cy="12" r="8"/>'),
3705
+ discard: F('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3706
+ recapture: F('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3707
+ privacy: F('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3708
+ audio: F('<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"/>'),
3709
+ video: F('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3710
+ stop: '<svg class="nf-icon" viewBox="0 0 24 24" fill="currentColor" stroke="none" aria-hidden="true"><rect x="7" y="7" width="10" height="10" rx="1.5"/></svg>',
3711
+ openArrow: F('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>'),
3712
+ close: F('<path d="M6 6l12 12M18 6 6 18"/>')
3713
+ }, _e = ji();
3714
+ _e.hook();
3715
+ const We = 10, Qi = 80, Ze = "notefully.author", Je = "notefully.kind", Ye = "notefully.redactSections";
3716
+ let c = {
3680
3717
  endpoint: "",
3681
3718
  projectKey: "",
3682
3719
  version: "0.0.0",
3683
3720
  name: "",
3684
3721
  targets: null,
3685
3722
  hideLauncher: !1,
3686
- theme: Kt,
3723
+ theme: qe,
3687
3724
  video: !1,
3688
- consoleLogLimit: Gt,
3689
- kinds: Y.map((e) => ({ ...e })),
3725
+ consoleLogLimit: We,
3726
+ kinds: J.map((t) => ({ ...t })),
3690
3727
  kindsCustom: !1,
3691
3728
  capture: null,
3692
3729
  onBeforeCapture: null,
@@ -3695,883 +3732,954 @@ let d = {
3695
3732
  displayLink: !1,
3696
3733
  locale: null,
3697
3734
  translations: null
3698
- }, ce = !1, Ie = !1, N = {}, f = null, n = {}, A = Je(), H = "", ie = "", K = null, J = Re(Y), q = null, M = null, j = null, E = null, me = null, Q = null, le = null, G = { w: 0, h: 0 }, Ve = !1, Pe = !1, xe = !1, V = [], I = [], _ = !1;
3699
- function y(e) {
3700
- return f.querySelector(e);
3735
+ }, pt = !1, Vt = !1, K = {}, y = null, r = {}, A = Yt(), q = "", nt = "", H = null, G = Tt(J), Y = null, O = null, R = null, E = null, kt = null, W = null, V = null, et = !1, _ = { w: 0, h: 0 }, $t = !1, gt = !1, mt = !1, B = [], $ = [], Z = !1;
3736
+ function h(t) {
3737
+ return y.querySelector(t);
3701
3738
  }
3702
- function Zt(e) {
3703
- const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
3704
- return qi.includes(t) ? t : Kt;
3739
+ function Xe(t) {
3740
+ const e = String(t || "").trim().toLowerCase().replace(/\s+/g, "-");
3741
+ return Ji.includes(e) ? e : qe;
3705
3742
  }
3706
- function S(e, t = !1) {
3707
- n.status && (n.status.textContent = e || "", me && (clearTimeout(me), me = null), e && !t && (me = setTimeout(() => {
3708
- n.status.textContent = "";
3743
+ function S(t, e = !1) {
3744
+ r.status && (r.status.textContent = t || "", kt && (clearTimeout(kt), kt = null), t && !e && (kt = setTimeout(() => {
3745
+ r.status.textContent = "";
3709
3746
  }, 4e3)));
3710
3747
  }
3711
- function Ye() {
3712
- return f && document.body.contains(f) || (f = document.createElement("div"), f.id = "notefully", f.innerHTML = `
3713
- <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Wi}</button>
3748
+ function Xt() {
3749
+ return y && document.body.contains(y) || (y = document.createElement("div"), y.id = "notefully", y.innerHTML = `
3750
+ <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Xi}</button>
3714
3751
  <div class="nf-dialog" hidden>
3715
3752
  <div class="nf-panel">
3753
+ <div class="nf-pill nf-close-pill">
3754
+ <button class="nf-close nf-icon-btn" type="button" data-i18n-title="form.close" data-i18n-aria="form.close">${x.close}</button>
3755
+ </div>
3716
3756
  <div class="nf-panel-body">
3757
+ <div class="nf-heading">
3758
+ <h2 class="nf-title"></h2>
3759
+ <p class="nf-intro"></p>
3760
+ </div>
3717
3761
  <div class="nf-stage" hidden>
3718
- <div class="nf-palette">
3719
- <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${F.crop}</button>
3720
- <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${F.resetCrop}</button>
3721
- <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${F.arrow}</button>
3722
- <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${F.rect}</button>
3723
- <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${F.circle}</button>
3724
- <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${F.discard}</button>
3725
- <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${F.recapture}</button>
3762
+ <div class="nf-shot-block">
3763
+ <div class="nf-canvas"></div>
3764
+ <div class="nf-palette">
3765
+ <div class="nf-palette-tools">
3766
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${x.crop}</button>
3767
+ <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${x.resetCrop}</button>
3768
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${x.arrow}</button>
3769
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${x.rect}</button>
3770
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${x.circle}</button>
3771
+ </div>
3772
+ <div class="nf-palette-shot">
3773
+ <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${x.recapture}</button>
3774
+ <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${x.discard}</button>
3775
+ </div>
3776
+ </div>
3726
3777
  </div>
3727
- <div class="nf-canvas"></div>
3728
3778
  </div>
3729
- <textarea class="nf-text" data-i18n-placeholder="form.messagePlaceholder"></textarea>
3779
+ <textarea class="nf-text"></textarea>
3730
3780
  <input class="nf-author" type="text" name="author" autocomplete="nickname" data-i18n-placeholder="form.authorPlaceholder" data-i18n-aria="form.author">
3731
- <div class="nf-kind-row">
3732
- <div class="nf-kind"></div>
3733
- <div class="nf-privacy-summary">
3734
- <span class="nf-privacy-text"></span>
3735
- <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${F.privacy}</button>
3781
+ <div class="nf-privacy-stack">
3782
+ <div class="nf-kind-row">
3783
+ <div class="nf-kind"></div>
3784
+ <div class="nf-privacy-summary">
3785
+ <span class="nf-privacy-text"></span>
3786
+ <div class="nf-pill nf-privacy-toggle-pill">
3787
+ <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${x.privacy}</button>
3788
+ </div>
3789
+ </div>
3736
3790
  </div>
3737
- </div>
3738
- <div class="nf-privacy">
3739
- <div class="nf-privacy-panel" hidden>
3740
- <div class="nf-privacy-scroll"></div>
3741
- <button class="nf-privacy-done" type="button" data-i18n-text="form.done"></button>
3791
+ <div class="nf-privacy">
3792
+ <div class="nf-privacy-panel" hidden>
3793
+ <div class="nf-privacy-scroll"></div>
3794
+ </div>
3742
3795
  </div>
3743
3796
  </div>
3744
3797
  <div class="nf-actions">
3745
- <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${F.resetCrop}</button>
3746
- <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${F.audio}</button>
3747
- <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${F.video}</button>
3748
- <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3798
+ <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${x.resetCrop}</button>
3799
+ <div class="nf-actions-media">
3800
+ <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${x.audio}</button>
3801
+ <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${x.video}</button>
3802
+ </div>
3803
+ <div class="nf-pill nf-submit-pill">
3804
+ <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3805
+ </div>
3749
3806
  </div>
3750
3807
  <div class="nf-status"></div>
3751
3808
  </div>
3752
3809
  <p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
3753
3810
  <a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
3754
3811
  <span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
3755
- ${F.openArrow}
3812
+ ${x.openArrow}
3756
3813
  </a>
3757
3814
  </div>
3758
3815
  </div>
3759
- <button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
3760
- `, document.body.appendChild(f), n = {
3761
- launcher: y(".nf-launcher"),
3762
- dialog: y(".nf-dialog"),
3763
- panel: y(".nf-panel"),
3764
- panelBody: y(".nf-panel-body"),
3765
- successMsg: y(".nf-success-msg"),
3766
- successLink: y(".nf-success-link"),
3767
- stage: y(".nf-stage"),
3768
- palette: y(".nf-palette"),
3769
- canvas: y(".nf-canvas"),
3770
- text: y(".nf-text"),
3771
- author: y(".nf-author"),
3772
- kindRow: y(".nf-kind-row"),
3773
- kind: y(".nf-kind"),
3774
- privacy: y(".nf-privacy"),
3775
- privacySummary: y(".nf-privacy-summary"),
3776
- privacyText: y(".nf-privacy-text"),
3777
- privacyChange: y(".nf-privacy-change"),
3778
- privacyPanel: y(".nf-privacy-panel"),
3779
- privacyScroll: y(".nf-privacy-scroll"),
3780
- privacyDone: y(".nf-privacy-done"),
3781
- actions: y(".nf-actions"),
3782
- restore: y(".nf-restore"),
3783
- status: y(".nf-status"),
3784
- audio: y(".nf-audio"),
3785
- video: y(".nf-video"),
3786
- discard: y(".nf-discard-shot"),
3787
- recapture: y(".nf-recapture"),
3788
- stop: y(".nf-stop-video"),
3789
- resetCrop: y(".nf-reset-crop"),
3790
- submit: y(".nf-submit"),
3816
+ <button class="nf-stop-video nf-icon-btn" type="button" hidden data-i18n-title="tool.stopVideo" data-i18n-aria="tool.stopVideo">${x.stop}</button>
3817
+ `, document.body.appendChild(y), r = {
3818
+ launcher: h(".nf-launcher"),
3819
+ dialog: h(".nf-dialog"),
3820
+ panel: h(".nf-panel"),
3821
+ close: h(".nf-close"),
3822
+ panelBody: h(".nf-panel-body"),
3823
+ heading: h(".nf-heading"),
3824
+ title: h(".nf-title"),
3825
+ intro: h(".nf-intro"),
3826
+ successMsg: h(".nf-success-msg"),
3827
+ successLink: h(".nf-success-link"),
3828
+ stage: h(".nf-stage"),
3829
+ shotBlock: h(".nf-shot-block"),
3830
+ palette: h(".nf-palette"),
3831
+ paletteTools: h(".nf-palette-tools"),
3832
+ paletteShot: h(".nf-palette-shot"),
3833
+ canvas: h(".nf-canvas"),
3834
+ text: h(".nf-text"),
3835
+ author: h(".nf-author"),
3836
+ privacyStack: h(".nf-privacy-stack"),
3837
+ kindRow: h(".nf-kind-row"),
3838
+ kind: h(".nf-kind"),
3839
+ privacy: h(".nf-privacy"),
3840
+ privacySummary: h(".nf-privacy-summary"),
3841
+ privacyText: h(".nf-privacy-text"),
3842
+ privacyChange: h(".nf-privacy-change"),
3843
+ privacyPanel: h(".nf-privacy-panel"),
3844
+ privacyScroll: h(".nf-privacy-scroll"),
3845
+ actions: h(".nf-actions"),
3846
+ actionsMedia: h(".nf-actions-media"),
3847
+ restore: h(".nf-restore"),
3848
+ status: h(".nf-status"),
3849
+ audio: h(".nf-audio"),
3850
+ video: h(".nf-video"),
3851
+ discard: h(".nf-discard-shot"),
3852
+ recapture: h(".nf-recapture"),
3853
+ stop: h(".nf-stop-video"),
3854
+ resetCrop: h(".nf-reset-crop"),
3855
+ submit: h(".nf-submit"),
3791
3856
  shot: null
3792
- }, Xi(), se()), f;
3857
+ }, es(), lt()), y;
3793
3858
  }
3794
- function se() {
3795
- var e;
3796
- f && (Jt(), f.dataset.theme = Zt(d.theme), f.lang = ye(), f.dir = Aa(ye()), d.hideLauncher ? f.setAttribute("data-nf-hidden-launcher", "") : f.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Ji(), V.length && V.forEach((t) => {
3797
- t.label = p(`diag.${t.key}`);
3798
- }), Yt(), _ ? at() : tt(), (e = n.dialog) != null && e.hidden && Se());
3859
+ function lt() {
3860
+ var t;
3861
+ y && (Qe(), y.dataset.theme = Xe(c.theme), y.lang = At(), y.dir = Ra(At()), c.hideLauncher ? y.setAttribute("data-nf-hidden-launcher", "") : y.removeAttribute("data-nf-hidden-launcher"), r.video && (r.video.hidden = !c.video), ts(), B.length && B.forEach((e) => {
3862
+ e.label = p(`diag.${e.key}`);
3863
+ }), ea(), Z ? se() : ie(), (t = r.dialog) != null && t.hidden && jt());
3799
3864
  }
3800
- function Jt() {
3801
- const e = ba({
3802
- locale: d.locale == null ? void 0 : d.locale
3865
+ function Qe() {
3866
+ const t = Ca({
3867
+ locale: c.locale == null ? void 0 : c.locale
3803
3868
  });
3804
- Sa(d.translations), wa(e);
3805
- }
3806
- function Ji() {
3807
- if (f && (f.querySelectorAll("[data-i18n-title]").forEach((e) => {
3808
- e.title = p(e.getAttribute("data-i18n-title"));
3809
- }), f.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3810
- e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
3811
- }), f.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3812
- e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
3813
- }), f.querySelectorAll("[data-i18n-text]").forEach((e) => {
3814
- e.textContent = p(e.getAttribute("data-i18n-text"));
3815
- }), n.audio)) {
3816
- const e = n.audio.dataset.active === "true";
3817
- Ue(e);
3869
+ Ea(c.translations), za(t);
3870
+ }
3871
+ function ts() {
3872
+ if (y) {
3873
+ if (y.querySelectorAll("[data-i18n-title]").forEach((t) => {
3874
+ t.title = p(t.getAttribute("data-i18n-title"));
3875
+ }), y.querySelectorAll("[data-i18n-aria]").forEach((t) => {
3876
+ t.setAttribute("aria-label", p(t.getAttribute("data-i18n-aria")));
3877
+ }), y.querySelectorAll("[data-i18n-placeholder]").forEach((t) => {
3878
+ t.setAttribute("placeholder", p(t.getAttribute("data-i18n-placeholder")));
3879
+ }), y.querySelectorAll("[data-i18n-text]").forEach((t) => {
3880
+ t.textContent = p(t.getAttribute("data-i18n-text"));
3881
+ }), r.audio) {
3882
+ const t = r.audio.dataset.active === "true";
3883
+ ft(t);
3884
+ }
3885
+ te();
3818
3886
  }
3819
3887
  }
3820
- function Yi(e) {
3821
- if (d.kindsCustom)
3822
- return e.label;
3823
- const t = `kind.${e.id}`, a = p(t);
3824
- return a === t ? e.label : a;
3825
- }
3826
- function Se() {
3827
- n.launcher && (n.launcher.hidden = !!d.hideLauncher);
3828
- }
3829
- function Xi() {
3830
- n.launcher.addEventListener("click", () => ga()), y(".nf-dialog").addEventListener("click", (t) => {
3831
- Pe && !xe || t.target === n.dialog && re();
3832
- }), document.addEventListener("keydown", ua), f.querySelectorAll(".nf-tool").forEach((t) => {
3833
- t.addEventListener("click", () => de(t.dataset.tool));
3834
- }), n.resetCrop.addEventListener("click", ls), n.canvas.addEventListener("pointerdown", os), n.canvas.addEventListener("dragstart", (t) => t.preventDefault());
3835
- const e = y(".nf-kind");
3836
- e && e.addEventListener("click", (t) => {
3837
- const a = t.target.closest("[data-kind]");
3838
- a && Xe(a.dataset.kind);
3839
- }), n.discard.addEventListener("click", us), n.recapture.addEventListener("click", () => {
3840
- ds().catch((t) => S(t.message || p("status.recaptureFailed")));
3841
- }), n.restore.addEventListener("click", cs), n.audio.addEventListener("click", ps), n.video.addEventListener("click", gs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Ee(!_)), n.privacyDone.addEventListener("click", () => Ee(!1)), n.privacyScroll.addEventListener("change", Es), y(".nf-submit").addEventListener("click", () => {
3842
- ha().catch((t) => S(t.message || p("status.submitFailed")));
3843
- }), Yt(), de(null);
3844
- }
3845
- function x(e) {
3846
- return String(e || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3888
+ function ta(t) {
3889
+ if (c.kindsCustom)
3890
+ return t.label;
3891
+ const e = `kind.${t.id}`, a = p(e);
3892
+ return a === e ? t.label : a;
3847
3893
  }
3848
- function Yt() {
3849
- const e = f == null ? void 0 : f.querySelector(".nf-kind");
3850
- if (!e)
3894
+ function jt() {
3895
+ r.launcher && (r.launcher.hidden = !!c.hideLauncher);
3896
+ }
3897
+ function es() {
3898
+ var e;
3899
+ r.launcher.addEventListener("click", () => ya()), h(".nf-dialog").addEventListener("click", (a) => {
3900
+ gt && !mt || a.target === r.dialog && at();
3901
+ }), (e = r.close) == null || e.addEventListener("click", () => {
3902
+ gt && !mt || at();
3903
+ }), document.addEventListener("keydown", ga), y.querySelectorAll(".nf-tool").forEach((a) => {
3904
+ a.addEventListener("click", () => ht(a.dataset.tool));
3905
+ }), r.resetCrop.addEventListener("click", gs), r.canvas.addEventListener("pointerdown", ls), r.canvas.addEventListener("dragstart", (a) => a.preventDefault());
3906
+ const t = h(".nf-kind");
3907
+ t && t.addEventListener("click", (a) => {
3908
+ const o = a.target.closest("[data-kind]");
3909
+ o && Qt(o.dataset.kind);
3910
+ }), r.discard.addEventListener("click", ms), r.recapture.addEventListener("click", () => {
3911
+ fs().catch((a) => S(a.message || p("status.recaptureFailed")));
3912
+ }), r.restore.addEventListener("click", hs), r.audio.addEventListener("click", ys), r.video.addEventListener("click", () => {
3913
+ vs().catch((a) => S((a == null ? void 0 : a.message) || p("status.screenUnsupported")));
3914
+ }), r.stop.addEventListener("click", () => V == null ? void 0 : V.stop()), r.privacyChange.addEventListener("click", () => oe(!Z)), r.privacyScroll.addEventListener("change", Us), h(".nf-submit").addEventListener("click", () => {
3915
+ ka().catch((a) => S(a.message || p("status.submitFailed")));
3916
+ }), ea(), ht(null);
3917
+ }
3918
+ function M(t) {
3919
+ return String(t || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3920
+ }
3921
+ function ea() {
3922
+ const t = y == null ? void 0 : y.querySelector(".nf-kind");
3923
+ if (!t)
3851
3924
  return;
3852
- const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : Y;
3853
- e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Yi(s))}</button>`).join("");
3854
- const o = t.map((s) => s.id).includes(J) ? J : Re(t);
3855
- Xe(o);
3925
+ const e = Array.isArray(c.kinds) && c.kinds.length ? c.kinds : J;
3926
+ t.innerHTML = e.map((i) => `<button type="button" data-kind="${M(i.id)}">${M(ta(i))}</button>`).join("");
3927
+ const o = e.map((i) => i.id).includes(G) ? G : Tt(e);
3928
+ Qt(o);
3929
+ }
3930
+ function Qt(t) {
3931
+ G = (c.kinds || J).map((a) => a.id).includes(t) ? t : Tt(c.kinds), y == null || y.querySelectorAll("[data-kind]").forEach((a) => {
3932
+ a.dataset.active = String(a.dataset.kind === G);
3933
+ }), ss(G), te();
3934
+ }
3935
+ function as() {
3936
+ return (Array.isArray(c.kinds) && c.kinds.length ? c.kinds : J).find((e) => e.id === G) || null;
3937
+ }
3938
+ function os() {
3939
+ const t = as(), e = (t == null ? void 0 : t.id) || G || "other", a = e === "bug" || e === "idea" || e === "other", o = (t == null ? void 0 : t.title) && String(t.title).trim() || p(a ? `form.title.${e}` : "form.title.other"), i = (t == null ? void 0 : t.description) && String(t.description).trim() || p(a ? `form.intro.${e}` : "form.intro.other"), s = a ? p(`form.placeholder.${e}`) : p("form.placeholder.custom", {
3940
+ kind: t ? ta(t) : bt(e)
3941
+ });
3942
+ return { title: o, intro: i, placeholder: s };
3856
3943
  }
3857
- function Xe(e) {
3858
- J = (d.kinds || Y).map((a) => a.id).includes(e) ? e : Re(d.kinds), f == null || f.querySelectorAll("[data-kind]").forEach((a) => {
3859
- a.dataset.active = String(a.dataset.kind === J);
3860
- }), es(J);
3944
+ function te() {
3945
+ if (!r.title && !r.intro && !r.text)
3946
+ return;
3947
+ const t = os(), e = I() ? ` ${p("form.screenshotNote")}` : "";
3948
+ r.title && (r.title.textContent = t.title), r.intro && (r.intro.textContent = `${t.intro}${e}`), r.text && r.text.setAttribute("placeholder", t.placeholder);
3861
3949
  }
3862
- function Qi() {
3950
+ function is() {
3863
3951
  try {
3864
- return String(localStorage.getItem(_t) || "").trim().toLowerCase();
3952
+ return String(localStorage.getItem(Je) || "").trim().toLowerCase();
3865
3953
  } catch {
3866
3954
  return "";
3867
3955
  }
3868
3956
  }
3869
- function es(e) {
3870
- const t = String(e || "").trim().toLowerCase();
3871
- if (t)
3957
+ function ss(t) {
3958
+ const e = String(t || "").trim().toLowerCase();
3959
+ if (e)
3872
3960
  try {
3873
- localStorage.setItem(_t, t);
3961
+ localStorage.setItem(Je, e);
3874
3962
  } catch {
3875
3963
  }
3876
3964
  }
3877
- function ts() {
3878
- const e = (d.kinds || Y).map((a) => a.id), t = Qi();
3879
- return t && e.includes(t) ? t : Re(d.kinds);
3965
+ function rs() {
3966
+ const t = (c.kinds || J).map((a) => a.id), e = is();
3967
+ return e && t.includes(e) ? e : Tt(c.kinds);
3880
3968
  }
3881
- function de(e) {
3882
- q = _i.has(e) ? e : null, M = null, f.querySelectorAll(".nf-tool").forEach((t) => {
3883
- t.dataset.active = String(t.dataset.tool === q);
3884
- }), n.canvas && (n.canvas.dataset.draw = q ? "true" : "false"), B() && O();
3969
+ function ht(t) {
3970
+ Y = Yi.has(t) ? t : null, O = null, y.querySelectorAll(".nf-tool").forEach((e) => {
3971
+ e.dataset.active = String(e.dataset.tool === Y);
3972
+ }), r.canvas && (r.canvas.dataset.draw = Y ? "true" : "false"), I() && D();
3885
3973
  }
3886
- function St(e) {
3887
- return Math.min(1, Math.max(0, e));
3974
+ function ze(t) {
3975
+ return Math.min(1, Math.max(0, t));
3888
3976
  }
3889
- function pe() {
3890
- return n.shot || n.canvas;
3977
+ function yt() {
3978
+ return r.shot || r.canvas;
3891
3979
  }
3892
- function Ae(e) {
3893
- const t = pe().getBoundingClientRect();
3980
+ function Pt(t) {
3981
+ const e = yt().getBoundingClientRect();
3894
3982
  return {
3895
- x: St((e.clientX - t.left) / Math.max(t.width, 1)),
3896
- y: St((e.clientY - t.top) / Math.max(t.height, 1))
3983
+ x: ze((t.clientX - e.left) / Math.max(e.width, 1)),
3984
+ y: ze((t.clientY - e.top) / Math.max(e.height, 1))
3897
3985
  };
3898
3986
  }
3899
- function as(e) {
3900
- const t = pe().getBoundingClientRect();
3901
- return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
3987
+ function ns(t) {
3988
+ const e = yt().getBoundingClientRect();
3989
+ return t.clientX >= e.left && t.clientX <= e.right && t.clientY >= e.top && t.clientY <= e.bottom;
3902
3990
  }
3903
- function Xt(e) {
3904
- const t = Ae(e), a = A.crop();
3991
+ function aa(t) {
3992
+ const e = Pt(t), a = A.crop();
3905
3993
  return {
3906
- x: a.x + t.x * a.w,
3907
- y: a.y + t.y * a.h
3994
+ x: a.x + e.x * a.w,
3995
+ y: a.y + e.y * a.h
3908
3996
  };
3909
3997
  }
3910
- function Le(e, t) {
3911
- const a = Math.min(e.x, t.x), o = Math.min(e.y, t.y);
3998
+ function Ft(t, e) {
3999
+ const a = Math.min(t.x, e.x), o = Math.min(t.y, e.y);
3912
4000
  return {
3913
4001
  x: a,
3914
4002
  y: o,
3915
- w: Math.max(Ke, Math.abs(t.x - e.x)),
3916
- h: Math.max(Ke, Math.abs(t.y - e.y))
4003
+ w: Math.max(Ht, Math.abs(e.x - t.x)),
4004
+ h: Math.max(Ht, Math.abs(e.y - t.y))
3917
4005
  };
3918
4006
  }
3919
- function Qe(e) {
3920
- f && (e ? f.dataset.grabbing = "true" : delete f.dataset.grabbing);
4007
+ function ee(t) {
4008
+ y && (t ? y.dataset.grabbing = "true" : delete y.dataset.grabbing);
3921
4009
  }
3922
- function $e(e) {
4010
+ function Bt(t) {
3923
4011
  try {
3924
- n.canvas.setPointerCapture(e.pointerId);
4012
+ r.canvas.setPointerCapture(t.pointerId);
3925
4013
  } catch {
3926
4014
  }
3927
4015
  }
3928
- function He() {
3929
- window.addEventListener("pointermove", ea), window.addEventListener("pointerup", Ce), window.addEventListener("pointercancel", Ce);
4016
+ function Gt() {
4017
+ window.addEventListener("pointermove", ia), window.addEventListener("pointerup", xt), window.addEventListener("pointercancel", xt);
3930
4018
  }
3931
- function Qt() {
3932
- window.removeEventListener("pointermove", ea), window.removeEventListener("pointerup", Ce), window.removeEventListener("pointercancel", Ce);
4019
+ function oa() {
4020
+ window.removeEventListener("pointermove", ia), window.removeEventListener("pointerup", xt), window.removeEventListener("pointercancel", xt);
3933
4021
  }
3934
- function os(e) {
3935
- if (e.button !== 0 || !B())
4022
+ function ls(t) {
4023
+ if (t.button !== 0 || !I())
3936
4024
  return;
3937
- if (!e.target.closest(".nf-sticker") && !as(e)) {
3938
- M = null, O();
4025
+ if (!t.target.closest(".nf-sticker") && !ns(t)) {
4026
+ O = null, D();
3939
4027
  return;
3940
4028
  }
3941
- const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
4029
+ const e = t.target.closest(".nf-handle"), a = t.target.closest(".nf-sticker");
3942
4030
  if (a && a.dataset.preview !== "true") {
3943
- e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), is({
4031
+ t.preventDefault(), t.stopPropagation(), O = a.dataset.id, Bt(t), us({
3944
4032
  kind: "sticker",
3945
- id: M,
3946
- dir: (t == null ? void 0 : t.dataset.dir) || "move"
3947
- }, e), O();
4033
+ id: O,
4034
+ dir: (e == null ? void 0 : e.dataset.dir) || "move"
4035
+ }, t), D();
3948
4036
  return;
3949
4037
  }
3950
- if (M = null, q === "crop") {
3951
- e.preventDefault(), $e(e), j = { kind: "crop", start: Ae(e), current: Ae(e) }, He(), O();
4038
+ if (O = null, Y === "crop") {
4039
+ t.preventDefault(), Bt(t), R = { kind: "crop", start: Pt(t), current: Pt(t) }, Gt(), D();
3952
4040
  return;
3953
4041
  }
3954
- if (q === "arrow" || q === "rect" || q === "circle") {
3955
- e.preventDefault(), $e(e);
3956
- const o = Xt(e);
3957
- j = { kind: "sticker", type: q, start: o, current: o }, He(), O();
4042
+ if (Y === "arrow" || Y === "rect" || Y === "circle") {
4043
+ t.preventDefault(), Bt(t);
4044
+ const o = aa(t);
4045
+ R = { kind: "sticker", type: Y, start: o, current: o }, Gt(), D();
3958
4046
  return;
3959
4047
  }
3960
- O();
4048
+ D();
3961
4049
  }
3962
- function is(e, t) {
3963
- t.preventDefault(), t.stopPropagation();
3964
- const a = pe().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
4050
+ function us(t, e) {
4051
+ e.preventDefault(), e.stopPropagation();
4052
+ const a = yt().getBoundingClientRect(), o = A.list().find((i) => i.id === t.id);
3965
4053
  E = {
3966
- ...e,
3967
- startX: t.clientX,
3968
- startY: t.clientY,
4054
+ ...t,
4055
+ startX: e.clientX,
4056
+ startY: e.clientY,
3969
4057
  crop: A.crop(),
3970
4058
  sticker: o ? { ...o } : null,
3971
4059
  rect: a
3972
- }, Qe(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
4060
+ }, ee(t.dir === "move" || t.dir === "start" || t.dir === "end"), Gt();
3973
4061
  }
3974
- function ea(e) {
3975
- if (j) {
3976
- j.current = j.kind === "crop" ? Ae(e) : Xt(e), O();
4062
+ function ia(t) {
4063
+ if (R) {
4064
+ R.current = R.kind === "crop" ? Pt(t) : aa(t), D();
3977
4065
  return;
3978
4066
  }
3979
4067
  if (!E)
3980
4068
  return;
3981
- 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;
4069
+ const e = (t.clientX - E.startX) / E.rect.width * E.crop.w, a = (t.clientY - E.startY) / E.rect.height * E.crop.h, o = E.sticker;
3982
4070
  if (o) {
3983
4071
  if (E.dir === "end")
3984
4072
  A.update(o.id, {
3985
- x2: o.x2 + t,
4073
+ x2: o.x2 + e,
3986
4074
  y2: o.y2 + a
3987
4075
  });
3988
4076
  else if (E.dir === "start")
3989
4077
  A.update(o.id, {
3990
- x: o.x + t,
4078
+ x: o.x + e,
3991
4079
  y: o.y + a
3992
4080
  });
3993
4081
  else if (E.dir === "move")
3994
4082
  A.update(o.id, {
3995
- x: o.x + t,
4083
+ x: o.x + e,
3996
4084
  y: o.y + a,
3997
- x2: (o.x2 || o.x) + t,
4085
+ x2: (o.x2 || o.x) + e,
3998
4086
  y2: (o.y2 || o.y) + a
3999
4087
  });
4000
4088
  else {
4001
- const s = { x: o.x, y: o.y, w: o.w, h: o.h };
4002
- ss(s, E.dir, t, a), A.update(o.id, s);
4089
+ const i = { x: o.x, y: o.y, w: o.w, h: o.h };
4090
+ cs(i, E.dir, e, a), A.update(o.id, i);
4003
4091
  }
4004
- O();
4092
+ D();
4005
4093
  }
4006
4094
  }
4007
- function ss(e, t, a, o) {
4008
- if (t.includes("e") && (e.w = Math.max(0.04, e.w + a)), t.includes("s") && (e.h = Math.max(0.04, e.h + o)), t.includes("w")) {
4009
- const s = Math.max(0.04, e.w - a);
4010
- e.x += e.w - s, e.w = s;
4095
+ function cs(t, e, a, o) {
4096
+ if (e.includes("e") && (t.w = Math.max(0.04, t.w + a)), e.includes("s") && (t.h = Math.max(0.04, t.h + o)), e.includes("w")) {
4097
+ const i = Math.max(0.04, t.w - a);
4098
+ t.x += t.w - i, t.w = i;
4011
4099
  }
4012
- if (t.includes("n")) {
4013
- const s = Math.max(0.04, e.h - o);
4014
- e.y += e.h - s, e.h = s;
4100
+ if (e.includes("n")) {
4101
+ const i = Math.max(0.04, t.h - o);
4102
+ t.y += t.h - i, t.h = i;
4015
4103
  }
4016
4104
  }
4017
- function Ce(e) {
4018
- if (Qt(), Qe(!1), j) {
4019
- rs();
4105
+ function xt(t) {
4106
+ if (oa(), ee(!1), R) {
4107
+ ds();
4020
4108
  return;
4021
4109
  }
4022
4110
  if (E) {
4023
4111
  if (E.kind === "sticker") {
4024
- const t = n.canvas.getBoundingClientRect();
4025
- (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);
4112
+ const e = r.canvas.getBoundingClientRect();
4113
+ (t.clientX < e.left - 24 || t.clientX > e.right + 24 || t.clientY < e.top - 24 || t.clientY > e.bottom + 24) && (A.remove(E.id), O = null);
4026
4114
  }
4027
- E = null, O();
4115
+ E = null, D();
4028
4116
  }
4029
4117
  }
4030
- function rs() {
4031
- const e = j;
4032
- if (j = null, !e)
4118
+ function ds() {
4119
+ const t = R;
4120
+ if (R = null, !t)
4033
4121
  return;
4034
- if (e.kind === "crop") {
4035
- const a = Le(e.start, e.current);
4036
- if (Math.abs(e.current.x - e.start.x) < wt || Math.abs(e.current.y - e.start.y) < wt) {
4037
- O();
4122
+ if (t.kind === "crop") {
4123
+ const a = Ft(t.start, t.current);
4124
+ if (Math.abs(t.current.x - t.start.x) < Ce || Math.abs(t.current.y - t.start.y) < Ce) {
4125
+ D();
4038
4126
  return;
4039
4127
  }
4040
- const s = A.crop();
4128
+ const i = A.crop();
4041
4129
  A.setCrop({
4042
- x: s.x + a.x * s.w,
4043
- y: s.y + a.y * s.h,
4044
- w: a.w * s.w,
4045
- h: a.h * s.h
4046
- }), ee();
4130
+ x: i.x + a.x * i.w,
4131
+ y: i.y + a.y * i.h,
4132
+ w: a.w * i.w,
4133
+ h: a.h * i.h
4134
+ }), ot();
4047
4135
  return;
4048
4136
  }
4049
- const t = ns(e);
4050
- t && (M = t.id), O();
4051
- }
4052
- function ns(e) {
4053
- if (e.type === "arrow") {
4054
- const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
4055
- return Math.hypot(t, a) < Ke ? A.add("arrow", {
4056
- x: e.start.x,
4057
- y: e.start.y,
4058
- x2: e.start.x + 0.12,
4059
- y2: e.start.y,
4137
+ const e = ps(t);
4138
+ e && (O = e.id), D();
4139
+ }
4140
+ function ps(t) {
4141
+ if (t.type === "arrow") {
4142
+ const e = t.current.x - t.start.x, a = t.current.y - t.start.y;
4143
+ return Math.hypot(e, a) < Ht ? A.add("arrow", {
4144
+ x: t.start.x,
4145
+ y: t.start.y,
4146
+ x2: t.start.x + 0.12,
4147
+ y2: t.start.y,
4060
4148
  w: 0.12,
4061
4149
  h: 0.02
4062
4150
  }) : A.add("arrow", {
4063
- x: e.start.x,
4064
- y: e.start.y,
4065
- x2: e.current.x,
4066
- y2: e.current.y,
4067
- w: Math.abs(t),
4151
+ x: t.start.x,
4152
+ y: t.start.y,
4153
+ x2: t.current.x,
4154
+ y2: t.current.y,
4155
+ w: Math.abs(e),
4068
4156
  h: Math.abs(a)
4069
4157
  });
4070
4158
  }
4071
- return A.add(e.type, Le(e.start, e.current));
4159
+ return A.add(t.type, Ft(t.start, t.current));
4072
4160
  }
4073
- function ls() {
4074
- A.resetCrop(), M = null, ee();
4161
+ function gs() {
4162
+ A.resetCrop(), O = null, ot();
4075
4163
  }
4076
- function ze() {
4077
- n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
4164
+ function Lt() {
4165
+ r.resetCrop && (r.resetCrop.hidden = !A.isCropped());
4078
4166
  }
4079
- function Ue(e) {
4080
- if (!n.audio)
4167
+ function ft(t) {
4168
+ if (!r.audio)
4081
4169
  return;
4082
- const t = p(e ? "tool.audioStop" : "tool.audio");
4083
- n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
4170
+ const e = !!t, a = p(e ? "tool.audioStop" : "tool.audio");
4171
+ r.audio.title = a, r.audio.setAttribute("aria-label", a), r.audio.dataset.active = String(e), r.audio.innerHTML = e ? x.stop : x.audio;
4172
+ }
4173
+ function ct(t) {
4174
+ if (et = !!t, r.video) {
4175
+ const e = p(et ? "tool.stopVideo" : "tool.video");
4176
+ r.video.title = e, r.video.setAttribute("aria-label", e), r.video.dataset.active = String(et), r.video.innerHTML = et ? x.stop : x.video;
4177
+ }
4178
+ if (r.stop) {
4179
+ const e = p("tool.stopVideo");
4180
+ r.stop.title = e, r.stop.setAttribute("aria-label", e), r.stop.innerHTML = x.stop, r.stop.dataset.active = "true";
4181
+ }
4084
4182
  }
4085
- function B() {
4086
- return Z(H);
4183
+ function I() {
4184
+ return Q(q);
4087
4185
  }
4088
- function ge() {
4089
- if (!n.stage || !n.palette || !n.actions || !n.recapture)
4186
+ function vt() {
4187
+ if (!r.stage || !r.palette || !r.actions || !r.recapture)
4090
4188
  return;
4091
- const e = B();
4092
- n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !ie), e ? (n.palette.appendChild(n.discard), n.palette.appendChild(n.recapture)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1;
4189
+ const t = I();
4190
+ r.stage.hidden = !t && !H, r.palette.hidden = !t, r.discard && (r.discard.hidden = !t), r.restore && (r.restore.hidden = t || !nt), t && r.paletteShot ? (r.paletteShot.appendChild(r.recapture), r.paletteShot.appendChild(r.discard)) : r.actionsMedia ? r.actionsMedia.after(r.recapture) : r.audio ? r.audio.after(r.recapture) : r.actions.insertBefore(r.recapture, r.submit || null), r.recapture.hidden = !1, te();
4093
4191
  }
4094
- function us() {
4095
- B() && (ie = H), H = "", de(null), ge(), ee();
4192
+ function ms() {
4193
+ I() && (nt = q), q = "", ht(null), vt(), ot();
4096
4194
  }
4097
- function cs() {
4098
- Z(ie) && (H = ie, ge(), ee());
4195
+ function hs() {
4196
+ Q(nt) && (q = nt, vt(), ot());
4099
4197
  }
4100
- function ta() {
4198
+ function sa() {
4101
4199
  return {
4102
- capture: typeof d.capture == "function" ? d.capture : void 0,
4103
- onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
4200
+ capture: typeof c.capture == "function" ? c.capture : void 0,
4201
+ onBeforeCapture: typeof c.onBeforeCapture == "function" ? c.onBeforeCapture : void 0
4104
4202
  };
4105
4203
  }
4106
- function aa(e) {
4107
- if (!Z(e))
4204
+ function ra(t) {
4205
+ if (!Q(t))
4108
4206
  throw new Error(p("status.screenshotFailed"));
4109
- H = e, ie = e, A = Je(), G = { w: 0, h: 0 }, M = null, j = null, E = null, de(null);
4207
+ q = t, nt = t, A = Yt(), _ = { w: 0, h: 0 }, O = null, R = null, E = null, ht(null);
4110
4208
  }
4111
- async function ds() {
4112
- if (!(Ie || !n.dialog || n.dialog.hidden)) {
4113
- Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
4209
+ async function fs() {
4210
+ if (!(Vt || !r.dialog || r.dialog.hidden)) {
4211
+ Vt = !0, r.recapture.disabled = !0, S(p("status.capturing"), !0), r.dialog.hidden = !0;
4114
4212
  try {
4115
- let e = "";
4213
+ let t = "";
4116
4214
  try {
4117
- e = await pi();
4215
+ t = await fi();
4118
4216
  } catch {
4119
- e = await Vt(ta());
4217
+ t = await Ne(sa());
4120
4218
  }
4121
- aa(e), S("");
4122
- } catch (e) {
4123
- S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4219
+ ra(t), S("");
4220
+ } catch (t) {
4221
+ S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4124
4222
  } finally {
4125
- n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, ge(), ee();
4223
+ r.dialog.hidden = !1, r.recapture.disabled = !1, Vt = !1, vt(), ot();
4126
4224
  }
4127
4225
  }
4128
4226
  }
4129
- function ps() {
4227
+ function ys() {
4130
4228
  try {
4131
- if (Q || (Q = zi((t) => {
4132
- const a = n.text.value.trim();
4133
- n.text.value = a ? `${a} ${t}` : t;
4134
- })), !Q.isSupported()) {
4229
+ if (W || (W = Pi((e) => {
4230
+ const a = r.text.value.trim();
4231
+ r.text.value = a ? `${a} ${e}` : e;
4232
+ }, {
4233
+ onActiveChange(e) {
4234
+ ft(e), e || S("");
4235
+ }
4236
+ })), !W.isSupported()) {
4135
4237
  S(p("status.audioUnsupported"));
4136
4238
  return;
4137
4239
  }
4138
- const e = Q.start({ lang: ye() });
4139
- Ue(e), S(e ? p("status.listening") : "");
4140
- } catch (e) {
4141
- S(e.message);
4240
+ if (W.isActive()) {
4241
+ W.stop();
4242
+ return;
4243
+ }
4244
+ const t = W.start({ lang: At() });
4245
+ ft(t), S(t ? p("status.listening") : "");
4246
+ } catch (t) {
4247
+ S(t.message);
4248
+ }
4249
+ }
4250
+ async function vs() {
4251
+ if (et) {
4252
+ V == null || V.stop();
4253
+ return;
4142
4254
  }
4255
+ await ks();
4143
4256
  }
4144
- async function gs() {
4145
- if (!d.video) {
4257
+ async function ks() {
4258
+ if (!c.video) {
4146
4259
  S(p("status.videoDisabled"));
4147
4260
  return;
4148
4261
  }
4149
- n.dialog.hidden = !0, n.stop.hidden = !1, se(), n.launcher.hidden = !0, le = ji({
4150
- onStart() {
4151
- },
4152
- onStop(e) {
4153
- K = e, n.stop.hidden = !0, Se(), n.dialog.hidden = !1, ge(), ee(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
4154
- },
4155
- onError(e) {
4156
- S(e.message);
4262
+ if (!et) {
4263
+ r.dialog.hidden = !0, r.stop.hidden = !1, lt(), r.launcher.hidden = !0, V = Li({
4264
+ onStart() {
4265
+ ct(!0);
4266
+ },
4267
+ onStop(t) {
4268
+ H = t, ct(!1), r.stop.hidden = !0, jt(), r.dialog.hidden = !1, vt(), ot(), S(p(t ? "status.videoAttached" : "status.recordingCancelled"));
4269
+ },
4270
+ onError(t) {
4271
+ ct(!1), S(t.message);
4272
+ }
4273
+ });
4274
+ try {
4275
+ await V.start();
4276
+ } catch (t) {
4277
+ ct(!1), r.stop.hidden = !0, jt(), r.dialog.hidden = !1, S(t.message);
4157
4278
  }
4158
- });
4159
- try {
4160
- await le.start();
4161
- } catch (e) {
4162
- n.stop.hidden = !0, Se(), n.dialog.hidden = !1, S(e.message);
4163
4279
  }
4164
4280
  }
4165
- function ee() {
4166
- if (n.shot = null, !B()) {
4167
- 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>` : "", ze();
4281
+ function ot() {
4282
+ if (r.shot = null, !I()) {
4283
+ r.canvas.style.removeProperty("--nf-shot-aspect"), r.canvas.style.removeProperty("aspect-ratio"), r.canvas.innerHTML = H ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(H)}"></video>` : "", Lt();
4168
4284
  return;
4169
4285
  }
4170
- n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${H}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
4171
- const e = n.shot.querySelector("img");
4172
- e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
4173
- const t = () => {
4174
- ms(e), O();
4286
+ r.canvas.innerHTML = `<div class="nf-shot"><img alt="${M(p("shot.alt"))}" src="${q}" draggable="false"></div>`, r.shot = r.canvas.querySelector(".nf-shot");
4287
+ const t = r.shot.querySelector("img");
4288
+ t.draggable = !1, t.addEventListener("dragstart", (a) => a.preventDefault());
4289
+ const e = () => {
4290
+ bs(t), D();
4175
4291
  };
4176
- e.addEventListener("load", t), e.complete && e.naturalWidth && t(), ze();
4292
+ t.addEventListener("load", e), t.complete && t.naturalWidth && e(), Lt();
4177
4293
  }
4178
- function ms(e) {
4179
- const t = e.naturalWidth || G.w, a = e.naturalHeight || G.h;
4180
- if (t && a && (G = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !G.w || !G.h)
4294
+ function bs(t) {
4295
+ const e = t.naturalWidth || _.w, a = t.naturalHeight || _.h;
4296
+ if (e && a && (_ = { w: e, h: a }, r.canvas.style.setProperty("--nf-shot-aspect", String(e / a)), r.canvas.style.aspectRatio = `${e} / ${a}`), !r.shot || !_.w || !_.h)
4181
4297
  return;
4182
- const o = A.crop(), s = G.w / G.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
4183
- 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}%`;
4298
+ const o = A.crop(), i = _.w / _.h, s = o.w / o.h * i, n = Math.min(1, s / i), l = Math.min(1, i / s);
4299
+ r.shot.style.left = `${(1 - n) / 2 * 100}%`, r.shot.style.top = `${(1 - l) / 2 * 100}%`, r.shot.style.width = `${n * 100}%`, r.shot.style.height = `${l * 100}%`, t.style.width = `${100 / o.w}%`, t.style.height = `${100 / o.h}%`, t.style.left = `${-o.x / o.w * 100}%`, t.style.top = `${-o.y / o.h * 100}%`;
4184
4300
  }
4185
- function hs(e) {
4186
- return e.type === "arrow" ? {
4301
+ function ws(t) {
4302
+ return t.type === "arrow" ? {
4187
4303
  id: "preview",
4188
4304
  type: "arrow",
4189
4305
  number: "",
4190
- x: e.start.x,
4191
- y: e.start.y,
4192
- x2: e.current.x,
4193
- y2: e.current.y,
4194
- w: Math.abs(e.current.x - e.start.x),
4195
- h: Math.abs(e.current.y - e.start.y)
4306
+ x: t.start.x,
4307
+ y: t.start.y,
4308
+ x2: t.current.x,
4309
+ y2: t.current.y,
4310
+ w: Math.abs(t.current.x - t.start.x),
4311
+ h: Math.abs(t.current.y - t.start.y)
4196
4312
  } : {
4197
4313
  id: "preview",
4198
- type: e.type,
4314
+ type: t.type,
4199
4315
  number: "",
4200
- ...Le(e.start, e.current)
4316
+ ...Ft(t.start, t.current)
4201
4317
  };
4202
4318
  }
4203
- function O() {
4204
- if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !B() || !n.shot) {
4205
- ze();
4319
+ function D() {
4320
+ if ((r.shot || r.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((s) => s.remove()), !I() || !r.shot) {
4321
+ Lt();
4206
4322
  return;
4207
4323
  }
4208
- const t = A.crop(), a = pe(), o = Nt(a.clientWidth || 400);
4209
- 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") {
4210
- const i = document.createElement("div");
4211
- i.className = "nf-crop", At(i, Le(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
4324
+ const e = A.crop(), a = yt(), o = Ge(a.clientWidth || 400);
4325
+ if (r.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), r.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), r.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), r.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (R == null ? void 0 : R.kind) === "crop") {
4326
+ const s = document.createElement("div");
4327
+ s.className = "nf-crop", Ee(s, Ft(R.start, R.current), { x: 0, y: 0, w: 1, h: 1 }), r.shot.appendChild(s);
4212
4328
  }
4213
- const s = A.list().slice();
4214
- if ((j == null ? void 0 : j.kind) === "sticker" && s.push(hs(j)), s.forEach((i) => {
4215
- const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
4216
- 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" ? fs(u, i, t, l, o) : (At(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
4217
- const c = document.createElement("span");
4218
- c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
4329
+ const i = A.list().slice();
4330
+ if ((R == null ? void 0 : R.kind) === "sticker" && i.push(ws(R)), i.forEach((s) => {
4331
+ const n = s.id === "preview", l = !n && s.id === O, u = document.createElement("div");
4332
+ if (u.className = `nf-sticker nf-${s.type}`, u.dataset.id = s.id, l && (u.dataset.selected = "true"), n && (u.dataset.preview = "true"), s.type === "arrow" ? Ss(u, s, e, l, o) : (Ee(u, s, e), l && ["nw", "ne", "sw", "se"].forEach((d) => qt(u, d))), !n && s.number) {
4333
+ const d = document.createElement("span");
4334
+ d.className = "nf-badge", d.textContent = String(s.number), u.appendChild(d);
4219
4335
  }
4220
- n.shot.appendChild(u);
4221
- }), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
4222
- const i = document.createElement("video");
4223
- 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);
4336
+ r.shot.appendChild(u);
4337
+ }), r.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((s) => s.remove()), H) {
4338
+ const s = document.createElement("video");
4339
+ s.className = "nf-recording-preview", s.controls = !0, s.src = URL.createObjectURL(H), s.style.position = "absolute", s.style.right = "8px", s.style.bottom = "8px", s.style.width = "160px", r.canvas.appendChild(s);
4224
4340
  }
4225
- ze();
4341
+ Lt();
4226
4342
  }
4227
- function fs(e, t, a, o, s = Nt(400)) {
4228
- const i = pe(), 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, T = u - w, $ = c - b, P = g - w, m = v - b, C = Ui(T, $, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4229
- 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 = `
4230
- <line class="nf-arrow-hit" x1="${T}" y1="${$}" x2="${P}" y2="${m}" />
4231
- <line class="nf-arrow-shaft" x1="${T}" y1="${$}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4343
+ function Ss(t, e, a, o, i = Ge(400)) {
4344
+ const s = yt(), n = s.clientWidth, l = s.clientHeight, u = (e.x - a.x) / a.w * n, d = (e.y - a.y) / a.h * l, g = ((e.x2 ?? e.x + e.w) - a.x) / a.w * n, k = ((e.y2 ?? e.y) - a.y) / a.h * l, v = Math.max(18, i.arrowHead + i.stroke * 2), w = Math.min(u, g) - v, b = Math.min(d, k) - v, z = Math.max(2, Math.abs(g - u)) + v * 2, j = Math.max(2, Math.abs(k - d)) + v * 2, T = u - w, N = d - b, P = g - w, m = k - b, C = Di(T, N, P, m, i), tt = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4345
+ t.style.left = `${w}px`, t.style.top = `${b}px`, t.style.width = `${z}px`, t.style.height = `${j}px`, tt.setAttribute("class", "nf-arrow-svg"), tt.setAttribute("viewBox", `0 0 ${z} ${j}`), tt.setAttribute("width", String(z)), tt.setAttribute("height", String(j)), tt.innerHTML = `
4346
+ <line class="nf-arrow-hit" x1="${T}" y1="${N}" x2="${P}" y2="${m}" />
4347
+ <line class="nf-arrow-shaft" x1="${T}" y1="${N}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4232
4348
  <polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
4233
- `, e.appendChild(X), o && (Ge(e, "start", { left: T - 5, top: $ - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
4349
+ `, t.appendChild(tt), o && (qt(t, "start", { left: T - 5, top: N - 5 }), qt(t, "end", { left: P - 5, top: m - 5 }));
4234
4350
  }
4235
- function Ge(e, t, a) {
4351
+ function qt(t, e, a) {
4236
4352
  const o = document.createElement("span");
4237
- o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
4353
+ o.className = "nf-handle", o.dataset.dir = e, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), t.appendChild(o);
4238
4354
  }
4239
- function At(e, t, a) {
4240
- e.style.left = `${(t.x - a.x) / a.w * 100}%`, e.style.top = `${(t.y - a.y) / a.h * 100}%`, e.style.width = `${t.w / a.w * 100}%`, e.style.height = `${t.h / a.h * 100}%`;
4355
+ function Ee(t, e, a) {
4356
+ t.style.left = `${(e.x - a.x) / a.w * 100}%`, t.style.top = `${(e.y - a.y) / a.h * 100}%`, t.style.width = `${e.w / a.w * 100}%`, t.style.height = `${e.h / a.h * 100}%`;
4241
4357
  }
4242
- function oa() {
4358
+ function na() {
4243
4359
  try {
4244
- return String(localStorage.getItem(qt) || "").trim();
4360
+ return String(localStorage.getItem(Ze) || "").trim();
4245
4361
  } catch {
4246
4362
  return "";
4247
4363
  }
4248
4364
  }
4249
- function ys(e) {
4250
- const t = String(e || "").trim();
4251
- if (!(!t || t === qe()))
4365
+ function As(t) {
4366
+ const e = String(t || "").trim();
4367
+ if (!(!e || e === _t()))
4252
4368
  try {
4253
- localStorage.setItem(qt, t);
4369
+ localStorage.setItem(Ze, e);
4254
4370
  } catch {
4255
4371
  }
4256
4372
  }
4257
- function ia() {
4373
+ function la() {
4258
4374
  try {
4259
- const e = localStorage.getItem(Wt);
4260
- if (!e)
4375
+ const t = localStorage.getItem(Ye);
4376
+ if (!t)
4261
4377
  return { diagnostics: !1, logs: !1 };
4262
- const t = JSON.parse(e);
4378
+ const e = JSON.parse(t);
4263
4379
  return {
4264
- diagnostics: !!(t != null && t.diagnostics),
4265
- logs: !!(t != null && t.logs)
4380
+ diagnostics: !!(e != null && e.diagnostics),
4381
+ logs: !!(e != null && e.logs)
4266
4382
  };
4267
4383
  } catch {
4268
4384
  return { diagnostics: !1, logs: !1 };
4269
4385
  }
4270
4386
  }
4271
- function Ct(e = {}) {
4272
- const t = {
4273
- ...ia(),
4274
- ...e
4387
+ function Re(t = {}) {
4388
+ const e = {
4389
+ ...la(),
4390
+ ...t
4275
4391
  };
4276
4392
  try {
4277
- localStorage.setItem(Wt, JSON.stringify({
4278
- diagnostics: !!t.diagnostics,
4279
- logs: !!t.logs
4393
+ localStorage.setItem(Ye, JSON.stringify({
4394
+ diagnostics: !!e.diagnostics,
4395
+ logs: !!e.logs
4280
4396
  }));
4281
4397
  } catch {
4282
4398
  }
4283
4399
  }
4284
- function sa() {
4285
- return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
4400
+ function ua() {
4401
+ return !!(String(K.userId || "").trim() || String(K.email || "").trim() || String(K.displayName || "").trim());
4286
4402
  }
4287
- function ra() {
4403
+ function ca() {
4288
4404
  return String(
4289
- N.displayName || N.email || N.userId || ""
4405
+ K.displayName || K.email || K.userId || ""
4290
4406
  ).trim();
4291
4407
  }
4292
- function qe() {
4408
+ function _t() {
4293
4409
  return p("form.authorPlaceholder");
4294
4410
  }
4295
- function vs() {
4296
- var t;
4297
- if (sa())
4298
- return ra() || qe();
4299
- const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
4300
- return e ? (ys(e), e) : qe();
4411
+ function Cs() {
4412
+ var e;
4413
+ if (ua())
4414
+ return ca() || _t();
4415
+ const t = String(((e = r.author) == null ? void 0 : e.value) || "").trim();
4416
+ return t ? (As(t), t) : _t();
4301
4417
  }
4302
- function na() {
4303
- if (!n.author)
4418
+ function da() {
4419
+ if (!r.author)
4304
4420
  return;
4305
- const e = sa();
4306
- if (n.author.hidden = e, e) {
4307
- n.author.value = "";
4421
+ const t = ua();
4422
+ if (r.author.hidden = t, t) {
4423
+ r.author.value = "";
4308
4424
  return;
4309
4425
  }
4310
- n.author.value = oa();
4311
- }
4312
- function la(e, t = Gt) {
4313
- const a = Number(e);
4314
- return Number.isFinite(a) ? Math.min(Zi, Math.max(0, Math.floor(a))) : t;
4315
- }
4316
- function ua(e) {
4317
- e.key !== "Escape" || !n.dialog || n.dialog.hidden || Pe && !xe || re();
4318
- }
4319
- function ca(e = {}) {
4320
- yi(e);
4321
- const t = Object.prototype.hasOwnProperty.call(e, "kinds");
4322
- d = {
4323
- ...d,
4324
- endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
4325
- projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
4326
- version: e.version == null ? d.version : String(e.version),
4327
- name: e.name == null ? d.name : String(e.name || ""),
4328
- targets: e.targets === void 0 ? d.targets : e.targets,
4329
- hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
4330
- theme: Zt(e.theme ?? d.theme),
4331
- video: e.video == null ? d.video : !!e.video,
4332
- consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : la(e.consoleLogLimit, d.consoleLogLimit),
4333
- kinds: t ? Gi(e.kinds) : d.kinds,
4334
- kindsCustom: t ? !0 : d.kindsCustom,
4335
- capture: e.capture === void 0 ? d.capture : e.capture,
4336
- onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
4337
- onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
4338
- onClose: e.onClose === void 0 ? d.onClose : e.onClose,
4339
- displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
4340
- locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4341
- translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4426
+ r.author.value = na();
4427
+ }
4428
+ function pa(t, e = We) {
4429
+ const a = Number(t);
4430
+ return Number.isFinite(a) ? Math.min(Qi, Math.max(0, Math.floor(a))) : e;
4431
+ }
4432
+ function ga(t) {
4433
+ t.key !== "Escape" || !r.dialog || r.dialog.hidden || gt && !mt || at();
4434
+ }
4435
+ function ma(t = {}) {
4436
+ wi(t);
4437
+ const e = Object.prototype.hasOwnProperty.call(t, "kinds");
4438
+ c = {
4439
+ ...c,
4440
+ endpoint: String(t.endpoint || c.endpoint || "").replace(/\/$/, ""),
4441
+ projectKey: t.projectKey == null ? c.projectKey : String(t.projectKey),
4442
+ version: t.version == null ? c.version : String(t.version),
4443
+ name: t.name == null ? c.name : String(t.name || ""),
4444
+ targets: t.targets === void 0 ? c.targets : t.targets,
4445
+ hideLauncher: t.hideLauncher == null ? c.hideLauncher : !!t.hideLauncher,
4446
+ theme: Xe(t.theme ?? c.theme),
4447
+ video: t.video == null ? c.video : !!t.video,
4448
+ consoleLogLimit: t.consoleLogLimit == null ? c.consoleLogLimit : pa(t.consoleLogLimit, c.consoleLogLimit),
4449
+ kinds: e ? Zi(t.kinds) : c.kinds,
4450
+ kindsCustom: e ? !0 : c.kindsCustom,
4451
+ capture: t.capture === void 0 ? c.capture : t.capture,
4452
+ onBeforeCapture: t.onBeforeCapture === void 0 ? c.onBeforeCapture : t.onBeforeCapture,
4453
+ onOpen: t.onOpen === void 0 ? c.onOpen : t.onOpen,
4454
+ onClose: t.onClose === void 0 ? c.onClose : t.onClose,
4455
+ displayLink: t.displayLink == null ? c.displayLink : !!t.displayLink,
4456
+ locale: t.locale === void 0 ? c.locale : t.locale == null || t.locale === "" ? null : String(t.locale),
4457
+ translations: t.translations === void 0 ? c.translations : t.translations && typeof t.translations == "object" ? t.translations : null
4342
4458
  };
4343
4459
  }
4344
- function da(e) {
4345
- const t = d[e];
4346
- if (typeof t == "function")
4460
+ function ha(t) {
4461
+ const e = c[t];
4462
+ if (typeof e == "function")
4347
4463
  try {
4348
- t();
4464
+ e();
4349
4465
  } catch (a) {
4350
- console.warn(`Notefully.${e} failed:`, a);
4466
+ console.warn(`Notefully.${t} failed:`, a);
4351
4467
  }
4352
4468
  }
4353
- function ks() {
4354
- return ce;
4469
+ function zs() {
4470
+ return pt;
4355
4471
  }
4356
- function bs() {
4357
- return ye();
4472
+ function Es() {
4473
+ return At();
4358
4474
  }
4359
- function ws(e, t) {
4360
- return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), f ? se() : Jt(), Te;
4475
+ function Rs(t, e) {
4476
+ return c.locale = t == null || t === "" ? null : String(t), e !== void 0 && (c.translations = e && typeof e == "object" ? e : null), y ? lt() : Qe(), Mt;
4361
4477
  }
4362
- function et(e = {}) {
4363
- return ca(e), f && se(), Te;
4478
+ function ae(t = {}) {
4479
+ return ma(t), y && lt(), Mt;
4364
4480
  }
4365
- function Ss(e = {}) {
4366
- return ca(e), Ye(), se(), Te;
4481
+ function js(t = {}) {
4482
+ return ma(t), Xt(), lt(), Mt;
4367
4483
  }
4368
- function As(e) {
4369
- return et({ theme: e });
4484
+ function Ps(t) {
4485
+ return ae({ theme: t });
4370
4486
  }
4371
- function Cs(e) {
4372
- const t = !!e;
4373
- return !t && f && n.dialog && !n.dialog.hidden && re(), et({ hideLauncher: !t });
4487
+ function xs(t) {
4488
+ const e = !!t;
4489
+ return !e && y && r.dialog && !r.dialog.hidden && at(), ae({ hideLauncher: !e });
4374
4490
  }
4375
- function zs() {
4376
- const e = ra() || oa() || void 0, t = hi({
4377
- ...N,
4378
- displayName: N.displayName || e
4491
+ function Ls() {
4492
+ const t = ca() || na() || void 0, e = ki({
4493
+ ...K,
4494
+ displayName: K.displayName || t
4379
4495
  });
4380
- V = Vi(t), I = $i(
4381
- Ht.snapshot().slice(-la(d.consoleLogLimit))
4496
+ B = Ki(e), $ = Hi(
4497
+ _e.snapshot().slice(-pa(c.consoleLogLimit))
4382
4498
  );
4383
- const a = ia();
4384
- a.diagnostics && we(V, !0), a.logs && I.length && we(I, !0), _ = !1;
4499
+ const a = la();
4500
+ a.diagnostics && Rt(B, !0), a.logs && $.length && Rt($, !0), Z = !1;
4385
4501
  }
4386
- function Ee(e) {
4387
- _ = !!e, n.privacyPanel && (n.privacyPanel.hidden = !_), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", _ ? "true" : "false"), n.privacyChange.dataset.active = String(_)), _ && at();
4502
+ function oe(t) {
4503
+ Z = !!t, r.privacyPanel && (r.privacyPanel.hidden = !Z), r.privacyStack && (r.privacyStack.dataset.open = String(Z)), r.privacyChange && (r.privacyChange.setAttribute("aria-expanded", Z ? "true" : "false"), r.privacyChange.dataset.active = String(Z)), Z && se();
4388
4504
  }
4389
- function tt() {
4390
- if (!n.privacy || !n.privacyText || !n.privacyChange)
4505
+ function ie() {
4506
+ if (!r.privacy || !r.privacyText || !r.privacyChange)
4391
4507
  return;
4392
- const e = Ni({
4393
- diagnostics: V,
4394
- logs: I
4508
+ const t = qi({
4509
+ diagnostics: B,
4510
+ logs: $
4395
4511
  });
4396
- n.privacyText.textContent = e, n.privacyText.hidden = !e;
4397
- const t = V.length === 0 && I.length === 0;
4398
- n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
4399
- }
4400
- function pa(e, t, a) {
4401
- return `<label class="nf-privacy-toggle">
4402
- <span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
4403
- <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
4512
+ r.privacyText.textContent = t, r.privacyText.hidden = !t;
4513
+ const e = B.length === 0 && $.length === 0;
4514
+ r.privacySummary && (r.privacySummary.hidden = e), r.privacy.hidden = e, r.privacyChange.hidden = !1;
4515
+ }
4516
+ function fa(t, e, a) {
4517
+ const i = `${p(t ? "privacy.included" : "privacy.redacted")} ${a}`;
4518
+ return `<label class="nf-privacy-toggle" data-included="${t ? "true" : "false"}">
4519
+ <span class="nf-privacy-check">
4520
+ <input type="checkbox" ${t ? "checked" : ""} ${e ? 'data-indeterminate="true"' : ""} aria-label="${M(i)}">
4521
+ </span>
4404
4522
  </label>`;
4405
4523
  }
4406
- function zt(e, t, a, o, s, i = null) {
4407
- const r = pa(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
4408
- if (s) {
4409
- const c = l ? `${a}: ${l}` : a;
4410
- return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
4411
- <div class="nf-privacy-row-text">
4412
- <div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
4413
- </div>
4414
- ${r}
4415
- </div>`;
4416
- }
4417
- const u = i ?? x(l);
4418
- return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
4419
- <div class="nf-privacy-row-text">
4420
- <div class="nf-privacy-row-title">${x(a)}</div>
4421
- <div class="nf-privacy-row-detail">${u}</div>
4524
+ function je(t, e, a, o, i, s = null) {
4525
+ const n = fa(!i, !1, a), l = typeof o == "string" ? o : String(o || ""), u = i ? M(l) : s ?? M(l), d = l ? `${a}: ${l}` : a;
4526
+ return `<div class="nf-privacy-row" data-kind="${M(t)}" data-id="${M(e)}"${i ? ' data-redacted="true"' : ""}>
4527
+ ${n}
4528
+ <div class="nf-privacy-row-text"${i ? ` title="${M(d)}"` : ""}>
4529
+ <span class="nf-privacy-row-title">${M(a)}</span>
4530
+ <span class="nf-privacy-row-detail">${u}</span>
4422
4531
  </div>
4423
- ${r}
4424
4532
  </div>`;
4425
4533
  }
4426
- function Et(e, t, a, o) {
4534
+ function Pe(t, e, a, o) {
4427
4535
  if (!a.length)
4428
4536
  return "";
4429
- const s = Bi(a), i = s.checked && !s.indeterminate;
4430
- return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
4537
+ const i = Gi(a), s = !i.checked && !i.indeterminate;
4538
+ return `<section class="nf-privacy-section" data-section="${M(t)}"${s ? ' data-redacted="true"' : ""}>
4431
4539
  <div class="nf-privacy-section-head">
4432
- <h3 class="nf-privacy-section-title">${x(t)}</h3>
4433
- ${pa(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
4540
+ ${fa(i.checked, i.indeterminate, e)}
4541
+ <h3 class="nf-privacy-section-title">${M(e)}</h3>
4434
4542
  </div>
4435
- <div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
4543
+ <div class="nf-privacy-rows"${s ? " hidden" : ""}>${o}</div>
4436
4544
  </section>`;
4437
4545
  }
4438
- function at() {
4439
- if (!n.privacyScroll)
4546
+ function se() {
4547
+ if (!r.privacyScroll)
4440
4548
  return;
4441
- const e = V.map((a) => zt(
4549
+ const t = B.map((a) => je(
4442
4550
  "diagnostic",
4443
4551
  a.key,
4444
4552
  a.label,
4445
- Ki(a.value),
4553
+ _i(a.value),
4446
4554
  a.redacted
4447
- )).join(""), t = I.map((a) => {
4448
- const o = wi(a);
4449
- return zt(
4555
+ )).join(""), e = $.map((a) => {
4556
+ const o = zi(a);
4557
+ return je(
4450
4558
  "log",
4451
4559
  a.id,
4452
4560
  a.level,
4453
4561
  o,
4454
4562
  a.redacted,
4455
- a.redacted ? null : Si(a)
4563
+ a.redacted ? null : Ei(a)
4456
4564
  );
4457
4565
  }).join("");
4458
- n.privacyScroll.innerHTML = [
4459
- Et("diagnostics", p("privacy.section.diagnostics"), V, e),
4460
- I.length ? Et("logs", p("privacy.section.logs"), I, t) : ""
4461
- ].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4566
+ r.privacyScroll.innerHTML = [
4567
+ Pe("diagnostics", p("privacy.section.diagnostics"), B, t),
4568
+ $.length ? Pe("logs", p("privacy.section.logs"), $, e) : ""
4569
+ ].join(""), r.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4462
4570
  a.indeterminate = !0, a.removeAttribute("data-indeterminate");
4463
- }), tt();
4571
+ }), ie();
4464
4572
  }
4465
- function Es(e) {
4466
- const t = e.target;
4467
- if (!(t instanceof HTMLInputElement) || t.type !== "checkbox")
4573
+ function Us(t) {
4574
+ const e = t.target;
4575
+ if (!(e instanceof HTMLInputElement) || e.type !== "checkbox")
4468
4576
  return;
4469
- const a = t.closest("[data-section]"), o = t.closest(".nf-privacy-row"), s = t.checked;
4577
+ const a = e.closest("[data-section]"), o = e.closest(".nf-privacy-row"), i = !e.checked;
4470
4578
  if (o) {
4471
- const i = o.dataset.kind, r = o.dataset.id;
4472
- if (i === "diagnostic") {
4473
- const l = V.find((u) => u.key === r);
4474
- l && (l.redacted = s);
4475
- } else if (i === "log") {
4476
- const l = I.find((u) => u.id === r);
4477
- l && (l.redacted = s);
4579
+ const s = o.dataset.kind, n = o.dataset.id;
4580
+ if (s === "diagnostic") {
4581
+ const l = B.find((u) => u.key === n);
4582
+ l && (l.redacted = i);
4583
+ } else if (s === "log") {
4584
+ const l = $.find((u) => u.id === n);
4585
+ l && (l.redacted = i);
4478
4586
  }
4479
4587
  } else if (a) {
4480
- const i = a.dataset.section;
4481
- i === "diagnostics" ? (we(V, s), Ct({ diagnostics: s })) : i === "logs" && (we(I, s), Ct({ logs: s }));
4588
+ const s = a.dataset.section;
4589
+ s === "diagnostics" ? (Rt(B, i), Re({ diagnostics: i })) : s === "logs" && (Rt($, i), Re({ logs: i }));
4482
4590
  } else
4483
4591
  return;
4484
- at();
4592
+ se();
4485
4593
  }
4486
- async function ga() {
4487
- Ye(), ce || (ce = !0, da("onOpen")), ma(), se(), n.launcher.hidden = !0, A = Je(), G = { w: 0, h: 0 }, K = null, H = "", ie = "", M = null, j = null, E = null, J = ts(), Xe(J), de(null), Ue(!1), n.text.value = "", na(), S(""), zs();
4594
+ async function ya() {
4595
+ Xt(), pt || (pt = !0, ha("onOpen")), va(), lt(), r.launcher.hidden = !0, A = Yt(), _ = { w: 0, h: 0 }, H = null, q = "", nt = "", O = null, R = null, E = null, G = rs(), Qt(G), ht(null), ft(!1), r.text.value = "", da(), S(""), Ls();
4488
4596
  try {
4489
- aa(await Vt(ta())), S("");
4490
- } catch (t) {
4491
- H = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4597
+ ra(await Ne(sa())), S("");
4598
+ } catch (e) {
4599
+ q = "", S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4492
4600
  }
4493
- ge(), Ee(!1), tt(), n.dialog.hidden = !1, ee(), n.text.focus();
4601
+ vt(), oe(!1), ie(), r.dialog.hidden = !1, ot(), r.text.focus();
4494
4602
  }
4495
- function re() {
4496
- if (!f)
4603
+ function at() {
4604
+ if (!y)
4497
4605
  return;
4498
- const e = ce;
4499
- Q == null || Q.stop(), Ue(!1), Qt(), j = null, E = null, Qe(!1), ma(), Ee(!1), n.dialog.hidden = !0, n.stop.hidden = !0, Se(), e && (ce = !1, da("onClose"));
4606
+ const t = pt;
4607
+ W == null || W.stop(), ft(!1), et && (V == null || V.stop()), ct(!1), oa(), R = null, E = null, ee(!1), va(), oe(!1), r.dialog.hidden = !0, r.stop.hidden = !0, jt(), t && (pt = !1, ha("onClose"));
4500
4608
  }
4501
- function js(e = "") {
4502
- const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
4503
- if (!t || !a || !o || !s)
4609
+ function Ts(t = "") {
4610
+ const e = r.dialog, a = r.panel, o = r.panelBody, i = r.successMsg, s = r.successLink, n = String(t || "").trim(), l = !!(c.displayLink && n);
4611
+ if (!e || !a || !o || !i)
4504
4612
  return Promise.resolve(!1);
4505
- Pe = !0, xe = l, S("");
4506
- const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
4507
- 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) {
4613
+ gt = !0, mt = l, S("");
4614
+ const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, d = a.getBoundingClientRect();
4615
+ if (o.hidden = !0, i.hidden = !1, e.classList.add("nf-success"), e.classList.toggle("nf-success-sticky", l), e.style.opacity = "1", s && (l ? (s.hidden = !1, s.href = n) : (s.hidden = !0, s.removeAttribute("href"))), l) {
4508
4616
  if (u)
4509
4617
  return Promise.resolve(!0);
4510
- const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
4511
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
4618
+ const w = a.getBoundingClientRect(), b = w.width > 0 ? d.width / w.width : 1, z = w.height > 0 ? d.height / w.height : 1;
4619
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((j) => {
4512
4620
  let T = !1;
4513
- const $ = () => {
4514
- T || (T = !0, a.removeEventListener("transitionend", P), R(!0));
4621
+ const N = () => {
4622
+ T || (T = !0, a.removeEventListener("transitionend", P), j(!0));
4515
4623
  }, P = (m) => {
4516
- m.target !== a || m.propertyName !== "transform" || $();
4624
+ m.target !== a || m.propertyName !== "transform" || N();
4517
4625
  };
4518
4626
  a.addEventListener("transitionend", P), requestAnimationFrame(() => {
4519
4627
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4520
- }), window.setTimeout($, 700);
4628
+ }), window.setTimeout(N, 700);
4521
4629
  });
4522
4630
  }
4523
4631
  if (u)
4524
4632
  return new Promise((w) => {
4525
4633
  window.setTimeout(() => w(!1), 1e3);
4526
4634
  });
4527
- const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
4528
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
4635
+ const g = a.getBoundingClientRect(), k = g.width > 0 ? d.width / g.width : 1, v = g.height > 0 ? d.height / g.height : 1;
4636
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${k}, ${v})`, a.getBoundingClientRect(), new Promise((w) => {
4529
4637
  let b = !1;
4530
4638
  const z = () => {
4531
- b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
4532
- t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4639
+ b || (b = !0, a.removeEventListener("transitionend", j), window.setTimeout(() => {
4640
+ e.style.transition = "opacity 0.28s ease", e.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4533
4641
  }, 1e3));
4534
- }, R = (T) => {
4642
+ }, j = (T) => {
4535
4643
  T.target !== a || T.propertyName !== "transform" || z();
4536
4644
  };
4537
- a.addEventListener("transitionend", R), requestAnimationFrame(() => {
4645
+ a.addEventListener("transitionend", j), requestAnimationFrame(() => {
4538
4646
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4539
4647
  }), window.setTimeout(z, 700);
4540
4648
  });
4541
4649
  }
4542
- function ma() {
4543
- Pe = !1, xe = !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")));
4650
+ function va() {
4651
+ gt = !1, mt = !1, r.dialog && (r.dialog.classList.remove("nf-success", "nf-success-sticky"), r.dialog.style.opacity = "", r.dialog.style.transition = "", r.panel && (r.panel.style.transform = "", r.panel.style.transition = "", r.panel.style.transformOrigin = ""), r.panelBody && (r.panelBody.hidden = !1), r.successMsg && (r.successMsg.hidden = !0), r.successLink && (r.successLink.hidden = !0, r.successLink.removeAttribute("href")));
4544
4652
  }
4545
- function Rs(e = {}) {
4546
- N = { ...N, ...fi(e) }, na();
4653
+ function Fs(t = {}) {
4654
+ K = { ...K, ...bi(t) }, da();
4547
4655
  }
4548
- async function ha() {
4549
- var t, a;
4550
- if (Ye(), Ve)
4656
+ async function ka() {
4657
+ var e, a;
4658
+ if (Xt(), $t)
4551
4659
  return null;
4552
- const e = n.text.value.trim();
4553
- if (!e && !B() && !K)
4660
+ const t = r.text.value.trim();
4661
+ if (!t && !I() && !H)
4554
4662
  return S(p("status.emptyReport")), null;
4555
- if (!d.endpoint || !d.projectKey)
4663
+ if (!c.endpoint || !c.projectKey)
4556
4664
  return S(p("status.missingConfig")), null;
4557
- Ve = !0, jt(!0), S(p("status.submitting"), !0);
4665
+ $t = !0, xe(!0), S(p("status.submitting"), !0);
4558
4666
  try {
4559
- const o = vs(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Pi(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = Hi({
4667
+ const o = Cs(), i = A.crop(), s = A.list(), n = A.isCropped(), l = n ? Ti(s, i) : s, u = n ? { x: 0, y: 0, w: 1, h: 1 } : i, d = Wi({
4560
4668
  author: o,
4561
- diagnostics: V,
4562
- logs: I
4669
+ diagnostics: B,
4670
+ logs: $
4563
4671
  }), g = {
4564
4672
  width: typeof screen < "u" ? screen.width : null,
4565
4673
  height: typeof screen < "u" ? screen.height : null,
4566
4674
  dpr: window.devicePixelRatio || 1
4567
- }, v = [];
4568
- let k = 2048, w = null, b = null;
4569
- B() && (b = await vt(H, {
4570
- crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4571
- maxEdge: k
4675
+ }, k = [];
4676
+ let v = 2048, w = null, b = null;
4677
+ I() && (b = await we(q, {
4678
+ crop: n ? i : { x: 0, y: 0, w: 1, h: 1 },
4679
+ maxEdge: v
4572
4680
  }));
4573
4681
  for (let z = 1; z <= 3; z += 1) {
4574
- const R = z === 3 || !b, T = R ? {
4682
+ const j = z === 3 || !b, T = j ? {
4575
4683
  ...b ? { width: b.width, height: b.height, mime: b.mime } : {},
4576
4684
  attempt: z,
4577
4685
  omitted: !0
@@ -4580,22 +4688,22 @@ async function ha() {
4580
4688
  height: b.height,
4581
4689
  mime: b.mime,
4582
4690
  attempt: z
4583
- }, $ = {
4584
- ...c,
4691
+ }, N = {
4692
+ ...d,
4585
4693
  screen: g,
4586
4694
  screenshotMeta: T
4587
4695
  };
4588
- R && B() && ($.screenshotError = {
4696
+ j && I() && (N.screenshotError = {
4589
4697
  message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
4590
- attempts: [...v]
4698
+ attempts: [...k]
4591
4699
  });
4592
4700
  const P = new FormData();
4593
- P.append("message", e), P.append("kind", J), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify($)), 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");
4701
+ P.append("message", t), P.append("kind", G), P.append("version", c.version || "0.0.0"), P.append("author", o), c.name && P.append("name", c.name), P.append("context", JSON.stringify(N)), P.append("annotations", JSON.stringify(l)), P.append("crop", JSON.stringify(u)), Array.isArray(c.targets) && P.append("targets", JSON.stringify(c.targets)), !j && b && P.append("screenshot", b.blob, `screenshot.${b.ext}`), H && P.append("recording", H, "recording.webm");
4594
4702
  try {
4595
- const m = await fetch(`${d.endpoint}/v1/reports`, {
4703
+ const m = await fetch(`${c.endpoint}/v1/reports`, {
4596
4704
  method: "POST",
4597
4705
  headers: {
4598
- "X-Notefully-Key": d.projectKey
4706
+ "X-Notefully-Key": c.projectKey
4599
4707
  },
4600
4708
  body: P
4601
4709
  });
@@ -4606,25 +4714,25 @@ async function ha() {
4606
4714
  C = null;
4607
4715
  }
4608
4716
  if (!m.ok) {
4609
- const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4610
- throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
4717
+ const ut = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4718
+ throw ut.status = m.status, ut.code = C == null ? void 0 : C.code, ut.json = C, ut;
4611
4719
  }
4612
- return R && B() && S(p("status.submitWithoutImage"), !0), await js((C == null ? void 0 : C.trackerUrl) || "") || re(), C;
4720
+ return j && I() && S(p("status.submitWithoutImage"), !0), await Ts((C == null ? void 0 : C.trackerUrl) || "") || at(), C;
4613
4721
  } catch (m) {
4614
- if (w = m, v.push({
4722
+ if (w = m, k.push({
4615
4723
  attempt: z,
4616
- maxEdge: R ? null : k,
4724
+ maxEdge: j ? null : v,
4617
4725
  status: (m == null ? void 0 : m.status) || null,
4618
4726
  code: (m == null ? void 0 : m.code) || null,
4619
4727
  message: String((m == null ? void 0 : m.message) || m)
4620
- }), R || !b)
4621
- throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4622
- if (!Oi(m, (m == null ? void 0 : m.json) || null))
4728
+ }), j || !b)
4729
+ throw S(((e = m == null ? void 0 : m.json) == null ? void 0 : e.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4730
+ if (!Vi(m, (m == null ? void 0 : m.json) || null))
4623
4731
  throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4624
4732
  if (z === 1) {
4625
- S(p("status.submitTooLarge"), !0), k = Fi(k), b = await vt(H, {
4626
- crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4627
- maxEdge: k
4733
+ S(p("status.submitTooLarge"), !0), v = Ii(v), b = await we(q, {
4734
+ crop: n ? i : { x: 0, y: 0, w: 1, h: 1 },
4735
+ maxEdge: v
4628
4736
  });
4629
4737
  continue;
4630
4738
  }
@@ -4633,42 +4741,42 @@ async function ha() {
4633
4741
  }
4634
4742
  throw w || new Error(p("status.submitFailed"));
4635
4743
  } finally {
4636
- Ve = !1, jt(!1);
4744
+ $t = !1, xe(!1);
4637
4745
  }
4638
4746
  }
4639
- function jt(e) {
4640
- n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
4641
- }
4642
- function Ps() {
4643
- re(), document.removeEventListener("keydown", ua), f == null || f.remove(), f = null, n = {};
4644
- }
4645
- const Te = {
4646
- init: Ss,
4647
- configure: et,
4648
- setTheme: As,
4649
- setVisible: Cs,
4650
- open: ga,
4651
- close: re,
4652
- isOpen: ks,
4653
- getLocale: bs,
4654
- setLocale: ws,
4655
- identify: Rs,
4656
- submit: ha,
4657
- destroy: Ps
4747
+ function xe(t) {
4748
+ r.submit && (r.submit.disabled = !!t, r.submit.setAttribute("aria-busy", t ? "true" : "false"));
4749
+ }
4750
+ function Ms() {
4751
+ at(), document.removeEventListener("keydown", ga), y == null || y.remove(), y = null, r = {};
4752
+ }
4753
+ const Mt = {
4754
+ init: js,
4755
+ configure: ae,
4756
+ setTheme: Ps,
4757
+ setVisible: xs,
4758
+ open: ya,
4759
+ close: at,
4760
+ isOpen: zs,
4761
+ getLocale: Es,
4762
+ setLocale: Rs,
4763
+ identify: Fs,
4764
+ submit: ka,
4765
+ destroy: Ms
4658
4766
  };
4659
- typeof window < "u" && (window.Notefully = Te);
4767
+ typeof window < "u" && (window.Notefully = Mt);
4660
4768
  export {
4661
- re as close,
4662
- et as configure,
4663
- Te as default,
4664
- Ps as destroy,
4665
- bs as getLocaleTag,
4666
- Rs as identify,
4667
- Ss as init,
4668
- ks as isOpen,
4669
- ga as open,
4670
- ws as setLocale,
4671
- As as setTheme,
4672
- Cs as setVisible,
4673
- ha as submit
4769
+ at as close,
4770
+ ae as configure,
4771
+ Mt as default,
4772
+ Ms as destroy,
4773
+ Es as getLocaleTag,
4774
+ Fs as identify,
4775
+ js as init,
4776
+ zs as isOpen,
4777
+ ya as open,
4778
+ Rs as setLocale,
4779
+ Ps as setTheme,
4780
+ xs as setVisible,
4781
+ ka as submit
4674
4782
  };