@makefully/notefully 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/notefully.css +1 -1
- package/dist/notefully.iife.js +17 -17
- package/dist/notefully.js +379 -366
- package/package.json +1 -1
package/dist/notefully.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ye(t, e) {
|
|
2
2
|
if (t.match(/^[a-z]+:\/\//i))
|
|
3
3
|
return t;
|
|
4
4
|
if (t.match(/^\/\//))
|
|
@@ -8,7 +8,7 @@ function me(t, e) {
|
|
|
8
8
|
const n = document.implementation.createHTMLDocument(), r = n.createElement("base"), o = n.createElement("a");
|
|
9
9
|
return n.head.appendChild(r), n.body.appendChild(o), e && (r.href = e), o.href = t, o.href;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const ge = /* @__PURE__ */ (() => {
|
|
12
12
|
let t = 0;
|
|
13
13
|
const e = () => (
|
|
14
14
|
// eslint-disable-next-line no-bitwise
|
|
@@ -16,33 +16,33 @@ const ye = /* @__PURE__ */ (() => {
|
|
|
16
16
|
);
|
|
17
17
|
return () => (t += 1, `u${e()}${t}`);
|
|
18
18
|
})();
|
|
19
|
-
function
|
|
19
|
+
function D(t) {
|
|
20
20
|
const e = [];
|
|
21
21
|
for (let n = 0, r = t.length; n < r; n++)
|
|
22
22
|
e.push(t[n]);
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
|
-
let
|
|
26
|
-
function
|
|
27
|
-
return
|
|
25
|
+
let N = null;
|
|
26
|
+
function Wt(t = {}) {
|
|
27
|
+
return N || (t.includeStyleProperties ? (N = t.includeStyleProperties, N) : (N = D(window.getComputedStyle(document.documentElement)), N));
|
|
28
28
|
}
|
|
29
29
|
function K(t, e) {
|
|
30
30
|
const r = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
|
|
31
31
|
return r ? parseFloat(r.replace("px", "")) : 0;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function we(t) {
|
|
34
34
|
const e = K(t, "border-left-width"), n = K(t, "border-right-width");
|
|
35
35
|
return t.clientWidth + e + n;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function be(t) {
|
|
38
38
|
const e = K(t, "border-top-width"), n = K(t, "border-bottom-width");
|
|
39
39
|
return t.clientHeight + e + n;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const n = e.width ||
|
|
41
|
+
function qt(t, e = {}) {
|
|
42
|
+
const n = e.width || we(t), r = e.height || be(t);
|
|
43
43
|
return { width: n, height: r };
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Se() {
|
|
46
46
|
let t, e;
|
|
47
47
|
try {
|
|
48
48
|
e = process;
|
|
@@ -65,12 +65,12 @@ function G(t) {
|
|
|
65
65
|
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = t;
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
68
|
+
async function xe(t) {
|
|
69
69
|
return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
71
|
+
async function Ee(t, e, n) {
|
|
72
72
|
const r = "http://www.w3.org/2000/svg", o = document.createElementNS(r, "svg"), i = document.createElementNS(r, "foreignObject");
|
|
73
|
-
return o.setAttribute("width", `${e}`), o.setAttribute("height", `${n}`), o.setAttribute("viewBox", `0 0 ${e} ${n}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), o.appendChild(i), i.appendChild(t),
|
|
73
|
+
return o.setAttribute("width", `${e}`), o.setAttribute("height", `${n}`), o.setAttribute("viewBox", `0 0 ${e} ${n}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), o.appendChild(i), i.appendChild(t), xe(o);
|
|
74
74
|
}
|
|
75
75
|
const x = (t, e) => {
|
|
76
76
|
if (t instanceof e)
|
|
@@ -78,67 +78,67 @@ const x = (t, e) => {
|
|
|
78
78
|
const n = Object.getPrototypeOf(t);
|
|
79
79
|
return n === null ? !1 : n.constructor.name === e.name || x(n, e);
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function Ce(t) {
|
|
82
82
|
const e = t.getPropertyValue("content");
|
|
83
83
|
return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function Me(t, e) {
|
|
86
|
+
return Wt(e).map((n) => {
|
|
87
87
|
const r = t.getPropertyValue(n), o = t.getPropertyPriority(n);
|
|
88
88
|
return `${n}: ${r}${o ? " !important" : ""};`;
|
|
89
89
|
}).join(" ");
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const o = `.${t}:${e}`, i = n.cssText ?
|
|
91
|
+
function Le(t, e, n, r) {
|
|
92
|
+
const o = `.${t}:${e}`, i = n.cssText ? Ce(n) : Me(n, r);
|
|
93
93
|
return document.createTextNode(`${o}{${i}}`);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Rt(t, e, n, r) {
|
|
96
96
|
const o = window.getComputedStyle(t, n), i = o.getPropertyValue("content");
|
|
97
97
|
if (i === "" || i === "none")
|
|
98
98
|
return;
|
|
99
|
-
const a =
|
|
99
|
+
const a = ge();
|
|
100
100
|
try {
|
|
101
101
|
e.className = `${e.className} ${a}`;
|
|
102
102
|
} catch {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
const s = document.createElement("style");
|
|
106
|
-
s.appendChild(
|
|
106
|
+
s.appendChild(Le(a, n, o, r)), e.appendChild(s);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
108
|
+
function $e(t, e, n) {
|
|
109
|
+
Rt(t, e, ":before", n), Rt(t, e, ":after", n);
|
|
110
110
|
}
|
|
111
|
-
const
|
|
112
|
-
woff:
|
|
113
|
-
woff2:
|
|
111
|
+
const At = "application/font-woff", Pt = "image/jpeg", Re = {
|
|
112
|
+
woff: At,
|
|
113
|
+
woff2: At,
|
|
114
114
|
ttf: "application/font-truetype",
|
|
115
115
|
eot: "application/vnd.ms-fontobject",
|
|
116
116
|
png: "image/png",
|
|
117
|
-
jpg:
|
|
118
|
-
jpeg:
|
|
117
|
+
jpg: Pt,
|
|
118
|
+
jpeg: Pt,
|
|
119
119
|
gif: "image/gif",
|
|
120
120
|
tiff: "image/tiff",
|
|
121
121
|
svg: "image/svg+xml",
|
|
122
122
|
webp: "image/webp"
|
|
123
123
|
};
|
|
124
|
-
function
|
|
124
|
+
function Ae(t) {
|
|
125
125
|
const e = /\.([^./]*?)$/g.exec(t);
|
|
126
126
|
return e ? e[1] : "";
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const e =
|
|
130
|
-
return
|
|
128
|
+
function xt(t) {
|
|
129
|
+
const e = Ae(t).toLowerCase();
|
|
130
|
+
return Re[e] || "";
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Pe(t) {
|
|
133
133
|
return t.split(/,/)[1];
|
|
134
134
|
}
|
|
135
135
|
function ft(t) {
|
|
136
136
|
return t.search(/^(data:)/) !== -1;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Te(t, e) {
|
|
139
139
|
return `data:${e};base64,${t}`;
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
141
|
+
async function zt(t, e, n) {
|
|
142
142
|
const r = await fetch(t, e);
|
|
143
143
|
if (r.status === 404)
|
|
144
144
|
throw new Error(`Resource "${r.url}" not found`);
|
|
@@ -155,19 +155,19 @@ async function qt(t, e, n) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
const ct = {};
|
|
158
|
-
function
|
|
158
|
+
function ke(t, e, n) {
|
|
159
159
|
let r = t.replace(/\?.*/, "");
|
|
160
160
|
return n && (r = t), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), e ? `[${e}]${r}` : r;
|
|
161
161
|
}
|
|
162
|
-
async function
|
|
163
|
-
const r =
|
|
162
|
+
async function Et(t, e, n) {
|
|
163
|
+
const r = ke(t, e, n.includeQueryParams);
|
|
164
164
|
if (ct[r] != null)
|
|
165
165
|
return ct[r];
|
|
166
166
|
n.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
167
167
|
let o;
|
|
168
168
|
try {
|
|
169
|
-
const i = await
|
|
170
|
-
o =
|
|
169
|
+
const i = await zt(t, n.fetchRequestInit, ({ res: a, result: s }) => (e || (e = a.headers.get("Content-Type") || ""), Pe(s)));
|
|
170
|
+
o = Te(i, e);
|
|
171
171
|
} catch (i) {
|
|
172
172
|
o = n.imagePlaceholder || "";
|
|
173
173
|
let a = `Failed to fetch resource: ${t}`;
|
|
@@ -175,21 +175,21 @@ async function xt(t, e, n) {
|
|
|
175
175
|
}
|
|
176
176
|
return ct[r] = o, o;
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
178
|
+
async function Ie(t) {
|
|
179
179
|
const e = t.toDataURL();
|
|
180
180
|
return e === "data:," ? t.cloneNode(!1) : G(e);
|
|
181
181
|
}
|
|
182
|
-
async function
|
|
182
|
+
async function Oe(t, e) {
|
|
183
183
|
if (t.currentSrc) {
|
|
184
184
|
const i = document.createElement("canvas"), a = i.getContext("2d");
|
|
185
185
|
i.width = t.clientWidth, i.height = t.clientHeight, a == null || a.drawImage(t, 0, 0, i.width, i.height);
|
|
186
186
|
const s = i.toDataURL();
|
|
187
187
|
return G(s);
|
|
188
188
|
}
|
|
189
|
-
const n = t.poster, r =
|
|
189
|
+
const n = t.poster, r = xt(n), o = await Et(n, r, e);
|
|
190
190
|
return G(o);
|
|
191
191
|
}
|
|
192
|
-
async function
|
|
192
|
+
async function He(t, e) {
|
|
193
193
|
var n;
|
|
194
194
|
try {
|
|
195
195
|
if (!((n = t == null ? void 0 : t.contentDocument) === null || n === void 0) && n.body)
|
|
@@ -198,42 +198,42 @@ async function Oe(t, e) {
|
|
|
198
198
|
}
|
|
199
199
|
return t.cloneNode(!1);
|
|
200
200
|
}
|
|
201
|
-
async function
|
|
202
|
-
return x(t, HTMLCanvasElement) ?
|
|
201
|
+
async function De(t, e) {
|
|
202
|
+
return x(t, HTMLCanvasElement) ? Ie(t) : x(t, HTMLVideoElement) ? Oe(t, e) : x(t, HTMLIFrameElement) ? He(t, e) : t.cloneNode(Xt(t));
|
|
203
203
|
}
|
|
204
|
-
const
|
|
205
|
-
async function
|
|
204
|
+
const Fe = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT", Xt = (t) => t.tagName != null && t.tagName.toUpperCase() === "SVG";
|
|
205
|
+
async function Ue(t, e, n) {
|
|
206
206
|
var r, o;
|
|
207
|
-
if (
|
|
207
|
+
if (Xt(e))
|
|
208
208
|
return e;
|
|
209
209
|
let i = [];
|
|
210
|
-
return
|
|
210
|
+
return Fe(t) && t.assignedNodes ? i = D(t.assignedNodes()) : x(t, HTMLIFrameElement) && (!((r = t.contentDocument) === null || r === void 0) && r.body) ? i = D(t.contentDocument.body.childNodes) : i = D(((o = t.shadowRoot) !== null && o !== void 0 ? o : t).childNodes), i.length === 0 || x(t, HTMLVideoElement) || await i.reduce((a, s) => a.then(() => nt(s, n)).then((l) => {
|
|
211
211
|
l && e.appendChild(l);
|
|
212
212
|
}), Promise.resolve()), e;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function je(t, e, n) {
|
|
215
215
|
const r = e.style;
|
|
216
216
|
if (!r)
|
|
217
217
|
return;
|
|
218
218
|
const o = window.getComputedStyle(t);
|
|
219
|
-
o.cssText ? (r.cssText = o.cssText, r.transformOrigin = o.transformOrigin) :
|
|
219
|
+
o.cssText ? (r.cssText = o.cssText, r.transformOrigin = o.transformOrigin) : Wt(n).forEach((i) => {
|
|
220
220
|
let a = o.getPropertyValue(i);
|
|
221
221
|
i === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - 0.1}px`), x(t, HTMLIFrameElement) && i === "display" && a === "inline" && (a = "block"), i === "d" && e.getAttribute("d") && (a = `path(${e.getAttribute("d")})`), r.setProperty(i, a, o.getPropertyPriority(i));
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function _e(t, e) {
|
|
225
225
|
x(t, HTMLTextAreaElement) && (e.innerHTML = t.value), x(t, HTMLInputElement) && e.setAttribute("value", t.value);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Ne(t, e) {
|
|
228
228
|
if (x(t, HTMLSelectElement)) {
|
|
229
229
|
const r = Array.from(e.children).find((o) => t.value === o.getAttribute("value"));
|
|
230
230
|
r && r.setAttribute("selected", "");
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return x(e, Element) && (
|
|
233
|
+
function Be(t, e, n) {
|
|
234
|
+
return x(e, Element) && (je(t, e, n), $e(t, e, n), _e(t, e), Ne(t, e)), e;
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
236
|
+
async function Ve(t, e) {
|
|
237
237
|
const n = t.querySelectorAll ? t.querySelectorAll("use") : [];
|
|
238
238
|
if (n.length === 0)
|
|
239
239
|
return t;
|
|
@@ -258,30 +258,30 @@ async function Be(t, e) {
|
|
|
258
258
|
return t;
|
|
259
259
|
}
|
|
260
260
|
async function nt(t, e, n) {
|
|
261
|
-
return !n && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((r) =>
|
|
261
|
+
return !n && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((r) => De(r, e)).then((r) => Ue(t, r, e)).then((r) => Be(t, r, e)).then((r) => Ve(r, e));
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
function
|
|
263
|
+
const Yt = /url\((['"]?)([^'"]+?)\1\)/g, We = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, qe = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
264
|
+
function ze(t) {
|
|
265
265
|
const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
266
266
|
return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Xe(t) {
|
|
269
269
|
const e = [];
|
|
270
|
-
return t.replace(
|
|
270
|
+
return t.replace(Yt, (n, r, o) => (e.push(o), n)), e.filter((n) => !ft(n));
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function Ye(t, e, n, r, o) {
|
|
273
273
|
try {
|
|
274
|
-
const i = n ?
|
|
274
|
+
const i = n ? ye(e, n) : e, a = xt(e);
|
|
275
275
|
let s;
|
|
276
|
-
return o || (s = await
|
|
276
|
+
return o || (s = await Et(i, a, r)), t.replace(ze(e), `$1${s}$3`);
|
|
277
277
|
} catch {
|
|
278
278
|
}
|
|
279
279
|
return t;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return e ? t.replace(
|
|
281
|
+
function Ke(t, { preferredFontFormat: e }) {
|
|
282
|
+
return e ? t.replace(qe, (n) => {
|
|
283
283
|
for (; ; ) {
|
|
284
|
-
const [r, , o] =
|
|
284
|
+
const [r, , o] = We.exec(n) || [];
|
|
285
285
|
if (!o)
|
|
286
286
|
return "";
|
|
287
287
|
if (o === e)
|
|
@@ -289,32 +289,32 @@ function Ye(t, { preferredFontFormat: e }) {
|
|
|
289
289
|
}
|
|
290
290
|
}) : t;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return t.search(
|
|
292
|
+
function Kt(t) {
|
|
293
|
+
return t.search(Yt) !== -1;
|
|
294
294
|
}
|
|
295
|
-
async function
|
|
296
|
-
if (!
|
|
295
|
+
async function Gt(t, e, n) {
|
|
296
|
+
if (!Kt(t))
|
|
297
297
|
return t;
|
|
298
|
-
const r =
|
|
299
|
-
return
|
|
298
|
+
const r = Ke(t, n);
|
|
299
|
+
return Xe(r).reduce((i, a) => i.then((s) => Ye(s, a, e, n)), Promise.resolve(r));
|
|
300
300
|
}
|
|
301
|
-
async function
|
|
301
|
+
async function B(t, e, n) {
|
|
302
302
|
var r;
|
|
303
303
|
const o = (r = e.style) === null || r === void 0 ? void 0 : r.getPropertyValue(t);
|
|
304
304
|
if (o) {
|
|
305
|
-
const i = await
|
|
305
|
+
const i = await Gt(o, null, n);
|
|
306
306
|
return e.style.setProperty(t, i, e.style.getPropertyPriority(t)), !0;
|
|
307
307
|
}
|
|
308
308
|
return !1;
|
|
309
309
|
}
|
|
310
|
-
async function Ke(t, e) {
|
|
311
|
-
await N("background", t, e) || await N("background-image", t, e), await N("mask", t, e) || await N("-webkit-mask", t, e) || await N("mask-image", t, e) || await N("-webkit-mask-image", t, e);
|
|
312
|
-
}
|
|
313
310
|
async function Ge(t, e) {
|
|
311
|
+
await B("background", t, e) || await B("background-image", t, e), await B("mask", t, e) || await B("-webkit-mask", t, e) || await B("mask-image", t, e) || await B("-webkit-mask-image", t, e);
|
|
312
|
+
}
|
|
313
|
+
async function Je(t, e) {
|
|
314
314
|
const n = x(t, HTMLImageElement);
|
|
315
315
|
if (!(n && !ft(t.src)) && !(x(t, SVGImageElement) && !ft(t.href.baseVal)))
|
|
316
316
|
return;
|
|
317
|
-
const r = n ? t.src : t.href.baseVal, o = await
|
|
317
|
+
const r = n ? t.src : t.href.baseVal, o = await Et(r, xt(r), e);
|
|
318
318
|
await new Promise((i, a) => {
|
|
319
319
|
t.onload = i, t.onerror = e.onImageErrorHandler ? (...l) => {
|
|
320
320
|
try {
|
|
@@ -327,14 +327,14 @@ async function Ge(t, e) {
|
|
|
327
327
|
s.decode && (s.decode = i), s.loading === "lazy" && (s.loading = "eager"), n ? (t.srcset = "", t.src = o) : t.href.baseVal = o;
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
331
|
-
const r =
|
|
330
|
+
async function Qe(t, e) {
|
|
331
|
+
const r = D(t.childNodes).map((o) => Jt(o, e));
|
|
332
332
|
await Promise.all(r).then(() => t);
|
|
333
333
|
}
|
|
334
|
-
async function
|
|
335
|
-
x(t, Element) && (await
|
|
334
|
+
async function Jt(t, e) {
|
|
335
|
+
x(t, Element) && (await Ge(t, e), await Je(t, e), await Qe(t, e));
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function Ze(t, e) {
|
|
338
338
|
const { style: n } = t;
|
|
339
339
|
e.backgroundColor && (n.backgroundColor = e.backgroundColor), e.width && (n.width = `${e.width}px`), e.height && (n.height = `${e.height}px`);
|
|
340
340
|
const r = e.style;
|
|
@@ -342,23 +342,23 @@ function Qe(t, e) {
|
|
|
342
342
|
n[o] = r[o];
|
|
343
343
|
}), t;
|
|
344
344
|
}
|
|
345
|
-
const
|
|
346
|
-
async function
|
|
347
|
-
let e =
|
|
345
|
+
const Tt = {};
|
|
346
|
+
async function kt(t) {
|
|
347
|
+
let e = Tt[t];
|
|
348
348
|
if (e != null)
|
|
349
349
|
return e;
|
|
350
350
|
const r = await (await fetch(t)).text();
|
|
351
|
-
return e = { url: t, cssText: r },
|
|
351
|
+
return e = { url: t, cssText: r }, Tt[t] = e, e;
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
353
|
+
async function It(t, e) {
|
|
354
354
|
let n = t.cssText;
|
|
355
355
|
const r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (a) => {
|
|
356
356
|
let s = a.replace(r, "$1");
|
|
357
|
-
return s.startsWith("https://") || (s = new URL(s, t.url).href),
|
|
357
|
+
return s.startsWith("https://") || (s = new URL(s, t.url).href), zt(s, e.fetchRequestInit, ({ result: l }) => (n = n.replace(a, `url(${l})`), [a, l]));
|
|
358
358
|
});
|
|
359
359
|
return Promise.all(i).then(() => n);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ot(t) {
|
|
362
362
|
if (t == null)
|
|
363
363
|
return [];
|
|
364
364
|
const e = [], n = /(\/\*[\s\S]*?\*\/)/gi;
|
|
@@ -384,21 +384,21 @@ function It(t) {
|
|
|
384
384
|
}
|
|
385
385
|
return e;
|
|
386
386
|
}
|
|
387
|
-
async function
|
|
387
|
+
async function tn(t, e) {
|
|
388
388
|
const n = [], r = [];
|
|
389
389
|
return t.forEach((o) => {
|
|
390
390
|
if ("cssRules" in o)
|
|
391
391
|
try {
|
|
392
|
-
|
|
392
|
+
D(o.cssRules || []).forEach((i, a) => {
|
|
393
393
|
if (i.type === CSSRule.IMPORT_RULE) {
|
|
394
394
|
let s = a + 1;
|
|
395
|
-
const l = i.href, u =
|
|
395
|
+
const l = i.href, u = kt(l).then((d) => It(d, e)).then((d) => Ot(d).forEach((m) => {
|
|
396
396
|
try {
|
|
397
|
-
o.insertRule(
|
|
398
|
-
} catch (
|
|
397
|
+
o.insertRule(m, m.startsWith("@import") ? s += 1 : o.cssRules.length);
|
|
398
|
+
} catch (p) {
|
|
399
399
|
console.error("Error inserting rule from remote css", {
|
|
400
|
-
rule:
|
|
401
|
-
error:
|
|
400
|
+
rule: m,
|
|
401
|
+
error: p
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
})).catch((d) => {
|
|
@@ -409,7 +409,7 @@ async function Ze(t, e) {
|
|
|
409
409
|
});
|
|
410
410
|
} catch (i) {
|
|
411
411
|
const a = t.find((s) => s.href == null) || document.styleSheets[0];
|
|
412
|
-
o.href != null && r.push(
|
|
412
|
+
o.href != null && r.push(kt(o.href).then((s) => It(s, e)).then((s) => Ot(s).forEach((l) => {
|
|
413
413
|
a.insertRule(l, a.cssRules.length);
|
|
414
414
|
})).catch((s) => {
|
|
415
415
|
console.error("Error loading remote stylesheet", s);
|
|
@@ -418,7 +418,7 @@ async function Ze(t, e) {
|
|
|
418
418
|
}), Promise.all(r).then(() => (t.forEach((o) => {
|
|
419
419
|
if ("cssRules" in o)
|
|
420
420
|
try {
|
|
421
|
-
|
|
421
|
+
D(o.cssRules || []).forEach((i) => {
|
|
422
422
|
n.push(i);
|
|
423
423
|
});
|
|
424
424
|
} catch (i) {
|
|
@@ -426,60 +426,60 @@ async function Ze(t, e) {
|
|
|
426
426
|
}
|
|
427
427
|
}), n));
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) =>
|
|
429
|
+
function en(t) {
|
|
430
|
+
return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Kt(e.style.getPropertyValue("src")));
|
|
431
431
|
}
|
|
432
|
-
async function
|
|
432
|
+
async function nn(t, e) {
|
|
433
433
|
if (t.ownerDocument == null)
|
|
434
434
|
throw new Error("Provided element is not within a Document");
|
|
435
|
-
const n =
|
|
436
|
-
return
|
|
435
|
+
const n = D(t.ownerDocument.styleSheets), r = await tn(n, e);
|
|
436
|
+
return en(r);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function Qt(t) {
|
|
439
439
|
return t.trim().replace(/["']/g, "");
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function rn(t) {
|
|
442
442
|
const e = /* @__PURE__ */ new Set();
|
|
443
443
|
function n(r) {
|
|
444
444
|
(r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((i) => {
|
|
445
|
-
e.add(
|
|
445
|
+
e.add(Qt(i));
|
|
446
446
|
}), Array.from(r.children).forEach((i) => {
|
|
447
447
|
i instanceof HTMLElement && n(i);
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
return n(t), e;
|
|
451
451
|
}
|
|
452
|
-
async function
|
|
453
|
-
const n = await
|
|
454
|
-
return (await Promise.all(n.filter((i) => r.has(
|
|
452
|
+
async function on(t, e) {
|
|
453
|
+
const n = await nn(t, e), r = rn(t);
|
|
454
|
+
return (await Promise.all(n.filter((i) => r.has(Qt(i.style.fontFamily))).map((i) => {
|
|
455
455
|
const a = i.parentStyleSheet ? i.parentStyleSheet.href : null;
|
|
456
|
-
return
|
|
456
|
+
return Gt(i.cssText, a, e);
|
|
457
457
|
}))).join(`
|
|
458
458
|
`);
|
|
459
459
|
}
|
|
460
|
-
async function
|
|
461
|
-
const n = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await
|
|
460
|
+
async function an(t, e) {
|
|
461
|
+
const n = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await on(t, e);
|
|
462
462
|
if (n) {
|
|
463
463
|
const r = document.createElement("style"), o = document.createTextNode(n);
|
|
464
464
|
r.appendChild(o), t.firstChild ? t.insertBefore(r, t.firstChild) : t.appendChild(r);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
async function an(t, e = {}) {
|
|
468
|
-
const { width: n, height: r } = Wt(t, e), o = await nt(t, e, !0);
|
|
469
|
-
return await on(o, e), await Gt(o, e), Qe(o, e), await xe(o, n, r);
|
|
470
|
-
}
|
|
471
467
|
async function sn(t, e = {}) {
|
|
472
|
-
const { width: n, height: r } =
|
|
473
|
-
return
|
|
468
|
+
const { width: n, height: r } = qt(t, e), o = await nt(t, e, !0);
|
|
469
|
+
return await an(o, e), await Jt(o, e), Ze(o, e), await Ee(o, n, r);
|
|
474
470
|
}
|
|
475
471
|
async function cn(t, e = {}) {
|
|
476
|
-
|
|
472
|
+
const { width: n, height: r } = qt(t, e), o = await sn(t, e), i = await G(o), a = document.createElement("canvas"), s = a.getContext("2d"), l = e.pixelRatio || Se(), u = e.canvasWidth || n, d = e.canvasHeight || r;
|
|
473
|
+
return a.width = u * l, a.height = d * l, e.skipAutoScale || ve(a), a.style.width = `${u}`, a.style.height = `${d}`, e.backgroundColor && (s.fillStyle = e.backgroundColor, s.fillRect(0, 0, a.width, a.height)), s.drawImage(i, 0, 0, a.width, a.height), a;
|
|
474
|
+
}
|
|
475
|
+
async function ln(t, e = {}) {
|
|
476
|
+
return (await cn(t, e)).toDataURL();
|
|
477
477
|
}
|
|
478
478
|
const J = "data-nf-capture-chrome";
|
|
479
|
-
function
|
|
479
|
+
function un(t) {
|
|
480
480
|
return t instanceof Element && (t.hasAttribute(J) || t.hasAttribute("data-nf-mask-cover") || t.id === "notefully");
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function dn() {
|
|
483
483
|
const t = [];
|
|
484
484
|
return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((n) => {
|
|
485
485
|
const r = n.getBoundingClientRect(), o = document.createElement("div");
|
|
@@ -495,47 +495,47 @@ function un() {
|
|
|
495
495
|
].join(";"), document.body.appendChild(o), t.push(o);
|
|
496
496
|
}), () => t.forEach((n) => n.remove());
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function fn() {
|
|
499
499
|
const t = document.querySelector(`[${J}]`);
|
|
500
500
|
if (t)
|
|
501
501
|
return t;
|
|
502
502
|
const e = document.createElement("div");
|
|
503
503
|
return e.setAttribute(J, "1"), e.className = "nf-capture-chrome", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.innerHTML = '<span class="nf-capture-chrome-pill">Capturing…</span>', document.body.appendChild(e), e;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function hn() {
|
|
506
506
|
document.querySelectorAll(`[${J}]`).forEach((t) => t.remove());
|
|
507
507
|
}
|
|
508
|
-
async function
|
|
509
|
-
const t = document.getElementById("notefully"), e = t ? t.style.display : "", n =
|
|
508
|
+
async function mn() {
|
|
509
|
+
const t = document.getElementById("notefully"), e = t ? t.style.display : "", n = fn();
|
|
510
510
|
t && (t.style.display = "none");
|
|
511
|
-
const r =
|
|
511
|
+
const r = dn();
|
|
512
512
|
await new Promise((o) => requestAnimationFrame(() => requestAnimationFrame(o)));
|
|
513
513
|
try {
|
|
514
|
-
return await
|
|
514
|
+
return await ln(document.body, {
|
|
515
515
|
cacheBust: !0,
|
|
516
516
|
pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
|
|
517
|
-
filter: (o) => !
|
|
517
|
+
filter: (o) => !un(o)
|
|
518
518
|
});
|
|
519
519
|
} finally {
|
|
520
|
-
r(), n.remove(),
|
|
520
|
+
r(), n.remove(), hn(), t && (t.style.display = e);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
function pn(t = "") {
|
|
524
524
|
const e = String(t || "");
|
|
525
525
|
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" : "";
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function yn(t = "") {
|
|
528
528
|
const e = String(t || "");
|
|
529
529
|
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" : "";
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function gn(t = {}) {
|
|
532
532
|
const e = navigator.userAgent;
|
|
533
533
|
return {
|
|
534
534
|
url: location.href,
|
|
535
535
|
title: document.title,
|
|
536
536
|
userAgent: e,
|
|
537
537
|
os: pn(e),
|
|
538
|
-
browser:
|
|
538
|
+
browser: yn(e),
|
|
539
539
|
language: navigator.language,
|
|
540
540
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
541
541
|
viewport: {
|
|
@@ -550,11 +550,11 @@ function yn(t = {}) {
|
|
|
550
550
|
}
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
const
|
|
553
|
+
const Ht = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), Dt = {
|
|
554
554
|
id: "userId",
|
|
555
555
|
username: "displayName",
|
|
556
556
|
name: "displayName"
|
|
557
|
-
},
|
|
557
|
+
}, Ft = /* @__PURE__ */ new Set([
|
|
558
558
|
"endpoint",
|
|
559
559
|
"projectKey",
|
|
560
560
|
"version",
|
|
@@ -564,7 +564,7 @@ const Ot = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), Ht = {
|
|
|
564
564
|
"theme",
|
|
565
565
|
"video",
|
|
566
566
|
"consoleLogLimit"
|
|
567
|
-
]),
|
|
567
|
+
]), Ut = {
|
|
568
568
|
slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
|
|
569
569
|
projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
|
|
570
570
|
project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
|
|
@@ -573,14 +573,14 @@ const Ot = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), Ht = {
|
|
|
573
573
|
email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
|
|
574
574
|
displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
|
|
575
575
|
};
|
|
576
|
-
function
|
|
577
|
-
const n = e.warn ||
|
|
578
|
-
for (const a of
|
|
576
|
+
function wn(t = {}, e = {}) {
|
|
577
|
+
const n = e.warn || Zt, r = t && typeof t == "object" ? t : {}, o = {}, i = [];
|
|
578
|
+
for (const a of Ht)
|
|
579
579
|
Object.prototype.hasOwnProperty.call(r, a) && (o[a] = r[a]);
|
|
580
|
-
for (const [a, s] of Object.entries(
|
|
580
|
+
for (const [a, s] of Object.entries(Dt))
|
|
581
581
|
Object.prototype.hasOwnProperty.call(r, a) && (Object.prototype.hasOwnProperty.call(o, s) || (o[s] = r[a]));
|
|
582
582
|
for (const a of Object.keys(r))
|
|
583
|
-
|
|
583
|
+
Ht.has(a) || Object.prototype.hasOwnProperty.call(Dt, a) || i.push(a);
|
|
584
584
|
if (i.length) {
|
|
585
585
|
const a = i.some((s) => s === "name" || s === "slug" || s === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
|
|
586
586
|
n(
|
|
@@ -589,23 +589,23 @@ function gn(t = {}, e = {}) {
|
|
|
589
589
|
}
|
|
590
590
|
return o;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
const n = e.warn ||
|
|
592
|
+
function bn(t = {}, e = {}) {
|
|
593
|
+
const n = e.warn || Zt, r = t && typeof t == "object" ? t : {}, o = Object.keys(r).filter((i) => !Ft.has(i));
|
|
594
594
|
if (o.length)
|
|
595
595
|
for (const i of o) {
|
|
596
|
-
if (
|
|
597
|
-
n(`Notefully.init: ignoring "${i}". ${
|
|
596
|
+
if (Ut[i]) {
|
|
597
|
+
n(`Notefully.init: ignoring "${i}". ${Ut[i]}`);
|
|
598
598
|
continue;
|
|
599
599
|
}
|
|
600
600
|
n(
|
|
601
|
-
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...
|
|
601
|
+
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...Ft].join(", ")}.`
|
|
602
602
|
);
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Zt(t) {
|
|
606
606
|
typeof console < "u" && typeof console.warn == "function" && console.warn(t);
|
|
607
607
|
}
|
|
608
|
-
const
|
|
608
|
+
const Sn = 80;
|
|
609
609
|
function vn() {
|
|
610
610
|
const t = [], e = {};
|
|
611
611
|
let n = !1;
|
|
@@ -620,7 +620,7 @@ function vn() {
|
|
|
620
620
|
level: i,
|
|
621
621
|
text: s.slice(0, 2e3),
|
|
622
622
|
at: Date.now()
|
|
623
|
-
}), t.length >
|
|
623
|
+
}), t.length > Sn && t.shift();
|
|
624
624
|
};
|
|
625
625
|
return {
|
|
626
626
|
hook: () => {
|
|
@@ -639,7 +639,7 @@ function vn() {
|
|
|
639
639
|
}
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function xn(t) {
|
|
643
643
|
const e = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
644
644
|
let n = null, r = !1;
|
|
645
645
|
const o = () => {
|
|
@@ -669,8 +669,8 @@ function Sn(t) {
|
|
|
669
669
|
isActive: () => r
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
672
|
+
const En = 60 * 1e3;
|
|
673
|
+
function Cn({ onStart: t, onStop: e, onError: n }) {
|
|
674
674
|
let r = null, o = null, i = [], a = null;
|
|
675
675
|
const s = () => {
|
|
676
676
|
if (a && (clearTimeout(a), a = null), o && o.state !== "inactive")
|
|
@@ -687,7 +687,7 @@ function En({ onStart: t, onStop: e, onError: n }) {
|
|
|
687
687
|
s(), e(null);
|
|
688
688
|
};
|
|
689
689
|
return { start: async () => {
|
|
690
|
-
var d,
|
|
690
|
+
var d, m;
|
|
691
691
|
if (!((d = navigator.mediaDevices) != null && d.getDisplayMedia))
|
|
692
692
|
throw new Error("Screen recording is not supported in this browser.");
|
|
693
693
|
r = await navigator.mediaDevices.getDisplayMedia({
|
|
@@ -697,15 +697,15 @@ function En({ onStart: t, onStop: e, onError: n }) {
|
|
|
697
697
|
selfBrowserSurface: "include"
|
|
698
698
|
}), i = [], o = new MediaRecorder(r, {
|
|
699
699
|
mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
|
|
700
|
-
}), o.ondataavailable = (
|
|
701
|
-
|
|
700
|
+
}), o.ondataavailable = (p) => {
|
|
701
|
+
p.data && p.data.size && i.push(p.data);
|
|
702
702
|
}, o.onstop = () => {
|
|
703
|
-
const
|
|
704
|
-
s(), e(
|
|
705
|
-
}, (
|
|
703
|
+
const p = i.length ? new Blob(i, { type: o.mimeType || "video/webm" }) : null;
|
|
704
|
+
s(), e(p);
|
|
705
|
+
}, (m = r.getVideoTracks()[0]) == null || m.addEventListener("ended", () => l()), o.start(), a = setTimeout(l, En);
|
|
706
706
|
}, stop: l };
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Mn() {
|
|
709
709
|
const t = /* @__PURE__ */ new Set();
|
|
710
710
|
return {
|
|
711
711
|
alloc() {
|
|
@@ -724,15 +724,15 @@ function Cn() {
|
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
726
|
const lt = { x: 0, y: 0, w: 1, h: 1 };
|
|
727
|
-
function
|
|
728
|
-
const t =
|
|
727
|
+
function te() {
|
|
728
|
+
const t = Mn();
|
|
729
729
|
let e = [], n = { ...lt }, r = 1;
|
|
730
730
|
return {
|
|
731
|
-
list: () => e.filter((i) =>
|
|
731
|
+
list: () => e.filter((i) => $n(i, n)),
|
|
732
732
|
all: () => e.slice(),
|
|
733
733
|
crop: () => ({ ...n }),
|
|
734
734
|
setCrop(i) {
|
|
735
|
-
return n =
|
|
735
|
+
return n = Ln(i), n;
|
|
736
736
|
},
|
|
737
737
|
resetCrop() {
|
|
738
738
|
return n = { ...lt }, n;
|
|
@@ -772,15 +772,15 @@ function Zt() {
|
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function Ln(t) {
|
|
776
776
|
const e = Math.min(Math.max(t.x, 0), 0.95), n = Math.min(Math.max(t.y, 0), 0.95), r = Math.min(Math.max(t.w, 0.05), 1 - e), o = Math.min(Math.max(t.h, 0.05), 1 - n);
|
|
777
777
|
return { x: e, y: n, w: r, h: o };
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function $n(t, e) {
|
|
780
780
|
const n = t.type === "arrow" ? (t.x + (t.x2 ?? t.x)) / 2 : t.x + (t.w || 0) / 2, r = t.type === "arrow" ? (t.y + (t.y2 ?? t.y)) / 2 : t.y + (t.h || 0) / 2;
|
|
781
781
|
return n >= e.x && r >= e.y && n <= e.x + e.w && r <= e.y + e.h;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function Ct(t) {
|
|
784
784
|
const e = Math.max(1, Number(t) || 1);
|
|
785
785
|
return {
|
|
786
786
|
stroke: Math.max(2, e * 75e-4),
|
|
@@ -790,52 +790,52 @@ function Et(t) {
|
|
|
790
790
|
arrowHeadAngle: 0.4
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function Rn(t, {
|
|
794
794
|
stickers: e = [],
|
|
795
795
|
crop: n = { x: 0, y: 0, w: 1, h: 1 },
|
|
796
796
|
width: r,
|
|
797
797
|
height: o,
|
|
798
798
|
colors: i = {}
|
|
799
799
|
}) {
|
|
800
|
-
const a = i.mark || "#fdd341", s = i.markText || "#2a2140", l =
|
|
800
|
+
const a = i.mark || "#fdd341", s = i.markText || "#2a2140", l = Ct(r);
|
|
801
801
|
t.save(), t.lineWidth = l.stroke, t.lineCap = "round", t.lineJoin = "round", t.strokeStyle = a, t.fillStyle = a, t.font = `700 ${Math.round(l.fontSize)}px ui-sans-serif, system-ui, sans-serif`, e.forEach((u) => {
|
|
802
|
-
const d = ht(u.x, n, r),
|
|
802
|
+
const d = ht(u.x, n, r), m = mt(u.y, n, o), p = u.w / n.w * r, C = u.h / n.h * o, L = l.stroke / 2;
|
|
803
803
|
if (u.type === "rect")
|
|
804
804
|
t.strokeRect(
|
|
805
805
|
d + L,
|
|
806
|
-
|
|
807
|
-
Math.max(0,
|
|
806
|
+
m + L,
|
|
807
|
+
Math.max(0, p - l.stroke),
|
|
808
808
|
Math.max(0, C - l.stroke)
|
|
809
809
|
);
|
|
810
810
|
else if (u.type === "circle")
|
|
811
811
|
t.beginPath(), t.ellipse(
|
|
812
|
-
d +
|
|
813
|
-
|
|
814
|
-
Math.max(0.5,
|
|
812
|
+
d + p / 2,
|
|
813
|
+
m + C / 2,
|
|
814
|
+
Math.max(0.5, p / 2 - L),
|
|
815
815
|
Math.max(0.5, C / 2 - L),
|
|
816
816
|
0,
|
|
817
817
|
0,
|
|
818
818
|
Math.PI * 2
|
|
819
819
|
), t.stroke();
|
|
820
820
|
else if (u.type === "arrow") {
|
|
821
|
-
const
|
|
822
|
-
|
|
821
|
+
const U = ht(u.x2 ?? u.x + u.w, n, r), j = mt(u.y2 ?? u.y, n, o);
|
|
822
|
+
Pn(t, d, m, U, j, l);
|
|
823
823
|
}
|
|
824
824
|
if (u.number == null || u.number === "")
|
|
825
825
|
return;
|
|
826
|
-
const
|
|
827
|
-
t.beginPath(), t.arc(
|
|
826
|
+
const P = An(u, n, r, o, d, m, p), V = String(u.number);
|
|
827
|
+
t.beginPath(), t.arc(P.x, P.y, l.badgeRadius, 0, Math.PI * 2), t.fillStyle = a, t.fill(), t.fillStyle = s, t.textAlign = "center", t.textBaseline = "middle", t.fillText(V, P.x, P.y + 0.5), t.fillStyle = a;
|
|
828
828
|
}), t.restore();
|
|
829
829
|
}
|
|
830
830
|
function ht(t, e, n) {
|
|
831
831
|
return (t - e.x) / e.w * n;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function mt(t, e, n) {
|
|
834
834
|
return (t - e.y) / e.h * n;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function An(t, e, n, r, o, i, a) {
|
|
837
837
|
if (t.type === "arrow") {
|
|
838
|
-
const s = ht(t.x2 ?? t.x + t.w, e, n), l =
|
|
838
|
+
const s = ht(t.x2 ?? t.x + t.w, e, n), l = mt(t.y2 ?? t.y, e, r);
|
|
839
839
|
return {
|
|
840
840
|
x: (o + s) / 2,
|
|
841
841
|
y: (i + l) / 2
|
|
@@ -843,8 +843,8 @@ function Rn(t, e, n, r, o, i, a) {
|
|
|
843
843
|
}
|
|
844
844
|
return { x: o + a / 2, y: i };
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
const i = Math.atan2(r - e, n - t), a = o.arrowHead, s = Math.min(o.stroke, a * 0.2), l = n, u = r, d = n - Math.cos(i) * a,
|
|
846
|
+
function ee(t, e, n, r, o) {
|
|
847
|
+
const i = Math.atan2(r - e, n - t), a = o.arrowHead, s = Math.min(o.stroke, a * 0.2), l = n, u = r, d = n - Math.cos(i) * a, m = r - Math.sin(i) * a, p = {
|
|
848
848
|
x: l - a * Math.cos(i - o.arrowHeadAngle),
|
|
849
849
|
y: u - a * Math.sin(i - o.arrowHeadAngle)
|
|
850
850
|
}, C = {
|
|
@@ -854,26 +854,26 @@ function te(t, e, n, r, o) {
|
|
|
854
854
|
x: n - Math.cos(i) * s,
|
|
855
855
|
y: r - Math.sin(i) * s
|
|
856
856
|
};
|
|
857
|
-
return { angle: i, tipX: l, tipY: u, baseX: d, baseY:
|
|
857
|
+
return { angle: i, tipX: l, tipY: u, baseX: d, baseY: m, left: p, right: C, shaftEnd: L };
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
const a =
|
|
859
|
+
function Pn(t, e, n, r, o, i) {
|
|
860
|
+
const a = ee(e, n, r, o, i);
|
|
861
861
|
t.beginPath(), t.moveTo(e, n), t.lineTo(a.shaftEnd.x, a.shaftEnd.y), t.stroke(), t.beginPath(), t.moveTo(a.tipX, a.tipY), t.lineTo(a.left.x, a.left.y), t.lineTo(a.right.x, a.right.y), t.closePath(), t.fill();
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Tn(t, e, n, r = {}) {
|
|
864
864
|
return new Promise((o, i) => {
|
|
865
865
|
const a = new Image();
|
|
866
866
|
a.onload = () => {
|
|
867
|
-
const s = Math.round(e.x * a.width), l = Math.round(e.y * a.height), u = Math.max(1, Math.round(e.w * a.width)), d = Math.max(1, Math.round(e.h * a.height)),
|
|
868
|
-
|
|
869
|
-
const
|
|
870
|
-
|
|
867
|
+
const s = Math.round(e.x * a.width), l = Math.round(e.y * a.height), u = Math.max(1, Math.round(e.w * a.width)), d = Math.max(1, Math.round(e.h * a.height)), m = document.createElement("canvas");
|
|
868
|
+
m.width = u, m.height = d;
|
|
869
|
+
const p = m.getContext("2d");
|
|
870
|
+
p.drawImage(a, s, l, u, d, 0, 0, u, d), Rn(p, {
|
|
871
871
|
stickers: n,
|
|
872
872
|
crop: e,
|
|
873
873
|
width: u,
|
|
874
874
|
height: d,
|
|
875
875
|
colors: r
|
|
876
|
-
}),
|
|
876
|
+
}), m.toBlob((C) => {
|
|
877
877
|
if (!C) {
|
|
878
878
|
i(new Error("Could not encode screenshot"));
|
|
879
879
|
return;
|
|
@@ -883,27 +883,27 @@ function Pn(t, e, n, r = {}) {
|
|
|
883
883
|
}, a.onerror = () => i(new Error("Could not load screenshot")), a.src = t;
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
|
-
const
|
|
886
|
+
const kn = ["bug", "idea", "other"], In = ["maker", "all-business", "brighter-day", "quiet-night"], ne = "maker", On = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), pt = 0.02, jt = 0.05, Hn = `
|
|
887
887
|
<svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
888
888
|
<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"/>
|
|
889
889
|
<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"/>
|
|
890
890
|
</svg>
|
|
891
891
|
`;
|
|
892
|
-
function
|
|
892
|
+
function k(t) {
|
|
893
893
|
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>`;
|
|
894
894
|
}
|
|
895
|
-
const
|
|
896
|
-
crop:
|
|
897
|
-
resetCrop:
|
|
898
|
-
arrow:
|
|
899
|
-
rect:
|
|
900
|
-
circle:
|
|
901
|
-
discard:
|
|
902
|
-
audio:
|
|
903
|
-
video:
|
|
904
|
-
},
|
|
905
|
-
|
|
906
|
-
const
|
|
895
|
+
const I = {
|
|
896
|
+
crop: k('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
|
|
897
|
+
resetCrop: k('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
|
|
898
|
+
arrow: k('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
|
|
899
|
+
rect: k('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
|
|
900
|
+
circle: k('<circle cx="12" cy="12" r="8"/>'),
|
|
901
|
+
discard: k('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
|
|
902
|
+
audio: k('<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"/>'),
|
|
903
|
+
video: k('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>')
|
|
904
|
+
}, re = vn();
|
|
905
|
+
re.hook();
|
|
906
|
+
const ie = 10, Dn = 80, oe = "notefully.author", yt = "Anonymous";
|
|
907
907
|
let f = {
|
|
908
908
|
endpoint: "",
|
|
909
909
|
projectKey: "",
|
|
@@ -911,37 +911,37 @@ let f = {
|
|
|
911
911
|
name: "",
|
|
912
912
|
targets: null,
|
|
913
913
|
hideLauncher: !1,
|
|
914
|
-
theme:
|
|
914
|
+
theme: ne,
|
|
915
915
|
video: !1,
|
|
916
|
-
consoleLogLimit:
|
|
917
|
-
},
|
|
916
|
+
consoleLogLimit: ie
|
|
917
|
+
}, R = {}, h = null, c = {}, y = te(), v = "", q = "", A = null, Q = "bug", H = null, $ = null, w = null, g = null, Y = null, F = null, W = null, O = { w: 0, h: 0 }, ut = !1;
|
|
918
918
|
function b(t) {
|
|
919
919
|
return h.querySelector(t);
|
|
920
920
|
}
|
|
921
921
|
function ae(t) {
|
|
922
922
|
const e = String(t || "").trim().toLowerCase().replace(/\s+/g, "-");
|
|
923
|
-
return
|
|
923
|
+
return In.includes(e) ? e : ne;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function _t(t, e) {
|
|
926
926
|
return h && getComputedStyle(h).getPropertyValue(t).trim() || e;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function S(t, e = !1) {
|
|
929
929
|
c.status && (c.status.textContent = t || "", Y && (clearTimeout(Y), Y = null), t && !e && (Y = setTimeout(() => {
|
|
930
930
|
c.status.textContent = "";
|
|
931
931
|
}, 4e3)));
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function Mt() {
|
|
934
934
|
return h && document.body.contains(h) || (h = document.createElement("div"), h.id = "notefully", h.innerHTML = `
|
|
935
|
-
<button class="nf-launcher" type="button" title="Leave a note…" aria-label="Leave a note…">${
|
|
935
|
+
<button class="nf-launcher" type="button" title="Leave a note…" aria-label="Leave a note…">${Hn}</button>
|
|
936
936
|
<div class="nf-dialog" hidden>
|
|
937
937
|
<div class="nf-panel">
|
|
938
938
|
<div class="nf-stage">
|
|
939
939
|
<div class="nf-palette">
|
|
940
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="crop" title="Crop" aria-label="Crop">${
|
|
941
|
-
<button class="nf-reset-crop nf-icon-btn" type="button" title="Reset crop" aria-label="Reset crop" hidden>${
|
|
942
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" title="Arrow" aria-label="Arrow">${
|
|
943
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="rect" title="Rectangle" aria-label="Rectangle">${
|
|
944
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="circle" title="Circle" aria-label="Circle">${
|
|
940
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="crop" title="Crop" aria-label="Crop">${I.crop}</button>
|
|
941
|
+
<button class="nf-reset-crop nf-icon-btn" type="button" title="Reset crop" aria-label="Reset crop" hidden>${I.resetCrop}</button>
|
|
942
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" title="Arrow" aria-label="Arrow">${I.arrow}</button>
|
|
943
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="rect" title="Rectangle" aria-label="Rectangle">${I.rect}</button>
|
|
944
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="circle" title="Circle" aria-label="Circle">${I.circle}</button>
|
|
945
945
|
</div>
|
|
946
946
|
<div class="nf-canvas"></div>
|
|
947
947
|
</div>
|
|
@@ -953,9 +953,9 @@ function Ct() {
|
|
|
953
953
|
<button type="button" data-kind="other">Other</button>
|
|
954
954
|
</div>
|
|
955
955
|
<div class="nf-actions">
|
|
956
|
-
<button class="nf-discard-shot nf-icon-btn" type="button" title="Discard screenshot" aria-label="Discard screenshot">${
|
|
957
|
-
<button class="nf-audio nf-icon-btn" type="button" title="Record audio" aria-label="Record audio">${
|
|
958
|
-
<button class="nf-video nf-icon-btn" type="button" title="Record video" aria-label="Record video">${
|
|
956
|
+
<button class="nf-discard-shot nf-icon-btn" type="button" title="Discard screenshot" aria-label="Discard screenshot">${I.discard}</button>
|
|
957
|
+
<button class="nf-audio nf-icon-btn" type="button" title="Record audio" aria-label="Record audio">${I.audio}</button>
|
|
958
|
+
<button class="nf-video nf-icon-btn" type="button" title="Record video" aria-label="Record video">${I.video}</button>
|
|
959
959
|
<button class="nf-submit" type="button">Submit</button>
|
|
960
960
|
</div>
|
|
961
961
|
<button class="nf-restore" type="button" hidden>Restore screenshot</button>
|
|
@@ -979,7 +979,7 @@ function Ct() {
|
|
|
979
979
|
resetCrop: b(".nf-reset-crop"),
|
|
980
980
|
submit: b(".nf-submit"),
|
|
981
981
|
shot: null
|
|
982
|
-
},
|
|
982
|
+
}, Fn(), rt()), h;
|
|
983
983
|
}
|
|
984
984
|
function rt() {
|
|
985
985
|
var t;
|
|
@@ -988,28 +988,28 @@ function rt() {
|
|
|
988
988
|
function Z() {
|
|
989
989
|
c.launcher && (c.launcher.hidden = !!f.hideLauncher);
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
c.launcher.addEventListener("click", () =>
|
|
991
|
+
function Fn() {
|
|
992
|
+
c.launcher.addEventListener("click", () => he()), b(".nf-dialog").addEventListener("click", (t) => {
|
|
993
993
|
t.target === c.dialog && ot();
|
|
994
994
|
}), h.querySelectorAll(".nf-tool").forEach((t) => {
|
|
995
|
-
t.addEventListener("click", () =>
|
|
996
|
-
}), c.resetCrop.addEventListener("click",
|
|
997
|
-
t.addEventListener("click", () =>
|
|
998
|
-
}), c.discard.addEventListener("click",
|
|
999
|
-
|
|
1000
|
-
}),
|
|
1001
|
-
}
|
|
1002
|
-
function
|
|
1003
|
-
Q =
|
|
995
|
+
t.addEventListener("click", () => wt(t.dataset.tool));
|
|
996
|
+
}), c.resetCrop.addEventListener("click", Wn), c.canvas.addEventListener("pointerdown", jn), c.canvas.addEventListener("dragstart", (t) => t.preventDefault()), h.querySelectorAll("[data-kind]").forEach((t) => {
|
|
997
|
+
t.addEventListener("click", () => gt(t.dataset.kind));
|
|
998
|
+
}), c.discard.addEventListener("click", qn), c.restore.addEventListener("click", zn), c.audio.addEventListener("click", Xn), c.video.addEventListener("click", Yn), c.stop.addEventListener("click", () => W == null ? void 0 : W.stop()), b(".nf-submit").addEventListener("click", () => {
|
|
999
|
+
me().catch((t) => S(t.message || "Submit failed."));
|
|
1000
|
+
}), gt("bug"), wt(null);
|
|
1001
|
+
}
|
|
1002
|
+
function gt(t) {
|
|
1003
|
+
Q = kn.includes(t) ? t : "bug", h.querySelectorAll("[data-kind]").forEach((e) => {
|
|
1004
1004
|
e.dataset.active = String(e.dataset.kind === Q);
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1009
|
-
e.dataset.active = String(e.dataset.tool ===
|
|
1010
|
-
}), c.canvas && (c.canvas.dataset.draw =
|
|
1007
|
+
function wt(t) {
|
|
1008
|
+
H = On.has(t) ? t : null, $ = null, h.querySelectorAll(".nf-tool").forEach((e) => {
|
|
1009
|
+
e.dataset.active = String(e.dataset.tool === H);
|
|
1010
|
+
}), c.canvas && (c.canvas.dataset.draw = H ? "true" : "false"), v && M();
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function Nt(t) {
|
|
1013
1013
|
return Math.min(1, Math.max(0, t));
|
|
1014
1014
|
}
|
|
1015
1015
|
function z() {
|
|
@@ -1018,11 +1018,11 @@ function z() {
|
|
|
1018
1018
|
function tt(t) {
|
|
1019
1019
|
const e = z().getBoundingClientRect();
|
|
1020
1020
|
return {
|
|
1021
|
-
x:
|
|
1022
|
-
y:
|
|
1021
|
+
x: Nt((t.clientX - e.left) / Math.max(e.width, 1)),
|
|
1022
|
+
y: Nt((t.clientY - e.top) / Math.max(e.height, 1))
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Un(t) {
|
|
1026
1026
|
const e = z().getBoundingClientRect();
|
|
1027
1027
|
return t.clientX >= e.left && t.clientX <= e.right && t.clientY >= e.top && t.clientY <= e.bottom;
|
|
1028
1028
|
}
|
|
@@ -1038,11 +1038,11 @@ function it(t, e) {
|
|
|
1038
1038
|
return {
|
|
1039
1039
|
x: n,
|
|
1040
1040
|
y: r,
|
|
1041
|
-
w: Math.max(
|
|
1042
|
-
h: Math.max(
|
|
1041
|
+
w: Math.max(pt, Math.abs(e.x - t.x)),
|
|
1042
|
+
h: Math.max(pt, Math.abs(e.y - t.y))
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function Lt(t) {
|
|
1046
1046
|
h && (t ? h.dataset.grabbing = "true" : delete h.dataset.grabbing);
|
|
1047
1047
|
}
|
|
1048
1048
|
function dt(t) {
|
|
@@ -1051,41 +1051,41 @@ function dt(t) {
|
|
|
1051
1051
|
} catch {
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function bt() {
|
|
1055
1055
|
window.addEventListener("pointermove", le), window.addEventListener("pointerup", et), window.addEventListener("pointercancel", et);
|
|
1056
1056
|
}
|
|
1057
1057
|
function ce() {
|
|
1058
1058
|
window.removeEventListener("pointermove", le), window.removeEventListener("pointerup", et), window.removeEventListener("pointercancel", et);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
if (t.button !== 0 || !
|
|
1060
|
+
function jn(t) {
|
|
1061
|
+
if (t.button !== 0 || !v)
|
|
1062
1062
|
return;
|
|
1063
|
-
if (!t.target.closest(".nf-sticker") && !
|
|
1063
|
+
if (!t.target.closest(".nf-sticker") && !Un(t)) {
|
|
1064
1064
|
$ = null, M();
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
1067
|
const e = t.target.closest(".nf-handle"), n = t.target.closest(".nf-sticker");
|
|
1068
1068
|
if (n && n.dataset.preview !== "true") {
|
|
1069
|
-
t.preventDefault(), t.stopPropagation(), $ = n.dataset.id, dt(t),
|
|
1069
|
+
t.preventDefault(), t.stopPropagation(), $ = n.dataset.id, dt(t), _n({
|
|
1070
1070
|
kind: "sticker",
|
|
1071
1071
|
id: $,
|
|
1072
1072
|
dir: (e == null ? void 0 : e.dataset.dir) || "move"
|
|
1073
1073
|
}, t), M();
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
|
-
if ($ = null,
|
|
1077
|
-
t.preventDefault(), dt(t), w = { kind: "crop", start: tt(t), current: tt(t) },
|
|
1076
|
+
if ($ = null, H === "crop") {
|
|
1077
|
+
t.preventDefault(), dt(t), w = { kind: "crop", start: tt(t), current: tt(t) }, bt(), M();
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
|
-
if (
|
|
1080
|
+
if (H === "arrow" || H === "rect" || H === "circle") {
|
|
1081
1081
|
t.preventDefault(), dt(t);
|
|
1082
1082
|
const r = se(t);
|
|
1083
|
-
w = { kind: "sticker", type:
|
|
1083
|
+
w = { kind: "sticker", type: H, start: r, current: r }, bt(), M();
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
1086
|
M();
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function _n(t, e) {
|
|
1089
1089
|
e.preventDefault(), e.stopPropagation();
|
|
1090
1090
|
const n = z().getBoundingClientRect(), r = y.list().find((o) => o.id === t.id);
|
|
1091
1091
|
g = {
|
|
@@ -1095,7 +1095,7 @@ function jn(t, e) {
|
|
|
1095
1095
|
crop: y.crop(),
|
|
1096
1096
|
sticker: r ? { ...r } : null,
|
|
1097
1097
|
rect: n
|
|
1098
|
-
},
|
|
1098
|
+
}, Lt(t.dir === "move" || t.dir === "start" || t.dir === "end"), bt();
|
|
1099
1099
|
}
|
|
1100
1100
|
function le(t) {
|
|
1101
1101
|
if (w) {
|
|
@@ -1125,12 +1125,12 @@ function le(t) {
|
|
|
1125
1125
|
});
|
|
1126
1126
|
else {
|
|
1127
1127
|
const o = { x: r.x, y: r.y, w: r.w, h: r.h };
|
|
1128
|
-
|
|
1128
|
+
Nn(o, g.dir, e, n), y.update(r.id, o);
|
|
1129
1129
|
}
|
|
1130
1130
|
M();
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Nn(t, e, n, r) {
|
|
1134
1134
|
if (e.includes("e") && (t.w = Math.max(0.04, t.w + n)), e.includes("s") && (t.h = Math.max(0.04, t.h + r)), e.includes("w")) {
|
|
1135
1135
|
const o = Math.max(0.04, t.w - n);
|
|
1136
1136
|
t.x += t.w - o, t.w = o;
|
|
@@ -1141,8 +1141,8 @@ function _n(t, e, n, r) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
function et(t) {
|
|
1144
|
-
if (ce(),
|
|
1145
|
-
|
|
1144
|
+
if (ce(), Lt(!1), w) {
|
|
1145
|
+
Bn();
|
|
1146
1146
|
return;
|
|
1147
1147
|
}
|
|
1148
1148
|
if (g) {
|
|
@@ -1153,13 +1153,13 @@ function et(t) {
|
|
|
1153
1153
|
g = null, M();
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function Bn() {
|
|
1157
1157
|
const t = w;
|
|
1158
1158
|
if (w = null, !t)
|
|
1159
1159
|
return;
|
|
1160
1160
|
if (t.kind === "crop") {
|
|
1161
1161
|
const n = it(t.start, t.current);
|
|
1162
|
-
if (Math.abs(t.current.x - t.start.x) <
|
|
1162
|
+
if (Math.abs(t.current.x - t.start.x) < jt || Math.abs(t.current.y - t.start.y) < jt) {
|
|
1163
1163
|
M();
|
|
1164
1164
|
return;
|
|
1165
1165
|
}
|
|
@@ -1172,13 +1172,13 @@ function Nn() {
|
|
|
1172
1172
|
}), X();
|
|
1173
1173
|
return;
|
|
1174
1174
|
}
|
|
1175
|
-
const e =
|
|
1175
|
+
const e = Vn(t);
|
|
1176
1176
|
e && ($ = e.id), M();
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Vn(t) {
|
|
1179
1179
|
if (t.type === "arrow") {
|
|
1180
1180
|
const e = t.current.x - t.start.x, n = t.current.y - t.start.y;
|
|
1181
|
-
return Math.hypot(e, n) <
|
|
1181
|
+
return Math.hypot(e, n) < pt ? y.add("arrow", {
|
|
1182
1182
|
x: t.start.x,
|
|
1183
1183
|
y: t.start.y,
|
|
1184
1184
|
x2: t.start.x + 0.12,
|
|
@@ -1196,81 +1196,81 @@ function Bn(t) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
return y.add(t.type, it(t.start, t.current));
|
|
1198
1198
|
}
|
|
1199
|
-
function
|
|
1199
|
+
function Wn() {
|
|
1200
1200
|
y.resetCrop(), $ = null, X();
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function St() {
|
|
1203
1203
|
c.resetCrop && (c.resetCrop.hidden = !y.isCropped());
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function $t(t) {
|
|
1206
1206
|
if (!c.audio)
|
|
1207
1207
|
return;
|
|
1208
1208
|
const e = t ? "Stop audio" : "Record audio";
|
|
1209
1209
|
c.audio.title = e, c.audio.setAttribute("aria-label", e), c.audio.dataset.active = String(!!t);
|
|
1210
1210
|
}
|
|
1211
|
-
function Wn() {
|
|
1212
|
-
S && (q = S), S = "", c.stage.hidden = !0, c.restore.hidden = !q;
|
|
1213
|
-
}
|
|
1214
1211
|
function qn() {
|
|
1215
|
-
|
|
1212
|
+
v && (q = v), v = "", c.stage.hidden = !0, c.restore.hidden = !q;
|
|
1216
1213
|
}
|
|
1217
1214
|
function zn() {
|
|
1215
|
+
q && (v = q, c.stage.hidden = !1, c.restore.hidden = !0, X());
|
|
1216
|
+
}
|
|
1217
|
+
function Xn() {
|
|
1218
1218
|
try {
|
|
1219
|
-
if (
|
|
1219
|
+
if (F || (F = xn((e) => {
|
|
1220
1220
|
const n = c.text.value.trim();
|
|
1221
1221
|
c.text.value = n ? `${n} ${e}` : e;
|
|
1222
|
-
})), !
|
|
1223
|
-
|
|
1222
|
+
})), !F.isSupported()) {
|
|
1223
|
+
S("Audio-to-text is not supported in this browser.");
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
|
-
const t =
|
|
1227
|
-
|
|
1226
|
+
const t = F.start();
|
|
1227
|
+
$t(t), S(t ? "Listening…" : "");
|
|
1228
1228
|
} catch (t) {
|
|
1229
|
-
|
|
1229
|
+
S(t.message);
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
async function
|
|
1232
|
+
async function Yn() {
|
|
1233
1233
|
if (!f.video) {
|
|
1234
|
-
|
|
1234
|
+
S("Video is disabled on this host.");
|
|
1235
1235
|
return;
|
|
1236
1236
|
}
|
|
1237
|
-
c.dialog.hidden = !0, c.stop.hidden = !1, rt(), c.launcher.hidden = !0,
|
|
1237
|
+
c.dialog.hidden = !0, c.stop.hidden = !1, rt(), c.launcher.hidden = !0, W = Cn({
|
|
1238
1238
|
onStart() {
|
|
1239
1239
|
},
|
|
1240
1240
|
onStop(t) {
|
|
1241
|
-
|
|
1241
|
+
A = t, c.stop.hidden = !0, Z(), c.dialog.hidden = !1, X(), S(t ? "Video attached." : "Recording cancelled.");
|
|
1242
1242
|
},
|
|
1243
1243
|
onError(t) {
|
|
1244
|
-
|
|
1244
|
+
S(t.message);
|
|
1245
1245
|
}
|
|
1246
1246
|
});
|
|
1247
1247
|
try {
|
|
1248
|
-
await
|
|
1248
|
+
await W.start();
|
|
1249
1249
|
} catch (t) {
|
|
1250
|
-
c.stop.hidden = !0, Z(), c.dialog.hidden = !1,
|
|
1250
|
+
c.stop.hidden = !0, Z(), c.dialog.hidden = !1, S(t.message);
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
function X() {
|
|
1254
|
-
if (c.shot = null, !
|
|
1255
|
-
c.canvas.style.removeProperty("--nf-shot-aspect"), c.canvas.style.removeProperty("aspect-ratio"), c.canvas.innerHTML =
|
|
1254
|
+
if (c.shot = null, !v) {
|
|
1255
|
+
c.canvas.style.removeProperty("--nf-shot-aspect"), c.canvas.style.removeProperty("aspect-ratio"), c.canvas.innerHTML = A ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(A)}"></video>` : "", St();
|
|
1256
1256
|
return;
|
|
1257
1257
|
}
|
|
1258
|
-
c.canvas.innerHTML = `<div class="nf-shot"><img alt="Screenshot" src="${
|
|
1258
|
+
c.canvas.innerHTML = `<div class="nf-shot"><img alt="Screenshot" src="${v}" draggable="false"></div>`, c.shot = c.canvas.querySelector(".nf-shot");
|
|
1259
1259
|
const t = c.shot.querySelector("img");
|
|
1260
1260
|
t.draggable = !1, t.addEventListener("dragstart", (n) => n.preventDefault());
|
|
1261
1261
|
const e = () => {
|
|
1262
|
-
|
|
1262
|
+
Kn(t), M();
|
|
1263
1263
|
};
|
|
1264
1264
|
t.addEventListener("load", e), t.complete && t.naturalWidth && e();
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const e = t.naturalWidth ||
|
|
1268
|
-
if (e && n && (
|
|
1266
|
+
function Kn(t) {
|
|
1267
|
+
const e = t.naturalWidth || O.w, n = t.naturalHeight || O.h;
|
|
1268
|
+
if (e && n && (O = { w: e, h: n }, c.canvas.style.setProperty("--nf-shot-aspect", String(e / n)), c.canvas.style.aspectRatio = `${e} / ${n}`), !c.shot || !O.w || !O.h)
|
|
1269
1269
|
return;
|
|
1270
|
-
const r = y.crop(), o =
|
|
1270
|
+
const r = y.crop(), o = O.w / O.h, i = r.w / r.h * o, a = Math.min(1, i / o), s = Math.min(1, o / i);
|
|
1271
1271
|
c.shot.style.left = `${(1 - a) / 2 * 100}%`, c.shot.style.top = `${(1 - s) / 2 * 100}%`, c.shot.style.width = `${a * 100}%`, c.shot.style.height = `${s * 100}%`, t.style.width = `${100 / r.w}%`, t.style.height = `${100 / r.h}%`, t.style.left = `${-r.x / r.w * 100}%`, t.style.top = `${-r.y / r.h * 100}%`;
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function Gn(t) {
|
|
1274
1274
|
return t.type === "arrow" ? {
|
|
1275
1275
|
id: "preview",
|
|
1276
1276
|
type: "arrow",
|
|
@@ -1289,77 +1289,90 @@ function Kn(t) {
|
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
1291
1291
|
function M() {
|
|
1292
|
-
if ((c.shot || c.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !
|
|
1293
|
-
|
|
1292
|
+
if ((c.shot || c.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !v || !c.shot) {
|
|
1293
|
+
St();
|
|
1294
1294
|
return;
|
|
1295
1295
|
}
|
|
1296
|
-
const e = y.crop(), n = z(), r =
|
|
1296
|
+
const e = y.crop(), n = z(), r = Ct(n.clientWidth || 400);
|
|
1297
1297
|
if (c.shot.style.setProperty("--nf-anno-stroke", `${r.stroke}px`), c.shot.style.setProperty("--nf-anno-badge", `${r.badgeRadius * 2}px`), c.shot.style.setProperty("--nf-anno-badge-font", `${r.fontSize}px`), c.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, r.stroke * 2.5)}px`), (w == null ? void 0 : w.kind) === "crop") {
|
|
1298
1298
|
const i = document.createElement("div");
|
|
1299
|
-
i.className = "nf-crop",
|
|
1299
|
+
i.className = "nf-crop", Bt(i, it(w.start, w.current), { x: 0, y: 0, w: 1, h: 1 }), c.shot.appendChild(i);
|
|
1300
1300
|
}
|
|
1301
1301
|
const o = y.list().slice();
|
|
1302
|
-
if ((w == null ? void 0 : w.kind) === "sticker" && o.push(
|
|
1302
|
+
if ((w == null ? void 0 : w.kind) === "sticker" && o.push(Gn(w)), o.forEach((i) => {
|
|
1303
1303
|
const a = i.id === "preview", s = !a && i.id === $, l = document.createElement("div");
|
|
1304
|
-
if (l.className = `nf-sticker nf-${i.type}`, l.dataset.id = i.id, s && (l.dataset.selected = "true"), a && (l.dataset.preview = "true"), i.type === "arrow" ?
|
|
1304
|
+
if (l.className = `nf-sticker nf-${i.type}`, l.dataset.id = i.id, s && (l.dataset.selected = "true"), a && (l.dataset.preview = "true"), i.type === "arrow" ? Jn(l, i, e, s, r) : (Bt(l, i, e), s && ["nw", "ne", "sw", "se"].forEach((u) => vt(l, u))), !a && i.number) {
|
|
1305
1305
|
const u = document.createElement("span");
|
|
1306
1306
|
u.className = "nf-badge", u.textContent = String(i.number), l.appendChild(u);
|
|
1307
1307
|
}
|
|
1308
1308
|
c.shot.appendChild(l);
|
|
1309
|
-
}), c.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()),
|
|
1309
|
+
}), c.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), A) {
|
|
1310
1310
|
const i = document.createElement("video");
|
|
1311
|
-
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(
|
|
1311
|
+
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(A), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", c.canvas.appendChild(i);
|
|
1312
1312
|
}
|
|
1313
|
-
|
|
1313
|
+
St();
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
const i = z(), a = i.clientWidth, s = i.clientHeight, l = (e.x - n.x) / n.w * a, u = (e.y - n.y) / n.h * s, d = ((e.x2 ?? e.x + e.w) - n.x) / n.w * a,
|
|
1317
|
-
t.style.left = `${C}px`, t.style.top = `${L}px`, t.style.width = `${
|
|
1318
|
-
<line class="nf-arrow-hit" x1="${
|
|
1319
|
-
<line class="nf-arrow-shaft" x1="${
|
|
1320
|
-
<polygon class="nf-arrow-head" points="${
|
|
1321
|
-
`, t.appendChild(
|
|
1315
|
+
function Jn(t, e, n, r, o = Ct(400)) {
|
|
1316
|
+
const i = z(), a = i.clientWidth, s = i.clientHeight, l = (e.x - n.x) / n.w * a, u = (e.y - n.y) / n.h * s, d = ((e.x2 ?? e.x + e.w) - n.x) / n.w * a, m = ((e.y2 ?? e.y) - n.y) / n.h * s, p = Math.max(18, o.arrowHead + o.stroke * 2), C = Math.min(l, d) - p, L = Math.min(u, m) - p, P = Math.max(2, Math.abs(d - l)) + p * 2, V = Math.max(2, Math.abs(m - u)) + p * 2, U = l - C, j = u - L, at = d - C, st = m - L, T = ee(U, j, at, st, o), _ = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1317
|
+
t.style.left = `${C}px`, t.style.top = `${L}px`, t.style.width = `${P}px`, t.style.height = `${V}px`, _.setAttribute("class", "nf-arrow-svg"), _.setAttribute("viewBox", `0 0 ${P} ${V}`), _.setAttribute("width", String(P)), _.setAttribute("height", String(V)), _.innerHTML = `
|
|
1318
|
+
<line class="nf-arrow-hit" x1="${U}" y1="${j}" x2="${at}" y2="${st}" />
|
|
1319
|
+
<line class="nf-arrow-shaft" x1="${U}" y1="${j}" x2="${T.shaftEnd.x}" y2="${T.shaftEnd.y}" />
|
|
1320
|
+
<polygon class="nf-arrow-head" points="${T.tipX},${T.tipY} ${T.left.x},${T.left.y} ${T.right.x},${T.right.y}" />
|
|
1321
|
+
`, t.appendChild(_), r && (vt(t, "start", { left: U - 5, top: j - 5 }), vt(t, "end", { left: at - 5, top: st - 5 }));
|
|
1322
1322
|
}
|
|
1323
1323
|
function vt(t, e, n) {
|
|
1324
1324
|
const r = document.createElement("span");
|
|
1325
1325
|
r.className = "nf-handle", r.dataset.dir = e, n && (r.style.left = `${n.left}px`, r.style.top = `${n.top}px`), t.appendChild(r);
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function Bt(t, e, n) {
|
|
1328
1328
|
t.style.left = `${(e.x - n.x) / n.w * 100}%`, t.style.top = `${(e.y - n.y) / n.h * 100}%`, t.style.width = `${e.w / n.w * 100}%`, t.style.height = `${e.h / n.h * 100}%`;
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function Qn() {
|
|
1331
1331
|
try {
|
|
1332
|
-
return String(localStorage.getItem(
|
|
1332
|
+
return String(localStorage.getItem(oe) || "").trim();
|
|
1333
1333
|
} catch {
|
|
1334
1334
|
return "";
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Zn(t) {
|
|
1338
1338
|
const e = String(t || "").trim();
|
|
1339
|
-
if (!(!e || e ===
|
|
1339
|
+
if (!(!e || e === yt))
|
|
1340
1340
|
try {
|
|
1341
|
-
localStorage.setItem(
|
|
1341
|
+
localStorage.setItem(oe, e);
|
|
1342
1342
|
} catch {
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1346
|
-
|
|
1347
|
-
return t || Jn();
|
|
1345
|
+
function ue() {
|
|
1346
|
+
return !!(String(R.userId || "").trim() || String(R.email || "").trim() || String(R.displayName || "").trim());
|
|
1348
1347
|
}
|
|
1349
1348
|
function tr() {
|
|
1349
|
+
return String(
|
|
1350
|
+
R.displayName || R.email || R.userId || ""
|
|
1351
|
+
).trim();
|
|
1352
|
+
}
|
|
1353
|
+
function er() {
|
|
1350
1354
|
var e;
|
|
1355
|
+
if (ue())
|
|
1356
|
+
return tr() || yt;
|
|
1351
1357
|
const t = String(((e = c.author) == null ? void 0 : e.value) || "").trim();
|
|
1352
|
-
return t ? (
|
|
1358
|
+
return t ? (Zn(t), t) : yt;
|
|
1353
1359
|
}
|
|
1354
|
-
function
|
|
1355
|
-
|
|
1360
|
+
function de() {
|
|
1361
|
+
if (!c.author)
|
|
1362
|
+
return;
|
|
1363
|
+
const t = ue();
|
|
1364
|
+
if (c.author.hidden = t, t) {
|
|
1365
|
+
c.author.value = "";
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
c.author.value = Qn();
|
|
1356
1369
|
}
|
|
1357
|
-
function
|
|
1370
|
+
function fe(t, e = ie) {
|
|
1358
1371
|
const n = Number(t);
|
|
1359
|
-
return Number.isFinite(n) ? Math.min(
|
|
1372
|
+
return Number.isFinite(n) ? Math.min(Dn, Math.max(0, Math.floor(n))) : e;
|
|
1360
1373
|
}
|
|
1361
|
-
function
|
|
1362
|
-
return
|
|
1374
|
+
function nr(t = {}) {
|
|
1375
|
+
return bn(t), f = {
|
|
1363
1376
|
...f,
|
|
1364
1377
|
endpoint: String(t.endpoint || f.endpoint || "").replace(/\/$/, ""),
|
|
1365
1378
|
projectKey: t.projectKey == null ? f.projectKey : String(t.projectKey),
|
|
@@ -1369,55 +1382,55 @@ function er(t = {}) {
|
|
|
1369
1382
|
hideLauncher: t.hideLauncher == null ? f.hideLauncher : !!t.hideLauncher,
|
|
1370
1383
|
theme: ae(t.theme ?? f.theme),
|
|
1371
1384
|
video: t.video == null ? f.video : !!t.video,
|
|
1372
|
-
consoleLogLimit: t.consoleLogLimit == null ? f.consoleLogLimit :
|
|
1373
|
-
},
|
|
1385
|
+
consoleLogLimit: t.consoleLogLimit == null ? f.consoleLogLimit : fe(t.consoleLogLimit, f.consoleLogLimit)
|
|
1386
|
+
}, Mt(), rt(), pe;
|
|
1374
1387
|
}
|
|
1375
|
-
async function
|
|
1376
|
-
|
|
1388
|
+
async function he() {
|
|
1389
|
+
Mt(), rt(), c.launcher.hidden = !0, y = te(), O = { w: 0, h: 0 }, A = null, $ = null, w = null, g = null, Q = "bug", gt("bug"), wt(null), $t(!1), c.text.value = "", de(), S("");
|
|
1377
1390
|
try {
|
|
1378
|
-
|
|
1391
|
+
v = await mn(), q = v, c.stage.hidden = !1, c.restore.hidden = !0, S("");
|
|
1379
1392
|
} catch {
|
|
1380
|
-
|
|
1393
|
+
v = "", S("Screenshot failed; you can still send text.");
|
|
1381
1394
|
}
|
|
1382
1395
|
c.dialog.hidden = !1, X(), c.text.focus();
|
|
1383
1396
|
}
|
|
1384
1397
|
function ot() {
|
|
1385
|
-
h && (
|
|
1398
|
+
h && (F == null || F.stop(), $t(!1), ce(), w = null, g = null, Lt(!1), c.dialog.hidden = !0, c.stop.hidden = !0, Z());
|
|
1386
1399
|
}
|
|
1387
|
-
function
|
|
1388
|
-
|
|
1400
|
+
function rr(t = {}) {
|
|
1401
|
+
R = { ...R, ...wn(t) }, de();
|
|
1389
1402
|
}
|
|
1390
|
-
async function
|
|
1391
|
-
if (
|
|
1403
|
+
async function me() {
|
|
1404
|
+
if (Mt(), ut)
|
|
1392
1405
|
return null;
|
|
1393
1406
|
const t = c.text.value.trim();
|
|
1394
|
-
if (!t && !
|
|
1395
|
-
return
|
|
1407
|
+
if (!t && !v && !A)
|
|
1408
|
+
return S("Add a note, screenshot, or video first."), null;
|
|
1396
1409
|
if (!f.endpoint || !f.projectKey)
|
|
1397
|
-
return
|
|
1398
|
-
ut = !0,
|
|
1410
|
+
return S("Notefully is missing endpoint or projectKey."), null;
|
|
1411
|
+
ut = !0, Vt(!0), S("Submitting…", !0);
|
|
1399
1412
|
try {
|
|
1400
|
-
const e =
|
|
1413
|
+
const e = er(), n = new FormData();
|
|
1401
1414
|
if (n.append("message", t), n.append("kind", Q), n.append("version", f.version || "0.0.0"), n.append("author", e), f.name && n.append("name", f.name), n.append("context", JSON.stringify({
|
|
1402
|
-
...
|
|
1403
|
-
...
|
|
1404
|
-
displayName:
|
|
1415
|
+
...gn({
|
|
1416
|
+
...R,
|
|
1417
|
+
displayName: R.displayName || e
|
|
1405
1418
|
}),
|
|
1406
1419
|
author: e,
|
|
1407
|
-
console:
|
|
1408
|
-
})), n.append("annotations", JSON.stringify(y.list())), Array.isArray(f.targets) && n.append("targets", JSON.stringify(f.targets)),
|
|
1409
|
-
const i = await
|
|
1410
|
-
|
|
1420
|
+
console: re.snapshot().slice(-fe(f.consoleLogLimit))
|
|
1421
|
+
})), n.append("annotations", JSON.stringify(y.list())), Array.isArray(f.targets) && n.append("targets", JSON.stringify(f.targets)), v) {
|
|
1422
|
+
const i = await Tn(
|
|
1423
|
+
v,
|
|
1411
1424
|
y.crop(),
|
|
1412
1425
|
y.list(),
|
|
1413
1426
|
{
|
|
1414
|
-
mark:
|
|
1415
|
-
markText:
|
|
1427
|
+
mark: _t("--nf-mark", "#fdd341"),
|
|
1428
|
+
markText: _t("--nf-mark-text", "#2a2140")
|
|
1416
1429
|
}
|
|
1417
1430
|
);
|
|
1418
1431
|
n.append("screenshot", i, "screenshot.png");
|
|
1419
1432
|
}
|
|
1420
|
-
|
|
1433
|
+
A && n.append("recording", A, "recording.webm");
|
|
1421
1434
|
const r = await fetch(`${f.endpoint}/v1/reports`, {
|
|
1422
1435
|
method: "POST",
|
|
1423
1436
|
headers: {
|
|
@@ -1432,26 +1445,26 @@ async function he() {
|
|
|
1432
1445
|
o = null;
|
|
1433
1446
|
}
|
|
1434
1447
|
if (!r.ok)
|
|
1435
|
-
throw
|
|
1436
|
-
return
|
|
1448
|
+
throw S((o == null ? void 0 : o.error) || "Submit failed."), new Error((o == null ? void 0 : o.error) || `Submit failed (${r.status})`);
|
|
1449
|
+
return S("Sent. Thank you."), ot(), o;
|
|
1437
1450
|
} finally {
|
|
1438
|
-
ut = !1,
|
|
1451
|
+
ut = !1, Vt(!1);
|
|
1439
1452
|
}
|
|
1440
1453
|
}
|
|
1441
|
-
function
|
|
1454
|
+
function Vt(t) {
|
|
1442
1455
|
c.submit && (c.submit.disabled = !!t, c.submit.setAttribute("aria-busy", t ? "true" : "false"));
|
|
1443
1456
|
}
|
|
1444
|
-
function
|
|
1457
|
+
function ir() {
|
|
1445
1458
|
ot(), h == null || h.remove(), h = null, c = {};
|
|
1446
1459
|
}
|
|
1447
|
-
const pe = { init:
|
|
1460
|
+
const pe = { init: nr, open: he, close: ot, identify: rr, submit: me, destroy: ir };
|
|
1448
1461
|
typeof window < "u" && (window.Notefully = pe);
|
|
1449
1462
|
export {
|
|
1450
1463
|
ot as close,
|
|
1451
1464
|
pe as default,
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1465
|
+
ir as destroy,
|
|
1466
|
+
rr as identify,
|
|
1467
|
+
nr as init,
|
|
1468
|
+
he as open,
|
|
1469
|
+
me as submit
|
|
1457
1470
|
};
|