@vokality/design-system 3.0.0 → 4.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 (61) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +24 -9
  3. package/bin/vokality-skill.mjs +68 -0
  4. package/dist/components/Alert/Alert.js +1 -1
  5. package/dist/components/AppShell/AppShell.js +4 -1
  6. package/dist/components/Button/Button.d.ts +2 -1
  7. package/dist/components/Button/Button.js +1 -1
  8. package/dist/components/ChatWidget/ChatWidget.js +1 -1
  9. package/dist/components/CommandPalette/CommandPalette.js +2 -2
  10. package/dist/components/ErrorSummary/ErrorSummary.js +3 -1
  11. package/dist/components/Fieldset/Fieldset.d.ts +2 -0
  12. package/dist/components/Fieldset/Fieldset.js +2 -2
  13. package/dist/components/FileUpload/FileUpload.js +1 -1
  14. package/dist/components/IconButton/IconButton.d.ts +2 -1
  15. package/dist/components/IconButton/IconButton.js +2 -2
  16. package/dist/components/Menu/Menu.d.ts +1 -2
  17. package/dist/components/Menu/Menu.js +7 -1
  18. package/dist/components/Popover/Popover.d.ts +1 -1
  19. package/dist/components/Popover/Popover.js +1 -1
  20. package/dist/components/Prose/Prose.d.ts +3 -1
  21. package/dist/components/Prose/Prose.js +2 -2
  22. package/dist/components/RichTextEditor/RichTextEditor.js +20 -7
  23. package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
  24. package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
  25. package/dist/components/ThemeProvider/ThemeProvider.d.ts +13 -0
  26. package/dist/components/ThemeProvider/ThemeProvider.js +11 -0
  27. package/dist/components/TimePicker/TimePicker.js +3 -1
  28. package/dist/components/Toaster/Toaster.js +1 -1
  29. package/dist/components.css +54 -8
  30. package/dist/hooks/useTheme.d.ts +3 -2
  31. package/dist/hooks/useTheme.js +6 -4
  32. package/dist/index.d.ts +4 -4
  33. package/dist/index.js +2 -2
  34. package/dist/internal/ThemeOptionsProvider.d.ts +15 -0
  35. package/dist/internal/ThemeOptionsProvider.js +26 -0
  36. package/dist/internal/themeOptions.d.ts +3 -0
  37. package/dist/internal/themeOptions.js +4 -0
  38. package/dist/lib/theme.d.ts +5 -1
  39. package/dist/lib/theme.js +3 -2
  40. package/dist/tokens.css +1 -0
  41. package/dist/tokens.dtcg.json +5 -0
  42. package/dist/tokens.json +5 -0
  43. package/dist/vokality.css +55 -8
  44. package/dist/vokality.iife.js +483 -434
  45. package/docs/brand.md +2 -2
  46. package/docs/components/Button/README.md +4 -1
  47. package/docs/components/DatePicker/README.md +1 -1
  48. package/docs/components/Fieldset/README.md +3 -1
  49. package/docs/components/FileUpload/README.md +3 -2
  50. package/docs/components/Menu/README.md +3 -3
  51. package/docs/components/NavList/README.md +1 -1
  52. package/docs/components/Popover/README.md +1 -1
  53. package/docs/components/Prose/README.md +4 -0
  54. package/docs/components/RichTextEditor/README.md +1 -1
  55. package/docs/components/SegmentedControl/README.md +1 -1
  56. package/docs/components/{ThemeScript → ThemeProvider}/README.md +16 -11
  57. package/package.json +27 -12
  58. package/skills/vokality-design-system/SKILL.md +55 -0
  59. package/skills/vokality-design-system/references/examples.tsx +103 -0
  60. package/dist/components/ThemeScript/ThemeScript.d.ts +0 -7
  61. package/dist/components/ThemeScript/ThemeScript.js +0 -9
@@ -1,4 +1,4 @@
1
- /* @ds-bundle: {"format":4,"namespace":"Vokality","components":[{"name":"Accordion"},{"name":"Alert"},{"name":"AppShell"},{"name":"Avatar"},{"name":"AvatarGroup"},{"name":"Badge"},{"name":"BarChart"},{"name":"Breadcrumbs"},{"name":"Button"},{"name":"Calendar"},{"name":"Card"},{"name":"Checkbox"},{"name":"Code"},{"name":"CodeBlock"},{"name":"Combobox"},{"name":"CommandPalette"},{"name":"Container"},{"name":"ContextMenu"},{"name":"DatePicker"},{"name":"DescriptionList"},{"name":"Dialog"},{"name":"Divider"},{"name":"Drawer"},{"name":"EmptyState"},{"name":"ErrorSummary"},{"name":"FaqList"},{"name":"Field"},{"name":"Fieldset"},{"name":"Figure"},{"name":"FileUpload"},{"name":"Grid"},{"name":"HatchDivider"},{"name":"Heading"},{"name":"Icon"},{"name":"IconButton"},{"name":"Inline"},{"name":"Input"},{"name":"Kbd"},{"name":"LineChart"},{"name":"Link"},{"name":"LinkProvider"},{"name":"List"},{"name":"ListItem"},{"name":"MediaCard"},{"name":"Menu"},{"name":"MultiSelect"},{"name":"NavList"},{"name":"NumberInput"},{"name":"OtpInput"},{"name":"PageHeader"},{"name":"Pagination"},{"name":"PasswordInput"},{"name":"Popover"},{"name":"Progress"},{"name":"Prose"},{"name":"Quote"},{"name":"Radio"},{"name":"RadioGroup"},{"name":"SearchInput"},{"name":"SectionHeader"},{"name":"SegmentedControl"},{"name":"Select"},{"name":"Skeleton"},{"name":"Slider"},{"name":"Sparkline"},{"name":"Spinner"},{"name":"SquareGlyph"},{"name":"Stack"},{"name":"Stat"},{"name":"Steps"},{"name":"Switch"},{"name":"Table"},{"name":"Tabs"},{"name":"Tag"},{"name":"Text"},{"name":"Textarea"},{"name":"ThemeScript"},{"name":"TileGrid"},{"name":"TimePicker"},{"name":"Timeline"},{"name":"Toaster"},{"name":"Tooltip"},{"name":"TreeView"},{"name":"LocaleProvider"},{"name":"RichTextEditor"},{"name":"ChatWidget"},{"name":"ChatInbox"}]} */
1
+ /* @ds-bundle: {"format":4,"namespace":"Vokality","components":[{"name":"Accordion"},{"name":"Alert"},{"name":"AppShell"},{"name":"Avatar"},{"name":"AvatarGroup"},{"name":"Badge"},{"name":"BarChart"},{"name":"Breadcrumbs"},{"name":"Button"},{"name":"Calendar"},{"name":"Card"},{"name":"Checkbox"},{"name":"Code"},{"name":"CodeBlock"},{"name":"Combobox"},{"name":"CommandPalette"},{"name":"Container"},{"name":"ContextMenu"},{"name":"DatePicker"},{"name":"DescriptionList"},{"name":"Dialog"},{"name":"Divider"},{"name":"Drawer"},{"name":"EmptyState"},{"name":"ErrorSummary"},{"name":"FaqList"},{"name":"Field"},{"name":"Fieldset"},{"name":"Figure"},{"name":"FileUpload"},{"name":"Grid"},{"name":"HatchDivider"},{"name":"Heading"},{"name":"Icon"},{"name":"IconButton"},{"name":"Inline"},{"name":"Input"},{"name":"Kbd"},{"name":"LineChart"},{"name":"Link"},{"name":"LinkProvider"},{"name":"List"},{"name":"ListItem"},{"name":"MediaCard"},{"name":"Menu"},{"name":"MultiSelect"},{"name":"NavList"},{"name":"NumberInput"},{"name":"OtpInput"},{"name":"PageHeader"},{"name":"Pagination"},{"name":"PasswordInput"},{"name":"Popover"},{"name":"Progress"},{"name":"Prose"},{"name":"Quote"},{"name":"Radio"},{"name":"RadioGroup"},{"name":"SearchInput"},{"name":"SectionHeader"},{"name":"SegmentedControl"},{"name":"Select"},{"name":"Skeleton"},{"name":"Slider"},{"name":"Sparkline"},{"name":"Spinner"},{"name":"SquareGlyph"},{"name":"Stack"},{"name":"Stat"},{"name":"Steps"},{"name":"Switch"},{"name":"Table"},{"name":"Tabs"},{"name":"Tag"},{"name":"Text"},{"name":"Textarea"},{"name":"ThemeProvider"},{"name":"TileGrid"},{"name":"TimePicker"},{"name":"Timeline"},{"name":"Toaster"},{"name":"Tooltip"},{"name":"TreeView"},{"name":"LocaleProvider"},{"name":"RichTextEditor"},{"name":"ChatWidget"},{"name":"ChatInbox"}]} */
2
2
  (() => {
3
3
  var __create = Object.create;
4
4
  var __getProtoOf = Object.getPrototypeOf;
@@ -1052,7 +1052,7 @@ Check the top-level render call using <` + parentName + ">.";
1052
1052
  Tag: () => Tag,
1053
1053
  Text: () => Text,
1054
1054
  Textarea: () => Textarea,
1055
- ThemeScript: () => ThemeScript,
1055
+ ThemeProvider: () => ThemeProvider,
1056
1056
  TileGrid: () => TileGrid,
1057
1057
  TimePicker: () => TimePicker,
1058
1058
  Timeline: () => Timeline,
@@ -1391,7 +1391,7 @@ Check the top-level render call using <` + parentName + ">.";
1391
1391
  var Button = import_react2.forwardRef(function Button(props, ref) {
1392
1392
  const variant = props.variant || "primary";
1393
1393
  const rest = omit(props, ["variant", "size", "href", "arrow", "children", "className", "loading", "loadingLabel", "block"]);
1394
- const className = cx("vk-btn", "vk-btn-" + variant, props.size === "sm" && "vk-btn-sm", props.block && "vk-btn-block", props.loading && "vk-btn-loading", props.className);
1394
+ const className = cx("vk-btn", "vk-btn-" + variant, props.size === "sm" && "vk-btn-sm", props.size === "xs" && "vk-btn-xs", props.block && "vk-btn-block", props.loading && "vk-btn-loading", props.className);
1395
1395
  const kids = [
1396
1396
  /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
1397
1397
  className: "vk-btn-label",
@@ -1778,10 +1778,9 @@ Check the top-level render call using <` + parentName + ">.";
1778
1778
  var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
1779
1779
  var IconButton = import_react6.forwardRef(function IconButton(props, ref) {
1780
1780
  const rest = omit(props, ["icon", "label", "variant", "href", "size", "className"]);
1781
- const className = cx("vk-icon-btn", "vk-icon-btn-" + (props.variant || "ghost"), props.className);
1781
+ const className = cx("vk-icon-btn", "vk-icon-btn-" + (props.variant || "ghost"), props.size === "xs" && "vk-icon-btn-xs", props.className);
1782
1782
  const glyph = /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Icon, {
1783
- name: props.icon,
1784
- size: props.size
1783
+ name: props.icon
1785
1784
  }, undefined, false, undefined, this);
1786
1785
  if (props.href) {
1787
1786
  return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Anchor, {
@@ -14080,13 +14079,13 @@ Defaulting to \`null\`.`;
14080
14079
  var import_react12 = __toESM(require_react(), 1);
14081
14080
  var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
14082
14081
  "use client";
14083
- var Fieldset = import_react12.forwardRef(function Fieldset({ legend, hint, error, children, className, id, "aria-describedby": existing, ...rest }, ref) {
14082
+ var Fieldset = import_react12.forwardRef(function Fieldset({ legend, hint, error, plain, children, className, id, "aria-describedby": existing, ...rest }, ref) {
14084
14083
  const uid = useUid("vk-fieldset");
14085
14084
  const groupId = id || uid;
14086
14085
  return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("fieldset", {
14087
14086
  ref,
14088
14087
  id: groupId,
14089
- className: cx("vk-fieldset", className),
14088
+ className: cx("vk-fieldset", plain && "vk-fieldset-plain", className),
14090
14089
  "aria-describedby": describedBy(groupId, hint, error, existing),
14091
14090
  "aria-invalid": error ? true : undefined,
14092
14091
  ...rest,
@@ -16572,7 +16571,6 @@ Defaulting to \`null\`.`;
16572
16571
  }, undefined, true, undefined, this),
16573
16572
  onDismiss ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(IconButton, {
16574
16573
  icon: "x",
16575
- size: 16,
16576
16574
  label: dismissLabel || messages.dismiss,
16577
16575
  className: "vk-alert-close",
16578
16576
  onClick: onDismiss
@@ -16677,7 +16675,6 @@ Defaulting to \`null\`.`;
16677
16675
  asChild: true,
16678
16676
  children: /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(IconButton, {
16679
16677
  icon: "x",
16680
- size: 16,
16681
16678
  label: messages.dismissNotification,
16682
16679
  className: "vk-alert-close"
16683
16680
  }, undefined, false, undefined, this)
@@ -16943,6 +16940,9 @@ Defaulting to \`null\`.`;
16943
16940
  // src/components/Menu/Menu.tsx
16944
16941
  var jsx_dev_runtime40 = __toESM(require_jsx_dev_runtime(), 1);
16945
16942
  "use client";
16943
+ function triggerClass(iconOnly, variant, size) {
16944
+ return iconOnly ? cx("vk-icon-btn", "vk-icon-btn-" + (variant || "ghost"), size === "xs" && "vk-icon-btn-xs") : cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" && "vk-btn-sm", size === "xs" && "vk-btn-xs");
16945
+ }
16946
16946
  function Menu2({ items, label, icon, triggerLabel, variant, size, align, disabled, className }) {
16947
16947
  const { messages } = useLocale();
16948
16948
  const iconOnly = label ? undefined : icon;
@@ -16952,7 +16952,7 @@ Defaulting to \`null\`.`;
16952
16952
  children: [
16953
16953
  /* @__PURE__ */ jsx_dev_runtime40.jsxDEV(DropdownMenuTrigger, {
16954
16954
  disabled,
16955
- className: iconOnly ? "vk-icon-btn vk-icon-btn-" + (variant || "ghost") : cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" ? "vk-btn-sm" : null),
16955
+ className: triggerClass(Boolean(iconOnly), variant, size),
16956
16956
  "aria-label": iconOnly ? triggerLabel || messages.moreActions : undefined,
16957
16957
  title: iconOnly ? triggerLabel || messages.moreActions : undefined,
16958
16958
  children: iconOnly ? /* @__PURE__ */ jsx_dev_runtime40.jsxDEV(Icon, {
@@ -17011,7 +17011,7 @@ Defaulting to \`null\`.`;
17011
17011
  modal,
17012
17012
  children: [
17013
17013
  /* @__PURE__ */ jsx_dev_runtime41.jsxDEV(PopoverTrigger, {
17014
- className: cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" ? "vk-btn-sm" : null),
17014
+ className: cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" ? "vk-btn-sm" : size === "xs" ? "vk-btn-xs" : null),
17015
17015
  children: [
17016
17016
  /* @__PURE__ */ jsx_dev_runtime41.jsxDEV("span", {
17017
17017
  className: "vk-btn-label",
@@ -17220,7 +17220,7 @@ Defaulting to \`null\`.`;
17220
17220
  const options = normalizeOptions(optionsProp, (value) => ({ value, label: value }));
17221
17221
  return /* @__PURE__ */ jsx_dev_runtime45.jsxDEV(RadioGroup, {
17222
17222
  "aria-label": label,
17223
- className: cx("vk-segmented", size === "sm" && "vk-segmented-sm", className),
17223
+ className: cx("vk-segmented", size === "sm" && "vk-segmented-sm", size === "xs" && "vk-segmented-xs", className),
17224
17224
  value: valueProp,
17225
17225
  defaultValue,
17226
17226
  onValueChange: onChange,
@@ -18238,7 +18238,6 @@ Defaulting to \`null\`.`;
18238
18238
  }, undefined, false, undefined, this),
18239
18239
  /* @__PURE__ */ jsx_dev_runtime59.jsxDEV(IconButton, {
18240
18240
  icon: "x",
18241
- size: 16,
18242
18241
  label: messages.remove(f.name),
18243
18242
  onClick: () => {
18244
18243
  remove(i);
@@ -18457,7 +18456,8 @@ Defaulting to \`null\`.`;
18457
18456
  }, undefined, true, undefined, this);
18458
18457
  }
18459
18458
  function ShellSidebar({ id, modal, label, footer, children }) {
18460
- const aside = /* @__PURE__ */ jsx_dev_runtime62.jsxDEV("aside", {
18459
+ const Tag = modal ? "div" : "aside";
18460
+ const aside = /* @__PURE__ */ jsx_dev_runtime62.jsxDEV(Tag, {
18461
18461
  id,
18462
18462
  className: "vk-shell-sidebar",
18463
18463
  "aria-label": label,
@@ -19001,6 +19001,7 @@ Defaulting to \`null\`.`;
19001
19001
  "aria-activedescendant": open && active >= 0 ? listId + "-" + String(active) : undefined,
19002
19002
  onChange: (e) => {
19003
19003
  type(e.target.value);
19004
+ setActive(-1);
19004
19005
  },
19005
19006
  onClick: () => {
19006
19007
  if (!open)
@@ -19057,6 +19058,7 @@ Defaulting to \`null\`.`;
19057
19058
  function ErrorSummary(props) {
19058
19059
  const { messages } = useLocale();
19059
19060
  const ref = import_react45.useRef(null);
19061
+ const titleId = useUid("vk-errsum-title");
19060
19062
  const errors = props.errors;
19061
19063
  const autoFocusRef = import_react45.useRef(props.autoFocus);
19062
19064
  import_react45.useEffect(() => {
@@ -19074,7 +19076,7 @@ Defaulting to \`null\`.`;
19074
19076
  tabIndex: -1,
19075
19077
  role: "alert",
19076
19078
  className: "vk-alert vk-alert-danger vk-error-summary",
19077
- "aria-labelledby": "vk-errsum-title",
19079
+ "aria-labelledby": titleId,
19078
19080
  children: [
19079
19081
  /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(Icon, {
19080
19082
  name: "circle-alert",
@@ -19085,7 +19087,7 @@ Defaulting to \`null\`.`;
19085
19087
  className: "vk-alert-body",
19086
19088
  children: [
19087
19089
  /* @__PURE__ */ jsx_dev_runtime68.jsxDEV("p", {
19088
- id: "vk-errsum-title",
19090
+ id: titleId,
19089
19091
  className: "vk-alert-title",
19090
19092
  children: title
19091
19093
  }, undefined, false, undefined, this),
@@ -19495,10 +19497,10 @@ Defaulting to \`null\`.`;
19495
19497
  }
19496
19498
  // src/components/Prose/Prose.tsx
19497
19499
  var jsx_dev_runtime75 = __toESM(require_jsx_dev_runtime(), 1);
19498
- function Prose({ as, children, className }) {
19500
+ function Prose({ as, children, className, tone }) {
19499
19501
  const Tag = as || "div";
19500
19502
  return /* @__PURE__ */ jsx_dev_runtime75.jsxDEV(Tag, {
19501
- className: cx("vk-prose", className),
19503
+ className: cx("vk-prose", tone === "foreground" && "vk-prose-foreground", className),
19502
19504
  children
19503
19505
  }, undefined, false, undefined, this);
19504
19506
  }
@@ -19789,8 +19791,8 @@ Defaulting to \`null\`.`;
19789
19791
  placeholder: placeholder || messages.commandSearch,
19790
19792
  autoComplete: "off",
19791
19793
  value: query,
19792
- "aria-expanded": "true",
19793
- "aria-controls": uid + "-list",
19794
+ "aria-expanded": cmds.length > 0,
19795
+ "aria-controls": cmds.length ? uid + "-list" : undefined,
19794
19796
  "aria-activedescendant": cmds.length ? uid + "-" + String(active) : undefined,
19795
19797
  "aria-autocomplete": "list",
19796
19798
  onChange: (e) => {
@@ -19863,7 +19865,7 @@ Defaulting to \`null\`.`;
19863
19865
  ]
19864
19866
  }, c.id || c.label, true, undefined, this))
19865
19867
  ]
19866
- }, g.name || "_", true, undefined, this))
19868
+ }, String(g.items[0]?.i) + ":" + g.name, true, undefined, this))
19867
19869
  }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("p", {
19868
19870
  className: "vk-select-empty",
19869
19871
  role: "status",
@@ -20418,7 +20420,7 @@ Defaulting to \`null\`.`;
20418
20420
  }, undefined, true, undefined, this);
20419
20421
  }
20420
20422
  // src/hooks/useTheme.ts
20421
- var import_react52 = __toESM(require_react(), 1);
20423
+ var import_react53 = __toESM(require_react(), 1);
20422
20424
 
20423
20425
  // src/lib/theme.ts
20424
20426
  var THEMES = ["dark", "light", "contrast"];
@@ -20426,9 +20428,14 @@ Defaulting to \`null\`.`;
20426
20428
  const key = JSON.stringify(options.storageKey || "vk-theme").replace(/</g, "\\u003c");
20427
20429
  const fallback = JSON.stringify(options.defaultTheme && THEMES.includes(options.defaultTheme) ? options.defaultTheme : "dark");
20428
20430
  const system = options.followSystem === false ? "" : 'if(matchMedia("(prefers-contrast: more)").matches)t="contrast";else if(matchMedia("(prefers-color-scheme: light)").matches)t="light";else if(matchMedia("(prefers-color-scheme: dark)").matches)t="dark";';
20429
- return "(function(){var t=" + fallback + ";try{var s=localStorage.getItem(" + key + ');if(s==="dark"||s==="light"||s==="contrast")t=s;else{' + system + '}}catch(e){}document.documentElement.setAttribute("data-theme",t)})();';
20431
+ return "(function(){var t=" + fallback + ";try{var s=localStorage.getItem(" + key + ');if(s==="dark"||s==="light"||s==="contrast")t=s;else{' + system + '}}catch(e){}document.documentElement.setAttribute("data-theme",t)' + (options.density === "compact" ? ';document.documentElement.setAttribute("data-density","compact")' : "") + "})();";
20430
20432
  }
20431
20433
 
20434
+ // src/internal/themeOptions.ts
20435
+ var import_react52 = __toESM(require_react(), 1);
20436
+ "use client";
20437
+ var ThemeOptionsContext = import_react52.createContext(null);
20438
+
20432
20439
  // src/hooks/useTheme.ts
20433
20440
  "use client";
20434
20441
  var THEME_EVENT = "vk-themechange";
@@ -20450,13 +20457,13 @@ Defaulting to \`null\`.`;
20450
20457
  return "system";
20451
20458
  }
20452
20459
  }
20453
- function useTheme(options) {
20454
- const o = options || {};
20460
+ function useTheme() {
20461
+ const o = import_react53.useContext(ThemeOptionsContext) || {};
20455
20462
  const key = o.storageKey || "vk-theme";
20456
20463
  const fallback = isTheme(o.defaultTheme) ? o.defaultTheme : "dark";
20457
20464
  const follow = o.followSystem !== false;
20458
- const resolve = import_react52.useCallback((pref) => pref !== "system" ? pref : follow ? systemTheme() : fallback, [follow, fallback]);
20459
- const subscribe = import_react52.useCallback((cb) => {
20465
+ const resolve = import_react53.useCallback((pref) => pref !== "system" ? pref : follow ? systemTheme() : fallback, [follow, fallback]);
20466
+ const subscribe = import_react53.useCallback((cb) => {
20460
20467
  const mqs = ["(prefers-contrast: more)", "(prefers-color-scheme: light)"].map((q) => typeof Reflect.get(window, "matchMedia") === "function" ? window.matchMedia(q) : null);
20461
20468
  const onSystem = () => {
20462
20469
  if (readPreference(key) === "system")
@@ -20484,9 +20491,9 @@ Defaulting to \`null\`.`;
20484
20491
  window.removeEventListener("storage", onStorage);
20485
20492
  };
20486
20493
  }, [key, resolve]);
20487
- const snapshot = import_react52.useCallback(() => readPreference(key) + "|" + (document.documentElement.getAttribute("data-theme") || resolve(readPreference(key))), [key, resolve]);
20488
- const [pref, resolved] = import_react52.useSyncExternalStore(subscribe, snapshot, () => "system|" + fallback).split("|");
20489
- const setTheme = import_react52.useCallback((next) => {
20494
+ const snapshot = import_react53.useCallback(() => readPreference(key) + "|" + (document.documentElement.getAttribute("data-theme") || resolve(readPreference(key))), [key, resolve]);
20495
+ const [pref, resolved] = import_react53.useSyncExternalStore(subscribe, snapshot, () => "system|" + fallback).split("|");
20496
+ const setTheme = import_react53.useCallback((next) => {
20490
20497
  const choice = isTheme(next) ? next : "system";
20491
20498
  try {
20492
20499
  if (choice === "system")
@@ -20504,33 +20511,69 @@ Defaulting to \`null\`.`;
20504
20511
  themes: THEMES.slice()
20505
20512
  };
20506
20513
  }
20507
- // src/components/ThemeScript/ThemeScript.tsx
20514
+ // src/internal/ThemeOptionsProvider.tsx
20515
+ var import_react54 = __toESM(require_react(), 1);
20508
20516
  var jsx_dev_runtime84 = __toESM(require_jsx_dev_runtime(), 1);
20509
- function ThemeScript(props) {
20510
- return /* @__PURE__ */ jsx_dev_runtime84.jsxDEV("script", {
20511
- nonce: props.nonce,
20512
- dangerouslySetInnerHTML: { __html: themeScript(props) }
20517
+ "use client";
20518
+ function ThemeOptionsProvider({ options, children }) {
20519
+ const compact = options.density === "compact";
20520
+ useIsoLayoutEffect(() => {
20521
+ if (compact)
20522
+ document.documentElement.setAttribute("data-density", "compact");
20523
+ else
20524
+ document.documentElement.removeAttribute("data-density");
20525
+ }, [compact]);
20526
+ return /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemeOptionsContext.Provider, {
20527
+ value: options,
20528
+ children
20513
20529
  }, undefined, false, undefined, this);
20514
20530
  }
20531
+ var noSubscription = () => () => {};
20532
+ function ThemeScriptTag({ options, nonce }) {
20533
+ const fromServer = import_react54.useSyncExternalStore(noSubscription, () => false, () => true);
20534
+ return fromServer ? /* @__PURE__ */ jsx_dev_runtime84.jsxDEV("script", {
20535
+ nonce,
20536
+ suppressHydrationWarning: true,
20537
+ dangerouslySetInnerHTML: { __html: themeScript(options) }
20538
+ }, undefined, false, undefined, this) : null;
20539
+ }
20540
+
20541
+ // src/components/ThemeProvider/ThemeProvider.tsx
20542
+ var jsx_dev_runtime85 = __toESM(require_jsx_dev_runtime(), 1);
20543
+ function ThemeProvider({ defaultTheme, storageKey, followSystem, density, nonce, children }) {
20544
+ const options = { defaultTheme, storageKey, followSystem, density };
20545
+ return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(jsx_dev_runtime85.Fragment, {
20546
+ children: [
20547
+ /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ThemeScriptTag, {
20548
+ options,
20549
+ nonce
20550
+ }, undefined, false, undefined, this),
20551
+ /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ThemeOptionsProvider, {
20552
+ options,
20553
+ children
20554
+ }, undefined, false, undefined, this)
20555
+ ]
20556
+ }, undefined, true, undefined, this);
20557
+ }
20515
20558
  // src/lib/utils.ts
20516
20559
  var utils = { parseDateInput, parseTime, formatTime, pageList, toISO, parseISO, addDays, addMonths, formatBytes, niceTicks, resolveLocale };
20517
20560
  // src/components/ChatWidget/ChatWidget.tsx
20518
- var import_react83 = __toESM(require_react(), 1);
20561
+ var import_react85 = __toESM(require_react(), 1);
20519
20562
 
20520
20563
  // node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
20521
20564
  var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
20522
- var import_react62 = __toESM(require_react(), 1);
20565
+ var import_react64 = __toESM(require_react(), 1);
20523
20566
 
20524
20567
  // node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs
20525
- var import_react53 = __toESM(require_react(), 1);
20568
+ var import_react55 = __toESM(require_react(), 1);
20526
20569
  "use client";
20527
- var LayoutGroupContext = import_react53.createContext({});
20570
+ var LayoutGroupContext = import_react55.createContext({});
20528
20571
 
20529
20572
  // node_modules/framer-motion/dist/es/utils/use-constant.mjs
20530
- var import_react54 = __toESM(require_react(), 1);
20573
+ var import_react56 = __toESM(require_react(), 1);
20531
20574
  "use client";
20532
20575
  function useConstant(init) {
20533
- const ref = import_react54.useRef(null);
20576
+ const ref = import_react56.useRef(null);
20534
20577
  if (ref.current === null) {
20535
20578
  ref.current = init();
20536
20579
  }
@@ -20538,24 +20581,24 @@ Defaulting to \`null\`.`;
20538
20581
  }
20539
20582
 
20540
20583
  // node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
20541
- var import_react55 = __toESM(require_react(), 1);
20584
+ var import_react57 = __toESM(require_react(), 1);
20542
20585
 
20543
20586
  // node_modules/framer-motion/dist/es/utils/is-browser.mjs
20544
20587
  var isBrowser = typeof window !== "undefined";
20545
20588
 
20546
20589
  // node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
20547
20590
  "use client";
20548
- var useIsomorphicLayoutEffect2 = isBrowser ? import_react55.useLayoutEffect : import_react55.useEffect;
20591
+ var useIsomorphicLayoutEffect2 = isBrowser ? import_react57.useLayoutEffect : import_react57.useEffect;
20549
20592
 
20550
20593
  // node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
20551
20594
  var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
20552
20595
  var React59 = __toESM(require_react(), 1);
20553
- var import_react59 = __toESM(require_react(), 1);
20596
+ var import_react61 = __toESM(require_react(), 1);
20554
20597
 
20555
20598
  // node_modules/framer-motion/dist/es/context/PresenceContext.mjs
20556
- var import_react56 = __toESM(require_react(), 1);
20599
+ var import_react58 = __toESM(require_react(), 1);
20557
20600
  "use client";
20558
- var PresenceContext = /* @__PURE__ */ import_react56.createContext(null);
20601
+ var PresenceContext = /* @__PURE__ */ import_react58.createContext(null);
20559
20602
 
20560
20603
  // node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
20561
20604
  var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
@@ -25632,12 +25675,12 @@ Defaulting to \`null\`.`;
25632
25675
  }
25633
25676
  // node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
25634
25677
  var React58 = __toESM(require_react(), 1);
25635
- var import_react58 = __toESM(require_react(), 1);
25678
+ var import_react60 = __toESM(require_react(), 1);
25636
25679
 
25637
25680
  // node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
25638
- var import_react57 = __toESM(require_react(), 1);
25681
+ var import_react59 = __toESM(require_react(), 1);
25639
25682
  "use client";
25640
- var MotionConfigContext = import_react57.createContext({
25683
+ var MotionConfigContext = import_react59.createContext({
25641
25684
  transformPagePoint: (p) => p,
25642
25685
  isStatic: false,
25643
25686
  reducedMotion: "never"
@@ -25708,9 +25751,9 @@ Defaulting to \`null\`.`;
25708
25751
  }
25709
25752
  }
25710
25753
  function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) {
25711
- const id = import_react58.useId();
25712
- const ref = import_react58.useRef(null);
25713
- const size = import_react58.useRef({
25754
+ const id = import_react60.useId();
25755
+ const ref = import_react60.useRef(null);
25756
+ const size = import_react60.useRef({
25714
25757
  width: 0,
25715
25758
  height: 0,
25716
25759
  top: 0,
@@ -25719,10 +25762,10 @@ Defaulting to \`null\`.`;
25719
25762
  bottom: 0,
25720
25763
  direction: "ltr"
25721
25764
  });
25722
- const { nonce } = import_react58.useContext(MotionConfigContext);
25765
+ const { nonce } = import_react60.useContext(MotionConfigContext);
25723
25766
  const childRef = pop !== false ? children.props?.ref ?? children?.ref : undefined;
25724
25767
  const composedRef = useComposedRefs2(ref, childRef);
25725
- import_react58.useInsertionEffect(() => {
25768
+ import_react60.useInsertionEffect(() => {
25726
25769
  const { width, height, top, left, right, bottom, direction } = size.current;
25727
25770
  if (isPresent || pop === false || !ref.current || !width || !height)
25728
25771
  return;
@@ -25762,15 +25805,15 @@ Defaulting to \`null\`.`;
25762
25805
  "use client";
25763
25806
  var PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => {
25764
25807
  const presenceChildren = useConstant(newChildrenMap);
25765
- const id = import_react59.useId();
25766
- const isPresentRef = import_react59.useRef(isPresent);
25767
- const onExitCompleteRef = import_react59.useRef(onExitComplete);
25808
+ const id = import_react61.useId();
25809
+ const isPresentRef = import_react61.useRef(isPresent);
25810
+ const onExitCompleteRef = import_react61.useRef(onExitComplete);
25768
25811
  useIsomorphicLayoutEffect2(() => {
25769
25812
  isPresentRef.current = isPresent;
25770
25813
  onExitCompleteRef.current = onExitComplete;
25771
25814
  });
25772
25815
  let isReusedContext = true;
25773
- let context = import_react59.useMemo(() => {
25816
+ let context = import_react61.useMemo(() => {
25774
25817
  isReusedContext = false;
25775
25818
  return {
25776
25819
  id,
@@ -25797,7 +25840,7 @@ Defaulting to \`null\`.`;
25797
25840
  if (presenceAffectsLayout && isReusedContext) {
25798
25841
  context = { ...context };
25799
25842
  }
25800
- import_react59.useMemo(() => {
25843
+ import_react61.useMemo(() => {
25801
25844
  presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
25802
25845
  }, [isPresent]);
25803
25846
  React59.useEffect(() => {
@@ -25811,30 +25854,30 @@ Defaulting to \`null\`.`;
25811
25854
  }
25812
25855
 
25813
25856
  // node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
25814
- var import_react60 = __toESM(require_react(), 1);
25857
+ var import_react62 = __toESM(require_react(), 1);
25815
25858
  "use client";
25816
25859
  function usePresence2(subscribe = true) {
25817
- const context = import_react60.useContext(PresenceContext);
25860
+ const context = import_react62.useContext(PresenceContext);
25818
25861
  if (context === null)
25819
25862
  return [true, null];
25820
25863
  const { isPresent, onExitComplete, register } = context;
25821
- const id = import_react60.useId();
25822
- import_react60.useEffect(() => {
25864
+ const id = import_react62.useId();
25865
+ import_react62.useEffect(() => {
25823
25866
  if (subscribe) {
25824
25867
  return register(id);
25825
25868
  }
25826
25869
  }, [subscribe]);
25827
- const safeToRemove = import_react60.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
25870
+ const safeToRemove = import_react62.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);
25828
25871
  return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
25829
25872
  }
25830
25873
 
25831
25874
  // node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
25832
- var import_react61 = __toESM(require_react(), 1);
25875
+ var import_react63 = __toESM(require_react(), 1);
25833
25876
  var getChildKey = (child) => child.key || "";
25834
25877
  function onlyElements(children) {
25835
25878
  const filtered = [];
25836
- import_react61.Children.forEach(children, (child) => {
25837
- if (import_react61.isValidElement(child))
25879
+ import_react63.Children.forEach(children, (child) => {
25880
+ if (import_react63.isValidElement(child))
25838
25881
  filtered.push(child);
25839
25882
  });
25840
25883
  return filtered;
@@ -25844,13 +25887,13 @@ Defaulting to \`null\`.`;
25844
25887
  "use client";
25845
25888
  var AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => {
25846
25889
  const [isParentPresent, safeToRemove] = usePresence2(propagate);
25847
- const presentChildren = import_react62.useMemo(() => onlyElements(children), [children]);
25890
+ const presentChildren = import_react64.useMemo(() => onlyElements(children), [children]);
25848
25891
  const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);
25849
- const isInitialRender = import_react62.useRef(true);
25892
+ const isInitialRender = import_react64.useRef(true);
25850
25893
  const exitComplete = useConstant(() => new Map);
25851
- const exitingComponents = import_react62.useRef(new Set);
25852
- const [diffedChildren, setDiffedChildren] = import_react62.useState(presentChildren);
25853
- const [renderedChildren, setRenderedChildren] = import_react62.useState(presentChildren);
25894
+ const exitingComponents = import_react64.useRef(new Set);
25895
+ const [diffedChildren, setDiffedChildren] = import_react64.useState(presentChildren);
25896
+ const [renderedChildren, setRenderedChildren] = import_react64.useState(presentChildren);
25854
25897
  useIsomorphicLayoutEffect2(() => {
25855
25898
  if (propagate && !isParentPresent && !renderedChildren.length) {
25856
25899
  safeToRemove?.();
@@ -25895,7 +25938,7 @@ Defaulting to \`null\`.`;
25895
25938
  if (mode === "wait" && renderedChildren.length > 1) {
25896
25939
  console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
25897
25940
  }
25898
- const { forceRender } = import_react62.useContext(LayoutGroupContext);
25941
+ const { forceRender } = import_react64.useContext(LayoutGroupContext);
25899
25942
  return import_jsx_runtime39.jsx(import_jsx_runtime39.Fragment, { children: renderedChildren.map((child) => {
25900
25943
  const key = getChildKey(child);
25901
25944
  const isPresent = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key);
@@ -25926,12 +25969,12 @@ Defaulting to \`null\`.`;
25926
25969
  };
25927
25970
  // node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs
25928
25971
  var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
25929
- var import_react64 = __toESM(require_react(), 1);
25972
+ var import_react66 = __toESM(require_react(), 1);
25930
25973
 
25931
25974
  // node_modules/framer-motion/dist/es/context/LazyContext.mjs
25932
- var import_react63 = __toESM(require_react(), 1);
25975
+ var import_react65 = __toESM(require_react(), 1);
25933
25976
  "use client";
25934
- var LazyContext = import_react63.createContext({ strict: false });
25977
+ var LazyContext = import_react65.createContext({ strict: false });
25935
25978
 
25936
25979
  // node_modules/framer-motion/dist/es/motion/features/definitions.mjs
25937
25980
  var featureProps = {
@@ -25987,14 +26030,14 @@ Defaulting to \`null\`.`;
25987
26030
  // node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs
25988
26031
  "use client";
25989
26032
  function LazyMotion({ children, features, strict = false }) {
25990
- const [, setIsLoaded] = import_react64.useState(!isLazyBundle(features));
25991
- const loadedRenderer = import_react64.useRef(undefined);
26033
+ const [, setIsLoaded] = import_react66.useState(!isLazyBundle(features));
26034
+ const loadedRenderer = import_react66.useRef(undefined);
25992
26035
  if (!isLazyBundle(features)) {
25993
26036
  const { renderer, ...loadedFeatures } = features;
25994
26037
  loadedRenderer.current = renderer;
25995
26038
  loadFeatures(loadedFeatures);
25996
26039
  }
25997
- import_react64.useEffect(() => {
26040
+ import_react66.useEffect(() => {
25998
26041
  if (isLazyBundle(features)) {
25999
26042
  features().then(({ renderer, ...loadedFeatures }) => {
26000
26043
  loadFeatures(loadedFeatures);
@@ -26010,15 +26053,15 @@ Defaulting to \`null\`.`;
26010
26053
  }
26011
26054
  // node_modules/framer-motion/dist/es/motion/index.mjs
26012
26055
  var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
26013
- var import_react74 = __toESM(require_react(), 1);
26056
+ var import_react76 = __toESM(require_react(), 1);
26014
26057
 
26015
26058
  // node_modules/framer-motion/dist/es/context/MotionContext/index.mjs
26016
- var import_react65 = __toESM(require_react(), 1);
26059
+ var import_react67 = __toESM(require_react(), 1);
26017
26060
  "use client";
26018
- var MotionContext = /* @__PURE__ */ import_react65.createContext({});
26061
+ var MotionContext = /* @__PURE__ */ import_react67.createContext({});
26019
26062
 
26020
26063
  // node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
26021
- var import_react66 = __toESM(require_react(), 1);
26064
+ var import_react68 = __toESM(require_react(), 1);
26022
26065
 
26023
26066
  // node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
26024
26067
  function getCurrentTreeVariants(props, context) {
@@ -26035,18 +26078,18 @@ Defaulting to \`null\`.`;
26035
26078
  // node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
26036
26079
  "use client";
26037
26080
  function useCreateMotionContext(props) {
26038
- const { initial, animate } = getCurrentTreeVariants(props, import_react66.useContext(MotionContext));
26039
- return import_react66.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
26081
+ const { initial, animate } = getCurrentTreeVariants(props, import_react68.useContext(MotionContext));
26082
+ return import_react68.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
26040
26083
  }
26041
26084
  function variantLabelsAsDependency(prop) {
26042
26085
  return Array.isArray(prop) ? prop.join(" ") : prop;
26043
26086
  }
26044
26087
 
26045
26088
  // node_modules/framer-motion/dist/es/render/dom/use-render.mjs
26046
- var import_react69 = __toESM(require_react(), 1);
26089
+ var import_react71 = __toESM(require_react(), 1);
26047
26090
 
26048
26091
  // node_modules/framer-motion/dist/es/render/html/use-props.mjs
26049
- var import_react67 = __toESM(require_react(), 1);
26092
+ var import_react69 = __toESM(require_react(), 1);
26050
26093
 
26051
26094
  // node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs
26052
26095
  var createHtmlRenderState = () => ({
@@ -26066,7 +26109,7 @@ Defaulting to \`null\`.`;
26066
26109
  }
26067
26110
  }
26068
26111
  function useInitialMotionValues({ transformTemplate }, visualState) {
26069
- return import_react67.useMemo(() => {
26112
+ return import_react69.useMemo(() => {
26070
26113
  const state = createHtmlRenderState();
26071
26114
  buildHTMLStyles(state, visualState, transformTemplate);
26072
26115
  return Object.assign({}, state.vars, state.style);
@@ -26095,7 +26138,7 @@ Defaulting to \`null\`.`;
26095
26138
  }
26096
26139
 
26097
26140
  // node_modules/framer-motion/dist/es/render/svg/use-props.mjs
26098
- var import_react68 = __toESM(require_react(), 1);
26141
+ var import_react70 = __toESM(require_react(), 1);
26099
26142
 
26100
26143
  // node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
26101
26144
  var createSvgRenderState = () => ({
@@ -26106,7 +26149,7 @@ Defaulting to \`null\`.`;
26106
26149
  // node_modules/framer-motion/dist/es/render/svg/use-props.mjs
26107
26150
  "use client";
26108
26151
  function useSVGProps(props, visualState, _isStatic, Component) {
26109
- const visualProps = import_react68.useMemo(() => {
26152
+ const visualProps = import_react70.useMemo(() => {
26110
26153
  const state = createSvgRenderState();
26111
26154
  buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
26112
26155
  return {
@@ -26222,17 +26265,17 @@ Defaulting to \`null\`.`;
26222
26265
  const useVisualProps = isSVG ?? isSVGComponent(Component) ? useSVGProps : useHTMLProps;
26223
26266
  const visualProps = useVisualProps(props, latestValues, isStatic, Component);
26224
26267
  const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps, isValidProp);
26225
- const elementProps = Component !== import_react69.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
26268
+ const elementProps = Component !== import_react71.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
26226
26269
  const { children } = props;
26227
- const renderedChildren = import_react69.useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
26228
- return import_react69.createElement(Component, {
26270
+ const renderedChildren = import_react71.useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
26271
+ return import_react71.createElement(Component, {
26229
26272
  ...elementProps,
26230
26273
  children: renderedChildren
26231
26274
  });
26232
26275
  }
26233
26276
 
26234
26277
  // node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
26235
- var import_react70 = __toESM(require_react(), 1);
26278
+ var import_react72 = __toESM(require_react(), 1);
26236
26279
  "use client";
26237
26280
  function makeState({ scrapeMotionValuesFromProps, createRenderState }, props, context, presenceContext) {
26238
26281
  const state = {
@@ -26284,8 +26327,8 @@ Defaulting to \`null\`.`;
26284
26327
  return values;
26285
26328
  }
26286
26329
  var makeUseVisualState = (config) => (props, isStatic) => {
26287
- const context = import_react70.useContext(MotionContext);
26288
- const presenceContext = import_react70.useContext(PresenceContext);
26330
+ const context = import_react72.useContext(MotionContext);
26331
+ const presenceContext = import_react72.useContext(PresenceContext);
26289
26332
  const make = () => makeState(config, props, context, presenceContext);
26290
26333
  return isStatic ? make() : useConstant(make);
26291
26334
  };
@@ -26308,15 +26351,15 @@ Defaulting to \`null\`.`;
26308
26351
  var motionComponentSymbol = Symbol.for("motionComponentSymbol");
26309
26352
 
26310
26353
  // node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs
26311
- var import_react71 = __toESM(require_react(), 1);
26354
+ var import_react73 = __toESM(require_react(), 1);
26312
26355
  "use client";
26313
26356
  function useMotionRef(visualState, visualElement, externalRef) {
26314
- const externalRefContainer = import_react71.useRef(externalRef);
26315
- import_react71.useInsertionEffect(() => {
26357
+ const externalRefContainer = import_react73.useRef(externalRef);
26358
+ import_react73.useInsertionEffect(() => {
26316
26359
  externalRefContainer.current = externalRef;
26317
26360
  });
26318
- const refCleanup = import_react71.useRef(null);
26319
- return import_react71.useCallback((instance) => {
26361
+ const refCleanup = import_react73.useRef(null);
26362
+ return import_react73.useCallback((instance) => {
26320
26363
  if (instance) {
26321
26364
  visualState.onMount?.(instance);
26322
26365
  }
@@ -26343,12 +26386,12 @@ Defaulting to \`null\`.`;
26343
26386
  }
26344
26387
 
26345
26388
  // node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
26346
- var import_react73 = __toESM(require_react(), 1);
26389
+ var import_react75 = __toESM(require_react(), 1);
26347
26390
 
26348
26391
  // node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs
26349
- var import_react72 = __toESM(require_react(), 1);
26392
+ var import_react74 = __toESM(require_react(), 1);
26350
26393
  "use client";
26351
- var SwitchLayoutGroupContext = import_react72.createContext({});
26394
+ var SwitchLayoutGroupContext = import_react74.createContext({});
26352
26395
 
26353
26396
  // node_modules/framer-motion/dist/es/utils/is-ref-object.mjs
26354
26397
  function isRefObject(ref) {
@@ -26358,14 +26401,14 @@ Defaulting to \`null\`.`;
26358
26401
  // node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
26359
26402
  "use client";
26360
26403
  function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
26361
- const { visualElement: parent } = import_react73.useContext(MotionContext);
26362
- const lazyContext = import_react73.useContext(LazyContext);
26363
- const presenceContext = import_react73.useContext(PresenceContext);
26364
- const motionConfig = import_react73.useContext(MotionConfigContext);
26404
+ const { visualElement: parent } = import_react75.useContext(MotionContext);
26405
+ const lazyContext = import_react75.useContext(LazyContext);
26406
+ const presenceContext = import_react75.useContext(PresenceContext);
26407
+ const motionConfig = import_react75.useContext(MotionConfigContext);
26365
26408
  const reducedMotionConfig = motionConfig.reducedMotion;
26366
26409
  const skipAnimations = motionConfig.skipAnimations;
26367
- const visualElementRef = import_react73.useRef(null);
26368
- const hasMountedOnce = import_react73.useRef(false);
26410
+ const visualElementRef = import_react75.useRef(null);
26411
+ const hasMountedOnce = import_react75.useRef(false);
26369
26412
  createVisualElement = createVisualElement || lazyContext.renderer;
26370
26413
  if (!visualElementRef.current && createVisualElement) {
26371
26414
  visualElementRef.current = createVisualElement(Component, {
@@ -26383,18 +26426,18 @@ Defaulting to \`null\`.`;
26383
26426
  }
26384
26427
  }
26385
26428
  const visualElement = visualElementRef.current;
26386
- const initialLayoutGroupConfig = import_react73.useContext(SwitchLayoutGroupContext);
26429
+ const initialLayoutGroupConfig = import_react75.useContext(SwitchLayoutGroupContext);
26387
26430
  if (visualElement && !visualElement.projection && ProjectionNodeConstructor && (visualElement.type === "html" || visualElement.type === "svg")) {
26388
26431
  createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
26389
26432
  }
26390
- const isMounted = import_react73.useRef(false);
26391
- import_react73.useInsertionEffect(() => {
26433
+ const isMounted = import_react75.useRef(false);
26434
+ import_react75.useInsertionEffect(() => {
26392
26435
  if (visualElement && isMounted.current) {
26393
26436
  visualElement.update(props, presenceContext);
26394
26437
  }
26395
26438
  });
26396
26439
  const optimisedAppearId = props[optimizedAppearDataAttribute];
26397
- const wantsHandoff = import_react73.useRef(Boolean(optimisedAppearId) && typeof window !== "undefined" && !window.MotionHandoffIsComplete?.(optimisedAppearId) && window.MotionHasOptimisedAnimation?.(optimisedAppearId));
26440
+ const wantsHandoff = import_react75.useRef(Boolean(optimisedAppearId) && typeof window !== "undefined" && !window.MotionHandoffIsComplete?.(optimisedAppearId) && window.MotionHasOptimisedAnimation?.(optimisedAppearId));
26398
26441
  useIsomorphicLayoutEffect2(() => {
26399
26442
  if (!hasMountedOnce.current || !visualElement)
26400
26443
  return;
@@ -26413,7 +26456,7 @@ Defaulting to \`null\`.`;
26413
26456
  visualElement.animationState.animateChanges();
26414
26457
  }
26415
26458
  });
26416
- import_react73.useEffect(() => {
26459
+ import_react75.useEffect(() => {
26417
26460
  if (!visualElement)
26418
26461
  return;
26419
26462
  if (!wantsHandoff.current && visualElement.animationState) {
@@ -26460,7 +26503,7 @@ Defaulting to \`null\`.`;
26460
26503
  function MotionDOMComponent(props, externalRef) {
26461
26504
  let MeasureLayout;
26462
26505
  const configAndProps = {
26463
- ...import_react74.useContext(MotionConfigContext),
26506
+ ...import_react76.useContext(MotionConfigContext),
26464
26507
  ...props,
26465
26508
  layoutId: useLayoutId(props)
26466
26509
  };
@@ -26476,16 +26519,16 @@ Defaulting to \`null\`.`;
26476
26519
  return import_jsx_runtime41.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? import_jsx_runtime41.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] });
26477
26520
  }
26478
26521
  MotionDOMComponent.displayName = `motion.${typeof Component === "string" ? Component : `create(${Component.displayName ?? Component.name ?? ""})`}`;
26479
- const ForwardRefMotionComponent = import_react74.forwardRef(MotionDOMComponent);
26522
+ const ForwardRefMotionComponent = import_react76.forwardRef(MotionDOMComponent);
26480
26523
  ForwardRefMotionComponent[motionComponentSymbol] = Component;
26481
26524
  return ForwardRefMotionComponent;
26482
26525
  }
26483
26526
  function useLayoutId({ layoutId }) {
26484
- const layoutGroupId = import_react74.useContext(LayoutGroupContext).id;
26527
+ const layoutGroupId = import_react76.useContext(LayoutGroupContext).id;
26485
26528
  return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId;
26486
26529
  }
26487
26530
  function useStrictMode(configAndProps, preloadedFeatures) {
26488
- const isStrict = import_react74.useContext(LazyContext).strict;
26531
+ const isStrict = import_react76.useContext(LazyContext).strict;
26489
26532
  if (preloadedFeatures && isStrict) {
26490
26533
  const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
26491
26534
  configAndProps.ignoreStrict ? warning(false, strictMessage, "lazy-strict-mode") : invariant(false, strictMessage, "lazy-strict-mode");
@@ -26504,11 +26547,11 @@ Defaulting to \`null\`.`;
26504
26547
  }
26505
26548
 
26506
26549
  // node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs
26507
- var import_react75 = __toESM(require_react(), 1);
26550
+ var import_react77 = __toESM(require_react(), 1);
26508
26551
  var createDomVisualElement = (Component, options) => {
26509
26552
  const isSVG = options.isSVG ?? isSVGComponent(Component);
26510
26553
  return isSVG ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
26511
- allowProjection: Component !== import_react75.Fragment
26554
+ allowProjection: Component !== import_react77.Fragment
26512
26555
  });
26513
26556
  };
26514
26557
 
@@ -26822,11 +26865,11 @@ Defaulting to \`null\`.`;
26822
26865
  ...gestureAnimations
26823
26866
  };
26824
26867
  // node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs
26825
- var import_react76 = __toESM(require_react(), 1);
26868
+ var import_react78 = __toESM(require_react(), 1);
26826
26869
  "use client";
26827
26870
  function useReducedMotion() {
26828
26871
  !hasReducedMotionListener.current && initPrefersReducedMotion();
26829
- const [shouldReduceMotion] = import_react76.useState(prefersReducedMotion.current);
26872
+ const [shouldReduceMotion] = import_react78.useState(prefersReducedMotion.current);
26830
26873
  if (true) {
26831
26874
  warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
26832
26875
  }
@@ -26842,10 +26885,10 @@ Defaulting to \`null\`.`;
26842
26885
  var MotionDiv = /* @__PURE__ */ createMinimalMotionComponent("div");
26843
26886
  var MotionLi = /* @__PURE__ */ createMinimalMotionComponent("li");
26844
26887
  // src/components/ChatPanel/composer.tsx
26845
- var import_react80 = __toESM(require_react(), 1);
26888
+ var import_react82 = __toESM(require_react(), 1);
26846
26889
 
26847
26890
  // src/components/RichTextEditor/RichTextEditor.tsx
26848
- var import_react79 = __toESM(require_react(), 1);
26891
+ var import_react81 = __toESM(require_react(), 1);
26849
26892
 
26850
26893
  // node_modules/orderedmap/dist/index.js
26851
26894
  function OrderedMap(content) {
@@ -27012,7 +27055,7 @@ Defaulting to \`null\`.`;
27012
27055
  return ch >= 55296 && ch < 56320;
27013
27056
  }
27014
27057
 
27015
- class Fragment27 {
27058
+ class Fragment28 {
27016
27059
  constructor(content, size) {
27017
27060
  this.content = content;
27018
27061
  this.size = size || 0;
@@ -27059,7 +27102,7 @@ Defaulting to \`null\`.`;
27059
27102
  }
27060
27103
  for (;i < other.content.length; i++)
27061
27104
  content.push(other.content[i]);
27062
- return new Fragment27(content, this.size + other.size);
27105
+ return new Fragment28(content, this.size + other.size);
27063
27106
  }
27064
27107
  cut(from, to = this.size) {
27065
27108
  if (from == 0 && to == this.size)
@@ -27080,14 +27123,14 @@ Defaulting to \`null\`.`;
27080
27123
  }
27081
27124
  pos = end;
27082
27125
  }
27083
- return new Fragment27(result, size);
27126
+ return new Fragment28(result, size);
27084
27127
  }
27085
27128
  cutByIndex(from, to) {
27086
27129
  if (from == to)
27087
- return Fragment27.empty;
27130
+ return Fragment28.empty;
27088
27131
  if (from == 0 && to == this.content.length)
27089
27132
  return this;
27090
- return new Fragment27(this.content.slice(from, to));
27133
+ return new Fragment28(this.content.slice(from, to));
27091
27134
  }
27092
27135
  replaceChild(index, node) {
27093
27136
  let current = this.content[index];
@@ -27096,13 +27139,13 @@ Defaulting to \`null\`.`;
27096
27139
  let copy = this.content.slice();
27097
27140
  let size = this.size + node.nodeSize - current.nodeSize;
27098
27141
  copy[index] = node;
27099
- return new Fragment27(copy, size);
27142
+ return new Fragment28(copy, size);
27100
27143
  }
27101
27144
  addToStart(node) {
27102
- return new Fragment27([node].concat(this.content), this.size + node.nodeSize);
27145
+ return new Fragment28([node].concat(this.content), this.size + node.nodeSize);
27103
27146
  }
27104
27147
  addToEnd(node) {
27105
- return new Fragment27(this.content.concat(node), this.size + node.nodeSize);
27148
+ return new Fragment28(this.content.concat(node), this.size + node.nodeSize);
27106
27149
  }
27107
27150
  eq(other) {
27108
27151
  if (this.content.length != other.content.length)
@@ -27171,14 +27214,14 @@ Defaulting to \`null\`.`;
27171
27214
  }
27172
27215
  static fromJSON(schema, value) {
27173
27216
  if (!value)
27174
- return Fragment27.empty;
27217
+ return Fragment28.empty;
27175
27218
  if (!Array.isArray(value))
27176
27219
  throw new RangeError("Invalid input for Fragment.fromJSON");
27177
- return Fragment27.fromArray(value.map(schema.nodeFromJSON));
27220
+ return Fragment28.fromArray(value.map(schema.nodeFromJSON));
27178
27221
  }
27179
27222
  static fromArray(array) {
27180
27223
  if (!array.length)
27181
- return Fragment27.empty;
27224
+ return Fragment28.empty;
27182
27225
  let joined, size = 0;
27183
27226
  for (let i = 0;i < array.length; i++) {
27184
27227
  let node = array[i];
@@ -27191,21 +27234,21 @@ Defaulting to \`null\`.`;
27191
27234
  joined.push(node);
27192
27235
  }
27193
27236
  }
27194
- return new Fragment27(joined || array, size);
27237
+ return new Fragment28(joined || array, size);
27195
27238
  }
27196
27239
  static from(nodes) {
27197
27240
  if (!nodes)
27198
- return Fragment27.empty;
27199
- if (nodes instanceof Fragment27)
27241
+ return Fragment28.empty;
27242
+ if (nodes instanceof Fragment28)
27200
27243
  return nodes;
27201
27244
  if (Array.isArray(nodes))
27202
27245
  return this.fromArray(nodes);
27203
27246
  if (nodes.attrs)
27204
- return new Fragment27([nodes], nodes.nodeSize);
27247
+ return new Fragment28([nodes], nodes.nodeSize);
27205
27248
  throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
27206
27249
  }
27207
27250
  }
27208
- Fragment27.empty = new Fragment27([], 0);
27251
+ Fragment28.empty = new Fragment28([], 0);
27209
27252
  var found = { index: 0, offset: 0 };
27210
27253
  function retIndex(index, offset) {
27211
27254
  found.index = index;
@@ -27365,7 +27408,7 @@ Defaulting to \`null\`.`;
27365
27408
  let openStart = json.openStart || 0, openEnd = json.openEnd || 0;
27366
27409
  if (typeof openStart != "number" || typeof openEnd != "number")
27367
27410
  throw new RangeError("Invalid input for Slice.fromJSON");
27368
- return new Slice(Fragment27.fromJSON(schema, json.content), openStart, openEnd);
27411
+ return new Slice(Fragment28.fromJSON(schema, json.content), openStart, openEnd);
27369
27412
  }
27370
27413
  static maxOpen(fragment, openIsolating = true) {
27371
27414
  let openStart = 0, openEnd = 0;
@@ -27376,7 +27419,7 @@ Defaulting to \`null\`.`;
27376
27419
  return new Slice(fragment, openStart, openEnd);
27377
27420
  }
27378
27421
  }
27379
- Slice.empty = new Slice(Fragment27.empty, 0, 0);
27422
+ Slice.empty = new Slice(Fragment28.empty, 0, 0);
27380
27423
  function removeRange(content, from, to) {
27381
27424
  let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
27382
27425
  let { index: indexTo, offset: offsetTo } = content.findIndex(to);
@@ -27475,7 +27518,7 @@ Defaulting to \`null\`.`;
27475
27518
  addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
27476
27519
  }
27477
27520
  addRange($to, null, depth, content);
27478
- return new Fragment27(content);
27521
+ return new Fragment28(content);
27479
27522
  }
27480
27523
  function replaceTwoWay($from, $to, depth) {
27481
27524
  let content = [];
@@ -27485,13 +27528,13 @@ Defaulting to \`null\`.`;
27485
27528
  addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
27486
27529
  }
27487
27530
  addRange($to, null, depth, content);
27488
- return new Fragment27(content);
27531
+ return new Fragment28(content);
27489
27532
  }
27490
27533
  function prepareSliceForReplace(slice, $along) {
27491
27534
  let extra = $along.depth - slice.openStart, parent = $along.node(extra);
27492
27535
  let node = parent.copy(slice.content);
27493
27536
  for (let i = extra - 1;i >= 0; i--)
27494
- node = $along.node(i).copy(Fragment27.from(node));
27537
+ node = $along.node(i).copy(Fragment28.from(node));
27495
27538
  return {
27496
27539
  start: node.resolveNoCache(slice.openStart + extra),
27497
27540
  end: node.resolveNoCache(node.content.size - slice.openEnd - extra)
@@ -27703,7 +27746,7 @@ Defaulting to \`null\`.`;
27703
27746
  this.type = type;
27704
27747
  this.attrs = attrs;
27705
27748
  this.marks = marks;
27706
- this.content = content || Fragment27.empty;
27749
+ this.content = content || Fragment28.empty;
27707
27750
  }
27708
27751
  get children() {
27709
27752
  return this.content.content;
@@ -27850,7 +27893,7 @@ Defaulting to \`null\`.`;
27850
27893
  throw new Error("Called contentMatchAt on a node with invalid content");
27851
27894
  return match;
27852
27895
  }
27853
- canReplace(from, to, replacement = Fragment27.empty, start = 0, end = replacement.childCount) {
27896
+ canReplace(from, to, replacement = Fragment28.empty, start = 0, end = replacement.childCount) {
27854
27897
  let one = this.contentMatchAt(from).matchFragment(replacement, start, end);
27855
27898
  let two = one && one.matchFragment(this.content, to);
27856
27899
  if (!two || !two.validEnd)
@@ -27912,7 +27955,7 @@ Defaulting to \`null\`.`;
27912
27955
  throw new RangeError("Invalid text node in JSON");
27913
27956
  return schema.text(json.text, marks);
27914
27957
  }
27915
- let content = Fragment27.fromJSON(schema, json.content);
27958
+ let content = Fragment28.fromJSON(schema, json.content);
27916
27959
  let node = schema.nodeType(json.type).create(json.attrs, content, marks);
27917
27960
  return node;
27918
27961
  }
@@ -28029,7 +28072,7 @@ Defaulting to \`null\`.`;
28029
28072
  function search(match, types) {
28030
28073
  let finished = match.matchFragment(after, startIndex);
28031
28074
  if (finished && (!toEnd || finished.validEnd))
28032
- return Fragment27.from(types.map((tp) => tp.createAndFill()));
28075
+ return Fragment28.from(types.map((tp) => tp.createAndFill()));
28033
28076
  for (let i = 0;i < match.next.length; i++) {
28034
28077
  let { type, next } = match.next[i];
28035
28078
  if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
@@ -28414,16 +28457,16 @@ Defaulting to \`null\`.`;
28414
28457
  create(attrs = null, content, marks) {
28415
28458
  if (this.isText)
28416
28459
  throw new Error("NodeType.create can't construct text nodes");
28417
- return new Node2(this, this.computeAttrs(attrs), Fragment27.from(content), Mark.setFrom(marks));
28460
+ return new Node2(this, this.computeAttrs(attrs), Fragment28.from(content), Mark.setFrom(marks));
28418
28461
  }
28419
28462
  createChecked(attrs = null, content, marks) {
28420
- content = Fragment27.from(content);
28463
+ content = Fragment28.from(content);
28421
28464
  this.checkContent(content);
28422
28465
  return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
28423
28466
  }
28424
28467
  createAndFill(attrs = null, content, marks) {
28425
28468
  attrs = this.computeAttrs(attrs);
28426
- content = Fragment27.from(content);
28469
+ content = Fragment28.from(content);
28427
28470
  if (content.size) {
28428
28471
  let before = this.contentMatch.fillBefore(content);
28429
28472
  if (!before)
@@ -28431,7 +28474,7 @@ Defaulting to \`null\`.`;
28431
28474
  content = before.append(content);
28432
28475
  }
28433
28476
  let matched = this.contentMatch.matchFragment(content);
28434
- let after = matched && matched.fillBefore(Fragment27.empty, true);
28477
+ let after = matched && matched.fillBefore(Fragment28.empty, true);
28435
28478
  if (!after)
28436
28479
  return null;
28437
28480
  return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
@@ -28796,7 +28839,7 @@ Defaulting to \`null\`.`;
28796
28839
  if (!this.match) {
28797
28840
  if (!this.type)
28798
28841
  return [];
28799
- let fill = this.type.contentMatch.fillBefore(Fragment27.from(node));
28842
+ let fill = this.type.contentMatch.fillBefore(Fragment28.from(node));
28800
28843
  if (fill) {
28801
28844
  this.match = this.type.contentMatch.matchFragment(fill);
28802
28845
  } else {
@@ -28822,9 +28865,9 @@ Defaulting to \`null\`.`;
28822
28865
  this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));
28823
28866
  }
28824
28867
  }
28825
- let content = Fragment27.from(this.content);
28868
+ let content = Fragment28.from(this.content);
28826
28869
  if (!openEnd && this.match)
28827
- content = content.append(this.match.fillBefore(Fragment27.empty, true));
28870
+ content = content.append(this.match.fillBefore(Fragment28.empty, true));
28828
28871
  return this.type ? this.type.create(this.attrs, content, this.marks) : content;
28829
28872
  }
28830
28873
  inlineContext(node) {
@@ -29677,7 +29720,7 @@ Defaulting to \`null\`.`;
29677
29720
  child = f(child, parent, i);
29678
29721
  mapped.push(child);
29679
29722
  }
29680
- return Fragment27.fromArray(mapped);
29723
+ return Fragment28.fromArray(mapped);
29681
29724
  }
29682
29725
 
29683
29726
  class AddMarkStep extends Step {
@@ -29782,7 +29825,7 @@ Defaulting to \`null\`.`;
29782
29825
  if (!node)
29783
29826
  return StepResult.fail("No node at mark step's position");
29784
29827
  let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
29785
- return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment27.from(updated), 0, node.isLeaf ? 0 : 1));
29828
+ return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment28.from(updated), 0, node.isLeaf ? 0 : 1));
29786
29829
  }
29787
29830
  invert(doc) {
29788
29831
  let node = doc.nodeAt(this.pos);
@@ -29823,7 +29866,7 @@ Defaulting to \`null\`.`;
29823
29866
  if (!node)
29824
29867
  return StepResult.fail("No node at mark step's position");
29825
29868
  let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
29826
- return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment27.from(updated), 0, node.isLeaf ? 0 : 1));
29869
+ return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment28.from(updated), 0, node.isLeaf ? 0 : 1));
29827
29870
  }
29828
29871
  invert(doc) {
29829
29872
  let node = doc.nodeAt(this.pos);
@@ -30068,7 +30111,7 @@ Defaulting to \`null\`.`;
30068
30111
  let m, newline = /\r?\n|\r/g, slice;
30069
30112
  while (m = newline.exec(child.text)) {
30070
30113
  if (!slice)
30071
- slice = new Slice(Fragment27.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
30114
+ slice = new Slice(Fragment28.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
30072
30115
  replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice));
30073
30116
  }
30074
30117
  }
@@ -30076,7 +30119,7 @@ Defaulting to \`null\`.`;
30076
30119
  cur = end;
30077
30120
  }
30078
30121
  if (!match.validEnd) {
30079
- let fill = match.fillBefore(Fragment27.empty, true);
30122
+ let fill = match.fillBefore(Fragment28.empty, true);
30080
30123
  tr.replace(cur, cur, new Slice(fill, 0, 0));
30081
30124
  }
30082
30125
  for (let i = replSteps.length - 1;i >= 0; i--)
@@ -30106,20 +30149,20 @@ Defaulting to \`null\`.`;
30106
30149
  let { $from, $to, depth } = range;
30107
30150
  let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
30108
30151
  let start = gapStart, end = gapEnd;
30109
- let before = Fragment27.empty, openStart = 0;
30152
+ let before = Fragment28.empty, openStart = 0;
30110
30153
  for (let d = depth, splitting = false;d > target; d--)
30111
30154
  if (splitting || $from.index(d) > 0) {
30112
30155
  splitting = true;
30113
- before = Fragment27.from($from.node(d).copy(before));
30156
+ before = Fragment28.from($from.node(d).copy(before));
30114
30157
  openStart++;
30115
30158
  } else {
30116
30159
  start--;
30117
30160
  }
30118
- let after = Fragment27.empty, openEnd = 0;
30161
+ let after = Fragment28.empty, openEnd = 0;
30119
30162
  for (let d = depth, splitting = false;d > target; d--)
30120
30163
  if (splitting || $to.after(d + 1) < $to.end(d)) {
30121
30164
  splitting = true;
30122
- after = Fragment27.from($to.node(d).copy(after));
30165
+ after = Fragment28.from($to.node(d).copy(after));
30123
30166
  openEnd++;
30124
30167
  } else {
30125
30168
  end++;
@@ -30159,14 +30202,14 @@ Defaulting to \`null\`.`;
30159
30202
  return inside;
30160
30203
  }
30161
30204
  function wrap(tr, range, wrappers) {
30162
- let content = Fragment27.empty;
30205
+ let content = Fragment28.empty;
30163
30206
  for (let i = wrappers.length - 1;i >= 0; i--) {
30164
30207
  if (content.size) {
30165
30208
  let match = wrappers[i].type.contentMatch.matchFragment(content);
30166
30209
  if (!match || !match.validEnd)
30167
30210
  throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
30168
30211
  }
30169
- content = Fragment27.from(wrappers[i].type.create(wrappers[i].attrs, content));
30212
+ content = Fragment28.from(wrappers[i].type.create(wrappers[i].attrs, content));
30170
30213
  }
30171
30214
  let { start, end } = range;
30172
30215
  tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
@@ -30191,7 +30234,7 @@ Defaulting to \`null\`.`;
30191
30234
  clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type, undefined, convertNewlines === null);
30192
30235
  let mapping = tr.mapping.slice(mapFrom);
30193
30236
  let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
30194
- tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment27.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
30237
+ tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment28.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
30195
30238
  if (convertNewlines === true)
30196
30239
  replaceNewlines(tr, node, pos, mapFrom);
30197
30240
  return false;
@@ -30233,7 +30276,7 @@ Defaulting to \`null\`.`;
30233
30276
  return tr.replaceWith(pos, pos + node.nodeSize, newNode);
30234
30277
  if (!type.validContent(node.content))
30235
30278
  throw new RangeError("Invalid content for node type " + type.name);
30236
- tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment27.from(newNode), 0, 0), 1, true));
30279
+ tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment28.from(newNode), 0, 0), 1, true));
30237
30280
  }
30238
30281
  function canSplit(doc, pos, depth = 1, typesAfter) {
30239
30282
  let $pos = doc.resolve(pos), base = $pos.depth - depth;
@@ -30257,11 +30300,11 @@ Defaulting to \`null\`.`;
30257
30300
  return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type);
30258
30301
  }
30259
30302
  function split(tr, pos, depth = 1, typesAfter) {
30260
- let $pos = tr.doc.resolve(pos), before = Fragment27.empty, after = Fragment27.empty;
30303
+ let $pos = tr.doc.resolve(pos), before = Fragment28.empty, after = Fragment28.empty;
30261
30304
  for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1;d > e; d--, i--) {
30262
- before = Fragment27.from($pos.node(d).copy(before));
30305
+ before = Fragment28.from($pos.node(d).copy(before));
30263
30306
  let typeAfter = typesAfter && typesAfter[i];
30264
- after = Fragment27.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
30307
+ after = Fragment28.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
30265
30308
  }
30266
30309
  tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
30267
30310
  }
@@ -30379,7 +30422,7 @@ Defaulting to \`null\`.`;
30379
30422
  this.$to = $to;
30380
30423
  this.unplaced = unplaced;
30381
30424
  this.frontier = [];
30382
- this.placed = Fragment27.empty;
30425
+ this.placed = Fragment28.empty;
30383
30426
  for (let i = 0;i <= $from.depth; i++) {
30384
30427
  let node = $from.node(i);
30385
30428
  this.frontier.push({
@@ -30388,7 +30431,7 @@ Defaulting to \`null\`.`;
30388
30431
  });
30389
30432
  }
30390
30433
  for (let i = $from.depth;i > 0; i--)
30391
- this.placed = Fragment27.from($from.node(i).copy(this.placed));
30434
+ this.placed = Fragment28.from($from.node(i).copy(this.placed));
30392
30435
  }
30393
30436
  get depth() {
30394
30437
  return this.frontier.length - 1;
@@ -30442,7 +30485,7 @@ Defaulting to \`null\`.`;
30442
30485
  let first = fragment.firstChild;
30443
30486
  for (let frontierDepth = this.depth;frontierDepth >= 0; frontierDepth--) {
30444
30487
  let { type, match } = this.frontier[frontierDepth], wrap, inject = null;
30445
- if (pass == 1 && (first ? match.matchType(first.type) || (inject = match.fillBefore(Fragment27.from(first), false)) : parent && type.compatibleContent(parent.type)))
30488
+ if (pass == 1 && (first ? match.matchType(first.type) || (inject = match.fillBefore(Fragment28.from(first), false)) : parent && type.compatibleContent(parent.type)))
30446
30489
  return { sliceDepth, frontierDepth, parent, inject };
30447
30490
  else if (pass == 2 && first && (wrap = match.findWrapping(first.type)))
30448
30491
  return { sliceDepth, frontierDepth, parent, wrap };
@@ -30500,7 +30543,7 @@ Defaulting to \`null\`.`;
30500
30543
  let toEnd = taken == fragment.childCount;
30501
30544
  if (!toEnd)
30502
30545
  openEndCount = -1;
30503
- this.placed = addToFragment(this.placed, frontierDepth, Fragment27.from(add));
30546
+ this.placed = addToFragment(this.placed, frontierDepth, Fragment28.from(add));
30504
30547
  this.frontier[frontierDepth].match = match;
30505
30548
  if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
30506
30549
  this.closeFrontierNode();
@@ -30557,12 +30600,12 @@ Defaulting to \`null\`.`;
30557
30600
  openFrontierNode(type, attrs = null, content) {
30558
30601
  let top = this.frontier[this.depth];
30559
30602
  top.match = top.match.matchType(type);
30560
- this.placed = addToFragment(this.placed, this.depth, Fragment27.from(type.create(attrs, content)));
30603
+ this.placed = addToFragment(this.placed, this.depth, Fragment28.from(type.create(attrs, content)));
30561
30604
  this.frontier.push({ type, match: type.contentMatch });
30562
30605
  }
30563
30606
  closeFrontierNode() {
30564
30607
  let open = this.frontier.pop();
30565
- let add = open.match.fillBefore(Fragment27.empty, true);
30608
+ let add = open.match.fillBefore(Fragment28.empty, true);
30566
30609
  if (add.childCount)
30567
30610
  this.placed = addToFragment(this.placed, this.frontier.length, add);
30568
30611
  }
@@ -30591,7 +30634,7 @@ Defaulting to \`null\`.`;
30591
30634
  if (openStart > 0) {
30592
30635
  frag = node.type.contentMatch.fillBefore(frag).append(frag);
30593
30636
  if (openEnd <= 0)
30594
- frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment27.empty, true));
30637
+ frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment28.empty, true));
30595
30638
  }
30596
30639
  return node.copy(frag);
30597
30640
  }
@@ -30691,7 +30734,7 @@ Defaulting to \`null\`.`;
30691
30734
  if (depth > newOpen) {
30692
30735
  let match = parent.contentMatchAt(0);
30693
30736
  let start = match.fillBefore(fragment).append(fragment);
30694
- fragment = start.append(match.matchFragment(start).fillBefore(Fragment27.empty, true));
30737
+ fragment = start.append(match.matchFragment(start).fillBefore(Fragment28.empty, true));
30695
30738
  }
30696
30739
  return fragment;
30697
30740
  }
@@ -30701,7 +30744,7 @@ Defaulting to \`null\`.`;
30701
30744
  if (point != null)
30702
30745
  from = to = point;
30703
30746
  }
30704
- tr.replaceRange(from, to, new Slice(Fragment27.from(node), 0, 0));
30747
+ tr.replaceRange(from, to, new Slice(Fragment28.from(node), 0, 0));
30705
30748
  }
30706
30749
  function deleteRange(tr, from, to) {
30707
30750
  let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);
@@ -30764,7 +30807,7 @@ Defaulting to \`null\`.`;
30764
30807
  attrs[name] = node.attrs[name];
30765
30808
  attrs[this.attr] = this.value;
30766
30809
  let updated = node.type.create(attrs, null, node.marks);
30767
- return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment27.from(updated), 0, node.isLeaf ? 0 : 1));
30810
+ return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment28.from(updated), 0, node.isLeaf ? 0 : 1));
30768
30811
  }
30769
30812
  getMap() {
30770
30813
  return StepMap.empty;
@@ -30884,7 +30927,7 @@ Defaulting to \`null\`.`;
30884
30927
  return this;
30885
30928
  }
30886
30929
  replaceWith(from, to, content) {
30887
- return this.replace(from, to, new Slice(Fragment27.from(content), 0, 0));
30930
+ return this.replace(from, to, new Slice(Fragment28.from(content), 0, 0));
30888
30931
  }
30889
30932
  delete(from, to) {
30890
30933
  return this.replace(from, to, Slice.empty);
@@ -31186,7 +31229,7 @@ Defaulting to \`null\`.`;
31186
31229
  return new NodeSelection($pos);
31187
31230
  }
31188
31231
  content() {
31189
- return new Slice(Fragment27.from(this.node), 0, 0);
31232
+ return new Slice(Fragment28.from(this.node), 0, 0);
31190
31233
  }
31191
31234
  eq(other) {
31192
31235
  return other instanceof NodeSelection && other.anchor == this.anchor;
@@ -32850,7 +32893,7 @@ Defaulting to \`null\`.`;
32850
32893
  if (found)
32851
32894
  rule.contentElement = found;
32852
32895
  else
32853
- rule.getContent = () => Fragment27.empty;
32896
+ rule.getContent = () => Fragment28.empty;
32854
32897
  }
32855
32898
  }
32856
32899
  return rule;
@@ -34166,7 +34209,7 @@ Defaulting to \`null\`.`;
34166
34209
  text = f(text, inCode || plainText, view);
34167
34210
  });
34168
34211
  if (inCode) {
34169
- slice = new Slice(Fragment27.from(view.state.schema.text(text.replace(/\r\n?/g, `
34212
+ slice = new Slice(Fragment28.from(view.state.schema.text(text.replace(/\r\n?/g, `
34170
34213
  `))), 0, 0);
34171
34214
  view.someProp("transformPasted", (f) => {
34172
34215
  slice = f(slice, view, true);
@@ -34259,13 +34302,13 @@ Defaulting to \`null\`.`;
34259
34302
  }
34260
34303
  });
34261
34304
  if (result)
34262
- return Fragment27.from(result);
34305
+ return Fragment28.from(result);
34263
34306
  }
34264
34307
  return fragment;
34265
34308
  }
34266
34309
  function withWrappers(node, wrap, from = 0) {
34267
34310
  for (let i = wrap.length - 1;i >= from; i--)
34268
- node = wrap[i].create(null, Fragment27.from(node));
34311
+ node = wrap[i].create(null, Fragment28.from(node));
34269
34312
  return node;
34270
34313
  }
34271
34314
  function addToSibling(wrap, lastWrap, node, sibling, depth) {
@@ -34275,14 +34318,14 @@ Defaulting to \`null\`.`;
34275
34318
  return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
34276
34319
  let match = sibling.contentMatchAt(sibling.childCount);
34277
34320
  if (match.matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1]))
34278
- return sibling.copy(sibling.content.append(Fragment27.from(withWrappers(node, wrap, depth + 1))));
34321
+ return sibling.copy(sibling.content.append(Fragment28.from(withWrappers(node, wrap, depth + 1))));
34279
34322
  }
34280
34323
  }
34281
34324
  function closeRight(node, depth) {
34282
34325
  if (depth == 0)
34283
34326
  return node;
34284
34327
  let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
34285
- let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment27.empty, true);
34328
+ let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment28.empty, true);
34286
34329
  return node.copy(fragment.append(fill));
34287
34330
  }
34288
34331
  function closeRange(fragment, side, from, to, depth, openEnd) {
@@ -34292,7 +34335,7 @@ Defaulting to \`null\`.`;
34292
34335
  if (depth < to - 1)
34293
34336
  inner = closeRange(inner, side, from, to, depth + 1, openEnd);
34294
34337
  if (depth >= from)
34295
- inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment27.empty, true));
34338
+ inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment28.empty, true));
34296
34339
  return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
34297
34340
  }
34298
34341
  function closeSlice(slice, openStart, openEnd) {
@@ -34378,7 +34421,7 @@ Defaulting to \`null\`.`;
34378
34421
  if (!type || type.hasRequiredAttrs())
34379
34422
  break;
34380
34423
  try {
34381
- content = Fragment27.from(type.create(array[i + 1], content));
34424
+ content = Fragment28.from(type.create(array[i + 1], content));
34382
34425
  } catch (e) {
34383
34426
  break;
34384
34427
  }
@@ -36264,7 +36307,7 @@ Defaulting to \`null\`.`;
36264
36307
  let updated = [];
36265
36308
  for (let i = 0;i < prev.childCount; i++)
36266
36309
  updated.push(update(prev.child(i)));
36267
- if (Fragment27.from(updated).eq(cur))
36310
+ if (Fragment28.from(updated).eq(cur))
36268
36311
  return { mark, type };
36269
36312
  }
36270
36313
  function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
@@ -37014,10 +37057,10 @@ Defaulting to \`null\`.`;
37014
37057
  let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
37015
37058
  if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
37016
37059
  if (dispatch) {
37017
- let end = $cut.pos + after.nodeSize, wrap = Fragment27.empty;
37060
+ let end = $cut.pos + after.nodeSize, wrap = Fragment28.empty;
37018
37061
  for (let i = conn.length - 1;i >= 0; i--)
37019
- wrap = Fragment27.from(conn[i].create(null, wrap));
37020
- wrap = Fragment27.from(before.copy(wrap));
37062
+ wrap = Fragment28.from(conn[i].create(null, wrap));
37063
+ wrap = Fragment28.from(before.copy(wrap));
37021
37064
  let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));
37022
37065
  let $joinAt = tr.doc.resolve(end + 2 * conn.length);
37023
37066
  if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr.doc, $joinAt.pos))
@@ -37046,9 +37089,9 @@ Defaulting to \`null\`.`;
37046
37089
  afterDepth++;
37047
37090
  if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
37048
37091
  if (dispatch) {
37049
- let end = Fragment27.empty;
37092
+ let end = Fragment28.empty;
37050
37093
  for (let i = wrap.length - 1;i >= 0; i--)
37051
- end = Fragment27.from(wrap[i].copy(end));
37094
+ end = Fragment28.from(wrap[i].copy(end));
37052
37095
  let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap.length, 0), 0, true));
37053
37096
  dispatch(tr.scrollIntoView());
37054
37097
  }
@@ -44054,9 +44097,9 @@ Defaulting to \`null\`.`;
44054
44097
  return true;
44055
44098
  }
44056
44099
  function doWrapInList(tr, range, wrappers, joinBefore, listType) {
44057
- let content = Fragment27.empty;
44100
+ let content = Fragment28.empty;
44058
44101
  for (let i = wrappers.length - 1;i >= 0; i--)
44059
- content = Fragment27.from(wrappers[i].type.create(wrappers[i].attrs, content));
44102
+ content = Fragment28.from(wrappers[i].type.create(wrappers[i].attrs, content));
44060
44103
  tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
44061
44104
  let found = 0;
44062
44105
  for (let i = 0;i < wrappers.length; i++)
@@ -44085,12 +44128,12 @@ Defaulting to \`null\`.`;
44085
44128
  if ($from.depth == 3 || $from.node(-3).type != itemType || $from.index(-2) != $from.node(-2).childCount - 1)
44086
44129
  return false;
44087
44130
  if (dispatch) {
44088
- let wrap = Fragment27.empty;
44131
+ let wrap = Fragment28.empty;
44089
44132
  let depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
44090
44133
  for (let d = $from.depth - depthBefore;d >= $from.depth - 3; d--)
44091
- wrap = Fragment27.from($from.node(d).copy(wrap));
44134
+ wrap = Fragment28.from($from.node(d).copy(wrap));
44092
44135
  let depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1 : $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
44093
- wrap = wrap.append(Fragment27.from(itemType.createAndFill()));
44136
+ wrap = wrap.append(Fragment28.from(itemType.createAndFill()));
44094
44137
  let start = $from.before($from.depth - (depthBefore - 1));
44095
44138
  let tr = state.tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
44096
44139
  let sel = -1;
@@ -44133,7 +44176,7 @@ Defaulting to \`null\`.`;
44133
44176
  function liftToOuterList(state, dispatch, itemType, range) {
44134
44177
  let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
44135
44178
  if (end < endOfList) {
44136
- tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment27.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
44179
+ tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment28.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
44137
44180
  range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
44138
44181
  }
44139
44182
  const target = liftTarget(range);
@@ -44157,10 +44200,10 @@ Defaulting to \`null\`.`;
44157
44200
  return false;
44158
44201
  let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
44159
44202
  let parent = $start.node(-1), indexBefore = $start.index(-1);
44160
- if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment27.empty : Fragment27.from(list))))
44203
+ if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment28.empty : Fragment28.from(list))))
44161
44204
  return false;
44162
44205
  let start = $start.pos, end = start + item.nodeSize;
44163
- tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment27.empty : Fragment27.from(list.copy(Fragment27.empty))).append(atEnd ? Fragment27.empty : Fragment27.from(list.copy(Fragment27.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
44206
+ tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment28.empty : Fragment28.from(list.copy(Fragment28.empty))).append(atEnd ? Fragment28.empty : Fragment28.from(list.copy(Fragment28.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
44164
44207
  dispatch(tr.scrollIntoView());
44165
44208
  return true;
44166
44209
  }
@@ -44178,8 +44221,8 @@ Defaulting to \`null\`.`;
44178
44221
  return false;
44179
44222
  if (dispatch) {
44180
44223
  let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
44181
- let inner = Fragment27.from(nestedBefore ? itemType.create() : null);
44182
- let slice = new Slice(Fragment27.from(itemType.create(null, Fragment27.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
44224
+ let inner = Fragment28.from(nestedBefore ? itemType.create() : null);
44225
+ let slice = new Slice(Fragment28.from(itemType.create(null, Fragment28.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
44183
44226
  let { start: before, end: after } = range;
44184
44227
  dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true)).scrollIntoView());
44185
44228
  }
@@ -44243,8 +44286,8 @@ Defaulting to \`null\`.`;
44243
44286
  }
44244
44287
 
44245
44288
  // src/components/RichTextEditor/toolbar.tsx
44246
- var import_react77 = __toESM(require_react(), 1);
44247
- var jsx_dev_runtime85 = __toESM(require_jsx_dev_runtime(), 1);
44289
+ var import_react79 = __toESM(require_react(), 1);
44290
+ var jsx_dev_runtime86 = __toESM(require_jsx_dev_runtime(), 1);
44248
44291
  "use client";
44249
44292
  function activeNode(state, name, level) {
44250
44293
  if (!state)
@@ -44264,7 +44307,7 @@ Defaulting to \`null\`.`;
44264
44307
  return empty ? !!mark.isInSet(state.storedMarks || $from.marks()) : state.doc.rangeHasMark(from, to, mark);
44265
44308
  }
44266
44309
  function CommandButton({ label, children, command, view, state, disabled, pressed }) {
44267
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarButton, {
44310
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarButton, {
44268
44311
  type: "button",
44269
44312
  className: "vk-rich-tool",
44270
44313
  "aria-label": label,
@@ -44280,7 +44323,7 @@ Defaulting to \`null\`.`;
44280
44323
  command(view.state, view.dispatch, view);
44281
44324
  view.focus();
44282
44325
  },
44283
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44326
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44284
44327
  "aria-hidden": "true",
44285
44328
  children
44286
44329
  }, undefined, false, undefined, this)
@@ -44289,10 +44332,10 @@ Defaulting to \`null\`.`;
44289
44332
  function LinkTool({ view, disabled, state }) {
44290
44333
  const { messages } = useLocale();
44291
44334
  const copy = messages.richText;
44292
- const [open, setOpen] = import_react77.useState(false);
44293
- const [url, setUrl] = import_react77.useState("");
44294
- const [text, setText] = import_react77.useState("");
44295
- const [invalid, setInvalid] = import_react77.useState(false);
44335
+ const [open, setOpen] = import_react79.useState(false);
44336
+ const [url, setUrl] = import_react79.useState("");
44337
+ const [text, setText] = import_react79.useState("");
44338
+ const [invalid, setInvalid] = import_react79.useState(false);
44296
44339
  const openPanel = (next) => {
44297
44340
  if (next && view) {
44298
44341
  const { from, to, $from } = view.state.selection;
@@ -44339,14 +44382,14 @@ Defaulting to \`null\`.`;
44339
44382
  setOpen(false);
44340
44383
  view.focus();
44341
44384
  };
44342
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Popover, {
44385
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Popover, {
44343
44386
  open: open && !disabled,
44344
44387
  onOpenChange: openPanel,
44345
44388
  children: [
44346
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarButton, {
44389
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarButton, {
44347
44390
  asChild: true,
44348
44391
  disabled: disabled || !view,
44349
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverTrigger, {
44392
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverTrigger, {
44350
44393
  type: "button",
44351
44394
  className: "vk-rich-tool",
44352
44395
  "aria-label": copy.addLink,
@@ -44355,14 +44398,14 @@ Defaulting to \`null\`.`;
44355
44398
  onMouseDown: (event) => {
44356
44399
  event.preventDefault();
44357
44400
  },
44358
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44401
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44359
44402
  "aria-hidden": "true",
44360
44403
  children: "↗"
44361
44404
  }, undefined, false, undefined, this)
44362
44405
  }, undefined, false, undefined, this)
44363
44406
  }, undefined, false, undefined, this),
44364
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverPortal, {
44365
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverContent, {
44407
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverPortal, {
44408
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverContent, {
44366
44409
  className: "vk-popover vk-rich-panel",
44367
44410
  sideOffset: 4,
44368
44411
  collisionPadding: 8,
@@ -44372,13 +44415,13 @@ Defaulting to \`null\`.`;
44372
44415
  view?.focus();
44373
44416
  },
44374
44417
  children: [
44375
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("label", {
44418
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("label", {
44376
44419
  className: "vk-rich-panel-field",
44377
44420
  children: [
44378
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44421
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44379
44422
  children: copy.linkUrl
44380
44423
  }, undefined, false, undefined, this),
44381
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Input, {
44424
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Input, {
44382
44425
  type: "url",
44383
44426
  value: url,
44384
44427
  onChange: (event) => {
@@ -44395,13 +44438,13 @@ Defaulting to \`null\`.`;
44395
44438
  }, undefined, false, undefined, this)
44396
44439
  ]
44397
44440
  }, undefined, true, undefined, this),
44398
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("label", {
44441
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("label", {
44399
44442
  className: "vk-rich-panel-field",
44400
44443
  children: [
44401
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44444
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44402
44445
  children: copy.linkText
44403
44446
  }, undefined, false, undefined, this),
44404
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Input, {
44447
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Input, {
44405
44448
  value: text,
44406
44449
  onChange: (event) => {
44407
44450
  setText(event.target.value);
@@ -44415,30 +44458,30 @@ Defaulting to \`null\`.`;
44415
44458
  }, undefined, false, undefined, this)
44416
44459
  ]
44417
44460
  }, undefined, true, undefined, this),
44418
- invalid ? /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44461
+ invalid ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44419
44462
  className: "vk-field-error",
44420
44463
  role: "alert",
44421
44464
  children: copy.invalidUrl
44422
44465
  }, undefined, false, undefined, this) : null,
44423
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("div", {
44466
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("div", {
44424
44467
  className: "vk-rich-panel-actions",
44425
44468
  children: [
44426
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Button, {
44469
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Button, {
44427
44470
  type: "button",
44428
44471
  size: "sm",
44429
44472
  onClick: apply,
44430
44473
  children: copy.applyLink
44431
44474
  }, undefined, false, undefined, this),
44432
- activeMark(state, "link") ? /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Button, {
44475
+ activeMark(state, "link") ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Button, {
44433
44476
  type: "button",
44434
44477
  size: "sm",
44435
44478
  variant: "ghost",
44436
44479
  onClick: remove,
44437
44480
  children: copy.removeLink
44438
44481
  }, undefined, false, undefined, this) : null,
44439
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverClose, {
44482
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverClose, {
44440
44483
  asChild: true,
44441
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Button, {
44484
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Button, {
44442
44485
  type: "button",
44443
44486
  size: "sm",
44444
44487
  variant: "ghost",
@@ -44457,21 +44500,21 @@ Defaulting to \`null\`.`;
44457
44500
  function EmojiTool({ view, disabled, emojiOptions }) {
44458
44501
  const { locale, messages } = useLocale();
44459
44502
  const copy = messages.richText;
44460
- const [open, setOpen] = import_react77.useState(false);
44461
- const [query, setQuery] = import_react77.useState("");
44503
+ const [open, setOpen] = import_react79.useState(false);
44504
+ const [query, setQuery] = import_react79.useState("");
44462
44505
  const choices = emojiOptions || emojiValues.map((value) => ({ value, label: copy.emojiName(value) }));
44463
44506
  const filtered = choices.filter((option) => option.value.includes(query) || option.label.toLocaleLowerCase(locale).includes(query.toLocaleLowerCase(locale)));
44464
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Popover, {
44507
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Popover, {
44465
44508
  open: open && !disabled,
44466
44509
  onOpenChange: (next) => {
44467
44510
  setQuery("");
44468
44511
  setOpen(next);
44469
44512
  },
44470
44513
  children: [
44471
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarButton, {
44514
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarButton, {
44472
44515
  asChild: true,
44473
44516
  disabled: disabled || !view,
44474
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverTrigger, {
44517
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverTrigger, {
44475
44518
  type: "button",
44476
44519
  className: "vk-rich-tool",
44477
44520
  "aria-label": copy.emoji,
@@ -44479,14 +44522,14 @@ Defaulting to \`null\`.`;
44479
44522
  onMouseDown: (event) => {
44480
44523
  event.preventDefault();
44481
44524
  },
44482
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44525
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44483
44526
  "aria-hidden": "true",
44484
44527
  children: "☺"
44485
44528
  }, undefined, false, undefined, this)
44486
44529
  }, undefined, false, undefined, this)
44487
44530
  }, undefined, false, undefined, this),
44488
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverPortal, {
44489
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(PopoverContent, {
44531
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverPortal, {
44532
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(PopoverContent, {
44490
44533
  className: "vk-popover vk-rich-panel",
44491
44534
  sideOffset: 4,
44492
44535
  collisionPadding: 8,
@@ -44496,7 +44539,7 @@ Defaulting to \`null\`.`;
44496
44539
  view?.focus();
44497
44540
  },
44498
44541
  children: [
44499
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Input, {
44542
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Input, {
44500
44543
  "aria-label": copy.emojiSearch,
44501
44544
  placeholder: copy.emojiSearch,
44502
44545
  value: query,
@@ -44504,11 +44547,11 @@ Defaulting to \`null\`.`;
44504
44547
  setQuery(event.target.value);
44505
44548
  }
44506
44549
  }, undefined, false, undefined, this),
44507
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("div", {
44550
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("div", {
44508
44551
  className: "vk-rich-emoji",
44509
44552
  role: "group",
44510
44553
  "aria-label": copy.emoji,
44511
- children: filtered.map((option) => /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("button", {
44554
+ children: filtered.map((option) => /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("button", {
44512
44555
  type: "button",
44513
44556
  className: "vk-rich-tool",
44514
44557
  "aria-label": option.label,
@@ -44520,13 +44563,13 @@ Defaulting to \`null\`.`;
44520
44563
  setOpen(false);
44521
44564
  view.focus();
44522
44565
  },
44523
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44566
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44524
44567
  "aria-hidden": "true",
44525
44568
  children: option.value
44526
44569
  }, undefined, false, undefined, this)
44527
44570
  }, option.value + option.label, false, undefined, this))
44528
44571
  }, undefined, false, undefined, this),
44529
- !filtered.length ? /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("p", {
44572
+ !filtered.length ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("p", {
44530
44573
  role: "status",
44531
44574
  children: copy.noEmoji
44532
44575
  }, undefined, false, undefined, this) : null
@@ -44541,7 +44584,7 @@ Defaulting to \`null\`.`;
44541
44584
  const label = messages.richText.attachFiles;
44542
44585
  if (!onAttach)
44543
44586
  return null;
44544
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarButton, {
44587
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarButton, {
44545
44588
  type: "button",
44546
44589
  className: "vk-rich-tool",
44547
44590
  disabled: disabled || !view,
@@ -44551,7 +44594,7 @@ Defaulting to \`null\`.`;
44551
44594
  event.preventDefault();
44552
44595
  },
44553
44596
  onClick: onAttach,
44554
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44597
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44555
44598
  "aria-hidden": "true",
44556
44599
  children: "+"
44557
44600
  }, undefined, false, undefined, this)
@@ -44563,17 +44606,17 @@ Defaulting to \`null\`.`;
44563
44606
  const shared = { view, state, disabled };
44564
44607
  const bullet = activeNode(state, "bullet_list");
44565
44608
  const formattingLabel = "Aa: " + copy.formatting;
44566
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Collapsible, {
44609
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Collapsible, {
44567
44610
  className: "vk-rich-minimal",
44568
44611
  disabled,
44569
44612
  children: [
44570
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Toolbar, {
44613
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Toolbar, {
44571
44614
  className: "vk-rich-toolbar vk-rich-minimal-actions",
44572
44615
  "aria-label": copy.toolbar,
44573
44616
  children: [
44574
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CollapsibleTrigger, {
44617
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CollapsibleTrigger, {
44575
44618
  asChild: true,
44576
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarButton, {
44619
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarButton, {
44577
44620
  type: "button",
44578
44621
  className: "vk-rich-tool",
44579
44622
  "aria-label": formattingLabel,
@@ -44582,51 +44625,51 @@ Defaulting to \`null\`.`;
44582
44625
  onMouseDown: (event) => {
44583
44626
  event.preventDefault();
44584
44627
  },
44585
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("span", {
44628
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44586
44629
  "aria-hidden": "true",
44587
44630
  children: "Aa"
44588
44631
  }, undefined, false, undefined, this)
44589
44632
  }, undefined, false, undefined, this)
44590
44633
  }, undefined, false, undefined, this),
44591
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(EmojiTool, {
44634
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(EmojiTool, {
44592
44635
  view,
44593
44636
  disabled,
44594
44637
  emojiOptions
44595
44638
  }, undefined, false, undefined, this),
44596
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(AttachTool, {
44639
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(AttachTool, {
44597
44640
  view,
44598
44641
  disabled,
44599
44642
  onAttach
44600
44643
  }, undefined, false, undefined, this)
44601
44644
  ]
44602
44645
  }, undefined, true, undefined, this),
44603
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CollapsibleContent, {
44604
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Toolbar, {
44646
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CollapsibleContent, {
44647
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Toolbar, {
44605
44648
  className: "vk-rich-toolbar vk-rich-minimal-formatting",
44606
44649
  "aria-label": copy.formatting,
44607
44650
  children: [
44608
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44651
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44609
44652
  ...shared,
44610
44653
  label: copy.bold,
44611
44654
  command: toggleMark(schema.marks.strong),
44612
44655
  pressed: activeMark(state, "strong"),
44613
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("strong", {
44656
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("strong", {
44614
44657
  children: "B"
44615
44658
  }, undefined, false, undefined, this)
44616
44659
  }, undefined, false, undefined, this),
44617
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44660
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44618
44661
  ...shared,
44619
44662
  label: copy.italic,
44620
44663
  command: toggleMark(schema.marks.em),
44621
44664
  pressed: activeMark(state, "em"),
44622
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("em", {
44665
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("em", {
44623
44666
  children: "I"
44624
44667
  }, undefined, false, undefined, this)
44625
44668
  }, undefined, false, undefined, this),
44626
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(LinkTool, {
44669
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(LinkTool, {
44627
44670
  ...shared
44628
44671
  }, undefined, false, undefined, this),
44629
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44672
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44630
44673
  ...shared,
44631
44674
  label: copy.bulletList,
44632
44675
  command: bullet ? liftListItem(schema.nodes.list_item) : wrapInList(schema.nodes.bullet_list),
@@ -44646,18 +44689,18 @@ Defaulting to \`null\`.`;
44646
44689
  const bullet = activeNode(state, "bullet_list");
44647
44690
  const ordered = activeNode(state, "ordered_list");
44648
44691
  const quote = activeNode(state, "blockquote");
44649
- return /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(Toolbar, {
44692
+ return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(Toolbar, {
44650
44693
  className: "vk-rich-toolbar",
44651
44694
  "aria-label": copy.toolbar,
44652
44695
  children: [
44653
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44696
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44654
44697
  ...shared,
44655
44698
  label: copy.paragraph,
44656
44699
  command: setBlockType2(schema.nodes.paragraph),
44657
44700
  pressed: activeNode(state, "paragraph"),
44658
44701
  children: "¶"
44659
44702
  }, undefined, false, undefined, this),
44660
- [1, 2, 3].map((level) => /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44703
+ [1, 2, 3].map((level) => /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44661
44704
  ...shared,
44662
44705
  label: "H" + String(level) + ": " + copy.heading(level),
44663
44706
  command: setBlockType2(schema.nodes.heading, { level }),
@@ -44667,57 +44710,57 @@ Defaulting to \`null\`.`;
44667
44710
  level
44668
44711
  ]
44669
44712
  }, level, true, undefined, this)),
44670
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarSeparator, {
44713
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarSeparator, {
44671
44714
  className: "vk-rich-separator"
44672
44715
  }, undefined, false, undefined, this),
44673
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44716
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44674
44717
  ...shared,
44675
44718
  label: copy.bold,
44676
44719
  command: toggleMark(schema.marks.strong),
44677
44720
  pressed: activeMark(state, "strong"),
44678
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("strong", {
44721
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("strong", {
44679
44722
  children: "B"
44680
44723
  }, undefined, false, undefined, this)
44681
44724
  }, undefined, false, undefined, this),
44682
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44725
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44683
44726
  ...shared,
44684
44727
  label: copy.italic,
44685
44728
  command: toggleMark(schema.marks.em),
44686
44729
  pressed: activeMark(state, "em"),
44687
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("em", {
44730
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("em", {
44688
44731
  children: "I"
44689
44732
  }, undefined, false, undefined, this)
44690
44733
  }, undefined, false, undefined, this),
44691
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44734
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44692
44735
  ...shared,
44693
44736
  label: copy.inlineCode,
44694
44737
  command: toggleMark(schema.marks.code),
44695
44738
  pressed: activeMark(state, "code"),
44696
44739
  children: "〈/〉"
44697
44740
  }, undefined, false, undefined, this),
44698
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44741
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44699
44742
  ...shared,
44700
44743
  label: copy.codeBlock,
44701
44744
  command: setBlockType2(schema.nodes.code_block),
44702
44745
  pressed: activeNode(state, "code_block"),
44703
44746
  children: "{ }"
44704
44747
  }, undefined, false, undefined, this),
44705
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarSeparator, {
44748
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarSeparator, {
44706
44749
  className: "vk-rich-separator"
44707
44750
  }, undefined, false, undefined, this),
44708
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44751
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44709
44752
  ...shared,
44710
44753
  label: copy.bulletList,
44711
44754
  command: bullet ? liftListItem(schema.nodes.list_item) : wrapInList(schema.nodes.bullet_list),
44712
44755
  pressed: bullet,
44713
44756
  children: "•≡"
44714
44757
  }, undefined, false, undefined, this),
44715
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44758
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44716
44759
  ...shared,
44717
44760
  label: copy.orderedList,
44718
44761
  command: ordered ? liftListItem(schema.nodes.list_item) : wrapInList(schema.nodes.ordered_list),
44719
44762
  pressed: ordered,
44720
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("svg", {
44763
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("svg", {
44721
44764
  "aria-hidden": "true",
44722
44765
  width: "18",
44723
44766
  height: "18",
@@ -44727,41 +44770,41 @@ Defaulting to \`null\`.`;
44727
44770
  strokeWidth: "1.5",
44728
44771
  strokeLinecap: "round",
44729
44772
  strokeLinejoin: "round",
44730
- children: /* @__PURE__ */ jsx_dev_runtime85.jsxDEV("path", {
44773
+ children: /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("path", {
44731
44774
  d: "M10 6h11M10 12h11M10 18h11M4 2v6M3 3l1-1M3 8h2M3 12h2l-2 4h2M3 20h2M3 19h2v3H3"
44732
44775
  }, undefined, false, undefined, this)
44733
44776
  }, undefined, false, undefined, this)
44734
44777
  }, undefined, false, undefined, this),
44735
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44778
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44736
44779
  ...shared,
44737
44780
  label: copy.quote,
44738
44781
  command: quote ? lift2 : wrapIn(schema.nodes.blockquote),
44739
44782
  pressed: quote,
44740
44783
  children: "❞"
44741
44784
  }, undefined, false, undefined, this),
44742
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(LinkTool, {
44785
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(LinkTool, {
44743
44786
  ...shared
44744
44787
  }, undefined, false, undefined, this),
44745
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(EmojiTool, {
44788
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(EmojiTool, {
44746
44789
  view,
44747
44790
  disabled,
44748
44791
  emojiOptions
44749
44792
  }, undefined, false, undefined, this),
44750
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(AttachTool, {
44793
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(AttachTool, {
44751
44794
  view,
44752
44795
  disabled,
44753
44796
  onAttach
44754
44797
  }, undefined, false, undefined, this),
44755
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(ToolbarSeparator, {
44798
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(ToolbarSeparator, {
44756
44799
  className: "vk-rich-separator"
44757
44800
  }, undefined, false, undefined, this),
44758
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44801
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44759
44802
  ...shared,
44760
44803
  label: copy.undo,
44761
44804
  command: undo,
44762
44805
  children: "↶"
44763
44806
  }, undefined, false, undefined, this),
44764
- /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(CommandButton, {
44807
+ /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(CommandButton, {
44765
44808
  ...shared,
44766
44809
  label: copy.redo,
44767
44810
  command: redo,
@@ -44771,16 +44814,16 @@ Defaulting to \`null\`.`;
44771
44814
  }, undefined, true, undefined, this);
44772
44815
  }
44773
44816
  function RichTextToolbar({ variant, ...props }) {
44774
- return variant === "minimal" ? /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(MinimalToolbar, {
44817
+ return variant === "minimal" ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(MinimalToolbar, {
44775
44818
  ...props
44776
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime85.jsxDEV(FullToolbar, {
44819
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(FullToolbar, {
44777
44820
  ...props
44778
44821
  }, undefined, false, undefined, this);
44779
44822
  }
44780
44823
 
44781
44824
  // src/components/RichTextEditor/uploads.tsx
44782
- var import_react78 = __toESM(require_react(), 1);
44783
- var jsx_dev_runtime86 = __toESM(require_jsx_dev_runtime(), 1);
44825
+ var import_react80 = __toESM(require_react(), 1);
44826
+ var jsx_dev_runtime87 = __toESM(require_jsx_dev_runtime(), 1);
44784
44827
  "use client";
44785
44828
  function validateAttachment(value) {
44786
44829
  if (typeof value !== "object" || value === null || !("name" in value) || !("url" in value) || typeof value.name !== "string" || !value.name.trim() || hasRichTextControlCharacters(value.name) || !isRichTextUrl(value.url) || /^(mailto|tel):/i.test(value.url)) {
@@ -44790,19 +44833,19 @@ Defaulting to \`null\`.`;
44790
44833
  }
44791
44834
  function useRichTextUploads(options) {
44792
44835
  const { messages } = useLocale();
44793
- const [entries, setEntries] = import_react78.useState([]);
44794
- const [announcement, setAnnouncement] = import_react78.useState(null);
44795
- const settings = import_react78.useRef(options);
44836
+ const [entries, setEntries] = import_react80.useState([]);
44837
+ const [announcement, setAnnouncement] = import_react80.useState(null);
44838
+ const settings = import_react80.useRef(options);
44796
44839
  useIsoLayoutEffect(() => {
44797
44840
  settings.current = options;
44798
44841
  }, [options]);
44799
- const nextId = import_react78.useRef(0);
44800
- const attempts = import_react78.useRef(new Map);
44801
- const alive = import_react78.useRef(true);
44842
+ const nextId = import_react80.useRef(0);
44843
+ const attempts = import_react80.useRef(new Map);
44844
+ const alive = import_react80.useRef(true);
44802
44845
  const reportPending = () => {
44803
44846
  settings.current.onPendingChange?.(attempts.current.size > 0);
44804
44847
  };
44805
- import_react78.useEffect(() => {
44848
+ import_react80.useEffect(() => {
44806
44849
  alive.current = true;
44807
44850
  const controllers = attempts.current;
44808
44851
  return () => {
@@ -44813,7 +44856,7 @@ Defaulting to \`null\`.`;
44813
44856
  controllers.clear();
44814
44857
  };
44815
44858
  }, []);
44816
- import_react78.useEffect(() => {
44859
+ import_react80.useEffect(() => {
44817
44860
  if (!options.locked)
44818
44861
  return;
44819
44862
  attempts.current.forEach((controller) => {
@@ -44821,7 +44864,7 @@ Defaulting to \`null\`.`;
44821
44864
  });
44822
44865
  attempts.current.clear();
44823
44866
  }, [options.locked]);
44824
- const reset = import_react78.useCallback(() => {
44867
+ const reset = import_react80.useCallback(() => {
44825
44868
  attempts.current.forEach((controller) => {
44826
44869
  controller.abort();
44827
44870
  });
@@ -44912,28 +44955,28 @@ Defaulting to \`null\`.`;
44912
44955
  function RichTextUploads({ uploads, locked }) {
44913
44956
  const { messages } = useLocale();
44914
44957
  const copy = messages.richText;
44915
- return /* @__PURE__ */ jsx_dev_runtime86.jsxDEV(jsx_dev_runtime86.Fragment, {
44958
+ return /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(jsx_dev_runtime87.Fragment, {
44916
44959
  children: [
44917
- /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44960
+ /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("span", {
44918
44961
  className: "vk-sr-only",
44919
44962
  role: "status",
44920
44963
  "aria-live": "polite",
44921
44964
  children: uploads.announcement
44922
44965
  }, undefined, false, undefined, this),
44923
- uploads.entries.length ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("ul", {
44966
+ uploads.entries.length ? /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("ul", {
44924
44967
  className: "vk-rich-uploads",
44925
- children: uploads.entries.map((entry) => /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("li", {
44968
+ children: uploads.entries.map((entry) => /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("li", {
44926
44969
  className: "vk-rich-upload",
44927
44970
  "data-state": entry.state,
44928
44971
  children: [
44929
- /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44972
+ /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("span", {
44930
44973
  children: entry.file.name
44931
44974
  }, undefined, false, undefined, this),
44932
- /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("span", {
44975
+ /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("span", {
44933
44976
  className: entry.state === "error" ? "vk-field-error" : "vk-rich-upload-status",
44934
44977
  children: entry.state === "pending" ? copy.uploading(entry.file.name) : entry.state === "error" ? entry.issue?.kind === "too-large" ? copy.maxFileSize(formatBytes(entry.issue.limit)) : copy.uploadFailed(entry.file.name) : copy.attachmentUploaded(entry.attachment?.name || entry.file.name)
44935
44978
  }, undefined, false, undefined, this),
44936
- entry.state === "error" ? /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("button", {
44979
+ entry.state === "error" ? /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("button", {
44937
44980
  type: "button",
44938
44981
  className: "vk-link",
44939
44982
  disabled: locked,
@@ -44943,7 +44986,7 @@ Defaulting to \`null\`.`;
44943
44986
  "aria-label": copy.retryUpload(entry.file.name),
44944
44987
  children: copy.retryUpload(entry.file.name)
44945
44988
  }, undefined, false, undefined, this) : null,
44946
- /* @__PURE__ */ jsx_dev_runtime86.jsxDEV("button", {
44989
+ /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("button", {
44947
44990
  type: "button",
44948
44991
  className: "vk-link",
44949
44992
  disabled: locked,
@@ -44964,7 +45007,7 @@ Defaulting to \`null\`.`;
44964
45007
  }
44965
45008
 
44966
45009
  // src/components/RichTextEditor/RichTextEditor.tsx
44967
- var jsx_dev_runtime87 = __toESM(require_jsx_dev_runtime(), 1);
45010
+ var jsx_dev_runtime88 = __toESM(require_jsx_dev_runtime(), 1);
44968
45011
  "use client";
44969
45012
  function editorPlugins() {
44970
45013
  const hardBreak = chainCommands(exitCode, (state, dispatch) => {
@@ -44997,19 +45040,21 @@ Defaulting to \`null\`.`;
44997
45040
  keymap(baseKeymap)
44998
45041
  ];
44999
45042
  }
45043
+ var ECHO_LIMIT = 64;
45000
45044
  function useRichTextEditor(props) {
45001
- const surfaceRef = import_react79.useRef(null);
45002
- const viewRef = import_react79.useRef(null);
45003
- const settings = import_react79.useRef(props);
45045
+ const surfaceRef = import_react81.useRef(null);
45046
+ const viewRef = import_react81.useRef(null);
45047
+ const settings = import_react81.useRef(props);
45048
+ const emitted = import_react81.useRef([]);
45004
45049
  useIsoLayoutEffect(() => {
45005
45050
  settings.current = props;
45006
45051
  }, [props]);
45007
- const [initial] = import_react79.useState(() => props.value ?? props.defaultValue ?? "");
45008
- const [initialDoc] = import_react79.useState(() => parseRichTextMarkdown(initial));
45009
- const [uncontrolledMarkdown, setUncontrolledMarkdown] = import_react79.useState(initial);
45052
+ const [initial] = import_react81.useState(() => props.value ?? props.defaultValue ?? "");
45053
+ const [initialDoc] = import_react81.useState(() => parseRichTextMarkdown(initial));
45054
+ const [uncontrolledMarkdown, setUncontrolledMarkdown] = import_react81.useState(initial);
45010
45055
  const markdown = props.value ?? uncontrolledMarkdown;
45011
- const [editorView, setEditorView] = import_react79.useState(null);
45012
- const [editorState, setEditorState] = import_react79.useState(null);
45056
+ const [editorView, setEditorView] = import_react81.useState(null);
45057
+ const [editorState, setEditorState] = import_react81.useState(null);
45013
45058
  const locked = !!(props.disabled || props.readOnly);
45014
45059
  const insertAttachment = (attachment) => {
45015
45060
  const view = viewRef.current;
@@ -45034,7 +45079,7 @@ Defaulting to \`null\`.`;
45034
45079
  };
45035
45080
  const uploads = useRichTextUploads({ upload: props.onUploadAttachment, locked, maxFileSize: props.maxFileSize, insert: insertAttachment, remove: removeAttachment, onError: props.onUploadError, onPendingChange: props.onUploadPendingChange });
45036
45081
  const resetUploads = uploads.reset;
45037
- import_react79.useEffect(() => {
45082
+ import_react81.useEffect(() => {
45038
45083
  if (!surfaceRef.current)
45039
45084
  return;
45040
45085
  const view = new EditorView({ mount: surfaceRef.current }, {
@@ -45048,6 +45093,7 @@ Defaulting to \`null\`.`;
45048
45093
  setEditorState(next);
45049
45094
  if (transaction.docChanged && !next.doc.eq(transaction.before)) {
45050
45095
  const content = serializeRichTextMarkdown(next.doc);
45096
+ emitted.current = [...emitted.current.slice(-(ECHO_LIMIT - 1)), content];
45051
45097
  if (settings.current.value === undefined)
45052
45098
  setUncontrolledMarkdown(content);
45053
45099
  settings.current.onChange?.(content);
@@ -45080,28 +45126,32 @@ Defaulting to \`null\`.`;
45080
45126
  view.destroy();
45081
45127
  };
45082
45128
  }, [initialDoc, resetUploads]);
45083
- import_react79.useEffect(() => {
45129
+ import_react81.useEffect(() => {
45084
45130
  const view = viewRef.current;
45085
45131
  if (!view)
45086
45132
  return;
45087
45133
  view.setProps({ editable: () => !(props.disabled || props.readOnly) });
45088
45134
  }, [props.disabled, props.readOnly]);
45089
- const currentDoc = editorState?.doc;
45090
- import_react79.useEffect(() => {
45135
+ import_react81.useEffect(() => {
45091
45136
  const view = viewRef.current;
45092
45137
  if (props.value === undefined || !view)
45093
45138
  return;
45094
- const document2 = parseRichTextMarkdown(props.value);
45095
- if (!view.state.doc.eq(document2)) {
45096
- resetUploads();
45097
- view.updateState(EditorState.create({ doc: document2, plugins: editorPlugins() }));
45098
- setEditorState(view.state);
45139
+ const echo = emitted.current.indexOf(props.value);
45140
+ if (echo >= 0) {
45141
+ emitted.current = emitted.current.slice(echo + 1);
45142
+ return;
45099
45143
  }
45100
- }, [props.value, currentDoc, resetUploads]);
45144
+ emitted.current = [];
45145
+ if (serializeRichTextMarkdown(view.state.doc) === props.value)
45146
+ return;
45147
+ resetUploads();
45148
+ view.updateState(EditorState.create({ doc: parseRichTextMarkdown(props.value), plugins: editorPlugins() }));
45149
+ setEditorState(view.state);
45150
+ }, [props.value, resetUploads]);
45101
45151
  return { surfaceRef, editorView, editorState, initialDoc, markdown, uploads };
45102
45152
  }
45103
- var RichTextSurface = import_react79.forwardRef(function RichTextSurface({ props, id, document: document2 }, ref) {
45104
- return /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("div", {
45153
+ var RichTextSurface = import_react81.forwardRef(function RichTextSurface({ props, id, document: document2 }, ref) {
45154
+ return /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("div", {
45105
45155
  ref,
45106
45156
  id,
45107
45157
  className: "vk-rich-content vk-prose",
@@ -45122,9 +45172,9 @@ Defaulting to \`null\`.`;
45122
45172
  });
45123
45173
  function RichTextFormFields({ props, markdown, editorView, chooser, uploads }) {
45124
45174
  const locked = !!(props.disabled || props.readOnly);
45125
- return /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(jsx_dev_runtime87.Fragment, {
45175
+ return /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(jsx_dev_runtime88.Fragment, {
45126
45176
  children: [
45127
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("textarea", {
45177
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("textarea", {
45128
45178
  className: "vk-sr-only",
45129
45179
  tabIndex: -1,
45130
45180
  "aria-hidden": "true",
@@ -45138,7 +45188,7 @@ Defaulting to \`null\`.`;
45138
45188
  editorView?.focus();
45139
45189
  }
45140
45190
  }, undefined, false, undefined, this),
45141
- props.onUploadAttachment ? /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("input", {
45191
+ props.onUploadAttachment ? /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("input", {
45142
45192
  ref: chooser,
45143
45193
  type: "file",
45144
45194
  className: "vk-sr-only",
@@ -45159,7 +45209,7 @@ Defaulting to \`null\`.`;
45159
45209
  const minimal = props.toolbar === "minimal";
45160
45210
  if (props.readOnly || position === "after" !== minimal)
45161
45211
  return null;
45162
- return /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextToolbar, {
45212
+ return /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextToolbar, {
45163
45213
  variant: props.toolbar,
45164
45214
  view,
45165
45215
  state,
@@ -45168,53 +45218,53 @@ Defaulting to \`null\`.`;
45168
45218
  onAttach: props.onUploadAttachment ? () => chooser.current?.click() : undefined
45169
45219
  }, undefined, false, undefined, this);
45170
45220
  }
45171
- var RichTextEditor = import_react79.forwardRef(function RichTextEditor(props, forwardedRef) {
45221
+ var RichTextEditor = import_react81.forwardRef(function RichTextEditor(props, forwardedRef) {
45172
45222
  const uid = useUid("vk-rich");
45173
45223
  const id = props.id || uid;
45174
- const chooser = import_react79.useRef(null);
45224
+ const chooser = import_react81.useRef(null);
45175
45225
  const { surfaceRef, editorView, editorState, initialDoc, markdown, uploads } = useRichTextEditor(props);
45176
45226
  const locked = !!(props.disabled || props.readOnly);
45177
- const connectSurface = import_react79.useCallback((node) => {
45227
+ const connectSurface = import_react81.useCallback((node) => {
45178
45228
  surfaceRef.current = node;
45179
45229
  if (typeof forwardedRef === "function")
45180
45230
  forwardedRef(node);
45181
45231
  else if (forwardedRef)
45182
45232
  forwardedRef.current = node;
45183
45233
  }, [forwardedRef, surfaceRef]);
45184
- return /* @__PURE__ */ jsx_dev_runtime87.jsxDEV("div", {
45234
+ return /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("div", {
45185
45235
  className: cx("vk-rich", props.className),
45186
45236
  "data-disabled": props.disabled || undefined,
45187
45237
  "data-readonly": props.readOnly || undefined,
45188
45238
  "data-invalid": props["aria-invalid"] || undefined,
45189
45239
  children: [
45190
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextTools, {
45240
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextTools, {
45191
45241
  props,
45192
45242
  position: "before",
45193
45243
  view: editorView,
45194
45244
  state: editorState,
45195
45245
  chooser
45196
45246
  }, undefined, false, undefined, this),
45197
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextSurface, {
45247
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextSurface, {
45198
45248
  ref: connectSurface,
45199
45249
  props,
45200
45250
  id,
45201
45251
  document: editorState?.doc ?? initialDoc
45202
45252
  }, undefined, false, undefined, this),
45203
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextTools, {
45253
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextTools, {
45204
45254
  props,
45205
45255
  position: "after",
45206
45256
  view: editorView,
45207
45257
  state: editorState,
45208
45258
  chooser
45209
45259
  }, undefined, false, undefined, this),
45210
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextFormFields, {
45260
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextFormFields, {
45211
45261
  props,
45212
45262
  markdown,
45213
45263
  editorView,
45214
45264
  chooser,
45215
45265
  uploads
45216
45266
  }, undefined, false, undefined, this),
45217
- /* @__PURE__ */ jsx_dev_runtime87.jsxDEV(RichTextUploads, {
45267
+ /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextUploads, {
45218
45268
  uploads,
45219
45269
  locked
45220
45270
  }, undefined, false, undefined, this)
@@ -45223,13 +45273,13 @@ Defaulting to \`null\`.`;
45223
45273
  });
45224
45274
 
45225
45275
  // src/components/ChatPanel/composer.tsx
45226
- var jsx_dev_runtime88 = __toESM(require_jsx_dev_runtime(), 1);
45276
+ var jsx_dev_runtime89 = __toESM(require_jsx_dev_runtime(), 1);
45227
45277
  "use client";
45228
45278
  function ChatComposer({ options }) {
45229
45279
  const { messages } = useLocale();
45230
- const [uncontrolled, setUncontrolled] = import_react80.useState(options.defaultValue || "");
45280
+ const [uncontrolled, setUncontrolled] = import_react82.useState(options.defaultValue || "");
45231
45281
  const controlled = options.value !== undefined;
45232
- const [uploadPending, setUploadPending] = import_react80.useState(false);
45282
+ const [uploadPending, setUploadPending] = import_react82.useState(false);
45233
45283
  const draft = options.value ?? uncontrolled;
45234
45284
  const locked = Boolean(options.disabled || options.sending);
45235
45285
  const change = (value) => {
@@ -45247,13 +45297,13 @@ Defaulting to \`null\`.`;
45247
45297
  if (!controlled)
45248
45298
  change("");
45249
45299
  };
45250
- return /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("form", {
45300
+ return /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("form", {
45251
45301
  className: "vk-chat-composer",
45252
45302
  onSubmit: submit,
45253
45303
  children: [
45254
- /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(Field, {
45304
+ /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Field, {
45255
45305
  label: options.label || messages.chat.message,
45256
- children: /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(RichTextEditor, {
45306
+ children: /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(RichTextEditor, {
45257
45307
  toolbar: "minimal",
45258
45308
  value: draft,
45259
45309
  onChange: change,
@@ -45268,9 +45318,9 @@ Defaulting to \`null\`.`;
45268
45318
  onUploadPendingChange: setUploadPending
45269
45319
  }, undefined, false, undefined, this)
45270
45320
  }, undefined, false, undefined, this),
45271
- /* @__PURE__ */ jsx_dev_runtime88.jsxDEV("div", {
45321
+ /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45272
45322
  className: "vk-chat-composer-actions",
45273
- children: /* @__PURE__ */ jsx_dev_runtime88.jsxDEV(Button, {
45323
+ children: /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Button, {
45274
45324
  type: "submit",
45275
45325
  size: "sm",
45276
45326
  loading: options.sending,
@@ -45284,35 +45334,35 @@ Defaulting to \`null\`.`;
45284
45334
  }
45285
45335
 
45286
45336
  // src/components/ChatPanel/transcript.tsx
45287
- var import_react81 = __toESM(require_react(), 1);
45288
- var jsx_dev_runtime89 = __toESM(require_jsx_dev_runtime(), 1);
45337
+ var import_react83 = __toESM(require_react(), 1);
45338
+ var jsx_dev_runtime90 = __toESM(require_jsx_dev_runtime(), 1);
45289
45339
  "use client";
45290
45340
  function MessageDelivery({ message, onRetry }) {
45291
45341
  const { messages } = useLocale();
45292
45342
  if (!message.delivery)
45293
45343
  return null;
45294
45344
  if (message.delivery.state === "pending")
45295
- return /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("span", {
45345
+ return /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("span", {
45296
45346
  className: "vk-chat-delivery",
45297
45347
  children: [
45298
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Icon, {
45348
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Icon, {
45299
45349
  name: "clock",
45300
45350
  size: 14
45301
45351
  }, undefined, false, undefined, this),
45302
45352
  messages.chat.sending
45303
45353
  ]
45304
45354
  }, undefined, true, undefined, this);
45305
- return /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45355
+ return /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45306
45356
  className: "vk-chat-delivery vk-chat-delivery-failed",
45307
45357
  children: [
45308
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Icon, {
45358
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Icon, {
45309
45359
  name: "circle-alert",
45310
45360
  size: 14
45311
45361
  }, undefined, false, undefined, this),
45312
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("span", {
45362
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("span", {
45313
45363
  children: message.delivery.error || messages.chat.failed
45314
45364
  }, undefined, false, undefined, this),
45315
- onRetry ? /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Button, {
45365
+ onRetry ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Button, {
45316
45366
  type: "button",
45317
45367
  size: "sm",
45318
45368
  variant: "ghost",
@@ -45326,41 +45376,41 @@ Defaulting to \`null\`.`;
45326
45376
  }, undefined, true, undefined, this);
45327
45377
  }
45328
45378
  function MessageItem({ message, onRetry, reducedMotion }) {
45329
- return /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(MotionLi, {
45379
+ return /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(MotionLi, {
45330
45380
  className: cx("vk-chat-message", "vk-chat-message-" + message.direction),
45331
45381
  initial: { opacity: 0, y: reducedMotion ? 0 : 4 },
45332
45382
  animate: { opacity: 1, y: 0 },
45333
45383
  transition: { duration: reducedMotion ? 0 : 0.16, ease: "easeOut" },
45334
45384
  children: [
45335
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("span", {
45385
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("span", {
45336
45386
  className: "vk-chat-message-avatar",
45337
- children: message.author.avatar || /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(Avatar, {
45387
+ children: message.author.avatar || /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Avatar, {
45338
45388
  name: message.author.name,
45339
45389
  size: 28,
45340
45390
  decorative: true
45341
45391
  }, undefined, false, undefined, this)
45342
45392
  }, undefined, false, undefined, this),
45343
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45393
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45344
45394
  className: "vk-chat-message-body",
45345
45395
  children: [
45346
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45396
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45347
45397
  className: "vk-chat-message-meta",
45348
45398
  children: [
45349
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("span", {
45399
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("span", {
45350
45400
  className: "vk-chat-message-author",
45351
45401
  children: message.author.name
45352
45402
  }, undefined, false, undefined, this),
45353
- message.timestamp ? /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("span", {
45403
+ message.timestamp ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("span", {
45354
45404
  className: "vk-chat-message-time",
45355
45405
  children: message.timestamp
45356
45406
  }, undefined, false, undefined, this) : null
45357
45407
  ]
45358
45408
  }, undefined, true, undefined, this),
45359
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45409
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45360
45410
  className: "vk-prose vk-chat-message-content",
45361
45411
  children: message.content
45362
45412
  }, undefined, false, undefined, this),
45363
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(MessageDelivery, {
45413
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(MessageDelivery, {
45364
45414
  message,
45365
45415
  onRetry
45366
45416
  }, undefined, false, undefined, this)
@@ -45372,15 +45422,15 @@ Defaulting to \`null\`.`;
45372
45422
  function ChatTranscript(props) {
45373
45423
  const { messages } = useLocale();
45374
45424
  const reducedMotion = useReducedMotion() === true;
45375
- const scrollRef = import_react81.useRef(null);
45376
- const follow = import_react81.useRef(true);
45425
+ const scrollRef = import_react83.useRef(null);
45426
+ const follow = import_react83.useRef(true);
45377
45427
  useIsoLayoutEffect(() => {
45378
45428
  const node = scrollRef.current;
45379
45429
  if (node && follow.current)
45380
45430
  node.scrollTop = node.scrollHeight;
45381
45431
  }, [props.messages, props.pending]);
45382
45432
  const empty = props.emptyState === undefined ? messages.chat.empty : props.emptyState;
45383
- return /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45433
+ return /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45384
45434
  ref: scrollRef,
45385
45435
  role: "log",
45386
45436
  "aria-label": props.label || messages.chat.messages,
@@ -45394,13 +45444,13 @@ Defaulting to \`null\`.`;
45394
45444
  follow.current = node.scrollHeight - node.scrollTop - node.clientHeight <= 32;
45395
45445
  },
45396
45446
  children: [
45397
- /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(LazyMotion, {
45447
+ /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(LazyMotion, {
45398
45448
  features: domAnimation,
45399
- children: /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("ol", {
45449
+ children: /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("ol", {
45400
45450
  className: "vk-chat-messages",
45401
- children: /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(AnimatePresence, {
45451
+ children: /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(AnimatePresence, {
45402
45452
  initial: false,
45403
- children: props.messages.map((message) => /* @__PURE__ */ jsx_dev_runtime89.jsxDEV(MessageItem, {
45453
+ children: props.messages.map((message) => /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(MessageItem, {
45404
45454
  message,
45405
45455
  onRetry: props.onRetryMessage,
45406
45456
  reducedMotion
@@ -45408,11 +45458,11 @@ Defaulting to \`null\`.`;
45408
45458
  }, undefined, false, undefined, this)
45409
45459
  }, undefined, false, undefined, this)
45410
45460
  }, undefined, false, undefined, this),
45411
- !props.messages.length && !props.pending && !props.error ? /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45461
+ !props.messages.length && !props.pending && !props.error ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45412
45462
  className: "vk-chat-empty",
45413
45463
  children: empty
45414
45464
  }, undefined, false, undefined, this) : null,
45415
- props.pending ? /* @__PURE__ */ jsx_dev_runtime89.jsxDEV("div", {
45465
+ props.pending ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45416
45466
  className: "vk-chat-pending",
45417
45467
  role: "status",
45418
45468
  children: props.pending
@@ -45422,14 +45472,14 @@ Defaulting to \`null\`.`;
45422
45472
  }
45423
45473
 
45424
45474
  // src/components/ChatPanel/ChatPanel.tsx
45425
- var jsx_dev_runtime90 = __toESM(require_jsx_dev_runtime(), 1);
45475
+ var jsx_dev_runtime91 = __toESM(require_jsx_dev_runtime(), 1);
45426
45476
  "use client";
45427
45477
  function ChatPanel(props) {
45428
45478
  const { messages } = useLocale();
45429
- return /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45479
+ return /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45430
45480
  className: cx("vk-chat-panel", props.className),
45431
45481
  children: [
45432
- /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ChatTranscript, {
45482
+ /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(ChatTranscript, {
45433
45483
  messages: props.messages,
45434
45484
  emptyState: props.emptyState,
45435
45485
  pending: props.pending,
@@ -45437,18 +45487,18 @@ Defaulting to \`null\`.`;
45437
45487
  label: props["aria-label"],
45438
45488
  onRetryMessage: props.onRetryMessage
45439
45489
  }, undefined, false, undefined, this),
45440
- props.error ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45490
+ props.error ? /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45441
45491
  className: "vk-chat-feedback",
45442
45492
  role: "alert",
45443
45493
  children: [
45444
- /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Icon, {
45494
+ /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(Icon, {
45445
45495
  name: "circle-alert",
45446
45496
  size: 16
45447
45497
  }, undefined, false, undefined, this),
45448
- /* @__PURE__ */ jsx_dev_runtime90.jsxDEV("div", {
45498
+ /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45449
45499
  children: props.error
45450
45500
  }, undefined, false, undefined, this),
45451
- props.onRetry ? /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(Button, {
45501
+ props.onRetry ? /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(Button, {
45452
45502
  type: "button",
45453
45503
  size: "sm",
45454
45504
  variant: "ghost",
@@ -45457,7 +45507,7 @@ Defaulting to \`null\`.`;
45457
45507
  }, undefined, false, undefined, this) : null
45458
45508
  ]
45459
45509
  }, undefined, true, undefined, this) : null,
45460
- /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ChatComposer, {
45510
+ /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(ChatComposer, {
45461
45511
  options: props.composer
45462
45512
  }, undefined, false, undefined, this)
45463
45513
  ]
@@ -45465,11 +45515,11 @@ Defaulting to \`null\`.`;
45465
45515
  }
45466
45516
 
45467
45517
  // src/components/ChatWidget/ChatWidget.tsx
45468
- var jsx_dev_runtime91 = __toESM(require_jsx_dev_runtime(), 1);
45518
+ var jsx_dev_runtime92 = __toESM(require_jsx_dev_runtime(), 1);
45469
45519
  "use client";
45470
45520
  var MotionIconButton = createMinimalMotionComponent(IconButton);
45471
45521
  function useChatOpen({ open, defaultOpen, onOpenChange }) {
45472
- const [localOpen, setLocalOpen] = import_react83.useState(defaultOpen ?? false);
45522
+ const [localOpen, setLocalOpen] = import_react85.useState(defaultOpen ?? false);
45473
45523
  return {
45474
45524
  open: open ?? localOpen,
45475
45525
  change: (next) => {
@@ -45483,9 +45533,9 @@ Defaulting to \`null\`.`;
45483
45533
  const { messages } = useLocale();
45484
45534
  const reducedMotion = useReducedMotion() === true;
45485
45535
  const descriptionId = titleId + "-description";
45486
- return /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(PopoverPortal, {
45536
+ return /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(PopoverPortal, {
45487
45537
  forceMount: true,
45488
- children: /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(PopoverContent, {
45538
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(PopoverContent, {
45489
45539
  forceMount: true,
45490
45540
  asChild: true,
45491
45541
  side: "top",
@@ -45495,39 +45545,39 @@ Defaulting to \`null\`.`;
45495
45545
  "aria-labelledby": titleId,
45496
45546
  "aria-describedby": description ? descriptionId : undefined,
45497
45547
  className: "vk-chat-widget-panel",
45498
- children: /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(MotionDiv, {
45548
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(MotionDiv, {
45499
45549
  initial: { opacity: 0, y: reducedMotion ? 0 : 8, scale: reducedMotion ? 1 : 0.99 },
45500
45550
  animate: { opacity: 1, y: 0, scale: 1, transition: { duration: reducedMotion ? 0 : 0.2, ease: [0.2, 0.8, 0.2, 1] } },
45501
45551
  exit: { opacity: 0, y: reducedMotion ? 0 : 8, scale: reducedMotion ? 1 : 0.99, transition: { duration: reducedMotion ? 0 : 0.12 } },
45502
45552
  children: [
45503
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("header", {
45553
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("header", {
45504
45554
  className: "vk-chat-header",
45505
45555
  children: [
45506
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45556
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45507
45557
  className: "vk-chat-heading",
45508
45558
  children: [
45509
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("h2", {
45559
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("h2", {
45510
45560
  id: titleId,
45511
45561
  className: "vk-chat-title",
45512
45562
  children: title
45513
45563
  }, undefined, false, undefined, this),
45514
- description ? /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45564
+ description ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45515
45565
  id: descriptionId,
45516
45566
  className: "vk-chat-description",
45517
45567
  children: description
45518
45568
  }, undefined, false, undefined, this) : null
45519
45569
  ]
45520
45570
  }, undefined, true, undefined, this),
45521
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(PopoverClose, {
45571
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(PopoverClose, {
45522
45572
  asChild: true,
45523
- children: /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(IconButton, {
45573
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(IconButton, {
45524
45574
  icon: "x",
45525
45575
  label: messages.chat.close
45526
45576
  }, undefined, false, undefined, this)
45527
45577
  }, undefined, false, undefined, this)
45528
45578
  ]
45529
45579
  }, undefined, true, undefined, this),
45530
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(ChatPanel, {
45580
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ChatPanel, {
45531
45581
  ...panel
45532
45582
  }, undefined, false, undefined, this)
45533
45583
  ]
@@ -45542,21 +45592,20 @@ Defaulting to \`null\`.`;
45542
45592
  const titleId = useUid("vk-chat-title");
45543
45593
  const unread = unreadCount && unreadCount > 0 ? messages.chat.unread(unreadCount) : "";
45544
45594
  const label = (triggerLabel || messages.chat.open) + (unread ? ", " + unread : "");
45545
- return /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(LazyMotion, {
45595
+ return /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(LazyMotion, {
45546
45596
  features: domAnimation,
45547
- children: /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(Popover, {
45597
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(Popover, {
45548
45598
  open: disclosure.open,
45549
45599
  onOpenChange: disclosure.change,
45550
45600
  modal,
45551
45601
  children: [
45552
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("div", {
45602
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45553
45603
  className: cx("vk-chat-widget-launcher", "vk-chat-widget-" + align, className),
45554
45604
  children: [
45555
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(PopoverTrigger, {
45605
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(PopoverTrigger, {
45556
45606
  asChild: true,
45557
- children: /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(MotionIconButton, {
45607
+ children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(MotionIconButton, {
45558
45608
  icon: "message-circle",
45559
- size: 24,
45560
45609
  label,
45561
45610
  variant: "outline",
45562
45611
  className: "vk-chat-widget-trigger",
@@ -45565,16 +45614,16 @@ Defaulting to \`null\`.`;
45565
45614
  transition: { duration: reducedMotion ? 0 : 0.12 }
45566
45615
  }, undefined, false, undefined, this)
45567
45616
  }, undefined, false, undefined, this),
45568
- unreadCount && unreadCount > 0 ? /* @__PURE__ */ jsx_dev_runtime91.jsxDEV("span", {
45617
+ unreadCount && unreadCount > 0 ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45569
45618
  className: "vk-chat-unread",
45570
45619
  "aria-hidden": "true",
45571
45620
  children: formatNumber(unreadCount, { locale })
45572
45621
  }, undefined, false, undefined, this) : null
45573
45622
  ]
45574
45623
  }, undefined, true, undefined, this),
45575
- /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(AnimatePresence, {
45624
+ /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(AnimatePresence, {
45576
45625
  initial: false,
45577
- children: disclosure.open ? /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(WidgetContent, {
45626
+ children: disclosure.open ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(WidgetContent, {
45578
45627
  title,
45579
45628
  description,
45580
45629
  align,
@@ -45588,20 +45637,20 @@ Defaulting to \`null\`.`;
45588
45637
  }
45589
45638
 
45590
45639
  // src/components/ChatInbox/ChatInbox.tsx
45591
- var import_react85 = __toESM(require_react(), 1);
45592
- var jsx_dev_runtime92 = __toESM(require_jsx_dev_runtime(), 1);
45640
+ var import_react87 = __toESM(require_react(), 1);
45641
+ var jsx_dev_runtime93 = __toESM(require_jsx_dev_runtime(), 1);
45593
45642
  "use client";
45594
45643
  function ThreadList({ threads, selectedId, activeRef, onSelect }) {
45595
45644
  const { locale, messages } = useLocale();
45596
45645
  if (!threads.length)
45597
- return /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45646
+ return /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("div", {
45598
45647
  className: "vk-chat-empty",
45599
45648
  children: messages.chat.noThreads
45600
45649
  }, undefined, false, undefined, this);
45601
- return /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("ul", {
45650
+ return /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("ul", {
45602
45651
  className: "vk-chat-threads",
45603
- children: threads.map((thread) => /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("li", {
45604
- children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("button", {
45652
+ children: threads.map((thread) => /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("li", {
45653
+ children: /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("button", {
45605
45654
  ref: thread.id === selectedId ? activeRef : undefined,
45606
45655
  type: "button",
45607
45656
  className: "vk-chat-thread",
@@ -45611,29 +45660,29 @@ Defaulting to \`null\`.`;
45611
45660
  onSelect(thread.id);
45612
45661
  },
45613
45662
  children: [
45614
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45663
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45615
45664
  className: "vk-chat-thread-avatar",
45616
- children: thread.avatar || /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(Avatar, {
45665
+ children: thread.avatar || /* @__PURE__ */ jsx_dev_runtime93.jsxDEV(Avatar, {
45617
45666
  name: thread.title,
45618
45667
  decorative: true
45619
45668
  }, undefined, false, undefined, this)
45620
45669
  }, undefined, false, undefined, this),
45621
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45670
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45622
45671
  className: "vk-chat-thread-text",
45623
45672
  children: [
45624
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45673
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45625
45674
  className: "vk-chat-thread-title",
45626
45675
  children: thread.title
45627
45676
  }, undefined, false, undefined, this),
45628
- thread.preview ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45677
+ thread.preview ? /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45629
45678
  className: "vk-chat-thread-preview",
45630
45679
  children: thread.preview
45631
45680
  }, undefined, false, undefined, this) : null,
45632
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45681
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45633
45682
  className: "vk-chat-thread-meta",
45634
45683
  children: [
45635
45684
  thread.timestamp,
45636
- thread.unreadCount && thread.unreadCount > 0 ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("span", {
45685
+ thread.unreadCount && thread.unreadCount > 0 ? /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("span", {
45637
45686
  className: "vk-chat-thread-count",
45638
45687
  "aria-label": messages.chat.unread(thread.unreadCount),
45639
45688
  children: formatNumber(thread.unreadCount, { locale })
@@ -45651,9 +45700,9 @@ Defaulting to \`null\`.`;
45651
45700
  const { messages } = useLocale();
45652
45701
  const listTitleId = useUid("vk-chat-threads");
45653
45702
  const selected = threads.find((thread) => thread.id === selectedThreadId);
45654
- const headingRef = import_react85.useRef(null);
45655
- const activeRef = import_react85.useRef(null);
45656
- const navigation = import_react85.useRef(null);
45703
+ const headingRef = import_react87.useRef(null);
45704
+ const activeRef = import_react87.useRef(null);
45705
+ const navigation = import_react87.useRef(null);
45657
45706
  useIsoLayoutEffect(() => {
45658
45707
  const request = navigation.current;
45659
45708
  if (!request)
@@ -45675,22 +45724,22 @@ Defaulting to \`null\`.`;
45675
45724
  onSelectThread(null);
45676
45725
  };
45677
45726
  const empty = emptySelection === undefined ? messages.chat.chooseThread : emptySelection;
45678
- return /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45727
+ return /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("div", {
45679
45728
  className: cx("vk-chat-inbox", selected && "vk-chat-inbox-selected", className),
45680
45729
  children: [
45681
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("section", {
45730
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("section", {
45682
45731
  className: "vk-chat-inbox-list",
45683
45732
  "aria-labelledby": listTitleId,
45684
45733
  children: [
45685
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("header", {
45734
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("header", {
45686
45735
  className: "vk-chat-header",
45687
- children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("h2", {
45736
+ children: /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("h2", {
45688
45737
  id: listTitleId,
45689
45738
  className: "vk-chat-title",
45690
45739
  children: title || messages.chat.conversations
45691
45740
  }, undefined, false, undefined, this)
45692
45741
  }, undefined, false, undefined, this),
45693
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThreadList, {
45742
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV(ThreadList, {
45694
45743
  threads,
45695
45744
  selectedId: selectedThreadId,
45696
45745
  activeRef,
@@ -45698,21 +45747,21 @@ Defaulting to \`null\`.`;
45698
45747
  }, undefined, false, undefined, this)
45699
45748
  ]
45700
45749
  }, undefined, true, undefined, this),
45701
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("section", {
45750
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("section", {
45702
45751
  className: "vk-chat-inbox-detail",
45703
45752
  "aria-label": selected?.title || messages.chat.messages,
45704
- children: selected ? /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(jsx_dev_runtime92.Fragment, {
45753
+ children: selected ? /* @__PURE__ */ jsx_dev_runtime93.jsxDEV(jsx_dev_runtime93.Fragment, {
45705
45754
  children: [
45706
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("header", {
45755
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("header", {
45707
45756
  className: "vk-chat-header",
45708
45757
  children: [
45709
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(IconButton, {
45758
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV(IconButton, {
45710
45759
  icon: "chevron-left",
45711
45760
  label: messages.chat.back,
45712
45761
  className: "vk-chat-back",
45713
45762
  onClick: back
45714
45763
  }, undefined, false, undefined, this),
45715
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("h2", {
45764
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("h2", {
45716
45765
  ref: headingRef,
45717
45766
  tabIndex: -1,
45718
45767
  className: "vk-chat-title",
@@ -45720,11 +45769,11 @@ Defaulting to \`null\`.`;
45720
45769
  }, undefined, false, undefined, this)
45721
45770
  ]
45722
45771
  }, undefined, true, undefined, this),
45723
- /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ChatPanel, {
45772
+ /* @__PURE__ */ jsx_dev_runtime93.jsxDEV(ChatPanel, {
45724
45773
  ...panel
45725
45774
  }, selected.id, false, undefined, this)
45726
45775
  ]
45727
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime92.jsxDEV("div", {
45776
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime93.jsxDEV("div", {
45728
45777
  className: "vk-chat-empty vk-chat-no-selection",
45729
45778
  children: empty
45730
45779
  }, undefined, false, undefined, this)