@commentkit/comment-kit 2.0.0 → 2.1.0
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/CHANGELOG.md +57 -0
- package/README.md +123 -19
- package/SECURITY.md +2 -2
- package/dist/node/cli/api.js +61 -15
- package/dist/node/cli/credentials.js +8 -0
- package/dist/node/cli/doctor.js +152 -25
- package/dist/node/cli/init.js +349 -35
- package/dist/node/cli/main.js +310 -69
- package/dist/node/cli/mcp.js +187 -6
- package/dist/node/cli/website.js +140 -0
- package/dist/node/shared/dashboard-places.js +33 -0
- package/dist/node/types/next.d.ts +4 -4
- package/dist/npm/THIRD_PARTY_NOTICES.txt +47 -0
- package/dist/npm/chunks/{AgentSend-DxRJIYiz.js → AgentSend-pA7Ufvye.js} +16 -16
- package/dist/npm/chunks/Checklist-Cn9skOYK.js +269 -0
- package/dist/npm/chunks/Composer-D7H-pzGa.js +734 -0
- package/dist/npm/chunks/DatePicker-Nta5a1xD.js +161 -0
- package/dist/npm/chunks/{Guest-vvNPz8h-.js → Guest-Bi7hlzhs.js} +63 -59
- package/dist/npm/chunks/{MarkupEditor-VCOXh9d2.js → MarkupEditor-WU3USeTk.js} +46 -39
- package/dist/npm/chunks/Panel-DhAzbUbC.js +1210 -0
- package/dist/npm/chunks/{Settings-BGoZS2iV.js → Settings-BmKqPX40.js} +91 -90
- package/dist/npm/chunks/{Shortcuts-B2OMvczr.js → Shortcuts-Bl-c0Sez.js} +25 -23
- package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +35 -0
- package/dist/npm/chunks/{StyleEditor-CJ_d8Huf.js → StyleEditor-D6fUnlwq.js} +10 -10
- package/dist/npm/chunks/{StylePanel-yQzHHlY7.js → StylePanel-C-Gikxt1.js} +61 -61
- package/dist/npm/chunks/TaskFields-CaKi523b.js +617 -0
- package/dist/npm/chunks/ThreadCard-d_3pUB5V.js +1142 -0
- package/dist/npm/chunks/Viewer-BULQsi9-.js +115 -0
- package/dist/npm/chunks/{agent-C1OQzBAm.js → agent-DHdhIJ3s.js} +1 -1
- package/dist/npm/chunks/{ar-CAJ3XT8e.js → ar-B5UszrQp.js} +53 -12
- package/dist/npm/chunks/card-bits-cV8GdFWX.js +55 -0
- package/dist/npm/chunks/{client-kNAo2TTG.js → client-Cv8ddtuM.js} +13 -11
- package/dist/npm/chunks/{confetti-CkBdSu19.js → confetti-B9zlyILU.js} +1 -1
- package/dist/npm/chunks/{context-B8UAzve0.js → context-CsHnabaA.js} +1 -1
- package/dist/npm/chunks/{de-Dl18G48t.js → de-BE0Aaq8u.js} +53 -12
- package/dist/npm/chunks/{dialog-GO04oC3D.js → dialog-DvdIkCW0.js} +1 -1
- package/dist/npm/chunks/{dpop-U48QIQd7.js → dpop-CwW9ifkq.js} +1 -1
- package/dist/npm/chunks/entrance-Bn_5M9uO.js +90 -0
- package/dist/npm/chunks/{es-Dxk79lS9.js → es-BQviao4d.js} +53 -12
- package/dist/npm/chunks/{extension-E81hWyiT.js → extension-CnQTDC1j.js} +2 -2
- package/dist/npm/chunks/{extension-CKFpPWmi.js → extension-DXhz81XD.js} +1 -1
- package/dist/npm/chunks/{files-DyD5BZgp.js → files-DLEr_wmh.js} +2 -2
- package/dist/npm/chunks/{fr-8BebGKYD.js → fr-C5gu6A06.js} +53 -12
- package/dist/npm/chunks/{hi-BIN6Yy_p.js → hi-DXfQ5EvY.js} +53 -12
- package/dist/npm/chunks/{i18n-DOBt8e9U.js → i18n-Mgs9VOuk.js} +63 -58
- package/dist/npm/chunks/icons-_C6ZWmBY.js +141 -0
- package/dist/npm/chunks/{identify-CN-3xzqL.js → identify-BnQGJOa0.js} +4 -4
- package/dist/npm/chunks/{it-Cr6EwpPQ.js → it-BPHt13FV.js} +53 -12
- package/dist/npm/chunks/{ja-Iy3s5aur.js → ja-BkCqyKR0.js} +52 -11
- package/dist/npm/chunks/late-words-D4Oo_yhJ.js +57 -0
- package/dist/npm/chunks/{live-CelVeZfP.js → live-DXcxj_Af.js} +28 -22
- package/dist/npm/chunks/{nl-B84WHqqe.js → nl-DZxdLLMU.js} +53 -12
- package/dist/npm/chunks/{page-key-DepmJzC1.js → page-key-UqAozdZi.js} +1 -1
- package/dist/npm/chunks/{pick-yTyqtxN0.js → pick-C20RVUas.js} +1 -1
- package/dist/npm/chunks/{pkce-ChKGSW_4.js → pkce-BPvWoBrr.js} +1 -1
- package/dist/npm/chunks/{pt-BR-DOkdlfoe.js → pt-BR-lA9mJ05F.js} +53 -12
- package/dist/npm/chunks/{report-CrIqQZDI.js → report-BjUgUNnT.js} +1 -1
- package/dist/npm/chunks/show-BinoJyED.js +97 -0
- package/dist/npm/chunks/signin-C2jjsxz9.js +101 -0
- package/dist/npm/chunks/{source-pXVve2Cx.js → source-NuflODx3.js} +1 -1
- package/dist/npm/chunks/src-9o2Ocq8d.js +221 -0
- package/dist/npm/chunks/start-Cbx6rMrr.js +1904 -0
- package/dist/npm/chunks/states-DLMCvwes.js +3 -0
- package/dist/npm/chunks/{upload-MgPYqPyE.js → upload-C4NpM-jE.js} +1 -1
- package/dist/npm/chunks/uploads-CY4bDbaI.js +1236 -0
- package/dist/npm/chunks/{wrap-Bl0gbnFa.js → wrap-D-xTKIzj.js} +20 -20
- package/dist/npm/chunks/{zh-CN-Z5fQCb7G.js → zh-CN-yqaDHwBx.js} +53 -12
- package/dist/npm/element.js +7 -1
- package/dist/npm/headless.js +2 -2
- package/dist/npm/index.js +2 -2
- package/dist/npm/react.js +1 -1
- package/dist/npm/svelte.js +1 -1
- package/dist/npm/types/adapters/vue.d.ts +12 -0
- package/dist/npm/types/core/auth.d.ts +1 -0
- package/dist/npm/types/core/client.d.ts +5 -1
- package/dist/npm/types/core/types.d.ts +19 -4
- package/dist/npm/vue.js +5 -1
- package/package.json +4 -1
- package/dist/npm/chunks/Checklist-CnlfeSbc.js +0 -282
- package/dist/npm/chunks/Composer-B1bBVszY.js +0 -725
- package/dist/npm/chunks/Panel-F37vIL1K.js +0 -1206
- package/dist/npm/chunks/TaskFields-fmy6_HtK.js +0 -289
- package/dist/npm/chunks/ThreadCard-D51slKST.js +0 -1113
- package/dist/npm/chunks/Viewer-BOBadqmC.js +0 -111
- package/dist/npm/chunks/card-bits-CAnzrqx3.js +0 -53
- package/dist/npm/chunks/late-words-B2bmZceJ.js +0 -12
- package/dist/npm/chunks/show-BgVC8gWY.js +0 -97
- package/dist/npm/chunks/signin-Dd1rb2BP.js +0 -75
- package/dist/npm/chunks/src-BTMy4Gyc.js +0 -208
- package/dist/npm/chunks/start-DtVlpt7p.js +0 -1878
- package/dist/npm/chunks/states-sfTbjZz8.js +0 -3
- package/dist/npm/chunks/uploads-D49mywwz.js +0 -1146
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
import { a as e } from "./src-9o2Ocq8d.js";
|
|
2
|
+
import { b as t, o as n, v as r } from "./client-Cv8ddtuM.js";
|
|
3
|
+
import { a as i, c as a, o, s } from "./privacy-BWUGlHw5.js";
|
|
4
|
+
import { s as c } from "./anchor-BsQNVkHj.js";
|
|
5
|
+
import { _ as l, b as u, c as d, d as f, f as p, m, u as h, v as g } from "./i18n-Mgs9VOuk.js";
|
|
6
|
+
import { n as _, t as ee } from "./icons-_C6ZWmBY.js";
|
|
7
|
+
import { a as te, c as ne, d as re, f as ie, g as ae, h as oe, i as se, l as ce, m as le, n as ue, o as de, p as v, t as fe } from "./uploads-CY4bDbaI.js";
|
|
8
|
+
import { r as pe } from "./files-DLEr_wmh.js";
|
|
9
|
+
import { n as me, r as he, t as ge } from "./card-bits-cV8GdFWX.js";
|
|
10
|
+
import { i as y } from "./drafts-B0ctr1g9.js";
|
|
11
|
+
import { t as b } from "./states-DLMCvwes.js";
|
|
12
|
+
import { A as _e, C as ve, P as ye, R as be, S as x, b as xe, c as S, d as Se, f as Ce, j as we, l as Te, p as Ee, y as C } from "./start-Cbx6rMrr.js";
|
|
13
|
+
// src/capture/context.ts
|
|
14
|
+
function De() {
|
|
15
|
+
let e = navigator.userAgent, t = w(e, [
|
|
16
|
+
["Edge", /Edg\/([\d.]+)/],
|
|
17
|
+
["Opera", /OPR\/([\d.]+)/],
|
|
18
|
+
["Samsung Internet", /SamsungBrowser\/([\d.]+)/],
|
|
19
|
+
["Chrome", /Chrome\/([\d.]+)/],
|
|
20
|
+
["Firefox", /Firefox\/([\d.]+)/],
|
|
21
|
+
["Safari", /Version\/([\d.]+).*Safari/]
|
|
22
|
+
]), n = w(e, [
|
|
23
|
+
["iOS", /(?:iPhone|iPad|iPod).*OS ([\d_]+)/],
|
|
24
|
+
["Android", /Android ([\d.]+)/],
|
|
25
|
+
["Windows", /Windows NT ([\d.]+)/],
|
|
26
|
+
["macOS", /Mac OS X ([\d_]+)/],
|
|
27
|
+
["ChromeOS", /CrOS [^ ]+ ([\d.]+)/],
|
|
28
|
+
["Linux", /Linux()/]
|
|
29
|
+
]), r = innerWidth, i = matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
30
|
+
return {
|
|
31
|
+
viewport: {
|
|
32
|
+
width: r,
|
|
33
|
+
height: innerHeight,
|
|
34
|
+
dpr: Math.round((devicePixelRatio || 1) * 100) / 100,
|
|
35
|
+
zoom: Math.round((visualViewport?.scale ?? 1) * 100) / 100
|
|
36
|
+
},
|
|
37
|
+
device: {
|
|
38
|
+
browser: t?.[0],
|
|
39
|
+
browser_version: t?.[1]?.split(".")[0],
|
|
40
|
+
os: n?.[0],
|
|
41
|
+
os_version: n?.[1]?.replace(/_/g, "."),
|
|
42
|
+
type: i ? r >= 768 ? "tablet" : "mobile" : "desktop",
|
|
43
|
+
locale: navigator.language,
|
|
44
|
+
color_scheme: matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
45
|
+
user_agent: e.slice(0, 500)
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function w(e, t) {
|
|
50
|
+
for (let [n, r] of t) {
|
|
51
|
+
let t = e.match(r);
|
|
52
|
+
if (t) return [n, t[1] ?? ""];
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
// src/capture/screenshot.ts
|
|
57
|
+
var T = 8e6, E = 15e3;
|
|
58
|
+
function Oe() {
|
|
59
|
+
e() || import("./html2canvas-pro.esm-B7b8p5Wr.js").catch(() => void 0);
|
|
60
|
+
}
|
|
61
|
+
async function ke(t = {}) {
|
|
62
|
+
let n = (t.redact ?? []).filter(s), r = o(t.privacy), i = innerWidth, a = innerHeight, c = null;
|
|
63
|
+
e() && (c = await import("./extension-DXhz81XD.js").then((e) => e.captureTab(n, r)).catch(() => null)), c ?? (c = await D(n, r, i, a));
|
|
64
|
+
let l = c.getContext("2d"), u = c.width / Math.max(1, i);
|
|
65
|
+
return l && Ae(l, u, t), t.crop && t.region && (c = k(c, u, t.region, i, a)), {
|
|
66
|
+
blob: await Me(c),
|
|
67
|
+
width: c.width,
|
|
68
|
+
height: c.height
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function D(e, t, n, r) {
|
|
72
|
+
let [{ default: o }, { captureBackground: s, normalizeCaptureColors: c, settleStylesheets: l }] = await Promise.all([import("./html2canvas-pro.esm-B7b8p5Wr.js"), import("./colors-CWAn_swA.js")]), u = a([], t), d = (t) => t.tagName === "NOSCRIPT" || i(t, u) || e.some((e) => Ne(t, e)), f = Math.min(devicePixelRatio || 1, 2, Math.sqrt(T / Math.max(1, n * r)));
|
|
73
|
+
return A(o(document.documentElement, {
|
|
74
|
+
useCORS: !0,
|
|
75
|
+
logging: !1,
|
|
76
|
+
backgroundColor: s(getComputedStyle(document.body).backgroundColor),
|
|
77
|
+
scale: f,
|
|
78
|
+
x: scrollX,
|
|
79
|
+
y: scrollY,
|
|
80
|
+
width: n,
|
|
81
|
+
height: r,
|
|
82
|
+
windowWidth: document.documentElement.clientWidth,
|
|
83
|
+
windowHeight: r,
|
|
84
|
+
ignoreElements: d,
|
|
85
|
+
onclone: async (e) => {
|
|
86
|
+
await l(e), c(e);
|
|
87
|
+
}
|
|
88
|
+
}), E);
|
|
89
|
+
}
|
|
90
|
+
function Ae(e, t, n) {
|
|
91
|
+
e.setTransform(1, 0, 0, 1, 0, 0);
|
|
92
|
+
let r = n.accent ?? "#ff5733";
|
|
93
|
+
if (n.region) {
|
|
94
|
+
let i = n.region;
|
|
95
|
+
e.save(), e.lineWidth = 3 * t, e.strokeStyle = r, e.setLineDash([8 * t, 6 * t]), e.strokeRect(i.x * t, i.y * t, i.w * t, i.h * t), e.restore();
|
|
96
|
+
}
|
|
97
|
+
if (n.pin) {
|
|
98
|
+
let i = n.pin.x * t, a = n.pin.y * t, o = 11 * t;
|
|
99
|
+
e.save(), e.shadowColor = "rgba(0,0,0,0.25)", e.shadowBlur = 6 * t, e.fillStyle = r, e.beginPath(), e.arc(i, a - o, o, Math.PI, 0), e.lineTo(i, a + o * .4), e.closePath(), e.fill(), e.shadowBlur = 0, e.fillStyle = "#ffffff", e.beginPath(), e.arc(i, a - o, o * .38, 0, Math.PI * 2), e.fill(), e.restore();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
var O = {
|
|
103
|
+
w: 320,
|
|
104
|
+
h: 200
|
|
105
|
+
};
|
|
106
|
+
function je(e, t, n) {
|
|
107
|
+
let r = Math.min(t, Math.max(O.w, e.w + 64)), i = Math.min(n, Math.max(O.h, e.h + 64));
|
|
108
|
+
return {
|
|
109
|
+
x: Math.min(Math.max(0, e.x + e.w / 2 - r / 2), t - r),
|
|
110
|
+
y: Math.min(Math.max(0, e.y + e.h / 2 - i / 2), n - i),
|
|
111
|
+
w: r,
|
|
112
|
+
h: i
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function k(e, t, n, r, i) {
|
|
116
|
+
let a = je(n, r, i), o = document.createElement("canvas");
|
|
117
|
+
return o.width = Math.max(1, Math.round(a.w * t)), o.height = Math.max(1, Math.round(a.h * t)), o.getContext("2d")?.drawImage(e, a.x * t, a.y * t, o.width, o.height, 0, 0, o.width, o.height), o;
|
|
118
|
+
}
|
|
119
|
+
function Me(e) {
|
|
120
|
+
return new Promise((t, n) => {
|
|
121
|
+
e.toBlob((r) => {
|
|
122
|
+
if (r && r.type === "image/webp") return t(r);
|
|
123
|
+
e.toBlob((e) => e ? t(e) : n(/* @__PURE__ */ Error("Could not encode the screenshot.")), "image/png");
|
|
124
|
+
}, "image/webp", .86);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function A(e, t) {
|
|
128
|
+
return new Promise((n, r) => {
|
|
129
|
+
let i = setTimeout(() => r(/* @__PURE__ */ Error("The screenshot took too long. Your feedback will be sent without it.")), t);
|
|
130
|
+
e.then((e) => (clearTimeout(i), n(e)), (e) => (clearTimeout(i), r(e)));
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function Ne(e, t) {
|
|
134
|
+
try {
|
|
135
|
+
return e.matches(t) || !!e.closest(t);
|
|
136
|
+
} catch {
|
|
137
|
+
return !1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
S(b), S(re);
|
|
141
|
+
function Pe({ client: e, draft: i, signedIn: a, onSignIn: o, onCancel: s, onSent: re, onError: v, share: b = null, onPending: ye }) {
|
|
142
|
+
let S = x(e.state, (e) => e.config), w = x(e.state, (e) => e.session?.person ?? null), T = g(() => Ee(e, i.anchor), [i.anchor]), [E, Oe] = l(() => He()), [D, Ae] = l(() => le(T, void 0, Ee(e, i.anchor, n()))), [O, je] = l([]), [k, Me] = l(null), A = e.options.tools ?? {}, Ne = S?.features.screenshots !== !1 && A.screenshots !== !1, Pe = A.attachments !== !1, [j, We] = l(Ne ? "capturing" : "off"), N = x(e.state, (e) => !!e.session?.capabilities.triage), Ge = N && A.checklist !== !1, [P] = l(() => Ue(T)), [Ke, qe] = l(P?.task ?? {}), [F, Je] = l(P?.checklist ?? null), [I, Ye] = l(""), Xe = C(N, () => import("./TaskFields-CaKi523b.js").then((e) => e.TaskDraft), () => void 0), [L, Ze] = l(P?.markup ?? []), [Qe, R] = l(!1), $e = C(Qe, () => import("./MarkupEditor-WU3USeTk.js").then((e) => e.MarkupEditor), (e) => (R(!1), v(e))), z = ue(e, (e) => v(new r(0, "file_rejected", e))), B = g(() => {
|
|
143
|
+
if (!N || A.style === !1 || i.anchor.type !== "element" && i.anchor.type !== "text") return null;
|
|
144
|
+
let e = c(i.anchor).element;
|
|
145
|
+
return e instanceof HTMLElement || e instanceof SVGElement ? e : null;
|
|
146
|
+
}, [i.anchor, N]), [V, et] = l(P?.styles ?? []), [H, tt] = l(!1), nt = C(H, () => import("./StylePanel-C-Gikxt1.js").then((e) => e.StylePanel), v), U = m(null), W = m(null), rt = () => {
|
|
147
|
+
B && (U.current ?? (U.current = de(B)), W.current ?? (W.current = new se(B)), tt(!0));
|
|
148
|
+
};
|
|
149
|
+
p(() => {
|
|
150
|
+
H ? W.current?.apply(V) : W.current?.revert();
|
|
151
|
+
}, [H, V]), p(() => () => W.current?.revert(), []);
|
|
152
|
+
let [G, it] = l(null), at = C(G !== null, () => import("./Viewer-BULQsi9-.js").then((e) => e.Viewer), v), [K, q] = l("idle"), J = K !== "idle", [ot, st] = l(!1);
|
|
153
|
+
f(() => {
|
|
154
|
+
if (K !== "sending") return st(!1);
|
|
155
|
+
let e = setTimeout(() => st(!0), 1e4);
|
|
156
|
+
return () => clearTimeout(e);
|
|
157
|
+
}, [K]);
|
|
158
|
+
let Y = m(null), ct = m(!1), [lt, ut] = l(() => {
|
|
159
|
+
let e = !!y(Ce);
|
|
160
|
+
return y(Ce, null), e && a;
|
|
161
|
+
}), [dt, ft] = l(!1), pt = !!(S?.features.console_capture || S?.features.network_capture), mt = x(e.state, (e) => !e.session || e.session.role === "guest"), [ht, gt] = l(S?.features.capture_consent_default === !0 && !mt), X = xe(), _t = !a && !b, Z = !a && !!b && !e.auth.pending(), [vt, yt] = l(null), bt = {
|
|
162
|
+
name: m(null),
|
|
163
|
+
email: m(null)
|
|
164
|
+
}, xt = m(null), Q = m(null), St = m(null);
|
|
165
|
+
p(() => void (lt && St.current?.focus({ preventScroll: !0 })), []);
|
|
166
|
+
let Ct = () => {
|
|
167
|
+
y(Se, null), y(M, null);
|
|
168
|
+
};
|
|
169
|
+
p(() => () => {
|
|
170
|
+
Y.current?.abort(), ct.current || Ct();
|
|
171
|
+
}, []);
|
|
172
|
+
let wt = (e) => {
|
|
173
|
+
Y.current?.abort(), Ct(), s(e);
|
|
174
|
+
}, Tt = m(null);
|
|
175
|
+
ae(Tt);
|
|
176
|
+
let Et = m(null), Dt = m(null), [Ot] = l(() => (e) => {
|
|
177
|
+
e && !Et.current && we(e), Et.current = e;
|
|
178
|
+
}), kt = m(null), At = m(null), jt = m(null), Mt = m(!1);
|
|
179
|
+
p(() => {
|
|
180
|
+
j === "off" && Mt.current && jt.current?.focus(), Mt.current = !1;
|
|
181
|
+
}, [j]);
|
|
182
|
+
let Nt = (e, t) => {
|
|
183
|
+
let n = e.closest(".ck-draft-item");
|
|
184
|
+
((n?.nextElementSibling ?? n?.previousElementSibling)?.querySelector(".ck-draft-item button, input") ?? t())?.focus();
|
|
185
|
+
}, Pt = m(Promise.resolve(null));
|
|
186
|
+
f(() => {
|
|
187
|
+
if (j !== "capturing") return;
|
|
188
|
+
let t = !1, n = 0, r = 0;
|
|
189
|
+
return Pt.current = new Promise((a) => {
|
|
190
|
+
let o = !1, s = () => {
|
|
191
|
+
if (!o) {
|
|
192
|
+
if (o = !0, t) return a(null);
|
|
193
|
+
ke({
|
|
194
|
+
redact: [...S?.privacy.redact_selectors ?? [], ...e.options.redact ?? []],
|
|
195
|
+
privacy: Te(S, e.options.privacy),
|
|
196
|
+
pin: i.region ? null : i.point,
|
|
197
|
+
region: i.region,
|
|
198
|
+
crop: !!i.region
|
|
199
|
+
}).then(a, () => a(null));
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
n = requestAnimationFrame(() => n = requestAnimationFrame(s)), r = window.setTimeout(s, 300);
|
|
203
|
+
}), Pt.current.then((e) => {
|
|
204
|
+
t || (e && Me(e), We(e ? "ready" : "failed"));
|
|
205
|
+
}), () => {
|
|
206
|
+
t = !0, cancelAnimationFrame(n), clearTimeout(r);
|
|
207
|
+
};
|
|
208
|
+
}, []);
|
|
209
|
+
let $ = g(() => k && URL.createObjectURL(k.blob), [k]);
|
|
210
|
+
p(() => () => void ($ && URL.revokeObjectURL($)), [$]);
|
|
211
|
+
let Ft = (e) => {
|
|
212
|
+
Ae(e), oe(T, e);
|
|
213
|
+
};
|
|
214
|
+
p(() => {
|
|
215
|
+
Q.current = null;
|
|
216
|
+
}, [
|
|
217
|
+
D,
|
|
218
|
+
O,
|
|
219
|
+
k,
|
|
220
|
+
j,
|
|
221
|
+
L,
|
|
222
|
+
z.items,
|
|
223
|
+
ht,
|
|
224
|
+
Ke,
|
|
225
|
+
F,
|
|
226
|
+
V
|
|
227
|
+
]);
|
|
228
|
+
let It = g(() => he(i.point, i.region ? {
|
|
229
|
+
top: i.region.y,
|
|
230
|
+
bottom: i.region.y + i.region.h
|
|
231
|
+
} : void 0), [i.point]), Lt = (e) => z.add(e), Rt = async () => {
|
|
232
|
+
let n = null, r = null, a = j === "capturing" ? await Pt.current : j === "ready" ? k : null;
|
|
233
|
+
if (a) try {
|
|
234
|
+
let t = a.blob.type, r = `screenshot.${t === "image/webp" ? "webp" : t === "image/jpeg" ? "jpg" : "png"}`;
|
|
235
|
+
n = (await e.upload(a.blob, r, "screenshot")).id;
|
|
236
|
+
} catch {
|
|
237
|
+
r = "screenshot";
|
|
238
|
+
}
|
|
239
|
+
let o = await z.ready(), s = o.ids;
|
|
240
|
+
o.missing && (r ?? (r = "files"));
|
|
241
|
+
let c = {
|
|
242
|
+
...De(),
|
|
243
|
+
...pt && ht ? be() : {},
|
|
244
|
+
screenshot_id: n,
|
|
245
|
+
markup: L.length ? L : void 0
|
|
246
|
+
}, l = N ? Le(Ke) : void 0, u = [...F ?? [], ...F && I.trim() ? [I.trim()] : []], d = B ? te(V) : [];
|
|
247
|
+
return {
|
|
248
|
+
key: t(16),
|
|
249
|
+
input: {
|
|
250
|
+
anchor: i.anchor,
|
|
251
|
+
body: D.trim(),
|
|
252
|
+
capture: c,
|
|
253
|
+
attachmentIds: s,
|
|
254
|
+
mentionIds: O,
|
|
255
|
+
task: l,
|
|
256
|
+
checklist: u,
|
|
257
|
+
styleChanges: d
|
|
258
|
+
},
|
|
259
|
+
missing: r
|
|
260
|
+
};
|
|
261
|
+
}, zt = async () => {
|
|
262
|
+
if (J || !D.trim() || !X) return;
|
|
263
|
+
ft(!1);
|
|
264
|
+
let t = Z ? E.name.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(E.email.trim()) ? null : "email" : "name" : null;
|
|
265
|
+
if (yt(t), t) return bt[t].current?.focus();
|
|
266
|
+
ut(!1), q("sending");
|
|
267
|
+
let n = !1, s = new AbortController(), c = D.trim(), l = new Set(e.state.get().threads.map((e) => e.id)), u = () => void 0;
|
|
268
|
+
try {
|
|
269
|
+
let t = !a && !b;
|
|
270
|
+
if (Z && b) {
|
|
271
|
+
let { startGuest: n } = await import("./Guest-Bi7hlzhs.js");
|
|
272
|
+
y(Ve, JSON.stringify({
|
|
273
|
+
name: E.name,
|
|
274
|
+
email: E.email
|
|
275
|
+
})), t = await n(e, {
|
|
276
|
+
share: b,
|
|
277
|
+
...E
|
|
278
|
+
}) === "popup";
|
|
279
|
+
}
|
|
280
|
+
if (t) {
|
|
281
|
+
y(Se, JSON.stringify({
|
|
282
|
+
draft: i,
|
|
283
|
+
scrollY
|
|
284
|
+
})), oe(T, D), y(M, JSON.stringify({
|
|
285
|
+
id: T,
|
|
286
|
+
checklist: F,
|
|
287
|
+
task: Ke,
|
|
288
|
+
markup: L,
|
|
289
|
+
styles: V
|
|
290
|
+
})), q("signing-in");
|
|
291
|
+
let e = await o((Y.current = new AbortController()).signal);
|
|
292
|
+
if (Y.current = null, St.current?.focus({ preventScroll: !0 }), e === "redirecting" ? ct.current = !0 : Ct(), e !== "signed_in") return;
|
|
293
|
+
q("sending");
|
|
294
|
+
}
|
|
295
|
+
let r = Q.current ?? (Q.current = await Rt()), d = (e) => {
|
|
296
|
+
n || (n = !0, u(), Q.current = null, ie(T), y(Ve, null), re(e, r.missing));
|
|
297
|
+
}, f = e.state.get().session?.person;
|
|
298
|
+
f && (u = e.state.subscribe(() => {
|
|
299
|
+
let t = e.state.get().threads.find((e) => !l.has(e.id) && e.first_message?.body === c && e.author.id === f.id);
|
|
300
|
+
t && !t.pending_verification && (d(t), s.abort());
|
|
301
|
+
}));
|
|
302
|
+
let p = await e.createThread({
|
|
303
|
+
...r.input,
|
|
304
|
+
idempotencyKey: r.key,
|
|
305
|
+
signal: s.signal
|
|
306
|
+
});
|
|
307
|
+
if (n) return;
|
|
308
|
+
if (u(), Q.current = null, p.pending_verification) return ye?.(e.auth.pending()?.email ?? E.email);
|
|
309
|
+
d(p);
|
|
310
|
+
} catch (t) {
|
|
311
|
+
if (n) return;
|
|
312
|
+
if (t instanceof r && ["pending_limit", "verification_required"].includes(t.code) && e.auth.pending()) return ye?.(e.auth.pending().email);
|
|
313
|
+
let i = me(t);
|
|
314
|
+
ft(i ?? !0), i || v(t);
|
|
315
|
+
} finally {
|
|
316
|
+
u(), q("idle");
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
return /* @__PURE__ */ h(u, { children: [i.region ? /* @__PURE__ */ h("div", {
|
|
320
|
+
class: "ck-pending-region",
|
|
321
|
+
style: _e(i.region.x, i.region.y, i.region.w, i.region.h),
|
|
322
|
+
"aria-hidden": "true",
|
|
323
|
+
"data-commentkit-ui": !0
|
|
324
|
+
}) : i.anchor.type === "page" ? null : /* @__PURE__ */ h("div", {
|
|
325
|
+
class: "ck-pending-pin",
|
|
326
|
+
style: _e(i.point.x, i.point.y),
|
|
327
|
+
"aria-hidden": "true",
|
|
328
|
+
"data-commentkit-ui": !0,
|
|
329
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
330
|
+
viewBox: "5 3 54 62",
|
|
331
|
+
children: /* @__PURE__ */ h("path", { d: Ie })
|
|
332
|
+
}), w ? /* @__PURE__ */ h(ve, { person: w }) : null]
|
|
333
|
+
}), /* @__PURE__ */ h("div", {
|
|
334
|
+
class: "ck-card ck-composer",
|
|
335
|
+
ref: Tt,
|
|
336
|
+
style: It,
|
|
337
|
+
role: "region",
|
|
338
|
+
"aria-label": d("comment"),
|
|
339
|
+
"data-commentkit-ui": !0,
|
|
340
|
+
onKeyDown: (e) => e.key === "Escape" && wt(!0),
|
|
341
|
+
...Pe ? pe(Lt) : {},
|
|
342
|
+
children: [
|
|
343
|
+
/* @__PURE__ */ h("div", {
|
|
344
|
+
class: "ck-card-body",
|
|
345
|
+
children: [
|
|
346
|
+
i.anchor.quote ? /* @__PURE__ */ h("blockquote", {
|
|
347
|
+
class: "ck-quote",
|
|
348
|
+
"aria-label": d("quotedText"),
|
|
349
|
+
children: /* @__PURE__ */ h("bdi", { children: i.anchor.quote.slice(0, 200) })
|
|
350
|
+
}) : null,
|
|
351
|
+
X ? null : /* @__PURE__ */ h("div", {
|
|
352
|
+
class: "ck-note",
|
|
353
|
+
"data-tone": "warning",
|
|
354
|
+
role: "status",
|
|
355
|
+
children: d("offlineSend")
|
|
356
|
+
}),
|
|
357
|
+
dt && X ? /* @__PURE__ */ h("div", {
|
|
358
|
+
class: "ck-note",
|
|
359
|
+
"data-tone": "warning",
|
|
360
|
+
role: "alert",
|
|
361
|
+
children: dt === !0 ? /* @__PURE__ */ h(u, { children: [
|
|
362
|
+
d("sendFailed"),
|
|
363
|
+
" ",
|
|
364
|
+
/* @__PURE__ */ h("button", {
|
|
365
|
+
class: "ck-btn",
|
|
366
|
+
onClick: () => (St.current?.focus(), void zt()),
|
|
367
|
+
children: d("retry")
|
|
368
|
+
})
|
|
369
|
+
] }) : `${dt} ${d("savedHere")}`
|
|
370
|
+
}) : null,
|
|
371
|
+
/* @__PURE__ */ h(ce, {
|
|
372
|
+
client: e,
|
|
373
|
+
value: D,
|
|
374
|
+
onChange: Ft,
|
|
375
|
+
onMentions: je,
|
|
376
|
+
onSubmit: () => void zt(),
|
|
377
|
+
placeholder: d("composerPlaceholder"),
|
|
378
|
+
autofocus: !0,
|
|
379
|
+
disabled: J,
|
|
380
|
+
canMention: a,
|
|
381
|
+
tools: /* @__PURE__ */ h(u, { children: [
|
|
382
|
+
Pe ? /* @__PURE__ */ h(ge, {
|
|
383
|
+
input: xt,
|
|
384
|
+
onFiles: Lt,
|
|
385
|
+
types: S?.limits?.upload_types
|
|
386
|
+
}) : null,
|
|
387
|
+
Ge ? /* @__PURE__ */ h("button", {
|
|
388
|
+
ref: Dt,
|
|
389
|
+
class: "ck-icon ck-icon-sm",
|
|
390
|
+
"data-tool": "checklist",
|
|
391
|
+
"aria-label": d("addChecklist"),
|
|
392
|
+
"aria-pressed": F === null ? !1 : !F.length || void 0,
|
|
393
|
+
onClick: () => F?.length ? Et.current?.focus() : F === null ? Je([]) : (Ye(""), Je(null)),
|
|
394
|
+
children: /* @__PURE__ */ h(_, { name: "listChecks" })
|
|
395
|
+
}) : null,
|
|
396
|
+
B ? /* @__PURE__ */ h("button", {
|
|
397
|
+
ref: kt,
|
|
398
|
+
class: "ck-icon ck-icon-sm",
|
|
399
|
+
"data-tool": "style",
|
|
400
|
+
"aria-label": d("adjustStyle"),
|
|
401
|
+
"aria-pressed": H,
|
|
402
|
+
onClick: () => H ? tt(!1) : rt(),
|
|
403
|
+
children: /* @__PURE__ */ h(_, { name: "sliders" })
|
|
404
|
+
}) : null
|
|
405
|
+
] })
|
|
406
|
+
}),
|
|
407
|
+
F === null ? null : /* @__PURE__ */ h("div", {
|
|
408
|
+
class: "ck-draft-list",
|
|
409
|
+
role: "group",
|
|
410
|
+
"aria-label": d("checklist"),
|
|
411
|
+
children: [F.map((e, t) => /* @__PURE__ */ h("div", {
|
|
412
|
+
class: "ck-draft-item",
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ h("span", {
|
|
415
|
+
"aria-hidden": "true",
|
|
416
|
+
class: "ck-draft-box"
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ h("bdi", { children: e }),
|
|
419
|
+
/* @__PURE__ */ h("button", {
|
|
420
|
+
class: "ck-ghost ck-ghost-sm",
|
|
421
|
+
"aria-label": d("removeItem", { item: e }),
|
|
422
|
+
onClick: (e) => {
|
|
423
|
+
Nt(e.currentTarget, () => Et.current ?? Dt.current), Je(F.filter((e, n) => n !== t));
|
|
424
|
+
},
|
|
425
|
+
children: /* @__PURE__ */ h(_, {
|
|
426
|
+
name: "clear",
|
|
427
|
+
size: 12
|
|
428
|
+
})
|
|
429
|
+
})
|
|
430
|
+
]
|
|
431
|
+
})), F.length < 30 ? /* @__PURE__ */ h("input", {
|
|
432
|
+
class: "ck-input",
|
|
433
|
+
maxLength: 300,
|
|
434
|
+
placeholder: d("checklistAdd"),
|
|
435
|
+
"aria-label": d("checklistAdd"),
|
|
436
|
+
enterKeyHint: "done",
|
|
437
|
+
value: I,
|
|
438
|
+
ref: Ot,
|
|
439
|
+
onInput: (e) => Ye(e.target.value),
|
|
440
|
+
onKeyDown: (e) => {
|
|
441
|
+
e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && I.trim() && (e.preventDefault(), Je([...F, I.trim()]), Ye(""));
|
|
442
|
+
}
|
|
443
|
+
}) : null]
|
|
444
|
+
}),
|
|
445
|
+
V.length ? /* @__PURE__ */ h("div", {
|
|
446
|
+
class: "ck-draft-list ck-style-list",
|
|
447
|
+
role: "group",
|
|
448
|
+
"aria-label": d("styleChanges"),
|
|
449
|
+
children: V.map((e) => /* @__PURE__ */ h("div", {
|
|
450
|
+
class: "ck-draft-item",
|
|
451
|
+
children: [/* @__PURE__ */ h("code", { children: ne(e) }), /* @__PURE__ */ h("button", {
|
|
452
|
+
class: "ck-ghost ck-ghost-sm",
|
|
453
|
+
"aria-label": d("styleRemoveChange", { change: ne(e) }),
|
|
454
|
+
onClick: (t) => {
|
|
455
|
+
Nt(t.currentTarget, () => kt.current), et(V.filter((t) => t.property !== e.property));
|
|
456
|
+
},
|
|
457
|
+
children: /* @__PURE__ */ h(_, {
|
|
458
|
+
name: "clear",
|
|
459
|
+
size: 12
|
|
460
|
+
})
|
|
461
|
+
})]
|
|
462
|
+
}))
|
|
463
|
+
}) : null,
|
|
464
|
+
H && nt && U.current ? /* @__PURE__ */ h(nt, {
|
|
465
|
+
base: U.current,
|
|
466
|
+
changes: V,
|
|
467
|
+
onChange: et,
|
|
468
|
+
onClose: () => tt(!1)
|
|
469
|
+
}) : null,
|
|
470
|
+
j === "capturing" ? /* @__PURE__ */ h("div", {
|
|
471
|
+
class: "ck-shot-row",
|
|
472
|
+
"aria-busy": "true",
|
|
473
|
+
children: [/* @__PURE__ */ h("span", { class: "ck-shot-thumb ck-skeleton" }), /* @__PURE__ */ h("span", {
|
|
474
|
+
class: "ck-muted",
|
|
475
|
+
children: d("capturing")
|
|
476
|
+
})]
|
|
477
|
+
}) : null,
|
|
478
|
+
j === "failed" ? /* @__PURE__ */ h("p", {
|
|
479
|
+
class: "ck-muted",
|
|
480
|
+
children: d("capturingFailed")
|
|
481
|
+
}) : null,
|
|
482
|
+
j === "ready" && $ ? /* @__PURE__ */ h("div", {
|
|
483
|
+
class: "ck-shot-row",
|
|
484
|
+
children: [/* @__PURE__ */ h("button", {
|
|
485
|
+
class: "ck-shot-thumb",
|
|
486
|
+
"aria-label": d("openImage", { name: d("screenshot") }),
|
|
487
|
+
onClick: () => it(-1),
|
|
488
|
+
children: /* @__PURE__ */ h("img", {
|
|
489
|
+
src: $,
|
|
490
|
+
alt: d("screenshotIncluded"),
|
|
491
|
+
style: { objectPosition: Re(i) }
|
|
492
|
+
})
|
|
493
|
+
}), /* @__PURE__ */ h("div", {
|
|
494
|
+
class: "ck-shot-side",
|
|
495
|
+
children: [/* @__PURE__ */ h("span", {
|
|
496
|
+
class: "ck-shot-label",
|
|
497
|
+
children: d("screenshotLabel")
|
|
498
|
+
}), /* @__PURE__ */ h("span", {
|
|
499
|
+
class: "ck-shot-actions",
|
|
500
|
+
children: [A.markup === !1 ? null : /* @__PURE__ */ h("button", {
|
|
501
|
+
class: "ck-ghost ck-ghost-sm",
|
|
502
|
+
ref: At,
|
|
503
|
+
onClick: () => R(!0),
|
|
504
|
+
children: [/* @__PURE__ */ h(_, {
|
|
505
|
+
name: "pen",
|
|
506
|
+
size: 14
|
|
507
|
+
}), d("markupShort")]
|
|
508
|
+
}), /* @__PURE__ */ h("button", {
|
|
509
|
+
class: "ck-ghost ck-ghost-sm",
|
|
510
|
+
"aria-label": d("screenshotRemove"),
|
|
511
|
+
onClick: () => (We("off"), Mt.current = !0),
|
|
512
|
+
children: [/* @__PURE__ */ h(_, {
|
|
513
|
+
name: "clear",
|
|
514
|
+
size: 14
|
|
515
|
+
}), d("screenshotRemoveShort")]
|
|
516
|
+
})]
|
|
517
|
+
})]
|
|
518
|
+
})]
|
|
519
|
+
}) : null,
|
|
520
|
+
j === "off" && k ? /* @__PURE__ */ h("button", {
|
|
521
|
+
class: "ck-ghost ck-ghost-sm ck-shot-add",
|
|
522
|
+
ref: jt,
|
|
523
|
+
onClick: () => We("ready"),
|
|
524
|
+
children: [/* @__PURE__ */ h(_, {
|
|
525
|
+
name: "imagePlus",
|
|
526
|
+
size: 14
|
|
527
|
+
}), d("screenshotAdd")]
|
|
528
|
+
}) : null,
|
|
529
|
+
pt ? /* @__PURE__ */ h("label", {
|
|
530
|
+
class: "ck-check",
|
|
531
|
+
children: [/* @__PURE__ */ h(ee, {
|
|
532
|
+
checked: ht,
|
|
533
|
+
onChange: (e) => gt(e.target.checked)
|
|
534
|
+
}), d("includeDiagnostics")]
|
|
535
|
+
}) : null,
|
|
536
|
+
pt ? /* @__PURE__ */ h(Fe, {}) : null,
|
|
537
|
+
/* @__PURE__ */ h(fe, {
|
|
538
|
+
items: z.items,
|
|
539
|
+
onRemove: z.remove,
|
|
540
|
+
onRetry: z.retry,
|
|
541
|
+
onOpen: it
|
|
542
|
+
}),
|
|
543
|
+
N && Xe ? /* @__PURE__ */ h(Xe, {
|
|
544
|
+
client: e,
|
|
545
|
+
value: Ke,
|
|
546
|
+
onChange: qe
|
|
547
|
+
}) : null,
|
|
548
|
+
lt && !J ? /* @__PURE__ */ h("div", {
|
|
549
|
+
class: "ck-note",
|
|
550
|
+
role: "status",
|
|
551
|
+
children: d("signedInPressSend")
|
|
552
|
+
}) : null,
|
|
553
|
+
K === "signing-in" ? /* @__PURE__ */ h("div", {
|
|
554
|
+
class: "ck-note",
|
|
555
|
+
role: "status",
|
|
556
|
+
children: [/* @__PURE__ */ h("div", { children: d("signInWaiting") }), /* @__PURE__ */ h("button", {
|
|
557
|
+
class: "ck-btn",
|
|
558
|
+
onClick: () => Y.current?.abort(),
|
|
559
|
+
children: d("signInCancel")
|
|
560
|
+
})]
|
|
561
|
+
}) : null,
|
|
562
|
+
Z || _t && !J ? /* @__PURE__ */ h("div", {
|
|
563
|
+
class: "ck-note",
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ h("strong", { children: d(Z ? "guestIntro" : "signInToSendTitle") }),
|
|
566
|
+
/* @__PURE__ */ h("div", { children: d(Z ? "guestExplain" : "signInToSendBody") }),
|
|
567
|
+
Z ? /* @__PURE__ */ h("div", {
|
|
568
|
+
class: "ck-guest",
|
|
569
|
+
children: [["name", "email"].map((e) => /* @__PURE__ */ h("div", {
|
|
570
|
+
class: "ck-field",
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ h("label", {
|
|
573
|
+
for: `ck-guest-${e}`,
|
|
574
|
+
children: d(e === "name" ? "guestName" : "guestEmail")
|
|
575
|
+
}),
|
|
576
|
+
/* @__PURE__ */ h("input", {
|
|
577
|
+
id: `ck-guest-${e}`,
|
|
578
|
+
ref: bt[e],
|
|
579
|
+
class: "ck-input",
|
|
580
|
+
type: e === "email" ? "email" : "text",
|
|
581
|
+
autoComplete: e,
|
|
582
|
+
maxLength: e === "name" ? 120 : 254,
|
|
583
|
+
enterKeyHint: "send",
|
|
584
|
+
autoCapitalize: e === "name" ? "words" : "off",
|
|
585
|
+
value: E[e],
|
|
586
|
+
"aria-invalid": vt === e,
|
|
587
|
+
"aria-describedby": vt === e ? "ck-guest-error" : void 0,
|
|
588
|
+
onInput: (t) => {
|
|
589
|
+
let n = t.target.value;
|
|
590
|
+
Oe((t) => ({
|
|
591
|
+
...t,
|
|
592
|
+
[e]: n
|
|
593
|
+
}));
|
|
594
|
+
},
|
|
595
|
+
onKeyDown: (e) => {
|
|
596
|
+
e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && zt();
|
|
597
|
+
}
|
|
598
|
+
}),
|
|
599
|
+
vt === e ? /* @__PURE__ */ h("span", {
|
|
600
|
+
class: "ck-error",
|
|
601
|
+
id: "ck-guest-error",
|
|
602
|
+
role: "alert",
|
|
603
|
+
children: d(e === "name" ? "guestNameMissing" : "guestEmailInvalid")
|
|
604
|
+
}) : null
|
|
605
|
+
]
|
|
606
|
+
})), /* @__PURE__ */ h("p", {
|
|
607
|
+
class: "ck-muted ck-guest-privacy",
|
|
608
|
+
children: [
|
|
609
|
+
d("guestPrivacy"),
|
|
610
|
+
" ",
|
|
611
|
+
/* @__PURE__ */ h("a", {
|
|
612
|
+
href: Be(e.options.endpoint),
|
|
613
|
+
target: "_blank",
|
|
614
|
+
rel: "noopener noreferrer",
|
|
615
|
+
children: d("guestPrivacyLink")
|
|
616
|
+
}),
|
|
617
|
+
ze(S) ? /* @__PURE__ */ h(u, { children: [" · ", /* @__PURE__ */ h("a", {
|
|
618
|
+
href: ze(S),
|
|
619
|
+
target: "_blank",
|
|
620
|
+
rel: "noopener noreferrer",
|
|
621
|
+
children: d("guestPrivacySite", { website: S?.project.name ?? "" })
|
|
622
|
+
})] }) : null
|
|
623
|
+
]
|
|
624
|
+
})]
|
|
625
|
+
}) : null
|
|
626
|
+
]
|
|
627
|
+
}) : null
|
|
628
|
+
]
|
|
629
|
+
}),
|
|
630
|
+
/* @__PURE__ */ h("div", {
|
|
631
|
+
class: "ck-card-foot",
|
|
632
|
+
children: [
|
|
633
|
+
/* @__PURE__ */ h("span", { class: "ck-spacer" }),
|
|
634
|
+
/* @__PURE__ */ h("button", {
|
|
635
|
+
class: "ck-btn",
|
|
636
|
+
onClick: () => wt(),
|
|
637
|
+
children: d("cancel")
|
|
638
|
+
}),
|
|
639
|
+
/* @__PURE__ */ h("button", {
|
|
640
|
+
ref: St,
|
|
641
|
+
class: D.trim() && X || J ? "ck-btn ck-primary" : "ck-btn ck-quiet",
|
|
642
|
+
"aria-disabled": J || !D.trim() || !X || void 0,
|
|
643
|
+
onClick: () => void zt(),
|
|
644
|
+
children: d(K === "signing-in" ? "signingIn" : K === "sending" ? ot ? "stillSending" : "sending" : _t ? "signInToSend" : "send")
|
|
645
|
+
})
|
|
646
|
+
]
|
|
647
|
+
}),
|
|
648
|
+
G !== null && at ? /* @__PURE__ */ h(at, {
|
|
649
|
+
images: G < 0 && $ ? [{
|
|
650
|
+
src: $,
|
|
651
|
+
name: d("screenshot")
|
|
652
|
+
}] : z.items.filter((e) => e.preview).map((e) => ({
|
|
653
|
+
src: e.preview,
|
|
654
|
+
name: e.file.name
|
|
655
|
+
})),
|
|
656
|
+
start: Math.max(0, G),
|
|
657
|
+
onClose: () => it(null)
|
|
658
|
+
}) : null,
|
|
659
|
+
Qe && $e && k ? /* @__PURE__ */ h($e, {
|
|
660
|
+
image: k.blob,
|
|
661
|
+
onCancel: () => (R(!1), setTimeout(() => At.current?.focus())),
|
|
662
|
+
onDone: (e, t) => {
|
|
663
|
+
Me({
|
|
664
|
+
...k,
|
|
665
|
+
blob: e
|
|
666
|
+
}), Ze(t), R(!1), setTimeout(() => At.current?.focus());
|
|
667
|
+
}
|
|
668
|
+
}) : null
|
|
669
|
+
]
|
|
670
|
+
})] });
|
|
671
|
+
}
|
|
672
|
+
function Fe() {
|
|
673
|
+
let [e, t] = l(!1), n = e ? j(be()) : [];
|
|
674
|
+
return /* @__PURE__ */ h("details", {
|
|
675
|
+
class: "ck-diag",
|
|
676
|
+
onToggle: (e) => t(e.currentTarget.open),
|
|
677
|
+
children: [/* @__PURE__ */ h("summary", { children: d("diagnosticsSee") }), e ? n.length ? /* @__PURE__ */ h("ul", { children: n.map((e) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h("bdi", { children: e }) })) }) : /* @__PURE__ */ h("p", {
|
|
678
|
+
class: "ck-muted",
|
|
679
|
+
children: d("diagnosticsEmpty")
|
|
680
|
+
}) : null]
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
function j(e) {
|
|
684
|
+
return [...(e.console ?? []).map((e) => `${e.level}: ${e.message}`), ...(e.network ?? []).map((e) => `${e.method} ${e.url} ${e.status}`)];
|
|
685
|
+
}
|
|
686
|
+
var Ie = "M31.5 4.8C17.3 4.4 7 15.2 7 29c0 13 8.5 21.2 20.9 23 1.6.2 2.1 1.2 2.1 2.5v6.9c0 1.7 1.2 2.1 2.5.9 5.7-4.9 16-13.6 21.1-22.1 3.5-5.8 4.7-11.8 3.2-18.1C54.3 11.5 44.7 4.6 31.5 4.8Z";
|
|
687
|
+
function Le(e) {
|
|
688
|
+
let t = {};
|
|
689
|
+
return e.priority && e.priority !== "none" && (t.priority = e.priority), e.assignee_ids?.length && (t.assignee_ids = e.assignee_ids), e.label_ids?.length && (t.label_ids = e.label_ids), Object.keys(t).length ? t : void 0;
|
|
690
|
+
}
|
|
691
|
+
function Re(e) {
|
|
692
|
+
return e.region ? "50% 50%" : `50% ${Math.round(Math.min(100, Math.max(0, e.point.y / Math.max(1, innerHeight) * 100)))}%`;
|
|
693
|
+
}
|
|
694
|
+
var M = "commentkit:pending-extras";
|
|
695
|
+
function ze(e) {
|
|
696
|
+
let t = ye(e?.privacy?.notice_url);
|
|
697
|
+
return t?.startsWith("https:") ? t : null;
|
|
698
|
+
}
|
|
699
|
+
function Be(e) {
|
|
700
|
+
try {
|
|
701
|
+
return `${new URL(e ?? "https://commentkit.dev").origin}/privacy`;
|
|
702
|
+
} catch {
|
|
703
|
+
return "https://commentkit.dev/privacy";
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
var Ve = "commentkit:guest-details";
|
|
707
|
+
function He() {
|
|
708
|
+
try {
|
|
709
|
+
let e = JSON.parse(y(Ve) ?? "null"), t = (e, t) => typeof e == "string" ? e.slice(0, t) : "";
|
|
710
|
+
return {
|
|
711
|
+
name: t(e?.name, 120),
|
|
712
|
+
email: t(e?.email, 254)
|
|
713
|
+
};
|
|
714
|
+
} catch {
|
|
715
|
+
return {
|
|
716
|
+
name: "",
|
|
717
|
+
email: ""
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function Ue(e) {
|
|
722
|
+
try {
|
|
723
|
+
let t = JSON.parse(y(M) ?? "null");
|
|
724
|
+
return y(M, null), !t || v(t.id) !== v(e) ? null : {
|
|
725
|
+
checklist: Array.isArray(t.checklist) ? t.checklist.filter((e) => typeof e == "string").slice(0, 30) : null,
|
|
726
|
+
task: t.task && typeof t.task == "object" ? t.task : {},
|
|
727
|
+
markup: Array.isArray(t.markup) ? t.markup.filter((e) => !!e && typeof e == "object" && Array.isArray(e.points)).slice(0, 100) : [],
|
|
728
|
+
styles: te(t.styles)
|
|
729
|
+
};
|
|
730
|
+
} catch {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
export { Pe as Composer, j as diagnosticsLines, Be as privacyNotice, ze as siteNotice, Oe as warmCapture };
|