@commentkit/comment-kit 1.0.1 → 1.5.1

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +129 -1
  2. package/README.md +12 -5
  3. package/SECURITY.md +3 -1
  4. package/dist/npm/THIRD_PARTY_NOTICES.txt +22 -23
  5. package/dist/npm/chunks/AgentSend-DjFZSC0S.js +64 -0
  6. package/dist/npm/chunks/Checklist-BEz4IZdT.js +259 -0
  7. package/dist/npm/chunks/Composer-D1wbmdjF.js +681 -0
  8. package/dist/npm/chunks/Guest-CtyRy8Kz.js +170 -0
  9. package/dist/npm/chunks/MarkupEditor-CPH4yKx4.js +334 -0
  10. package/dist/npm/chunks/Panel-DSoUAlbQ.js +863 -0
  11. package/dist/npm/chunks/Settings-C_qV4n7J.js +206 -0
  12. package/dist/npm/chunks/{Shortcuts-3AOERWBh.js → Shortcuts-ChnaribX.js} +21 -17
  13. package/dist/npm/chunks/StyleEditor-DqZd6C5o.js +44 -0
  14. package/dist/npm/chunks/StylePanel-DMC3riYK.js +199 -0
  15. package/dist/npm/chunks/TaskFields-BfjjllMx.js +272 -0
  16. package/dist/npm/chunks/ThreadCard-DmKAelSL.js +1026 -0
  17. package/dist/npm/chunks/Viewer-mw69qSI5.js +110 -0
  18. package/dist/npm/chunks/agent-CqDO3JMA.js +146 -0
  19. package/dist/npm/chunks/anchor-OCQnjp_6.js +294 -0
  20. package/dist/npm/chunks/{ar-BVQ4ToG2.js → ar-BQ9K9Oqf.js} +188 -7
  21. package/dist/npm/chunks/card-bits-C7bIk5KX.js +126 -0
  22. package/dist/npm/chunks/client-dZeNdizE.js +754 -0
  23. package/dist/npm/chunks/colors-CAjY4jxf.js +137 -0
  24. package/dist/npm/chunks/confetti-DKeKR7-6.js +41 -0
  25. package/dist/npm/chunks/{de-CamSq76K.js → de-CcPi8xdC.js} +159 -7
  26. package/dist/npm/chunks/drafts-CpQdHhcK.js +51 -0
  27. package/dist/npm/chunks/{es-BBIlcnsU.js → es-DXgkjDCG.js} +159 -7
  28. package/dist/npm/chunks/extension-BFkXOmX5.js +50 -0
  29. package/dist/npm/chunks/{extension-CLm_T7Vj.js → extension-Gvei3opb.js} +2 -2
  30. package/dist/npm/chunks/{fr-BXsff0Zz.js → fr-IjJaUbWh.js} +159 -7
  31. package/dist/npm/chunks/{hi-y-APBuxh.js → hi-BhKQK2MU.js} +159 -7
  32. package/dist/npm/chunks/html2canvas-pro.esm-lgs6tb4C.js +8378 -0
  33. package/dist/npm/chunks/i18n-DAJGndZ2.js +904 -0
  34. package/dist/npm/chunks/{it-C5MH_Ktv.js → it-DKiSCkiD.js} +159 -7
  35. package/dist/npm/chunks/{ja-s1JJld2J.js → ja-BI1WagDg.js} +159 -7
  36. package/dist/npm/chunks/{live-CkVrNM1-.js → live-MvvBdoGd.js} +1 -1
  37. package/dist/npm/chunks/lock-C82sC17d.js +30 -0
  38. package/dist/npm/chunks/{nl-CFzRMEfl.js → nl-CJw3VUQ5.js} +159 -7
  39. package/dist/npm/chunks/pick-dDDLxCDI.js +120 -0
  40. package/dist/npm/chunks/{pt-BR-DE_r-5UM.js → pt-BR-CjBolC5g.js} +159 -7
  41. package/dist/npm/chunks/{pusher-BSsQoE1K.js → realtime-D22tI_AS.js} +58 -4
  42. package/dist/npm/chunks/source-BQS2_xfB.js +146 -0
  43. package/dist/npm/chunks/src-C_oUnL0i.js +150 -0
  44. package/dist/npm/chunks/start-C5-rebEU.js +1783 -0
  45. package/dist/npm/chunks/upload-CzPAjktW.js +42 -0
  46. package/dist/npm/chunks/uploads-tpLjiJdH.js +541 -0
  47. package/dist/npm/chunks/{zh-CN--gibO2l7.js → zh-CN-BrZGx2S0.js} +159 -7
  48. package/dist/npm/element.js +4 -5
  49. package/dist/npm/headless.js +3 -3
  50. package/dist/npm/index.js +2 -2
  51. package/dist/npm/react.js +1 -1
  52. package/dist/npm/svelte.js +1 -1
  53. package/dist/npm/types/adapters/vue.d.ts +14 -0
  54. package/dist/npm/types/anchor/index.d.ts +22 -1
  55. package/dist/npm/types/core/api.d.ts +3 -0
  56. package/dist/npm/types/core/auth.d.ts +11 -0
  57. package/dist/npm/types/core/client.d.ts +128 -6
  58. package/dist/npm/types/core/types.d.ts +78 -4
  59. package/dist/npm/types/headless.d.ts +1 -1
  60. package/dist/npm/types/index.d.ts +6 -1
  61. package/dist/npm/vue.js +5 -1
  62. package/package.json +6 -3
  63. package/dist/npm/chunks/Guest-CdfnuD8T.js +0 -157
  64. package/dist/npm/chunks/MarkupEditor-Clb17Tse.js +0 -199
  65. package/dist/npm/chunks/Panel-CgvEbZXr.js +0 -438
  66. package/dist/npm/chunks/ThreadCard-DuGKe-gE.js +0 -817
  67. package/dist/npm/chunks/anchor-DT-Ynhh1.js +0 -270
  68. package/dist/npm/chunks/art-Bn9_ANNS.js +0 -155
  69. package/dist/npm/chunks/client-CS5oL_LQ.js +0 -620
  70. package/dist/npm/chunks/colors-CX-IPjvb.js +0 -86
  71. package/dist/npm/chunks/extension-DWHHer7j.js +0 -26
  72. package/dist/npm/chunks/format-CP2xZaec.js +0 -524
  73. package/dist/npm/chunks/html2canvas-DfGb8yka.js +0 -4024
  74. package/dist/npm/chunks/mount-VmnAiANB.js +0 -1507
  75. package/dist/npm/chunks/privacy-DLhezjyi.js +0 -30
  76. package/dist/npm/chunks/realtime-CBRW9BB3.js +0 -34
  77. package/dist/npm/chunks/src-DG8ehgE9.js +0 -549
@@ -1,1507 +0,0 @@
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-DG8ehgE9.js";
3
- import { c, l, r as u } from "./client-CS5oL_LQ.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-CP2xZaec.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 ne(e = {}) {
54
- let t = (e.redact ?? []).filter(F), n = innerWidth, i = innerHeight, a = null;
55
- r() && (a = await import("./extension-CLm_T7Vj.js").then((e) => e.captureTab(t)).catch(() => null)), a ?? (a = await j(t, n, i));
56
- let o = a.getContext("2d");
57
- return o && M(o, a.width / Math.max(1, n), e), {
58
- blob: await N(a),
59
- width: a.width,
60
- height: a.height
61
- };
62
- }
63
- async function j(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) => I(t, e)), o = Math.min(devicePixelRatio || 1, 2, Math.sqrt(te / Math.max(1, n * r)));
65
- return P(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 M(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 N(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 P(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 F(e) {
107
- try {
108
- return document.createDocumentFragment().querySelector(e), !0;
109
- } catch {
110
- return !1;
111
- }
112
- }
113
- function I(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 L = "commentkit:draft:v2:", R = !1;
123
- function z(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 B(e, ...t) {
132
- return `${L}${e}:${z(t.map((e) => e ?? "").join(""))}`;
133
- }
134
- function V(e, t = Date.now()) {
135
- U(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 H(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 re(e) {
152
- H(e, "");
153
- }
154
- function U(e = Date.now(), t = !1) {
155
- if (!R || t) {
156
- R = !0;
157
- try {
158
- for (let t = localStorage.length - 1; t >= 0; t--) {
159
- let n = localStorage.key(t);
160
- if (!n?.startsWith(L)) 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 W = {
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 = W[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(() => V(p)), [b, S] = x([]), [E, D] = x(null), [k, te] = x(null), [A, j] = x(f?.features.screenshots === !1 ? "off" : "capturing"), [M, N] = x([]), [P, F] = x(null), [I, L] = x([]), [R, z] = x(!1), [B, U] = x(!1), W = !!(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 ne({
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), j("ready"));
378
- }, () => !n && j("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), H(p, e);
388
- };
389
- y(() => {
390
- Q.current = null;
391
- }, [
392
- g,
393
- b,
394
- E,
395
- A,
396
- M,
397
- I,
398
- G
399
- ]);
400
- let xe = C(() => _e(t.point), [t.point]), Se = (e) => {
401
- let t = ae(I, e, f?.limits.max_upload_bytes ?? 10485760);
402
- L(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 I) try {
413
- a.push((await e.upload(t, t.name)).id);
414
- } catch {
415
- i ?? (i = "files");
416
- }
417
- let o = {
418
- ...ee(),
419
- ...W && G ? n() : {},
420
- screenshot_id: r,
421
- markup: M.length ? M : 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 (R || !g.trim() || !q) return;
436
- if (U(!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
- z(!0);
443
- try {
444
- let n = !r && !u;
445
- if (Y && u) {
446
- let { startGuest: t } = await import("./Guest-CdfnuD8T.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
- re(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
- U(n ?? !0), n || l(t);
469
- } finally {
470
- z(!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
- B && q ? /* @__PURE__ */ v("div", {
505
- class: "ck-note",
506
- "data-tone": "warning",
507
- role: "alert",
508
- children: B === !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
- ] }) : `${B} ${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: R,
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-Clb17Tse.js").then((e) => F(() => 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: () => j("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: () => j("ready"),
612
- children: [/* @__PURE__ */ v(w, {
613
- name: "image",
614
- size: 14
615
- }), a("screenshotAdd")]
616
- }) : null,
617
- W ? /* @__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: I,
627
- onRemove: (e) => L(I.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: R || !g.trim() || !q,
647
- onClick: () => void $(),
648
- children: a(R ? "sending" : J && !r ? "signIn" : "send")
649
- })
650
- ]
651
- }),
652
- P && E ? /* @__PURE__ */ v(P, {
653
- image: E.blob,
654
- onCancel: () => F(null),
655
- onDone: (e, t) => {
656
- D({
657
- ...E,
658
- blob: e
659
- }), N(t), F(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 B(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);
1126
- y(() => {
1127
- if (!o || o.tone !== "error" && !o.action) return;
1128
- let e = (e) => {
1129
- e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-toast")) || s(null);
1130
- };
1131
- return addEventListener("pointerdown", e, !0), () => removeEventListener("pointerdown", e, !0);
1132
- }, [o]);
1133
- let [l, u] = x(!1), [d, f] = x(null), [p, m] = x(null);
1134
- y(() => {
1135
- l && !p && import("./Shortcuts-3AOERWBh.js").then((e) => m(() => e.Shortcuts), N);
1136
- }, [l]);
1137
- let [h, g] = x(null), [_, S] = x(null), C = X(e.state, (e) => e.opening), [E] = x(() => Pe()), [D, ee] = x(() => !!E && !Ie(Oe)), k = T(null), [te, A] = x(null), ne = e.options.shortcuts !== !1;
1138
- y(() => {
1139
- if (r.name === "idle") {
1140
- let e = k.current;
1141
- k.current = null, e?.isConnected && e.focus({ preventScroll: !0 });
1142
- }
1143
- }, [r.name]);
1144
- let j = (e) => {
1145
- if (r.name === "idle") {
1146
- let e = document.querySelector("[data-commentkit-host]")?.shadowRoot?.activeElement;
1147
- k.current = e instanceof HTMLElement ? e : null;
1148
- }
1149
- i(e);
1150
- }, M = b((e) => {
1151
- s(e), e.tone !== "error" && !e.action && setTimeout(() => s((t) => t === e ? null : t), 4e3);
1152
- }, []), N = b((t) => {
1153
- let n = e.auth.pending();
1154
- if (t instanceof c && t.code === "verification_required" && n) return i({
1155
- name: "verify",
1156
- email: n.email,
1157
- draft: null
1158
- });
1159
- M({
1160
- text: K(t),
1161
- tone: "error"
1162
- });
1163
- }, [M]), P = T(null), F = T(null);
1164
- F.current = r.name === "thread" ? r.threadId : null;
1165
- let [I, L] = x(0);
1166
- y(() => () => P.current?.stop(), []), y(() => {
1167
- if (!n) return;
1168
- let t = () => e.loadPageThreads().catch(N);
1169
- t(), e.inbox().catch(() => void 0);
1170
- let r = e.state.get().config;
1171
- return r?.features.realtime && r.realtime && import("./live-CkVrNM1-.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);
1172
- }, [
1173
- e,
1174
- n,
1175
- N
1176
- ]), y(() => {
1177
- let e = new URL(location.href), t = e.searchParams.get("ck_thread");
1178
- t && /^[0-9a-f-]{36}$/i.test(t) && (e.searchParams.delete("ck_thread"), history.replaceState(history.state, "", e.toString()), n ? i({
1179
- name: "thread",
1180
- threadId: t
1181
- }) : Le("commentkit:pending-thread", t));
1182
- }, [n]), y(() => {
1183
- if (!n) return;
1184
- let e = null;
1185
- try {
1186
- e = JSON.parse(sessionStorage.getItem("commentkit:pending-compose") ?? "null"), sessionStorage.removeItem(de);
1187
- } catch {
1188
- e = null;
1189
- }
1190
- e?.draft?.anchor && (scrollTo({
1191
- top: e.scrollY,
1192
- behavior: "auto"
1193
- }), i({
1194
- name: "composing",
1195
- draft: e.draft
1196
- }));
1197
- }, [n]), y(() => {
1198
- if (!n) return;
1199
- let e = Ie("commentkit:pending-thread");
1200
- e && (Re("commentkit:pending-thread"), i({
1201
- name: "thread",
1202
- threadId: e
1203
- }));
1204
- }, [n]), y(() => {
1205
- let t = e.auth.pending();
1206
- !n && t && i({
1207
- name: "verify",
1208
- email: t.email,
1209
- draft: null
1210
- });
1211
- }, []), y(() => {
1212
- r.name === "verify" && !d && import("./Guest-CdfnuD8T.js").then((e) => f(() => e.GuestVerify), N);
1213
- }, [r.name]), y(() => {
1214
- r.name === "panel" && !h && import("./Panel-CgvEbZXr.js").then((e) => g(() => e.Panel), N), r.name === "thread" && !_ && import("./ThreadCard-DuGKe-gE.js").then((e) => S(() => e.ThreadCard), N);
1215
- }, [r.name]), y(() => {
1216
- if (!C || !n) return;
1217
- if (e.state.set({ opening: null }), /^[0-9a-f-]{36}$/i.test(C)) return H(C);
1218
- let t = C.trim().toUpperCase(), r = e.state.get().threads.find((e) => e.reference.toUpperCase() === t);
1219
- if (r) return H(r);
1220
- e.listThreads({
1221
- q: t,
1222
- status: "all",
1223
- limit: 5
1224
- }).then((e) => {
1225
- let n = e.data.find((e) => e.reference.toUpperCase() === t);
1226
- n ? Q(n.page.url, n.id, H) : M({
1227
- text: a("threadNotFound"),
1228
- tone: "error"
1229
- });
1230
- }, N);
1231
- }, [C, n]), y(() => {
1232
- let t = (t) => {
1233
- if (!(t.defaultPrevented || Ne(t) || je(t) || !ne && t.key !== "Escape")) {
1234
- if (l) t.key === "Escape" && u(!1);
1235
- else if (t.key === "?" && !t.metaKey && !t.ctrlKey && !t.altKey) t.preventDefault(), u(!0);
1236
- else if (t.key === "Escape" && r.name !== "idle") t.preventDefault(), i({ name: "idle" });
1237
- else if ((t.key === "c" || t.key === "C") && !t.metaKey && !t.ctrlKey && !t.altKey && r.name === "idle") t.preventDefault(), V();
1238
- else if ((t.key === "j" || t.key === "k") && !t.metaKey && !t.ctrlKey && !t.altKey && n && (r.name === "idle" || r.name === "thread")) {
1239
- let n = e.state.get().threads;
1240
- if (!n.length || Me(t)) return;
1241
- t.preventDefault();
1242
- 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];
1243
- a && H(a);
1244
- }
1245
- }
1246
- };
1247
- return addEventListener("keydown", t, !0), () => removeEventListener("keydown", t, !0);
1248
- });
1249
- let R = t?.read_only ?? !1, z = a(n && n.role !== "guest" ? "readOnly" : "readOnlyGuest"), B = !n && r.name === "idle" ? e.auth.pending() : null, V = () => {
1250
- if (R) return M({
1251
- text: z,
1252
- tone: "error"
1253
- });
1254
- ee(!1), j({ name: "commenting" });
1255
- }, H = (e) => j({
1256
- name: "thread",
1257
- threadId: typeof e == "string" ? e : e.id
1258
- }), U = async () => {
1259
- let t = await e.signIn(E);
1260
- return t === "signed_in" || (t === "redirecting" || M({
1261
- text: a(t === "popup_blocked" ? "popupBlocked" : "signInCancelled"),
1262
- tone: "error"
1263
- }), !1);
1264
- }, W = e.options.position ?? t?.appearance.position ?? "bottom-right";
1265
- return /* @__PURE__ */ v(O, { children: [
1266
- n ? /* @__PURE__ */ v(Te, {
1267
- client: e,
1268
- activeId: r.name === "thread" ? r.threadId : null,
1269
- onOpen: H
1270
- }) : null,
1271
- r.name === "commenting" ? /* @__PURE__ */ v(Se, {
1272
- onCancel: () => i({ name: "idle" }),
1273
- onPick: (e) => i({
1274
- name: "composing",
1275
- draft: e
1276
- })
1277
- }) : null,
1278
- r.name === "composing" ? /* @__PURE__ */ v(fe, {
1279
- client: e,
1280
- draft: r.draft,
1281
- signedIn: !!n,
1282
- onSignIn: U,
1283
- onCancel: () => i({ name: "idle" }),
1284
- onSent: (e, t) => {
1285
- M({ text: t ? a(t === "screenshot" ? "sentWithoutScreenshot" : "sentWithoutFiles") : n?.role === "guest" || !n ? a("sentGuest") : a("sent") }), H(e);
1286
- },
1287
- share: E,
1288
- onPending: (e) => {
1289
- A(r.draft), i({
1290
- name: "verify",
1291
- email: e,
1292
- draft: r.draft
1293
- });
1294
- },
1295
- onError: N
1296
- }) : null,
1297
- r.name === "verify" && d ? /* @__PURE__ */ v(d, {
1298
- client: e,
1299
- email: r.email,
1300
- onDone: (t) => {
1301
- r.draft && re(me(e, r.draft.anchor)), M({ text: a("sentGuest") }), t[0] ? H(t[0]) : i({ name: "idle" });
1302
- },
1303
- onDifferentEmail: () => i(r.draft ? {
1304
- name: "composing",
1305
- draft: r.draft
1306
- } : { name: "commenting" }),
1307
- onClose: () => i({ name: "idle" })
1308
- }) : null,
1309
- r.name === "thread" && _ ? /* @__PURE__ */ v(_, {
1310
- client: e,
1311
- threadId: r.threadId,
1312
- version: I,
1313
- onClose: () => i({ name: "idle" }),
1314
- onError: N,
1315
- notify: M
1316
- }) : null,
1317
- r.name === "panel" && h ? /* @__PURE__ */ v(h, {
1318
- client: e,
1319
- side: W.endsWith("left") ? "left" : "right",
1320
- dock: W.startsWith("top") ? "top" : "bottom",
1321
- onClose: () => i({ name: "idle" }),
1322
- onOpen: H,
1323
- onError: N
1324
- }) : null,
1325
- D && !n && r.name === "idle" ? /* @__PURE__ */ v(Ee, {
1326
- position: W,
1327
- project: t?.project.name ?? "",
1328
- onStart: V,
1329
- onDismiss: () => {
1330
- ee(!1), Le(Oe, "1");
1331
- }
1332
- }) : null,
1333
- /* @__PURE__ */ v(xe, {
1334
- client: e,
1335
- position: W,
1336
- commenting: r.name === "commenting",
1337
- panelOpen: r.name === "panel",
1338
- onComment: () => r.name === "commenting" ? i({ name: "idle" }) : V(),
1339
- onPanel: () => r.name === "panel" ? i({ name: "idle" }) : j({ name: "panel" }),
1340
- onSignIn: () => void U(),
1341
- onSignOut: () => void e.signOut(),
1342
- onShortcuts: ne ? () => u(!0) : null,
1343
- waiting: B?.email ?? null,
1344
- onCode: () => B && j({
1345
- name: "verify",
1346
- email: B.email,
1347
- draft: te
1348
- }),
1349
- covered: r.name !== "idle" && r.name !== "commenting" || l
1350
- }),
1351
- l && p ? /* @__PURE__ */ v(p, { onClose: () => u(!1) }) : null,
1352
- R && r.name === "commenting" ? /* @__PURE__ */ v("div", {
1353
- class: "ck-toast",
1354
- role: "status",
1355
- children: z
1356
- }) : null,
1357
- /* @__PURE__ */ v("div", {
1358
- class: "ck-toast-region",
1359
- role: "status",
1360
- "aria-live": "polite",
1361
- children: o ? /* @__PURE__ */ v("div", {
1362
- class: "ck-toast",
1363
- "data-tone": o.tone,
1364
- children: [
1365
- /* @__PURE__ */ v("span", { children: o.text }),
1366
- o.action ? /* @__PURE__ */ v("button", {
1367
- onClick: () => (s(null), o.action.run()),
1368
- children: o.action.label
1369
- }) : null,
1370
- o.tone === "error" || o.action ? /* @__PURE__ */ v("button", {
1371
- class: "ck-toast-close",
1372
- "aria-label": a("close"),
1373
- onClick: () => s(null),
1374
- children: /* @__PURE__ */ v(w, {
1375
- name: "close",
1376
- size: 14
1377
- })
1378
- }) : null
1379
- ]
1380
- }) : null
1381
- })
1382
- ] });
1383
- }
1384
- function je(e) {
1385
- return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-markup"));
1386
- }
1387
- function Me(e) {
1388
- return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-panel"));
1389
- }
1390
- function Ne(e) {
1391
- return e.composedPath().some((e) => e instanceof HTMLElement && (e.isContentEditable || [
1392
- "INPUT",
1393
- "TEXTAREA",
1394
- "SELECT"
1395
- ].includes(e.tagName)));
1396
- }
1397
- function Pe() {
1398
- let e = new URL(location.href), t = e.searchParams.get("ck");
1399
- if (t && /^[A-Za-z0-9]{16,128}$/.test(t)) {
1400
- e.searchParams.delete("ck"), history.replaceState(history.state, "", e.toString());
1401
- try {
1402
- sessionStorage.setItem(De, t);
1403
- } catch {}
1404
- return t;
1405
- }
1406
- try {
1407
- return sessionStorage.getItem(De);
1408
- } catch {
1409
- return null;
1410
- }
1411
- }
1412
- function Fe(e) {
1413
- let t = location.href, n = () => {
1414
- location.href !== t && (t = location.href, e());
1415
- }, r = setInterval(n, 500);
1416
- return addEventListener("popstate", n), addEventListener("hashchange", n), () => {
1417
- clearInterval(r), removeEventListener("popstate", n), removeEventListener("hashchange", n);
1418
- };
1419
- }
1420
- function Ie(e) {
1421
- try {
1422
- return localStorage.getItem(e);
1423
- } catch {
1424
- return null;
1425
- }
1426
- }
1427
- function Le(e, t) {
1428
- try {
1429
- localStorage.setItem(e, t);
1430
- } catch {}
1431
- }
1432
- function Re(e) {
1433
- try {
1434
- localStorage.removeItem(e);
1435
- } catch {}
1436
- }
1437
- //#endregion
1438
- //#region src/ui/styles.css?inline
1439
- 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;--ck-img-outline:#0000001a;font-family:var(--ck-font);color:var(--ck-text);font-size:14px;line-height:1.45}@supports (color:color(display-p3 0 0 0)){:host{--ck-img-outline:color(display-p3 0 0 0/.1)}}@supports (color:lab(0% 0 0)){:host{--ck-img-outline:lab(0% 0 0/.1)}}: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-img-outline:#ffffff1a;--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}@supports (color:color(display-p3 0 0 0)){:host([data-theme=dark]){--ck-img-outline:color(display-p3 1 1 1/.1)}}@supports (color:lab(0% 0 0)){:host([data-theme=dark]){--ck-img-outline:lab(100% 0 0/.1)}}.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;background:0 0;border:0;border-radius:999px;align-items:center;gap:6px;height:34px;padding:0 12px;font-size:13.5px;font-weight:600;transition:background-color .12s,color .12s,scale .15s ease-out;display:inline-flex}.ck-bar-btn:not(:disabled):active,.ck-btn:not(:disabled):active,.ck-chip:not(:disabled):active{scale:.96}.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-icon-btn{width:34px;color:var(--ck-text-muted);justify-content:center;padding:0;position:relative}.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-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-property:left,top,width,height;transition-duration:70ms;transition-timing-function: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[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,100dvh - 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-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;border:0;justify-content:center;align-items:center;gap:6px;padding:0 12px;font-size:13.5px;font-weight:600;transition:background-color .12s,filter .12s,scale .15s ease-out;display:inline-flex}.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: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: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);background:var(--ck-bg-muted);margin-top:10px;position:relative;overflow:hidden}.ck-shot img,.ck-shot canvas,.ck-item-thumb,.ck-avatar img{outline:1px solid var(--ck-img-outline);outline-offset:-1px}.ck-shot img,.ck-shot canvas{border-radius:inherit;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);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[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 .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(76px + env(safe-area-inset-bottom,0px))}.ck-panel[data-dock=top]{top:76px}}.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[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[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]{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-region:empty{display:none}.ck-card~.ck-toast-region .ck-toast,.ck-panel~.ck-toast-region .ck-toast{top:12px;bottom:auto}.ck-toast .ck-toast-close{background:0 0;place-items:center;width:24px;height:24px;margin-inline-end:-4px;padding:0;display:grid}.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-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(100dvh - 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;border-radius:999px;align-items:center;gap:5px;max-width:100%;padding:0 10px;font-size:12px;font-weight:600;transition:background-color .12s,border-color .12s,color .12s,scale .15s ease-out;display:inline-flex;overflow:hidden}.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:52px;right:0}.ck-launcher[data-pos^=top] .ck-menu{top:52px;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(100dvh - 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-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(70dvh, calc(100dvh - 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-panel{width:100%;height:80dvh;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-input,.ck-textarea{font-size:16px}.ck-pin:after{content:\"\";position:absolute;top:-10px;bottom:-10px;left:-10px;right:-10px}}@media (hover:hover){.ck-bar-btn:hover{background:var(--ck-bg-hover)}.ck-bar-btn[aria-pressed=true]:hover,.ck-primary:hover{background:var(--ck-accent);filter:brightness(.96)}.ck-icon-btn:hover{color:var(--ck-text)}.ck-mode-hint .ck-chip:hover{background:#ffffff29}.ck-pin:hover{scale:1.08}.ck-ghost:hover{background:var(--ck-bg-hover);color:var(--ck-text)}.ck-btn:hover{background:var(--ck-bg-muted)}.ck-btn.ck-primary:hover{background:var(--ck-accent);filter:brightness(.96)}.ck-textarea:hover,.ck-input:hover{border-color:color-mix(in srgb, var(--ck-text-muted) 45%, var(--ck-border))}.ck-reaction:hover{background:var(--ck-bg-muted)}.ck-menu button:hover{background:var(--ck-bg-hover)}.ck-tab:hover{color:var(--ck-text)}.ck-item:hover{background:var(--ck-bg-muted)}.ck-suggest button:hover{background:var(--ck-bg-hover)}.ck-toast button:hover{background:#ffffff3d}.ck-chip:hover{color:var(--ck-text);background:var(--ck-bg-muted)}.ck-danger-btn:hover{background:var(--ck-danger);filter:brightness(.95)}}.ck-card-body,.ck-menu,.ck-suggest,.ck-task-menu,.ck-markup{overscroll-behavior:contain}.ck-card,.ck-panel,.ck-menu,.ck-bar,.ck-toast,.ck-welcome,.ck-suggest,.ck-btn,.ck-label-box,.ck-launcher-note{border:1px solid #0000}@media (forced-colors:active){.ck-root .ck-input:focus,.ck-root .ck-textarea:focus{outline-offset:1px;outline:2px solid highlight}.ck-root .ck-input:focus-visible{outline-offset:1px;outline:2px solid highlight}.ck-root .ck-textarea:focus-visible{outline-offset:1px;outline:2px solid highlight}}.ck-msg-body,.ck-note,.ck-empty,.ck-toast span,.ck-welcome p,.ck-review-ask,.ck-verify-text{text-wrap:pretty}.ck-empty strong,.ck-welcome h2,.ck-dialog h2{text-wrap:balance}.ck-badge,.ck-count,.ck-time{font-variant-numeric:tabular-nums}.ck-ghost-sm{min-height:24px}", Be = /* @__PURE__ */ e({
1440
- Boundary: () => Ue,
1441
- mountWidget: () => Ve
1442
- });
1443
- function Ve(e, t = () => void 0) {
1444
- let n = document.createElement("div");
1445
- n.setAttribute("data-commentkit-host", ""), n.style.cssText = "position:absolute;top:0;left:0;width:0;height:0;z-index:2147483000;";
1446
- let r = n.attachShadow({ mode: "open" });
1447
- if ("adoptedStyleSheets" in Document.prototype && "replaceSync" in CSSStyleSheet.prototype) {
1448
- let e = new CSSStyleSheet();
1449
- e.replaceSync(ze), r.adoptedStyleSheets = [e];
1450
- } else {
1451
- let e = document.createElement("style");
1452
- e.textContent = ze, r.appendChild(e);
1453
- }
1454
- let i = document.createElement("div");
1455
- i.className = "ck-root", i.dir = s(), i.lang = o(), r.appendChild(i), document.documentElement.appendChild(n);
1456
- let a = () => {
1457
- let t = e.options.theme ?? e.state.get().config?.appearance.theme ?? "auto", r = t === "dark" || t === "auto" && matchMedia("(prefers-color-scheme: dark)").matches;
1458
- n.setAttribute("data-theme", r ? "dark" : "light");
1459
- let i = e.state.get().config?.appearance.accent;
1460
- if (i && /^#[0-9a-f]{6}$/i.test(i)) {
1461
- n.style.setProperty("--ck-accent", i);
1462
- let [e, t, r] = [
1463
- 1,
1464
- 3,
1465
- 5
1466
- ].map((e) => {
1467
- let t = parseInt(i.slice(e, e + 2), 16) / 255;
1468
- return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1469
- });
1470
- n.style.setProperty("--ck-accent-ink", .2126 * e + .7152 * t + .0722 * r > .18 ? "#121316" : "#ffffff");
1471
- }
1472
- };
1473
- a();
1474
- let c = matchMedia("(prefers-color-scheme: dark)");
1475
- c.addEventListener?.("change", a);
1476
- let l = e.state.subscribe(a), u = window.visualViewport, d = () => u && n.style.setProperty("--ck-kb", _(Math.max(0, innerHeight - u.height - u.offsetTop)));
1477
- return u?.addEventListener("resize", d), u?.addEventListener("scroll", d), D(/* @__PURE__ */ v(Ue, {
1478
- onCrash: t,
1479
- onError: (t) => e.reportCrash(t),
1480
- children: /* @__PURE__ */ v(ke, { client: e })
1481
- }), i), () => {
1482
- D(null, i), l(), c.removeEventListener?.("change", a), u?.removeEventListener("resize", d), u?.removeEventListener("scroll", d), n.remove();
1483
- };
1484
- }
1485
- var He = !1, Ue = class extends h {
1486
- constructor(...e) {
1487
- super(...e), l(this, "state", { crashed: !1 });
1488
- }
1489
- componentDidCatch(e) {
1490
- if (!this.state.crashed) {
1491
- this.setState({ crashed: !0 });
1492
- try {
1493
- this.props.onError?.(e);
1494
- } catch {}
1495
- He || (He = !0, console.warn("[CommentKit] The widget stopped after an error and was removed. Your page is not affected.", e)), setTimeout(() => {
1496
- try {
1497
- this.props.onCrash();
1498
- } catch {}
1499
- });
1500
- }
1501
- }
1502
- render() {
1503
- return this.state.crashed ? null : this.props.children;
1504
- }
1505
- };
1506
- //#endregion
1507
- export { Ue as Boundary, H as _, pe as a, le as c, ae as d, oe as f, V as g, B as h, he as i, ce as l, re 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 };