@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
@@ -0,0 +1,1113 @@
1
+ import { b as e, v as t } from "./client-kNAo2TTG.js";
2
+ import { s as n } from "./anchor-BsQNVkHj.js";
3
+ import { _ as r, a as i, c as a, d as o, f as s, g as c, i as l, o as u, p as d, u as f, y as p } from "./i18n-DOBt8e9U.js";
4
+ import { r as m } from "./agent-C1OQzBAm.js";
5
+ import { a as h, r as ee } from "./files-DyD5BZgp.js";
6
+ import { i as te, n as ne, r as g, t as re } from "./card-bits-CAnzrqx3.js";
7
+ import { n as ie } from "./drafts-B0ctr1g9.js";
8
+ import { a as _, c as v, f as ae, h as oe, i as y, l as se, m as ce, n as le, t as ue, u as de } from "./uploads-D49mywwz.js";
9
+ import { t as fe } from "./states-sfTbjZz8.js";
10
+ import { n as pe, r as b, t as me } from "./context-B8UAzve0.js";
11
+ import { r as he, t as ge } from "./Checklist-CnlfeSbc.js";
12
+ import { TaskFields as _e } from "./TaskFields-fmy6_HtK.js";
13
+ import { A as ve, C as x, D as ye, E as be, M as S, N as C, O as xe, _ as Se, b as Ce, f as we, g as Te, h as Ee, j as De, n as Oe, o as ke, p as Ae, s as w, v as T, x as E, y as D } from "./start-DtVlpt7p.js";
14
+ // src/ui/StyleChanges.tsx
15
+ function je({ thread: e, element: t, editable: n, onChange: i }, o) {
16
+ let { reportError: l } = b(o), u = r(() => _(e.style_changes), [e.style_changes]), [p, m] = c(!1), [h, ee] = c(!1), te = Te(h, () => import("./StyleEditor-CJ_d8Huf.js").then((e) => e.StyleEditor), l), ne = d(null), g = t instanceof HTMLElement || t instanceof SVGElement ? t : null;
17
+ return s(() => {
18
+ if (!p || !g) return;
19
+ let e = ne.current = new y(g);
20
+ return e.apply(u), () => e.revert();
21
+ }, [
22
+ p,
23
+ g,
24
+ u
25
+ ]), h && g && te ? /* @__PURE__ */ f(te, {
26
+ thread: e,
27
+ element: g,
28
+ onSaved: (e) => i?.(e),
29
+ onClose: () => ee(!1)
30
+ }) : u.length ? /* @__PURE__ */ f("section", {
31
+ class: "ck-style-card",
32
+ "aria-label": a("styleSuggested"),
33
+ children: [/* @__PURE__ */ f("div", {
34
+ class: "ck-style-card-head",
35
+ children: [/* @__PURE__ */ f("span", { children: a("styleSuggested") }), g ? /* @__PURE__ */ f("span", {
36
+ class: "ck-style-card-actions",
37
+ children: [n ? /* @__PURE__ */ f("button", {
38
+ class: "ck-ghost ck-ghost-sm",
39
+ "aria-label": a("styleEdit"),
40
+ onClick: () => {
41
+ ne.current?.revert(), m(!1), ee(!0);
42
+ },
43
+ children: a("edit")
44
+ }) : null, /* @__PURE__ */ f("button", {
45
+ class: "ck-chip",
46
+ "aria-pressed": p,
47
+ onClick: () => m(!p),
48
+ children: a("stylePreview")
49
+ })]
50
+ }) : null]
51
+ }), /* @__PURE__ */ f("ul", { children: u.map((e) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f("code", { children: v(e) }) })) })]
52
+ }) : null;
53
+ }
54
+ // src/ui/ThreadContext.tsx
55
+ function Me({ thread: e, anchor: t, branch: n }) {
56
+ return /* @__PURE__ */ f(p, { children: [
57
+ t === "detached" ? /* @__PURE__ */ f("div", {
58
+ class: "ck-note",
59
+ "data-tone": "warning",
60
+ children: a("detached")
61
+ }) : null,
62
+ t === "moved" ? /* @__PURE__ */ f("p", {
63
+ class: "ck-muted",
64
+ children: a("moved")
65
+ }) : null,
66
+ De(e) ? /* @__PURE__ */ f("p", {
67
+ class: "ck-muted",
68
+ title: `${e.breakpoint}px`,
69
+ children: a(`screen_${C(e.breakpoint)}`)
70
+ }) : null,
71
+ e.page.branch && n ? /* @__PURE__ */ f("p", {
72
+ class: "ck-muted ck-build",
73
+ children: a("leftOnBranch", {
74
+ branch: e.page.branch,
75
+ commit: e.page.commit_sha ? ` @ ${e.page.commit_sha.slice(0, 7)}` : ""
76
+ })
77
+ }) : null,
78
+ e.anchor.quote ? /* @__PURE__ */ f("blockquote", {
79
+ class: "ck-quote",
80
+ "aria-label": a("quotedText"),
81
+ children: /* @__PURE__ */ f("bdi", { children: e.anchor.quote })
82
+ }) : null,
83
+ e.description?.trim() ? /* @__PURE__ */ f("details", {
84
+ class: "ck-description",
85
+ open: e.description.length <= 280,
86
+ children: [/* @__PURE__ */ f("summary", { children: a("description") }), /* @__PURE__ */ f("p", { children: /* @__PURE__ */ f("bdi", { children: e.description }) })]
87
+ }) : null
88
+ ] });
89
+ }
90
+ function Ne({ thread: e }) {
91
+ let [t, n] = c(!1), r = S(e.page.url), i = e.capture?.device, o = e.capture?.viewport, s = [[a("detailCreated"), /* @__PURE__ */ f("time", {
92
+ dateTime: e.created_at,
93
+ children: l(e.created_at)
94
+ })]];
95
+ if (e.resolved_at && e.status === "resolved" && s.push([a("detailResolved"), /* @__PURE__ */ f("time", {
96
+ dateTime: e.resolved_at,
97
+ children: l(e.resolved_at)
98
+ })]), r && s.push([a("detailPage"), /* @__PURE__ */ f("a", {
99
+ href: r,
100
+ target: "_blank",
101
+ rel: "noopener noreferrer",
102
+ children: /* @__PURE__ */ f("bdi", { children: e.page.title || e.page.path })
103
+ })]), i?.browser || i?.os) {
104
+ let e = i.browser && `${i.browser}${i.browser_version ? ` ${i.browser_version.split(".")[0]}` : ""}`, t = i.os && `${i.os}${i.os_version ? ` ${i.os_version}` : ""}`;
105
+ s.push([a("detailBrowser"), /* @__PURE__ */ f("bdi", { children: [e, t].filter(Boolean).join(" · ") })]);
106
+ }
107
+ return o?.width && s.push([a("detailWindow"), /* @__PURE__ */ f("bdi", {
108
+ dir: "ltr",
109
+ children: `${o.width} × ${o.height}`
110
+ })]), /* @__PURE__ */ f("div", {
111
+ class: "ck-details",
112
+ children: [/* @__PURE__ */ f("button", {
113
+ class: "ck-details-toggle",
114
+ "aria-expanded": t,
115
+ "aria-controls": t ? "ck-details" : void 0,
116
+ onClick: () => n(!t),
117
+ children: a("details")
118
+ }), t ? /* @__PURE__ */ f("dl", {
119
+ id: "ck-details",
120
+ children: s.map(([e, t]) => /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("dt", { children: e }), /* @__PURE__ */ f("dd", { children: t })] }))
121
+ }) : null]
122
+ });
123
+ }
124
+ // src/ui/Reactions.tsx
125
+ var O = h.slice(0, 6);
126
+ function k(e) {
127
+ if (!e) return;
128
+ ve(e), e.querySelector("button")?.focus({ preventScroll: !0 });
129
+ let t = e.closest(".ck-card-body")?.getBoundingClientRect();
130
+ t && e.getBoundingClientRect().top < t.top && (e.dataset.below = ""), e.scrollIntoView({ block: "nearest" });
131
+ }
132
+ function A({ reactions: e = [], canWrite: t, picker: n = !0, onReact: r }) {
133
+ let [o, s] = c(!1), l = d(null), u = () => {
134
+ s(!1), (l.current?.firstElementChild)?.focus();
135
+ };
136
+ return T(o, l, () => s(!1)), !e.length && !t ? null : /* @__PURE__ */ f("div", {
137
+ class: "ck-reactions",
138
+ children: [
139
+ e.map((e) => {
140
+ let t = `${i("reactionLabel", e.count, { emoji: e.emoji })}${e.mine ? `, ${a("youReacted")}` : ""}`;
141
+ return /* @__PURE__ */ f("button", {
142
+ class: "ck-reaction",
143
+ "aria-pressed": e.mine,
144
+ "aria-label": t,
145
+ title: t,
146
+ onClick: () => r(e.emoji),
147
+ children: [/* @__PURE__ */ f(E, { char: e.emoji }), /* @__PURE__ */ f("span", { children: e.count })]
148
+ });
149
+ }),
150
+ t && O.filter((t) => !e.some((e) => e.emoji === t)).slice(0, 3).map((e) => /* @__PURE__ */ f("button", {
151
+ class: "ck-reaction ck-reaction-add",
152
+ "aria-label": a("reactWith", { emoji: e }),
153
+ title: a("reactWith", { emoji: e }),
154
+ onClick: () => r(e),
155
+ children: /* @__PURE__ */ f(E, { char: e })
156
+ })),
157
+ t && n ? /* @__PURE__ */ f("span", {
158
+ class: "ck-picker-wrap",
159
+ ref: l,
160
+ children: [/* @__PURE__ */ f("button", {
161
+ class: "ck-reaction ck-reaction-more",
162
+ "aria-label": a("moreReactions"),
163
+ title: a("moreReactions"),
164
+ "aria-haspopup": "true",
165
+ "aria-expanded": o,
166
+ onClick: () => s(!o),
167
+ children: /* @__PURE__ */ f(x, {
168
+ name: "smile",
169
+ size: 14
170
+ })
171
+ }), o ? /* @__PURE__ */ f("div", {
172
+ class: "ck-picker",
173
+ role: "group",
174
+ "aria-label": a("moreReactions"),
175
+ ref: k,
176
+ onKeyDown: (e) => {
177
+ e.key === "Escape" ? (e.stopPropagation(), u()) : Ee(e, "button", !1);
178
+ },
179
+ children: h.map((t) => /* @__PURE__ */ f("button", {
180
+ "aria-pressed": e.some((e) => e.emoji === t && e.mine),
181
+ "aria-label": a("reactWith", { emoji: t }),
182
+ onClick: () => (u(), r(t)),
183
+ children: /* @__PURE__ */ f(E, { char: t })
184
+ }))
185
+ }) : null]
186
+ }) : null
187
+ ]
188
+ });
189
+ }
190
+ // src/ui/ThreadMessage.tsx
191
+ function Pe(e) {
192
+ let { client: t, message: n, first: r, mine: i, edit: o, canWrite: s, simple: c } = e, d = (e) => {
193
+ let t = e.currentTarget.getRootNode().getElementById(`ck-msg-${n.reply_to.id}`);
194
+ t?.scrollIntoView({
195
+ block: "center",
196
+ behavior: Fe() ? "auto" : "smooth"
197
+ }), t?.focus({ preventScroll: !0 });
198
+ }, m = i && !r, h = o ? null : /* @__PURE__ */ f("span", {
199
+ class: "ck-msg-actions",
200
+ children: [
201
+ c ? null : /* @__PURE__ */ f(p, { children: [s ? /* @__PURE__ */ f("button", {
202
+ class: "ck-ghost ck-ghost-sm",
203
+ "aria-label": a("replyTo", { name: n.author.name }),
204
+ title: a("quoteReply"),
205
+ onClick: e.onQuote,
206
+ children: /* @__PURE__ */ f(x, {
207
+ name: "reply",
208
+ size: 14
209
+ })
210
+ }) : null, /* @__PURE__ */ f("button", {
211
+ class: "ck-ghost ck-ghost-sm",
212
+ "aria-label": a("copyText"),
213
+ title: a("copyText"),
214
+ onClick: e.onCopy,
215
+ children: /* @__PURE__ */ f(x, {
216
+ name: "copy",
217
+ size: 14
218
+ })
219
+ })] }),
220
+ s && i ? /* @__PURE__ */ f("button", {
221
+ class: "ck-ghost ck-ghost-sm",
222
+ onClick: e.onEdit,
223
+ children: a("edit")
224
+ }) : null,
225
+ e.canDelete ? /* @__PURE__ */ f("button", {
226
+ class: "ck-ghost ck-ghost-sm ck-danger",
227
+ onClick: e.onDelete,
228
+ children: a("delete")
229
+ }) : null
230
+ ]
231
+ });
232
+ return /* @__PURE__ */ f("div", {
233
+ class: "ck-msg",
234
+ id: `ck-msg-${n.id}`,
235
+ tabIndex: -1,
236
+ "data-mine": i || void 0,
237
+ "data-reply": !r || void 0,
238
+ "data-new": e.fresh || void 0,
239
+ children: [/* @__PURE__ */ f(Ce, { person: n.author }), /* @__PURE__ */ f("div", {
240
+ class: "ck-msg-main",
241
+ children: [
242
+ /* @__PURE__ */ f("div", {
243
+ class: "ck-msg-meta",
244
+ children: [
245
+ m ? h : null,
246
+ /* @__PURE__ */ f("bdi", {
247
+ class: "ck-msg-name",
248
+ children: n.author.name
249
+ }),
250
+ /* @__PURE__ */ f("time", {
251
+ dateTime: n.created_at,
252
+ title: l(n.created_at),
253
+ children: u(n.created_at)
254
+ }),
255
+ n.edited_at ? /* @__PURE__ */ f("span", {
256
+ title: l(n.edited_at),
257
+ children: ["· ", a("edited")]
258
+ }) : null,
259
+ n.visibility === "team" ? /* @__PURE__ */ f("span", {
260
+ class: "ck-team-only",
261
+ children: a("teamOnly")
262
+ }) : null,
263
+ m ? null : h
264
+ ]
265
+ }),
266
+ n.reply_to ? /* @__PURE__ */ f("button", {
267
+ class: "ck-quote ck-quote-msg",
268
+ onClick: d,
269
+ children: [
270
+ /* @__PURE__ */ f("strong", { children: /* @__PURE__ */ f("bdi", { children: n.reply_to.author.name }) }),
271
+ " ",
272
+ /* @__PURE__ */ f("bdi", { children: n.reply_to.excerpt })
273
+ ]
274
+ }) : null,
275
+ o ? /* @__PURE__ */ f("div", {
276
+ class: "ck-msg-edit",
277
+ children: [/* @__PURE__ */ f("div", {
278
+ onKeyDown: (e) => {
279
+ e.key === "Escape" && (e.stopPropagation(), o.onCancel());
280
+ },
281
+ children: /* @__PURE__ */ f(se, {
282
+ client: t,
283
+ value: o.body,
284
+ onChange: o.onChange,
285
+ onMentions: () => void 0,
286
+ onSubmit: o.onSave,
287
+ placeholder: a("edit"),
288
+ autofocus: !0,
289
+ disabled: o.busy,
290
+ canMention: !0
291
+ })
292
+ }), /* @__PURE__ */ f("div", {
293
+ class: "ck-actions",
294
+ children: [/* @__PURE__ */ f("button", {
295
+ class: "ck-btn",
296
+ onClick: o.onCancel,
297
+ children: a("cancel")
298
+ }), /* @__PURE__ */ f("button", {
299
+ class: "ck-btn ck-primary",
300
+ "aria-disabled": o.busy || !o.body.trim() || void 0,
301
+ onClick: () => o.body.trim() && o.onSave(),
302
+ children: o.busy ? a("saving") : a("save")
303
+ })]
304
+ })]
305
+ }) : /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ f("div", {
306
+ class: "ck-msg-body",
307
+ dir: "auto",
308
+ children: /* @__PURE__ */ f(be, {
309
+ text: n.body,
310
+ people: e.people
311
+ })
312
+ }), /* @__PURE__ */ f(M, {
313
+ client: t,
314
+ text: n.body,
315
+ onLoad: e.onImageLoad
316
+ })] }),
317
+ /* @__PURE__ */ f(j, {
318
+ files: n.attachments ?? [],
319
+ shot: r ? e.shot : null,
320
+ onView: e.onView,
321
+ onLoad: e.onImageLoad
322
+ }),
323
+ /* @__PURE__ */ f(A, {
324
+ reactions: n.reactions,
325
+ canWrite: s,
326
+ picker: !c,
327
+ onReact: e.onReact
328
+ }),
329
+ e.alone ? /* @__PURE__ */ f("p", {
330
+ class: "ck-muted ck-no-replies",
331
+ children: a("noReplies")
332
+ }) : null
333
+ ]
334
+ })]
335
+ });
336
+ }
337
+ function Fe() {
338
+ return matchMedia("(prefers-reduced-motion: reduce)").matches;
339
+ }
340
+ function Ie(e) {
341
+ return e.mime.startsWith("image/") && !!(S(e.url, "image") || S(e.thumbnail_url, "image"));
342
+ }
343
+ function j({ files: e, shot: t, onView: n, onLoad: r }) {
344
+ let i = e.filter((e) => e.kind !== "screenshot"), o = i.filter(Ie), s = [...t ? [{
345
+ src: t.src,
346
+ name: t.name,
347
+ href: t.href
348
+ }] : [], ...o.map((e) => ({
349
+ src: S(e.url, "image") ?? S(e.thumbnail_url, "image"),
350
+ name: e.name,
351
+ href: S(e.url)
352
+ }))], c = [...t ? [t.thumb] : [], ...o.map((e) => S(e.thumbnail_url, "image") ?? S(e.url, "image"))], l = i.filter((e) => !Ie(e));
353
+ return /* @__PURE__ */ f(p, { children: [c.length === 1 ? /* @__PURE__ */ f("button", {
354
+ class: "ck-shot",
355
+ "aria-label": a("openImage", { name: s[0].name }),
356
+ onClick: () => n(s, 0),
357
+ children: /* @__PURE__ */ f("img", {
358
+ src: c[0],
359
+ alt: s[0].name,
360
+ loading: "lazy",
361
+ onLoad: r
362
+ })
363
+ }) : c.length ? /* @__PURE__ */ f("div", {
364
+ class: "ck-grid",
365
+ "data-count": Math.min(c.length, 4),
366
+ children: c.slice(0, 4).map((e, t) => /* @__PURE__ */ f("button", {
367
+ class: "ck-grid-item",
368
+ "aria-label": t === 3 && c.length > 4 ? a("openImageMore", {
369
+ name: s[t].name,
370
+ n: c.length - 4
371
+ }) : a("openImage", { name: s[t].name }),
372
+ onClick: () => n(s, t),
373
+ children: [/* @__PURE__ */ f("img", {
374
+ src: e,
375
+ alt: s[t].name,
376
+ loading: "lazy",
377
+ onLoad: r
378
+ }), t === 3 && c.length > 4 ? /* @__PURE__ */ f("span", {
379
+ class: "ck-grid-more",
380
+ "aria-hidden": "true",
381
+ children: ["+", c.length - 4]
382
+ }) : null]
383
+ }))
384
+ }) : null, l.length ? /* @__PURE__ */ f("div", {
385
+ class: "ck-files",
386
+ children: l.map((e) => {
387
+ let t = S(e.url);
388
+ return t ? /* @__PURE__ */ f("a", {
389
+ class: "ck-file",
390
+ href: t,
391
+ target: "_blank",
392
+ rel: "noopener noreferrer",
393
+ children: /* @__PURE__ */ f("bdi", { children: e.name })
394
+ }) : /* @__PURE__ */ f("span", {
395
+ class: "ck-file",
396
+ children: /* @__PURE__ */ f("bdi", { children: e.name })
397
+ });
398
+ })
399
+ }) : null] });
400
+ }
401
+ function M({ client: e, text: t, onLoad: n }) {
402
+ let i = r(() => [...new Set([...t.matchAll(/https?:\/\/[^\s<>"')​-‏‪-‮⁠-⁩]+/g)].map((e) => S(e[0])).filter((e) => !!e))].slice(0, 2), [t]), [a, s] = c([]);
403
+ return o(() => {
404
+ let t = !0;
405
+ return s([]), i.length && Promise.all(i.map((t) => e.linkPreview(t))).then((e) => t && s(e.filter((e) => !!e))), () => {
406
+ t = !1;
407
+ };
408
+ }, [i.join(" ")]), o(() => void (a.length && n()), [a]), a.length ? /* @__PURE__ */ f("div", {
409
+ class: "ck-previews",
410
+ children: a.map((e) => {
411
+ let t = S(e.url);
412
+ return t ? /* @__PURE__ */ f("a", {
413
+ class: "ck-preview",
414
+ href: t,
415
+ target: "_blank",
416
+ rel: "noopener noreferrer nofollow ugc",
417
+ children: [
418
+ /* @__PURE__ */ f("span", {
419
+ class: "ck-preview-site",
420
+ children: /* @__PURE__ */ f("bdi", { children: e.site })
421
+ }),
422
+ /* @__PURE__ */ f("strong", {
423
+ title: e.title,
424
+ children: /* @__PURE__ */ f("bdi", { children: e.title })
425
+ }),
426
+ e.description ? /* @__PURE__ */ f("span", {
427
+ class: "ck-preview-text",
428
+ children: /* @__PURE__ */ f("bdi", { children: e.description })
429
+ }) : null
430
+ ]
431
+ }) : null;
432
+ })
433
+ }) : null;
434
+ }
435
+ w(fe), w(".ck-msg-actions .ck-ghost{place-items:center;min-width:24px;display:inline-grid}.ck-msg-body .ck-pre code{box-shadow:none;font-size:var(--ck-fs-sm);background:0 0;padding:0;line-height:1.55}.ck-reaction .ck-emoji{vertical-align:-2px;width:14px;height:14px}.ck-msg-skeleton .ck-skeleton:not(.ck-skeleton-avatar){margin:4px 0 12px}.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-thread-head{position:relative}.ck-thread-head .ck-card-title:focus-visible{outline:none}.ck-thread-head .ck-menu{right:auto}.ck-thread-head .ck-menu:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:8px}.ck-thread-head .ck-menu:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:8px}.ck-thread-head .ck-menu:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:8px}.ck-thread-head .ck-menu:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:8px}.ck-reply-foot{flex-direction:column;align-items:stretch;position:relative}.ck-reply-foot .ck-actions,.ck-reply-foot .ck-note{margin-top:0}.ck-card-body>.ck-note:first-child{margin:0 0 8px}.ck-card-embedded{width:auto;height:100%;max-height:none;box-shadow:none;animation:ck-slide-in var(--ck-dur) var(--ck-ease);border:0;border-radius:0;flex-direction:column;display:flex;position:static;top:auto;bottom:auto;left:auto;right:auto}.ck-card-embedded .ck-card-body{flex:1;min-height:0}.ck-back svg{scale:-1 1}.ck-root[dir=rtl] .ck-back svg{scale:1}.ck-step svg{rotate:-90deg}.ck-step[data-dir=next] svg{rotate:90deg}.ck-card-pos{font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;white-space:nowrap}.ck-thread-head .ck-card-title{min-width:4.5em}.ck-thread-head .ck-status{text-overflow:ellipsis;min-width:0;display:block;overflow:hidden}.ck-thread-head .ck-status:before{vertical-align:1px;margin-inline-end:6px;display:inline-block}@media (max-width:520px){.ck-thread-head .ck-card-pos{display:none}}@keyframes ck-slide-in{0%{opacity:0;translate:24px}}.ck-root[dir=rtl] .ck-card-embedded{animation-name:ck-slide-in-rtl}@keyframes ck-slide-in-rtl{0%{opacity:0;translate:-24px}}.ck-thread-skeleton{gap:12px;display:grid}.ck-skeleton-meta{width:40%;height:10px}.ck-msg-skeleton{gap:8px;display:flex}.ck-msg-skeleton>div{flex:1}.ck-msg-skeleton .ck-skeleton.ck-skeleton-avatar{border-radius:50%;flex:none;width:28px;height:28px;margin:0;display:block}.ck-thread-skeleton .ck-msg-skeleton:nth-child(3){opacity:.7}.ck-thread-skeleton .ck-msg-skeleton:nth-child(4){opacity:.45}.ck-build{overflow-wrap:anywhere}.ck-description{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);font-size:var(--ck-fs-md);margin:0 0 8px;padding:8px 12px}.ck-description summary{cursor:pointer;color:var(--ck-text-muted);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-xs);font-weight:600}.ck-description p{white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty;max-height:240px;margin:4px 0 0;overflow:auto}.ck-details{font-size:var(--ck-fs-sm);margin:0 0 8px}.ck-details-toggle{min-height:24px;color:var(--ck-text-muted);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-xs);transition:color var(--ck-fast);background:0 0;border:0;align-items:center;gap:8px;margin-inline-start:-4px;padding:0 4px;font-weight:600;display:inline-flex}.ck-details-toggle:after{content:\"\";width:5px;height:5px;transition:transform var(--ck-dur) var(--ck-ease);border-bottom:1.5px solid;border-right:1.5px solid;transform:rotate(45deg)translateY(-2px)}.ck-details-toggle[aria-expanded=true]:after{transform:rotate(225deg)translate(-1px,-1px)}.ck-details dl{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);grid-template-columns:max-content minmax(0,1fr);gap:4px 12px;margin:4px 0 0;padding:8px 12px;display:grid}.ck-details dl>div{display:contents}.ck-details dt{color:var(--ck-text-muted)}.ck-details dd{overflow-wrap:anywhere;font-variant-numeric:tabular-nums;min-width:0;margin:0}.ck-details a{color:inherit;text-underline-offset:2px}.ck-review-ask{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);background:color-mix(in srgb, var(--ck-review) 14%, var(--ck-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ck-review) 30%, transparent);text-wrap:pretty;margin-bottom:12px;padding:12px}.ck-review-ask .ck-actions{margin-top:8px}.ck-extra{gap:8px;margin:0 0 12px;display:grid}.ck-extra>.ck-extra-add{gap:8px;margin:0;display:flex}.ck-extra>.ck-extra-add .ck-ghost{padding:4px 8px}.ck-checklist{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);padding:8px 12px}.ck-checklist-head{font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;align-items:center;gap:8px;display:flex}.ck-checklist-bar{border-radius:var(--ck-radius-pill);background:var(--ck-border);flex:1;height:4px;overflow:hidden}.ck-checklist-bar>span{background:var(--ck-success);transform-origin:0;height:100%;transition:scale var(--ck-dur) var(--ck-ease);display:block}.ck-root[dir=rtl] .ck-checklist-bar>span{transform-origin:100%}.ck-checklist ul{gap:4px;margin:8px 0 0;padding:0;list-style:none;display:grid}.ck-checklist li{align-items:flex-start;gap:4px;display:flex}.ck-checklist li .ck-check{min-width:0;font-size:var(--ck-fs-md);overflow-wrap:anywhere;flex:1;margin:0;padding:2px 0}.ck-checklist li .ck-check:has(input:disabled){cursor:default}.ck-checklist li[data-done] bdi{color:var(--ck-text-muted);text-decoration:line-through}.ck-checklist li .ck-ghost{opacity:0;width:24px;min-width:0;height:24px;min-height:0;transition:opacity var(--ck-fast), background-color var(--ck-fast), color var(--ck-fast);flex:none;place-items:center;padding:0;display:grid}.ck-checklist li:hover .ck-ghost,.ck-checklist li:focus-within .ck-ghost{opacity:1}.ck-checklist-add{align-items:center;gap:4px;display:flex}.ck-checklist-add .ck-input{min-width:0;height:32px;font-size:var(--ck-fs-md);flex:1}.ck-checklist-add .ck-ghost{flex:none;justify-content:center;width:32px;height:32px;padding:0}.ck-msg{gap:8px;padding:4px 0;display:flex}.ck-msg+.ck-msg{border-top:1px solid var(--ck-hairline);padding-top:12px}.ck-msg+.ck-msg[data-reply]{border-top:0;padding-top:8px}.ck-msg-main{flex:1;min-width:0}.ck-msg-meta{font-size:var(--ck-fs-sm);color:var(--ck-text-muted);flex-wrap:wrap;align-items:baseline;gap:4px 8px;display:flex}.ck-msg-meta .ck-msg-name{overflow-wrap:anywhere;min-width:0}.ck-msg-meta time{cursor:default;font-variant-numeric:tabular-nums}.ck-team-only{border-radius:var(--ck-radius-pill);background:color-mix(in srgb, var(--ck-accent) 12%, transparent);color:var(--ck-text);font-size:var(--ck-fs-2xs);padding:0 6px;font-weight:600}.ck-msg-actions{opacity:0;transition:opacity var(--ck-fast);gap:4px;margin-inline-start:auto;display:inline-flex}.ck-msg:hover .ck-msg-actions,.ck-msg:focus-within .ck-msg-actions{opacity:1}.ck-msg-body{white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty;margin-top:2px;line-height:1.5}.ck-msg-body a{color:var(--ck-accent-text);text-underline-offset:2px}.ck-msg-body code{font-family:var(--ck-mono);font-size:var(--ck-fs-sm);border-radius:var(--ck-radius-xs);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);padding:0 4px}.ck-msg-body s{color:var(--ck-text-muted)}.ck-msg[data-reply] .ck-msg-body{border-radius:var(--ck-radius);background:var(--ck-bg-muted);max-width:100%;padding:4px 12px;display:inline-block}.ck-msg[data-reply] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius-xs)}.ck-msg[data-reply] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius-xs)}.ck-msg[data-reply] .ck-msg-body:-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)){border-top-right-radius:var(--ck-radius-xs)}.ck-msg[data-reply] .ck-msg-body: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)){border-top-right-radius:var(--ck-radius-xs)}.ck-msg[data-reply] .ck-msg-body code{background:var(--ck-bg)}.ck-msg[data-reply][data-mine]{flex-direction:row-reverse}.ck-msg[data-reply][data-mine] .ck-msg-main{flex-direction:column;align-items:flex-end;display:flex}.ck-msg[data-reply][data-mine] .ck-msg-meta{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-actions{margin-inline-start:0;margin-inline-end:auto}.ck-msg[data-mine] .ck-msg-edit .ck-actions{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-body{background:var(--ck-accent-soft)}.ck-msg[data-reply][data-mine] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius);border-top-right-radius:var(--ck-radius-xs)}.ck-msg[data-reply][data-mine] .ck-msg-body: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))){border-top-left-radius:var(--ck-radius);border-top-right-radius:var(--ck-radius-xs)}.ck-msg[data-reply][data-mine] .ck-msg-body:-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)){border-top-right-radius:var(--ck-radius);border-top-left-radius:var(--ck-radius-xs)}.ck-msg[data-reply][data-mine] .ck-msg-body: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)){border-top-right-radius:var(--ck-radius);border-top-left-radius:var(--ck-radius-xs)}.ck-msg[data-reply][data-mine] .ck-reactions{justify-content:flex-end}.ck-msg[data-reply][data-mine] .ck-msg-body .ck-pre{text-align:start}.ck-msg[data-new]{animation:ck-reply-in var(--ck-dur) var(--ck-ease)}@keyframes ck-reply-in{0%{opacity:0;translate:0 8px}}.ck-msg-edit{width:100%}.ck-quote-msg{border-top:0;border-bottom:0;text-align:start;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:color var(--ck-fast);border-inline-end:0;margin:4px 0 8px;overflow:hidden}.ck-quote-msg strong,.ck-quoting strong{color:var(--ck-text);font-weight:600}.ck-no-replies{font-size:var(--ck-fs-sm);text-wrap:pretty;margin:8px 0 0}.ck-card-body>p.ck-muted{text-wrap:pretty}.ck-msg:focus-visible{outline-offset:2px;border-radius:var(--ck-radius-xs)}.ck-card-body>.ck-task{padding:0 0 12px}.ck-card .ck-btn[aria-disabled=true]{opacity:.5;cursor:default}button.ck-shot{cursor:zoom-in;text-align:start;background:0 0;border:0;width:100%;padding:0;display:block}button.ck-shot:focus-visible{outline-offset:2px}.ck-grid{border-radius:var(--ck-radius-md);grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin-top:8px;display:grid;overflow:hidden}.ck-grid[data-count=\"3\"] .ck-grid-item:first-child{aspect-ratio:auto;grid-row:span 2}.ck-grid-item{aspect-ratio:4/3;background:var(--ck-bg-muted);cursor:zoom-in;border:0;padding:0;position:relative;overflow:hidden}.ck-grid-item:focus-visible{outline-offset:-2px;z-index:1}.ck-grid-item img{object-fit:cover;outline:1px solid var(--ck-img-outline);outline-offset:-1px;width:100%;height:100%;transition:scale var(--ck-dur) var(--ck-ease);display:block}.ck-grid-more{color:#fff;font-size:var(--ck-fs-xl);font-variant-numeric:tabular-nums;background:#1213168c;place-items:center;font-weight:700;display:grid;position:absolute;top:0;bottom:0;left:0;right:0}.ck-msg .ck-file{color:var(--ck-text);overflow-wrap:anywhere;transition:background-color var(--ck-fast);text-decoration:none}.ck-previews{gap:8px;margin-top:8px;display:grid}.ck-preview{padding:8px 12px;border-inline-start:3px solid var(--ck-border);border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);color:var(--ck-text);font-size:var(--ck-fs-sm);transition:background-color var(--ck-fast);gap:4px;padding-inline-start:9px;text-decoration:none;display:grid}.ck-preview>*{min-width:0}.ck-preview strong{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.ck-preview-site{color:var(--ck-text-muted);font-size:var(--ck-fs-xs);overflow-wrap:anywhere}.ck-preview-text{color:var(--ck-text-muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ck-reactions{flex-wrap:wrap;gap:4px;margin-top:8px;display:flex}.ck-reaction{border-radius:var(--ck-radius-pill);border:1px solid var(--ck-border);background:var(--ck-bg);min-width:32px;height:24px;color:var(--ck-text);font-size:var(--ck-fs-sm);font-variant-numeric:tabular-nums;transition:background-color var(--ck-fast), border-color var(--ck-fast), color var(--ck-fast), scale var(--ck-fast) ease-out;justify-content:center;align-items:center;gap:4px;padding:0 8px;display:inline-flex}.ck-reaction:active{scale:.96}.ck-reaction[aria-pressed=true]{border-color:var(--ck-accent-text);background:var(--ck-accent-soft)}.ck-reaction .ck-emoji{margin:0}.ck-reaction-add{opacity:.55;transition:opacity var(--ck-fast), background-color var(--ck-fast)}.ck-reaction-add:focus-visible{opacity:1}.ck-picker-wrap{display:inline-flex;position:relative}.ck-reaction-more{color:var(--ck-text-muted);padding:0}.ck-picker{z-index:4;bottom:calc(100% + 8px);background:var(--ck-bg);border-radius:var(--ck-radius-md);box-shadow:var(--ck-shadow);animation:ck-pop var(--ck-fast) var(--ck-ease);border:1px solid #0000;grid-template-columns:repeat(8,32px);gap:4px;padding:4px;display:grid;position:absolute}.ck-picker:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-picker:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:0}.ck-picker:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-picker:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:0}.ck-picker[data-below]{top:calc(100% + 8px);bottom:auto}.ck-picker button{border-radius:var(--ck-radius-xs);width:32px;height:32px;font-size:var(--ck-fs-lg);transition:background-color var(--ck-fast), scale var(--ck-fast) ease-out;background:0 0;border:0;place-items:center;padding:0;display:grid}.ck-picker button[aria-pressed=true]{background:var(--ck-accent-soft)}.ck-picker button:active{scale:.96}.ck-picker .ck-emoji{width:20px;height:20px;margin:0}@media (max-width:520px){.ck-picker{grid-template-columns:repeat(6,36px)}.ck-picker button{width:36px;height:36px}}.ck-quoting{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);border-inline-start:3px solid var(--ck-accent-text);font-size:var(--ck-fs-sm);color:var(--ck-text-muted);align-items:center;gap:8px;margin-bottom:8px;padding:4px;padding-inline-start:5px;display:flex}.ck-quoting>svg{flex:none}.ck-quoting>span{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.ck-quoting .ck-ghost{flex:none;place-items:center;min-width:24px;padding:0;display:grid}.ck-jump{box-shadow:var(--ck-shadow-sm);animation:ck-pop var(--ck-fast) var(--ck-ease);z-index:1;position:absolute;bottom:calc(100% + 8px);left:50%;translate:-50%}.ck-mention-card{z-index:5;background:var(--ck-bg);border-radius:var(--ck-radius-md);max-width:240px;box-shadow:var(--ck-shadow);pointer-events:none;animation:ck-fade var(--ck-fast) ease-out;font-size:var(--ck-fs-md);border:1px solid #0000;align-items:center;gap:8px;padding:4px;padding-inline-end:12px;display:flex;position:fixed}.ck-mention-card .ck-avatar{--ck-av:24px}.ck-mention-card .ck-msg-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}@media (hover:hover){.ck-reaction:hover{background:var(--ck-bg-muted)}.ck-reaction-add:hover{opacity:1}.ck-reaction-more:hover{color:var(--ck-text)}.ck-picker button:hover{background:var(--ck-bg-hover)}.ck-quote-msg:hover,.ck-details-toggle:hover{color:var(--ck-text)}.ck-grid-item:hover img,button.ck-shot:hover img{scale:1.02}.ck-preview:hover,.ck-msg a.ck-file:hover{background:var(--ck-bg-hover)}}@media (forced-colors:active){.ck-reaction[aria-pressed=true],.ck-picker button[aria-pressed=true]{color:highlighttext;background:highlight}}@media (hover:none){.ck-msg-actions,.ck-checklist li .ck-ghost{opacity:1}}@media (pointer:coarse){.ck-reaction,.ck-msg-actions .ck-ghost,.ck-quoting .ck-ghost,.ck-checklist li .ck-ghost,.ck-details-toggle,.ck-extra>.ck-extra-add .ck-ghost{min-width:44px;min-height:44px}.ck-checklist li{align-items:center}.ck-checklist-add .ck-input{height:44px;font-size:var(--ck-fs-lg)}.ck-picker{grid-template-columns:repeat(6,44px)}.ck-picker button{width:44px;height:44px}}");
436
+ function Le(e, t) {
437
+ return !!t && e.id !== null && e.id === t.person.id && e.type === t.person.type;
438
+ }
439
+ function Re(e, t) {
440
+ let n = /* @__PURE__ */ new Set(), r = [...new Set(t)].filter(Boolean).sort((e, t) => t.length - e.length);
441
+ if (!r.length) return n;
442
+ let i = r.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), a = RegExp(`(?:^|[\\s(\\[])@(${i.join("|")})(?![\\p{L}\\p{N}_-])`, "gu");
443
+ for (let t of e.matchAll(a)) n.add(t[1]);
444
+ return n;
445
+ }
446
+ var ze = /* @__PURE__ */ new Map();
447
+ function Be({ client: i, threadId: l, version: u = 0, onClose: h, onError: _, notify: v, embedded: y, onMovePin: fe }) {
448
+ let b = D(i.state, (e) => e.session), ve = D(i.state, (e) => e.config?.read_only ?? !1), be = D(i.state, (e) => e.config?.limits?.upload_types), C = Se(), De = d(null), w = D(i.state, (e) => e.threads.find((e) => e.id === l) ?? null), [T, E] = c(w), [O, k] = c([]), [A, Ie] = c(null), j = ie(i.options.project, "reply", l), [M, Be] = c(() => ce(j)), He = (e) => {
449
+ e !== M && (F.current = null), Be(e), oe(j, e);
450
+ }, N = le(i, (e) => _(new t(0, "file_rejected", e))), [Ue, We] = c(null), Ge = Te(Ue, () => import("./Viewer-BOBadqmC.js").then((e) => e.Viewer), _), Ke = (e, t) => We({
451
+ images: e,
452
+ start: t
453
+ }), qe = d(null), [Je, Ye] = c([]), [P, Xe] = c(!1), [Ze, Qe] = c(!1), F = d(null), [I, $e] = c(!1), et = d(null), tt = d(null);
454
+ s(() => {
455
+ I && tt.current?.querySelector("[role=menuitem]")?.focus();
456
+ }, [I]);
457
+ let nt = () => {
458
+ $e(!1), et.current?.focus();
459
+ }, [L, R] = c(null), [z, B] = c(null), [rt, V] = c(!1), it = d(0), [H, at] = c([]), ot = r(() => H.map((e) => e.name), [H]), [U, W] = c(null), st = d(/* @__PURE__ */ new Set()), [ct, lt] = c(!1), [ut, dt] = c(!0), ft = d(null), pt = (e = !1) => ft.current?.scrollTo({
460
+ top: ft.current.scrollHeight,
461
+ behavior: e && !Fe() ? "smooth" : "auto"
462
+ });
463
+ o(() => {
464
+ rt || pt();
465
+ }, [O.length]);
466
+ let mt = () => !rt && pt();
467
+ o(() => {
468
+ b && de(i).then(at);
469
+ }, [b?.person.id]);
470
+ let G = d(l);
471
+ G.current = l;
472
+ let K = d(null), ht = (e) => {
473
+ K.current?.(), K.current = null;
474
+ let t = () => {
475
+ G.current === e && i.state.get().unread > 0 && i.markRead({ threadId: e }).catch(() => void 0);
476
+ };
477
+ if (i.inboxLoaded || i.state.get().unread > 0) return t();
478
+ let n = i.state.subscribe(() => {
479
+ i.inboxLoaded && (n(), K.current = null, t());
480
+ });
481
+ K.current = n;
482
+ };
483
+ o(() => () => K.current?.(), []);
484
+ let q = async (e = !1) => {
485
+ let n = l;
486
+ try {
487
+ let [t, r] = await Promise.all([i.getThread(n), i.allMessages(n, { refresh: e })]);
488
+ if (G.current !== n) return;
489
+ E(t), st.current.size || r.forEach((e) => st.current.add(e.id)), k(r), !ze.has(n) && typeof t.watching == "boolean" && dt(t.watching), ht(n);
490
+ } catch (e) {
491
+ if (G.current !== n) return;
492
+ let r = e instanceof t && (e.status === 404 || e.status === 403);
493
+ if (w && !r) {
494
+ _(e);
495
+ return;
496
+ }
497
+ if (w) {
498
+ _(new t(404, "thread_not_found", a("threadNotFound"))), h();
499
+ return;
500
+ }
501
+ Ie({
502
+ gone: r,
503
+ text: r ? a("threadNotFound") : we(e)
504
+ });
505
+ }
506
+ };
507
+ s(() => {
508
+ E(w), k([]), Be(ce(j)), N.clear(), B(null), V(!1), W(null), st.current = /* @__PURE__ */ new Set(), lt(!1), Qe(!1), F.current = null, dt(ze.get(l) ?? w?.watching ?? !0), q();
509
+ }, [l]), o(() => {
510
+ w && T && w.updated_at !== T.updated_at && q(!0);
511
+ }, [w?.updated_at]);
512
+ let gt = d(u);
513
+ o(() => {
514
+ u !== gt.current && (gt.current = u, q(!0));
515
+ }, [u]);
516
+ let J = r(() => T ? n(T.anchor) : null, [T]);
517
+ o(() => {
518
+ !y && J?.element && J.state !== "detached" && J.element.scrollIntoView({
519
+ block: "center",
520
+ behavior: Fe() ? "auto" : "smooth"
521
+ });
522
+ }, [J?.element]), o(() => {
523
+ T && De.current?.focus({ preventScroll: !0 });
524
+ }, [T?.id]);
525
+ let Y = () => Oe(i);
526
+ if (s(() => {
527
+ let e = (e) => {
528
+ if (y && (e.key === "j" || e.key === "k") && !e.metaKey && !e.ctrlKey && !e.altKey && Y() && Ae(e)) {
529
+ let t = e.key === "j" ? y.onNext : y.onPrev;
530
+ t && (e.preventDefault(), t());
531
+ } else e.key !== "e" && e.key !== "E" || e.metaKey || e.ctrlKey || e.altKey || !T || !Y() || Ae(e) && b?.capabilities.comment && !ve && T.status !== "resolved" && (e.preventDefault(), $("resolved"));
532
+ };
533
+ return addEventListener("keydown", e), () => removeEventListener("keydown", e);
534
+ }), !T) return /* @__PURE__ */ f("div", {
535
+ class: y ? "ck-card ck-card-embedded" : "ck-card",
536
+ style: y ? void 0 : g({
537
+ x: innerWidth - 400,
538
+ y: 80
539
+ }),
540
+ role: "region",
541
+ "aria-label": a("loadingThread"),
542
+ "aria-busy": !A,
543
+ "data-commentkit-ui": !0,
544
+ children: [/* @__PURE__ */ f("div", {
545
+ class: "ck-card-head",
546
+ children: [
547
+ y ? /* @__PURE__ */ f("button", {
548
+ class: "ck-ghost ck-back",
549
+ "aria-label": a("backToList"),
550
+ onClick: y.onBack,
551
+ children: /* @__PURE__ */ f(x, {
552
+ name: "chevron",
553
+ size: 16
554
+ })
555
+ }) : null,
556
+ /* @__PURE__ */ f("span", {
557
+ class: "ck-card-title",
558
+ children: A ? "" : a("loadingThread")
559
+ }),
560
+ /* @__PURE__ */ f("button", {
561
+ class: "ck-ghost",
562
+ "aria-label": a("close"),
563
+ onClick: y ? y.onBack : h,
564
+ children: /* @__PURE__ */ f(x, { name: "close" })
565
+ })
566
+ ]
567
+ }), A ? /* @__PURE__ */ f("div", {
568
+ class: "ck-card-body ck-empty",
569
+ role: "alert",
570
+ children: [
571
+ /* @__PURE__ */ f(he, { name: A.gone ? "gone" : "error" }),
572
+ /* @__PURE__ */ f("span", { children: A.text }),
573
+ /* @__PURE__ */ f("button", {
574
+ class: "ck-btn",
575
+ onClick: A.gone ? h : () => {
576
+ Ie(null), q();
577
+ },
578
+ children: a(A.gone ? "close" : "retry")
579
+ })
580
+ ]
581
+ }) : /* @__PURE__ */ f("div", {
582
+ class: "ck-card-body ck-thread-skeleton",
583
+ children: [/* @__PURE__ */ f("div", { class: "ck-skeleton ck-skeleton-meta" }), [
584
+ 0,
585
+ 1,
586
+ 2
587
+ ].map(() => /* @__PURE__ */ f("div", {
588
+ class: "ck-msg-skeleton",
589
+ children: [/* @__PURE__ */ f("span", { class: "ck-skeleton ck-skeleton-avatar" }), /* @__PURE__ */ f("div", { children: [
590
+ /* @__PURE__ */ f("div", { class: "ck-skeleton" }),
591
+ /* @__PURE__ */ f("div", { class: "ck-skeleton" }),
592
+ /* @__PURE__ */ f("div", { class: "ck-skeleton" })
593
+ ] })]
594
+ }))]
595
+ })]
596
+ });
597
+ let X = b?.capabilities, Z = !!X?.triage, Q = !!X?.comment && !ve, _t = i.options.tools?.attachments !== !1, vt = b && T.author.id === b.person.id && T.author.type === (b.person.type === "guest" ? "guest" : "user"), yt = J ? {
598
+ x: J.point.x - scrollX,
599
+ y: J.point.y - scrollY
600
+ } : {
601
+ x: innerWidth - 400,
602
+ y: 80
603
+ }, bt = g({
604
+ x: Math.min(Math.max(yt.x, 0), innerWidth),
605
+ y: Math.min(Math.max(yt.y, 0), innerHeight - 40)
606
+ }), xt = Z ? T.reference : a("feedbackRef", { ref: T.reference }), St = (e) => {
607
+ if (!(e instanceof t && e.status === 412)) return _(e);
608
+ R(null), v({
609
+ text: a("editConflict"),
610
+ tone: "info"
611
+ }), q();
612
+ }, Ct = (e) => G.current === e.id && E(e), $ = async (e) => {
613
+ let t = T;
614
+ try {
615
+ Ct(await i.updateThread(T.id, { status: e })), e === "resolved" && import("./confetti-CkBdSu19.js").then((e) => e.celebrate(ft.current)).catch(() => void 0), e === "resolved" ? v({
616
+ text: a("resolvedToast", { ref: T.reference }),
617
+ tone: "success",
618
+ action: {
619
+ label: a("undo"),
620
+ run: () => void te(i, t, v, _).then((e) => e && G.current === e.id && E(e))
621
+ }
622
+ }) : e === "open" && (t.status === "resolved" || t.status === "closed") && v({
623
+ text: a("reopenedToast", { ref: T.reference }),
624
+ tone: "info"
625
+ });
626
+ } catch (e) {
627
+ St(e);
628
+ }
629
+ }, wt = () => i.watch(T.id, !ut).then((e) => {
630
+ let t = e?.watching ?? !ut;
631
+ ze.set(T.id, t), G.current === T.id && dt(t), v({ text: a(t ? "followed" : "muted", { ref: T.reference }) });
632
+ }, _), Tt = () => {
633
+ if (!L || P) return;
634
+ Xe(!0);
635
+ let e = Re(L.body, H.map((e) => e.name)), t = H.filter((t) => /^\d+$/.test(t.id ?? "") && e.has(t.name)).map((e) => Number(e.id));
636
+ i.editMessage(L.id, L.body, ...t.length ? [{ mentionIds: t }] : []).then((e) => {
637
+ k((t) => t.map((t) => t.id === e.id ? e : t)), R(null), v({
638
+ text: a("editedToast"),
639
+ tone: "success"
640
+ }), e.id === O[0]?.id && i.refreshThread(T.id);
641
+ }, St).finally(() => Xe(!1));
642
+ }, Et = async () => {
643
+ if (M.trim() && !P && C) {
644
+ Xe(!0), Qe(!1);
645
+ try {
646
+ let t = await N.ready(), n = t.ids;
647
+ t.missing && v({
648
+ text: a("sentWithoutFiles"),
649
+ tone: "info"
650
+ });
651
+ let r = await i.reply(T.id, M.trim(), {
652
+ replyTo: z?.id ?? null,
653
+ mentionIds: Je,
654
+ attachmentIds: n,
655
+ idempotencyKey: F.current ?? (F.current = e(16))
656
+ });
657
+ if (F.current = null, ae(j), G.current !== T.id) return;
658
+ k((e) => e.some((e) => e.id === r.id) ? e : [...e, r]), B(null), V(!1), Be(""), N.clear(), (T.status === "resolved" || T.status === "closed") && E({
659
+ ...T,
660
+ status: "open"
661
+ });
662
+ } catch (e) {
663
+ Qe(ne(e) ?? !0);
664
+ } finally {
665
+ Xe(!1);
666
+ }
667
+ }
668
+ }, Dt = async (e, t) => {
669
+ let n = e.reactions?.find((e) => e.emoji === t)?.mine ?? !1, r = (e) => {
670
+ let r = (e.reactions ?? []).map((e) => e.emoji === t ? {
671
+ ...e,
672
+ count: e.count + (n ? -1 : 1),
673
+ mine: !n
674
+ } : e).filter((e) => e.count > 0);
675
+ return !n && !r.some((e) => e.emoji === t) && r.push({
676
+ emoji: t,
677
+ count: 1,
678
+ mine: !0
679
+ }), {
680
+ ...e,
681
+ reactions: r
682
+ };
683
+ };
684
+ k(O.map((t) => t.id === e.id ? r(t) : t));
685
+ try {
686
+ await i.react(e.id, t, !n);
687
+ } catch (e) {
688
+ _(e), q();
689
+ }
690
+ }, Ot = (e) => N.add(e), kt = (e) => {
691
+ let t = O.findIndex((t) => t.id === e.id);
692
+ k((t) => t.filter((t) => t.id !== e.id)), De.current?.focus({ preventScroll: !0 }), v({
693
+ text: a("replyDeleted"),
694
+ action: {
695
+ label: a("undo"),
696
+ run: () => G.current === T.id && k((n) => n.some((t) => t.id === e.id) ? n : [
697
+ ...n.slice(0, t),
698
+ e,
699
+ ...n.slice(t)
700
+ ])
701
+ },
702
+ expires: Ve,
703
+ onExpire: () => void i.deleteMessage(e.id).then(() => i.refreshThread(T.id), (e) => {
704
+ _(e), G.current === T.id && q();
705
+ })
706
+ });
707
+ }, At = () => {
708
+ let e = i.state.get().threads;
709
+ i.state.set((e) => ({ threads: e.threads.filter((e) => e.id !== T.id) })), h(), v({
710
+ text: a("threadDeleted", { ref: T.reference }),
711
+ action: {
712
+ label: a("undo"),
713
+ run: () => i.state.set((t) => ({ threads: t.threads.some((e) => e.id === T.id) ? t.threads : e.filter((e) => e.id === T.id).concat(t.threads) }))
714
+ },
715
+ expires: Ve,
716
+ onExpire: () => void i.deleteThread(T.id).catch((e) => {
717
+ _(e), i.refreshThread(T.id);
718
+ })
719
+ });
720
+ }, jt = async (e, t) => {
721
+ try {
722
+ await navigator.clipboard.writeText(e), v({ text: t });
723
+ } catch {
724
+ _(Error(a("errorGeneric")));
725
+ }
726
+ }, Mt = (() => {
727
+ let e = S(T.page.url);
728
+ return e ? ke(e, T.id) : "";
729
+ })(), Nt = S(T.capture?.screenshot?.thumbnail_url, "image"), Pt = S(T.capture?.screenshot?.url), Ft = Nt ? {
730
+ thumb: Nt,
731
+ src: Pt ?? Nt,
732
+ href: Pt,
733
+ name: a("screenshot")
734
+ } : null, It = T.status === "resolved" || T.status === "closed";
735
+ return /* @__PURE__ */ f(me, {
736
+ value: pe(i, v, St, b),
737
+ children: /* @__PURE__ */ f("div", {
738
+ class: y ? "ck-card ck-card-embedded" : "ck-card",
739
+ style: y ? void 0 : bt,
740
+ role: "region",
741
+ "aria-label": xt,
742
+ "data-commentkit-ui": !0,
743
+ onKeyDown: y ? (e) => e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), y.onBack()) : void 0,
744
+ children: [
745
+ /* @__PURE__ */ f("div", {
746
+ class: "ck-card-head ck-thread-head",
747
+ ref: tt,
748
+ children: [
749
+ y ? /* @__PURE__ */ f("button", {
750
+ class: "ck-ghost ck-back",
751
+ "aria-label": a("backToList"),
752
+ title: a("backToList"),
753
+ onClick: y.onBack,
754
+ children: /* @__PURE__ */ f(x, {
755
+ name: "chevron",
756
+ size: 16
757
+ })
758
+ }) : null,
759
+ /* @__PURE__ */ f("span", {
760
+ class: "ck-card-title",
761
+ ref: De,
762
+ tabIndex: -1,
763
+ children: xt
764
+ }),
765
+ /* @__PURE__ */ f(ye, { status: T.status }),
766
+ y?.position ? /* @__PURE__ */ f("span", {
767
+ class: "ck-muted ck-card-pos",
768
+ children: a("countOf", {
769
+ n: y.position.n,
770
+ total: y.position.total
771
+ })
772
+ }) : null,
773
+ y?.onPrev ? /* @__PURE__ */ f("button", {
774
+ class: "ck-ghost ck-step",
775
+ "aria-label": a("previousThread"),
776
+ title: Y() ? `${a("previousThread")} (K)` : a("previousThread"),
777
+ "aria-keyshortcuts": Y() ? "K" : void 0,
778
+ onClick: y.onPrev,
779
+ children: /* @__PURE__ */ f(x, {
780
+ name: "chevron",
781
+ size: 16
782
+ })
783
+ }) : null,
784
+ y?.onNext ? /* @__PURE__ */ f("button", {
785
+ class: "ck-ghost ck-step",
786
+ "data-dir": "next",
787
+ "aria-label": a("nextThread"),
788
+ title: Y() ? `${a("nextThread")} (J)` : a("nextThread"),
789
+ "aria-keyshortcuts": Y() ? "J" : void 0,
790
+ onClick: y.onNext,
791
+ children: /* @__PURE__ */ f(x, {
792
+ name: "chevron",
793
+ size: 16
794
+ })
795
+ }) : null,
796
+ /* @__PURE__ */ f("button", {
797
+ class: "ck-ghost",
798
+ ref: et,
799
+ "aria-label": a("more"),
800
+ title: a("more"),
801
+ "aria-haspopup": "menu",
802
+ "aria-expanded": I,
803
+ onClick: () => $e(!I),
804
+ children: /* @__PURE__ */ f(x, { name: "more" })
805
+ }),
806
+ y ? null : /* @__PURE__ */ f("button", {
807
+ class: "ck-ghost",
808
+ "aria-label": a("close"),
809
+ title: a("close"),
810
+ onClick: h,
811
+ children: /* @__PURE__ */ f(x, { name: "close" })
812
+ }),
813
+ I ? /* @__PURE__ */ f("div", {
814
+ class: "ck-menu",
815
+ role: "menu",
816
+ onClick: nt,
817
+ onKeyDown: (e) => e.key === "Escape" ? (e.stopPropagation(), nt()) : Ee(e, "[role=menuitem]", !0),
818
+ children: [
819
+ y ? /* @__PURE__ */ f("button", {
820
+ role: "menuitem",
821
+ onClick: () => y.onShow(T),
822
+ children: a("showOnPage")
823
+ }) : null,
824
+ Mt ? /* @__PURE__ */ f("button", {
825
+ role: "menuitem",
826
+ onClick: () => void jt(Mt, a("copied")),
827
+ children: a("copyLink")
828
+ }) : null,
829
+ fe && X?.triage && Q ? /* @__PURE__ */ f("button", {
830
+ role: "menuitem",
831
+ onClick: fe,
832
+ children: a("movePin")
833
+ }) : null,
834
+ X?.export_for_agents ? /* @__PURE__ */ f("button", {
835
+ role: "menuitem",
836
+ onClick: () => void jt(m(T, O), a("copiedForAgent")),
837
+ children: a("copyForAgent")
838
+ }) : null,
839
+ X?.set_any_status && Q ? /* @__PURE__ */ f(p, { children: [
840
+ /* @__PURE__ */ f("button", {
841
+ role: "menuitem",
842
+ onClick: () => void $("in_progress"),
843
+ children: a("markInProgress")
844
+ }),
845
+ /* @__PURE__ */ f("button", {
846
+ role: "menuitem",
847
+ onClick: () => void $("in_review"),
848
+ children: a("markInReview")
849
+ }),
850
+ /* @__PURE__ */ f("button", {
851
+ role: "menuitem",
852
+ onClick: () => void $("closed"),
853
+ children: a("closeThread")
854
+ })
855
+ ] }) : null,
856
+ /* @__PURE__ */ f("button", {
857
+ role: "menuitem",
858
+ onClick: () => void wt(),
859
+ children: a(ut ? "mute" : "unmute")
860
+ }),
861
+ Q && (X?.manage || vt && T.message_count <= 1) ? /* @__PURE__ */ f("button", {
862
+ role: "menuitem",
863
+ class: "ck-danger",
864
+ onClick: At,
865
+ children: a("delete")
866
+ }) : null
867
+ ]
868
+ }) : null
869
+ ]
870
+ }),
871
+ /* @__PURE__ */ f("div", {
872
+ class: "ck-card-body",
873
+ ref: ft,
874
+ onScroll: (e) => {
875
+ let t = e.currentTarget, n = t.scrollHeight - t.scrollTop - t.clientHeight > 120, r = t.scrollTop < it.current;
876
+ it.current = t.scrollTop, V((e) => n && (e || r)), W(null);
877
+ },
878
+ onMouseOver: (e) => {
879
+ let t = e.target.closest?.(".ck-mention");
880
+ if (!t) return W(null);
881
+ let n = t.textContent?.replace(/^@/, "") ?? "", r = H.find((e) => e.name === n) ?? H.find((e) => n.startsWith(e.name));
882
+ if (!r) return;
883
+ let i = t.getBoundingClientRect();
884
+ W({
885
+ person: r,
886
+ x: i.left,
887
+ y: i.bottom + 6
888
+ });
889
+ },
890
+ onMouseLeave: () => W(null),
891
+ children: [
892
+ /* @__PURE__ */ f(_e, {
893
+ thread: T,
894
+ editable: !!X?.triage && Q,
895
+ onChange: Ct
896
+ }),
897
+ /* @__PURE__ */ f(Me, {
898
+ thread: T,
899
+ anchor: J?.state,
900
+ branch: Z && !!i.options.branch
901
+ }),
902
+ /* @__PURE__ */ f(ge, {
903
+ thread: T,
904
+ editable: Q && (Z || !!vt),
905
+ addable: Z && i.options.tools?.checklist !== !1,
906
+ onChange: Ct
907
+ }, T.id),
908
+ T.style_changes?.length ? /* @__PURE__ */ f(je, {
909
+ thread: T,
910
+ element: J?.state === "detached" ? null : J?.element ?? null,
911
+ editable: Q && (!!X?.triage || !!vt),
912
+ onChange: Ct
913
+ }, T.id) : null,
914
+ Z ? /* @__PURE__ */ f(Ne, { thread: T }) : null,
915
+ T.status === "in_review" && !X?.set_any_status && Q ? /* @__PURE__ */ f("div", {
916
+ class: "ck-review-ask",
917
+ children: [/* @__PURE__ */ f("div", { children: a("reviewAsk") }), /* @__PURE__ */ f("div", {
918
+ class: "ck-actions",
919
+ children: [/* @__PURE__ */ f("button", {
920
+ class: "ck-btn ck-primary",
921
+ onClick: () => void $("resolved"),
922
+ children: [
923
+ /* @__PURE__ */ f(x, {
924
+ name: "check",
925
+ size: 14
926
+ }),
927
+ " ",
928
+ a("looksGood")
929
+ ]
930
+ }), /* @__PURE__ */ f("button", {
931
+ class: "ck-btn",
932
+ onClick: () => lt(!0),
933
+ children: a("notYet")
934
+ })]
935
+ })]
936
+ }) : null,
937
+ O.map((e, t) => {
938
+ let n = Le(e.author, b), r = t === 0;
939
+ return /* @__PURE__ */ f(Pe, {
940
+ client: i,
941
+ message: e,
942
+ first: r,
943
+ mine: n,
944
+ fresh: !st.current.has(e.id),
945
+ people: ot,
946
+ shot: Ft,
947
+ canWrite: Q,
948
+ simple: !Z,
949
+ canDelete: Q && (n || !!X?.manage) && !r,
950
+ edit: L?.id === e.id ? {
951
+ body: L.body,
952
+ busy: P,
953
+ onChange: (t) => R({
954
+ id: e.id,
955
+ body: t
956
+ }),
957
+ onCancel: () => R(null),
958
+ onSave: Tt
959
+ } : null,
960
+ alone: r && O.length === 1,
961
+ onQuote: () => B(e),
962
+ onCopy: () => void jt(e.body, a("copiedText")),
963
+ onEdit: () => R({
964
+ id: e.id,
965
+ body: e.body
966
+ }),
967
+ onDelete: () => kt(e),
968
+ onReact: (t) => void Dt(e, t),
969
+ onView: Ke,
970
+ onImageLoad: mt
971
+ });
972
+ })
973
+ ]
974
+ }),
975
+ /* @__PURE__ */ f("div", {
976
+ class: "ck-card-foot ck-reply-foot",
977
+ ...Q && _t ? ee(Ot) : {},
978
+ children: [rt ? /* @__PURE__ */ f("button", {
979
+ class: "ck-chip ck-jump",
980
+ onClick: () => (V(!1), pt(!0)),
981
+ children: [/* @__PURE__ */ f(x, {
982
+ name: "down",
983
+ size: 14
984
+ }), a("jumpToLatest")]
985
+ }) : null, Q ? /* @__PURE__ */ f(p, { children: [
986
+ C ? null : /* @__PURE__ */ f("div", {
987
+ class: "ck-note",
988
+ "data-tone": "warning",
989
+ role: "status",
990
+ children: a("offline")
991
+ }),
992
+ Ze && C ? /* @__PURE__ */ f("div", {
993
+ class: "ck-note",
994
+ "data-tone": "warning",
995
+ role: "alert",
996
+ children: Ze === !0 ? /* @__PURE__ */ f(p, { children: [
997
+ a("replyFailed"),
998
+ " ",
999
+ /* @__PURE__ */ f("button", {
1000
+ class: "ck-btn",
1001
+ "aria-disabled": P || void 0,
1002
+ onClick: () => void Et(),
1003
+ children: a("retry")
1004
+ })
1005
+ ] }) : Ze
1006
+ }) : null,
1007
+ /* @__PURE__ */ f(se, {
1008
+ client: i,
1009
+ value: M,
1010
+ onChange: He,
1011
+ onMentions: Ye,
1012
+ onSubmit: () => void Et(),
1013
+ placeholder: a(ct ? "notYetPlaceholder" : It ? "replyToReopen" : "replyPlaceholder"),
1014
+ autofocus: ct || !!z,
1015
+ disabled: P,
1016
+ canMention: !0,
1017
+ above: z ? /* @__PURE__ */ f("div", {
1018
+ class: "ck-quoting",
1019
+ role: "status",
1020
+ children: [
1021
+ /* @__PURE__ */ f(x, {
1022
+ name: "reply",
1023
+ size: 14
1024
+ }),
1025
+ /* @__PURE__ */ f("span", {
1026
+ title: z.body.slice(0, 280),
1027
+ children: [
1028
+ /* @__PURE__ */ f("strong", { children: /* @__PURE__ */ f("bdi", { children: z.author.name }) }),
1029
+ " ",
1030
+ /* @__PURE__ */ f("bdi", { children: z.body.slice(0, 140) })
1031
+ ]
1032
+ }),
1033
+ /* @__PURE__ */ f("button", {
1034
+ class: "ck-ghost ck-ghost-sm",
1035
+ "aria-label": a("quoteCancel"),
1036
+ onClick: () => B(null),
1037
+ children: /* @__PURE__ */ f(x, {
1038
+ name: "close",
1039
+ size: 14
1040
+ })
1041
+ })
1042
+ ]
1043
+ }) : null
1044
+ }),
1045
+ /* @__PURE__ */ f(ue, {
1046
+ items: N.items,
1047
+ onRemove: N.remove,
1048
+ onRetry: N.retry,
1049
+ onOpen: (e) => Ke(N.items.filter((e) => e.preview).map((e) => ({
1050
+ src: e.preview,
1051
+ name: e.file.name
1052
+ })), e)
1053
+ }),
1054
+ /* @__PURE__ */ f("div", {
1055
+ class: "ck-actions",
1056
+ children: [
1057
+ _t ? /* @__PURE__ */ f(re, {
1058
+ input: qe,
1059
+ onFiles: Ot,
1060
+ types: be
1061
+ }) : null,
1062
+ It ? /* @__PURE__ */ f("button", {
1063
+ class: "ck-btn",
1064
+ onClick: () => void $("open"),
1065
+ children: a("reopen")
1066
+ }) : /* @__PURE__ */ f("button", {
1067
+ class: "ck-btn",
1068
+ title: a("resolveHint"),
1069
+ "aria-keyshortcuts": Y() ? "E" : void 0,
1070
+ onClick: () => void $("resolved"),
1071
+ children: [
1072
+ /* @__PURE__ */ f(x, {
1073
+ name: "check",
1074
+ size: 14
1075
+ }),
1076
+ " ",
1077
+ a("resolve")
1078
+ ]
1079
+ }),
1080
+ /* @__PURE__ */ f("span", { class: "ck-spacer" }),
1081
+ /* @__PURE__ */ f("button", {
1082
+ class: T.status === "in_review" && !X?.set_any_status && Q ? "ck-btn" : "ck-btn ck-primary",
1083
+ "aria-disabled": P || !M.trim() || !C || void 0,
1084
+ onClick: () => C && void Et(),
1085
+ children: a(P ? "sending" : "reply")
1086
+ })
1087
+ ]
1088
+ })
1089
+ ] }) : /* @__PURE__ */ f("div", {
1090
+ class: "ck-note",
1091
+ children: a(ve ? "readOnlyReply" : "noReplyAccess")
1092
+ })]
1093
+ }),
1094
+ Ue && Ge ? /* @__PURE__ */ f(Ge, {
1095
+ images: Ue.images,
1096
+ start: Ue.start,
1097
+ onClose: () => We(null)
1098
+ }) : null,
1099
+ U ? /* @__PURE__ */ f("div", {
1100
+ class: "ck-mention-card",
1101
+ style: xe(Math.max(8, Math.min(U.x, innerWidth - 248)), U.y),
1102
+ "aria-hidden": "true",
1103
+ children: [/* @__PURE__ */ f(Ce, { person: U.person }), /* @__PURE__ */ f("bdi", {
1104
+ class: "ck-msg-name",
1105
+ children: U.person.name
1106
+ })]
1107
+ }) : null
1108
+ ]
1109
+ })
1110
+ });
1111
+ }
1112
+ var Ve = 6e3;
1113
+ export { Be as ThreadCard };