@w100n/documents 0.16.0 → 0.16.2

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 (39) hide show
  1. package/dist/{SheetView-EFBSMY7K.js → SheetView-S5AFXKPA.js} +5 -5
  2. package/dist/{TextEditor-MGCSGGGA.js → TextEditor-7WQJFUUU.js} +399 -349
  3. package/dist/TextEditor-7WQJFUUU.js.map +1 -0
  4. package/dist/{chunk-3OLRFIHQ.js → chunk-JC4DLTMI.js} +2 -2
  5. package/dist/{chunk-2L3TK7UF.js → chunk-KGAQT5M3.js} +3 -3
  6. package/dist/{chunk-2L3TK7UF.js.map → chunk-KGAQT5M3.js.map} +1 -1
  7. package/dist/{chunk-RKV3N6OS.js → chunk-LZYITB56.js} +22 -1
  8. package/dist/chunk-LZYITB56.js.map +1 -0
  9. package/dist/collab.cjs +22 -1
  10. package/dist/collab.cjs.map +1 -1
  11. package/dist/collab.d.cts +1 -1
  12. package/dist/collab.d.ts +1 -1
  13. package/dist/collab.js +2 -2
  14. package/dist/{grid-Q4XBPQFY.js → grid-AZLMNS7K.js} +15 -6
  15. package/dist/grid-AZLMNS7K.js.map +1 -0
  16. package/dist/index.cjs +1023 -886
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.css +78 -6
  19. package/dist/index.css.map +1 -1
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +58 -14
  23. package/dist/index.js.map +1 -1
  24. package/dist/kinds.d.cts +1 -1
  25. package/dist/kinds.d.ts +1 -1
  26. package/dist/memory.cjs +25 -2
  27. package/dist/memory.cjs.map +1 -1
  28. package/dist/memory.d.cts +3 -2
  29. package/dist/memory.d.ts +3 -2
  30. package/dist/memory.js +25 -2
  31. package/dist/memory.js.map +1 -1
  32. package/dist/{types-BTsVooZw.d.cts → types-DNcaU6SK.d.cts} +9 -0
  33. package/dist/{types-BTsVooZw.d.ts → types-DNcaU6SK.d.ts} +9 -0
  34. package/package.json +1 -1
  35. package/dist/TextEditor-MGCSGGGA.js.map +0 -1
  36. package/dist/chunk-RKV3N6OS.js.map +0 -1
  37. package/dist/grid-Q4XBPQFY.js.map +0 -1
  38. /package/dist/{SheetView-EFBSMY7K.js.map → SheetView-S5AFXKPA.js.map} +0 -0
  39. /package/dist/{chunk-3OLRFIHQ.js.map → chunk-JC4DLTMI.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -98,6 +98,13 @@ var init_text = __esm({
98
98
  retry: "Try again",
99
99
  loading: "Loading",
100
100
  unsupported: "This file cannot be shown yet",
101
+ teamTemplates: "Team templates",
102
+ saveTemplate: "Save as template",
103
+ templateSaved: "Saved to Templates",
104
+ templateFailed: "Could not save the template",
105
+ assignTo: "Assign to {name}",
106
+ assignedTo: "Assigned to {name}",
107
+ assignedYou: "Assigned to you",
101
108
  printLayout: "Print layout",
102
109
  cut: "Cut",
103
110
  paste: "Paste",
@@ -432,6 +439,13 @@ var init_text = __esm({
432
439
  retry: "Spr\xF3buj ponownie",
433
440
  loading: "Wczytywanie",
434
441
  unsupported: "Tego pliku nie da si\u0119 jeszcze pokaza\u0107",
442
+ teamTemplates: "Szablony zespo\u0142u",
443
+ saveTemplate: "Zapisz jako szablon",
444
+ templateSaved: "Zapisano w Szablonach",
445
+ templateFailed: "Nie uda\u0142o si\u0119 zapisa\u0107 szablonu",
446
+ assignTo: "Przypisz do: {name}",
447
+ assignedTo: "Przypisane: {name}",
448
+ assignedYou: "Przypisane do Ciebie",
435
449
  printLayout: "Uk\u0142ad wydruku",
436
450
  cut: "Wytnij",
437
451
  paste: "Wklej",
@@ -766,6 +780,13 @@ var init_text = __esm({
766
780
  retry: "\u0421\u043F\u0440\u043E\u0431\u0443\u0432\u0430\u0442\u0438 \u0449\u0435",
767
781
  loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",
768
782
  unsupported: "\u0426\u0435\u0439 \u0444\u0430\u0439\u043B \u043F\u043E\u043A\u0438 \u043D\u0435 \u043C\u043E\u0436\u043D\u0430 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0438",
783
+ teamTemplates: "\u0428\u0430\u0431\u043B\u043E\u043D\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0438",
784
+ saveTemplate: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044F\u043A \u0448\u0430\u0431\u043B\u043E\u043D",
785
+ templateSaved: "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E \u0432 Templates",
786
+ templateFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D",
787
+ assignTo: "\u0414\u043E\u0440\u0443\u0447\u0438\u0442\u0438: {name}",
788
+ assignedTo: "\u0414\u043E\u0440\u0443\u0447\u0435\u043D\u043E: {name}",
789
+ assignedYou: "\u0414\u043E\u0440\u0443\u0447\u0435\u043D\u043E \u0432\u0430\u043C",
769
790
  printLayout: "\u0420\u043E\u0437\u043C\u0456\u0442\u043A\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",
770
791
  cut: "\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438",
771
792
  paste: "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438",
@@ -4714,7 +4735,7 @@ var init_extensions = __esm({
4714
4735
  var version;
4715
4736
  var init_package = __esm({
4716
4737
  "package.json"() {
4717
- version = "0.16.0";
4738
+ version = "0.16.2";
4718
4739
  }
4719
4740
  });
4720
4741
 
@@ -8000,6 +8021,74 @@ var init_live = __esm({
8000
8021
  }
8001
8022
  });
8002
8023
 
8024
+ // src/editor/Mentions.tsx
8025
+ function Mentions({ value: value3, onChange, onSend, people, label, placeholder, autoFocus }) {
8026
+ const field = (0, import_react9.useRef)(null);
8027
+ const [caret, setCaret] = (0, import_react9.useState)(0);
8028
+ const [at2, setAt] = (0, import_react9.useState)(0);
8029
+ const [shut, setShut] = (0, import_react9.useState)(false);
8030
+ const typed = /(?:^|\s)@([\p{L}\p{N}.'-]*)$/u.exec(value3.slice(0, caret));
8031
+ const query = typed?.[1].toLocaleLowerCase() ?? "";
8032
+ const found = typed && !shut ? people.filter((p) => p.name.toLocaleLowerCase().split(/\s+/).some((w) => w.startsWith(query)) || p.name.toLocaleLowerCase().startsWith(query)).slice(0, 6) : [];
8033
+ const choose = (p) => {
8034
+ const start = caret - query.length - 1;
8035
+ const next = `${value3.slice(0, start)}@${p.name} ${value3.slice(caret)}`;
8036
+ const end = start + p.name.length + 2;
8037
+ onChange(next);
8038
+ setCaret(end);
8039
+ requestAnimationFrame(() => field.current?.setSelectionRange(end, end));
8040
+ };
8041
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-mentions", children: [
8042
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
8043
+ "textarea",
8044
+ {
8045
+ ref: field,
8046
+ autoFocus,
8047
+ value: value3,
8048
+ placeholder,
8049
+ "aria-label": label,
8050
+ "aria-autocomplete": "list",
8051
+ "aria-expanded": found.length > 0,
8052
+ onChange: (e) => {
8053
+ onChange(e.target.value);
8054
+ setCaret(e.target.selectionStart);
8055
+ setAt(0);
8056
+ setShut(false);
8057
+ },
8058
+ onClick: (e) => setCaret(e.currentTarget.selectionStart),
8059
+ onKeyUp: (e) => {
8060
+ if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) setCaret(e.currentTarget.selectionStart);
8061
+ },
8062
+ onKeyDown: (e) => {
8063
+ if (found.length && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
8064
+ e.preventDefault();
8065
+ setAt((at2 + (e.key === "ArrowDown" ? 1 : found.length - 1)) % found.length);
8066
+ } else if (found.length && (e.key === "Enter" || e.key === "Tab") && !e.metaKey && !e.ctrlKey) {
8067
+ e.preventDefault();
8068
+ choose(found[Math.min(at2, found.length - 1)]);
8069
+ } else if (found.length && e.key === "Escape") {
8070
+ e.stopPropagation();
8071
+ setShut(true);
8072
+ } else if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) onSend();
8073
+ }
8074
+ }
8075
+ ),
8076
+ found.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-pop w100n-text-menu w100n-text-people-list", role: "listbox", "aria-label": label, children: found.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", role: "option", "aria-selected": i === Math.min(at2, found.length - 1), onMouseDown: (e) => e.preventDefault(), onClick: () => choose(p), children: [
8077
+ p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { className: "w100n-text-face", src: p.avatarUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: p.name.slice(0, 1).toUpperCase() }),
8078
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: p.name })
8079
+ ] }, p.id)) })
8080
+ ] });
8081
+ }
8082
+ var import_react9, import_jsx_runtime6, tagged;
8083
+ var init_Mentions = __esm({
8084
+ "src/editor/Mentions.tsx"() {
8085
+ "use strict";
8086
+ import_react9 = require("react");
8087
+ import_jsx_runtime6 = require("react/jsx-runtime");
8088
+ tagged = (body, people) => people.filter((p) => body.toLocaleLowerCase().includes(`@${p.name.toLocaleLowerCase()}`));
8089
+ }
8090
+ });
8091
+
8003
8092
  // src/editor/TextEditor.tsx
8004
8093
  var TextEditor_exports = {};
8005
8094
  __export(TextEditor_exports, {
@@ -8016,47 +8105,47 @@ function TextEditor({ kind, bytes, t, language, rights, host, together, document
8016
8105
  const live = useLive(together ? host : void 0, documentId, kind, bytes, source.data?.doc, language, can.edit, onSaved);
8017
8106
  const shared = live?.ready ? live.wire : null;
8018
8107
  if (live?.readonly) can.edit = false;
8019
- const baseline = (0, import_react10.useRef)(null);
8020
- const anchors2 = (0, import_react10.useRef)(/* @__PURE__ */ new Map());
8021
- const scroller = (0, import_react10.useRef)(null);
8022
- const root = (0, import_react10.useRef)(null);
8023
- const [pop, setPop] = (0, import_react10.useState)(null);
8024
- const [spot3, setSpot] = (0, import_react10.useState)({ x: 0, y: 0 });
8025
- const touch = (0, import_react10.useRef)(false);
8026
- const [spell, setSpell] = (0, import_react10.useState)(() => typeof localStorage === "undefined" || localStorage.getItem("w100n-docs-spell") !== "0");
8027
- const [dialog, setDialog] = (0, import_react10.useState)(null);
8028
- const field = (0, import_react10.useRef)(null);
8029
- const [more, setMore] = (0, import_react10.useState)(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-more") === "1");
8030
- const [zoom, setZoom] = (0, import_react10.useState)(null);
8031
- const [layout2, setLayout] = (0, import_react10.useState)(null);
8032
- const [room, setRoom] = (0, import_react10.useState)(0);
8033
- const [printed, setPrinted] = (0, import_react10.useState)(null);
8108
+ const baseline = (0, import_react11.useRef)(null);
8109
+ const anchors2 = (0, import_react11.useRef)(/* @__PURE__ */ new Map());
8110
+ const scroller = (0, import_react11.useRef)(null);
8111
+ const root = (0, import_react11.useRef)(null);
8112
+ const [pop, setPop] = (0, import_react11.useState)(null);
8113
+ const [spot3, setSpot] = (0, import_react11.useState)({ x: 0, y: 0 });
8114
+ const touch = (0, import_react11.useRef)(false);
8115
+ const [spell, setSpell] = (0, import_react11.useState)(() => typeof localStorage === "undefined" || localStorage.getItem("w100n-docs-spell") !== "0");
8116
+ const [dialog, setDialog] = (0, import_react11.useState)(null);
8117
+ const field = (0, import_react11.useRef)(null);
8118
+ const [more, setMore] = (0, import_react11.useState)(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-more") === "1");
8119
+ const [zoom, setZoom] = (0, import_react11.useState)(null);
8120
+ const [layout2, setLayout] = (0, import_react11.useState)(null);
8121
+ const [room, setRoom] = (0, import_react11.useState)(0);
8122
+ const [printed, setPrinted] = (0, import_react11.useState)(null);
8034
8123
  const flow = docx2 && !(printed ?? !(room > 0 && room < 640));
8035
- const [saving, setSaving] = (0, import_react10.useState)("idle");
8036
- const [href, setHref] = (0, import_react10.useState)("");
8037
- const [grid3, setGrid] = (0, import_react10.useState)({ rows: 0, cols: 0 });
8038
- const [draft, setDraft] = (0, import_react10.useState)(null);
8039
- const [reply, setReply] = (0, import_react10.useState)(null);
8040
- const [active, setActive] = (0, import_react10.useState)(null);
8041
- const [resolved, setResolved] = (0, import_react10.useState)(false);
8042
- const [posting, setPosting] = (0, import_react10.useState)("idle");
8043
- const [added, setAdded] = (0, import_react10.useState)([]);
8044
- const [changed2, setChanged] = (0, import_react10.useState)({});
8045
- const [editing, setEditing] = (0, import_react10.useState)(null);
8046
- const [dropping, setDropping] = (0, import_react10.useState)(null);
8047
- const [failed, setFailed] = (0, import_react10.useState)(false);
8048
- const [paint2, setPaint] = (0, import_react10.useState)(null);
8049
- const [query, setQuery] = (0, import_react10.useState)("");
8050
- const [swap, setSwap] = (0, import_react10.useState)("");
8051
- const [matchCase, setMatchCase] = (0, import_react10.useState)(false);
8052
- const [count, setCount] = (0, import_react10.useState)({ words: 0, pages: 0 });
8053
- const [marg, setMarg] = (0, import_react10.useState)(null);
8054
- const [unsetup, setUnsetup] = (0, import_react10.useState)(false);
8055
- const [draft2, setDraft2] = (0, import_react10.useState)(null);
8124
+ const [saving, setSaving] = (0, import_react11.useState)("idle");
8125
+ const [href, setHref] = (0, import_react11.useState)("");
8126
+ const [grid3, setGrid] = (0, import_react11.useState)({ rows: 0, cols: 0 });
8127
+ const [draft, setDraft] = (0, import_react11.useState)(null);
8128
+ const [reply, setReply] = (0, import_react11.useState)(null);
8129
+ const [active, setActive] = (0, import_react11.useState)(null);
8130
+ const [resolved, setResolved] = (0, import_react11.useState)(false);
8131
+ const [posting, setPosting] = (0, import_react11.useState)("idle");
8132
+ const [added, setAdded] = (0, import_react11.useState)([]);
8133
+ const [changed2, setChanged] = (0, import_react11.useState)({});
8134
+ const [editing, setEditing] = (0, import_react11.useState)(null);
8135
+ const [dropping, setDropping] = (0, import_react11.useState)(null);
8136
+ const [failed, setFailed] = (0, import_react11.useState)(false);
8137
+ const [paint2, setPaint] = (0, import_react11.useState)(null);
8138
+ const [query, setQuery] = (0, import_react11.useState)("");
8139
+ const [swap, setSwap] = (0, import_react11.useState)("");
8140
+ const [matchCase, setMatchCase] = (0, import_react11.useState)(false);
8141
+ const [count, setCount] = (0, import_react11.useState)({ words: 0, pages: 0 });
8142
+ const [marg, setMarg] = (0, import_react11.useState)(null);
8143
+ const [unsetup, setUnsetup] = (0, import_react11.useState)(false);
8144
+ const [draft2, setDraft2] = (0, import_react11.useState)(null);
8056
8145
  useRestore(pop !== null);
8057
8146
  useRestore(editing !== null);
8058
8147
  useRestore(dropping !== null);
8059
- const editor = (0, import_react9.useEditor)({
8148
+ const editor = (0, import_react10.useEditor)({
8060
8149
  extensions: kit(kind, t, shared),
8061
8150
  content: shared ? null : source.data?.doc ?? null,
8062
8151
  editable: can.edit && (!live || !!shared),
@@ -8067,7 +8156,7 @@ function TextEditor({ kind, bytes, t, language, rights, host, together, document
8067
8156
  if (source.data && !live) baseline.current = { bytes, doc: made2.state.doc, base: source.data.md && track(source.data.md, made2.state.doc) };
8068
8157
  }
8069
8158
  }, [source.data, can.edit, shared]);
8070
- const state = (0, import_react9.useEditorState)({
8159
+ const state = (0, import_react10.useEditorState)({
8071
8160
  editor,
8072
8161
  selector: ({ editor: e }) => {
8073
8162
  if (!e) return null;
@@ -8137,10 +8226,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8137
8226
  setTimeout(() => frame.remove(), 1e3);
8138
8227
  };
8139
8228
  const marginal = marg ?? (source.data && "marginal" in source.data ? source.data.marginal : null) ?? { header: "", footer: "", numbers: false };
8140
- (0, import_react10.useEffect)(() => {
8229
+ (0, import_react11.useEffect)(() => {
8141
8230
  if (editor && docx2 && source.data) editor.view.dispatch(editor.state.tr.setMeta(paging, { page, marks: { header: marginal.header, footer: marginal.footer }, flow }));
8142
8231
  }, [editor, source.data, page, marginal.header, marginal.footer, flow]);
8143
- (0, import_react10.useEffect)(() => {
8232
+ (0, import_react11.useEffect)(() => {
8144
8233
  if (!shared || !docx2) return;
8145
8234
  const map = shared.doc.getMap("setup");
8146
8235
  const sync = () => {
@@ -8153,21 +8242,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8153
8242
  return () => map.unobserve(sync);
8154
8243
  }, [shared, docx2]);
8155
8244
  const loaded = useLoad((signal) => host?.comments ? host.comments(documentId, { signal }) : Promise.resolve([]), [host, documentId]);
8245
+ const crowd = useLoad((signal) => host?.people && can.comment ? host.people(documentId, { signal }) : Promise.resolve([]), [host, documentId]);
8246
+ const people = (crowd.data ?? []).filter((p) => p.id !== host?.me.id);
8156
8247
  const all = [...loaded.data ?? [], ...added].flatMap((c) => c.id in changed2 ? changed2[c.id] ?? [] : [c]).filter((c) => !c.replyTo || changed2[c.replyTo] !== null);
8157
8248
  const open = all.filter((c) => !c.replyTo && !c.resolved);
8158
8249
  const threads = all.filter((c) => !c.replyTo && (resolved || !c.resolved)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
8159
8250
  const openIds = open.map((c) => c.id).join();
8160
- (0, import_react10.useEffect)(() => {
8251
+ (0, import_react11.useEffect)(() => {
8161
8252
  if (!editor || !source.data) return;
8162
8253
  const have = new Map(notes.getState(editor.state).spots.map((s) => [s.id, s]));
8163
8254
  const fresh2 = open.filter((c) => !have.has(c.id));
8164
8255
  const found2 = locate(editor.state.doc, fresh2.map((c) => ({ id: c.id, quote: c.quote, anchor: anchors2.current.get(c.id) })));
8165
8256
  editor.view.dispatch(editor.state.tr.setMeta(notes, { spots: [...open.flatMap((c) => have.get(c.id) ?? []), ...found2] }));
8166
8257
  }, [editor, source.data, openIds]);
8167
- (0, import_react10.useEffect)(() => {
8258
+ (0, import_react11.useEffect)(() => {
8168
8259
  if (editor && source.data) editor.view.dispatch(editor.state.tr.setMeta(notes, { active }));
8169
8260
  }, [editor, source.data, active]);
8170
- (0, import_react10.useEffect)(() => {
8261
+ (0, import_react11.useEffect)(() => {
8171
8262
  if (!editor || !source.data) return;
8172
8263
  let timer = 0;
8173
8264
  let last2 = "";
@@ -8198,7 +8289,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8198
8289
  editor.off("update", later);
8199
8290
  };
8200
8291
  }, [editor, source.data, onOutline]);
8201
- (0, import_react10.useEffect)(() => {
8292
+ (0, import_react11.useEffect)(() => {
8202
8293
  const el = scroller.current;
8203
8294
  if (!el || !editor || !onReading) return;
8204
8295
  let frame = 0;
@@ -8228,32 +8319,32 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8228
8319
  }, [editor, source.data, onReading, documentId]);
8229
8320
  const dirty = live ? live.pending : !!state?.dirty || unsetup;
8230
8321
  const unsent = live ? live.unsynced && can.edit : dirty;
8231
- (0, import_react10.useEffect)(() => {
8322
+ (0, import_react11.useEffect)(() => {
8232
8323
  if (!guard || live || !dirty || !source.data || !editor) return;
8233
8324
  guard.current = save2;
8234
8325
  return () => {
8235
8326
  guard.current = null;
8236
8327
  };
8237
8328
  });
8238
- (0, import_react10.useEffect)(() => {
8329
+ (0, import_react11.useEffect)(() => {
8239
8330
  if (live || !dirty || !can.edit || saving === "busy" || !editor) return;
8240
8331
  const timer = window.setTimeout(() => void save2(true), 3e3);
8241
8332
  return () => clearTimeout(timer);
8242
8333
  });
8243
- (0, import_react10.useEffect)(() => {
8334
+ (0, import_react11.useEffect)(() => {
8244
8335
  if (!unsent) return;
8245
8336
  const stop = (e) => e.preventDefault();
8246
8337
  window.addEventListener("beforeunload", stop);
8247
8338
  return () => window.removeEventListener("beforeunload", stop);
8248
8339
  }, [unsent]);
8249
- (0, import_react10.useEffect)(() => {
8340
+ (0, import_react11.useEffect)(() => {
8250
8341
  const el = scroller.current;
8251
8342
  if (!el || typeof ResizeObserver === "undefined") return;
8252
8343
  const watch = new ResizeObserver(() => setRoom(el.clientWidth));
8253
8344
  watch.observe(el);
8254
8345
  return () => watch.disconnect();
8255
8346
  }, [editor, source.data]);
8256
- (0, import_react10.useEffect)(() => {
8347
+ (0, import_react11.useEffect)(() => {
8257
8348
  const view = window.visualViewport;
8258
8349
  const el = root.current;
8259
8350
  if (!view || !el) return;
@@ -8265,7 +8356,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8265
8356
  view.removeEventListener("scroll", lift);
8266
8357
  };
8267
8358
  }, [editor, source.data]);
8268
- (0, import_react10.useEffect)(() => {
8359
+ (0, import_react11.useEffect)(() => {
8269
8360
  const el = root.current;
8270
8361
  if (!el) return;
8271
8362
  const open2 = () => {
@@ -8275,11 +8366,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8275
8366
  el.addEventListener("docs-find", open2);
8276
8367
  return () => el.removeEventListener("docs-find", open2);
8277
8368
  }, [editor, source.data]);
8278
- (0, import_react10.useEffect)(() => {
8369
+ (0, import_react11.useEffect)(() => {
8279
8370
  const shown = pop === "find" ? query : "";
8280
8371
  if (editor && searching.getState(editor.state).query !== shown) editor.view.dispatch(editor.state.tr.setMeta(searching, { query: shown }));
8281
8372
  }, [editor, pop, query]);
8282
- (0, import_react10.useEffect)(() => {
8373
+ (0, import_react11.useEffect)(() => {
8283
8374
  const press = (e) => {
8284
8375
  if (!(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== "p") return;
8285
8376
  e.preventDefault();
@@ -8289,7 +8380,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8289
8380
  window.addEventListener("keydown", press, true);
8290
8381
  return () => window.removeEventListener("keydown", press, true);
8291
8382
  });
8292
- (0, import_react10.useEffect)(() => {
8383
+ (0, import_react11.useEffect)(() => {
8293
8384
  if (!pop) return;
8294
8385
  const close = (e) => {
8295
8386
  if (!e.target.closest(".w100n-text-pop, [data-pop]")) setPop(null);
@@ -8306,8 +8397,8 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8306
8397
  window.removeEventListener("scroll", off, true);
8307
8398
  };
8308
8399
  }, [pop]);
8309
- if (source.error) return docx2 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DocxView, { bytes, onOutline, failed: t.failed }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
8310
- if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
8400
+ if (source.error) return docx2 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DocxView, { bytes, onOutline, failed: t.failed }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
8401
+ if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
8311
8402
  const save2 = async (auto = false) => {
8312
8403
  if (live) {
8313
8404
  if (!can.edit || !live.ready || !live.online || !live.pending || saving === "busy") return false;
@@ -8371,7 +8462,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8371
8462
  const { from, to, empty } = editor.state.selection;
8372
8463
  if (empty || !can.comment) return;
8373
8464
  editor.view.dispatch(editor.state.tr.setMeta(notes, { pending: { from, to } }));
8374
- setDraft({ quote: editor.state.doc.textBetween(from, to, "\n", " "), body: "" });
8465
+ setDraft({ quote: editor.state.doc.textBetween(from, to, "\n", " "), body: "", give: false });
8375
8466
  setPosting("idle");
8376
8467
  onPanel?.("comments");
8377
8468
  };
@@ -8384,7 +8475,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8384
8475
  setPosting("busy");
8385
8476
  try {
8386
8477
  const anchor = uid2();
8387
- const made2 = await host.comment(documentId, { body: draft.body.trim(), quote: draft.quote, replyTo: null, anchor });
8478
+ const made2 = await host.comment(documentId, { body: draft.body.trim(), quote: draft.quote, replyTo: null, anchor, assignee: draft.give ? tagged(draft.body, people)[0]?.id ?? null : null });
8388
8479
  anchors2.current.set(made2.id, anchor);
8389
8480
  const range = notes.getState(editor.state).pending;
8390
8481
  editor.view.dispatch(editor.state.tr.setMeta(notes, { pending: null, spots: [...notes.getState(editor.state).spots, ...range ? [{ id: made2.id, ...range }] : []] }));
@@ -8482,11 +8573,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8482
8573
  };
8483
8574
  const tool = (icon, label, run3, pressed, disabled) => {
8484
8575
  const Icon = icon;
8485
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
8576
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
8486
8577
  run3();
8487
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { "aria-hidden": true }) });
8578
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { "aria-hidden": true }) });
8488
8579
  };
8489
- const gap = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-pdf-gap" });
8580
+ const gap = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-pdf-gap" });
8490
8581
  const known = source.data.styles;
8491
8582
  const named3 = (test) => {
8492
8583
  const name = known.find(test)?.name;
@@ -8505,28 +8596,28 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8505
8596
  ];
8506
8597
  const margins = [[t.marginsNormal, [96, 96, 96, 96]], [t.marginsNarrow, [48, 48, 48, 48]], [t.marginsWide, [96, 192, 96, 192]]];
8507
8598
  const when = (iso) => new Intl.DateTimeFormat(language, { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso));
8508
- const person = (c) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
8509
- c.author.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { className: "w100n-text-face", src: c.author.avatarUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: c.author.name.slice(0, 1).toUpperCase() }),
8510
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-who", children: [
8511
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("b", { children: [
8599
+ const person = (c) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { children: [
8600
+ c.author.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { className: "w100n-text-face", src: c.author.avatarUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: c.author.name.slice(0, 1).toUpperCase() }),
8601
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-who", children: [
8602
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("b", { children: [
8512
8603
  c.author.name,
8513
- c.author.id.startsWith("guest:") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-docs-badge", children: t.guest })
8604
+ c.author.id.startsWith("guest:") && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-docs-badge", children: t.guest })
8514
8605
  ] }),
8515
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: when(c.createdAt) })
8606
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: when(c.createdAt) })
8516
8607
  ] }),
8517
- drops(c) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-own", onClick: (e) => e.stopPropagation(), children: [
8518
- mine(c) && host.editComment && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": t.editComment, title: t.editComment, onClick: () => {
8608
+ drops(c) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-own", onClick: (e) => e.stopPropagation(), children: [
8609
+ mine(c) && host.editComment && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": t.editComment, title: t.editComment, onClick: () => {
8519
8610
  setDropping(null);
8520
8611
  setEditing({ id: c.id, body: c.body });
8521
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Pencil, { "aria-hidden": true }) }),
8522
- host.deleteComment && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-tone": "red", "aria-label": t.delete, title: t.delete, onClick: () => {
8612
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Pencil, { "aria-hidden": true }) }),
8613
+ host.deleteComment && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-tone": "red", "aria-label": t.delete, title: t.delete, onClick: () => {
8523
8614
  setEditing(null);
8524
8615
  setDropping(c.id);
8525
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Trash2, { "aria-hidden": true }) })
8616
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Trash2, { "aria-hidden": true }) })
8526
8617
  ] })
8527
8618
  ] });
8528
- const words3 = (c) => editing?.id === c.id ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-reply w100n-text-edit", onClick: (e) => e.stopPropagation(), children: [
8529
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
8619
+ const words3 = (c) => editing?.id === c.id ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-reply w100n-text-edit", onClick: (e) => e.stopPropagation(), children: [
8620
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
8530
8621
  "textarea",
8531
8622
  {
8532
8623
  autoFocus: true,
@@ -8538,33 +8629,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8538
8629
  }
8539
8630
  }
8540
8631
  ),
8541
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
8542
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setEditing(null), children: t.cancel }),
8543
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !editing.body.trim() || editing.body.trim() === c.body || posting === "busy", onClick: () => void change(c.id, editing.body.trim()), children: [
8544
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Save, { "aria-hidden": true }),
8632
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
8633
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setEditing(null), children: t.cancel }),
8634
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !editing.body.trim() || editing.body.trim() === c.body || posting === "busy", onClick: () => void change(c.id, editing.body.trim()), children: [
8635
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Save, { "aria-hidden": true }),
8545
8636
  t.save
8546
8637
  ] })
8547
8638
  ] })
8548
- ] }) : dropping === c.id ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-confirm", role: "group", "aria-label": t.delete, onClick: (e) => e.stopPropagation(), children: [
8549
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: c.replyTo || !all.some((r) => r.replyTo === c.id) ? t.deleteAsk : t.deleteThread }),
8550
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
8551
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", autoFocus: true, onClick: () => setDropping(null), children: t.cancel }),
8552
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: posting === "busy", onClick: () => void change(c.id, null), children: [
8553
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Trash2, { "aria-hidden": true }),
8639
+ ] }) : dropping === c.id ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-confirm", role: "group", "aria-label": t.delete, onClick: (e) => e.stopPropagation(), children: [
8640
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: c.replyTo || !all.some((r) => r.replyTo === c.id) ? t.deleteAsk : t.deleteThread }),
8641
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
8642
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", autoFocus: true, onClick: () => setDropping(null), children: t.cancel }),
8643
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: posting === "busy", onClick: () => void change(c.id, null), children: [
8644
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Trash2, { "aria-hidden": true }),
8554
8645
  t.delete
8555
8646
  ] })
8556
8647
  ] })
8557
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: c.body });
8648
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: c.body });
8558
8649
  const pick = (next) => setPop(pop === next ? null : next);
8559
- const swatches = (list, current, set, none) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-swatches", role: "group", children: [
8560
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-text-none", onClick: () => {
8650
+ const swatches = (list, current, set, none) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-swatches", role: "group", children: [
8651
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-text-none", onClick: () => {
8561
8652
  set(null);
8562
8653
  setPop(null);
8563
8654
  }, children: none }),
8564
- list.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": c, "aria-pressed": current === c, onClick: () => {
8655
+ list.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": c, "aria-pressed": current === c, onClick: () => {
8565
8656
  set(c);
8566
8657
  setPop(null);
8567
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { style: { background: c } }) }, i))
8658
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { style: { background: c } }) }, i))
8568
8659
  ] });
8569
8660
  const mod = /Mac|iPhone|iPad/.test(navigator.platform) ? "\u2318" : "Ctrl+";
8570
8661
  const item = (label, run3, more2 = {}) => ({ label, run: run3, ...more2 });
@@ -8582,9 +8673,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8582
8673
  item(t.print, print, { keys: `${mod}P` }),
8583
8674
  ...docx2 ? ["-", item(t.pageSetup, () => setDraft2({ width: page.width, height: page.height, margins: page.margins.map(cm), ...marginal }))] : []
8584
8675
  ] : [],
8585
- ...can.edit && (file?.formats.length || file?.copy || file?.rename) ? ["-"] : [],
8676
+ ...can.edit && (file?.formats.length || file?.copy || file?.rename || file?.template) ? ["-"] : [],
8586
8677
  ...(file?.formats ?? []).map((f) => item(`${t.downloadAs} ${f === "md" ? "Markdown" : f.toUpperCase()}`, () => file.download(f))),
8587
8678
  !!file?.copy && item(t.makeCopy, file.copy),
8679
+ !!file?.template && item(t.saveTemplate, file.template),
8588
8680
  !!file?.rename && item(t.rename, file.rename)
8589
8681
  ]],
8590
8682
  ["edit", t.menuEdit, can.edit ? [
@@ -8689,17 +8781,17 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8689
8781
  item(t.deleteColumn, () => editor.chain().focus().deleteColumn().run())
8690
8782
  ] : []
8691
8783
  ];
8692
- const rows = (list) => list.filter((x) => x !== false).filter((x, i, all2) => x !== "-" || i > 0 && all2[i - 1] !== "-" && i < all2.length - 1).map((x, i) => x === "-" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("hr", {}, i) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", role: x.on === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": x.on, disabled: x.off, onClick: () => {
8784
+ const rows = (list) => list.filter((x) => x !== false).filter((x, i, all2) => x !== "-" || i > 0 && all2[i - 1] !== "-" && i < all2.length - 1).map((x, i) => x === "-" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("hr", {}, i) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", role: x.on === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": x.on, disabled: x.off, onClick: () => {
8693
8785
  setPop(null);
8694
8786
  x.run();
8695
8787
  }, children: [
8696
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
8697
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: x.label }),
8698
- x.keys && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("kbd", { children: x.keys })
8788
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
8789
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: x.label }),
8790
+ x.keys && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("kbd", { children: x.keys })
8699
8791
  ] }, i));
8700
- const menu = ([key2, label, list]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8701
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-text-menu-button", "data-pop": true, "aria-haspopup": "menu", "aria-expanded": pop === key2, onClick: () => pick(key2), children: label }),
8702
- pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-pop w100n-text-menu", role: "menu", "aria-label": label, children: rows(list) })
8792
+ const menu = ([key2, label, list]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8793
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-text-menu-button", "data-pop": true, "aria-haspopup": "menu", "aria-expanded": pop === key2, onClick: () => pick(key2), children: label }),
8794
+ pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-pop w100n-text-menu", role: "menu", "aria-label": label, children: rows(list) })
8703
8795
  ] }, key2);
8704
8796
  const seek = (next) => {
8705
8797
  editor.view.dispatch(editor.state.tr.setMeta(searching, next));
@@ -8711,11 +8803,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8711
8803
  }
8712
8804
  };
8713
8805
  const found = searching.getState(editor.state);
8714
- const finder = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8715
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "find", "aria-label": t.findReplace, title: t.findReplace, onClick: () => pick("find"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Search, { "aria-hidden": true }) }),
8716
- pop === "find" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-find", role: "search", "aria-label": t.findReplace, children: [
8717
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-docs-row", children: [
8718
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
8806
+ const finder = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8807
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "find", "aria-label": t.findReplace, title: t.findReplace, onClick: () => pick("find"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Search, { "aria-hidden": true }) }),
8808
+ pop === "find" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-find", role: "search", "aria-label": t.findReplace, children: [
8809
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-docs-row", children: [
8810
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
8719
8811
  "input",
8720
8812
  {
8721
8813
  autoFocus: true,
@@ -8735,23 +8827,27 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8735
8827
  }
8736
8828
  }
8737
8829
  ),
8738
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
8739
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": t.previous, title: t.previous, disabled: !found?.hits.length, onClick: () => seek({ at: found.at - 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronUp, { "aria-hidden": true }) }),
8740
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": t.next, title: t.next, disabled: !found?.hits.length, onClick: () => seek({ at: found.at + 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true }) })
8830
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-find-end", children: [
8831
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
8832
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": t.previous, title: t.previous, disabled: !found?.hits.length, onClick: () => seek({ at: found.at - 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronUp, { "aria-hidden": true }) }),
8833
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": t.next, title: t.next, disabled: !found?.hits.length, onClick: () => seek({ at: found.at + 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true }) })
8834
+ ] })
8741
8835
  ] }),
8742
- can.edit && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-docs-row", children: [
8743
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
8744
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
8745
- replace(editor, swap, false);
8746
- seek({});
8747
- }, children: t.replaceOne }),
8748
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
8749
- replace(editor, swap, true);
8750
- seek({});
8751
- }, children: t.replaceAll })
8836
+ can.edit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-docs-row", children: [
8837
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
8838
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-find-end", children: [
8839
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
8840
+ replace(editor, swap, false);
8841
+ seek({});
8842
+ }, children: t.replaceOne }),
8843
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
8844
+ replace(editor, swap, true);
8845
+ seek({});
8846
+ }, children: t.replaceAll })
8847
+ ] })
8752
8848
  ] }),
8753
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-setup-check", children: [
8754
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
8849
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-setup-check", children: [
8850
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
8755
8851
  setMatchCase(e.target.checked);
8756
8852
  seek({ matchCase: e.target.checked, at: 0 });
8757
8853
  } }),
@@ -8776,47 +8872,47 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8776
8872
  spacing(editor, { line: paint2.block.line, after: paint2.block.after });
8777
8873
  if (!paint2.keep) setPaint(null);
8778
8874
  };
8779
- const fontPicker = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8780
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "font", "aria-label": t.font, title: t.font, onClick: () => pick("font"), children: [
8781
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
8782
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8875
+ const fontPicker = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8876
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "font", "aria-label": t.font, title: t.font, onClick: () => pick("font"), children: [
8877
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
8878
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8783
8879
  ] }),
8784
- pop === "font" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
8785
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
8880
+ pop === "font" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
8881
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
8786
8882
  editor.chain().focus().unsetFontFamily().run();
8787
8883
  setPop(null);
8788
8884
  }, children: t.defaultFont }),
8789
- faces.map((f) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
8885
+ faces.map((f) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
8790
8886
  editor.chain().focus().setFontFamily(f).run();
8791
8887
  setPop(null);
8792
8888
  }, children: f }, f))
8793
8889
  ] })
8794
8890
  ] });
8795
- const sizePicker = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8796
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "size", "aria-label": t.fontSize, title: t.fontSize, onClick: () => pick("size"), children: [
8891
+ const sizePicker = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8892
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "size", "aria-label": t.fontSize, title: t.fontSize, onClick: () => pick("size"), children: [
8797
8893
  state.size ? parseFloat(state.size) : t.defaultFont,
8798
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8894
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8799
8895
  ] }),
8800
- pop === "size" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
8801
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
8896
+ pop === "size" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
8897
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
8802
8898
  editor.chain().focus().unsetFontSize().run();
8803
8899
  setPop(null);
8804
8900
  }, children: t.defaultFont }),
8805
- sizes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
8901
+ sizes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
8806
8902
  editor.chain().focus().setFontSize(`${n}pt`).run();
8807
8903
  setPop(null);
8808
8904
  }, children: n }, n))
8809
8905
  ] })
8810
8906
  ] });
8811
- const spacer = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8812
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "spacing", "aria-label": t.lineSpacing, title: t.lineSpacing, onClick: () => pick("spacing"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.UnfoldVertical, { "aria-hidden": true }) }),
8813
- pop === "spacing" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
8814
- lines2.map(([v, label]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
8907
+ const spacer = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8908
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "spacing", "aria-label": t.lineSpacing, title: t.lineSpacing, onClick: () => pick("spacing"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.UnfoldVertical, { "aria-hidden": true }) }),
8909
+ pop === "spacing" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
8910
+ lines2.map(([v, label]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
8815
8911
  spacing(editor, { line: v });
8816
8912
  setPop(null);
8817
8913
  }, children: label }, v)),
8818
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("hr", {}),
8819
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
8914
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("hr", {}),
8915
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
8820
8916
  spacing(editor, { after: state.after === 0 ? 8 : 0 });
8821
8917
  setPop(null);
8822
8918
  }, children: state.after === 0 ? t.spaceAfter : t.noSpaceAfter })
@@ -8839,18 +8935,18 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8839
8935
  setDraft2(null);
8840
8936
  };
8841
8937
  const zooms = [50, 75, 90, 100, 125, 150, 200];
8842
- const zoomer = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8843
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "zoom", "aria-label": t.zoom, title: t.zoom, onClick: () => pick("zoom"), children: [
8938
+ const zoomer = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8939
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "zoom", "aria-label": t.zoom, title: t.zoom, onClick: () => pick("zoom"), children: [
8844
8940
  percent,
8845
8941
  "%",
8846
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8942
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8847
8943
  ] }),
8848
- pop === "zoom" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
8849
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
8944
+ pop === "zoom" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
8945
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
8850
8946
  setZoom(null);
8851
8947
  setPop(null);
8852
8948
  }, children: t.fitWidth }),
8853
- zooms.map((z) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
8949
+ zooms.map((z) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
8854
8950
  setZoom(z);
8855
8951
  setPop(null);
8856
8952
  }, children: [
@@ -8860,9 +8956,9 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8860
8956
  ] })
8861
8957
  ] });
8862
8958
  const Aligned = aligns.find(([, , value3]) => value3 === state.align)?.[0] ?? import_lucide_react5.AlignLeft;
8863
- const aligner = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8864
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "align", "aria-label": t.align, title: t.align, onClick: () => pick("align"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Aligned, { "aria-hidden": true }) }),
8865
- pop === "align" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-pop", role: "group", "aria-label": t.align, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-tools", children: aligns.map(([icon, label, value3], i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react10.Fragment, { children: tool(icon, label, () => {
8959
+ const aligner = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8960
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "align", "aria-label": t.align, title: t.align, onClick: () => pick("align"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Aligned, { "aria-hidden": true }) }),
8961
+ pop === "align" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-pop", role: "group", "aria-label": t.align, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-tools", children: aligns.map(([icon, label, value3], i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react11.Fragment, { children: tool(icon, label, () => {
8866
8962
  align2(editor, value3);
8867
8963
  setPop(null);
8868
8964
  }, state.align === value3) }, i)) }) })
@@ -8871,13 +8967,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8871
8967
  localStorage.setItem("w100n-docs-more", more ? "" : "1");
8872
8968
  setMore(!more);
8873
8969
  };
8874
- const main = can.edit ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
8875
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8876
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "style", "aria-label": t.paragraphStyle, title: t.paragraphStyle, onClick: () => pick("style"), children: [
8970
+ const main = can.edit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
8971
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8972
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "style", "aria-label": t.paragraphStyle, title: t.paragraphStyle, onClick: () => pick("style"), children: [
8877
8973
  styles2.find(([key2]) => key2 === state.style)?.[1] ?? t.normal,
8878
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8974
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true })
8879
8975
  ] }),
8880
- pop === "style" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.paragraphStyle, children: styles2.map(([key2, label, run3]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
8976
+ pop === "style" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.paragraphStyle, children: styles2.map(([key2, label, run3]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
8881
8977
  "button",
8882
8978
  {
8883
8979
  type: "button",
@@ -8898,10 +8994,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8898
8994
  tool(import_lucide_react5.Italic, t.italic, () => editor.chain().focus().toggleItalic().run(), state.italic),
8899
8995
  docx2 ? tool(import_lucide_react5.Underline, t.underline, () => editor.chain().focus().toggleUnderline().run(), state.underline) : tool(import_lucide_react5.Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
8900
8996
  !docx2 && tool(import_lucide_react5.Code, t.code, () => editor.chain().focus().toggleCode().run(), state.code),
8901
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8902
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
8903
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Baseline, { "aria-hidden": true }),
8904
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
8997
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
8998
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
8999
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Baseline, { "aria-hidden": true }),
9000
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
8905
9001
  ] }),
8906
9002
  pop === "color" && swatches(inks, state.color, (c) => c ? editor.chain().focus().setColor(c).run() : editor.chain().focus().unsetColor().run(), t.automatic)
8907
9003
  ] }),
@@ -8911,35 +9007,35 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8911
9007
  tool(import_lucide_react5.ListOrdered, t.numbers, () => editor.chain().focus().toggleOrderedList().run(), state.numbers),
8912
9008
  !docx2 && tool(import_lucide_react5.ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
8913
9009
  gap,
8914
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8915
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "link", "aria-pressed": state.link, "aria-label": t.link, title: t.link, onClick: () => pop === "link" ? setPop(null) : linkUp(), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Link, { "aria-hidden": true }) }),
8916
- pop === "link" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
8917
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
9010
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
9011
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "link", "aria-pressed": state.link, "aria-label": t.link, title: t.link, onClick: () => pop === "link" ? setPop(null) : linkUp(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Link, { "aria-hidden": true }) }),
9012
+ pop === "link" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
9013
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
8918
9014
  if (e.key === "Enter") putLink();
8919
9015
  } }),
8920
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-docs-row", children: [
8921
- state.link && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
9016
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-docs-row", children: [
9017
+ state.link && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
8922
9018
  editor.chain().focus().extendMarkRange("link").unsetLink().run();
8923
9019
  setPop(null);
8924
9020
  }, children: [
8925
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Link2Off, { "aria-hidden": true }),
9021
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Link2Off, { "aria-hidden": true }),
8926
9022
  t.unlink
8927
9023
  ] }),
8928
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
8929
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Link, { "aria-hidden": true }),
9024
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
9025
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Link, { "aria-hidden": true }),
8930
9026
  t.apply
8931
9027
  ] })
8932
9028
  ] })
8933
9029
  ] })
8934
9030
  ] }),
8935
9031
  can.comment && tool(import_lucide_react5.MessageSquarePlus, t.addComment, begin, void 0, state.empty),
8936
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8937
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
9032
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
9033
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
8938
9034
  setHref("");
8939
9035
  pick("image");
8940
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ImagePlus, { "aria-hidden": true }) }),
8941
- pop === "image" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
8942
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9036
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ImagePlus, { "aria-hidden": true }) }),
9037
+ pop === "image" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
9038
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
8943
9039
  "input",
8944
9040
  {
8945
9041
  autoFocus: true,
@@ -8955,10 +9051,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8955
9051
  }
8956
9052
  }
8957
9053
  ),
8958
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-docs-row", children: [
8959
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-pdf-link", children: [
9054
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-docs-row", children: [
9055
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-pdf-link", children: [
8960
9056
  t.chooseFile,
8961
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
9057
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
8962
9058
  const file2 = e.target.files?.[0];
8963
9059
  if (!file2) return;
8964
9060
  const reader = new FileReader();
@@ -8969,23 +9065,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
8969
9065
  reader.readAsDataURL(file2);
8970
9066
  } })
8971
9067
  ] }),
8972
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
9068
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
8973
9069
  editor.chain().focus().setImage({ src: href.trim() }).run();
8974
9070
  setPop(null);
8975
9071
  }, children: [
8976
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ImagePlus, { "aria-hidden": true }),
9072
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ImagePlus, { "aria-hidden": true }),
8977
9073
  t.put
8978
9074
  ] })
8979
9075
  ] })
8980
9076
  ] })
8981
9077
  ] }),
8982
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
8983
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "table", "aria-label": t.table, title: t.table, onClick: () => pick("table"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Table, { "aria-hidden": true }) }),
8984
- pop === "table" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-grid", role: "group", "aria-label": t.table, onPointerLeave: () => setGrid({ rows: 0, cols: 0 }), children: [
8985
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: Array.from({ length: 48 }, (_, i) => {
9078
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
9079
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "table", "aria-label": t.table, title: t.table, onClick: () => pick("table"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Table, { "aria-hidden": true }) }),
9080
+ pop === "table" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-grid", role: "group", "aria-label": t.table, onPointerLeave: () => setGrid({ rows: 0, cols: 0 }), children: [
9081
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: Array.from({ length: 48 }, (_, i) => {
8986
9082
  const rows2 = Math.floor(i / 8) + 1;
8987
9083
  const cols = i % 8 + 1;
8988
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9084
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
8989
9085
  "button",
8990
9086
  {
8991
9087
  type: "button",
@@ -9000,31 +9096,31 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9000
9096
  i
9001
9097
  );
9002
9098
  }) }),
9003
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: grid3.rows ? `${grid3.rows} \xD7 ${grid3.cols}` : t.table })
9099
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: grid3.rows ? `${grid3.rows} \xD7 ${grid3.cols}` : t.table })
9004
9100
  ] })
9005
9101
  ] }),
9006
9102
  gap,
9007
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-expanded": more, "aria-label": more ? t.fewerTools : t.moreTools, title: more ? t.fewerTools : t.moreTools, onClick: widen, children: more ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ChevronUp, { "aria-hidden": true }) })
9008
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9009
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
9010
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.ListTree, { "aria-hidden": true }),
9103
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-expanded": more, "aria-label": more ? t.fewerTools : t.moreTools, title: more ? t.fewerTools : t.moreTools, onClick: widen, children: more ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ChevronUp, { "aria-hidden": true }) })
9104
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9105
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
9106
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.ListTree, { "aria-hidden": true }),
9011
9107
  t.outline
9012
9108
  ] }),
9013
- can.comment && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9014
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-grow" }),
9015
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
9016
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.MessageSquarePlus, { "aria-hidden": true }),
9109
+ can.comment && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9110
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-grow" }),
9111
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
9112
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.MessageSquarePlus, { "aria-hidden": true }),
9017
9113
  t.addComment
9018
9114
  ] })
9019
9115
  ] }),
9020
- !!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
9021
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.MessagesSquare, { "aria-hidden": true }),
9116
+ !!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
9117
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.MessagesSquare, { "aria-hidden": true }),
9022
9118
  t.comments,
9023
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: open.length })
9119
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: open.length })
9024
9120
  ] })
9025
9121
  ] });
9026
- const extra = can.edit && more && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9027
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9122
+ const extra = can.edit && more && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9123
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9028
9124
  fontPicker,
9029
9125
  sizePicker,
9030
9126
  gap
@@ -9032,11 +9128,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9032
9128
  docx2 && tool(import_lucide_react5.Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
9033
9129
  docx2 && tool(import_lucide_react5.Superscript, t.superscript, () => editor.chain().focus().toggleMark("superscript").run(), state.sup),
9034
9130
  docx2 && tool(import_lucide_react5.Subscript, t.subscript, () => editor.chain().focus().toggleMark("subscript").run(), state.sub),
9035
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
9036
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "mark", "aria-pressed": state.glow, "aria-label": t.highlight, title: t.highlight, onClick: () => pick("mark"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Highlighter, { "aria-hidden": true }) }),
9131
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
9132
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "mark", "aria-pressed": state.glow, "aria-label": t.highlight, title: t.highlight, onClick: () => pick("mark"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Highlighter, { "aria-hidden": true }) }),
9037
9133
  pop === "mark" && swatches(glows, null, (c) => c ? editor.chain().focus().setHighlight({ color: c }).run() : editor.chain().focus().unsetHighlight().run(), t.noColour)
9038
9134
  ] }),
9039
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9135
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9040
9136
  gap,
9041
9137
  spacer
9042
9138
  ] }),
@@ -9044,24 +9140,24 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9044
9140
  tool(import_lucide_react5.ListIndentIncrease, t.indent, () => indent(editor, 1)),
9045
9141
  docx2 && tool(import_lucide_react5.ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
9046
9142
  gap,
9047
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": t.painter, title: paint2 ? t.painterHint : t.painter, "aria-pressed": !!paint2, onClick: () => take(false), onDoubleClick: () => take(true), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.PaintRoller, { "aria-hidden": true }) }),
9143
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": t.painter, title: paint2 ? t.painterHint : t.painter, "aria-pressed": !!paint2, onClick: () => take(false), onDoubleClick: () => take(true), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.PaintRoller, { "aria-hidden": true }) }),
9048
9144
  tool(import_lucide_react5.RemoveFormatting, t.clearFormat, () => clear(editor)),
9049
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9145
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9050
9146
  gap,
9051
9147
  tool(import_lucide_react5.FilePenLine, t.suggest, suggest, state.suggest)
9052
9148
  ] })
9053
9149
  ] });
9054
- const context = can.edit && (state.table ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9150
+ const context = can.edit && (state.table ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9055
9151
  tool(import_lucide_react5.BetweenHorizontalStart, t.rowAbove, () => editor.chain().focus().addRowBefore().run()),
9056
9152
  tool(import_lucide_react5.BetweenHorizontalEnd, t.rowBelow, () => editor.chain().focus().addRowAfter().run()),
9057
9153
  tool(import_lucide_react5.BetweenVerticalStart, t.columnLeft, () => editor.chain().focus().addColumnBefore().run()),
9058
9154
  tool(import_lucide_react5.BetweenVerticalEnd, t.columnRight, () => editor.chain().focus().addColumnAfter().run()),
9059
9155
  tool(import_lucide_react5.PanelTop, t.headerRow, () => editor.chain().focus().toggleHeaderRow().run()),
9060
9156
  docx2 && tool(import_lucide_react5.TableCellsMerge, t.mergeCells, () => editor.chain().focus().mergeOrSplit().run()),
9061
- docx2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-anchor", children: [
9062
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
9063
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.PaintBucket, { "aria-hidden": true }),
9064
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
9157
+ docx2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-anchor", children: [
9158
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
9159
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.PaintBucket, { "aria-hidden": true }),
9160
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
9065
9161
  ] }),
9066
9162
  pop === "fill" && swatches(glows, state.fill, (c) => editor.chain().focus().setCellAttribute("background", c).run(), t.noColour)
9067
9163
  ] }),
@@ -9069,33 +9165,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9069
9165
  tool(import_lucide_react5.TableRowsSplit, t.deleteRow, () => editor.chain().focus().deleteRow().run()),
9070
9166
  tool(import_lucide_react5.TableColumnsSplit, t.deleteColumn, () => editor.chain().focus().deleteColumn().run()),
9071
9167
  tool(import_lucide_react5.Trash2, t.deleteTable, () => editor.chain().focus().deleteTable().run())
9072
- ] }) : state.img && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: [[import_lucide_react5.Image, t.wrapInline, "inline"], [import_lucide_react5.PanelLeft, t.wrapLeft, "left"], [import_lucide_react5.PanelRight, t.wrapRight, "right"]].map(([icon, label, value3]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react10.Fragment, { children: tool(icon, label, () => editor.chain().focus().updateAttributes("image", { wrap: value3 === "inline" ? null : value3 }).run(), state.img === value3) }, value3)) }));
9073
- const status = (can.edit || live) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-end", children: [
9074
- live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
9075
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.WifiOff, { "aria-hidden": true }),
9168
+ ] }) : state.img && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: [[import_lucide_react5.Image, t.wrapInline, "inline"], [import_lucide_react5.PanelLeft, t.wrapLeft, "left"], [import_lucide_react5.PanelRight, t.wrapRight, "right"]].map(([icon, label, value3]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react11.Fragment, { children: tool(icon, label, () => editor.chain().focus().updateAttributes("image", { wrap: value3 === "inline" ? null : value3 }).run(), state.img === value3) }, value3)) }));
9169
+ const status = (can.edit || live) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-end", children: [
9170
+ live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
9171
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.WifiOff, { "aria-hidden": true }),
9076
9172
  live.denied ? t.liveOff : t.offline
9077
9173
  ] }),
9078
- state.suggest && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-docs-badge", children: t.suggesting }),
9079
- can.edit && saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save2(), children: [
9080
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.CloudAlert, { "aria-hidden": true }),
9081
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: t.saveFailed })
9174
+ state.suggest && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-docs-badge", children: t.suggesting }),
9175
+ can.edit && saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save2(), children: [
9176
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.CloudAlert, { "aria-hidden": true }),
9177
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t.saveFailed })
9082
9178
  ] }),
9083
- live && live.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: live.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) })
9179
+ live && live.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: live.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) })
9084
9180
  ] });
9085
- const menubar = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-menus", role: "menubar", "aria-label": t.textTools, children: menus.filter(([, , list]) => list.some((x) => x && x !== "-")).map(menu) });
9181
+ const menubar = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-menus", role: "menubar", "aria-label": t.textTools, children: menus.filter(([, , list]) => list.some((x) => x && x !== "-")).map(menu) });
9086
9182
  const keep = (e) => {
9087
9183
  if (e.target.closest("button")) e.preventDefault();
9088
9184
  };
9089
9185
  const sheet2 = docx2 ? { "--page-w": `${page.width}px`, "--page-h": `${page.height}px`, "--mt": `${page.margins[0]}px`, "--mr": `${page.margins[1]}px`, "--mb": `${page.margins[2]}px`, "--ml": `${page.margins[3]}px` } : void 0;
9090
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys2, children: [
9091
- head2 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9092
- head2.menus && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head2.menus),
9093
- head2.status && status && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head2.status)
9094
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
9186
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys2, children: [
9187
+ head2 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9188
+ head2.menus && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head2.menus),
9189
+ head2.status && status && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head2.status)
9190
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
9095
9191
  menubar,
9096
9192
  status
9097
9193
  ] }),
9098
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint2, onMouseUp: lay, onPointerDown: (e) => {
9194
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint2, onMouseUp: lay, onPointerDown: (e) => {
9099
9195
  touch.current = e.pointerType === "touch";
9100
9196
  }, onContextMenu: (e) => {
9101
9197
  if (touch.current || e.shiftKey || pop === "context" || !e.target.closest(".ProseMirror")) return setPop(null);
@@ -9118,49 +9214,49 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9118
9214
  if (!id) return;
9119
9215
  setActive(id);
9120
9216
  onPanel?.("comments");
9121
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-zoomed", style: { zoom: percent / 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: docx2 ? `w100n-text-sheet${flow ? " is-flow" : ""}` : "w100n-docs-page w100n-text-column", style: sheet2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react9.EditorContent, { editor }) }) }) }),
9122
- pop === "context" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-pop w100n-text-menu w100n-text-context", role: "menu", "aria-label": t.textTools, style: { left: spot3.x, top: spot3.y }, onPointerDown: keep, children: [
9217
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-zoomed", style: { zoom: percent / 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: docx2 ? `w100n-text-sheet${flow ? " is-flow" : ""}` : "w100n-docs-page w100n-text-column", style: sheet2, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react10.EditorContent, { editor }) }) }) }),
9218
+ pop === "context" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-pop w100n-text-menu w100n-text-context", role: "menu", "aria-label": t.textTools, style: { left: spot3.x, top: spot3.y }, onPointerDown: keep, children: [
9123
9219
  rows(near),
9124
- spell && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { className: "w100n-text-hint", children: t.spellHint })
9220
+ spell && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { className: "w100n-text-hint", children: t.spellHint })
9125
9221
  ] }),
9126
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "left", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.zoom, children: [
9222
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "left", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.zoom, children: [
9127
9223
  tool(import_lucide_react5.Minus, t.zoomOut, () => zoomBy(-10)),
9128
9224
  zoomer,
9129
9225
  tool(import_lucide_react5.Plus, t.zoomIn, () => zoomBy(10))
9130
9226
  ] }) }),
9131
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
9132
- context && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
9133
- extra && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
9134
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
9227
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
9228
+ context && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
9229
+ extra && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
9230
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
9135
9231
  ] }),
9136
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "right", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.findReplace, children: [
9137
- can.edit && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9232
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "right", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.findReplace, children: [
9233
+ can.edit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9138
9234
  tool(import_lucide_react5.Undo2, t.undo, () => editor.chain().focus().undo().run(), void 0, !state.undo),
9139
9235
  tool(import_lucide_react5.Redo2, t.redo, () => editor.chain().focus().redo().run(), void 0, !state.redo),
9140
9236
  gap
9141
9237
  ] }),
9142
9238
  finder
9143
9239
  ] }) }),
9144
- dialog && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
9240
+ dialog && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
9145
9241
  if (e.key === "Escape") {
9146
9242
  e.stopPropagation();
9147
9243
  setDialog(null);
9148
9244
  }
9149
- }, children: dialog.kind === "symbol" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
9150
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-new-head", children: [
9151
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Omega, { "aria-hidden": true }) }),
9152
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
9153
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9245
+ }, children: dialog.kind === "symbol" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
9246
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-new-head", children: [
9247
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Omega, { "aria-hidden": true }) }),
9248
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
9249
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9154
9250
  ] }),
9155
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
9156
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Search, { "aria-hidden": true }),
9157
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { autoFocus: true, value: dialog.query, placeholder: t.symbolSearch, "aria-label": t.symbolSearch, onChange: (e) => setDialog({ kind: "symbol", query: e.target.value }) })
9251
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
9252
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Search, { "aria-hidden": true }),
9253
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { autoFocus: true, value: dialog.query, placeholder: t.symbolSearch, "aria-label": t.symbolSearch, onChange: (e) => setDialog({ kind: "symbol", query: e.target.value }) })
9158
9254
  ] }),
9159
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-insert-grid", role: "group", "aria-label": t.symbols, children: symbols.filter(([ch, name]) => !dialog.query.trim() || name.includes(dialog.query.trim().toLowerCase()) || ch === dialog.query.trim()).map(([ch, name]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-label": name, title: name, onClick: () => {
9255
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-insert-grid", role: "group", "aria-label": t.symbols, children: symbols.filter(([ch, name]) => !dialog.query.trim() || name.includes(dialog.query.trim().toLowerCase()) || ch === dialog.query.trim()).map(([ch, name]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": name, title: name, onClick: () => {
9160
9256
  editor.chain().focus().insertContent(ch).run();
9161
9257
  setDialog(null);
9162
9258
  }, children: ch }, ch)) })
9163
- ] }) : dialog.kind === "formula" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
9259
+ ] }) : dialog.kind === "formula" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
9164
9260
  e.preventDefault();
9165
9261
  const latex = dialog.latex.trim();
9166
9262
  if (!latex) return;
@@ -9171,13 +9267,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9171
9267
  else editor.chain().focus().insertContent({ type: "math", attrs: { latex } }).run();
9172
9268
  setDialog(null);
9173
9269
  }, children: [
9174
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-new-head", children: [
9175
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Sigma, { "aria-hidden": true }) }),
9176
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
9177
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9270
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-new-head", children: [
9271
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Sigma, { "aria-hidden": true }) }),
9272
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
9273
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9178
9274
  ] }),
9179
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { ref: field, autoFocus: true, className: "w100n-insert-latex", value: dialog.latex, "aria-label": t.formula, placeholder: "F = 900 + 12 \\\\cdot n", onChange: (e) => setDialog({ ...dialog, latex: e.target.value }) }),
9180
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-insert-tools", role: "group", "aria-label": t.formula, children: helpers.map(([label, code]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
9275
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { ref: field, autoFocus: true, className: "w100n-insert-latex", value: dialog.latex, "aria-label": t.formula, placeholder: "F = 900 + 12 \\\\cdot n", onChange: (e) => setDialog({ ...dialog, latex: e.target.value }) }),
9276
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-insert-tools", role: "group", "aria-label": t.formula, children: helpers.map(([label, code]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => {
9181
9277
  const el = field.current;
9182
9278
  const at2 = el.selectionStart ?? dialog.latex.length;
9183
9279
  const latex = dialog.latex.slice(0, at2) + code + dialog.latex.slice(el.selectionEnd ?? at2);
@@ -9188,15 +9284,15 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9188
9284
  el.setSelectionRange(caret, caret);
9189
9285
  });
9190
9286
  }, children: label }, label)) }),
9191
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
9192
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9193
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
9194
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
9195
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9287
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
9288
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9289
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
9290
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
9291
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9196
9292
  dialog.at !== null ? t.update : t.put
9197
9293
  ] })
9198
9294
  ] })
9199
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
9295
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
9200
9296
  e.preventDefault();
9201
9297
  const text = dialog.text.trim();
9202
9298
  if (!text) return;
@@ -9213,12 +9309,12 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9213
9309
  }
9214
9310
  setDialog(null);
9215
9311
  }, children: [
9216
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-new-head", children: [
9217
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Superscript, { "aria-hidden": true }) }),
9218
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
9219
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9312
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-new-head", children: [
9313
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Superscript, { "aria-hidden": true }) }),
9314
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
9315
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9220
9316
  ] }),
9221
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9317
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
9222
9318
  "textarea",
9223
9319
  {
9224
9320
  autoFocus: true,
@@ -9232,40 +9328,40 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9232
9328
  }
9233
9329
  }
9234
9330
  ),
9235
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9236
- dialog.at !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
9331
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9332
+ dialog.at !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
9237
9333
  editor.chain().focus().deleteRange({ from: dialog.at, to: dialog.at + 1 }).run();
9238
9334
  setDialog(null);
9239
9335
  }, children: t.removeFootnote }),
9240
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
9241
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
9242
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9336
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
9337
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
9338
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9243
9339
  dialog.at !== null ? t.update : t.put
9244
9340
  ] })
9245
9341
  ] })
9246
9342
  ] }) }),
9247
- draft2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
9343
+ draft2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
9248
9344
  if (e.key === "Escape") {
9249
9345
  e.stopPropagation();
9250
9346
  setDraft2(null);
9251
9347
  }
9252
- }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
9348
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
9253
9349
  e.preventDefault();
9254
9350
  applySetup();
9255
9351
  }, children: [
9256
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-new-head", children: [
9257
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Ruler, { "aria-hidden": true }) }),
9258
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
9259
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDraft2(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9352
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-new-head", children: [
9353
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Ruler, { "aria-hidden": true }) }),
9354
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
9355
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDraft2(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.X, { "aria-hidden": true }) })
9260
9356
  ] }),
9261
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-caption", children: t.pageSize }),
9262
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size2]) => {
9357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-caption", children: t.pageSize }),
9358
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size2]) => {
9263
9359
  const land = draft2.width > draft2.height;
9264
9360
  const on2 = Math.abs(Math.min(draft2.width, draft2.height) - size2.width) < 2 && Math.abs(Math.max(draft2.width, draft2.height) - size2.height) < 2;
9265
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-pressed": on2, onClick: () => setDraft2({ ...draft2, width: land ? size2.height : size2.width, height: land ? size2.width : size2.height }), children: label }, label);
9361
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-pressed": on2, onClick: () => setDraft2({ ...draft2, width: land ? size2.height : size2.width, height: land ? size2.width : size2.height }), children: label }, label);
9266
9362
  }) }),
9267
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-caption", children: t.orientation }),
9268
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.orientation, children: [[false, t.portrait], [true, t.landscape]].map(([land, label]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9363
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-caption", children: t.orientation }),
9364
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.orientation, children: [[false, t.portrait], [true, t.landscape]].map(([land, label]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
9269
9365
  "button",
9270
9366
  {
9271
9367
  type: "button",
@@ -9277,11 +9373,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9277
9373
  },
9278
9374
  label
9279
9375
  )) }),
9280
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-caption", children: t.marginsCm }),
9281
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.margins, children: margins.map(([label, values]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-pressed": values.every((v, n) => Math.abs(cm(v) - draft2.margins[n]) < 0.05), onClick: () => setDraft2({ ...draft2, margins: values.map(cm) }), children: label }, label)) }),
9282
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
9283
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: label }),
9284
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9376
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-caption", children: t.marginsCm }),
9377
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.margins, children: margins.map(([label, values]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-pressed": values.every((v, n) => Math.abs(cm(v) - draft2.margins[n]) < 0.05), onClick: () => setDraft2({ ...draft2, margins: values.map(cm) }), children: label }, label)) }),
9378
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
9379
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: label }),
9380
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
9285
9381
  "input",
9286
9382
  {
9287
9383
  className: "w100n-docs-field",
@@ -9294,130 +9390,111 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9294
9390
  }
9295
9391
  )
9296
9392
  ] }, n)) }),
9297
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-setup-line", children: [
9298
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: t.headerText }),
9299
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
9393
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-setup-line", children: [
9394
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t.headerText }),
9395
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
9300
9396
  ] }),
9301
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-setup-line", children: [
9302
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: t.footerText }),
9303
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
9397
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-setup-line", children: [
9398
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t.footerText }),
9399
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
9304
9400
  ] }),
9305
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "w100n-setup-check", children: [
9306
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
9401
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-setup-check", children: [
9402
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
9307
9403
  t.pageNumbers
9308
9404
  ] }),
9309
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
9310
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
9311
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
9312
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9405
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
9406
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
9407
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
9408
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9313
9409
  t.apply
9314
9410
  ] })
9315
9411
  ] })
9316
9412
  ] }) }),
9317
- slot && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-notes", children: [
9318
- draft && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-card w100n-text-draft", children: [
9319
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("blockquote", { children: draft.quote }),
9320
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9321
- "textarea",
9322
- {
9323
- autoFocus: true,
9324
- value: draft.body,
9325
- placeholder: t.writeComment,
9326
- "aria-label": t.writeComment,
9327
- onChange: (e) => setDraft({ ...draft, body: e.target.value }),
9328
- onKeyDown: (e) => {
9329
- if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) void post();
9330
- }
9331
- }
9332
- ),
9333
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9334
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: drop2, children: t.cancel }),
9335
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
9336
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.MessageSquarePlus, { "aria-hidden": true }),
9413
+ slot && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-notes", children: [
9414
+ draft && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-card w100n-text-draft", children: [
9415
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("blockquote", { children: draft.quote }),
9416
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Mentions, { autoFocus: true, value: draft.body, placeholder: t.writeComment, label: t.writeComment, people, onChange: (body) => setDraft({ ...draft, body }), onSend: () => void post() }),
9417
+ tagged(draft.body, people).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "w100n-setup-check", children: [
9418
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: draft.give, onChange: (e) => setDraft({ ...draft, give: e.target.checked }) }),
9419
+ t.assignTo.replace("{name}", tagged(draft.body, people)[0].name)
9420
+ ] }),
9421
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9422
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: drop2, children: t.cancel }),
9423
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
9424
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.MessageSquarePlus, { "aria-hidden": true }),
9337
9425
  t.post
9338
9426
  ] })
9339
9427
  ] })
9340
9428
  ] }),
9341
- suggested.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
9342
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "w100n-docs-caption", children: [
9343
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.FilePenLine, { "aria-hidden": true }),
9429
+ suggested.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
9430
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { className: "w100n-docs-caption", children: [
9431
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.FilePenLine, { "aria-hidden": true }),
9344
9432
  t.suggestions,
9345
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: suggested.length })
9433
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: suggested.length })
9346
9434
  ] }),
9347
- suggested.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
9348
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
9349
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
9350
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-who", children: [
9351
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: c.author || t.someone }),
9352
- c.date && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: when(c.date) })
9435
+ suggested.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
9436
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { children: [
9437
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
9438
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-who", children: [
9439
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: c.author || t.someone }),
9440
+ c.date && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: when(c.date) })
9353
9441
  ] })
9354
9442
  ] }),
9355
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { children: [
9443
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { children: [
9356
9444
  c.kind === "insertion" ? t.added : t.removed,
9357
9445
  " ",
9358
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("q", { children: c.text })
9446
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("q", { children: c.text })
9359
9447
  ] }),
9360
- can.edit && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
9361
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
9362
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9448
+ can.edit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
9449
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
9450
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9363
9451
  t.accept
9364
9452
  ] }),
9365
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
9366
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.X, { "aria-hidden": true }),
9453
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
9454
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.X, { "aria-hidden": true }),
9367
9455
  t.reject
9368
9456
  ] })
9369
9457
  ] })
9370
9458
  ] }, i))
9371
9459
  ] }),
9372
- posting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
9373
- failed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
9374
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-docs-row", children: [
9375
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "w100n-docs-caption", children: [
9376
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.MessagesSquare, { "aria-hidden": true }),
9460
+ posting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
9461
+ failed && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
9462
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-docs-row", children: [
9463
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { className: "w100n-docs-caption", children: [
9464
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.MessagesSquare, { "aria-hidden": true }),
9377
9465
  t.comments,
9378
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: open.length })
9466
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: open.length })
9379
9467
  ] }),
9380
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
9468
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
9381
9469
  ] }),
9382
- !threads.length && !draft && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
9383
- threads.map((c) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
9470
+ !threads.length && !draft && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
9471
+ threads.map((c) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
9384
9472
  person(c),
9385
- c.quote && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("blockquote", { children: c.quote }),
9473
+ c.assignee && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-given", "data-me": c.assignee.id === host?.me.id, children: c.assignee.id === host?.me.id ? t.assignedYou : t.assignedTo.replace("{name}", c.assignee.name) }),
9474
+ c.quote && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("blockquote", { children: c.quote }),
9386
9475
  words3(c),
9387
- all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-reply", children: [
9476
+ all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-reply", children: [
9388
9477
  person(r),
9389
9478
  words3(r)
9390
9479
  ] }, r.id)),
9391
- reply?.id === c.id && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
9392
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
9393
- "textarea",
9394
- {
9395
- autoFocus: true,
9396
- value: reply.body,
9397
- placeholder: t.writeComment,
9398
- "aria-label": t.reply,
9399
- onChange: (e) => setReply({ ...reply, body: e.target.value }),
9400
- onKeyDown: (e) => {
9401
- if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) void answer(c);
9402
- }
9403
- }
9404
- ),
9405
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9406
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
9407
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
9408
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Reply, { "aria-hidden": true }),
9480
+ reply?.id === c.id && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
9481
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Mentions, { autoFocus: true, value: reply.body, placeholder: t.writeComment, label: t.reply, people, onChange: (body) => setReply({ ...reply, body }), onSend: () => void answer(c) }),
9482
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
9483
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
9484
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
9485
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Reply, { "aria-hidden": true }),
9409
9486
  t.reply
9410
9487
  ] })
9411
9488
  ] })
9412
9489
  ] }),
9413
- can.comment && reply?.id !== c.id && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
9414
- c.resolved && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w100n-docs-badge", children: t.resolved }),
9415
- !c.resolved && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
9416
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Reply, { "aria-hidden": true }),
9490
+ can.comment && reply?.id !== c.id && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
9491
+ c.resolved && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-docs-badge", children: t.resolved }),
9492
+ !c.resolved && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
9493
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Reply, { "aria-hidden": true }),
9417
9494
  t.reply
9418
9495
  ] }),
9419
- host?.resolveComment && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle2(c), children: [
9420
- c.resolved ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9496
+ host?.resolveComment && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle2(c), children: [
9497
+ c.resolved ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true }),
9421
9498
  c.resolved ? t.reopen : t.resolve
9422
9499
  ] })
9423
9500
  ] })
@@ -9425,13 +9502,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
9425
9502
  ] }), slot)
9426
9503
  ] });
9427
9504
  }
9428
- var import_react9, import_lucide_react5, import_react10, import_react_dom2, import_jsx_runtime6, legal, symbols, helpers, cm, inks, glows, faces, sizes, uid2;
9505
+ var import_react10, import_lucide_react5, import_react11, import_react_dom2, import_jsx_runtime7, legal, symbols, helpers, cm, inks, glows, faces, sizes, uid2;
9429
9506
  var init_TextEditor = __esm({
9430
9507
  "src/editor/TextEditor.tsx"() {
9431
9508
  "use strict";
9432
- import_react9 = require("@tiptap/react");
9509
+ import_react10 = require("@tiptap/react");
9433
9510
  import_lucide_react5 = require("lucide-react");
9434
- import_react10 = require("react");
9511
+ import_react11 = require("react");
9435
9512
  import_react_dom2 = require("react-dom");
9436
9513
  init_docx();
9437
9514
  init_focus();
@@ -9441,8 +9518,9 @@ var init_TextEditor = __esm({
9441
9518
  init_live();
9442
9519
  init_markdown();
9443
9520
  init_math();
9521
+ init_Mentions();
9444
9522
  init_pager();
9445
- import_jsx_runtime6 = require("react/jsx-runtime");
9523
+ import_jsx_runtime7 = require("react/jsx-runtime");
9446
9524
  legal = { width: 816, height: 1344 };
9447
9525
  symbols = [
9448
9526
  ["\xA9", "copyright"],
@@ -10001,6 +10079,15 @@ var init_sheets = __esm({
10001
10079
  }
10002
10080
  });
10003
10081
 
10082
+ // src/sheets/calm.ts
10083
+ var calm;
10084
+ var init_calm = __esm({
10085
+ "src/sheets/calm.ts"() {
10086
+ "use strict";
10087
+ calm = (selection) => selection.style?.widgets && Object.values(selection.style.widgets).some(Boolean) ? { ...selection, style: { ...selection.style, widgets: {}, strokeWidth: 2 } } : selection;
10088
+ }
10089
+ });
10090
+
10004
10091
  // src/sheets/grid.ts
10005
10092
  var grid_exports = {};
10006
10093
  __export(grid_exports, {
@@ -10014,7 +10101,7 @@ function grid2(container, language, edit) {
10014
10101
  [import_presets.LocaleType.EN_US]: (0, import_presets.mergeLocales)(import_en_US.default, import_en_US2.default, import_en_US3.default, import_en_US4.default, import_en_US5.default, import_en_US6.default),
10015
10102
  [import_presets.LocaleType.PL_PL]: (0, import_presets.mergeLocales)(import_pl_PL.default, import_pl_PL2.default, import_pl_PL3.default, import_pl_PL4.default, import_pl_PL5.default, import_pl_PL6.default)
10016
10103
  },
10017
- theme: import_presets.purpleTheme,
10104
+ theme: { ...import_presets.purpleTheme, "loop-color": { 1: "blue.500", 2: "red.500", 3: "green.600", 4: "orange.500", 5: "purple.500", 6: "jiqing.600", 7: "pink.500", 8: "yellow.700", 9: "indigo.600", 10: "red.700", 11: "green.800", 12: "blue.800" } },
10018
10105
  darkMode: false,
10019
10106
  presets: [
10020
10107
  (0, import_preset_sheets_core.UniverSheetsCorePreset)({
@@ -10038,7 +10125,7 @@ function marks({ univer, univerAPI: api }) {
10038
10125
  const service = univer.__getInjector().get(import_preset_sheets_core.IMarkSelectionService);
10039
10126
  let list = [];
10040
10127
  let ids = [];
10041
- const draw = () => {
10128
+ const draw2 = () => {
10042
10129
  ids.forEach((id) => service.removeShape(id));
10043
10130
  const sid = api.getActiveWorkbook()?.getActiveSheet().getSheetId();
10044
10131
  ids = list.filter((m) => m.sheet === sid).flatMap((m) => {
@@ -10047,11 +10134,11 @@ function marks({ univer, univerAPI: api }) {
10047
10134
  return id ? [id] : [];
10048
10135
  });
10049
10136
  };
10050
- const turn2 = api.addEvent(api.Event.ActiveSheetChanged, draw);
10137
+ const turn2 = api.addEvent(api.Event.ActiveSheetChanged, draw2);
10051
10138
  return {
10052
10139
  show: (next) => {
10053
10140
  list = next;
10054
- draw();
10141
+ draw2();
10055
10142
  },
10056
10143
  dispose: () => {
10057
10144
  turn2.dispose();
@@ -10059,7 +10146,7 @@ function marks({ univer, univerAPI: api }) {
10059
10146
  }
10060
10147
  };
10061
10148
  }
10062
- var import_lib, import_lib2, import_lib3, import_lib4, import_lib5, import_lib6, import_presets, import_preset_sheets_core, import_preset_sheets_data_validation, import_preset_sheets_filter, import_preset_sheets_find_replace, import_preset_sheets_note, import_preset_sheets_sort, import_en_US, import_pl_PL, import_en_US2, import_pl_PL2, import_en_US3, import_pl_PL3, import_en_US4, import_pl_PL4, import_en_US5, import_pl_PL5, import_en_US6, import_pl_PL6;
10149
+ var import_lib, import_lib2, import_lib3, import_lib4, import_lib5, import_lib6, import_presets, import_preset_sheets_core, import_preset_sheets_data_validation, import_preset_sheets_filter, import_preset_sheets_find_replace, import_preset_sheets_note, import_preset_sheets_sort, import_en_US, import_pl_PL, import_en_US2, import_pl_PL2, import_en_US3, import_pl_PL3, import_en_US4, import_pl_PL4, import_en_US5, import_pl_PL5, import_en_US6, import_pl_PL6, draw;
10063
10150
  var init_grid = __esm({
10064
10151
  "src/sheets/grid.ts"() {
10065
10152
  "use strict";
@@ -10088,7 +10175,12 @@ var init_grid = __esm({
10088
10175
  import_pl_PL5 = __toESM(require("@univerjs/preset-sheets-note/locales/pl-PL"), 1);
10089
10176
  import_en_US6 = __toESM(require("@univerjs/preset-sheets-sort/locales/en-US"), 1);
10090
10177
  import_pl_PL6 = __toESM(require("@univerjs/preset-sheets-sort/locales/pl-PL"), 1);
10178
+ init_calm();
10091
10179
  init_refs();
10180
+ draw = import_preset_sheets_core.SelectionControl.prototype.updateRangeBySelectionWithCoord;
10181
+ import_preset_sheets_core.SelectionControl.prototype.updateRangeBySelectionWithCoord = function(selection, ...rest) {
10182
+ draw.call(this, calm(selection), ...rest);
10183
+ };
10092
10184
  }
10093
10185
  });
10094
10186
 
@@ -10118,21 +10210,21 @@ function autoSum(r, numeric2) {
10118
10210
  }
10119
10211
  function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSaveRequest, guard, host, together, documentId = "", onSaved }) {
10120
10212
  const t = sheetTexts[language];
10121
- const box2 = (0, import_react11.useRef)(null);
10122
- const live = (0, import_react11.useRef)(null);
10213
+ const box2 = (0, import_react12.useRef)(null);
10214
+ const live = (0, import_react12.useRef)(null);
10123
10215
  const room = useLive(together ? host : void 0, documentId, kind, bytes, void 0, language, rights.edit && !!onSaveRequest, onSaved);
10124
10216
  const shared = room?.ready ? room.wire : null;
10125
10217
  const waiting2 = !!room && !shared && !room.late && !room.denied;
10126
- const [phase, setPhase] = (0, import_react11.useState)("loading");
10127
- const [attempt, setAttempt] = (0, import_react11.useState)(0);
10128
- const [dirty, setDirty] = (0, import_react11.useState)(false);
10129
- const [saving, setSaving] = (0, import_react11.useState)("idle");
10130
- const [refusal, setRefusal] = (0, import_react11.useState)(null);
10131
- const [pop, setPop] = (0, import_react11.useState)(null);
10132
- const [look, setLook] = (0, import_react11.useState)(null);
10218
+ const [phase, setPhase] = (0, import_react12.useState)("loading");
10219
+ const [attempt, setAttempt] = (0, import_react12.useState)(0);
10220
+ const [dirty, setDirty] = (0, import_react12.useState)(false);
10221
+ const [saving, setSaving] = (0, import_react12.useState)("idle");
10222
+ const [refusal, setRefusal] = (0, import_react12.useState)(null);
10223
+ const [pop, setPop] = (0, import_react12.useState)(null);
10224
+ const [look, setLook] = (0, import_react12.useState)(null);
10133
10225
  const edit = rights.edit && !!onSaveRequest && (!room || !!shared && !room.readonly);
10134
10226
  const notes3 = !edit && rights.comment && !!onSaveRequest && !room;
10135
- (0, import_react11.useEffect)(() => {
10227
+ (0, import_react12.useEffect)(() => {
10136
10228
  if (waiting2) return;
10137
10229
  let gone = false;
10138
10230
  let stop = () => {
@@ -10224,15 +10316,15 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10224
10316
  live.current = null;
10225
10317
  };
10226
10318
  }, [bytes, kind, attempt, shared, waiting2]);
10227
- (0, import_react11.useEffect)(() => {
10319
+ (0, import_react12.useEffect)(() => {
10228
10320
  live.current?.marks?.show((room?.people ?? []).flatMap((p) => !p.me && p.selection ? [{ ...p.selection, color: p.color }] : []));
10229
10321
  }, [room?.people, phase]);
10230
- (0, import_react11.useEffect)(() => {
10322
+ (0, import_react12.useEffect)(() => {
10231
10323
  live.current?.api.setLocale(language === "pl" ? "plPL" : "enUS");
10232
10324
  }, [language]);
10233
10325
  const pending2 = room ? room.pending : dirty;
10234
10326
  const unsent = room ? room.unsynced && edit : dirty;
10235
- (0, import_react11.useEffect)(() => {
10327
+ (0, import_react12.useEffect)(() => {
10236
10328
  if (!unsent) return;
10237
10329
  const stop = (e) => e.preventDefault();
10238
10330
  window.addEventListener("beforeunload", stop);
@@ -10274,7 +10366,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10274
10366
  return false;
10275
10367
  }
10276
10368
  };
10277
- (0, import_react11.useEffect)(() => {
10369
+ (0, import_react12.useEffect)(() => {
10278
10370
  if (!guard || room || !dirty) return;
10279
10371
  guard.current = save2;
10280
10372
  return () => {
@@ -10300,15 +10392,15 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10300
10392
  setPop(null);
10301
10393
  }
10302
10394
  };
10303
- const tool = (Icon, label, onClick, pressed) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled: phase !== "ready", onClick, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { "aria-hidden": true }) });
10304
- const gap = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-sheet-gap" });
10305
- const anchor = (key2, trigger, body) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-sheet-anchor", children: [
10395
+ const tool = (Icon, label, onClick, pressed) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled: phase !== "ready", onClick, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { "aria-hidden": true }) });
10396
+ const gap = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-sheet-gap" });
10397
+ const anchor = (key2, trigger, body) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-sheet-anchor", children: [
10306
10398
  trigger,
10307
- pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-sheet-pop", role: "dialog", children: body })
10399
+ pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-sheet-pop", role: "dialog", children: body })
10308
10400
  ] });
10309
- const opener = (key2, Icon, label, bar) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", "aria-label": label, title: label, "aria-expanded": pop === key2, disabled: phase !== "ready", onClick: () => setPop(pop === key2 ? null : key2), children: [
10310
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { "aria-hidden": true }),
10311
- bar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "w100n-sheet-bar", style: { background: bar || "currentColor" } })
10401
+ const opener = (key2, Icon, label, bar) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", "aria-label": label, title: label, "aria-expanded": pop === key2, disabled: phase !== "ready", onClick: () => setPop(pop === key2 ? null : key2), children: [
10402
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { "aria-hidden": true }),
10403
+ bar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "w100n-sheet-bar", style: { background: bar || "currentColor" } })
10312
10404
  ] });
10313
10405
  const currency = language === "pl" ? '#,##0.00 "z\u0142"' : language === "uk" ? '#,##0.00 "\u20B4"' : '"$"#,##0.00';
10314
10406
  const formats = [
@@ -10340,22 +10432,22 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10340
10432
  if (rows) ws.deleteRows(r.startRow, r.endRow - r.startRow + 1);
10341
10433
  else ws.deleteColumns(r.startColumn, r.endColumn - r.startColumn + 1);
10342
10434
  };
10343
- const swatches = (list, pick, none, reset, current) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-sheet-swatches", children: [
10344
- list.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": c, "aria-pressed": current.toLowerCase() === c, onClick: () => pick(c), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { style: { background: c } }) }, i)),
10345
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-sheet-none", onClick: reset, children: none })
10435
+ const swatches = (list, pick, none, reset, current) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-sheet-swatches", children: [
10436
+ list.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": c, "aria-pressed": current.toLowerCase() === c, onClick: () => pick(c), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { style: { background: c } }) }, i)),
10437
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-sheet-none", onClick: reset, children: none })
10346
10438
  ] });
10347
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-sheet", "data-theme": theme, onKeyDownCapture: keys2, children: [
10348
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-sheet-ribbon", role: "toolbar", "aria-label": t.tools, onKeyDown: rove, onPointerDown: (e) => {
10439
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet", "data-theme": theme, onKeyDownCapture: keys2, children: [
10440
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet-ribbon", role: "toolbar", "aria-label": t.tools, onKeyDown: rove, onPointerDown: (e) => {
10349
10441
  if (e.target.closest("button")) e.preventDefault();
10350
10442
  }, children: [
10351
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-sheet-tools", children: [
10352
- edit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
10443
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet-tools", children: [
10444
+ edit && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
10353
10445
  tool(import_lucide_react6.Undo2, t.undo, () => void api()?.undo()),
10354
10446
  tool(import_lucide_react6.Redo2, t.redo, () => void api()?.redo()),
10355
10447
  gap,
10356
10448
  anchor(
10357
10449
  "format",
10358
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
10450
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
10359
10451
  "button",
10360
10452
  {
10361
10453
  type: "button",
@@ -10366,12 +10458,12 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10366
10458
  disabled: phase !== "ready",
10367
10459
  onClick: () => setPop(pop === "format" ? null : "format"),
10368
10460
  children: [
10369
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: shown }),
10370
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
10461
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: shown }),
10462
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
10371
10463
  ]
10372
10464
  }
10373
10465
  ),
10374
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-sheet-list", children: formats.map(([label, pattern], i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
10466
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-sheet-list", children: formats.map(([label, pattern], i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
10375
10467
  "button",
10376
10468
  {
10377
10469
  type: "button",
@@ -10382,7 +10474,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10382
10474
  },
10383
10475
  children: [
10384
10476
  label,
10385
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: pattern === "General" ? "" : pattern })
10477
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: pattern === "General" ? "" : pattern })
10386
10478
  ]
10387
10479
  },
10388
10480
  i
@@ -10422,8 +10514,8 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10422
10514
  anchor(
10423
10515
  "border",
10424
10516
  opener("border", import_lucide_react6.Grid2x2, t.borders),
10425
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-sheet-list", children: [[import_lucide_react6.Grid2x2, t.borderAll, "all"], [import_lucide_react6.Square, t.borderOuter, "outside"], [import_lucide_react6.PanelBottom, t.borderBottom, "bottom"], [import_lucide_react6.SquareDashed, t.borderNone, "none"]].map(([Icon, label, type]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick: () => border(type), children: [
10426
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { "aria-hidden": true }),
10517
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-sheet-list", children: [[import_lucide_react6.Grid2x2, t.borderAll, "all"], [import_lucide_react6.Square, t.borderOuter, "outside"], [import_lucide_react6.PanelBottom, t.borderBottom, "bottom"], [import_lucide_react6.SquareDashed, t.borderNone, "none"]].map(([Icon, label, type]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", onClick: () => border(type), children: [
10518
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { "aria-hidden": true }),
10427
10519
  label
10428
10520
  ] }, type)) })
10429
10521
  ),
@@ -10443,17 +10535,17 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10443
10535
  anchor(
10444
10536
  "freeze",
10445
10537
  opener("freeze", import_lucide_react6.Snowflake, t.freeze),
10446
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-sheet-list", children: [
10447
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => {
10538
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-sheet-list", children: [
10539
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => {
10448
10540
  sheet2()?.setFrozenRows(1);
10449
10541
  setPop(null);
10450
10542
  }, children: t.freezeRow }),
10451
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => {
10543
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => {
10452
10544
  sheet2()?.setFrozenColumns(1);
10453
10545
  setPop(null);
10454
10546
  }, children: t.freezeColumn }),
10455
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => run3("sheet.command.set-selection-frozen"), children: t.freezeHere }),
10456
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => {
10547
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => run3("sheet.command.set-selection-frozen"), children: t.freezeHere }),
10548
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => {
10457
10549
  sheet2()?.cancelFreeze();
10458
10550
  setPop(null);
10459
10551
  }, children: t.freezeNone })
@@ -10469,34 +10561,34 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
10469
10561
  (edit || notes3) && tool(import_lucide_react6.StickyNote, t.note, () => run3("sheet.operation.add-note-popup")),
10470
10562
  tool(import_lucide_react6.Search, t.find, () => run3("ui.operation.open-find-dialog"))
10471
10563
  ] }),
10472
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-sheet-end", children: [
10473
- room && (room.ready ? !room.online : room.late || room.denied) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-text-live", title: room.denied ? void 0 : t.offlineHint, children: [
10474
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.WifiOff, { "aria-hidden": true }),
10564
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-sheet-end", children: [
10565
+ room && (room.ready ? !room.online : room.late || room.denied) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-live", title: room.denied ? void 0 : t.offlineHint, children: [
10566
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.WifiOff, { "aria-hidden": true }),
10475
10567
  room.denied ? t.liveOff : t.offline
10476
10568
  ] }),
10477
- room && room.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: room.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) }),
10478
- !edit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-docs-badge", children: notes3 ? t.notesOnly : t.viewOnly }),
10479
- saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-sheet-muted", role: "alert", children: refusal ? t.refused[refusal.code].replace("{sheet}", refusal.sheet) : t.saveFailed }),
10480
- (edit || notes3) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !pending2 || saving === "busy" || phase !== "ready" || !!room && !room.online, onClick: () => void save2(), children: [
10481
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react6.Save, { "aria-hidden": true }),
10569
+ room && room.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: room.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) }),
10570
+ !edit && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-badge", children: notes3 ? t.notesOnly : t.viewOnly }),
10571
+ saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-sheet-muted", role: "alert", children: refusal ? t.refused[refusal.code].replace("{sheet}", refusal.sheet) : t.saveFailed }),
10572
+ (edit || notes3) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !pending2 || saving === "busy" || phase !== "ready" || !!room && !room.online, onClick: () => void save2(), children: [
10573
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Save, { "aria-hidden": true }),
10482
10574
  saving === "busy" ? t.saving : !pending2 && saving === "done" ? t.saved : t.save
10483
10575
  ] })
10484
10576
  ] })
10485
10577
  ] }),
10486
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w100n-sheet-stage", onPointerDown: () => setPop(null), children: [
10487
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: box2, className: "w100n-sheet-grid" }),
10488
- phase !== "ready" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w100n-sheet-cover", children: phase === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: t.loading }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
10578
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet-stage", onPointerDown: () => setPop(null), children: [
10579
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: box2, className: "w100n-sheet-grid" }),
10580
+ phase !== "ready" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-sheet-cover", children: phase === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.loading }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
10489
10581
  t.failed,
10490
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: () => setAttempt((n) => n + 1), children: t.retry })
10582
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: () => setAttempt((n) => n + 1), children: t.retry })
10491
10583
  ] }) })
10492
10584
  ] })
10493
10585
  ] });
10494
10586
  }
10495
- var import_react11, import_lucide_react6, import_core5, import_jsx_runtime7, decimals, letters2, SheetView_default;
10587
+ var import_react12, import_lucide_react6, import_core5, import_jsx_runtime8, decimals, letters2, SheetView_default;
10496
10588
  var init_SheetView = __esm({
10497
10589
  "src/sheets/SheetView.tsx"() {
10498
10590
  "use strict";
10499
- import_react11 = require("react");
10591
+ import_react12 = require("react");
10500
10592
  import_lucide_react6 = require("lucide-react");
10501
10593
  import_core5 = require("@univerjs/core");
10502
10594
  init_live();
@@ -10510,7 +10602,7 @@ var init_SheetView = __esm({
10510
10602
  init_text2();
10511
10603
  init_xlsx();
10512
10604
  init_sheets();
10513
- import_jsx_runtime7 = require("react/jsx-runtime");
10605
+ import_jsx_runtime8 = require("react/jsx-runtime");
10514
10606
  decimals = (pattern, step) => {
10515
10607
  const p = pattern === "General" ? "0" : pattern;
10516
10608
  const next = Math.max(0, (/0(?:\.(0+))?/.exec(p)?.[1]?.length ?? 0) + step);
@@ -10595,15 +10687,15 @@ function changes2(before, after) {
10595
10687
  }
10596
10688
  function Compare({ host, documentId, kind, older, t }) {
10597
10689
  const rows = useLoad(async (signal) => changes2(await textOf2(kind, older), await textOf2(kind, await host.content(documentId, null, { signal }))), [host, documentId, older]);
10598
- if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
10599
- if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
10690
+ if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
10691
+ if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
10600
10692
  const added = rows.data.filter((r) => r.op === "+").length, removed = rows.data.filter((r) => r.op === "-").length, edited = rows.data.filter((r) => r.op === "~").length;
10601
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
10602
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
10603
- rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("del", { children: p.text }, k)) }, i))
10693
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
10694
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
10695
+ rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("del", { children: p.text }, k)) }, i))
10604
10696
  ] }) });
10605
10697
  }
10606
- var import_jsx_runtime12, words2, alike;
10698
+ var import_jsx_runtime13, words2, alike;
10607
10699
  var init_Compare = __esm({
10608
10700
  "src/Compare.tsx"() {
10609
10701
  "use strict";
@@ -10611,7 +10703,7 @@ var init_Compare = __esm({
10611
10703
  init_diff();
10612
10704
  init_markdown();
10613
10705
  init_useLoad();
10614
- import_jsx_runtime12 = require("react/jsx-runtime");
10706
+ import_jsx_runtime13 = require("react/jsx-runtime");
10615
10707
  words2 = (text) => text.split(/(\s+)/).filter(Boolean);
10616
10708
  alike = (a, b) => {
10617
10709
  const x = a.split(/\s+/).filter(Boolean), y = b.split(/\s+/).filter(Boolean);
@@ -10641,7 +10733,7 @@ module.exports = __toCommonJS(index_exports);
10641
10733
 
10642
10734
  // src/DocumentOverlay.tsx
10643
10735
  var import_lucide_react7 = require("lucide-react");
10644
- var import_react12 = require("react");
10736
+ var import_react13 = require("react");
10645
10737
  var import_react_dom3 = require("react-dom");
10646
10738
  init_focus();
10647
10739
 
@@ -12739,7 +12831,7 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
12739
12831
  setSigning(null);
12740
12832
  setTool("place");
12741
12833
  };
12742
- const draw = (e) => {
12834
+ const draw2 = (e) => {
12743
12835
  const r = e.currentTarget.getBoundingClientRect();
12744
12836
  const p = { x: e.clientX - r.left, y: e.clientY - r.top };
12745
12837
  const ctx = e.currentTarget.getContext("2d");
@@ -13003,7 +13095,7 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
13003
13095
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "w100n-pdf-script", style: { fontSize: Math.min(52, Math.floor(680 / Math.max(1, (signing.name || t.yourName).length))) }, children: signing.name || t.yourName })
13004
13096
  ] }),
13005
13097
  signing.tab === "drawn" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
13006
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("canvas", { ref: pad, className: "w100n-pdf-pad", "aria-label": t.drawHere, onPointerDown: draw, onPointerMove: draw }),
13098
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("canvas", { ref: pad, className: "w100n-pdf-pad", "aria-label": t.drawHere, onPointerDown: draw2, onPointerMove: draw2 }),
13007
13099
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "w100n-docs-row", children: [
13008
13100
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { className: "w100n-docs-muted", children: t.drawHere }),
13009
13101
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
@@ -13048,9 +13140,9 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
13048
13140
  }
13049
13141
 
13050
13142
  // src/DocumentOverlay.tsx
13051
- var import_jsx_runtime8 = require("react/jsx-runtime");
13052
- var TextEditor2 = (0, import_react12.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
13053
- var SheetView2 = (0, import_react12.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
13143
+ var import_jsx_runtime9 = require("react/jsx-runtime");
13144
+ var TextEditor2 = (0, import_react13.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
13145
+ var SheetView2 = (0, import_react13.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
13054
13146
  var icons = { docx: import_lucide_react7.FileText, markdown: import_lucide_react7.FileType, pdf: import_lucide_react7.Files, sheet: import_lucide_react7.FileSpreadsheet, slides: import_lucide_react7.Presentation };
13055
13147
  var read = { view: true, comment: false, edit: false };
13056
13148
  var quiet2 = () => {
@@ -13059,7 +13151,7 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
13059
13151
  const t = texts[language];
13060
13152
  const kind = kindOf(name, mimeType) ?? "pdf";
13061
13153
  const Kind = icons[kind];
13062
- const [saved, setSaved] = (0, import_react12.useState)(null);
13154
+ const [saved, setSaved] = (0, import_react13.useState)(null);
13063
13155
  const loaded = useLoad(async (signal) => {
13064
13156
  if (source instanceof ArrayBuffer) return source;
13065
13157
  if (source instanceof Blob) return source.arrayBuffer();
@@ -13069,15 +13161,15 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
13069
13161
  }, [source]);
13070
13162
  const doc = useLoad((signal) => host && documentId ? host.document(documentId, { signal }) : Promise.resolve(null), [host, documentId]);
13071
13163
  const bytes = saved ?? loaded.data;
13072
- const guard = (0, import_react12.useRef)(null);
13073
- const box2 = (0, import_react12.useRef)(null);
13164
+ const guard = (0, import_react13.useRef)(null);
13165
+ const box2 = (0, import_react13.useRef)(null);
13074
13166
  const { ask, dialog } = useUnsaved(guard, t);
13075
13167
  const close = () => ask(onClose);
13076
13168
  useRestore(true);
13077
- (0, import_react12.useEffect)(() => {
13169
+ (0, import_react13.useEffect)(() => {
13078
13170
  box2.current.focus();
13079
13171
  }, []);
13080
- (0, import_react12.useEffect)(() => {
13172
+ (0, import_react13.useEffect)(() => {
13081
13173
  const escape3 = (e) => {
13082
13174
  if (e.key !== "Escape") return;
13083
13175
  e.stopPropagation();
@@ -13100,10 +13192,10 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
13100
13192
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
13101
13193
  };
13102
13194
  const sheet2 = readable(name, mimeType) !== "sheet" ? null : /\.csv$/i.test(name) || mimeType === "text/csv" ? "csv" : "xlsx";
13103
- const wait = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
13195
+ const wait = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
13104
13196
  let stage = null;
13105
13197
  if (bytes && !doc.loading) {
13106
- if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
13198
+ if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
13107
13199
  PdfView,
13108
13200
  {
13109
13201
  bytes,
@@ -13117,51 +13209,51 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
13117
13209
  guard
13118
13210
  }
13119
13211
  );
13120
- else if (kind === "docx" || kind === "markdown") stage = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react12.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TextEditor2, { kind, bytes, t, language, rights: read, documentId: documentId ?? name, onOutline: quiet2, slot: null }) });
13121
- else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SlidesView, { html: new TextDecoder().decode(bytes), name, rights: read, language, theme, onOutline: quiet2 });
13122
- else if (sheet2) stage = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react12.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SheetView2, { bytes, name, kind: sheet2, rights: read, language, theme, documentId: documentId ?? name }) });
13123
- else stage = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
13124
- }
13125
- return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: box2, className: "w100n-docs w100n-docs-overlay", "data-theme": theme, role: "dialog", "aria-modal": true, "aria-label": name, tabIndex: -1, children: [
13126
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "w100n-docs-bar", children: [
13127
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Kind, { "aria-hidden": true }) }),
13128
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-docs-heading", children: [
13129
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("strong", { className: "w100n-docs-title", children: name }),
13130
- info && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-crumbs", children: info })
13212
+ else if (kind === "docx" || kind === "markdown") stage = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react13.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TextEditor2, { kind, bytes, t, language, rights: read, documentId: documentId ?? name, onOutline: quiet2, slot: null }) });
13213
+ else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SlidesView, { html: new TextDecoder().decode(bytes), name, rights: read, language, theme, onOutline: quiet2 });
13214
+ else if (sheet2) stage = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react13.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SheetView2, { bytes, name, kind: sheet2, rights: read, language, theme, documentId: documentId ?? name }) });
13215
+ else stage = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
13216
+ }
13217
+ return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: box2, className: "w100n-docs w100n-docs-overlay", "data-theme": theme, role: "dialog", "aria-modal": true, "aria-label": name, tabIndex: -1, children: [
13218
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("header", { className: "w100n-docs-bar", children: [
13219
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Kind, { "aria-hidden": true }) }),
13220
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-docs-heading", children: [
13221
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { className: "w100n-docs-title", children: name }),
13222
+ info && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-crumbs", children: info })
13131
13223
  ] }),
13132
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-docs-end", children: [
13224
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-docs-end", children: [
13133
13225
  actions,
13134
- download && !saved || !bytes ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("a", { className: "w100n-docs-action", href: download ?? (typeof source === "string" ? source : void 0), download: name, "aria-label": t.download, children: [
13135
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Download, { "aria-hidden": true }),
13136
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.download })
13137
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: save2, "aria-label": t.download, children: [
13138
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.Download, { "aria-hidden": true }),
13139
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.download })
13226
+ download && !saved || !bytes ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { className: "w100n-docs-action", href: download ?? (typeof source === "string" ? source : void 0), download: name, "aria-label": t.download, children: [
13227
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Download, { "aria-hidden": true }),
13228
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: t.download })
13229
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: save2, "aria-label": t.download, children: [
13230
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Download, { "aria-hidden": true }),
13231
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: t.download })
13140
13232
  ] }),
13141
- onOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => ask(onOpen), "aria-label": t.openInDocuments, children: [
13142
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.ExternalLink, { "aria-hidden": true }),
13143
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.openInDocuments })
13233
+ onOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => ask(onOpen), "aria-label": t.openInDocuments, children: [
13234
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ExternalLink, { "aria-hidden": true }),
13235
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: t.openInDocuments })
13144
13236
  ] }),
13145
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: close, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react7.X, { "aria-hidden": true }) })
13237
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: close, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.X, { "aria-hidden": true }) })
13146
13238
  ] })
13147
13239
  ] }),
13148
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-body", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("main", { className: "w100n-docs-stage", children: loaded.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-docs-empty", children: [
13240
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w100n-docs-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("main", { className: "w100n-docs-stage", children: loaded.error ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-docs-empty", children: [
13149
13241
  t.failed,
13150
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: loaded.retry, children: t.retry })
13242
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: loaded.retry, children: t.retry })
13151
13243
  ] }) : stage ?? wait }) }),
13152
13244
  dialog
13153
13245
  ] }), document.body);
13154
13246
  }
13155
13247
 
13156
13248
  // src/DocumentsWorkspace.tsx
13157
- var import_react16 = require("react");
13249
+ var import_react17 = require("react");
13158
13250
  var import_react_dom4 = require("react-dom");
13159
13251
  var import_lucide_react10 = require("lucide-react");
13160
13252
  init_focus();
13161
13253
 
13162
13254
  // src/NewDocument.tsx
13163
13255
  var import_lucide_react8 = require("lucide-react");
13164
- var import_react13 = require("react");
13256
+ var import_react14 = require("react");
13165
13257
 
13166
13258
  // src/blank.ts
13167
13259
  var import_fflate2 = require("fflate");
@@ -13286,80 +13378,104 @@ function blank4(kind, name, template = "blank") {
13286
13378
 
13287
13379
  // src/NewDocument.tsx
13288
13380
  init_focus();
13289
- var import_jsx_runtime9 = require("react/jsx-runtime");
13381
+ init_useLoad();
13382
+ var import_jsx_runtime10 = require("react/jsx-runtime");
13290
13383
  var icons2 = { docx: import_lucide_react8.FileText, markdown: import_lucide_react8.FileType, sheet: import_lucide_react8.FileSpreadsheet, slides: import_lucide_react8.Presentation };
13291
13384
  var shaped = ["blank", "letter", "contract", "notes", "invoice", "report"];
13292
13385
  function NewDocument({ host, t, onClose, onMade }) {
13293
- const id = (0, import_react13.useId)();
13294
- const [kind, setKind] = (0, import_react13.useState)("docx");
13295
- const [template, setTemplate] = (0, import_react13.useState)("blank");
13296
- const [name, setName] = (0, import_react13.useState)("");
13297
- const [state, setState] = (0, import_react13.useState)("idle");
13386
+ const id = (0, import_react14.useId)();
13387
+ const [kind, setKind] = (0, import_react14.useState)("docx");
13388
+ const [template, setTemplate] = (0, import_react14.useState)("blank");
13389
+ const [name, setName] = (0, import_react14.useState)("");
13390
+ const [team, setTeam] = (0, import_react14.useState)(null);
13391
+ const shared = useLoad((signal) => host.templates ? host.templates({ signal }) : Promise.resolve([]), [host]);
13392
+ const ours2 = (shared.data ?? []).filter((item) => item.kind === kind);
13393
+ const stem = (file) => file.replace(/\.[^.]+$/, "");
13394
+ const [state, setState] = (0, import_react14.useState)("idle");
13298
13395
  useRestore(true);
13299
13396
  const choices = kind === "docx" || kind === "markdown" ? shaped : ["blank"];
13300
13397
  const make2 = async () => {
13301
- const title = name.trim() || (template === "blank" ? t.untitled : t.templates[template]);
13398
+ const title = name.trim() || (team ? stem(team.name) : template === "blank" ? t.untitled : t.templates[template]);
13302
13399
  setState("busy");
13303
13400
  try {
13304
- onMade(await host.create({ name: `${title.replace(/[\\/:*?"<>|\s]+/g, " ").trim()}.${extensions[kind]}`, bytes: blank4(kind, title, template), mimeType: mimes2[kind] }));
13401
+ const ext = team ? team.name.split(".").pop() : extensions[kind];
13402
+ const bytes = team ? await host.content(team.id) : blank4(kind, title, template);
13403
+ onMade(await host.create({ name: `${title.replace(/[\\/:*?"<>|\s]+/g, " ").trim()}.${ext}`, bytes, mimeType: mimes2[kind] }));
13305
13404
  } catch {
13306
13405
  setState("failed");
13307
13406
  }
13308
13407
  };
13309
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
13408
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
13310
13409
  if (e.key === "Escape") {
13311
13410
  e.stopPropagation();
13312
13411
  onClose();
13313
13412
  }
13314
- }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
13413
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
13315
13414
  e.preventDefault();
13316
13415
  void make2();
13317
13416
  }, children: [
13318
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-new-head", children: [
13319
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-new-tile", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.Plus, { "aria-hidden": true }) }),
13320
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
13321
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: onClose, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.X, { "aria-hidden": true }) })
13417
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-new-head", children: [
13418
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-new-tile", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Plus, { "aria-hidden": true }) }),
13419
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
13420
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: onClose, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.X, { "aria-hidden": true }) })
13322
13421
  ] }),
13323
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
13422
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
13324
13423
  const Icon = icons2[item];
13325
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
13424
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
13326
13425
  setKind(item);
13426
+ setTeam(null);
13327
13427
  if (item === "sheet" || item === "slides") setTemplate("blank");
13328
13428
  }, children: [
13329
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { "aria-hidden": true }) }),
13330
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
13331
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: t.newKinds[item] }),
13332
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("small", { children: t.kindHints[item] })
13429
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { "aria-hidden": true }) }),
13430
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13431
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: t.newKinds[item] }),
13432
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: t.kindHints[item] })
13333
13433
  ] })
13334
13434
  ] }, item);
13335
13435
  }) }),
13336
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "w100n-docs-caption", children: t.startFrom }),
13337
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { role: "radiogroup", "aria-label": t.startFrom, className: "w100n-new-templates", children: choices.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", role: "radio", "aria-checked": template === item, onClick: () => setTemplate(item), children: [
13338
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.Plus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
13339
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { "data-head": true }),
13340
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", {}),
13341
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", {}),
13342
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { "data-accent": true }),
13343
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", {}),
13344
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", {})
13436
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-caption", children: t.startFrom }),
13437
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "radiogroup", "aria-label": t.startFrom, className: "w100n-new-templates", children: choices.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "radio", "aria-checked": !team && template === item, onClick: () => {
13438
+ setTeam(null);
13439
+ setTemplate(item);
13440
+ }, children: [
13441
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Plus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
13442
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "data-head": true }),
13443
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
13444
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
13445
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "data-accent": true }),
13446
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
13447
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {})
13345
13448
  ] }) }),
13346
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: t.templates[item] })
13449
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.templates[item] })
13347
13450
  ] }, item)) }),
13348
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-new-fields", children: [
13349
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { children: [
13350
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-caption", children: t.name }),
13351
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { className: "w100n-docs-field", autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: template === "blank" ? t.untitled : t.templates[template] })
13451
+ ours2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
13452
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-caption", children: t.teamTemplates }),
13453
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "radiogroup", "aria-label": t.teamTemplates, className: "w100n-new-templates", children: ours2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "radio", "aria-checked": team?.id === item.id, onClick: () => setTeam(item), children: [
13454
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "w100n-new-sheet", children: [
13455
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "data-head": true }),
13456
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
13457
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "data-accent": true }),
13458
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
13459
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {})
13460
+ ] }),
13461
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { title: item.name, children: stem(item.name) })
13462
+ ] }, item.id)) })
13463
+ ] }),
13464
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-new-fields", children: [
13465
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
13466
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-caption", children: t.name }),
13467
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { className: "w100n-docs-field", autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: team ? stem(team.name) : template === "blank" ? t.untitled : t.templates[template] })
13352
13468
  ] }),
13353
- host.createIn && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
13354
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-caption", children: t.savesTo }),
13355
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
13469
+ host.createIn && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
13470
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-caption", children: t.savesTo }),
13471
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
13356
13472
  ] })
13357
13473
  ] }),
13358
- state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
13359
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
13360
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
13361
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
13362
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react8.Check, { "aria-hidden": true }),
13474
+ state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
13475
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
13476
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
13477
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
13478
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Check, { "aria-hidden": true }),
13363
13479
  state === "busy" ? t.making : t.make
13364
13480
  ] })
13365
13481
  ] })
@@ -13367,10 +13483,10 @@ function NewDocument({ host, t, onClose, onMade }) {
13367
13483
  }
13368
13484
 
13369
13485
  // src/Sharing.tsx
13370
- var import_react14 = require("react");
13486
+ var import_react15 = require("react");
13371
13487
  var import_lucide_react9 = require("lucide-react");
13372
13488
  init_useLoad();
13373
- var import_jsx_runtime10 = require("react/jsx-runtime");
13489
+ var import_jsx_runtime11 = require("react/jsx-runtime");
13374
13490
  var blank5 = { id: null, comment: false, download: false, askName: true, works: "30", day: "", password: false, secret: "", had: false };
13375
13491
  var local = (iso) => {
13376
13492
  const at2 = new Date(iso);
@@ -13378,9 +13494,9 @@ var local = (iso) => {
13378
13494
  };
13379
13495
  function Sharing({ host, doc, t, language, team }) {
13380
13496
  const links = useLoad((signal) => host.links(doc.id, { signal }), [host, doc.id]);
13381
- const [form, setForm] = (0, import_react14.useState)(null);
13382
- const [state, setState] = (0, import_react14.useState)("idle");
13383
- const [copied, setCopied] = (0, import_react14.useState)(null);
13497
+ const [form, setForm] = (0, import_react15.useState)(null);
13498
+ const [state, setState] = (0, import_react15.useState)("idle");
13499
+ const [copied, setCopied] = (0, import_react15.useState)(null);
13384
13500
  const text = doc.kind === "docx" || doc.kind === "markdown";
13385
13501
  const rules = new Intl.PluralRules(language);
13386
13502
  const count = (n, forms) => `${n} ${forms[rules.select(n)] ?? forms.other}`;
@@ -13442,31 +13558,31 @@ function Sharing({ host, doc, t, language, team }) {
13442
13558
  setCopied(null);
13443
13559
  }
13444
13560
  };
13445
- if (form) return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share", children: [
13446
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "w100n-docs-caption", children: [
13447
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13561
+ if (form) return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share", children: [
13562
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "w100n-docs-caption", children: [
13563
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13448
13564
  form.id ? t.changeLink : t.newLink
13449
13565
  ] }),
13450
- text && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-field", children: [
13451
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.guestsCan }),
13452
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-docs-chips", children: [
13453
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
13454
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }),
13566
+ text && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-field", children: [
13567
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: t.guestsCan }),
13568
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-docs-chips", children: [
13569
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
13570
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }),
13455
13571
  t.canRead
13456
13572
  ] }),
13457
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
13458
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.MessageSquarePlus, { "aria-hidden": true }),
13573
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
13574
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.MessageSquarePlus, { "aria-hidden": true }),
13459
13575
  t.canComment
13460
13576
  ] })
13461
13577
  ] })
13462
13578
  ] }),
13463
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-field", children: [
13464
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.linkWorks }),
13465
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key2, label]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", "aria-pressed": form.works === key2, onClick: () => setForm({ ...form, works: key2 }), children: [
13466
- key2 === "day" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.CalendarDays, { "aria-hidden": true }),
13579
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-field", children: [
13580
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: t.linkWorks }),
13581
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key2, label]) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", "aria-pressed": form.works === key2, onClick: () => setForm({ ...form, works: key2 }), children: [
13582
+ key2 === "day" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.CalendarDays, { "aria-hidden": true }),
13467
13583
  label
13468
13584
  ] }, key2)) }),
13469
- form.works === "day" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
13585
+ form.works === "day" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
13470
13586
  "input",
13471
13587
  {
13472
13588
  type: "date",
@@ -13478,14 +13594,14 @@ function Sharing({ host, doc, t, language, team }) {
13478
13594
  }
13479
13595
  )
13480
13596
  ] }),
13481
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "w100n-share-toggle", children: [
13482
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
13483
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13484
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: t.passwordOn }),
13485
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: t.passwordHint })
13597
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "w100n-share-toggle", children: [
13598
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
13599
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13600
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: t.passwordOn }),
13601
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: t.passwordHint })
13486
13602
  ] })
13487
13603
  ] }),
13488
- form.password && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
13604
+ form.password && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
13489
13605
  "input",
13490
13606
  {
13491
13607
  type: "password",
@@ -13497,120 +13613,120 @@ function Sharing({ host, doc, t, language, team }) {
13497
13613
  onChange: (e) => setForm({ ...form, secret: e.target.value })
13498
13614
  }
13499
13615
  ),
13500
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "w100n-share-toggle", children: [
13501
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
13502
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13503
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: t.downloadFile }),
13504
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: t.downloadHint })
13616
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "w100n-share-toggle", children: [
13617
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
13618
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13619
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: t.downloadFile }),
13620
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: t.downloadHint })
13505
13621
  ] })
13506
13622
  ] }),
13507
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "w100n-share-toggle", children: [
13508
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
13509
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13510
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: t.askName }),
13511
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: t.askNameHint })
13623
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "w100n-share-toggle", children: [
13624
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
13625
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13626
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: t.askName }),
13627
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: t.askNameHint })
13512
13628
  ] })
13513
13629
  ] }),
13514
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-muted", children: t.lastSaved }),
13515
- state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
13516
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
13517
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
13630
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", children: t.lastSaved }),
13631
+ state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
13632
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
13633
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
13518
13634
  setForm(null);
13519
13635
  setState("idle");
13520
13636
  }, children: t.cancel }),
13521
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
13522
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13637
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
13638
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13523
13639
  form.id ? t.saveLink : t.makeLink
13524
13640
  ] })
13525
13641
  ] })
13526
13642
  ] });
13527
13643
  const on2 = links.data ?? [];
13528
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share", children: [
13529
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "w100n-docs-caption", children: [
13530
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13644
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share", children: [
13645
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "w100n-docs-caption", children: [
13646
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Link, { "aria-hidden": true }),
13531
13647
  t.guestLinks,
13532
- on2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: on2.filter((l) => !l.ended).length })
13648
+ on2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: on2.filter((l) => !l.ended).length })
13533
13649
  ] }),
13534
- links.error && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-docs-note", children: [
13650
+ links.error && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-docs-note", children: [
13535
13651
  t.failed,
13536
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: links.retry, children: t.retry })
13652
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: links.retry, children: t.retry })
13537
13653
  ] }),
13538
- links.data && !on2.length && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-muted", children: t.noLinks }),
13539
- state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
13540
- on2.map((l) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
13541
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
13542
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }) }),
13543
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13544
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: l.comment ? t.commentLink : t.viewLink }),
13545
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
13654
+ links.data && !on2.length && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", children: t.noLinks }),
13655
+ state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
13656
+ on2.map((l) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
13657
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { children: [
13658
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }) }),
13659
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13660
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: l.comment ? t.commentLink : t.viewLink }),
13661
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
13546
13662
  t.madeBy.replace("{name}", l.createdBy.name),
13547
13663
  " \xB7 ",
13548
13664
  day(l.createdAt)
13549
13665
  ] })
13550
13666
  ] })
13551
13667
  ] }),
13552
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-chips", children: [
13553
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13554
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Clock, { "aria-hidden": true }),
13668
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-chips", children: [
13669
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13670
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Clock, { "aria-hidden": true }),
13555
13671
  l.ended ? t.linkEnded : l.endsAt ? t.endsOn.replace("{date}", day(l.endsAt)) : t.untilOff
13556
13672
  ] }),
13557
- l.download && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13558
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Download, { "aria-hidden": true }),
13673
+ l.download && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13674
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Download, { "aria-hidden": true }),
13559
13675
  t.downloadOn
13560
13676
  ] }),
13561
- l.password && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13562
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Lock, { "aria-hidden": true }),
13677
+ l.password && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13678
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Lock, { "aria-hidden": true }),
13563
13679
  t.passwordOn
13564
13680
  ] }),
13565
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13566
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }),
13681
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13682
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Eye, { "aria-hidden": true }),
13567
13683
  count(l.guests.reduce((n, g) => n + g.opens, 0), t.openForms)
13568
13684
  ] })
13569
13685
  ] }),
13570
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-url", children: [
13571
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: l.url.replace(/^https?:\/\//, "") }),
13572
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy2(l), children: [
13573
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Copy, { "aria-hidden": true }),
13686
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-url", children: [
13687
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: l.url.replace(/^https?:\/\//, "") }),
13688
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy2(l), children: [
13689
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Copy, { "aria-hidden": true }),
13574
13690
  copied === l.id ? t.copied : t.copy
13575
13691
  ] })
13576
13692
  ] }),
13577
- l.guests.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
13578
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
13579
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: g.name || t.unnamed }),
13580
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
13693
+ l.guests.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
13694
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
13695
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: g.name || t.unnamed }),
13696
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
13581
13697
  g.comments ? count(g.comments, t.commentForms) : count(g.opens, t.openForms),
13582
13698
  " \xB7 ",
13583
13699
  ago(g.lastAt)
13584
13700
  ] })
13585
13701
  ] }, i)) }),
13586
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-tools", children: [
13587
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
13588
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Clock, { "aria-hidden": true }),
13702
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-tools", children: [
13703
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
13704
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Clock, { "aria-hidden": true }),
13589
13705
  t.changeLink
13590
13706
  ] }),
13591
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
13592
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Ban, { "aria-hidden": true }),
13707
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
13708
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Ban, { "aria-hidden": true }),
13593
13709
  t.turnOff
13594
13710
  ] })
13595
13711
  ] })
13596
13712
  ] }, l.id)),
13597
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
13713
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
13598
13714
  setState("idle");
13599
13715
  setForm(blank5);
13600
13716
  }, children: [
13601
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Plus, { "aria-hidden": true }),
13717
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Plus, { "aria-hidden": true }),
13602
13718
  t.newLink
13603
13719
  ] }),
13604
- team && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
13605
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "w100n-docs-caption", children: [
13606
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Users, { "aria-hidden": true }),
13720
+ team && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
13721
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "w100n-docs-caption", children: [
13722
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Users, { "aria-hidden": true }),
13607
13723
  t.inTeam
13608
13724
  ] }),
13609
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-share-team", children: [
13610
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-share-tile", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react9.Users, { "aria-hidden": true }) }),
13611
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
13612
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: t.peopleOf.replace("{space}", team) }),
13613
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: t.teamHint })
13725
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-share-team", children: [
13726
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w100n-share-tile", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.Users, { "aria-hidden": true }) }),
13727
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
13728
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: t.peopleOf.replace("{space}", team) }),
13729
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: t.teamHint })
13614
13730
  ] })
13615
13731
  ] })
13616
13732
  ] })
@@ -13621,7 +13737,7 @@ function Sharing({ host, doc, t, language, team }) {
13621
13737
  init_text();
13622
13738
 
13623
13739
  // src/Thumb.tsx
13624
- var import_react15 = require("react");
13740
+ var import_react16 = require("react");
13625
13741
 
13626
13742
  // src/preview.ts
13627
13743
  var cache = /* @__PURE__ */ new Map();
@@ -13674,12 +13790,12 @@ function preview(host, doc) {
13674
13790
  }
13675
13791
 
13676
13792
  // src/Thumb.tsx
13677
- var import_jsx_runtime11 = require("react/jsx-runtime");
13793
+ var import_jsx_runtime12 = require("react/jsx-runtime");
13678
13794
  function Thumb({ host, item, label }) {
13679
- const box2 = (0, import_react15.useRef)(null);
13680
- const [seen2, setSeen] = (0, import_react15.useState)(false);
13681
- const [shot, setShot] = (0, import_react15.useState)(null);
13682
- (0, import_react15.useEffect)(() => {
13795
+ const box2 = (0, import_react16.useRef)(null);
13796
+ const [seen2, setSeen] = (0, import_react16.useState)(false);
13797
+ const [shot, setShot] = (0, import_react16.useState)(null);
13798
+ (0, import_react16.useEffect)(() => {
13683
13799
  if (item.thumbnailUrl || item.excerpt || typeof IntersectionObserver === "undefined") return;
13684
13800
  const watch = new IntersectionObserver((entries2) => {
13685
13801
  if (entries2.some((entry2) => entry2.isIntersecting)) setSeen(true);
@@ -13687,7 +13803,7 @@ function Thumb({ host, item, label }) {
13687
13803
  watch.observe(box2.current);
13688
13804
  return () => watch.disconnect();
13689
13805
  }, [item.thumbnailUrl, item.excerpt]);
13690
- (0, import_react15.useEffect)(() => {
13806
+ (0, import_react16.useEffect)(() => {
13691
13807
  if (!seen2) return;
13692
13808
  let live = true;
13693
13809
  void preview(host, item).then((found) => {
@@ -13700,53 +13816,53 @@ function Thumb({ host, item, label }) {
13700
13816
  const text = item.excerpt ?? shot?.text ?? "";
13701
13817
  const lines2 = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
13702
13818
  const image = item.thumbnailUrl ?? shot?.image;
13703
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
13704
- image ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
13705
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: lines2[0] }),
13819
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
13820
+ image ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
13821
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("b", { children: lines2[0] }),
13706
13822
  lines2.slice(1, 14).join(" ")
13707
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
13708
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
13709
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
13710
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
13711
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
13712
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {})
13823
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
13824
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
13825
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
13826
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
13827
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
13828
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {})
13713
13829
  ] }) }),
13714
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
13830
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
13715
13831
  ] });
13716
13832
  }
13717
13833
 
13718
13834
  // src/DocumentsWorkspace.tsx
13719
13835
  init_useLoad();
13720
- var import_jsx_runtime13 = require("react/jsx-runtime");
13721
- var TextEditor3 = (0, import_react16.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
13722
- var SheetView3 = (0, import_react16.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
13723
- var Compare2 = (0, import_react16.lazy)(() => Promise.resolve().then(() => (init_Compare(), Compare_exports)));
13836
+ var import_jsx_runtime14 = require("react/jsx-runtime");
13837
+ var TextEditor3 = (0, import_react17.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
13838
+ var SheetView3 = (0, import_react17.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
13839
+ var Compare2 = (0, import_react17.lazy)(() => Promise.resolve().then(() => (init_Compare(), Compare_exports)));
13724
13840
  var icons3 = { docx: import_lucide_react10.FileText, markdown: import_lucide_react10.FileType, pdf: import_lucide_react10.Files, sheet: import_lucide_react10.FileSpreadsheet, slides: import_lucide_react10.Presentation };
13725
13841
  function DocumentsWorkspace({ host, language = "en", theme = "light", place: place2, onPlace, start, end, aside, actions }) {
13726
13842
  const t = texts[language];
13727
- const [own, setOwn] = (0, import_react16.useState)({ spaceId: null, documentId: null });
13843
+ const [own, setOwn] = (0, import_react17.useState)({ spaceId: null, documentId: null });
13728
13844
  const here = place2 ?? own;
13729
13845
  const go = (next) => {
13730
13846
  setOwn(next);
13731
13847
  onPlace?.(next);
13732
13848
  };
13733
- const [query, setQuery] = (0, import_react16.useState)("");
13734
- const [picked, setPicked] = (0, import_react16.useState)([]);
13735
- const [typing, setTyping] = (0, import_react16.useState)(false);
13736
- const [menusAt, setMenusAt] = (0, import_react16.useState)(null);
13737
- const [renaming, setRenaming] = (0, import_react16.useState)(null);
13738
- const [renamed2, setRenamed] = (0, import_react16.useState)("idle");
13739
- const [statusAt, setStatusAt] = (0, import_react16.useState)(null);
13740
- const [listOpen, setListOpen] = (0, import_react16.useState)(true);
13741
- const [panelOpen, setPanelOpen] = (0, import_react16.useState)(true);
13742
- const [narrow, setNarrow] = (0, import_react16.useState)(false);
13743
- const body = (0, import_react16.useRef)(null);
13744
- const listButton = (0, import_react16.useRef)(null);
13745
- const panelButton = (0, import_react16.useRef)(null);
13746
- const listClose = (0, import_react16.useRef)(null);
13747
- const panel = (0, import_react16.useRef)(null);
13748
- const guard = (0, import_react16.useRef)(null);
13749
- (0, import_react16.useLayoutEffect)(() => {
13849
+ const [query, setQuery] = (0, import_react17.useState)("");
13850
+ const [picked, setPicked] = (0, import_react17.useState)([]);
13851
+ const [typing, setTyping] = (0, import_react17.useState)(false);
13852
+ const [menusAt, setMenusAt] = (0, import_react17.useState)(null);
13853
+ const [renaming, setRenaming] = (0, import_react17.useState)(null);
13854
+ const [renamed2, setRenamed] = (0, import_react17.useState)("idle");
13855
+ const [statusAt, setStatusAt] = (0, import_react17.useState)(null);
13856
+ const [listOpen, setListOpen] = (0, import_react17.useState)(true);
13857
+ const [panelOpen, setPanelOpen] = (0, import_react17.useState)(true);
13858
+ const [narrow, setNarrow] = (0, import_react17.useState)(false);
13859
+ const body = (0, import_react17.useRef)(null);
13860
+ const listButton = (0, import_react17.useRef)(null);
13861
+ const panelButton = (0, import_react17.useRef)(null);
13862
+ const listClose = (0, import_react17.useRef)(null);
13863
+ const panel = (0, import_react17.useRef)(null);
13864
+ const guard = (0, import_react17.useRef)(null);
13865
+ (0, import_react17.useLayoutEffect)(() => {
13750
13866
  const el = body.current;
13751
13867
  let was = false;
13752
13868
  const check = () => {
@@ -13764,9 +13880,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13764
13880
  watch.observe(el);
13765
13881
  return () => watch.disconnect();
13766
13882
  }, [here.documentId]);
13767
- const [picking, setPicking] = (0, import_react16.useState)(false);
13768
- const [adding, setAdding] = (0, import_react16.useState)(false);
13769
- (0, import_react16.useEffect)(() => {
13883
+ const [picking, setPicking] = (0, import_react17.useState)(false);
13884
+ const [adding, setAdding] = (0, import_react17.useState)(false);
13885
+ (0, import_react17.useEffect)(() => {
13770
13886
  if (!adding) return;
13771
13887
  const close = (e) => {
13772
13888
  if (!e.target.closest(".w100n-docs-new")) setAdding(false);
@@ -13774,7 +13890,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13774
13890
  document.addEventListener("pointerdown", close);
13775
13891
  return () => document.removeEventListener("pointerdown", close);
13776
13892
  }, [adding]);
13777
- (0, import_react16.useEffect)(() => {
13893
+ (0, import_react17.useEffect)(() => {
13778
13894
  if (!typing) return;
13779
13895
  const close = (e) => {
13780
13896
  if (!e.target.closest(".w100n-docs-types")) setTyping(false);
@@ -13782,7 +13898,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13782
13898
  document.addEventListener("pointerdown", close);
13783
13899
  return () => document.removeEventListener("pointerdown", close);
13784
13900
  }, [typing]);
13785
- (0, import_react16.useEffect)(() => {
13901
+ (0, import_react17.useEffect)(() => {
13786
13902
  if (!picking) return;
13787
13903
  const close = (e) => {
13788
13904
  if (!e.target.closest(".w100n-docs-picker")) setPicking(false);
@@ -13790,21 +13906,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13790
13906
  document.addEventListener("pointerdown", close);
13791
13907
  return () => document.removeEventListener("pointerdown", close);
13792
13908
  }, [picking]);
13793
- const [tab, setTab] = (0, import_react16.useState)("outline");
13794
- const [outline2, setOutline] = (0, import_react16.useState)([]);
13795
- const [reading, setReading] = (0, import_react16.useState)(null);
13796
- const [hunt, setHunt] = (0, import_react16.useState)("");
13797
- const [fold, setFold] = (0, import_react16.useState)({});
13798
- const [version2, setVersion] = (0, import_react16.useState)({ documentId: null, id: null });
13909
+ const [tab, setTab] = (0, import_react17.useState)("outline");
13910
+ const [outline2, setOutline] = (0, import_react17.useState)([]);
13911
+ const [reading, setReading] = (0, import_react17.useState)(null);
13912
+ const [hunt, setHunt] = (0, import_react17.useState)("");
13913
+ const [fold, setFold] = (0, import_react17.useState)({});
13914
+ const [version2, setVersion] = (0, import_react17.useState)({ documentId: null, id: null });
13799
13915
  const versionId = version2.documentId === here.documentId ? version2.id : null;
13800
- const [comparing, setComparing] = (0, import_react16.useState)(false);
13801
- const [restoring, setRestoring] = (0, import_react16.useState)("idle");
13802
- const [exporting, setExporting] = (0, import_react16.useState)("idle");
13803
- const [copying, setCopying] = (0, import_react16.useState)("idle");
13804
- const [box2, setBox] = (0, import_react16.useState)(null);
13805
- const [making, setMaking] = (0, import_react16.useState)(false);
13806
- const [sending, setSending] = (0, import_react16.useState)("idle");
13807
- const upload = (0, import_react16.useRef)(null);
13916
+ const [comparing, setComparing] = (0, import_react17.useState)(false);
13917
+ const [restoring, setRestoring] = (0, import_react17.useState)("idle");
13918
+ const [exporting, setExporting] = (0, import_react17.useState)("idle");
13919
+ const [copying, setCopying] = (0, import_react17.useState)("idle");
13920
+ const [kept, setKept] = (0, import_react17.useState)(null);
13921
+ const [box2, setBox] = (0, import_react17.useState)(null);
13922
+ const [making, setMaking] = (0, import_react17.useState)(false);
13923
+ const [sending, setSending] = (0, import_react17.useState)("idle");
13924
+ const upload = (0, import_react17.useRef)(null);
13808
13925
  const spaces = useLoad((signal) => host.spaces({ signal }), [host]);
13809
13926
  const single = spaces.data?.length === 1 ? spaces.data[0].id : null;
13810
13927
  const spaceId = here.spaceId ?? single;
@@ -13815,7 +13932,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13815
13932
  const all2 = await host.spaces({ signal });
13816
13933
  return (await Promise.all(all2.map((item) => host.documents(item.id, { signal })))).flat();
13817
13934
  }, [host, spaceId]);
13818
- (0, import_react16.useEffect)(() => {
13935
+ (0, import_react17.useEffect)(() => {
13819
13936
  const sync = () => {
13820
13937
  if (document.visibilityState !== "visible") return;
13821
13938
  spaces.retry();
@@ -13838,7 +13955,14 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13838
13955
  const docbar = text && !versionId && !narrow;
13839
13956
  const signatures = useLoad((signal) => here.documentId && pdf && host.signatures ? host.signatures(here.documentId, { signal }) : Promise.resolve([]), [host, here.documentId, pdf]);
13840
13957
  const all = list.data ?? [];
13841
- const shown = all.filter((item) => matches(item, query, picked));
13958
+ const deep = useLoad(async (signal) => {
13959
+ const text2 = query.trim();
13960
+ if (!host.search || text2.length < 2) return [];
13961
+ await new Promise((done) => setTimeout(done, 300));
13962
+ return signal.aborted ? [] : host.search(text2, { signal });
13963
+ }, [host, query]);
13964
+ const inside2 = new Map((deep.data ?? []).map((hit2) => [hit2.id, hit2.excerpt]));
13965
+ const shown = all.filter((item) => matches(item, query, picked) || inside2.has(item.id) && matches(item, "", picked));
13842
13966
  const present = kinds.filter((item) => all.some((doc2) => doc2.kind === item));
13843
13967
  const folders = spaceId ? [.../* @__PURE__ */ new Set(["", ...shown.map((item) => item.folder ?? "")])].filter((folder2) => shown.some((item) => (item.folder ?? "") === folder2)) : [""];
13844
13968
  const names2 = new Map((spaces.data ?? []).map((item) => [item.id, item.name]));
@@ -13855,9 +13979,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13855
13979
  return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
13856
13980
  };
13857
13981
  const size2 = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
13858
- const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-note", children: [
13982
+ const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-note", children: [
13859
13983
  t.failed,
13860
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: retry, children: t.retry })
13984
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: retry, children: t.retry })
13861
13985
  ] });
13862
13986
  const { ask, dialog } = useUnsaved(guard, t);
13863
13987
  const side2 = (which, open2) => {
@@ -13948,6 +14072,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13948
14072
  setCopying("failed");
13949
14073
  }
13950
14074
  };
14075
+ const keep = async (file) => {
14076
+ setKept({ id: file.id, state: "busy" });
14077
+ try {
14078
+ await host.saveTemplate(file.id);
14079
+ setKept({ id: file.id, state: "done" });
14080
+ } catch {
14081
+ setKept({ id: file.id, state: "failed" });
14082
+ }
14083
+ };
13951
14084
  const rename = async (file, draft) => {
13952
14085
  setRenaming(null);
13953
14086
  const ext = /\.[^.]+$/.exec(file.name)?.[0] ?? "";
@@ -13976,8 +14109,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13976
14109
  setSending("failed");
13977
14110
  }
13978
14111
  };
13979
- let stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-empty", children: [
13980
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FileText, { "aria-hidden": true }),
14112
+ let stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-empty", children: [
14113
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileText, { "aria-hidden": true }),
13981
14114
  t.pick
13982
14115
  ] });
13983
14116
  if (here.documentId) {
@@ -13985,9 +14118,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
13985
14118
  doc.retry();
13986
14119
  content.retry();
13987
14120
  });
13988
- else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
13989
- else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react16.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
13990
- else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react16.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14121
+ else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
14122
+ else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
14123
+ else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
13991
14124
  TextEditor3,
13992
14125
  {
13993
14126
  kind: doc.data.kind,
@@ -14012,7 +14145,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14012
14145
  formats: host.exportAs ? doc.data.exports ?? [] : [],
14013
14146
  download: (f) => void exportAs(doc.data, f),
14014
14147
  copy: host.create ? () => void copy2(doc.data) : void 0,
14015
- rename: host.rename && doc.data.rights.edit ? () => setRenaming(doc.data.name.replace(/\.[^.]+$/, "")) : void 0
14148
+ rename: host.rename && doc.data.rights.edit ? () => setRenaming(doc.data.name.replace(/\.[^.]+$/, "")) : void 0,
14149
+ template: host.saveTemplate && doc.data.rights.edit ? () => void keep(doc.data) : void 0
14016
14150
  },
14017
14151
  onSaved: () => {
14018
14152
  versions.retry();
@@ -14022,7 +14156,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14022
14156
  },
14023
14157
  doc.data.id
14024
14158
  ) });
14025
- else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14159
+ else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14026
14160
  PdfView,
14027
14161
  {
14028
14162
  bytes: content.data,
@@ -14044,7 +14178,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14044
14178
  },
14045
14179
  `${doc.data.id}:${versionId ?? ""}`
14046
14180
  );
14047
- else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14181
+ else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14048
14182
  SlidesView,
14049
14183
  {
14050
14184
  html: new TextDecoder().decode(content.data),
@@ -14063,7 +14197,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14063
14197
  },
14064
14198
  doc.data.id
14065
14199
  );
14066
- else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react16.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14200
+ else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14067
14201
  SheetView3,
14068
14202
  {
14069
14203
  bytes: content.data,
@@ -14090,7 +14224,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14090
14224
  },
14091
14225
  `${doc.data.id}:${versionId ?? ""}`
14092
14226
  ) });
14093
- else stage = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
14227
+ else stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
14094
14228
  }
14095
14229
  const Kind = doc.data ? icons3[doc.data.kind] : import_lucide_react10.FileText;
14096
14230
  const top = Math.min(...outline2.map((h) => h.level));
@@ -14110,7 +14244,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14110
14244
  if (text && host.comments && !versionId) panelTabs.push(["comments", import_lucide_react10.MessagesSquare, t.comments]);
14111
14245
  const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
14112
14246
  if (sharing) panelTabs.push(["sharing", import_lucide_react10.Share2, t.sharing]);
14113
- const listToggle = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14247
+ const listToggle = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14114
14248
  "button",
14115
14249
  {
14116
14250
  ref: listButton,
@@ -14120,10 +14254,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14120
14254
  onClick: () => side2("list", !listOpen),
14121
14255
  "aria-label": listOpen ? t.closeList : t.openList,
14122
14256
  title: listOpen ? t.closeList : t.openList,
14123
- children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.PanelLeftOpen, { "aria-hidden": true })
14257
+ children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.PanelLeftOpen, { "aria-hidden": true })
14124
14258
  }
14125
14259
  );
14126
- const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14260
+ const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14127
14261
  "button",
14128
14262
  {
14129
14263
  ref: panelButton,
@@ -14133,16 +14267,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14133
14267
  onClick: () => side2("panel", !panelOpen),
14134
14268
  "aria-label": panelOpen ? t.closePanel : t.openPanel,
14135
14269
  title: panelOpen ? t.closePanel : t.openPanel,
14136
- children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.PanelRightOpen, { "aria-hidden": true })
14270
+ children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.PanelRightOpen, { "aria-hidden": true })
14137
14271
  }
14138
14272
  );
14139
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
14140
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "w100n-docs-bar", children: [
14141
- start && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
14273
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
14274
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "w100n-docs-bar", children: [
14275
+ start && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
14142
14276
  narrow && listToggle,
14143
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Kind, { "aria-hidden": true }) }),
14144
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-heading", children: [
14145
- renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14277
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Kind, { "aria-hidden": true }) }),
14278
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-heading", children: [
14279
+ renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14146
14280
  "input",
14147
14281
  {
14148
14282
  className: "w100n-docs-title w100n-docs-rename",
@@ -14160,7 +14294,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14160
14294
  }
14161
14295
  }
14162
14296
  }
14163
- ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
14297
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14164
14298
  "strong",
14165
14299
  {
14166
14300
  className: "w100n-docs-title",
@@ -14169,195 +14303,198 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14169
14303
  children: doc.data?.name ?? t.documents
14170
14304
  }
14171
14305
  ),
14172
- docbar ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
14173
- i > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronRight, { "aria-hidden": true }),
14306
+ docbar ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
14307
+ i > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronRight, { "aria-hidden": true }),
14174
14308
  item
14175
- ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
14309
+ ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
14176
14310
  ] }),
14177
- versionId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
14178
- versionId && text && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
14179
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FileDiff, { "aria-hidden": true }),
14311
+ versionId && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
14312
+ versionId && text && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
14313
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileDiff, { "aria-hidden": true }),
14180
14314
  comparing ? t.hideChanges : t.showChanges
14181
14315
  ] }),
14182
- versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
14183
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.RotateCcw, { "aria-hidden": true }),
14316
+ versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
14317
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.RotateCcw, { "aria-hidden": true }),
14184
14318
  t.restore
14185
14319
  ] }),
14186
- restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
14187
- doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
14188
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FileSpreadsheet, { "aria-hidden": true }),
14320
+ restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
14321
+ doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
14322
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileSpreadsheet, { "aria-hidden": true }),
14189
14323
  t.copyAs
14190
14324
  ] }),
14191
- copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
14192
- renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
14193
- docbar && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
14194
- sharing && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
14325
+ copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
14326
+ kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
14327
+ kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
14328
+ renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
14329
+ docbar && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
14330
+ sharing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
14195
14331
  setTab("sharing");
14196
14332
  side2("panel", true);
14197
14333
  }, children: [
14198
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Share2, { "aria-hidden": true }),
14199
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t.share })
14334
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Share2, { "aria-hidden": true }),
14335
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.share })
14200
14336
  ] }),
14201
14337
  doc.data && !versionId && actions?.(doc.data),
14202
14338
  narrow && panelToggle,
14203
- end && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
14339
+ end && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
14204
14340
  ] }),
14205
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
14206
- listOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
14207
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-head", children: [
14208
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-row", children: [
14209
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "w100n-docs-caption", children: [
14210
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Files, { "aria-hidden": true }),
14341
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
14342
+ listOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
14343
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-head", children: [
14344
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-row", children: [
14345
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "w100n-docs-caption", children: [
14346
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Files, { "aria-hidden": true }),
14211
14347
  t.documents,
14212
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: all.length })
14348
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: all.length })
14213
14349
  ] }),
14214
- host.create && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
14350
+ host.create && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
14215
14351
  if (e.key === "Escape" && adding) {
14216
14352
  e.stopPropagation();
14217
14353
  setAdding(false);
14218
14354
  }
14219
14355
  }, children: [
14220
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
14221
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Plus, { "aria-hidden": true }),
14222
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
14223
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14356
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
14357
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Plus, { "aria-hidden": true }),
14358
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
14359
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14224
14360
  ] }),
14225
- adding && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
14226
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14361
+ adding && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
14362
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14227
14363
  setAdding(false);
14228
14364
  setMaking(true);
14229
14365
  }, children: [
14230
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FilePlus, { "aria-hidden": true }) }),
14231
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.newTitle })
14366
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FilePlus, { "aria-hidden": true }) }),
14367
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.newTitle })
14232
14368
  ] }),
14233
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14369
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
14234
14370
  setAdding(false);
14235
14371
  upload.current.click();
14236
14372
  }, children: [
14237
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Upload, { "aria-hidden": true }) }),
14238
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.uploadFile })
14373
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Upload, { "aria-hidden": true }) }),
14374
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.uploadFile })
14239
14375
  ] })
14240
14376
  ] }),
14241
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
14377
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
14242
14378
  const file = e.target.files?.[0];
14243
14379
  e.target.value = "";
14244
14380
  if (file) void send(file);
14245
14381
  } })
14246
14382
  ] }),
14247
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.X, { "aria-hidden": true }) })
14383
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.X, { "aria-hidden": true }) })
14248
14384
  ] }),
14249
- (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
14385
+ (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
14250
14386
  if (e.key !== "Escape" || !picking) return;
14251
14387
  e.stopPropagation();
14252
14388
  setPicking(false);
14253
14389
  e.currentTarget.querySelector("button").focus();
14254
14390
  }, children: [
14255
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
14256
- space ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.LayoutGrid, { "aria-hidden": true }) }),
14257
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: space?.name ?? t.allProjects }),
14258
- !space && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-count", children: all.length }),
14259
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14391
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
14392
+ space ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.LayoutGrid, { "aria-hidden": true }) }),
14393
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: space?.name ?? t.allProjects }),
14394
+ !space && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-count", children: all.length }),
14395
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14260
14396
  ] }),
14261
- picking && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
14262
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
14263
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.LayoutGrid, { "aria-hidden": true }) }),
14264
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.allProjects }),
14265
- !spaceId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Check, { "aria-hidden": true })
14397
+ picking && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
14398
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
14399
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.LayoutGrid, { "aria-hidden": true }) }),
14400
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.allProjects }),
14401
+ !spaceId && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Check, { "aria-hidden": true })
14266
14402
  ] }),
14267
- groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
14268
- group && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
14269
- (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
14270
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
14271
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: item.name }),
14272
- !spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
14273
- item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Check, { "aria-hidden": true })
14403
+ groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
14404
+ group && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
14405
+ (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
14406
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
14407
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.name }),
14408
+ !spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
14409
+ item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Check, { "aria-hidden": true })
14274
14410
  ] }, item.id))
14275
14411
  ] }, group))
14276
14412
  ] })
14277
14413
  ] }),
14278
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-filters", children: [
14279
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
14280
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Search, { "aria-hidden": true }),
14281
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search })
14414
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-filters", children: [
14415
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
14416
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Search, { "aria-hidden": true }),
14417
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search })
14282
14418
  ] }),
14283
- present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
14419
+ present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
14284
14420
  if (e.key !== "Escape" || !typing) return;
14285
14421
  e.stopPropagation();
14286
14422
  setTyping(false);
14287
14423
  e.currentTarget.querySelector("button").focus();
14288
14424
  }, children: [
14289
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
14290
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ListFilter, { "aria-hidden": true }),
14291
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.typeFilter }),
14292
- picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
14293
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14425
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
14426
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ListFilter, { "aria-hidden": true }),
14427
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.typeFilter }),
14428
+ picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
14429
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true })
14294
14430
  ] }),
14295
- typing && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
14431
+ typing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
14296
14432
  present.map((item) => {
14297
14433
  const Icon = icons3[item];
14298
14434
  const on2 = picked.includes(item);
14299
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
14300
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Check, { "aria-hidden": true }) }),
14301
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { "aria-hidden": true }) }),
14302
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.kinds[item] }),
14303
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
14435
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
14436
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Check, { "aria-hidden": true }) }),
14437
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { "aria-hidden": true }) }),
14438
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.kinds[item] }),
14439
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
14304
14440
  ] }, item);
14305
14441
  }),
14306
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
14307
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
14308
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
14442
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
14443
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
14444
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
14309
14445
  ] })
14310
14446
  ] })
14311
14447
  ] })
14312
14448
  ] }),
14313
- picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
14449
+ picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
14314
14450
  t.kinds[item],
14315
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.X, { "aria-hidden": true })
14451
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.X, { "aria-hidden": true })
14316
14452
  ] }, item)) })
14317
14453
  ] }),
14318
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-cards", children: [
14319
- sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
14454
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-cards", children: [
14455
+ sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
14320
14456
  list.error && failed(list.retry),
14321
- list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
14322
- list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
14323
- folders.map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
14324
- folders.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
14325
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-card", "aria-current": item.id === here.documentId, onClick: () => open(item), title: item.name, children: [
14326
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
14327
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "w100n-docs-card-text", children: [
14328
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: item.name }),
14329
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") })
14457
+ list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
14458
+ list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
14459
+ folders.map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
14460
+ folders.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
14461
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-card", "aria-current": item.id === here.documentId, onClick: () => open(item), title: item.name, children: [
14462
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
14463
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-docs-card-text", children: [
14464
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.name }),
14465
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
14466
+ inside2.get(item.id) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { className: "w100n-docs-hit", children: inside2.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("mark", { children: part }, i) : part) })
14330
14467
  ] })
14331
14468
  ] }, item.id)) })
14332
14469
  ] }, folder2))
14333
14470
  ] })
14334
14471
  ] }),
14335
14472
  !narrow && !listOpen && listToggle,
14336
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("main", { className: "w100n-docs-stage", children: [
14473
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("main", { className: "w100n-docs-stage", children: [
14337
14474
  !narrow && !panelOpen && panelToggle,
14338
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-bare", children: stage })
14475
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-bare", children: stage })
14339
14476
  ] }),
14340
- doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
14341
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-row", children: [
14342
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
14343
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { "aria-hidden": true }),
14344
- (panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: label })
14477
+ doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
14478
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-row", children: [
14479
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
14480
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { "aria-hidden": true }),
14481
+ (panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: label })
14345
14482
  ] }, key2)) }),
14346
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.X, { "aria-hidden": true }) })
14483
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.X, { "aria-hidden": true }) })
14347
14484
  ] }) }),
14348
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
14349
- tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
14350
- now && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-reading", children: [
14351
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
14352
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
14485
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
14486
+ tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
14487
+ now && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-reading", children: [
14488
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
14489
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
14353
14490
  Math.round(now.progress * 100),
14354
14491
  "% ",
14355
14492
  t.read
14356
14493
  ] })
14357
14494
  ] }),
14358
- outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
14359
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Search, { "aria-hidden": true }),
14360
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
14495
+ outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
14496
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Search, { "aria-hidden": true }),
14497
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
14361
14498
  ] }),
14362
14499
  chapters.map((c, i) => {
14363
14500
  const subs = words3.length ? c.subs.filter(hit) : c.subs;
@@ -14365,13 +14502,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14365
14502
  const opened3 = words3.length > 0 || (fold[c.head.id] ?? i === reached);
14366
14503
  const named3 = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
14367
14504
  const mark = c.subs.findIndex((s) => s.id === now?.id);
14368
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
14369
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
14370
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
14371
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.Bookmark, { "aria-hidden": true }) }),
14372
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: named3 ? named3[2] : c.head.text })
14505
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
14506
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
14507
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
14508
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.Bookmark, { "aria-hidden": true }) }),
14509
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: named3 ? named3[2] : c.head.text })
14373
14510
  ] }),
14374
- c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14511
+ c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14375
14512
  "button",
14376
14513
  {
14377
14514
  type: "button",
@@ -14381,13 +14518,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14381
14518
  title: opened3 ? t.hideSections : t.showSections,
14382
14519
  onClick: () => setFold({ ...fold, [c.head.id]: !opened3 }),
14383
14520
  children: [
14384
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: c.subs.length }),
14385
- opened3 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.ChevronRight, { "aria-hidden": true })
14521
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: c.subs.length }),
14522
+ opened3 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.ChevronRight, { "aria-hidden": true })
14386
14523
  ]
14387
14524
  }
14388
14525
  )
14389
14526
  ] }),
14390
- opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14527
+ opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14391
14528
  "button",
14392
14529
  {
14393
14530
  type: "button",
@@ -14396,7 +14533,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14396
14533
  "data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
14397
14534
  "aria-current": now?.id === s.id ? "location" : void 0,
14398
14535
  children: [
14399
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { "aria-hidden": true }),
14536
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": true }),
14400
14537
  s.text
14401
14538
  ]
14402
14539
  },
@@ -14404,46 +14541,46 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14404
14541
  )) })
14405
14542
  ] }, c.head.id);
14406
14543
  })
14407
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
14408
- tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-versions", children: [
14544
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
14545
+ tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-versions", children: [
14409
14546
  versions.error && failed(versions.retry),
14410
- (versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14547
+ (versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14411
14548
  "button",
14412
14549
  {
14413
14550
  type: "button",
14414
14551
  "aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
14415
14552
  onClick: () => view(item.current ? null : item.id),
14416
14553
  children: [
14417
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
14554
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("b", { children: [
14418
14555
  date(item.createdAt),
14419
- item.current && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-badge", children: t.current })
14556
+ item.current && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-badge", children: t.current })
14420
14557
  ] }),
14421
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
14558
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
14422
14559
  ]
14423
14560
  },
14424
14561
  item.id
14425
14562
  ))
14426
14563
  ] }),
14427
- tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dl", { className: "w100n-docs-details", children: [
14428
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t.kind }),
14429
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: t.kinds[doc.data.kind] }),
14430
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t.size }),
14431
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: size2(doc.data.size) }),
14432
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t.updated }),
14433
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: date(doc.data.updatedAt) }),
14434
- doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
14435
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t.by }),
14436
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: doc.data.updatedBy.name })
14564
+ tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dl", { className: "w100n-docs-details", children: [
14565
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t.kind }),
14566
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: t.kinds[doc.data.kind] }),
14567
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t.size }),
14568
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: size2(doc.data.size) }),
14569
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t.updated }),
14570
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: date(doc.data.updatedAt) }),
14571
+ doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14572
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t.by }),
14573
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: doc.data.updatedBy.name })
14437
14574
  ] }),
14438
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t.rights }),
14439
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
14575
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t.rights }),
14576
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
14440
14577
  ] }),
14441
- tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-about", children: [
14442
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "w100n-docs-caption", children: [
14443
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FileDown, { "aria-hidden": true }),
14578
+ tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-about", children: [
14579
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "w100n-docs-caption", children: [
14580
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileDown, { "aria-hidden": true }),
14444
14581
  t.exportAs
14445
14582
  ] }),
14446
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14583
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14447
14584
  "button",
14448
14585
  {
14449
14586
  type: "button",
@@ -14451,22 +14588,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14451
14588
  disabled: exporting === "busy",
14452
14589
  onClick: () => void exportAs(doc.data, format),
14453
14590
  children: [
14454
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react10.FileDown, { "aria-hidden": true }),
14591
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react10.FileDown, { "aria-hidden": true }),
14455
14592
  format.toUpperCase()
14456
14593
  ]
14457
14594
  },
14458
14595
  format
14459
14596
  )) }),
14460
- exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
14597
+ exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
14461
14598
  ] }),
14462
- tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: setBox }),
14463
- tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
14464
- tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-docs-versions", children: [
14599
+ tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: setBox }),
14600
+ tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
14601
+ tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-versions", children: [
14465
14602
  signatures.error && failed(signatures.retry),
14466
- signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
14603
+ signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
14467
14604
  (signatures.data ?? []).map((entry2) => {
14468
14605
  const signed = versions.data?.find((v) => v.id === entry2.versionId);
14469
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14606
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14470
14607
  "button",
14471
14608
  {
14472
14609
  type: "button",
@@ -14474,15 +14611,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14474
14611
  "aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
14475
14612
  onClick: () => view(signed.current ? null : signed.id),
14476
14613
  children: [
14477
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
14614
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("b", { children: [
14478
14615
  entry2.signer.name,
14479
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "w100n-docs-badge", children: [
14616
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-docs-badge", children: [
14480
14617
  t.page,
14481
14618
  " ",
14482
14619
  entry2.page
14483
14620
  ] })
14484
14621
  ] }),
14485
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
14622
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
14486
14623
  ]
14487
14624
  },
14488
14625
  entry2.id
@@ -14493,7 +14630,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14493
14630
  ] })
14494
14631
  ] })
14495
14632
  ] }),
14496
- making && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
14633
+ making && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
14497
14634
  setMaking(false);
14498
14635
  opened2(made2);
14499
14636
  } }),
@@ -14502,13 +14639,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14502
14639
  }
14503
14640
 
14504
14641
  // src/GuestDocument.tsx
14505
- var import_react17 = require("react");
14642
+ var import_react18 = require("react");
14506
14643
  var import_lucide_react11 = require("lucide-react");
14507
14644
  init_text();
14508
14645
  init_useLoad();
14509
- var import_jsx_runtime14 = require("react/jsx-runtime");
14510
- var TextEditor4 = (0, import_react17.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
14511
- var SheetView4 = (0, import_react17.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
14646
+ var import_jsx_runtime15 = require("react/jsx-runtime");
14647
+ var TextEditor4 = (0, import_react18.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
14648
+ var SheetView4 = (0, import_react18.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
14512
14649
  var icons4 = { docx: import_lucide_react11.FileText, markdown: import_lucide_react11.FileType, pdf: import_lucide_react11.Files, sheet: import_lucide_react11.FileSpreadsheet, slides: import_lucide_react11.Presentation };
14513
14650
  var GuestRefused = class extends Error {
14514
14651
  constructor(reason, file = "", sharedBy = "") {
@@ -14534,14 +14671,14 @@ var remember = (name) => {
14534
14671
  };
14535
14672
  function GuestDocument({ host, language = "en", theme = "light", brand }) {
14536
14673
  const t = texts[language];
14537
- const [ask, setAsk] = (0, import_react17.useState)(() => ({ name: remembered() || void 0 }));
14538
- const [typed, setTyped] = (0, import_react17.useState)("");
14539
- const [name, setName] = (0, import_react17.useState)(remembered);
14540
- const named3 = (0, import_react17.useRef)(name);
14541
- const [slot, setSlot] = (0, import_react17.useState)(null);
14542
- const [saving, setSaving] = (0, import_react17.useState)("idle");
14674
+ const [ask, setAsk] = (0, import_react18.useState)(() => ({ name: remembered() || void 0 }));
14675
+ const [typed, setTyped] = (0, import_react18.useState)("");
14676
+ const [name, setName] = (0, import_react18.useState)(remembered);
14677
+ const named3 = (0, import_react18.useRef)(name);
14678
+ const [slot, setSlot] = (0, import_react18.useState)(null);
14679
+ const [saving, setSaving] = (0, import_react18.useState)("idle");
14543
14680
  const opened2 = useLoad((signal) => host.open(ask, { signal }), [host, ask]);
14544
- const [notes3] = (0, import_react17.useState)(() => ({
14681
+ const [notes3] = (0, import_react18.useState)(() => ({
14545
14682
  me: { id: "", name: "" },
14546
14683
  spaces: async () => [],
14547
14684
  documents: async () => [],
@@ -14568,17 +14705,17 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14568
14705
  const top = (file2, badge) => {
14569
14706
  const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
14570
14707
  const Kind = kind2 ? icons4[kind2] : import_lucide_react11.FileText;
14571
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
14572
- brand && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-guest-brand", children: brand }),
14573
- file2 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14574
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Kind, { "aria-hidden": true }) }),
14575
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-heading", children: [
14576
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
14577
- file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
14708
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
14709
+ brand && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-guest-brand", children: brand }),
14710
+ file2 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
14711
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Kind, { "aria-hidden": true }) }),
14712
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs-heading", children: [
14713
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
14714
+ file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
14578
14715
  ] }),
14579
- badge && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
14580
- file2.download && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-end", children: [
14581
- (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14716
+ badge && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
14717
+ file2.download && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs-end", children: [
14718
+ (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14582
14719
  "button",
14583
14720
  {
14584
14721
  type: "button",
@@ -14589,25 +14726,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14589
14726
  "aria-label": t.pdfCopy,
14590
14727
  title: t.pdfCopy,
14591
14728
  children: [
14592
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react11.FileDown, { "aria-hidden": true }),
14593
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.pdfCopy })
14729
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.FileDown, { "aria-hidden": true }),
14730
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: t.pdfCopy })
14594
14731
  ]
14595
14732
  }
14596
14733
  ),
14597
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
14598
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react11.Download, { "aria-hidden": true }),
14599
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.download })
14734
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
14735
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.Download, { "aria-hidden": true }),
14736
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: t.download })
14600
14737
  ] })
14601
14738
  ] })
14602
14739
  ] })
14603
14740
  ] });
14604
14741
  };
14605
- const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14742
+ const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14606
14743
  top(null, null),
14607
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-guest-card", children: [
14608
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { "aria-hidden": true }) }),
14609
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: title }),
14610
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: body }),
14744
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-guest-card", children: [
14745
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { "aria-hidden": true }) }),
14746
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { children: title }),
14747
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: body }),
14611
14748
  form
14612
14749
  ] }) })
14613
14750
  ] });
@@ -14623,7 +14760,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14623
14760
  password ? import_lucide_react11.Lock : import_lucide_react11.UserRound,
14624
14761
  refused.file || t.documents,
14625
14762
  shared + (password ? t.passwordAsk : t.nameAsk),
14626
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
14763
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
14627
14764
  e.preventDefault();
14628
14765
  if (!typed.trim()) return;
14629
14766
  if (password) setAsk({ ...ask, password: typed });
@@ -14633,7 +14770,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14633
14770
  }
14634
14771
  setTyped("");
14635
14772
  }, children: [
14636
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14773
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
14637
14774
  "input",
14638
14775
  {
14639
14776
  className: "w100n-share-input",
@@ -14646,21 +14783,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14646
14783
  onChange: (e) => setTyped(e.target.value)
14647
14784
  }
14648
14785
  ),
14649
- refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
14650
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
14651
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react11.Eye, { "aria-hidden": true }),
14786
+ refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
14787
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
14788
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react11.Eye, { "aria-hidden": true }),
14652
14789
  t.openDoc
14653
14790
  ] })
14654
14791
  ] })
14655
14792
  );
14656
14793
  }
14657
14794
  if (refused?.reason === "busy") return gate("slate", import_lucide_react11.Ban, t.failed, t.tooMany);
14658
- return gate("slate", import_lucide_react11.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
14795
+ return gate("slate", import_lucide_react11.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
14659
14796
  }
14660
14797
  const file = opened2.data;
14661
- if (!file) return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14798
+ if (!file) return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14662
14799
  top(null, null),
14663
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
14800
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
14664
14801
  ] });
14665
14802
  const kind = kindOf(file.name, file.mimeType);
14666
14803
  const text = kind === "docx" || kind === "markdown";
@@ -14668,23 +14805,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
14668
14805
  const rights = { view: true, comment: talk, edit: false };
14669
14806
  const quiet3 = () => {
14670
14807
  };
14671
- let stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
14672
- if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
14673
- else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
14674
- else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
14675
- else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
14676
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14808
+ let stage = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
14809
+ if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
14810
+ else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
14811
+ else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
14812
+ else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react18.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
14813
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
14677
14814
  top(file, talk ? t.badgeComment : t.badgeRead),
14678
- saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
14679
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
14680
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
14681
- talk && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-panel-body", children: [
14682
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-share-field", children: [
14683
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.yourName }),
14684
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
14815
+ saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
14816
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
14817
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
14818
+ talk && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-docs-panel-body", children: [
14819
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "w100n-share-field", children: [
14820
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: t.yourName }),
14821
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
14685
14822
  ] }),
14686
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
14687
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: setSlot })
14823
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
14824
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: setSlot })
14688
14825
  ] }) })
14689
14826
  ] })
14690
14827
  ] });