@commentkit/comment-kit 1.0.0-beta.0 → 1.0.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 +83 -0
- package/README.md +99 -7
- package/SECURITY.md +7 -2
- package/dist/npm/chunks/Guest-VNoofLxw.js +157 -0
- package/dist/npm/chunks/MarkupEditor-DTXrS3DD.js +199 -0
- package/dist/npm/chunks/Panel-B88JYH52.js +438 -0
- package/dist/npm/chunks/Shortcuts-BSOKdMHt.js +56 -0
- package/dist/npm/chunks/ThreadCard-izybwXIC.js +817 -0
- package/dist/npm/chunks/ar-O7EPv0mI.js +222 -0
- package/dist/npm/chunks/art-DK1JwPIo.js +155 -0
- package/dist/npm/chunks/{client-D1vrh_5G.js → client-Iegfv6ZC.js} +95 -65
- package/dist/npm/chunks/de-PGyZVNHX.js +211 -0
- package/dist/npm/chunks/es-Bq1idl8M.js +211 -0
- package/dist/npm/chunks/extension-B7SelsS0.js +54 -0
- package/dist/npm/chunks/extension-DSA8S8Qz.js +26 -0
- package/dist/npm/chunks/format-B5tJGtPC.js +524 -0
- package/dist/npm/chunks/fr-BVB9GGco.js +211 -0
- package/dist/npm/chunks/hi-DyBvrjzQ.js +211 -0
- package/dist/npm/chunks/{html2canvas-_mjSRP3G.js → html2canvas-DfGb8yka.js} +1145 -1132
- package/dist/npm/chunks/it-BlMMMwZh.js +211 -0
- package/dist/npm/chunks/ja-lAioBCJv.js +211 -0
- package/dist/npm/chunks/live-YFyP1GnP.js +34 -0
- package/dist/npm/chunks/mount-Dx_8NhX3.js +1484 -0
- package/dist/npm/chunks/nl-DR8mLHnn.js +211 -0
- package/dist/npm/chunks/privacy-DLhezjyi.js +30 -0
- package/dist/npm/chunks/pt-BR-D7j6aDPx.js +211 -0
- package/dist/npm/chunks/{pusher-DRKlokR8.js → pusher-BSsQoE1K.js} +1 -1
- package/dist/npm/chunks/realtime-CBRW9BB3.js +34 -0
- package/dist/npm/chunks/report-DoDVi1qT.js +28 -0
- package/dist/npm/chunks/{rolldown-runtime-VHNaYcLd.js → rolldown-runtime-Y_bBpyJl.js} +10 -3
- package/dist/npm/chunks/src-C1Qp94nr.js +549 -0
- package/dist/npm/chunks/zh-CN-tzYg9NPH.js +211 -0
- package/dist/npm/element.js +28 -11
- package/dist/npm/headless.js +2 -2
- package/dist/npm/index.js +3 -3
- package/dist/npm/react.js +12 -3
- package/dist/npm/svelte.js +12 -3
- package/dist/npm/types/adapters/react.d.ts +2 -0
- package/dist/npm/types/adapters/svelte.d.ts +1 -1
- package/dist/npm/types/adapters/vue.d.ts +72 -0
- package/dist/npm/types/anchor/index.d.ts +0 -1
- package/dist/npm/types/core/api.d.ts +2 -0
- package/dist/npm/types/core/auth.d.ts +42 -5
- package/dist/npm/types/core/client.d.ts +22 -7
- package/dist/npm/types/core/types.d.ts +50 -6
- package/dist/npm/types/element.d.ts +4 -1
- package/dist/npm/types/index.d.ts +3 -1
- package/dist/npm/vue.js +46 -7
- package/package.json +8 -2
- package/dist/npm/chunks/mount-Ce1MZrcm.js +0 -2485
- package/dist/npm/chunks/realtime-5SvAvTUU.js +0 -23
- package/dist/npm/chunks/src-DJjfvVsa.js +0 -330
|
@@ -0,0 +1,1484 @@
|
|
|
1
|
+
import { n as e, r as t } from "./rolldown-runtime-Y_bBpyJl.js";
|
|
2
|
+
import { c as n, d as r, i, o as a, r as o, s } from "./src-C1Qp94nr.js";
|
|
3
|
+
import { c, l, r as u } from "./client-Iegfv6ZC.js";
|
|
4
|
+
import { n as d, r as f, t as p } from "./anchor-DT-Ynhh1.js";
|
|
5
|
+
import { n as m } from "./privacy-DLhezjyi.js";
|
|
6
|
+
import { _ as h, a as g, c as _, d as v, f as y, g as b, h as x, l as S, m as C, n as w, p as T, t as E, v as D, y as O } from "./format-B5tJGtPC.js";
|
|
7
|
+
//#region src/capture/context.ts
|
|
8
|
+
function ee() {
|
|
9
|
+
let e = navigator.userAgent, t = k(e, [
|
|
10
|
+
["Edge", /Edg\/([\d.]+)/],
|
|
11
|
+
["Opera", /OPR\/([\d.]+)/],
|
|
12
|
+
["Samsung Internet", /SamsungBrowser\/([\d.]+)/],
|
|
13
|
+
["Chrome", /Chrome\/([\d.]+)/],
|
|
14
|
+
["Firefox", /Firefox\/([\d.]+)/],
|
|
15
|
+
["Safari", /Version\/([\d.]+).*Safari/]
|
|
16
|
+
]), n = k(e, [
|
|
17
|
+
["iOS", /(?:iPhone|iPad|iPod).*OS ([\d_]+)/],
|
|
18
|
+
["Android", /Android ([\d.]+)/],
|
|
19
|
+
["Windows", /Windows NT ([\d.]+)/],
|
|
20
|
+
["macOS", /Mac OS X ([\d_]+)/],
|
|
21
|
+
["ChromeOS", /CrOS [^ ]+ ([\d.]+)/],
|
|
22
|
+
["Linux", /Linux()/]
|
|
23
|
+
]), r = innerWidth, i = matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
24
|
+
return {
|
|
25
|
+
viewport: {
|
|
26
|
+
width: r,
|
|
27
|
+
height: innerHeight,
|
|
28
|
+
dpr: Math.round((devicePixelRatio || 1) * 100) / 100,
|
|
29
|
+
zoom: Math.round((visualViewport?.scale ?? 1) * 100) / 100
|
|
30
|
+
},
|
|
31
|
+
device: {
|
|
32
|
+
browser: t?.[0],
|
|
33
|
+
browser_version: t?.[1]?.split(".")[0],
|
|
34
|
+
os: n?.[0],
|
|
35
|
+
os_version: n?.[1]?.replace(/_/g, "."),
|
|
36
|
+
type: i ? r >= 768 ? "tablet" : "mobile" : "desktop",
|
|
37
|
+
locale: navigator.language,
|
|
38
|
+
color_scheme: matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
39
|
+
user_agent: e.slice(0, 500)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function k(e, t) {
|
|
44
|
+
for (let [n, r] of t) {
|
|
45
|
+
let t = e.match(r);
|
|
46
|
+
if (t) return [n, t[1] ?? ""];
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/capture/screenshot.ts
|
|
52
|
+
var te = 8e6, A = 15e3;
|
|
53
|
+
async function j(e = {}) {
|
|
54
|
+
let t = (e.redact ?? []).filter(I), n = innerWidth, i = innerHeight, a = null;
|
|
55
|
+
r() && (a = await import("./extension-B7SelsS0.js").then((e) => e.captureTab(t)).catch(() => null)), a ?? (a = await M(t, n, i));
|
|
56
|
+
let o = a.getContext("2d");
|
|
57
|
+
return o && N(o, a.width / Math.max(1, n), e), {
|
|
58
|
+
blob: await P(a),
|
|
59
|
+
width: a.width,
|
|
60
|
+
height: a.height
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
async function M(e, n, r) {
|
|
64
|
+
let { default: i } = await import("./html2canvas-DfGb8yka.js").then((e) => /* @__PURE__ */ t(e.default, 1)), a = (t) => m(t) || e.some((e) => L(t, e)), o = Math.min(devicePixelRatio || 1, 2, Math.sqrt(te / Math.max(1, n * r)));
|
|
65
|
+
return F(i(document.documentElement, {
|
|
66
|
+
useCORS: !0,
|
|
67
|
+
logging: !1,
|
|
68
|
+
backgroundColor: getComputedStyle(document.body).backgroundColor || "#ffffff",
|
|
69
|
+
scale: o,
|
|
70
|
+
x: scrollX,
|
|
71
|
+
y: scrollY,
|
|
72
|
+
width: n,
|
|
73
|
+
height: r,
|
|
74
|
+
windowWidth: document.documentElement.clientWidth,
|
|
75
|
+
windowHeight: r,
|
|
76
|
+
ignoreElements: a,
|
|
77
|
+
onclone: (e) => import("./colors-CX-IPjvb.js").then(({ normalizeCaptureColors: t }) => t(e))
|
|
78
|
+
}), A);
|
|
79
|
+
}
|
|
80
|
+
function N(e, t, n) {
|
|
81
|
+
e.setTransform(1, 0, 0, 1, 0, 0);
|
|
82
|
+
let r = n.accent ?? "#ff5733";
|
|
83
|
+
if (n.region) {
|
|
84
|
+
let i = n.region;
|
|
85
|
+
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();
|
|
86
|
+
}
|
|
87
|
+
if (n.pin) {
|
|
88
|
+
let i = n.pin.x * t, a = n.pin.y * t, o = 11 * t;
|
|
89
|
+
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();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function P(e) {
|
|
93
|
+
return new Promise((t, n) => {
|
|
94
|
+
e.toBlob((r) => {
|
|
95
|
+
if (r && r.type === "image/webp") return t(r);
|
|
96
|
+
e.toBlob((e) => e ? t(e) : n(/* @__PURE__ */ Error("Could not encode the screenshot.")), "image/png");
|
|
97
|
+
}, "image/webp", .86);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function F(e, t) {
|
|
101
|
+
return new Promise((n, r) => {
|
|
102
|
+
let i = setTimeout(() => r(/* @__PURE__ */ Error("The screenshot took too long. Your feedback will be sent without it.")), t);
|
|
103
|
+
e.then((e) => (clearTimeout(i), n(e)), (e) => (clearTimeout(i), r(e)));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function I(e) {
|
|
107
|
+
try {
|
|
108
|
+
return document.createDocumentFragment().querySelector(e), !0;
|
|
109
|
+
} catch {
|
|
110
|
+
return !1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function L(e, t) {
|
|
114
|
+
try {
|
|
115
|
+
return e.matches(t) || !!e.closest(t);
|
|
116
|
+
} catch {
|
|
117
|
+
return !1;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/ui/drafts.ts
|
|
122
|
+
var R = "commentkit:draft:v2:", z = !1;
|
|
123
|
+
function B(e) {
|
|
124
|
+
let t = 2166136261, n = 16777619;
|
|
125
|
+
for (let r = 0; r < e.length; r++) {
|
|
126
|
+
let i = e.charCodeAt(r);
|
|
127
|
+
t = Math.imul(t ^ i, 16777619), n = Math.imul(n ^ i, 2166136261);
|
|
128
|
+
}
|
|
129
|
+
return (t >>> 0).toString(36) + (n >>> 0).toString(36);
|
|
130
|
+
}
|
|
131
|
+
function V(e, ...t) {
|
|
132
|
+
return `${R}${e}:${B(t.map((e) => e ?? "").join(""))}`;
|
|
133
|
+
}
|
|
134
|
+
function H(e, t = Date.now()) {
|
|
135
|
+
W(t);
|
|
136
|
+
try {
|
|
137
|
+
let n = JSON.parse(localStorage.getItem(e) ?? "null");
|
|
138
|
+
if (n && typeof n.text == "string" && typeof n.at == "number" && t - n.at < 6048e5) return n.text;
|
|
139
|
+
localStorage.removeItem(e);
|
|
140
|
+
} catch {}
|
|
141
|
+
return "";
|
|
142
|
+
}
|
|
143
|
+
function U(e, t, n = Date.now()) {
|
|
144
|
+
try {
|
|
145
|
+
t.trim() ? localStorage.setItem(e, JSON.stringify({
|
|
146
|
+
text: t.slice(0, 1e4),
|
|
147
|
+
at: n
|
|
148
|
+
})) : localStorage.removeItem(e);
|
|
149
|
+
} catch {}
|
|
150
|
+
}
|
|
151
|
+
function ne(e) {
|
|
152
|
+
U(e, "");
|
|
153
|
+
}
|
|
154
|
+
function W(e = Date.now(), t = !1) {
|
|
155
|
+
if (!z || t) {
|
|
156
|
+
z = !0;
|
|
157
|
+
try {
|
|
158
|
+
for (let t = localStorage.length - 1; t >= 0; t--) {
|
|
159
|
+
let n = localStorage.key(t);
|
|
160
|
+
if (!n?.startsWith(R)) continue;
|
|
161
|
+
let r = 0;
|
|
162
|
+
try {
|
|
163
|
+
r = Number(JSON.parse(localStorage.getItem(n) ?? "null")?.at) || 0;
|
|
164
|
+
} catch {}
|
|
165
|
+
e - r >= 6048e5 && localStorage.removeItem(n);
|
|
166
|
+
}
|
|
167
|
+
} catch {}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/ui/errors.ts
|
|
172
|
+
var re = {
|
|
173
|
+
network_error: "networkError",
|
|
174
|
+
upload_failed: "uploadFailed",
|
|
175
|
+
share_expired: "shareExpired",
|
|
176
|
+
no_access: "noAccess",
|
|
177
|
+
wrong_project: "noAccess",
|
|
178
|
+
guest_removed: "verifyRemoved",
|
|
179
|
+
origin_not_allowed: "originNotAllowed",
|
|
180
|
+
origin_required: "originNotAllowed",
|
|
181
|
+
widget_disabled: "paused",
|
|
182
|
+
plan_required: "readOnlyGuest",
|
|
183
|
+
not_found: "threadNotFound",
|
|
184
|
+
forbidden: "forbidden",
|
|
185
|
+
rate_limited: "tooFast"
|
|
186
|
+
}, G = /* @__PURE__ */ new Set(["file_rejected", "thread_not_found"]);
|
|
187
|
+
function K(e) {
|
|
188
|
+
if (!(e instanceof c)) return a("errorGeneric");
|
|
189
|
+
if (G.has(e.code)) return e.message;
|
|
190
|
+
let t = re[e.code] ?? (e.status === 410 ? "shareExpired" : e.status === 429 ? "tooFast" : null);
|
|
191
|
+
return t ? a(t) : o() === "en" && e.status >= 400 && e.message ? e.message : a("errorGeneric");
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/ui/files.ts
|
|
195
|
+
var q = {
|
|
196
|
+
png: "image/png",
|
|
197
|
+
jpg: "image/jpeg",
|
|
198
|
+
jpeg: "image/jpeg",
|
|
199
|
+
webp: "image/webp",
|
|
200
|
+
gif: "image/gif",
|
|
201
|
+
pdf: "application/pdf",
|
|
202
|
+
txt: "text/plain",
|
|
203
|
+
csv: "text/csv",
|
|
204
|
+
mp4: "video/mp4",
|
|
205
|
+
webm: "video/webm",
|
|
206
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
207
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
208
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
209
|
+
}, J = new Set(Object.values(q)), ie = [...J, ...Object.keys(q).map((e) => `.${e}`)].join(",");
|
|
210
|
+
function ae(e, t, n) {
|
|
211
|
+
let r = [...e], o = null;
|
|
212
|
+
for (let e of t) {
|
|
213
|
+
let t = J.has(e.type) ? e.type : e.type ? void 0 : q[e.name.split(".").pop()?.toLowerCase() ?? ""];
|
|
214
|
+
t ? e.size > n ? o = a("fileTooBig", {
|
|
215
|
+
name: e.name || "file",
|
|
216
|
+
size: Y(n)
|
|
217
|
+
}) : r.length >= 10 ? o = i("tooManyFiles", 10) : r.push(t === e.type ? e : new File([e], e.name, {
|
|
218
|
+
type: t,
|
|
219
|
+
lastModified: e.lastModified
|
|
220
|
+
})) : o = a("fileNotAllowed", { name: e.name || "file" });
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
files: r,
|
|
224
|
+
problem: o
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function Y(e) {
|
|
228
|
+
return `${Math.max(1, Math.round(e / 1048576))} MB`;
|
|
229
|
+
}
|
|
230
|
+
function oe(e) {
|
|
231
|
+
return {
|
|
232
|
+
onPaste: (t) => {
|
|
233
|
+
let n = [...t.clipboardData?.files ?? []];
|
|
234
|
+
n.length && (t.preventDefault(), e(n));
|
|
235
|
+
},
|
|
236
|
+
onDragOver: (e) => {
|
|
237
|
+
e.dataTransfer?.types.includes("Files") && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
238
|
+
},
|
|
239
|
+
onDrop: (t) => {
|
|
240
|
+
let n = [...t.dataTransfer?.files ?? []];
|
|
241
|
+
n.length && (t.preventDefault(), e(n));
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/ui/hooks.ts
|
|
247
|
+
function X(e, t) {
|
|
248
|
+
let [n, r] = x(() => t(e.get()));
|
|
249
|
+
return y(() => (r(t(e.get())), e.subscribe((e) => r(() => t(e)))), [e]), n;
|
|
250
|
+
}
|
|
251
|
+
function se(e) {
|
|
252
|
+
let [t, n] = x(0);
|
|
253
|
+
return y(() => {
|
|
254
|
+
if (!e) return;
|
|
255
|
+
let t = 0, r = () => {
|
|
256
|
+
t || (t = requestAnimationFrame(() => {
|
|
257
|
+
t = 0, n((e) => e + 1);
|
|
258
|
+
}));
|
|
259
|
+
}, i = new MutationObserver((e) => {
|
|
260
|
+
e.some((e) => !(e.target instanceof Element && e.target.closest("[data-commentkit-host]"))) && r();
|
|
261
|
+
});
|
|
262
|
+
i.observe(document.body, {
|
|
263
|
+
subtree: !0,
|
|
264
|
+
childList: !0,
|
|
265
|
+
attributes: !0,
|
|
266
|
+
characterData: !0
|
|
267
|
+
}), addEventListener("resize", r), addEventListener("scroll", r, !0), document.fonts?.ready.then(r).catch(() => void 0);
|
|
268
|
+
let a = setInterval(r, 2e3);
|
|
269
|
+
return () => {
|
|
270
|
+
i.disconnect(), removeEventListener("resize", r), removeEventListener("scroll", r, !0), clearInterval(a), cancelAnimationFrame(t);
|
|
271
|
+
};
|
|
272
|
+
}, [e]), t;
|
|
273
|
+
}
|
|
274
|
+
function ce() {
|
|
275
|
+
let [e, t] = x(() => typeof navigator > "u" || navigator.onLine !== !1);
|
|
276
|
+
return y(() => {
|
|
277
|
+
let e = () => t(!0), n = () => t(!1);
|
|
278
|
+
return addEventListener("online", e), addEventListener("offline", n), () => {
|
|
279
|
+
removeEventListener("online", e), removeEventListener("offline", n);
|
|
280
|
+
};
|
|
281
|
+
}, []), e;
|
|
282
|
+
}
|
|
283
|
+
function le(e, t, n = !1) {
|
|
284
|
+
let r = !n && getComputedStyle(e.currentTarget).direction === "rtl", i = n ? [
|
|
285
|
+
"ArrowDown",
|
|
286
|
+
"j",
|
|
287
|
+
"J"
|
|
288
|
+
] : [r ? "ArrowLeft" : "ArrowRight"], a = n ? [
|
|
289
|
+
"ArrowUp",
|
|
290
|
+
"k",
|
|
291
|
+
"K"
|
|
292
|
+
] : [r ? "ArrowRight" : "ArrowLeft"], o = i.includes(e.key) ? 1 : a.includes(e.key) ? -1 : e.key === "Home" ? "first" : e.key === "End" ? "last" : null;
|
|
293
|
+
if (o === null) return;
|
|
294
|
+
let s = e.currentTarget, c = [...s.querySelectorAll(t)].filter((e) => !e.hasAttribute("disabled"));
|
|
295
|
+
if (!c.length) return;
|
|
296
|
+
e.preventDefault();
|
|
297
|
+
let l = c.indexOf(s.getRootNode().activeElement);
|
|
298
|
+
c[o === "first" ? 0 : o === "last" ? c.length - 1 : (Math.max(l, o > 0 ? -1 : 0) + o + c.length) % c.length]?.focus();
|
|
299
|
+
}
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/ui/MentionBox.tsx
|
|
302
|
+
var Z = null;
|
|
303
|
+
function ue({ client: e, value: t, onChange: n, onMentions: r, onSubmit: i, placeholder: a, autofocus: o, disabled: s, canMention: c }) {
|
|
304
|
+
let l = T(null), [u, d] = x([]), [f, p] = x(null), [m, h] = x(0), [g, _] = x(/* @__PURE__ */ new Map());
|
|
305
|
+
y(() => {
|
|
306
|
+
o && l.current?.focus();
|
|
307
|
+
}, [o]), y(() => {
|
|
308
|
+
c && (Z ?? (Z = e.people().catch(() => [])), Z.then(d));
|
|
309
|
+
}, [e, c]);
|
|
310
|
+
let b = f === null ? [] : u.filter((e) => e.name.toLowerCase().includes(f.toLowerCase())).slice(0, 6), S = (e) => {
|
|
311
|
+
n(e);
|
|
312
|
+
let t = l.current?.selectionStart ?? e.length, i = e.slice(0, t), a = /(^|\s)@([\p{L}\p{N}._-]{0,30})$/u.exec(i);
|
|
313
|
+
p(c && a ? a[2] ?? "" : null), h(0), r([...g.entries()].filter(([t]) => e.includes(`@${t}`)).map(([, e]) => e));
|
|
314
|
+
}, C = (e) => {
|
|
315
|
+
let i = l.current;
|
|
316
|
+
if (!i || e.id === null) return;
|
|
317
|
+
let a = i.selectionStart ?? t.length, o = t.slice(0, a).replace(/@[\p{L}\p{N}._-]*$/u, `@${e.name} `), s = o + t.slice(a), c = new Map(g).set(e.name, Number(e.id));
|
|
318
|
+
_(c), p(null), n(s), r([...c.entries()].filter(([e]) => s.includes(`@${e}`)).map(([, e]) => e)), requestAnimationFrame(() => {
|
|
319
|
+
i.focus(), i.setSelectionRange(o.length, o.length);
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
return /* @__PURE__ */ v(O, { children: [/* @__PURE__ */ v("textarea", {
|
|
323
|
+
ref: l,
|
|
324
|
+
class: "ck-textarea",
|
|
325
|
+
value: t,
|
|
326
|
+
placeholder: a,
|
|
327
|
+
disabled: s,
|
|
328
|
+
maxLength: 1e4,
|
|
329
|
+
"aria-label": a,
|
|
330
|
+
"aria-autocomplete": "list",
|
|
331
|
+
"aria-controls": b.length ? "ck-suggest" : void 0,
|
|
332
|
+
"aria-activedescendant": b.length ? `ck-opt-${m}` : void 0,
|
|
333
|
+
onInput: (e) => S(e.target.value),
|
|
334
|
+
onKeyDown: (e) => {
|
|
335
|
+
b.length && [
|
|
336
|
+
"ArrowDown",
|
|
337
|
+
"ArrowUp",
|
|
338
|
+
"Enter",
|
|
339
|
+
"Tab"
|
|
340
|
+
].includes(e.key) ? (e.preventDefault(), e.key === "ArrowDown" ? h((e) => (e + 1) % b.length) : e.key === "ArrowUp" ? h((e) => (e - 1 + b.length) % b.length) : C(b[m])) : (e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), i()), e.key !== "Escape" && e.stopPropagation());
|
|
341
|
+
}
|
|
342
|
+
}), b.length ? /* @__PURE__ */ v("div", {
|
|
343
|
+
class: "ck-suggest",
|
|
344
|
+
id: "ck-suggest",
|
|
345
|
+
role: "listbox",
|
|
346
|
+
children: b.map((e, t) => /* @__PURE__ */ v("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
role: "option",
|
|
349
|
+
id: `ck-opt-${t}`,
|
|
350
|
+
"aria-selected": t === m,
|
|
351
|
+
onMouseDown: (t) => {
|
|
352
|
+
t.preventDefault(), C(e);
|
|
353
|
+
},
|
|
354
|
+
children: [/* @__PURE__ */ v(E, { person: e }), /* @__PURE__ */ v("bdi", { children: e.name })]
|
|
355
|
+
}))
|
|
356
|
+
}) : null] });
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/ui/Composer.tsx
|
|
360
|
+
var de = "commentkit:pending-compose";
|
|
361
|
+
function fe({ client: e, draft: t, signedIn: r, onSignIn: i, onCancel: o, onSent: s, onError: l, share: u = null, onPending: d }) {
|
|
362
|
+
let f = X(e.state, (e) => e.config), p = C(() => me(e, t.anchor), [t.anchor]), [m, h] = x({
|
|
363
|
+
name: "",
|
|
364
|
+
email: ""
|
|
365
|
+
}), [g, _] = x(() => H(p)), [b, S] = x([]), [E, D] = x(null), [k, te] = x(null), [A, M] = x(f?.features.screenshots === !1 ? "off" : "capturing"), [N, P] = x([]), [F, I] = x(null), [L, R] = x([]), [z, B] = x(!1), [V, W] = x(!1), re = !!(f?.features.console_capture || f?.features.network_capture), [G, K] = x(f?.features.capture_consent_default === !0), q = ce(), [J, ie] = x(!1), Y = !r && !!u && !e.auth.pending(), [se, le] = x(null), Z = {
|
|
366
|
+
name: T(null),
|
|
367
|
+
email: T(null)
|
|
368
|
+
}, fe = T(null), Q = T(null);
|
|
369
|
+
y(() => {
|
|
370
|
+
if (A !== "capturing") return;
|
|
371
|
+
let n = !1;
|
|
372
|
+
return j({
|
|
373
|
+
redact: [...f?.privacy.redact_selectors ?? [], ...e.options.redact ?? []],
|
|
374
|
+
pin: t.region ? null : t.point,
|
|
375
|
+
region: t.region
|
|
376
|
+
}).then((e) => {
|
|
377
|
+
n || (D(e), M("ready"));
|
|
378
|
+
}, () => !n && M("failed")), () => {
|
|
379
|
+
n = !0;
|
|
380
|
+
};
|
|
381
|
+
}, []), y(() => {
|
|
382
|
+
if (!E) return;
|
|
383
|
+
let e = URL.createObjectURL(E.blob);
|
|
384
|
+
return te(e), () => URL.revokeObjectURL(e);
|
|
385
|
+
}, [E]);
|
|
386
|
+
let be = (e) => {
|
|
387
|
+
_(e), U(p, e);
|
|
388
|
+
};
|
|
389
|
+
y(() => {
|
|
390
|
+
Q.current = null;
|
|
391
|
+
}, [
|
|
392
|
+
g,
|
|
393
|
+
b,
|
|
394
|
+
E,
|
|
395
|
+
A,
|
|
396
|
+
N,
|
|
397
|
+
L,
|
|
398
|
+
G
|
|
399
|
+
]);
|
|
400
|
+
let xe = C(() => _e(t.point), [t.point]), Se = (e) => {
|
|
401
|
+
let t = ae(L, e, f?.limits.max_upload_bytes ?? 10485760);
|
|
402
|
+
R(t.files), t.problem && l(new c(0, "file_rejected", t.problem));
|
|
403
|
+
}, Ce = async () => {
|
|
404
|
+
let r = null, i = null;
|
|
405
|
+
if (E && A === "ready") try {
|
|
406
|
+
let t = E.blob.type, n = `screenshot.${t === "image/webp" ? "webp" : t === "image/jpeg" ? "jpg" : "png"}`;
|
|
407
|
+
r = (await e.upload(E.blob, n, "screenshot")).id;
|
|
408
|
+
} catch {
|
|
409
|
+
i = "screenshot";
|
|
410
|
+
}
|
|
411
|
+
let a = [];
|
|
412
|
+
for (let t of L) try {
|
|
413
|
+
a.push((await e.upload(t, t.name)).id);
|
|
414
|
+
} catch {
|
|
415
|
+
i ?? (i = "files");
|
|
416
|
+
}
|
|
417
|
+
let o = {
|
|
418
|
+
...ee(),
|
|
419
|
+
...re && G ? n() : {},
|
|
420
|
+
screenshot_id: r,
|
|
421
|
+
markup: N.length ? N : void 0
|
|
422
|
+
};
|
|
423
|
+
return {
|
|
424
|
+
key: crypto.randomUUID(),
|
|
425
|
+
input: {
|
|
426
|
+
anchor: t.anchor,
|
|
427
|
+
body: g.trim(),
|
|
428
|
+
capture: o,
|
|
429
|
+
attachmentIds: a,
|
|
430
|
+
mentionIds: b
|
|
431
|
+
},
|
|
432
|
+
missing: i
|
|
433
|
+
};
|
|
434
|
+
}, $ = async () => {
|
|
435
|
+
if (z || !g.trim() || !q) return;
|
|
436
|
+
if (W(!1), !r && !u && !J) {
|
|
437
|
+
ie(!0);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
let n = Y ? m.name.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m.email.trim()) ? null : "email" : "name" : null;
|
|
441
|
+
if (le(n), n) return Z[n].current?.focus();
|
|
442
|
+
B(!0);
|
|
443
|
+
try {
|
|
444
|
+
let n = !r && !u;
|
|
445
|
+
if (Y && u) {
|
|
446
|
+
let { startGuest: t } = await import("./Guest-VNoofLxw.js");
|
|
447
|
+
n = await t(e, {
|
|
448
|
+
share: u,
|
|
449
|
+
...m
|
|
450
|
+
}) === "popup";
|
|
451
|
+
}
|
|
452
|
+
if (n) {
|
|
453
|
+
if (ve(de, JSON.stringify({
|
|
454
|
+
draft: t,
|
|
455
|
+
scrollY
|
|
456
|
+
})), !await i()) return;
|
|
457
|
+
ye(de);
|
|
458
|
+
}
|
|
459
|
+
let a = Q.current ?? (Q.current = await Ce()), o = await e.createThread({
|
|
460
|
+
...a.input,
|
|
461
|
+
idempotencyKey: a.key
|
|
462
|
+
});
|
|
463
|
+
if (Q.current = null, o.pending_verification) return d?.(e.auth.pending()?.email ?? m.email);
|
|
464
|
+
ne(p), s(o, a.missing);
|
|
465
|
+
} catch (t) {
|
|
466
|
+
if (t instanceof c && ["pending_limit", "verification_required"].includes(t.code) && e.auth.pending()) return d?.(e.auth.pending().email);
|
|
467
|
+
let n = pe(t);
|
|
468
|
+
W(n ?? !0), n || l(t);
|
|
469
|
+
} finally {
|
|
470
|
+
B(!1);
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
return /* @__PURE__ */ v("div", {
|
|
474
|
+
class: "ck-card",
|
|
475
|
+
style: xe,
|
|
476
|
+
role: "dialog",
|
|
477
|
+
"aria-label": a("comment"),
|
|
478
|
+
"data-commentkit-ui": !0,
|
|
479
|
+
onKeyDown: (e) => e.key === "Escape" && o(),
|
|
480
|
+
...oe(Se),
|
|
481
|
+
children: [
|
|
482
|
+
/* @__PURE__ */ v("div", {
|
|
483
|
+
class: "ck-card-head",
|
|
484
|
+
children: [/* @__PURE__ */ v("span", {
|
|
485
|
+
class: "ck-card-title",
|
|
486
|
+
children: t.anchor.quote ? `“${t.anchor.quote.slice(0, 60)}”` : a("comment")
|
|
487
|
+
}), /* @__PURE__ */ v("button", {
|
|
488
|
+
class: "ck-ghost",
|
|
489
|
+
onClick: o,
|
|
490
|
+
"aria-label": a("cancel"),
|
|
491
|
+
children: /* @__PURE__ */ v(w, { name: "close" })
|
|
492
|
+
})]
|
|
493
|
+
}),
|
|
494
|
+
/* @__PURE__ */ v("div", {
|
|
495
|
+
class: "ck-card-body",
|
|
496
|
+
style: { position: "relative" },
|
|
497
|
+
children: [
|
|
498
|
+
q ? null : /* @__PURE__ */ v("div", {
|
|
499
|
+
class: "ck-note",
|
|
500
|
+
"data-tone": "warning",
|
|
501
|
+
role: "status",
|
|
502
|
+
children: a("offlineSend")
|
|
503
|
+
}),
|
|
504
|
+
V && q ? /* @__PURE__ */ v("div", {
|
|
505
|
+
class: "ck-note",
|
|
506
|
+
"data-tone": "warning",
|
|
507
|
+
role: "alert",
|
|
508
|
+
children: V === !0 ? /* @__PURE__ */ v(O, { children: [
|
|
509
|
+
a("sendFailed"),
|
|
510
|
+
" ",
|
|
511
|
+
/* @__PURE__ */ v("button", {
|
|
512
|
+
class: "ck-btn",
|
|
513
|
+
onClick: () => void $(),
|
|
514
|
+
children: a("retry")
|
|
515
|
+
})
|
|
516
|
+
] }) : `${V} ${a("savedHere")}`
|
|
517
|
+
}) : null,
|
|
518
|
+
/* @__PURE__ */ v(ue, {
|
|
519
|
+
client: e,
|
|
520
|
+
value: g,
|
|
521
|
+
onChange: be,
|
|
522
|
+
onMentions: S,
|
|
523
|
+
onSubmit: () => void $(),
|
|
524
|
+
placeholder: a("composerPlaceholder"),
|
|
525
|
+
autofocus: !0,
|
|
526
|
+
disabled: z,
|
|
527
|
+
canMention: r
|
|
528
|
+
}),
|
|
529
|
+
Y || J && !r ? /* @__PURE__ */ v("div", {
|
|
530
|
+
class: "ck-note",
|
|
531
|
+
children: [
|
|
532
|
+
/* @__PURE__ */ v("strong", { children: a(Y ? "guestIntro" : "signInToSend") }),
|
|
533
|
+
/* @__PURE__ */ v("div", { children: a(u ? "guestExplain" : "signInExplain") }),
|
|
534
|
+
Y ? /* @__PURE__ */ v("div", {
|
|
535
|
+
class: "ck-guest",
|
|
536
|
+
children: ["name", "email"].map((e) => /* @__PURE__ */ v("div", {
|
|
537
|
+
class: "ck-field",
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ v("label", {
|
|
540
|
+
for: `ck-guest-${e}`,
|
|
541
|
+
children: a(e === "name" ? "guestName" : "guestEmail")
|
|
542
|
+
}),
|
|
543
|
+
/* @__PURE__ */ v("input", {
|
|
544
|
+
id: `ck-guest-${e}`,
|
|
545
|
+
ref: Z[e],
|
|
546
|
+
class: "ck-input",
|
|
547
|
+
type: e === "email" ? "email" : "text",
|
|
548
|
+
autoComplete: e,
|
|
549
|
+
maxLength: e === "name" ? 120 : 254,
|
|
550
|
+
value: m[e],
|
|
551
|
+
"aria-invalid": se === e,
|
|
552
|
+
"aria-describedby": se === e ? "ck-guest-error" : void 0,
|
|
553
|
+
onInput: (t) => {
|
|
554
|
+
let n = t.target.value;
|
|
555
|
+
h((t) => ({
|
|
556
|
+
...t,
|
|
557
|
+
[e]: n
|
|
558
|
+
}));
|
|
559
|
+
},
|
|
560
|
+
onKeyDown: (e) => {
|
|
561
|
+
e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && $();
|
|
562
|
+
}
|
|
563
|
+
}),
|
|
564
|
+
se === e ? /* @__PURE__ */ v("span", {
|
|
565
|
+
class: "ck-error",
|
|
566
|
+
id: "ck-guest-error",
|
|
567
|
+
role: "alert",
|
|
568
|
+
children: a(e === "name" ? "guestNameMissing" : "guestEmailInvalid")
|
|
569
|
+
}) : null
|
|
570
|
+
]
|
|
571
|
+
}))
|
|
572
|
+
}) : null
|
|
573
|
+
]
|
|
574
|
+
}) : null,
|
|
575
|
+
A === "capturing" ? /* @__PURE__ */ v("p", {
|
|
576
|
+
class: "ck-muted",
|
|
577
|
+
children: a("capturing")
|
|
578
|
+
}) : null,
|
|
579
|
+
A === "ready" && k ? /* @__PURE__ */ v(O, { children: [/* @__PURE__ */ v("div", {
|
|
580
|
+
class: "ck-shot",
|
|
581
|
+
children: /* @__PURE__ */ v("img", {
|
|
582
|
+
src: k,
|
|
583
|
+
alt: a("screenshot")
|
|
584
|
+
})
|
|
585
|
+
}), /* @__PURE__ */ v("div", {
|
|
586
|
+
class: "ck-shot-tools",
|
|
587
|
+
children: [
|
|
588
|
+
/* @__PURE__ */ v("span", {
|
|
589
|
+
class: "ck-muted",
|
|
590
|
+
style: { flex: "1 1 100%" },
|
|
591
|
+
children: a("screenshotIncluded")
|
|
592
|
+
}),
|
|
593
|
+
/* @__PURE__ */ v("button", {
|
|
594
|
+
class: "ck-chip",
|
|
595
|
+
onClick: () => void import("./MarkupEditor-DTXrS3DD.js").then((e) => I(() => e.MarkupEditor), l),
|
|
596
|
+
children: [/* @__PURE__ */ v(w, {
|
|
597
|
+
name: "pen",
|
|
598
|
+
size: 14
|
|
599
|
+
}), a("markup")]
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ v("button", {
|
|
602
|
+
class: "ck-chip",
|
|
603
|
+
onClick: () => M("off"),
|
|
604
|
+
children: a("screenshotRemove")
|
|
605
|
+
})
|
|
606
|
+
]
|
|
607
|
+
})] }) : null,
|
|
608
|
+
A === "off" && E ? /* @__PURE__ */ v("button", {
|
|
609
|
+
class: "ck-chip",
|
|
610
|
+
style: { marginTop: "8px" },
|
|
611
|
+
onClick: () => M("ready"),
|
|
612
|
+
children: [/* @__PURE__ */ v(w, {
|
|
613
|
+
name: "image",
|
|
614
|
+
size: 14
|
|
615
|
+
}), a("screenshotAdd")]
|
|
616
|
+
}) : null,
|
|
617
|
+
re ? /* @__PURE__ */ v("label", {
|
|
618
|
+
class: "ck-check",
|
|
619
|
+
children: [/* @__PURE__ */ v("input", {
|
|
620
|
+
type: "checkbox",
|
|
621
|
+
checked: G,
|
|
622
|
+
onChange: (e) => K(e.target.checked)
|
|
623
|
+
}), a("includeDiagnostics")]
|
|
624
|
+
}) : null,
|
|
625
|
+
/* @__PURE__ */ v(he, {
|
|
626
|
+
files: L,
|
|
627
|
+
onRemove: (e) => R(L.filter((t) => t !== e))
|
|
628
|
+
})
|
|
629
|
+
]
|
|
630
|
+
}),
|
|
631
|
+
/* @__PURE__ */ v("div", {
|
|
632
|
+
class: "ck-card-foot",
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ v(ge, {
|
|
635
|
+
input: fe,
|
|
636
|
+
onFiles: Se
|
|
637
|
+
}),
|
|
638
|
+
/* @__PURE__ */ v("span", { class: "ck-spacer" }),
|
|
639
|
+
/* @__PURE__ */ v("button", {
|
|
640
|
+
class: "ck-btn",
|
|
641
|
+
onClick: o,
|
|
642
|
+
children: a("cancel")
|
|
643
|
+
}),
|
|
644
|
+
/* @__PURE__ */ v("button", {
|
|
645
|
+
class: "ck-btn ck-primary",
|
|
646
|
+
disabled: z || !g.trim() || !q,
|
|
647
|
+
onClick: () => void $(),
|
|
648
|
+
children: a(z ? "sending" : J && !r ? "signIn" : "send")
|
|
649
|
+
})
|
|
650
|
+
]
|
|
651
|
+
}),
|
|
652
|
+
F && E ? /* @__PURE__ */ v(F, {
|
|
653
|
+
image: E.blob,
|
|
654
|
+
onCancel: () => I(null),
|
|
655
|
+
onDone: (e, t) => {
|
|
656
|
+
D({
|
|
657
|
+
...E,
|
|
658
|
+
blob: e
|
|
659
|
+
}), P(t), I(null);
|
|
660
|
+
}
|
|
661
|
+
}) : null
|
|
662
|
+
]
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
function pe(e) {
|
|
666
|
+
return e instanceof c && (e.code === "widget_disabled" || e.code === "plan_required" || e.status >= 400 && e.status < 500 && e.status !== 408 && e.status !== 429) ? K(e) : null;
|
|
667
|
+
}
|
|
668
|
+
function me(e, t) {
|
|
669
|
+
return V(e.options.project, u(), t.type, t.selector, t.ck_id, t.source, t.quote);
|
|
670
|
+
}
|
|
671
|
+
function he({ files: e, onRemove: t }) {
|
|
672
|
+
return e.length ? /* @__PURE__ */ v("div", {
|
|
673
|
+
class: "ck-files",
|
|
674
|
+
children: e.map((e) => /* @__PURE__ */ v("span", {
|
|
675
|
+
class: "ck-file",
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ v("bdi", { children: e.name }),
|
|
678
|
+
" ",
|
|
679
|
+
/* @__PURE__ */ v("button", {
|
|
680
|
+
class: "ck-ghost",
|
|
681
|
+
"aria-label": a("removeFile", { name: e.name }),
|
|
682
|
+
onClick: () => t(e),
|
|
683
|
+
children: "×"
|
|
684
|
+
})
|
|
685
|
+
]
|
|
686
|
+
}))
|
|
687
|
+
}) : null;
|
|
688
|
+
}
|
|
689
|
+
function ge({ input: e, onFiles: t }) {
|
|
690
|
+
return /* @__PURE__ */ v(O, { children: [/* @__PURE__ */ v("input", {
|
|
691
|
+
ref: e,
|
|
692
|
+
type: "file",
|
|
693
|
+
multiple: !0,
|
|
694
|
+
hidden: !0,
|
|
695
|
+
accept: ie,
|
|
696
|
+
onChange: (e) => {
|
|
697
|
+
let n = e.target;
|
|
698
|
+
t(Array.from(n.files ?? [])), n.value = "";
|
|
699
|
+
}
|
|
700
|
+
}), /* @__PURE__ */ v("button", {
|
|
701
|
+
class: "ck-ghost",
|
|
702
|
+
onClick: () => e.current?.click(),
|
|
703
|
+
"aria-label": a("attach"),
|
|
704
|
+
title: a("attach"),
|
|
705
|
+
children: /* @__PURE__ */ v(w, { name: "paperclip" })
|
|
706
|
+
})] });
|
|
707
|
+
}
|
|
708
|
+
function _e(e) {
|
|
709
|
+
let t = Math.min(380, innerWidth - 24), n = Math.min(Math.max(12, e.x + 16), innerWidth - t - 12), r = e.y + 16;
|
|
710
|
+
return innerHeight - r > 360 ? {
|
|
711
|
+
left: `${n}px`,
|
|
712
|
+
top: `${r}px`
|
|
713
|
+
} : {
|
|
714
|
+
left: `${n}px`,
|
|
715
|
+
bottom: `${Math.max(12, innerHeight - e.y + 16)}px`
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
function ve(e, t) {
|
|
719
|
+
try {
|
|
720
|
+
sessionStorage.setItem(e, t);
|
|
721
|
+
} catch {}
|
|
722
|
+
}
|
|
723
|
+
function ye(e) {
|
|
724
|
+
try {
|
|
725
|
+
sessionStorage.removeItem(e);
|
|
726
|
+
} catch {}
|
|
727
|
+
}
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region src/ui/nav.ts
|
|
730
|
+
function Q(e, t, n) {
|
|
731
|
+
let r = S(e);
|
|
732
|
+
if (!r || !/^https?:$/.test(new URL(r).protocol) || be(r)) return n(t);
|
|
733
|
+
let i = new URL(r);
|
|
734
|
+
i.searchParams.set("ck_thread", t), location.assign(i.toString());
|
|
735
|
+
}
|
|
736
|
+
function be(e) {
|
|
737
|
+
try {
|
|
738
|
+
let t = new URL(e), n = new URL(u());
|
|
739
|
+
return t.origin === n.origin && t.pathname === n.pathname && t.search === n.search && (t.hash === n.hash || !t.hash.startsWith("#/"));
|
|
740
|
+
} catch {
|
|
741
|
+
return !1;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/ui/Launcher.tsx
|
|
746
|
+
function xe({ client: e, position: t, commenting: n, panelOpen: r, onComment: i, onPanel: o, onSignIn: s, onSignOut: c, onShortcuts: l, waiting: u, onCode: d, covered: f }) {
|
|
747
|
+
let p = X(e.state, (e) => e.config?.read_only ?? !1), m = X(e.state, (e) => e.session), h = X(e.state, (e) => e.unread);
|
|
748
|
+
X(e.state, (e) => e.threads.length);
|
|
749
|
+
let [g, _] = x(!1);
|
|
750
|
+
return /* @__PURE__ */ v("div", {
|
|
751
|
+
class: "ck-launcher",
|
|
752
|
+
"data-pos": t,
|
|
753
|
+
"data-covered": f,
|
|
754
|
+
"data-commentkit-ui": !0,
|
|
755
|
+
children: [
|
|
756
|
+
g ? null : u ? /* @__PURE__ */ v("div", {
|
|
757
|
+
class: "ck-note ck-launcher-note",
|
|
758
|
+
role: "status",
|
|
759
|
+
children: [
|
|
760
|
+
a("pendingNote", { email: u }),
|
|
761
|
+
" ",
|
|
762
|
+
/* @__PURE__ */ v("button", {
|
|
763
|
+
class: "ck-btn",
|
|
764
|
+
onClick: d,
|
|
765
|
+
children: a("enterCode")
|
|
766
|
+
})
|
|
767
|
+
]
|
|
768
|
+
}) : p ? /* @__PURE__ */ v("div", {
|
|
769
|
+
class: "ck-note ck-launcher-note",
|
|
770
|
+
role: "status",
|
|
771
|
+
children: a("readOnlyShort")
|
|
772
|
+
}) : null,
|
|
773
|
+
/* @__PURE__ */ v("div", {
|
|
774
|
+
class: "ck-bar",
|
|
775
|
+
role: "toolbar",
|
|
776
|
+
"aria-label": "CommentKit",
|
|
777
|
+
children: [
|
|
778
|
+
/* @__PURE__ */ v("button", {
|
|
779
|
+
class: "ck-bar-btn",
|
|
780
|
+
"aria-pressed": n,
|
|
781
|
+
onClick: i,
|
|
782
|
+
title: a("commentHint"),
|
|
783
|
+
"aria-keyshortcuts": l ? "C" : void 0,
|
|
784
|
+
children: [/* @__PURE__ */ v(w, { name: "comment" }), /* @__PURE__ */ v("span", {
|
|
785
|
+
class: "ck-label",
|
|
786
|
+
children: a("comment")
|
|
787
|
+
})]
|
|
788
|
+
}),
|
|
789
|
+
m ? /* @__PURE__ */ v("button", {
|
|
790
|
+
class: "ck-bar-btn ck-icon-btn",
|
|
791
|
+
"aria-pressed": r,
|
|
792
|
+
onClick: o,
|
|
793
|
+
title: a("inbox"),
|
|
794
|
+
"aria-label": `${a("inbox")}${h ? ` (${h})` : ""}`,
|
|
795
|
+
children: [/* @__PURE__ */ v(w, { name: "inbox" }), h > 0 ? /* @__PURE__ */ v("span", {
|
|
796
|
+
class: "ck-badge",
|
|
797
|
+
children: h > 99 ? "99+" : h
|
|
798
|
+
}) : null]
|
|
799
|
+
}) : null,
|
|
800
|
+
/* @__PURE__ */ v("button", {
|
|
801
|
+
class: "ck-bar-btn ck-icon-btn",
|
|
802
|
+
"aria-haspopup": "menu",
|
|
803
|
+
"aria-expanded": g,
|
|
804
|
+
onClick: () => _(!g),
|
|
805
|
+
"aria-label": a("more"),
|
|
806
|
+
children: /* @__PURE__ */ v(w, { name: "more" })
|
|
807
|
+
})
|
|
808
|
+
]
|
|
809
|
+
}),
|
|
810
|
+
g ? /* @__PURE__ */ v("div", {
|
|
811
|
+
class: "ck-menu",
|
|
812
|
+
role: "menu",
|
|
813
|
+
onClick: () => _(!1),
|
|
814
|
+
onKeyDown: (e) => e.key === "Escape" ? (e.stopPropagation(), _(!1)) : le(e, "[role=menuitem]", !0),
|
|
815
|
+
children: [m ? /* @__PURE__ */ v(O, { children: [/* @__PURE__ */ v("div", {
|
|
816
|
+
class: "ck-menu-head",
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ v("bdi", { children: m.person.name }),
|
|
819
|
+
" · ",
|
|
820
|
+
/* @__PURE__ */ v("bdi", { children: m.project.name })
|
|
821
|
+
]
|
|
822
|
+
}), /* @__PURE__ */ v("button", {
|
|
823
|
+
role: "menuitem",
|
|
824
|
+
onClick: c,
|
|
825
|
+
children: a("signOut")
|
|
826
|
+
})] }) : /* @__PURE__ */ v("button", {
|
|
827
|
+
role: "menuitem",
|
|
828
|
+
onClick: s,
|
|
829
|
+
children: a("signInMember")
|
|
830
|
+
}), l ? /* @__PURE__ */ v("button", {
|
|
831
|
+
role: "menuitem",
|
|
832
|
+
"aria-keyshortcuts": "?",
|
|
833
|
+
onClick: l,
|
|
834
|
+
children: a("shortcutsTitle")
|
|
835
|
+
}) : null]
|
|
836
|
+
}) : null
|
|
837
|
+
]
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
function Se({ onCancel: e, onPick: t }) {
|
|
841
|
+
let [n] = x(() => {
|
|
842
|
+
let e = document.activeElement;
|
|
843
|
+
return e && e !== document.body && e !== document.documentElement && !d(e) ? e : null;
|
|
844
|
+
}), r = C(() => matchMedia("(pointer: coarse)").matches, []), [i, o] = x(null), [s, c] = x(null), l = T(null), u = T(null);
|
|
845
|
+
y(() => u.current?.focus({ preventScroll: !0 }), []);
|
|
846
|
+
let f = T(null), m = T({
|
|
847
|
+
timer: null,
|
|
848
|
+
fired: !1
|
|
849
|
+
}), h = () => {
|
|
850
|
+
m.current.timer && clearTimeout(m.current.timer), m.current.timer = null;
|
|
851
|
+
};
|
|
852
|
+
y(() => h, []), y(() => {
|
|
853
|
+
let e = getSelection(), n = e?.toString().trim();
|
|
854
|
+
if (e && n && e.rangeCount && !d(e.anchorNode?.parentElement ?? null)) {
|
|
855
|
+
let r = e.getRangeAt(0), i = r.getBoundingClientRect(), a = r.commonAncestorContainer instanceof Element ? r.commonAncestorContainer : r.commonAncestorContainer.parentElement;
|
|
856
|
+
t({
|
|
857
|
+
anchor: p({
|
|
858
|
+
element: a,
|
|
859
|
+
clientX: i.left,
|
|
860
|
+
clientY: i.top,
|
|
861
|
+
quote: n
|
|
862
|
+
}),
|
|
863
|
+
point: {
|
|
864
|
+
x: i.left,
|
|
865
|
+
y: i.bottom
|
|
866
|
+
},
|
|
867
|
+
region: {
|
|
868
|
+
x: i.left,
|
|
869
|
+
y: i.top,
|
|
870
|
+
w: i.width,
|
|
871
|
+
h: i.height
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
}, []);
|
|
876
|
+
let _ = (e, t) => {
|
|
877
|
+
let n = l.current;
|
|
878
|
+
if (!n) return null;
|
|
879
|
+
n.style.pointerEvents = "none";
|
|
880
|
+
let r = document.elementsFromPoint(e, t).find((e) => !d(e) && e !== document.documentElement && e !== document.body) ?? document.body;
|
|
881
|
+
return n.style.pointerEvents = "auto", r;
|
|
882
|
+
}, b = (e) => {
|
|
883
|
+
let n = e.getBoundingClientRect(), r = n.left + Math.min(n.width / 2, 24), i = n.top + Math.min(n.height / 2, 24);
|
|
884
|
+
t({
|
|
885
|
+
anchor: p({
|
|
886
|
+
element: e,
|
|
887
|
+
clientX: r,
|
|
888
|
+
clientY: i
|
|
889
|
+
}),
|
|
890
|
+
point: {
|
|
891
|
+
x: r,
|
|
892
|
+
y: n.bottom
|
|
893
|
+
},
|
|
894
|
+
region: null
|
|
895
|
+
});
|
|
896
|
+
}, S = () => {
|
|
897
|
+
t({
|
|
898
|
+
anchor: {
|
|
899
|
+
type: "page",
|
|
900
|
+
page: {
|
|
901
|
+
x: 50,
|
|
902
|
+
y: Math.round(scrollY + Math.min(120, innerHeight / 3))
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
point: {
|
|
906
|
+
x: innerWidth / 2,
|
|
907
|
+
y: Math.min(120, innerHeight / 3)
|
|
908
|
+
},
|
|
909
|
+
region: null
|
|
910
|
+
});
|
|
911
|
+
};
|
|
912
|
+
return y(() => {
|
|
913
|
+
let t = (t) => {
|
|
914
|
+
t.key === "Escape" ? e() : t.key === "Enter" && !t.composedPath().some((e) => e instanceof HTMLButtonElement) && (t.preventDefault(), n ? b(n) : S());
|
|
915
|
+
};
|
|
916
|
+
return addEventListener("keydown", t), () => removeEventListener("keydown", t);
|
|
917
|
+
}, [e]), /* @__PURE__ */ v(O, { children: [
|
|
918
|
+
/* @__PURE__ */ v("div", {
|
|
919
|
+
class: "ck-mode-frame",
|
|
920
|
+
"aria-hidden": "true",
|
|
921
|
+
"data-commentkit-ui": !0
|
|
922
|
+
}),
|
|
923
|
+
/* @__PURE__ */ v("div", {
|
|
924
|
+
class: "ck-mode-hint",
|
|
925
|
+
role: "toolbar",
|
|
926
|
+
"aria-label": a("comment"),
|
|
927
|
+
"data-commentkit-ui": !0,
|
|
928
|
+
children: [
|
|
929
|
+
/* @__PURE__ */ v("span", {
|
|
930
|
+
role: "status",
|
|
931
|
+
children: a(r ? "modeBarTouch" : "modeBar")
|
|
932
|
+
}),
|
|
933
|
+
n ? /* @__PURE__ */ v("button", {
|
|
934
|
+
class: "ck-chip",
|
|
935
|
+
ref: u,
|
|
936
|
+
onClick: () => b(n),
|
|
937
|
+
children: a("commentFocused")
|
|
938
|
+
}) : null,
|
|
939
|
+
/* @__PURE__ */ v("button", {
|
|
940
|
+
class: "ck-chip",
|
|
941
|
+
ref: n ? void 0 : u,
|
|
942
|
+
onClick: S,
|
|
943
|
+
children: a("commentOnPage")
|
|
944
|
+
})
|
|
945
|
+
]
|
|
946
|
+
}),
|
|
947
|
+
/* @__PURE__ */ v("div", {
|
|
948
|
+
ref: l,
|
|
949
|
+
class: "ck-catcher",
|
|
950
|
+
"data-commentkit-ui": !0,
|
|
951
|
+
onPointerMove: (e) => {
|
|
952
|
+
if (e.pointerType === "touch") {
|
|
953
|
+
let t = f.current;
|
|
954
|
+
t && (Math.abs(e.clientX - t.x) > 8 || Math.abs(e.clientY - t.y) > 8) && h();
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
if (f.current) {
|
|
958
|
+
c({
|
|
959
|
+
x: f.current.x,
|
|
960
|
+
y: f.current.y,
|
|
961
|
+
x2: e.clientX,
|
|
962
|
+
y2: e.clientY
|
|
963
|
+
});
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
let t = _(e.clientX, e.clientY);
|
|
967
|
+
o(t ? t.getBoundingClientRect() : null);
|
|
968
|
+
},
|
|
969
|
+
onPointerDown: (e) => {
|
|
970
|
+
if (e.button !== 0) return;
|
|
971
|
+
let n = _(e.clientX, e.clientY);
|
|
972
|
+
n && (f.current = {
|
|
973
|
+
x: e.clientX,
|
|
974
|
+
y: e.clientY,
|
|
975
|
+
target: n
|
|
976
|
+
}, m.current.fired = !1, e.pointerType === "touch" && (h(), m.current.timer = setTimeout(() => {
|
|
977
|
+
let e = f.current;
|
|
978
|
+
m.current.timer = null, e && (m.current.fired = !0, f.current = null, Ce(e.x, e.y), t({
|
|
979
|
+
anchor: p({
|
|
980
|
+
element: e.target,
|
|
981
|
+
clientX: e.x,
|
|
982
|
+
clientY: e.y
|
|
983
|
+
}),
|
|
984
|
+
point: {
|
|
985
|
+
x: e.x,
|
|
986
|
+
y: e.y
|
|
987
|
+
},
|
|
988
|
+
region: null
|
|
989
|
+
}));
|
|
990
|
+
}, 500)), e.pointerType !== "touch" && l.current?.setPointerCapture(e.pointerId));
|
|
991
|
+
},
|
|
992
|
+
onPointerUp: (e) => {
|
|
993
|
+
h();
|
|
994
|
+
let n = f.current;
|
|
995
|
+
if (f.current = null, c(null), !n) return;
|
|
996
|
+
let r = Math.abs(e.clientX - n.x) > 8 || Math.abs(e.clientY - n.y) > 8;
|
|
997
|
+
if (e.pointerType === "touch" && r) return;
|
|
998
|
+
e.pointerType === "touch" && Ce(e.clientX, e.clientY);
|
|
999
|
+
let i = e.pointerType !== "touch" && Math.abs(e.clientX - n.x) > 8 && Math.abs(e.clientY - n.y) > 8, a = i ? $(n.target, _(e.clientX, e.clientY) ?? n.target) : n.target;
|
|
1000
|
+
t({
|
|
1001
|
+
anchor: p({
|
|
1002
|
+
element: a,
|
|
1003
|
+
clientX: n.x,
|
|
1004
|
+
clientY: n.y,
|
|
1005
|
+
...i ? {
|
|
1006
|
+
endX: e.clientX,
|
|
1007
|
+
endY: e.clientY
|
|
1008
|
+
} : {}
|
|
1009
|
+
}),
|
|
1010
|
+
point: {
|
|
1011
|
+
x: i ? Math.max(n.x, e.clientX) : e.clientX,
|
|
1012
|
+
y: i ? Math.max(n.y, e.clientY) : e.clientY
|
|
1013
|
+
},
|
|
1014
|
+
region: i ? {
|
|
1015
|
+
x: Math.min(n.x, e.clientX),
|
|
1016
|
+
y: Math.min(n.y, e.clientY),
|
|
1017
|
+
w: Math.abs(e.clientX - n.x),
|
|
1018
|
+
h: Math.abs(e.clientY - n.y)
|
|
1019
|
+
} : null
|
|
1020
|
+
});
|
|
1021
|
+
},
|
|
1022
|
+
onPointerCancel: () => {
|
|
1023
|
+
h(), f.current = null, c(null);
|
|
1024
|
+
},
|
|
1025
|
+
onContextMenu: (t) => {
|
|
1026
|
+
t.preventDefault(), !m.current.timer && !m.current.fired && !r && e();
|
|
1027
|
+
}
|
|
1028
|
+
}),
|
|
1029
|
+
i && !s ? /* @__PURE__ */ v("div", {
|
|
1030
|
+
class: "ck-outline",
|
|
1031
|
+
style: g(i.left - 2, i.top - 2, i.width + 4, i.height + 4)
|
|
1032
|
+
}) : null,
|
|
1033
|
+
s ? /* @__PURE__ */ v("div", {
|
|
1034
|
+
class: "ck-region",
|
|
1035
|
+
style: g(Math.min(s.x, s.x2), Math.min(s.y, s.y2), Math.abs(s.x2 - s.x), Math.abs(s.y2 - s.y))
|
|
1036
|
+
}) : null
|
|
1037
|
+
] });
|
|
1038
|
+
}
|
|
1039
|
+
function Ce(e, t) {
|
|
1040
|
+
let n = (r) => {
|
|
1041
|
+
Math.abs(r.clientX - e) > 24 || Math.abs(r.clientY - t) > 24 || (r.preventDefault(), r.stopPropagation(), removeEventListener("click", n, !0));
|
|
1042
|
+
};
|
|
1043
|
+
addEventListener("click", n, !0), setTimeout(() => removeEventListener("click", n, !0), 700);
|
|
1044
|
+
}
|
|
1045
|
+
function $(e, t) {
|
|
1046
|
+
if (e.contains(t)) return e;
|
|
1047
|
+
for (let n = t; n; n = n.parentElement) if (n.contains(e)) return n;
|
|
1048
|
+
return document.body;
|
|
1049
|
+
}
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region src/ui/Pins.tsx
|
|
1052
|
+
var we = "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";
|
|
1053
|
+
function Te({ client: e, activeId: t, onOpen: n }) {
|
|
1054
|
+
let r = X(e.state, (e) => e.threads);
|
|
1055
|
+
return se(r.length > 0), /* @__PURE__ */ v("div", {
|
|
1056
|
+
class: "ck-pins",
|
|
1057
|
+
"data-commentkit-ui": !0,
|
|
1058
|
+
children: r.map((e) => {
|
|
1059
|
+
let r = f(e.anchor);
|
|
1060
|
+
return r.state === "detached" ? null : /* @__PURE__ */ v(O, { children: [r.rect && e.id === t ? /* @__PURE__ */ v("div", {
|
|
1061
|
+
class: "ck-pin-region",
|
|
1062
|
+
style: g(r.rect.x, r.rect.y, r.rect.w, r.rect.h)
|
|
1063
|
+
}) : null, /* @__PURE__ */ v("button", {
|
|
1064
|
+
class: "ck-pin",
|
|
1065
|
+
style: g(r.point.x, r.point.y),
|
|
1066
|
+
"data-status": e.status,
|
|
1067
|
+
"data-state": r.state,
|
|
1068
|
+
"aria-expanded": e.id === t,
|
|
1069
|
+
"aria-label": `${e.reference}: ${e.first_message?.body.slice(0, 80) ?? ""}`,
|
|
1070
|
+
onClick: () => n(e),
|
|
1071
|
+
children: [/* @__PURE__ */ v("svg", {
|
|
1072
|
+
viewBox: "5 3 54 62",
|
|
1073
|
+
"aria-hidden": "true",
|
|
1074
|
+
children: /* @__PURE__ */ v("path", { d: we })
|
|
1075
|
+
}), /* @__PURE__ */ v("span", { children: e.number })]
|
|
1076
|
+
})] });
|
|
1077
|
+
})
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region src/ui/Welcome.tsx
|
|
1082
|
+
function Ee({ position: e, project: t, onStart: n, onDismiss: r }) {
|
|
1083
|
+
let i = e.startsWith("top") ? { top: "76px" } : { bottom: "76px" };
|
|
1084
|
+
return i[e.endsWith("left") ? "left" : "right"] = "20px", /* @__PURE__ */ v("div", {
|
|
1085
|
+
class: "ck-welcome",
|
|
1086
|
+
style: i,
|
|
1087
|
+
role: "region",
|
|
1088
|
+
"aria-labelledby": "ck-welcome-title",
|
|
1089
|
+
"data-commentkit-ui": !0,
|
|
1090
|
+
children: [
|
|
1091
|
+
/* @__PURE__ */ v("h2", {
|
|
1092
|
+
id: "ck-welcome-title",
|
|
1093
|
+
children: a("welcomeTitle", { project: t })
|
|
1094
|
+
}),
|
|
1095
|
+
/* @__PURE__ */ v("p", { children: a(matchMedia("(pointer: coarse)").matches ? "welcomeBodyTouch" : "welcomeBody") }),
|
|
1096
|
+
/* @__PURE__ */ v("div", {
|
|
1097
|
+
style: {
|
|
1098
|
+
display: "flex",
|
|
1099
|
+
gap: "8px"
|
|
1100
|
+
},
|
|
1101
|
+
children: [/* @__PURE__ */ v("button", {
|
|
1102
|
+
class: "ck-btn ck-primary",
|
|
1103
|
+
onClick: n,
|
|
1104
|
+
children: a("comment")
|
|
1105
|
+
}), /* @__PURE__ */ v("button", {
|
|
1106
|
+
class: "ck-btn",
|
|
1107
|
+
onClick: r,
|
|
1108
|
+
children: a("gotIt")
|
|
1109
|
+
})]
|
|
1110
|
+
})
|
|
1111
|
+
]
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region src/ui/App.tsx
|
|
1116
|
+
var De = "commentkit:share", Oe = "commentkit:welcomed";
|
|
1117
|
+
function ke({ client: e }) {
|
|
1118
|
+
return X(e.state, (e) => e.config?.enabled !== !1) ? /* @__PURE__ */ v(Ae, { client: e }) : /* @__PURE__ */ v("div", {
|
|
1119
|
+
class: "ck-toast",
|
|
1120
|
+
role: "status",
|
|
1121
|
+
children: a("paused")
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
function Ae({ client: e }) {
|
|
1125
|
+
let t = X(e.state, (e) => e.config), n = X(e.state, (e) => e.session), [r, i] = x({ name: "idle" }), [o, s] = x(null), [l, u] = x(!1), [d, f] = x(null), [p, m] = x(null);
|
|
1126
|
+
y(() => {
|
|
1127
|
+
l && !p && import("./Shortcuts-BSOKdMHt.js").then((e) => m(() => e.Shortcuts), N);
|
|
1128
|
+
}, [l]);
|
|
1129
|
+
let [h, g] = x(null), [_, S] = x(null), C = X(e.state, (e) => e.opening), [w] = x(() => Pe()), [E, D] = x(() => !!w && !Ie(Oe)), ee = T(null), [k, te] = x(null), A = e.options.shortcuts !== !1;
|
|
1130
|
+
y(() => {
|
|
1131
|
+
if (r.name === "idle") {
|
|
1132
|
+
let e = ee.current;
|
|
1133
|
+
ee.current = null, e?.isConnected && e.focus({ preventScroll: !0 });
|
|
1134
|
+
}
|
|
1135
|
+
}, [r.name]);
|
|
1136
|
+
let j = (e) => {
|
|
1137
|
+
if (r.name === "idle") {
|
|
1138
|
+
let e = document.querySelector("[data-commentkit-host]")?.shadowRoot?.activeElement;
|
|
1139
|
+
ee.current = e instanceof HTMLElement ? e : null;
|
|
1140
|
+
}
|
|
1141
|
+
i(e);
|
|
1142
|
+
}, M = b((e) => {
|
|
1143
|
+
s(e), setTimeout(() => s((t) => t === e ? null : t), e.tone === "error" || e.action ? 6e3 : 3500);
|
|
1144
|
+
}, []), N = b((t) => {
|
|
1145
|
+
let n = e.auth.pending();
|
|
1146
|
+
if (t instanceof c && t.code === "verification_required" && n) return i({
|
|
1147
|
+
name: "verify",
|
|
1148
|
+
email: n.email,
|
|
1149
|
+
draft: null
|
|
1150
|
+
});
|
|
1151
|
+
M({
|
|
1152
|
+
text: K(t),
|
|
1153
|
+
tone: "error"
|
|
1154
|
+
});
|
|
1155
|
+
}, [M]), P = T(null), F = T(null);
|
|
1156
|
+
F.current = r.name === "thread" ? r.threadId : null;
|
|
1157
|
+
let [I, L] = x(0);
|
|
1158
|
+
y(() => () => P.current?.stop(), []), y(() => {
|
|
1159
|
+
if (!n) return;
|
|
1160
|
+
let t = () => e.loadPageThreads().catch(N);
|
|
1161
|
+
t(), e.inbox().catch(() => void 0);
|
|
1162
|
+
let r = e.state.get().config;
|
|
1163
|
+
return r?.features.realtime && r.realtime && import("./live-YFyP1GnP.js").then((t) => (P.current ?? (P.current = t.liveUpdates(e, () => F.current, () => L((e) => e + 1))), e.connectRealtime((e) => P.current?.onPing(e)))).catch(() => void 0), Fe(t);
|
|
1164
|
+
}, [
|
|
1165
|
+
e,
|
|
1166
|
+
n,
|
|
1167
|
+
N
|
|
1168
|
+
]), y(() => {
|
|
1169
|
+
let e = new URL(location.href), t = e.searchParams.get("ck_thread");
|
|
1170
|
+
t && /^[0-9a-f-]{36}$/i.test(t) && (e.searchParams.delete("ck_thread"), history.replaceState(history.state, "", e.toString()), n ? i({
|
|
1171
|
+
name: "thread",
|
|
1172
|
+
threadId: t
|
|
1173
|
+
}) : Le("commentkit:pending-thread", t));
|
|
1174
|
+
}, [n]), y(() => {
|
|
1175
|
+
if (!n) return;
|
|
1176
|
+
let e = null;
|
|
1177
|
+
try {
|
|
1178
|
+
e = JSON.parse(sessionStorage.getItem("commentkit:pending-compose") ?? "null"), sessionStorage.removeItem(de);
|
|
1179
|
+
} catch {
|
|
1180
|
+
e = null;
|
|
1181
|
+
}
|
|
1182
|
+
e?.draft?.anchor && (scrollTo({
|
|
1183
|
+
top: e.scrollY,
|
|
1184
|
+
behavior: "auto"
|
|
1185
|
+
}), i({
|
|
1186
|
+
name: "composing",
|
|
1187
|
+
draft: e.draft
|
|
1188
|
+
}));
|
|
1189
|
+
}, [n]), y(() => {
|
|
1190
|
+
if (!n) return;
|
|
1191
|
+
let e = Ie("commentkit:pending-thread");
|
|
1192
|
+
e && (Re("commentkit:pending-thread"), i({
|
|
1193
|
+
name: "thread",
|
|
1194
|
+
threadId: e
|
|
1195
|
+
}));
|
|
1196
|
+
}, [n]), y(() => {
|
|
1197
|
+
let t = e.auth.pending();
|
|
1198
|
+
!n && t && i({
|
|
1199
|
+
name: "verify",
|
|
1200
|
+
email: t.email,
|
|
1201
|
+
draft: null
|
|
1202
|
+
});
|
|
1203
|
+
}, []), y(() => {
|
|
1204
|
+
r.name === "verify" && !d && import("./Guest-VNoofLxw.js").then((e) => f(() => e.GuestVerify), N);
|
|
1205
|
+
}, [r.name]), y(() => {
|
|
1206
|
+
r.name === "panel" && !h && import("./Panel-B88JYH52.js").then((e) => g(() => e.Panel), N), r.name === "thread" && !_ && import("./ThreadCard-izybwXIC.js").then((e) => S(() => e.ThreadCard), N);
|
|
1207
|
+
}, [r.name]), y(() => {
|
|
1208
|
+
if (!C || !n) return;
|
|
1209
|
+
if (e.state.set({ opening: null }), /^[0-9a-f-]{36}$/i.test(C)) return H(C);
|
|
1210
|
+
let t = C.trim().toUpperCase(), r = e.state.get().threads.find((e) => e.reference.toUpperCase() === t);
|
|
1211
|
+
if (r) return H(r);
|
|
1212
|
+
e.listThreads({
|
|
1213
|
+
q: t,
|
|
1214
|
+
status: "all",
|
|
1215
|
+
limit: 5
|
|
1216
|
+
}).then((e) => {
|
|
1217
|
+
let n = e.data.find((e) => e.reference.toUpperCase() === t);
|
|
1218
|
+
n ? Q(n.page.url, n.id, H) : M({
|
|
1219
|
+
text: a("threadNotFound"),
|
|
1220
|
+
tone: "error"
|
|
1221
|
+
});
|
|
1222
|
+
}, N);
|
|
1223
|
+
}, [C, n]), y(() => {
|
|
1224
|
+
let t = (t) => {
|
|
1225
|
+
if (!(t.defaultPrevented || Ne(t) || je(t) || !A && t.key !== "Escape")) {
|
|
1226
|
+
if (l) t.key === "Escape" && u(!1);
|
|
1227
|
+
else if (t.key === "?" && !t.metaKey && !t.ctrlKey && !t.altKey) t.preventDefault(), u(!0);
|
|
1228
|
+
else if (t.key === "Escape" && r.name !== "idle") t.preventDefault(), i({ name: "idle" });
|
|
1229
|
+
else if ((t.key === "c" || t.key === "C") && !t.metaKey && !t.ctrlKey && !t.altKey && r.name === "idle") t.preventDefault(), V();
|
|
1230
|
+
else if ((t.key === "j" || t.key === "k") && !t.metaKey && !t.ctrlKey && !t.altKey && n && (r.name === "idle" || r.name === "thread")) {
|
|
1231
|
+
let n = e.state.get().threads;
|
|
1232
|
+
if (!n.length || Me(t)) return;
|
|
1233
|
+
t.preventDefault();
|
|
1234
|
+
let i = r.name === "thread" ? n.findIndex((e) => e.id === r.threadId) : -1, a = n[(i + (t.key === "j" ? 1 : n.length - 1 + +(i < 0))) % n.length];
|
|
1235
|
+
a && H(a);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
1239
|
+
return addEventListener("keydown", t, !0), () => removeEventListener("keydown", t, !0);
|
|
1240
|
+
});
|
|
1241
|
+
let R = t?.read_only ?? !1, z = a(n && n.role !== "guest" ? "readOnly" : "readOnlyGuest"), B = !n && r.name === "idle" ? e.auth.pending() : null, V = () => {
|
|
1242
|
+
if (R) return M({
|
|
1243
|
+
text: z,
|
|
1244
|
+
tone: "error"
|
|
1245
|
+
});
|
|
1246
|
+
D(!1), j({ name: "commenting" });
|
|
1247
|
+
}, H = (e) => j({
|
|
1248
|
+
name: "thread",
|
|
1249
|
+
threadId: typeof e == "string" ? e : e.id
|
|
1250
|
+
}), U = async () => {
|
|
1251
|
+
let t = await e.signIn(w);
|
|
1252
|
+
return t === "signed_in" || (t === "redirecting" || M({
|
|
1253
|
+
text: a(t === "popup_blocked" ? "popupBlocked" : "signInCancelled"),
|
|
1254
|
+
tone: "error"
|
|
1255
|
+
}), !1);
|
|
1256
|
+
}, W = e.options.position ?? t?.appearance.position ?? "bottom-right";
|
|
1257
|
+
return /* @__PURE__ */ v(O, { children: [
|
|
1258
|
+
n ? /* @__PURE__ */ v(Te, {
|
|
1259
|
+
client: e,
|
|
1260
|
+
activeId: r.name === "thread" ? r.threadId : null,
|
|
1261
|
+
onOpen: H
|
|
1262
|
+
}) : null,
|
|
1263
|
+
r.name === "commenting" ? /* @__PURE__ */ v(Se, {
|
|
1264
|
+
onCancel: () => i({ name: "idle" }),
|
|
1265
|
+
onPick: (e) => i({
|
|
1266
|
+
name: "composing",
|
|
1267
|
+
draft: e
|
|
1268
|
+
})
|
|
1269
|
+
}) : null,
|
|
1270
|
+
r.name === "composing" ? /* @__PURE__ */ v(fe, {
|
|
1271
|
+
client: e,
|
|
1272
|
+
draft: r.draft,
|
|
1273
|
+
signedIn: !!n,
|
|
1274
|
+
onSignIn: U,
|
|
1275
|
+
onCancel: () => i({ name: "idle" }),
|
|
1276
|
+
onSent: (e, t) => {
|
|
1277
|
+
M({ text: t ? a(t === "screenshot" ? "sentWithoutScreenshot" : "sentWithoutFiles") : n?.role === "guest" || !n ? a("sentGuest") : a("sent") }), H(e);
|
|
1278
|
+
},
|
|
1279
|
+
share: w,
|
|
1280
|
+
onPending: (e) => {
|
|
1281
|
+
te(r.draft), i({
|
|
1282
|
+
name: "verify",
|
|
1283
|
+
email: e,
|
|
1284
|
+
draft: r.draft
|
|
1285
|
+
});
|
|
1286
|
+
},
|
|
1287
|
+
onError: N
|
|
1288
|
+
}) : null,
|
|
1289
|
+
r.name === "verify" && d ? /* @__PURE__ */ v(d, {
|
|
1290
|
+
client: e,
|
|
1291
|
+
email: r.email,
|
|
1292
|
+
onDone: (t) => {
|
|
1293
|
+
r.draft && ne(me(e, r.draft.anchor)), M({ text: a("sentGuest") }), t[0] ? H(t[0]) : i({ name: "idle" });
|
|
1294
|
+
},
|
|
1295
|
+
onDifferentEmail: () => i(r.draft ? {
|
|
1296
|
+
name: "composing",
|
|
1297
|
+
draft: r.draft
|
|
1298
|
+
} : { name: "commenting" }),
|
|
1299
|
+
onClose: () => i({ name: "idle" })
|
|
1300
|
+
}) : null,
|
|
1301
|
+
r.name === "thread" && _ ? /* @__PURE__ */ v(_, {
|
|
1302
|
+
client: e,
|
|
1303
|
+
threadId: r.threadId,
|
|
1304
|
+
version: I,
|
|
1305
|
+
onClose: () => i({ name: "idle" }),
|
|
1306
|
+
onError: N,
|
|
1307
|
+
notify: M
|
|
1308
|
+
}) : null,
|
|
1309
|
+
r.name === "panel" && h ? /* @__PURE__ */ v(h, {
|
|
1310
|
+
client: e,
|
|
1311
|
+
side: W.endsWith("left") ? "left" : "right",
|
|
1312
|
+
dock: W.startsWith("top") ? "top" : "bottom",
|
|
1313
|
+
onClose: () => i({ name: "idle" }),
|
|
1314
|
+
onOpen: H,
|
|
1315
|
+
onError: N
|
|
1316
|
+
}) : null,
|
|
1317
|
+
E && !n && r.name === "idle" ? /* @__PURE__ */ v(Ee, {
|
|
1318
|
+
position: W,
|
|
1319
|
+
project: t?.project.name ?? "",
|
|
1320
|
+
onStart: V,
|
|
1321
|
+
onDismiss: () => {
|
|
1322
|
+
D(!1), Le(Oe, "1");
|
|
1323
|
+
}
|
|
1324
|
+
}) : null,
|
|
1325
|
+
/* @__PURE__ */ v(xe, {
|
|
1326
|
+
client: e,
|
|
1327
|
+
position: W,
|
|
1328
|
+
commenting: r.name === "commenting",
|
|
1329
|
+
panelOpen: r.name === "panel",
|
|
1330
|
+
onComment: () => r.name === "commenting" ? i({ name: "idle" }) : V(),
|
|
1331
|
+
onPanel: () => r.name === "panel" ? i({ name: "idle" }) : j({ name: "panel" }),
|
|
1332
|
+
onSignIn: () => void U(),
|
|
1333
|
+
onSignOut: () => void e.signOut(),
|
|
1334
|
+
onShortcuts: A ? () => u(!0) : null,
|
|
1335
|
+
waiting: B?.email ?? null,
|
|
1336
|
+
onCode: () => B && j({
|
|
1337
|
+
name: "verify",
|
|
1338
|
+
email: B.email,
|
|
1339
|
+
draft: k
|
|
1340
|
+
}),
|
|
1341
|
+
covered: r.name !== "idle" && r.name !== "commenting" || l
|
|
1342
|
+
}),
|
|
1343
|
+
l && p ? /* @__PURE__ */ v(p, { onClose: () => u(!1) }) : null,
|
|
1344
|
+
R && r.name === "commenting" ? /* @__PURE__ */ v("div", {
|
|
1345
|
+
class: "ck-toast",
|
|
1346
|
+
role: "status",
|
|
1347
|
+
children: z
|
|
1348
|
+
}) : null,
|
|
1349
|
+
o ? /* @__PURE__ */ v("div", {
|
|
1350
|
+
class: "ck-toast",
|
|
1351
|
+
role: "status",
|
|
1352
|
+
"aria-live": "polite",
|
|
1353
|
+
"data-tone": o.tone,
|
|
1354
|
+
children: [o.text, o.action ? /* @__PURE__ */ v("button", {
|
|
1355
|
+
onClick: () => (s(null), o.action.run()),
|
|
1356
|
+
children: o.action.label
|
|
1357
|
+
}) : null]
|
|
1358
|
+
}) : null
|
|
1359
|
+
] });
|
|
1360
|
+
}
|
|
1361
|
+
function je(e) {
|
|
1362
|
+
return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-markup"));
|
|
1363
|
+
}
|
|
1364
|
+
function Me(e) {
|
|
1365
|
+
return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-panel"));
|
|
1366
|
+
}
|
|
1367
|
+
function Ne(e) {
|
|
1368
|
+
return e.composedPath().some((e) => e instanceof HTMLElement && (e.isContentEditable || [
|
|
1369
|
+
"INPUT",
|
|
1370
|
+
"TEXTAREA",
|
|
1371
|
+
"SELECT"
|
|
1372
|
+
].includes(e.tagName)));
|
|
1373
|
+
}
|
|
1374
|
+
function Pe() {
|
|
1375
|
+
let e = new URL(location.href), t = e.searchParams.get("ck");
|
|
1376
|
+
if (t && /^[A-Za-z0-9]{16,128}$/.test(t)) {
|
|
1377
|
+
e.searchParams.delete("ck"), history.replaceState(history.state, "", e.toString());
|
|
1378
|
+
try {
|
|
1379
|
+
sessionStorage.setItem(De, t);
|
|
1380
|
+
} catch {}
|
|
1381
|
+
return t;
|
|
1382
|
+
}
|
|
1383
|
+
try {
|
|
1384
|
+
return sessionStorage.getItem(De);
|
|
1385
|
+
} catch {
|
|
1386
|
+
return null;
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
function Fe(e) {
|
|
1390
|
+
let t = location.href, n = () => {
|
|
1391
|
+
location.href !== t && (t = location.href, e());
|
|
1392
|
+
}, r = setInterval(n, 500);
|
|
1393
|
+
return addEventListener("popstate", n), addEventListener("hashchange", n), () => {
|
|
1394
|
+
clearInterval(r), removeEventListener("popstate", n), removeEventListener("hashchange", n);
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
function Ie(e) {
|
|
1398
|
+
try {
|
|
1399
|
+
return localStorage.getItem(e);
|
|
1400
|
+
} catch {
|
|
1401
|
+
return null;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
function Le(e, t) {
|
|
1405
|
+
try {
|
|
1406
|
+
localStorage.setItem(e, t);
|
|
1407
|
+
} catch {}
|
|
1408
|
+
}
|
|
1409
|
+
function Re(e) {
|
|
1410
|
+
try {
|
|
1411
|
+
localStorage.removeItem(e);
|
|
1412
|
+
} catch {}
|
|
1413
|
+
}
|
|
1414
|
+
//#endregion
|
|
1415
|
+
//#region src/ui/styles.css?inline
|
|
1416
|
+
var ze = ":host{all:initial;--ck-accent:#ff5733;--ck-accent-ink:#121316;--ck-accent-soft:color-mix(in srgb, var(--ck-accent) 12%, var(--ck-bg));--ck-bg:#fff;--ck-bg-muted:#f6f5f2;--ck-bg-hover:#efede8;--ck-border:#e6e4de;--ck-hairline:#12131614;--ck-text:#121316;--ck-text-muted:#6b6a64;--ck-danger:#c2341b;--ck-success:#16794c;--ck-warning:#a15c00;--ck-review:#e5a400;--ck-progress:#3b82f6;--ck-shadow-sm:0 0 0 1px var(--ck-hairline), 0 1px 2px #1213160f, 0 2px 6px #1213160d;--ck-shadow:0 0 0 1px var(--ck-hairline), 0 4px 10px #1213160f, 0 16px 40px -6px #1213162e;--ck-radius:14px;--ck-radius-sm:8px;--ck-radius-md:10px;--ck-ease:cubic-bezier(.2, .8, .2, 1);--ck-font:ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;--ck-mono:ui-monospace, SFMono-Regular, Menlo, monospace;--ck-z:2147480000;font-family:var(--ck-font);color:var(--ck-text);font-size:14px;line-height:1.45}:host([data-theme=dark]){--ck-bg:#1a1b1e;--ck-bg-muted:#222327;--ck-bg-hover:#2b2c31;--ck-border:#33343a;--ck-hairline:#ffffff14;--ck-text:#f2f1ec;--ck-text-muted:#a3a29b;--ck-danger:#f0715a;--ck-success:#4cc38a;--ck-warning:#e3a33f;--ck-shadow-sm:0 0 0 1px var(--ck-hairline), 0 1px 2px #0006, 0 2px 6px #0000004d;--ck-shadow:0 0 0 1px var(--ck-hairline), 0 4px 10px #0000004d, 0 16px 40px -6px #0009}.ck-root{all:initial;font-family:var(--ck-font);letter-spacing:normal;word-spacing:normal;text-align:start;text-transform:none;text-indent:0;text-shadow:none;white-space:normal;color:var(--ck-text);cursor:auto;visibility:visible;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;font-style:normal;font-weight:400;line-height:1.45;display:block}*,:before,:after{box-sizing:border-box}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}:focus-visible{outline:2px solid var(--ck-accent);outline-offset:2px}::placeholder{color:var(--ck-text-muted);opacity:.8}.ck-root *{scrollbar-width:thin;scrollbar-color:var(--ck-border) transparent}@keyframes ck-pop{0%{opacity:0;transform:translateY(6px)scale(.98)}}@keyframes ck-fade{0%{opacity:0}}@keyframes ck-sheet{0%{opacity:0;transform:translateY(32px)}}.ck-launcher{z-index:var(--ck-z);align-items:center;gap:8px;display:flex;position:fixed}.ck-launcher[data-pos=bottom-right]{right:20px;bottom:calc(20px + env(safe-area-inset-bottom,0px))}.ck-launcher[data-pos=bottom-left]{left:20px;bottom:calc(20px + env(safe-area-inset-bottom,0px))}.ck-launcher[data-pos=top-right]{top:20px;right:20px}.ck-launcher[data-pos=top-left]{top:20px;left:20px}.ck-bar{background:color-mix(in srgb, var(--ck-bg) 86%, transparent);-webkit-backdrop-filter:blur(14px)saturate(1.4);backdrop-filter:blur(14px)saturate(1.4);box-shadow:var(--ck-shadow);animation:ck-pop .22s var(--ck-ease);border-radius:999px;align-items:center;gap:2px;padding:4px;display:flex}.ck-bar-btn{letter-spacing:-.005em;white-space:nowrap;height:34px;transition:background-color .12s, color .12s, transform .12s var(--ck-ease);background:0 0;border:0;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:13.5px;font-weight:600;display:inline-flex}.ck-bar-btn:hover{background:var(--ck-bg-hover)}.ck-bar-btn:active,.ck-btn:active,.ck-chip:active{transform:scale(.97)}.ck-bar-btn svg,.ck-btn svg,.ck-ghost svg{flex:none}.ck-bar-btn[aria-pressed=true],.ck-primary{background:var(--ck-accent);color:var(--ck-accent-ink);box-shadow:inset 0 1px 0 #ffffff38, 0 1px 2px color-mix(in srgb, var(--ck-accent) 40%, transparent)}.ck-bar-btn[aria-pressed=true]:hover,.ck-primary:hover{background:var(--ck-accent);filter:brightness(.96)}.ck-icon-btn{width:34px;color:var(--ck-text-muted);justify-content:center;padding:0;position:relative}.ck-icon-btn:hover{color:var(--ck-text)}.ck-badge{background:var(--ck-danger);color:#fff;min-width:16px;height:16px;box-shadow:0 0 0 2px var(--ck-bg);border-radius:999px;place-items:center;padding:0 4px;font-size:10px;font-weight:700;line-height:1;display:grid;position:absolute;top:2px;right:2px}.ck-count{background:var(--ck-bg-hover);color:var(--ck-text-muted);font-variant-numeric:tabular-nums;border-radius:999px;padding:1px 7px;font-size:11.5px;font-weight:700}.ck-mode-hint{z-index:var(--ck-z);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);color:#f2f1ec;background:#121316e0;border-radius:18px;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 10px;max-width:calc(100vw - 24px);padding:8px 8px 8px 16px;font-size:13px;font-weight:600;animation:.16s ease-out ck-fade;display:flex;position:fixed;top:16px;left:50%;transform:translate(-50%);box-shadow:0 8px 24px #00000038}.ck-mode-hint .ck-chip{color:inherit;background:#ffffff14;border-color:#ffffff2e}.ck-mode-hint .ck-chip:hover{background:#ffffff29}.ck-mode-frame{z-index:calc(var(--ck-z) - 1);pointer-events:none;box-shadow:inset 0 0 0 2px var(--ck-accent), inset 0 0 18px 4px color-mix(in srgb, var(--ck-accent) 45%, transparent), inset 0 0 60px 10px color-mix(in srgb, var(--ck-accent) 18%, transparent);border-radius:0;animation:.24s ease-out ck-fade,2.4s ease-in-out .24s infinite ck-glow;position:fixed;top:0;bottom:0;left:0;right:0}@keyframes ck-glow{50%{box-shadow:inset 0 0 0 2px var(--ck-accent), inset 0 0 26px 6px color-mix(in srgb, var(--ck-accent) 55%, transparent), inset 0 0 80px 14px color-mix(in srgb, var(--ck-accent) 24%, transparent)}}.ck-catcher{z-index:calc(var(--ck-z) - 2);cursor:crosshair;touch-action:pan-x pan-y pinch-zoom;background:0 0;position:fixed;top:0;bottom:0;left:0;right:0}.ck-outline{z-index:calc(var(--ck-z) - 1);pointer-events:none;border:2px solid var(--ck-accent);background:color-mix(in srgb, var(--ck-accent) 8%, transparent);box-shadow:0 0 0 4px color-mix(in srgb, var(--ck-accent) 14%, transparent);border-radius:6px;transition:all 70ms ease-out;position:fixed}.ck-region{z-index:calc(var(--ck-z) - 1);pointer-events:none;border:2px dashed var(--ck-accent);background:color-mix(in srgb, var(--ck-accent) 10%, transparent);border-radius:6px;position:fixed}.ck-pins{width:0;height:0;z-index:calc(var(--ck-z) - 3);position:absolute;top:0;left:0}.ck-pin{--ck-pin:var(--ck-accent);transform-origin:49% 97%;width:28px;height:32px;color:var(--ck-accent-ink);font-variant-numeric:tabular-nums;filter:drop-shadow(0 0 .6px #fff)drop-shadow(0 0 .6px #fff)drop-shadow(0 3px 6px #12131647);transition:scale .14s var(--ck-ease), filter .14s;background:0 0;border:0;padding:0;font-size:11px;font-weight:800;animation:.2s ease-out ck-fade;position:absolute;transform:translate(-49%,-97%)}.ck-pin svg{width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0;overflow:visible}.ck-pin path{fill:var(--ck-pin);stroke:#121316;stroke-width:3px;stroke-linejoin:round}.ck-pin>span{left:0;right:0;text-align:center;line-height:1;position:absolute;top:41%;translate:0 -50%}.ck-pin:hover{scale:1.08}.ck-pin[data-status=in_review]{--ck-pin:var(--ck-review);color:#121316}.ck-pin[data-status=in_progress]{--ck-pin:var(--ck-progress);color:#fff}.ck-pin[data-status=resolved]{--ck-pin:var(--ck-success);color:#fff}.ck-pin[data-state=moved]{opacity:.85}.ck-pin[aria-expanded=true]{filter:drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff) drop-shadow(0 0 5px color-mix(in srgb, var(--ck-pin) 60%, transparent)) drop-shadow(0 4px 8px #1213164d);scale:1.14}.ck-pin:focus-visible{outline-offset:3px;border-radius:50%}.ck-pin-region{pointer-events:none;border:2px dashed var(--ck-accent);border-radius:6px;position:absolute}.ck-card{z-index:var(--ck-z);background:var(--ck-bg);border-radius:var(--ck-radius);width:min(380px,100vw - 24px);max-height:min(560px,100vh - 24px);box-shadow:var(--ck-shadow);animation:ck-pop .18s var(--ck-ease);flex-direction:column;display:flex;position:fixed;overflow:hidden}.ck-card-head{border-bottom:1px solid var(--ck-hairline);align-items:center;gap:6px;min-height:46px;padding:7px 8px 7px 14px;display:flex}.ck-card-title{letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:650;overflow:hidden}.ck-card-body{flex:1;padding:12px 14px;overflow:auto}.ck-card-foot{border-top:1px solid var(--ck-hairline);background:color-mix(in srgb, var(--ck-bg-muted) 50%, var(--ck-bg));align-items:center;gap:8px;padding:8px 10px 10px 14px;display:flex}.ck-ghost{border-radius:var(--ck-radius-sm);color:var(--ck-text-muted);background:0 0;border:0;padding:6px 8px;font-weight:600;transition:background-color .12s,color .12s}.ck-ghost:hover{background:var(--ck-bg-hover);color:var(--ck-text)}.ck-card-head .ck-ghost{flex:none;place-items:center;width:32px;height:32px;padding:0;display:inline-grid}.ck-ghost-sm{padding:0 4px;font-size:12px}.ck-btn{border-radius:var(--ck-radius-sm);background:var(--ck-bg);height:32px;box-shadow:var(--ck-shadow-sm);white-space:nowrap;transition:background-color .12s, filter .12s, transform .12s var(--ck-ease);border:0;justify-content:center;align-items:center;gap:6px;padding:0 12px;font-size:13.5px;font-weight:600;display:inline-flex}.ck-btn:hover{background:var(--ck-bg-muted)}.ck-btn.ck-primary{background:var(--ck-accent);color:var(--ck-accent-ink);box-shadow:inset 0 1px 0 #ffffff38, 0 0 0 1px color-mix(in srgb, var(--ck-accent) 80%, #000), 0 1px 2px #1213161f}.ck-btn.ck-primary:hover{background:var(--ck-accent);filter:brightness(.96)}.ck-btn:disabled,.ck-btn.ck-primary:disabled{background:var(--ck-bg-muted);color:color-mix(in srgb, var(--ck-text-muted) 80%, transparent);box-shadow:0 0 0 1px var(--ck-hairline);cursor:not-allowed;filter:none;transform:none}.ck-spacer{flex:1}.ck-textarea{resize:none;field-sizing:content;border-radius:var(--ck-radius-md);border:1px solid var(--ck-border);background:var(--ck-bg);outline:none;width:100%;min-height:68px;max-height:220px;padding:8px 11px;line-height:1.5;transition:border-color .12s,box-shadow .12s;display:block}.ck-textarea:hover,.ck-input:hover{border-color:color-mix(in srgb, var(--ck-text-muted) 45%, var(--ck-border))}.ck-textarea:focus,.ck-input:focus{border-color:var(--ck-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--ck-accent) 18%, transparent);outline:none}.ck-input{border-radius:var(--ck-radius-sm);border:1px solid var(--ck-border);background:var(--ck-bg);width:100%;height:34px;padding:0 11px;transition:border-color .12s,box-shadow .12s}.ck-input[aria-invalid=true],.ck-textarea[aria-invalid=true]{border-color:var(--ck-danger)}.ck-muted{color:var(--ck-text-muted);font-size:12px}.ck-note{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);margin:8px 0 0;padding:10px 12px;font-size:13px;line-height:1.45}.ck-note[data-tone=warning]{background:color-mix(in srgb, var(--ck-review) 16%, var(--ck-bg))}.ck-note[data-tone=error]{background:color-mix(in srgb, var(--ck-danger) 10%, var(--ck-bg));color:var(--ck-danger)}.ck-shot{border-radius:var(--ck-radius-md);box-shadow:0 0 0 1px var(--ck-hairline);background:var(--ck-bg-muted);margin-top:10px;position:relative;overflow:hidden}.ck-shot img,.ck-shot canvas{width:100%;height:auto;display:block}.ck-msg .ck-shot img{object-fit:cover;object-position:top;max-height:150px}.ck-shot-tools{flex-wrap:wrap;gap:4px;margin-top:8px;display:flex}.ck-files{flex-wrap:wrap;gap:6px;margin-top:8px;display:flex}.ck-file{background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);border-radius:6px;padding:4px 8px;font-size:12px}.ck-msg{gap:10px;padding:6px 0;display:flex}.ck-msg+.ck-msg{border-top:1px solid var(--ck-hairline);padding-top:10px}.ck-avatar{background:var(--ck-accent-soft);width:28px;height:28px;color:color-mix(in srgb, var(--ck-accent) 70%, var(--ck-text));letter-spacing:.02em;box-shadow:0 0 0 1px var(--ck-hairline);border-radius:50%;flex:none;place-items:center;font-size:11px;font-weight:700;display:grid;overflow:hidden}.ck-avatar img{object-fit:cover;width:100%;height:100%}.ck-msg-main{flex:1;min-width:0}.ck-msg-meta{color:var(--ck-text-muted);align-items:baseline;gap:6px;font-size:12px;display:flex}.ck-msg-name{color:var(--ck-text);font-size:13px;font-weight:650}.ck-msg-body{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:2px;line-height:1.5}.ck-msg-body a{color:color-mix(in srgb, var(--ck-accent) 80%, var(--ck-text));text-underline-offset:2px}.ck-msg-body code{font-family:var(--ck-mono);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);border-radius:5px;padding:1px 5px;font-size:12px}.ck-reactions{flex-wrap:wrap;gap:4px;margin-top:6px;display:flex}.ck-reaction{border:1px solid var(--ck-border);background:var(--ck-bg);font-variant-numeric:tabular-nums;border-radius:999px;height:24px;padding:0 8px;font-size:12px;transition:background-color .12s,border-color .12s}.ck-reaction:hover{background:var(--ck-bg-muted)}.ck-reaction[aria-pressed=true]{border-color:color-mix(in srgb, var(--ck-accent) 60%, var(--ck-border));background:var(--ck-accent-soft)}.ck-status{--ck-tone:var(--ck-accent);background:color-mix(in srgb, var(--ck-tone) 12%, var(--ck-bg));color:color-mix(in srgb, var(--ck-tone) 45%, var(--ck-text));white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:2px 9px 2px 8px;font-size:12px;font-weight:650;display:inline-flex}.ck-status:before{content:\"\";background:var(--ck-tone);border-radius:50%;width:7px;height:7px}.ck-status[data-status=in_progress]{--ck-tone:var(--ck-progress)}.ck-status[data-status=in_review]{--ck-tone:var(--ck-review)}.ck-status[data-status=resolved]{--ck-tone:var(--ck-success)}.ck-status[data-status=closed]{--ck-tone:var(--ck-text-muted)}.ck-review-ask{border-radius:var(--ck-radius-md);background:color-mix(in srgb, var(--ck-review) 14%, var(--ck-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ck-review) 30%, transparent);margin-bottom:10px;padding:12px}.ck-actions{flex-wrap:wrap;gap:6px;margin-top:10px;display:flex}.ck-menu{z-index:2;background:var(--ck-bg);min-width:210px;box-shadow:var(--ck-shadow);animation:ck-pop .14s var(--ck-ease);border-radius:12px;padding:4px;position:absolute;top:48px;right:8px}.ck-menu button{text-align:start;border-radius:var(--ck-radius-sm);background:0 0;border:0;align-items:center;gap:8px;width:100%;padding:8px 10px;font-size:13.5px;display:flex}.ck-menu button:hover{background:var(--ck-bg-hover)}.ck-menu .ck-danger{color:var(--ck-danger)}.ck-menu-head{border-bottom:1px solid var(--ck-hairline);color:var(--ck-text-muted);text-overflow:ellipsis;white-space:nowrap;margin-bottom:4px;padding:6px 10px 8px;font-size:12px;overflow:hidden}.ck-panel{z-index:var(--ck-z);background:var(--ck-bg);border-radius:var(--ck-radius);width:min(400px,100vw - 24px);box-shadow:var(--ck-shadow);animation:ck-pop .2s var(--ck-ease);flex-direction:column;display:flex;position:fixed;top:12px;bottom:12px;overflow:hidden}.ck-panel[data-side=right]{right:12px}.ck-panel[data-side=left]{left:12px}@media (min-width:521px){.ck-panel[data-dock=bottom]{bottom:calc(74px + env(safe-area-inset-bottom,0px))}.ck-panel[data-dock=top]{top:74px}}.ck-tabs{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);gap:2px;margin:8px 10px 0;padding:3px;display:flex}.ck-tab{color:var(--ck-text-muted);white-space:nowrap;background:0 0;border:0;border-radius:7px;flex:1;justify-content:center;align-items:center;gap:6px;padding:5px 8px;font-size:13px;font-weight:600;transition:background-color .12s,color .12s;display:inline-flex}.ck-tab:hover{color:var(--ck-text)}.ck-tab[aria-selected=true]{color:var(--ck-text);background:var(--ck-bg);box-shadow:var(--ck-shadow-sm)}.ck-list{margin:0;padding:4px 6px;list-style:none}.ck-item{text-align:start;border-radius:var(--ck-radius-md);background:0 0;border:0;width:100%;padding:9px 10px;transition:background-color .12s;display:block}.ck-list>li+li,.ck-list>.ck-item+.ck-item{border-top:1px solid var(--ck-hairline)}.ck-item:hover{background:var(--ck-bg-muted)}.ck-item[data-unread=true]{background:var(--ck-accent-soft)}.ck-item[data-shot]{grid-template-columns:minmax(0,1fr) 64px;align-items:start;gap:12px;display:grid}.ck-item-main{min-width:0}.ck-item-top{color:var(--ck-text-muted);align-items:flex-start;gap:8px;font-size:12px;display:flex}.ck-item-tags{flex-wrap:wrap;flex:1;align-items:center;gap:4px 6px;min-width:0;display:flex}.ck-item-tags>strong{color:var(--ck-text);font-variant-numeric:tabular-nums;white-space:nowrap;margin-inline-end:2px;font-weight:650}.ck-time{white-space:nowrap;font-variant-numeric:tabular-nums;flex:none;line-height:20px}.ck-item-meta{text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.ck-item-thumb{object-fit:cover;object-position:top;background:var(--ck-bg-muted);width:64px;height:44px;box-shadow:0 0 0 1px var(--ck-hairline);border-radius:6px;margin-top:2px}.ck-item-text{-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:4px;line-height:1.45;display:-webkit-box;overflow:hidden}.ck-empty{text-align:center;color:var(--ck-text-muted);padding:32px 20px}.ck-empty strong{color:var(--ck-text);margin-bottom:4px;font-weight:650;display:block}.ck-art{margin:0 auto 10px;display:block;overflow:visible}.ck-art *{vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round}.ck-art-w,.ck-art-a,path.ck-art-m{stroke:var(--ck-text);stroke-width:2px}.ck-art-w{fill:var(--ck-bg)}.ck-art-a{fill:var(--ck-accent)}.ck-art-m{fill:var(--ck-bg-hover)}.ck-art-line{fill:none;stroke:var(--ck-text);stroke-width:2px}.ck-art-bold{stroke-width:4.5px}.ck-art-tick{fill:none;stroke:#fff;stroke-width:2.6px}.ck-art-dot{fill:var(--ck-border)}.ck-art-ink{fill:var(--ck-text)}.ck-art-spark{fill:none;stroke:var(--ck-accent);stroke-width:2.4px}.ck-art-ghost{fill:none;stroke:var(--ck-text-muted);stroke-width:2px;stroke-dasharray:5 5}.ck-art-shadow{fill:var(--ck-bg-hover)}.ck-empty .ck-hint{margin-top:2px;font-size:13px;display:block}.ck-suggest{background:var(--ck-bg);max-height:180px;box-shadow:var(--ck-shadow);z-index:3;animation:ck-pop .12s var(--ck-ease);border-radius:12px;padding:4px;position:absolute;bottom:56px;left:14px;right:14px;overflow:auto}.ck-suggest button{border-radius:var(--ck-radius-sm);text-align:start;background:0 0;border:0;align-items:center;gap:8px;width:100%;padding:6px 8px;display:flex}.ck-suggest button[aria-selected=true],.ck-suggest button:hover{background:var(--ck-bg-hover)}.ck-toast{z-index:calc(var(--ck-z) + 1);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);color:#f2f1ec;max-width:min(420px,100vw - 24px);animation:ck-pop .18s var(--ck-ease);background:#121316eb;border-radius:12px;align-items:center;gap:12px;padding:10px 12px 10px 16px;font-size:13.5px;font-weight:600;display:flex;position:fixed;bottom:84px;left:50%;transform:translate(-50%);box-shadow:0 10px 30px #00000040}.ck-toast[data-tone=error]{background:var(--ck-danger);color:#fff}.ck-toast[data-tone=error]:before{content:\"!\";background:#ffffff38;border-radius:50%;flex:none;place-items:center;width:18px;height:18px;margin-inline-start:-4px;font-size:12px;font-weight:800;line-height:1;display:grid}.ck-toast button{color:inherit;background:#ffffff24;border:0;border-radius:6px;flex:none;padding:4px 8px;font-weight:700}.ck-toast button:hover{background:#ffffff3d}.ck-welcome{z-index:var(--ck-z);background:var(--ck-bg);border-radius:var(--ck-radius);width:min(340px,100vw - 24px);box-shadow:var(--ck-shadow);animation:ck-pop .22s var(--ck-ease);padding:18px;position:fixed}.ck-welcome h2{letter-spacing:-.01em;margin:0 0 6px;font-size:15px;font-weight:650}.ck-welcome p{color:var(--ck-text-muted);margin:0 0 14px;line-height:1.5}.ck-markup{z-index:calc(var(--ck-z) + 2);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#0a0a0cc2;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:16px;display:flex;position:fixed;top:0;bottom:0;left:0;right:0}.ck-markup canvas{border-radius:var(--ck-radius-md);cursor:crosshair;touch-action:none;background:#fff;max-width:100%;max-height:calc(100vh - 120px);box-shadow:0 20px 50px #0006}.ck-markup-tools{background:var(--ck-bg);box-shadow:var(--ck-shadow);border-radius:999px;flex-wrap:wrap;justify-content:center;gap:4px;padding:5px;display:flex}.ck-filters{gap:6px;padding:8px 10px;display:flex}.ck-filters+.ck-filters{padding-top:0}.ck-filters select{width:auto}.ck-task{flex-wrap:wrap;gap:6px;padding:8px 14px 0;display:flex}.ck-date{position:relative}.ck-date[data-set]{color:var(--ck-text)}.ck-date-input{opacity:0;cursor:pointer;border:0;width:100%;height:100%;margin:0;padding:0;position:absolute;top:0;bottom:0;left:0;right:0}.ck-date:focus-within{outline:2px solid var(--ck-accent);outline-offset:1px}.ck-root .ck-date-input:focus-visible{outline:none}.ck-task .ck-chip{cursor:default}.ck-task button.ck-chip{cursor:pointer}.ck-task-pick{position:relative}.ck-task-menu{z-index:2;top:calc(100% + 4px);border:1px solid var(--ck-border);border-radius:var(--ck-radius-md);background:var(--ck-bg);min-width:180px;max-height:220px;box-shadow:var(--ck-shadow);padding:4px 10px 10px;position:absolute;overflow:auto}.ck-task-menu:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-task-menu:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-task-menu:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-task-menu:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-swatch{border-radius:50%;flex:none;width:8px;height:8px}.ck-pad{padding:8px 10px}.ck-branchbar{flex-wrap:wrap;gap:6px;padding:8px 10px 0;display:flex}.ck-chip{border:1px solid var(--ck-border);background:var(--ck-bg);height:26px;color:var(--ck-text-muted);cursor:pointer;text-overflow:ellipsis;white-space:nowrap;max-width:100%;transition:background-color .12s, border-color .12s, color .12s, transform .12s var(--ck-ease);border-radius:999px;align-items:center;gap:5px;padding:0 10px;font-size:12px;font-weight:600;display:inline-flex;overflow:hidden}.ck-chip:hover{color:var(--ck-text);background:var(--ck-bg-muted)}.ck-chip[aria-pressed=true],.ck-chip[aria-expanded=true]{background:var(--ck-accent-soft);color:color-mix(in srgb, var(--ck-accent) 55%, var(--ck-text));border-color:color-mix(in srgb, var(--ck-accent) 45%, var(--ck-border))}.ck-chip:focus-visible{outline:2px solid var(--ck-accent);outline-offset:1px}.ck-card-body>p.ck-muted{margin:0 0 8px;line-height:1.4}.ck-build{overflow-wrap:anywhere}.ck-tag{background:var(--ck-bg-hover);color:var(--ck-text-muted);white-space:nowrap;border-radius:999px;padding:1px 7px;font-size:11px;font-weight:600}.ck-badge-soft{white-space:nowrap;background:color-mix(in srgb, var(--ck-warning) 14%, transparent);color:var(--ck-warning);border-radius:999px;padding:1px 7px;font-size:11px;font-weight:600}.ck-skeleton{background:linear-gradient(90deg, var(--ck-bg-muted), var(--ck-bg-hover), var(--ck-bg-muted));background-size:200% 100%;border-radius:6px;height:12px;margin:10px 0;animation:1.2s linear infinite ck-shimmer}@keyframes ck-shimmer{to{background-position:-200% 0}}.ck-msg-skeleton{gap:10px;display:flex}.ck-msg-skeleton>div{flex:1}.ck-skeleton-avatar{border-radius:50%;flex:none;width:28px;height:28px;margin:0;display:block}.ck-msg-skeleton .ck-skeleton:not(.ck-skeleton-avatar){margin:4px 0 10px}.ck-msg-skeleton .ck-skeleton:first-child{width:34%}.ck-msg-skeleton .ck-skeleton:nth-child(2){width:92%}.ck-msg-skeleton .ck-skeleton:nth-child(3){width:64%}.ck-loading{padding:4px 16px}.ck-loading-row{padding:12px 0}.ck-loading-row+.ck-loading-row{border-top:1px solid var(--ck-hairline)}.ck-loading-row .ck-skeleton{margin:0 0 8px}.ck-loading-row .ck-skeleton:first-child{width:38%}.ck-loading-row .ck-skeleton:nth-child(2){width:86%}.ck-loading-row .ck-skeleton:last-child{width:52%;height:10px;margin:0}.ck-input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}.ck-empty .ck-btn{margin:12px auto 0;display:flex}.ck-root :focus{outline:none}.ck-root :focus-visible{outline:2px solid var(--ck-accent);outline-offset:2px}.ck-root .ck-input:focus-visible{outline:none}.ck-root .ck-textarea:focus-visible{outline:none}.ck-root [dir=rtl],.ck-root[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.ck-launcher-note{background:var(--ck-bg);width:max-content;max-width:min(300px,100vw - 40px);box-shadow:var(--ck-shadow);animation:ck-pop .2s var(--ck-ease);margin:0;position:absolute;bottom:calc(100% + 8px);right:0}.ck-launcher[data-pos$=left] .ck-launcher-note{left:0;right:auto}.ck-launcher[data-pos^=top] .ck-launcher-note{top:calc(100% + 8px);bottom:auto}.ck-launcher .ck-menu{top:auto;bottom:50px;right:0}.ck-launcher[data-pos^=top] .ck-menu{top:50px;bottom:auto}.ck-launcher[data-pos$=left] .ck-menu{left:0;right:auto}.ck-scrim{z-index:calc(var(--ck-z) + 3);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0a0a0c73;place-items:center;padding:12px;animation:.14s ease-out ck-fade;display:grid;position:fixed;top:0;bottom:0;left:0;right:0}.ck-scrim .ck-card{max-height:calc(100vh - 24px);position:static!important}.ck-dialog h2{margin:0;font-size:15px;font-weight:650}.ck-keys{gap:10px;margin:0;display:grid}.ck-keys div{grid-template-columns:minmax(96px,auto) 1fr;align-items:baseline;gap:12px;display:grid}.ck-keys dd{color:var(--ck-text-muted);margin:0}kbd{font-family:var(--ck-mono);border:1px solid var(--ck-border);background:var(--ck-bg-muted);white-space:nowrap;border-bottom-width:2px;border-radius:6px;padding:2px 6px;font-size:11.5px}.ck-here{color:var(--ck-text-muted);white-space:nowrap;align-items:center;gap:6px;font-size:12px;display:inline-flex}.ck-dot{background:var(--ck-success);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb, var(--ck-success) 20%, transparent);border-radius:50%}.ck-ghost.ck-danger{color:var(--ck-danger)}.ck-btn.ck-danger-btn,.ck-danger-btn{background:var(--ck-danger);color:#fff;box-shadow:inset 0 1px 0 #ffffff2e, 0 0 0 1px color-mix(in srgb, var(--ck-danger) 80%, #000)}.ck-danger-btn:hover{background:var(--ck-danger);filter:brightness(.95)}.ck-check{cursor:pointer;align-items:flex-start;gap:8px;margin-top:10px;font-size:13px;display:flex}.ck-check input{width:16px;height:16px;accent-color:var(--ck-accent);flex:none;margin:2px 0 0}.ck-label-box{z-index:1;background:var(--ck-bg);box-shadow:var(--ck-shadow);border-radius:12px;align-items:center;gap:6px;padding:6px;display:flex;position:fixed}.ck-label-box .ck-input{width:200px;font-weight:650}.ck-pad-x{margin:8px 12px 0}.ck-guest{gap:10px;margin-top:12px;display:grid}.ck-field{color:var(--ck-text-muted);gap:5px;font-size:12.5px;font-weight:600;display:grid}.ck-field .ck-input{color:var(--ck-text);font-size:14px;font-weight:400}.ck-error{color:var(--ck-danger);font-size:12px;font-weight:500}.ck-verify-text{margin:0 0 12px;line-height:1.5}.ck-card h2.ck-card-title{margin:0;font-size:14px}.ck-code{font-family:var(--ck-mono);letter-spacing:.32em;text-align:center;height:46px;font-size:20px}.ck-catcher{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}@media (max-width:520px){.ck-launcher[data-covered=true]{display:none}.ck-card{width:auto;max-height:min(70vh, calc(100vh - 24px - var(--ck-kb,0px)));border-radius:16px;animation-name:ck-sheet;left:12px!important;right:12px!important;bottom:calc(12px + var(--ck-kb,0px) + env(safe-area-inset-bottom,0px))!important;top:auto!important}.ck-card~.ck-toast,.ck-panel~.ck-toast{top:12px;bottom:auto}.ck-panel{width:100%;height:80vh;padding-bottom:env(safe-area-inset-bottom,0px);border-radius:18px 18px 0 0;animation-name:ck-sheet;top:auto;bottom:0;left:0!important;right:0!important}.ck-panel:before{content:\"\";background:var(--ck-border);border-radius:2px;flex:none;width:36px;height:4px;margin:8px auto 0;display:block}.ck-mode-hint{top:auto;bottom:calc(84px + env(safe-area-inset-bottom,0px))}}@media (pointer:coarse){.ck-bar-btn,.ck-btn,.ck-ghost{min-width:44px;min-height:44px}.ck-tab,.ck-chip,.ck-reaction{min-width:36px;min-height:36px}.ck-item{min-height:48px}.ck-pin:after{content:\"\";position:absolute;top:-10px;bottom:-10px;left:-10px;right:-10px}}", Be = /* @__PURE__ */ e({
|
|
1417
|
+
Boundary: () => Ue,
|
|
1418
|
+
mountWidget: () => Ve
|
|
1419
|
+
});
|
|
1420
|
+
function Ve(e, t = () => void 0) {
|
|
1421
|
+
let n = document.createElement("div");
|
|
1422
|
+
n.setAttribute("data-commentkit-host", ""), n.style.cssText = "position:absolute;top:0;left:0;width:0;height:0;z-index:2147483000;";
|
|
1423
|
+
let r = n.attachShadow({ mode: "open" });
|
|
1424
|
+
if ("adoptedStyleSheets" in Document.prototype && "replaceSync" in CSSStyleSheet.prototype) {
|
|
1425
|
+
let e = new CSSStyleSheet();
|
|
1426
|
+
e.replaceSync(ze), r.adoptedStyleSheets = [e];
|
|
1427
|
+
} else {
|
|
1428
|
+
let e = document.createElement("style");
|
|
1429
|
+
e.textContent = ze, r.appendChild(e);
|
|
1430
|
+
}
|
|
1431
|
+
let i = document.createElement("div");
|
|
1432
|
+
i.className = "ck-root", i.dir = s(), i.lang = o(), r.appendChild(i), document.documentElement.appendChild(n);
|
|
1433
|
+
let a = () => {
|
|
1434
|
+
let t = e.options.theme ?? e.state.get().config?.appearance.theme ?? "auto", r = t === "dark" || t === "auto" && matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1435
|
+
n.setAttribute("data-theme", r ? "dark" : "light");
|
|
1436
|
+
let i = e.state.get().config?.appearance.accent;
|
|
1437
|
+
if (i && /^#[0-9a-f]{6}$/i.test(i)) {
|
|
1438
|
+
n.style.setProperty("--ck-accent", i);
|
|
1439
|
+
let [e, t, r] = [
|
|
1440
|
+
1,
|
|
1441
|
+
3,
|
|
1442
|
+
5
|
|
1443
|
+
].map((e) => {
|
|
1444
|
+
let t = parseInt(i.slice(e, e + 2), 16) / 255;
|
|
1445
|
+
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1446
|
+
});
|
|
1447
|
+
n.style.setProperty("--ck-accent-ink", .2126 * e + .7152 * t + .0722 * r > .18 ? "#121316" : "#ffffff");
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
a();
|
|
1451
|
+
let c = matchMedia("(prefers-color-scheme: dark)");
|
|
1452
|
+
c.addEventListener?.("change", a);
|
|
1453
|
+
let l = e.state.subscribe(a), u = window.visualViewport, d = () => u && n.style.setProperty("--ck-kb", _(Math.max(0, innerHeight - u.height - u.offsetTop)));
|
|
1454
|
+
return u?.addEventListener("resize", d), u?.addEventListener("scroll", d), D(/* @__PURE__ */ v(Ue, {
|
|
1455
|
+
onCrash: t,
|
|
1456
|
+
onError: (t) => e.reportCrash(t),
|
|
1457
|
+
children: /* @__PURE__ */ v(ke, { client: e })
|
|
1458
|
+
}), i), () => {
|
|
1459
|
+
D(null, i), l(), c.removeEventListener?.("change", a), u?.removeEventListener("resize", d), u?.removeEventListener("scroll", d), n.remove();
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
var He = !1, Ue = class extends h {
|
|
1463
|
+
constructor(...e) {
|
|
1464
|
+
super(...e), l(this, "state", { crashed: !1 });
|
|
1465
|
+
}
|
|
1466
|
+
componentDidCatch(e) {
|
|
1467
|
+
if (!this.state.crashed) {
|
|
1468
|
+
this.setState({ crashed: !0 });
|
|
1469
|
+
try {
|
|
1470
|
+
this.props.onError?.(e);
|
|
1471
|
+
} catch {}
|
|
1472
|
+
He || (He = !0, console.warn("[CommentKit] The widget stopped after an error and was removed. Your page is not affected.", e)), setTimeout(() => {
|
|
1473
|
+
try {
|
|
1474
|
+
this.props.onCrash();
|
|
1475
|
+
} catch {}
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
render() {
|
|
1480
|
+
return this.state.crashed ? null : this.props.children;
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
//#endregion
|
|
1484
|
+
export { Ue as Boundary, U as _, pe as a, le as c, ae as d, oe as f, H as g, V as h, he as i, ce as l, ne as m, Ve as mountWidget, Q as n, _e as o, K as p, ge as r, ue as s, Be as t, X as u };
|