@commentkit/comment-kit 1.5.1 → 2.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.
Files changed (141) hide show
  1. package/CHANGELOG.md +281 -582
  2. package/README.md +334 -154
  3. package/SECURITY.md +47 -46
  4. package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
  5. package/dist/node/browser.js +17 -0
  6. package/dist/node/cli/api.js +226 -0
  7. package/dist/node/cli/bin.js +18 -0
  8. package/dist/node/cli/credentials.js +268 -0
  9. package/dist/node/cli/doctor.js +725 -0
  10. package/dist/node/cli/format.js +54 -0
  11. package/dist/node/cli/init.js +372 -0
  12. package/dist/node/cli/main.js +519 -0
  13. package/dist/node/cli/mcp.js +114 -0
  14. package/dist/node/cli/open.js +20 -0
  15. package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
  16. package/dist/node/plugins/astro.js +26 -0
  17. package/dist/node/plugins/git-BIXLbL3f.js +92 -0
  18. package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
  19. package/dist/node/plugins/next.js +48 -0
  20. package/dist/node/plugins/options-THop1K92.js +71 -0
  21. package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
  22. package/dist/node/plugins/vite-BdAYUW10.js +74 -0
  23. package/dist/node/plugins/vite.js +1 -0
  24. package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
  25. package/dist/node/plugins/webpack-loader.cjs +21 -0
  26. package/dist/node/plugins/webpack-loader.js +18 -0
  27. package/dist/node/plugins/webpack.js +1 -0
  28. package/dist/node/shared/endpoint.js +26 -0
  29. package/dist/node/shared/format.js +63 -0
  30. package/dist/node/types/astro.d.ts +11 -0
  31. package/dist/node/types/next.d.ts +34 -0
  32. package/dist/node/types/options.d.ts +59 -0
  33. package/dist/node/types/vite.d.ts +11 -0
  34. package/dist/node/types/webpack-loader.d.ts +22 -0
  35. package/dist/node/types/webpack.d.ts +27 -0
  36. package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
  37. package/dist/npm/chunks/AgentSend-DxRJIYiz.js +68 -0
  38. package/dist/npm/chunks/Checklist-CnlfeSbc.js +282 -0
  39. package/dist/npm/chunks/Composer-B1bBVszY.js +725 -0
  40. package/dist/npm/chunks/Guest-vvNPz8h-.js +267 -0
  41. package/dist/npm/chunks/MarkupEditor-VCOXh9d2.js +338 -0
  42. package/dist/npm/chunks/Panel-F37vIL1K.js +1206 -0
  43. package/dist/npm/chunks/Settings-BGoZS2iV.js +231 -0
  44. package/dist/npm/chunks/Shortcuts-B2OMvczr.js +62 -0
  45. package/dist/npm/chunks/StyleEditor-CJ_d8Huf.js +46 -0
  46. package/dist/npm/chunks/StylePanel-yQzHHlY7.js +199 -0
  47. package/dist/npm/chunks/TaskFields-fmy6_HtK.js +289 -0
  48. package/dist/npm/chunks/ThreadCard-D51slKST.js +1113 -0
  49. package/dist/npm/chunks/Viewer-BOBadqmC.js +111 -0
  50. package/dist/npm/chunks/{agent-CqDO3JMA.js → agent-C1OQzBAm.js} +20 -21
  51. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsQNVkHj.js} +109 -87
  52. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-CAJ3XT8e.js} +73 -20
  53. package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
  54. package/dist/npm/chunks/{client-dZeNdizE.js → client-kNAo2TTG.js} +292 -285
  55. package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
  56. package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
  57. package/dist/npm/chunks/context-B8UAzve0.js +20 -0
  58. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  59. package/dist/npm/chunks/{de-CcPi8xdC.js → de-Dl18G48t.js} +64 -19
  60. package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
  61. package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
  62. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  63. package/dist/npm/chunks/{es-DXgkjDCG.js → es-Dxk79lS9.js} +64 -19
  64. package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
  65. package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-E81hWyiT.js} +21 -14
  66. package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
  67. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-8BebGKYD.js} +121 -76
  68. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-BIN6Yy_p.js} +65 -20
  69. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  70. package/dist/npm/chunks/i18n-DOBt8e9U.js +936 -0
  71. package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
  72. package/dist/npm/chunks/{it-DKiSCkiD.js → it-Cr6EwpPQ.js} +83 -38
  73. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-Iy3s5aur.js} +62 -17
  74. package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
  75. package/dist/npm/chunks/live-CelVeZfP.js +85 -0
  76. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  77. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  78. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-B84WHqqe.js} +65 -20
  79. package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
  80. package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-yTyqtxN0.js} +46 -46
  81. package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
  82. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  83. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  84. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-DOkdlfoe.js} +64 -19
  85. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-C79zF50C.js} +16 -15
  86. package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
  87. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  88. package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
  89. package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
  90. package/dist/npm/chunks/{source-BQS2_xfB.js → source-pXVve2Cx.js} +2 -3
  91. package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
  92. package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
  93. package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
  94. package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
  95. package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
  96. package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
  97. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-Z5fQCb7G.js} +63 -18
  98. package/dist/npm/element.js +59 -23
  99. package/dist/npm/headless.js +7 -3
  100. package/dist/npm/index.js +3 -3
  101. package/dist/npm/react.js +19 -13
  102. package/dist/npm/svelte.js +29 -14
  103. package/dist/npm/types/adapters/react.d.ts +4 -1
  104. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  105. package/dist/npm/types/adapters/vue.d.ts +35 -2
  106. package/dist/npm/types/anchor/index.d.ts +19 -0
  107. package/dist/npm/types/capture/privacy.d.ts +14 -0
  108. package/dist/npm/types/core/api.d.ts +20 -1
  109. package/dist/npm/types/core/auth.d.ts +47 -14
  110. package/dist/npm/types/core/client.d.ts +60 -4
  111. package/dist/npm/types/core/page-key.d.ts +42 -0
  112. package/dist/npm/types/core/types.d.ts +87 -4
  113. package/dist/npm/types/element.d.ts +17 -7
  114. package/dist/npm/types/headless.d.ts +2 -1
  115. package/dist/npm/types/index.d.ts +16 -6
  116. package/dist/npm/vue.js +45 -11
  117. package/package.json +95 -21
  118. package/dist/npm/chunks/AgentSend-DjFZSC0S.js +0 -64
  119. package/dist/npm/chunks/Checklist-BEz4IZdT.js +0 -259
  120. package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
  121. package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
  122. package/dist/npm/chunks/MarkupEditor-CPH4yKx4.js +0 -334
  123. package/dist/npm/chunks/Panel-DSoUAlbQ.js +0 -863
  124. package/dist/npm/chunks/Settings-C_qV4n7J.js +0 -206
  125. package/dist/npm/chunks/Shortcuts-ChnaribX.js +0 -60
  126. package/dist/npm/chunks/StyleEditor-DqZd6C5o.js +0 -44
  127. package/dist/npm/chunks/StylePanel-DMC3riYK.js +0 -199
  128. package/dist/npm/chunks/TaskFields-BfjjllMx.js +0 -272
  129. package/dist/npm/chunks/ThreadCard-DmKAelSL.js +0 -1026
  130. package/dist/npm/chunks/Viewer-mw69qSI5.js +0 -110
  131. package/dist/npm/chunks/card-bits-C7bIk5KX.js +0 -126
  132. package/dist/npm/chunks/confetti-DKeKR7-6.js +0 -41
  133. package/dist/npm/chunks/drafts-CpQdHhcK.js +0 -51
  134. package/dist/npm/chunks/extension-Gvei3opb.js +0 -54
  135. package/dist/npm/chunks/i18n-DAJGndZ2.js +0 -904
  136. package/dist/npm/chunks/live-MvvBdoGd.js +0 -34
  137. package/dist/npm/chunks/report-DoDVi1qT.js +0 -28
  138. package/dist/npm/chunks/src-C_oUnL0i.js +0 -150
  139. package/dist/npm/chunks/start-C5-rebEU.js +0 -1783
  140. package/dist/npm/chunks/upload-CzPAjktW.js +0 -42
  141. package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
@@ -1,1783 +0,0 @@
1
- import { n as e } from "./rolldown-runtime-Y_bBpyJl.js";
2
- import { i as t, p as n } from "./client-dZeNdizE.js";
3
- import { a as r, i, n as a, r as o, t as s } from "./anchor-OCQnjp_6.js";
4
- import { _ as c, a as l, c as u, f as d, g as f, h as p, i as m, l as h, m as g, n as _, o as v, p as y, s as b, u as x, v as S } from "./i18n-DAJGndZ2.js";
5
- import { n as C, t as w } from "./drafts-CpQdHhcK.js";
6
- //#region src/capture/diagnostics.ts
7
- var T = 20, E = /token|key|secret|passw|^pass$|auth|code|session|sig|credential|^x-amz-|ck_invite/i, D = /[\w.%+-]{1,64}@[A-Za-z0-9-]{1,63}(?:\.[A-Za-z0-9-]{1,63}){0,8}\.[A-Za-z]{2,24}/g, O = 1e3, k = [], A = [], j = !1, M = "";
8
- function N(e) {
9
- if (j) return () => void 0;
10
- j = !0, M = `${new URL(e.endpoint ?? "https://commentkit.dev").origin}/api/v1/`;
11
- let t = [];
12
- if (e.console) {
13
- for (let e of ["error", "warn"]) {
14
- let n = console[e];
15
- console[e] = (...t) => {
16
- I(k, {
17
- level: e,
18
- message: ee(t.map(te).join(" ")),
19
- at: (/* @__PURE__ */ new Date()).toISOString()
20
- }), n.apply(console, t);
21
- }, t.push(() => console[e] = n);
22
- }
23
- let e = (e) => I(k, {
24
- level: "error",
25
- message: ee(e.message || String(e.error)),
26
- at: (/* @__PURE__ */ new Date()).toISOString()
27
- }), n = (e) => I(k, {
28
- level: "error",
29
- message: ee(`Unhandled promise rejection: ${te(e.reason)}`),
30
- at: (/* @__PURE__ */ new Date()).toISOString()
31
- });
32
- addEventListener("error", e), addEventListener("unhandledrejection", n), t.push(() => removeEventListener("error", e), () => removeEventListener("unhandledrejection", n));
33
- }
34
- if (e.network && typeof fetch == "function") {
35
- let e = window.fetch;
36
- window.fetch = async (...t) => {
37
- let n = performance.now(), r = (t[1]?.method ?? (t[0] instanceof Request ? t[0].method : "GET")).toUpperCase(), i = t[0] instanceof Request ? t[0].url : String(t[0]);
38
- try {
39
- let a = await e(...t);
40
- return a.status >= 400 && F(r, i, a.status, n), a;
41
- } catch (e) {
42
- throw F(r, i, 0, n), e;
43
- }
44
- }, t.push(() => window.fetch = e);
45
- }
46
- if (e.network && typeof XMLHttpRequest == "function") {
47
- let e = XMLHttpRequest.prototype, { open: n, send: r } = e, i = /* @__PURE__ */ new WeakMap();
48
- e.open = function(e, t, ...r) {
49
- return i.set(this, {
50
- method: String(e).toUpperCase(),
51
- url: String(t)
52
- }), n.call(this, e, t, ...r);
53
- }, e.send = function(e) {
54
- let t = i.get(this), n = performance.now();
55
- return t && this.addEventListener("loadend", () => {
56
- (this.status >= 400 || this.status === 0) && F(t.method, t.url, this.status, n);
57
- }, { once: !0 }), r.call(this, e);
58
- }, t.push(() => {
59
- e.open = n, e.send = r;
60
- });
61
- }
62
- return () => {
63
- t.forEach((e) => e()), j = !1;
64
- };
65
- }
66
- function P() {
67
- return {
68
- console: k.length ? [...k] : void 0,
69
- network: A.length ? [...A] : void 0
70
- };
71
- }
72
- function F(e, t, n, r) {
73
- try {
74
- if (new URL(t, location.href).href.startsWith(M)) return;
75
- } catch {}
76
- I(A, {
77
- method: e.slice(0, 10),
78
- url: R(t).slice(0, 2e3),
79
- status: n,
80
- duration_ms: Math.round(performance.now() - r)
81
- });
82
- }
83
- function I(e, t) {
84
- e.push(t), e.length > T && e.shift();
85
- }
86
- function L(e) {
87
- if (e.length < 24 || !/^[\w~+/=.-]+$/.test(e) || !/\d/.test(e) || !/[a-z]/i.test(e) || /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)) return !1;
88
- let t = /* @__PURE__ */ new Map();
89
- for (let n of e) t.set(n, (t.get(n) ?? 0) + 1);
90
- let n = 0;
91
- for (let r of t.values()) n -= r / e.length * Math.log2(r / e.length);
92
- return n >= 3.5;
93
- }
94
- function R(e) {
95
- try {
96
- let t = new URL(e, location.href);
97
- t.username = "", t.password = "";
98
- for (let [e, n] of [...t.searchParams]) (E.test(e) || L(n)) && t.searchParams.set(e, "[redacted]");
99
- return t.hash && (E.test(t.hash) || t.hash.split(/[#&=/]/).some(L)) && (t.hash = "#[redacted]"), t.toString();
100
- } catch {
101
- return "[unparseable url]";
102
- }
103
- }
104
- function z(e) {
105
- return e.replace(/Bearer\s+[A-Za-z0-9._~+/-]+=*/gi, "Bearer [redacted]").replace(/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+/g, "[redacted-jwt]").replace(/https?:\/\/[^\s"'<>]+/g, (e) => R(e)).replace(/\b((?:[\w-]*[_-])?(?:token|secret|password|passwd|pwd|api[_-]?key|access[_-]?key|private[_-]?key|session[_-]?id|signature|authorization|auth[_-]?code))(["']?\s*[:=]\s*["']?)(?!\[redacted)[^\s"'&,;]+/gi, "$1$2[redacted]").replace(/[\w~+=-]{24,}/g, (e) => L(e) ? "[redacted]" : e);
106
- }
107
- function ee(e) {
108
- return z(e.slice(0, O)).replace(D, "[email]").slice(0, O);
109
- }
110
- function te(e) {
111
- if (e instanceof Error) return `${e.name}: ${e.message}`;
112
- if (typeof e == "string") return e;
113
- try {
114
- return JSON.stringify(e)?.slice(0, 500) ?? String(e);
115
- } catch {
116
- return String(e);
117
- }
118
- }
119
- //#endregion
120
- //#region src/ui/format.tsx
121
- function ne(e, t) {
122
- return !!t && e.id !== null && e.id === t.person.id && e.type === t.person.type;
123
- }
124
- function re(e, t = innerWidth) {
125
- return !!e.breakpoint && Math.abs(e.breakpoint - t) > 200;
126
- }
127
- var ie = (e) => e < 600 ? "phone" : e < 1024 ? "tablet" : "wide", B = (e) => `${Math.round(e * 100) / 100}px`, V = (e, t, n, r) => ({
128
- left: B(e),
129
- top: B(t),
130
- ...n === void 0 ? {} : { width: B(n) },
131
- ...r === void 0 ? {} : { height: B(r) }
132
- });
133
- function H({ text: e, people: t = [] }) {
134
- let n = q(t), r = [], i = 0;
135
- for (let t of e.matchAll(U)) {
136
- let a = t.index ?? 0;
137
- a > i && r.push(W(e.slice(i, a), n)), r.push(/* @__PURE__ */ h("pre", {
138
- class: "ck-pre",
139
- children: /* @__PURE__ */ h("code", { children: t[1].replace(/^\n|\n$/g, "") })
140
- })), i = a + t[0].length;
141
- }
142
- return i < e.length && r.push(W(e.slice(i), n)), /* @__PURE__ */ h(S, { children: r });
143
- }
144
- var U = /```[\w-]*\n?([\s\S]*?)```/g;
145
- function W(e, t) {
146
- let n = e.replace(/^\n/, "").split("\n");
147
- return n.map((e, r) => /* @__PURE__ */ h(S, { children: [de(e, t), r < n.length - 1 ? /* @__PURE__ */ h("br", {}) : null] }));
148
- }
149
- var G = null;
150
- function ae(e) {
151
- G = e;
152
- }
153
- function oe(e) {
154
- return [...e.includes("‍") ? e : e.replace(/\ufe0f/g, "")].map((e) => e.codePointAt(0).toString(16)).join("-");
155
- }
156
- function se({ char: e }) {
157
- let [t, n] = g(!1);
158
- return !G || t ? /* @__PURE__ */ h(S, { children: e }) : /* @__PURE__ */ h("img", {
159
- class: "ck-emoji",
160
- src: `${G}/emoji/${oe(e)}.svg`,
161
- alt: e,
162
- draggable: !1,
163
- loading: "lazy",
164
- onError: () => n(!0)
165
- });
166
- }
167
- var ce = String.raw`\p{Extended_Pictographic}(?:\ufe0f|\p{Emoji_Modifier}|\u200d\p{Extended_Pictographic}\ufe0f?)*`, le = String.raw`\*\*[^*\n]+\*\*|~~[^~\n]+~~|\x60[^\x60\n]+\x60|\*[^*\s][^*\n]*\*|(?:^|[\s(\[])_[^_\n]+_(?![\p{L}\p{N}_])|https?:\/\/[^\s<>"')\u200b-\u200f\u202a-\u202e\u2060-\u2069\ufeff]+`, K = /* @__PURE__ */ new Map();
168
- function q(e) {
169
- let t = e.join("\0"), n = K.get(t);
170
- if (!n) {
171
- let r = [...e].filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), i = `(?:^|[\\s(\\[])@(?:${r.length ? `${r.join("|")}|` : ""}[\\p{L}\\p{N}._-]+)`;
172
- n = RegExp(`${le}|${i}|${ce}`, "gu"), K.set(t, n);
173
- }
174
- return n;
175
- }
176
- function ue(e, t) {
177
- let n = /* @__PURE__ */ new Set(), r = [...new Set(t)].filter(Boolean).sort((e, t) => t.length - e.length);
178
- if (!r.length) return n;
179
- let i = r.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), a = RegExp(`(?:^|[\\s(\\[])@(${i.join("|")})(?![\\p{L}\\p{N}_-])`, "gu");
180
- for (let t of e.matchAll(a)) n.add(t[1]);
181
- return n;
182
- }
183
- function de(e, t) {
184
- let n = [], r = 0;
185
- for (let i of e.matchAll(t)) {
186
- let t = i[0], a = i.index ?? 0;
187
- if (/^[\s(\[]/.test(t) && /[_@]/.test(t[1] ?? "") && (a += 1, t = t.slice(1)), a > r && n.push(e.slice(r, a)), t.startsWith("**")) n.push(/* @__PURE__ */ h("strong", { children: t.slice(2, -2) }));
188
- else if (t.startsWith("~~")) n.push(/* @__PURE__ */ h("s", { children: t.slice(2, -2) }));
189
- else if (t.startsWith("`")) n.push(/* @__PURE__ */ h("code", { children: t.slice(1, -1) }));
190
- else if (t.startsWith("*") || t.startsWith("_")) n.push(/* @__PURE__ */ h("em", { children: t.slice(1, -1) }));
191
- else if (t.startsWith("@")) n.push(/* @__PURE__ */ h("span", {
192
- class: "ck-mention",
193
- children: /* @__PURE__ */ h("bdi", { children: t })
194
- }));
195
- else if (/^\p{Extended_Pictographic}/u.test(t)) n.push(/* @__PURE__ */ h(se, { char: t }));
196
- else {
197
- let e = J(t);
198
- n.push(e ? /* @__PURE__ */ h("a", {
199
- href: e,
200
- target: "_blank",
201
- rel: "noopener noreferrer nofollow ugc",
202
- children: t
203
- }) : t);
204
- }
205
- r = a + t.length;
206
- }
207
- return r < e.length && n.push(e.slice(r)), n;
208
- }
209
- function J(e, t = "link") {
210
- if (!e) return null;
211
- try {
212
- let n = new URL(e);
213
- return n.protocol === "https:" || n.protocol === "http:" || t === "link" && n.protocol === "mailto:" ? n.href : null;
214
- } catch {
215
- return null;
216
- }
217
- }
218
- function Y({ person: e }) {
219
- let t = e.name.split(/\s+/).map((e) => e[0]).slice(0, 2).join("").toUpperCase() || "?";
220
- return /* @__PURE__ */ h("span", {
221
- class: "ck-avatar",
222
- "aria-hidden": "true",
223
- children: e.avatar_url && /^https:\/\//.test(e.avatar_url) ? /* @__PURE__ */ h("img", {
224
- src: e.avatar_url,
225
- alt: "",
226
- referrerPolicy: "no-referrer"
227
- }) : t
228
- });
229
- }
230
- function X({ status: e }) {
231
- return /* @__PURE__ */ h("span", {
232
- class: "ck-status",
233
- "data-status": e,
234
- children: b(`status_${e}`)
235
- });
236
- }
237
- function Z({ name: e, size: t = 18 }) {
238
- return /* @__PURE__ */ h("svg", {
239
- width: t,
240
- height: t,
241
- viewBox: "0 0 24 24",
242
- fill: "none",
243
- stroke: "currentColor",
244
- "stroke-width": e === "more" ? 3.2 : 2,
245
- "stroke-linecap": "round",
246
- "stroke-linejoin": "round",
247
- "aria-hidden": "true",
248
- children: /* @__PURE__ */ h("path", { d: {
249
- agent: "M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM18.5 15l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z",
250
- comment: "M4 5h16v11H8l-4 4z",
251
- inbox: "M4 13l2-8h12l2 8M4 13v6h16v-6M4 13h5l1 2h4l1-2h5",
252
- close: "M6 6l12 12M18 6L6 18",
253
- more: "M5 12h.01M12 12h.01M19 12h.01",
254
- image: "M4 5h16v14H4zM4 15l4-4 4 4 3-3 5 5M15 9h.01",
255
- paperclip: "M17.5 8.5v7a5.5 5.5 0 0 1-11 0V7a3.75 3.75 0 0 1 7.5 0v8.25a2 2 0 0 1-4 0V8.5",
256
- pen: "M4 20l4-1 11-11-3-3L5 16zM14 6l3 3",
257
- check: "M5 12l4 4 10-10",
258
- user: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20a8 8 0 0 1 16 0",
259
- bold: "M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z",
260
- italic: "M10 5h8M6 19h8M14 5l-4 14",
261
- strike: "M5 12h14M16 7.5A4 3 0 0 0 12 5c-2.5 0-4 1.3-4 3s1.5 2.4 4 3M8 16.5c.6 1.5 2.1 2.5 4 2.5 2.5 0 4-1.3 4-3",
262
- code: "M9 8l-4 4 4 4M15 8l4 4-4 4",
263
- reply: "M10 8L5 12l5 4M5 12h9a5 5 0 0 1 5 5v1",
264
- copy: "M9 9h10v10H9zM5 15V5h10",
265
- info: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5M12 8h.01",
266
- alert: "M12 4l9 16H3zM12 10v4M12 17h.01",
267
- down: "M12 5v14M6 13l6 6 6-6",
268
- search: "M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",
269
- clock: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",
270
- device: "M4 5h16v11H4zM9 20h6M12 16v4",
271
- chevron: "M9 6l6 6-6 6",
272
- flag: "M5 21V4h11l-2 4 2 4H5",
273
- pin: "M12 21s7-6.5 7-12a7 7 0 1 0-14 0c0 5.5 7 12 7 12zM12 11.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",
274
- area: "M4 8V4h4M16 4h4v4M20 16v4h-4M8 20H4v-4",
275
- quote: "M7 7h4v4c0 3-2 5-4 5M14 7h4v4c0 3-2 5-4 5",
276
- page: "M6 3h9l4 4v14H6zM14 3v5h5",
277
- smile: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM8.5 14a4.5 4.5 0 0 0 7 0M9 9.5h.01M15 9.5h.01",
278
- link: "M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1"
279
- }[e] })
280
- });
281
- }
282
- function fe(e) {
283
- e?.focus({ preventScroll: !0 });
284
- }
285
- function pe(e) {
286
- if (!e) return;
287
- let t = e.getBoundingClientRect(), n = e.parentElement?.closest(".ck-panel, .ck-card")?.getBoundingClientRect() ?? {
288
- left: 0,
289
- right: innerWidth
290
- }, r = Math.min(0, n.right - 8 - t.right);
291
- t.left + r < n.left + 8 && (r = n.left + 8 - t.left), r && (e.style.translate = `${Math.round(r)}px 0`);
292
- }
293
- //#endregion
294
- //#region src/ui/errors.ts
295
- var Q = {
296
- network_error: "networkError",
297
- upload_failed: "uploadFailed",
298
- share_expired: "shareExpired",
299
- no_access: "noAccess",
300
- wrong_project: "noAccess",
301
- guest_removed: "verifyRemoved",
302
- origin_not_allowed: "originNotAllowed",
303
- origin_required: "originNotAllowed",
304
- widget_disabled: "paused",
305
- plan_required: "readOnlyGuest",
306
- not_found: "threadNotFound",
307
- forbidden: "forbidden",
308
- rate_limited: "tooFast",
309
- edit_conflict: "editConflict",
310
- internal_error: "serverError"
311
- }, me = /* @__PURE__ */ new Set(["file_rejected", "thread_not_found"]);
312
- function he(e) {
313
- if (!(e instanceof n)) return b("errorGeneric");
314
- if (me.has(e.code)) return e.message;
315
- let t = Q[e.code] ?? (e.status === 410 ? "shareExpired" : e.status === 429 ? "tooFast" : null);
316
- return t ? b(t) : _() === "en" && e.status >= 400 && e.message ? e.message : b("errorGeneric");
317
- }
318
- //#endregion
319
- //#region src/ui/draft-key.ts
320
- var ge = "commentkit:pending-compose";
321
- function _e(e, n) {
322
- return C(e.options.project, t(), n.type, n.selector, n.ck_id, n.source, n.quote);
323
- }
324
- //#endregion
325
- //#region src/ui/hooks.ts
326
- function $(e, t) {
327
- let [n, r] = g(() => t(e.get()));
328
- return x(() => (r(t(e.get())), e.subscribe((e) => r(() => t(e)))), [e]), n;
329
- }
330
- function ve(e) {
331
- let [, t] = g(0), [n] = g(() => ({
332
- version: 0,
333
- watch: () => void 0
334
- }));
335
- return x(() => {
336
- if (!e) return;
337
- let r = 0, i = () => {
338
- r || (r = requestAnimationFrame(() => {
339
- r = 0, t((e) => e + 1);
340
- }));
341
- }, a = () => {
342
- n.version++, i();
343
- }, o = new MutationObserver((e) => {
344
- e.some((e) => !(e.target instanceof Element && e.target.closest("[data-commentkit-host]"))) && a();
345
- });
346
- o.observe(document.documentElement, {
347
- subtree: !0,
348
- childList: !0,
349
- attributes: !0,
350
- characterData: !0
351
- });
352
- let s = typeof ResizeObserver == "function" ? new ResizeObserver(i) : null, c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = (e) => {
353
- for (let t of l) e.has(t) || t.removeEventListener("scroll", i, !0);
354
- for (let t of e) l.has(t) || t.addEventListener("scroll", i, !0);
355
- l = e;
356
- };
357
- n.watch = (e) => {
358
- let t = /* @__PURE__ */ new Set([
359
- document.documentElement,
360
- document.body,
361
- ...e
362
- ]);
363
- for (let e of c) t.has(e) || s?.unobserve(e);
364
- for (let e of t) c.has(e) || s?.observe(e);
365
- c = t;
366
- let n = /* @__PURE__ */ new Set();
367
- for (let t of e) for (let e = t.ownerDocument.defaultView; e && e !== window && !n.has(e); e = e.parent) n.add(e);
368
- u(n);
369
- }, n.watch([]);
370
- let d = [
371
- "scroll",
372
- "load",
373
- "transitionend",
374
- "animationend"
375
- ];
376
- addEventListener("resize", a), d.forEach((e) => addEventListener(e, i, !0)), document.fonts?.ready.then(i).catch(() => void 0);
377
- let f = setInterval(a, 2e3);
378
- return () => {
379
- o.disconnect(), s?.disconnect(), n.watch = () => void 0, u(/* @__PURE__ */ new Set()), removeEventListener("resize", a), d.forEach((e) => removeEventListener(e, i, !0)), clearInterval(f), cancelAnimationFrame(r);
380
- };
381
- }, [e]), n;
382
- }
383
- function ye() {
384
- let [e, t] = g(() => typeof navigator > "u" || navigator.onLine !== !1);
385
- return x(() => {
386
- let e = () => t(!0), n = () => t(!1);
387
- return addEventListener("online", e), addEventListener("offline", n), () => {
388
- removeEventListener("online", e), removeEventListener("offline", n);
389
- };
390
- }, []), e;
391
- }
392
- function be(e, t, n = !1) {
393
- let r = !n && getComputedStyle(e.currentTarget).direction === "rtl", i = n ? [
394
- "ArrowDown",
395
- "j",
396
- "J"
397
- ] : [r ? "ArrowLeft" : "ArrowRight"], a = n ? [
398
- "ArrowUp",
399
- "k",
400
- "K"
401
- ] : [r ? "ArrowRight" : "ArrowLeft"], o = i.includes(e.key) ? 1 : a.includes(e.key) ? -1 : e.key === "Home" ? "first" : e.key === "End" ? "last" : null;
402
- if (o === null) return;
403
- let s = e.currentTarget, c = [...s.querySelectorAll(t)].filter((e) => !e.hasAttribute("disabled"));
404
- if (!c.length) return;
405
- e.preventDefault();
406
- let l = c.indexOf(s.getRootNode().activeElement);
407
- c[o === "first" ? 0 : o === "last" ? c.length - 1 : (Math.max(l, o > 0 ? -1 : 0) + o + c.length) % c.length]?.focus();
408
- }
409
- //#endregion
410
- //#region src/ui/sheet.ts
411
- var xe = [], Se = null;
412
- function Ce(e) {
413
- Se = e, e && xe.forEach((t) => Te(e, t));
414
- }
415
- function we(e) {
416
- xe.includes(e) || (xe.push(e), Se && Te(Se, e));
417
- }
418
- function Te(e, t) {
419
- if ("adoptedStyleSheets" in e && "replaceSync" in CSSStyleSheet.prototype) {
420
- let n = new CSSStyleSheet();
421
- n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n];
422
- } else {
423
- let n = document.createElement("style");
424
- n.textContent = t, e.insertBefore(n, e.querySelector(".ck-root"));
425
- }
426
- }
427
- //#endregion
428
- //#region src/ui/Launcher.tsx
429
- function Ee({ client: e, position: t, onMove: n, commenting: r, panelOpen: i, onComment: a, onPanel: o, onSignIn: s, onSignOut: c, onShortcuts: l, onHide: u, onSettings: f, waiting: p, onCode: m, covered: _ }) {
430
- let v = $(e.state, (e) => e.config?.read_only ?? !1), y = $(e.state, (e) => e.session), x = $(e.state, (e) => e.unread), [C, w] = g(!1), [T, E] = g(null), D = d(null), O = d(null);
431
- return /* @__PURE__ */ h("div", {
432
- class: "ck-launcher",
433
- "data-pos": t,
434
- "data-covered": _,
435
- "data-dragging": T ? "true" : void 0,
436
- "data-commentkit-ui": !0,
437
- style: T ? {
438
- left: `${T.x}px`,
439
- top: `${T.y}px`,
440
- right: "auto",
441
- bottom: "auto",
442
- transform: "none"
443
- } : void 0,
444
- children: [
445
- C ? null : p ? /* @__PURE__ */ h("div", {
446
- class: "ck-note ck-launcher-note",
447
- role: "status",
448
- children: [
449
- b("pendingNote", { email: p }),
450
- " ",
451
- /* @__PURE__ */ h("button", {
452
- class: "ck-btn",
453
- onClick: m,
454
- children: b("enterCode")
455
- })
456
- ]
457
- }) : v ? /* @__PURE__ */ h("div", {
458
- class: "ck-note ck-launcher-note",
459
- role: "status",
460
- children: b("readOnlyShort")
461
- }) : null,
462
- /* @__PURE__ */ h("div", {
463
- class: "ck-bar",
464
- role: "toolbar",
465
- "aria-label": "CommentKit",
466
- ref: O,
467
- children: [
468
- /* @__PURE__ */ h("button", {
469
- class: "ck-bar-btn",
470
- "aria-pressed": r,
471
- onClick: a,
472
- title: b("commentHint"),
473
- "aria-keyshortcuts": l ? "C" : void 0,
474
- children: [/* @__PURE__ */ h(Z, { name: "comment" }), /* @__PURE__ */ h("span", {
475
- class: "ck-label",
476
- children: b("comment")
477
- })]
478
- }),
479
- y ? /* @__PURE__ */ h("button", {
480
- class: "ck-bar-btn ck-icon-btn",
481
- "aria-pressed": i,
482
- onClick: o,
483
- title: b("inbox"),
484
- "aria-label": `${b("inbox")}${x ? ` (${x})` : ""}`,
485
- children: [/* @__PURE__ */ h(Z, { name: "inbox" }), x > 0 ? /* @__PURE__ */ h("span", {
486
- class: "ck-badge",
487
- children: x > 99 ? "99+" : x
488
- }) : null]
489
- }) : null,
490
- /* @__PURE__ */ h("button", {
491
- class: "ck-bar-btn ck-icon-btn",
492
- "aria-haspopup": "menu",
493
- "aria-expanded": C,
494
- onClick: () => w(!C),
495
- "aria-label": b("more"),
496
- children: /* @__PURE__ */ h(Z, { name: "more" })
497
- }),
498
- /* @__PURE__ */ h("button", {
499
- class: "ck-grip",
500
- "aria-label": b("moveToolbar"),
501
- title: b("moveToolbar"),
502
- "aria-keyshortcuts": "ArrowLeft ArrowRight ArrowUp ArrowDown",
503
- onPointerDown: (e) => {
504
- if (e.button !== 0) return;
505
- let t = e.currentTarget.closest(".ck-launcher").getBoundingClientRect();
506
- D.current = {
507
- dx: e.clientX - t.left,
508
- dy: e.clientY - t.top
509
- }, e.currentTarget.setPointerCapture(e.pointerId);
510
- },
511
- onPointerMove: (e) => {
512
- let t = D.current;
513
- t && E({
514
- x: e.clientX - t.dx,
515
- y: e.clientY - t.dy
516
- });
517
- },
518
- onPointerUp: (e) => {
519
- let t = D.current;
520
- if (D.current = null, !t || !T) return E(null);
521
- E(null), n(De(e.clientX, e.clientY));
522
- },
523
- onPointerCancel: () => (D.current = null, E(null)),
524
- onKeyDown: (e) => {
525
- let r = Oe(t, e.key);
526
- r && (e.preventDefault(), n(r));
527
- },
528
- children: /* @__PURE__ */ h("svg", {
529
- width: "8",
530
- height: "14",
531
- viewBox: "0 0 8 14",
532
- "aria-hidden": "true",
533
- children: [
534
- /* @__PURE__ */ h("circle", {
535
- cx: "2",
536
- cy: "2",
537
- r: "1.2"
538
- }),
539
- /* @__PURE__ */ h("circle", {
540
- cx: "6",
541
- cy: "2",
542
- r: "1.2"
543
- }),
544
- /* @__PURE__ */ h("circle", {
545
- cx: "2",
546
- cy: "7",
547
- r: "1.2"
548
- }),
549
- /* @__PURE__ */ h("circle", {
550
- cx: "6",
551
- cy: "7",
552
- r: "1.2"
553
- }),
554
- /* @__PURE__ */ h("circle", {
555
- cx: "2",
556
- cy: "12",
557
- r: "1.2"
558
- }),
559
- /* @__PURE__ */ h("circle", {
560
- cx: "6",
561
- cy: "12",
562
- r: "1.2"
563
- })
564
- ]
565
- })
566
- })
567
- ]
568
- }),
569
- C ? /* @__PURE__ */ h("div", {
570
- class: "ck-menu",
571
- role: "menu",
572
- onClick: () => w(!1),
573
- onKeyDown: (e) => e.key === "Escape" ? (e.stopPropagation(), w(!1)) : be(e, "[role=menuitem]", !0),
574
- children: [
575
- y ? /* @__PURE__ */ h(S, { children: [
576
- /* @__PURE__ */ h("div", {
577
- class: "ck-menu-head",
578
- children: [
579
- /* @__PURE__ */ h("bdi", { children: y.person.name }),
580
- " · ",
581
- /* @__PURE__ */ h("bdi", { children: y.project.name })
582
- ]
583
- }),
584
- /* @__PURE__ */ h("button", {
585
- role: "menuitem",
586
- onClick: f,
587
- children: b("settings")
588
- }),
589
- /* @__PURE__ */ h("button", {
590
- role: "menuitem",
591
- onClick: c,
592
- children: b("signOut")
593
- })
594
- ] }) : /* @__PURE__ */ h("button", {
595
- role: "menuitem",
596
- onClick: s,
597
- children: b("signInMember")
598
- }),
599
- l ? /* @__PURE__ */ h("button", {
600
- role: "menuitem",
601
- "aria-keyshortcuts": "?",
602
- onClick: l,
603
- children: b("shortcutsTitle")
604
- }) : null,
605
- /* @__PURE__ */ h("button", {
606
- role: "menuitem",
607
- class: "ck-menu-two",
608
- "aria-keyshortcuts": "Meta+Shift+K",
609
- onClick: u,
610
- children: [b("hideWidget"), /* @__PURE__ */ h("span", {
611
- class: "ck-muted",
612
- children: b("hideWidgetHint", { keys: /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘ Shift K" : "Ctrl Shift K" })
613
- })]
614
- })
615
- ]
616
- }) : null
617
- ]
618
- });
619
- }
620
- function De(e, t) {
621
- return `${t < innerHeight / 2 ? "top" : "bottom"}-${e < innerWidth / 3 ? "left" : e > innerWidth * 2 / 3 ? "right" : "center"}`;
622
- }
623
- function Oe(e, t) {
624
- let [n, r] = e.split("-"), i = [
625
- "left",
626
- "center",
627
- "right"
628
- ], a = i.indexOf(r);
629
- return t === "ArrowLeft" && a > 0 ? `${n}-${i[a - 1]}` : t === "ArrowRight" && a < 2 ? `${n}-${i[a + 1]}` : t === "ArrowUp" && n === "bottom" ? `top-${r}` : t === "ArrowDown" && n === "top" ? `bottom-${r}` : null;
630
- }
631
- function ke({ onCancel: e, onPick: t, quote: n = !0 }) {
632
- let [r] = g(() => {
633
- let e = document.activeElement;
634
- return e && e !== document.body && e !== document.documentElement && !o(e) ? e : null;
635
- }), a = y(() => matchMedia("(pointer: coarse)").matches, []), [c, l] = g(null), u = d(null);
636
- x(() => {
637
- let e = !0;
638
- return import("./pick-dDDLxCDI.js").then((r) => {
639
- if (!e) return;
640
- u.current = r, r.prepare();
641
- let a = n ? r.selected() : null, o = a?.toString().trim();
642
- if (a && o) {
643
- let e = i(a.startContainer, a.getBoundingClientRect()), n = a.commonAncestorContainer.nodeType === 1 ? a.commonAncestorContainer : a.commonAncestorContainer.parentElement;
644
- t({
645
- anchor: f({
646
- element: n,
647
- clientX: e.left,
648
- clientY: e.top,
649
- quote: o
650
- }),
651
- point: {
652
- x: e.left,
653
- y: e.bottom
654
- },
655
- region: {
656
- x: e.left,
657
- y: e.top,
658
- w: e.width,
659
- h: e.height
660
- }
661
- });
662
- }
663
- }, () => {}), () => void (e = !1);
664
- }, []);
665
- let f = (e) => s({
666
- ...e,
667
- extra: u.current?.extra
668
- }), [p, m] = g(null), _ = d(null), v = d(null), [C, w] = g([]), T = d(null), E = d(null);
669
- x(() => E.current?.focus({ preventScroll: !0 }), []);
670
- let D = d(null), O = d({
671
- timer: null,
672
- fired: !1
673
- }), k = () => {
674
- O.current.timer && clearTimeout(O.current.timer), O.current.timer = null;
675
- };
676
- x(() => k, []);
677
- let A = (e, t) => {
678
- let n = T.current;
679
- if (!n) return null;
680
- let r = u.current;
681
- n.style.pointerEvents = "none";
682
- let i = r ? r.deepAt(e, t) : document.elementsFromPoint(e, t).find((e) => !o(e) && e !== document.documentElement && e !== document.body) ?? document.body;
683
- return n.style.pointerEvents = "auto", r ? r.paintedAt(i, (n) => {
684
- let i = N(e, t);
685
- return !!i && n.contains(i.node) && r.overText(e, t, i);
686
- }) : i;
687
- }, j = (e) => {
688
- let n = i(e), r = n.left + Math.min(n.width / 2, 24), a = n.top + Math.min(n.height / 2, 24);
689
- t({
690
- anchor: f({
691
- element: e,
692
- clientX: r,
693
- clientY: a
694
- }),
695
- point: {
696
- x: r,
697
- y: n.top + n.height
698
- },
699
- region: null
700
- });
701
- }, M = () => {
702
- t({
703
- anchor: {
704
- type: "page",
705
- page: {
706
- x: 50,
707
- y: Math.round(scrollY + Math.min(120, innerHeight / 3))
708
- }
709
- },
710
- point: {
711
- x: innerWidth / 2,
712
- y: Math.min(120, innerHeight / 3)
713
- },
714
- region: null
715
- });
716
- }, N = (e, t) => {
717
- let n = T.current, r = u.current;
718
- if (!n || !r) return null;
719
- n.style.pointerEvents = "none";
720
- try {
721
- return r.caretAt(e, t);
722
- } finally {
723
- n.style.pointerEvents = "auto";
724
- }
725
- };
726
- return x(() => {
727
- let t = (t) => {
728
- t.key === "Escape" ? e() : t.key === "Enter" && !t.composedPath().some((e) => e instanceof HTMLButtonElement) && (t.preventDefault(), r ? j(r) : M());
729
- };
730
- return addEventListener("keydown", t), () => removeEventListener("keydown", t);
731
- }, [e]), /* @__PURE__ */ h(S, { children: [
732
- /* @__PURE__ */ h("div", {
733
- class: "ck-mode-frame",
734
- "aria-hidden": "true",
735
- "data-commentkit-ui": !0
736
- }),
737
- /* @__PURE__ */ h("div", {
738
- class: "ck-mode-hint",
739
- role: "toolbar",
740
- "aria-label": b("comment"),
741
- "data-commentkit-ui": !0,
742
- children: [
743
- /* @__PURE__ */ h("span", {
744
- role: "status",
745
- children: b(n ? a ? "modeBarTouch" : "modeBar" : a ? "modeBarTouchNoText" : "modeBarNoText")
746
- }),
747
- r ? /* @__PURE__ */ h("button", {
748
- class: "ck-chip",
749
- ref: E,
750
- onClick: () => j(r),
751
- children: b("commentFocused")
752
- }) : null,
753
- /* @__PURE__ */ h("button", {
754
- class: "ck-chip",
755
- ref: r ? void 0 : E,
756
- onClick: M,
757
- children: b("commentOnPage")
758
- })
759
- ]
760
- }),
761
- /* @__PURE__ */ h("div", {
762
- ref: T,
763
- class: "ck-catcher",
764
- "data-commentkit-ui": !0,
765
- onPointerMove: (e) => {
766
- if (e.pointerType === "touch") {
767
- let t = D.current;
768
- t && (Math.abs(e.clientX - t.x) > 8 || Math.abs(e.clientY - t.y) > 8) && k();
769
- return;
770
- }
771
- if (D.current && _.current) {
772
- let t = N(e.clientX, e.clientY);
773
- if (!t) return;
774
- let n = u.current, r = n.between(_.current, t);
775
- if (!r) return;
776
- v.current = r, w(n.boxesOf(r).filter((e) => e.width > 0 && e.height > 0).slice(0, 200));
777
- return;
778
- }
779
- if (D.current) {
780
- m({
781
- x: D.current.x,
782
- y: D.current.y,
783
- x2: e.clientX,
784
- y2: e.clientY
785
- });
786
- return;
787
- }
788
- let t = A(e.clientX, e.clientY);
789
- l(t ? i(t) : null);
790
- },
791
- onPointerDown: (e) => {
792
- if (e.button !== 0) return;
793
- let r = A(e.clientX, e.clientY);
794
- if (r) {
795
- if (D.current = {
796
- x: e.clientX,
797
- y: e.clientY,
798
- target: r
799
- }, O.current.fired = !1, _.current = null, v.current = null, n && e.pointerType !== "touch" && !e.shiftKey) {
800
- let t = N(e.clientX, e.clientY);
801
- t && u.current.overText(e.clientX, e.clientY, t) && (_.current = t);
802
- }
803
- e.pointerType === "touch" && (k(), O.current.timer = setTimeout(() => {
804
- let e = D.current;
805
- O.current.timer = null, e && (O.current.fired = !0, D.current = null, Ae(e.x, e.y), t({
806
- anchor: f({
807
- element: e.target,
808
- clientX: e.x,
809
- clientY: e.y
810
- }),
811
- point: {
812
- x: e.x,
813
- y: e.y
814
- },
815
- region: null
816
- }));
817
- }, 500)), e.pointerType !== "touch" && T.current?.setPointerCapture(e.pointerId);
818
- }
819
- },
820
- onPointerUp: (e) => {
821
- k();
822
- let n = D.current;
823
- if (D.current = null, m(null), w([]), !n) return;
824
- let r = v.current;
825
- _.current = null, v.current = null;
826
- let a = r?.toString().trim();
827
- if (r && a) {
828
- let e = i(r.startContainer, r.getBoundingClientRect()), o = r.commonAncestorContainer.nodeType === 1 ? r.commonAncestorContainer : r.commonAncestorContainer.parentElement ?? n.target;
829
- t({
830
- anchor: f({
831
- element: o,
832
- clientX: e.left,
833
- clientY: e.top,
834
- quote: a
835
- }),
836
- point: {
837
- x: e.left,
838
- y: e.bottom
839
- },
840
- region: {
841
- x: e.left,
842
- y: e.top,
843
- w: e.width,
844
- h: e.height
845
- }
846
- });
847
- return;
848
- }
849
- let o = Math.abs(e.clientX - n.x) > 8 || Math.abs(e.clientY - n.y) > 8;
850
- if (e.pointerType === "touch" && o) return;
851
- e.pointerType === "touch" && Ae(e.clientX, e.clientY);
852
- let s = e.pointerType !== "touch" && Math.abs(e.clientX - n.x) > 8 && Math.abs(e.clientY - n.y) > 8, c = s ? je(n.target, A(e.clientX, e.clientY) ?? n.target) : n.target;
853
- t({
854
- anchor: f({
855
- element: c,
856
- clientX: n.x,
857
- clientY: n.y,
858
- ...s ? {
859
- endX: e.clientX,
860
- endY: e.clientY
861
- } : {}
862
- }),
863
- point: {
864
- x: s ? Math.max(n.x, e.clientX) : e.clientX,
865
- y: s ? Math.max(n.y, e.clientY) : e.clientY
866
- },
867
- region: s ? {
868
- x: Math.min(n.x, e.clientX),
869
- y: Math.min(n.y, e.clientY),
870
- w: Math.abs(e.clientX - n.x),
871
- h: Math.abs(e.clientY - n.y)
872
- } : null
873
- });
874
- },
875
- onPointerCancel: () => {
876
- k(), D.current = null, m(null);
877
- },
878
- onContextMenu: (t) => {
879
- t.preventDefault(), !O.current.timer && !O.current.fired && !a && e();
880
- }
881
- }),
882
- c && !p && !C.length ? /* @__PURE__ */ h("div", {
883
- class: "ck-outline",
884
- style: V(c.left - 2, c.top - 2, c.width + 4, c.height + 4)
885
- }) : null,
886
- C.map((e) => /* @__PURE__ */ h("div", {
887
- class: "ck-text-box",
888
- style: V(e.left, e.top, e.width, e.height)
889
- })),
890
- p && !_.current ? /* @__PURE__ */ h("div", {
891
- class: "ck-region",
892
- style: V(Math.min(p.x, p.x2), Math.min(p.y, p.y2), Math.abs(p.x2 - p.x), Math.abs(p.y2 - p.y))
893
- }) : null
894
- ] });
895
- }
896
- function Ae(e, t) {
897
- let n = (r) => {
898
- Math.abs(r.clientX - e) > 24 || Math.abs(r.clientY - t) > 24 || (r.preventDefault(), r.stopPropagation(), removeEventListener("click", n, !0));
899
- };
900
- addEventListener("click", n, !0), setTimeout(() => removeEventListener("click", n, !0), 700);
901
- }
902
- function je(e, t) {
903
- if (e.contains(t)) return e;
904
- for (let n = t; n; n = n.parentElement) if (n.contains(e)) return n;
905
- return document.body;
906
- }
907
- //#endregion
908
- //#region src/ui/nav.ts
909
- function Me(e, t, n) {
910
- let r = J(e);
911
- if (!r || !/^https?:$/.test(new URL(r).protocol) || Ne(r)) return n(t);
912
- let i = new URL(r);
913
- i.searchParams.set("ck_thread", t), location.assign(i.toString());
914
- }
915
- function Ne(e) {
916
- try {
917
- let n = new URL(e), r = new URL(t());
918
- return n.origin === r.origin && n.pathname === r.pathname && n.search === r.search && (n.hash === r.hash || !n.hash.startsWith("#/"));
919
- } catch {
920
- return !1;
921
- }
922
- }
923
- //#endregion
924
- //#region src/ui/placement.ts
925
- function Pe() {
926
- let e = /* @__PURE__ */ new Map();
927
- return (t, n, o) => {
928
- let s = e.get(t), c;
929
- if (!s || s.a !== n || s.v !== o && !Fe(s)) {
930
- c = r(n);
931
- let i = c.state === "detached" ? null : c.element;
932
- e.set(t, s = {
933
- a: n,
934
- f: i && {
935
- element: i,
936
- state: c.state
937
- },
938
- fp: i && a(i),
939
- v: o,
940
- ...Ie(i)
941
- });
942
- } else s.v !== o && Object.assign(s, { v: o }, Ie(s.f.element));
943
- if (!s.f) return null;
944
- c ?? (c = r(n, document, s.f));
945
- let l = c.point.x - scrollX, u = c.point.y - scrollY, d = s.clips.map((e) => {
946
- let t = i(e);
947
- return e.localName === "iframe" ? new DOMRect(t.x + e.clientLeft, t.y + e.clientTop, e.clientWidth || t.width, e.clientHeight || t.height) : t;
948
- }), f = (e, t) => d.every((n) => e >= n.left - 1 && e <= n.right + 1 && t >= n.top - 1 && t <= n.bottom + 1);
949
- return {
950
- resolved: c,
951
- element: s.f.element,
952
- x: l,
953
- y: u,
954
- fixed: s.fixed,
955
- clipped: !f(l, u),
956
- inView: f
957
- };
958
- };
959
- }
960
- function Fe(e) {
961
- let t = e.f?.element;
962
- return !!t?.isConnected && t.getClientRects().length > 0 && a(t) === e.fp;
963
- }
964
- function Ie(e) {
965
- let t = [], n = !1;
966
- for (let r = e; r && r !== document.body;) {
967
- let i = getComputedStyle(r);
968
- n ? n = i.transform + i.filter + i.perspective === "nonenonenone" : (r !== e && i.overflow !== "visible" && !/^(html|body)$/.test(r.localName) && t.push(r), n = i.position === "fixed");
969
- let a = r.parentElement ?? r.parentNode?.host, o = a || r.ownerDocument === document ? null : r.ownerDocument.defaultView?.frameElement;
970
- o && (n = !1, t.push(o)), r = a ?? o ?? null;
971
- }
972
- return {
973
- clips: t,
974
- fixed: n
975
- };
976
- }
977
- //#endregion
978
- //#region src/ui/Pins.tsx
979
- var Le = "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", Re = 6;
980
- function ze({ client: e, activeId: t, onOpen: n, notify: r, onError: a }) {
981
- let c = $(e.state, (e) => e.threads), l = $(e.state, (e) => !!e.session?.capabilities.triage && !e.config?.read_only), u = ve(c.length > 0), [f] = g(Pe), [p] = g(() => /* @__PURE__ */ new Map()), m = d(null), _ = d(null), v = typeof matchMedia == "function" && matchMedia("(hover: hover)").matches, y = c.map((e) => ({
982
- thread: e,
983
- at: f(e.id, e.anchor, u.version)
984
- })), C = (e) => {
985
- let t = e?.getBoundingClientRect() ?? {
986
- left: -scrollX,
987
- top: -scrollY,
988
- width: 100
989
- };
990
- return (e, n) => ({
991
- x: (e - t.left) / (t.width / 100 || 1),
992
- y: (n - t.top) / (t.width / 100 || 1)
993
- });
994
- }, w = C(m.current), T = C(_.current), E = y.flatMap(({ thread: e, at: t }) => {
995
- let n = e.anchor.quote;
996
- if (!t || e.anchor.type !== "text" || !n) return [];
997
- let r = p.get(e.id);
998
- r?.[0] !== u.version && p.set(e.id, r = [u.version, Ue(t.element, n)]);
999
- let a = t.element.getBoundingClientRect(), o = i(t.element);
1000
- return [...r[1]?.getClientRects() ?? []].map((e) => new DOMRect(e.x + o.x - a.x, e.y + o.y - a.y, e.width, e.height)).filter((e) => e.width > 0 && e.height > 0 && t.inView(e.left + e.width / 2, e.top + e.height / 2)).slice(0, 50).map((n) => ({
1001
- id: e.id,
1002
- fixed: t.fixed,
1003
- x: n.left,
1004
- y: n.top,
1005
- w: n.width,
1006
- h: n.height
1007
- }));
1008
- }), D = d(E);
1009
- D.current = E, x(() => u.watch(y.flatMap(({ at: e }) => e?.element ? [e.element] : []))), x(() => {
1010
- if (!v) return;
1011
- let e = 0, t = null, n = (n) => {
1012
- e || (e = requestAnimationFrame(() => {
1013
- e = 0;
1014
- let r = n.clientX, i = n.clientY, a = D.current.find((e) => r >= e.x && r <= e.x + e.w && i >= e.y && i <= e.y + e.h)?.id ?? null;
1015
- a !== t && (t = a, F(a, a ? 250 : 120));
1016
- }));
1017
- };
1018
- return addEventListener("pointermove", n, { passive: !0 }), () => {
1019
- removeEventListener("pointermove", n), cancelAnimationFrame(e);
1020
- };
1021
- }, [E.length > 0]);
1022
- let [O, k] = g(null), [A, j] = g(null), M = d(null), N = d(!1), P = d(null), F = (e, t) => {
1023
- P.current && clearTimeout(P.current), P.current = setTimeout(() => k(e), t);
1024
- };
1025
- x(() => () => void (P.current && clearTimeout(P.current)), []);
1026
- let I = (t, n, i) => {
1027
- let c = document.elementsFromPoint(n, i).find((e) => !o(e) && e !== document.documentElement);
1028
- if (!c) return;
1029
- let l = t.anchor, u = s({
1030
- element: c,
1031
- clientX: n,
1032
- clientY: i
1033
- });
1034
- e.state.set((e) => ({ threads: e.threads.map((e) => e.id === t.id ? {
1035
- ...e,
1036
- anchor: u
1037
- } : e) })), e.updateThread(t.id, { anchor: u }).then(() => {
1038
- r({
1039
- text: b("pinMoved", { ref: t.reference }),
1040
- tone: "success",
1041
- action: {
1042
- label: b("undo"),
1043
- run: () => void e.updateThread(t.id, { anchor: l }).catch(a)
1044
- }
1045
- });
1046
- }, (n) => {
1047
- e.state.set((e) => ({ threads: e.threads.map((e) => e.id === t.id ? {
1048
- ...e,
1049
- anchor: l
1050
- } : e) })), a(n);
1051
- });
1052
- }, L = {
1053
- page: [],
1054
- fixed: []
1055
- };
1056
- for (let e of E) {
1057
- let n = (e.fixed ? T : w)(e.x, e.y);
1058
- L[e.fixed ? "fixed" : "page"].push(/* @__PURE__ */ h("div", {
1059
- class: "ck-shade",
1060
- "data-active": e.id === t || e.id === O || void 0,
1061
- style: V(n.x, n.y, e.w, e.h),
1062
- "aria-hidden": "true"
1063
- }));
1064
- }
1065
- for (let { thread: e, at: r } of y) {
1066
- if (!r) continue;
1067
- let i = r.fixed ? T : w, a = A?.id === e.id, o = a ? A.x : r.x, s = a ? A.y : r.y, c = !a && r.clipped, u = c || !a && e.id !== t && Be(r.element, o, s), d = O === e.id && !A && e.id !== t && !u, f = i(o, s), p = r.resolved.rect && e.id === t && !c ? i(r.resolved.rect.x - scrollX, r.resolved.rect.y - scrollY) : null;
1068
- L[r.fixed ? "fixed" : "page"].push(/* @__PURE__ */ h(S, { children: [
1069
- p ? /* @__PURE__ */ h("div", {
1070
- class: "ck-pin-region",
1071
- style: V(p.x, p.y, r.resolved.rect.w, r.resolved.rect.h)
1072
- }) : null,
1073
- /* @__PURE__ */ h("button", {
1074
- class: "ck-pin",
1075
- style: V(f.x, f.y),
1076
- "data-status": e.status,
1077
- "data-state": r.resolved.state,
1078
- "data-dragging": a || void 0,
1079
- "data-covered": u || void 0,
1080
- "data-clipped": c || void 0,
1081
- tabIndex: u ? -1 : void 0,
1082
- "data-movable": l || void 0,
1083
- "aria-expanded": e.id === t,
1084
- "aria-label": `${e.reference}: ${e.first_message?.body.slice(0, 80) ?? ""}`,
1085
- "aria-roledescription": l ? b("pinMovable") : void 0,
1086
- onPointerEnter: () => v && F(e.id, 250),
1087
- onPointerLeave: () => v && F(null, 120),
1088
- onFocus: () => F(e.id, 0),
1089
- onBlur: () => F(null, 0),
1090
- onPointerDown: (t) => {
1091
- l && t.button === 0 && (M.current = {
1092
- id: e.id,
1093
- x: t.clientX,
1094
- y: t.clientY,
1095
- moved: !1
1096
- }, t.currentTarget.setPointerCapture?.(t.pointerId));
1097
- },
1098
- onPointerMove: (t) => {
1099
- let n = M.current;
1100
- n && n.id === e.id && (!n.moved && Math.hypot(t.clientX - n.x, t.clientY - n.y) < Re || (n.moved = !0, k(null), j({
1101
- id: e.id,
1102
- x: t.clientX,
1103
- y: t.clientY
1104
- })));
1105
- },
1106
- onPointerUp: (t) => {
1107
- let n = M.current;
1108
- M.current = null, n?.moved && (N.current = !0, j(null), I(e, t.clientX, t.clientY));
1109
- },
1110
- onPointerCancel: () => {
1111
- M.current = null, j(null);
1112
- },
1113
- onClick: () => {
1114
- if (N.current) return void (N.current = !1);
1115
- n(e);
1116
- },
1117
- onKeyDown: (e) => e.key === "Escape" && k(null),
1118
- children: [/* @__PURE__ */ h("svg", {
1119
- viewBox: "5 3 54 62",
1120
- "aria-hidden": "true",
1121
- children: /* @__PURE__ */ h("path", { d: Le })
1122
- }), /* @__PURE__ */ h("span", { children: e.number })]
1123
- }),
1124
- d ? /* @__PURE__ */ h(He, {
1125
- thread: e,
1126
- x: o,
1127
- y: s,
1128
- to: i
1129
- }) : null
1130
- ] }, e.id));
1131
- }
1132
- return /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ h("div", {
1133
- class: "ck-pins",
1134
- ref: m,
1135
- "data-commentkit-ui": !0,
1136
- children: L.page
1137
- }), /* @__PURE__ */ h("div", {
1138
- class: "ck-pins",
1139
- ref: _,
1140
- "data-fixed": !0,
1141
- "data-commentkit-ui": !0,
1142
- children: L.fixed
1143
- })] });
1144
- }
1145
- function Be(e, t, n) {
1146
- if (!e?.isConnected || t < 0 || n < 0 || t >= innerWidth || n >= innerHeight) return !1;
1147
- let r = document.elementsFromPoint(t, n).find((e) => !o(e)), i = Ve(e), a = r && Ve(r);
1148
- return !!a && a !== document.documentElement && a !== document.body && !i.contains(a) && !a.contains(i);
1149
- }
1150
- function Ve(e) {
1151
- for (let t; t = e.getRootNode().host ?? (e.ownerDocument !== document && e.ownerDocument.defaultView?.frameElement);) e = t;
1152
- return e;
1153
- }
1154
- function He({ thread: e, x: t, y: n, to: r }) {
1155
- let i = n > 180, a = r(Math.min(Math.max(8, t + 18), innerWidth - 260 - 8), i ? n - 16 : n + 24);
1156
- return /* @__PURE__ */ h("div", {
1157
- class: "ck-peek",
1158
- style: {
1159
- ...V(a.x, a.y, 260),
1160
- transform: i ? "translateY(-100%)" : "none"
1161
- },
1162
- "aria-hidden": "true",
1163
- children: [
1164
- /* @__PURE__ */ h("div", {
1165
- class: "ck-peek-top",
1166
- children: [
1167
- /* @__PURE__ */ h(Y, { person: e.author }),
1168
- /* @__PURE__ */ h("bdi", {
1169
- class: "ck-msg-name",
1170
- children: e.author.name
1171
- }),
1172
- /* @__PURE__ */ h("span", {
1173
- class: "ck-time",
1174
- children: l(e.created_at)
1175
- })
1176
- ]
1177
- }),
1178
- e.anchor.quote ? /* @__PURE__ */ h("div", {
1179
- class: "ck-quote ck-peek-quote",
1180
- children: /* @__PURE__ */ h("bdi", { children: e.anchor.quote })
1181
- }) : null,
1182
- /* @__PURE__ */ h("div", {
1183
- class: "ck-peek-text",
1184
- dir: "auto",
1185
- children: e.first_message?.body
1186
- }),
1187
- /* @__PURE__ */ h("div", {
1188
- class: "ck-peek-foot",
1189
- children: [/* @__PURE__ */ h(X, { status: e.status }), /* @__PURE__ */ h("span", {
1190
- class: "ck-muted",
1191
- children: m("messageCount", e.message_count)
1192
- })]
1193
- })
1194
- ]
1195
- });
1196
- }
1197
- function Ue(e, t) {
1198
- let n = t.replace(/\s+/g, " ").trim().toLowerCase();
1199
- if (!n) return null;
1200
- let r = [], i = "", a = e.ownerDocument, o = a.createTreeWalker(e, NodeFilter.SHOW_TEXT);
1201
- for (let e = o.nextNode(); e; e = o.nextNode()) {
1202
- for (let t = 0; t < e.data.length; t++) {
1203
- let n = /\s/.test(e.data[t]) ? " " : e.data[t].toLowerCase();
1204
- n === " " && i.endsWith(" ") || (i += n, r.push({
1205
- node: e,
1206
- offset: t
1207
- }));
1208
- }
1209
- if (i.length > 2e4) break;
1210
- }
1211
- let s = i.indexOf(n);
1212
- if (s < 0) return null;
1213
- let c = r[s], l = r[s + n.length - 1], u = a.createRange();
1214
- return u.setStart(c.node, c.offset), u.setEnd(l.node, l.offset + 1), u;
1215
- }
1216
- //#endregion
1217
- //#region src/ui/Welcome.tsx
1218
- function We({ position: e, project: t, onStart: n, onDismiss: r }) {
1219
- let i = e.startsWith("top") ? { top: "76px" } : { bottom: "76px" };
1220
- return e.endsWith("center") ? Object.assign(i, {
1221
- left: "50%",
1222
- transform: "translateX(-50%)"
1223
- }) : i[e.endsWith("left") ? "left" : "right"] = "20px", /* @__PURE__ */ h("div", {
1224
- class: "ck-welcome",
1225
- style: i,
1226
- role: "region",
1227
- "aria-labelledby": "ck-welcome-title",
1228
- "data-commentkit-ui": !0,
1229
- children: [
1230
- /* @__PURE__ */ h("h2", {
1231
- id: "ck-welcome-title",
1232
- children: b("welcomeTitle", { project: t })
1233
- }),
1234
- /* @__PURE__ */ h("p", { children: b(matchMedia("(pointer: coarse)").matches ? "welcomeBodyTouch" : "welcomeBody") }),
1235
- /* @__PURE__ */ h("div", {
1236
- style: {
1237
- display: "flex",
1238
- gap: "8px"
1239
- },
1240
- children: [/* @__PURE__ */ h("button", {
1241
- class: "ck-btn ck-primary",
1242
- onClick: n,
1243
- children: b("comment")
1244
- }), /* @__PURE__ */ h("button", {
1245
- class: "ck-btn",
1246
- onClick: r,
1247
- children: b("gotIt")
1248
- })]
1249
- })
1250
- ]
1251
- });
1252
- }
1253
- //#endregion
1254
- //#region src/ui/App.tsx
1255
- var Ge = 3, Ke = "commentkit:share", qe = "commentkit:dblclick-hint", Je = "commentkit:dock", Ye = 200, Xe = /* @__PURE__ */ new WeakSet(), Ze = "commentkit:welcomed";
1256
- function Qe({ client: e, onHide: t = () => void 0 }) {
1257
- return $(e.state, (e) => e.config?.enabled !== !1) ? /* @__PURE__ */ h($e, {
1258
- client: e,
1259
- onHide: t
1260
- }) : /* @__PURE__ */ h("div", {
1261
- class: "ck-toast",
1262
- role: "status",
1263
- children: b("paused")
1264
- });
1265
- }
1266
- function $e({ client: e, onHide: t }) {
1267
- let r = $(e.state, (e) => e.config), i = $(e.state, (e) => e.session), [a, o] = g({ name: "idle" }), [s, c] = g([]), l = p((e, t = !1) => {
1268
- c((t) => t.filter((t) => t !== e)), !t && e.onExpire && !Xe.has(e) && (Xe.add(e), e.onExpire());
1269
- }, []);
1270
- x(() => {
1271
- let e = s.filter((e) => (e.tone === "error" || e.action) && !e.expires);
1272
- if (!e.length) return;
1273
- let t = (t) => {
1274
- t.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-toast")) || e.forEach((e) => l(e));
1275
- };
1276
- return addEventListener("pointerdown", t, !0), () => removeEventListener("pointerdown", t, !0);
1277
- }, [s]);
1278
- let u = d(s);
1279
- u.current = s, x(() => {
1280
- let e = () => u.current.forEach((e) => l(e));
1281
- return addEventListener("pagehide", e), () => {
1282
- removeEventListener("pagehide", e), e();
1283
- };
1284
- }, []);
1285
- let [f, m] = g(!1), [_, v] = g(!1), [y, C] = g(null);
1286
- x(() => {
1287
- _ && !y && import("./Settings-C_qV4n7J.js").then((e) => C(() => e.Settings), W);
1288
- }, [_]);
1289
- let [T, E] = g(null), [D, O] = g(null);
1290
- x(() => {
1291
- f && !D && import("./Shortcuts-ChnaribX.js").then((e) => O(() => e.Shortcuts), W);
1292
- }, [f]);
1293
- let [k, A] = g(null);
1294
- x(() => {
1295
- (a.name === "commenting" || a.name === "composing") && !k && import("./Composer-D1wbmdjF.js").then((t) => {
1296
- A(() => t.Composer), e.state.get().config?.features.screenshots !== !1 && t.warmCapture();
1297
- }, W);
1298
- }, [a.name]);
1299
- let [j, M] = g(null), [N, P] = g(null), F = $(e.state, (e) => e.opening), [I] = g(() => rt()), [L, R] = g(() => !!I && !at(Ze)), z = d(null), [ee, te] = g(null), ne = e.options.shortcuts !== !1;
1300
- x(() => {
1301
- if (a.name === "idle") {
1302
- let e = z.current;
1303
- z.current = null, e?.isConnected && e.focus({ preventScroll: !0 });
1304
- }
1305
- }, [a.name]);
1306
- let [re, ie] = g(!1), B = d(null), V = p(() => {
1307
- if (!B.current) {
1308
- if (matchMedia("(prefers-reduced-motion: reduce)").matches) return o({ name: "idle" });
1309
- ie(!0), B.current = setTimeout(() => {
1310
- B.current = null, ie(!1), o({ name: "idle" });
1311
- }, Ye);
1312
- }
1313
- }, []);
1314
- x(() => () => void (B.current && clearTimeout(B.current)), []);
1315
- let H = (e) => {
1316
- if (a.name === "idle") {
1317
- let e = document.querySelector("[data-commentkit-host]")?.shadowRoot?.activeElement;
1318
- z.current = e instanceof HTMLElement ? e : null;
1319
- }
1320
- B.current && (clearTimeout(B.current), B.current = null, ie(!1)), o(e);
1321
- }, U = p((e) => {
1322
- c((t) => {
1323
- let n = t.filter((t) => t.text !== e.text), r = n.slice(0, Math.max(0, n.length - Ge + 1));
1324
- return r.forEach((e) => queueMicrotask(() => l(e))), [...n.slice(r.length), e];
1325
- }), (e.expires || e.tone !== "error" && !e.action) && setTimeout(() => l(e), e.expires ?? 4e3);
1326
- }, []), W = p((t) => {
1327
- let r = e.auth.pending();
1328
- if (t instanceof n && t.code === "verification_required" && r) return o({
1329
- name: "verify",
1330
- email: r.email,
1331
- draft: null
1332
- });
1333
- U({
1334
- text: he(t),
1335
- tone: "error"
1336
- });
1337
- }, [U]), G = d(null), ae = d(null);
1338
- ae.current = a.name === "thread" ? a.threadId : a.name === "panel" ? a.threadId ?? null : null;
1339
- let [oe, se] = g(0);
1340
- x(() => () => G.current?.stop(), []), x(() => {
1341
- let t = () => {
1342
- let e = new URL(location.href), t = e.searchParams.get("ck_thread");
1343
- t && /^[0-9a-f-]{36}$/i.test(t) && (e.searchParams.delete("ck_thread"), history.replaceState(history.state, "", e.toString()), i ? H({
1344
- name: "thread",
1345
- threadId: t
1346
- }) : ot("commentkit:pending-thread", t));
1347
- }, n = () => i && void e.loadPageThreads().catch(W);
1348
- if (n(), t(), i) {
1349
- e.inbox().catch(() => void 0);
1350
- let t = e.state.get().config;
1351
- t?.features.realtime && t.realtime && import("./live-MvvBdoGd.js").then((t) => (G.current ?? (G.current = t.liveUpdates(e, () => ae.current, () => se((e) => e + 1))), e.connectRealtime((e) => G.current?.onPing(e)))).catch(() => void 0);
1352
- }
1353
- return it(() => (n(), t()));
1354
- }, [
1355
- e,
1356
- i,
1357
- W
1358
- ]), x(() => {
1359
- if (!i) return;
1360
- let e = null;
1361
- try {
1362
- e = JSON.parse(sessionStorage.getItem("commentkit:pending-compose") ?? "null"), sessionStorage.removeItem(ge);
1363
- } catch {
1364
- e = null;
1365
- }
1366
- e?.draft?.anchor && (scrollTo({
1367
- top: e.scrollY,
1368
- behavior: "auto"
1369
- }), o({
1370
- name: "composing",
1371
- draft: e.draft
1372
- }));
1373
- }, [i]), x(() => {
1374
- if (!i) return;
1375
- let e = at("commentkit:pending-thread");
1376
- e && (st("commentkit:pending-thread"), o({
1377
- name: "thread",
1378
- threadId: e
1379
- }));
1380
- }, [i]), x(() => {
1381
- let t = e.auth.pending();
1382
- !i && t && o({
1383
- name: "verify",
1384
- email: t.email,
1385
- draft: null
1386
- });
1387
- }, []), x(() => {
1388
- a.name === "verify" && !T && import("./Guest-CtyRy8Kz.js").then((e) => E(() => e.GuestVerify), W);
1389
- }, [a.name]), x(() => {
1390
- a.name === "panel" && !j && import("./Panel-DSoUAlbQ.js").then((e) => M(() => e.Panel), W), (a.name === "thread" || a.name === "panel" && a.threadId) && !N && import("./ThreadCard-DmKAelSL.js").then((e) => P(() => e.ThreadCard), W);
1391
- }, [a.name, a.name === "panel" ? a.threadId : null]), x(() => {
1392
- if (!F || !i) return;
1393
- if (e.state.set({ opening: null }), /^[0-9a-f-]{36}$/i.test(F)) return Y(F);
1394
- let t = F.trim().toUpperCase(), n = e.state.get().threads.find((e) => e.reference.toUpperCase() === t);
1395
- if (n) return Y(n);
1396
- e.listThreads({
1397
- q: t,
1398
- status: "all",
1399
- limit: 5
1400
- }).then((e) => {
1401
- let n = e.data.find((e) => e.reference.toUpperCase() === t);
1402
- n ? Me(n.page.url, n.id, Y) : U({
1403
- text: b("threadNotFound"),
1404
- tone: "error"
1405
- });
1406
- }, W);
1407
- }, [F, i]), x(() => {
1408
- let t = (t) => {
1409
- if (!(t.defaultPrevented || nt(t) || et(t) || !ne && t.key !== "Escape")) {
1410
- if (f) t.key === "Escape" && m(!1);
1411
- else if (t.key === "?" && !t.metaKey && !t.ctrlKey && !t.altKey) t.preventDefault(), m(!0);
1412
- else if (t.key === "Escape" && a.name !== "idle") t.preventDefault(), a.name === "commenting" ? o({ name: "idle" }) : V();
1413
- else if ((t.key === "c" || t.key === "C") && !t.metaKey && !t.ctrlKey && !t.altKey && a.name === "idle") t.preventDefault(), q();
1414
- else if ((t.key === "j" || t.key === "k") && !t.metaKey && !t.ctrlKey && !t.altKey && i && (a.name === "idle" || a.name === "thread")) {
1415
- let n = e.state.get().threads;
1416
- if (!n.length || tt(t)) return;
1417
- t.preventDefault();
1418
- let r = a.name === "thread" ? n.findIndex((e) => e.id === a.threadId) : -1, i = n[(r + (t.key === "j" ? 1 : n.length - 1 + +(r < 0))) % n.length];
1419
- i && Y(i);
1420
- }
1421
- }
1422
- };
1423
- return addEventListener("keydown", t, !0), () => removeEventListener("keydown", t, !0);
1424
- });
1425
- let ce = r?.read_only ?? !1, le = b(i && i.role !== "guest" ? "readOnly" : "readOnlyGuest"), K = !i && a.name === "idle" ? e.auth.pending() : null, q = () => {
1426
- if (ce) return U({
1427
- text: le,
1428
- tone: "error"
1429
- });
1430
- R(!1), H({ name: "commenting" });
1431
- };
1432
- x(() => {
1433
- if (a.name !== "panel") return;
1434
- let e = (e) => !e.composedPath().some((e) => e instanceof HTMLElement && e.hasAttribute("data-commentkit-ui")), t = (t) => e(t) && V(), n = (t) => {
1435
- e(t) && t.button === 0 && !at(qe) && (ot(qe, "1"), U({
1436
- text: b("doubleClickHint"),
1437
- tone: "info"
1438
- }));
1439
- };
1440
- return addEventListener("dblclick", t, !0), addEventListener("pointerdown", n, !0), () => {
1441
- removeEventListener("dblclick", t, !0), removeEventListener("pointerdown", n, !0);
1442
- };
1443
- }, [a.name]);
1444
- let ue = a.name === "commenting", de = d(!1);
1445
- x(() => {
1446
- (de.current || ue) && e.emit("mode", { commenting: ue }), de.current = !0;
1447
- }, [ue]);
1448
- let J = $(e.state, (e) => e.request);
1449
- x(() => {
1450
- J && (e.state.set({ request: null }), J.kind === "comment" ? a.name !== "commenting" && q() : J.kind === "stop" ? a.name === "commenting" && o({ name: "idle" }) : i ? a.name === "panel" ? V() : H({ name: "panel" }) : X());
1451
- }, [J]);
1452
- let Y = (e) => H({
1453
- name: "thread",
1454
- threadId: typeof e == "string" ? e : e.id
1455
- }), X = async () => {
1456
- let t = await e.signIn(I);
1457
- return t === "signed_in" || (t === "redirecting" || U({
1458
- text: b(t === "popup_blocked" ? "popupBlocked" : "signInCancelled"),
1459
- tone: "error"
1460
- }), !1);
1461
- }, [fe, pe] = g(() => {
1462
- let e = at(Je);
1463
- return e && /^(top|bottom)-(left|center|right)$/.test(e) ? e : null;
1464
- }), Q = fe ?? e.options.position ?? r?.appearance.position ?? "bottom-right";
1465
- return /* @__PURE__ */ h(S, { children: [
1466
- i ? /* @__PURE__ */ h(ze, {
1467
- client: e,
1468
- activeId: ae.current,
1469
- onOpen: Y,
1470
- notify: U,
1471
- onError: W
1472
- }) : null,
1473
- a.name === "commenting" ? /* @__PURE__ */ h(ke, {
1474
- quote: e.options.tools?.text !== !1,
1475
- onCancel: () => o({ name: "idle" }),
1476
- onPick: (e) => o({
1477
- name: "composing",
1478
- draft: e
1479
- })
1480
- }) : null,
1481
- /* @__PURE__ */ h("div", {
1482
- class: "ck-layer",
1483
- "data-closing": re || void 0,
1484
- "data-pos": Q,
1485
- children: [
1486
- a.name === "composing" && k ? /* @__PURE__ */ h(k, {
1487
- client: e,
1488
- draft: a.draft,
1489
- signedIn: !!i,
1490
- onSignIn: X,
1491
- onCancel: V,
1492
- onSent: (e, t) => {
1493
- U({
1494
- text: t ? b(t === "screenshot" ? "sentWithoutScreenshot" : "sentWithoutFiles") : i?.role === "guest" || !i ? b("sentGuest") : b("sent"),
1495
- tone: t ? "info" : "success"
1496
- }), Y(e);
1497
- },
1498
- share: I,
1499
- onPending: (e) => {
1500
- te(a.draft), o({
1501
- name: "verify",
1502
- email: e,
1503
- draft: a.draft
1504
- });
1505
- },
1506
- onError: W
1507
- }) : null,
1508
- a.name === "verify" && T ? /* @__PURE__ */ h(T, {
1509
- client: e,
1510
- email: a.email,
1511
- onDone: (t) => {
1512
- a.draft && w(_e(e, a.draft.anchor)), U({
1513
- text: b("sentGuest"),
1514
- tone: "success"
1515
- }), t[0] ? Y(t[0]) : o({ name: "idle" });
1516
- },
1517
- onDifferentEmail: () => o(a.draft ? {
1518
- name: "composing",
1519
- draft: a.draft
1520
- } : { name: "commenting" }),
1521
- onClose: V
1522
- }) : null,
1523
- a.name === "thread" && N ? /* @__PURE__ */ h(N, {
1524
- client: e,
1525
- threadId: a.threadId,
1526
- version: oe,
1527
- onClose: V,
1528
- onError: W,
1529
- notify: U
1530
- }) : null,
1531
- a.name === "panel" && j ? /* @__PURE__ */ h(j, {
1532
- client: e,
1533
- side: Q.endsWith("left") ? "left" : "right",
1534
- dock: Q.startsWith("top") ? "top" : "bottom",
1535
- onClose: V,
1536
- onOpen: (e, t) => o({
1537
- name: "panel",
1538
- threadId: typeof e == "string" ? e : e.id,
1539
- order: t
1540
- }),
1541
- onError: W,
1542
- notify: U,
1543
- detail: a.threadId && N ? (() => {
1544
- let t = a.order ?? [], n = t.indexOf(a.threadId), r = (e) => n < 0 ? void 0 : () => o({
1545
- ...a,
1546
- threadId: t[(n + e + t.length) % t.length]
1547
- });
1548
- return /* @__PURE__ */ h(N, {
1549
- client: e,
1550
- threadId: a.threadId,
1551
- version: oe,
1552
- onClose: V,
1553
- onError: W,
1554
- notify: U,
1555
- embedded: {
1556
- onBack: () => o({
1557
- name: "panel",
1558
- order: t
1559
- }),
1560
- onPrev: t.length > 1 ? r(-1) : void 0,
1561
- onNext: t.length > 1 ? r(1) : void 0,
1562
- position: n < 0 ? null : {
1563
- n: n + 1,
1564
- total: t.length
1565
- },
1566
- onShow: (e) => {
1567
- o({ name: "idle" }), Me(e.page.url, e.id, Y);
1568
- }
1569
- }
1570
- });
1571
- })() : null
1572
- }) : null
1573
- ]
1574
- }),
1575
- L && !i && a.name === "idle" ? /* @__PURE__ */ h(We, {
1576
- position: Q,
1577
- project: r?.project.name ?? "",
1578
- onStart: q,
1579
- onDismiss: () => {
1580
- R(!1), ot(Ze, "1");
1581
- }
1582
- }) : null,
1583
- /* @__PURE__ */ h(Ee, {
1584
- client: e,
1585
- position: Q,
1586
- onMove: (e) => {
1587
- pe(e), ot(Je, e);
1588
- },
1589
- commenting: a.name === "commenting",
1590
- panelOpen: a.name === "panel",
1591
- onComment: () => a.name === "commenting" ? o({ name: "idle" }) : q(),
1592
- onPanel: () => a.name === "panel" ? V() : H({ name: "panel" }),
1593
- onSignIn: () => void X(),
1594
- onSignOut: () => void e.signOut(),
1595
- onShortcuts: ne ? () => m(!0) : null,
1596
- onSettings: () => v(!0),
1597
- onHide: t,
1598
- waiting: K?.email ?? null,
1599
- onCode: () => K && H({
1600
- name: "verify",
1601
- email: K.email,
1602
- draft: ee
1603
- }),
1604
- covered: a.name !== "idle" && a.name !== "commenting" || f || _
1605
- }),
1606
- f && D ? /* @__PURE__ */ h(D, { onClose: () => m(!1) }) : null,
1607
- _ && y ? /* @__PURE__ */ h(y, {
1608
- client: e,
1609
- onClose: () => v(!1),
1610
- onShortcuts: ne ? () => m(!0) : null,
1611
- onHide: t,
1612
- onSignOut: () => void e.signOut()
1613
- }) : null,
1614
- ce && a.name === "commenting" ? /* @__PURE__ */ h("div", {
1615
- class: "ck-toast",
1616
- role: "status",
1617
- children: le
1618
- }) : null,
1619
- /* @__PURE__ */ h("div", {
1620
- class: "ck-toast-region",
1621
- role: "status",
1622
- "aria-live": "polite",
1623
- children: s.map((e) => /* @__PURE__ */ h("div", {
1624
- class: "ck-toast",
1625
- "data-tone": e.tone,
1626
- children: [
1627
- e.tone ? /* @__PURE__ */ h("span", {
1628
- class: "ck-toast-icon",
1629
- "aria-hidden": "true",
1630
- children: /* @__PURE__ */ h(Z, {
1631
- name: e.tone === "error" ? "alert" : e.tone === "success" ? "check" : "info",
1632
- size: 15
1633
- })
1634
- }) : null,
1635
- /* @__PURE__ */ h("span", { children: e.text }),
1636
- e.action ? /* @__PURE__ */ h("button", {
1637
- onClick: () => (l(e, !0), e.action.run()),
1638
- children: e.action.label
1639
- }) : null,
1640
- e.tone === "error" || e.action ? /* @__PURE__ */ h("button", {
1641
- class: "ck-toast-close",
1642
- "aria-label": b("close"),
1643
- onClick: () => l(e),
1644
- children: /* @__PURE__ */ h(Z, {
1645
- name: "close",
1646
- size: 14
1647
- })
1648
- }) : null
1649
- ]
1650
- }, e.text))
1651
- })
1652
- ] });
1653
- }
1654
- function et(e) {
1655
- return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-markup"));
1656
- }
1657
- function tt(e) {
1658
- return e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("ck-panel"));
1659
- }
1660
- function nt(e) {
1661
- return e.composedPath().some((e) => e instanceof HTMLElement && (e.isContentEditable || [
1662
- "INPUT",
1663
- "TEXTAREA",
1664
- "SELECT"
1665
- ].includes(e.tagName)));
1666
- }
1667
- function rt() {
1668
- let e = new URL(location.href), t = e.searchParams.get("ck");
1669
- if (t && /^[A-Za-z0-9]{16,128}$/.test(t)) {
1670
- e.searchParams.delete("ck"), history.replaceState(history.state, "", e.toString());
1671
- try {
1672
- sessionStorage.setItem(Ke, t);
1673
- } catch {}
1674
- return t;
1675
- }
1676
- try {
1677
- return sessionStorage.getItem(Ke);
1678
- } catch {
1679
- return null;
1680
- }
1681
- }
1682
- function it(e) {
1683
- let t = location.href, n = () => {
1684
- location.href !== t && (t = location.href, e());
1685
- }, r = setInterval(n, 500);
1686
- return addEventListener("popstate", n), addEventListener("hashchange", n), () => {
1687
- clearInterval(r), removeEventListener("popstate", n), removeEventListener("hashchange", n);
1688
- };
1689
- }
1690
- function at(e) {
1691
- try {
1692
- return localStorage.getItem(e);
1693
- } catch {
1694
- return null;
1695
- }
1696
- }
1697
- function ot(e, t) {
1698
- try {
1699
- localStorage.setItem(e, t);
1700
- } catch {}
1701
- }
1702
- function st(e) {
1703
- try {
1704
- localStorage.removeItem(e);
1705
- } catch {}
1706
- }
1707
- //#endregion
1708
- //#region src/ui/styles.css?inline
1709
- var ct = ":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-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 1.5px color-mix(in srgb, var(--ck-accent) 75%, transparent), inset 0 0 14px 2px color-mix(in srgb, var(--ck-accent) 16%, transparent);animation:.24s ease-out ck-fade,3.2s ease-in-out .24s infinite ck-breathe;position:fixed;top:0;bottom:0;left:0;right:0}@keyframes ck-breathe{50%{opacity:.5}}@media (prefers-reduced-motion:reduce){.ck-mode-frame{animation:.24s ease-out ck-fade}}.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-radius:6px;position:fixed}.ck-region,.ck-pending-region{--ck-dash:linear-gradient(90deg, var(--ck-accent) 50%, transparent 0);--ck-dash-v:linear-gradient(0deg, var(--ck-accent) 50%, transparent 0);background:var(--ck-dash) 0 0 / 12px 2px repeat-x, var(--ck-dash) 0 100% / 12px 2px repeat-x, var(--ck-dash-v) 0 0 / 2px 12px repeat-y, var(--ck-dash-v) 100% 0 / 2px 12px repeat-y, color-mix(in srgb, var(--ck-accent) 8%, transparent);animation:.6s linear infinite ck-ants}@keyframes ck-ants{to{background-position:12px 0,-12px 100%,0 -12px,100% 12px,0 0}}@media (prefers-reduced-motion:reduce){.ck-region,.ck-pending-region{animation:none}}.ck-pins{width:100px;height:0;z-index:calc(var(--ck-z) - 3);position:absolute;top:0;left:0}.ck-pins[data-fixed]{position:fixed}.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[data-covered]{opacity:0;pointer-events:none;transition:opacity .12s ease-out}.ck-pin[data-clipped]{display:none}.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:calc(var(--ck-z) + 1);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;min-height:0;padding:12px 14px;overflow:auto}.ck-card>:not(.ck-card-body){flex-shrink:0}.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-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]{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-avatar img{outline:1px solid var(--ck-img-outline);outline-offset:-1px}.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-name{color:var(--ck-text);font-size:13px;font-weight:650}.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-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-time{white-space:nowrap;font-variant-numeric:tabular-nums;flex:none;line-height:20px}.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-toast{z-index:calc(var(--ck-z) + 1);background:var(--ck-bg);max-width:min(360px,100vw - 24px);color:var(--ck-text);box-shadow:var(--ck-shadow);animation:ck-pop .18s var(--ck-ease);border-radius:12px;align-items:center;gap:10px;padding:10px 10px 10px 12px;font-size:13px;font-weight:500;line-height:1.4;display:flex;position:fixed;bottom:84px;left:50%;transform:translate(-50%);border-color:var(--ck-hairline)!important}.ck-toast-region:empty{display:none}.ck-toast-region{z-index:calc(var(--ck-z) + 1);pointer-events:none;flex-direction:column;align-items:center;gap:8px;width:max-content;max-width:calc(100vw - 24px);display:flex;position:fixed;bottom:84px;left:50%;transform:translate(-50%)}.ck-toast-region .ck-toast{pointer-events:auto;position:relative;bottom:auto;left:auto;transform:none}.ck-layer:has(.ck-card,.ck-panel)~.ck-toast-region{flex-direction:column-reverse;top:12px;bottom:auto}.ck-toast-icon{width:20px;height:20px;color:var(--ck-text-muted);border-radius:50%;flex:none;place-items:center;display:grid}.ck-toast[data-tone=success] .ck-toast-icon{color:var(--ck-success)}.ck-toast .ck-toast-close{width:24px;height:24px;color:var(--ck-text-muted);background:0 0;place-items:center;padding:0;display:grid}.ck-toast[data-tone=error] .ck-toast-icon{color:var(--ck-danger)}.ck-toast button{color:var(--ck-accent);background:0 0;border:0;border-radius:6px;flex:none;padding:4px 8px;font-weight:650}.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(6px);backdrop-filter:blur(6px);background:#0a0a0c4d;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-card:has(.ck-markup,.ck-viewer){z-index:calc(var(--ck-z) + 3)}.ck-panel:has(.ck-viewer){z-index:calc(var(--ck-z) + 3)}.ck-markup canvas{border-radius:var(--ck-radius-md);cursor:crosshair;touch-action:none;background:#fff;max-width:min(100%,1100px);max-height:calc(100dvh - 110px);box-shadow:0 0 0 1px #0000000d,0 20px 50px #00000040}.ck-root .ck-date-input:focus-visible{outline:none}.ck-task .ck-chip{cursor:default}.ck-task button.ck-chip{cursor:pointer}.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-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 .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-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-dialog h2{text-wrap:balance;margin:0;font-size:15px;font-weight:650}.ck-scrim .ck-card{max-height:calc(100dvh - 24px);position:static!important}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-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 .ck-input{width:200px;font-weight:650}.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-card h2.ck-card-title{margin:0;font-size:14px}.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-chip{min-width:36px;min-height:36px}.ck-input{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-input:hover{border-color:color-mix(in srgb, var(--ck-text-muted) 45%, var(--ck-border))}.ck-menu button:hover,.ck-toast button:hover{background:var(--ck-bg-hover)}.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-markup{overscroll-behavior:contain}.ck-card,.ck-panel,.ck-menu,.ck-bar,.ck-toast,.ck-welcome,.ck-btn,.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-note,.ck-empty,.ck-toast span,.ck-welcome p{text-wrap:pretty}.ck-empty strong,.ck-welcome h2{text-wrap:balance}.ck-badge,.ck-time{font-variant-numeric:tabular-nums}.ck-ghost-sm{min-height:24px}.ck-format .ck-ghost{place-items:center;width:26px;height:24px;padding:0;display:grid}.ck-msg-actions .ck-ghost{place-items:center;min-width:24px;display:inline-grid}.ck-mention{color:color-mix(in srgb, var(--ck-accent) 78%, var(--ck-text));font-weight:600}.ck-pre{overscroll-behavior-x:contain;border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);white-space:pre;margin:6px 0;padding:10px 12px;overflow-x:auto}.ck-msg-body .ck-pre code{box-shadow:none;background:0 0;padding:0;font-size:12px;line-height:1.55}.ck-quote{border-radius:var(--ck-radius-sm);border-inline-start:3px solid color-mix(in srgb, var(--ck-accent) 70%, var(--ck-border));background:var(--ck-bg-muted);color:var(--ck-text-muted);overflow-wrap:anywhere;margin:0 0 8px;padding:6px 10px;font-size:12.5px;line-height:1.45;display:block}.ck-search .ck-input{padding-inline-start:32px;padding-inline-end:30px}.ck-search .ck-ghost{place-items:center;width:24px;height:24px;padding:0;display:grid;position:absolute}.ck-search .ck-ghost: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))){right:4px}.ck-search .ck-ghost: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))){right:4px}.ck-search .ck-ghost:-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:4px}.ck-search .ck-ghost: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:4px}.ck-chip .ck-count{margin-inline-start:2px}.ck-item-meta .ck-avatar{width:16px;height:16px;margin-inline-end:2px;font-size:8px}.ck-live-note .ck-btn{flex:none;margin-inline-start:auto}.ck-menu-two{flex-direction:column;align-items:flex-start!important;gap:0!important}.ck-menu-two .ck-muted{font-size:11.5px}.ck-pin[data-movable]{touch-action:none}.ck-pin[data-dragging]{cursor:grabbing;filter:drop-shadow(0 0 .6px #fff)drop-shadow(0 8px 14px #12131659);z-index:2;transition:none;scale:1.18}.ck-peek{z-index:3;background:var(--ck-bg);box-shadow:var(--ck-shadow);pointer-events:none;animation:ck-pop .14s var(--ck-ease);border:1px solid #0000;border-radius:12px;padding:10px 12px;font-size:13px;position:absolute}.ck-peek-top{align-items:center;gap:6px;display:flex}.ck-peek-top .ck-avatar{width:20px;height:20px;font-size:9px}.ck-peek-top .ck-time{color:var(--ck-text-muted);margin-inline-start:auto;font-size:12px}.ck-peek-quote{-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:8px 0 0;display:-webkit-box;overflow:hidden}.ck-peek-text{-webkit-line-clamp:3;overflow-wrap:anywhere;-webkit-box-orient:vertical;margin-top:6px;line-height:1.45;display:-webkit-box;overflow:hidden}.ck-peek-foot{align-items:center;gap:8px;margin-top:8px;font-size:12px;display:flex}@media (hover:hover){.ck-pin[data-movable]:hover{cursor:grab}.ck-format .ck-ghost:hover,.ck-msg-actions .ck-ghost:hover{color:var(--ck-text)}}@media (pointer:coarse){.ck-format .ck-ghost,.ck-msg-actions .ck-ghost,.ck-search .ck-ghost{min-width:36px;min-height:36px}}.ck-emoji{vertical-align:-.2em;width:1.15em;height:1.15em;margin:0 .04em;display:inline-block}.ck-reaction .ck-emoji{vertical-align:-2px;width:14px;height:14px}.ck-extra-add .ck-ghost{padding:2px 6px}.ck-draft-list .ck-input{height:30px;font-size:13px}.ck-panel{transform-origin:100% 100%;animation:ck-grow .24s var(--ck-ease)}.ck-panel[data-side=left]{transform-origin:0 100%}.ck-panel[data-dock=top][data-side=right]{transform-origin:100% 0}.ck-panel[data-dock=top][data-side=left]{transform-origin:0 0}@keyframes ck-grow{0%{opacity:0;scale:.86}}@keyframes ck-panel-out{to{opacity:0;filter:blur(2px);scale:.6}}@keyframes ck-out{to{opacity:0;translate:0 6px;scale:.97}}.ck-layer[data-closing] .ck-panel{pointer-events:none;animation:.2s cubic-bezier(.4,0,1,1) forwards ck-panel-out}.ck-layer[data-closing] .ck-card:not(.ck-card-embedded){pointer-events:none;animation:.16s ease-in forwards ck-out}@keyframes ck-sheet-out{to{translate:0 100%}}@media (max-width:520px){.ck-panel{animation-name:ck-sheet}.ck-layer[data-closing] .ck-panel,.ck-layer[data-closing] .ck-card:not(.ck-card-embedded){animation:.2s ease-in forwards ck-sheet-out}}.ck-confetti{width:100vw;height:100vh;z-index:calc(var(--ck-z) + 4);pointer-events:none;position:fixed;top:0;bottom:0;left:0;right:0}.ck-pin[aria-expanded=true]:before{content:\"\";width:28px;height:28px;box-shadow:0 0 0 2px var(--ck-pin);pointer-events:none;opacity:0;border-radius:50%;margin:-14px 0 0 -14px;animation:.9s ease-out 2 ck-ping;position:absolute;top:40%;left:50%}@keyframes ck-ping{0%{opacity:.8;scale:.6}to{opacity:0;scale:2.2}}.ck-pending-pin .ck-avatar{color:#121316;width:20px;height:20px;box-shadow:none;background:#fff;font-size:8px;position:absolute;top:41%;left:50%;translate:-50% -50%}@keyframes ck-pin-drop{0%{opacity:0;translate:0 -8px;scale:.4}}.ck-text-box{z-index:var(--ck-z);pointer-events:none;background:color-mix(in srgb, var(--ck-accent) 30%, transparent);border-radius:2px;position:fixed}.ck-shade{pointer-events:none;background:color-mix(in srgb, var(--ck-accent) 16%, transparent);box-shadow:inset 0 -2px 0 color-mix(in srgb, var(--ck-accent) 55%, transparent);border-radius:2px;transition:background-color .15s;position:absolute}.ck-shade[data-active]{background:color-mix(in srgb, var(--ck-accent) 28%, transparent)}.ck-launcher[data-pos=bottom-center]{left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translate(-50%)}.ck-launcher[data-pos=top-center]{top:20px;left:50%;transform:translate(-50%)}.ck-launcher[data-pos$=center] .ck-launcher-note,.ck-launcher[data-pos$=center] .ck-menu{left:50%;right:auto;translate:-50%}.ck-launcher[data-dragging]{opacity:.92;transition:none}.ck-launcher:not([data-dragging]){transition:left .2s var(--ck-ease), right .2s var(--ck-ease), top .2s var(--ck-ease), bottom .2s var(--ck-ease)}.ck-grip{width:18px;height:32px;color:var(--ck-text-muted);cursor:grab;touch-action:none;opacity:.55;background:0 0;border:0;border-radius:6px;place-items:center;margin-inline-start:-2px;margin-inline-end:2px;padding:0;transition:opacity .12s;display:grid}.ck-grip svg{fill:currentColor}.ck-launcher[data-dragging] .ck-grip{cursor:grabbing}@media (hover:hover){.ck-grip:hover{opacity:1}}@media (pointer:coarse){.ck-grip{display:none}}";
1710
- //#endregion
1711
- //#region src/ui/mount.tsx
1712
- function lt(e, t = () => void 0, n = t) {
1713
- let r = document.createElement("div");
1714
- r.setAttribute("data-commentkit-host", ""), r.style.cssText = "position:absolute;top:0;left:0;width:0;height:0;z-index:2147483000;";
1715
- let i = r.attachShadow({ mode: "open" });
1716
- if ("adoptedStyleSheets" in Document.prototype && "replaceSync" in CSSStyleSheet.prototype) {
1717
- let e = new CSSStyleSheet();
1718
- e.replaceSync(ct), i.adoptedStyleSheets = [e];
1719
- } else {
1720
- let e = document.createElement("style");
1721
- e.textContent = ct, i.appendChild(e);
1722
- }
1723
- let a = document.createElement("div");
1724
- a.className = "ck-root", a.dir = u(), a.lang = _(), i.appendChild(a), Ce(i), ae(e.assets), document.documentElement.appendChild(r);
1725
- let o = () => {
1726
- let t = e.state.get().theme ?? e.options.theme ?? e.state.get().config?.appearance.theme ?? "auto", n = t === "dark" || t === "auto" && matchMedia("(prefers-color-scheme: dark)").matches;
1727
- r.setAttribute("data-theme", n ? "dark" : "light");
1728
- let i = e.state.get().config?.appearance.accent;
1729
- if (i && /^#[0-9a-f]{6}$/i.test(i)) {
1730
- r.style.setProperty("--ck-accent", i);
1731
- let [e, t, n] = [
1732
- 1,
1733
- 3,
1734
- 5
1735
- ].map((e) => {
1736
- let t = parseInt(i.slice(e, e + 2), 16) / 255;
1737
- return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1738
- });
1739
- r.style.setProperty("--ck-accent-ink", .2126 * e + .7152 * t + .0722 * n > .18 ? "#121316" : "#ffffff");
1740
- }
1741
- };
1742
- o();
1743
- let s = matchMedia("(prefers-color-scheme: dark)");
1744
- s.addEventListener?.("change", o);
1745
- let l = e.state.subscribe(o), d = window.visualViewport, f = () => d && r.style.setProperty("--ck-kb", B(Math.max(0, innerHeight - d.height - d.offsetTop)));
1746
- return d?.addEventListener("resize", f), d?.addEventListener("scroll", f), c(/* @__PURE__ */ h(dt, {
1747
- onCrash: t,
1748
- onError: (t) => e.reportCrash(t),
1749
- children: /* @__PURE__ */ h(Qe, {
1750
- client: e,
1751
- onHide: n
1752
- })
1753
- }), a), () => {
1754
- c(null, a), Ce(null), l(), s.removeEventListener?.("change", o), d?.removeEventListener("resize", f), d?.removeEventListener("scroll", f), r.remove();
1755
- };
1756
- }
1757
- var ut = !1, dt = class extends f {
1758
- constructor(...e) {
1759
- super(...e), this.state = { crashed: !1 };
1760
- }
1761
- componentDidCatch(e) {
1762
- if (!this.state.crashed) {
1763
- this.setState({ crashed: !0 });
1764
- try {
1765
- this.props.onError?.(e);
1766
- } catch {}
1767
- ut || (ut = !0, console.warn("[CommentKit] The widget stopped after an error and was removed. Your page is not affected.", e)), setTimeout(() => {
1768
- try {
1769
- this.props.onCrash();
1770
- } catch {}
1771
- });
1772
- }
1773
- }
1774
- render() {
1775
- return this.state.crashed ? null : this.props.children;
1776
- }
1777
- }, ft = /* @__PURE__ */ e({
1778
- installDiagnostics: () => N,
1779
- mountWidget: () => lt,
1780
- setLocale: () => v
1781
- });
1782
- //#endregion
1783
- export { z as C, P as S, pe as _, $ as a, J as b, he as c, Z as d, H as f, ne as g, fe as h, ye as i, N as installDiagnostics, Y as l, V as m, lt as mountWidget, we as n, ge as o, X as p, be as r, _e as s, v as setLocale, ft as t, se as u, ue as v, R as w, ie as x, re as y };