efficient-shell 4.137.0 → 4.145.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 (176) hide show
  1. package/LICENSE +6 -17
  2. package/README.md +80 -12
  3. package/dist/Browser-24YNRTKT.js +43 -0
  4. package/dist/Calculator-LER6KUQC.js +29 -0
  5. package/dist/ConfirmDialog-GAYETRMG.js +1 -0
  6. package/dist/CurrencyConverter-Y35GFDFF.js +21 -0
  7. package/dist/Documents-7FYX2CGT.js +52 -0
  8. package/dist/Files-RZOML2N6.js +89 -0
  9. package/dist/Notepad-VVDCBDUA.js +25 -0
  10. package/dist/PdfViewer-CvLb2j_l.d.ts +40 -0
  11. package/dist/PdfViewer-ZCT3PYXU.js +1 -0
  12. package/dist/PomodoroTimer-VAM3AJOX.js +99 -0
  13. package/dist/Preview-HZ37D7QJ.js +187 -0
  14. package/dist/Sidebar-CVF7C6BO.js +23 -0
  15. package/dist/Spreadsheet-6WX3P6AB.js +37 -0
  16. package/dist/Stock-AUWI3TUX.js +16 -0
  17. package/dist/Weather-HU75TH7T.js +60 -0
  18. package/dist/WorldClock-T64MDRMJ.js +32 -0
  19. package/dist/apps/index.d.ts +3 -23
  20. package/dist/apps/index.js +1 -151
  21. package/dist/brand.css +1 -1
  22. package/dist/chunk-2RHMSFZV.js +9 -0
  23. package/dist/chunk-4FS742BM.js +1 -0
  24. package/dist/chunk-57MIENLJ.js +1 -0
  25. package/dist/chunk-7DAQ3WVP.js +106 -0
  26. package/dist/chunk-BR22X7E5.js +1 -0
  27. package/dist/chunk-BUTSU7FO.js +1 -0
  28. package/dist/chunk-CVTOZCM3.js +24 -0
  29. package/dist/chunk-D65T4H6J.js +1 -0
  30. package/dist/chunk-ESL5TDNA.js +1 -0
  31. package/dist/chunk-FBDZGO3V.js +1 -0
  32. package/dist/chunk-FHTLC7HH.js +1 -0
  33. package/dist/chunk-GDSGXDET.js +34 -0
  34. package/dist/chunk-I55UMU3R.js +6 -0
  35. package/dist/chunk-KKOHUQPF.js +1 -0
  36. package/dist/chunk-L7TEFXIS.js +69 -0
  37. package/dist/chunk-LVDRBRYU.js +1 -0
  38. package/dist/chunk-LVFMK5OQ.js +29 -0
  39. package/dist/chunk-LWLCNQY7.js +1 -0
  40. package/dist/chunk-MAIHBBWT.js +1 -0
  41. package/dist/chunk-MU5H2CDL.js +2 -0
  42. package/dist/chunk-NBBOFQPL.js +947 -0
  43. package/dist/chunk-NPJH5MD7.js +13 -0
  44. package/dist/chunk-OCSOMMY2.js +1 -0
  45. package/dist/chunk-PH3PRIFP.js +5 -0
  46. package/dist/chunk-RJ4LACFH.js +9 -0
  47. package/dist/chunk-SLCR26NK.js +4 -0
  48. package/dist/chunk-TFKB2WEB.js +19 -0
  49. package/dist/chunk-TR6PLN7W.js +1 -0
  50. package/dist/chunk-TWV42Q3K.js +1 -0
  51. package/dist/chunk-UB22J6EF.js +1 -0
  52. package/dist/chunk-UB4JIOLD.js +2 -0
  53. package/dist/chunk-V453E4KU.js +11 -0
  54. package/dist/chunk-VTVSMRFX.js +1 -0
  55. package/dist/file-intake/index.js +1 -4
  56. package/dist/{index-DVI9DMSu.d.ts → index-NhR7frRu.d.ts} +189 -17
  57. package/dist/index.d.ts +2 -2
  58. package/dist/index.js +639 -7473
  59. package/dist/map/index.d.ts +266 -13
  60. package/dist/map/index.js +22 -540
  61. package/dist/markdown/index.js +6 -184
  62. package/dist/markup/index.js +1 -135
  63. package/dist/page-tabs/index.js +21 -709
  64. package/dist/pdf/index.d.ts +9 -0
  65. package/dist/pdf/index.js +2 -0
  66. package/dist/sounds-OMHXVVQ4.js +1 -0
  67. package/dist/ui/index.d.ts +1 -1
  68. package/dist/ui/index.js +1 -19
  69. package/dist/ui.css +7 -0
  70. package/package.json +9 -3
  71. package/dist/Browser-ZNX4WFUH.js +0 -482
  72. package/dist/Browser-ZNX4WFUH.js.map +0 -1
  73. package/dist/Calculator-6FGNKOXU.js +0 -192
  74. package/dist/Calculator-6FGNKOXU.js.map +0 -1
  75. package/dist/ConfirmDialog-NPQMIGUR.js +0 -4
  76. package/dist/ConfirmDialog-NPQMIGUR.js.map +0 -1
  77. package/dist/CurrencyConverter-FF7EXRYL.js +0 -236
  78. package/dist/CurrencyConverter-FF7EXRYL.js.map +0 -1
  79. package/dist/Documents-H3R7XSBH.js +0 -441
  80. package/dist/Documents-H3R7XSBH.js.map +0 -1
  81. package/dist/Files-ZHJIAUC2.js +0 -805
  82. package/dist/Files-ZHJIAUC2.js.map +0 -1
  83. package/dist/Notepad-VE7ISWRQ.js +0 -410
  84. package/dist/Notepad-VE7ISWRQ.js.map +0 -1
  85. package/dist/PdfViewer-SQBFYAGW.js +0 -5
  86. package/dist/PdfViewer-SQBFYAGW.js.map +0 -1
  87. package/dist/PomodoroTimer-IR3WREED.js +0 -633
  88. package/dist/PomodoroTimer-IR3WREED.js.map +0 -1
  89. package/dist/Preview-DAQGRNRM.js +0 -2959
  90. package/dist/Preview-DAQGRNRM.js.map +0 -1
  91. package/dist/Sidebar-YW6H4NDJ.js +0 -291
  92. package/dist/Sidebar-YW6H4NDJ.js.map +0 -1
  93. package/dist/Spreadsheet-HOCPHJOC.js +0 -519
  94. package/dist/Spreadsheet-HOCPHJOC.js.map +0 -1
  95. package/dist/Stock-LVRQPURG.js +0 -158
  96. package/dist/Stock-LVRQPURG.js.map +0 -1
  97. package/dist/Weather-LZQGVDJL.js +0 -431
  98. package/dist/Weather-LZQGVDJL.js.map +0 -1
  99. package/dist/WorldClock-XPD7WOZT.js +0 -202
  100. package/dist/WorldClock-XPD7WOZT.js.map +0 -1
  101. package/dist/apps/index.js.map +0 -1
  102. package/dist/chunk-5O42JXQE.js +0 -26
  103. package/dist/chunk-5O42JXQE.js.map +0 -1
  104. package/dist/chunk-5RPTS3BT.js +0 -70
  105. package/dist/chunk-5RPTS3BT.js.map +0 -1
  106. package/dist/chunk-6XJEJWNJ.js +0 -61
  107. package/dist/chunk-6XJEJWNJ.js.map +0 -1
  108. package/dist/chunk-7CCHEEYC.js +0 -94
  109. package/dist/chunk-7CCHEEYC.js.map +0 -1
  110. package/dist/chunk-BE7FZOFU.js +0 -17
  111. package/dist/chunk-BE7FZOFU.js.map +0 -1
  112. package/dist/chunk-COWYSHG2.js +0 -79
  113. package/dist/chunk-COWYSHG2.js.map +0 -1
  114. package/dist/chunk-D7PYW2QS.js +0 -265
  115. package/dist/chunk-D7PYW2QS.js.map +0 -1
  116. package/dist/chunk-DVZWYWSD.js +0 -26
  117. package/dist/chunk-DVZWYWSD.js.map +0 -1
  118. package/dist/chunk-E7TB6WD2.js +0 -153
  119. package/dist/chunk-E7TB6WD2.js.map +0 -1
  120. package/dist/chunk-FIHOGVUP.js +0 -416
  121. package/dist/chunk-FIHOGVUP.js.map +0 -1
  122. package/dist/chunk-GA35NEND.js +0 -56
  123. package/dist/chunk-GA35NEND.js.map +0 -1
  124. package/dist/chunk-HUBJAUGG.js +0 -316
  125. package/dist/chunk-HUBJAUGG.js.map +0 -1
  126. package/dist/chunk-I2TAAJHS.js +0 -465
  127. package/dist/chunk-I2TAAJHS.js.map +0 -1
  128. package/dist/chunk-ICTRCKUE.js +0 -3710
  129. package/dist/chunk-ICTRCKUE.js.map +0 -1
  130. package/dist/chunk-IPXN646P.js +0 -14
  131. package/dist/chunk-IPXN646P.js.map +0 -1
  132. package/dist/chunk-IRWSRJ4K.js +0 -48
  133. package/dist/chunk-IRWSRJ4K.js.map +0 -1
  134. package/dist/chunk-JOPU6WPY.js +0 -504
  135. package/dist/chunk-JOPU6WPY.js.map +0 -1
  136. package/dist/chunk-MGGY74RY.js +0 -14
  137. package/dist/chunk-MGGY74RY.js.map +0 -1
  138. package/dist/chunk-PVPPAWVM.js +0 -46
  139. package/dist/chunk-PVPPAWVM.js.map +0 -1
  140. package/dist/chunk-R7QGMK6N.js +0 -102
  141. package/dist/chunk-R7QGMK6N.js.map +0 -1
  142. package/dist/chunk-RT6DSB5Y.js +0 -143
  143. package/dist/chunk-RT6DSB5Y.js.map +0 -1
  144. package/dist/chunk-TRCWINHF.js +0 -105
  145. package/dist/chunk-TRCWINHF.js.map +0 -1
  146. package/dist/chunk-TW7LPMVR.js +0 -16
  147. package/dist/chunk-TW7LPMVR.js.map +0 -1
  148. package/dist/chunk-UTYKLGGT.js +0 -195
  149. package/dist/chunk-UTYKLGGT.js.map +0 -1
  150. package/dist/chunk-VNJJCH5A.js +0 -822
  151. package/dist/chunk-VNJJCH5A.js.map +0 -1
  152. package/dist/chunk-XJHZWSKV.js +0 -1103
  153. package/dist/chunk-XJHZWSKV.js.map +0 -1
  154. package/dist/chunk-Y3GYJ7YR.js +0 -549
  155. package/dist/chunk-Y3GYJ7YR.js.map +0 -1
  156. package/dist/chunk-YA4EE7ST.js +0 -14107
  157. package/dist/chunk-YA4EE7ST.js.map +0 -1
  158. package/dist/chunk-YDHXWCCJ.js +0 -145
  159. package/dist/chunk-YDHXWCCJ.js.map +0 -1
  160. package/dist/chunk-YE6GUDGP.js +0 -548
  161. package/dist/chunk-YE6GUDGP.js.map +0 -1
  162. package/dist/chunk-YNKK7NE3.js +0 -171
  163. package/dist/chunk-YNKK7NE3.js.map +0 -1
  164. package/dist/chunk-YPO6RDMX.js +0 -20
  165. package/dist/chunk-YPO6RDMX.js.map +0 -1
  166. package/dist/chunk-ZS7PMGUW.js +0 -7
  167. package/dist/chunk-ZS7PMGUW.js.map +0 -1
  168. package/dist/file-intake/index.js.map +0 -1
  169. package/dist/index.js.map +0 -1
  170. package/dist/map/index.js.map +0 -1
  171. package/dist/markdown/index.js.map +0 -1
  172. package/dist/markup/index.js.map +0 -1
  173. package/dist/page-tabs/index.js.map +0 -1
  174. package/dist/sounds-NT4DEZGD.js +0 -3
  175. package/dist/sounds-NT4DEZGD.js.map +0 -1
  176. package/dist/ui/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/apps/_wasmBytes.ts","../src/apps/_panelActions.tsx","../src/apps/PdfViewer.tsx"],"names":["jsx"],"mappings":";;;;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AA,KAAK,CAAA,CAAE,aAAA,CAAc,SAAA,CAAU,IAAI,WAAW;AAAA;AAAA;AAC/D,WAAA,EACF;AAAA,SAAA,EACF;AAAA;AAAA;AAEJ,GAAA,EACF,CAAA;AAEJ","file":"chunk-FIHOGVUP.js","sourcesContent":["/**\n * Is what came back over the wire actually a WebAssembly module?\n *\n * `Preview`'s wasm factory used to accept any `res.ok` response. That is not\n * enough on a single-page app: an SPA host answers a path its router does not\n * recognise with its own index.html under HTTP 200, so a build that failed to\n * emit a decoder returns a PAGE rather than a 404 (confirmed against the live\n * console on 2026-08-30 — both `/assets/jbig2.wasm` and a made-up asset path\n * answered 200 with `content-type: text/html`). pdf.js then instantiates the\n * page inside a `try` that only warns before dropping to its JS fallback, which\n * is the same quiet degrading the factory was added to remove — except now\n * nothing in the console points at the emit as the cause.\n *\n * This module is deliberately free of React and of pdfjs-dist so it can be\n * driven directly from a spec. Importing `Preview.tsx` in a Node test is not\n * possible: pdfjs builds a `new DOMMatrix()` at module scope and throws.\n */\n\n/** Every WebAssembly module opens with the four bytes `\\0asm`. Anything else —\n * an HTML fallback page, most often — is not one. */\nexport function hasWasmPreamble(bytes: Uint8Array): boolean {\n return (\n bytes.length >= 4 &&\n bytes[0] === 0x00 &&\n bytes[1] === 0x61 &&\n bytes[2] === 0x73 &&\n bytes[3] === 0x6d\n );\n}\n\n/** A short, safe description of what arrived instead, for the error message.\n * The opening bytes of an HTML page name the problem far better than a length\n * does, so they are worth quoting; the cap keeps a stray binary out of the\n * console. */\nexport function describeNonWasm(bytes: Uint8Array): string {\n if (bytes.length === 0) return 'an empty response';\n const head = Array.from(bytes.subarray(0, 24))\n .map(b => (b >= 0x20 && b < 0x7f ? String.fromCharCode(b) : '.'))\n .join('');\n return `${bytes.length} bytes starting \"${head}\"`;\n}\n\n/** The message a developer reads when the emit went missing. It has to name the\n * emit, because the symptom they are looking at is a preview that renders\n * everything except the scanned page, with a silent console. */\nexport function wasmBytesError(href: string, filename: string, bytes: Uint8Array): Error {\n return new Error(\n `The response for ${href} is not a WebAssembly module (got ` +\n `${describeNonWasm(bytes)}). The bundler did not emit \"${filename}\" as ` +\n `an asset, and the host answered with a fallback page instead of a 404. ` +\n `Serve pdfjs-dist/wasm/ yourself and point ` +\n `window.__REACT_OS_SHELL_PDF_WASM__ at it.`,\n );\n}\n","/**\n * Where a format panel's toolbar buttons go.\n *\n * Inside the Preview window there is one toolbar row — Open, the filename,\n * then a slot at its right end — and each panel (PDF, DXF, 3D, image) portals\n * its own page nav / zoom / layer / download buttons into that slot rather\n * than stacking a second row under it. `ToolbarSlotContext` carries the slot\n * element down.\n *\n * Outside Preview there is no slot, and there is no outer toolbar to merge\n * with either: an embedded `PdfViewer` is the whole widget. So the fallback\n * renders the buttons in place as the panel's own toolbar. It used to return\n * `null`, which was right while every panel lived in a window and wrong the\n * moment one did not — an embedded viewer with no page nav and no zoom.\n */\nimport { createContext, useContext } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport const ToolbarSlotContext = createContext<HTMLElement | null>(null);\n\nexport function PanelActions({ children }: { children: React.ReactNode }) {\n const slot = useContext(ToolbarSlotContext);\n if (slot) return createPortal(children, slot);\n return (\n <div className=\"flex shrink-0 items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs\">\n {children}\n </div>\n );\n}\n","/**\n * PdfViewer — the pdf.js reader, on its own so it can be embedded.\n *\n * It was the Preview window's private `PdfPanel` until a consumer needed a PDF\n * inside a dialog rather than in a window of its own. The two consumers that\n * needed one had each reached for `<iframe src={blobUrl}>`, which hands the\n * page to the BROWSER's built-in plugin: its own toolbar, a ~250px thumbnail\n * rail, and its own idea of the zoom — roughly a third of an already small\n * pane spent on chrome nobody asked for, and a portrait page cropped at the\n * fold. Nothing about that is themeable or testable, and it is not this\n * package's viewer.\n *\n * Import it lazily (`efficient-shell/apps` exports it wrapped in `lazy`, like\n * the other document apps) and render it inside a `<Suspense>`: the static\n * `pdfjs-dist` import below must not reach a host's startup bundle. Give it a\n * parent with a resolved height — it fills its container and scrolls inside.\n */\nimport { useState, useEffect, useRef } from 'react';\nimport * as pdfjsLib from 'pdfjs-dist';\nimport toast from '../shell/toast';\nimport { hasWasmPreamble, wasmBytesError } from './_wasmBytes';\nimport { PanelActions } from './_panelActions';\n\n// Default the worker to the matching unpkg build (mirrors the consumer's\n// installed npm version exactly). Consumers can override by setting\n// pdfjsLib.GlobalWorkerOptions.workerSrc themselves before this module loads.\nif (typeof window !== 'undefined' && !pdfjsLib.GlobalWorkerOptions.workerSrc) {\n pdfjsLib.GlobalWorkerOptions.workerSrc =\n `https://unpkg.com/pdfjs-dist@${pdfjsLib.version}/build/pdf.worker.min.mjs`;\n}\n\n// pdf.js does not ship its JBIG2 and JPEG 2000 decoders as JavaScript any\n// more: both are WebAssembly modules it loads at decode time, and it will only\n// load them from a location the caller supplies. With neither `wasmUrl` nor a\n// `BinaryDataFactory` configured — this package's state until now — the\n// decoder asks for one, pdf.js's own base factory throws \"Ensure that the\n// `wasmUrl` API parameter is provided\", and the worker swallows that as a\n// `warn()`. The page still renders; the scanned or JPEG-2000 image on it is\n// just missing. Nothing reaches the user, which is why it went unnoticed.\n//\n// The fix follows the mechanism the admin portal already uses for the pdf\n// WORKER (`import ... from 'pdfjs-dist/build/pdf.worker.min.mjs?url'`, which\n// Vite emits as /assets/pdf.worker.min-<hash>.mjs): let the CONSUMER'S bundler\n// emit the file and hand pdf.js the URL it produced. `new URL(spec,\n// import.meta.url)` is the bundler-neutral spelling of that — Vite resolves\n// the bare specifier and emits the binary as its own hashed asset (verified on\n// Vite 5 and 7), and a bundler that does not understand the form leaves it\n// alone and lands back on today's warn-and-degrade rather than on an error.\n//\n// The specifier points at the CONSUMER'S installed `pdfjs-dist`, not at a copy\n// vendored into this package. That is deliberate: these binaries are built\n// alongside the worker that instantiates them, and a vendored copy would pin\n// them to THIS package's devDependency instead of to the peer they actually\n// run against.\nconst PDF_WASM_MODULES: Record<string, string> = {\n 'jbig2.wasm': new URL('pdfjs-dist/wasm/jbig2.wasm', import.meta.url).href,\n 'openjpeg.wasm': new URL('pdfjs-dist/wasm/openjpeg.wasm', import.meta.url).href,\n};\n\n/** pdf.js instantiates this itself (it is passed to `getDocument` as a class,\n * not an instance) and calls `fetch` once per binary it needs.\n *\n * Only the `wasmUrl` kind is served. cMap and standard-font data are the other\n * two kinds pdf.js can ask for, and this package has never configured a URL\n * for either — so those keep the exact message pdf.js's own base factory\n * raises for an unconfigured URL, and behave as they always have. */\nclass BundledPdfWasmFactory {\n async fetch({ kind, filename }: { kind: string; filename: string }): Promise<Uint8Array> {\n if (kind !== 'wasmUrl') {\n throw new Error(`Ensure that the \\`${kind}\\` API parameter is provided.`);\n }\n const href = PDF_WASM_MODULES[filename];\n if (!href) {\n throw new Error(`No bundled pdf.js wasm module for \"${filename}\".`);\n }\n const res = await fetch(href);\n if (!res.ok) {\n throw new Error(`Unable to load wasm data at: ${href}`);\n }\n // A 200 is not proof the bundler emitted the binary — see _wasmBytes.ts.\n const bytes = new Uint8Array(await res.arrayBuffer());\n if (!hasWasmPreamble(bytes)) {\n throw wasmBytesError(href, filename, bytes);\n }\n return bytes;\n }\n}\n\n/** The `getDocument` parameters that give pdf.js somewhere to load its wasm\n * decoders from.\n *\n * A consumer that serves the whole `pdfjs-dist/wasm/` directory itself (copied\n * into `public/`, say, or on an air-gapped host) points us at it with\n * `window.__REACT_OS_SHELL_PDF_WASM__` — same escape hatch as\n * `__REACT_OS_SHELL_O3DV_LIBS__` below. pdf.js requires a trailing slash on\n * that value and throws \"Invalid factory url\" without one, so add it here\n * rather than making every consumer remember. Everyone else gets the\n * bundler-emitted modules and configures nothing. */\nfunction pdfWasmParams(): { wasmUrl?: string; BinaryDataFactory?: object } {\n const dir = typeof window !== 'undefined'\n ? (window as unknown as { __REACT_OS_SHELL_PDF_WASM__?: unknown }).__REACT_OS_SHELL_PDF_WASM__\n : undefined;\n if (typeof dir === 'string' && dir) {\n return { wasmUrl: dir.endsWith('/') ? dir : `${dir}/` };\n }\n return { BinaryDataFactory: BundledPdfWasmFactory };\n}\n\nexport interface PdfViewerProps {\n /** Object URL or remote URL of the PDF. */\n url: string;\n /** Display name — also the filename the built-in Download uses. */\n filename: string;\n /**\n * What the auto-fit scale tracks until the reader picks a manual zoom.\n *\n * `'width'` fills the container's width and lets a tall page scroll — right\n * for a viewer that owns a whole window, and what the Preview app uses.\n * `'page'` fits the WHOLE page, which is what an embedded preview pane\n * wants: someone checking a document before sending it needs to see that it\n * is the right document, and a page cropped at the fold reads as broken.\n */\n fit?: 'width' | 'page';\n /** Replaces the built-in \"save `url` as `filename`\" download. */\n onDownload?: () => void;\n /** An Email button joins the toolbar only when this is supplied. */\n onEmail?: () => void;\n}\n\nconst ZOOM_PRESETS = [50, 75, 100, 125, 150, 200, 300, 400];\n\n/** The `p-4` gutter the page sits in, on both axes. */\nconst PAGE_GUTTER = 40;\nconst MIN_SCALE = 0.3;\nconst MAX_SCALE = 4;\n\n/**\n * The scale auto-fit lands on.\n *\n * @internal Exported for the spec. The effect that calls it needs a rendered\n * document and a laid-out container to reach, and the wrong answer here does\n * not throw — it crops the page at the fold, which reads as a broken preview\n * rather than as a bug in a formula.\n */\nexport function fitScale(\n fit: 'width' | 'page',\n container: { width: number; height: number },\n page: { width: number; height: number },\n): number {\n const byWidth = (container.width - PAGE_GUTTER) / page.width;\n // Fitting the PAGE means neither axis may overflow, so take whichever\n // constraint binds first. Width alone is what crops a portrait page in a\n // pane wider than it is tall.\n const wanted = fit === 'page'\n ? Math.min(byWidth, (container.height - PAGE_GUTTER) / page.height)\n : byWidth;\n return Math.min(Math.max(wanted, MIN_SCALE), MAX_SCALE);\n}\n\n// Trimmed copy of pdf.js's text-layer rules (pdf_viewer.css), under our own\n// class name so a consumer that loads the full viewer CSS doesn't\n// double-apply. The layer is a sheet of transparent spans positioned over\n// the canvas glyphs — that's what makes the rendered page selectable. Span\n// positions are % of page size; font-size derives from\n// --total-scale-factor, which the render effect sets to the viewport scale.\n// The .endOfContent sentinel plus the .selecting toggle keep a\n// drag-selection alive between lines and past the last line (same trick as\n// pdf.js's own TextLayerBuilder).\nconst TEXT_LAYER_CSS = `\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role=\"img\"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n`;\n\nexport default function PdfViewer({ url, filename, fit = 'width', onDownload, onEmail }: PdfViewerProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const textLayerRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [pdf, setPdf] = useState<pdfjsLib.PDFDocumentProxy | null>(null);\n const [page, setPage] = useState(1);\n const [totalPages, setTotalPages] = useState(0);\n const [scale, setScale] = useState(1);\n // Fit mode is the default — scale stays auto-tracking the container width\n // until the user picks a manual zoom (− / + / dropdown). Re-armed by the\n // Fit toolbar button.\n const [fitMode, setFitMode] = useState(true);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n // A new document starts at its first page. The page number belongs to the\n // document being read, not to the viewer, and it used to survive a change\n // of `url`: sitting on page 3 and being handed a one-page document asked\n // pdf.js for a page that does not exist, and the canvas went blank with\n // nothing thrown. The Preview window never saw it because it keys its\n // panels by url, but an embedder that re-renders one viewer with a new\n // document — a preview pane next to the options that regenerate it — is\n // exactly the shape this component was extracted for.\n //\n // Reset before the fetch, not in its `.then`: the manual page controls are\n // live while a document loads, and a reset that landed afterwards would\n // undo a page the reader had already picked.\n //\n // Zoom is deliberately NOT reset. It is the reader's own preference for\n // how large they want text, and it holds across documents the way it does\n // in every reader; only the page is a fact about the file.\n setPage(1);\n // Parameter-object form, not the bare string: pdfjs-dist 6.x removed the\n // string overload (\"expected either `data`, `range`, or `url` parameter\"),\n // so a consumer on 6.x had every preview die on this line. The object form\n // works on 5.x too. tests/pdfjsContract.test.ts fails if it reverts.\n pdfjsLib.getDocument({ url, ...pdfWasmParams() }).promise.then(doc => {\n if (cancelled) return;\n setPdf(doc);\n setTotalPages(doc.numPages);\n setLoading(false);\n }).catch(() => {\n if (!cancelled) { toast.error('Failed to load PDF'); setLoading(false); }\n });\n return () => { cancelled = true; };\n }, [url]);\n\n // Auto-fit: re-compute scale from the container whenever fit mode is on, the\n // document changes, the page changes, or the container resizes. Window\n // resize and Modal drag-resize both trigger ResizeObserver. Manual zoom\n // turns this off until the user clicks Fit again.\n useEffect(() => {\n if (!pdf || !fitMode || !containerRef.current) return;\n const recompute = () => {\n const el = containerRef.current;\n if (!el) return;\n pdf.getPage(page).then(p => {\n if (!containerRef.current) return;\n const viewport = p.getViewport({ scale: 1 });\n const next = fitScale(\n fit,\n { width: el.clientWidth, height: el.clientHeight },\n { width: viewport.width, height: viewport.height },\n );\n setScale(prev => (Math.abs(prev - next) < 0.005 ? prev : next));\n });\n };\n recompute();\n const ro = new ResizeObserver(recompute);\n ro.observe(containerRef.current);\n return () => ro.disconnect();\n }, [pdf, page, fitMode, fit]);\n\n useEffect(() => {\n if (!pdf || !canvasRef.current) return;\n let cancelled = false;\n let task: { cancel: () => void; promise: Promise<void> } | null = null;\n let textLayer: pdfjsLib.TextLayer | null = null;\n pdf.getPage(page).then(p => {\n if (cancelled || !canvasRef.current) return;\n const viewport = p.getViewport({ scale });\n const canvas = canvasRef.current;\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n // Lock the displayed (CSS) size to the viewport. pdf.js stamps inline\n // style.width/height on render and inline values stick across re-renders\n // even when canvas.width shrinks — without this, zoom changes only\n // affect resolution, not visible size.\n canvas.style.width = `${viewport.width}px`;\n canvas.style.height = `${viewport.height}px`;\n const ctx = canvas.getContext('2d')!;\n task = p.render({ canvas, canvasContext: ctx, viewport });\n task.promise.catch(() => {});\n // Selectable text layer — transparent spans over the canvas glyphs.\n // Rebuilt per page/zoom render; pdf.js reads --total-scale-factor for\n // span font-size and the container's own width/height.\n const textEl = textLayerRef.current;\n if (textEl) {\n textEl.replaceChildren();\n textEl.style.setProperty('--total-scale-factor', String(viewport.scale));\n textLayer = new pdfjsLib.TextLayer({\n textContentSource: p.streamTextContent(),\n container: textEl,\n viewport,\n });\n textLayer.render().then(() => {\n if (cancelled) return;\n const end = document.createElement('div');\n end.className = 'endOfContent';\n textEl.append(end);\n }).catch(() => {});\n }\n });\n return () => {\n cancelled = true;\n task?.cancel();\n textLayer?.cancel();\n };\n }, [pdf, page, scale]);\n\n // End a selection drag wherever the pointer is released — the .selecting\n // class is added on pointerdown in the layer itself (see JSX below).\n useEffect(() => {\n const up = () => textLayerRef.current?.classList.remove('selecting');\n window.addEventListener('pointerup', up);\n return () => window.removeEventListener('pointerup', up);\n }, []);\n\n const handlePrint = () => {\n if (!pdf) return;\n const win = window.open('', '_blank');\n if (!win) { toast.error('Allow popups to print'); return; }\n const promises: Promise<string>[] = [];\n for (let i = 1; i <= totalPages; i++) {\n promises.push(pdf.getPage(i).then(p => {\n const vp = p.getViewport({ scale: 2 });\n const c = document.createElement('canvas');\n c.width = vp.width; c.height = vp.height;\n return p.render({ canvas: c, canvasContext: c.getContext('2d')!, viewport: vp }).promise.then(() => c.toDataURL());\n }));\n }\n Promise.all(promises).then(images => {\n win.document.write(`<html><head><title>${filename}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`);\n win.document.write(images.map(src => `<img src=\"${src}\"/>`).join(''));\n win.document.write('</body></html>');\n win.document.close();\n setTimeout(() => { win.print(); win.close(); }, 300);\n });\n };\n\n const handleDefaultDownload = () => {\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n a.click();\n };\n\n // Re-arm fit mode. The auto-fit effect picks the new scale on its next\n // tick once `fitMode` flips to true.\n const reFit = () => setFitMode(true);\n const fitLabel = fit === 'page' ? 'Fit page' : 'Fit width';\n\n // Wheel and keyboard page navigation. Only takes the wheel event when\n // the container is at the top/bottom edge — otherwise normal scroll\n // moves through a tall page first, matching native PDF readers.\n const onWheelPage = (e: React.WheelEvent<HTMLDivElement>) => {\n if (!pdf) return;\n if (e.ctrlKey || e.metaKey) return; // browser-zoom shortcut, leave alone\n const el = containerRef.current;\n if (!el) return;\n const atTop = el.scrollTop <= 0;\n const atBottom = el.scrollTop + el.clientHeight >= el.scrollHeight - 1;\n if (e.deltaY > 0 && atBottom && page < totalPages) {\n e.preventDefault();\n setPage(p => Math.min(totalPages, p + 1));\n // Land at the top of the next page so wheel-down keeps reading\n // forward. requestAnimationFrame so the canvas has a tick to\n // resize before we scroll.\n requestAnimationFrame(() => { if (containerRef.current) containerRef.current.scrollTop = 0; });\n } else if (e.deltaY < 0 && atTop && page > 1) {\n e.preventDefault();\n setPage(p => Math.max(1, p - 1));\n requestAnimationFrame(() => {\n if (containerRef.current) containerRef.current.scrollTop = containerRef.current.scrollHeight;\n });\n }\n };\n const onKeyPage = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!pdf) return;\n // Ignore keyboard nav when an input/textarea has focus.\n const tag = (document.activeElement?.tagName || '').toLowerCase();\n if (tag === 'input' || tag === 'textarea' || (document.activeElement as HTMLElement)?.isContentEditable) return;\n if (e.key === 'PageDown' || e.key === 'ArrowRight') {\n if (page < totalPages) { e.preventDefault(); setPage(p => Math.min(totalPages, p + 1)); }\n } else if (e.key === 'PageUp' || e.key === 'ArrowLeft') {\n if (page > 1) { e.preventDefault(); setPage(p => Math.max(1, p - 1)); }\n } else if (e.key === 'Home') {\n e.preventDefault(); setPage(1);\n } else if (e.key === 'End') {\n e.preventDefault(); setPage(totalPages);\n }\n };\n\n const btn = 'px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1';\n\n return (\n <div className=\"flex flex-col h-full\">\n <PanelActions>\n <button aria-label=\"Previous page\" onClick={() => setPage(p => Math.max(1, p - 1))} disabled={page <= 1} className=\"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600\">\n <svg className=\"h-3.5 w-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M15.75 19.5L8.25 12l7.5-7.5\" /></svg>\n </button>\n <span className=\"text-gray-600 font-medium tabular-nums\">{page} / {totalPages}</span>\n <button aria-label=\"Next page\" onClick={() => setPage(p => Math.min(totalPages, p + 1))} disabled={page >= totalPages} className=\"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600\">\n <svg className=\"h-3.5 w-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M8.25 4.5l7.5 7.5-7.5 7.5\" /></svg>\n </button>\n <div className=\"h-4 w-px bg-gray-300 mx-1\" />\n <button\n onClick={() => { setFitMode(false); setScale(s => Math.max(0.3, Math.round((s - 0.25) * 100) / 100)); }}\n className={btn}\n >−</button>\n <select\n value={fitMode ? 'fit' : (ZOOM_PRESETS.includes(Math.round(scale * 100)) ? Math.round(scale * 100) : 'custom')}\n onChange={e => {\n const v = e.target.value;\n if (v === 'fit') { setFitMode(true); return; }\n if (v !== 'custom') { setFitMode(false); setScale(Number(v) / 100); }\n }}\n className=\"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400\"\n title=\"Zoom\"\n >\n <option value=\"fit\">{fitLabel}</option>\n {!fitMode && !ZOOM_PRESETS.includes(Math.round(scale * 100)) && (\n <option value=\"custom\">{Math.round(scale * 100)}%</option>\n )}\n {ZOOM_PRESETS.map(p => <option key={p} value={p}>{p}%</option>)}\n </select>\n <button\n onClick={() => { setFitMode(false); setScale(s => Math.min(4, Math.round((s + 0.25) * 100) / 100)); }}\n className={btn}\n >+</button>\n <button\n onClick={reFit}\n className={btn + (fitMode ? ' bg-gray-200 text-gray-900' : '')}\n title={`${fitLabel} — auto-tracks the container size until you zoom manually`}\n >Fit</button>\n <div className=\"h-4 w-px bg-gray-300 mx-1\" />\n <button onClick={handlePrint} className={btn}>\n <svg className=\"h-3.5 w-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0l.229 2.523a1.125 1.125 0 01-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0021 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 00-1.913-.247M6.34 18H5.25A2.25 2.25 0 013 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 011.913-.247m10.5 0a48.536 48.536 0 00-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5zm-3 0h.008v.008H15V10.5z\" /></svg>\n Print\n </button>\n <button onClick={onDownload ?? handleDefaultDownload} className={btn}>\n <svg className=\"h-3.5 w-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\" /></svg>\n Download\n </button>\n {onEmail && (\n <button onClick={onEmail} className={btn}>\n <svg className=\"h-3.5 w-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75\" /></svg>\n Email\n </button>\n )}\n </PanelActions>\n\n <div\n ref={containerRef}\n className=\"flex-1 overflow-auto bg-gray-100 outline-none\"\n // tabIndex makes the scroll container itself focusable so PageUp /\n // PageDown / Arrow keys are captured even when no inner element\n // has focus (e.g. right after the panel mounts). Wheel handler\n // page-flips when the user reaches the top/bottom of a long page.\n tabIndex={0}\n onWheel={onWheelPage}\n onKeyDown={onKeyPage}\n >\n {loading ? (\n <div className=\"flex items-center justify-center h-full text-gray-400 text-sm\">Loading PDF...</div>\n ) : (\n <div className=\"min-h-full flex items-center justify-center p-4\">\n <style>{TEXT_LAYER_CSS}</style>\n <div className=\"relative shadow-lg rounded\">\n <canvas ref={canvasRef} className=\"block rounded\" />\n <div\n ref={textLayerRef}\n className=\"preview-pdf-textlayer\"\n onPointerDown={e => e.currentTarget.classList.add('selecting')}\n />\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
@@ -1,56 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- // src/shell/nav-types.ts
5
- function isSection(item) {
6
- return "items" in item;
7
- }
8
- function navVisible(entry, hasAnyPerm) {
9
- if (entry.perms?.length && !hasAnyPerm(entry.perms)) return false;
10
- if (entry.allPerms?.length && !entry.allPerms.every((p) => hasAnyPerm([p]))) return false;
11
- return true;
12
- }
13
- function visibleChildren(item, hasAnyPerm) {
14
- return (item.children ?? []).filter((c) => navVisible(c, hasAnyPerm));
15
- }
16
- function isReachable(item, hasAnyPerm) {
17
- if (!item.children?.length) return true;
18
- return visibleChildren(item, hasAnyPerm).some((child) => isReachable(child, hasAnyPerm));
19
- }
20
-
21
- // src/shell-config/nav.tsx
22
- var _navIcons = {};
23
- var navIcons = new Proxy(_navIcons, {
24
- get(_t, k) {
25
- return _navIcons[k];
26
- },
27
- has(_t, k) {
28
- return k in _navIcons;
29
- },
30
- ownKeys() {
31
- return Object.keys(_navIcons);
32
- },
33
- getOwnPropertyDescriptor(_t, k) {
34
- if (k in _navIcons) return { configurable: true, enumerable: true, value: _navIcons[k] };
35
- return void 0;
36
- }
37
- });
38
- function setShellNavIcons(icons) {
39
- for (const k of Object.keys(_navIcons)) delete _navIcons[k];
40
- Object.assign(_navIcons, icons);
41
- }
42
- var sectionIcons = {};
43
- var navSections = [];
44
- var startMenuCategories = { erp: [], system: [], virtual: [], footer: [] };
45
- var DEFAULT = { hasAnyPerm: () => true };
46
- var ShellAuthContext = createContext(DEFAULT);
47
- function ShellAuthProvider({ value, children }) {
48
- return /* @__PURE__ */ jsx(ShellAuthContext.Provider, { value, children });
49
- }
50
- function useShellAuth() {
51
- return useContext(ShellAuthContext);
52
- }
53
-
54
- export { ShellAuthProvider, isReachable, isSection, navIcons, navSections, navVisible, sectionIcons, setShellNavIcons, startMenuCategories, useShellAuth, visibleChildren };
55
- //# sourceMappingURL=chunk-GA35NEND.js.map
56
- //# sourceMappingURL=chunk-GA35NEND.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/nav-types.ts","../src/shell-config/nav.tsx","../src/shell/ShellAuth.tsx"],"names":[],"mappings":";;;;AA6EO,SAAS,UAAU,IAAA,EAAgD;AACxE,EAAA,OAAO,OAAA,IAAW,IAAA;AACpB;AAoBO,SAAS,UAAA,CACd,OACA,UAAA,EACS;AACT,EAAA,IAAI,KAAA,CAAM,OAAO,MAAA,IAAU,CAAC,WAAW,KAAA,CAAM,KAAK,GAAG,OAAO,KAAA;AAC5D,EAAA,IAAI,KAAA,CAAM,QAAA,EAAU,MAAA,IAAU,CAAC,MAAM,QAAA,CAAS,KAAA,CAAM,CAAA,CAAA,KAAK,UAAA,CAAW,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,KAAA;AAClF,EAAA,OAAO,IAAA;AACT;AAWO,SAAS,eAAA,CAAgB,MAAe,UAAA,EAAmC;AAChF,EAAA,OAAA,CAAQ,IAAA,CAAK,YAAY,EAAC,EAAG,OAAO,CAAA,CAAA,KAAK,UAAA,CAAW,CAAA,EAAG,UAAU,CAAC,CAAA;AACpE;AAcO,SAAS,WAAA,CAAY,MAAe,UAAA,EAAiC;AAC1E,EAAA,IAAI,CAAC,IAAA,CAAK,QAAA,EAAU,MAAA,EAAQ,OAAO,IAAA;AACnC,EAAA,OAAO,eAAA,CAAgB,MAAM,UAAU,CAAA,CAAE,KAAK,CAAA,KAAA,KAAS,WAAA,CAAY,KAAA,EAAO,UAAU,CAAC,CAAA;AACvF;;;ACxHA,IAAM,YAAuC,EAAC;AACvC,IAAM,QAAA,GAAsC,IAAI,KAAA,CAAM,SAAA,EAAW;AAAA,EACtE,GAAA,CAAI,IAAI,CAAA,EAAW;AAAE,IAAA,OAAO,UAAU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umer-supplied via Layout props — the package never\n * ships nav DATA, only the shape it expects.\n */\nimport type { ReactNode } from 'react';\n\nexport interface NavItem {\n to: string;\n label: string;\n /** Optional compact wording used only inside navigation menus. Keep `label`\n * as the full semantic name for windows, search and assistive technology. */\n menuLabel?: string;\n perms?: string[];\n /** Permissions the user must hold EVERY one of, unlike `perms` which needs\n * only one. For an entry whose page is gated on a narrower permission than\n * the one that puts it in the menu: listing both in `perms` would widen the\n * audience (it's an OR), so the extra one goes here instead. */\n allPerms?: string[];\n dividerAfter?: boolean;\n /** An action instead of a destination. When set, choosing the row calls this\n * and opens no window — `to` is then only the row's key (and its `navIcons`\n * lookup), so give it one no page uses. The menu closes as it would after\n * opening a page. For rows whose target is not a window: signing in to\n * another tenant, say, which Sign Out is the built-in precedent for. */\n onSelect?: () => void;\n /** Optional sub-items, to any depth — a child may have children of its own.\n * Hovering the parent in <StartMenu> opens a nested flyout; in <Sidebar>\n * the parent becomes an inline sub-accordion. */\n children?: NavItem[];\n}\n\nexport interface NavSection {\n label: string;\n /** Optional compact wording used only inside navigation menus. */\n menuLabel?: string;\n items: NavItem[];\n perms?: string[];\n /** Same all-of rule as `NavItem.allPerms`, for a whole section. */\n allPerms?: string[];\n /** Optional landing route for clicks on the section title itself\n * (e.g. R&D's `/rd` dashboard). */\n to?: string;\n /** Draw a divider under this section's row, so a consumer can split one\n * flat group into visual bands (e.g. an operator console pinned above the\n * ERP sections). Same knob as `NavItem.dividerAfter`, and drawn INSIDE the\n * section's wrapper so it stays below the row in the `flex-col-reverse`\n * Start menu a side/top taskbar renders. */\n dividerAfter?: boolean;\n}\n\nexport interface VirtualSection {\n label: string;\n /** Optional compact wording used only inside navigation menus. */\n menuLabel?: string;\n items: NavItem[];\n icon?: ReactNode;\n}\n\nexport interface StartMenuCategories {\n /** Section labels rendered in the \"ERP\" group (bold, with section icon). */\n erp: string[];\n /** Section labels rendered in the \"system\" group. */\n system: string[];\n /** Optional virtual flyouts (e.g. a \"Utilities\" tray). */\n virtual?: VirtualSection[];\n /** Optional section labels pinned to the bottom of the menu, next to the user\n * profile, separated from the ERP group by a divider. */\n footer?: string[];\n /** Optional flat top-level items pinned to the bottom of the menu, next to\n * the user profile, separated from the ERP group by a divider. Unlike\n * `footer` (section labels rendered as flyouts), these render as direct\n * clickable rows — use for standalone destinations like System Preferences\n * or a bug-report link. */\n footerItems?: NavItem[];\n}\n\nexport function isSection(item: NavSection | NavItem): item is NavSection {\n return 'items' in item;\n}\n\n/** The host app's permission predicate — `useAuth().hasAnyPerm`. */\ntype HasAnyPerm = (perms: string[]) => boolean;\n\n/**\n * Whether this user may see a nav entry, honouring BOTH permission rules.\n *\n * Every visibility test in the shell goes through here. It used to be an inline\n * `!x.perms || hasAnyPerm(x.perms)` repeated at nine call sites, which made the\n * all-of rule impossible to add without missing one — and a missed site shows a\n * row that refuses on click (SG#00214: a price-blind supplier role kept the\n * Price Sheets entry, because the entry is gated on the permission that lists\n * price sheets while the page is gated on the narrower one that reveals prices).\n *\n * `perms` keeps its any-of meaning, so existing nav data is untouched.\n * `allPerms` requires every entry, and is tested one permission at a time\n * because `hasAnyPerm` is the only predicate a host supplies — asking for all\n * of them in one call would be an OR and quietly grant the row.\n */\nexport function navVisible(\n entry: { perms?: string[]; allPerms?: string[] },\n hasAnyPerm: HasAnyPerm,\n): boolean {\n if (entry.perms?.length && !hasAnyPerm(entry.perms)) return false;\n if (entry.allPerms?.length && !entry.allPerms.every(p => hasAnyPerm([p]))) return false;\n return true;\n}\n\n/**\n * The sub-items of `item` this user may actually see.\n *\n * Every affordance for a nested group has to be derived from THIS list — the\n * chevron that advertises it, the hover handler that opens it, and the flyout\n * itself. Reading the raw `item.children` for the chevron while filtering only\n * for the flyout put an arrow on groups whose children were all\n * permission-hidden: hovering one highlighted the row and opened nothing.\n */\nexport function visibleChildren(item: NavItem, hasAnyPerm: HasAnyPerm): NavItem[] {\n return (item.children ?? []).filter(c => navVisible(c, hasAnyPerm));\n}\n\n/**\n * Whether a nav row leads anywhere for this user: either it's a plain\n * destination, or it's a group with at least one child that itself leads\n * somewhere. A group whose children are all hidden has nothing to open — and\n * by convention a group's `to` is a synthetic key that never navigates, so\n * there is nothing to fall back to either. Such a row is dropped rather than\n * rendered inert.\n *\n * The test recurses because nesting does: a group holding one sub-group whose\n * own children are all permission-hidden is just as inert as a group holding\n * nothing, and at four levels deep that shape is easy to build by accident.\n */\nexport function isReachable(item: NavItem, hasAnyPerm: HasAnyPerm): boolean {\n if (!item.children?.length) return true;\n return visibleChildren(item, hasAnyPerm).some(child => isReachable(child, hasAnyPerm));\n}\n","/**\n * INTERNAL stub — package-side compatibility for files that legacy-imported\n * default nav data from `shell-config/nav`. The package never ships nav\n * DATA; consumers always supply `navSections` / `navIcons` / `sectionIcons` /\n * `categories` as Layout props.\n *\n * Empty defaults exported here so the copied files compile during the\n * extraction transition. Each consumer-facing field is also re-exported as\n * a TYPE alias for code that only needed the shape.\n */\nimport type { ReactNode } from 'react';\nimport type { NavItem, NavSection, StartMenuCategories, VirtualSection } from '../shell/nav-types';\n\n// Live proxy: WindowManager reads window-title icons from this module-level\n// map. Consumers register their full icon set once at app startup so the\n// title bars show the same glyphs as the start menu.\nconst _navIcons: Record<string, ReactNode> = {};\nexport const navIcons: Record<string, ReactNode> = new Proxy(_navIcons, {\n get(_t, k: string) { return _navIcons[k]; },\n has(_t, k: string) { return k in _navIcons; },\n ownKeys() { return Object.keys(_navIcons); },\n getOwnPropertyDescriptor(_t, k: string) {\n if (k in _navIcons) return { configurable: true, enumerable: true, value: _navIcons[k] };\n return undefined;\n },\n});\nexport function setShellNavIcons(icons: Record<string, ReactNode>): void {\n for (const k of Object.keys(_navIcons)) delete _navIcons[k];\n Object.assign(_navIcons, icons);\n}\n\nexport const sectionIcons: Record<string, ReactNode> = {};\nexport const navSections: (NavSection | NavItem)[] = [];\nexport const startMenuCategories: StartMenuCategories = { erp: [], system: [], virtual: [], footer: [] };\n\nexport { isSection } from '../shell/nav-types';\nexport type { NavItem, NavSection, StartMenuCategories, VirtualSection };\n","/**\n * Shell-side auth surface — JUST permission checking. The shell never\n * authenticates anyone or holds tokens; it only asks \"is the current user\n * allowed to see this nav item?\".\n *\n * Consumer wraps the app:\n *\n * <ShellAuthProvider value={{ hasAnyPerm: (perms) => myAuth.has(...perms) }}>\n * <Layout ... />\n * </ShellAuthProvider>\n *\n * When no provider is mounted, every permission check returns true — useful\n * for demos and consumers that don't gate their UI.\n */\nimport { createContext, useContext, type ReactNode } from 'react';\n\nexport interface ShellAuth {\n /** Returns true if the current user has any of the listed permission codes. */\n hasAnyPerm: (perms: string[]) => boolean;\n}\n\nconst DEFAULT: ShellAuth = { hasAnyPerm: () => true };\n\nconst ShellAuthContext = createContext<ShellAuth>(DEFAULT);\n\nexport function ShellAuthProvider({ value, children }: { value: ShellAuth; children: ReactNode }) {\n return <ShellAuthContext.Provider value={value}>{children}</ShellAuthContext.Provider>;\n}\n\nexport function useShellAuth(): ShellAuth {\n return useContext(ShellAuthContext);\n}\n"]}
@@ -1,316 +0,0 @@
1
- import { useShellStrings } from './chunk-YE6GUDGP.js';
2
- import { useHydrated, useBrowserState } from './chunk-IRWSRJ4K.js';
3
- import { createContext, useSyncExternalStore, useCallback, useContext, useMemo } from 'react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
-
6
- var QUERY = "(max-width: 767px), (pointer: coarse)";
7
- function getSnapshot() {
8
- if (typeof window === "undefined" || !window.matchMedia) return false;
9
- return window.matchMedia(QUERY).matches;
10
- }
11
- function getServerSnapshot() {
12
- return false;
13
- }
14
- function subscribe(cb) {
15
- if (typeof window === "undefined" || !window.matchMedia) return () => {
16
- };
17
- const mql = window.matchMedia(QUERY);
18
- if (mql.addEventListener) {
19
- mql.addEventListener("change", cb);
20
- return () => mql.removeEventListener("change", cb);
21
- }
22
- mql.addListener(cb);
23
- return () => mql.removeListener(cb);
24
- }
25
- function useIsMobile() {
26
- return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
27
- }
28
- var STATUS_TONE = {
29
- success: "success",
30
- error: "error",
31
- warning: "warning",
32
- info: "info",
33
- // A missing page is not an error the user made, and colouring it red says it
34
- // was. Refused and broken are genuinely different from not-found.
35
- 404: "info",
36
- 403: "warning",
37
- 500: "error"
38
- };
39
- var TONE_CLASS = {
40
- success: "text-green-600 bg-green-100",
41
- error: "text-red-600 bg-red-100",
42
- warning: "text-amber-600 bg-amber-100",
43
- info: "text-blue-600 bg-blue-100"
44
- };
45
- var DEFAULT_TITLE = {
46
- 404: (errors) => errors.notFound,
47
- 403: (errors) => errors.noAccess,
48
- 500: (errors) => errors.serverError
49
- };
50
- function StatusIcon({ tone }) {
51
- const common = { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, "aria-hidden": true };
52
- switch (tone) {
53
- case "success":
54
- return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
55
- case "error":
56
- return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
57
- case "warning":
58
- return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) });
59
- default:
60
- return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) });
61
- }
62
- }
63
- function Result({
64
- status = "info",
65
- title,
66
- subTitle,
67
- extra,
68
- icon,
69
- children,
70
- className = ""
71
- }) {
72
- const tone = STATUS_TONE[status];
73
- const errors = useShellStrings().errors;
74
- const announces = tone === "error";
75
- return /* @__PURE__ */ jsxs(
76
- "div",
77
- {
78
- role: announces ? "alert" : void 0,
79
- className: `flex flex-col items-center justify-center px-6 py-12 text-center ${className}`.trim(),
80
- children: [
81
- /* @__PURE__ */ jsx("div", { className: `flex h-14 w-14 items-center justify-center rounded-full ${TONE_CLASS[tone]}`, children: icon ?? /* @__PURE__ */ jsx(StatusIcon, { tone }) }),
82
- /* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-semibold text-gray-900", children: title ?? DEFAULT_TITLE[status]?.(errors) ?? "" }),
83
- subTitle && /* @__PURE__ */ jsx("p", { className: "mt-1 max-w-md text-sm text-gray-500", children: subTitle }),
84
- children && /* @__PURE__ */ jsx("div", { className: "mt-4 w-full max-w-md text-left", children }),
85
- extra && /* @__PURE__ */ jsx("div", { className: "mt-6 flex flex-wrap items-center justify-center gap-3", children: extra })
86
- ]
87
- }
88
- );
89
- }
90
- function LoadingSpinner({ size = "md", padding = "py-12", label, className = "" }) {
91
- const dim = size === "sm" ? "h-5 w-5" : size === "lg" ? "h-12 w-12" : "h-8 w-8";
92
- const ring = /* @__PURE__ */ jsx("div", { className: `${dim} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600` });
93
- if (label == null) {
94
- return /* @__PURE__ */ jsx("div", { className: `flex items-center justify-center ${padding} ${className}`, children: ring });
95
- }
96
- return /* @__PURE__ */ jsxs("div", { role: "status", className: `flex flex-col items-center justify-center gap-3 ${padding} ${className}`, children: [
97
- ring,
98
- /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: label })
99
- ] });
100
- }
101
- var isMac = typeof window !== "undefined" && typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
102
- var FORMS = {
103
- MOD: ["\u2318", "Ctrl"],
104
- ALT: ["\u2325", "Alt"],
105
- CMD_ENTER: ["\u2318\u23CE", "Ctrl\u23CE"],
106
- CMD_S: ["\u2318S", "Ctrl+S"],
107
- CMD_K: ["\u2318K", "Ctrl+K"],
108
- CMD_DOT: ["\u2318.", "Ctrl+."],
109
- CMD_A: ["\u2318A", "Ctrl+A"],
110
- CMD_Z: ["\u2318Z", "Ctrl+Z"],
111
- CMD_SHIFT_Z: ["\u2318\u21E7Z", "Ctrl+Shift+Z"],
112
- ALT_SHIFT_D: ["\u2325\u21E7D", "Alt+Shift+D"],
113
- ALT_SHIFT_E: ["\u2325\u21E7E", "Alt+Shift+E"],
114
- ALT_SHIFT_N: ["\u2325\u21E7N", "Alt+Shift+N"]
115
- };
116
- var HERE = isMac ? 0 : 1;
117
- var MOD = FORMS.MOD[HERE];
118
- var ALT = FORMS.ALT[HERE];
119
- var SHIFT = "\u21E7";
120
- var ENTER = "\u23CE";
121
- var CMD_ENTER = FORMS.CMD_ENTER[HERE];
122
- var CMD_S = FORMS.CMD_S[HERE];
123
- var CMD_K = FORMS.CMD_K[HERE];
124
- var CMD_DOT = FORMS.CMD_DOT[HERE];
125
- var CMD_A = FORMS.CMD_A[HERE];
126
- var CMD_Z = FORMS.CMD_Z[HERE];
127
- var CMD_SHIFT_Z = FORMS.CMD_SHIFT_Z[HERE];
128
- var ALT_SHIFT_D = FORMS.ALT_SHIFT_D[HERE];
129
- var ALT_SHIFT_E = FORMS.ALT_SHIFT_E[HERE];
130
- var ALT_SHIFT_N = FORMS.ALT_SHIFT_N[HERE];
131
- var AS_ON_SERVER = new Map(
132
- isMac ? Object.values(FORMS).map(([mac, other]) => [mac, other]) : []
133
- );
134
- function useShortcutLabel(keys) {
135
- const hydrated = useHydrated();
136
- return hydrated ? keys : AS_ON_SERVER.get(keys) ?? keys;
137
- }
138
- var KBD_BASE = "inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500";
139
- var KBD_SIZES = {
140
- sm: "px-1 py-0.5 text-[10px]",
141
- md: "px-1.5 py-0.5 text-[11px]"
142
- };
143
- function Kbd({ keys, size = "md", className = "" }) {
144
- const label = useShortcutLabel(keys);
145
- return /* @__PURE__ */ jsx("kbd", { className: [KBD_BASE, KBD_SIZES[size], className].filter(Boolean).join(" "), children: label });
146
- }
147
- var ShellPrefsContext = createContext(null);
148
- function ShellPrefsProvider({
149
- value,
150
- children
151
- }) {
152
- return /* @__PURE__ */ jsx(ShellPrefsContext.Provider, { value, children });
153
- }
154
- function useLocalStoragePrefs(storageKey = "react-os-shell:prefs", defaults) {
155
- const [prefs, setPrefs] = useBrowserState(() => {
156
- try {
157
- const stored = JSON.parse(localStorage.getItem(storageKey) || "{}");
158
- return { ...defaults ?? {}, ...stored };
159
- } catch {
160
- return { ...defaults ?? {} };
161
- }
162
- }, { ...defaults ?? {} });
163
- const save = useCallback((patch) => {
164
- setPrefs((prev) => {
165
- const next = { ...prev, ...patch };
166
- try {
167
- localStorage.setItem(storageKey, JSON.stringify(next));
168
- } catch {
169
- }
170
- return next;
171
- });
172
- }, [storageKey]);
173
- return { prefs, save };
174
- }
175
- var NO_PROVIDER = { prefs: {}, save: () => {
176
- } };
177
- function useShellPrefsAdapter() {
178
- return useContext(ShellPrefsContext) ?? NO_PROVIDER;
179
- }
180
- function useShellPrefs() {
181
- const { prefs, save: rawSave } = useShellPrefsAdapter();
182
- const save = useCallback((patch) => {
183
- const result = rawSave(patch);
184
- return result && typeof result.then === "function" ? result.catch(() => {
185
- }) : result;
186
- }, [rawSave]);
187
- return useMemo(() => ({ prefs, save }), [prefs, save]);
188
- }
189
-
190
- // src/shell/staleChunk.ts
191
- var STALE_CHUNK_RELOAD_KEY = "react-os-shell:stale-chunk-reload-at";
192
- var STALE_CHUNK_RELOAD_COOLDOWN_MS = 3e4;
193
- var VITE_PRELOAD_ERROR_EVENT = "vite:preloadError";
194
- var NEXT_CHUNK_PATH_PREFIX = "/_next/static/";
195
- var STALE_CHUNK_MESSAGE = /Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;
196
- var CHUNK_LOAD_ERROR_NAME = "ChunkLoadError";
197
- function isStaleChunkError(error) {
198
- if (error instanceof Error && error.name === CHUNK_LOAD_ERROR_NAME) return true;
199
- const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
200
- return STALE_CHUNK_MESSAGE.test(message);
201
- }
202
- function linkLoadsChunk(link) {
203
- const rels = link.rel.toLowerCase().split(/\s+/);
204
- if (rels.includes("stylesheet") || rels.includes("modulepreload")) return true;
205
- const as = (link.getAttribute("as") ?? "").toLowerCase();
206
- return rels.includes("preload") && (as === "script" || as === "style");
207
- }
208
- function failedChunkUrl(event, prefix) {
209
- const target = event.target;
210
- let src = "";
211
- if (target instanceof window.HTMLScriptElement) src = target.src;
212
- else if (target instanceof window.HTMLLinkElement && linkLoadsChunk(target)) src = target.href;
213
- else if (event instanceof window.ErrorEvent && event.error?.name === "SyntaxError") {
214
- src = event.filename;
215
- }
216
- if (!src) return null;
217
- try {
218
- const base = new URL(prefix, window.location.origin).href;
219
- const url = new URL(src, window.location.href).href;
220
- return url.startsWith(base) ? url : null;
221
- } catch {
222
- return null;
223
- }
224
- }
225
- async function isGoneFromServer(url) {
226
- try {
227
- const response = await fetch(url, { method: "HEAD", cache: "no-store" });
228
- if (response.status === 404 || response.status === 410) return true;
229
- return response.ok && /\btext\/html\b/i.test(response.headers.get("content-type") ?? "");
230
- } catch {
231
- return false;
232
- }
233
- }
234
- function defaultStorage() {
235
- try {
236
- const s = window.sessionStorage;
237
- s.getItem(STALE_CHUNK_RELOAD_KEY);
238
- return s;
239
- } catch {
240
- return null;
241
- }
242
- }
243
- function readLastReload(storage) {
244
- if (!storage) return null;
245
- try {
246
- const raw = storage.getItem(STALE_CHUNK_RELOAD_KEY);
247
- const at = raw === null ? NaN : Number(raw);
248
- return Number.isFinite(at) ? at : null;
249
- } catch {
250
- return null;
251
- }
252
- }
253
- function writeLastReload(storage, at) {
254
- if (!storage) return;
255
- try {
256
- storage.setItem(STALE_CHUNK_RELOAD_KEY, String(at));
257
- } catch {
258
- }
259
- }
260
- function installStaleChunkReload(options = {}) {
261
- if (typeof window === "undefined") return () => {
262
- };
263
- const cooldownMs = options.cooldownMs ?? STALE_CHUNK_RELOAD_COOLDOWN_MS;
264
- const reload = options.reload ?? (() => window.location.reload());
265
- const now = options.now ?? Date.now;
266
- const storage = options.storage === void 0 ? defaultStorage() : options.storage;
267
- const chunkPathPrefix = options.chunkPathPrefix === void 0 ? NEXT_CHUNK_PATH_PREFIX : options.chunkPathPrefix;
268
- const claimReload = (chunk) => {
269
- const at = now();
270
- const last = readLastReload(storage);
271
- if (last !== null && at - last < cooldownMs) {
272
- console.error(
273
- "[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",
274
- chunk
275
- );
276
- return false;
277
- }
278
- writeLastReload(storage, at);
279
- console.warn(
280
- "[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",
281
- chunk
282
- );
283
- return true;
284
- };
285
- const onPreloadError = (event) => {
286
- const payload = event.payload;
287
- if (!isStaleChunkError(payload) || !claimReload(payload)) return;
288
- event.preventDefault();
289
- reload();
290
- };
291
- let active = true;
292
- let reloading = false;
293
- const asking = /* @__PURE__ */ new Set();
294
- const onChunkError = chunkPathPrefix === null ? null : (event) => {
295
- const chunk = failedChunkUrl(event, chunkPathPrefix);
296
- if (!chunk || reloading || asking.has(chunk)) return;
297
- asking.add(chunk);
298
- void isGoneFromServer(chunk).then((gone) => {
299
- asking.delete(chunk);
300
- if (!gone || !active || reloading || !claimReload(chunk)) return;
301
- reloading = true;
302
- reload();
303
- });
304
- };
305
- window.addEventListener(VITE_PRELOAD_ERROR_EVENT, onPreloadError);
306
- if (onChunkError) window.addEventListener("error", onChunkError, true);
307
- return () => {
308
- active = false;
309
- window.removeEventListener(VITE_PRELOAD_ERROR_EVENT, onPreloadError);
310
- if (onChunkError) window.removeEventListener("error", onChunkError, true);
311
- };
312
- }
313
-
314
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CMD_SHIFT_Z, CMD_Z, ENTER, Kbd, LoadingSpinner, MOD, NEXT_CHUNK_PATH_PREFIX, Result, SHIFT, STALE_CHUNK_RELOAD_COOLDOWN_MS, STALE_CHUNK_RELOAD_KEY, ShellPrefsProvider, VITE_PRELOAD_ERROR_EVENT, installStaleChunkReload, isMac, isStaleChunkError, useIsMobile, useLocalStoragePrefs, useShellPrefs, useShellPrefsAdapter, useShortcutLabel };
315
- //# sourceMappingURL=chunk-HUBJAUGG.js.map
316
- //# sourceMappingURL=chunk-HUBJAUGG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/useIsMobile.ts","../src/shell/Result.tsx","../src/shell/Spinner.tsx","../src/shell/Kbd.tsx","../src/shell/ShellPrefs.tsx","../src/shell/staleChunk.ts"],"names":["jsx","jsxs"],"mappings":";;;;;AAaA,IAAM,KAAA,GAAQ,uCAAA;AAEd,SAAS,WAAA,GAAuB;AAC9B,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,CAAC,MAAA,CAAO,YAAY,OAAO,KAAA;AAChE,EAAA,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA,CAAE,OAAA;AAClC;AAEA,SAAS,iBAAA,GAA6B;AACpC,EAAA,OAAO,KAAA;AACT;AAEA,SAAS,UAAU,EAAA,EAA4B;AAC7C,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,CAAC,MAAA,CAAO,UAAA,SAAmB,MAAM;AAAA,EAAC,CAAA;AACvE,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AAEnC,EAAA,IAAI,IAAI,gBAAA,EAAkB;AACxB,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,EAAE,CAAA;AACjC,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,EAAE,CAAA;AAAA,EACnD;AACA,EAAA,GAAA,CAAI,YAAY,EAAE,CAA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c,MAAA,CAAO,mBAAA,CAAoB,OAAA,EAAS,cAAc,IAAI,CAAA;AAAA,EAC1E,CAAA;AACF","file":"chunk-HUBJAUGG.js","sourcesContent":["/**\n * Mobile breakpoint hook — single source of truth for \"is this a phone/tablet\n * portrait viewport?\" Drives whether <Layout> renders the desktop chrome\n * (windows / taskbar / start menu sidebar) or the <MobileAppLanding> screen\n * that points the user at the consumer-wired mobile app. A handful of\n * primitives (Modal, ResizableTable) also read it to adapt touch behaviour.\n *\n * Locked at 768 px so iPad portrait counts as mobile. Also OR's with\n * `pointer: coarse` so touch-only devices that happen to be wider (e.g. an\n * Android tablet in landscape) still get touch-appropriate UI.\n */\nimport { useSyncExternalStore } from 'react';\n\nconst QUERY = '(max-width: 767px), (pointer: coarse)';\n\nfunction getSnapshot(): boolean {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia(QUERY).matches;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\nfunction subscribe(cb: () => void): () => void {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {};\n const mql = window.matchMedia(QUERY);\n // Older Safari uses addListener; modern browsers use addEventListener.\n if (mql.addEventListener) {\n mql.addEventListener('change', cb);\n return () => mql.removeEventListener('change', cb);\n }\n mql.addListener(cb);\n return () => mql.removeListener(cb);\n}\n\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n","/**\n * Result — the full-page outcome state: a 404, a 403, a crashed boundary, a\n * completed checkout.\n *\n * `EmptyState` is the neighbour to know about. That one means \"this list has\n * nothing in it yet\", which is normal and usually actionable. This one means\n * something ENDED — succeeded, failed, or was refused — and it is the whole\n * page rather than a region of one. `ErrorPage` is this component wrapped in a\n * full-screen frame.\n */\nimport { type ReactNode } from 'react';\nimport { useShellStrings, type ShellStrings } from './strings';\n\nexport type ResultStatus = 'success' | 'error' | 'warning' | 'info' | '404' | '403' | '500';\n\nexport interface ResultProps {\n status?: ResultStatus;\n title?: ReactNode;\n subTitle?: ReactNode;\n /** Actions — usually one primary route out. Always give the user one. */\n extra?: ReactNode;\n /** Replace the status glyph entirely. */\n icon?: ReactNode;\n children?: ReactNode;\n className?: string;\n}\n\ntype Tone = 'success' | 'error' | 'warning' | 'info';\n\nconst STATUS_TONE: Record<ResultStatus, Tone> = {\n success: 'success', error: 'error', warning: 'warning', info: 'info',\n // A missing page is not an error the user made, and colouring it red says it\n // was. Refused and broken are genuinely different from not-found.\n 404: 'info', 403: 'warning', 500: 'error',\n};\n\nconst TONE_CLASS: Record<Tone, string> = {\n success: 'text-green-600 bg-green-100',\n error: 'text-red-600 bg-red-100',\n warning: 'text-amber-600 bg-amber-100',\n info: 'text-blue-600 bg-blue-100',\n};\n\n/** Default copy, so the common cases need only `status` — the catalog's\n * `errors` words, picked at render so a translation reaches them. */\nconst DEFAULT_TITLE: Partial<Record<ResultStatus, (errors: ShellStrings['errors']) => string>> = {\n 404: errors => errors.notFound,\n 403: errors => errors.noAccess,\n 500: errors => errors.serverError,\n};\n\nfunction StatusIcon({ tone }: { tone: Tone }) {\n const common = { className: 'h-6 w-6', fill: 'none', viewBox: '0 0 24 24', stroke: 'currentColor', strokeWidth: 1.5, 'aria-hidden': true } as const;\n switch (tone) {\n case 'success':\n return <svg {...common}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\" /></svg>;\n case 'error':\n return <svg {...common}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" /></svg>;\n case 'warning':\n return <svg {...common}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z\" /></svg>;\n default:\n return <svg {...common}><path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z\" /></svg>;\n }\n}\n\nexport default function Result({\n status = 'info', title, subTitle, extra, icon, children, className = '',\n}: ResultProps) {\n const tone = STATUS_TONE[status];\n const errors = useShellStrings().errors;\n // WCAG 4.1.3. A Result that reports a failure is a status message: it appears\n // without the user moving focus, so a screen-reader user is told nothing\n // unless it announces itself. `alert` is assertive, which is right for a\n // failure and wrong for everything else — an outcome someone asked for\n // (a completed checkout) or a neutral one (an empty cart) would interrupt\n // whatever they were reading to say something they already expected.\n const announces = tone === 'error';\n return (\n <div\n role={announces ? 'alert' : undefined}\n className={`flex flex-col items-center justify-center px-6 py-12 text-center ${className}`.trim()}\n >\n <div className={`flex h-14 w-14 items-center justify-center rounded-full ${TONE_CLASS[tone]}`}>\n {icon ?? <StatusIcon tone={tone} />}\n </div>\n <h2 className=\"mt-4 text-lg font-semibold text-gray-900\">\n {title ?? DEFAULT_TITLE[status]?.(errors) ?? ''}\n </h2>\n {subTitle && <p className=\"mt-1 max-w-md text-sm text-gray-500\">{subTitle}</p>}\n {children && <div className=\"mt-4 w-full max-w-md text-left\">{children}</div>}\n {extra && <div className=\"mt-6 flex flex-wrap items-center justify-center gap-3\">{extra}</div>}\n </div>\n );\n}\n","import { type ReactNode } from 'react';\n\nexport interface LoadingSpinnerProps {\n /** Ring diameter: `sm` = 20px, `md` = 32px (default), `lg` = 48px. */\n size?: 'sm' | 'md' | 'lg';\n /** Wrapper padding utility (default `py-12`). Pass `''` to remove. */\n padding?: string;\n /**\n * Caption under the ring, e.g. \"Signing in…\". Naming what is happening beats\n * a bare ring on a full-screen wait, where there is nothing else on the page\n * to infer it from. Adds `role=\"status\"` so it is announced.\n */\n label?: ReactNode;\n /** Extra classes on the centering wrapper. */\n className?: string;\n}\n\n/**\n * LoadingSpinner — a centered animated ring for pending/loading regions.\n * (Distinct from the shell's internal \"Loading…\" text used inside data grids.)\n */\nexport default function LoadingSpinner({ size = 'md', padding = 'py-12', label, className = '' }: LoadingSpinnerProps) {\n const dim = size === 'sm' ? 'h-5 w-5' : size === 'lg' ? 'h-12 w-12' : 'h-8 w-8';\n const ring = <div className={`${dim} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`} />;\n // Without a label the markup is exactly what it has always been — including\n // no `role`, which would otherwise have changed the a11y tree for every\n // existing caller. A labelled spinner is a status; a bare ring is decoration.\n if (label == null) {\n return <div className={`flex items-center justify-center ${padding} ${className}`}>{ring}</div>;\n }\n return (\n <div role=\"status\" className={`flex flex-col items-center justify-center gap-3 ${padding} ${className}`}>\n {ring}\n <p className=\"text-sm text-gray-500\">{label}</p>\n </div>\n );\n}\n","/**\n * Keyboard shortcuts: the platform-aware STRINGS a shortcut is written with,\n * and the badge that renders one.\n *\n * Both live here because they are one concept — a shortcut nobody can see is\n * not a shortcut — and because the strings came first: the constants have\n * shipped for years and the badge around them was left to each consumer, which\n * is how the admin portal ended up with 109 hand-written `<kbd>` elements\n * across 80 files in two different sizes.\n */\nimport { useHydrated } from './hydration';\n\n/**\n * Whether the READER is on a Mac. Fixed when the module loads, and `false` on a\n * server whatever the server runs on: Node has had a global `navigator` since\n * 21, and its `platform` is the machine's own — a guard on `navigator` alone\n * let a Mac server write \\u2318 into HTML for every reader it served.\n */\nexport const isMac = typeof window !== 'undefined' && typeof navigator !== 'undefined'\n && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\n/**\n * Every platform-aware label, as [Mac, everywhere else]. One table, so the\n * badge can tell what a constant was written as on the server from what it is\n * written as here.\n */\nconst FORMS = {\n MOD: ['\\u2318', 'Ctrl'],\n ALT: ['\\u2325', 'Alt'],\n CMD_ENTER: ['\\u2318\\u23CE', 'Ctrl\\u23CE'],\n CMD_S: ['\\u2318S', 'Ctrl+S'],\n CMD_K: ['\\u2318K', 'Ctrl+K'],\n CMD_DOT: ['\\u2318.', 'Ctrl+.'],\n CMD_A: ['\\u2318A', 'Ctrl+A'],\n CMD_Z: ['\\u2318Z', 'Ctrl+Z'],\n CMD_SHIFT_Z: ['\\u2318\\u21e7Z', 'Ctrl+Shift+Z'],\n ALT_SHIFT_D: ['\\u2325\\u21E7D', 'Alt+Shift+D'],\n ALT_SHIFT_E: ['\\u2325\\u21E7E', 'Alt+Shift+E'],\n ALT_SHIFT_N: ['\\u2325\\u21E7N', 'Alt+Shift+N'],\n} as const;\nconst HERE = isMac ? 0 : 1;\n\n/** Platform-aware modifier symbols */\nexport const MOD = FORMS.MOD[HERE];\nexport const ALT = FORMS.ALT[HERE];\nexport const SHIFT = '\\u21E7';\nexport const ENTER = '\\u23CE';\n\n/** Common shortcut labels */\nexport const CMD_ENTER = FORMS.CMD_ENTER[HERE];\nexport const CMD_S = FORMS.CMD_S[HERE];\nexport const CMD_K = FORMS.CMD_K[HERE];\nexport const CMD_DOT = FORMS.CMD_DOT[HERE];\nexport const CMD_A = FORMS.CMD_A[HERE];\nexport const CMD_Z = FORMS.CMD_Z[HERE];\n/** Redo. Mac has no \\u2318Y convention, so it is the shifted undo there. */\nexport const CMD_SHIFT_Z = FORMS.CMD_SHIFT_Z[HERE];\nexport const ALT_SHIFT_D = FORMS.ALT_SHIFT_D[HERE];\nexport const ALT_SHIFT_E = FORMS.ALT_SHIFT_E[HERE];\nexport const ALT_SHIFT_N = FORMS.ALT_SHIFT_N[HERE];\n\n/**\n * What each constant said on the server, keyed by what it says on this Mac.\n * Empty everywhere else, because a server and a non-Mac reader write every\n * constant the same way and there is nothing to translate.\n */\nconst AS_ON_SERVER: ReadonlyMap<string, string> = new Map(\n isMac ? Object.values(FORMS).map(([mac, other]) => [mac, other] as [string, string]) : [],\n);\n\n/**\n * A shortcut label as it can be shown NOW.\n *\n * The constants are fixed when the module loads, so on a server they are the\n * non-Mac forms and in a Mac reader's browser the \\u2318 forms — and a page\n * hydrating `Ctrl+S` into `\\u2318S` is a mismatch. While hydrating, this hands\n * back the form the server wrote; one render later, the reader's own. A root\n * that was never server-rendered gets the reader's form on its first render,\n * as it always did.\n *\n * Only the constants are recognised. A string written out by hand — `'\\u2318K'`\n * rather than `CMD_K` — cannot be told apart from the Mac constant, so on a\n * server-rendered page write shortcuts with the constants.\n */\nexport function useShortcutLabel(keys: string): string {\n const hydrated = useHydrated();\n return hydrated ? keys : (AS_ON_SERVER.get(keys) ?? keys);\n}\n\nexport type KbdSize = 'sm' | 'md';\n\nexport interface KbdProps {\n /**\n * The shortcut, already written \\u2014 one of the constants above, or any string\n * (`'Esc'`, `'\\u2190'`). This component does NOT assemble a shortcut from\n * modifier flags: which symbol a platform uses is what the constants are\n * for, and two answers to that question is one too many.\n */\n keys: string;\n /**\n * `sm` is the quiet badge that rides inside another control's label \\u2014 the\n * `\\u2325\\u21E7E` on an Edit button. `md` (the default) is the one beside a\n * primary action, where it has to be readable at a glance.\n */\n size?: KbdSize;\n /**\n * Layered on, not replacing: a consumer that themes the badge (the admin\n * portal tints the submit one with its accent) adds its own class here and\n * keeps the shape.\n */\n className?: string;\n}\n\nconst KBD_BASE =\n 'inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500';\n\n// A Record keyed by the union, so a new rung without an entry is a compile\n// error rather than an undefined class string.\nconst KBD_SIZES: Record<KbdSize, string> = {\n sm: 'px-1 py-0.5 text-[10px]',\n md: 'px-1.5 py-0.5 text-[11px]',\n};\n\n/**\n * The shortcut badge: a real `<kbd>`, which is what tells a screen reader that\n * `\\u2318\\u23CE` is a key combination and not two pieces of punctuation.\n *\n * It renders the shortcut and nothing else \\u2014 no `aria-label` naming it \"Command\n * Enter\", because the badge is almost always INSIDE the control it belongs to\n * (\"Save \\u2318\\u23CE\") and a second name there would be read as part of the\n * button's own.\n */\nexport function Kbd({ keys, size = 'md', className = '' }: KbdProps) {\n const label = useShortcutLabel(keys);\n return <kbd className={[KBD_BASE, KBD_SIZES[size], className].filter(Boolean).join(' ')}>{label}</kbd>;\n}\n","/**\n * Shell-side user-preferences surface — the package never owns where prefs\n * live. The consumer supplies a hook returning the current prefs object plus\n * a save callback; the shell reads keys it knows about (theme,\n * taskbar_position, taskbar_size, world_clocks, favorite_documents,\n * desktop_folders, desktop_snap, notepad_notes, …) and patches them.\n *\n * When no provider is mounted, the shell falls back to localStorage scoped\n * by `storageKey` — so the package works out of the box for a backend-less\n * consumer.\n */\nimport { createContext, useContext, useCallback, useMemo, type ReactNode } from 'react';\nimport { useBrowserState } from './hydration';\n\nexport interface ShellPrefsAdapter {\n /** The current prefs object. The shell reads its known keys directly off\n * this; consumer-private keys are ignored. */\n prefs: Record<string, any>;\n /** Patch a subset of prefs. The shell calls this with shallow diffs. */\n save: (patch: Record<string, any>) => Promise<void> | void;\n}\n\nconst ShellPrefsContext = createContext<ShellPrefsAdapter | null>(null);\n\nexport function ShellPrefsProvider({\n value,\n children,\n}: { value: ShellPrefsAdapter; children: ReactNode }) {\n return <ShellPrefsContext.Provider value={value}>{children}</ShellPrefsContext.Provider>;\n}\n\n/** Default localStorage-backed adapter — useful when the consumer doesn't\n * ship a backend. Pass the result into <ShellPrefsProvider value={…}>.\n *\n * `defaults` are merged behind whatever's already stored, so they only\n * apply for keys the user hasn't set yet. Useful for opting out of bundled\n * features (e.g. `{ restore_windows: false }`). Note this is the only way to\n * turn a default-ON feature off up front; a default-OFF one like\n * `show_desktop_version` is already off until someone ticks its box. */\nexport function useLocalStoragePrefs(\n storageKey = 'react-os-shell:prefs',\n defaults?: Record<string, any>,\n): ShellPrefsAdapter {\n // Stored prefs are the reader's, so a server renders the defaults and\n // hydration agrees with it; the stored ones land the moment hydration ends.\n // A save that arrives before that — a child's mount effect — is merged into\n // what is STORED, never into the defaults (see `useBrowserState`).\n const [prefs, setPrefs] = useBrowserState<Record<string, any>>(() => {\n try {\n const stored = JSON.parse(localStorage.getItem(storageKey) || '{}');\n return { ...(defaults ?? {}), ...stored };\n } catch { return { ...(defaults ?? {}) }; }\n }, { ...(defaults ?? {}) });\n const save = useCallback((patch: Record<string, any>) => {\n setPrefs(prev => {\n const next = { ...prev, ...patch };\n try { localStorage.setItem(storageKey, JSON.stringify(next)); } catch {}\n return next;\n });\n }, [storageKey]);\n return { prefs, save };\n}\n\n/** Stable no-provider adapter: reads as empty, drops saves. One instance, so\n * a component with no provider above it is not handed a new `save` (and a new\n * effect dependency) on every render. */\nconst NO_PROVIDER: ShellPrefsAdapter = { prefs: {}, save: () => {} };\n\n/** The adapter exactly as the consumer supplied it — its `save` MAY reject.\n *\n * A consumer whose adapter reports a failed write is how the shell knows a\n * write did not land, which is what lets `SessionWindowRestore` retry one\n * rather than record a lost write as saved. That component is the only caller\n * that wants this; everything else wants `useShellPrefs`. Exported from the\n * module for it and for the spec, not from the package index. */\nexport function useShellPrefsAdapter(): ShellPrefsAdapter {\n return useContext(ShellPrefsContext) ?? NO_PROVIDER;\n}\n\n/** Returns the active prefs adapter. When no provider is mounted, reads as\n * empty and silently drops saves — components still render, but persistence\n * is a no-op.\n *\n * `save` here NEVER REJECTS. Nearly every caller fires and forgets —\n * `save({ desktop_bg: bg })` inside an onChange, with the result discarded —\n * and an adapter that reports a failed write turns each of those into an\n * unhandled rejection, one per failed PATCH, across the shell and every\n * consumer. So the rejection is swallowed once here rather than at a dozen\n * call sites that would each have to remember. `await save(…)` still works;\n * it just resolves whether or not the write landed.\n *\n * A caller that must know reads `useShellPrefsAdapter` instead. */\nexport function useShellPrefs(): ShellPrefsAdapter {\n const { prefs, save: rawSave } = useShellPrefsAdapter();\n const save = useCallback((patch: Record<string, any>) => {\n const result = rawSave(patch);\n // Stay thenable for `await save(…)`, but settled either way. Duck-typed:\n // an adapter may hand back any thenable, not a native Promise.\n return result && typeof (result as Promise<void>).then === 'function'\n ? (result as Promise<void>).catch(() => {})\n : result;\n }, [rawSave]);\n return useMemo(() => ({ prefs, save }), [prefs, save]);\n}\n","/**\n * Stale-chunk recovery — reload once when a lazy chunk the running page asks\n * for is no longer on the server.\n *\n * A build names every lazy chunk by its content hash, and a deploy replaces\n * the whole set. A tab opened before the deploy still runs the old entry, and\n * the first lazy window it opens asks for a chunk the server no longer has.\n * The SPA fallback answers with `index.html`, which is not the script the\n * page asked for, and the import fails. Nothing inside the page can satisfy\n * that import — only a fresh document, which names the new chunks, can — so\n * an error boundary's \"try again\" remounts into the same failure, and the\n * only recovery that works is a reload.\n *\n * Two bundlers, two ways to hear it:\n *\n * - **Vite** dispatches `vite:preloadError` on `window` (cancelable;\n * `preventDefault()` swallows the throw), and the import rejects with\n * \"Failed to fetch dynamically imported module\".\n * - **Next.js (Turbopack) and webpack** load a chunk by appending a `<script>`\n * or a stylesheet `<link>`, and a failed one rejects the import with an\n * Error named `ChunkLoadError`. There is no bundler event, but one capture\n * listener on `window`, matching the build's chunk path (`/_next/static/`\n * by default), hears every chunk — the app's lazy pages, the shell's lazy\n * apps, CSS — in one of two ways:\n * - the element's own `error`: a 404, or `index.html` refused under\n * `X-Content-Type-Options: nosniff`. A resource error does not bubble,\n * but it does pass `window` in the capture phase.\n * - without `nosniff` the browser RUNS `index.html` as the script, and a\n * `SyntaxError` whose `filename` is the chunk reaches `window`. Nothing\n * else ever would: Turbopack's loader waits for the chunk to register\n * itself, so the import neither resolves nor rejects.\n *\n * Neither proves a deploy. A dropped connection fails the element too, and\n * Turbopack retries a failed chunk once before it gives up. So before\n * reloading, a `HEAD` request (`no-store`) asks the server whether the file\n * is gone: a 404 or 410, or HTML where a chunk should be (the SPA\n * fallback). A chunk that is still there, a 5xx, or no answer at all\n * (offline) is left to the loader's retry and the crash fallback — a reload\n * would throw the page away for nothing, or land on the browser's offline\n * page.\n *\n * `installStaleChunkReload` listens for both and reloads the page — once per\n * cooldown, remembered in `sessionStorage` under one key whichever signal\n * fired, so a chunk that is STILL missing after the reload (a broken deploy)\n * surfaces as the crash it is rather than as a reload loop that eats the\n * user's open windows.\n *\n * Kit-safe: imports nothing. Call it once, before the app mounts.\n */\n\n/** sessionStorage key holding the epoch-ms of the last reload this made. */\nexport const STALE_CHUNK_RELOAD_KEY = 'react-os-shell:stale-chunk-reload-at';\n\n/**\n * How soon after a reload a second missing chunk is allowed to crash instead\n * of reloading again. A reload plus the shell restoring its windows takes a\n * few seconds; anything under this is the same failure, not a new deploy.\n */\nexport const STALE_CHUNK_RELOAD_COOLDOWN_MS = 30_000;\n\n/** The event name Vite's preload helper dispatches. */\nexport const VITE_PRELOAD_ERROR_EVENT = 'vite:preloadError';\n\n/** Where Next.js serves a build's hashed chunks, under Turbopack or webpack. */\nexport const NEXT_CHUNK_PATH_PREFIX = '/_next/static/';\n\nexport interface StaleChunkReloadOptions {\n /** Defaults to {@link STALE_CHUNK_RELOAD_COOLDOWN_MS}. */\n cooldownMs?: number;\n /** Replaced in tests; the default is `window.location.reload()`. */\n reload?: () => void;\n /**\n * Where the last-reload timestamp is kept. Defaults to `sessionStorage`\n * (guarded — a browser that throws on access, such as a private window\n * with storage disabled, degrades to \"always reload\"). `null` disables the\n * cooldown outright.\n */\n storage?: Pick<Storage, 'getItem' | 'setItem'> | null;\n /** Clock, for tests. */\n now?: () => number;\n /**\n * Where the build serves its chunks: a `<script>` or stylesheet `<link>`\n * under it that fails to load — and that the server confirms is gone —\n * reloads the page. A path, resolved from this page's origin, or a full URL\n * for chunks on another host (Next's `assetPrefix` on a CDN, which must then\n * allow the cross-origin `HEAD` that confirms it). End it with `/`: it is a\n * plain prefix match. Defaults to {@link NEXT_CHUNK_PATH_PREFIX}; a\n * `basePath` app passes `'/<basePath>/_next/static/'`, a webpack app its\n * `output.publicPath`. `null` listens for Vite's event only.\n *\n * Never point it at Vite's `/assets/`: Vite's own event already covers\n * those chunks, and hearing the same failure twice would spend the\n * cooldown on the first and let Vite throw on the second.\n */\n chunkPathPrefix?: string | null;\n}\n\n/**\n * The messages the three engines produce for a dynamic `import()` whose\n * module the server did not return, plus Vite's own line for a CSS chunk it\n * could not preload. Used by the shell's crash fallback to offer \"Reload\n * page\" instead of a remount that cannot succeed.\n */\nconst STALE_CHUNK_MESSAGE =\n /Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;\n\n/**\n * The name Turbopack and webpack give the Error a failed chunk rejects with\n * (\"Failed to load chunk /_next/static/chunks/… from module …\", \"Loading\n * chunk 42 failed.\").\n */\nconst CHUNK_LOAD_ERROR_NAME = 'ChunkLoadError';\n\n/** True when `error` is a lazy chunk the server no longer serves. */\nexport function isStaleChunkError(error: unknown): boolean {\n if (error instanceof Error && error.name === CHUNK_LOAD_ERROR_NAME) return true;\n const message =\n error instanceof Error ? error.message : typeof error === 'string' ? error : '';\n return STALE_CHUNK_MESSAGE.test(message);\n}\n\n/**\n * Whether a failed `<link>` was loading code or styles the page needs now: a\n * stylesheet, a module preload, or a preload of a script or a style. A\n * prefetch is speculative — for a page the user may never open — and a font,\n * an image or an icon is not a chunk; reloading for any of those would throw\n * away what the user is doing for nothing. `rel` is matched without regard\n * to case, as the browser matches it.\n */\nfunction linkLoadsChunk(link: HTMLLinkElement): boolean {\n const rels = link.rel.toLowerCase().split(/\\s+/);\n if (rels.includes('stylesheet') || rels.includes('modulepreload')) return true;\n const as = (link.getAttribute('as') ?? '').toLowerCase();\n return rels.includes('preload') && (as === 'script' || as === 'style');\n}\n\n/**\n * The address of the chunk an `error` on `window` is about, when it is one of\n * the build's chunks under `prefix`: a failed `<script>` or chunk `<link>`,\n * or a `SyntaxError` thrown by running a chunk that came back as HTML. Null\n * for anything else — an image, a third party, a runtime error in the app.\n * The constructors are read off `window`, so a document without them as bare\n * globals (a test DOM) or an element from another frame cannot throw here.\n */\nfunction failedChunkUrl(event: Event, prefix: string): string | null {\n const target = event.target;\n let src = '';\n if (target instanceof window.HTMLScriptElement) src = target.src;\n else if (target instanceof window.HTMLLinkElement && linkLoadsChunk(target)) src = target.href;\n else if (event instanceof window.ErrorEvent && (event.error as { name?: unknown } | null)?.name === 'SyntaxError') {\n src = event.filename;\n }\n if (!src) return null;\n try {\n // A path prefix lands on this origin, from its root; a full-URL prefix\n // stays where it points. Then one comparison serves both.\n const base = new URL(prefix, window.location.origin).href;\n const url = new URL(src, window.location.href).href;\n return url.startsWith(base) ? url : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Whether the server no longer has `url`: a 404 or 410, or the SPA fallback's\n * HTML where a chunk should be. Anything else — the file is there, a 5xx, no\n * answer at all — means the load failed for a reason a reload would not fix.\n * `no-store`, so a cached copy cannot answer for the server.\n */\nasync function isGoneFromServer(url: string): Promise<boolean> {\n try {\n const response = await fetch(url, { method: 'HEAD', cache: 'no-store' });\n if (response.status === 404 || response.status === 410) return true;\n return response.ok && /\\btext\\/html\\b/i.test(response.headers.get('content-type') ?? '');\n } catch {\n return false;\n }\n}\n\nfunction defaultStorage(): Pick<Storage, 'getItem' | 'setItem'> | null {\n try {\n const s = window.sessionStorage;\n // Touch it: some browsers expose the object and throw on first use.\n s.getItem(STALE_CHUNK_RELOAD_KEY);\n return s;\n } catch {\n return null;\n }\n}\n\nfunction readLastReload(storage: Pick<Storage, 'getItem' | 'setItem'> | null): number | null {\n if (!storage) return null;\n try {\n const raw = storage.getItem(STALE_CHUNK_RELOAD_KEY);\n const at = raw === null ? NaN : Number(raw);\n return Number.isFinite(at) ? at : null;\n } catch {\n return null;\n }\n}\n\nfunction writeLastReload(storage: Pick<Storage, 'getItem' | 'setItem'> | null, at: number): void {\n if (!storage) return;\n try {\n storage.setItem(STALE_CHUNK_RELOAD_KEY, String(at));\n } catch {\n /* storage full or disabled — the reload still happens, just without the cooldown */\n }\n}\n\n/**\n * Reload the page the first time a lazy chunk fails to load, and let the\n * failure through on a repeat within the cooldown.\n *\n * Returns the uninstaller. Server-side (no `window`) it installs nothing.\n */\nexport function installStaleChunkReload(options: StaleChunkReloadOptions = {}): () => void {\n if (typeof window === 'undefined') return () => {};\n\n const cooldownMs = options.cooldownMs ?? STALE_CHUNK_RELOAD_COOLDOWN_MS;\n const reload = options.reload ?? (() => window.location.reload());\n const now = options.now ?? Date.now;\n const storage = options.storage === undefined ? defaultStorage() : options.storage;\n const chunkPathPrefix =\n options.chunkPathPrefix === undefined ? NEXT_CHUNK_PATH_PREFIX : options.chunkPathPrefix;\n\n /**\n * Whether to reload for this missing chunk — false inside the cooldown.\n * Claims the cooldown when it says yes. Both listeners ask here, so they\n * share one record.\n */\n const claimReload = (chunk: unknown): boolean => {\n const at = now();\n const last = readLastReload(storage);\n if (last !== null && at - last < cooldownMs) {\n // Reloaded moments ago and the chunk is still gone: this is not a\n // deploy the page missed, it is a server that cannot serve the build.\n // Let the import fail, so the boundary shows what is wrong.\n console.error(\n '[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:',\n chunk,\n );\n return false;\n }\n writeLastReload(storage, at);\n console.warn(\n '[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:',\n chunk,\n );\n return true;\n };\n\n const onPreloadError = (event: Event) => {\n const payload = (event as Event & { payload?: unknown }).payload;\n // Vite dispatches this for ANY rejected dynamic import it wraps, not only\n // a missing chunk — an optional peer probed by its bare package name\n // rejects the same way, and its caller already catches that.\n // Reloading on that threw the whole portal away on every DXF preview.\n if (!isStaleChunkError(payload) || !claimReload(payload)) return;\n event.preventDefault();\n reload();\n };\n\n // The chunk listener asks the server before it reloads, so its decision is\n // async. One question per chunk at a time (Turbopack's retry fails the same\n // file again while the first is out), none once a reload has started (the\n // page is going), and none acted on after uninstall.\n let active = true;\n let reloading = false;\n const asking = new Set<string>();\n\n // Capture phase: a resource error does not bubble.\n const onChunkError = chunkPathPrefix === null ? null : (event: Event) => {\n const chunk = failedChunkUrl(event, chunkPathPrefix);\n if (!chunk || reloading || asking.has(chunk)) return;\n asking.add(chunk);\n void isGoneFromServer(chunk).then((gone) => {\n asking.delete(chunk);\n if (!gone || !active || reloading || !claimReload(chunk)) return;\n reloading = true;\n reload();\n });\n };\n\n window.addEventListener(VITE_PRELOAD_ERROR_EVENT, onPreloadError);\n if (onChunkError) window.addEventListener('error', onChunkError, true);\n return () => {\n active = false;\n window.removeEventListener(VITE_PRELOAD_ERROR_EVENT, onPreloadError);\n if (onChunkError) window.removeEventListener('error', onChunkError, true);\n };\n}\n"]}