@commentkit/comment-kit 0.7.4 → 0.7.5

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 (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  3. package/SECURITY.md +1 -1
  4. package/dist/angular.es.js +2 -2
  5. package/dist/comment-kit.es.js +3 -3
  6. package/dist/demo.es.js +24 -15
  7. package/dist/headless.es.js +2 -2
  8. package/dist/preact.es.js +2 -2
  9. package/dist/qwik.qwik.mjs +2 -2
  10. package/dist/react.es.js +2 -2
  11. package/dist/shared/ShadowRootContext-DD6a0QaI.js +11 -0
  12. package/dist/shared/annotation-toolbar-DgqxkHy8.js +1085 -0
  13. package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-DRX7dKDI.js} +3 -3
  14. package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
  15. package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
  16. package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-hSdcLShI.js} +2 -2
  17. package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
  18. package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-4zroOCCG.js} +7 -7
  19. package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-D4hTya6e.js} +28 -28
  20. package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-D068rcdY.js} +467 -503
  21. package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BDzNt0jv.js} +5077 -5253
  22. package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-BGnu_NgP.js} +2 -2
  23. package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-BCRmojWB.js} +4 -4
  24. package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-CYmUKmIV.js} +3 -3
  25. package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-BYsCpsGI.js} +48 -47
  26. package/dist/shared/dist-D9A5k-N4.js +617 -0
  27. package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-79Oo5pit.js} +4 -4
  28. package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-DuHk132g.js} +4 -4
  29. package/dist/shared/{pusher-D4M5K6Dk.js → pusher-3jyUauYd.js} +1 -1
  30. package/dist/shared/{realtime-BTqYEy8s.js → realtime-DspH16g5.js} +41 -28
  31. package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
  32. package/dist/shared/screenshot-BIuEaRiu.js +199 -0
  33. package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
  34. package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-3-yGIhMs.js} +3 -5
  35. package/dist/shared/{token-session-D0Y_HZw0.js → token-session-_Pi4fOEi.js} +1 -1
  36. package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
  37. package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
  38. package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-CvgZSo_L.js} +2 -2
  39. package/dist/solid.es.js +2 -2
  40. package/dist/svelte.es.js +2 -2
  41. package/dist/types/core/api-client.d.ts +17 -9
  42. package/dist/types/core/comment-kit-core.d.ts +4 -2
  43. package/dist/types/core/types.d.ts +37 -4
  44. package/dist/vue.es.js +2 -2
  45. package/docs/api-reference.md +29 -17
  46. package/package.json +1 -1
  47. package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
  48. package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
  49. package/dist/shared/dist-De294MVF.js +0 -623
@@ -0,0 +1,1085 @@
1
+ import { u as e } from "./comment-kit-core-D068rcdY.js";
2
+ import { C as t, F as n, P as r, T as i, d as a, f as o, l as s, m as c, o as l, s as u, t as d, u as f } from "./button-D4GHW6oZ.js";
3
+ import { $t as p, Ct as m, Et as ee, Nt as h, Ot as g, Tt as _, Zt as v, en as te, i as y, o as b, r as x, t as S, x as C, xt as ne } from "./separator-UhJb0Row.js";
4
+ import { E as w, M as re, S as ie, h as ae, j as oe, n as se, t as ce, u as le, y as ue } from "./useValueChanged-DKq5cMot.js";
5
+ import { a as de } from "./ShadowRootContext-DD6a0QaI.js";
6
+ import { a as fe, i as pe, l as me, n as he, o as ge, r as _e, s as T, t as E, u as ve } from "./button-group-BVR7iT-S.js";
7
+ import { A as ye, B as D, D as O, E as be, F as xe, I as k, L as A, M as Se, O as j, P as M, R as N, T as Ce, b as we, d as P, f as F, k as Te, o as I, s as L, w as R, x as Ee, y as De, z } from "./comment-kit-ui-BDzNt0jv.js";
8
+ import { a as Oe, c as ke, d as B, l as V, n as Ae, o as H, r as je, s as U, t as Me, u as W } from "./annotation-icons-Dh-bmNYK.js";
9
+ import * as G from "react";
10
+ import { jsx as K, jsxs as q } from "react/jsx-runtime";
11
+ var J = () => () => {}, Ne = () => !0, Pe = () => !1;
12
+ function Fe() {
13
+ return C(J, Ne, Pe);
14
+ }
15
+ function Ie() {
16
+ let [e, t] = G.useState(!1);
17
+ return G.useEffect(() => {
18
+ t(!0);
19
+ }, []), e;
20
+ }
21
+ var Le = a(18) ? Fe : Ie;
22
+ function Re() {
23
+ return !Le();
24
+ }
25
+ function ze(e) {
26
+ let { script: t } = e, { nonce: n } = F();
27
+ return Re() ? /*#__PURE__*/ K("script", {
28
+ nonce: n,
29
+ dangerouslySetInnerHTML: { __html: t },
30
+ suppressHydrationWarning: !0
31
+ }) : null;
32
+ }
33
+ function Y() {
34
+ let e = G.useRef(0), [t, n] = G.useState({
35
+ paths: [],
36
+ undone: [],
37
+ activePath: null,
38
+ tool: "pen",
39
+ color: Se,
40
+ strokeWidth: 3
41
+ }), r = G.useCallback((e) => {
42
+ n((t) => ({
43
+ ...t,
44
+ tool: e
45
+ }));
46
+ }, []), i = G.useCallback((e) => {
47
+ n((t) => ({
48
+ ...t,
49
+ color: e
50
+ }));
51
+ }, []), a = G.useCallback((e) => {
52
+ n((t) => ({
53
+ ...t,
54
+ strokeWidth: e
55
+ }));
56
+ }, []), o = G.useCallback((t, r, i = 1) => {
57
+ let a = `path-${String(++e.current)}`;
58
+ n((e) => ({
59
+ ...e,
60
+ activePath: {
61
+ id: a,
62
+ tool: e.tool,
63
+ points: [{
64
+ x: t,
65
+ y: r
66
+ }],
67
+ color: e.color,
68
+ strokeWidth: e.strokeWidth * i
69
+ }
70
+ }));
71
+ }, []), s = G.useCallback((e, t) => {
72
+ n((n) => {
73
+ if (!n.activePath) return n;
74
+ if (n.activePath.tool === "pen") return {
75
+ ...n,
76
+ activePath: {
77
+ ...n.activePath,
78
+ points: [...n.activePath.points, {
79
+ x: e,
80
+ y: t
81
+ }]
82
+ }
83
+ };
84
+ let r = n.activePath.points[0] ?? {
85
+ x: 0,
86
+ y: 0
87
+ };
88
+ return {
89
+ ...n,
90
+ activePath: {
91
+ ...n.activePath,
92
+ points: [r, {
93
+ x: e,
94
+ y: t
95
+ }]
96
+ }
97
+ };
98
+ });
99
+ }, []), c = G.useCallback(() => {
100
+ n((e) => !e.activePath || e.activePath.points.length < 2 ? {
101
+ ...e,
102
+ activePath: null
103
+ } : {
104
+ ...e,
105
+ paths: [...e.paths, e.activePath],
106
+ undone: [],
107
+ activePath: null
108
+ });
109
+ }, []), l = G.useCallback(() => {
110
+ n((e) => ({
111
+ ...e,
112
+ activePath: null
113
+ }));
114
+ }, []), u = G.useCallback(() => {
115
+ n((e) => e.paths.length === 0 ? e : {
116
+ ...e,
117
+ paths: e.paths.slice(0, -1),
118
+ undone: [...e.undone, ...e.paths.slice(-1)]
119
+ });
120
+ }, []), d = G.useCallback(() => {
121
+ n((e) => e.undone.length === 0 ? e : {
122
+ ...e,
123
+ paths: [...e.paths, ...e.undone.slice(-1)],
124
+ undone: e.undone.slice(0, -1)
125
+ });
126
+ }, []), f = G.useCallback(() => {
127
+ n((e) => ({
128
+ ...e,
129
+ paths: [],
130
+ undone: [],
131
+ activePath: null
132
+ }));
133
+ }, []);
134
+ return {
135
+ ...t,
136
+ setTool: r,
137
+ setColor: i,
138
+ setStrokeWidth: a,
139
+ startPath: o,
140
+ addPoint: s,
141
+ endPath: c,
142
+ cancelPath: l,
143
+ undo: u,
144
+ redo: d,
145
+ clear: f,
146
+ canUndo: t.paths.length > 0,
147
+ canRedo: t.undone.length > 0
148
+ };
149
+ }
150
+ function X(e) {
151
+ let t = e.composedPath?.()[0] ?? e.target;
152
+ return t instanceof Element ? [
153
+ "INPUT",
154
+ "TEXTAREA",
155
+ "SELECT"
156
+ ].includes(t.tagName) || t instanceof HTMLElement && t.isContentEditable : !1;
157
+ }
158
+ function Be(t, n, r) {
159
+ G.useEffect(() => {
160
+ let i = (i) => {
161
+ if (e() || i.defaultPrevented || i.isComposing || X(i)) return;
162
+ let a = i.key.toLowerCase();
163
+ (i.metaKey || i.ctrlKey) && !i.altKey && (a === "z" || a === "y") ? (i.preventDefault(), a === "y" || i.shiftKey ? n() : t()) : i.key === "Escape" && (i.preventDefault(), r());
164
+ };
165
+ return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
166
+ }, [
167
+ t,
168
+ n,
169
+ r
170
+ ]);
171
+ }
172
+ function Ve(e, t) {
173
+ return e - t;
174
+ }
175
+ function He(e, t, n, r, i, a) {
176
+ let o = P(e, n, r);
177
+ if (!i) return o;
178
+ let s = a.slice();
179
+ return s[t] = P(o, a[t - 1] ?? -Infinity, a[t + 1] ?? Infinity), s.sort(Ve);
180
+ }
181
+ function Ue(e, t, n) {
182
+ if (!Array.isArray(e)) return !0;
183
+ let r = t * n;
184
+ for (let t = 0; t < e.length - 1; t += 1) if (!(Math.abs(e[t] - e[t + 1]) >= r)) return !1;
185
+ return !0;
186
+ }
187
+ var Z = () => null, We = {
188
+ activeThumbIndex: Z,
189
+ max: Z,
190
+ min: Z,
191
+ minStepsBetweenValues: Z,
192
+ step: Z,
193
+ values: Z,
194
+ ...ye
195
+ }, Ge = /*#__PURE__*/ G.createContext(void 0);
196
+ function Ke() {
197
+ let e = G.useContext(Ge);
198
+ if (e === void 0) throw Error(r(62));
199
+ return e;
200
+ }
201
+ function qe(e, t) {
202
+ return e === t || Array.isArray(e) && Array.isArray(t) && Ee(e, t);
203
+ }
204
+ var Je = /*#__PURE__*/ G.forwardRef(function(e, t) {
205
+ let { "aria-labelledby": r, className: i, defaultValue: a, disabled: c = !1, id: l, format: u, largeStep: d = 10, locale: f, render: ee, max: h = 100, min: g = 0, minStepsBetweenValues: _ = 0, form: te, name: y, onValueChange: b, onValueCommitted: x, orientation: S = "horizontal", step: C = 1, thumbCollisionBehavior: ne = "push", thumbAlignment: w = "center", value: le, style: de, ...fe } = e, pe = se(l), me = De(pe), he = o(b), ge = o(x), { clearErrors: _e } = be(), { state: T, disabled: E, name: ve, setTouched: ye, setDirty: D, validityData: xe, validation: A } = Te(), { labelId: Se } = Ce(), [j, M] = G.useState(), F = r ?? we(Se, j), I = E || c, L = ve ?? y, [R, z] = N({
206
+ controlled: le,
207
+ default: a ?? g,
208
+ name: "Slider"
209
+ }), Oe = G.useRef(null), ke = G.useRef(null), B = G.useRef([]), V = G.useRef(null), Ae = G.useRef(-1), H = G.useRef(null), je = G.useRef(ie), [U, Me] = G.useState(-1), [W, q] = G.useState(-1), [J, Ne] = G.useState(!1), [Pe, Fe] = G.useState(() => /* @__PURE__ */ new Map()), [Ie, Le] = G.useState([void 0, void 0]), Re = o((e) => {
210
+ Me(e), e !== -1 && q(e);
211
+ }), ze = o((e) => {
212
+ e && (ke.current = e);
213
+ }), Y = Array.isArray(R), X = G.useMemo(() => Y ? R.map((e) => P(e, g, h)).sort(Ve) : [P(R, g, h)], [
214
+ h,
215
+ g,
216
+ Y,
217
+ R
218
+ ]), Be = Y ? X : X[0];
219
+ O(A.inputRef, pe, Be, void 0, !I, y), ce(Be, () => {
220
+ _e(L), A.change(Be);
221
+ let e = xe.initialValue, t;
222
+ t = Array.isArray(Be) && Array.isArray(e) ? !Ee(Be, e) : Be !== e, D(t);
223
+ });
224
+ let Z = o((e, t) => {
225
+ if (Number.isNaN(e) || qe(e, R)) return !1;
226
+ let n = t.event, r = n.constructor, i = new r(n.type, n);
227
+ return Object.defineProperty(i, "target", {
228
+ writable: !0,
229
+ value: {
230
+ value: e,
231
+ name: L
232
+ }
233
+ }), t.event = i, he(e, t), !t.isCanceled && (je.current = t.reason, z(e), !0);
234
+ }), Ke = o((e, t, n) => {
235
+ let r = He(e, t, g, h, Y, X);
236
+ if (Ue(r, C, _)) {
237
+ let e = "key" in n ? ue : ae, i = Z(r, oe(e, n.nativeEvent, void 0, { activeThumbIndex: t }));
238
+ ye(!0), i && ge(r, re(e, n.nativeEvent));
239
+ }
240
+ });
241
+ n(() => {
242
+ if (!I) return;
243
+ let e = v(m(Oe.current));
244
+ p(Oe.current, e) && e.blur(), U !== -1 && Re(-1);
245
+ }, [
246
+ U,
247
+ I,
248
+ Re
249
+ ]);
250
+ let Je = G.useMemo(() => ({
251
+ ...T,
252
+ activeThumbIndex: U,
253
+ disabled: I,
254
+ dragging: J,
255
+ orientation: S,
256
+ max: h,
257
+ min: g,
258
+ minStepsBetweenValues: _,
259
+ step: C,
260
+ values: X
261
+ }), [
262
+ T,
263
+ U,
264
+ I,
265
+ J,
266
+ h,
267
+ g,
268
+ _,
269
+ S,
270
+ C,
271
+ X
272
+ ]), Q = G.useMemo(() => ({
273
+ active: U,
274
+ controlRef: ke,
275
+ disabled: I,
276
+ dragging: J,
277
+ validation: A,
278
+ format: u,
279
+ handleInputChange: Ke,
280
+ indicatorPosition: Ie,
281
+ inset: w !== "center",
282
+ isArrayValue: Y,
283
+ labelId: F,
284
+ rootLabelId: me,
285
+ largeStep: d,
286
+ lastUsedThumbIndex: W,
287
+ lastChangeReasonRef: je,
288
+ form: te,
289
+ locale: f,
290
+ max: h,
291
+ min: g,
292
+ minStepsBetweenValues: _,
293
+ name: L,
294
+ onValueCommitted: ge,
295
+ orientation: S,
296
+ pressedThumbCenterOffsetRef: V,
297
+ pressedThumbIndexRef: Ae,
298
+ pressedValuesRef: H,
299
+ registerFieldControlRef: ze,
300
+ renderBeforeHydration: w === "edge",
301
+ setActive: Re,
302
+ setDragging: Ne,
303
+ setIndicatorPosition: Le,
304
+ setLabelId: M,
305
+ setValue: Z,
306
+ state: Je,
307
+ step: C,
308
+ thumbCollisionBehavior: ne,
309
+ thumbMap: Pe,
310
+ thumbRefs: B,
311
+ values: X
312
+ }), [
313
+ U,
314
+ F,
315
+ me,
316
+ I,
317
+ J,
318
+ A,
319
+ u,
320
+ Ke,
321
+ Ie,
322
+ d,
323
+ W,
324
+ te,
325
+ f,
326
+ h,
327
+ g,
328
+ _,
329
+ L,
330
+ ge,
331
+ S,
332
+ Y,
333
+ ze,
334
+ Re,
335
+ Z,
336
+ Je,
337
+ C,
338
+ ne,
339
+ w,
340
+ Pe,
341
+ X
342
+ ]), Ye = s("div", e, {
343
+ state: Je,
344
+ ref: [t, Oe],
345
+ props: [
346
+ {
347
+ "aria-labelledby": F,
348
+ id: pe,
349
+ role: "group"
350
+ },
351
+ fe,
352
+ (e) => A.getValidationProps(I, e)
353
+ ],
354
+ stateAttributesMapping: We
355
+ });
356
+ return /*#__PURE__*/ K(Ge.Provider, {
357
+ value: Q,
358
+ children: /*#__PURE__*/ K(k, {
359
+ elementsRef: B,
360
+ onMapChange: Fe,
361
+ children: Ye
362
+ })
363
+ });
364
+ });
365
+ function Q(e) {
366
+ return e === "touch" || e === "pen";
367
+ }
368
+ function Ye(e, t) {
369
+ let n = e.getBoundingClientRect();
370
+ return t ? (n.top + n.bottom) / 2 : (n.left + n.right) / 2;
371
+ }
372
+ function Xe(e) {
373
+ if (e === 0) return 0;
374
+ if (Math.abs(e) < 1) {
375
+ let t = e.toExponential().split("e-"), n = t[0].split(".")[1];
376
+ return (n ? n.length : 0) + parseInt(t[1], 10);
377
+ }
378
+ let t = e.toString().split(".")[1];
379
+ return t ? t.length : 0;
380
+ }
381
+ function Ze(e, t, n) {
382
+ let r = Math.round((e - n) / t) * t + n;
383
+ return Number(r.toFixed(Math.max(Xe(t), Xe(n))));
384
+ }
385
+ function $(e, t, n, r, i, a, o, s) {
386
+ let c = e.slice(), l = a * o, u = c.length - 1, d = s ?? e, f = r + t * l, p = i - (u - t) * l;
387
+ c[t] = P(n, f, p);
388
+ for (let e = t + 1; e <= u; e += 1) {
389
+ let t = c[e - 1] + l, n = i - (u - e) * l, r = d[e], a = Math.max(c[e], t);
390
+ r < a && (a = Math.max(r, t)), c[e] = P(a, t, n);
391
+ }
392
+ for (let e = t - 1; e >= 0; --e) {
393
+ let t = c[e + 1] - l, n = r + e * l, i = d[e], a = Math.min(c[e], t);
394
+ i > a && (a = Math.min(i, t)), c[e] = P(a, n, t);
395
+ }
396
+ for (let e = 0; e <= u; e += 1) c[e] = Number(c[e].toFixed(12));
397
+ return c;
398
+ }
399
+ function Qe(e, t, n, r, i, a, o, s, c, l) {
400
+ let u = n ?? t, d = r ?? t;
401
+ if (!(u.length > 1)) return {
402
+ value: a,
403
+ thumbIndex: 0,
404
+ didSwap: !1
405
+ };
406
+ let f = c * l;
407
+ if (e === "push") return {
408
+ value: $(u, i, a, o, s, c, l),
409
+ thumbIndex: i,
410
+ didSwap: !1
411
+ };
412
+ let p = u.slice(), m = p[i - 1], ee = p[i + 1], h = m == null ? o : m + f, g = ee == null ? s : ee - f, _ = Number(P(a, h, g).toFixed(12));
413
+ switch (p[i] = _, e) {
414
+ case "swap": {
415
+ let e = u[i], t = 1e-7, n = a > e, r = a < e, h = n && ee != null && a >= ee - t, g = r && m != null && a <= m + t;
416
+ if (!h && !g) return {
417
+ value: p,
418
+ thumbIndex: i,
419
+ didSwap: !1
420
+ };
421
+ let v = h ? i + 1 : i - 1, te = p.map((e, t) => t === i ? _ : d[t] ?? u[t]), y = a;
422
+ y = h ? Math.max(a, p[v]) : Math.min(a, p[v]);
423
+ let b = $(p, v, y, o, s, c, l, te), x = h ? v - 1 : v + 1, S = b[x - 1], C = b[x + 1], ne = S == null ? o : S + f;
424
+ ne = Math.max(ne, o + x * f);
425
+ let w = C == null ? s : C - f;
426
+ w = Math.min(w, s - (b.length - 1 - x) * f);
427
+ let re = P(_, ne, w);
428
+ return b[x] = Number(re.toFixed(12)), {
429
+ value: b,
430
+ thumbIndex: v,
431
+ didSwap: !0
432
+ };
433
+ }
434
+ default: return {
435
+ value: p,
436
+ thumbIndex: i,
437
+ didSwap: !1
438
+ };
439
+ }
440
+ }
441
+ var $e = 2;
442
+ function et(e, t) {
443
+ if (!e) return {
444
+ start: 0,
445
+ end: 0
446
+ };
447
+ function n(e) {
448
+ let t = e == null ? 0 : parseFloat(e);
449
+ return Number.isNaN(t) ? 0 : t;
450
+ }
451
+ let r = t ? "Top" : "InlineStart", i = t ? "Bottom" : "InlineEnd";
452
+ return {
453
+ start: n(e[`border${r}Width`]) + n(e[`padding${r}`]),
454
+ end: n(e[`border${i}Width`]) + n(e[`padding${i}`])
455
+ };
456
+ }
457
+ function tt(e, t) {
458
+ if (t.current != null && e.changedTouches) {
459
+ let n = e;
460
+ for (let e = 0; e < n.changedTouches.length; e += 1) {
461
+ let r = n.changedTouches[e];
462
+ if (r.identifier === t.current) return {
463
+ x: r.clientX,
464
+ y: r.clientY
465
+ };
466
+ }
467
+ return null;
468
+ }
469
+ return {
470
+ x: e.clientX,
471
+ y: e.clientY
472
+ };
473
+ }
474
+ var nt = /*#__PURE__*/ G.forwardRef(function(e, n) {
475
+ let { render: r, className: a, style: c, ...l } = e, { disabled: u, dragging: d, inset: f, isArrayValue: h, lastChangeReasonRef: y, max: b, min: x, minStepsBetweenValues: S, onValueCommitted: C, orientation: ne, pressedThumbCenterOffsetRef: ie, pressedThumbIndexRef: ae, pressedValuesRef: se, registerFieldControlRef: ce, renderBeforeHydration: ue, setActive: fe, setDragging: pe, setValue: me, state: he, step: ge, thumbCollisionBehavior: _e, thumbRefs: T, values: E } = Ke(), ve = de(), ye = E.length > 1, D = ne === "vertical", O = G.useRef(null), be = G.useRef(null), xe = o((e) => {
476
+ e && be.current == null && (be.current = t(e).getComputedStyle(e));
477
+ }), k = G.useRef(null), A = G.useRef(0), Se = G.useRef(0), j = G.useRef(null), M = G.useRef(!1), N = ee(E);
478
+ function Ce(e) {
479
+ return e?.querySelector("input[type=\"range\"]");
480
+ }
481
+ function we(e) {
482
+ ae.current = e, T.current[e] || (ie.current = null);
483
+ }
484
+ function F() {
485
+ ae.current = -1, ie.current = null;
486
+ }
487
+ function Te(e) {
488
+ return i(e) ? T.current.some((t) => !i(t) || !p(t, e) ? !1 : Ce(t)?.disabled === !0) : !1;
489
+ }
490
+ function I(e) {
491
+ let t = O.current, n = ae.current;
492
+ if (!t || n < 0 || n >= E.length) return n >= E.length && (j.current = null), null;
493
+ let { width: r, height: i, bottom: a, left: o, right: s } = t.getBoundingClientRect(), c = et(be.current, D), l = Se.current, u = (D ? i : r) - c.start - c.end - l * 2, d = ie.current ?? 0, f = e.x - d, p = e.y - d, m = D ? a - p - c.end : (ve === "rtl" ? s - f : f - o) - c.start, ee = P((m - l) / u, 0, 1), g = (b - x) * ee + x;
494
+ return g = Ze(g, ge, x), g = P(g, x, b), ye ? Qe(_e, E, N.current, se.current, n, g, x, b, ge, S) : {
495
+ value: h ? [g] : g,
496
+ thumbIndex: n,
497
+ didSwap: !1
498
+ };
499
+ }
500
+ function L(e) {
501
+ se.current = ye ? E.slice() : null, j.current = null, N.current = E;
502
+ let t = ae.current, n = t;
503
+ if (t > -1 && t < E.length) {
504
+ if (E[t] === b) {
505
+ let e = t;
506
+ for (; e > 0 && E[e - 1] === b;) --e;
507
+ n = e;
508
+ }
509
+ } else {
510
+ let t = D ? "y" : "x", r;
511
+ n = -1;
512
+ for (let a = 0; a < T.current.length; a += 1) {
513
+ let o = T.current[a];
514
+ if (i(o) && !Ce(o)?.disabled) {
515
+ let i = Ye(o, D), s = Math.abs(e[t] - i);
516
+ (r === void 0 || s <= r) && (n = a, r = s);
517
+ }
518
+ }
519
+ }
520
+ if (n > -1 && n !== t && we(n), f) {
521
+ let e = T.current[n];
522
+ if (i(e)) {
523
+ let t = e.getBoundingClientRect();
524
+ Se.current = t[D ? "height" : "width"] / 2;
525
+ }
526
+ }
527
+ }
528
+ function R(e) {
529
+ let t = Ce(T.current?.[e]);
530
+ t && t.focus({
531
+ preventScroll: !0,
532
+ focusVisible: !1
533
+ });
534
+ }
535
+ function Ee(e, t, n) {
536
+ let r = me(e.value, oe(t, n, void 0, { activeThumbIndex: e.thumbIndex }));
537
+ return r && (j.current = e.value, N.current = Array.isArray(e.value) ? e.value : [e.value], e.didSwap && (we(e.thumbIndex), R(e.thumbIndex))), r;
538
+ }
539
+ let De = o((e) => {
540
+ let t = tt(e, k);
541
+ if (t == null) return;
542
+ if (A.current += 1, e.type === "pointermove" && e.buttons === 0) {
543
+ z(e);
544
+ return;
545
+ }
546
+ let n = I(t);
547
+ n != null && Ue(n.value, ge, S) && (!d && A.current > $e && pe(!0), Ee(n, le, e));
548
+ }), z = o((e) => {
549
+ if (tt(e, k) == null) return;
550
+ fe(-1), pe(!1), ie.current = null;
551
+ let t = j.current;
552
+ if (Array.isArray(t) && t.length !== E.length && (j.current = null), j.current != null) {
553
+ let t = y.current;
554
+ C(j.current, re(t, e));
555
+ }
556
+ "pointerType" in e && O.current?.hasPointerCapture(e.pointerId) && O.current?.releasePointerCapture(e.pointerId), ae.current = -1, B();
557
+ }), Oe = o((e) => {
558
+ k.current ?? z(e);
559
+ }), ke = o((e) => {
560
+ let t = M.current;
561
+ if (M.current = !1, u) return;
562
+ if (Te(te(e))) {
563
+ F();
564
+ return;
565
+ }
566
+ let n = e.changedTouches[0];
567
+ if (n == null) return;
568
+ if (k.current = n.identifier, !t) {
569
+ let t = {
570
+ x: n.clientX,
571
+ y: n.clientY
572
+ };
573
+ L(t);
574
+ let r = I(t);
575
+ if (r == null) return;
576
+ R(r.thumbIndex), Ee(r, w, e), A.current = 0;
577
+ }
578
+ let r = m(O.current);
579
+ r.addEventListener("touchmove", De, { passive: !0 }), r.addEventListener("touchend", z, { passive: !0 }), r.addEventListener("touchcancel", z, { passive: !0 });
580
+ }), B = o(() => {
581
+ let e = m(O.current);
582
+ e.removeEventListener("pointermove", De), e.removeEventListener("pointerup", z), e.removeEventListener("pointercancel", Oe), e.removeEventListener("touchmove", De), e.removeEventListener("touchend", z), e.removeEventListener("touchcancel", z), k.current = null, se.current = null, j.current = null, M.current = !1;
583
+ }), V = _();
584
+ return G.useEffect(() => {
585
+ let e = O.current;
586
+ if (!e) return () => B();
587
+ let t = g(e, "touchstart", ke, { passive: !0 });
588
+ return () => {
589
+ t(), V.cancel(), B();
590
+ };
591
+ }, [
592
+ B,
593
+ ke,
594
+ O,
595
+ V
596
+ ]), G.useEffect(() => {
597
+ u && B();
598
+ }, [u, B]), s("div", e, {
599
+ state: he,
600
+ ref: [
601
+ n,
602
+ ce,
603
+ O,
604
+ xe
605
+ ],
606
+ props: [{
607
+ "data-base-ui-slider-control": ue ? "" : void 0,
608
+ onPointerDown(e) {
609
+ M.current = !1;
610
+ let t = O.current, n = te(e.nativeEvent);
611
+ if (!t || u || e.defaultPrevented || !i(n) || e.button !== 0) return;
612
+ if (Te(n)) {
613
+ F();
614
+ return;
615
+ }
616
+ let r = {
617
+ x: e.clientX,
618
+ y: e.clientY
619
+ };
620
+ L(r);
621
+ let a = I(r);
622
+ if (a == null) return;
623
+ p(T.current[a.thumbIndex], v(m(t))) ? e.preventDefault() : V.request(() => {
624
+ R(a.thumbIndex);
625
+ }), pe(!0), ie.current ?? Ee(a, w, e.nativeEvent), e.nativeEvent.pointerId && t.setPointerCapture(e.nativeEvent.pointerId), A.current = 0, M.current = Q(e.pointerType);
626
+ let o = m(t);
627
+ o.addEventListener("pointermove", De, { passive: !0 }), o.addEventListener("pointerup", z, { once: !0 }), o.addEventListener("pointercancel", Oe, { once: !0 });
628
+ }
629
+ }, l],
630
+ stateAttributesMapping: We
631
+ });
632
+ }), rt = /*#__PURE__*/ G.forwardRef(function(e, t) {
633
+ let { render: n, className: r, style: i, ...a } = e, { state: o } = Ke();
634
+ return s("div", e, {
635
+ state: o,
636
+ ref: t,
637
+ props: [{ style: { position: "relative" } }, a],
638
+ stateAttributesMapping: We
639
+ });
640
+ }), it = "data-index", at, ot = /* @__PURE__ */ new Set([
641
+ ...ge,
642
+ ve,
643
+ me
644
+ ]);
645
+ function st(e, t, n, r) {
646
+ if (!(t < 0)) return e.length === 2 ? `${L(e[t], r, n)} ${t === 0 ? "start" : "end"} range` : n ? L(e[t], r, n) : void 0;
647
+ }
648
+ function ct(e, t, n, r, i) {
649
+ let a = e + t * n, o = Number(a.toFixed(Math.max(Xe(e), Xe(t), Xe(r))));
650
+ return P(o, r, i);
651
+ }
652
+ var lt = /*#__PURE__*/ G.forwardRef(function(e, r) {
653
+ let { render: i, children: a, className: l, "aria-describedby": u, "aria-label": d, "aria-labelledby": m, "aria-valuetext": ee, disabled: g = !1, getAriaLabel: _, getAriaValueText: v, id: te, index: y, inputRef: b, onBlur: x, onFocus: S, onKeyDown: C, tabIndex: w, style: re, ...ie } = e, ae = se(te), { active: oe, lastUsedThumbIndex: ce, controlRef: le, disabled: ue, validation: E, format: ye, handleInputChange: D, inset: O, isArrayValue: be, labelId: xe, largeStep: k, locale: Se, max: M, min: N, minStepsBetweenValues: Ce, form: we, name: P, orientation: F, pressedThumbCenterOffsetRef: Ee, pressedThumbIndexRef: De, renderBeforeHydration: z, setActive: Oe, setIndicatorPosition: ke, state: B, step: V, thumbRefs: Ae, values: H } = Ke(), je = de(), U = g || ue, Me = H.length > 1, W = F === "vertical", J = je === "rtl", { setTouched: Ne, validationMode: Pe } = Te(), Fe = G.useRef(null), Ie = G.useRef(null), Le = j(U, Ie), Y = G.useRef(!1), X = o((e) => {
654
+ Y.current || S?.(e);
655
+ }), Be = o((e) => {
656
+ Y.current || x?.(e);
657
+ }), Ve = se(), Ue = R(), Z = Me ? Ve : Ue, Ge = G.useMemo(() => ({ inputId: Z }), [Z]), { ref: qe, index: Je } = A({ metadata: Ge }), Q = Me ? y ?? Je : 0, Xe = Q === H.length - 1, $ = H[Q], Qe = I($, N, M), [$e, et] = G.useState(), tt = Re(), nt = ce >= 0 && ce < H.length ? ce : -1, rt = o(() => {
658
+ let e = le.current, t = Fe.current;
659
+ if (!e || !t) return;
660
+ let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = W ? "height" : "width", a = r[i] - n[i], o = (n[i] / 2 + a * Qe / 100) / r[i] * 100, s = Number.isFinite(o) ? o : void 0;
661
+ et(s), Q === 0 ? ke((e) => [s, e[1]]) : Xe && ke((e) => [e[0], s]);
662
+ });
663
+ n(() => {
664
+ O && queueMicrotask(rt);
665
+ }, [rt, O]), n(() => {
666
+ O && rt();
667
+ }, [
668
+ rt,
669
+ O,
670
+ Qe
671
+ ]), n(() => {
672
+ if (!O) return;
673
+ let e = le.current, n = Fe.current;
674
+ if (!e || !n) return;
675
+ let r = t(e).ResizeObserver;
676
+ if (typeof r != "function") return;
677
+ let i = new r(rt);
678
+ return i.observe(e), i.observe(n), () => {
679
+ i.disconnect();
680
+ };
681
+ }, [
682
+ le,
683
+ rt,
684
+ O
685
+ ]);
686
+ let lt = W ? "bottom" : "insetInlineStart", ut = W ? "left" : "top", dt;
687
+ Me ? oe === Q ? dt = 2 : nt === Q && (dt = 1) : oe === Q && (dt = 1);
688
+ let ft;
689
+ ft = !O && !Number.isFinite(Qe) ? ne : {
690
+ position: "absolute",
691
+ [lt]: O ? "var(--position)" : `${Qe}%`,
692
+ [ut]: "50%",
693
+ translate: `${(W || !J ? -1 : 1) * 50}% ${(W ? 1 : -1) * 50}%`,
694
+ zIndex: dt,
695
+ ...O && {
696
+ "--position": `${$e ?? 0}%`,
697
+ visibility: z && tt || $e === void 0 ? "hidden" : void 0
698
+ }
699
+ };
700
+ let pt;
701
+ W && (pt = J ? "vertical-rl" : "vertical-lr");
702
+ let mt = typeof _ == "function" ? _(Q) : d, ht = f({
703
+ "aria-label": mt,
704
+ "aria-labelledby": m ?? (mt == null ? xe : void 0),
705
+ "aria-describedby": u,
706
+ "aria-orientation": F,
707
+ "aria-valuenow": $,
708
+ "aria-valuetext": typeof v == "function" ? v(L($, Se, ye), $, Q) : ee ?? st(H, Q, ye, Se),
709
+ disabled: U,
710
+ form: we,
711
+ id: Z,
712
+ max: M,
713
+ min: N,
714
+ name: P,
715
+ onChange(e) {
716
+ D(e.currentTarget.valueAsNumber, Q, e);
717
+ },
718
+ onFocus(e) {
719
+ let t = Y.current;
720
+ Y.current = !1, Oe(Q), Le(!0), t && e.stopPropagation();
721
+ },
722
+ onBlur(e) {
723
+ Y.current ? e.stopPropagation() : (Oe(-1), !Ae.current.some((t) => p(t, e.relatedTarget)) && (Ne(!0), Le(!1), Pe === "onBlur" && E.commit(He($, Q, N, M, be, H))));
724
+ },
725
+ onKeyDown(e) {
726
+ if (e.defaultPrevented || !ot.has(e.key)) return;
727
+ ge.has(e.key) && e.stopPropagation();
728
+ let t = null, n = 0, r = e.shiftKey ? k : V, i = Ze($, V, N);
729
+ switch (e.key) {
730
+ case fe:
731
+ n = 1;
732
+ break;
733
+ case pe:
734
+ n = J ? -1 : 1;
735
+ break;
736
+ case he:
737
+ n = -1;
738
+ break;
739
+ case _e:
740
+ n = J ? 1 : -1;
741
+ break;
742
+ case ve:
743
+ r = k, n = 1;
744
+ break;
745
+ case me:
746
+ r = k, n = -1;
747
+ break;
748
+ case "End":
749
+ t = Me && Number.isFinite(H[Q + 1]) ? H[Q + 1] - V * Ce : M;
750
+ break;
751
+ case T: t = Me && Number.isFinite(H[Q - 1]) ? H[Q - 1] + V * Ce : N;
752
+ }
753
+ if (n !== 0 && (t = ct(i, r, n, N, M)), t !== null) {
754
+ let n = e.currentTarget;
755
+ h(n) || (Y.current = !0, n.blur(), n.focus({
756
+ preventScroll: !0,
757
+ focusVisible: !0
758
+ })), D(t, Q, e), e.preventDefault();
759
+ }
760
+ },
761
+ step: V,
762
+ style: {
763
+ ...ne,
764
+ width: "100%",
765
+ height: "100%",
766
+ writingMode: pt
767
+ },
768
+ tabIndex: w,
769
+ type: "range",
770
+ value: $ ?? ""
771
+ }, (e) => E.getValidationProps(U, e), {
772
+ onFocus: X,
773
+ onBlur: Be,
774
+ onKeyDown: C
775
+ }), gt = c(Ie, E.inputRef, b);
776
+ return s("div", e, {
777
+ state: B,
778
+ ref: [
779
+ r,
780
+ qe,
781
+ Fe
782
+ ],
783
+ props: [{
784
+ [it]: Q,
785
+ children: /*#__PURE__*/ q(G.Fragment, { children: [
786
+ a,
787
+ /*#__PURE__*/ K("input", {
788
+ ref: gt,
789
+ ...ht,
790
+ suppressHydrationWarning: !0
791
+ }),
792
+ O && Xe && z && (at ||= /*#__PURE__*/ K(ze, { script: "" }))
793
+ ] }),
794
+ id: ae,
795
+ onPointerDown(e) {
796
+ if (U) return;
797
+ De.current = Q;
798
+ let t = Ye(e.currentTarget, W);
799
+ Ee.current = (W ? e.clientY : e.clientX) - t;
800
+ },
801
+ style: ft,
802
+ suppressHydrationWarning: z || void 0
803
+ }, ie],
804
+ stateAttributesMapping: We
805
+ });
806
+ });
807
+ function ut(e, t, n, r, i, a) {
808
+ let o = {
809
+ visibility: a || n && (r === void 0 || t && i === void 0) ? "hidden" : void 0,
810
+ position: e ? "absolute" : "relative",
811
+ [e ? "width" : "height"]: "inherit"
812
+ }, s = `${r ?? 0}%`, c = `${(i ?? 0) - (r ?? 0)}%`;
813
+ return n && (o["--start-position"] = s, s = "var(--start-position)", t && (o["--relative-size"] = c, c = "var(--relative-size)")), o[e ? "bottom" : "insetInlineStart"] = t ? s : 0, o[e ? "height" : "width"] = t ? c : s, o;
814
+ }
815
+ var dt = /*#__PURE__*/ G.forwardRef(function(e, t) {
816
+ let { render: n, className: r, style: i, ...a } = e, { indicatorPosition: o, inset: c, max: l, min: u, orientation: d, renderBeforeHydration: f, state: p, values: m } = Ke(), ee = Re(), h = ut(d === "vertical", m.length > 1, c, c ? o[0] : I(m[0], u, l), c ? o[1] : I(m[m.length - 1], u, l), c && f && ee);
817
+ return s("div", e, {
818
+ state: p,
819
+ ref: t,
820
+ props: [{
821
+ "data-base-ui-slider-indicator": f ? "" : void 0,
822
+ style: h,
823
+ suppressHydrationWarning: f || void 0
824
+ }, a],
825
+ stateAttributesMapping: We
826
+ });
827
+ }), ft = G.forwardRef(function({ className: e, defaultValue: t, value: n, min: r = 0, max: i = 100, thumbAriaLabels: a, ...o }, s) {
828
+ let c = G.useMemo(() => Array.isArray(n) ? n : Array.isArray(t) ? t : [r], [
829
+ n,
830
+ t,
831
+ r
832
+ ]);
833
+ return /* @__PURE__ */ K(Je, {
834
+ ref: s,
835
+ className: u("ck-slider", e),
836
+ "data-slot": "slider",
837
+ defaultValue: t,
838
+ value: n,
839
+ min: r,
840
+ max: i,
841
+ thumbAlignment: "edge",
842
+ ...o,
843
+ children: /* @__PURE__ */ q(nt, {
844
+ className: "ck-slider-control",
845
+ children: [/* @__PURE__ */ K(rt, {
846
+ "data-slot": "slider-track",
847
+ className: "ck-slider-track",
848
+ children: /* @__PURE__ */ K(dt, {
849
+ "data-slot": "slider-range",
850
+ className: "ck-slider-range"
851
+ })
852
+ }), Array.from({ length: c.length }, (e, t) => /* @__PURE__ */ K(lt, {
853
+ "data-slot": "slider-thumb",
854
+ className: "ck-slider-thumb",
855
+ "aria-label": a?.[t] ?? (c.length > 1 ? `Value ${t + 1} of ${c.length}` : "Value")
856
+ }, t))]
857
+ })
858
+ });
859
+ });
860
+ ft.displayName = "Slider";
861
+ var pt = [
862
+ "pen",
863
+ "line",
864
+ "rect",
865
+ "circle",
866
+ "arrow"
867
+ ];
868
+ function mt(e) {
869
+ return e != null && pt.includes(e);
870
+ }
871
+ var ht = [
872
+ {
873
+ value: "pen",
874
+ label: "Pen",
875
+ icon: ke
876
+ },
877
+ {
878
+ value: "line",
879
+ label: "Line",
880
+ icon: U
881
+ },
882
+ {
883
+ value: "rect",
884
+ label: "Rectangle",
885
+ icon: V
886
+ },
887
+ {
888
+ value: "circle",
889
+ label: "Circle",
890
+ icon: H
891
+ },
892
+ {
893
+ value: "arrow",
894
+ label: "Arrow",
895
+ icon: je
896
+ }
897
+ ], gt = G.memo(function({ tools: e, colors: t, drawing: n, onSave: r, saveDisabled: i, onCancel: a }) {
898
+ let o = e ? ht.filter((t) => e.includes(t.value)) : ht;
899
+ function s(e) {
900
+ let t = e[0];
901
+ mt(t) && n.setTool(t);
902
+ }
903
+ function c(e) {
904
+ let t = e[0];
905
+ t && n.setColor(t);
906
+ }
907
+ return /* @__PURE__ */ q("div", {
908
+ className: "ck-annotation-toolbar",
909
+ role: "toolbar",
910
+ "aria-label": "Annotation tools",
911
+ children: [
912
+ /* @__PURE__ */ K(M, {
913
+ value: [n.tool],
914
+ onValueChange: s,
915
+ size: "sm",
916
+ spacing: 1,
917
+ "aria-label": "Drawing tool",
918
+ children: o.map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
919
+ render: /* @__PURE__ */ K(xe, {
920
+ value: e,
921
+ "aria-label": t
922
+ }),
923
+ children: /* @__PURE__ */ K(n, {
924
+ size: 16,
925
+ stroke: 2
926
+ })
927
+ }), /* @__PURE__ */ K(y, { children: t })] }, e))
928
+ }),
929
+ /* @__PURE__ */ K(S, {
930
+ orientation: "vertical",
931
+ className: "ck-annotation-separator"
932
+ }),
933
+ /* @__PURE__ */ K(M, {
934
+ value: [n.color],
935
+ onValueChange: c,
936
+ size: "sm",
937
+ spacing: 1,
938
+ "aria-label": "Stroke color",
939
+ children: t.map((e) => /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
940
+ render: /* @__PURE__ */ K(xe, {
941
+ value: e.value,
942
+ "aria-label": e.label
943
+ }),
944
+ children: /* @__PURE__ */ K("span", {
945
+ className: "ck-annotation-swatch",
946
+ style: { "--ck-bg": e.value }
947
+ })
948
+ }), /* @__PURE__ */ K(y, { children: e.label })] }, e.value))
949
+ }),
950
+ /* @__PURE__ */ K(S, {
951
+ orientation: "vertical",
952
+ className: "ck-annotation-separator"
953
+ }),
954
+ /* @__PURE__ */ q("div", {
955
+ className: "ck-annotation-stroke",
956
+ children: [/* @__PURE__ */ K(ft, {
957
+ className: "ck-annotation-slider",
958
+ value: [n.strokeWidth],
959
+ onValueChange: (e) => {
960
+ let t = Array.isArray(e) ? e[0] : e;
961
+ t != null && Number.isFinite(t) && n.setStrokeWidth(t);
962
+ },
963
+ min: 1,
964
+ max: 12,
965
+ step: 1,
966
+ "aria-label": "Stroke width"
967
+ }), /* @__PURE__ */ q("span", {
968
+ className: "ck-annotation-stroke-label",
969
+ children: [n.strokeWidth, "px"]
970
+ })]
971
+ }),
972
+ /* @__PURE__ */ K(S, {
973
+ orientation: "vertical",
974
+ className: "ck-annotation-separator"
975
+ }),
976
+ /* @__PURE__ */ q(E, { children: [
977
+ /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
978
+ render: /* @__PURE__ */ K(d, {
979
+ variant: "outline",
980
+ size: "icon-sm",
981
+ "aria-label": "Undo",
982
+ onClick: () => n.undo(),
983
+ disabled: !n.canUndo
984
+ }),
985
+ children: /* @__PURE__ */ K(Me, {
986
+ size: 16,
987
+ stroke: 2
988
+ })
989
+ }), /* @__PURE__ */ K(y, { children: /* @__PURE__ */ q("span", {
990
+ className: "ck-annotation-tooltip",
991
+ children: [
992
+ "Undo",
993
+ " ",
994
+ /* @__PURE__ */ q(D, { children: [/* @__PURE__ */ K(z, { children: "⌘" }), /* @__PURE__ */ K(z, { children: "Z" })] })
995
+ ]
996
+ }) })] }),
997
+ /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
998
+ render: /* @__PURE__ */ K(d, {
999
+ variant: "outline",
1000
+ size: "icon-sm",
1001
+ "aria-label": "Redo",
1002
+ onClick: () => n.redo(),
1003
+ disabled: !n.canRedo
1004
+ }),
1005
+ children: /* @__PURE__ */ K(Ae, {
1006
+ size: 16,
1007
+ stroke: 2
1008
+ })
1009
+ }), /* @__PURE__ */ K(y, { children: /* @__PURE__ */ q("span", {
1010
+ className: "ck-annotation-tooltip",
1011
+ children: [
1012
+ "Redo",
1013
+ " ",
1014
+ /* @__PURE__ */ q(D, { children: [
1015
+ /* @__PURE__ */ K(z, { children: "⌘" }),
1016
+ /* @__PURE__ */ K(z, { children: "⇧" }),
1017
+ /* @__PURE__ */ K(z, { children: "Z" })
1018
+ ] })
1019
+ ]
1020
+ }) })] }),
1021
+ /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
1022
+ render: /* @__PURE__ */ K(d, {
1023
+ variant: "outline",
1024
+ size: "icon-sm",
1025
+ "aria-label": "Clear all",
1026
+ onClick: () => n.clear(),
1027
+ disabled: n.paths.length === 0
1028
+ }),
1029
+ children: /* @__PURE__ */ K(W, {
1030
+ size: 16,
1031
+ stroke: 2
1032
+ })
1033
+ }), /* @__PURE__ */ K(y, { children: "Clear all" })] })
1034
+ ] }),
1035
+ /* @__PURE__ */ K(S, {
1036
+ orientation: "vertical",
1037
+ className: "ck-annotation-separator"
1038
+ }),
1039
+ r ? /* @__PURE__ */ q(E, { children: [/* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
1040
+ render: /* @__PURE__ */ K(d, {
1041
+ variant: "outline",
1042
+ size: "icon-sm",
1043
+ "aria-label": "Cancel",
1044
+ onClick: a
1045
+ }),
1046
+ children: /* @__PURE__ */ K(B, {
1047
+ size: 16,
1048
+ stroke: 2
1049
+ })
1050
+ }), /* @__PURE__ */ K(y, { children: /* @__PURE__ */ q("span", {
1051
+ className: "ck-annotation-tooltip",
1052
+ children: ["Cancel ", /* @__PURE__ */ K(z, { children: "Esc" })]
1053
+ }) })] }), /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
1054
+ render: /* @__PURE__ */ K(d, {
1055
+ size: "icon-sm",
1056
+ "aria-label": "Save drawing",
1057
+ "aria-disabled": i || void 0,
1058
+ className: l(i && "ck-annotation-save--disabled"),
1059
+ onClick: () => {
1060
+ i || r();
1061
+ }
1062
+ }),
1063
+ children: /* @__PURE__ */ K(Oe, {
1064
+ size: 16,
1065
+ stroke: 2
1066
+ })
1067
+ }), /* @__PURE__ */ K(y, { children: i ? "Draw something first" : "Save drawing" })] })] }) : /* @__PURE__ */ q(x, { children: [/* @__PURE__ */ K(b, {
1068
+ render: /* @__PURE__ */ K(d, {
1069
+ variant: "outline",
1070
+ size: "icon-sm",
1071
+ "aria-label": "Cancel",
1072
+ onClick: a
1073
+ }),
1074
+ children: /* @__PURE__ */ K(B, {
1075
+ size: 16,
1076
+ stroke: 2
1077
+ })
1078
+ }), /* @__PURE__ */ K(y, { children: /* @__PURE__ */ q("span", {
1079
+ className: "ck-annotation-tooltip",
1080
+ children: ["Cancel ", /* @__PURE__ */ K(z, { children: "Esc" })]
1081
+ }) })] })
1082
+ ]
1083
+ });
1084
+ });
1085
+ export { Be as n, Y as r, gt as t };