@w100n/documents 0.12.1 → 0.13.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 (34) hide show
  1. package/dist/{SheetView-G3YWPH5V.js → SheetView-3UAFXGZS.js} +4 -4
  2. package/dist/{TextEditor-SPEVB5HX.js → TextEditor-OLBLWC6F.js} +4 -4
  3. package/dist/{chunk-UWASFTDF.js → chunk-MRP3EURG.js} +3 -3
  4. package/dist/{chunk-UWASFTDF.js.map → chunk-MRP3EURG.js.map} +1 -1
  5. package/dist/{chunk-5NT5ALOF.js → chunk-T7XCGDE5.js} +2 -2
  6. package/dist/{chunk-BKUFGMEA.js → chunk-WR3MT7KP.js} +40 -4
  7. package/dist/{chunk-BKUFGMEA.js.map → chunk-WR3MT7KP.js.map} +1 -1
  8. package/dist/collab.cjs +40 -4
  9. package/dist/collab.cjs.map +1 -1
  10. package/dist/collab.d.cts +1 -1
  11. package/dist/collab.d.ts +1 -1
  12. package/dist/collab.js +2 -2
  13. package/dist/index.cjs +857 -603
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.css +131 -0
  16. package/dist/index.css.map +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +546 -328
  20. package/dist/index.js.map +1 -1
  21. package/dist/kinds.d.cts +1 -1
  22. package/dist/kinds.d.ts +1 -1
  23. package/dist/memory.cjs +9 -1
  24. package/dist/memory.cjs.map +1 -1
  25. package/dist/memory.d.cts +1 -1
  26. package/dist/memory.d.ts +1 -1
  27. package/dist/memory.js +9 -1
  28. package/dist/memory.js.map +1 -1
  29. package/dist/{types-B5oF25dn.d.cts → types-Er60M5kL.d.cts} +6 -0
  30. package/dist/{types-B5oF25dn.d.ts → types-Er60M5kL.d.ts} +6 -0
  31. package/package.json +1 -1
  32. /package/dist/{SheetView-G3YWPH5V.js.map → SheetView-3UAFXGZS.js.map} +0 -0
  33. /package/dist/{TextEditor-SPEVB5HX.js.map → TextEditor-OLBLWC6F.js.map} +0 -0
  34. /package/dist/{chunk-5NT5ALOF.js.map → chunk-T7XCGDE5.js.map} +0 -0
package/dist/index.js CHANGED
@@ -13,10 +13,11 @@ import {
13
13
  useRestore
14
14
  } from "./chunk-TDP6OJET.js";
15
15
  import {
16
+ escape,
16
17
  readDocx,
17
18
  texts,
18
19
  writeDocx
19
- } from "./chunk-BKUFGMEA.js";
20
+ } from "./chunk-WR3MT7KP.js";
20
21
 
21
22
  // src/DocumentOverlay.tsx
22
23
  import { Download, ExternalLink, FileSpreadsheet, FileText, FileType, Files, Presentation, X as X4 } from "lucide-react";
@@ -345,10 +346,10 @@ var blocksOf = (el, html, notes) => {
345
346
  var notesOf = (el) => elements(el).find((e) => e.tag === "aside" && classes(e).includes("notes")) ?? null;
346
347
  var toText = (src) => decode(src.replace(/<!--[\s\S]*?-->/g, "").replace(/\s+/g, " ").replace(/<br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6]|blockquote|pre|tr)>/gi, "\n").replace(/<[^>]*>/g, "")).split("\n").map((line) => line.trim()).join("\n").replace(/\n{3,}/g, "\n\n").trim();
347
348
  var titled = (src) => toText(src).replace(/\s+/g, " ").slice(0, 80);
348
- var escape = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
349
- var quote = (s) => escape(s).replace(/"/g, "&quot;");
350
- var notesHtml = (text) => escape(text).split("\n").join("<br>\n");
351
- var sizeOf = (html, kind, scripts, styles, marks) => {
349
+ var escape2 = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
350
+ var quote = (s) => escape2(s).replace(/"/g, "&quot;");
351
+ var notesHtml = (text) => escape2(text).split("\n").join("<br>\n");
352
+ var sizeOf = (html, kind, scripts, styles2, marks) => {
352
353
  if (kind === "reveal") {
353
354
  const code = scripts.map((s) => html.slice(s.open, s.close)).join("\n");
354
355
  const at = code.search(/Reveal\.initialize\s*\(/);
@@ -362,7 +363,7 @@ var sizeOf = (html, kind, scripts, styles, marks) => {
362
363
  const height = Number(el.attrs.get("data-height")?.value);
363
364
  if (width > 0 && height > 0) return { width, height, center: false };
364
365
  }
365
- const css2 = styles.map((s) => html.slice(s.open, s.close)).join("\n").replace(/\/\*[\s\S]*?\*\//g, "");
366
+ const css2 = styles2.map((s) => html.slice(s.open, s.close)).join("\n").replace(/\/\*[\s\S]*?\*\//g, "");
366
367
  const target = kind === "marked" ? /(^|[\s>])\[data-slide[^\]]*\](\.[\w-]+)*$/ : /(^|[\s>])(section|\.slide)(\.[\w-]+)*$/;
367
368
  for (const rule of css2.matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
368
369
  if (!rule[1].split(",").some((sel) => target.test(sel.trim()))) continue;
@@ -376,13 +377,13 @@ function shape(html) {
376
377
  const root = parse(html);
377
378
  const all = elements(root);
378
379
  const scripts = all.filter((el) => el.tag === "script");
379
- const styles = all.filter((el) => el.tag === "style");
380
+ const styles2 = all.filter((el) => el.tag === "style");
380
381
  const refresh = all.filter((el) => el.tag === "meta" && el.attrs.get("http-equiv")?.value.toLowerCase() === "refresh");
381
- const head = all.find((el) => el.tag === "head");
382
+ const head2 = all.find((el) => el.tag === "head");
382
383
  const outer = all.find((el) => el.tag === "html");
383
384
  const body = all.find((el) => el.tag === "body") ?? null;
384
385
  const doctype = /^\s*<!doctype[^>]*>/i.exec(html);
385
- const at = head ? head.open : outer ? outer.open : doctype ? doctype[0].length : 0;
386
+ const at = head2 ? head2.open : outer ? outer.open : doctype ? doctype[0].length : 0;
386
387
  const reveal = all.find((el) => classes(el).includes("reveal")) ?? null;
387
388
  const box = reveal && all.find((el) => classes(el).includes("slides") && under(el, (up) => up === reveal));
388
389
  const spots = [];
@@ -422,14 +423,14 @@ function shape(html) {
422
423
  }
423
424
  for (const unit of units) spot2(unit, null);
424
425
  }
425
- const size = sizeOf(html, kind, scripts, styles, [container, ...body ? [body] : [], ...outer ? [outer] : []]);
426
+ const size = sizeOf(html, kind, scripts, styles2, [container, ...body ? [body] : [], ...outer ? [outer] : []]);
426
427
  return { kind, ...size, root, box: container, units, stacks, spots, scripts, refresh, head: at, body };
427
428
  }
428
429
  var titleOf = (html, s) => {
429
430
  const heading = elements(s.el).find((el2) => /^h[1-6]$/.test(el2.tag) && !(s.notes && under(el2, (up) => up === s.notes)));
430
431
  const el = heading ?? s.blocks[0];
431
- const head = el ? s.blocks.indexOf(el) : -1;
432
- return { title: el ? titled(html.slice(el.open, el.close)) : "", head: head < 0 ? null : head };
432
+ const head2 = el ? s.blocks.indexOf(el) : -1;
433
+ return { title: el ? titled(html.slice(el.open, el.close)) : "", head: head2 < 0 ? null : head2 };
433
434
  };
434
435
  var notesText = (html, s) => s.notes ? toText(html.slice(s.notes.open, s.notes.close)) : s.attr ? s.attr.value.trim() : "";
435
436
  function readDeck(html, known) {
@@ -486,9 +487,9 @@ function apply(html, from, to, list) {
486
487
  }
487
488
  var blank = (s) => !/\S/.test(s);
488
489
  var join = (html, box, els, parts) => {
489
- const head = html.slice(box.open, els[0].start);
490
+ const head2 = html.slice(box.open, els[0].start);
490
491
  const pre = els.map((el, i) => i ? html.slice(els[i - 1].end, el.start) : "");
491
- const fill = pre.find((gap, i) => i && blank(gap)) ?? (/\s*$/.exec(head)[0] || "\n");
492
+ const fill = pre.find((gap, i) => i && blank(gap)) ?? (/\s*$/.exec(head2)[0] || "\n");
492
493
  const used = /* @__PURE__ */ new Set();
493
494
  const body = parts.map(([from, part], k) => {
494
495
  const first = !used.has(from);
@@ -497,7 +498,7 @@ var join = (html, box, els, parts) => {
497
498
  return (first && !blank(pre[from]) ? pre[from].trimStart() : "") + part;
498
499
  });
499
500
  const lost = pre.filter((gap, i) => !used.has(i) && !blank(gap)).map((gap) => gap.trimEnd());
500
- return head + body.join("") + lost.join("") + html.slice(els[els.length - 1].end, box.close);
501
+ return head2 + body.join("") + lost.join("") + html.slice(els[els.length - 1].end, box.close);
501
502
  };
502
503
  function writeDeck(original, deck, known) {
503
504
  const s = known ?? shape(original);
@@ -527,8 +528,8 @@ function moveSlide(deck, from, to) {
527
528
  const slide = deck.slides[from];
528
529
  const rest = deck.slides.filter((_, i) => i !== from);
529
530
  let at = Math.max(0, Math.min(rest.length, to));
530
- const run = rest.flatMap((other, i) => slide.stack !== null && other.stack === slide.stack ? [i] : []);
531
- if (run.length) at = Math.max(run[0], Math.min(run[run.length - 1] + 1, at));
531
+ const run2 = rest.flatMap((other, i) => slide.stack !== null && other.stack === slide.stack ? [i] : []);
532
+ if (run2.length) at = Math.max(run2[0], Math.min(run2[run2.length - 1] + 1, at));
532
533
  else if (at > 0 && at < rest.length && rest[at].stack !== null && rest[at - 1].stack === rest[at].stack) {
533
534
  let end = at;
534
535
  while (end < rest.length && rest[end].stack === rest[at].stack) end++;
@@ -1118,7 +1119,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
1118
1119
  popup.close();
1119
1120
  };
1120
1121
  }, [popup]);
1121
- const tool = (Icon, text, run, disabled = false) => /* @__PURE__ */ jsx("button", { type: "button", "aria-label": text, title: text, disabled, onClick: run, children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }) });
1122
+ const tool = (Icon, text, run2, disabled = false) => /* @__PURE__ */ jsx("button", { type: "button", "aria-label": text, title: text, disabled, onClick: run2, children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }) });
1122
1123
  const thumb = 148;
1123
1124
  const seconds = Math.floor(Math.max(0, (timer.stop ?? now) - timer.from) / 1e3);
1124
1125
  const elapsed = `${seconds >= 3600 ? `${Math.floor(seconds / 3600)}:` : ""}${String(Math.floor(seconds / 60) % 60).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
@@ -2406,8 +2407,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
2406
2407
 
2407
2408
  // src/DocumentOverlay.tsx
2408
2409
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2409
- var TextEditor = lazy(() => import("./TextEditor-SPEVB5HX.js"));
2410
- var SheetView = lazy(() => import("./SheetView-G3YWPH5V.js"));
2410
+ var TextEditor = lazy(() => import("./TextEditor-OLBLWC6F.js"));
2411
+ var SheetView = lazy(() => import("./SheetView-3UAFXGZS.js"));
2411
2412
  var icons = { docx: FileText, markdown: FileType, pdf: Files, sheet: FileSpreadsheet, slides: Presentation };
2412
2413
  var read = { view: true, comment: false, edit: false };
2413
2414
  var quiet = () => {
@@ -2435,16 +2436,16 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
2435
2436
  box.current.focus();
2436
2437
  }, []);
2437
2438
  useEffect4(() => {
2438
- const escape2 = (e) => {
2439
+ const escape3 = (e) => {
2439
2440
  if (e.key !== "Escape") return;
2440
2441
  e.stopPropagation();
2441
2442
  close();
2442
2443
  };
2443
2444
  const overflow = document.body.style.overflow;
2444
2445
  document.body.style.overflow = "hidden";
2445
- window.addEventListener("keydown", escape2, true);
2446
+ window.addEventListener("keydown", escape3, true);
2446
2447
  return () => {
2447
- window.removeEventListener("keydown", escape2, true);
2448
+ window.removeEventListener("keydown", escape3, true);
2448
2449
  document.body.style.overflow = overflow;
2449
2450
  };
2450
2451
  });
@@ -2456,7 +2457,7 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
2456
2457
  link.click();
2457
2458
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
2458
2459
  };
2459
- const sheet = readable(name, mimeType) !== "sheet" ? null : /\.csv$/i.test(name) || mimeType === "text/csv" ? "csv" : "xlsx";
2460
+ const sheet2 = readable(name, mimeType) !== "sheet" ? null : /\.csv$/i.test(name) || mimeType === "text/csv" ? "csv" : "xlsx";
2460
2461
  const wait = /* @__PURE__ */ jsx5("div", { className: "w100n-docs-empty", children: t.loading });
2461
2462
  let stage = null;
2462
2463
  if (bytes && !doc.loading) {
@@ -2476,7 +2477,7 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
2476
2477
  );
2477
2478
  else if (kind === "docx" || kind === "markdown") stage = /* @__PURE__ */ jsx5(Suspense, { fallback: wait, children: /* @__PURE__ */ jsx5(TextEditor, { kind, bytes, t, language, rights: read, documentId: documentId ?? name, onOutline: quiet, slot: null }) });
2478
2479
  else if (kind === "slides") stage = /* @__PURE__ */ jsx5(SlidesView, { html: new TextDecoder().decode(bytes), name, rights: read, language, theme, onOutline: quiet });
2479
- else if (sheet) stage = /* @__PURE__ */ jsx5(Suspense, { fallback: wait, children: /* @__PURE__ */ jsx5(SheetView, { bytes, name, kind: sheet, rights: read, language, theme, documentId: documentId ?? name }) });
2480
+ else if (sheet2) stage = /* @__PURE__ */ jsx5(Suspense, { fallback: wait, children: /* @__PURE__ */ jsx5(SheetView, { bytes, name, kind: sheet2, rights: read, language, theme, documentId: documentId ?? name }) });
2480
2481
  else stage = /* @__PURE__ */ jsx5("div", { className: "w100n-docs-empty", children: t.unsupported });
2481
2482
  }
2482
2483
  return createPortal2(/* @__PURE__ */ jsxs5("div", { ref: box, className: "w100n-docs w100n-docs-overlay", "data-theme": theme, role: "dialog", "aria-modal": true, "aria-label": name, tabIndex: -1, children: [
@@ -2511,16 +2512,16 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
2511
2512
  }
2512
2513
 
2513
2514
  // src/DocumentsWorkspace.tsx
2514
- import { lazy as lazy2, Suspense as Suspense2, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState8 } from "react";
2515
+ import { lazy as lazy2, Suspense as Suspense2, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState9 } from "react";
2515
2516
  import { flushSync } from "react-dom";
2516
2517
  import {
2517
- Check,
2518
+ Check as Check2,
2518
2519
  ChevronDown as ChevronDown2,
2519
2520
  ChevronRight as ChevronRight2,
2520
2521
  FileDown,
2521
- FileSpreadsheet as FileSpreadsheet2,
2522
- FileText as FileText2,
2523
- FileType as FileType2,
2522
+ FileSpreadsheet as FileSpreadsheet3,
2523
+ FileText as FileText3,
2524
+ FileType as FileType3,
2524
2525
  Files as Files2,
2525
2526
  History,
2526
2527
  Info,
@@ -2531,28 +2532,234 @@ import {
2531
2532
  PanelLeftOpen,
2532
2533
  PanelRightClose,
2533
2534
  PanelRightOpen,
2534
- Presentation as Presentation2,
2535
+ Plus as Plus4,
2536
+ Presentation as Presentation3,
2535
2537
  RotateCcw as RotateCcw2,
2536
2538
  Search as Search2,
2537
2539
  Share2,
2538
2540
  Signature,
2539
- X as X5
2541
+ X as X6
2540
2542
  } from "lucide-react";
2541
2543
 
2542
- // src/Sharing.tsx
2543
- import { useState as useState6 } from "react";
2544
- import { Ban, CalendarDays, Clock, Copy as Copy2, Download as Download2, Eye, Link, Lock, MessageSquarePlus, Plus as Plus2, Users } from "lucide-react";
2544
+ // src/NewDocument.tsx
2545
+ import { Check, FileSpreadsheet as FileSpreadsheet2, FileText as FileText2, FileType as FileType2, Plus as Plus2, Presentation as Presentation2, X as X5 } from "lucide-react";
2546
+ import { useId as useId3, useState as useState6 } from "react";
2547
+
2548
+ // src/blank.ts
2549
+ import { strToU8, zipSync } from "fflate";
2550
+ var W = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
2551
+ var REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
2552
+ var PKG = "http://schemas.openxmlformats.org/package/2006/relationships";
2553
+ var head = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
2554
+ var mimes = {
2555
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2556
+ markdown: "text/markdown",
2557
+ sheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2558
+ slides: "text/html"
2559
+ };
2560
+ var extensions = { docx: "docx", markdown: "md", sheet: "xlsx", slides: "html" };
2561
+ var templates = {
2562
+ letter: (name) => [["Title", name], [null, "Web100Now"], [null, ""], [null, "Dear Name,"], [null, "Write the message here."], [null, ""], [null, "Kind regards,"], [null, "Your name"]],
2563
+ contract: (name) => [
2564
+ ["Title", name],
2565
+ [null, "Between Party A and Party B, date"],
2566
+ ["Heading1", "1. Scope of work"],
2567
+ [null, "What is delivered and when."],
2568
+ ["Heading1", "2. Fees and payment"],
2569
+ [null, "Amount, currency and when it is paid."],
2570
+ ["Heading1", "3. Term"],
2571
+ [null, "Start date, length and how either side ends it."],
2572
+ ["Heading1", "4. Signatures"],
2573
+ [["Party A", "Party B"], ["Name, date", "Name, date"]]
2574
+ ],
2575
+ notes: (name) => [
2576
+ ["Title", name],
2577
+ [null, "Date, people"],
2578
+ ["Heading1", "Agenda"],
2579
+ [null, "Topic one"],
2580
+ ["Heading1", "Decisions"],
2581
+ [null, "What was decided"],
2582
+ ["Heading1", "Next steps"],
2583
+ [["Who", "What", "By when"], ["", "", ""]]
2584
+ ],
2585
+ invoice: (name) => [
2586
+ ["Title", name],
2587
+ [null, "Number, date, due date"],
2588
+ [null, "Billed to: client name and address"],
2589
+ [["Item", "Quantity", "Price", "Total"], ["", "", "", ""], ["", "", "Total", ""]],
2590
+ [null, "Bank details and payment terms"]
2591
+ ],
2592
+ report: (name) => [
2593
+ ["Title", name],
2594
+ [null, "Period, author"],
2595
+ ["Heading1", "Summary"],
2596
+ [null, "The main points in a few lines."],
2597
+ ["Heading1", "Results"],
2598
+ [null, "What happened and the numbers behind it."],
2599
+ ["Heading1", "Next"],
2600
+ [null, "What comes next and who owns it."]
2601
+ ]
2602
+ };
2603
+ var run = (text) => text ? `<w:r><w:t xml:space="preserve">${escape(text)}</w:t></w:r>` : "";
2604
+ var para = ([style, text]) => `<w:p>${style ? `<w:pPr><w:pStyle w:val="${style}"/></w:pPr>` : ""}${run(text)}</w:p>`;
2605
+ var table = (rows) => {
2606
+ const width = Math.floor(9638 / rows[0].length);
2607
+ const border = (side) => `<w:${side} w:val="single" w:sz="4" w:space="0" w:color="94A3B8"/>`;
2608
+ return `<w:tbl><w:tblPr><w:tblW w:w="5000" w:type="pct"/><w:tblBorders>${["top", "left", "bottom", "right", "insideH", "insideV"].map(border).join("")}</w:tblBorders></w:tblPr><w:tblGrid>${rows[0].map(() => `<w:gridCol w:w="${width}"/>`).join("")}</w:tblGrid>` + rows.map((row, r) => `<w:tr>${row.map((cell) => `<w:tc><w:tcPr><w:tcW w:w="${width}" w:type="dxa"/></w:tcPr><w:p>${r === 0 ? `<w:r><w:rPr><w:b/></w:rPr><w:t xml:space="preserve">${escape(cell)}</w:t></w:r>` : run(cell)}</w:p></w:tc>`).join("")}</w:tr>`).join("") + "</w:tbl><w:p/>";
2609
+ };
2610
+ var styles = `${head}<w:styles xmlns:w="${W}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:eastAsia="Arial" w:cs="Arial"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="120" w:line="276" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="80"/></w:pPr><w:rPr><w:b/><w:sz w:val="48"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="360" w:after="120"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:b/><w:sz w:val="32"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Heading2"><w:name w:val="heading 2"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="240" w:after="80"/><w:outlineLvl w:val="1"/></w:pPr><w:rPr><w:b/><w:sz w:val="26"/></w:rPr></w:style></w:styles>`;
2611
+ function docx(blocks) {
2612
+ const body = blocks.map((block) => typeof block[0] === "string" || block[0] === null ? para(block) : table(block)).join("") || "<w:p/>";
2613
+ return zipSync({
2614
+ "[Content_Types].xml": strToU8(`${head}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`),
2615
+ "_rels/.rels": strToU8(`${head}<Relationships xmlns="${PKG}"><Relationship Id="rId1" Type="${REL}/officeDocument" Target="word/document.xml"/></Relationships>`),
2616
+ "word/_rels/document.xml.rels": strToU8(`${head}<Relationships xmlns="${PKG}"><Relationship Id="rId1" Type="${REL}/styles" Target="styles.xml"/></Relationships>`),
2617
+ "word/styles.xml": strToU8(styles),
2618
+ "word/document.xml": strToU8(`${head}<w:document xmlns:w="${W}" xmlns:r="${REL}"><w:body>${body}<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1417" w:right="1134" w:bottom="1417" w:left="1134" w:header="708" w:footer="708" w:gutter="0"/></w:sectPr></w:body></w:document>`)
2619
+ });
2620
+ }
2621
+ function markdown(blocks) {
2622
+ const line = (block) => {
2623
+ if (typeof block[0] === "string" || block[0] === null) {
2624
+ const [style, text] = block;
2625
+ return style === "Title" ? `# ${text}` : style === "Heading1" ? `## ${text.replace(/^\d+\.\s*/, "")}` : text;
2626
+ }
2627
+ const rows = block;
2628
+ return [rows[0], rows[0].map(() => "---"), ...rows.slice(1)].map((row) => `| ${row.join(" | ")} |`).join("\n");
2629
+ };
2630
+ return strToU8(blocks.map(line).join("\n\n").replace(/\n{3,}/g, "\n\n") + "\n");
2631
+ }
2632
+ var S = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
2633
+ function sheet() {
2634
+ return zipSync({
2635
+ "[Content_Types].xml": strToU8(`${head}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`),
2636
+ "_rels/.rels": strToU8(`${head}<Relationships xmlns="${PKG}"><Relationship Id="rId1" Type="${REL}/officeDocument" Target="xl/workbook.xml"/></Relationships>`),
2637
+ "xl/workbook.xml": strToU8(`${head}<workbook xmlns="${S}" xmlns:r="${REL}"><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets></workbook>`),
2638
+ "xl/_rels/workbook.xml.rels": strToU8(`${head}<Relationships xmlns="${PKG}"><Relationship Id="rId1" Type="${REL}/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="${REL}/styles" Target="styles.xml"/></Relationships>`),
2639
+ "xl/worksheets/sheet1.xml": strToU8(`${head}<worksheet xmlns="${S}" xmlns:r="${REL}"><sheetData/></worksheet>`),
2640
+ "xl/styles.xml": strToU8(`${head}<styleSheet xmlns="${S}"><fonts count="1"><font><sz val="11"/><name val="Arial"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`)
2641
+ });
2642
+ }
2643
+ var slides = (name) => strToU8(`<!DOCTYPE html>
2644
+ <html>
2645
+ <head>
2646
+ <meta charset="utf-8">
2647
+ <title>${escape(name)}</title>
2648
+ <style>
2649
+ body { margin: 0; font-family: Inter, Arial, sans-serif; background: #0f172a; }
2650
+ section { width: 1920px; height: 1080px; padding: 120px; box-sizing: border-box; background: #fff; color: #0f172a; }
2651
+ section h1 { font-size: 96px; margin: 0 0 24px; }
2652
+ section h2 { font-size: 72px; margin: 0 0 24px; }
2653
+ section p { font-size: 40px; color: #475569; }
2654
+ </style>
2655
+ </head>
2656
+ <body>
2657
+ <section><h1>${escape(name)}</h1><p>Subtitle</p></section>
2658
+ <section><h2>Title</h2><p>Text</p></section>
2659
+ </body>
2660
+ </html>
2661
+ `);
2662
+ function blank2(kind, name, template = "blank") {
2663
+ const blocks = template === "blank" ? [] : templates[template](name);
2664
+ const bytes = kind === "docx" ? docx(blocks) : kind === "markdown" ? markdown(blocks.length ? blocks : [["Title", name]]) : kind === "sheet" ? sheet() : slides(name);
2665
+ return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
2666
+ }
2667
+
2668
+ // src/NewDocument.tsx
2545
2669
  import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2546
- var blank2 = { id: null, comment: false, download: false, askName: true, works: "30", day: "", password: false, secret: "", had: false };
2670
+ var icons2 = { docx: FileText2, markdown: FileType2, sheet: FileSpreadsheet2, slides: Presentation2 };
2671
+ var shaped = ["blank", "letter", "contract", "notes", "invoice", "report"];
2672
+ function NewDocument({ host, t, onClose, onMade }) {
2673
+ const id = useId3();
2674
+ const [kind, setKind] = useState6("docx");
2675
+ const [template, setTemplate] = useState6("blank");
2676
+ const [name, setName] = useState6("");
2677
+ const [state, setState] = useState6("idle");
2678
+ useRestore(true);
2679
+ const choices = kind === "docx" || kind === "markdown" ? shaped : ["blank"];
2680
+ const make2 = async () => {
2681
+ const title = name.trim() || (template === "blank" ? t.untitled : t.templates[template]);
2682
+ setState("busy");
2683
+ try {
2684
+ onMade(await host.create({ name: `${title.replace(/[\\/:*?"<>|\s]+/g, " ").trim()}.${extensions[kind]}`, bytes: blank2(kind, title, template), mimeType: mimes[kind] }));
2685
+ } catch {
2686
+ setState("failed");
2687
+ }
2688
+ };
2689
+ return /* @__PURE__ */ jsx6("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
2690
+ if (e.key === "Escape") {
2691
+ e.stopPropagation();
2692
+ onClose();
2693
+ }
2694
+ }, children: /* @__PURE__ */ jsxs6("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
2695
+ e.preventDefault();
2696
+ void make2();
2697
+ }, children: [
2698
+ /* @__PURE__ */ jsxs6("div", { className: "w100n-new-head", children: [
2699
+ /* @__PURE__ */ jsx6("span", { className: "w100n-new-tile", children: /* @__PURE__ */ jsx6(Plus2, { "aria-hidden": true }) }),
2700
+ /* @__PURE__ */ jsx6("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
2701
+ /* @__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 }) })
2702
+ ] }),
2703
+ /* @__PURE__ */ jsx6("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
2704
+ const Icon = icons2[item];
2705
+ return /* @__PURE__ */ jsxs6("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
2706
+ setKind(item);
2707
+ if (item === "sheet" || item === "slides") setTemplate("blank");
2708
+ }, children: [
2709
+ /* @__PURE__ */ jsx6("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx6(Icon, { "aria-hidden": true }) }),
2710
+ /* @__PURE__ */ jsxs6("span", { children: [
2711
+ /* @__PURE__ */ jsx6("b", { children: t.newKinds[item] }),
2712
+ /* @__PURE__ */ jsx6("small", { children: t.kindHints[item] })
2713
+ ] })
2714
+ ] }, item);
2715
+ }) }),
2716
+ /* @__PURE__ */ jsx6("p", { className: "w100n-docs-caption", children: t.startFrom }),
2717
+ /* @__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": template === item, onClick: () => setTemplate(item), children: [
2718
+ /* @__PURE__ */ jsx6("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ jsx6(Plus2, { "aria-hidden": true }) : /* @__PURE__ */ jsxs6(Fragment5, { children: [
2719
+ /* @__PURE__ */ jsx6("i", { "data-head": true }),
2720
+ /* @__PURE__ */ jsx6("i", {}),
2721
+ /* @__PURE__ */ jsx6("i", {}),
2722
+ /* @__PURE__ */ jsx6("i", { "data-accent": true }),
2723
+ /* @__PURE__ */ jsx6("i", {}),
2724
+ /* @__PURE__ */ jsx6("i", {})
2725
+ ] }) }),
2726
+ /* @__PURE__ */ jsx6("span", { children: t.templates[item] })
2727
+ ] }, item)) }),
2728
+ /* @__PURE__ */ jsxs6("div", { className: "w100n-new-fields", children: [
2729
+ /* @__PURE__ */ jsxs6("label", { children: [
2730
+ /* @__PURE__ */ jsx6("span", { className: "w100n-docs-caption", children: t.name }),
2731
+ /* @__PURE__ */ jsx6("input", { className: "w100n-docs-field", autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: template === "blank" ? t.untitled : t.templates[template] })
2732
+ ] }),
2733
+ host.createIn && /* @__PURE__ */ jsxs6("div", { children: [
2734
+ /* @__PURE__ */ jsx6("span", { className: "w100n-docs-caption", children: t.savesTo }),
2735
+ /* @__PURE__ */ jsx6("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
2736
+ ] })
2737
+ ] }),
2738
+ state === "failed" && /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
2739
+ /* @__PURE__ */ jsxs6("div", { className: "w100n-pdf-dialog-end", children: [
2740
+ /* @__PURE__ */ jsx6("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
2741
+ /* @__PURE__ */ jsxs6("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
2742
+ /* @__PURE__ */ jsx6(Check, { "aria-hidden": true }),
2743
+ state === "busy" ? t.making : t.make
2744
+ ] })
2745
+ ] })
2746
+ ] }) });
2747
+ }
2748
+
2749
+ // src/Sharing.tsx
2750
+ import { useState as useState7 } from "react";
2751
+ import { Ban, CalendarDays, Clock, Copy as Copy2, Download as Download2, Eye, Link, Lock, MessageSquarePlus, Plus as Plus3, Users } from "lucide-react";
2752
+ import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2753
+ var blank3 = { id: null, comment: false, download: false, askName: true, works: "30", day: "", password: false, secret: "", had: false };
2547
2754
  var local = (iso) => {
2548
2755
  const at = new Date(iso);
2549
2756
  return `${at.getFullYear()}-${String(at.getMonth() + 1).padStart(2, "0")}-${String(at.getDate()).padStart(2, "0")}`;
2550
2757
  };
2551
2758
  function Sharing({ host, doc, t, language, team }) {
2552
2759
  const links = useLoad((signal) => host.links(doc.id, { signal }), [host, doc.id]);
2553
- const [form, setForm] = useState6(null);
2554
- const [state, setState] = useState6("idle");
2555
- const [copied, setCopied] = useState6(null);
2760
+ const [form, setForm] = useState7(null);
2761
+ const [state, setState] = useState7("idle");
2762
+ const [copied, setCopied] = useState7(null);
2556
2763
  const text = doc.kind === "docx" || doc.kind === "markdown";
2557
2764
  const rules = new Intl.PluralRules(language);
2558
2765
  const count = (n, forms) => `${n} ${forms[rules.select(n)] ?? forms.other}`;
@@ -2614,31 +2821,31 @@ function Sharing({ host, doc, t, language, team }) {
2614
2821
  setCopied(null);
2615
2822
  }
2616
2823
  };
2617
- if (form) return /* @__PURE__ */ jsxs6("div", { className: "w100n-share", children: [
2618
- /* @__PURE__ */ jsxs6("p", { className: "w100n-docs-caption", children: [
2619
- /* @__PURE__ */ jsx6(Link, { "aria-hidden": true }),
2824
+ if (form) return /* @__PURE__ */ jsxs7("div", { className: "w100n-share", children: [
2825
+ /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
2826
+ /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
2620
2827
  form.id ? t.changeLink : t.newLink
2621
2828
  ] }),
2622
- text && /* @__PURE__ */ jsxs6("div", { className: "w100n-share-field", children: [
2623
- /* @__PURE__ */ jsx6("span", { children: t.guestsCan }),
2624
- /* @__PURE__ */ jsxs6("div", { className: "w100n-docs-chips", children: [
2625
- /* @__PURE__ */ jsxs6("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
2626
- /* @__PURE__ */ jsx6(Eye, { "aria-hidden": true }),
2829
+ text && /* @__PURE__ */ jsxs7("div", { className: "w100n-share-field", children: [
2830
+ /* @__PURE__ */ jsx7("span", { children: t.guestsCan }),
2831
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-docs-chips", children: [
2832
+ /* @__PURE__ */ jsxs7("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
2833
+ /* @__PURE__ */ jsx7(Eye, { "aria-hidden": true }),
2627
2834
  t.canRead
2628
2835
  ] }),
2629
- /* @__PURE__ */ jsxs6("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
2630
- /* @__PURE__ */ jsx6(MessageSquarePlus, { "aria-hidden": true }),
2836
+ /* @__PURE__ */ jsxs7("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
2837
+ /* @__PURE__ */ jsx7(MessageSquarePlus, { "aria-hidden": true }),
2631
2838
  t.canComment
2632
2839
  ] })
2633
2840
  ] })
2634
2841
  ] }),
2635
- /* @__PURE__ */ jsxs6("div", { className: "w100n-share-field", children: [
2636
- /* @__PURE__ */ jsx6("span", { children: t.linkWorks }),
2637
- /* @__PURE__ */ jsx6("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key, label]) => /* @__PURE__ */ jsxs6("button", { type: "button", "aria-pressed": form.works === key, onClick: () => setForm({ ...form, works: key }), children: [
2638
- key === "day" && /* @__PURE__ */ jsx6(CalendarDays, { "aria-hidden": true }),
2842
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-share-field", children: [
2843
+ /* @__PURE__ */ jsx7("span", { children: t.linkWorks }),
2844
+ /* @__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: [
2845
+ key === "day" && /* @__PURE__ */ jsx7(CalendarDays, { "aria-hidden": true }),
2639
2846
  label
2640
2847
  ] }, key)) }),
2641
- form.works === "day" && /* @__PURE__ */ jsx6(
2848
+ form.works === "day" && /* @__PURE__ */ jsx7(
2642
2849
  "input",
2643
2850
  {
2644
2851
  type: "date",
@@ -2650,14 +2857,14 @@ function Sharing({ host, doc, t, language, team }) {
2650
2857
  }
2651
2858
  )
2652
2859
  ] }),
2653
- /* @__PURE__ */ jsxs6("label", { className: "w100n-share-toggle", children: [
2654
- /* @__PURE__ */ jsx6("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
2655
- /* @__PURE__ */ jsxs6("span", { children: [
2656
- /* @__PURE__ */ jsx6("b", { children: t.passwordOn }),
2657
- /* @__PURE__ */ jsx6("small", { children: t.passwordHint })
2860
+ /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2861
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
2862
+ /* @__PURE__ */ jsxs7("span", { children: [
2863
+ /* @__PURE__ */ jsx7("b", { children: t.passwordOn }),
2864
+ /* @__PURE__ */ jsx7("small", { children: t.passwordHint })
2658
2865
  ] })
2659
2866
  ] }),
2660
- form.password && /* @__PURE__ */ jsx6(
2867
+ form.password && /* @__PURE__ */ jsx7(
2661
2868
  "input",
2662
2869
  {
2663
2870
  type: "password",
@@ -2669,120 +2876,120 @@ function Sharing({ host, doc, t, language, team }) {
2669
2876
  onChange: (e) => setForm({ ...form, secret: e.target.value })
2670
2877
  }
2671
2878
  ),
2672
- /* @__PURE__ */ jsxs6("label", { className: "w100n-share-toggle", children: [
2673
- /* @__PURE__ */ jsx6("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
2674
- /* @__PURE__ */ jsxs6("span", { children: [
2675
- /* @__PURE__ */ jsx6("b", { children: t.downloadFile }),
2676
- /* @__PURE__ */ jsx6("small", { children: t.downloadHint })
2879
+ /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2880
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
2881
+ /* @__PURE__ */ jsxs7("span", { children: [
2882
+ /* @__PURE__ */ jsx7("b", { children: t.downloadFile }),
2883
+ /* @__PURE__ */ jsx7("small", { children: t.downloadHint })
2677
2884
  ] })
2678
2885
  ] }),
2679
- /* @__PURE__ */ jsxs6("label", { className: "w100n-share-toggle", children: [
2680
- /* @__PURE__ */ jsx6("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
2681
- /* @__PURE__ */ jsxs6("span", { children: [
2682
- /* @__PURE__ */ jsx6("b", { children: t.askName }),
2683
- /* @__PURE__ */ jsx6("small", { children: t.askNameHint })
2886
+ /* @__PURE__ */ jsxs7("label", { className: "w100n-share-toggle", children: [
2887
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
2888
+ /* @__PURE__ */ jsxs7("span", { children: [
2889
+ /* @__PURE__ */ jsx7("b", { children: t.askName }),
2890
+ /* @__PURE__ */ jsx7("small", { children: t.askNameHint })
2684
2891
  ] })
2685
2892
  ] }),
2686
- /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", children: t.lastSaved }),
2687
- state === "failed" && /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2688
- /* @__PURE__ */ jsxs6("span", { className: "w100n-pdf-dialog-end", children: [
2689
- /* @__PURE__ */ jsx6("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
2893
+ /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", children: t.lastSaved }),
2894
+ state === "failed" && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2895
+ /* @__PURE__ */ jsxs7("span", { className: "w100n-pdf-dialog-end", children: [
2896
+ /* @__PURE__ */ jsx7("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
2690
2897
  setForm(null);
2691
2898
  setState("idle");
2692
2899
  }, children: t.cancel }),
2693
- /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
2694
- /* @__PURE__ */ jsx6(Link, { "aria-hidden": true }),
2900
+ /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
2901
+ /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
2695
2902
  form.id ? t.saveLink : t.makeLink
2696
2903
  ] })
2697
2904
  ] })
2698
2905
  ] });
2699
2906
  const on = links.data ?? [];
2700
- return /* @__PURE__ */ jsxs6("div", { className: "w100n-share", children: [
2701
- /* @__PURE__ */ jsxs6("p", { className: "w100n-docs-caption", children: [
2702
- /* @__PURE__ */ jsx6(Link, { "aria-hidden": true }),
2907
+ return /* @__PURE__ */ jsxs7("div", { className: "w100n-share", children: [
2908
+ /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
2909
+ /* @__PURE__ */ jsx7(Link, { "aria-hidden": true }),
2703
2910
  t.guestLinks,
2704
- on.length > 0 && /* @__PURE__ */ jsx6("span", { children: on.filter((l) => !l.ended).length })
2911
+ on.length > 0 && /* @__PURE__ */ jsx7("span", { children: on.filter((l) => !l.ended).length })
2705
2912
  ] }),
2706
- links.error && /* @__PURE__ */ jsxs6("div", { className: "w100n-docs-note", children: [
2913
+ links.error && /* @__PURE__ */ jsxs7("div", { className: "w100n-docs-note", children: [
2707
2914
  t.failed,
2708
- /* @__PURE__ */ jsx6("button", { type: "button", onClick: links.retry, children: t.retry })
2915
+ /* @__PURE__ */ jsx7("button", { type: "button", onClick: links.retry, children: t.retry })
2709
2916
  ] }),
2710
- links.data && !on.length && /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", children: t.noLinks }),
2711
- state === "failed" && /* @__PURE__ */ jsx6("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2712
- on.map((l) => /* @__PURE__ */ jsxs6("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
2713
- /* @__PURE__ */ jsxs6("header", { children: [
2714
- /* @__PURE__ */ jsx6("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ jsx6(MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ jsx6(Eye, { "aria-hidden": true }) }),
2715
- /* @__PURE__ */ jsxs6("span", { children: [
2716
- /* @__PURE__ */ jsx6("b", { children: l.comment ? t.commentLink : t.viewLink }),
2717
- /* @__PURE__ */ jsxs6("small", { children: [
2917
+ links.data && !on.length && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", children: t.noLinks }),
2918
+ state === "failed" && /* @__PURE__ */ jsx7("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
2919
+ on.map((l) => /* @__PURE__ */ jsxs7("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
2920
+ /* @__PURE__ */ jsxs7("header", { children: [
2921
+ /* @__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 }) }),
2922
+ /* @__PURE__ */ jsxs7("span", { children: [
2923
+ /* @__PURE__ */ jsx7("b", { children: l.comment ? t.commentLink : t.viewLink }),
2924
+ /* @__PURE__ */ jsxs7("small", { children: [
2718
2925
  t.madeBy.replace("{name}", l.createdBy.name),
2719
2926
  " \xB7 ",
2720
2927
  day(l.createdAt)
2721
2928
  ] })
2722
2929
  ] })
2723
2930
  ] }),
2724
- /* @__PURE__ */ jsxs6("div", { className: "w100n-share-chips", children: [
2725
- /* @__PURE__ */ jsxs6("span", { children: [
2726
- /* @__PURE__ */ jsx6(Clock, { "aria-hidden": true }),
2931
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-share-chips", children: [
2932
+ /* @__PURE__ */ jsxs7("span", { children: [
2933
+ /* @__PURE__ */ jsx7(Clock, { "aria-hidden": true }),
2727
2934
  l.ended ? t.linkEnded : l.endsAt ? t.endsOn.replace("{date}", day(l.endsAt)) : t.untilOff
2728
2935
  ] }),
2729
- l.download && /* @__PURE__ */ jsxs6("span", { children: [
2730
- /* @__PURE__ */ jsx6(Download2, { "aria-hidden": true }),
2936
+ l.download && /* @__PURE__ */ jsxs7("span", { children: [
2937
+ /* @__PURE__ */ jsx7(Download2, { "aria-hidden": true }),
2731
2938
  t.downloadOn
2732
2939
  ] }),
2733
- l.password && /* @__PURE__ */ jsxs6("span", { children: [
2734
- /* @__PURE__ */ jsx6(Lock, { "aria-hidden": true }),
2940
+ l.password && /* @__PURE__ */ jsxs7("span", { children: [
2941
+ /* @__PURE__ */ jsx7(Lock, { "aria-hidden": true }),
2735
2942
  t.passwordOn
2736
2943
  ] }),
2737
- /* @__PURE__ */ jsxs6("span", { children: [
2738
- /* @__PURE__ */ jsx6(Eye, { "aria-hidden": true }),
2944
+ /* @__PURE__ */ jsxs7("span", { children: [
2945
+ /* @__PURE__ */ jsx7(Eye, { "aria-hidden": true }),
2739
2946
  count(l.guests.reduce((n, g) => n + g.opens, 0), t.openForms)
2740
2947
  ] })
2741
2948
  ] }),
2742
- /* @__PURE__ */ jsxs6("div", { className: "w100n-share-url", children: [
2743
- /* @__PURE__ */ jsx6("span", { children: l.url.replace(/^https?:\/\//, "") }),
2744
- /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy(l), children: [
2745
- /* @__PURE__ */ jsx6(Copy2, { "aria-hidden": true }),
2949
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-share-url", children: [
2950
+ /* @__PURE__ */ jsx7("span", { children: l.url.replace(/^https?:\/\//, "") }),
2951
+ /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy(l), children: [
2952
+ /* @__PURE__ */ jsx7(Copy2, { "aria-hidden": true }),
2746
2953
  copied === l.id ? t.copied : t.copy
2747
2954
  ] })
2748
2955
  ] }),
2749
- l.guests.length > 0 && /* @__PURE__ */ jsx6("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ jsxs6("div", { children: [
2750
- /* @__PURE__ */ jsx6("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
2751
- /* @__PURE__ */ jsx6("b", { children: g.name || t.unnamed }),
2752
- /* @__PURE__ */ jsxs6("small", { children: [
2956
+ l.guests.length > 0 && /* @__PURE__ */ jsx7("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ jsxs7("div", { children: [
2957
+ /* @__PURE__ */ jsx7("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
2958
+ /* @__PURE__ */ jsx7("b", { children: g.name || t.unnamed }),
2959
+ /* @__PURE__ */ jsxs7("small", { children: [
2753
2960
  g.comments ? count(g.comments, t.commentForms) : count(g.opens, t.openForms),
2754
2961
  " \xB7 ",
2755
2962
  ago(g.lastAt)
2756
2963
  ] })
2757
2964
  ] }, i)) }),
2758
- /* @__PURE__ */ jsxs6("div", { className: "w100n-share-tools", children: [
2759
- /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
2760
- /* @__PURE__ */ jsx6(Clock, { "aria-hidden": true }),
2965
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-share-tools", children: [
2966
+ /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
2967
+ /* @__PURE__ */ jsx7(Clock, { "aria-hidden": true }),
2761
2968
  t.changeLink
2762
2969
  ] }),
2763
- /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
2764
- /* @__PURE__ */ jsx6(Ban, { "aria-hidden": true }),
2970
+ /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
2971
+ /* @__PURE__ */ jsx7(Ban, { "aria-hidden": true }),
2765
2972
  t.turnOff
2766
2973
  ] })
2767
2974
  ] })
2768
2975
  ] }, l.id)),
2769
- /* @__PURE__ */ jsxs6("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
2976
+ /* @__PURE__ */ jsxs7("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
2770
2977
  setState("idle");
2771
- setForm(blank2);
2978
+ setForm(blank3);
2772
2979
  }, children: [
2773
- /* @__PURE__ */ jsx6(Plus2, { "aria-hidden": true }),
2980
+ /* @__PURE__ */ jsx7(Plus3, { "aria-hidden": true }),
2774
2981
  t.newLink
2775
2982
  ] }),
2776
- team && /* @__PURE__ */ jsxs6(Fragment5, { children: [
2777
- /* @__PURE__ */ jsxs6("p", { className: "w100n-docs-caption", children: [
2778
- /* @__PURE__ */ jsx6(Users, { "aria-hidden": true }),
2983
+ team && /* @__PURE__ */ jsxs7(Fragment6, { children: [
2984
+ /* @__PURE__ */ jsxs7("p", { className: "w100n-docs-caption", children: [
2985
+ /* @__PURE__ */ jsx7(Users, { "aria-hidden": true }),
2779
2986
  t.inTeam
2780
2987
  ] }),
2781
- /* @__PURE__ */ jsxs6("div", { className: "w100n-share-team", children: [
2782
- /* @__PURE__ */ jsx6("span", { className: "w100n-share-tile", children: /* @__PURE__ */ jsx6(Users, { "aria-hidden": true }) }),
2783
- /* @__PURE__ */ jsxs6("span", { children: [
2784
- /* @__PURE__ */ jsx6("b", { children: t.peopleOf.replace("{space}", team) }),
2785
- /* @__PURE__ */ jsx6("small", { children: t.teamHint })
2988
+ /* @__PURE__ */ jsxs7("div", { className: "w100n-share-team", children: [
2989
+ /* @__PURE__ */ jsx7("span", { className: "w100n-share-tile", children: /* @__PURE__ */ jsx7(Users, { "aria-hidden": true }) }),
2990
+ /* @__PURE__ */ jsxs7("span", { children: [
2991
+ /* @__PURE__ */ jsx7("b", { children: t.peopleOf.replace("{space}", team) }),
2992
+ /* @__PURE__ */ jsx7("small", { children: t.teamHint })
2786
2993
  ] })
2787
2994
  ] })
2788
2995
  ] })
@@ -2790,7 +2997,7 @@ function Sharing({ host, doc, t, language, team }) {
2790
2997
  }
2791
2998
 
2792
2999
  // src/Thumb.tsx
2793
- import { useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
3000
+ import { useEffect as useEffect5, useRef as useRef5, useState as useState8 } from "react";
2794
3001
 
2795
3002
  // src/preview.ts
2796
3003
  var cache = /* @__PURE__ */ new Map();
@@ -2843,11 +3050,11 @@ function preview(host, doc) {
2843
3050
  }
2844
3051
 
2845
3052
  // src/Thumb.tsx
2846
- import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3053
+ import { Fragment as Fragment7, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2847
3054
  function Thumb({ host, item, label }) {
2848
3055
  const box = useRef5(null);
2849
- const [seen, setSeen] = useState7(false);
2850
- const [shot, setShot] = useState7(null);
3056
+ const [seen, setSeen] = useState8(false);
3057
+ const [shot, setShot] = useState8(null);
2851
3058
  useEffect5(() => {
2852
3059
  if (item.thumbnailUrl || item.excerpt || typeof IntersectionObserver === "undefined") return;
2853
3060
  const watch = new IntersectionObserver((entries) => {
@@ -2869,39 +3076,39 @@ function Thumb({ host, item, label }) {
2869
3076
  const text = item.excerpt ?? shot?.text ?? "";
2870
3077
  const lines = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
2871
3078
  const image = item.thumbnailUrl ?? shot?.image;
2872
- return /* @__PURE__ */ jsxs7("span", { ref: box, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
2873
- image ? /* @__PURE__ */ jsx7("img", { src: image, alt: "" }) : /* @__PURE__ */ jsx7("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines.length ? /* @__PURE__ */ jsxs7(Fragment6, { children: [
2874
- /* @__PURE__ */ jsx7("b", { children: lines[0] }),
3079
+ return /* @__PURE__ */ jsxs8("span", { ref: box, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
3080
+ image ? /* @__PURE__ */ jsx8("img", { src: image, alt: "" }) : /* @__PURE__ */ jsx8("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines.length ? /* @__PURE__ */ jsxs8(Fragment7, { children: [
3081
+ /* @__PURE__ */ jsx8("b", { children: lines[0] }),
2875
3082
  lines.slice(1, 14).join(" ")
2876
- ] }) : /* @__PURE__ */ jsxs7(Fragment6, { children: [
2877
- /* @__PURE__ */ jsx7("i", {}),
2878
- /* @__PURE__ */ jsx7("i", {}),
2879
- /* @__PURE__ */ jsx7("i", {}),
2880
- /* @__PURE__ */ jsx7("i", {}),
2881
- /* @__PURE__ */ jsx7("i", {})
3083
+ ] }) : /* @__PURE__ */ jsxs8(Fragment7, { children: [
3084
+ /* @__PURE__ */ jsx8("i", {}),
3085
+ /* @__PURE__ */ jsx8("i", {}),
3086
+ /* @__PURE__ */ jsx8("i", {}),
3087
+ /* @__PURE__ */ jsx8("i", {}),
3088
+ /* @__PURE__ */ jsx8("i", {})
2882
3089
  ] }) }),
2883
- /* @__PURE__ */ jsx7("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
3090
+ /* @__PURE__ */ jsx8("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
2884
3091
  ] });
2885
3092
  }
2886
3093
 
2887
3094
  // src/DocumentsWorkspace.tsx
2888
- import { Fragment as Fragment7, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2889
- var TextEditor2 = lazy2(() => import("./TextEditor-SPEVB5HX.js"));
2890
- var SheetView2 = lazy2(() => import("./SheetView-G3YWPH5V.js"));
2891
- var icons2 = { docx: FileText2, markdown: FileType2, pdf: Files2, sheet: FileSpreadsheet2, slides: Presentation2 };
3095
+ import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3096
+ var TextEditor2 = lazy2(() => import("./TextEditor-OLBLWC6F.js"));
3097
+ var SheetView2 = lazy2(() => import("./SheetView-3UAFXGZS.js"));
3098
+ var icons3 = { docx: FileText3, markdown: FileType3, pdf: Files2, sheet: FileSpreadsheet3, slides: Presentation3 };
2892
3099
  function DocumentsWorkspace({ host, language = "en", theme = "light", place, onPlace, start, end, aside, actions }) {
2893
3100
  const t = texts[language];
2894
- const [own, setOwn] = useState8({ spaceId: null, documentId: null });
3101
+ const [own, setOwn] = useState9({ spaceId: null, documentId: null });
2895
3102
  const here = place ?? own;
2896
3103
  const go = (next) => {
2897
3104
  setOwn(next);
2898
3105
  onPlace?.(next);
2899
3106
  };
2900
- const [query, setQuery] = useState8("");
2901
- const [kind, setKind] = useState8("all");
2902
- const [listOpen, setListOpen] = useState8(true);
2903
- const [panelOpen, setPanelOpen] = useState8(true);
2904
- const [narrow, setNarrow] = useState8(false);
3107
+ const [query, setQuery] = useState9("");
3108
+ const [kind, setKind] = useState9("all");
3109
+ const [listOpen, setListOpen] = useState9(true);
3110
+ const [panelOpen, setPanelOpen] = useState9(true);
3111
+ const [narrow, setNarrow] = useState9(false);
2905
3112
  const body = useRef6(null);
2906
3113
  const listButton = useRef6(null);
2907
3114
  const panelButton = useRef6(null);
@@ -2926,7 +3133,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
2926
3133
  watch.observe(el);
2927
3134
  return () => watch.disconnect();
2928
3135
  }, [here.documentId]);
2929
- const [picking, setPicking] = useState8(false);
3136
+ const [picking, setPicking] = useState9(false);
2930
3137
  useEffect6(() => {
2931
3138
  if (!picking) return;
2932
3139
  const close = (e) => {
@@ -2935,14 +3142,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
2935
3142
  document.addEventListener("pointerdown", close);
2936
3143
  return () => document.removeEventListener("pointerdown", close);
2937
3144
  }, [picking]);
2938
- const [tab, setTab] = useState8("outline");
2939
- const [outline, setOutline] = useState8([]);
2940
- const [version, setVersion] = useState8({ documentId: null, id: null });
3145
+ const [tab, setTab] = useState9("outline");
3146
+ const [outline, setOutline] = useState9([]);
3147
+ const [version, setVersion] = useState9({ documentId: null, id: null });
2941
3148
  const versionId = version.documentId === here.documentId ? version.id : null;
2942
- const [restoring, setRestoring] = useState8("idle");
2943
- const [exporting, setExporting] = useState8("idle");
2944
- const [copying, setCopying] = useState8("idle");
2945
- const [box, setBox] = useState8(null);
3149
+ const [restoring, setRestoring] = useState9("idle");
3150
+ const [exporting, setExporting] = useState9("idle");
3151
+ const [copying, setCopying] = useState9("idle");
3152
+ const [box, setBox] = useState9(null);
3153
+ const [making, setMaking] = useState9(false);
2946
3154
  const spaces = useLoad((signal) => host.spaces({ signal }), [host]);
2947
3155
  const single = spaces.data?.length === 1 ? spaces.data[0].id : null;
2948
3156
  const spaceId = here.spaceId ?? single;
@@ -2977,9 +3185,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
2977
3185
  return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
2978
3186
  };
2979
3187
  const size = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
2980
- const failed = (retry) => /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-note", children: [
3188
+ const failed = (retry) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-note", children: [
2981
3189
  t.failed,
2982
- /* @__PURE__ */ jsx8("button", { type: "button", onClick: retry, children: t.retry })
3190
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: retry, children: t.retry })
2983
3191
  ] });
2984
3192
  const { ask, dialog } = useUnsaved(guard, t);
2985
3193
  const side = (which, open2) => {
@@ -3057,8 +3265,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3057
3265
  setCopying("failed");
3058
3266
  }
3059
3267
  };
3060
- let stage = /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-empty", children: [
3061
- /* @__PURE__ */ jsx8(FileText2, { "aria-hidden": true }),
3268
+ let stage = /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-empty", children: [
3269
+ /* @__PURE__ */ jsx9(FileText3, { "aria-hidden": true }),
3062
3270
  t.pick
3063
3271
  ] });
3064
3272
  if (here.documentId) {
@@ -3066,8 +3274,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3066
3274
  doc.retry();
3067
3275
  content.retry();
3068
3276
  });
3069
- else if (!doc.data || !content.data) stage = /* @__PURE__ */ jsx8("div", { className: "w100n-docs-empty", children: t.loading });
3070
- else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ jsx8(Suspense2, { fallback: /* @__PURE__ */ jsx8("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx8(
3277
+ else if (!doc.data || !content.data) stage = /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading });
3278
+ 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(
3071
3279
  TextEditor2,
3072
3280
  {
3073
3281
  kind: doc.data.kind,
@@ -3094,7 +3302,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3094
3302
  },
3095
3303
  doc.data.id
3096
3304
  ) });
3097
- else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ jsx8(
3305
+ else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ jsx9(
3098
3306
  PdfView,
3099
3307
  {
3100
3308
  bytes: content.data,
@@ -3116,7 +3324,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3116
3324
  },
3117
3325
  `${doc.data.id}:${versionId ?? ""}`
3118
3326
  );
3119
- else if (doc.data.kind === "slides") stage = /* @__PURE__ */ jsx8(
3327
+ else if (doc.data.kind === "slides") stage = /* @__PURE__ */ jsx9(
3120
3328
  SlidesView,
3121
3329
  {
3122
3330
  html: new TextDecoder().decode(content.data),
@@ -3135,7 +3343,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3135
3343
  },
3136
3344
  doc.data.id
3137
3345
  );
3138
- else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ jsx8(Suspense2, { fallback: /* @__PURE__ */ jsx8("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx8(
3346
+ else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ jsx9(Suspense2, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(
3139
3347
  SheetView2,
3140
3348
  {
3141
3349
  bytes: content.data,
@@ -3162,16 +3370,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3162
3370
  },
3163
3371
  `${doc.data.id}:${versionId ?? ""}`
3164
3372
  ) });
3165
- else stage = /* @__PURE__ */ jsx8("div", { className: "w100n-docs-empty", children: t.unsupported });
3373
+ else stage = /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.unsupported });
3166
3374
  }
3167
- const Kind = doc.data ? icons2[doc.data.kind] : FileText2;
3375
+ const Kind = doc.data ? icons3[doc.data.kind] : FileText3;
3168
3376
  const crumbs = doc.data ? [names2.get(doc.data.spaceId), doc.data.folder].filter(Boolean) : space ? [space.name] : [];
3169
3377
  const panelTabs = [["outline", ListTree, t.outline], ["versions", History, t.versions], ["details", Info, t.details]];
3170
3378
  if (pdf && host.signatures) panelTabs.push(["signatures", Signature, t.signatures]);
3171
3379
  if (text && host.comments && !versionId) panelTabs.push(["comments", MessagesSquare, t.comments]);
3172
3380
  const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
3173
3381
  if (sharing) panelTabs.push(["sharing", Share2, t.sharing]);
3174
- const listToggle = /* @__PURE__ */ jsx8(
3382
+ const listToggle = /* @__PURE__ */ jsx9(
3175
3383
  "button",
3176
3384
  {
3177
3385
  ref: listButton,
@@ -3181,10 +3389,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3181
3389
  onClick: () => side("list", !listOpen),
3182
3390
  "aria-label": listOpen ? t.closeList : t.openList,
3183
3391
  title: listOpen ? t.closeList : t.openList,
3184
- children: listOpen ? /* @__PURE__ */ jsx8(PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx8(PanelLeftOpen, { "aria-hidden": true })
3392
+ children: listOpen ? /* @__PURE__ */ jsx9(PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(PanelLeftOpen, { "aria-hidden": true })
3185
3393
  }
3186
3394
  );
3187
- const panelToggle = doc.data && /* @__PURE__ */ jsx8(
3395
+ const panelToggle = doc.data && /* @__PURE__ */ jsx9(
3188
3396
  "button",
3189
3397
  {
3190
3398
  ref: panelButton,
@@ -3194,163 +3402,167 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3194
3402
  onClick: () => side("panel", !panelOpen),
3195
3403
  "aria-label": panelOpen ? t.closePanel : t.openPanel,
3196
3404
  title: panelOpen ? t.closePanel : t.openPanel,
3197
- children: panelOpen ? /* @__PURE__ */ jsx8(PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx8(PanelRightOpen, { "aria-hidden": true })
3405
+ children: panelOpen ? /* @__PURE__ */ jsx9(PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx9(PanelRightOpen, { "aria-hidden": true })
3198
3406
  }
3199
3407
  );
3200
- return /* @__PURE__ */ jsxs8("div", { className: "w100n-docs", "data-theme": theme, children: [
3201
- /* @__PURE__ */ jsxs8("header", { className: "w100n-docs-bar", children: [
3202
- start && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
3408
+ return /* @__PURE__ */ jsxs9("div", { className: "w100n-docs", "data-theme": theme, children: [
3409
+ /* @__PURE__ */ jsxs9("header", { className: "w100n-docs-bar", children: [
3410
+ start && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
3203
3411
  narrow && listToggle,
3204
- /* @__PURE__ */ jsx8("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ jsx8(Kind, { "aria-hidden": true }) }),
3205
- /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-heading", children: [
3206
- /* @__PURE__ */ jsx8("strong", { className: "w100n-docs-title", children: doc.data?.name ?? t.documents }),
3207
- crumbs.length > 0 ? /* @__PURE__ */ jsx8("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ jsxs8("span", { children: [
3208
- i > 0 && /* @__PURE__ */ jsx8(ChevronRight2, { "aria-hidden": true }),
3412
+ /* @__PURE__ */ jsx9("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ jsx9(Kind, { "aria-hidden": true }) }),
3413
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-heading", children: [
3414
+ /* @__PURE__ */ jsx9("strong", { className: "w100n-docs-title", children: doc.data?.name ?? t.documents }),
3415
+ crumbs.length > 0 ? /* @__PURE__ */ jsx9("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ jsxs9("span", { children: [
3416
+ i > 0 && /* @__PURE__ */ jsx9(ChevronRight2, { "aria-hidden": true }),
3209
3417
  item
3210
- ] }, i)) }) : /* @__PURE__ */ jsx8("span", { className: "w100n-docs-hint", children: t.hint })
3418
+ ] }, i)) }) : /* @__PURE__ */ jsx9("span", { className: "w100n-docs-hint", children: t.hint })
3211
3419
  ] }),
3212
- doc.data && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-badge", "data-kind": doc.data.kind, children: t.kinds[doc.data.kind] }),
3213
- versionId && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
3214
- versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ jsxs8("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
3215
- /* @__PURE__ */ jsx8(RotateCcw2, { "aria-hidden": true }),
3420
+ doc.data && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", "data-kind": doc.data.kind, children: t.kinds[doc.data.kind] }),
3421
+ 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) }),
3422
+ 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: [
3423
+ /* @__PURE__ */ jsx9(RotateCcw2, { "aria-hidden": true }),
3216
3424
  t.restore
3217
3425
  ] }),
3218
- restoring === "failed" && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
3219
- doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ jsxs8("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
3220
- /* @__PURE__ */ jsx8(FileSpreadsheet2, { "aria-hidden": true }),
3426
+ restoring === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
3427
+ 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: [
3428
+ /* @__PURE__ */ jsx9(FileSpreadsheet3, { "aria-hidden": true }),
3221
3429
  t.copyAs
3222
3430
  ] }),
3223
- copying === "failed" && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-muted", children: t.copyFailed }),
3224
- sharing && /* @__PURE__ */ jsxs8("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
3431
+ copying === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.copyFailed }),
3432
+ sharing && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
3225
3433
  setTab("sharing");
3226
3434
  side("panel", true);
3227
3435
  }, children: [
3228
- /* @__PURE__ */ jsx8(Share2, { "aria-hidden": true }),
3229
- /* @__PURE__ */ jsx8("span", { children: t.share })
3436
+ /* @__PURE__ */ jsx9(Share2, { "aria-hidden": true }),
3437
+ /* @__PURE__ */ jsx9("span", { children: t.share })
3230
3438
  ] }),
3231
3439
  doc.data && !versionId && actions?.(doc.data),
3440
+ host.create && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "aria-label": t.create, title: t.create, onClick: () => setMaking(true), children: [
3441
+ /* @__PURE__ */ jsx9(Plus4, { "aria-hidden": true }),
3442
+ /* @__PURE__ */ jsx9("span", { children: t.create })
3443
+ ] }),
3232
3444
  narrow && panelToggle,
3233
- end && /* @__PURE__ */ jsx8("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
3445
+ end && /* @__PURE__ */ jsx9("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
3234
3446
  ] }),
3235
- /* @__PURE__ */ jsxs8("div", { ref: body, className: "w100n-docs-body", children: [
3236
- listOpen && /* @__PURE__ */ jsxs8("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
3237
- /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-head", children: [
3238
- /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-row", children: [
3239
- /* @__PURE__ */ jsxs8("p", { className: "w100n-docs-caption", children: [
3240
- /* @__PURE__ */ jsx8(Files2, { "aria-hidden": true }),
3447
+ /* @__PURE__ */ jsxs9("div", { ref: body, className: "w100n-docs-body", children: [
3448
+ listOpen && /* @__PURE__ */ jsxs9("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
3449
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-head", children: [
3450
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-row", children: [
3451
+ /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3452
+ /* @__PURE__ */ jsx9(Files2, { "aria-hidden": true }),
3241
3453
  t.documents,
3242
- /* @__PURE__ */ jsx8("span", { children: all.length })
3454
+ /* @__PURE__ */ jsx9("span", { children: all.length })
3243
3455
  ] }),
3244
- /* @__PURE__ */ jsx8("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ jsx8(X5, { "aria-hidden": true }) })
3456
+ /* @__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 }) })
3245
3457
  ] }),
3246
- (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
3458
+ (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
3247
3459
  if (e.key !== "Escape" || !picking) return;
3248
3460
  e.stopPropagation();
3249
3461
  setPicking(false);
3250
3462
  e.currentTarget.querySelector("button").focus();
3251
3463
  }, children: [
3252
- /* @__PURE__ */ jsxs8("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
3253
- space ? /* @__PURE__ */ jsx8("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ jsx8("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx8(LayoutGrid, { "aria-hidden": true }) }),
3254
- /* @__PURE__ */ jsx8("b", { children: space?.name ?? t.allProjects }),
3255
- !space && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-count", children: all.length }),
3256
- /* @__PURE__ */ jsx8(ChevronDown2, { "aria-hidden": true })
3464
+ /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
3465
+ 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 }) }),
3466
+ /* @__PURE__ */ jsx9("b", { children: space?.name ?? t.allProjects }),
3467
+ !space && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-count", children: all.length }),
3468
+ /* @__PURE__ */ jsx9(ChevronDown2, { "aria-hidden": true })
3257
3469
  ] }),
3258
- picking && /* @__PURE__ */ jsxs8("div", { role: "listbox", className: "w100n-docs-menu", children: [
3259
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
3260
- /* @__PURE__ */ jsx8("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx8(LayoutGrid, { "aria-hidden": true }) }),
3261
- /* @__PURE__ */ jsx8("b", { children: t.allProjects }),
3262
- !spaceId && /* @__PURE__ */ jsx8(Check, { "aria-hidden": true })
3470
+ picking && /* @__PURE__ */ jsxs9("div", { role: "listbox", className: "w100n-docs-menu", children: [
3471
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
3472
+ /* @__PURE__ */ jsx9("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx9(LayoutGrid, { "aria-hidden": true }) }),
3473
+ /* @__PURE__ */ jsx9("b", { children: t.allProjects }),
3474
+ !spaceId && /* @__PURE__ */ jsx9(Check2, { "aria-hidden": true })
3263
3475
  ] }),
3264
- groups.map((group) => /* @__PURE__ */ jsxs8("div", { role: "group", "aria-label": group || void 0, children: [
3265
- group && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-menu-caption", children: group }),
3266
- (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
3267
- /* @__PURE__ */ jsx8("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
3268
- /* @__PURE__ */ jsx8("b", { children: item.name }),
3269
- !spaceId && counts.get(item.id) ? /* @__PURE__ */ jsx8("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
3270
- item.id === spaceId && /* @__PURE__ */ jsx8(Check, { "aria-hidden": true })
3476
+ groups.map((group) => /* @__PURE__ */ jsxs9("div", { role: "group", "aria-label": group || void 0, children: [
3477
+ group && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-menu-caption", children: group }),
3478
+ (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: [
3479
+ /* @__PURE__ */ jsx9("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
3480
+ /* @__PURE__ */ jsx9("b", { children: item.name }),
3481
+ !spaceId && counts.get(item.id) ? /* @__PURE__ */ jsx9("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
3482
+ item.id === spaceId && /* @__PURE__ */ jsx9(Check2, { "aria-hidden": true })
3271
3483
  ] }, item.id))
3272
3484
  ] }, group))
3273
3485
  ] })
3274
3486
  ] }),
3275
- /* @__PURE__ */ jsxs8("label", { className: "w100n-docs-field w100n-docs-search", children: [
3276
- /* @__PURE__ */ jsx8(Search2, { "aria-hidden": true }),
3277
- /* @__PURE__ */ jsx8("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search })
3487
+ /* @__PURE__ */ jsxs9("label", { className: "w100n-docs-field w100n-docs-search", children: [
3488
+ /* @__PURE__ */ jsx9(Search2, { "aria-hidden": true }),
3489
+ /* @__PURE__ */ jsx9("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search })
3278
3490
  ] }),
3279
- present.length > 1 && /* @__PURE__ */ jsx8("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: ["all", ...present].map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", "aria-pressed": kind === item, onClick: () => setKind(item), children: [
3491
+ present.length > 1 && /* @__PURE__ */ jsx9("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: ["all", ...present].map((item) => /* @__PURE__ */ jsxs9("button", { type: "button", "aria-pressed": kind === item, onClick: () => setKind(item), children: [
3280
3492
  item === "all" ? t.all : t.kinds[item],
3281
- /* @__PURE__ */ jsx8("span", { "aria-hidden": true, children: item === "all" ? all.length : all.filter((doc2) => doc2.kind === item).length })
3493
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": true, children: item === "all" ? all.length : all.filter((doc2) => doc2.kind === item).length })
3282
3494
  ] }, item)) })
3283
3495
  ] }),
3284
- /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-cards", children: [
3496
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-cards", children: [
3285
3497
  list.error && failed(list.retry),
3286
- list.loading && !list.data && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", children: t.loading }),
3287
- list.data && !shown.length && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
3288
- folders.map((folder2) => /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
3289
- folders.length > 1 && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
3290
- /* @__PURE__ */ jsx8("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", className: "w100n-docs-card", "aria-current": item.id === here.documentId, onClick: () => open(item), title: item.name, children: [
3291
- /* @__PURE__ */ jsx8(Thumb, { host, item, label: t.kinds[item.kind] }),
3292
- /* @__PURE__ */ jsxs8("span", { className: "w100n-docs-card-text", children: [
3293
- /* @__PURE__ */ jsx8("b", { children: item.name }),
3294
- /* @__PURE__ */ jsx8("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") })
3498
+ list.loading && !list.data && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.loading }),
3499
+ list.data && !shown.length && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
3500
+ folders.map((folder2) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
3501
+ folders.length > 1 && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
3502
+ /* @__PURE__ */ jsx9("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-card", "aria-current": item.id === here.documentId, onClick: () => open(item), title: item.name, children: [
3503
+ /* @__PURE__ */ jsx9(Thumb, { host, item, label: t.kinds[item.kind] }),
3504
+ /* @__PURE__ */ jsxs9("span", { className: "w100n-docs-card-text", children: [
3505
+ /* @__PURE__ */ jsx9("b", { children: item.name }),
3506
+ /* @__PURE__ */ jsx9("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") })
3295
3507
  ] })
3296
3508
  ] }, item.id)) })
3297
3509
  ] }, folder2))
3298
3510
  ] })
3299
3511
  ] }),
3300
3512
  !narrow && !listOpen && listToggle,
3301
- /* @__PURE__ */ jsxs8("main", { className: "w100n-docs-stage", children: [
3513
+ /* @__PURE__ */ jsxs9("main", { className: "w100n-docs-stage", children: [
3302
3514
  !narrow && !panelOpen && panelToggle,
3303
- /* @__PURE__ */ jsx8("div", { className: "w100n-docs-bare", children: stage })
3515
+ /* @__PURE__ */ jsx9("div", { className: "w100n-docs-bare", children: stage })
3304
3516
  ] }),
3305
- doc.data && panelOpen && /* @__PURE__ */ jsxs8("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
3306
- /* @__PURE__ */ jsx8("div", { className: "w100n-docs-head", children: /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-row", children: [
3307
- /* @__PURE__ */ jsx8("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__ */ jsxs8("button", { type: "button", role: "tab", "aria-selected": tab === key, tabIndex: tab === key ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key), children: [
3308
- /* @__PURE__ */ jsx8(Icon, { "aria-hidden": true }),
3517
+ doc.data && panelOpen && /* @__PURE__ */ jsxs9("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
3518
+ /* @__PURE__ */ jsx9("div", { className: "w100n-docs-head", children: /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-row", children: [
3519
+ /* @__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: [
3520
+ /* @__PURE__ */ jsx9(Icon, { "aria-hidden": true }),
3309
3521
  (panelTabs.length < 4 || tab === key) && label
3310
3522
  ] }, key)) }),
3311
- /* @__PURE__ */ jsx8("button", { type: "button", className: "w100n-docs-close", onClick: () => side("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ jsx8(X5, { "aria-hidden": true }) })
3523
+ /* @__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 }) })
3312
3524
  ] }) }),
3313
- /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key]) => key === tab)?.[2], children: [
3314
- tab === "outline" && (outline.length ? /* @__PURE__ */ jsx8("nav", { className: "w100n-docs-outline", children: outline.map((item) => /* @__PURE__ */ jsx8("button", { type: "button", "data-level": item.level, onClick: () => item.go ? item.go() : document.getElementById(item.id)?.scrollIntoView({ behavior: "smooth", block: "start" }), children: item.text }, item.id)) }) : /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", children: t.noOutline })),
3315
- tab === "versions" && /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-versions", children: [
3525
+ /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key]) => key === tab)?.[2], children: [
3526
+ tab === "outline" && (outline.length ? /* @__PURE__ */ jsx9("nav", { className: "w100n-docs-outline", children: outline.map((item) => /* @__PURE__ */ jsx9("button", { type: "button", "data-level": item.level, onClick: () => item.go ? item.go() : document.getElementById(item.id)?.scrollIntoView({ behavior: "smooth", block: "start" }), children: item.text }, item.id)) }) : /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.noOutline })),
3527
+ tab === "versions" && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-versions", children: [
3316
3528
  versions.error && failed(versions.retry),
3317
- (versions.data ?? []).map((item) => /* @__PURE__ */ jsxs8(
3529
+ (versions.data ?? []).map((item) => /* @__PURE__ */ jsxs9(
3318
3530
  "button",
3319
3531
  {
3320
3532
  type: "button",
3321
3533
  "aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
3322
3534
  onClick: () => view(item.current ? null : item.id),
3323
3535
  children: [
3324
- /* @__PURE__ */ jsxs8("b", { children: [
3536
+ /* @__PURE__ */ jsxs9("b", { children: [
3325
3537
  date(item.createdAt),
3326
- item.current && /* @__PURE__ */ jsx8("span", { className: "w100n-docs-badge", children: t.current })
3538
+ item.current && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", children: t.current })
3327
3539
  ] }),
3328
- /* @__PURE__ */ jsx8("small", { children: [item.author?.name, size(item.size), item.note].filter(Boolean).join(" \xB7 ") })
3540
+ /* @__PURE__ */ jsx9("small", { children: [item.author?.name, size(item.size), item.note].filter(Boolean).join(" \xB7 ") })
3329
3541
  ]
3330
3542
  },
3331
3543
  item.id
3332
3544
  ))
3333
3545
  ] }),
3334
- tab === "details" && /* @__PURE__ */ jsxs8("dl", { className: "w100n-docs-details", children: [
3335
- /* @__PURE__ */ jsx8("dt", { children: t.kind }),
3336
- /* @__PURE__ */ jsx8("dd", { children: t.kinds[doc.data.kind] }),
3337
- /* @__PURE__ */ jsx8("dt", { children: t.size }),
3338
- /* @__PURE__ */ jsx8("dd", { children: size(doc.data.size) }),
3339
- /* @__PURE__ */ jsx8("dt", { children: t.updated }),
3340
- /* @__PURE__ */ jsx8("dd", { children: date(doc.data.updatedAt) }),
3341
- doc.data.updatedBy && /* @__PURE__ */ jsxs8(Fragment7, { children: [
3342
- /* @__PURE__ */ jsx8("dt", { children: t.by }),
3343
- /* @__PURE__ */ jsx8("dd", { children: doc.data.updatedBy.name })
3546
+ tab === "details" && /* @__PURE__ */ jsxs9("dl", { className: "w100n-docs-details", children: [
3547
+ /* @__PURE__ */ jsx9("dt", { children: t.kind }),
3548
+ /* @__PURE__ */ jsx9("dd", { children: t.kinds[doc.data.kind] }),
3549
+ /* @__PURE__ */ jsx9("dt", { children: t.size }),
3550
+ /* @__PURE__ */ jsx9("dd", { children: size(doc.data.size) }),
3551
+ /* @__PURE__ */ jsx9("dt", { children: t.updated }),
3552
+ /* @__PURE__ */ jsx9("dd", { children: date(doc.data.updatedAt) }),
3553
+ doc.data.updatedBy && /* @__PURE__ */ jsxs9(Fragment8, { children: [
3554
+ /* @__PURE__ */ jsx9("dt", { children: t.by }),
3555
+ /* @__PURE__ */ jsx9("dd", { children: doc.data.updatedBy.name })
3344
3556
  ] }),
3345
- /* @__PURE__ */ jsx8("dt", { children: t.rights }),
3346
- /* @__PURE__ */ jsx8("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
3557
+ /* @__PURE__ */ jsx9("dt", { children: t.rights }),
3558
+ /* @__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(", ") })
3347
3559
  ] }),
3348
- tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-about", children: [
3349
- /* @__PURE__ */ jsxs8("p", { className: "w100n-docs-caption", children: [
3350
- /* @__PURE__ */ jsx8(FileDown, { "aria-hidden": true }),
3560
+ tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-about", children: [
3561
+ /* @__PURE__ */ jsxs9("p", { className: "w100n-docs-caption", children: [
3562
+ /* @__PURE__ */ jsx9(FileDown, { "aria-hidden": true }),
3351
3563
  t.exportAs
3352
3564
  ] }),
3353
- /* @__PURE__ */ jsx8("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ jsxs8(
3565
+ /* @__PURE__ */ jsx9("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ jsxs9(
3354
3566
  "button",
3355
3567
  {
3356
3568
  type: "button",
@@ -3358,22 +3570,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3358
3570
  disabled: exporting === "busy",
3359
3571
  onClick: () => void exportAs(doc.data, format),
3360
3572
  children: [
3361
- /* @__PURE__ */ jsx8(FileDown, { "aria-hidden": true }),
3573
+ /* @__PURE__ */ jsx9(FileDown, { "aria-hidden": true }),
3362
3574
  format.toUpperCase()
3363
3575
  ]
3364
3576
  },
3365
3577
  format
3366
3578
  )) }),
3367
- exporting === "failed" && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", children: t.exportFailed })
3579
+ exporting === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.exportFailed })
3368
3580
  ] }),
3369
- tab === "comments" && /* @__PURE__ */ jsx8("div", { ref: setBox }),
3370
- tab === "sharing" && sharing && /* @__PURE__ */ jsx8(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
3371
- tab === "signatures" && /* @__PURE__ */ jsxs8("div", { className: "w100n-docs-versions", children: [
3581
+ tab === "comments" && /* @__PURE__ */ jsx9("div", { ref: setBox }),
3582
+ tab === "sharing" && sharing && /* @__PURE__ */ jsx9(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
3583
+ tab === "signatures" && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-versions", children: [
3372
3584
  signatures.error && failed(signatures.retry),
3373
- signatures.data?.length === 0 && /* @__PURE__ */ jsx8("p", { className: "w100n-docs-muted", children: t.noSignatures }),
3585
+ signatures.data?.length === 0 && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.noSignatures }),
3374
3586
  (signatures.data ?? []).map((entry) => {
3375
3587
  const signed = versions.data?.find((v) => v.id === entry.versionId);
3376
- return /* @__PURE__ */ jsxs8(
3588
+ return /* @__PURE__ */ jsxs9(
3377
3589
  "button",
3378
3590
  {
3379
3591
  type: "button",
@@ -3381,15 +3593,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3381
3593
  "aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
3382
3594
  onClick: () => view(signed.current ? null : signed.id),
3383
3595
  children: [
3384
- /* @__PURE__ */ jsxs8("b", { children: [
3596
+ /* @__PURE__ */ jsxs9("b", { children: [
3385
3597
  entry.signer.name,
3386
- /* @__PURE__ */ jsxs8("span", { className: "w100n-docs-badge", children: [
3598
+ /* @__PURE__ */ jsxs9("span", { className: "w100n-docs-badge", children: [
3387
3599
  t.page,
3388
3600
  " ",
3389
3601
  entry.page
3390
3602
  ] })
3391
3603
  ] }),
3392
- /* @__PURE__ */ jsx8("small", { children: [date(entry.signedAt), t.methods[entry.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
3604
+ /* @__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 ") })
3393
3605
  ]
3394
3606
  },
3395
3607
  entry.id
@@ -3400,17 +3612,23 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3400
3612
  ] })
3401
3613
  ] })
3402
3614
  ] }),
3615
+ making && /* @__PURE__ */ jsx9(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made) => {
3616
+ setMaking(false);
3617
+ spaces.retry();
3618
+ list.retry();
3619
+ ask(() => go({ spaceId: here.spaceId && made.spaceId, documentId: made.id }));
3620
+ } }),
3403
3621
  dialog
3404
3622
  ] });
3405
3623
  }
3406
3624
 
3407
3625
  // src/GuestDocument.tsx
3408
- import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState9 } from "react";
3409
- import { Ban as Ban2, Download as Download3, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet3, FileText as FileText3, FileType as FileType3, Files as Files3, Lock as Lock2, Presentation as Presentation3, UserRound } from "lucide-react";
3410
- import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3411
- var TextEditor3 = lazy3(() => import("./TextEditor-SPEVB5HX.js"));
3412
- var SheetView3 = lazy3(() => import("./SheetView-G3YWPH5V.js"));
3413
- var icons3 = { docx: FileText3, markdown: FileType3, pdf: Files3, sheet: FileSpreadsheet3, slides: Presentation3 };
3626
+ import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState10 } from "react";
3627
+ import { Ban as Ban2, Download as Download3, 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";
3628
+ import { Fragment as Fragment9, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
3629
+ var TextEditor3 = lazy3(() => import("./TextEditor-OLBLWC6F.js"));
3630
+ var SheetView3 = lazy3(() => import("./SheetView-3UAFXGZS.js"));
3631
+ var icons4 = { docx: FileText4, markdown: FileType4, pdf: Files3, sheet: FileSpreadsheet4, slides: Presentation4 };
3414
3632
  var GuestRefused = class extends Error {
3415
3633
  constructor(reason, file = "", sharedBy = "") {
3416
3634
  super(reason);
@@ -3435,14 +3653,14 @@ var remember = (name) => {
3435
3653
  };
3436
3654
  function GuestDocument({ host, language = "en", theme = "light", brand }) {
3437
3655
  const t = texts[language];
3438
- const [ask, setAsk] = useState9(() => ({ name: remembered() || void 0 }));
3439
- const [typed, setTyped] = useState9("");
3440
- const [name, setName] = useState9(remembered);
3656
+ const [ask, setAsk] = useState10(() => ({ name: remembered() || void 0 }));
3657
+ const [typed, setTyped] = useState10("");
3658
+ const [name, setName] = useState10(remembered);
3441
3659
  const named = useRef7(name);
3442
- const [slot, setSlot] = useState9(null);
3443
- const [saving, setSaving] = useState9("idle");
3660
+ const [slot, setSlot] = useState10(null);
3661
+ const [saving, setSaving] = useState10("idle");
3444
3662
  const opened = useLoad((signal) => host.open(ask, { signal }), [host, ask]);
3445
- const [notes] = useState9(() => ({
3663
+ const [notes] = useState10(() => ({
3446
3664
  me: { id: "", name: "" },
3447
3665
  spaces: async () => [],
3448
3666
  documents: async () => [],
@@ -3468,18 +3686,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3468
3686
  };
3469
3687
  const top = (file2, badge) => {
3470
3688
  const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
3471
- const Kind = kind2 ? icons3[kind2] : FileText3;
3472
- return /* @__PURE__ */ jsxs9("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
3473
- brand && /* @__PURE__ */ jsx9("span", { className: "w100n-guest-brand", children: brand }),
3474
- file2 && /* @__PURE__ */ jsxs9(Fragment8, { children: [
3475
- /* @__PURE__ */ jsx9("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ jsx9(Kind, { "aria-hidden": true }) }),
3476
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-heading", children: [
3477
- /* @__PURE__ */ jsx9("strong", { className: "w100n-docs-title", children: file2.name }),
3478
- file2.sharedBy && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
3689
+ const Kind = kind2 ? icons4[kind2] : FileText4;
3690
+ return /* @__PURE__ */ jsxs10("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
3691
+ brand && /* @__PURE__ */ jsx10("span", { className: "w100n-guest-brand", children: brand }),
3692
+ file2 && /* @__PURE__ */ jsxs10(Fragment9, { children: [
3693
+ /* @__PURE__ */ jsx10("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ jsx10(Kind, { "aria-hidden": true }) }),
3694
+ /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-heading", children: [
3695
+ /* @__PURE__ */ jsx10("strong", { className: "w100n-docs-title", children: file2.name }),
3696
+ file2.sharedBy && /* @__PURE__ */ jsx10("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
3479
3697
  ] }),
3480
- badge && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
3481
- file2.download && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-end", children: [
3482
- (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ jsxs9(
3698
+ badge && /* @__PURE__ */ jsx10("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
3699
+ file2.download && /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-end", children: [
3700
+ (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ jsxs10(
3483
3701
  "button",
3484
3702
  {
3485
3703
  type: "button",
@@ -3490,25 +3708,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3490
3708
  "aria-label": t.pdfCopy,
3491
3709
  title: t.pdfCopy,
3492
3710
  children: [
3493
- /* @__PURE__ */ jsx9(FileDown2, { "aria-hidden": true }),
3494
- /* @__PURE__ */ jsx9("span", { children: t.pdfCopy })
3711
+ /* @__PURE__ */ jsx10(FileDown2, { "aria-hidden": true }),
3712
+ /* @__PURE__ */ jsx10("span", { children: t.pdfCopy })
3495
3713
  ]
3496
3714
  }
3497
3715
  ),
3498
- /* @__PURE__ */ jsxs9("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: [
3499
- /* @__PURE__ */ jsx9(Download3, { "aria-hidden": true }),
3500
- /* @__PURE__ */ jsx9("span", { children: t.download })
3716
+ /* @__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: [
3717
+ /* @__PURE__ */ jsx10(Download3, { "aria-hidden": true }),
3718
+ /* @__PURE__ */ jsx10("span", { children: t.download })
3501
3719
  ] })
3502
3720
  ] })
3503
3721
  ] })
3504
3722
  ] });
3505
3723
  };
3506
- const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3724
+ const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3507
3725
  top(null, null),
3508
- /* @__PURE__ */ jsx9("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ jsxs9("div", { className: "w100n-guest-card", children: [
3509
- /* @__PURE__ */ jsx9("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ jsx9(Icon, { "aria-hidden": true }) }),
3510
- /* @__PURE__ */ jsx9("h2", { children: title }),
3511
- /* @__PURE__ */ jsx9("p", { children: body }),
3726
+ /* @__PURE__ */ jsx10("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ jsxs10("div", { className: "w100n-guest-card", children: [
3727
+ /* @__PURE__ */ jsx10("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ jsx10(Icon, { "aria-hidden": true }) }),
3728
+ /* @__PURE__ */ jsx10("h2", { children: title }),
3729
+ /* @__PURE__ */ jsx10("p", { children: body }),
3512
3730
  form
3513
3731
  ] }) })
3514
3732
  ] });
@@ -3524,7 +3742,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3524
3742
  password ? Lock2 : UserRound,
3525
3743
  refused.file || t.documents,
3526
3744
  shared + (password ? t.passwordAsk : t.nameAsk),
3527
- /* @__PURE__ */ jsxs9("form", { className: "w100n-guest-form", onSubmit: (e) => {
3745
+ /* @__PURE__ */ jsxs10("form", { className: "w100n-guest-form", onSubmit: (e) => {
3528
3746
  e.preventDefault();
3529
3747
  if (!typed.trim()) return;
3530
3748
  if (password) setAsk({ ...ask, password: typed });
@@ -3534,7 +3752,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3534
3752
  }
3535
3753
  setTyped("");
3536
3754
  }, children: [
3537
- /* @__PURE__ */ jsx9(
3755
+ /* @__PURE__ */ jsx10(
3538
3756
  "input",
3539
3757
  {
3540
3758
  className: "w100n-share-input",
@@ -3547,21 +3765,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3547
3765
  onChange: (e) => setTyped(e.target.value)
3548
3766
  }
3549
3767
  ),
3550
- refused.reason === "wrong" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
3551
- /* @__PURE__ */ jsxs9("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
3552
- /* @__PURE__ */ jsx9(Eye2, { "aria-hidden": true }),
3768
+ refused.reason === "wrong" && /* @__PURE__ */ jsx10("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
3769
+ /* @__PURE__ */ jsxs10("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
3770
+ /* @__PURE__ */ jsx10(Eye2, { "aria-hidden": true }),
3553
3771
  t.openDoc
3554
3772
  ] })
3555
3773
  ] })
3556
3774
  );
3557
3775
  }
3558
3776
  if (refused?.reason === "busy") return gate("slate", Ban2, t.failed, t.tooMany);
3559
- return gate("slate", Ban2, t.failed, "", /* @__PURE__ */ jsx9("button", { type: "button", className: "w100n-docs-action", onClick: opened.retry, children: t.retry }));
3777
+ return gate("slate", Ban2, t.failed, "", /* @__PURE__ */ jsx10("button", { type: "button", className: "w100n-docs-action", onClick: opened.retry, children: t.retry }));
3560
3778
  }
3561
3779
  const file = opened.data;
3562
- if (!file) return /* @__PURE__ */ jsxs9("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3780
+ if (!file) return /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3563
3781
  top(null, null),
3564
- /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading })
3782
+ /* @__PURE__ */ jsx10("div", { className: "w100n-docs-empty", children: t.loading })
3565
3783
  ] });
3566
3784
  const kind = kindOf(file.name, file.mimeType);
3567
3785
  const text = kind === "docx" || kind === "markdown";
@@ -3569,23 +3787,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
3569
3787
  const rights = { view: true, comment: talk, edit: false };
3570
3788
  const quiet2 = () => {
3571
3789
  };
3572
- let stage = /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.unsupported });
3573
- if (text) stage = /* @__PURE__ */ jsx9(Suspense3, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(TextEditor3, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes : void 0, documentId: file.id, onOutline: quiet2, slot: talk ? slot : null }) });
3574
- else if (kind === "pdf") stage = /* @__PURE__ */ jsx9(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet2 });
3575
- else if (kind === "slides") stage = /* @__PURE__ */ jsx9(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet2 });
3576
- else if (kind === "sheet") stage = /* @__PURE__ */ jsx9(Suspense3, { fallback: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx9(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 }) });
3577
- return /* @__PURE__ */ jsxs9("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3790
+ let stage = /* @__PURE__ */ jsx10("div", { className: "w100n-docs-empty", children: t.unsupported });
3791
+ if (text) stage = /* @__PURE__ */ jsx10(Suspense3, { fallback: /* @__PURE__ */ jsx10("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx10(TextEditor3, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes : void 0, documentId: file.id, onOutline: quiet2, slot: talk ? slot : null }) });
3792
+ else if (kind === "pdf") stage = /* @__PURE__ */ jsx10(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet2 });
3793
+ else if (kind === "slides") stage = /* @__PURE__ */ jsx10(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet2 });
3794
+ else if (kind === "sheet") stage = /* @__PURE__ */ jsx10(Suspense3, { fallback: /* @__PURE__ */ jsx10("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx10(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 }) });
3795
+ return /* @__PURE__ */ jsxs10("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
3578
3796
  top(file, talk ? t.badgeComment : t.badgeRead),
3579
- saving === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
3580
- /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-body w100n-guest-body", children: [
3581
- /* @__PURE__ */ jsx9("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ jsx9("div", { className: "w100n-docs-bare", children: stage }) }),
3582
- talk && /* @__PURE__ */ jsx9("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-panel-body", children: [
3583
- /* @__PURE__ */ jsxs9("label", { className: "w100n-share-field", children: [
3584
- /* @__PURE__ */ jsx9("span", { children: t.yourName }),
3585
- /* @__PURE__ */ jsx9("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
3797
+ saving === "failed" && /* @__PURE__ */ jsx10("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
3798
+ /* @__PURE__ */ jsxs10("div", { className: "w100n-docs-body w100n-guest-body", children: [
3799
+ /* @__PURE__ */ jsx10("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ jsx10("div", { className: "w100n-docs-bare", children: stage }) }),
3800
+ talk && /* @__PURE__ */ jsx10("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: [
3801
+ /* @__PURE__ */ jsxs10("label", { className: "w100n-share-field", children: [
3802
+ /* @__PURE__ */ jsx10("span", { children: t.yourName }),
3803
+ /* @__PURE__ */ jsx10("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
3586
3804
  ] }),
3587
- /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
3588
- /* @__PURE__ */ jsx9("div", { ref: setSlot })
3805
+ /* @__PURE__ */ jsx10("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
3806
+ /* @__PURE__ */ jsx10("div", { ref: setSlot })
3589
3807
  ] }) })
3590
3808
  ] })
3591
3809
  ] });