@commentkit/comment-kit 1.6.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +281 -597
  2. package/README.md +334 -154
  3. package/SECURITY.md +47 -46
  4. package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
  5. package/dist/node/browser.js +17 -0
  6. package/dist/node/cli/api.js +226 -0
  7. package/dist/node/cli/bin.js +18 -0
  8. package/dist/node/cli/credentials.js +268 -0
  9. package/dist/node/cli/doctor.js +725 -0
  10. package/dist/node/cli/format.js +54 -0
  11. package/dist/node/cli/init.js +372 -0
  12. package/dist/node/cli/main.js +519 -0
  13. package/dist/node/cli/mcp.js +114 -0
  14. package/dist/node/cli/open.js +20 -0
  15. package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
  16. package/dist/node/plugins/astro.js +26 -0
  17. package/dist/node/plugins/git-BIXLbL3f.js +92 -0
  18. package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
  19. package/dist/node/plugins/next.js +48 -0
  20. package/dist/node/plugins/options-THop1K92.js +71 -0
  21. package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
  22. package/dist/node/plugins/vite-BdAYUW10.js +74 -0
  23. package/dist/node/plugins/vite.js +1 -0
  24. package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
  25. package/dist/node/plugins/webpack-loader.cjs +21 -0
  26. package/dist/node/plugins/webpack-loader.js +18 -0
  27. package/dist/node/plugins/webpack.js +1 -0
  28. package/dist/node/shared/endpoint.js +26 -0
  29. package/dist/node/shared/format.js +63 -0
  30. package/dist/node/types/astro.d.ts +11 -0
  31. package/dist/node/types/next.d.ts +34 -0
  32. package/dist/node/types/options.d.ts +59 -0
  33. package/dist/node/types/vite.d.ts +11 -0
  34. package/dist/node/types/webpack-loader.d.ts +22 -0
  35. package/dist/node/types/webpack.d.ts +27 -0
  36. package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
  37. package/dist/npm/chunks/AgentSend-DxRJIYiz.js +68 -0
  38. package/dist/npm/chunks/Checklist-CnlfeSbc.js +282 -0
  39. package/dist/npm/chunks/Composer-B1bBVszY.js +725 -0
  40. package/dist/npm/chunks/Guest-vvNPz8h-.js +267 -0
  41. package/dist/npm/chunks/MarkupEditor-VCOXh9d2.js +338 -0
  42. package/dist/npm/chunks/Panel-F37vIL1K.js +1206 -0
  43. package/dist/npm/chunks/Settings-BGoZS2iV.js +231 -0
  44. package/dist/npm/chunks/Shortcuts-B2OMvczr.js +62 -0
  45. package/dist/npm/chunks/StyleEditor-CJ_d8Huf.js +46 -0
  46. package/dist/npm/chunks/StylePanel-yQzHHlY7.js +199 -0
  47. package/dist/npm/chunks/TaskFields-fmy6_HtK.js +289 -0
  48. package/dist/npm/chunks/ThreadCard-D51slKST.js +1113 -0
  49. package/dist/npm/chunks/Viewer-BOBadqmC.js +111 -0
  50. package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-C1OQzBAm.js} +9 -9
  51. package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
  52. package/dist/npm/chunks/{ar-8tPch6W4.js → ar-CAJ3XT8e.js} +69 -19
  53. package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
  54. package/dist/npm/chunks/{client-EFTWxHbJ.js → client-kNAo2TTG.js} +282 -290
  55. package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
  56. package/dist/npm/chunks/context-B8UAzve0.js +20 -0
  57. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  58. package/dist/npm/chunks/{de-C63897uD.js → de-Dl18G48t.js} +60 -18
  59. package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
  60. package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
  61. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  62. package/dist/npm/chunks/{es-CI2bSpvB.js → es-Dxk79lS9.js} +60 -18
  63. package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
  64. package/dist/npm/chunks/{extension-BST6LH1q.js → extension-E81hWyiT.js} +20 -12
  65. package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
  66. package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-8BebGKYD.js} +118 -76
  67. package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-BIN6Yy_p.js} +61 -19
  68. package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-DOBt8e9U.js} +91 -56
  69. package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
  70. package/dist/npm/chunks/{it-C8tnV0BF.js → it-Cr6EwpPQ.js} +79 -37
  71. package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-Iy3s5aur.js} +58 -16
  72. package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
  73. package/dist/npm/chunks/live-CelVeZfP.js +85 -0
  74. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  75. package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-B84WHqqe.js} +61 -19
  76. package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
  77. package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-yTyqtxN0.js} +45 -44
  78. package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
  79. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  80. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  81. package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-DOkdlfoe.js} +60 -18
  82. package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
  83. package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
  84. package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
  85. package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
  86. package/dist/npm/chunks/{source-CS7C6wJA.js → source-pXVve2Cx.js} +1 -1
  87. package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
  88. package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
  89. package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
  90. package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
  91. package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
  92. package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
  93. package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-Z5fQCb7G.js} +59 -17
  94. package/dist/npm/element.js +58 -21
  95. package/dist/npm/headless.js +7 -3
  96. package/dist/npm/index.js +3 -3
  97. package/dist/npm/react.js +18 -11
  98. package/dist/npm/svelte.js +28 -12
  99. package/dist/npm/types/adapters/react.d.ts +4 -1
  100. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  101. package/dist/npm/types/adapters/vue.d.ts +35 -2
  102. package/dist/npm/types/anchor/index.d.ts +19 -0
  103. package/dist/npm/types/capture/privacy.d.ts +14 -0
  104. package/dist/npm/types/core/api.d.ts +20 -1
  105. package/dist/npm/types/core/auth.d.ts +40 -21
  106. package/dist/npm/types/core/client.d.ts +60 -4
  107. package/dist/npm/types/core/page-key.d.ts +42 -0
  108. package/dist/npm/types/core/types.d.ts +87 -4
  109. package/dist/npm/types/element.d.ts +17 -7
  110. package/dist/npm/types/headless.d.ts +2 -1
  111. package/dist/npm/types/index.d.ts +16 -6
  112. package/dist/npm/vue.js +44 -9
  113. package/package.json +88 -14
  114. package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
  115. package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
  116. package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
  117. package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
  118. package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
  119. package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
  120. package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
  121. package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
  122. package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
  123. package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
  124. package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
  125. package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
  126. package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
  127. package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
  128. package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
  129. package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
  130. package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
  131. package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
  132. package/dist/npm/chunks/report-BBrT3r89.js +0 -27
  133. package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
  134. package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
  135. package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
  136. package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
@@ -0,0 +1,231 @@
1
+ import { c as e } from "./client-kNAo2TTG.js";
2
+ import { c as t, d as n, f as r, g as i, p as a, u as o, y as s } from "./i18n-DOBt8e9U.js";
3
+ import { i as c } from "./files-DyD5BZgp.js";
4
+ import { t as l } from "./dialog-GO04oC3D.js";
5
+ import { C as u, M as d, a as f, b as p, h as m, i as h, r as g, s as _, y as v } from "./start-DtVlpt7p.js";
6
+ _(l), _(".ck-settings .ck-card-body{grid-template-columns:minmax(0,1fr);gap:16px;display:grid}.ck-account{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);align-items:center;gap:12px;padding:12px;display:flex}.ck-account .ck-avatar{--ck-av:40px}.ck-account>div{min-width:0;font-size:var(--ck-fs-sm);gap:2px;display:grid}.ck-account .ck-msg-name,.ck-account .ck-muted{overflow-wrap:anywhere}.ck-setting h3{font-size:var(--ck-fs-sm);letter-spacing:.05em;text-transform:uppercase;color:var(--ck-text-muted);margin:0 0 8px;font-weight:600}.ck-root:-webkit-any(:lang(ar),:lang(hi),:lang(ja),:lang(zh)) .ck-setting h3{letter-spacing:0}.ck-root:is(:lang(ar),:lang(hi),:lang(ja),:lang(zh)) .ck-setting h3{letter-spacing:0}.ck-setting-hint{font-size:var(--ck-fs-sm);text-wrap:pretty;margin:8px 0 0}.ck-toggle{border-radius:var(--ck-radius-xs);width:100%;min-height:36px;color:var(--ck-text);font-size:var(--ck-fs);text-align:start;background:0 0;border:0;justify-content:space-between;align-items:center;gap:12px;padding:0;display:flex}.ck-toggle:focus-visible{outline-offset:2px}.ck-switch{border-radius:var(--ck-radius-pill);background:var(--ck-text-muted);width:36px;height:20px;transition:background-color var(--ck-fast);flex:none;position:relative}.ck-switch:after{content:\"\";top:2px;background:var(--ck-bg);width:16px;height:16px;box-shadow:var(--ck-shadow-sm);border-radius:50%;position:absolute}.ck-switch:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):after{left:2px}.ck-switch:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):after{left:2px}.ck-switch:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{right:2px}.ck-switch:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{right:2px}.ck-toggle[aria-checked=true] .ck-switch{background:var(--ck-accent)}.ck-toggle[aria-checked=true] .ck-switch:after{background:var(--ck-accent-ink)}.ck-toggle[aria-checked=true] .ck-switch:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):after{left:18px}.ck-toggle[aria-checked=true] .ck-switch:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):after{left:18px}.ck-toggle[aria-checked=true] .ck-switch:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{right:18px}.ck-toggle[aria-checked=true] .ck-switch:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{right:18px}.ck-segment{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:4px;display:grid}.ck-segment button{border-radius:var(--ck-radius-xs);height:32px;color:var(--ck-text-muted);font-size:var(--ck-fs-md);white-space:nowrap;text-overflow:ellipsis;transition:background-color var(--ck-fast), color var(--ck-fast);background:0 0;border:0;padding:0 8px;font-weight:600;overflow:hidden}.ck-segment button[aria-checked=true]{background:var(--ck-bg);color:var(--ck-text);box-shadow:var(--ck-shadow-sm)}.ck-segment button:focus-visible{outline-offset:-2px}.ck-segment button:active{scale:.96}.ck-setting-links{border-top:1px solid var(--ck-hairline);gap:2px;padding-top:8px;display:grid}.ck-setting-links a,.ck-setting-links button{border-radius:var(--ck-radius-sm);width:100%;min-height:36px;color:var(--ck-text);font-size:var(--ck-fs);text-align:start;transition:background-color var(--ck-fast);background:0 0;border:0;align-items:center;gap:12px;padding:8px 12px;text-decoration:none;display:flex}.ck-setting-links :-webkit-any(a,button):focus-visible{outline-offset:-2px}.ck-setting-links :is(a,button):focus-visible{outline-offset:-2px}.ck-setting-links :-webkit-any(a,button):active{background:var(--ck-bg-hover)}.ck-setting-links :is(a,button):active{background:var(--ck-bg-hover)}.ck-setting-links svg{color:var(--ck-text-muted);flex:none}.ck-setting-links .ck-danger{color:var(--ck-danger)}.ck-setting-links .ck-danger svg{color:currentColor}.ck-team{grid-template-columns:minmax(0,1fr);gap:2px;margin:0;padding:0;list-style:none;display:grid}.ck-team li{min-height:32px;font-size:var(--ck-fs-md);align-items:center;gap:8px;padding-block-start:4px;padding-block-end:4px;display:flex}.ck-team-name{overflow-wrap:anywhere;min-width:0}.ck-team li>.ck-muted{flex:none}.ck-team-face{flex:none;display:inline-flex;position:relative}.ck-team-face .ck-avatar{--ck-av:24px}.ck-online{background:var(--ck-success);width:8px;height:8px;box-shadow:0 0 0 2px var(--ck-bg);border-radius:50%;position:absolute;bottom:-2px}.ck-online:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:-2px}.ck-online:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:-2px}.ck-online:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:-2px}.ck-online:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:-2px}.ck-team-role{font-size:var(--ck-fs-sm);margin-inline-start:auto}.ck-meter{border-radius:var(--ck-radius-pill);background:var(--ck-bg-muted);outline:1px solid var(--ck-hairline);outline-offset:-1px;height:6px;overflow:hidden}.ck-meter>span{background:var(--ck-accent);border-radius:inherit;height:100%;display:block}.ck-meter>span[data-high]{background:var(--ck-warning)}@media (hover:hover){.ck-setting-links a:hover,.ck-setting-links button:hover{background:var(--ck-bg-hover)}.ck-segment button:hover{color:var(--ck-text)}}@media (pointer:coarse){.ck-segment button,.ck-setting-links a,.ck-setting-links button{min-height:44px}}@media (forced-colors:active){.ck-segment button[aria-checked=true]{color:highlighttext;background:highlight}.ck-switch{background:canvas;border:1px solid canvastext}.ck-switch:after,.ck-toggle[aria-checked=true] .ck-switch:after{background:canvastext}.ck-toggle[aria-checked=true] .ck-switch{background:highlight}}@media (pointer:coarse){.ck-toggle{min-height:44px}}@media (prefers-reduced-motion:reduce){.ck-segment button:active{scale:none}}");
7
+ var y = [
8
+ ["auto", "themeSystem"],
9
+ ["light", "themeLight"],
10
+ ["dark", "themeDark"]
11
+ ];
12
+ function b({ client: l, onClose: _, onShortcuts: b, onHide: C, onSignOut: w }) {
13
+ let T = v(l.state, (e) => e.session), E = v(l.state, (e) => e.theme ?? l.options.theme ?? e.config?.appearance?.theme ?? "auto"), D = a(null), O = v(l.state, (e) => e.team), k = T?.role === "admin" || T?.role === "member", [A, j] = i(null), [M, N] = i(null);
14
+ n(() => {
15
+ k && (l.people().then((e) => j(e.filter((e) => e.role && e.role !== "reviewer")), () => j([])), l.usage().then(N, () => N(null)));
16
+ }, [k]), r(() => {
17
+ let e = D.current?.getRootNode(), t = e?.activeElement ?? document.activeElement;
18
+ return D.current?.focus({ preventScroll: !0 }), () => x(t, e);
19
+ }, []);
20
+ let P = l.options.shortcuts !== !1, F = !!T?.capabilities.triage, [I, L] = i(() => f(F));
21
+ n(() => g(() => L(f(F))), []);
22
+ let R = (t) => {
23
+ e(t), l.state.set({ theme: t });
24
+ }, z = d(T?.dashboard_url), B = A?.find((e) => e.id === T?.person.id)?.role, V = T ? t(`role_${B === "owner" ? "owner" : T.role}`) : "";
25
+ return /* @__PURE__ */ o("div", {
26
+ class: "ck-scrim",
27
+ "data-commentkit-ui": !0,
28
+ onClick: (e) => e.target === e.currentTarget && _(),
29
+ children: /* @__PURE__ */ o("div", {
30
+ class: "ck-card ck-dialog ck-settings",
31
+ role: "dialog",
32
+ "aria-modal": "true",
33
+ "aria-labelledby": "ck-settings-title",
34
+ onKeyDown: (e) => {
35
+ e.stopPropagation(), e.key === "Escape" ? _() : S(e);
36
+ },
37
+ children: [/* @__PURE__ */ o("div", {
38
+ class: "ck-card-head",
39
+ children: [/* @__PURE__ */ o("h2", {
40
+ class: "ck-card-title",
41
+ id: "ck-settings-title",
42
+ children: t("settings")
43
+ }), /* @__PURE__ */ o("button", {
44
+ class: "ck-ghost",
45
+ ref: D,
46
+ "aria-label": t("close"),
47
+ title: t("close"),
48
+ onClick: _,
49
+ children: /* @__PURE__ */ o(u, { name: "close" })
50
+ })]
51
+ }), /* @__PURE__ */ o("div", {
52
+ class: "ck-card-body",
53
+ children: [
54
+ T ? /* @__PURE__ */ o("section", {
55
+ class: "ck-account",
56
+ "aria-label": t("account"),
57
+ children: [/* @__PURE__ */ o(p, { person: T.person }), /* @__PURE__ */ o("div", { children: [
58
+ /* @__PURE__ */ o("bdi", {
59
+ class: "ck-msg-name",
60
+ children: T.person.name
61
+ }),
62
+ T.email ? /* @__PURE__ */ o("div", {
63
+ class: "ck-muted",
64
+ children: /* @__PURE__ */ o("bdi", { children: T.email })
65
+ }) : null,
66
+ /* @__PURE__ */ o("div", {
67
+ class: "ck-muted",
68
+ children: [
69
+ /* @__PURE__ */ o("bdi", { children: T.project.name }),
70
+ " · ",
71
+ V
72
+ ]
73
+ })
74
+ ] })]
75
+ }) : null,
76
+ /* @__PURE__ */ o("section", {
77
+ class: "ck-setting",
78
+ children: [
79
+ /* @__PURE__ */ o("h3", {
80
+ id: "ck-theme-label",
81
+ children: t("appearance")
82
+ }),
83
+ /* @__PURE__ */ o("div", {
84
+ class: "ck-segment",
85
+ role: "radiogroup",
86
+ "aria-labelledby": "ck-theme-label",
87
+ onKeyDown: (e) => m(e, "[role=radio]"),
88
+ children: y.map(([e, n]) => /* @__PURE__ */ o("button", {
89
+ role: "radio",
90
+ "aria-checked": E === e,
91
+ tabIndex: E === e ? 0 : -1,
92
+ onClick: () => R(e),
93
+ onFocus: () => E !== e && R(e),
94
+ children: t(n)
95
+ }))
96
+ }),
97
+ /* @__PURE__ */ o("p", {
98
+ class: "ck-muted ck-setting-hint",
99
+ children: t("appearanceHint")
100
+ })
101
+ ]
102
+ }),
103
+ P ? /* @__PURE__ */ o("section", {
104
+ class: "ck-setting",
105
+ children: [
106
+ /* @__PURE__ */ o("h3", { children: t("shortcutsTitle") }),
107
+ /* @__PURE__ */ o("button", {
108
+ class: "ck-toggle",
109
+ role: "switch",
110
+ "aria-checked": I,
111
+ "aria-describedby": "ck-keys-hint",
112
+ onClick: () => h(!I),
113
+ children: [/* @__PURE__ */ o("span", { children: t("shortcutsSetting") }), /* @__PURE__ */ o("span", {
114
+ class: "ck-switch",
115
+ "aria-hidden": "true"
116
+ })]
117
+ }),
118
+ /* @__PURE__ */ o("p", {
119
+ class: "ck-muted ck-setting-hint",
120
+ id: "ck-keys-hint",
121
+ children: t("shortcutsSettingHint")
122
+ })
123
+ ]
124
+ }) : null,
125
+ k && A?.length ? /* @__PURE__ */ o("section", {
126
+ class: "ck-setting",
127
+ children: [/* @__PURE__ */ o("h3", { children: t("team") }), /* @__PURE__ */ o("ul", {
128
+ class: "ck-team",
129
+ children: A.map((e) => /* @__PURE__ */ o("li", { children: [
130
+ /* @__PURE__ */ o("span", {
131
+ class: "ck-team-face",
132
+ children: [/* @__PURE__ */ o(p, { person: e }), O.some((t) => t.id === e.id) ? /* @__PURE__ */ o("span", {
133
+ class: "ck-online",
134
+ role: "img",
135
+ "aria-label": t("online")
136
+ }) : null]
137
+ }),
138
+ /* @__PURE__ */ o("bdi", {
139
+ class: "ck-team-name",
140
+ children: e.name
141
+ }),
142
+ e.id === T?.person.id ? /* @__PURE__ */ o("span", {
143
+ class: "ck-muted",
144
+ children: [
145
+ "(",
146
+ t("you"),
147
+ ")"
148
+ ]
149
+ }) : null,
150
+ /* @__PURE__ */ o("span", {
151
+ class: "ck-muted ck-team-role",
152
+ children: t(`role_${e.role === "owner" ? "owner" : e.role === "admin" ? "admin" : "member"}`)
153
+ })
154
+ ] }))
155
+ })]
156
+ }) : null,
157
+ k && M ? /* @__PURE__ */ o("section", {
158
+ class: "ck-setting",
159
+ children: [/* @__PURE__ */ o("h3", { children: t("storage") }), M.limit_bytes ? /* @__PURE__ */ o(s, { children: [/* @__PURE__ */ o("div", {
160
+ class: "ck-meter",
161
+ role: "meter",
162
+ "aria-valuemin": 0,
163
+ "aria-valuemax": M.limit_bytes,
164
+ "aria-valuenow": M.used_bytes,
165
+ "aria-label": t("storage"),
166
+ children: /* @__PURE__ */ o("span", {
167
+ style: { width: `${Math.min(100, Math.round(M.used_bytes / M.limit_bytes * 100))}%` },
168
+ "data-high": M.used_bytes / M.limit_bytes > .85 || void 0
169
+ })
170
+ }), /* @__PURE__ */ o("p", {
171
+ class: "ck-muted ck-setting-hint",
172
+ children: t("storageUsed", {
173
+ used: c(M.used_bytes),
174
+ limit: c(M.limit_bytes)
175
+ })
176
+ })] }) : /* @__PURE__ */ o("p", {
177
+ class: "ck-muted ck-setting-hint",
178
+ children: t("storageUsedOnly", { used: c(M.used_bytes) })
179
+ })]
180
+ }) : null,
181
+ /* @__PURE__ */ o("nav", {
182
+ class: "ck-setting-links",
183
+ "aria-label": t("settings"),
184
+ children: [
185
+ z ? /* @__PURE__ */ o("a", {
186
+ href: z,
187
+ target: "_blank",
188
+ rel: "noopener noreferrer",
189
+ children: [/* @__PURE__ */ o(u, {
190
+ name: "link",
191
+ size: 16
192
+ }), t("openDashboard")]
193
+ }) : null,
194
+ b ? /* @__PURE__ */ o("button", {
195
+ onClick: () => (_(), b()),
196
+ children: [/* @__PURE__ */ o(u, {
197
+ name: "info",
198
+ size: 16
199
+ }), t("shortcutsTitle")]
200
+ }) : null,
201
+ F ? /* @__PURE__ */ o("button", {
202
+ onClick: C,
203
+ children: [/* @__PURE__ */ o(u, {
204
+ name: "close",
205
+ size: 16
206
+ }), t("hideWidget")]
207
+ }) : null,
208
+ T ? /* @__PURE__ */ o("button", {
209
+ class: "ck-danger",
210
+ onClick: () => (_(), w()),
211
+ children: [/* @__PURE__ */ o(u, {
212
+ name: "user",
213
+ size: 16
214
+ }), t("signOut")]
215
+ }) : null
216
+ ]
217
+ })
218
+ ]
219
+ })]
220
+ })
221
+ });
222
+ }
223
+ function x(e, t) {
224
+ (e instanceof HTMLElement && e.isConnected && e !== document.body ? e : t?.querySelector("[aria-haspopup=menu]"))?.focus({ preventScroll: !0 });
225
+ }
226
+ function S(e) {
227
+ if (e.key !== "Tab") return;
228
+ let t = e.currentTarget, n = [...t.querySelectorAll("a[href], button:not(:disabled), input:not(:disabled)")].filter((e) => e.tabIndex >= 0), r = t.getRootNode().activeElement, [i, a] = [n[0], n[n.length - 1]];
229
+ i && a && (e.shiftKey ? r === i || !t.contains(r) : r === a) && (e.preventDefault(), (e.shiftKey ? a : i).focus());
230
+ }
231
+ export { b as Settings };
@@ -0,0 +1,62 @@
1
+ import { c as e, f as t, p as n, u as r } from "./i18n-DOBt8e9U.js";
2
+ import { t as i } from "./dialog-GO04oC3D.js";
3
+ import { C as a, s as o } from "./start-DtVlpt7p.js";
4
+ o(i), o(".ck-keys{gap:12px;margin:0;display:grid}.ck-keys:focus-visible{outline-offset:-2px}.ck-scrim:has(.ck-keys){animation:none}.ck-scrim:has(.ck-keys) .ck-card{animation:none}.ck-keys div{grid-template-columns:minmax(96px,auto) 1fr;align-items:baseline;gap:12px;display:grid}.ck-keys dt{text-align:start}.ck-keys dd{color:var(--ck-text-muted);font-size:var(--ck-fs-md);margin:0}.ck-keys kbd{border:1px solid var(--ck-border);border-radius:var(--ck-radius-xs);background:var(--ck-bg-muted);color:var(--ck-text);font-family:var(--ck-mono);font-size:var(--ck-fs-sm);white-space:nowrap;border-bottom-width:2px;padding:0 7px;line-height:20px;display:inline-block}");
5
+ var s = [
6
+ ["C", "shortcutComment"],
7
+ ["J / K", "shortcutNext"],
8
+ ["E", "shortcutResolve"],
9
+ ["Esc", "shortcutClose"],
10
+ ["Enter", "shortcutSend"],
11
+ ["Shift + Enter", "shortcutNewLine"],
12
+ ["⌘ / Ctrl + B · I · E", "shortcutFormat"],
13
+ ["⌘ / Ctrl + Shift + K", "shortcutToggle"],
14
+ ["?", "shortcutHelp"]
15
+ ];
16
+ function c({ onClose: i }) {
17
+ let o = n(null), c = n(null);
18
+ return t(() => {
19
+ let e = o.current?.getRootNode(), t = e?.activeElement ?? document.activeElement;
20
+ return o.current?.focus({ preventScroll: !0 }), () => {
21
+ (t instanceof HTMLElement && t.isConnected && t !== document.body ? t : e?.querySelector("[aria-haspopup=menu]"))?.focus({ preventScroll: !0 });
22
+ };
23
+ }, []), /* @__PURE__ */ r("div", {
24
+ class: "ck-scrim",
25
+ "data-commentkit-ui": !0,
26
+ onClick: (e) => e.target === e.currentTarget && i(),
27
+ children: /* @__PURE__ */ r("div", {
28
+ class: "ck-card ck-dialog",
29
+ role: "dialog",
30
+ "aria-modal": "true",
31
+ "aria-labelledby": "ck-shortcuts-title",
32
+ onKeyDown: (e) => {
33
+ e.stopPropagation(), e.key === "Escape" || e.key === "?" ? (e.preventDefault(), i()) : e.key === "Tab" && (e.preventDefault(), (o.current?.getRootNode()?.activeElement === o.current ? c.current : o.current)?.focus());
34
+ },
35
+ children: [/* @__PURE__ */ r("div", {
36
+ class: "ck-card-head",
37
+ children: [/* @__PURE__ */ r("h2", {
38
+ class: "ck-card-title",
39
+ id: "ck-shortcuts-title",
40
+ children: e("shortcutsTitle")
41
+ }), /* @__PURE__ */ r("button", {
42
+ class: "ck-ghost",
43
+ ref: o,
44
+ "aria-label": e("close"),
45
+ title: e("close"),
46
+ onClick: i,
47
+ children: /* @__PURE__ */ r(a, { name: "close" })
48
+ })]
49
+ }), /* @__PURE__ */ r("dl", {
50
+ class: "ck-card-body ck-keys",
51
+ ref: c,
52
+ tabIndex: 0,
53
+ "aria-labelledby": "ck-shortcuts-title",
54
+ children: s.map(([t, n]) => /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ r("dt", { children: /* @__PURE__ */ r("kbd", {
55
+ dir: "ltr",
56
+ children: t
57
+ }) }), /* @__PURE__ */ r("dd", { children: e(n) })] }))
58
+ })]
59
+ })
60
+ });
61
+ }
62
+ export { c as Shortcuts };
@@ -0,0 +1,46 @@
1
+ import { c as e, f as t, g as n, p as r, u as i } from "./i18n-DOBt8e9U.js";
2
+ import { a, i as o, o as s } from "./uploads-D49mywwz.js";
3
+ import { r as c } from "./context-B8UAzve0.js";
4
+ import { StylePanel as l } from "./StylePanel-yQzHHlY7.js";
5
+ // src/ui/StyleEditor.tsx
6
+ function u({ thread: u, element: d, onSaved: f, onClose: p }, m) {
7
+ let { client: h, reportError: g } = c(m), [_] = n(() => {
8
+ let e = s(d);
9
+ for (let t of a(u.style_changes)) t.from && (e[t.property] = t.from);
10
+ return e;
11
+ }), [v, y] = n(() => a(u.style_changes)), [b, x] = n(!1), S = r(null);
12
+ t(() => {
13
+ let e = new o(d);
14
+ return S.current = e, () => e.revert();
15
+ }, [d]), t(() => S.current?.apply(v), [v]);
16
+ let C = async () => {
17
+ if (!b) {
18
+ x(!0);
19
+ try {
20
+ f(await h.updateThread(u.id, { style_changes: a(v) })), p();
21
+ } catch (e) {
22
+ x(!1), g(e);
23
+ }
24
+ }
25
+ };
26
+ return /* @__PURE__ */ i(l, {
27
+ base: _,
28
+ changes: v,
29
+ onChange: y,
30
+ onClose: p,
31
+ actions: /* @__PURE__ */ i("span", {
32
+ class: "ck-style-actions",
33
+ children: [/* @__PURE__ */ i("button", {
34
+ class: "ck-ghost ck-ghost-sm",
35
+ onClick: p,
36
+ children: e("cancel")
37
+ }), /* @__PURE__ */ i("button", {
38
+ class: "ck-btn ck-primary ck-style-done",
39
+ "aria-disabled": b || void 0,
40
+ onClick: () => void C(),
41
+ children: e("save")
42
+ })]
43
+ })
44
+ });
45
+ }
46
+ export { u as StyleEditor };
@@ -0,0 +1,199 @@
1
+ import { c as e, d as t, g as n, u as r, y as i } from "./i18n-DOBt8e9U.js";
2
+ import { r as a, s as o } from "./uploads-D49mywwz.js";
3
+ import { s } from "./start-DtVlpt7p.js";
4
+ // src/ui/StylePanel.tsx
5
+ s(".ck-style-panel{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);margin-top:8px;padding:8px 12px 12px}.ck-style-head{min-height:28px;font-size:var(--ck-fs-md);justify-content:space-between;align-items:center;gap:8px;display:flex}.ck-style-done{height:28px;font-size:var(--ck-fs-sm);padding:0 12px}.ck-style-actions{align-items:center;gap:4px;display:flex}.ck-style-actions .ck-ghost-sm{height:28px;padding:0 8px}.ck-style-hint{font-size:var(--ck-fs-sm);text-wrap:pretty;margin:4px 0 8px;line-height:1.4}.ck-style-rows{overscroll-behavior:contain;gap:4px;max-height:236px;margin-inline-start:-4px;margin-inline-end:-4px;padding-inline-start:4px;padding-inline-end:4px;display:grid;overflow:auto}.ck-style-row{border-radius:var(--ck-radius-sm);min-height:32px;transition:background-color var(--ck-fast);grid-template-columns:minmax(96px,40%) 1fr;align-items:center;column-gap:8px;padding:0 4px;display:grid}.ck-style-row[data-changed]{background:color-mix(in srgb, var(--ck-accent) 10%, transparent)}.ck-style-row .ck-error{grid-column:2;padding-block-start:4px;padding-block-end:4px}.ck-style-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--ck-fs-sm);color:var(--ck-text-muted);overflow:hidden}.ck-style-name code{font-family:var(--ck-mono);font-size:var(--ck-fs-xs)}.ck-style-row[data-changed] .ck-style-name{color:var(--ck-text)}.ck-style-control{align-items:center;gap:4px;min-width:0;display:flex}.ck-style-control .ck-style-input{width:auto;min-width:0;height:28px;font-size:var(--ck-fs-sm);font-family:var(--ck-mono);flex:1;padding:0 7px}.ck-style-control .ck-style-input[aria-invalid=true]{border-color:var(--ck-danger)}.ck-style-control .ck-style-input[aria-invalid=true]:focus{box-shadow:0 0 0 3px color-mix(in srgb, var(--ck-danger) 18%, transparent)}.ck-style-control .ck-ghost{width:24px;min-width:0;height:24px;min-height:0;font-size:var(--ck-fs);flex:none;place-items:center;padding:0;line-height:1;display:grid}.ck-style-control .ck-ghost:active{scale:.96}.ck-style-steps{flex:none;display:flex}.ck-style-swatch{width:16px;height:16px;box-shadow:inset 0 0 0 1px var(--ck-hairline), 0 0 0 1px var(--ck-border);border-radius:50%;flex:none;margin-inline-end:4px}.ck-style-undo:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){scale:-1 1}.ck-style-undo:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){scale:-1 1}@media (pointer:coarse){.ck-style-row{grid-template-columns:1fr;row-gap:4px;padding-block-start:8px;padding-block-end:8px}.ck-style-row .ck-error{grid-column:1}.ck-style-control .ck-style-input{font-size:var(--ck-fs-lg);height:44px}.ck-style-control .ck-ghost{width:44px;height:44px}.ck-style-rows{max-height:320px}}");
6
+ function c({ base: t, changes: n, onChange: i, onClose: o, actions: s }) {
7
+ let c = (e, r) => {
8
+ let a = n.filter((t) => t.property !== e);
9
+ if (r !== null && r === t[e]) return i(a);
10
+ let o = {
11
+ property: e,
12
+ from: t[e] || null,
13
+ to: r
14
+ }, s = n.findIndex((t) => t.property === e);
15
+ i(s === -1 ? [...n, o] : n.map((e, t) => t === s ? o : e));
16
+ };
17
+ return /* @__PURE__ */ r("div", {
18
+ class: "ck-style-panel",
19
+ role: "group",
20
+ "aria-label": e("adjustStyle"),
21
+ onKeyDown: (e) => {
22
+ e.stopPropagation(), e.key === "Escape" && o();
23
+ },
24
+ children: [
25
+ /* @__PURE__ */ r("div", {
26
+ class: "ck-style-head",
27
+ children: [/* @__PURE__ */ r("strong", { children: e("adjustStyle") }), s ?? /* @__PURE__ */ r("button", {
28
+ class: "ck-btn ck-style-done",
29
+ onClick: o,
30
+ children: e("styleDone")
31
+ })]
32
+ }),
33
+ /* @__PURE__ */ r("p", {
34
+ class: "ck-muted ck-style-hint",
35
+ children: e("adjustStyleHint")
36
+ }),
37
+ /* @__PURE__ */ r("div", {
38
+ class: "ck-style-rows",
39
+ children: a.map(({ property: e, kind: a, options: o }) => {
40
+ let s = n.find((t) => t.property === e);
41
+ return /* @__PURE__ */ r(l, {
42
+ property: e,
43
+ kind: a,
44
+ options: o,
45
+ base: t[e] ?? "",
46
+ value: s ? s.to : t[e] ?? "",
47
+ changed: !!s,
48
+ onSet: (t) => c(e, t),
49
+ onReset: () => i(n.filter((t) => t.property !== e))
50
+ }, e);
51
+ })
52
+ })
53
+ ]
54
+ });
55
+ }
56
+ function l({ property: a, kind: s, options: c, base: l, value: f, changed: p, onSet: m, onReset: h }) {
57
+ let [g, _] = n(f ?? ""), [v, y] = n(!1);
58
+ t(() => {
59
+ _(f ?? ""), y(!1);
60
+ }, [f]);
61
+ let b = `ck-style-${a}`, x = (e) => {
62
+ let t = e.trim();
63
+ _(e);
64
+ let n = t !== "" && o(t);
65
+ y(t !== "" && !n), n && m(t);
66
+ }, S = (e, t = !1) => {
67
+ let n = s === "choice" ? d(c ?? [], f ?? l, e) : u(a, f ?? l, e * (t ? 10 : 1));
68
+ n !== null && m(n);
69
+ };
70
+ return /* @__PURE__ */ r("div", {
71
+ class: "ck-style-row",
72
+ "data-changed": p || void 0,
73
+ children: [
74
+ /* @__PURE__ */ r("label", {
75
+ for: b,
76
+ class: "ck-style-name",
77
+ title: a,
78
+ children: /* @__PURE__ */ r("code", { children: a })
79
+ }),
80
+ /* @__PURE__ */ r("div", {
81
+ class: "ck-style-control",
82
+ children: [
83
+ /* @__PURE__ */ r(i, { children: [
84
+ s === "color" ? /* @__PURE__ */ r("span", {
85
+ class: "ck-style-swatch",
86
+ "aria-hidden": "true",
87
+ style: { backgroundColor: f ?? l ?? "transparent" }
88
+ }) : null,
89
+ /* @__PURE__ */ r("input", {
90
+ id: b,
91
+ class: "ck-input ck-style-input",
92
+ type: "text",
93
+ spellcheck: !1,
94
+ autoComplete: "off",
95
+ maxLength: 120,
96
+ value: g,
97
+ placeholder: f === null ? e("styleRemoved") : "",
98
+ "aria-invalid": v,
99
+ "aria-describedby": v ? `${b}-error` : void 0,
100
+ onInput: (e) => x(e.target.value),
101
+ onKeyDown: (e) => {
102
+ s !== "color" && s !== "box" && (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), S(e.key === "ArrowUp" ? 1 : -1, e.shiftKey));
103
+ }
104
+ }),
105
+ s === "length" || s === "number" ? /* @__PURE__ */ r("span", {
106
+ class: "ck-style-steps",
107
+ children: [/* @__PURE__ */ r("button", {
108
+ class: "ck-ghost ck-ghost-sm",
109
+ "aria-label": e("styleDecrease", { property: a }),
110
+ onClick: () => S(-1),
111
+ children: "−"
112
+ }), /* @__PURE__ */ r("button", {
113
+ class: "ck-ghost ck-ghost-sm",
114
+ "aria-label": e("styleIncrease", { property: a }),
115
+ onClick: () => S(1),
116
+ children: "+"
117
+ })]
118
+ }) : s === "choice" ? /* @__PURE__ */ r("span", {
119
+ class: "ck-style-steps",
120
+ children: [/* @__PURE__ */ r("button", {
121
+ class: "ck-ghost ck-ghost-sm",
122
+ "aria-label": e("stylePrevious", { property: a }),
123
+ onClick: () => S(-1),
124
+ children: "‹"
125
+ }), /* @__PURE__ */ r("button", {
126
+ class: "ck-ghost ck-ghost-sm",
127
+ "aria-label": e("styleNext", { property: a }),
128
+ onClick: () => S(1),
129
+ children: "›"
130
+ })]
131
+ }) : null
132
+ ] }),
133
+ p ? /* @__PURE__ */ r("button", {
134
+ class: "ck-ghost ck-ghost-sm",
135
+ "aria-label": e("styleReset", { property: a }),
136
+ title: e("styleReset", { property: a }),
137
+ onClick: h,
138
+ children: /* @__PURE__ */ r("svg", {
139
+ class: "ck-style-undo",
140
+ width: "12",
141
+ height: "12",
142
+ viewBox: "0 0 24 24",
143
+ fill: "none",
144
+ stroke: "currentColor",
145
+ "stroke-width": "2.2",
146
+ "stroke-linecap": "round",
147
+ "stroke-linejoin": "round",
148
+ "aria-hidden": "true",
149
+ children: /* @__PURE__ */ r("path", { d: "M4 9h11a5 5 0 0 1 0 10H9M8 5L4 9l4 4" })
150
+ })
151
+ }) : null,
152
+ f === null ? null : /* @__PURE__ */ r("button", {
153
+ class: "ck-ghost ck-ghost-sm",
154
+ "aria-label": e("styleRemoveValue", { property: a }),
155
+ title: e("styleRemoveValue", { property: a }),
156
+ onClick: () => m(null),
157
+ children: /* @__PURE__ */ r("svg", {
158
+ width: "12",
159
+ height: "12",
160
+ viewBox: "0 0 24 24",
161
+ fill: "none",
162
+ stroke: "currentColor",
163
+ "stroke-width": "2.2",
164
+ "stroke-linecap": "round",
165
+ "aria-hidden": "true",
166
+ children: /* @__PURE__ */ r("path", { d: "M6 6l12 12M18 6L6 18" })
167
+ })
168
+ })
169
+ ]
170
+ }),
171
+ v ? /* @__PURE__ */ r("span", {
172
+ class: "ck-error",
173
+ id: `${b}-error`,
174
+ role: "alert",
175
+ children: e("styleInvalid")
176
+ }) : null
177
+ ]
178
+ });
179
+ }
180
+ function u(e, t, n) {
181
+ let r = t === "normal" || t === "" ? e === "font-weight" ? "400" : e === "letter-spacing" ? "0px" : null : t === "bold" ? "700" : t, i = r ? /^(-?\d*\.?\d+)([a-z%]*)$/i.exec(r) : null;
182
+ if (!i) return null;
183
+ let [, a, o = ""] = i, s = e === "opacity" ? .05 : e === "font-weight" ? 100 : /^r?em$/i.test(o) || e === "line-height" && o === "" ? .05 : 1, c = Number(a) + n * s;
184
+ return e === "opacity" && (c = Math.min(1, Math.max(0, c))), e === "font-weight" && (c = Math.min(900, Math.max(100, c))), [
185
+ "font-size",
186
+ "border-width",
187
+ "border-radius",
188
+ "width",
189
+ "height",
190
+ "gap",
191
+ "line-height"
192
+ ].includes(e) && (c = Math.max(0, c)), `${Math.round(c * 100) / 100}${o}`;
193
+ }
194
+ function d(e, t, n) {
195
+ if (!e.length) return null;
196
+ let r = e.indexOf(t);
197
+ return r === -1 ? n === 1 ? e[0] : e[e.length - 1] : e[(r + n + e.length) % e.length];
198
+ }
199
+ export { c as StylePanel };