@commentkit/comment-kit 1.5.1 → 1.6.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 (58) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/npm/THIRD_PARTY_NOTICES.txt +2 -2
  3. package/dist/npm/chunks/{AgentSend-DjFZSC0S.js → AgentSend-2JPDseOo.js} +4 -5
  4. package/dist/npm/chunks/{Checklist-BEz4IZdT.js → Checklist-BpDXQebo.js} +77 -79
  5. package/dist/npm/chunks/Composer-CAyj-c8e.js +677 -0
  6. package/dist/npm/chunks/Guest-ZdFmTcXI.js +187 -0
  7. package/dist/npm/chunks/{MarkupEditor-CPH4yKx4.js → MarkupEditor-BFplZwFy.js} +3 -5
  8. package/dist/npm/chunks/{Panel-DSoUAlbQ.js → Panel-BhZ4XRDR.js} +300 -302
  9. package/dist/npm/chunks/{Settings-C_qV4n7J.js → Settings-SPG9EHUZ.js} +70 -72
  10. package/dist/npm/chunks/{Shortcuts-ChnaribX.js → Shortcuts-C28HVDw6.js} +3 -5
  11. package/dist/npm/chunks/{StyleEditor-DqZd6C5o.js → StyleEditor-ByZMtq10.js} +4 -5
  12. package/dist/npm/chunks/{StylePanel-DMC3riYK.js → StylePanel-Iwhce2tE.js} +62 -64
  13. package/dist/npm/chunks/{TaskFields-BfjjllMx.js → TaskFields-BsP_fVJg.js} +7 -6
  14. package/dist/npm/chunks/{ThreadCard-DmKAelSL.js → ThreadCard-BzVZdDCb.js} +407 -403
  15. package/dist/npm/chunks/{Viewer-mw69qSI5.js → Viewer-CqtGrdD8.js} +29 -31
  16. package/dist/npm/chunks/{agent-CqDO3JMA.js → agent-BDMQtOzH.js} +14 -15
  17. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsradQhn.js} +1 -2
  18. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-8tPch6W4.js} +5 -2
  19. package/dist/npm/chunks/{card-bits-C7bIk5KX.js → card-bits-Bna-g3Py.js} +24 -26
  20. package/dist/npm/chunks/{client-dZeNdizE.js → client-EFTWxHbJ.js} +76 -61
  21. package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
  22. package/dist/npm/chunks/{confetti-DKeKR7-6.js → confetti-DTKpwF3O.js} +1 -2
  23. package/dist/npm/chunks/{de-CcPi8xdC.js → de-C63897uD.js} +5 -2
  24. package/dist/npm/chunks/{drafts-CpQdHhcK.js → drafts-akdBsOd0.js} +1 -2
  25. package/dist/npm/chunks/{es-DXgkjDCG.js → es-CI2bSpvB.js} +5 -2
  26. package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-BST6LH1q.js} +2 -3
  27. package/dist/npm/chunks/{extension-Gvei3opb.js → extension-D-V3utTm.js} +3 -4
  28. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-rsVe-Lqk.js} +5 -2
  29. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-cvwbSaWP.js} +5 -2
  30. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  31. package/dist/npm/chunks/{i18n-DAJGndZ2.js → i18n-C4v0M-6z.js} +254 -257
  32. package/dist/npm/chunks/{it-DKiSCkiD.js → it-C8tnV0BF.js} +5 -2
  33. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-BWxDfC2f.js} +5 -2
  34. package/dist/npm/chunks/{live-MvvBdoGd.js → live-BCpJVBeN.js} +2 -3
  35. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  36. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-DNQ6eCht.js} +5 -2
  37. package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-CLyOdjnD.js} +3 -4
  38. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-CkG7vpU2.js} +5 -2
  39. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-DIo-Wth4.js} +2 -3
  40. package/dist/npm/chunks/{report-DoDVi1qT.js → report-BBrT3r89.js} +1 -2
  41. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  42. package/dist/npm/chunks/{source-BQS2_xfB.js → source-CS7C6wJA.js} +2 -3
  43. package/dist/npm/chunks/{src-C_oUnL0i.js → src-C4FsVoUp.js} +22 -24
  44. package/dist/npm/chunks/{start-C5-rebEU.js → start-i9M-r3aH.js} +374 -357
  45. package/dist/npm/chunks/{upload-CzPAjktW.js → upload-DSv7EyBD.js} +2 -3
  46. package/dist/npm/chunks/uploads-I01kdqQF.js +1103 -0
  47. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-BKuZOLBE.js} +5 -2
  48. package/dist/npm/element.js +2 -3
  49. package/dist/npm/headless.js +2 -2
  50. package/dist/npm/index.js +2 -2
  51. package/dist/npm/react.js +2 -3
  52. package/dist/npm/svelte.js +2 -3
  53. package/dist/npm/types/core/auth.d.ts +14 -0
  54. package/dist/npm/vue.js +2 -3
  55. package/package.json +8 -8
  56. package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
  57. package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
  58. package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
@@ -1,681 +0,0 @@
1
- import { n as e } from "./src-C_oUnL0i.js";
2
- import { p as t } from "./client-dZeNdizE.js";
3
- import { a as n } from "./anchor-OCQnjp_6.js";
4
- import { d as r, f as i, l as a, m as o, p as s, s as c, u as l, v as ee } from "./i18n-DAJGndZ2.js";
5
- import { n as te, o as ne, r as re, t as ie } from "./card-bits-C7bIk5KX.js";
6
- import { i as ae, r as oe, t as se } from "./drafts-CpQdHhcK.js";
7
- import { a as ce, c as le, d as u, i as ue, l as de, n as fe, o as pe, t as me } from "./uploads-tpLjiJdH.js";
8
- import { S as he, a as ge, d, h as _e, i as ve, l as ye, m as be, n as f, o as xe, s as Se } from "./start-C5-rebEU.js";
9
- var p = "iframe,[data-commentkit],[data-commentkit-host],[data-commentkit-ui],[data-commentkit-panel],[data-commentkit-redact],[data-html2canvas-ignore],input[type=\"password\"],input[type=\"hidden\"],input[type=\"email\" i],input[type=\"tel\" i]," + [
10
- "current-password",
11
- "new-password",
12
- "one-time-code",
13
- "email",
14
- "tel",
15
- "street-address",
16
- "address-line1",
17
- "address-line2",
18
- "address-line3",
19
- "postal-code"
20
- ].map((e) => `[autocomplete~="${e}" i]`).join(",") + "," + ["cc-", "tel-"].map((e) => `[autocomplete^="${e}" i],[autocomplete*=" ${e}" i]`).join(",");
21
- function m(e) {
22
- try {
23
- let t = e;
24
- for (; t;) {
25
- if (t.closest(p)) return !0;
26
- let e = t.getRootNode();
27
- t = e instanceof ShadowRoot ? e.host : null;
28
- }
29
- return !1;
30
- } catch {
31
- return !0;
32
- }
33
- }
34
- //#endregion
35
- //#region src/capture/context.ts
36
- function Ce() {
37
- let e = navigator.userAgent, t = we(e, [
38
- ["Edge", /Edg\/([\d.]+)/],
39
- ["Opera", /OPR\/([\d.]+)/],
40
- ["Samsung Internet", /SamsungBrowser\/([\d.]+)/],
41
- ["Chrome", /Chrome\/([\d.]+)/],
42
- ["Firefox", /Firefox\/([\d.]+)/],
43
- ["Safari", /Version\/([\d.]+).*Safari/]
44
- ]), n = we(e, [
45
- ["iOS", /(?:iPhone|iPad|iPod).*OS ([\d_]+)/],
46
- ["Android", /Android ([\d.]+)/],
47
- ["Windows", /Windows NT ([\d.]+)/],
48
- ["macOS", /Mac OS X ([\d_]+)/],
49
- ["ChromeOS", /CrOS [^ ]+ ([\d.]+)/],
50
- ["Linux", /Linux()/]
51
- ]), r = innerWidth, i = matchMedia?.("(pointer: coarse)").matches ?? !1;
52
- return {
53
- viewport: {
54
- width: r,
55
- height: innerHeight,
56
- dpr: Math.round((devicePixelRatio || 1) * 100) / 100,
57
- zoom: Math.round((visualViewport?.scale ?? 1) * 100) / 100
58
- },
59
- device: {
60
- browser: t?.[0],
61
- browser_version: t?.[1]?.split(".")[0],
62
- os: n?.[0],
63
- os_version: n?.[1]?.replace(/_/g, "."),
64
- type: i ? r >= 768 ? "tablet" : "mobile" : "desktop",
65
- locale: navigator.language,
66
- color_scheme: matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light",
67
- user_agent: e.slice(0, 500)
68
- }
69
- };
70
- }
71
- function we(e, t) {
72
- for (let [n, r] of t) {
73
- let t = e.match(r);
74
- if (t) return [n, t[1] ?? ""];
75
- }
76
- return null;
77
- }
78
- //#endregion
79
- //#region src/capture/screenshot.ts
80
- var h = 8e6, g = 15e3;
81
- function _() {
82
- e() || import("./html2canvas-pro.esm-lgs6tb4C.js").catch(() => void 0);
83
- }
84
- async function Te(t = {}) {
85
- let n = (t.redact ?? []).filter(C), r = innerWidth, i = innerHeight, a = null;
86
- e() && (a = await import("./extension-Gvei3opb.js").then((e) => e.captureTab(n)).catch(() => null)), a ?? (a = await v(n, r, i));
87
- let o = a.getContext("2d"), s = a.width / Math.max(1, r);
88
- return o && y(o, s, t), t.crop && t.region && (a = Ee(a, s, t.region, r, i)), {
89
- blob: await S(a),
90
- width: a.width,
91
- height: a.height
92
- };
93
- }
94
- async function v(e, t, n) {
95
- let [{ default: r }, { captureBackground: i, normalizeCaptureColors: a, settleStylesheets: o }] = await Promise.all([import("./html2canvas-pro.esm-lgs6tb4C.js"), import("./colors-CAjY4jxf.js")]), s = (t) => t.tagName === "NOSCRIPT" || m(t) || e.some((e) => Oe(t, e)), c = Math.min(devicePixelRatio || 1, 2, Math.sqrt(h / Math.max(1, t * n)));
96
- return De(r(document.documentElement, {
97
- useCORS: !0,
98
- logging: !1,
99
- backgroundColor: i(getComputedStyle(document.body).backgroundColor),
100
- scale: c,
101
- x: scrollX,
102
- y: scrollY,
103
- width: t,
104
- height: n,
105
- windowWidth: document.documentElement.clientWidth,
106
- windowHeight: n,
107
- ignoreElements: s,
108
- onclone: async (e) => {
109
- await o(e), a(e);
110
- }
111
- }), g);
112
- }
113
- function y(e, t, n) {
114
- e.setTransform(1, 0, 0, 1, 0, 0);
115
- let r = n.accent ?? "#ff5733";
116
- if (n.region) {
117
- let i = n.region;
118
- 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();
119
- }
120
- if (n.pin) {
121
- let i = n.pin.x * t, a = n.pin.y * t, o = 11 * t;
122
- 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();
123
- }
124
- }
125
- var b = {
126
- w: 320,
127
- h: 200
128
- };
129
- function x(e, t, n) {
130
- let r = Math.min(t, Math.max(b.w, e.w + 64)), i = Math.min(n, Math.max(b.h, e.h + 64));
131
- return {
132
- x: Math.min(Math.max(0, e.x + e.w / 2 - r / 2), t - r),
133
- y: Math.min(Math.max(0, e.y + e.h / 2 - i / 2), n - i),
134
- w: r,
135
- h: i
136
- };
137
- }
138
- function Ee(e, t, n, r, i) {
139
- let a = x(n, r, i), o = document.createElement("canvas");
140
- 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;
141
- }
142
- function S(e) {
143
- return new Promise((t, n) => {
144
- e.toBlob((r) => {
145
- if (r && r.type === "image/webp") return t(r);
146
- e.toBlob((e) => e ? t(e) : n(/* @__PURE__ */ Error("Could not encode the screenshot.")), "image/png");
147
- }, "image/webp", .86);
148
- });
149
- }
150
- function De(e, t) {
151
- return new Promise((n, r) => {
152
- let i = setTimeout(() => r(/* @__PURE__ */ Error("The screenshot took too long. Your feedback will be sent without it.")), t);
153
- e.then((e) => (clearTimeout(i), n(e)), (e) => (clearTimeout(i), r(e)));
154
- });
155
- }
156
- function C(e) {
157
- try {
158
- return document.createDocumentFragment().querySelector(e), !0;
159
- } catch {
160
- return !1;
161
- }
162
- }
163
- function Oe(e, t) {
164
- try {
165
- return e.matches(t) || !!e.closest(t);
166
- } catch {
167
- return !1;
168
- }
169
- }
170
- //#endregion
171
- //#region src/ui/Composer.tsx
172
- f(u);
173
- function w({ client: e, draft: u, signedIn: f, onSignIn: p, onCancel: m, onSent: we, onError: h, share: g = null, onPending: _ }) {
174
- let v = ge(e.state, (e) => e.config), y = ge(e.state, (e) => e.session?.person ?? null), b = s(() => Se(e, u.anchor), [u.anchor]), [x, Ee] = o(() => Ne()), [S, De] = o(() => oe(b)), [C, Oe] = o([]), [w, Fe] = o(null), [Ie, Le] = o(null), k = e.options.tools ?? {}, Re = v?.features.screenshots !== !1 && k.screenshots !== !1, ze = k.attachments !== !1, [A, j] = o(Re ? "capturing" : "off"), M = ge(e.state, (e) => !!e.session?.capabilities.triage), [N] = o(() => Pe(b)), [P, Be] = o(N?.task ?? {}), [F, I] = o(N?.checklist ?? null), [L, Ve] = o(""), [R, He] = o(null);
175
- l(() => {
176
- M && !R && import("./TaskFields-BfjjllMx.js").then((e) => He(() => e.TaskDraft), () => void 0);
177
- }, [M]);
178
- let [z, Ue] = o(N?.markup ?? []), [We, B] = o(null), V = fe(e, (e) => h(new t(0, "file_rejected", e))), H = s(() => {
179
- if (u.anchor.type !== "element" && u.anchor.type !== "text") return null;
180
- let e = n(u.anchor).element;
181
- return e instanceof HTMLElement || e instanceof SVGElement ? e : null;
182
- }, [u.anchor]), [U, Ge] = o(N?.styles ?? []), [W, Ke] = o(!1), [G, qe] = o(null), K = i(null), q = i(null), Je = () => {
183
- H && (K.current ?? (K.current = pe(H)), q.current ?? (q.current = new ue(H)), Ke(!0), G || import("./StylePanel-DMC3riYK.js").then((e) => qe(() => e.StylePanel), h));
184
- };
185
- r(() => {
186
- W ? q.current?.apply(U) : q.current?.revert();
187
- }, [W, U]), r(() => () => q.current?.revert(), []);
188
- let [Ye, Xe] = o(null), [J, Ze] = o(null), Qe = (e) => {
189
- Xe(e), J || import("./Viewer-mw69qSI5.js").then((e) => Ze(() => e.Viewer), h);
190
- }, [Y, $e] = o(!1), [et, tt] = o(!1), nt = !!(v?.features.console_capture || v?.features.network_capture), [rt, it] = o(v?.features.capture_consent_default === !0), X = ve(), [at, ot] = o(!1), Z = !f && !!g && !e.auth.pending(), [st, ct] = o(null), lt = {
191
- name: i(null),
192
- email: i(null)
193
- }, ut = i(null), Q = i(null), dt = i(Promise.resolve(null));
194
- l(() => {
195
- if (A !== "capturing") return;
196
- let t = !1, n = 0, r = 0;
197
- return dt.current = new Promise((i) => {
198
- let a = !1, o = () => {
199
- if (!a) {
200
- if (a = !0, t) return i(null);
201
- Te({
202
- redact: [...v?.privacy.redact_selectors ?? [], ...e.options.redact ?? []],
203
- pin: u.region ? null : u.point,
204
- region: u.region,
205
- crop: !!u.region
206
- }).then(i, () => i(null));
207
- }
208
- };
209
- n = requestAnimationFrame(() => n = requestAnimationFrame(o)), r = window.setTimeout(o, 300);
210
- }), dt.current.then((e) => {
211
- t || (e && Fe(e), j(e ? "ready" : "failed"));
212
- }), () => {
213
- t = !0, cancelAnimationFrame(n), clearTimeout(r);
214
- };
215
- }, []), l(() => {
216
- if (!w) return;
217
- let e = URL.createObjectURL(w.blob);
218
- return Le(e), () => URL.revokeObjectURL(e);
219
- }, [w]);
220
- let ft = (e) => {
221
- De(e), ae(b, e);
222
- };
223
- l(() => {
224
- Q.current = null;
225
- }, [
226
- S,
227
- C,
228
- w,
229
- A,
230
- z,
231
- V.items,
232
- rt,
233
- P,
234
- F,
235
- U
236
- ]);
237
- let pt = s(() => re(u.point, u.region ? {
238
- top: u.region.y,
239
- bottom: u.region.y + u.region.h
240
- } : void 0), [u.point]), mt = (e) => V.add(e), ht = async () => {
241
- let t = null, n = null, r = A === "capturing" ? await dt.current : A === "ready" ? w : null;
242
- if (r) try {
243
- let n = r.blob.type, i = `screenshot.${n === "image/webp" ? "webp" : n === "image/jpeg" ? "jpg" : "png"}`;
244
- t = (await e.upload(r.blob, i, "screenshot")).id;
245
- } catch {
246
- n = "screenshot";
247
- }
248
- let i = await V.ready(), a = i.ids;
249
- i.missing && (n ?? (n = "files"));
250
- let o = {
251
- ...Ce(),
252
- ...nt && rt ? he() : {},
253
- screenshot_id: t,
254
- markup: z.length ? z : void 0
255
- }, s = M ? Ae(P) : void 0, c = [...F ?? [], ...L.trim() ? [L.trim()] : []], l = H ? ce(U) : [];
256
- return {
257
- key: crypto.randomUUID(),
258
- input: {
259
- anchor: u.anchor,
260
- body: S.trim(),
261
- capture: o,
262
- attachmentIds: a,
263
- mentionIds: C,
264
- task: s,
265
- checklist: c,
266
- styleChanges: l
267
- },
268
- missing: n
269
- };
270
- }, $ = async () => {
271
- if (Y || !S.trim() || !X) return;
272
- if (tt(!1), !f && !g && !at) {
273
- ot(!0);
274
- return;
275
- }
276
- let n = Z ? x.name.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x.email.trim()) ? null : "email" : "name" : null;
277
- if (ct(n), n) return lt[n].current?.focus();
278
- $e(!0);
279
- try {
280
- let t = !f && !g;
281
- if (Z && g) {
282
- let { startGuest: n } = await import("./Guest-CtyRy8Kz.js");
283
- D(E, JSON.stringify({
284
- name: x.name,
285
- email: x.email
286
- })), t = await n(e, {
287
- share: g,
288
- ...x
289
- }) === "popup";
290
- }
291
- if (t) {
292
- if (D(xe, JSON.stringify({
293
- draft: u,
294
- scrollY
295
- })), D(T, JSON.stringify({
296
- id: b,
297
- checklist: F,
298
- task: P,
299
- markup: z,
300
- styles: U
301
- })), !await p()) return;
302
- O(xe), O(T);
303
- }
304
- let n = Q.current ?? (Q.current = await ht()), r = await e.createThread({
305
- ...n.input,
306
- idempotencyKey: n.key
307
- });
308
- if (Q.current = null, r.pending_verification) return _?.(e.auth.pending()?.email ?? x.email);
309
- se(b), O(E), we(r, n.missing);
310
- } catch (n) {
311
- if (n instanceof t && ["pending_limit", "verification_required"].includes(n.code) && e.auth.pending()) return _?.(e.auth.pending().email);
312
- let r = te(n);
313
- tt(r ?? !0), r || h(n);
314
- } finally {
315
- $e(!1);
316
- }
317
- };
318
- return /* @__PURE__ */ a(ee, { children: [u.region ? /* @__PURE__ */ a("div", {
319
- class: "ck-pending-region",
320
- style: be(u.region.x, u.region.y, u.region.w, u.region.h),
321
- "aria-hidden": "true",
322
- "data-commentkit-ui": !0
323
- }) : u.anchor.type === "page" ? null : /* @__PURE__ */ a("div", {
324
- class: "ck-pending-pin",
325
- style: be(u.point.x, u.point.y),
326
- "aria-hidden": "true",
327
- "data-commentkit-ui": !0,
328
- children: [/* @__PURE__ */ a("svg", {
329
- viewBox: "5 3 54 62",
330
- children: /* @__PURE__ */ a("path", { d: ke })
331
- }), y ? /* @__PURE__ */ a(ye, { person: y }) : null]
332
- }), /* @__PURE__ */ a("div", {
333
- class: "ck-card ck-composer",
334
- style: pt,
335
- role: "dialog",
336
- "aria-label": c("comment"),
337
- "data-commentkit-ui": !0,
338
- onKeyDown: (e) => e.key === "Escape" && m(),
339
- ...ze ? ne(mt) : {},
340
- children: [
341
- /* @__PURE__ */ a("div", {
342
- class: "ck-card-body",
343
- style: { position: "relative" },
344
- children: [
345
- u.anchor.quote ? /* @__PURE__ */ a("blockquote", {
346
- class: "ck-quote",
347
- "aria-label": c("quotedText"),
348
- children: /* @__PURE__ */ a("bdi", { children: u.anchor.quote.slice(0, 200) })
349
- }) : null,
350
- X ? null : /* @__PURE__ */ a("div", {
351
- class: "ck-note",
352
- "data-tone": "warning",
353
- role: "status",
354
- children: c("offlineSend")
355
- }),
356
- et && X ? /* @__PURE__ */ a("div", {
357
- class: "ck-note",
358
- "data-tone": "warning",
359
- role: "alert",
360
- children: et === !0 ? /* @__PURE__ */ a(ee, { children: [
361
- c("sendFailed"),
362
- " ",
363
- /* @__PURE__ */ a("button", {
364
- class: "ck-btn",
365
- onClick: () => void $(),
366
- children: c("retry")
367
- })
368
- ] }) : `${et} ${c("savedHere")}`
369
- }) : null,
370
- /* @__PURE__ */ a(de, {
371
- client: e,
372
- value: S,
373
- onChange: ft,
374
- onMentions: Oe,
375
- onSubmit: () => void $(),
376
- placeholder: c("composerPlaceholder"),
377
- autofocus: !0,
378
- disabled: Y,
379
- canMention: f
380
- }),
381
- F === null ? null : /* @__PURE__ */ a("div", {
382
- class: "ck-draft-list",
383
- role: "group",
384
- "aria-label": c("checklist"),
385
- children: [F.map((e, t) => /* @__PURE__ */ a("div", {
386
- class: "ck-draft-item",
387
- children: [
388
- /* @__PURE__ */ a("span", {
389
- "aria-hidden": "true",
390
- class: "ck-draft-box"
391
- }),
392
- /* @__PURE__ */ a("bdi", { children: e }),
393
- /* @__PURE__ */ a("button", {
394
- class: "ck-ghost ck-ghost-sm",
395
- "aria-label": c("removeItem", { item: e }),
396
- onClick: () => I(F.filter((e, n) => n !== t)),
397
- children: /* @__PURE__ */ a(d, {
398
- name: "close",
399
- size: 12
400
- })
401
- })
402
- ]
403
- })), F.length < 30 ? /* @__PURE__ */ a("input", {
404
- class: "ck-input",
405
- maxLength: 300,
406
- placeholder: c("checklistAdd"),
407
- "aria-label": c("checklistAdd"),
408
- value: L,
409
- ref: _e,
410
- onInput: (e) => Ve(e.target.value),
411
- onKeyDown: (e) => {
412
- e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && L.trim() && (e.preventDefault(), I([...F, L.trim()]), Ve(""));
413
- }
414
- }) : null]
415
- }),
416
- U.length ? /* @__PURE__ */ a("div", {
417
- class: "ck-draft-list ck-style-list",
418
- role: "group",
419
- "aria-label": c("styleChanges"),
420
- children: U.map((e) => /* @__PURE__ */ a("div", {
421
- class: "ck-draft-item",
422
- children: [/* @__PURE__ */ a("code", { children: le(e) }), /* @__PURE__ */ a("button", {
423
- class: "ck-ghost ck-ghost-sm",
424
- "aria-label": c("styleRemoveChange", { change: le(e) }),
425
- onClick: () => Ge(U.filter((t) => t.property !== e.property)),
426
- children: /* @__PURE__ */ a(d, {
427
- name: "close",
428
- size: 12
429
- })
430
- })]
431
- }))
432
- }) : null,
433
- W && G && K.current ? /* @__PURE__ */ a(G, {
434
- base: K.current,
435
- changes: U,
436
- onChange: Ge,
437
- onClose: () => Ke(!1)
438
- }) : null,
439
- F === null || H && !W ? /* @__PURE__ */ a("div", {
440
- class: "ck-extra-add",
441
- children: [F === null ? /* @__PURE__ */ a("button", {
442
- class: "ck-ghost ck-ghost-sm",
443
- onClick: () => I([]),
444
- children: ["+ ", c("addChecklist")]
445
- }) : null, H && !W ? /* @__PURE__ */ a("button", {
446
- class: "ck-chip",
447
- onClick: Je,
448
- children: [/* @__PURE__ */ a("svg", {
449
- width: "13",
450
- height: "13",
451
- viewBox: "0 0 24 24",
452
- fill: "none",
453
- stroke: "currentColor",
454
- "stroke-width": "2",
455
- "stroke-linecap": "round",
456
- "stroke-linejoin": "round",
457
- "aria-hidden": "true",
458
- children: /* @__PURE__ */ a("path", { d: "M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" })
459
- }), c("adjustStyle")]
460
- }) : null]
461
- }) : null,
462
- M && R ? /* @__PURE__ */ a(R, {
463
- client: e,
464
- value: P,
465
- onChange: Be
466
- }) : null,
467
- Z || at && !f ? /* @__PURE__ */ a("div", {
468
- class: "ck-note",
469
- children: [
470
- /* @__PURE__ */ a("strong", { children: c(Z ? "guestIntro" : "signInToSend") }),
471
- /* @__PURE__ */ a("div", { children: c(g ? "guestExplain" : "signInExplain") }),
472
- Z ? /* @__PURE__ */ a("div", {
473
- class: "ck-guest",
474
- children: [["name", "email"].map((e) => /* @__PURE__ */ a("div", {
475
- class: "ck-field",
476
- children: [
477
- /* @__PURE__ */ a("label", {
478
- for: `ck-guest-${e}`,
479
- children: c(e === "name" ? "guestName" : "guestEmail")
480
- }),
481
- /* @__PURE__ */ a("input", {
482
- id: `ck-guest-${e}`,
483
- ref: lt[e],
484
- class: "ck-input",
485
- type: e === "email" ? "email" : "text",
486
- autoComplete: e,
487
- maxLength: e === "name" ? 120 : 254,
488
- value: x[e],
489
- "aria-invalid": st === e,
490
- "aria-describedby": st === e ? "ck-guest-error" : void 0,
491
- onInput: (t) => {
492
- let n = t.target.value;
493
- Ee((t) => ({
494
- ...t,
495
- [e]: n
496
- }));
497
- },
498
- onKeyDown: (e) => {
499
- e.key !== "Escape" && e.stopPropagation(), e.key === "Enter" && $();
500
- }
501
- }),
502
- st === e ? /* @__PURE__ */ a("span", {
503
- class: "ck-error",
504
- id: "ck-guest-error",
505
- role: "alert",
506
- children: c(e === "name" ? "guestNameMissing" : "guestEmailInvalid")
507
- }) : null
508
- ]
509
- })), /* @__PURE__ */ a("p", {
510
- class: "ck-muted ck-guest-privacy",
511
- children: [
512
- c("guestPrivacy"),
513
- " ",
514
- /* @__PURE__ */ a("a", {
515
- href: Me(e.options.endpoint),
516
- target: "_blank",
517
- rel: "noopener noreferrer",
518
- children: c("guestPrivacyLink")
519
- })
520
- ]
521
- })]
522
- }) : null
523
- ]
524
- }) : null,
525
- A === "capturing" ? /* @__PURE__ */ a("div", {
526
- class: "ck-shot ck-shot-wait",
527
- children: /* @__PURE__ */ a("span", {
528
- class: "ck-muted",
529
- children: c("capturing")
530
- })
531
- }) : null,
532
- A === "failed" ? /* @__PURE__ */ a("p", {
533
- class: "ck-muted",
534
- children: c("capturingFailed")
535
- }) : null,
536
- A === "ready" && Ie ? /* @__PURE__ */ a("div", {
537
- class: "ck-shot",
538
- children: [/* @__PURE__ */ a("img", {
539
- src: Ie,
540
- alt: c("screenshotIncluded"),
541
- title: c("screenshotIncluded"),
542
- style: { objectPosition: je(u) }
543
- }), /* @__PURE__ */ a("div", {
544
- class: "ck-shot-tools",
545
- children: [k.markup === !1 ? null : /* @__PURE__ */ a("button", {
546
- class: "ck-chip",
547
- onClick: () => void import("./MarkupEditor-CPH4yKx4.js").then((e) => B(() => e.MarkupEditor), h),
548
- children: [/* @__PURE__ */ a(d, {
549
- name: "pen",
550
- size: 14
551
- }), c("markup")]
552
- }), /* @__PURE__ */ a("button", {
553
- class: "ck-chip",
554
- onClick: () => j("off"),
555
- children: c("screenshotRemove")
556
- })]
557
- })]
558
- }) : null,
559
- A === "off" && w ? /* @__PURE__ */ a("button", {
560
- class: "ck-chip",
561
- style: { marginTop: "8px" },
562
- onClick: () => j("ready"),
563
- children: [/* @__PURE__ */ a(d, {
564
- name: "image",
565
- size: 14
566
- }), c("screenshotAdd")]
567
- }) : null,
568
- nt ? /* @__PURE__ */ a("label", {
569
- class: "ck-check",
570
- children: [/* @__PURE__ */ a("input", {
571
- type: "checkbox",
572
- checked: rt,
573
- onChange: (e) => it(e.target.checked)
574
- }), c("includeDiagnostics")]
575
- }) : null,
576
- /* @__PURE__ */ a(me, {
577
- items: V.items,
578
- onRemove: V.remove,
579
- onRetry: V.retry,
580
- onOpen: Qe
581
- })
582
- ]
583
- }),
584
- /* @__PURE__ */ a("div", {
585
- class: "ck-card-foot",
586
- children: [
587
- ze ? /* @__PURE__ */ a(ie, {
588
- input: ut,
589
- onFiles: mt
590
- }) : null,
591
- /* @__PURE__ */ a("span", { class: "ck-spacer" }),
592
- /* @__PURE__ */ a("button", {
593
- class: "ck-btn",
594
- onClick: m,
595
- children: c("cancel")
596
- }),
597
- /* @__PURE__ */ a("button", {
598
- class: "ck-btn ck-primary",
599
- disabled: Y || !S.trim() || !X,
600
- onClick: () => void $(),
601
- children: c(Y ? "sending" : at && !f ? "signIn" : "send")
602
- })
603
- ]
604
- }),
605
- Ye !== null && J ? /* @__PURE__ */ a(J, {
606
- images: V.items.filter((e) => e.preview).map((e) => ({
607
- src: e.preview,
608
- name: e.file.name
609
- })),
610
- start: Ye,
611
- onClose: () => Xe(null)
612
- }) : null,
613
- We && w ? /* @__PURE__ */ a(We, {
614
- image: w.blob,
615
- onCancel: () => B(null),
616
- onDone: (e, t) => {
617
- Fe({
618
- ...w,
619
- blob: e
620
- }), Ue(t), B(null);
621
- }
622
- }) : null
623
- ]
624
- })] });
625
- }
626
- var ke = "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";
627
- function Ae(e) {
628
- let t = {};
629
- 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;
630
- }
631
- function je(e) {
632
- return e.region ? "50% 50%" : `50% ${Math.round(Math.min(100, Math.max(0, e.point.y / Math.max(1, innerHeight) * 100)))}%`;
633
- }
634
- var T = "commentkit:pending-extras";
635
- function Me(e) {
636
- try {
637
- return `${new URL(e ?? "https://commentkit.dev").origin}/privacy`;
638
- } catch {
639
- return "https://commentkit.dev/privacy";
640
- }
641
- }
642
- var E = "commentkit:guest-details";
643
- function Ne() {
644
- try {
645
- let e = JSON.parse(sessionStorage.getItem(E) ?? "null"), t = (e, t) => typeof e == "string" ? e.slice(0, t) : "";
646
- return {
647
- name: t(e?.name, 120),
648
- email: t(e?.email, 254)
649
- };
650
- } catch {
651
- return {
652
- name: "",
653
- email: ""
654
- };
655
- }
656
- }
657
- function Pe(e) {
658
- try {
659
- let t = JSON.parse(sessionStorage.getItem(T) ?? "null");
660
- return sessionStorage.removeItem(T), !t || t.id !== e ? null : {
661
- checklist: Array.isArray(t.checklist) ? t.checklist.filter((e) => typeof e == "string").slice(0, 30) : null,
662
- task: t.task && typeof t.task == "object" ? t.task : {},
663
- markup: Array.isArray(t.markup) ? t.markup.filter((e) => !!e && typeof e == "object" && Array.isArray(e.points)).slice(0, 100) : [],
664
- styles: ce(t.styles)
665
- };
666
- } catch {
667
- return null;
668
- }
669
- }
670
- function D(e, t) {
671
- try {
672
- sessionStorage.setItem(e, t);
673
- } catch {}
674
- }
675
- function O(e) {
676
- try {
677
- sessionStorage.removeItem(e);
678
- } catch {}
679
- }
680
- //#endregion
681
- export { w as Composer, p as t, _ as warmCapture };