@commentkit/comment-kit 2.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +14 -6
  3. package/dist/node/cli/api.js +61 -15
  4. package/dist/node/cli/credentials.js +8 -0
  5. package/dist/node/cli/doctor.js +68 -5
  6. package/dist/node/cli/main.js +275 -52
  7. package/dist/node/cli/website.js +140 -0
  8. package/dist/node/types/next.d.ts +4 -4
  9. package/dist/npm/THIRD_PARTY_NOTICES.txt +47 -0
  10. package/dist/npm/chunks/{AgentSend-DOy3jhyF.js → AgentSend-B4rxdY68.js} +3 -3
  11. package/dist/npm/chunks/Checklist-Cy68X5qC.js +269 -0
  12. package/dist/npm/chunks/Composer-D65l6Jg4.js +734 -0
  13. package/dist/npm/chunks/DatePicker-BPzzqW3f.js +161 -0
  14. package/dist/npm/chunks/{Guest-7hcN765o.js → Guest-C-ZhARI0.js} +18 -17
  15. package/dist/npm/chunks/{MarkupEditor-6bJGpWGO.js → MarkupEditor-BOb2jFTR.js} +8 -8
  16. package/dist/npm/chunks/{Panel-ChPUB68C.js → Panel-DgdCgaC-.js} +217 -218
  17. package/dist/npm/chunks/{Settings-CB5eEKnf.js → Settings-BbWu2Rd5.js} +34 -33
  18. package/dist/npm/chunks/{Shortcuts-eAyjJ89P.js → Shortcuts-C5wEx-Mq.js} +25 -23
  19. package/dist/npm/chunks/SignInFirst-BlMbutED.js +36 -0
  20. package/dist/npm/chunks/{StyleEditor-CZTdAA5c.js → StyleEditor-BN2z7mUs.js} +4 -4
  21. package/dist/npm/chunks/{StylePanel-B4pHQUL9.js → StylePanel-BZk-r-kl.js} +3 -3
  22. package/dist/npm/chunks/TaskFields-B2-YvIwV.js +617 -0
  23. package/dist/npm/chunks/ThreadCard-xKy4JbXK.js +1142 -0
  24. package/dist/npm/chunks/{Viewer-DY6zb90M.js → Viewer-DL6M3wAT.js} +9 -8
  25. package/dist/npm/chunks/{agent-MTQHr9ei.js → agent-D1VQvc14.js} +12 -12
  26. package/dist/npm/chunks/{ar-L5cQ-NPe.js → ar-DtfC6tHi.js} +53 -12
  27. package/dist/npm/chunks/{card-bits-CTdrkYn8.js → card-bits-B94SwnS9.js} +12 -10
  28. package/dist/npm/chunks/{client-7eVxvg5j.js → client-CULjcQxz.js} +13 -11
  29. package/dist/npm/chunks/{confetti-BIs5s14P.js → confetti-K_xKxQGa.js} +1 -1
  30. package/dist/npm/chunks/{context-Cf6khm7A.js → context-0MfEgoip.js} +1 -1
  31. package/dist/npm/chunks/{de-D0C-v6tP.js → de-CSyX5Cz-.js} +53 -12
  32. package/dist/npm/chunks/{dpop-0A76OPa9.js → dpop-DpxIN5kL.js} +1 -1
  33. package/dist/npm/chunks/entrance-CO0AzUKy.js +90 -0
  34. package/dist/npm/chunks/{es-Bw4Dj9tN.js → es-D7SAi7fz.js} +53 -12
  35. package/dist/npm/chunks/{extension-DFVOvciD.js → extension-DpfiPOjC.js} +1 -1
  36. package/dist/npm/chunks/{extension-SmoH5AA4.js → extension-faFfCApb.js} +2 -2
  37. package/dist/npm/chunks/{files-4lV9YQIX.js → files-BkHuRlcW.js} +2 -2
  38. package/dist/npm/chunks/{fr-TkuQaIAa.js → fr-CIr2nUyu.js} +53 -12
  39. package/dist/npm/chunks/{hi-DXSH2U8d.js → hi-BTocxOL5.js} +53 -12
  40. package/dist/npm/chunks/{i18n-aVSu9TcJ.js → i18n-CDw_D17c.js} +17 -21
  41. package/dist/npm/chunks/icons-BJLm_C0M.js +141 -0
  42. package/dist/npm/chunks/{identify-BGYh2dVo.js → identify-963WDKul.js} +1 -1
  43. package/dist/npm/chunks/{it-CiWA_bch.js → it-DCExRo0r.js} +53 -12
  44. package/dist/npm/chunks/{ja-C-QmR3yz.js → ja-CgWpTdWi.js} +52 -11
  45. package/dist/npm/chunks/late-words-QnNheaDY.js +59 -0
  46. package/dist/npm/chunks/{live-BExWHzQ7.js → live-BI72WQBA.js} +31 -23
  47. package/dist/npm/chunks/{nl-CEmZRqjX.js → nl-DhTQ8oJ_.js} +53 -12
  48. package/dist/npm/chunks/{page-key-HSY3Lze5.js → page-key-CW8Mtf60.js} +1 -1
  49. package/dist/npm/chunks/{pick-B3sR7jtS.js → pick-BRhngGMq.js} +1 -1
  50. package/dist/npm/chunks/{pkce-CfZhiNBi.js → pkce-BEeLAZhN.js} +1 -1
  51. package/dist/npm/chunks/{pt-BR-b-a8sxO8.js → pt-BR-DrO6LV4n.js} +53 -12
  52. package/dist/npm/chunks/{report-DaVuoRYS.js → report-DAzQvgUh.js} +1 -1
  53. package/dist/npm/chunks/{show-BoN8AC-F.js → show-Ka3g4eCJ.js} +7 -7
  54. package/dist/npm/chunks/signin-Car5vP1U.js +101 -0
  55. package/dist/npm/chunks/{source-mk3rGBBQ.js → source-dd_it90W.js} +1 -1
  56. package/dist/npm/chunks/{src-C8rZFyL_.js → src-fTYV50pw.js} +21 -15
  57. package/dist/npm/chunks/start-CE5eR33Z.js +1916 -0
  58. package/dist/npm/chunks/states-DLMCvwes.js +3 -0
  59. package/dist/npm/chunks/{upload-B2mkgMeJ.js → upload-Dcv9CCly.js} +1 -1
  60. package/dist/npm/chunks/uploads-CmeoNVO2.js +1236 -0
  61. package/dist/npm/chunks/{wrap-DW6EFbVQ.js → wrap-B0mzrRhc.js} +27 -27
  62. package/dist/npm/chunks/{zh-CN-JTscW8u8.js → zh-CN-Bb8UzT1V.js} +53 -12
  63. package/dist/npm/element.js +7 -1
  64. package/dist/npm/headless.js +2 -2
  65. package/dist/npm/index.js +2 -2
  66. package/dist/npm/react.js +1 -1
  67. package/dist/npm/svelte.js +1 -1
  68. package/dist/npm/types/adapters/vue.d.ts +12 -0
  69. package/dist/npm/types/core/auth.d.ts +1 -0
  70. package/dist/npm/types/core/client.d.ts +5 -1
  71. package/dist/npm/types/core/types.d.ts +17 -2
  72. package/dist/npm/vue.js +5 -1
  73. package/package.json +2 -1
  74. package/dist/npm/chunks/Checklist-CW_SwMpS.js +0 -282
  75. package/dist/npm/chunks/Composer-Bveq5QrK.js +0 -727
  76. package/dist/npm/chunks/TaskFields-C8BX0Sgg.js +0 -289
  77. package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +0 -1160
  78. package/dist/npm/chunks/late-words-80_VWt8S.js +0 -14
  79. package/dist/npm/chunks/signin-BOWr_WCo.js +0 -75
  80. package/dist/npm/chunks/start-CV4j78_q.js +0 -1894
  81. package/dist/npm/chunks/states-b9Bv3Ci7.js +0 -3
  82. package/dist/npm/chunks/uploads-8AxyRq7g.js +0 -1147
@@ -1,727 +0,0 @@
1
- import { a as e } from "./src-C8rZFyL_.js";
2
- import { b as t, o as n, v as r } from "./client-7eVxvg5j.js";
3
- import { a as i, c as a, o, s } from "./privacy-BWUGlHw5.js";
4
- import { s as c } from "./anchor-BsQNVkHj.js";
5
- import { _ as l, b as u, c as d, d as ee, f, m as p, u as m, v as h } from "./i18n-aVSu9TcJ.js";
6
- import { r as te } from "./files-4lV9YQIX.js";
7
- import { n as ne, r as re, t as ie } from "./card-bits-CTdrkYn8.js";
8
- import { i as g } from "./drafts-B0ctr1g9.js";
9
- import { a as ae, c as oe, d as se, f as ce, h as le, i as ue, l as de, m as fe, n as pe, o as me, p as _, t as he } from "./uploads-8AxyRq7g.js";
10
- import { t as v } from "./states-b9Bv3Ci7.js";
11
- import { C as y, F as ge, M as _e, O as ve, _ as ye, b as be, c as xe, g as b, k as Se, l as Ce, s as x, u as we, y as S } from "./start-CV4j78_q.js";
12
- // src/capture/context.ts
13
- function Te() {
14
- let e = navigator.userAgent, t = C(e, [
15
- ["Edge", /Edg\/([\d.]+)/],
16
- ["Opera", /OPR\/([\d.]+)/],
17
- ["Samsung Internet", /SamsungBrowser\/([\d.]+)/],
18
- ["Chrome", /Chrome\/([\d.]+)/],
19
- ["Firefox", /Firefox\/([\d.]+)/],
20
- ["Safari", /Version\/([\d.]+).*Safari/]
21
- ]), n = C(e, [
22
- ["iOS", /(?:iPhone|iPad|iPod).*OS ([\d_]+)/],
23
- ["Android", /Android ([\d.]+)/],
24
- ["Windows", /Windows NT ([\d.]+)/],
25
- ["macOS", /Mac OS X ([\d_]+)/],
26
- ["ChromeOS", /CrOS [^ ]+ ([\d.]+)/],
27
- ["Linux", /Linux()/]
28
- ]), r = innerWidth, i = matchMedia?.("(pointer: coarse)").matches ?? !1;
29
- return {
30
- viewport: {
31
- width: r,
32
- height: innerHeight,
33
- dpr: Math.round((devicePixelRatio || 1) * 100) / 100,
34
- zoom: Math.round((visualViewport?.scale ?? 1) * 100) / 100
35
- },
36
- device: {
37
- browser: t?.[0],
38
- browser_version: t?.[1]?.split(".")[0],
39
- os: n?.[0],
40
- os_version: n?.[1]?.replace(/_/g, "."),
41
- type: i ? r >= 768 ? "tablet" : "mobile" : "desktop",
42
- locale: navigator.language,
43
- color_scheme: matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light",
44
- user_agent: e.slice(0, 500)
45
- }
46
- };
47
- }
48
- function C(e, t) {
49
- for (let [n, r] of t) {
50
- let t = e.match(r);
51
- if (t) return [n, t[1] ?? ""];
52
- }
53
- return null;
54
- }
55
- // src/capture/screenshot.ts
56
- var w = 8e6, T = 15e3;
57
- function Ee() {
58
- e() || import("./html2canvas-pro.esm-B7b8p5Wr.js").catch(() => void 0);
59
- }
60
- async function De(t = {}) {
61
- let n = (t.redact ?? []).filter(s), r = o(t.privacy), i = innerWidth, a = innerHeight, c = null;
62
- e() && (c = await import("./extension-DFVOvciD.js").then((e) => e.captureTab(n, r)).catch(() => null)), c ?? (c = await E(n, r, i, a));
63
- let l = c.getContext("2d"), u = c.width / Math.max(1, i);
64
- return l && Oe(l, u, t), t.crop && t.region && (c = O(c, u, t.region, i, a)), {
65
- blob: await Ae(c),
66
- width: c.width,
67
- height: c.height
68
- };
69
- }
70
- async function E(e, t, n, r) {
71
- let [{ default: o }, { captureBackground: s, normalizeCaptureColors: c, settleStylesheets: l }] = await Promise.all([import("./html2canvas-pro.esm-B7b8p5Wr.js"), import("./colors-CWAn_swA.js")]), u = a([], t), d = (t) => t.tagName === "NOSCRIPT" || i(t, u) || e.some((e) => je(t, e)), ee = Math.min(devicePixelRatio || 1, 2, Math.sqrt(w / Math.max(1, n * r)));
72
- return k(o(document.documentElement, {
73
- useCORS: !0,
74
- logging: !1,
75
- backgroundColor: s(getComputedStyle(document.body).backgroundColor),
76
- scale: ee,
77
- x: scrollX,
78
- y: scrollY,
79
- width: n,
80
- height: r,
81
- windowWidth: document.documentElement.clientWidth,
82
- windowHeight: r,
83
- ignoreElements: d,
84
- onclone: async (e) => {
85
- await l(e), c(e);
86
- }
87
- }), T);
88
- }
89
- function Oe(e, t, n) {
90
- e.setTransform(1, 0, 0, 1, 0, 0);
91
- let r = n.accent ?? "#ff5733";
92
- if (n.region) {
93
- let i = n.region;
94
- e.save(), e.lineWidth = 3 * t, e.strokeStyle = r, e.setLineDash([8 * t, 6 * t]), e.strokeRect(i.x * t, i.y * t, i.w * t, i.h * t), e.restore();
95
- }
96
- if (n.pin) {
97
- let i = n.pin.x * t, a = n.pin.y * t, o = 11 * t;
98
- e.save(), e.shadowColor = "rgba(0,0,0,0.25)", e.shadowBlur = 6 * t, e.fillStyle = r, e.beginPath(), e.arc(i, a - o, o, Math.PI, 0), e.lineTo(i, a + o * .4), e.closePath(), e.fill(), e.shadowBlur = 0, e.fillStyle = "#ffffff", e.beginPath(), e.arc(i, a - o, o * .38, 0, Math.PI * 2), e.fill(), e.restore();
99
- }
100
- }
101
- var D = {
102
- w: 320,
103
- h: 200
104
- };
105
- function ke(e, t, n) {
106
- let r = Math.min(t, Math.max(D.w, e.w + 64)), i = Math.min(n, Math.max(D.h, e.h + 64));
107
- return {
108
- x: Math.min(Math.max(0, e.x + e.w / 2 - r / 2), t - r),
109
- y: Math.min(Math.max(0, e.y + e.h / 2 - i / 2), n - i),
110
- w: r,
111
- h: i
112
- };
113
- }
114
- function O(e, t, n, r, i) {
115
- let a = ke(n, r, i), o = document.createElement("canvas");
116
- return o.width = Math.max(1, Math.round(a.w * t)), o.height = Math.max(1, Math.round(a.h * t)), o.getContext("2d")?.drawImage(e, a.x * t, a.y * t, o.width, o.height, 0, 0, o.width, o.height), o;
117
- }
118
- function Ae(e) {
119
- return new Promise((t, n) => {
120
- e.toBlob((r) => {
121
- if (r && r.type === "image/webp") return t(r);
122
- e.toBlob((e) => e ? t(e) : n(/* @__PURE__ */ Error("Could not encode the screenshot.")), "image/png");
123
- }, "image/webp", .86);
124
- });
125
- }
126
- function k(e, t) {
127
- return new Promise((n, r) => {
128
- let i = setTimeout(() => r(/* @__PURE__ */ Error("The screenshot took too long. Your feedback will be sent without it.")), t);
129
- e.then((e) => (clearTimeout(i), n(e)), (e) => (clearTimeout(i), r(e)));
130
- });
131
- }
132
- function je(e, t) {
133
- try {
134
- return e.matches(t) || !!e.closest(t);
135
- } catch {
136
- return !1;
137
- }
138
- }
139
- x(v), x(se);
140
- function Me({ client: e, draft: i, signedIn: a, onSignIn: o, onCancel: s, onSent: se, onError: _, share: v = null, onPending: _e }) {
141
- let x = S(e.state, (e) => e.config), C = S(e.state, (e) => e.session?.person ?? null), w = h(() => we(e, i.anchor), [i.anchor]), [T, Ee] = l(() => Be()), [E, Oe] = l(() => fe(w, void 0, we(e, i.anchor, n()))), [D, ke] = l([]), [O, Ae] = l(null), k = e.options.tools ?? {}, je = x?.features.screenshots !== !1 && k.screenshots !== !1, Me = k.attachments !== !1, [A, He] = l(je ? "capturing" : "off"), M = S(e.state, (e) => !!e.session?.capabilities.triage), Ue = M && k.checklist !== !1, [N] = l(() => Ve(w)), [P, We] = l(N?.task ?? {}), [F, Ge] = l(() => !!Fe(N?.task ?? {})), [I, L] = l(N?.checklist ?? null), [R, Ke] = l(""), qe = b(M, () => import("./TaskFields-C8BX0Sgg.js").then((e) => e.TaskDraft), () => void 0), [z, Je] = l(N?.markup ?? []), [Ye, B] = l(!1), Xe = b(Ye, () => import("./MarkupEditor-6bJGpWGO.js").then((e) => e.MarkupEditor), (e) => (B(!1), _(e))), V = pe(e, (e) => _(new r(0, "file_rejected", e))), H = h(() => {
142
- if (!M || k.style === !1 || i.anchor.type !== "element" && i.anchor.type !== "text") return null;
143
- let e = c(i.anchor).element;
144
- return e instanceof HTMLElement || e instanceof SVGElement ? e : null;
145
- }, [i.anchor, M]), [U, Ze] = l(N?.styles ?? []), [W, Qe] = l(!1), $e = b(W, () => import("./StylePanel-B4pHQUL9.js").then((e) => e.StylePanel), _), G = p(null), K = p(null), et = () => {
146
- H && (G.current ?? (G.current = me(H)), K.current ?? (K.current = new ue(H)), Qe(!0));
147
- };
148
- f(() => {
149
- W ? K.current?.apply(U) : K.current?.revert();
150
- }, [W, U]), f(() => () => K.current?.revert(), []);
151
- let [q, tt] = l(null), nt = b(q !== null, () => import("./Viewer-DY6zb90M.js").then((e) => e.Viewer), _), [J, rt] = l(!1), [it, at] = l(!1), ot = !!(x?.features.console_capture || x?.features.network_capture), st = S(e.state, (e) => !e.session || e.session.role === "guest"), [ct, lt] = l(x?.features.capture_consent_default === !0 && !st), Y = ye(), [ut, dt] = l(!1), X = !a && !!v && !e.auth.pending(), [ft, pt] = l(null), mt = {
152
- name: p(null),
153
- email: p(null)
154
- }, ht = p(null), Z = p(null), gt = p(null), Q = p(null), _t = p(null), [vt] = l(() => (e) => {
155
- e && !Q.current && Se(e), Q.current = e;
156
- }), yt = p(null), bt = (e, t) => {
157
- let n = e.closest(".ck-draft-item");
158
- ((n?.nextElementSibling ?? n?.previousElementSibling)?.querySelector(".ck-draft-item button, input") ?? t())?.focus();
159
- }, xt = p(Promise.resolve(null));
160
- ee(() => {
161
- if (A !== "capturing") return;
162
- let t = !1, n = 0, r = 0;
163
- return xt.current = new Promise((a) => {
164
- let o = !1, s = () => {
165
- if (!o) {
166
- if (o = !0, t) return a(null);
167
- De({
168
- redact: [...x?.privacy.redact_selectors ?? [], ...e.options.redact ?? []],
169
- privacy: xe(x, e.options.privacy),
170
- pin: i.region ? null : i.point,
171
- region: i.region,
172
- crop: !!i.region
173
- }).then(a, () => a(null));
174
- }
175
- };
176
- n = requestAnimationFrame(() => n = requestAnimationFrame(s)), r = window.setTimeout(s, 300);
177
- }), xt.current.then((e) => {
178
- t || (e && Ae(e), He(e ? "ready" : "failed"));
179
- }), () => {
180
- t = !0, cancelAnimationFrame(n), clearTimeout(r);
181
- };
182
- }, []);
183
- let $ = h(() => O && URL.createObjectURL(O.blob), [O]);
184
- f(() => () => void ($ && URL.revokeObjectURL($)), [$]);
185
- let St = (e) => {
186
- Oe(e), le(w, e);
187
- };
188
- f(() => {
189
- Z.current = null;
190
- }, [
191
- E,
192
- D,
193
- O,
194
- A,
195
- z,
196
- V.items,
197
- ct,
198
- P,
199
- I,
200
- U
201
- ]);
202
- let Ct = !F && !!Fe(P), wt = h(() => re(i.point, i.region ? {
203
- top: i.region.y,
204
- bottom: i.region.y + i.region.h
205
- } : void 0), [i.point]), Tt = (e) => V.add(e), Et = async () => {
206
- let n = null, r = null, a = A === "capturing" ? await xt.current : A === "ready" ? O : null;
207
- if (a) try {
208
- let t = a.blob.type, r = `screenshot.${t === "image/webp" ? "webp" : t === "image/jpeg" ? "jpg" : "png"}`;
209
- n = (await e.upload(a.blob, r, "screenshot")).id;
210
- } catch {
211
- r = "screenshot";
212
- }
213
- let o = await V.ready(), s = o.ids;
214
- o.missing && (r ?? (r = "files"));
215
- let c = {
216
- ...Te(),
217
- ...ot && ct ? ge() : {},
218
- screenshot_id: n,
219
- markup: z.length ? z : void 0
220
- }, l = M ? Fe(P) : void 0, u = [...I ?? [], ...I && R.trim() ? [R.trim()] : []], d = H ? ae(U) : [];
221
- return {
222
- key: t(16),
223
- input: {
224
- anchor: i.anchor,
225
- body: E.trim(),
226
- capture: c,
227
- attachmentIds: s,
228
- mentionIds: D,
229
- task: l,
230
- checklist: u,
231
- styleChanges: d
232
- },
233
- missing: r
234
- };
235
- }, Dt = async () => {
236
- if (J || !E.trim() || !Y) return;
237
- if (at(!1), !a && !v && !ut) {
238
- dt(!0);
239
- return;
240
- }
241
- let t = X ? T.name.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(T.email.trim()) ? null : "email" : "name" : null;
242
- if (pt(t), t) return mt[t].current?.focus();
243
- rt(!0);
244
- try {
245
- let t = !a && !v;
246
- if (X && v) {
247
- let { startGuest: n } = await import("./Guest-7hcN765o.js");
248
- g(ze, JSON.stringify({
249
- name: T.name,
250
- email: T.email
251
- })), t = await n(e, {
252
- share: v,
253
- ...T
254
- }) === "popup";
255
- }
256
- if (t) {
257
- if (g(Ce, JSON.stringify({
258
- draft: i,
259
- scrollY
260
- })), g(j, JSON.stringify({
261
- id: w,
262
- checklist: I,
263
- task: P,
264
- markup: z,
265
- styles: U
266
- })), !await o()) return;
267
- g(Ce, null), g(j, null);
268
- }
269
- let n = Z.current ?? (Z.current = await Et()), r = await e.createThread({
270
- ...n.input,
271
- idempotencyKey: n.key
272
- });
273
- if (Z.current = null, r.pending_verification) return _e?.(e.auth.pending()?.email ?? T.email);
274
- ce(w), g(ze, null), se(r, n.missing);
275
- } catch (t) {
276
- if (t instanceof r && ["pending_limit", "verification_required"].includes(t.code) && e.auth.pending()) return _e?.(e.auth.pending().email);
277
- let n = ne(t);
278
- at(n ?? !0), n || _(t);
279
- } finally {
280
- rt(!1);
281
- }
282
- };
283
- return /* @__PURE__ */ m(u, { children: [i.region ? /* @__PURE__ */ m("div", {
284
- class: "ck-pending-region",
285
- style: ve(i.region.x, i.region.y, i.region.w, i.region.h),
286
- "aria-hidden": "true",
287
- "data-commentkit-ui": !0
288
- }) : i.anchor.type === "page" ? null : /* @__PURE__ */ m("div", {
289
- class: "ck-pending-pin",
290
- style: ve(i.point.x, i.point.y),
291
- "aria-hidden": "true",
292
- "data-commentkit-ui": !0,
293
- children: [/* @__PURE__ */ m("svg", {
294
- viewBox: "5 3 54 62",
295
- children: /* @__PURE__ */ m("path", { d: Pe })
296
- }), C ? /* @__PURE__ */ m(be, { person: C }) : null]
297
- }), /* @__PURE__ */ m("div", {
298
- class: "ck-card ck-composer",
299
- style: wt,
300
- role: "region",
301
- "aria-label": d("comment"),
302
- "data-commentkit-ui": !0,
303
- onKeyDown: (e) => e.key === "Escape" && s(!0),
304
- ...Me ? te(Tt) : {},
305
- children: [
306
- /* @__PURE__ */ m("div", {
307
- class: "ck-card-body",
308
- children: [
309
- i.anchor.quote ? /* @__PURE__ */ m("blockquote", {
310
- class: "ck-quote",
311
- "aria-label": d("quotedText"),
312
- children: /* @__PURE__ */ m("bdi", { children: i.anchor.quote.slice(0, 200) })
313
- }) : null,
314
- Y ? null : /* @__PURE__ */ m("div", {
315
- class: "ck-note",
316
- "data-tone": "warning",
317
- role: "status",
318
- children: d("offlineSend")
319
- }),
320
- it && Y ? /* @__PURE__ */ m("div", {
321
- class: "ck-note",
322
- "data-tone": "warning",
323
- role: "alert",
324
- children: it === !0 ? /* @__PURE__ */ m(u, { children: [
325
- d("sendFailed"),
326
- " ",
327
- /* @__PURE__ */ m("button", {
328
- class: "ck-btn",
329
- onClick: () => (gt.current?.focus(), void Dt()),
330
- children: d("retry")
331
- })
332
- ] }) : `${it} ${d("savedHere")}`
333
- }) : null,
334
- /* @__PURE__ */ m(de, {
335
- client: e,
336
- value: E,
337
- onChange: St,
338
- onMentions: ke,
339
- onSubmit: () => void Dt(),
340
- placeholder: d("composerPlaceholder"),
341
- autofocus: !0,
342
- disabled: J,
343
- canMention: a
344
- }),
345
- I === null ? null : /* @__PURE__ */ m("div", {
346
- class: "ck-draft-list",
347
- role: "group",
348
- "aria-label": d("checklist"),
349
- children: [I.map((e, t) => /* @__PURE__ */ m("div", {
350
- class: "ck-draft-item",
351
- children: [
352
- /* @__PURE__ */ m("span", {
353
- "aria-hidden": "true",
354
- class: "ck-draft-box"
355
- }),
356
- /* @__PURE__ */ m("bdi", { children: e }),
357
- /* @__PURE__ */ m("button", {
358
- class: "ck-ghost ck-ghost-sm",
359
- "aria-label": d("removeItem", { item: e }),
360
- title: d("removeItem", { item: e }),
361
- onClick: (e) => {
362
- bt(e.currentTarget, () => Q.current ?? _t.current), L(I.filter((e, n) => n !== t));
363
- },
364
- children: /* @__PURE__ */ m(y, {
365
- name: "close",
366
- size: 12
367
- })
368
- })
369
- ]
370
- })), I.length < 30 ? /* @__PURE__ */ m("input", {
371
- class: "ck-input",
372
- maxLength: 300,
373
- placeholder: d("checklistAdd"),
374
- "aria-label": d("checklistAdd"),
375
- enterKeyHint: "done",
376
- value: R,
377
- ref: vt,
378
- onInput: (e) => Ke(e.target.value),
379
- onKeyDown: (e) => {
380
- e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && R.trim() && (e.preventDefault(), L([...I, R.trim()]), Ke(""));
381
- }
382
- }) : null]
383
- }),
384
- U.length ? /* @__PURE__ */ m("div", {
385
- class: "ck-draft-list ck-style-list",
386
- role: "group",
387
- "aria-label": d("styleChanges"),
388
- children: U.map((e) => /* @__PURE__ */ m("div", {
389
- class: "ck-draft-item",
390
- children: [/* @__PURE__ */ m("code", { children: oe(e) }), /* @__PURE__ */ m("button", {
391
- class: "ck-ghost ck-ghost-sm",
392
- "aria-label": d("styleRemoveChange", { change: oe(e) }),
393
- title: d("styleRemoveChange", { change: oe(e) }),
394
- onClick: (t) => {
395
- bt(t.currentTarget, () => yt.current), Ze(U.filter((t) => t.property !== e.property));
396
- },
397
- children: /* @__PURE__ */ m(y, {
398
- name: "close",
399
- size: 12
400
- })
401
- })]
402
- }))
403
- }) : null,
404
- W && $e && G.current ? /* @__PURE__ */ m($e, {
405
- base: G.current,
406
- changes: U,
407
- onChange: Ze,
408
- onClose: () => Qe(!1)
409
- }) : null,
410
- M && qe && F ? /* @__PURE__ */ m(qe, {
411
- client: e,
412
- value: P,
413
- onChange: We
414
- }) : null,
415
- X || ut && !a ? /* @__PURE__ */ m("div", {
416
- class: "ck-note",
417
- children: [
418
- /* @__PURE__ */ m("strong", { children: d(X ? "guestIntro" : "signInToSend") }),
419
- /* @__PURE__ */ m("div", { children: d(v ? "guestExplain" : "signInExplain") }),
420
- X ? /* @__PURE__ */ m("div", {
421
- class: "ck-guest",
422
- children: [["name", "email"].map((e) => /* @__PURE__ */ m("div", {
423
- class: "ck-field",
424
- children: [
425
- /* @__PURE__ */ m("label", {
426
- for: `ck-guest-${e}`,
427
- children: d(e === "name" ? "guestName" : "guestEmail")
428
- }),
429
- /* @__PURE__ */ m("input", {
430
- id: `ck-guest-${e}`,
431
- ref: mt[e],
432
- class: "ck-input",
433
- type: e === "email" ? "email" : "text",
434
- autoComplete: e,
435
- maxLength: e === "name" ? 120 : 254,
436
- enterKeyHint: "send",
437
- autoCapitalize: e === "name" ? "words" : "off",
438
- value: T[e],
439
- "aria-invalid": ft === e,
440
- "aria-describedby": ft === e ? "ck-guest-error" : void 0,
441
- onInput: (t) => {
442
- let n = t.target.value;
443
- Ee((t) => ({
444
- ...t,
445
- [e]: n
446
- }));
447
- },
448
- onKeyDown: (e) => {
449
- e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && Dt();
450
- }
451
- }),
452
- ft === e ? /* @__PURE__ */ m("span", {
453
- class: "ck-error",
454
- id: "ck-guest-error",
455
- role: "alert",
456
- children: d(e === "name" ? "guestNameMissing" : "guestEmailInvalid")
457
- }) : null
458
- ]
459
- })), /* @__PURE__ */ m("p", {
460
- class: "ck-muted ck-guest-privacy",
461
- children: [
462
- d("guestPrivacy"),
463
- " ",
464
- /* @__PURE__ */ m("a", {
465
- href: Re(e.options.endpoint),
466
- target: "_blank",
467
- rel: "noopener noreferrer",
468
- children: d("guestPrivacyLink")
469
- }),
470
- Le(x) ? /* @__PURE__ */ m(u, { children: [" · ", /* @__PURE__ */ m("a", {
471
- href: Le(x),
472
- target: "_blank",
473
- rel: "noopener noreferrer",
474
- children: d("guestPrivacySite", { website: x?.project.name ?? "" })
475
- })] }) : null
476
- ]
477
- })]
478
- }) : null
479
- ]
480
- }) : null,
481
- A === "capturing" ? /* @__PURE__ */ m("div", {
482
- class: "ck-shot ck-shot-wait",
483
- children: /* @__PURE__ */ m("span", {
484
- class: "ck-muted",
485
- children: d("capturing")
486
- })
487
- }) : null,
488
- A === "failed" ? /* @__PURE__ */ m("p", {
489
- class: "ck-muted",
490
- children: d("capturingFailed")
491
- }) : null,
492
- A === "ready" && $ ? /* @__PURE__ */ m("div", {
493
- class: "ck-shot",
494
- children: [/* @__PURE__ */ m("button", {
495
- class: "ck-shot-open",
496
- "aria-label": d("openImage", { name: d("screenshot") }),
497
- onClick: () => tt(-1),
498
- children: /* @__PURE__ */ m("img", {
499
- src: $,
500
- alt: d("screenshotIncluded"),
501
- title: d("screenshotIncluded"),
502
- style: { objectPosition: Ie(i) }
503
- })
504
- }), /* @__PURE__ */ m("div", {
505
- class: "ck-shot-tools",
506
- children: [k.markup === !1 ? null : /* @__PURE__ */ m("button", {
507
- class: "ck-chip",
508
- onClick: () => B(!0),
509
- children: [/* @__PURE__ */ m(y, {
510
- name: "pen",
511
- size: 14
512
- }), d("markup")]
513
- }), /* @__PURE__ */ m("button", {
514
- class: "ck-chip",
515
- onClick: () => He("off"),
516
- children: d("screenshotRemove")
517
- })]
518
- })]
519
- }) : null,
520
- A === "off" && O ? /* @__PURE__ */ m("button", {
521
- class: "ck-chip ck-shot-add",
522
- onClick: () => He("ready"),
523
- children: [/* @__PURE__ */ m(y, {
524
- name: "image",
525
- size: 14
526
- }), d("screenshotAdd")]
527
- }) : null,
528
- ot ? /* @__PURE__ */ m("label", {
529
- class: "ck-check",
530
- children: [/* @__PURE__ */ m("input", {
531
- type: "checkbox",
532
- checked: ct,
533
- onChange: (e) => lt(e.target.checked)
534
- }), d("includeDiagnostics")]
535
- }) : null,
536
- ot ? /* @__PURE__ */ m(Ne, {}) : null,
537
- /* @__PURE__ */ m(he, {
538
- items: V.items,
539
- onRemove: V.remove,
540
- onRetry: V.retry,
541
- onOpen: tt
542
- })
543
- ]
544
- }),
545
- /* @__PURE__ */ m("div", {
546
- class: "ck-card-foot",
547
- children: [
548
- /* @__PURE__ */ m("div", {
549
- class: "ck-tools",
550
- children: [
551
- Me ? /* @__PURE__ */ m(ie, {
552
- input: ht,
553
- onFiles: Tt,
554
- types: x?.limits?.upload_types
555
- }) : null,
556
- Ue ? /* @__PURE__ */ m("button", {
557
- ref: _t,
558
- class: "ck-ghost",
559
- "data-tool": "checklist",
560
- "aria-label": d("addChecklist"),
561
- title: d("addChecklist"),
562
- "aria-pressed": I === null ? !1 : !I.length || void 0,
563
- onClick: () => I?.length ? Q.current?.focus() : I === null ? L([]) : (Ke(""), L(null)),
564
- children: /* @__PURE__ */ m("svg", {
565
- width: "16",
566
- height: "16",
567
- viewBox: "0 0 24 24",
568
- fill: "none",
569
- stroke: "currentColor",
570
- "stroke-width": "2",
571
- "stroke-linecap": "round",
572
- "stroke-linejoin": "round",
573
- "aria-hidden": "true",
574
- children: /* @__PURE__ */ m("path", { d: "m3 6 2 2 4-4M3 16l2 2 4-4M13 7h8M13 17h8" })
575
- })
576
- }) : null,
577
- M && qe ? /* @__PURE__ */ m("button", {
578
- class: "ck-ghost",
579
- "data-tool": "task",
580
- "aria-label": d("taskDetails"),
581
- title: d("taskDetails"),
582
- "aria-pressed": F,
583
- "data-set": Ct ? "" : void 0,
584
- "aria-describedby": Ct ? "ck-task-set" : void 0,
585
- onClick: () => Ge(!F),
586
- children: [/* @__PURE__ */ m("svg", {
587
- width: "16",
588
- height: "16",
589
- viewBox: "0 0 24 24",
590
- fill: "none",
591
- stroke: "currentColor",
592
- "stroke-width": "2",
593
- "stroke-linecap": "round",
594
- "stroke-linejoin": "round",
595
- "aria-hidden": "true",
596
- children: /* @__PURE__ */ m("path", { d: "M5 21V4h11l-2 4 2 4H5" })
597
- }), /* @__PURE__ */ m("span", {
598
- id: "ck-task-set",
599
- hidden: !0,
600
- children: d("taskDetailsSet")
601
- })]
602
- }) : null,
603
- H ? /* @__PURE__ */ m("button", {
604
- ref: yt,
605
- class: "ck-ghost",
606
- "data-tool": "style",
607
- "aria-label": d("adjustStyle"),
608
- title: d("adjustStyle"),
609
- "aria-pressed": W,
610
- onClick: () => W ? Qe(!1) : et(),
611
- children: /* @__PURE__ */ m("svg", {
612
- width: "16",
613
- height: "16",
614
- viewBox: "0 0 24 24",
615
- fill: "none",
616
- stroke: "currentColor",
617
- "stroke-width": "2",
618
- "stroke-linecap": "round",
619
- "stroke-linejoin": "round",
620
- "aria-hidden": "true",
621
- children: /* @__PURE__ */ m("path", { d: "M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" })
622
- })
623
- }) : null
624
- ]
625
- }),
626
- /* @__PURE__ */ m("span", { class: "ck-spacer" }),
627
- /* @__PURE__ */ m("button", {
628
- class: "ck-btn",
629
- onClick: () => s(),
630
- children: d("cancel")
631
- }),
632
- /* @__PURE__ */ m("button", {
633
- ref: gt,
634
- class: "ck-btn ck-primary",
635
- "aria-disabled": J || !E.trim() || !Y || void 0,
636
- onClick: () => void Dt(),
637
- children: d(J ? "sending" : ut && !a ? "signIn" : "send")
638
- })
639
- ]
640
- }),
641
- q !== null && nt ? /* @__PURE__ */ m(nt, {
642
- images: q < 0 && $ ? [{
643
- src: $,
644
- name: d("screenshot")
645
- }] : V.items.filter((e) => e.preview).map((e) => ({
646
- src: e.preview,
647
- name: e.file.name
648
- })),
649
- start: Math.max(0, q),
650
- onClose: () => tt(null)
651
- }) : null,
652
- Ye && Xe && O ? /* @__PURE__ */ m(Xe, {
653
- image: O.blob,
654
- onCancel: () => B(!1),
655
- onDone: (e, t) => {
656
- Ae({
657
- ...O,
658
- blob: e
659
- }), Je(t), B(!1);
660
- }
661
- }) : null
662
- ]
663
- })] });
664
- }
665
- function Ne() {
666
- let [e, t] = l(!1), n = e ? A(ge()) : [];
667
- return /* @__PURE__ */ m("details", {
668
- class: "ck-diag",
669
- onToggle: (e) => t(e.currentTarget.open),
670
- children: [/* @__PURE__ */ m("summary", { children: d("diagnosticsSee") }), e ? n.length ? /* @__PURE__ */ m("ul", { children: n.map((e) => /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m("bdi", { children: e }) })) }) : /* @__PURE__ */ m("p", {
671
- class: "ck-muted",
672
- children: d("diagnosticsEmpty")
673
- }) : null]
674
- });
675
- }
676
- function A(e) {
677
- return [...(e.console ?? []).map((e) => `${e.level}: ${e.message}`), ...(e.network ?? []).map((e) => `${e.method} ${e.url} ${e.status}`)];
678
- }
679
- var Pe = "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";
680
- function Fe(e) {
681
- let t = {};
682
- return e.priority && e.priority !== "none" && (t.priority = e.priority), e.assignee_ids?.length && (t.assignee_ids = e.assignee_ids), e.label_ids?.length && (t.label_ids = e.label_ids), Object.keys(t).length ? t : void 0;
683
- }
684
- function Ie(e) {
685
- return e.region ? "50% 50%" : `50% ${Math.round(Math.min(100, Math.max(0, e.point.y / Math.max(1, innerHeight) * 100)))}%`;
686
- }
687
- var j = "commentkit:pending-extras";
688
- function Le(e) {
689
- let t = _e(e?.privacy?.notice_url);
690
- return t?.startsWith("https:") ? t : null;
691
- }
692
- function Re(e) {
693
- try {
694
- return `${new URL(e ?? "https://commentkit.dev").origin}/privacy`;
695
- } catch {
696
- return "https://commentkit.dev/privacy";
697
- }
698
- }
699
- var ze = "commentkit:guest-details";
700
- function Be() {
701
- try {
702
- let e = JSON.parse(g(ze) ?? "null"), t = (e, t) => typeof e == "string" ? e.slice(0, t) : "";
703
- return {
704
- name: t(e?.name, 120),
705
- email: t(e?.email, 254)
706
- };
707
- } catch {
708
- return {
709
- name: "",
710
- email: ""
711
- };
712
- }
713
- }
714
- function Ve(e) {
715
- try {
716
- let t = JSON.parse(g(j) ?? "null");
717
- return g(j, null), !t || _(t.id) !== _(e) ? null : {
718
- checklist: Array.isArray(t.checklist) ? t.checklist.filter((e) => typeof e == "string").slice(0, 30) : null,
719
- task: t.task && typeof t.task == "object" ? t.task : {},
720
- markup: Array.isArray(t.markup) ? t.markup.filter((e) => !!e && typeof e == "object" && Array.isArray(e.points)).slice(0, 100) : [],
721
- styles: ae(t.styles)
722
- };
723
- } catch {
724
- return null;
725
- }
726
- }
727
- export { Me as Composer, A as diagnosticsLines, Re as privacyNotice, Le as siteNotice, Ee as warmCapture };