@w100n/documents 0.16.4 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{Compare-M57FG4R3.js → Compare-RHAUAKUJ.js} +2 -2
  2. package/dist/{SheetView-OEKOHMKW.js → SheetView-SBLAFGTL.js} +5 -5
  3. package/dist/{TextEditor-5S7FSLIZ.js → TextEditor-X2GSL4QM.js} +119 -27
  4. package/dist/TextEditor-X2GSL4QM.js.map +1 -0
  5. package/dist/{chunk-AKJGYZME.js → chunk-A6AHJCEK.js} +67 -832
  6. package/dist/chunk-A6AHJCEK.js.map +1 -0
  7. package/dist/{chunk-3D2G5NBI.js → chunk-ASTNK6WZ.js} +2 -2
  8. package/dist/{chunk-VNXZVOPN.js → chunk-B7C6NBBQ.js} +929 -1
  9. package/dist/chunk-B7C6NBBQ.js.map +1 -0
  10. package/dist/chunk-FFXAOK4A.js +39 -0
  11. package/dist/chunk-FFXAOK4A.js.map +1 -0
  12. package/dist/{chunk-EQLBYW42.js → chunk-GSIPTCQH.js} +9 -1
  13. package/dist/chunk-GSIPTCQH.js.map +1 -0
  14. package/dist/collab.cjs +170 -2
  15. package/dist/collab.cjs.map +1 -1
  16. package/dist/collab.d.cts +1 -1
  17. package/dist/collab.d.ts +1 -1
  18. package/dist/collab.js +3 -3
  19. package/dist/index.cjs +1204 -540
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.css +313 -0
  22. package/dist/index.css.map +1 -1
  23. package/dist/index.d.cts +2 -2
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +871 -494
  26. package/dist/index.js.map +1 -1
  27. package/dist/kinds.d.cts +1 -1
  28. package/dist/kinds.d.ts +1 -1
  29. package/dist/memory.cjs +3 -2
  30. package/dist/memory.cjs.map +1 -1
  31. package/dist/memory.d.cts +1 -1
  32. package/dist/memory.d.ts +1 -1
  33. package/dist/memory.js +3 -2
  34. package/dist/memory.js.map +1 -1
  35. package/dist/{types-BUO0OzOl.d.cts → types-CHmV8GLx.d.cts} +1 -0
  36. package/dist/{types-BUO0OzOl.d.ts → types-CHmV8GLx.d.ts} +1 -0
  37. package/package.json +1 -1
  38. package/dist/TextEditor-5S7FSLIZ.js.map +0 -1
  39. package/dist/chunk-AKJGYZME.js.map +0 -1
  40. package/dist/chunk-EQLBYW42.js.map +0 -1
  41. package/dist/chunk-VNXZVOPN.js.map +0 -1
  42. /package/dist/{Compare-M57FG4R3.js.map → Compare-RHAUAKUJ.js.map} +0 -0
  43. /package/dist/{SheetView-OEKOHMKW.js.map → SheetView-SBLAFGTL.js.map} +0 -0
  44. /package/dist/{chunk-3D2G5NBI.js.map → chunk-ASTNK6WZ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -5,6 +5,9 @@ import {
5
5
  matches,
6
6
  readable
7
7
  } from "./chunk-2CA3HQTI.js";
8
+ import {
9
+ findNote
10
+ } from "./chunk-FFXAOK4A.js";
8
11
  import {
9
12
  useLoad
10
13
  } from "./chunk-QDH7EZAF.js";
@@ -14,7 +17,7 @@ import {
14
17
  } from "./chunk-TDP6OJET.js";
15
18
  import {
16
19
  texts
17
- } from "./chunk-VNXZVOPN.js";
20
+ } from "./chunk-B7C6NBBQ.js";
18
21
  import {
19
22
  escape,
20
23
  readDocx,
@@ -870,7 +873,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
870
873
  };
871
874
  const fit = (box, pad = 0) => box.w > pad && box.h > pad ? Math.min((box.w - pad) / deck.width, (box.h - pad) / deck.height) : 0.5;
872
875
  const byKey = (a, b) => deck.slides[a].key < deck.slides[b].key ? -1 : 1;
873
- const around = (i) => [i - 1, i, i + 1].filter((k) => k >= 0 && k < count).sort(byKey);
876
+ const around2 = (i) => [i - 1, i, i + 1].filter((k) => k >= 0 && k < count).sort(byKey);
874
877
  const caption = (i) => `${t.slide} ${i + 1}${deck.slides[i].title ? `: ${deck.slides[i].title}` : ""}`;
875
878
  const post = (id, msg) => frames.current.get(id)?.contentWindow?.postMessage(msg, "*");
876
879
  const frame = (id, page, scale, title, hidden = false, still = false) => /* @__PURE__ */ jsx("span", { className: "w100n-slides-frame", "data-hidden": hidden || void 0, style: { width: Math.round(deck.width * scale), height: Math.round(deck.height * scale) }, children: /* @__PURE__ */ jsx(
@@ -1209,7 +1212,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
1209
1212
  s.key
1210
1213
  )) }) }),
1211
1214
  /* @__PURE__ */ jsxs("div", { className: "w100n-slides-main", children: [
1212
- /* @__PURE__ */ jsx("div", { ref: stageRef, className: "w100n-slides-stage", style: { "--w100n-ratio": `${deck.width} / ${deck.height}` }, children: around(index).map((i) => {
1215
+ /* @__PURE__ */ jsx("div", { ref: stageRef, className: "w100n-slides-stage", style: { "--w100n-ratio": `${deck.width} / ${deck.height}` }, children: around2(index).map((i) => {
1213
1216
  const id = `m:${deck.slides[i].key}:${epoch}`;
1214
1217
  return frame(id, frozen(deck.slides[i], id, "edit"), fit(stageBox, 32), caption(i), i !== index);
1215
1218
  }) }),
@@ -1236,7 +1239,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
1236
1239
  back();
1237
1240
  },
1238
1241
  children: [
1239
- around(nav.at).map((i) => {
1242
+ around2(nav.at).map((i) => {
1240
1243
  const id = `p:${deck.slides[i].key}:${epoch}`;
1241
1244
  return frame(id, frozen(deck.slides[i], id, "present"), fit(showBox), caption(i), i !== nav.at, true);
1242
1245
  }),
@@ -2409,8 +2412,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
2409
2412
 
2410
2413
  // src/DocumentOverlay.tsx
2411
2414
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2412
- var TextEditor = lazy(() => import("./TextEditor-5S7FSLIZ.js"));
2413
- var SheetView = lazy(() => import("./SheetView-OEKOHMKW.js"));
2415
+ var TextEditor = lazy(() => import("./TextEditor-X2GSL4QM.js"));
2416
+ var SheetView = lazy(() => import("./SheetView-SBLAFGTL.js"));
2414
2417
  var icons = { docx: FileText, markdown: FileType, pdf: Files, sheet: FileSpreadsheet, slides: Presentation };
2415
2418
  var read = { view: true, comment: false, edit: false };
2416
2419
  var quiet = () => {
@@ -2514,27 +2517,29 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
2514
2517
  }
2515
2518
 
2516
2519
  // src/DocumentsWorkspace.tsx
2517
- import { lazy as lazy2, Suspense as Suspense2, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState9 } from "react";
2520
+ import { lazy as lazy2, Suspense as Suspense2, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState11 } from "react";
2518
2521
  import { flushSync } from "react-dom";
2519
2522
  import {
2520
2523
  Bookmark,
2521
2524
  Check as Check2,
2522
- ChevronDown as ChevronDown2,
2523
- ChevronRight as ChevronRight2,
2525
+ ChevronDown as ChevronDown3,
2526
+ ChevronRight as ChevronRight3,
2524
2527
  Copy as Copy3,
2525
2528
  Download as Download3,
2526
2529
  ExternalLink as ExternalLink2,
2527
2530
  FileDiff,
2528
2531
  FileDown,
2529
2532
  Link as Link2,
2533
+ Link2 as Link22,
2530
2534
  Pencil,
2531
2535
  Send,
2532
2536
  Trash2 as Trash24,
2533
2537
  FilePlus,
2534
- FileSpreadsheet as FileSpreadsheet3,
2535
- FileText as FileText3,
2536
- FileType as FileType3,
2537
- Files as Files2,
2538
+ FileSpreadsheet as FileSpreadsheet4,
2539
+ FileText as FileText4,
2540
+ FileType as FileType6,
2541
+ Files as Files3,
2542
+ FolderTree,
2538
2543
  History,
2539
2544
  Info,
2540
2545
  LayoutGrid,
@@ -2545,19 +2550,196 @@ import {
2545
2550
  PanelLeftOpen,
2546
2551
  PanelRightClose,
2547
2552
  PanelRightOpen,
2548
- Plus as Plus4,
2549
- Presentation as Presentation3,
2553
+ Plus as Plus5,
2554
+ Presentation as Presentation4,
2550
2555
  RotateCcw as RotateCcw2,
2551
- Search as Search2,
2556
+ Search as Search3,
2552
2557
  Share2,
2553
2558
  Signature,
2554
2559
  Upload,
2555
2560
  X as X6
2556
2561
  } from "lucide-react";
2557
2562
 
2563
+ // src/Backlinks.tsx
2564
+ import { FileType as FileType2 } from "lucide-react";
2565
+ import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2566
+ var wikis = /\[\[([^[\]\n|]+?)(?:\|([^[\]\n]+?))?\]\]/g;
2567
+ var around = (text, from, to) => ({
2568
+ before: text.slice(Math.max(0, from - 70), from).replace(/^\S*\s/, "").replace(/\s+/g, " "),
2569
+ hit: text.slice(from, to),
2570
+ after: text.slice(to, to + 90).replace(/\s\S*$/, "").replace(/\s+/g, " ")
2571
+ });
2572
+ function mentions(current, notes, texts2) {
2573
+ const name = current.name.replace(/\.(md|markdown)$/i, "");
2574
+ const plain = new RegExp(`(^|[^\\p{L}\\p{N}])(${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})(?![\\p{L}\\p{N}])`, "iu");
2575
+ const linked = [];
2576
+ const unlinked = [];
2577
+ for (const item of notes) {
2578
+ if (item.id === current.id) continue;
2579
+ const text = texts2.get(item.id);
2580
+ if (!text) continue;
2581
+ let link = null;
2582
+ for (const m2 of text.matchAll(wikis)) {
2583
+ if (findNote(notes, m2[1])?.id !== current.id) continue;
2584
+ link = { item, ...around(text, m2.index, m2.index + m2[0].length), hit: m2[2] ?? m2[1] };
2585
+ break;
2586
+ }
2587
+ if (link) {
2588
+ linked.push(link);
2589
+ continue;
2590
+ }
2591
+ const bare3 = text.replace(wikis, (m2) => " ".repeat(m2.length));
2592
+ const m = plain.exec(bare3);
2593
+ if (m) unlinked.push({ item, ...around(text, m.index + m[1].length, m.index + m[0].length) });
2594
+ }
2595
+ return { linked, unlinked };
2596
+ }
2597
+ function Backlinks({ host, current, notes, t, onOpen }) {
2598
+ const others = notes.filter((item) => item.id !== current.id);
2599
+ const found = useLoad(async (signal) => {
2600
+ const texts2 = /* @__PURE__ */ new Map();
2601
+ const queue = [...others];
2602
+ const reader = new TextDecoder();
2603
+ await Promise.all(Array.from({ length: 6 }, async () => {
2604
+ for (let item = queue.shift(); item; item = queue.shift()) {
2605
+ try {
2606
+ texts2.set(item.id, reader.decode(await host.content(item.id, null, { signal })));
2607
+ } catch {
2608
+ if (signal.aborted) return;
2609
+ }
2610
+ }
2611
+ }));
2612
+ return mentions(current, notes, texts2);
2613
+ }, [host, current.id, current.name, others.map((item) => `${item.id}:${item.updatedAt}`).join()]);
2614
+ if (found.loading && !found.data) return /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", children: t.loading });
2615
+ if (found.error) return /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", children: t.failed });
2616
+ const { linked, unlinked } = found.data;
2617
+ const card = (m) => /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-links-card", onClick: () => onOpen(m.item), children: [
2618
+ /* @__PURE__ */ jsxs6("b", { children: [
2619
+ /* @__PURE__ */ jsx6(FileType2, { "aria-hidden": true }),
2620
+ m.item.name.replace(/\.(md|markdown)$/i, "")
2621
+ ] }),
2622
+ /* @__PURE__ */ jsxs6("small", { children: [
2623
+ "\u2026",
2624
+ m.before,
2625
+ /* @__PURE__ */ jsx6("mark", { children: m.hit }),
2626
+ m.after,
2627
+ "\u2026"
2628
+ ] }),
2629
+ m.item.folder && /* @__PURE__ */ jsx6("small", { className: "w100n-links-folder", children: m.item.folder })
2630
+ ] }, m.item.id);
2631
+ return /* @__PURE__ */ jsxs6("div", { className: "w100n-links", children: [
2632
+ /* @__PURE__ */ jsxs6("p", { className: "w100n-docs-caption", children: [
2633
+ t.linked,
2634
+ /* @__PURE__ */ jsx6("span", { children: linked.length })
2635
+ ] }),
2636
+ linked.length ? linked.map(card) : /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", children: t.noBacklinks }),
2637
+ unlinked.length > 0 && /* @__PURE__ */ jsxs6(Fragment5, { children: [
2638
+ /* @__PURE__ */ jsxs6("p", { className: "w100n-docs-caption", children: [
2639
+ t.unlinked,
2640
+ /* @__PURE__ */ jsx6("span", { children: unlinked.length })
2641
+ ] }),
2642
+ unlinked.map(card)
2643
+ ] })
2644
+ ] });
2645
+ }
2646
+
2647
+ // src/Jump.tsx
2648
+ import { useState as useState6 } from "react";
2649
+ import { Command, FileType as FileType3, Plus as Plus2, Search as Search2 } from "lucide-react";
2650
+ import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2651
+ var bare2 = (name) => name.replace(/\.(md|markdown)$/i, "");
2652
+ function rank(item, q) {
2653
+ const name = bare2(item.name).toLowerCase();
2654
+ if (!q) return 2;
2655
+ if (name.startsWith(q)) return 0;
2656
+ if (name.split(/[\s_.-]+/).some((w) => w.startsWith(q))) return 1;
2657
+ if (name.includes(q)) return 2;
2658
+ let at = 0;
2659
+ for (const ch of q) {
2660
+ at = name.indexOf(ch, at) + 1;
2661
+ if (!at) return -1;
2662
+ }
2663
+ return 3;
2664
+ }
2665
+ var lit = (text, q) => {
2666
+ const at = q ? text.toLowerCase().indexOf(q) : -1;
2667
+ return at < 0 ? text : /* @__PURE__ */ jsxs7(Fragment6, { children: [
2668
+ text.slice(0, at),
2669
+ /* @__PURE__ */ jsx7("mark", { children: text.slice(at, at + q.length) }),
2670
+ text.slice(at + q.length)
2671
+ ] });
2672
+ };
2673
+ function Jump({ mode, items, actions, t, place, onOpen, onCreate, onClose }) {
2674
+ const [query, setQuery] = useState6("");
2675
+ const [at, setAt] = useState6(0);
2676
+ const q = query.trim().toLowerCase();
2677
+ const found = mode === "open" ? items.map((item) => ({ item, r: rank(item, q) })).filter((x) => x.r >= 0).sort((a, b) => a.r - b.r || bare2(a.item.name).localeCompare(bare2(b.item.name))).slice(0, 30).map((x) => x.item) : [];
2678
+ const doing = mode === "run" ? actions.filter((a) => !q || a.label.toLowerCase().includes(q)) : [];
2679
+ const make2 = mode === "open" && onCreate && query.trim() && !found.some((item) => bare2(item.name).toLowerCase() === q);
2680
+ const total = found.length + doing.length + (make2 ? 1 : 0);
2681
+ const pick = Math.min(at, Math.max(0, total - 1));
2682
+ const go = (i) => {
2683
+ onClose();
2684
+ if (i < found.length) onOpen(found[i]);
2685
+ else if (mode === "run") doing[i]?.run();
2686
+ else if (make2) onCreate(query.trim());
2687
+ };
2688
+ return /* @__PURE__ */ jsx7("div", { className: "w100n-jump-back", onPointerDown: (e) => {
2689
+ if (e.target === e.currentTarget) onClose();
2690
+ }, children: /* @__PURE__ */ jsxs7("div", { className: "w100n-jump", role: "dialog", "aria-modal": true, "aria-label": mode === "open" ? t.openNote : t.commands, children: [
2691
+ /* @__PURE__ */ jsxs7("label", { className: "w100n-jump-field", children: [
2692
+ mode === "open" ? /* @__PURE__ */ jsx7(Search2, { "aria-hidden": true }) : /* @__PURE__ */ jsx7(Command, { "aria-hidden": true }),
2693
+ /* @__PURE__ */ jsx7(
2694
+ "input",
2695
+ {
2696
+ autoFocus: true,
2697
+ value: query,
2698
+ placeholder: mode === "open" ? t.findNote : t.commands,
2699
+ "aria-label": mode === "open" ? t.findNote : t.commands,
2700
+ onChange: (e) => {
2701
+ setQuery(e.target.value);
2702
+ setAt(0);
2703
+ },
2704
+ onKeyDown: (e) => {
2705
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
2706
+ e.preventDefault();
2707
+ if (total) setAt((pick + (e.key === "ArrowDown" ? 1 : total - 1)) % total);
2708
+ } else if (e.key === "Enter") {
2709
+ e.preventDefault();
2710
+ if (total) go(pick);
2711
+ } else if (e.key === "Escape") {
2712
+ e.stopPropagation();
2713
+ onClose();
2714
+ }
2715
+ }
2716
+ }
2717
+ )
2718
+ ] }),
2719
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-jump-list", role: "listbox", "aria-label": mode === "open" ? t.openNote : t.commands, children: [
2720
+ found.map((item, i) => /* @__PURE__ */ jsxs7("button", { type: "button", role: "option", "aria-selected": i === pick, onPointerMove: () => setAt(i), onClick: () => go(i), children: [
2721
+ /* @__PURE__ */ jsx7(FileType3, { "aria-hidden": true }),
2722
+ /* @__PURE__ */ jsx7("span", { children: lit(bare2(item.name), q) }),
2723
+ /* @__PURE__ */ jsx7("small", { children: place(item) })
2724
+ ] }, item.id)),
2725
+ doing.map((a, i) => /* @__PURE__ */ jsxs7("button", { type: "button", role: "option", "aria-selected": i === pick, onPointerMove: () => setAt(i), onClick: () => go(i), children: [
2726
+ /* @__PURE__ */ jsx7(a.icon, { "aria-hidden": true }),
2727
+ /* @__PURE__ */ jsx7("span", { children: lit(a.label, q) }),
2728
+ a.keys && /* @__PURE__ */ jsx7("kbd", { children: a.keys })
2729
+ ] }, a.id)),
2730
+ make2 && /* @__PURE__ */ jsxs7("button", { type: "button", role: "option", "aria-selected": pick === found.length, onPointerMove: () => setAt(found.length), onClick: () => go(found.length), children: [
2731
+ /* @__PURE__ */ jsx7(Plus2, { "aria-hidden": true }),
2732
+ /* @__PURE__ */ jsx7("span", { children: t.createNote.replace("{name}", query.trim()) })
2733
+ ] }),
2734
+ !total && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", children: t.noNote })
2735
+ ] }),
2736
+ /* @__PURE__ */ jsx7("p", { className: "w100n-jump-keys", children: mode === "open" ? t.keysOpen : t.keysRun })
2737
+ ] }) });
2738
+ }
2739
+
2558
2740
  // src/NewDocument.tsx
2559
- import { Check, FileSpreadsheet as FileSpreadsheet2, FileText as FileText2, FileType as FileType2, Plus as Plus2, Presentation as Presentation2, X as X5 } from "lucide-react";
2560
- import { useId as useId3, useState as useState6 } from "react";
2741
+ import { Check, FileSpreadsheet as FileSpreadsheet2, FileText as FileText2, FileType as FileType4, Plus as Plus3, Presentation as Presentation2, X as X5 } from "lucide-react";
2742
+ import { useId as useId3, useState as useState7 } from "react";
2561
2743
 
2562
2744
  // src/blank.ts
2563
2745
  import { strToU8, zipSync } from "fflate";
@@ -2680,19 +2862,19 @@ function blank2(kind, name, template = "blank") {
2680
2862
  }
2681
2863
 
2682
2864
  // src/NewDocument.tsx
2683
- import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2684
- var icons2 = { docx: FileText2, markdown: FileType2, sheet: FileSpreadsheet2, slides: Presentation2 };
2865
+ import { Fragment as Fragment7, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2866
+ var icons2 = { docx: FileText2, markdown: FileType4, sheet: FileSpreadsheet2, slides: Presentation2 };
2685
2867
  var shaped = ["blank", "letter", "contract", "notes", "invoice", "report"];
2686
2868
  function NewDocument({ host, t, onClose, onMade }) {
2687
2869
  const id = useId3();
2688
- const [kind, setKind] = useState6("docx");
2689
- const [template, setTemplate] = useState6("blank");
2690
- const [name, setName] = useState6("");
2691
- const [team, setTeam] = useState6(null);
2870
+ const [kind, setKind] = useState7("docx");
2871
+ const [template, setTemplate] = useState7("blank");
2872
+ const [name, setName] = useState7("");
2873
+ const [team, setTeam] = useState7(null);
2692
2874
  const shared = useLoad((signal) => host.templates ? host.templates({ signal }) : Promise.resolve([]), [host]);
2693
2875
  const ours = (shared.data ?? []).filter((item) => item.kind === kind);
2694
2876
  const stem = (file) => file.replace(/\.[^.]+$/, "");
2695
- const [state, setState] = useState6("idle");
2877
+ const [state, setState] = useState7("idle");
2696
2878
  useRestore(true);
2697
2879
  const choices = kind === "docx" || kind === "markdown" ? shaped : ["blank"];
2698
2880
  const make2 = async () => {
@@ -2706,77 +2888,77 @@ function NewDocument({ host, t, onClose, onMade }) {
2706
2888
  setState("failed");
2707
2889
  }
2708
2890
  };
2709
- return /* @__PURE__ */ jsx6("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
2891
+ return /* @__PURE__ */ jsx8("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
2710
2892
  if (e.key === "Escape") {
2711
2893
  e.stopPropagation();
2712
2894
  onClose();
2713
2895
  }
2714
- }, children: /* @__PURE__ */ jsxs6("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
2896
+ }, children: /* @__PURE__ */ jsxs8("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
2715
2897
  e.preventDefault();
2716
2898
  void make2();
2717
2899
  }, children: [
2718
- /* @__PURE__ */ jsxs6("div", { className: "w100n-new-head", children: [
2719
- /* @__PURE__ */ jsx6("span", { className: "w100n-new-tile", children: /* @__PURE__ */ jsx6(Plus2, { "aria-hidden": true }) }),
2720
- /* @__PURE__ */ jsx6("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
2721
- /* @__PURE__ */ jsx6("button", { type: "button", className: "w100n-docs-close", onClick: onClose, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx6(X5, { "aria-hidden": true }) })
2900
+ /* @__PURE__ */ jsxs8("div", { className: "w100n-new-head", children: [
2901
+ /* @__PURE__ */ jsx8("span", { className: "w100n-new-tile", children: /* @__PURE__ */ jsx8(Plus3, { "aria-hidden": true }) }),
2902
+ /* @__PURE__ */ jsx8("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
2903
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "w100n-docs-close", onClick: onClose, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx8(X5, { "aria-hidden": true }) })
2722
2904
  ] }),
2723
- /* @__PURE__ */ jsx6("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
2905
+ /* @__PURE__ */ jsx8("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
2724
2906
  const Icon = icons2[item];
2725
- return /* @__PURE__ */ jsxs6("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
2907
+ return /* @__PURE__ */ jsxs8("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
2726
2908
  setKind(item);
2727
2909
  setTeam(null);
2728
2910
  if (item === "sheet" || item === "slides") setTemplate("blank");
2729
2911
  }, children: [
2730
- /* @__PURE__ */ jsx6("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx6(Icon, { "aria-hidden": true }) }),
2731
- /* @__PURE__ */ jsxs6("span", { children: [
2732
- /* @__PURE__ */ jsx6("b", { children: t.newKinds[item] }),
2733
- /* @__PURE__ */ jsx6("small", { children: t.kindHints[item] })
2912
+ /* @__PURE__ */ jsx8("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx8(Icon, { "aria-hidden": true }) }),
2913
+ /* @__PURE__ */ jsxs8("span", { children: [
2914
+ /* @__PURE__ */ jsx8("b", { children: t.newKinds[item] }),
2915
+ /* @__PURE__ */ jsx8("small", { children: t.kindHints[item] })
2734
2916
  ] })
2735
2917
  ] }, item);
2736
2918
  }) }),
2737
- /* @__PURE__ */ jsx6("p", { className: "w100n-docs-caption", children: t.startFrom }),
2738
- /* @__PURE__ */ jsx6("div", { role: "radiogroup", "aria-label": t.startFrom, className: "w100n-new-templates", children: choices.map((item) => /* @__PURE__ */ jsxs6("button", { type: "button", role: "radio", "aria-checked": !team && template === item, onClick: () => {
2919
+ /* @__PURE__ */ jsx8("p", { className: "w100n-docs-caption", children: t.startFrom }),
2920
+ /* @__PURE__ */ jsx8("div", { role: "radiogroup", "aria-label": t.startFrom, className: "w100n-new-templates", children: choices.map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", role: "radio", "aria-checked": !team && template === item, onClick: () => {
2739
2921
  setTeam(null);
2740
2922
  setTemplate(item);
2741
2923
  }, children: [
2742
- /* @__PURE__ */ jsx6("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ jsx6(Plus2, { "aria-hidden": true }) : /* @__PURE__ */ jsxs6(Fragment5, { children: [
2743
- /* @__PURE__ */ jsx6("i", { "data-head": true }),
2744
- /* @__PURE__ */ jsx6("i", {}),
2745
- /* @__PURE__ */ jsx6("i", {}),
2746
- /* @__PURE__ */ jsx6("i", { "data-accent": true }),
2747
- /* @__PURE__ */ jsx6("i", {}),
2748
- /* @__PURE__ */ jsx6("i", {})
2924
+ /* @__PURE__ */ jsx8("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ jsx8(Plus3, { "aria-hidden": true }) : /* @__PURE__ */ jsxs8(Fragment7, { children: [
2925
+ /* @__PURE__ */ jsx8("i", { "data-head": true }),
2926
+ /* @__PURE__ */ jsx8("i", {}),
2927
+ /* @__PURE__ */ jsx8("i", {}),
2928
+ /* @__PURE__ */ jsx8("i", { "data-accent": true }),
2929
+ /* @__PURE__ */ jsx8("i", {}),
2930
+ /* @__PURE__ */ jsx8("i", {})
2749
2931
  ] }) }),
2750
- /* @__PURE__ */ jsx6("span", { children: t.templates[item] })
2932
+ /* @__PURE__ */ jsx8("span", { children: t.templates[item] })
2751
2933
  ] }, item)) }),
2752
- ours.length > 0 && /* @__PURE__ */ jsxs6(Fragment5, { children: [
2753
- /* @__PURE__ */ jsx6("p", { className: "w100n-docs-caption", children: t.teamTemplates }),
2754
- /* @__PURE__ */ jsx6("div", { role: "radiogroup", "aria-label": t.teamTemplates, className: "w100n-new-templates", children: ours.map((item) => /* @__PURE__ */ jsxs6("button", { type: "button", role: "radio", "aria-checked": team?.id === item.id, onClick: () => setTeam(item), children: [
2755
- /* @__PURE__ */ jsxs6("span", { className: "w100n-new-sheet", children: [
2756
- /* @__PURE__ */ jsx6("i", { "data-head": true }),
2757
- /* @__PURE__ */ jsx6("i", {}),
2758
- /* @__PURE__ */ jsx6("i", { "data-accent": true }),
2759
- /* @__PURE__ */ jsx6("i", {}),
2760
- /* @__PURE__ */ jsx6("i", {})
2934
+ ours.length > 0 && /* @__PURE__ */ jsxs8(Fragment7, { children: [
2935
+ /* @__PURE__ */ jsx8("p", { className: "w100n-docs-caption", children: t.teamTemplates }),
2936
+ /* @__PURE__ */ jsx8("div", { role: "radiogroup", "aria-label": t.teamTemplates, className: "w100n-new-templates", children: ours.map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", role: "radio", "aria-checked": team?.id === item.id, onClick: () => setTeam(item), children: [
2937
+ /* @__PURE__ */ jsxs8("span", { className: "w100n-new-sheet", children: [
2938
+ /* @__PURE__ */ jsx8("i", { "data-head": true }),
2939
+ /* @__PURE__ */ jsx8("i", {}),
2940
+ /* @__PURE__ */ jsx8("i", { "data-accent": true }),
2941
+ /* @__PURE__ */ jsx8("i", {}),
2942
+ /* @__PURE__ */ jsx8("i", {})
2761
2943
  ] }),
2762
- /* @__PURE__ */ jsx6("span", { title: item.name, children: stem(item.name) })
2944
+ /* @__PURE__ */ jsx8("span", { title: item.name, children: stem(item.name) })
2763
2945
  ] }, item.id)) })
2764
2946
  ] }),
2765
- /* @__PURE__ */ jsxs6("div", { className: "w100n-new-fields", children: [
2766
- /* @__PURE__ */ jsxs6("label", { children: [
2767
- /* @__PURE__ */ jsx6("span", { className: "w100n-docs-caption", children: t.name }),
2768
- /* @__PURE__ */ jsx6("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] })
2947
+ /* @__PURE__ */ jsxs8("div", { className: "w100n-new-fields", children: [
2948
+ /* @__PURE__ */ jsxs8("label", { children: [
2949
+ /* @__PURE__ */ jsx8("span", { className: "w100n-docs-caption", children: t.name }),
2950
+ /* @__PURE__ */ jsx8("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] })
2769
2951
  ] }),
2770
- host.createIn && /* @__PURE__ */ jsxs6("div", { children: [
2771
- /* @__PURE__ */ jsx6("span", { className: "w100n-docs-caption", children: t.savesTo }),
2772
- /* @__PURE__ */ jsx6("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
2952
+ host.createIn && /* @__PURE__ */ jsxs8("div", { children: [
2953
+ /* @__PURE__ */ jsx8("span", { className: "w100n-docs-caption", children: t.savesTo }),
2954
+ /* @__PURE__ */ jsx8("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
2773
2955
  ] })
2774
2956
  ] }),
2775
- state === "failed" && /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
2776
- /* @__PURE__ */ jsxs6("div", { className: "w100n-pdf-dialog-end", children: [
2777
- /* @__PURE__ */ jsx6("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
2778
- /* @__PURE__ */ jsxs6("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
2779
- /* @__PURE__ */ jsx6(Check, { "aria-hidden": true }),
2957
+ state === "failed" && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
2958
+ /* @__PURE__ */ jsxs8("div", { className: "w100n-pdf-dialog-end", children: [
2959
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
2960
+ /* @__PURE__ */ jsxs8("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
2961
+ /* @__PURE__ */ jsx8(Check, { "aria-hidden": true }),
2780
2962
  state === "busy" ? t.making : t.make
2781
2963
  ] })
2782
2964
  ] })
@@ -2784,9 +2966,9 @@ function NewDocument({ host, t, onClose, onMade }) {
2784
2966
  }
2785
2967
 
2786
2968
  // src/Sharing.tsx
2787
- import { useState as useState7 } from "react";
2788
- import { Ban, CalendarDays, Clock, Copy as Copy2, Download as Download2, Eye, Link, Lock, MessageSquarePlus, Plus as Plus3, Users } from "lucide-react";
2789
- import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2969
+ import { useState as useState8 } from "react";
2970
+ import { Ban, CalendarDays, Clock, Copy as Copy2, Download as Download2, Eye, Link, Lock, MessageSquarePlus, Plus as Plus4, Users } from "lucide-react";
2971
+ import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
2790
2972
  var blank3 = { id: null, comment: false, download: false, askName: true, works: "30", day: "", password: false, secret: "", had: false };
2791
2973
  var local = (iso) => {
2792
2974
  const at = new Date(iso);
@@ -2794,9 +2976,9 @@ var local = (iso) => {
2794
2976
  };
2795
2977
  function Sharing({ host, doc, t, language, team }) {
2796
2978
  const links = useLoad((signal) => host.links(doc.id, { signal }), [host, doc.id]);
2797
- const [form, setForm] = useState7(null);
2798
- const [state, setState] = useState7("idle");
2799
- const [copied, setCopied] = useState7(null);
2979
+ const [form, setForm] = useState8(null);
2980
+ const [state, setState] = useState8("idle");
2981
+ const [copied, setCopied] = useState8(null);
2800
2982
  const text = doc.kind === "docx" || doc.kind === "markdown";
2801
2983
  const rules = new Intl.PluralRules(language);
2802
2984
  const count = (n, forms) => `${n} ${forms[rules.select(n)] ?? forms.other}`;
@@ -2858,31 +3040,31 @@ function Sharing({ host, doc, t, language, team }) {
2858
3040
  setCopied(null);
2859
3041
  }
2860
3042
  };
2861
- if (form) return /* @__PURE__ */ jsxs7("div", { className: "w100n-share", children: [
2862
- /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
2863
- /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
3043
+ if (form) return /* @__PURE__ */ jsxs9("div", { className: "w100n-share", children: [
3044
+ /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3045
+ /* @__PURE__ */ jsx9(Link, { "aria-hidden": true }),
2864
3046
  form.id ? t.changeLink : t.newLink
2865
3047
  ] }),
2866
- text && /* @__PURE__ */ jsxs7("div", { className: "w100n-share-field", children: [
2867
- /* @__PURE__ */ jsx7("span", { children: t.guestsCan }),
2868
- /* @__PURE__ */ jsxs7("div", { className: "w100n-docs-chips", children: [
2869
- /* @__PURE__ */ jsxs7("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
2870
- /* @__PURE__ */ jsx7(Eye, { "aria-hidden": true }),
3048
+ text && /* @__PURE__ */ jsxs9("div", { className: "w100n-share-field", children: [
3049
+ /* @__PURE__ */ jsx9("span", { children: t.guestsCan }),
3050
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-chips", children: [
3051
+ /* @__PURE__ */ jsxs9("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
3052
+ /* @__PURE__ */ jsx9(Eye, { "aria-hidden": true }),
2871
3053
  t.canRead
2872
3054
  ] }),
2873
- /* @__PURE__ */ jsxs7("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
2874
- /* @__PURE__ */ jsx7(MessageSquarePlus, { "aria-hidden": true }),
3055
+ /* @__PURE__ */ jsxs9("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
3056
+ /* @__PURE__ */ jsx9(MessageSquarePlus, { "aria-hidden": true }),
2875
3057
  t.canComment
2876
3058
  ] })
2877
3059
  ] })
2878
3060
  ] }),
2879
- /* @__PURE__ */ jsxs7("div", { className: "w100n-share-field", children: [
2880
- /* @__PURE__ */ jsx7("span", { children: t.linkWorks }),
2881
- /* @__PURE__ */ jsx7("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key, label]) => /* @__PURE__ */ jsxs7("button", { type: "button", "aria-pressed": form.works === key, onClick: () => setForm({ ...form, works: key }), children: [
2882
- key === "day" && /* @__PURE__ */ jsx7(CalendarDays, { "aria-hidden": true }),
3061
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-share-field", children: [
3062
+ /* @__PURE__ */ jsx9("span", { children: t.linkWorks }),
3063
+ /* @__PURE__ */ jsx9("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key, label]) => /* @__PURE__ */ jsxs9("button", { type: "button", "aria-pressed": form.works === key, onClick: () => setForm({ ...form, works: key }), children: [
3064
+ key === "day" && /* @__PURE__ */ jsx9(CalendarDays, { "aria-hidden": true }),
2883
3065
  label
2884
3066
  ] }, key)) }),
2885
- form.works === "day" && /* @__PURE__ */ jsx7(
3067
+ form.works === "day" && /* @__PURE__ */ jsx9(
2886
3068
  "input",
2887
3069
  {
2888
3070
  type: "date",
@@ -2894,14 +3076,14 @@ function Sharing({ host, doc, t, language, team }) {
2894
3076
  }
2895
3077
  )
2896
3078
  ] }),
2897
- /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2898
- /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
2899
- /* @__PURE__ */ jsxs7("span", { children: [
2900
- /* @__PURE__ */ jsx7("b", { children: t.passwordOn }),
2901
- /* @__PURE__ */ jsx7("small", { children: t.passwordHint })
3079
+ /* @__PURE__ */ jsxs9("label", { className: "w100n-share-toggle", children: [
3080
+ /* @__PURE__ */ jsx9("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
3081
+ /* @__PURE__ */ jsxs9("span", { children: [
3082
+ /* @__PURE__ */ jsx9("b", { children: t.passwordOn }),
3083
+ /* @__PURE__ */ jsx9("small", { children: t.passwordHint })
2902
3084
  ] })
2903
3085
  ] }),
2904
- form.password && /* @__PURE__ */ jsx7(
3086
+ form.password && /* @__PURE__ */ jsx9(
2905
3087
  "input",
2906
3088
  {
2907
3089
  type: "password",
@@ -2913,120 +3095,120 @@ function Sharing({ host, doc, t, language, team }) {
2913
3095
  onChange: (e) => setForm({ ...form, secret: e.target.value })
2914
3096
  }
2915
3097
  ),
2916
- /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2917
- /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
2918
- /* @__PURE__ */ jsxs7("span", { children: [
2919
- /* @__PURE__ */ jsx7("b", { children: t.downloadFile }),
2920
- /* @__PURE__ */ jsx7("small", { children: t.downloadHint })
3098
+ /* @__PURE__ */ jsxs9("label", { className: "w100n-share-toggle", children: [
3099
+ /* @__PURE__ */ jsx9("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
3100
+ /* @__PURE__ */ jsxs9("span", { children: [
3101
+ /* @__PURE__ */ jsx9("b", { children: t.downloadFile }),
3102
+ /* @__PURE__ */ jsx9("small", { children: t.downloadHint })
2921
3103
  ] })
2922
3104
  ] }),
2923
- /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2924
- /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
2925
- /* @__PURE__ */ jsxs7("span", { children: [
2926
- /* @__PURE__ */ jsx7("b", { children: t.askName }),
2927
- /* @__PURE__ */ jsx7("small", { children: t.askNameHint })
3105
+ /* @__PURE__ */ jsxs9("label", { className: "w100n-share-toggle", children: [
3106
+ /* @__PURE__ */ jsx9("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
3107
+ /* @__PURE__ */ jsxs9("span", { children: [
3108
+ /* @__PURE__ */ jsx9("b", { children: t.askName }),
3109
+ /* @__PURE__ */ jsx9("small", { children: t.askNameHint })
2928
3110
  ] })
2929
3111
  ] }),
2930
- /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", children: t.lastSaved }),
2931
- state === "failed" && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2932
- /* @__PURE__ */ jsxs7("span", { className: "w100n-pdf-dialog-end", children: [
2933
- /* @__PURE__ */ jsx7("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
3112
+ /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.lastSaved }),
3113
+ state === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
3114
+ /* @__PURE__ */ jsxs9("span", { className: "w100n-pdf-dialog-end", children: [
3115
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
2934
3116
  setForm(null);
2935
3117
  setState("idle");
2936
3118
  }, children: t.cancel }),
2937
- /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
2938
- /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
3119
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
3120
+ /* @__PURE__ */ jsx9(Link, { "aria-hidden": true }),
2939
3121
  form.id ? t.saveLink : t.makeLink
2940
3122
  ] })
2941
3123
  ] })
2942
3124
  ] });
2943
3125
  const on = links.data ?? [];
2944
- return /* @__PURE__ */ jsxs7("div", { className: "w100n-share", children: [
2945
- /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
2946
- /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
3126
+ return /* @__PURE__ */ jsxs9("div", { className: "w100n-share", children: [
3127
+ /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3128
+ /* @__PURE__ */ jsx9(Link, { "aria-hidden": true }),
2947
3129
  t.guestLinks,
2948
- on.length > 0 && /* @__PURE__ */ jsx7("span", { children: on.filter((l) => !l.ended).length })
3130
+ on.length > 0 && /* @__PURE__ */ jsx9("span", { children: on.filter((l) => !l.ended).length })
2949
3131
  ] }),
2950
- links.error && /* @__PURE__ */ jsxs7("div", { className: "w100n-docs-note", children: [
3132
+ links.error && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-note", children: [
2951
3133
  t.failed,
2952
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: links.retry, children: t.retry })
3134
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: links.retry, children: t.retry })
2953
3135
  ] }),
2954
- links.data && !on.length && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", children: t.noLinks }),
2955
- state === "failed" && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2956
- on.map((l) => /* @__PURE__ */ jsxs7("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
2957
- /* @__PURE__ */ jsxs7("header", { children: [
2958
- /* @__PURE__ */ jsx7("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ jsx7(MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ jsx7(Eye, { "aria-hidden": true }) }),
2959
- /* @__PURE__ */ jsxs7("span", { children: [
2960
- /* @__PURE__ */ jsx7("b", { children: l.comment ? t.commentLink : t.viewLink }),
2961
- /* @__PURE__ */ jsxs7("small", { children: [
3136
+ links.data && !on.length && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.noLinks }),
3137
+ state === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
3138
+ on.map((l) => /* @__PURE__ */ jsxs9("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
3139
+ /* @__PURE__ */ jsxs9("header", { children: [
3140
+ /* @__PURE__ */ jsx9("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ jsx9(MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(Eye, { "aria-hidden": true }) }),
3141
+ /* @__PURE__ */ jsxs9("span", { children: [
3142
+ /* @__PURE__ */ jsx9("b", { children: l.comment ? t.commentLink : t.viewLink }),
3143
+ /* @__PURE__ */ jsxs9("small", { children: [
2962
3144
  t.madeBy.replace("{name}", l.createdBy.name),
2963
3145
  " \xB7 ",
2964
3146
  day(l.createdAt)
2965
3147
  ] })
2966
3148
  ] })
2967
3149
  ] }),
2968
- /* @__PURE__ */ jsxs7("div", { className: "w100n-share-chips", children: [
2969
- /* @__PURE__ */ jsxs7("span", { children: [
2970
- /* @__PURE__ */ jsx7(Clock, { "aria-hidden": true }),
3150
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-share-chips", children: [
3151
+ /* @__PURE__ */ jsxs9("span", { children: [
3152
+ /* @__PURE__ */ jsx9(Clock, { "aria-hidden": true }),
2971
3153
  l.ended ? t.linkEnded : l.endsAt ? t.endsOn.replace("{date}", day(l.endsAt)) : t.untilOff
2972
3154
  ] }),
2973
- l.download && /* @__PURE__ */ jsxs7("span", { children: [
2974
- /* @__PURE__ */ jsx7(Download2, { "aria-hidden": true }),
3155
+ l.download && /* @__PURE__ */ jsxs9("span", { children: [
3156
+ /* @__PURE__ */ jsx9(Download2, { "aria-hidden": true }),
2975
3157
  t.downloadOn
2976
3158
  ] }),
2977
- l.password && /* @__PURE__ */ jsxs7("span", { children: [
2978
- /* @__PURE__ */ jsx7(Lock, { "aria-hidden": true }),
3159
+ l.password && /* @__PURE__ */ jsxs9("span", { children: [
3160
+ /* @__PURE__ */ jsx9(Lock, { "aria-hidden": true }),
2979
3161
  t.passwordOn
2980
3162
  ] }),
2981
- /* @__PURE__ */ jsxs7("span", { children: [
2982
- /* @__PURE__ */ jsx7(Eye, { "aria-hidden": true }),
3163
+ /* @__PURE__ */ jsxs9("span", { children: [
3164
+ /* @__PURE__ */ jsx9(Eye, { "aria-hidden": true }),
2983
3165
  count(l.guests.reduce((n, g) => n + g.opens, 0), t.openForms)
2984
3166
  ] })
2985
3167
  ] }),
2986
- /* @__PURE__ */ jsxs7("div", { className: "w100n-share-url", children: [
2987
- /* @__PURE__ */ jsx7("span", { children: l.url.replace(/^https?:\/\//, "") }),
2988
- /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy(l), children: [
2989
- /* @__PURE__ */ jsx7(Copy2, { "aria-hidden": true }),
3168
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-share-url", children: [
3169
+ /* @__PURE__ */ jsx9("span", { children: l.url.replace(/^https?:\/\//, "") }),
3170
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy(l), children: [
3171
+ /* @__PURE__ */ jsx9(Copy2, { "aria-hidden": true }),
2990
3172
  copied === l.id ? t.copied : t.copy
2991
3173
  ] })
2992
3174
  ] }),
2993
- l.guests.length > 0 && /* @__PURE__ */ jsx7("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ jsxs7("div", { children: [
2994
- /* @__PURE__ */ jsx7("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
2995
- /* @__PURE__ */ jsx7("b", { children: g.name || t.unnamed }),
2996
- /* @__PURE__ */ jsxs7("small", { children: [
3175
+ l.guests.length > 0 && /* @__PURE__ */ jsx9("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ jsxs9("div", { children: [
3176
+ /* @__PURE__ */ jsx9("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
3177
+ /* @__PURE__ */ jsx9("b", { children: g.name || t.unnamed }),
3178
+ /* @__PURE__ */ jsxs9("small", { children: [
2997
3179
  g.comments ? count(g.comments, t.commentForms) : count(g.opens, t.openForms),
2998
3180
  " \xB7 ",
2999
3181
  ago(g.lastAt)
3000
3182
  ] })
3001
3183
  ] }, i)) }),
3002
- /* @__PURE__ */ jsxs7("div", { className: "w100n-share-tools", children: [
3003
- /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
3004
- /* @__PURE__ */ jsx7(Clock, { "aria-hidden": true }),
3184
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-share-tools", children: [
3185
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
3186
+ /* @__PURE__ */ jsx9(Clock, { "aria-hidden": true }),
3005
3187
  t.changeLink
3006
3188
  ] }),
3007
- /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
3008
- /* @__PURE__ */ jsx7(Ban, { "aria-hidden": true }),
3189
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
3190
+ /* @__PURE__ */ jsx9(Ban, { "aria-hidden": true }),
3009
3191
  t.turnOff
3010
3192
  ] })
3011
3193
  ] })
3012
3194
  ] }, l.id)),
3013
- /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
3195
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
3014
3196
  setState("idle");
3015
3197
  setForm(blank3);
3016
3198
  }, children: [
3017
- /* @__PURE__ */ jsx7(Plus3, { "aria-hidden": true }),
3199
+ /* @__PURE__ */ jsx9(Plus4, { "aria-hidden": true }),
3018
3200
  t.newLink
3019
3201
  ] }),
3020
- team && /* @__PURE__ */ jsxs7(Fragment6, { children: [
3021
- /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
3022
- /* @__PURE__ */ jsx7(Users, { "aria-hidden": true }),
3202
+ team && /* @__PURE__ */ jsxs9(Fragment8, { children: [
3203
+ /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3204
+ /* @__PURE__ */ jsx9(Users, { "aria-hidden": true }),
3023
3205
  t.inTeam
3024
3206
  ] }),
3025
- /* @__PURE__ */ jsxs7("div", { className: "w100n-share-team", children: [
3026
- /* @__PURE__ */ jsx7("span", { className: "w100n-share-tile", children: /* @__PURE__ */ jsx7(Users, { "aria-hidden": true }) }),
3027
- /* @__PURE__ */ jsxs7("span", { children: [
3028
- /* @__PURE__ */ jsx7("b", { children: t.peopleOf.replace("{space}", team) }),
3029
- /* @__PURE__ */ jsx7("small", { children: t.teamHint })
3207
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-share-team", children: [
3208
+ /* @__PURE__ */ jsx9("span", { className: "w100n-share-tile", children: /* @__PURE__ */ jsx9(Users, { "aria-hidden": true }) }),
3209
+ /* @__PURE__ */ jsxs9("span", { children: [
3210
+ /* @__PURE__ */ jsx9("b", { children: t.peopleOf.replace("{space}", team) }),
3211
+ /* @__PURE__ */ jsx9("small", { children: t.teamHint })
3030
3212
  ] })
3031
3213
  ] })
3032
3214
  ] })
@@ -3034,7 +3216,7 @@ function Sharing({ host, doc, t, language, team }) {
3034
3216
  }
3035
3217
 
3036
3218
  // src/Thumb.tsx
3037
- import { useEffect as useEffect5, useRef as useRef5, useState as useState8 } from "react";
3219
+ import { useEffect as useEffect5, useRef as useRef5, useState as useState9 } from "react";
3038
3220
 
3039
3221
  // src/preview.ts
3040
3222
  var cache = /* @__PURE__ */ new Map();
@@ -3087,11 +3269,11 @@ function preview(host, doc) {
3087
3269
  }
3088
3270
 
3089
3271
  // src/Thumb.tsx
3090
- import { Fragment as Fragment7, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3272
+ import { Fragment as Fragment9, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
3091
3273
  function Thumb({ host, item, label }) {
3092
3274
  const box = useRef5(null);
3093
- const [seen, setSeen] = useState8(false);
3094
- const [shot, setShot] = useState8(null);
3275
+ const [seen, setSeen] = useState9(false);
3276
+ const [shot, setShot] = useState9(null);
3095
3277
  useEffect5(() => {
3096
3278
  if (item.thumbnailUrl || item.excerpt || typeof IntersectionObserver === "undefined") return;
3097
3279
  const watch = new IntersectionObserver((entries) => {
@@ -3113,45 +3295,134 @@ function Thumb({ host, item, label }) {
3113
3295
  const text = item.excerpt ?? shot?.text ?? "";
3114
3296
  const lines = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
3115
3297
  const image = item.thumbnailUrl ?? shot?.image;
3116
- return /* @__PURE__ */ jsxs8("span", { ref: box, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
3117
- image ? /* @__PURE__ */ jsx8("img", { src: image, alt: "" }) : /* @__PURE__ */ jsx8("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines.length ? /* @__PURE__ */ jsxs8(Fragment7, { children: [
3118
- /* @__PURE__ */ jsx8("b", { children: lines[0] }),
3298
+ return /* @__PURE__ */ jsxs10("span", { ref: box, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
3299
+ image ? /* @__PURE__ */ jsx10("img", { src: image, alt: "" }) : /* @__PURE__ */ jsx10("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines.length ? /* @__PURE__ */ jsxs10(Fragment9, { children: [
3300
+ /* @__PURE__ */ jsx10("b", { children: lines[0] }),
3119
3301
  lines.slice(1, 14).join(" ")
3120
- ] }) : /* @__PURE__ */ jsxs8(Fragment7, { children: [
3121
- /* @__PURE__ */ jsx8("i", {}),
3122
- /* @__PURE__ */ jsx8("i", {}),
3123
- /* @__PURE__ */ jsx8("i", {}),
3124
- /* @__PURE__ */ jsx8("i", {}),
3125
- /* @__PURE__ */ jsx8("i", {})
3302
+ ] }) : /* @__PURE__ */ jsxs10(Fragment9, { children: [
3303
+ /* @__PURE__ */ jsx10("i", {}),
3304
+ /* @__PURE__ */ jsx10("i", {}),
3305
+ /* @__PURE__ */ jsx10("i", {}),
3306
+ /* @__PURE__ */ jsx10("i", {}),
3307
+ /* @__PURE__ */ jsx10("i", {})
3126
3308
  ] }) }),
3127
- label && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
3309
+ label && /* @__PURE__ */ jsx10("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
3310
+ ] });
3311
+ }
3312
+
3313
+ // src/Tree.tsx
3314
+ import { useState as useState10 } from "react";
3315
+ import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, FileSpreadsheet as FileSpreadsheet3, FileText as FileText3, FileType as FileType5, Files as Files2, Folder, Presentation as Presentation3 } from "lucide-react";
3316
+ import { Fragment as Fragment10, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3317
+ var icons3 = { docx: FileText3, markdown: FileType5, pdf: Files2, sheet: FileSpreadsheet3, slides: Presentation3 };
3318
+ function grow(items, names2, bySpace, other) {
3319
+ const root = { key: "", name: "", folders: [], files: [], count: 0 };
3320
+ for (const item of items) {
3321
+ const path = [...bySpace ? [names2.get(item.spaceId) ?? other] : [], ...(item.folder ?? "").split("/").filter(Boolean)];
3322
+ let at = root;
3323
+ at.count++;
3324
+ for (const part of path) {
3325
+ const key = `${at.key}/${part}`;
3326
+ let next = at.folders.find((f) => f.key === key);
3327
+ if (!next) at.folders.push(next = { key, name: part, folders: [], files: [], count: 0 });
3328
+ next.count++;
3329
+ at = next;
3330
+ }
3331
+ at.files.push(item);
3332
+ }
3333
+ const sort = (b) => {
3334
+ b.folders.sort((x, y) => x.name.localeCompare(y.name));
3335
+ b.files.sort((x, y) => x.name.localeCompare(y.name));
3336
+ b.folders.forEach(sort);
3337
+ };
3338
+ sort(root);
3339
+ return root;
3340
+ }
3341
+ var remembered = () => {
3342
+ try {
3343
+ return new Set(JSON.parse(localStorage.getItem("w100n-docs-closed") ?? "[]"));
3344
+ } catch {
3345
+ return /* @__PURE__ */ new Set();
3346
+ }
3347
+ };
3348
+ function Tree({ items, names: names2, bySpace, current, t, onOpen, onMenu, onWarm }) {
3349
+ const [closed, setClosed] = useState10(remembered);
3350
+ const flip = (key) => {
3351
+ const next = new Set(closed);
3352
+ if (!next.delete(key)) next.add(key);
3353
+ setClosed(next);
3354
+ localStorage.setItem("w100n-docs-closed", JSON.stringify([...next]));
3355
+ };
3356
+ const branch = (b, depth) => /* @__PURE__ */ jsxs11(Fragment10, { children: [
3357
+ b.folders.map((f) => {
3358
+ const open = !closed.has(f.key);
3359
+ return /* @__PURE__ */ jsxs11("div", { role: "group", "aria-label": f.name, children: [
3360
+ /* @__PURE__ */ jsxs11("button", { type: "button", className: "w100n-tree-row", "aria-expanded": open, style: { paddingLeft: 8 + depth * 16 }, onClick: () => flip(f.key), children: [
3361
+ open ? /* @__PURE__ */ jsx11(ChevronDown2, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ jsx11(ChevronRight2, { "aria-hidden": true, className: "w100n-tree-fold" }),
3362
+ /* @__PURE__ */ jsx11(Folder, { "aria-hidden": true }),
3363
+ /* @__PURE__ */ jsx11("span", { children: f.name }),
3364
+ /* @__PURE__ */ jsx11("small", { children: f.count })
3365
+ ] }),
3366
+ open && branch(f, depth + 1)
3367
+ ] }, f.key);
3368
+ }),
3369
+ b.files.map((item) => {
3370
+ const Icon = icons3[item.kind];
3371
+ return /* @__PURE__ */ jsxs11(
3372
+ "button",
3373
+ {
3374
+ type: "button",
3375
+ className: "w100n-tree-row",
3376
+ "aria-current": item.id === current,
3377
+ title: item.name,
3378
+ style: { paddingLeft: 24 + depth * 16 },
3379
+ onClick: () => onOpen(item),
3380
+ onPointerEnter: () => onWarm(item),
3381
+ onPointerLeave: () => onWarm(null),
3382
+ onContextMenu: (e) => {
3383
+ e.preventDefault();
3384
+ onMenu(item, e);
3385
+ },
3386
+ children: [
3387
+ /* @__PURE__ */ jsx11(Icon, { "aria-hidden": true }),
3388
+ /* @__PURE__ */ jsx11("span", { children: item.name.replace(/\.[^.]+$/, "") }),
3389
+ item.kind !== "markdown" && /* @__PURE__ */ jsx11("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
3390
+ ]
3391
+ },
3392
+ item.id
3393
+ );
3394
+ })
3128
3395
  ] });
3396
+ return /* @__PURE__ */ jsx11("nav", { className: "w100n-tree", "aria-label": t.tree, children: branch(grow(items, names2, bySpace, t.elsewhere), 0) });
3129
3397
  }
3130
3398
 
3131
3399
  // src/DocumentsWorkspace.tsx
3132
- import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3133
- var TextEditor2 = lazy2(() => import("./TextEditor-5S7FSLIZ.js"));
3134
- var SheetView2 = lazy2(() => import("./SheetView-OEKOHMKW.js"));
3135
- var Compare = lazy2(() => import("./Compare-M57FG4R3.js"));
3136
- var icons3 = { docx: FileText3, markdown: FileType3, pdf: Files2, sheet: FileSpreadsheet3, slides: Presentation3 };
3400
+ import { Fragment as Fragment11, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
3401
+ var TextEditor2 = lazy2(() => import("./TextEditor-X2GSL4QM.js"));
3402
+ var SheetView2 = lazy2(() => import("./SheetView-SBLAFGTL.js"));
3403
+ var Compare = lazy2(() => import("./Compare-RHAUAKUJ.js"));
3404
+ var icons4 = { docx: FileText4, markdown: FileType6, pdf: Files3, sheet: FileSpreadsheet4, slides: Presentation4 };
3137
3405
  function DocumentsWorkspace({ host, language = "en", theme = "light", place, onPlace, start, end, aside, actions }) {
3138
3406
  const t = texts[language];
3139
- const [own, setOwn] = useState9({ spaceId: null, documentId: null });
3407
+ const [own, setOwn] = useState11({ spaceId: null, documentId: null });
3140
3408
  const here = place ?? own;
3141
3409
  const go = (next) => {
3142
3410
  setOwn(next);
3143
3411
  onPlace?.(next);
3144
3412
  };
3145
- const [query, setQuery] = useState9("");
3146
- const [picked, setPicked] = useState9([]);
3147
- const [typing, setTyping] = useState9(false);
3148
- const [menusAt, setMenusAt] = useState9(null);
3149
- const [renaming, setRenaming] = useState9(null);
3150
- const [renamed, setRenamed] = useState9("idle");
3151
- const [statusAt, setStatusAt] = useState9(null);
3152
- const [listOpen, setListOpen] = useState9(true);
3153
- const [panelOpen, setPanelOpen] = useState9(true);
3154
- const [narrow, setNarrow] = useState9(false);
3413
+ const [query, setQuery] = useState11("");
3414
+ const [picked, setPicked] = useState11([]);
3415
+ const [typing, setTyping] = useState11(false);
3416
+ const [menusAt, setMenusAt] = useState11(null);
3417
+ const [renaming, setRenaming] = useState11(null);
3418
+ const [renamed, setRenamed] = useState11("idle");
3419
+ const [statusAt, setStatusAt] = useState11(null);
3420
+ const [listOpen, setListOpen] = useState11(true);
3421
+ const [shape2, setShape] = useState11(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-view") === "tree" ? "tree" : "cards");
3422
+ const [jump, setJump] = useState11(null);
3423
+ const finder = useRef6(null);
3424
+ const [panelOpen, setPanelOpen] = useState11(true);
3425
+ const [narrow, setNarrow] = useState11(false);
3155
3426
  const body = useRef6(null);
3156
3427
  const listButton = useRef6(null);
3157
3428
  const panelButton = useRef6(null);
@@ -3176,8 +3447,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3176
3447
  watch.observe(el);
3177
3448
  return () => watch.disconnect();
3178
3449
  }, [here.documentId]);
3179
- const [picking, setPicking] = useState9(false);
3180
- const [adding, setAdding] = useState9(false);
3450
+ const [picking, setPicking] = useState11(false);
3451
+ const [adding, setAdding] = useState11(false);
3181
3452
  useEffect6(() => {
3182
3453
  if (!adding) return;
3183
3454
  const close = (e) => {
@@ -3202,9 +3473,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3202
3473
  document.addEventListener("pointerdown", close);
3203
3474
  return () => document.removeEventListener("pointerdown", close);
3204
3475
  }, [picking]);
3205
- const [menu, setMenu] = useState9(null);
3206
- const [naming, setNaming] = useState9(null);
3207
- const [notice, setNotice] = useState9(null);
3476
+ const [menu, setMenu] = useState11(null);
3477
+ const [naming, setNaming] = useState11(null);
3478
+ const [notice, setNotice] = useState11(null);
3208
3479
  const early = useRef6(/* @__PURE__ */ new Map());
3209
3480
  const hover = useRef6(0);
3210
3481
  useEffect6(() => {
@@ -3223,21 +3494,21 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3223
3494
  window.removeEventListener("scroll", close, true);
3224
3495
  };
3225
3496
  }, [menu]);
3226
- const [tab, setTab] = useState9("outline");
3227
- const [outline, setOutline] = useState9([]);
3228
- const [reading, setReading] = useState9(null);
3229
- const [hunt, setHunt] = useState9("");
3230
- const [fold, setFold] = useState9({});
3231
- const [version, setVersion] = useState9({ documentId: null, id: null });
3497
+ const [tab, setTab] = useState11("outline");
3498
+ const [outline, setOutline] = useState11([]);
3499
+ const [reading, setReading] = useState11(null);
3500
+ const [hunt, setHunt] = useState11("");
3501
+ const [fold, setFold] = useState11({});
3502
+ const [version, setVersion] = useState11({ documentId: null, id: null });
3232
3503
  const versionId = version.documentId === here.documentId ? version.id : null;
3233
- const [comparing, setComparing] = useState9(false);
3234
- const [restoring, setRestoring] = useState9("idle");
3235
- const [exporting, setExporting] = useState9("idle");
3236
- const [copying, setCopying] = useState9("idle");
3237
- const [kept, setKept] = useState9(null);
3238
- const [box, setBox] = useState9(null);
3239
- const [making, setMaking] = useState9(false);
3240
- const [sending, setSending] = useState9("idle");
3504
+ const [comparing, setComparing] = useState11(false);
3505
+ const [restoring, setRestoring] = useState11("idle");
3506
+ const [exporting, setExporting] = useState11("idle");
3507
+ const [copying, setCopying] = useState11("idle");
3508
+ const [kept, setKept] = useState11(null);
3509
+ const [box, setBox] = useState11(null);
3510
+ const [making, setMaking] = useState11(false);
3511
+ const [sending, setSending] = useState11("idle");
3241
3512
  const upload = useRef6(null);
3242
3513
  const spaces = useLoad((signal) => host.spaces({ signal }), [host]);
3243
3514
  const single = spaces.data?.length === 1 ? spaces.data[0].id : null;
@@ -3302,9 +3573,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3302
3573
  return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
3303
3574
  };
3304
3575
  const size = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
3305
- const failed = (retry) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-note", children: [
3576
+ const failed = (retry) => /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-note", children: [
3306
3577
  t.failed,
3307
- /* @__PURE__ */ jsx9("button", { type: "button", onClick: retry, children: t.retry })
3578
+ /* @__PURE__ */ jsx12("button", { type: "button", onClick: retry, children: t.retry })
3308
3579
  ] });
3309
3580
  const { ask, dialog } = useUnsaved(guard, t);
3310
3581
  const side = (which, open2) => {
@@ -3316,12 +3587,21 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3316
3587
  if (which === "list") (open2 ? listClose : listButton).current?.focus();
3317
3588
  else (open2 ? panel.current?.querySelector('[aria-selected="true"]') : panelButton.current)?.focus();
3318
3589
  };
3590
+ const leave = (then) => {
3591
+ const save = doc.data?.kind === "markdown" ? guard.current : null;
3592
+ if (!save) return ask(then);
3593
+ void save().then((ok) => {
3594
+ if (!ok) return ask(then);
3595
+ guard.current = null;
3596
+ then();
3597
+ });
3598
+ };
3319
3599
  const open = (item) => {
3320
3600
  if (item.id === here.documentId) {
3321
3601
  if (narrow) setListOpen(false);
3322
3602
  return;
3323
3603
  }
3324
- ask(() => {
3604
+ leave(() => {
3325
3605
  setOutline([]);
3326
3606
  setHunt("");
3327
3607
  setFold({});
@@ -3408,8 +3688,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3408
3688
  clearTimeout(hover.current);
3409
3689
  hover.current = window.setTimeout(() => {
3410
3690
  if (item.id === here.documentId) return;
3411
- if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-5S7FSLIZ.js");
3412
- if (item.kind === "sheet") void import("./SheetView-OEKOHMKW.js");
3691
+ if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-X2GSL4QM.js");
3692
+ if (item.kind === "sheet") void import("./SheetView-SBLAFGTL.js");
3413
3693
  const kept2 = early.current.get(item.id);
3414
3694
  if (kept2 && Date.now() - kept2.at < 15e3 || item.size > 5e6) return;
3415
3695
  const next = { at: Date.now(), doc: host.document(item.id), bytes: host.content(item.id, null) };
@@ -3478,8 +3758,64 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3478
3758
  setSending("failed");
3479
3759
  }
3480
3760
  };
3481
- let stage = /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-empty", children: [
3482
- /* @__PURE__ */ jsx9(FileText3, { "aria-hidden": true }),
3761
+ const notes = doc.data?.kind === "markdown" ? all.filter((item) => item.kind === "markdown" && item.spaceId === doc.data.spaceId) : [];
3762
+ const note = async (name, show) => {
3763
+ try {
3764
+ const made = await host.create({ name: `${name}.md`, bytes: new TextEncoder().encode("").buffer, mimeType: "text/markdown", near: here.documentId ?? void 0 });
3765
+ list.retry();
3766
+ if (show) opened(made);
3767
+ return made.id;
3768
+ } catch {
3769
+ setNotice(t.actionFailed);
3770
+ return null;
3771
+ }
3772
+ };
3773
+ const wiki = doc.data?.kind === "markdown" ? {
3774
+ notes: notes.map(({ id, name, folder: folder2 }) => ({ id, name, folder: folder2 })),
3775
+ open: (id) => {
3776
+ const item = all.find((x) => x.id === id);
3777
+ if (item) open(item);
3778
+ },
3779
+ create: host.create ? (name) => note(name, false) : void 0
3780
+ } : void 0;
3781
+ const panelOn = (next) => {
3782
+ setTab(next);
3783
+ side("panel", true);
3784
+ };
3785
+ const current = doc.data && all.find((item) => item.id === doc.data.id);
3786
+ const commands = [
3787
+ ...host.create ? [{ id: "new", label: t.newNote, icon: FilePlus, keys: "\u2318N", run: () => void note(t.untitled, true) }] : [],
3788
+ { id: "open", label: t.openNote, icon: Search3, keys: "\u2318O", run: () => setJump("open") },
3789
+ { id: "search", label: t.searchAll, icon: Search3, run: () => {
3790
+ side("list", true);
3791
+ requestAnimationFrame(() => finder.current?.focus());
3792
+ } },
3793
+ ...doc.data ? [
3794
+ { id: "outline", label: t.showOutline, icon: ListTree, run: () => panelOn("outline") },
3795
+ ...doc.data.kind === "markdown" ? [{ id: "links", label: t.showLinks, icon: Link22, run: () => panelOn("links") }] : [],
3796
+ { id: "versions", label: t.showVersions, icon: History, run: () => panelOn("versions") },
3797
+ ...text && host.comments ? [{ id: "comments", label: t.showComments, icon: MessagesSquare, run: () => panelOn("comments") }] : [],
3798
+ ...host.send && !doc.data.id.includes(":") ? [{ id: "send", label: t.sendChat, icon: Send, run: () => host.send(doc.data.id) }] : [],
3799
+ ...host.rename && doc.data.rights.edit ? [{ id: "rename", label: t.rename, icon: Pencil, run: () => setRenaming(doc.data.name.replace(/\.[^.]+$/, "")) }] : [],
3800
+ ...host.remove && current ? [{ id: "trash", label: t.trash, icon: Trash24, run: () => void drop2(current) }] : []
3801
+ ] : []
3802
+ ];
3803
+ useEffect6(() => {
3804
+ const press = (e) => {
3805
+ if (!(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey) return;
3806
+ const key = e.key.toLowerCase();
3807
+ if (key === "o" || key === "p" && doc.data?.kind !== "docx" && doc.data?.kind !== "pdf" || key === "n" && host.create && doc.data?.kind === "markdown") {
3808
+ e.preventDefault();
3809
+ e.stopPropagation();
3810
+ if (key === "n") void note(t.untitled, true);
3811
+ else setJump(key === "o" ? "open" : "run");
3812
+ }
3813
+ };
3814
+ window.addEventListener("keydown", press, true);
3815
+ return () => window.removeEventListener("keydown", press, true);
3816
+ });
3817
+ let stage = /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-empty", children: [
3818
+ /* @__PURE__ */ jsx12(FileText4, { "aria-hidden": true }),
3483
3819
  t.pick
3484
3820
  ] });
3485
3821
  if (here.documentId) {
@@ -3487,9 +3823,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3487
3823
  doc.retry();
3488
3824
  content.retry();
3489
3825
  });
3490
- else if (!doc.data || !content.data) stage = /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading });
3491
- else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ jsx9(Suspense2, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(Compare, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
3492
- else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ jsx9(Suspense2, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(
3826
+ else if (!doc.data || !content.data) stage = /* @__PURE__ */ jsx12("div", { className: "w100n-docs-empty", children: t.loading });
3827
+ else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ jsx12(Suspense2, { fallback: /* @__PURE__ */ jsx12("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx12(Compare, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
3828
+ else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ jsx12(Suspense2, { fallback: /* @__PURE__ */ jsx12("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx12(
3493
3829
  TextEditor2,
3494
3830
  {
3495
3831
  kind: doc.data.kind,
@@ -3510,6 +3846,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3510
3846
  slot: tab === "comments" && panelOpen ? box : null,
3511
3847
  head: docbar ? { menus: menusAt, status: statusAt } : void 0,
3512
3848
  guard,
3849
+ wiki: versionId ? void 0 : wiki,
3513
3850
  file: versionId ? void 0 : {
3514
3851
  formats: host.exportAs ? doc.data.exports ?? [] : [],
3515
3852
  download: (f) => void exportAs(doc.data, f),
@@ -3525,7 +3862,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3525
3862
  },
3526
3863
  doc.data.id
3527
3864
  ) });
3528
- else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ jsx9(
3865
+ else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ jsx12(
3529
3866
  PdfView,
3530
3867
  {
3531
3868
  bytes: content.data,
@@ -3547,7 +3884,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3547
3884
  },
3548
3885
  `${doc.data.id}:${versionId ?? ""}`
3549
3886
  );
3550
- else if (doc.data.kind === "slides") stage = /* @__PURE__ */ jsx9(
3887
+ else if (doc.data.kind === "slides") stage = /* @__PURE__ */ jsx12(
3551
3888
  SlidesView,
3552
3889
  {
3553
3890
  html: new TextDecoder().decode(content.data),
@@ -3557,8 +3894,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3557
3894
  theme,
3558
3895
  onOutline: setOutline,
3559
3896
  guard,
3560
- onSaveRequest: host.save && !versionId ? async (bytes, note) => {
3561
- await host.save(doc.data.id, bytes, note);
3897
+ onSaveRequest: host.save && !versionId ? async (bytes, note2) => {
3898
+ await host.save(doc.data.id, bytes, note2);
3562
3899
  versions.retry();
3563
3900
  doc.retry();
3564
3901
  list.retry();
@@ -3566,7 +3903,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3566
3903
  },
3567
3904
  doc.data.id
3568
3905
  );
3569
- else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ jsx9(Suspense2, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(
3906
+ else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ jsx12(Suspense2, { fallback: /* @__PURE__ */ jsx12("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx12(
3570
3907
  SheetView2,
3571
3908
  {
3572
3909
  bytes: content.data,
@@ -3584,8 +3921,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3584
3921
  doc.retry();
3585
3922
  list.retry();
3586
3923
  },
3587
- onSaveRequest: versionId || !host.save ? void 0 : async (bytes, note) => {
3588
- await host.save(doc.data.id, bytes, note);
3924
+ onSaveRequest: versionId || !host.save ? void 0 : async (bytes, note2) => {
3925
+ await host.save(doc.data.id, bytes, note2);
3589
3926
  versions.retry();
3590
3927
  doc.retry();
3591
3928
  list.retry();
@@ -3593,9 +3930,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3593
3930
  },
3594
3931
  `${doc.data.id}:${versionId ?? ""}`
3595
3932
  ) });
3596
- else stage = /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.unsupported });
3933
+ else stage = /* @__PURE__ */ jsx12("div", { className: "w100n-docs-empty", children: t.unsupported });
3597
3934
  }
3598
- const Kind = doc.data ? icons3[doc.data.kind] : FileText3;
3935
+ const Kind = doc.data ? icons4[doc.data.kind] : FileText4;
3599
3936
  const top = Math.min(...outline.map((h) => h.level));
3600
3937
  const chapters = outline.reduce((all2, h) => {
3601
3938
  if (h.level === top || !all2.length) all2.push({ head: h, subs: [] });
@@ -3608,12 +3945,17 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3608
3945
  const hit = (h) => words.every((w) => h.text.toLocaleLowerCase().includes(w));
3609
3946
  const reach = (h) => h.go ? h.go() : document.getElementById(h.id)?.scrollIntoView({ behavior: "smooth", block: "start" });
3610
3947
  const crumbs = doc.data ? [names2.get(doc.data.spaceId), doc.data.folder].filter(Boolean) : space ? [space.name] : [];
3611
- const panelTabs = [["outline", ListTree, t.outline], ["versions", History, t.versions], ["details", Info, t.details]];
3948
+ const panelTabs = [
3949
+ ["outline", ListTree, t.outline],
3950
+ ...doc.data?.kind === "markdown" ? [["links", Link22, t.links]] : [],
3951
+ ["versions", History, t.versions],
3952
+ ["details", Info, t.details]
3953
+ ];
3612
3954
  if (pdf && host.signatures) panelTabs.push(["signatures", Signature, t.signatures]);
3613
3955
  if (text && host.comments && !versionId) panelTabs.push(["comments", MessagesSquare, t.comments]);
3614
3956
  const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
3615
3957
  if (sharing) panelTabs.push(["sharing", Share2, t.sharing]);
3616
- const listToggle = /* @__PURE__ */ jsx9(
3958
+ const listToggle = /* @__PURE__ */ jsx12(
3617
3959
  "button",
3618
3960
  {
3619
3961
  ref: listButton,
@@ -3623,10 +3965,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3623
3965
  onClick: () => side("list", !listOpen),
3624
3966
  "aria-label": listOpen ? t.closeList : t.openList,
3625
3967
  title: listOpen ? t.closeList : t.openList,
3626
- children: listOpen ? /* @__PURE__ */ jsx9(PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(PanelLeftOpen, { "aria-hidden": true })
3968
+ children: listOpen ? /* @__PURE__ */ jsx12(PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx12(PanelLeftOpen, { "aria-hidden": true })
3627
3969
  }
3628
3970
  );
3629
- const panelToggle = doc.data && /* @__PURE__ */ jsx9(
3971
+ const panelToggle = doc.data && /* @__PURE__ */ jsx12(
3630
3972
  "button",
3631
3973
  {
3632
3974
  ref: panelButton,
@@ -3636,16 +3978,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3636
3978
  onClick: () => side("panel", !panelOpen),
3637
3979
  "aria-label": panelOpen ? t.closePanel : t.openPanel,
3638
3980
  title: panelOpen ? t.closePanel : t.openPanel,
3639
- children: panelOpen ? /* @__PURE__ */ jsx9(PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(PanelRightOpen, { "aria-hidden": true })
3981
+ children: panelOpen ? /* @__PURE__ */ jsx12(PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx12(PanelRightOpen, { "aria-hidden": true })
3640
3982
  }
3641
3983
  );
3642
- return /* @__PURE__ */ jsxs9("div", { className: "w100n-docs", "data-theme": theme, children: [
3643
- /* @__PURE__ */ jsxs9("header", { className: "w100n-docs-bar", children: [
3644
- start && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
3984
+ return /* @__PURE__ */ jsxs12("div", { className: "w100n-docs", "data-theme": theme, children: [
3985
+ /* @__PURE__ */ jsxs12("header", { className: "w100n-docs-bar", children: [
3986
+ start && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
3645
3987
  narrow && listToggle,
3646
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ jsx9(Kind, { "aria-hidden": true }) }),
3647
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-heading", children: [
3648
- renaming !== null && doc.data ? /* @__PURE__ */ jsx9(
3988
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ jsx12(Kind, { "aria-hidden": true }) }),
3989
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-heading", children: [
3990
+ renaming !== null && doc.data ? /* @__PURE__ */ jsx12(
3649
3991
  "input",
3650
3992
  {
3651
3993
  className: "w100n-docs-title w100n-docs-rename",
@@ -3663,7 +4005,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3663
4005
  }
3664
4006
  }
3665
4007
  }
3666
- ) : /* @__PURE__ */ jsx9(
4008
+ ) : /* @__PURE__ */ jsx12(
3667
4009
  "strong",
3668
4010
  {
3669
4011
  className: "w100n-docs-title",
@@ -3672,31 +4014,31 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3672
4014
  children: doc.data?.name ?? t.documents
3673
4015
  }
3674
4016
  ),
3675
- docbar ? /* @__PURE__ */ jsx9("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ jsx9("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ jsxs9("span", { children: [
3676
- i > 0 && /* @__PURE__ */ jsx9(ChevronRight2, { "aria-hidden": true }),
4017
+ docbar ? /* @__PURE__ */ jsx12("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ jsx12("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ jsxs12("span", { children: [
4018
+ i > 0 && /* @__PURE__ */ jsx12(ChevronRight3, { "aria-hidden": true }),
3677
4019
  item
3678
- ] }, i)) }) : /* @__PURE__ */ jsx9("span", { className: "w100n-docs-hint", children: t.hint })
4020
+ ] }, i)) }) : /* @__PURE__ */ jsx12("span", { className: "w100n-docs-hint", children: t.hint })
3679
4021
  ] }),
3680
- versionId && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
3681
- versionId && text && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
3682
- /* @__PURE__ */ jsx9(FileDiff, { "aria-hidden": true }),
4022
+ versionId && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
4023
+ versionId && text && /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
4024
+ /* @__PURE__ */ jsx12(FileDiff, { "aria-hidden": true }),
3683
4025
  comparing ? t.hideChanges : t.showChanges
3684
4026
  ] }),
3685
- versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
3686
- /* @__PURE__ */ jsx9(RotateCcw2, { "aria-hidden": true }),
4027
+ versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
4028
+ /* @__PURE__ */ jsx12(RotateCcw2, { "aria-hidden": true }),
3687
4029
  t.restore
3688
4030
  ] }),
3689
- restoring === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
3690
- doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
3691
- /* @__PURE__ */ jsx9(FileSpreadsheet3, { "aria-hidden": true }),
4031
+ restoring === "failed" && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
4032
+ doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
4033
+ /* @__PURE__ */ jsx12(FileSpreadsheet4, { "aria-hidden": true }),
3692
4034
  t.copyAs
3693
4035
  ] }),
3694
- copying === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.copyFailed }),
3695
- kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
3696
- kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
3697
- renamed === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.renameFailed }),
3698
- docbar && /* @__PURE__ */ jsx9("span", { ref: setStatusAt, className: "w100n-docs-status" }),
3699
- host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ jsxs9(
4036
+ copying === "failed" && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-muted", children: t.copyFailed }),
4037
+ kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
4038
+ kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
4039
+ renamed === "failed" && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-muted", children: t.renameFailed }),
4040
+ docbar && /* @__PURE__ */ jsx12("span", { ref: setStatusAt, className: "w100n-docs-status" }),
4041
+ host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ jsxs12(
3700
4042
  "button",
3701
4043
  {
3702
4044
  type: "button",
@@ -3706,146 +4048,167 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3706
4048
  title: t.sendChat,
3707
4049
  onClick: () => host.send(doc.data.id),
3708
4050
  children: [
3709
- /* @__PURE__ */ jsx9(Send, { "aria-hidden": true }),
3710
- /* @__PURE__ */ jsx9("span", { children: t.sendChat })
4051
+ /* @__PURE__ */ jsx12(Send, { "aria-hidden": true }),
4052
+ /* @__PURE__ */ jsx12("span", { children: t.sendChat })
3711
4053
  ]
3712
4054
  }
3713
4055
  ),
3714
- sharing && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
4056
+ sharing && /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
3715
4057
  setTab("sharing");
3716
4058
  side("panel", true);
3717
4059
  }, children: [
3718
- /* @__PURE__ */ jsx9(Share2, { "aria-hidden": true }),
3719
- /* @__PURE__ */ jsx9("span", { children: t.share })
4060
+ /* @__PURE__ */ jsx12(Share2, { "aria-hidden": true }),
4061
+ /* @__PURE__ */ jsx12("span", { children: t.share })
3720
4062
  ] }),
3721
4063
  doc.data && !versionId && actions?.(doc.data),
3722
4064
  narrow && panelToggle,
3723
- end && /* @__PURE__ */ jsx9("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
4065
+ end && /* @__PURE__ */ jsx12("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
3724
4066
  ] }),
3725
- /* @__PURE__ */ jsxs9("div", { ref: body, className: "w100n-docs-body", children: [
3726
- listOpen && /* @__PURE__ */ jsxs9("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
3727
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-head", children: [
3728
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-row", children: [
3729
- /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3730
- /* @__PURE__ */ jsx9(Files2, { "aria-hidden": true }),
4067
+ /* @__PURE__ */ jsxs12("div", { ref: body, className: "w100n-docs-body", children: [
4068
+ listOpen && /* @__PURE__ */ jsxs12("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
4069
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-head", children: [
4070
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-row", children: [
4071
+ /* @__PURE__ */ jsxs12("p", { className: "w100n-docs-caption", children: [
4072
+ /* @__PURE__ */ jsx12(Files3, { "aria-hidden": true }),
3731
4073
  t.documents,
3732
- /* @__PURE__ */ jsx9("span", { children: all.length })
4074
+ /* @__PURE__ */ jsx12("span", { children: all.length })
3733
4075
  ] }),
3734
- host.create && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-new", onKeyDown: (e) => {
4076
+ host.create && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-new", onKeyDown: (e) => {
3735
4077
  if (e.key === "Escape" && adding) {
3736
4078
  e.stopPropagation();
3737
4079
  setAdding(false);
3738
4080
  }
3739
4081
  }, children: [
3740
- /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
3741
- /* @__PURE__ */ jsx9(Plus4, { "aria-hidden": true }),
3742
- /* @__PURE__ */ jsx9("span", { children: sending === "busy" ? t.uploading : t.create }),
3743
- /* @__PURE__ */ jsx9(ChevronDown2, { "aria-hidden": true })
4082
+ /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
4083
+ /* @__PURE__ */ jsx12(Plus5, { "aria-hidden": true }),
4084
+ /* @__PURE__ */ jsx12("span", { children: sending === "busy" ? t.uploading : t.create }),
4085
+ /* @__PURE__ */ jsx12(ChevronDown3, { "aria-hidden": true })
3744
4086
  ] }),
3745
- adding && /* @__PURE__ */ jsxs9("div", { role: "menu", className: "w100n-docs-menu", children: [
3746
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4087
+ adding && /* @__PURE__ */ jsxs12("div", { role: "menu", className: "w100n-docs-menu", children: [
4088
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
3747
4089
  setAdding(false);
3748
4090
  setMaking(true);
3749
4091
  }, children: [
3750
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx9(FilePlus, { "aria-hidden": true }) }),
3751
- /* @__PURE__ */ jsx9("b", { children: t.newTitle })
4092
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx12(FilePlus, { "aria-hidden": true }) }),
4093
+ /* @__PURE__ */ jsx12("b", { children: t.newTitle })
3752
4094
  ] }),
3753
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4095
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
3754
4096
  setAdding(false);
3755
4097
  upload.current.click();
3756
4098
  }, children: [
3757
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx9(Upload, { "aria-hidden": true }) }),
3758
- /* @__PURE__ */ jsx9("b", { children: t.uploadFile })
4099
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx12(Upload, { "aria-hidden": true }) }),
4100
+ /* @__PURE__ */ jsx12("b", { children: t.uploadFile })
3759
4101
  ] })
3760
4102
  ] }),
3761
- /* @__PURE__ */ jsx9("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
4103
+ /* @__PURE__ */ jsx12("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
3762
4104
  const file = e.target.files?.[0];
3763
4105
  e.target.value = "";
3764
4106
  if (file) void send(file);
3765
4107
  } })
3766
4108
  ] }),
3767
- /* @__PURE__ */ jsx9("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ jsx9(X6, { "aria-hidden": true }) })
4109
+ /* @__PURE__ */ jsx12("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ jsx12(X6, { "aria-hidden": true }) })
3768
4110
  ] }),
3769
- (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
4111
+ (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
3770
4112
  if (e.key !== "Escape" || !picking) return;
3771
4113
  e.stopPropagation();
3772
4114
  setPicking(false);
3773
4115
  e.currentTarget.querySelector("button").focus();
3774
4116
  }, children: [
3775
- /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
3776
- space ? /* @__PURE__ */ jsx9("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ jsx9("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx9(LayoutGrid, { "aria-hidden": true }) }),
3777
- /* @__PURE__ */ jsx9("b", { children: space?.name ?? t.allProjects }),
3778
- !space && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-count", children: all.length }),
3779
- /* @__PURE__ */ jsx9(ChevronDown2, { "aria-hidden": true })
4117
+ /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
4118
+ space ? /* @__PURE__ */ jsx12("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ jsx12("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx12(LayoutGrid, { "aria-hidden": true }) }),
4119
+ /* @__PURE__ */ jsx12("b", { children: space?.name ?? t.allProjects }),
4120
+ !space && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-count", children: all.length }),
4121
+ /* @__PURE__ */ jsx12(ChevronDown3, { "aria-hidden": true })
3780
4122
  ] }),
3781
- picking && /* @__PURE__ */ jsxs9("div", { role: "listbox", className: "w100n-docs-menu", children: [
3782
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
3783
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx9(LayoutGrid, { "aria-hidden": true }) }),
3784
- /* @__PURE__ */ jsx9("b", { children: t.allProjects }),
3785
- !spaceId && /* @__PURE__ */ jsx9(Check2, { "aria-hidden": true })
4123
+ picking && /* @__PURE__ */ jsxs12("div", { role: "listbox", className: "w100n-docs-menu", children: [
4124
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
4125
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx12(LayoutGrid, { "aria-hidden": true }) }),
4126
+ /* @__PURE__ */ jsx12("b", { children: t.allProjects }),
4127
+ !spaceId && /* @__PURE__ */ jsx12(Check2, { "aria-hidden": true })
3786
4128
  ] }),
3787
- groups.map((group) => /* @__PURE__ */ jsxs9("div", { role: "group", "aria-label": group || void 0, children: [
3788
- group && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-menu-caption", children: group }),
3789
- (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ jsxs9("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
3790
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
3791
- /* @__PURE__ */ jsx9("b", { children: item.name }),
3792
- !spaceId && counts.get(item.id) ? /* @__PURE__ */ jsx9("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
3793
- item.id === spaceId && /* @__PURE__ */ jsx9(Check2, { "aria-hidden": true })
4129
+ groups.map((group) => /* @__PURE__ */ jsxs12("div", { role: "group", "aria-label": group || void 0, children: [
4130
+ group && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-menu-caption", children: group }),
4131
+ (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ jsxs12("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
4132
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
4133
+ /* @__PURE__ */ jsx12("b", { children: item.name }),
4134
+ !spaceId && counts.get(item.id) ? /* @__PURE__ */ jsx12("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
4135
+ item.id === spaceId && /* @__PURE__ */ jsx12(Check2, { "aria-hidden": true })
3794
4136
  ] }, item.id))
3795
4137
  ] }, group))
3796
4138
  ] })
3797
4139
  ] }),
3798
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-filters", children: [
3799
- /* @__PURE__ */ jsxs9("label", { className: "w100n-docs-field w100n-docs-search", children: [
3800
- /* @__PURE__ */ jsx9(Search2, { "aria-hidden": true }),
3801
- /* @__PURE__ */ jsx9("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search })
4140
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-filters", children: [
4141
+ /* @__PURE__ */ jsxs12("label", { className: "w100n-docs-field w100n-docs-search", children: [
4142
+ /* @__PURE__ */ jsx12(Search3, { "aria-hidden": true }),
4143
+ /* @__PURE__ */ jsx12("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
4144
+ /* @__PURE__ */ jsx12("kbd", { children: "\u2318O" })
3802
4145
  ] }),
3803
- present.length > 1 && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-types", onKeyDown: (e) => {
4146
+ present.length > 1 && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-types", onKeyDown: (e) => {
3804
4147
  if (e.key !== "Escape" || !typing) return;
3805
4148
  e.stopPropagation();
3806
4149
  setTyping(false);
3807
4150
  e.currentTarget.querySelector("button").focus();
3808
4151
  }, children: [
3809
- /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
3810
- /* @__PURE__ */ jsx9(ListFilter, { "aria-hidden": true }),
3811
- /* @__PURE__ */ jsx9("b", { children: t.typeFilter }),
3812
- picked.length > 0 && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", children: picked.length }),
3813
- /* @__PURE__ */ jsx9(ChevronDown2, { "aria-hidden": true })
4152
+ /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
4153
+ /* @__PURE__ */ jsx12(ListFilter, { "aria-hidden": true }),
4154
+ /* @__PURE__ */ jsx12("b", { children: t.typeFilter }),
4155
+ picked.length > 0 && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-badge", children: picked.length }),
4156
+ /* @__PURE__ */ jsx12(ChevronDown3, { "aria-hidden": true })
3814
4157
  ] }),
3815
- typing && /* @__PURE__ */ jsxs9("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
4158
+ typing && /* @__PURE__ */ jsxs12("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
3816
4159
  present.map((item) => {
3817
- const Icon = icons3[item];
4160
+ const Icon = icons4[item];
3818
4161
  const on = picked.includes(item);
3819
- return /* @__PURE__ */ jsxs9("button", { type: "button", role: "option", "aria-selected": on, onClick: () => setPicked(on ? picked.filter((k) => k !== item) : [...picked, item]), children: [
3820
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-box", children: on && /* @__PURE__ */ jsx9(Check2, { "aria-hidden": true }) }),
3821
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx9(Icon, { "aria-hidden": true }) }),
3822
- /* @__PURE__ */ jsx9("b", { children: t.kinds[item] }),
3823
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
4162
+ return /* @__PURE__ */ jsxs12("button", { type: "button", role: "option", "aria-selected": on, onClick: () => setPicked(on ? picked.filter((k) => k !== item) : [...picked, item]), children: [
4163
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-box", children: on && /* @__PURE__ */ jsx12(Check2, { "aria-hidden": true }) }),
4164
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx12(Icon, { "aria-hidden": true }) }),
4165
+ /* @__PURE__ */ jsx12("b", { children: t.kinds[item] }),
4166
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
3824
4167
  ] }, item);
3825
4168
  }),
3826
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-menu-foot", children: [
3827
- /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
3828
- /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
4169
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-menu-foot", children: [
4170
+ /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
4171
+ /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
3829
4172
  ] })
3830
4173
  ] })
3831
4174
  ] })
3832
4175
  ] }),
3833
- picked.length > 0 && /* @__PURE__ */ jsx9("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ jsxs9("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
4176
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-shape", role: "radiogroup", "aria-label": t.tree, children: [["tree", FolderTree, t.tree], ["cards", LayoutGrid, t.cards]].map(([key, Icon, label]) => /* @__PURE__ */ jsxs12("button", { type: "button", role: "radio", "aria-checked": shape2 === key, onClick: () => {
4177
+ setShape(key);
4178
+ localStorage.setItem("w100n-docs-view", key);
4179
+ }, children: [
4180
+ /* @__PURE__ */ jsx12(Icon, { "aria-hidden": true }),
4181
+ label
4182
+ ] }, key)) }),
4183
+ picked.length > 0 && /* @__PURE__ */ jsx12("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ jsxs12("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
3834
4184
  t.kinds[item],
3835
- /* @__PURE__ */ jsx9(X6, { "aria-hidden": true })
4185
+ /* @__PURE__ */ jsx12(X6, { "aria-hidden": true })
3836
4186
  ] }, item)) })
3837
4187
  ] }),
3838
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-cards", children: [
3839
- sending === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
4188
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-cards", children: [
4189
+ sending === "failed" && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
3840
4190
  list.error && failed(list.retry),
3841
- list.loading && !list.data && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.loading }),
3842
- notice && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "status", children: notice }),
3843
- list.data && !shown.length && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
3844
- folders.map((folder2) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
3845
- folders.length > 1 && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
3846
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-card", children: [
3847
- /* @__PURE__ */ jsx9(Thumb, { host, item, label: t.kinds[item.kind] }),
3848
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ jsx9(
4191
+ list.loading && !list.data && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", children: t.loading }),
4192
+ notice && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", role: "status", children: notice }),
4193
+ list.data && !shown.length && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
4194
+ shape2 === "tree" && list.data && /* @__PURE__ */ jsx12(
4195
+ Tree,
4196
+ {
4197
+ items: shown,
4198
+ names: names2,
4199
+ bySpace: !spaceId,
4200
+ current: here.documentId,
4201
+ t,
4202
+ onOpen: open,
4203
+ onMenu: (item, e) => setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false }),
4204
+ onWarm: (item) => item ? warm(item) : clearTimeout(hover.current)
4205
+ }
4206
+ ),
4207
+ shape2 === "cards" && folders.map((folder2) => /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
4208
+ folders.length > 1 && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
4209
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-card", children: [
4210
+ /* @__PURE__ */ jsx12(Thumb, { host, item, label: t.kinds[item.kind] }),
4211
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ jsx12(
3849
4212
  "input",
3850
4213
  {
3851
4214
  className: "w100n-docs-field",
@@ -3864,7 +4227,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3864
4227
  }
3865
4228
  }
3866
4229
  ) })
3867
- ] }, item.id) : /* @__PURE__ */ jsxs9(
4230
+ ] }, item.id) : /* @__PURE__ */ jsxs12(
3868
4231
  "button",
3869
4232
  {
3870
4233
  type: "button",
@@ -3879,11 +4242,11 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3879
4242
  setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
3880
4243
  },
3881
4244
  children: [
3882
- /* @__PURE__ */ jsx9(Thumb, { host, item, label: t.kinds[item.kind] }),
3883
- /* @__PURE__ */ jsxs9("span", { className: "w100n-docs-card-text", children: [
3884
- /* @__PURE__ */ jsx9("b", { children: item.name }),
3885
- /* @__PURE__ */ jsx9("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
3886
- inside.get(item.id) && /* @__PURE__ */ jsx9("small", { className: "w100n-docs-hit", children: inside.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx9("mark", { children: part }, i) : part) })
4245
+ /* @__PURE__ */ jsx12(Thumb, { host, item, label: t.kinds[item.kind] }),
4246
+ /* @__PURE__ */ jsxs12("span", { className: "w100n-docs-card-text", children: [
4247
+ /* @__PURE__ */ jsx12("b", { children: item.name }),
4248
+ /* @__PURE__ */ jsx12("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
4249
+ inside.get(item.id) && /* @__PURE__ */ jsx12("small", { className: "w100n-docs-hit", children: inside.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx12("mark", { children: part }, i) : part) })
3887
4250
  ] })
3888
4251
  ]
3889
4252
  },
@@ -3893,31 +4256,31 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3893
4256
  ] })
3894
4257
  ] }),
3895
4258
  !narrow && !listOpen && listToggle,
3896
- /* @__PURE__ */ jsxs9("main", { className: "w100n-docs-stage", children: [
4259
+ /* @__PURE__ */ jsxs12("main", { className: "w100n-docs-stage", children: [
3897
4260
  !narrow && !panelOpen && panelToggle,
3898
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-bare", children: stage })
4261
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-bare", children: stage })
3899
4262
  ] }),
3900
- doc.data && panelOpen && /* @__PURE__ */ jsxs9("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
3901
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-head", children: /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-row", children: [
3902
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key, Icon, label]) => /* @__PURE__ */ jsxs9("button", { type: "button", role: "tab", "aria-selected": tab === key, tabIndex: tab === key ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key), children: [
3903
- /* @__PURE__ */ jsx9(Icon, { "aria-hidden": true }),
3904
- (panelTabs.length < 4 || tab === key && panelTabs.length < 5) && /* @__PURE__ */ jsx9("span", { children: label })
4263
+ doc.data && panelOpen && /* @__PURE__ */ jsxs12("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
4264
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-head", children: /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-row", children: [
4265
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key, Icon, label]) => /* @__PURE__ */ jsxs12("button", { type: "button", role: "tab", "aria-selected": tab === key, tabIndex: tab === key ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key), children: [
4266
+ /* @__PURE__ */ jsx12(Icon, { "aria-hidden": true }),
4267
+ (panelTabs.length < 4 || tab === key && panelTabs.length < 5) && /* @__PURE__ */ jsx12("span", { children: label })
3905
4268
  ] }, key)) }),
3906
- /* @__PURE__ */ jsx9("button", { type: "button", className: "w100n-docs-close", onClick: () => side("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ jsx9(X6, { "aria-hidden": true }) })
4269
+ /* @__PURE__ */ jsx12("button", { type: "button", className: "w100n-docs-close", onClick: () => side("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ jsx12(X6, { "aria-hidden": true }) })
3907
4270
  ] }) }),
3908
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key]) => key === tab)?.[2], children: [
3909
- tab === "outline" && (outline.length ? /* @__PURE__ */ jsxs9("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
3910
- now && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-reading", children: [
3911
- /* @__PURE__ */ jsx9("span", { children: /* @__PURE__ */ jsx9("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
3912
- /* @__PURE__ */ jsxs9("small", { children: [
4271
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key]) => key === tab)?.[2], children: [
4272
+ tab === "outline" && (outline.length ? /* @__PURE__ */ jsxs12("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
4273
+ now && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-reading", children: [
4274
+ /* @__PURE__ */ jsx12("span", { children: /* @__PURE__ */ jsx12("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
4275
+ /* @__PURE__ */ jsxs12("small", { children: [
3913
4276
  Math.round(now.progress * 100),
3914
4277
  "% ",
3915
4278
  t.read
3916
4279
  ] })
3917
4280
  ] }),
3918
- outline.length > 8 && /* @__PURE__ */ jsxs9("label", { className: "w100n-docs-field w100n-docs-search", children: [
3919
- /* @__PURE__ */ jsx9(Search2, { "aria-hidden": true }),
3920
- /* @__PURE__ */ jsx9("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
4281
+ outline.length > 8 && /* @__PURE__ */ jsxs12("label", { className: "w100n-docs-field w100n-docs-search", children: [
4282
+ /* @__PURE__ */ jsx12(Search3, { "aria-hidden": true }),
4283
+ /* @__PURE__ */ jsx12("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
3921
4284
  ] }),
3922
4285
  chapters.map((c, i) => {
3923
4286
  const subs = words.length ? c.subs.filter(hit) : c.subs;
@@ -3925,13 +4288,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3925
4288
  const opened2 = words.length > 0 || (fold[c.head.id] ?? i === reached);
3926
4289
  const named = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
3927
4290
  const mark = c.subs.findIndex((s) => s.id === now?.id);
3928
- return /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
3929
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-chapter-row", children: [
3930
- /* @__PURE__ */ jsxs9("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: [
3931
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-chapter-num", children: named ? named[1] : /* @__PURE__ */ jsx9(Bookmark, { "aria-hidden": true }) }),
3932
- /* @__PURE__ */ jsx9("b", { children: named ? named[2] : c.head.text })
4291
+ return /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
4292
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-chapter-row", children: [
4293
+ /* @__PURE__ */ jsxs12("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: [
4294
+ /* @__PURE__ */ jsx12("span", { className: "w100n-docs-chapter-num", children: named ? named[1] : /* @__PURE__ */ jsx12(Bookmark, { "aria-hidden": true }) }),
4295
+ /* @__PURE__ */ jsx12("b", { children: named ? named[2] : c.head.text })
3933
4296
  ] }),
3934
- c.subs.length > 0 && /* @__PURE__ */ jsxs9(
4297
+ c.subs.length > 0 && /* @__PURE__ */ jsxs12(
3935
4298
  "button",
3936
4299
  {
3937
4300
  type: "button",
@@ -3941,13 +4304,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3941
4304
  title: opened2 ? t.hideSections : t.showSections,
3942
4305
  onClick: () => setFold({ ...fold, [c.head.id]: !opened2 }),
3943
4306
  children: [
3944
- /* @__PURE__ */ jsx9("small", { children: c.subs.length }),
3945
- opened2 ? /* @__PURE__ */ jsx9(ChevronDown2, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(ChevronRight2, { "aria-hidden": true })
4307
+ /* @__PURE__ */ jsx12("small", { children: c.subs.length }),
4308
+ opened2 ? /* @__PURE__ */ jsx12(ChevronDown3, { "aria-hidden": true }) : /* @__PURE__ */ jsx12(ChevronRight3, { "aria-hidden": true })
3946
4309
  ]
3947
4310
  }
3948
4311
  )
3949
4312
  ] }),
3950
- opened2 && subs.length > 0 && /* @__PURE__ */ jsx9("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ jsxs9(
4313
+ opened2 && subs.length > 0 && /* @__PURE__ */ jsx12("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ jsxs12(
3951
4314
  "button",
3952
4315
  {
3953
4316
  type: "button",
@@ -3956,7 +4319,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3956
4319
  "data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
3957
4320
  "aria-current": now?.id === s.id ? "location" : void 0,
3958
4321
  children: [
3959
- /* @__PURE__ */ jsx9("i", { "aria-hidden": true }),
4322
+ /* @__PURE__ */ jsx12("i", { "aria-hidden": true }),
3960
4323
  s.text
3961
4324
  ]
3962
4325
  },
@@ -3964,46 +4327,47 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3964
4327
  )) })
3965
4328
  ] }, c.head.id);
3966
4329
  })
3967
- ] }) : /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.noOutline })),
3968
- tab === "versions" && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-versions", children: [
4330
+ ] }) : /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", children: t.noOutline })),
4331
+ tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ jsx12(Backlinks, { host, current: doc.data, notes, t, onOpen: open }),
4332
+ tab === "versions" && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-versions", children: [
3969
4333
  versions.error && failed(versions.retry),
3970
- (versions.data ?? []).map((item) => /* @__PURE__ */ jsxs9(
4334
+ (versions.data ?? []).map((item) => /* @__PURE__ */ jsxs12(
3971
4335
  "button",
3972
4336
  {
3973
4337
  type: "button",
3974
4338
  "aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
3975
4339
  onClick: () => view(item.current ? null : item.id),
3976
4340
  children: [
3977
- /* @__PURE__ */ jsxs9("b", { children: [
4341
+ /* @__PURE__ */ jsxs12("b", { children: [
3978
4342
  date(item.createdAt),
3979
- item.current && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", children: t.current })
4343
+ item.current && /* @__PURE__ */ jsx12("span", { className: "w100n-docs-badge", children: t.current })
3980
4344
  ] }),
3981
- /* @__PURE__ */ jsx9("small", { children: [item.author?.name, size(item.size), item.note].filter(Boolean).join(" \xB7 ") })
4345
+ /* @__PURE__ */ jsx12("small", { children: [item.author?.name, size(item.size), item.note].filter(Boolean).join(" \xB7 ") })
3982
4346
  ]
3983
4347
  },
3984
4348
  item.id
3985
4349
  ))
3986
4350
  ] }),
3987
- tab === "details" && /* @__PURE__ */ jsxs9("dl", { className: "w100n-docs-details", children: [
3988
- /* @__PURE__ */ jsx9("dt", { children: t.kind }),
3989
- /* @__PURE__ */ jsx9("dd", { children: t.kinds[doc.data.kind] }),
3990
- /* @__PURE__ */ jsx9("dt", { children: t.size }),
3991
- /* @__PURE__ */ jsx9("dd", { children: size(doc.data.size) }),
3992
- /* @__PURE__ */ jsx9("dt", { children: t.updated }),
3993
- /* @__PURE__ */ jsx9("dd", { children: date(doc.data.updatedAt) }),
3994
- doc.data.updatedBy && /* @__PURE__ */ jsxs9(Fragment8, { children: [
3995
- /* @__PURE__ */ jsx9("dt", { children: t.by }),
3996
- /* @__PURE__ */ jsx9("dd", { children: doc.data.updatedBy.name })
4351
+ tab === "details" && /* @__PURE__ */ jsxs12("dl", { className: "w100n-docs-details", children: [
4352
+ /* @__PURE__ */ jsx12("dt", { children: t.kind }),
4353
+ /* @__PURE__ */ jsx12("dd", { children: t.kinds[doc.data.kind] }),
4354
+ /* @__PURE__ */ jsx12("dt", { children: t.size }),
4355
+ /* @__PURE__ */ jsx12("dd", { children: size(doc.data.size) }),
4356
+ /* @__PURE__ */ jsx12("dt", { children: t.updated }),
4357
+ /* @__PURE__ */ jsx12("dd", { children: date(doc.data.updatedAt) }),
4358
+ doc.data.updatedBy && /* @__PURE__ */ jsxs12(Fragment11, { children: [
4359
+ /* @__PURE__ */ jsx12("dt", { children: t.by }),
4360
+ /* @__PURE__ */ jsx12("dd", { children: doc.data.updatedBy.name })
3997
4361
  ] }),
3998
- /* @__PURE__ */ jsx9("dt", { children: t.rights }),
3999
- /* @__PURE__ */ jsx9("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
4362
+ /* @__PURE__ */ jsx12("dt", { children: t.rights }),
4363
+ /* @__PURE__ */ jsx12("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
4000
4364
  ] }),
4001
- tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-about", children: [
4002
- /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
4003
- /* @__PURE__ */ jsx9(FileDown, { "aria-hidden": true }),
4365
+ tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-about", children: [
4366
+ /* @__PURE__ */ jsxs12("p", { className: "w100n-docs-caption", children: [
4367
+ /* @__PURE__ */ jsx12(FileDown, { "aria-hidden": true }),
4004
4368
  t.exportAs
4005
4369
  ] }),
4006
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ jsxs9(
4370
+ /* @__PURE__ */ jsx12("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ jsxs12(
4007
4371
  "button",
4008
4372
  {
4009
4373
  type: "button",
@@ -4011,22 +4375,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4011
4375
  disabled: exporting === "busy",
4012
4376
  onClick: () => void exportAs(doc.data, format),
4013
4377
  children: [
4014
- /* @__PURE__ */ jsx9(FileDown, { "aria-hidden": true }),
4378
+ /* @__PURE__ */ jsx12(FileDown, { "aria-hidden": true }),
4015
4379
  format.toUpperCase()
4016
4380
  ]
4017
4381
  },
4018
4382
  format
4019
4383
  )) }),
4020
- exporting === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.exportFailed })
4384
+ exporting === "failed" && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", children: t.exportFailed })
4021
4385
  ] }),
4022
- tab === "comments" && /* @__PURE__ */ jsx9("div", { ref: setBox }),
4023
- tab === "sharing" && sharing && /* @__PURE__ */ jsx9(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
4024
- tab === "signatures" && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-versions", children: [
4386
+ tab === "comments" && /* @__PURE__ */ jsx12("div", { ref: setBox }),
4387
+ tab === "sharing" && sharing && /* @__PURE__ */ jsx12(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
4388
+ tab === "signatures" && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-versions", children: [
4025
4389
  signatures.error && failed(signatures.retry),
4026
- signatures.data?.length === 0 && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.noSignatures }),
4390
+ signatures.data?.length === 0 && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-muted", children: t.noSignatures }),
4027
4391
  (signatures.data ?? []).map((entry) => {
4028
4392
  const signed = versions.data?.find((v) => v.id === entry.versionId);
4029
- return /* @__PURE__ */ jsxs9(
4393
+ return /* @__PURE__ */ jsxs12(
4030
4394
  "button",
4031
4395
  {
4032
4396
  type: "button",
@@ -4034,15 +4398,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4034
4398
  "aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
4035
4399
  onClick: () => view(signed.current ? null : signed.id),
4036
4400
  children: [
4037
- /* @__PURE__ */ jsxs9("b", { children: [
4401
+ /* @__PURE__ */ jsxs12("b", { children: [
4038
4402
  entry.signer.name,
4039
- /* @__PURE__ */ jsxs9("span", { className: "w100n-docs-badge", children: [
4403
+ /* @__PURE__ */ jsxs12("span", { className: "w100n-docs-badge", children: [
4040
4404
  t.page,
4041
4405
  " ",
4042
4406
  entry.page
4043
4407
  ] })
4044
4408
  ] }),
4045
- /* @__PURE__ */ jsx9("small", { children: [date(entry.signedAt), t.methods[entry.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
4409
+ /* @__PURE__ */ jsx12("small", { children: [date(entry.signedAt), t.methods[entry.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
4046
4410
  ]
4047
4411
  },
4048
4412
  entry.id
@@ -4053,85 +4417,98 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4053
4417
  ] })
4054
4418
  ] })
4055
4419
  ] }),
4056
- making && /* @__PURE__ */ jsx9(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made) => {
4420
+ jump && /* @__PURE__ */ jsx12(
4421
+ Jump,
4422
+ {
4423
+ mode: jump,
4424
+ items: all,
4425
+ actions: commands,
4426
+ t,
4427
+ onClose: () => setJump(null),
4428
+ onOpen: open,
4429
+ onCreate: host.create ? (name) => void note(name, true) : void 0,
4430
+ place: (item) => [!spaceId && names2.get(item.spaceId), item.folder].filter(Boolean).join(" / ")
4431
+ }
4432
+ ),
4433
+ making && /* @__PURE__ */ jsx12(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made) => {
4057
4434
  setMaking(false);
4058
4435
  opened(made);
4059
4436
  } }),
4060
- menu && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
4061
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-context-head", children: [
4062
- /* @__PURE__ */ jsx9("b", { children: menu.item.name }),
4063
- /* @__PURE__ */ jsx9("small", { children: [t.kinds[menu.item.kind], size(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
4064
- menu.item.createdAt && /* @__PURE__ */ jsx9("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
4065
- /* @__PURE__ */ jsx9("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
4437
+ menu && /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
4438
+ /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-context-head", children: [
4439
+ /* @__PURE__ */ jsx12("b", { children: menu.item.name }),
4440
+ /* @__PURE__ */ jsx12("small", { children: [t.kinds[menu.item.kind], size(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
4441
+ menu.item.createdAt && /* @__PURE__ */ jsx12("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
4442
+ /* @__PURE__ */ jsx12("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
4066
4443
  ] }),
4067
- menu.sure ? /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-context-ask", children: [
4068
- /* @__PURE__ */ jsx9("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
4069
- /* @__PURE__ */ jsxs9("span", { className: "w100n-pdf-dialog-end", children: [
4070
- /* @__PURE__ */ jsx9("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
4071
- /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
4072
- /* @__PURE__ */ jsx9(Trash24, { "aria-hidden": true }),
4444
+ menu.sure ? /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-context-ask", children: [
4445
+ /* @__PURE__ */ jsx12("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
4446
+ /* @__PURE__ */ jsxs12("span", { className: "w100n-pdf-dialog-end", children: [
4447
+ /* @__PURE__ */ jsx12("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
4448
+ /* @__PURE__ */ jsxs12("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
4449
+ /* @__PURE__ */ jsx12(Trash24, { "aria-hidden": true }),
4073
4450
  t.trash
4074
4451
  ] })
4075
4452
  ] })
4076
- ] }) : /* @__PURE__ */ jsxs9(Fragment8, { children: [
4077
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4453
+ ] }) : /* @__PURE__ */ jsxs12(Fragment11, { children: [
4454
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
4078
4455
  setMenu(null);
4079
4456
  open(menu.item);
4080
4457
  }, children: [
4081
- /* @__PURE__ */ jsx9(FileText3, { "aria-hidden": true }),
4458
+ /* @__PURE__ */ jsx12(FileText4, { "aria-hidden": true }),
4082
4459
  t.openFile
4083
4460
  ] }),
4084
- host.href && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4461
+ host.href && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
4085
4462
  setMenu(null);
4086
4463
  window.open(host.href(menu.item.id), "_blank", "noopener");
4087
4464
  }, children: [
4088
- /* @__PURE__ */ jsx9(ExternalLink2, { "aria-hidden": true }),
4465
+ /* @__PURE__ */ jsx12(ExternalLink2, { "aria-hidden": true }),
4089
4466
  t.openTab
4090
4467
  ] }),
4091
- host.href && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
4092
- /* @__PURE__ */ jsx9(Link2, { "aria-hidden": true }),
4468
+ host.href && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
4469
+ /* @__PURE__ */ jsx12(Link2, { "aria-hidden": true }),
4093
4470
  t.copyLink
4094
4471
  ] }),
4095
- host.send && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4472
+ host.send && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
4096
4473
  setMenu(null);
4097
4474
  host.send(menu.item.id);
4098
4475
  }, children: [
4099
- /* @__PURE__ */ jsx9(Send, { "aria-hidden": true }),
4476
+ /* @__PURE__ */ jsx12(Send, { "aria-hidden": true }),
4100
4477
  t.sendChat
4101
4478
  ] }),
4102
- /* @__PURE__ */ jsx9("hr", {}),
4103
- host.rename && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4479
+ /* @__PURE__ */ jsx12("hr", {}),
4480
+ host.rename && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
4104
4481
  setMenu(null);
4105
4482
  setNaming({ id: menu.item.id, text: menu.item.name.replace(/\.[^.]+$/, "") });
4106
4483
  }, children: [
4107
- /* @__PURE__ */ jsx9(Pencil, { "aria-hidden": true }),
4484
+ /* @__PURE__ */ jsx12(Pencil, { "aria-hidden": true }),
4108
4485
  t.rename
4109
4486
  ] }),
4110
- host.create && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy(await host.document(menu.item.id))), children: [
4111
- /* @__PURE__ */ jsx9(Copy3, { "aria-hidden": true }),
4487
+ host.create && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy(await host.document(menu.item.id))), children: [
4488
+ /* @__PURE__ */ jsx12(Copy3, { "aria-hidden": true }),
4112
4489
  t.makeCopy
4113
4490
  ] }),
4114
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
4115
- /* @__PURE__ */ jsx9(Download3, { "aria-hidden": true }),
4491
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
4492
+ /* @__PURE__ */ jsx12(Download3, { "aria-hidden": true }),
4116
4493
  t.download
4117
4494
  ] }),
4118
- host.saveTemplate && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
4119
- /* @__PURE__ */ jsx9(Bookmark, { "aria-hidden": true }),
4495
+ host.saveTemplate && /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
4496
+ /* @__PURE__ */ jsx12(Bookmark, { "aria-hidden": true }),
4120
4497
  t.saveTemplate
4121
4498
  ] }),
4122
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
4499
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", onClick: () => {
4123
4500
  setMenu(null);
4124
4501
  open(menu.item);
4125
4502
  setTab("details");
4126
4503
  side("panel", true);
4127
4504
  }, children: [
4128
- /* @__PURE__ */ jsx9(Info, { "aria-hidden": true }),
4505
+ /* @__PURE__ */ jsx12(Info, { "aria-hidden": true }),
4129
4506
  t.details
4130
4507
  ] }),
4131
- host.remove && /* @__PURE__ */ jsxs9(Fragment8, { children: [
4132
- /* @__PURE__ */ jsx9("hr", {}),
4133
- /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
4134
- /* @__PURE__ */ jsx9(Trash24, { "aria-hidden": true }),
4508
+ host.remove && /* @__PURE__ */ jsxs12(Fragment11, { children: [
4509
+ /* @__PURE__ */ jsx12("hr", {}),
4510
+ /* @__PURE__ */ jsxs12("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
4511
+ /* @__PURE__ */ jsx12(Trash24, { "aria-hidden": true }),
4135
4512
  t.trash
4136
4513
  ] })
4137
4514
  ] })
@@ -4142,22 +4519,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4142
4519
  }
4143
4520
 
4144
4521
  // src/FilePreview.tsx
4145
- import { useState as useState10 } from "react";
4146
- import { jsx as jsx10 } from "react/jsx-runtime";
4522
+ import { useState as useState12 } from "react";
4523
+ import { jsx as jsx13 } from "react/jsx-runtime";
4147
4524
  function FilePreview({ url, name, mimeType, size = 0, bytes, pdfWorker }) {
4148
- const [source] = useState10(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
4525
+ const [source] = useState12(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
4149
4526
  const kind = kindOf(name, mimeType);
4150
4527
  if (!kind) return null;
4151
- return /* @__PURE__ */ jsx10("span", { className: "w100n-preview", children: /* @__PURE__ */ jsx10(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size, updatedAt: "" } }) });
4528
+ return /* @__PURE__ */ jsx13("span", { className: "w100n-preview", children: /* @__PURE__ */ jsx13(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size, updatedAt: "" } }) });
4152
4529
  }
4153
4530
 
4154
4531
  // src/GuestDocument.tsx
4155
- import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState11 } from "react";
4156
- import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet4, FileText as FileText4, FileType as FileType4, Files as Files3, Lock as Lock2, Presentation as Presentation4, UserRound } from "lucide-react";
4157
- import { Fragment as Fragment9, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
4158
- var TextEditor3 = lazy3(() => import("./TextEditor-5S7FSLIZ.js"));
4159
- var SheetView3 = lazy3(() => import("./SheetView-OEKOHMKW.js"));
4160
- var icons4 = { docx: FileText4, markdown: FileType4, pdf: Files3, sheet: FileSpreadsheet4, slides: Presentation4 };
4532
+ import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState13 } from "react";
4533
+ import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet5, FileText as FileText5, FileType as FileType7, Files as Files4, Lock as Lock2, Presentation as Presentation5, UserRound } from "lucide-react";
4534
+ import { Fragment as Fragment12, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
4535
+ var TextEditor3 = lazy3(() => import("./TextEditor-X2GSL4QM.js"));
4536
+ var SheetView3 = lazy3(() => import("./SheetView-SBLAFGTL.js"));
4537
+ var icons5 = { docx: FileText5, markdown: FileType7, pdf: Files4, sheet: FileSpreadsheet5, slides: Presentation5 };
4161
4538
  var GuestRefused = class extends Error {
4162
4539
  constructor(reason, file = "", sharedBy = "") {
4163
4540
  super(reason);
@@ -4166,7 +4543,7 @@ var GuestRefused = class extends Error {
4166
4543
  this.sharedBy = sharedBy;
4167
4544
  }
4168
4545
  };
4169
- var remembered = () => {
4546
+ var remembered2 = () => {
4170
4547
  try {
4171
4548
  return localStorage.getItem("w100n-guest-name") ?? "";
4172
4549
  } catch {
@@ -4182,14 +4559,14 @@ var remember = (name) => {
4182
4559
  };
4183
4560
  function GuestDocument({ host, language = "en", theme = "light", brand }) {
4184
4561
  const t = texts[language];
4185
- const [ask, setAsk] = useState11(() => ({ name: remembered() || void 0 }));
4186
- const [typed, setTyped] = useState11("");
4187
- const [name, setName] = useState11(remembered);
4562
+ const [ask, setAsk] = useState13(() => ({ name: remembered2() || void 0 }));
4563
+ const [typed, setTyped] = useState13("");
4564
+ const [name, setName] = useState13(remembered2);
4188
4565
  const named = useRef7(name);
4189
- const [slot, setSlot] = useState11(null);
4190
- const [saving, setSaving] = useState11("idle");
4566
+ const [slot, setSlot] = useState13(null);
4567
+ const [saving, setSaving] = useState13("idle");
4191
4568
  const opened = useLoad((signal) => host.open(ask, { signal }), [host, ask]);
4192
- const [notes] = useState11(() => ({
4569
+ const [notes] = useState13(() => ({
4193
4570
  me: { id: "", name: "" },
4194
4571
  spaces: async () => [],
4195
4572
  documents: async () => [],
@@ -4215,18 +4592,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4215
4592
  };
4216
4593
  const top = (file2, badge) => {
4217
4594
  const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
4218
- const Kind = kind2 ? icons4[kind2] : FileText4;
4219
- return /* @__PURE__ */ jsxs10("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
4220
- brand && /* @__PURE__ */ jsx11("span", { className: "w100n-guest-brand", children: brand }),
4221
- file2 && /* @__PURE__ */ jsxs10(Fragment9, { children: [
4222
- /* @__PURE__ */ jsx11("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ jsx11(Kind, { "aria-hidden": true }) }),
4223
- /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-heading", children: [
4224
- /* @__PURE__ */ jsx11("strong", { className: "w100n-docs-title", children: file2.name }),
4225
- file2.sharedBy && /* @__PURE__ */ jsx11("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
4595
+ const Kind = kind2 ? icons5[kind2] : FileText5;
4596
+ return /* @__PURE__ */ jsxs13("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
4597
+ brand && /* @__PURE__ */ jsx14("span", { className: "w100n-guest-brand", children: brand }),
4598
+ file2 && /* @__PURE__ */ jsxs13(Fragment12, { children: [
4599
+ /* @__PURE__ */ jsx14("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ jsx14(Kind, { "aria-hidden": true }) }),
4600
+ /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-heading", children: [
4601
+ /* @__PURE__ */ jsx14("strong", { className: "w100n-docs-title", children: file2.name }),
4602
+ file2.sharedBy && /* @__PURE__ */ jsx14("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
4226
4603
  ] }),
4227
- badge && /* @__PURE__ */ jsx11("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
4228
- file2.download && /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-end", children: [
4229
- (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ jsxs10(
4604
+ badge && /* @__PURE__ */ jsx14("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
4605
+ file2.download && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-end", children: [
4606
+ (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ jsxs13(
4230
4607
  "button",
4231
4608
  {
4232
4609
  type: "button",
@@ -4237,25 +4614,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4237
4614
  "aria-label": t.pdfCopy,
4238
4615
  title: t.pdfCopy,
4239
4616
  children: [
4240
- /* @__PURE__ */ jsx11(FileDown2, { "aria-hidden": true }),
4241
- /* @__PURE__ */ jsx11("span", { children: t.pdfCopy })
4617
+ /* @__PURE__ */ jsx14(FileDown2, { "aria-hidden": true }),
4618
+ /* @__PURE__ */ jsx14("span", { children: t.pdfCopy })
4242
4619
  ]
4243
4620
  }
4244
4621
  ),
4245
- /* @__PURE__ */ jsxs10("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: [
4246
- /* @__PURE__ */ jsx11(Download4, { "aria-hidden": true }),
4247
- /* @__PURE__ */ jsx11("span", { children: t.download })
4622
+ /* @__PURE__ */ jsxs13("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: [
4623
+ /* @__PURE__ */ jsx14(Download4, { "aria-hidden": true }),
4624
+ /* @__PURE__ */ jsx14("span", { children: t.download })
4248
4625
  ] })
4249
4626
  ] })
4250
4627
  ] })
4251
4628
  ] });
4252
4629
  };
4253
- const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4630
+ const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ jsxs13("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4254
4631
  top(null, null),
4255
- /* @__PURE__ */ jsx11("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ jsxs10("div", { className: "w100n-guest-card", children: [
4256
- /* @__PURE__ */ jsx11("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ jsx11(Icon, { "aria-hidden": true }) }),
4257
- /* @__PURE__ */ jsx11("h2", { children: title }),
4258
- /* @__PURE__ */ jsx11("p", { children: body }),
4632
+ /* @__PURE__ */ jsx14("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ jsxs13("div", { className: "w100n-guest-card", children: [
4633
+ /* @__PURE__ */ jsx14("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ jsx14(Icon, { "aria-hidden": true }) }),
4634
+ /* @__PURE__ */ jsx14("h2", { children: title }),
4635
+ /* @__PURE__ */ jsx14("p", { children: body }),
4259
4636
  form
4260
4637
  ] }) })
4261
4638
  ] });
@@ -4271,7 +4648,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4271
4648
  password ? Lock2 : UserRound,
4272
4649
  refused.file || t.documents,
4273
4650
  shared + (password ? t.passwordAsk : t.nameAsk),
4274
- /* @__PURE__ */ jsxs10("form", { className: "w100n-guest-form", onSubmit: (e) => {
4651
+ /* @__PURE__ */ jsxs13("form", { className: "w100n-guest-form", onSubmit: (e) => {
4275
4652
  e.preventDefault();
4276
4653
  if (!typed.trim()) return;
4277
4654
  if (password) setAsk({ ...ask, password: typed });
@@ -4281,7 +4658,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4281
4658
  }
4282
4659
  setTyped("");
4283
4660
  }, children: [
4284
- /* @__PURE__ */ jsx11(
4661
+ /* @__PURE__ */ jsx14(
4285
4662
  "input",
4286
4663
  {
4287
4664
  className: "w100n-share-input",
@@ -4294,21 +4671,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4294
4671
  onChange: (e) => setTyped(e.target.value)
4295
4672
  }
4296
4673
  ),
4297
- refused.reason === "wrong" && /* @__PURE__ */ jsx11("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
4298
- /* @__PURE__ */ jsxs10("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
4299
- /* @__PURE__ */ jsx11(Eye2, { "aria-hidden": true }),
4674
+ refused.reason === "wrong" && /* @__PURE__ */ jsx14("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
4675
+ /* @__PURE__ */ jsxs13("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
4676
+ /* @__PURE__ */ jsx14(Eye2, { "aria-hidden": true }),
4300
4677
  t.openDoc
4301
4678
  ] })
4302
4679
  ] })
4303
4680
  );
4304
4681
  }
4305
4682
  if (refused?.reason === "busy") return gate("slate", Ban2, t.failed, t.tooMany);
4306
- return gate("slate", Ban2, t.failed, "", /* @__PURE__ */ jsx11("button", { type: "button", className: "w100n-docs-action", onClick: opened.retry, children: t.retry }));
4683
+ return gate("slate", Ban2, t.failed, "", /* @__PURE__ */ jsx14("button", { type: "button", className: "w100n-docs-action", onClick: opened.retry, children: t.retry }));
4307
4684
  }
4308
4685
  const file = opened.data;
4309
- if (!file) return /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4686
+ if (!file) return /* @__PURE__ */ jsxs13("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4310
4687
  top(null, null),
4311
- /* @__PURE__ */ jsx11("div", { className: "w100n-docs-empty", children: t.loading })
4688
+ /* @__PURE__ */ jsx14("div", { className: "w100n-docs-empty", children: t.loading })
4312
4689
  ] });
4313
4690
  const kind = kindOf(file.name, file.mimeType);
4314
4691
  const text = kind === "docx" || kind === "markdown";
@@ -4316,23 +4693,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
4316
4693
  const rights = { view: true, comment: talk, edit: false };
4317
4694
  const quiet2 = () => {
4318
4695
  };
4319
- let stage = /* @__PURE__ */ jsx11("div", { className: "w100n-docs-empty", children: t.unsupported });
4320
- if (text) stage = /* @__PURE__ */ jsx11(Suspense3, { fallback: /* @__PURE__ */ jsx11("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx11(TextEditor3, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes : void 0, documentId: file.id, onOutline: quiet2, slot: talk ? slot : null }) });
4321
- else if (kind === "pdf") stage = /* @__PURE__ */ jsx11(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet2 });
4322
- else if (kind === "slides") stage = /* @__PURE__ */ jsx11(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet2 });
4323
- else if (kind === "sheet") stage = /* @__PURE__ */ jsx11(Suspense3, { fallback: /* @__PURE__ */ jsx11("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx11(SheetView3, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
4324
- return /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4696
+ let stage = /* @__PURE__ */ jsx14("div", { className: "w100n-docs-empty", children: t.unsupported });
4697
+ if (text) stage = /* @__PURE__ */ jsx14(Suspense3, { fallback: /* @__PURE__ */ jsx14("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx14(TextEditor3, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes : void 0, documentId: file.id, onOutline: quiet2, slot: talk ? slot : null }) });
4698
+ else if (kind === "pdf") stage = /* @__PURE__ */ jsx14(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet2 });
4699
+ else if (kind === "slides") stage = /* @__PURE__ */ jsx14(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet2 });
4700
+ else if (kind === "sheet") stage = /* @__PURE__ */ jsx14(Suspense3, { fallback: /* @__PURE__ */ jsx14("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx14(SheetView3, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
4701
+ return /* @__PURE__ */ jsxs13("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
4325
4702
  top(file, talk ? t.badgeComment : t.badgeRead),
4326
- saving === "failed" && /* @__PURE__ */ jsx11("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
4327
- /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-body w100n-guest-body", children: [
4328
- /* @__PURE__ */ jsx11("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ jsx11("div", { className: "w100n-docs-bare", children: stage }) }),
4329
- talk && /* @__PURE__ */ jsx11("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-panel-body", children: [
4330
- /* @__PURE__ */ jsxs10("label", { className: "w100n-share-field", children: [
4331
- /* @__PURE__ */ jsx11("span", { children: t.yourName }),
4332
- /* @__PURE__ */ jsx11("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
4703
+ saving === "failed" && /* @__PURE__ */ jsx14("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
4704
+ /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-body w100n-guest-body", children: [
4705
+ /* @__PURE__ */ jsx14("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ jsx14("div", { className: "w100n-docs-bare", children: stage }) }),
4706
+ talk && /* @__PURE__ */ jsx14("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-panel-body", children: [
4707
+ /* @__PURE__ */ jsxs13("label", { className: "w100n-share-field", children: [
4708
+ /* @__PURE__ */ jsx14("span", { children: t.yourName }),
4709
+ /* @__PURE__ */ jsx14("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
4333
4710
  ] }),
4334
- /* @__PURE__ */ jsx11("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
4335
- /* @__PURE__ */ jsx11("div", { ref: setSlot })
4711
+ /* @__PURE__ */ jsx14("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
4712
+ /* @__PURE__ */ jsx14("div", { ref: setSlot })
4336
4713
  ] }) })
4337
4714
  ] })
4338
4715
  ] });